[swarming] Update device alias for Android Pixel Tablet "tangorpro"

Bug: 345043297
Change-Id: Id19dc87043fc5db37424615c1c52aaf06fa0ee1c
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-py/+/5618430
Commit-Queue: Haiyang Pan <hypan@google.com>
Reviewed-by: Renuga Nanjappan <rnanjappan@chromium.org>
Auto-Submit: Haiyang Pan <hypan@google.com>
diff --git a/appengine/swarming/ui2/dist/public_bot_index-bundle.js b/appengine/swarming/ui2/dist/public_bot_index-bundle.js
index 2854f01..6d526aa 100644
--- a/appengine/swarming/ui2/dist/public_bot_index-bundle.js
+++ b/appengine/swarming/ui2/dist/public_bot_index-bundle.js
@@ -1 +1 @@
-(()=>{"use strict";var t={445:function(t,e){var s=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(n,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const t in e.RpcCode)i[e.RpcCode[t]]=t;function n(t){return i[t]}e.rpcCodeToCodeName=n,e.PrpcClient=class{constructor(t=null){t=t||{},this.host=t.host||document.location.host,this.accessToken=t.accessToken||null,this.insecure=t.hasOwnProperty("insecure")&&Boolean(t.insecure),this.fetchImpl=t.fetchImpl||window.fetch.bind(window)}call(t,i,n,a){return s(this,void 0,void 0,(function*(){if(!t)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!n)throw new TypeError("missing required argument: message");if(!(n instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const s=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${t}/${i}`,l=this._requestOptions(n,a),d=yield this.fetchImpl(s,l);if(!d.headers.has("X-Prpc-Grpc-Code"))throw new r(d.status,"Invalid response: no X-Prpc-Grpc-Code response header");const h=Number.parseInt(d.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(h))throw new r(d.status,"Invalid X-Prpc-Grpc-Code response header");const c=yield d.text();if(h!==e.RpcCode.OK)throw new o(h,c);if(!c.startsWith(")]}'"))throw new r(d.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(c.substr(4))}))}_requestOptions(t,e){const s={accept:"application/json","content-type":"application/json"};return e&&Object.assign(s,e),this.accessToken&&(s.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:s,body:JSON.stringify(t)}}};class o extends Error{constructor(t,e){if(super(),this.code=t,this.description=e,null===t)throw new Error("missing required argument: code");this.codeName=n(t)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}e.GrpcError=o;class r extends Error{constructor(t,e){if(super(),this.httpStatus=t,this.description=e,null===t)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}e.ProtocolError=r}},e={};function s(i){var n=e[i];if(void 0!==n)return n.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,s),o.exports}(()=>{const t=new Promise((function(t,e){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)})),e=(t,e=document)=>e.querySelector(t);function i(t,e=1e4){"object"==typeof t&&(t=t.message||JSON.stringify(t));var s={message:t,duration:e};document.dispatchEvent(new CustomEvent("error-sk",{detail:s,bubbles:!0}))}const n=new WeakMap,o=t=>"function"==typeof t&&n.has(t),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,a=(t,e,s=null)=>{let i=e;for(;i!==s;){const e=i.nextSibling;t.removeChild(i),i=e}},l={},d={},h=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${h}--\x3e`,u=new RegExp(`${h}|${c}`),p="$lit$";class _{constructor(t,e){this.parts=[],this.element=e;let s=-1,i=0;const n=[],o=e=>{const r=e.content,a=document.createTreeWalker(r,133,null,!1);let l=0;for(;a.nextNode();){s++;const e=a.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const n=e.attributes;let o=0;for(let t=0;t<n.length;t++)n[t].value.indexOf(h)>=0&&o++;for(;o-- >0;){const n=t.strings[i],o=v.exec(n)[2],r=o.toLowerCase()+p,a=e.getAttribute(r).split(u);this.parts.push({type:"attribute",index:s,name:o,strings:a}),e.removeAttribute(r),i+=a.length-1}}"TEMPLATE"===e.tagName&&o(e)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(h)>=0){const o=e.parentNode,r=t.split(u),a=r.length-1;for(let t=0;t<a;t++)o.insertBefore(""===r[t]?g():document.createTextNode(r[t]),e),this.parts.push({type:"node",index:++s});""===r[a]?(o.insertBefore(g(),e),n.push(e)):e.data=r[a],i+=a}}else if(8===e.nodeType)if(e.data===h){const t=e.parentNode;null!==e.previousSibling&&s!==l||(s++,t.insertBefore(g(),e)),l=s,this.parts.push({type:"node",index:s}),null===e.nextSibling?e.data="":(n.push(e),s--),i++}else{let t=-1;for(;-1!==(t=e.data.indexOf(h,t+1));)this.parts.push({type:"node",index:-1})}}};o(e);for(const t of n)t.parentNode.removeChild(t)}}const m=t=>-1!==t.index,g=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class f{constructor(t,e,s){this._parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this._parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=r?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let s=0,i=0;const n=t=>{const o=document.createTreeWalker(t,133,null,!1);let r=o.nextNode();for(;s<e.length&&null!==r;){const t=e[s];if(m(t))if(i===t.index){if("node"===t.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(r.previousSibling),this._parts.push(t)}else this._parts.push(...this.processor.handleAttributeExpressions(r,t.name,t.strings,this.options));s++}else i++,"TEMPLATE"===r.nodeName&&n(r.content),r=o.nextNode();else this._parts.push(void 0),s++}};return n(t),r&&(document.adoptNode(t),customElements.upgrade(t)),t}}class b{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="";for(let s=0;s<t;s++){const t=this.strings[s],i=v.exec(t);e+=i?t.substr(0,i.index)+i[1]+i[2]+p+i[3]+h:t+c}return e+this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const w=t=>null===t||!("object"==typeof t||"function"==typeof t);class k{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new y(this)}_getValue(){const t=this.strings,e=t.length-1;let s="";for(let i=0;i<e;i++){s+=t[i];const e=this.parts[i];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)s+="string"==typeof e?e:String(e);else s+="string"==typeof t?t:String(t)}}return s+t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class y{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===l||w(t)&&t===this.value||(this.value=t,o(t)||(this.committer.dirty=!0))}commit(){for(;o(this.value);){const t=this.value;this.value=l,t(this)}this.value!==l&&this.committer.commit()}}class E{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(g()),this.endNode=t.appendChild(g())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=g()),t._insert(this.endNode=g())}insertAfterPart(t){t._insert(this.startNode=g()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}const t=this._pendingValue;t!==l&&(w(t)?t!==this.value&&this._commitText(t):t instanceof b?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):t===d?(this.value=d,this.clear()):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof f&&this.value.template===e)this.value.update(t.values);else{const s=new f(e,t.processor,this.options),i=s._clone();s.update(t.values),this._commitNode(i),this.value=s}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,i=0;for(const n of t)void 0===(s=e[i])&&(s=new E(this.options),e.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(e[i-1])),s.setValue(n),s.commit(),i++;i<e.length&&(e.length=i,this.clear(s&&s.endNode))}clear(t=this.startNode){a(this.startNode.parentNode,t.nextSibling,this.endNode)}}class T{constructor(t,e,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=l}}class I extends k{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new x(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class x extends y{}let A=!1;try{const t={get capture(){return A=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class ${constructor(t,e,s){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this._boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=this._pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=C(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=l}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const C=t=>t&&(A?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),S=new class{handleAttributeExpressions(t,e,s,i){const n=e[0];return"."===n?new I(t,e.slice(1),s).parts:"@"===n?[new $(t,e.slice(1),i.eventContext)]:"?"===n?[new T(t,e.slice(1),s)]:new k(t,e,s).parts}handleTextExpression(t){return new E(t)}};function N(t){let e=D.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},D.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(h);return void 0===(s=e.keyString.get(i))&&(s=new _(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const D=new Map,L=new WeakMap,H=(t,e,s)=>{let i=L.get(e);void 0===i&&(a(e,e.firstChild),L.set(e,i=new E(Object.assign({templateFactory:N},s))),i.appendInto(e)),i.setValue(t),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const P=(t,...e)=>new b(t,e,"html",S),M=(B=t=>e=>{if(void 0===t&&e instanceof y){if(t!==e.value){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else e.setValue(t)},(...t)=>{const e=B(...t);return n.set(e,!0),e});var B;function G(t){var e=[];return Object.keys(t).sort().forEach((function(s){Array.isArray(t[s])?t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))})):"object"==typeof t[s]?e.push(encodeURIComponent(s)+"="+encodeURIComponent(G(t[s]))):e.push(encodeURIComponent(s)+"="+encodeURIComponent(t[s]))})),e.join("&")}function V(t,e){e=e||{};for(var s={},i=t.split("&"),n=0;n<i.length;n++){var o=i[n].split("=",2);if(2==o.length){var r=decodeURIComponent(o[0]),a=decodeURIComponent(o[1]);if(e.hasOwnProperty(r))switch(typeof e[r]){case"boolean":s[r]="true"==a;break;case"number":s[r]=Number(a);break;case"object":if(Array.isArray(e[r])){var l=s[r]||[];l.push(a),s[r]=l}else s[r]=V(a,e[r]);break;default:s[r]=a}else s[r]=a}}return s}const O=t=>JSON.parse(JSON.stringify(t));function R(e,s){let i=O(e()),n=!1;const o=()=>{n=!0;let t=V(window.location.search.slice(1),i);s(function(t,e){let s={};return Object.keys(e).forEach((function(i){t.hasOwnProperty(i)?s[i]=O(t[i]):s[i]=O(e[i])})),s}(t,i))};return t.then(o),window.addEventListener("popstate",o),()=>{if(!n)return;let t=G(function(t,e){let s={};return Object.keys(t).forEach((function(i){(function(t,e){if(typeof t!=typeof e)return!1;let s=typeof t;return"string"===s||"boolean"===s||"number"===s?t===e:"object"===s?Array.isArray(s)?JSON.stringify(t)===JSON.stringify(e):G(t)===G(e):void 0})(t[i],e[i])||(s[i]=t[i])})),s}(e(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+t)}}function W(t,e){if(t.hasOwnProperty(e)){let s=t[e];delete t[e],t[e]=s}}class z extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),W(this,"checked"),W(this,"disabled"),W(this,"name"),W(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(t){let e=!!t;this._input.checked=e,t?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){let e=!!t;this._input.disabled=e,e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(t){this.setAttribute("name",t),this._input.setAttribute("name",t)}get label(){return this._input.getAttribute("label")}set label(t){this.setAttribute("label",t),this._input.setAttribute("label",t)}attributeChangedCallback(t,e,s){if(!this._input)return;let i=null!=s;switch(t){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=s;break;case"label":this._label.textContent=s}}}window.customElements.define("checkbox-sk",z);const U=document.createElement("template");U.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("add-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=U.content.cloneNode(!0);this.appendChild(t)}});const F=document.createElement("template");F.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("remove-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=F.content.cloneNode(!0);this.appendChild(t)}});const q=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}];function K(t){if(t<0&&(t=-t),0===t)return"  0s";let e="";for(let s=0;s<q.length;s++)if(q[s].delta<=t){let i=Math.floor(t/q[s].delta)+q[s].units;for(;i.length<4;)i=" "+i;e+=i,t%=q[s].delta}return e}function j(t=[],e=[]){const s=[];for(const e of t)if(e.key&&e.value)if(Array.isArray(e.value))for(const t of e.value)s.push(e.key+":"+t);else s.push(e.key+":"+e.value);else s.push(e);return"/botlist?"+function(t){if(!t)return"";var e=[];return Object.keys(t).sort().forEach((function(s){t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))}))})),e.join("&")}({f:s,c:e})}function X(t){if(0===t||"0"===t)return"0s";if(!t)return"--";const e=parseFloat(t);return e?e>60?K(e):e.toFixed(2)+"s":t+" seconds"}function J(t,e,s=!0){W(t,e),void 0===t[e]&&t.hasAttribute(e)&&(t[e]=t.getAttribute(e),s&&t.removeAttribute(e))}function Y(t,e){if(t)return e||(t=t.substring(0,t.length-1)+"0"),`/task?id=${t}`}function Q(t){return t?function(t){let e=(("number"==typeof t?t:Date.parse(t))-Date.now())/1e3;return e<0&&(e*=-1),function(t,e){for(let s=0;s<e.length-1;s++)if(Math.round(t/e[s+1].delta)*e[s+1].delta/e[s].delta>=1)return Math.round(t/e[s].delta)+e[s].units;let s=e.length-1;return Math.round(t/e[s].delta)+e[s].units}(e,q)}(t.getTime())||"0s":"eons"}function Z(t,e){return t?(e||(e=new Date),K((e.getTime()-t.getTime())/1e3)||"0s"):"eons"}class tt{constructor(t){this._time=new Proxy(t,{get(t,e,s){let i=Reflect.get(t,e,s);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const n=i.toString(),o=n.substring(n.indexOf("("));return`${i.toLocaleString()} ${o}`}})}get time(){return this._time}}function et(t,e){if(void 0!==t){for(const s of e){const e=t[s];"string"==typeof e&&(t[s]=new Date(e))}t.humanized=new tt(t)}}function st(t){if(void 0!==t)return t.humanized=new tt(t),t}const it=document.createElement("template");it.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>',window.customElements.define("arrow-drop-down-icon-sk",class extends HTMLElement{connectedCallback(){let t=it.content.cloneNode(!0);this.appendChild(t)}});const nt=document.createElement("template");nt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 14l5-5 5 5z"/></svg>',window.customElements.define("arrow-drop-up-icon-sk",class extends HTMLElement{connectedCallback(){let t=nt.content.cloneNode(!0);this.appendChild(t)}}),window.customElements.define("sort-toggle",class extends HTMLElement{constructor(){super()}connectedCallback(){J(this,"currentKey"),J(this,"key"),J(this,"direction"),this.addEventListener("click",(()=>{this.toggle()})),this.render()}get currentKey(){return this._currentKey}set currentKey(t){this._currentKey=t,this.render()}get key(){return this._key}set key(t){this._key=t,this.render()}get direction(){return this._direction}set direction(t){this._direction=t,this.render()}toggle(){this.currentKey===this.key&&"asc"===this.direction?this.direction="desc":this.direction="asc",this.dispatchEvent(new CustomEvent("sort-change",{detail:{direction:this.direction,key:this.key},bubbles:!0}))}render(){var t;H(P` <arrow-drop-down-icon-sk ?hidden=${(t=this).key===t.currentKey&&"asc"===t.direction} > </arrow-drop-down-icon-sk> <arrow-drop-up-icon-sk ?hidden=${t.key===t.currentKey&&"desc"===t.direction} > </arrow-drop-up-icon-sk>`,this,{eventContext:this})}});function ot(t){return(t=(t=function(t){return t.replace(" (with patch)","")}(t=t.trim())).replace(/ \(retry\)/g,"")).replace(/ \(debug\)/g,"")}window.customElements.define("bot-page-summary",class extends HTMLElement{constructor(){super(),this._sort="total",this._dir="desc",this._summarized=[],this._totalStats={},this._showAllTasks=!1,this._fullNames=!1}connectedCallback(){J(this,"tasks"),this._sortEvent=t=>{this._sort=t.detail.key,this._dir=t.detail.direction,this.render()},this.addEventListener("sort-change",this._sortEvent)}disconnectedCallback(){this.removeEventListener("sort-change",this._sortEvent)}get tasks(){return this._tasks||[]}set tasks(t){this._tasks=t,this.render()}_aggregate(){const t={total:0,success:0,failed:0,bot_died:0,avg_duration:0,avg_overhead:0,total_overhead:0,total_time:0};if(!this.tasks||!this.tasks.length)return this._totalStats=t,void(this._summarized=[]);const e=new Date,s={};t.wall_time=(e-this.tasks[this.tasks.length-1].startedTs)/1e3;for(const e of this.tasks){const i=ot(e.name);if("RUNNING"===e.state)continue;s[i]||(s[i]={full_name:i,total:0,success:0,failed:0,bot_died:0,avg_duration:0,total_time:0,total_overhead:0}),t.total++,s[i].total++,e.failure?(t.failed++,s[i].failed++):e.internal_failure&&(t.bot_died++,s[i].bot_died++);const n=e.totalDuration||e.duration||0;t.total_time+=n,s[i].total_time+=n,t.total_overhead+=e.total_overhead||0,s[i].total_overhead+=e.total_overhead||0}const i=[];for(const e in s)if(s.hasOwnProperty(e)){const n=s[e];n.avg_duration=n.total_time/n.total,n.avg_overhead=n.total_overhead/n.total,n.total_time_percent=(100*n.total_time/t.total_time).toFixed(1),i.push(n)}t.avg_duration=t.total_time/t.total,t.avg_overhead=t.total_overhead/t.total,t.wall_time_utilization=(100*t.total_time/t.wall_time).toFixed(1),this._totalStats=t,this._summarized=i}render(){var t;this._aggregate(),H(P` <table> <thead> <tr> <th> <span>Name</span> <sort-toggle key="full_name" .currentKey=${(t=this)._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Total</span> <sort-toggle key="total" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Success</span> <sort-toggle key="success" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Failed</span> <sort-toggle key="failed" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Died</span> <sort-toggle key="bot_died" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Average Duration</span> <sort-toggle key="avg_duration" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Average Overhead</span> <sort-toggle key="avg_overhead" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th>Percent of Total</th> </tr> </thead> <tbody> ${t._sortAndLimitTasks().map((e=>((t,e)=>P` <tr> <td title=${t.full_name} class="break-all"> ${e._shortenName(t.full_name)} </td> <td>${t.total}</td> <td>${t.success}</td> <td>${t.failed}</td> <td>${t.bot_died}</td> <td>${X(t.avg_duration)}</td> <td>${X(t.avg_overhead)}</td> <td>${t.total_time_percent}%</td> </tr> `)(e,t)))} <tr class="thick"> <td>Total</td> <td>${t._totalStats.total}</td> <td>${t._totalStats.success}</td> <td>${t._totalStats.failed}</td> <td>${t._totalStats.bot_died}</td> <td>${X(t._totalStats.avg_duration)}</td> <td>${X(t._totalStats.avg_overhead)}</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>${X(t._totalStats.wall_time)}</td> <td>${t._totalStats.wall_time_utilization}%</td> </tr> </tbody> </table> <div class="controls"> <checkbox-sk ?checked=${t._fullNames} @click=${t._toggleName}> </checkbox-sk> <span>Show Full Names</span> <checkbox-sk ?hidden=${t._summarized.length<=15} ?checked=${t._showAllTasks} @click=${t._toggleShow} > </checkbox-sk> <span ?hidden=${t._summarized.length<=15} >Show All Tasks</span > </div> </div> `,this,{eventContext:this})}_sortAndLimitTasks(){return this._summarized.sort(((t,e)=>{if(!this._sort)return 0;let s=1;return"desc"===this._dir&&(s=-1),"full_name"===this._sort?s*t.full_name.localeCompare(e.full_name):s*(t[this._sort]-e[this._sort])})),this._showAllTasks?this._summarized:this._summarized.slice(0,Math.min(this._summarized.length,15))}_shortenName(t){return t.length>50&&!this._fullNames?t.slice(0,47)+"...":t}_toggleName(t){t.preventDefault(),this._fullNames=!this._fullNames,this.render()}_toggleShow(t){t.preventDefault(),this._showAllTasks=!this._showAllTasks,this.render()}});const rt=document.createElement("template");rt.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const t=rt.content.cloneNode(!0);if(this.appendChild(t),this._backdrop=e(".backdrop",this),this._content=e(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const t=window.innerWidth,e=window.innerHeight,s=Math.min(this._content.offsetWidth,t-50),i=Math.min(this._content.offsetHeight,e-50);this._content.style.width=s,this._content.style.left=(t-s)/2,this._content.style.top=(e-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),W(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(t){this.setAttribute("duration",t)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(t){t.detail.duration&&(this._toast.duration=t.detail.duration),this._toast.textContent=t.detail.message,this._toast.show()}});const at=document.createElement("template");at.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let t=at.content.cloneNode(!0);this.appendChild(t)}});const lt=document.createElement("template");function dt(t){if(t.ok)return t.json();throw{message:`Bad network response: ${t.statusText}`,resp:t,status:t.status}}lt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let t=lt.content.cloneNode(!0);this.appendChild(t)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){W(this,"active")}get active(){return this.hasAttribute("active")}set active(t){t?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){W(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((t=>{"anonymous:anonymous"!=t.identity&&(this._fireLoginEvent(t),this.render())}),(t=>{console.error(t),i(`Error getting auth state: ${JSON.stringify(t)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(t){this._profile={email:t.email,imageURL:t.picture},this._auth_header=`Bearer ${t.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(t){const e=window.location.pathname+window.location.search;window.location=e&&"/"!=e?`/auth/openid/${t}?r=${encodeURIComponent(e)}`:`/auth/openid/${t}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(dt)}render(){H((t=>t.authHeader?P` <div> <img class="center" id="avatar" src="${t._profile.imageURL}" width="30" height="30" /> <span class="center">${t._profile.email}</span> <span class="center">|</span> <a class="center" @click=${t._logOut} href="#">Sign out</a> </div>`:P` <div> <a @click=${t._logIn} href="#">Sign in</a> </div>`)(this),this,{eventContext:this})}attributeChangedCallback(t,e,s){this.render()}});var ht=s(445);class ct{constructor(t,e=null,s={}){const i={...s,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=t,e){const t=(t,s)=>(s.signal=e,fetch(t,s));i.fetchImpl=t}this._client=new ht.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(t,e){const s={authorization:this._token};return this._client.call(this.service,t,e,s)}}class ut extends ct{get service(){return"swarming.v2.Swarming"}permissions(t){return this._call("GetPermissions",t)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const pt=document.createElement("template");pt.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const _t=document.createElement("template");_t.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const mt="You must log in to see more details",gt=document.createElement("template");function vt(t,e){if(!ft[e]||"none"===t||!t)return t;let s=ft[e][t];if("gpu"===e){const i=t.split("-")[0];s=ft[e][i]}else if("os"===e&&t.startsWith("Windows")){const i=t.split(".")[0];s=ft[e][i]}return s?`${s} (${t})`:t}gt.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:mt,botVersion:"",casViewerServer:""};const t=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,t),this._permissions={}}connectedCallback(){W(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(t=>{this._auth_header=t.detail.authHeader,this._profile=t.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(t){this._busyTaskCount+=t,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const t=this.querySelector("header"),e=t&&t.querySelector("aside"),s=this.querySelector("footer");if(!(t&&e&&e.classList.contains("hideable")))return;let i=pt.content.cloneNode(!0);t.insertBefore(i,t.firstElementChild),(i=t.firstElementChild).addEventListener("click",(t=>this._toggleMenu(t,e)));const n=_t.content.cloneNode(!0);t.insertBefore(n,e),this._spinner=t.querySelector("spinner-sk");const o=document.createElement("span");o.classList.add("grow"),t.appendChild(o),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),t.appendChild(this._dynamicEle);const r=document.createElement("error-toast-sk");s.append(r);const a=gt.content.cloneNode(!0);s.append(a)}_toggleMenu(t,e){e.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const t={authHeader:this._auth_header};this.addBusyTasks(1),new ut(t.authHeader).details().then((t=>{this._serverDetails=t,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{"PERMISSION_DENIED"===t.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(t),i(`Unexpected error loading details: ${t.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(t)}_fetchPermissions(t,e){return this.addBusyTasks(1),new ut(t.authHeader,t.signal).permissions(e||{}).then((t=>{this._permissions=t,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{403!==t.status&&(console.error(t),i(`Unexpected error loading permissions: ${t.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&H((t=>P` <div class="server-version"> AppEngine version: ${function(t,e){return e&&e.serverVersion?P`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(t,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",e.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${e.serverVersion}</a >`:mt}(t._projectId,t._serverDetails)} Git version:${function(t){if(!t||!t.serverVersion)return"";const e=t.serverVersion.split("-");if(e.length>=3)return console.error(`Invalid Git version. version=${t.serverVersion}`),"";const s=2==e.length?e[1]:e[0];return P`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${s}>${s}</a>`}(t._serverDetails)} </div> <oauth-login ?testing_offline=${t.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(t,e,s){this.render()}});const ft={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}};function bt(t){if(!t)return[];for(const e of t)et(e,["ts"]),e.state=e.state?JSON.parse(e.state):{};return t.sort(((t,e)=>e.ts-t.ts)),t}const wt=(t,e,s)=>{for(const s of e)if(t[s])return t[s];return s},kt=t=>wt(t,["startedTs"]),yt=t=>wt(t,["completedTs","abandonedTs","modifiedTs"],new Date);function Et(t){if(!t)return[];for(const e of t){if(et(e,xt),e.duration)e.humanDuration=X(e.duration);else{const t=yt(e);e.humanDuration=Z(e.startedTs,t),e.duration=(t.getTime()-e.startedTs)/1e3}const t=e.performanceStats&&e.performanceStats.botOverhead||0;e.totalDuration=e.duration+t,e.humanTotalDuration=X(e.totalDuration),e.total_overhead=t,e.humanState=e.state||"UNKNOWN","COMPLETED"===e.state&&(e.failure?e.humanState="FAILURE":"RUNNING"!==e.state&&(e.humanState="SUCCESS"))}return t.sort(((t,e)=>kt(e)-kt(t))),t}const Tt=["id","caches","server_version"],It=["firstSeenTs","lastSeenTs","leaseExpirationTs"],xt=["startedTs","completedTs","abandonedTs","modifiedTs"],At=new Set(["PENDING","RUNNING"]),$t=new Set(["TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED"]);class Ct extends ct{get service(){return"swarming.v2.Tasks"}cancel(t,e){return this._call("CancelTask",{taskId:t,killRunning:e})}stdout(t,e,s){return this._call("GetStdout",{taskId:t,offset:e,length:s})}request(t){return this._call("GetRequest",{taskId:t})}result(t,e){return this._call("GetResult",{taskId:t,includePerformanceStats:e})}new(t){return this._call("NewTask",t)}count(t){return this._call("CountTasks",t)}list(t){return t.state||(t={...t,state:"QUERY_ALL"}),this._call("ListTasks",t)}massCancel(t){return this._call("CancelTasks",t)}}class St extends ct{get service(){return"swarming.v2.Bots"}bot(t){return this._call("GetBot",{botId:t})}tasks(t,e){const s={sort:4,state:10,botId:t,cursor:e,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",s)}terminate(t,e){const s={botId:t,reason:e};return this._call("TerminateBot",s)}events(t,e){const s={limit:50,botId:t,cursor:e};return this._call("ListBotEvents",s)}delete(t){return this._call("DeleteBot",{botId:t})}count(t){return this._call("CountBots",{dimensions:t})}dimensions(t){return this._call("GetBotDimensions",{pool:t})}list(t){return this._call("ListBots",t)}}class Nt extends HTMLElement{constructor(t){super(),this._template=t,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){W(this,"testing_offline"),this._authHeaderEvent=t=>{this._auth_header=t.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(t,e,s){"PERMISSION_DENIED"!==t.codeName||s?"AbortError"!==t.name&&(console.error(t),i(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(t,e,s){403!==t.status||s?"AbortError"!==t.name&&(console.error(t),i(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){H(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,H(this._template(this),this,{eventContext:this}))}attributeChangedCallback(t,e,s){this.render()}_createTasksService(){return new Ct(this.authHeader,this._fetchController.signal)}_createBotService(){return new St(this.authHeader,this._fetchController.signal)}}const Dt=t=>P` <tr> <td>${t.key}</td> <td>${t.value.join(" | ")}</td> </tr> `,Lt=t=>P` <tr> <td>${t.id}</td> <td>${t.battery&&t.battery.level||"???"}</td> <td>${t.averageTemp}</td> <td>${t.state}</td> </tr> `,Ht=t=>P` <tr class=${function(t){if(!t||!t.state)return"";const e=t.state;return $t.has(e)?"exception":"BOT_DIED"===e?"bot_died":"CLIENT_ERROR"===e?"client_error":At.has(e)?"pending_task":"COMPLETED"===e&&t.failure?"failed_task":""}(t)}> <td class="break-all"> <a target="_blank" rel="noopener" href=${Y(t.taskId)}> ${t.name} </a> </td> <td>${t.humanized.time.startedTs}</td> <td title=${t.humanized.time.completedTs}>${t.humanTotalDuration}</td> <td>${t.humanState}</td> </tr> `,Pt=t=>P` <swarming-app id=swapp ?testing_offline=${t.testing_offline}> <header> <div class=title>Swarming Bot Page</div> <aside class=hideable> <a href=/>Home</a> <a href=/botlist>Bot List</a> <a href=/tasklist>Task List</a> <a href=/task>Task Page</a> </aside> </header> <main> <h2 class=message ?hidden=${t.loggedInAndAuthorized}>${t._message}</h2> <div class=top ?hidden=${!t.loggedInAndAuthorized}> ${(t=>t._botId?P` <div class=id_buttons> <input id=id_input placeholder="Bot ID" @change=${t._updateID}></input> <button title="Refresh data" class=refresh @click=${t._refresh}>refresh</button> </div>`:P` <div class=id_buttons> <input id=id_input placeholder="Bot ID" @change=${t._updateID}></input> <span class=message>Enter a Bot ID to get started.</span> </div>`)(t)} <h2 class=not_found ?hidden=${!t._notFound||!t._botId}> Bot not found </h2> </div> <div class="horizontal layout wrap content" ?hidden=${!t.loggedInAndAuthorized||!t._botId||t._notFound}> <div class=grow> <table class=data_table> ${((t,e)=>t._botId?P` <tr class="dead ${e.deleted?"":"hidden"}" title="This bot was deleted." > <td colspan="3">THIS BOT WAS DELETED</td> </tr> <tr class=${e.isDead?"dead":""}> <td>Last Seen</td> <td title=${e.humanized.lastSeenTs}> ${Z(e.lastSeenTs)} ago </td> <td> <button class="shut_down ${!e.isDead&&e.firstSeenTs?"":"hidden"}" ?hidden=${e.isDead} ?disabled=${!t.permissions.terminateBot} @click=${t._promptShutdown} > Stop the bot gracefully </button> <button class="delete ${e.isDead&&!e.deleted?"":"hidden"}" ?disabled=${!t.permissions.deleteBot} @click=${t._promptDelete} > Delete </button> </td> </tr> <tr class="quarantined ${e.quarantined?"":"hidden"}"> <td>Quarantined</td> <td colspan="2" class="code">${function(t){if(t&&t.quarantined){let e=t.state.quarantined;return void 0!==e&&"true"!==e&&!0!==e||(e=t.state&&t.state.error),e||"True"}return""}(e)}</td> </tr> <tr class="dead ${e.isDead&&!e.deleted?"":"hidden"}"> <td>Dead</td> <td colspan="2" class="code"> Bot has been missing longer than 10 minutes </td> </tr> <tr class="maintenance ${e.maintenanceMsg?"":"hidden"}"> <td>In Maintenance</td> <td colspan="2" class="code">${e.maintenanceMsg}</td> </tr> <tr> <td>${e.isDead?"Died on Task":"Current Task"}</td> <td> <a target="_blank" rel="noopener" href=${M(Y(e.taskId))} > ${e.taskId||"idle"} </a> </td> <td> <button class="kill" ?hidden=${!e.taskId||e.isDead} ?disabled=${!t.permissions.cancelTask} @click=${t._promptKill} > Kill task </button> </td> </tr>`:"")(t,t._bot)} ${(t=>P` <tr> <td rowspan=${t.length+1}> <a href=${function(t){const e=["id","os","task","status"];if(!t)return j([],e);t=t.filter((t=>-1===Tt.indexOf(t.key)));for(const s of t)-1===e.indexOf(s.key)&&e.push(s.key);return j(t,e)}(t)}> Dimensions </a> </td> </tr> ${t.map(Dt)} `)(t._bot.dimensions||[])} ${((t,e)=>P` <tr title="IP address that the server saw the connection from."> <td>External IP</td> <td colspan="2"> <a href=${"http://"+e.externalIp}>${e.externalIp}</a> </td> </tr> <tr class=${t.serverDetails.botVersion===e.version?"":"old_version"} title="Version is based on the content of swarming_bot.zip which is the swarming bot code. The bot won't update if quarantined, dead, or busy." > <td>Bot Version</td> <td colspan="2">${e.version&&e.version.substring(0,10)}</td> </tr> <tr title="The version the server expects the bot to be using."> <td>Expected Bot Version</td> <td colspan="2"> ${t.serverDetails.botVersion&&t.serverDetails.botVersion.substring(0,10)} </td> </tr> <tr title="First time ever a bot with this id contacted the server."> <td>First seen</td> <td colspan="2" title=${e.humanized.firstSeenTs}> ${Q(e.firstSeenTs)} ago </td> </tr> <tr title="How the bot is authenticated by the server."> <td>Authenticated as</td> <td colspan="2">${e.authenticatedAs}</td> </tr> `)(t,t._bot)} </table> ${((t,e)=>e.device_list&&e.device_list.length?P` <h2>Android Devices</h2> <table class="devices"> <thead> <tr> <th>ID</th> <th>Battery</th> <th>Avg Temp. (°C)</th> <th>State</th> </tr> </thead> <tbody> ${e.device_list.map(Lt)} </tbody> </table>`:"")(0,t._bot)} ${((t,e)=>P` <span class="title">State</span> <button class="state" @click=${t._toggleBotState}> <add-circle-outline-icon-sk ?hidden=${t._showState} ></add-circle-outline-icon-sk> <remove-circle-outline-icon-sk ?hidden=${!t._showState} ></remove-circle-outline-icon-sk> </button> <div ?hidden=${!t._showState} class="bot_state"> ${JSON.stringify(e&&e.state||{},null,2)} </div> `)(t,t._bot)} </div> <div class="stats grow"> <bot-page-summary .tasks=${t._tasks}></bot-page-summary> </div> </div> <div class=tasks-events-picker ?hidden=${!t.loggedInAndAuthorized||!t._botId||t._notFound}> <div class=tab @click=${e=>t._setShowEvents(!1)} ?selected=${!t._showEvents}> Tasks </div> <div class=tab @click=${e=>t._setShowEvents(!0)} ?selected=${t._showEvents}> Events </div> </div> ${((t,e)=>!t.loggedInAndAuthorized||!t._botId||t._showEvents||t._notFound?"":P` <table class="tasks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Duration</th> <th>Result</th> </tr> </thead> <tbody> ${e.map(Ht)} </tbody> </table> <button class="more_tasks" ?disabled=${!t._taskCursor} @click=${t._moreTasks} > Show More </button> `)(t,t._tasks)} ${((t,e)=>t.loggedInAndAuthorized&&t._botId&&t._showEvents&&!t._notFound?P` <div class="all-events"> <checkbox-sk ?checked=${t._showAll} @click=${t._toggleShowAll}> </checkbox-sk> <span>Show all events</span> </div> <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> ${e.map((e=>((t,e,s)=>e||t.message?P` <tr> <td class="message">${[t.message,t.maintenanceMsg,t.state.quarantined].filter(Boolean).join("\n")}</td> <td>${t.eventType}</td> <td>${t.humanized.time.ts}</td> <td> <a target="_blank" rel="noopener" href=${Y(t.taskId)}> ${t.taskId} </a> </td> <td class=${s===t.version?"":"old_version"}> ${t.version&&t.version.substring(0,10)} </td> </tr>`:"")(e,t._showAll,t.serverDetails.botVersion)))} </tbody> </table> <button class="more_events" ?disabled=${!t._eventsCursor} @click=${t._moreEvents} > Show More </button> `:"")(t,t._events)} </main> <footer></footer> ${(t=>"shutdown"===t._promptType?(t=>P` <dialog-pop-over> <div class="prompt-dialog content"> <div class="vertical grid reason"> <div>Are you sure you want to ${t._prompt}?</div> <div class="horizontal layout terminate"> <label for="reason">Shutdown reason (optional)</label> <input type="text" id="reason" name="reason" /> </div> <div class="horizontal layout end"> <button @click=${t._closePopup} class="cancel" tabindex="0"> NO </button> <button @click=${t._promptCallback} class="ok" tabindex="0"> YES </button> </div> </div> </div> </dialog-pop-over>`)(t):(t=>P` <dialog-pop-over> <div class="prompt-dialog content"> Are you sure you want to ${t._prompt}? <div class="horizontal layout end"> <button @click=${t._closePopup} class="cancel" tabindex="0"> NO </button> <button @click=${t._promptCallback} class="ok" tabindex="0"> YES </button> </div> </div> </dialog-pop-over>`)(t))(t)} </swarming-app> `;window.customElements.define("bot-page",class extends Nt{constructor(){super(Pt),this._botId="",this._showState=!1,this._showEvents=!1,this._showAll=!1,this._urlParamsLoaded=!1,this._stateChanged=R((()=>({id:this._botId,s:this._showState,e:this._showEvents,a:this._showAll})),(t=>{this._botId=t.id||this._botId,this._showState=t.s,this._showEvents=t.e,this._showAll=t.a,this._urlParamsLoaded=!0,this._fetch(),this.render()})),this._bot=st({}),this._notFound=!1,this._tasks=[],this._events=[],this._resetCursors(),this._promptCallback=()=>{},this._message="You must sign in to see anything useful.",this._fetchController=null}connectedCallback(){super.connectedCallback(),this._loginEvent=t=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this.render()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent)}_closePopup(){e("dialog-pop-over",this).hide()}_deleteBot(){this.app.addBusyTasks(1),this._createBotService().delete(this._botId).then((t=>{this._closePopup(),i("Request to delete bot sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>{this._closePopup(),this.prpcError(t,"bot/delete"),this.render()}))}_fetch(){if(!this.loggedInAndAuthorized||!this._urlParamsLoaded||!this._botId)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const t={authHeader:this.authHeader,signal:this._fetchController.signal};this.app._fetchPermissions(t,{botId:this._botId}),this.app.addBusyTasks(1);const e=this._createBotService();e.bot(this._botId).then((t=>{this._notFound=!1,this._bot=function(t){if(!t)return{};et(t,It),t.state=t.state||"{}",t.state=JSON.parse(t.state)||{},t.dimensions=t.dimensions||[];for(const e of t.dimensions)e.value.forEach((function(t,s){e.value[s]=vt(t,e.key)}));t.device_list=[];const e=t.state.devices;if(e)for(const s in e)if(e.hasOwnProperty(s)){const i=e[s];i.id=s,t.device_list.push(i);let n=0,o=0;i.temp=i.temp||{};for(const t in i.temp)i.temp.hasOwnProperty(t)&&(o+=parseFloat(i.temp[t]),n++);i.averageTemp=n?(o/n).toFixed(1):"???"}return t}(t),this.render(),this.app.finishedTask()})).catch((t=>{"NOT_FOUND"===t.codeName&&(this._bot=st({}),this._notFound=!0,this.render()),this.prpcError(t,"bot/data")})),this._taskCursor||(this.app.addBusyTasks(1),e.tasks(this._botId,this._taskCursor).then((t=>{this._taskCursor=t.cursor,this._tasks=Et(t.items),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bot/tasks")))),this._eventsCursor||(this.app.addBusyTasks(1),e.events(this._botId,this._eventsCursor).then((t=>{this._eventsCursor=t.cursor,this._events=bt(t.items),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bot/events"))))}_killTask(){this.app.addBusyTasks(1),this._createTasksService().cancel(this._bot.taskId,!0).then((t=>{this._closePopup(),i("Request to kill task sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>{this._closePopup(),this.prpcError(t,"task/kill"),this.render()}))}_moreEvents(){this._eventsCursor&&(this.app.addBusyTasks(1),this._createBotService().events(this._botId,this._eventsCursor).then((t=>{this._eventsCursor=t.cursor,this._events.push(...bt(t.items)),this.render(),this.app.finishedTask()})).catch((t=>this.fetchError(t,"bot/more_events"))))}_moreTasks(){this._taskCursor&&(this.app.addBusyTasks(1),this._createBotService().tasks(this._botId,this._taskCursor).then((t=>{this._taskCursor=t.cursor,this._tasks.push(...Et(t.items)),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bot/more_tasks"))))}_promptDelete(){this._promptType="delete",this._prompt=`delete dead bot '${this._botId}'`,this._promptCallback=this._deleteBot,this.render(),e("dialog-pop-over",this).show(),e("dialog-pop-over button.cancel",this).focus()}_promptKill(){this._promptType="kill",this._prompt=`kill running task '${this._bot.taskId}'`,this._promptCallback=this._killTask,this.render(),e("dialog-pop-over",this).show(),e("dialog-pop-over button.cancel",this).focus()}_promptShutdown(){this._promptType="shutdown",this._prompt=`gracefully shut down bot '${this._botId}'`,this._promptCallback=this._shutdownBot,this.render(),e("dialog-pop-over",this).show(),e("dialog-pop-over button.cancel",this).focus()}_refresh(){this._resetCursors(),this._fetch(),this.render()}render(){super.render(),e("#id_input",this).value=this._botId}_resetCursors(){this._taskCursor="",this._eventsCursor=""}_setShowEvents(t){this._showEvents=t,this._stateChanged(),this.render()}_shutdownBot(){this.app.addBusyTasks(1);const t=e("#reason").value;this._createBotService().terminate(this._botId,t).then((t=>{this._closePopup(),i("Request to shutdown bot sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>{this._closePopup(),this.prpcError(t,"bot/terminate"),this.render()}))}_toggleBotState(t){this._showState=!this._showState,this._stateChanged(),this.render()}_toggleShowAll(t){t.preventDefault(),this._showAll=!this._showAll,this._stateChanged(),this.render()}_updateID(t){const s=e("#id_input",this);this._botId=s.value,this._resetCursors(),this._stateChanged(),this._fetch(),this.render()}})})()})();
\ No newline at end of file
+(()=>{"use strict";var t={445:function(t,e){var s=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(n,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const t in e.RpcCode)i[e.RpcCode[t]]=t;function n(t){return i[t]}e.rpcCodeToCodeName=n,e.PrpcClient=class{constructor(t=null){t=t||{},this.host=t.host||document.location.host,this.accessToken=t.accessToken||null,this.insecure=t.hasOwnProperty("insecure")&&Boolean(t.insecure),this.fetchImpl=t.fetchImpl||window.fetch.bind(window)}call(t,i,n,a){return s(this,void 0,void 0,(function*(){if(!t)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!n)throw new TypeError("missing required argument: message");if(!(n instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const s=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${t}/${i}`,l=this._requestOptions(n,a),d=yield this.fetchImpl(s,l);if(!d.headers.has("X-Prpc-Grpc-Code"))throw new r(d.status,"Invalid response: no X-Prpc-Grpc-Code response header");const h=Number.parseInt(d.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(h))throw new r(d.status,"Invalid X-Prpc-Grpc-Code response header");const c=yield d.text();if(h!==e.RpcCode.OK)throw new o(h,c);if(!c.startsWith(")]}'"))throw new r(d.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(c.substr(4))}))}_requestOptions(t,e){const s={accept:"application/json","content-type":"application/json"};return e&&Object.assign(s,e),this.accessToken&&(s.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:s,body:JSON.stringify(t)}}};class o extends Error{constructor(t,e){if(super(),this.code=t,this.description=e,null===t)throw new Error("missing required argument: code");this.codeName=n(t)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}e.GrpcError=o;class r extends Error{constructor(t,e){if(super(),this.httpStatus=t,this.description=e,null===t)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}e.ProtocolError=r}},e={};function s(i){var n=e[i];if(void 0!==n)return n.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,s),o.exports}(()=>{const t=new Promise((function(t,e){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)})),e=(t,e=document)=>e.querySelector(t);function i(t,e=1e4){"object"==typeof t&&(t=t.message||JSON.stringify(t));var s={message:t,duration:e};document.dispatchEvent(new CustomEvent("error-sk",{detail:s,bubbles:!0}))}const n=new WeakMap,o=t=>"function"==typeof t&&n.has(t),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,a=(t,e,s=null)=>{let i=e;for(;i!==s;){const e=i.nextSibling;t.removeChild(i),i=e}},l={},d={},h=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${h}--\x3e`,u=new RegExp(`${h}|${c}`),p="$lit$";class _{constructor(t,e){this.parts=[],this.element=e;let s=-1,i=0;const n=[],o=e=>{const r=e.content,a=document.createTreeWalker(r,133,null,!1);let l=0;for(;a.nextNode();){s++;const e=a.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const n=e.attributes;let o=0;for(let t=0;t<n.length;t++)n[t].value.indexOf(h)>=0&&o++;for(;o-- >0;){const n=t.strings[i],o=v.exec(n)[2],r=o.toLowerCase()+p,a=e.getAttribute(r).split(u);this.parts.push({type:"attribute",index:s,name:o,strings:a}),e.removeAttribute(r),i+=a.length-1}}"TEMPLATE"===e.tagName&&o(e)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(h)>=0){const o=e.parentNode,r=t.split(u),a=r.length-1;for(let t=0;t<a;t++)o.insertBefore(""===r[t]?g():document.createTextNode(r[t]),e),this.parts.push({type:"node",index:++s});""===r[a]?(o.insertBefore(g(),e),n.push(e)):e.data=r[a],i+=a}}else if(8===e.nodeType)if(e.data===h){const t=e.parentNode;null!==e.previousSibling&&s!==l||(s++,t.insertBefore(g(),e)),l=s,this.parts.push({type:"node",index:s}),null===e.nextSibling?e.data="":(n.push(e),s--),i++}else{let t=-1;for(;-1!==(t=e.data.indexOf(h,t+1));)this.parts.push({type:"node",index:-1})}}};o(e);for(const t of n)t.parentNode.removeChild(t)}}const m=t=>-1!==t.index,g=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class f{constructor(t,e,s){this._parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this._parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=r?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let s=0,i=0;const n=t=>{const o=document.createTreeWalker(t,133,null,!1);let r=o.nextNode();for(;s<e.length&&null!==r;){const t=e[s];if(m(t))if(i===t.index){if("node"===t.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(r.previousSibling),this._parts.push(t)}else this._parts.push(...this.processor.handleAttributeExpressions(r,t.name,t.strings,this.options));s++}else i++,"TEMPLATE"===r.nodeName&&n(r.content),r=o.nextNode();else this._parts.push(void 0),s++}};return n(t),r&&(document.adoptNode(t),customElements.upgrade(t)),t}}class b{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="";for(let s=0;s<t;s++){const t=this.strings[s],i=v.exec(t);e+=i?t.substr(0,i.index)+i[1]+i[2]+p+i[3]+h:t+c}return e+this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const w=t=>null===t||!("object"==typeof t||"function"==typeof t);class k{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new y(this)}_getValue(){const t=this.strings,e=t.length-1;let s="";for(let i=0;i<e;i++){s+=t[i];const e=this.parts[i];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)s+="string"==typeof e?e:String(e);else s+="string"==typeof t?t:String(t)}}return s+t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class y{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===l||w(t)&&t===this.value||(this.value=t,o(t)||(this.committer.dirty=!0))}commit(){for(;o(this.value);){const t=this.value;this.value=l,t(this)}this.value!==l&&this.committer.commit()}}class E{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(g()),this.endNode=t.appendChild(g())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=g()),t._insert(this.endNode=g())}insertAfterPart(t){t._insert(this.startNode=g()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}const t=this._pendingValue;t!==l&&(w(t)?t!==this.value&&this._commitText(t):t instanceof b?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):t===d?(this.value=d,this.clear()):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof f&&this.value.template===e)this.value.update(t.values);else{const s=new f(e,t.processor,this.options),i=s._clone();s.update(t.values),this._commitNode(i),this.value=s}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,i=0;for(const n of t)void 0===(s=e[i])&&(s=new E(this.options),e.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(e[i-1])),s.setValue(n),s.commit(),i++;i<e.length&&(e.length=i,this.clear(s&&s.endNode))}clear(t=this.startNode){a(this.startNode.parentNode,t.nextSibling,this.endNode)}}class T{constructor(t,e,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=l}}class I extends k{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new x(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class x extends y{}let A=!1;try{const t={get capture(){return A=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class ${constructor(t,e,s){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this._boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=this._pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=C(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=l}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const C=t=>t&&(A?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),S=new class{handleAttributeExpressions(t,e,s,i){const n=e[0];return"."===n?new I(t,e.slice(1),s).parts:"@"===n?[new $(t,e.slice(1),i.eventContext)]:"?"===n?[new T(t,e.slice(1),s)]:new k(t,e,s).parts}handleTextExpression(t){return new E(t)}};function N(t){let e=D.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},D.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(h);return void 0===(s=e.keyString.get(i))&&(s=new _(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const D=new Map,L=new WeakMap,H=(t,e,s)=>{let i=L.get(e);void 0===i&&(a(e,e.firstChild),L.set(e,i=new E(Object.assign({templateFactory:N},s))),i.appendInto(e)),i.setValue(t),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const P=(t,...e)=>new b(t,e,"html",S),M=(B=t=>e=>{if(void 0===t&&e instanceof y){if(t!==e.value){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else e.setValue(t)},(...t)=>{const e=B(...t);return n.set(e,!0),e});var B;function G(t){var e=[];return Object.keys(t).sort().forEach((function(s){Array.isArray(t[s])?t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))})):"object"==typeof t[s]?e.push(encodeURIComponent(s)+"="+encodeURIComponent(G(t[s]))):e.push(encodeURIComponent(s)+"="+encodeURIComponent(t[s]))})),e.join("&")}function V(t,e){e=e||{};for(var s={},i=t.split("&"),n=0;n<i.length;n++){var o=i[n].split("=",2);if(2==o.length){var r=decodeURIComponent(o[0]),a=decodeURIComponent(o[1]);if(e.hasOwnProperty(r))switch(typeof e[r]){case"boolean":s[r]="true"==a;break;case"number":s[r]=Number(a);break;case"object":if(Array.isArray(e[r])){var l=s[r]||[];l.push(a),s[r]=l}else s[r]=V(a,e[r]);break;default:s[r]=a}else s[r]=a}}return s}const O=t=>JSON.parse(JSON.stringify(t));function R(e,s){let i=O(e()),n=!1;const o=()=>{n=!0;let t=V(window.location.search.slice(1),i);s(function(t,e){let s={};return Object.keys(e).forEach((function(i){t.hasOwnProperty(i)?s[i]=O(t[i]):s[i]=O(e[i])})),s}(t,i))};return t.then(o),window.addEventListener("popstate",o),()=>{if(!n)return;let t=G(function(t,e){let s={};return Object.keys(t).forEach((function(i){(function(t,e){if(typeof t!=typeof e)return!1;let s=typeof t;return"string"===s||"boolean"===s||"number"===s?t===e:"object"===s?Array.isArray(s)?JSON.stringify(t)===JSON.stringify(e):G(t)===G(e):void 0})(t[i],e[i])||(s[i]=t[i])})),s}(e(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+t)}}function W(t,e){if(t.hasOwnProperty(e)){let s=t[e];delete t[e],t[e]=s}}class z extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),W(this,"checked"),W(this,"disabled"),W(this,"name"),W(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(t){let e=!!t;this._input.checked=e,t?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){let e=!!t;this._input.disabled=e,e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(t){this.setAttribute("name",t),this._input.setAttribute("name",t)}get label(){return this._input.getAttribute("label")}set label(t){this.setAttribute("label",t),this._input.setAttribute("label",t)}attributeChangedCallback(t,e,s){if(!this._input)return;let i=null!=s;switch(t){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=s;break;case"label":this._label.textContent=s}}}window.customElements.define("checkbox-sk",z);const U=document.createElement("template");U.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("add-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=U.content.cloneNode(!0);this.appendChild(t)}});const F=document.createElement("template");F.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("remove-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=F.content.cloneNode(!0);this.appendChild(t)}});const q=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}];function K(t){if(t<0&&(t=-t),0===t)return"  0s";let e="";for(let s=0;s<q.length;s++)if(q[s].delta<=t){let i=Math.floor(t/q[s].delta)+q[s].units;for(;i.length<4;)i=" "+i;e+=i,t%=q[s].delta}return e}function j(t=[],e=[]){const s=[];for(const e of t)if(e.key&&e.value)if(Array.isArray(e.value))for(const t of e.value)s.push(e.key+":"+t);else s.push(e.key+":"+e.value);else s.push(e);return"/botlist?"+function(t){if(!t)return"";var e=[];return Object.keys(t).sort().forEach((function(s){t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))}))})),e.join("&")}({f:s,c:e})}function X(t){if(0===t||"0"===t)return"0s";if(!t)return"--";const e=parseFloat(t);return e?e>60?K(e):e.toFixed(2)+"s":t+" seconds"}function J(t,e,s=!0){W(t,e),void 0===t[e]&&t.hasAttribute(e)&&(t[e]=t.getAttribute(e),s&&t.removeAttribute(e))}function Y(t,e){if(t)return e||(t=t.substring(0,t.length-1)+"0"),`/task?id=${t}`}function Q(t){return t?function(t){let e=(("number"==typeof t?t:Date.parse(t))-Date.now())/1e3;return e<0&&(e*=-1),function(t,e){for(let s=0;s<e.length-1;s++)if(Math.round(t/e[s+1].delta)*e[s+1].delta/e[s].delta>=1)return Math.round(t/e[s].delta)+e[s].units;let s=e.length-1;return Math.round(t/e[s].delta)+e[s].units}(e,q)}(t.getTime())||"0s":"eons"}function Z(t,e){return t?(e||(e=new Date),K((e.getTime()-t.getTime())/1e3)||"0s"):"eons"}class tt{constructor(t){this._time=new Proxy(t,{get(t,e,s){let i=Reflect.get(t,e,s);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const n=i.toString(),o=n.substring(n.indexOf("("));return`${i.toLocaleString()} ${o}`}})}get time(){return this._time}}function et(t,e){if(void 0!==t){for(const s of e){const e=t[s];"string"==typeof e&&(t[s]=new Date(e))}t.humanized=new tt(t)}}function st(t){if(void 0!==t)return t.humanized=new tt(t),t}const it=document.createElement("template");it.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>',window.customElements.define("arrow-drop-down-icon-sk",class extends HTMLElement{connectedCallback(){let t=it.content.cloneNode(!0);this.appendChild(t)}});const nt=document.createElement("template");nt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 14l5-5 5 5z"/></svg>',window.customElements.define("arrow-drop-up-icon-sk",class extends HTMLElement{connectedCallback(){let t=nt.content.cloneNode(!0);this.appendChild(t)}}),window.customElements.define("sort-toggle",class extends HTMLElement{constructor(){super()}connectedCallback(){J(this,"currentKey"),J(this,"key"),J(this,"direction"),this.addEventListener("click",(()=>{this.toggle()})),this.render()}get currentKey(){return this._currentKey}set currentKey(t){this._currentKey=t,this.render()}get key(){return this._key}set key(t){this._key=t,this.render()}get direction(){return this._direction}set direction(t){this._direction=t,this.render()}toggle(){this.currentKey===this.key&&"asc"===this.direction?this.direction="desc":this.direction="asc",this.dispatchEvent(new CustomEvent("sort-change",{detail:{direction:this.direction,key:this.key},bubbles:!0}))}render(){var t;H(P` <arrow-drop-down-icon-sk ?hidden=${(t=this).key===t.currentKey&&"asc"===t.direction} > </arrow-drop-down-icon-sk> <arrow-drop-up-icon-sk ?hidden=${t.key===t.currentKey&&"desc"===t.direction} > </arrow-drop-up-icon-sk>`,this,{eventContext:this})}});function ot(t){return(t=(t=function(t){return t.replace(" (with patch)","")}(t=t.trim())).replace(/ \(retry\)/g,"")).replace(/ \(debug\)/g,"")}window.customElements.define("bot-page-summary",class extends HTMLElement{constructor(){super(),this._sort="total",this._dir="desc",this._summarized=[],this._totalStats={},this._showAllTasks=!1,this._fullNames=!1}connectedCallback(){J(this,"tasks"),this._sortEvent=t=>{this._sort=t.detail.key,this._dir=t.detail.direction,this.render()},this.addEventListener("sort-change",this._sortEvent)}disconnectedCallback(){this.removeEventListener("sort-change",this._sortEvent)}get tasks(){return this._tasks||[]}set tasks(t){this._tasks=t,this.render()}_aggregate(){const t={total:0,success:0,failed:0,bot_died:0,avg_duration:0,avg_overhead:0,total_overhead:0,total_time:0};if(!this.tasks||!this.tasks.length)return this._totalStats=t,void(this._summarized=[]);const e=new Date,s={};t.wall_time=(e-this.tasks[this.tasks.length-1].startedTs)/1e3;for(const e of this.tasks){const i=ot(e.name);if("RUNNING"===e.state)continue;s[i]||(s[i]={full_name:i,total:0,success:0,failed:0,bot_died:0,avg_duration:0,total_time:0,total_overhead:0}),t.total++,s[i].total++,e.failure?(t.failed++,s[i].failed++):e.internal_failure&&(t.bot_died++,s[i].bot_died++);const n=e.totalDuration||e.duration||0;t.total_time+=n,s[i].total_time+=n,t.total_overhead+=e.total_overhead||0,s[i].total_overhead+=e.total_overhead||0}const i=[];for(const e in s)if(s.hasOwnProperty(e)){const n=s[e];n.avg_duration=n.total_time/n.total,n.avg_overhead=n.total_overhead/n.total,n.total_time_percent=(100*n.total_time/t.total_time).toFixed(1),i.push(n)}t.avg_duration=t.total_time/t.total,t.avg_overhead=t.total_overhead/t.total,t.wall_time_utilization=(100*t.total_time/t.wall_time).toFixed(1),this._totalStats=t,this._summarized=i}render(){var t;this._aggregate(),H(P` <table> <thead> <tr> <th> <span>Name</span> <sort-toggle key="full_name" .currentKey=${(t=this)._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Total</span> <sort-toggle key="total" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Success</span> <sort-toggle key="success" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Failed</span> <sort-toggle key="failed" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Died</span> <sort-toggle key="bot_died" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Average Duration</span> <sort-toggle key="avg_duration" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th> <span>Average Overhead</span> <sort-toggle key="avg_overhead" .currentKey=${t._sort} .direction=${t._dir} > </sort-toggle> </th> <th>Percent of Total</th> </tr> </thead> <tbody> ${t._sortAndLimitTasks().map((e=>((t,e)=>P` <tr> <td title=${t.full_name} class="break-all"> ${e._shortenName(t.full_name)} </td> <td>${t.total}</td> <td>${t.success}</td> <td>${t.failed}</td> <td>${t.bot_died}</td> <td>${X(t.avg_duration)}</td> <td>${X(t.avg_overhead)}</td> <td>${t.total_time_percent}%</td> </tr> `)(e,t)))} <tr class="thick"> <td>Total</td> <td>${t._totalStats.total}</td> <td>${t._totalStats.success}</td> <td>${t._totalStats.failed}</td> <td>${t._totalStats.bot_died}</td> <td>${X(t._totalStats.avg_duration)}</td> <td>${X(t._totalStats.avg_overhead)}</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>${X(t._totalStats.wall_time)}</td> <td>${t._totalStats.wall_time_utilization}%</td> </tr> </tbody> </table> <div class="controls"> <checkbox-sk ?checked=${t._fullNames} @click=${t._toggleName}> </checkbox-sk> <span>Show Full Names</span> <checkbox-sk ?hidden=${t._summarized.length<=15} ?checked=${t._showAllTasks} @click=${t._toggleShow} > </checkbox-sk> <span ?hidden=${t._summarized.length<=15} >Show All Tasks</span > </div> </div> `,this,{eventContext:this})}_sortAndLimitTasks(){return this._summarized.sort(((t,e)=>{if(!this._sort)return 0;let s=1;return"desc"===this._dir&&(s=-1),"full_name"===this._sort?s*t.full_name.localeCompare(e.full_name):s*(t[this._sort]-e[this._sort])})),this._showAllTasks?this._summarized:this._summarized.slice(0,Math.min(this._summarized.length,15))}_shortenName(t){return t.length>50&&!this._fullNames?t.slice(0,47)+"...":t}_toggleName(t){t.preventDefault(),this._fullNames=!this._fullNames,this.render()}_toggleShow(t){t.preventDefault(),this._showAllTasks=!this._showAllTasks,this.render()}});const rt=document.createElement("template");rt.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const t=rt.content.cloneNode(!0);if(this.appendChild(t),this._backdrop=e(".backdrop",this),this._content=e(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const t=window.innerWidth,e=window.innerHeight,s=Math.min(this._content.offsetWidth,t-50),i=Math.min(this._content.offsetHeight,e-50);this._content.style.width=s,this._content.style.left=(t-s)/2,this._content.style.top=(e-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),W(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(t){this.setAttribute("duration",t)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(t){t.detail.duration&&(this._toast.duration=t.detail.duration),this._toast.textContent=t.detail.message,this._toast.show()}});const at=document.createElement("template");at.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let t=at.content.cloneNode(!0);this.appendChild(t)}});const lt=document.createElement("template");function dt(t){if(t.ok)return t.json();throw{message:`Bad network response: ${t.statusText}`,resp:t,status:t.status}}lt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let t=lt.content.cloneNode(!0);this.appendChild(t)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){W(this,"active")}get active(){return this.hasAttribute("active")}set active(t){t?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){W(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((t=>{"anonymous:anonymous"!=t.identity&&(this._fireLoginEvent(t),this.render())}),(t=>{console.error(t),i(`Error getting auth state: ${JSON.stringify(t)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(t){this._profile={email:t.email,imageURL:t.picture},this._auth_header=`Bearer ${t.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(t){const e=window.location.pathname+window.location.search;window.location=e&&"/"!=e?`/auth/openid/${t}?r=${encodeURIComponent(e)}`:`/auth/openid/${t}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(dt)}render(){H((t=>t.authHeader?P` <div> <img class="center" id="avatar" src="${t._profile.imageURL}" width="30" height="30" /> <span class="center">${t._profile.email}</span> <span class="center">|</span> <a class="center" @click=${t._logOut} href="#">Sign out</a> </div>`:P` <div> <a @click=${t._logIn} href="#">Sign in</a> </div>`)(this),this,{eventContext:this})}attributeChangedCallback(t,e,s){this.render()}});var ht=s(445);class ct{constructor(t,e=null,s={}){const i={...s,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=t,e){const t=(t,s)=>(s.signal=e,fetch(t,s));i.fetchImpl=t}this._client=new ht.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(t,e){const s={authorization:this._token};return this._client.call(this.service,t,e,s)}}class ut extends ct{get service(){return"swarming.v2.Swarming"}permissions(t){return this._call("GetPermissions",t)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const pt=document.createElement("template");pt.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const _t=document.createElement("template");_t.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const mt="You must log in to see more details",gt=document.createElement("template");function vt(t,e){if(!ft[e]||"none"===t||!t)return t;let s=ft[e][t];if("gpu"===e){const i=t.split("-")[0];s=ft[e][i]}else if("os"===e&&t.startsWith("Windows")){const i=t.split(".")[0];s=ft[e][i]}return s?`${s} (${t})`:t}gt.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:mt,botVersion:"",casViewerServer:""};const t=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,t),this._permissions={}}connectedCallback(){W(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(t=>{this._auth_header=t.detail.authHeader,this._profile=t.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(t){this._busyTaskCount+=t,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const t=this.querySelector("header"),e=t&&t.querySelector("aside"),s=this.querySelector("footer");if(!(t&&e&&e.classList.contains("hideable")))return;let i=pt.content.cloneNode(!0);t.insertBefore(i,t.firstElementChild),(i=t.firstElementChild).addEventListener("click",(t=>this._toggleMenu(t,e)));const n=_t.content.cloneNode(!0);t.insertBefore(n,e),this._spinner=t.querySelector("spinner-sk");const o=document.createElement("span");o.classList.add("grow"),t.appendChild(o),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),t.appendChild(this._dynamicEle);const r=document.createElement("error-toast-sk");s.append(r);const a=gt.content.cloneNode(!0);s.append(a)}_toggleMenu(t,e){e.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const t={authHeader:this._auth_header};this.addBusyTasks(1),new ut(t.authHeader).details().then((t=>{this._serverDetails=t,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{"PERMISSION_DENIED"===t.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(t),i(`Unexpected error loading details: ${t.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(t)}_fetchPermissions(t,e){return this.addBusyTasks(1),new ut(t.authHeader,t.signal).permissions(e||{}).then((t=>{this._permissions=t,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{403!==t.status&&(console.error(t),i(`Unexpected error loading permissions: ${t.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&H((t=>P` <div class="server-version"> AppEngine version: ${function(t,e){return e&&e.serverVersion?P`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(t,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",e.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${e.serverVersion}</a >`:mt}(t._projectId,t._serverDetails)} Git version:${function(t){if(!t||!t.serverVersion)return"";const e=t.serverVersion.split("-");if(e.length>=3)return console.error(`Invalid Git version. version=${t.serverVersion}`),"";const s=2==e.length?e[1]:e[0];return P`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${s}>${s}</a>`}(t._serverDetails)} </div> <oauth-login ?testing_offline=${t.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(t,e,s){this.render()}});const ft={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL",tangorpro:"Pixel Tablet","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}};function bt(t){if(!t)return[];for(const e of t)et(e,["ts"]),e.state=e.state?JSON.parse(e.state):{};return t.sort(((t,e)=>e.ts-t.ts)),t}const wt=(t,e,s)=>{for(const s of e)if(t[s])return t[s];return s},kt=t=>wt(t,["startedTs"]),yt=t=>wt(t,["completedTs","abandonedTs","modifiedTs"],new Date);function Et(t){if(!t)return[];for(const e of t){if(et(e,xt),e.duration)e.humanDuration=X(e.duration);else{const t=yt(e);e.humanDuration=Z(e.startedTs,t),e.duration=(t.getTime()-e.startedTs)/1e3}const t=e.performanceStats&&e.performanceStats.botOverhead||0;e.totalDuration=e.duration+t,e.humanTotalDuration=X(e.totalDuration),e.total_overhead=t,e.humanState=e.state||"UNKNOWN","COMPLETED"===e.state&&(e.failure?e.humanState="FAILURE":"RUNNING"!==e.state&&(e.humanState="SUCCESS"))}return t.sort(((t,e)=>kt(e)-kt(t))),t}const Tt=["id","caches","server_version"],It=["firstSeenTs","lastSeenTs","leaseExpirationTs"],xt=["startedTs","completedTs","abandonedTs","modifiedTs"],At=new Set(["PENDING","RUNNING"]),$t=new Set(["TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED"]);class Ct extends ct{get service(){return"swarming.v2.Tasks"}cancel(t,e){return this._call("CancelTask",{taskId:t,killRunning:e})}stdout(t,e,s){return this._call("GetStdout",{taskId:t,offset:e,length:s})}request(t){return this._call("GetRequest",{taskId:t})}result(t,e){return this._call("GetResult",{taskId:t,includePerformanceStats:e})}new(t){return this._call("NewTask",t)}count(t){return this._call("CountTasks",t)}list(t){return t.state||(t={...t,state:"QUERY_ALL"}),this._call("ListTasks",t)}massCancel(t){return this._call("CancelTasks",t)}}class St extends ct{get service(){return"swarming.v2.Bots"}bot(t){return this._call("GetBot",{botId:t})}tasks(t,e){const s={sort:4,state:10,botId:t,cursor:e,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",s)}terminate(t,e){const s={botId:t,reason:e};return this._call("TerminateBot",s)}events(t,e){const s={limit:50,botId:t,cursor:e};return this._call("ListBotEvents",s)}delete(t){return this._call("DeleteBot",{botId:t})}count(t){return this._call("CountBots",{dimensions:t})}dimensions(t){return this._call("GetBotDimensions",{pool:t})}list(t){return this._call("ListBots",t)}}class Nt extends HTMLElement{constructor(t){super(),this._template=t,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){W(this,"testing_offline"),this._authHeaderEvent=t=>{this._auth_header=t.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(t,e,s){"PERMISSION_DENIED"!==t.codeName||s?"AbortError"!==t.name&&(console.error(t),i(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(t,e,s){403!==t.status||s?"AbortError"!==t.name&&(console.error(t),i(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){H(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,H(this._template(this),this,{eventContext:this}))}attributeChangedCallback(t,e,s){this.render()}_createTasksService(){return new Ct(this.authHeader,this._fetchController.signal)}_createBotService(){return new St(this.authHeader,this._fetchController.signal)}}const Dt=t=>P` <tr> <td>${t.key}</td> <td>${t.value.join(" | ")}</td> </tr> `,Lt=t=>P` <tr> <td>${t.id}</td> <td>${t.battery&&t.battery.level||"???"}</td> <td>${t.averageTemp}</td> <td>${t.state}</td> </tr> `,Ht=t=>P` <tr class=${function(t){if(!t||!t.state)return"";const e=t.state;return $t.has(e)?"exception":"BOT_DIED"===e?"bot_died":"CLIENT_ERROR"===e?"client_error":At.has(e)?"pending_task":"COMPLETED"===e&&t.failure?"failed_task":""}(t)}> <td class="break-all"> <a target="_blank" rel="noopener" href=${Y(t.taskId)}> ${t.name} </a> </td> <td>${t.humanized.time.startedTs}</td> <td title=${t.humanized.time.completedTs}>${t.humanTotalDuration}</td> <td>${t.humanState}</td> </tr> `,Pt=t=>P` <swarming-app id=swapp ?testing_offline=${t.testing_offline}> <header> <div class=title>Swarming Bot Page</div> <aside class=hideable> <a href=/>Home</a> <a href=/botlist>Bot List</a> <a href=/tasklist>Task List</a> <a href=/task>Task Page</a> </aside> </header> <main> <h2 class=message ?hidden=${t.loggedInAndAuthorized}>${t._message}</h2> <div class=top ?hidden=${!t.loggedInAndAuthorized}> ${(t=>t._botId?P` <div class=id_buttons> <input id=id_input placeholder="Bot ID" @change=${t._updateID}></input> <button title="Refresh data" class=refresh @click=${t._refresh}>refresh</button> </div>`:P` <div class=id_buttons> <input id=id_input placeholder="Bot ID" @change=${t._updateID}></input> <span class=message>Enter a Bot ID to get started.</span> </div>`)(t)} <h2 class=not_found ?hidden=${!t._notFound||!t._botId}> Bot not found </h2> </div> <div class="horizontal layout wrap content" ?hidden=${!t.loggedInAndAuthorized||!t._botId||t._notFound}> <div class=grow> <table class=data_table> ${((t,e)=>t._botId?P` <tr class="dead ${e.deleted?"":"hidden"}" title="This bot was deleted." > <td colspan="3">THIS BOT WAS DELETED</td> </tr> <tr class=${e.isDead?"dead":""}> <td>Last Seen</td> <td title=${e.humanized.lastSeenTs}> ${Z(e.lastSeenTs)} ago </td> <td> <button class="shut_down ${!e.isDead&&e.firstSeenTs?"":"hidden"}" ?hidden=${e.isDead} ?disabled=${!t.permissions.terminateBot} @click=${t._promptShutdown} > Stop the bot gracefully </button> <button class="delete ${e.isDead&&!e.deleted?"":"hidden"}" ?disabled=${!t.permissions.deleteBot} @click=${t._promptDelete} > Delete </button> </td> </tr> <tr class="quarantined ${e.quarantined?"":"hidden"}"> <td>Quarantined</td> <td colspan="2" class="code">${function(t){if(t&&t.quarantined){let e=t.state.quarantined;return void 0!==e&&"true"!==e&&!0!==e||(e=t.state&&t.state.error),e||"True"}return""}(e)}</td> </tr> <tr class="dead ${e.isDead&&!e.deleted?"":"hidden"}"> <td>Dead</td> <td colspan="2" class="code"> Bot has been missing longer than 10 minutes </td> </tr> <tr class="maintenance ${e.maintenanceMsg?"":"hidden"}"> <td>In Maintenance</td> <td colspan="2" class="code">${e.maintenanceMsg}</td> </tr> <tr> <td>${e.isDead?"Died on Task":"Current Task"}</td> <td> <a target="_blank" rel="noopener" href=${M(Y(e.taskId))} > ${e.taskId||"idle"} </a> </td> <td> <button class="kill" ?hidden=${!e.taskId||e.isDead} ?disabled=${!t.permissions.cancelTask} @click=${t._promptKill} > Kill task </button> </td> </tr>`:"")(t,t._bot)} ${(t=>P` <tr> <td rowspan=${t.length+1}> <a href=${function(t){const e=["id","os","task","status"];if(!t)return j([],e);t=t.filter((t=>-1===Tt.indexOf(t.key)));for(const s of t)-1===e.indexOf(s.key)&&e.push(s.key);return j(t,e)}(t)}> Dimensions </a> </td> </tr> ${t.map(Dt)} `)(t._bot.dimensions||[])} ${((t,e)=>P` <tr title="IP address that the server saw the connection from."> <td>External IP</td> <td colspan="2"> <a href=${"http://"+e.externalIp}>${e.externalIp}</a> </td> </tr> <tr class=${t.serverDetails.botVersion===e.version?"":"old_version"} title="Version is based on the content of swarming_bot.zip which is the swarming bot code. The bot won't update if quarantined, dead, or busy." > <td>Bot Version</td> <td colspan="2">${e.version&&e.version.substring(0,10)}</td> </tr> <tr title="The version the server expects the bot to be using."> <td>Expected Bot Version</td> <td colspan="2"> ${t.serverDetails.botVersion&&t.serverDetails.botVersion.substring(0,10)} </td> </tr> <tr title="First time ever a bot with this id contacted the server."> <td>First seen</td> <td colspan="2" title=${e.humanized.firstSeenTs}> ${Q(e.firstSeenTs)} ago </td> </tr> <tr title="How the bot is authenticated by the server."> <td>Authenticated as</td> <td colspan="2">${e.authenticatedAs}</td> </tr> `)(t,t._bot)} </table> ${((t,e)=>e.device_list&&e.device_list.length?P` <h2>Android Devices</h2> <table class="devices"> <thead> <tr> <th>ID</th> <th>Battery</th> <th>Avg Temp. (°C)</th> <th>State</th> </tr> </thead> <tbody> ${e.device_list.map(Lt)} </tbody> </table>`:"")(0,t._bot)} ${((t,e)=>P` <span class="title">State</span> <button class="state" @click=${t._toggleBotState}> <add-circle-outline-icon-sk ?hidden=${t._showState} ></add-circle-outline-icon-sk> <remove-circle-outline-icon-sk ?hidden=${!t._showState} ></remove-circle-outline-icon-sk> </button> <div ?hidden=${!t._showState} class="bot_state"> ${JSON.stringify(e&&e.state||{},null,2)} </div> `)(t,t._bot)} </div> <div class="stats grow"> <bot-page-summary .tasks=${t._tasks}></bot-page-summary> </div> </div> <div class=tasks-events-picker ?hidden=${!t.loggedInAndAuthorized||!t._botId||t._notFound}> <div class=tab @click=${e=>t._setShowEvents(!1)} ?selected=${!t._showEvents}> Tasks </div> <div class=tab @click=${e=>t._setShowEvents(!0)} ?selected=${t._showEvents}> Events </div> </div> ${((t,e)=>!t.loggedInAndAuthorized||!t._botId||t._showEvents||t._notFound?"":P` <table class="tasks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Duration</th> <th>Result</th> </tr> </thead> <tbody> ${e.map(Ht)} </tbody> </table> <button class="more_tasks" ?disabled=${!t._taskCursor} @click=${t._moreTasks} > Show More </button> `)(t,t._tasks)} ${((t,e)=>t.loggedInAndAuthorized&&t._botId&&t._showEvents&&!t._notFound?P` <div class="all-events"> <checkbox-sk ?checked=${t._showAll} @click=${t._toggleShowAll}> </checkbox-sk> <span>Show all events</span> </div> <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> ${e.map((e=>((t,e,s)=>e||t.message?P` <tr> <td class="message">${[t.message,t.maintenanceMsg,t.state.quarantined].filter(Boolean).join("\n")}</td> <td>${t.eventType}</td> <td>${t.humanized.time.ts}</td> <td> <a target="_blank" rel="noopener" href=${Y(t.taskId)}> ${t.taskId} </a> </td> <td class=${s===t.version?"":"old_version"}> ${t.version&&t.version.substring(0,10)} </td> </tr>`:"")(e,t._showAll,t.serverDetails.botVersion)))} </tbody> </table> <button class="more_events" ?disabled=${!t._eventsCursor} @click=${t._moreEvents} > Show More </button> `:"")(t,t._events)} </main> <footer></footer> ${(t=>"shutdown"===t._promptType?(t=>P` <dialog-pop-over> <div class="prompt-dialog content"> <div class="vertical grid reason"> <div>Are you sure you want to ${t._prompt}?</div> <div class="horizontal layout terminate"> <label for="reason">Shutdown reason (optional)</label> <input type="text" id="reason" name="reason" /> </div> <div class="horizontal layout end"> <button @click=${t._closePopup} class="cancel" tabindex="0"> NO </button> <button @click=${t._promptCallback} class="ok" tabindex="0"> YES </button> </div> </div> </div> </dialog-pop-over>`)(t):(t=>P` <dialog-pop-over> <div class="prompt-dialog content"> Are you sure you want to ${t._prompt}? <div class="horizontal layout end"> <button @click=${t._closePopup} class="cancel" tabindex="0"> NO </button> <button @click=${t._promptCallback} class="ok" tabindex="0"> YES </button> </div> </div> </dialog-pop-over>`)(t))(t)} </swarming-app> `;window.customElements.define("bot-page",class extends Nt{constructor(){super(Pt),this._botId="",this._showState=!1,this._showEvents=!1,this._showAll=!1,this._urlParamsLoaded=!1,this._stateChanged=R((()=>({id:this._botId,s:this._showState,e:this._showEvents,a:this._showAll})),(t=>{this._botId=t.id||this._botId,this._showState=t.s,this._showEvents=t.e,this._showAll=t.a,this._urlParamsLoaded=!0,this._fetch(),this.render()})),this._bot=st({}),this._notFound=!1,this._tasks=[],this._events=[],this._resetCursors(),this._promptCallback=()=>{},this._message="You must sign in to see anything useful.",this._fetchController=null}connectedCallback(){super.connectedCallback(),this._loginEvent=t=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this.render()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent)}_closePopup(){e("dialog-pop-over",this).hide()}_deleteBot(){this.app.addBusyTasks(1),this._createBotService().delete(this._botId).then((t=>{this._closePopup(),i("Request to delete bot sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>{this._closePopup(),this.prpcError(t,"bot/delete"),this.render()}))}_fetch(){if(!this.loggedInAndAuthorized||!this._urlParamsLoaded||!this._botId)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const t={authHeader:this.authHeader,signal:this._fetchController.signal};this.app._fetchPermissions(t,{botId:this._botId}),this.app.addBusyTasks(1);const e=this._createBotService();e.bot(this._botId).then((t=>{this._notFound=!1,this._bot=function(t){if(!t)return{};et(t,It),t.state=t.state||"{}",t.state=JSON.parse(t.state)||{},t.dimensions=t.dimensions||[];for(const e of t.dimensions)e.value.forEach((function(t,s){e.value[s]=vt(t,e.key)}));t.device_list=[];const e=t.state.devices;if(e)for(const s in e)if(e.hasOwnProperty(s)){const i=e[s];i.id=s,t.device_list.push(i);let n=0,o=0;i.temp=i.temp||{};for(const t in i.temp)i.temp.hasOwnProperty(t)&&(o+=parseFloat(i.temp[t]),n++);i.averageTemp=n?(o/n).toFixed(1):"???"}return t}(t),this.render(),this.app.finishedTask()})).catch((t=>{"NOT_FOUND"===t.codeName&&(this._bot=st({}),this._notFound=!0,this.render()),this.prpcError(t,"bot/data")})),this._taskCursor||(this.app.addBusyTasks(1),e.tasks(this._botId,this._taskCursor).then((t=>{this._taskCursor=t.cursor,this._tasks=Et(t.items),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bot/tasks")))),this._eventsCursor||(this.app.addBusyTasks(1),e.events(this._botId,this._eventsCursor).then((t=>{this._eventsCursor=t.cursor,this._events=bt(t.items),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bot/events"))))}_killTask(){this.app.addBusyTasks(1),this._createTasksService().cancel(this._bot.taskId,!0).then((t=>{this._closePopup(),i("Request to kill task sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>{this._closePopup(),this.prpcError(t,"task/kill"),this.render()}))}_moreEvents(){this._eventsCursor&&(this.app.addBusyTasks(1),this._createBotService().events(this._botId,this._eventsCursor).then((t=>{this._eventsCursor=t.cursor,this._events.push(...bt(t.items)),this.render(),this.app.finishedTask()})).catch((t=>this.fetchError(t,"bot/more_events"))))}_moreTasks(){this._taskCursor&&(this.app.addBusyTasks(1),this._createBotService().tasks(this._botId,this._taskCursor).then((t=>{this._taskCursor=t.cursor,this._tasks.push(...Et(t.items)),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bot/more_tasks"))))}_promptDelete(){this._promptType="delete",this._prompt=`delete dead bot '${this._botId}'`,this._promptCallback=this._deleteBot,this.render(),e("dialog-pop-over",this).show(),e("dialog-pop-over button.cancel",this).focus()}_promptKill(){this._promptType="kill",this._prompt=`kill running task '${this._bot.taskId}'`,this._promptCallback=this._killTask,this.render(),e("dialog-pop-over",this).show(),e("dialog-pop-over button.cancel",this).focus()}_promptShutdown(){this._promptType="shutdown",this._prompt=`gracefully shut down bot '${this._botId}'`,this._promptCallback=this._shutdownBot,this.render(),e("dialog-pop-over",this).show(),e("dialog-pop-over button.cancel",this).focus()}_refresh(){this._resetCursors(),this._fetch(),this.render()}render(){super.render(),e("#id_input",this).value=this._botId}_resetCursors(){this._taskCursor="",this._eventsCursor=""}_setShowEvents(t){this._showEvents=t,this._stateChanged(),this.render()}_shutdownBot(){this.app.addBusyTasks(1);const t=e("#reason").value;this._createBotService().terminate(this._botId,t).then((t=>{this._closePopup(),i("Request to shutdown bot sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>{this._closePopup(),this.prpcError(t,"bot/terminate"),this.render()}))}_toggleBotState(t){this._showState=!this._showState,this._stateChanged(),this.render()}_toggleShowAll(t){t.preventDefault(),this._showAll=!this._showAll,this._stateChanged(),this.render()}_updateID(t){const s=e("#id_input",this);this._botId=s.value,this._resetCursors(),this._stateChanged(),this._fetch(),this.render()}})})()})();
\ No newline at end of file
diff --git a/appengine/swarming/ui2/dist/public_bot_index.html b/appengine/swarming/ui2/dist/public_bot_index.html
index 248360a..106eeec 100644
--- a/appengine/swarming/ui2/dist/public_bot_index.html
+++ b/appengine/swarming/ui2/dist/public_bot_index.html
@@ -1 +1 @@
-<script defer src="/newres/public_bot_index-bundle.js?2152feea094c6431f77e"></script><link href="/newres/public_bot_index-bundle.css" rel="stylesheet"><title>Bot Page - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><bot-page></bot-page>
\ No newline at end of file
+<script defer src="/newres/public_bot_index-bundle.js?dc4efda9677a0276c30e"></script><link href="/newres/public_bot_index-bundle.css" rel="stylesheet"><title>Bot Page - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><bot-page></bot-page>
\ No newline at end of file
diff --git a/appengine/swarming/ui2/dist/public_botlist_index-bundle.js b/appengine/swarming/ui2/dist/public_botlist_index-bundle.js
index 4fdab93..0be1680 100644
--- a/appengine/swarming/ui2/dist/public_botlist_index-bundle.js
+++ b/appengine/swarming/ui2/dist/public_botlist_index-bundle.js
@@ -1 +1 @@
-(()=>{var e={445:function(e,t){"use strict";var s=this&&this.__awaiter||function(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const e in t.RpcCode)i[t.RpcCode[e]]=e;function n(e){return i[e]}t.rpcCodeToCodeName=n,t.PrpcClient=class{constructor(e=null){e=e||{},this.host=e.host||document.location.host,this.accessToken=e.accessToken||null,this.insecure=e.hasOwnProperty("insecure")&&Boolean(e.insecure),this.fetchImpl=e.fetchImpl||window.fetch.bind(window)}call(e,i,n,a){return s(this,void 0,void 0,(function*(){if(!e)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!n)throw new TypeError("missing required argument: message");if(!(n instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const s=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${e}/${i}`,l=this._requestOptions(n,a),c=yield this.fetchImpl(s,l);if(!c.headers.has("X-Prpc-Grpc-Code"))throw new o(c.status,"Invalid response: no X-Prpc-Grpc-Code response header");const h=Number.parseInt(c.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(h))throw new o(c.status,"Invalid X-Prpc-Grpc-Code response header");const d=yield c.text();if(h!==t.RpcCode.OK)throw new r(h,d);if(!d.startsWith(")]}'"))throw new o(c.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(d.substr(4))}))}_requestOptions(e,t){const s={accept:"application/json","content-type":"application/json"};return t&&Object.assign(s,t),this.accessToken&&(s.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:s,body:JSON.stringify(e)}}};class r extends Error{constructor(e,t){if(super(),this.code=e,this.description=t,null===e)throw new Error("missing required argument: code");this.codeName=n(e)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}t.GrpcError=r;class o extends Error{constructor(e,t){if(super(),this.httpStatus=e,this.description=t,null===e)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}t.ProtocolError=o},28:e=>{e.exports=function e(t,s){"use strict";var i,n,r=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,h=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},d=h(t).replace(o,"")||"",u=h(s).replace(o,"")||"",p=d.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=u.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),_=parseInt(d.match(l),16)||1!==p.length&&d.match(a)&&Date.parse(d),f=parseInt(u.match(l),16)||_&&u.match(a)&&Date.parse(u)||null;if(f){if(_<f)return-1;if(_>f)return 1}for(var g=0,v=Math.max(p.length,m.length);g<v;g++){if(i=!(p[g]||"").match(c)&&parseFloat(p[g])||p[g]||0,n=!(m[g]||"").match(c)&&parseFloat(m[g])||m[g]||0,isNaN(i)!==isNaN(n))return isNaN(i)?1:-1;if(typeof i!=typeof n&&(i+="",n+=""),i<n)return-1;if(i>n)return 1}return 0}}},t={};function s(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=new Promise((function(e,t){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)})),t=(e,t=document)=>t.querySelector(e);function i(e,t=1e4){"object"==typeof e&&(e=e.message||JSON.stringify(e));var s={message:e,duration:t};document.dispatchEvent(new CustomEvent("error-sk",{detail:s,bubbles:!0}))}const n=new WeakMap,r=e=>(...t)=>{const s=e(...t);return n.set(s,!0),s},o=e=>"function"==typeof e&&n.has(e),a=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,l=(e,t,s=null)=>{let i=t;for(;i!==s;){const t=i.nextSibling;e.removeChild(i),i=t}},c={},h={},d=`{{lit-${String(Math.random()).slice(2)}}}`,u=`\x3c!--${d}--\x3e`,p=new RegExp(`${d}|${u}`),m="$lit$";class _{constructor(e,t){this.parts=[],this.element=t;let s=-1,i=0;const n=[],r=t=>{const o=t.content,a=document.createTreeWalker(o,133,null,!1);let l=0;for(;a.nextNode();){s++;const t=a.currentNode;if(1===t.nodeType){if(t.hasAttributes()){const n=t.attributes;let r=0;for(let e=0;e<n.length;e++)n[e].value.indexOf(d)>=0&&r++;for(;r-- >0;){const n=e.strings[i],r=v.exec(n)[2],o=r.toLowerCase()+m,a=t.getAttribute(o).split(p);this.parts.push({type:"attribute",index:s,name:r,strings:a}),t.removeAttribute(o),i+=a.length-1}}"TEMPLATE"===t.tagName&&r(t)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(d)>=0){const r=t.parentNode,o=e.split(p),a=o.length-1;for(let e=0;e<a;e++)r.insertBefore(""===o[e]?g():document.createTextNode(o[e]),t),this.parts.push({type:"node",index:++s});""===o[a]?(r.insertBefore(g(),t),n.push(t)):t.data=o[a],i+=a}}else if(8===t.nodeType)if(t.data===d){const e=t.parentNode;null!==t.previousSibling&&s!==l||(s++,e.insertBefore(g(),t)),l=s,this.parts.push({type:"node",index:s}),null===t.nextSibling?t.data="":(n.push(t),s--),i++}else{let e=-1;for(;-1!==(e=t.data.indexOf(d,e+1));)this.parts.push({type:"node",index:-1})}}};r(t);for(const e of n)e.parentNode.removeChild(e)}}const f=e=>-1!==e.index,g=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class b{constructor(e,t,s){this._parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this._parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this._parts)void 0!==e&&e.commit()}_clone(){const e=a?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=this.template.parts;let s=0,i=0;const n=e=>{const r=document.createTreeWalker(e,133,null,!1);let o=r.nextNode();for(;s<t.length&&null!==o;){const e=t[s];if(f(e))if(i===e.index){if("node"===e.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(o.previousSibling),this._parts.push(e)}else this._parts.push(...this.processor.handleAttributeExpressions(o,e.name,e.strings,this.options));s++}else i++,"TEMPLATE"===o.nodeName&&n(o.content),o=r.nextNode();else this._parts.push(void 0),s++}};return n(e),a&&(document.adoptNode(e),customElements.upgrade(e)),e}}class w{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="";for(let s=0;s<e;s++){const e=this.strings[s],i=v.exec(e);t+=i?e.substr(0,i.index)+i[1]+i[2]+m+i[3]+d:e+u}return t+this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}const y=e=>null===e||!("object"==typeof e||"function"==typeof e);class k{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new E(this)}_getValue(){const e=this.strings,t=e.length-1;let s="";for(let i=0;i<t;i++){s+=e[i];const t=this.parts[i];if(void 0!==t){const e=t.value;if(null!=e&&(Array.isArray(e)||"string"!=typeof e&&e[Symbol.iterator]))for(const t of e)s+="string"==typeof t?t:String(t);else s+="string"==typeof e?e:String(e)}}return s+e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class E{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===c||y(e)&&e===this.value||(this.value=e,o(e)||(this.committer.dirty=!0))}commit(){for(;o(this.value);){const e=this.value;this.value=c,e(this)}this.value!==c&&this.committer.commit()}}class x{constructor(e){this.value=void 0,this._pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(g()),this.endNode=e.appendChild(g())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e._insert(this.startNode=g()),e._insert(this.endNode=g())}insertAfterPart(e){e._insert(this.startNode=g()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this._pendingValue=e}commit(){for(;o(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}const e=this._pendingValue;e!==c&&(y(e)?e!==this.value&&this._commitText(e):e instanceof w?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===h?(this.value=h,this.clear()):this._commitText(e))}_insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}_commitNode(e){this.value!==e&&(this.clear(),this._insert(e),this.value=e)}_commitText(e){const t=this.startNode.nextSibling;e=null==e?"":e,t===this.endNode.previousSibling&&3===t.nodeType?t.data=e:this._commitNode(document.createTextNode("string"==typeof e?e:String(e))),this.value=e}_commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof b&&this.value.template===t)this.value.update(e.values);else{const s=new b(t,e.processor,this.options),i=s._clone();s.update(e.values),this._commitNode(i),this.value=s}}_commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,i=0;for(const n of e)void 0===(s=t[i])&&(s=new x(this.options),t.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(t[i-1])),s.setValue(n),s.commit(),i++;i<t.length&&(t.length=i,this.clear(s&&s.endNode))}clear(e=this.startNode){l(this.startNode.parentNode,e.nextSibling,this.endNode)}}class C{constructor(e,t,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this._pendingValue=e}commit(){for(;o(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=c}}class A extends k{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new N(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class N extends E{}let T=!1;try{const e={get capture(){return T=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class I{constructor(e,t,s){this.value=void 0,this._pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this._boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this._pendingValue=e}commit(){for(;o(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=this._pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=$(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=c}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const $=e=>e&&(T?{capture:e.capture,passive:e.passive,once:e.once}:e.capture),S=new class{handleAttributeExpressions(e,t,s,i){const n=t[0];return"."===n?new A(e,t.slice(1),s).parts:"@"===n?[new I(e,t.slice(1),i.eventContext)]:"?"===n?[new C(e,t.slice(1),s)]:new k(e,t,s).parts}handleTextExpression(e){return new x(e)}};function D(e){let t=L.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},L.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const i=e.strings.join(d);return void 0===(s=t.keyString.get(i))&&(s=new _(e,e.getTemplateElement()),t.keyString.set(i,s)),t.stringsArray.set(e.strings,s),s}const L=new Map,P=new WeakMap,M=(e,t,s)=>{let i=P.get(t);void 0===i&&(l(t,t.firstChild),P.set(t,i=new x(Object.assign({templateFactory:D},s))),i.appendInto(t)),i.setValue(e),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const H=(e,...t)=>new w(e,t,"html",S),O=r((e=>t=>{if(void 0===e&&t instanceof E){if(e!==t.value){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else t.setValue(e)}));var U=s(28),V=s.n(U);function B(e){if(!e)return"";var t=[];return Object.keys(e).sort().forEach((function(s){e[s].forEach((function(e){t.push(encodeURIComponent(s)+"="+encodeURIComponent(e))}))})),t.join("&")}function G(e){var t=[];return Object.keys(e).sort().forEach((function(s){Array.isArray(e[s])?e[s].forEach((function(e){t.push(encodeURIComponent(s)+"="+encodeURIComponent(e))})):"object"==typeof e[s]?t.push(encodeURIComponent(s)+"="+encodeURIComponent(G(e[s]))):t.push(encodeURIComponent(s)+"="+encodeURIComponent(e[s]))})),t.join("&")}function W(e,t){t=t||{};for(var s={},i=e.split("&"),n=0;n<i.length;n++){var r=i[n].split("=",2);if(2==r.length){var o=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]);if(t.hasOwnProperty(o))switch(typeof t[o]){case"boolean":s[o]="true"==a;break;case"number":s[o]=Number(a);break;case"object":if(Array.isArray(t[o])){var l=s[o]||[];l.push(a),s[o]=l}else s[o]=W(a,t[o]);break;default:s[o]=a}else s[o]=a}}return s}const R=e=>JSON.parse(JSON.stringify(e));function K(t,s){let i=R(t()),n=!1;const r=()=>{n=!0;let e=W(window.location.search.slice(1),i);s(function(e,t){let s={};return Object.keys(t).forEach((function(i){e.hasOwnProperty(i)?s[i]=R(e[i]):s[i]=R(t[i])})),s}(e,i))};return e.then(r),window.addEventListener("popstate",r),()=>{if(!n)return;let e=G(function(e,t){let s={};return Object.keys(e).forEach((function(i){(function(e,t){if(typeof e!=typeof t)return!1;let s=typeof e;return"string"===s||"boolean"===s||"number"===s?e===t:"object"===s?Array.isArray(s)?JSON.stringify(e)===JSON.stringify(t):G(e)===G(t):void 0})(e[i],t[i])||(s[i]=e[i])})),s}(t(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+e)}}function z(e,t){if(e.hasOwnProperty(t)){let s=e[t];delete e[t],e[t]=s}}class F extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),z(this,"checked"),z(this,"disabled"),z(this,"name"),z(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(e){let t=!!e;this._input.checked=t,e?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){let t=!!e;this._input.disabled=t,t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(e){this.setAttribute("name",e),this._input.setAttribute("name",e)}get label(){return this._input.getAttribute("label")}set label(e){this.setAttribute("label",e),this._input.setAttribute("label",e)}attributeChangedCallback(e,t,s){if(!this._input)return;let i=null!=s;switch(e){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=s;break;case"label":this._label.textContent=s}}}window.customElements.define("checkbox-sk",F);const q=document.createElement("template");q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>',window.customElements.define("add-circle-icon-sk",class extends HTMLElement{connectedCallback(){let e=q.content.cloneNode(!0);this.appendChild(e)}});const j=document.createElement("template");j.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',window.customElements.define("cancel-icon-sk",class extends HTMLElement{connectedCallback(){let e=j.content.cloneNode(!0);this.appendChild(e)}});const X=document.createElement("template");X.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>',window.customElements.define("more-vert-icon-sk",class extends HTMLElement{connectedCallback(){let e=X.content.cloneNode(!0);this.appendChild(e)}});const Q=document.createElement("template");Q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',window.customElements.define("search-icon-sk",class extends HTMLElement{connectedCallback(){let e=Q.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("select-sk",class extends HTMLElement{constructor(){super(),this._obs=new MutationObserver((()=>this._bubbleUp())),this._selection=-1}connectedCallback(){z(this,"selection"),z(this,"disabled"),this.addEventListener("click",this._click),this._obs.observe(this,{childList:!0}),this._bubbleUp()}disconnectedCallback(){this.removeEventListener("click",this._click),this._obs.disconnect()}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?(this.setAttribute("disabled",""),this.selection=-1):(this.removeAttribute("disabled"),this._bubbleUp())}get selection(){return this._selection}set selection(e){this.disabled||(null!=e||(e=-1),this._selection=+e,this._rationalize())}_click(e){if(this.disabled)return;let t=this._selection,s=e.target;for(;s&&s.parentElement!==this;)s=s.parentElement;if(s&&s.parentElement===this)for(let e=0;e<this.children.length;e++)if(this.children[e]===s){this._selection=e;break}this._rationalize(),t!=this._selection&&this.dispatchEvent(new CustomEvent("selection-changed",{detail:{selection:this._selection},bubbles:!0}))}_rationalize(){for(let e=0;e<this.children.length;e++)this._selection===e?this.children[e].setAttribute("selected",""):this.children[e].removeAttribute("selected")}_bubbleUp(){if(this._selection=-1,!this.disabled){for(let e=0;e<this.children.length;e++)if(this.children[e].hasAttribute("selected")){this._selection=e;break}this._rationalize()}}});const J=new WeakMap,Y=r(((...e)=>t=>{let s=J.get(t);void 0===s&&(s={values:[]},J.set(t,s));const i=s.values;s.values=e;for(let n=0;n<e.length&&!(void 0!==s.lastRenderedIndex&&n>s.lastRenderedIndex);n++){const r=e[n];if(y(r)||"function"!=typeof r.then){t.setValue(r),s.lastRenderedIndex=n;break}void 0!==s.lastRenderedIndex&&"function"==typeof r.then&&r===i[n]||(s.lastRenderedIndex=void 0,Promise.resolve(r).then((e=>{const i=s.values.indexOf(r);i>-1&&(void 0===s.lastRenderedIndex||i<s.lastRenderedIndex)&&(s.lastRenderedIndex=i,t.setValue(e),t.commit())})))}})),Z=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}],ee=1048576,te=1024*ee,se=[{units:" PB",delta:0x4000000000000},{units:" TB",delta:1099511627776},{units:" GB",delta:te},{units:" MB",delta:ee},{units:" KB",delta:1024},{units:" B",delta:1}];function ie(e){if(e<0&&(e=-e),0===e)return"  0s";let t="";for(let s=0;s<Z.length;s++)if(Z[s].delta<=e){let i=Math.floor(e/Z[s].delta)+Z[s].units;for(;i.length<4;)i=" "+i;t+=i,e%=Z[s].delta}return t}function ne(e){let t=(("number"==typeof e?e:Date.parse(e))-Date.now())/1e3;return t<0&&(t*=-1),oe(t,Z)}function re(e,t=1){return Number.isInteger(t)&&(e*=t),oe(e,se)}function oe(e,t){for(let s=0;s<t.length-1;s++)if(Math.round(e/t[s+1].delta)*t[s+1].delta/t[s].delta>=1)return Math.round(e/t[s].delta)+t[s].units;let s=t.length-1;return Math.round(e/t[s].delta)+t[s].units}function ae(e,t,s=!0){z(e,t),void 0===e[t]&&e.hasAttribute(t)&&(e[t]=e.getAttribute(t),s&&e.removeAttribute(t))}class le{constructor(e){this._time=new Proxy(e,{get(e,t,s){let i=Reflect.get(e,t,s);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const n=i.toString(),r=n.substring(n.indexOf("("));return`${i.toLocaleString()} ${r}`}})}get time(){return this._time}}function ce(e,t){if(void 0!==e){for(const s of t){const t=e[s];"string"==typeof t&&(e[s]=new Date(t))}e.humanized=new le(e)}}var he=s(445);class de{constructor(e,t=null,s={}){const i={...s,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=e,t){const e=(e,s)=>(s.signal=t,fetch(e,s));i.fetchImpl=e}this._client=new he.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(e,t){const s={authorization:this._token};return this._client.call(this.service,e,t,s)}}class ue extends de{get service(){return"swarming.v2.Bots"}bot(e){return this._call("GetBot",{botId:e})}tasks(e,t){const s={sort:4,state:10,botId:e,cursor:t,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",s)}terminate(e,t){const s={botId:e,reason:t};return this._call("TerminateBot",s)}events(e,t){const s={limit:50,botId:e,cursor:t};return this._call("ListBotEvents",s)}delete(e){return this._call("DeleteBot",{botId:e})}count(e){return this._call("CountBots",{dimensions:e})}dimensions(e){return this._call("GetBotDimensions",{pool:e})}list(e){return this._call("ListBots",e)}}const pe=e=>H`<li>${e.key}:${e.value}</li>`;function me(e,t){const s=`Unexpected error loading ${t}: ${e.message}`;console.error(s),i(s,5e3)}window.customElements.define("bot-mass-delete",class extends HTMLElement{constructor(){super(),this._count="...",this._readyToDelete=!1,this._started=!1,this._finished=!1,this._progress=0,this._dimensions=void 0}connectedCallback(){ae(this,"authHeader"),ae(this,"dimensions"),this.render()}set dimensions(e){"string"==typeof e&&(e=e.split(",")),e.sort(),this._dimensions=e.map((e=>{const[t,s]=e.split(":");return{key:t,value:s}}))}get dimensions(){return this._dimensions}_deleteAll(){this._started=!0,this.dispatchEvent(new CustomEvent("bots-deleting-started",{bubbles:!0}));const e={dimensions:this.dimensions,limit:200,isDead:"TRUE"},t=new ue(this.authHeader);let s=[];t.list(e).then((e=>{const i=e=>{if(s=s.concat(e.items||[]),this.render(),e.cursor){const s={cursor:e.cursor,dimensions:this.dimensions,limit:200,isDead:"TRUE"};t.list(s).then(i).catch((e=>me(e,"bot-mass-delete/list (paging)")))}else{const e=s=>{if(!s.length)return this._finished=!0,this.render(),void this.dispatchEvent(new CustomEvent("bots-deleting-finished",{bubbles:!0}));const i=s.pop();t.delete(i.botId).then((()=>{this._progress++,this.render(),e(s)})).catch((e=>me(e,"bot-mass-delete/delete")))};e(s)}};i(e)})).catch((e=>me(e,"bot-mass-delete/list"))),this.render()}_fetchCount(){if(!this.authHeader)return void console.warn("no authHeader received, try refreshing the page?");const e=new ue(this.authHeader).count(this.dimensions).then((e=>(this._readyToDelete=!0,this.render(),parseInt(e.dead||0)))).catch((e=>me(e,"bot-mass-delete/count")));this._count=H`${Y(e,"...")}`}render(){var e;M(H` <div> You are about to delete all DEAD bots with the following dimensions: <ul> ${(e=this).dimensions.map(pe)} </ul> This is about ${e._count} bots. Once you start the process, the only way to partially stop it is to close this browser window. If that sounds good, click the button below. </div> <button class="delete" ?disabled=${!e._readyToDelete||e._started} @click=${e._deleteAll} tabindex="0" > Delete the bots </button> <div> <div ?hidden=${!e._started}> Progress: ${e._progress} deleted${e._finished?" - DONE.":"."} </div> <div> Note: the bot deletion is being done in browser - closing the window will stop the mass deletion. </div> </div> `,this,{eventContext:this})}show(){this._readyToDelete=!1,this._started=!1,this._finished=!1,this._progress=0,this._fetchCount(),this.render()}});const _e=document.createElement("template");_e.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const e=_e.content.cloneNode(!0);if(this.appendChild(e),this._backdrop=t(".backdrop",this),this._content=t(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const e=window.innerWidth,t=window.innerHeight,s=Math.min(this._content.offsetWidth,e-50),i=Math.min(this._content.offsetHeight,t-50);this._content.style.width=s,this._content.style.left=(e-s)/2,this._content.style.top=(t-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}});const fe=document.createElement("template");fe.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>',window.customElements.define("arrow-drop-down-icon-sk",class extends HTMLElement{connectedCallback(){let e=fe.content.cloneNode(!0);this.appendChild(e)}});const ge=document.createElement("template");ge.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 14l5-5 5 5z"/></svg>',window.customElements.define("arrow-drop-up-icon-sk",class extends HTMLElement{connectedCallback(){let e=ge.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("sort-toggle",class extends HTMLElement{constructor(){super()}connectedCallback(){ae(this,"currentKey"),ae(this,"key"),ae(this,"direction"),this.addEventListener("click",(()=>{this.toggle()})),this.render()}get currentKey(){return this._currentKey}set currentKey(e){this._currentKey=e,this.render()}get key(){return this._key}set key(e){this._key=e,this.render()}get direction(){return this._direction}set direction(e){this._direction=e,this.render()}toggle(){this.currentKey===this.key&&"asc"===this.direction?this.direction="desc":this.direction="asc",this.dispatchEvent(new CustomEvent("sort-change",{detail:{direction:this.direction,key:this.key},bubbles:!0}))}render(){var e;M(H` <arrow-drop-down-icon-sk ?hidden=${(e=this).key===e.currentKey&&"asc"===e.direction} > </arrow-drop-down-icon-sk> <arrow-drop-up-icon-sk ?hidden=${e.key===e.currentKey&&"desc"===e.direction} > </arrow-drop-up-icon-sk>`,this,{eventContext:this})}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),z(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(e){this.setAttribute("duration",e)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(e){e.detail.duration&&(this._toast.duration=e.detail.duration),this._toast.textContent=e.detail.message,this._toast.show()}});const ve=document.createElement("template");ve.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let e=ve.content.cloneNode(!0);this.appendChild(e)}});const be=document.createElement("template");function we(e){if(e.ok)return e.json();throw{message:`Bad network response: ${e.statusText}`,resp:e,status:e.status}}be.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let e=be.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){z(this,"active")}get active(){return this.hasAttribute("active")}set active(e){e?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){z(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((e=>{"anonymous:anonymous"!=e.identity&&(this._fireLoginEvent(e),this.render())}),(e=>{console.error(e),i(`Error getting auth state: ${JSON.stringify(e)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(e){this._profile={email:e.email,imageURL:e.picture},this._auth_header=`Bearer ${e.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(e){const t=window.location.pathname+window.location.search;window.location=t&&"/"!=t?`/auth/openid/${e}?r=${encodeURIComponent(t)}`:`/auth/openid/${e}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(we)}render(){var e;M((e=this).authHeader?H` <div> <img class="center" id="avatar" src="${e._profile.imageURL}" width="30" height="30" /> <span class="center">${e._profile.email}</span> <span class="center">|</span> <a class="center" @click=${e._logOut} href="#">Sign out</a> </div>`:H` <div> <a @click=${e._logIn} href="#">Sign in</a> </div>`,this,{eventContext:this})}attributeChangedCallback(e,t,s){this.render()}});class ye extends de{get service(){return"swarming.v2.Swarming"}permissions(e){return this._call("GetPermissions",e)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const ke=document.createElement("template");ke.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const Ee=document.createElement("template");Ee.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const xe="You must log in to see more details",Ce=document.createElement("template");function Ae(e,t){if(!Ne[t]||"none"===e||!e)return e;let s=Ne[t][e];if("gpu"===t){const i=e.split("-")[0];s=Ne[t][i]}else if("os"===t&&e.startsWith("Windows")){const i=e.split(".")[0];s=Ne[t][i]}return s?`${s} (${e})`:e}Ce.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:xe,botVersion:"",casViewerServer:""};const e=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,e),this._permissions={}}connectedCallback(){z(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(e=>{this._auth_header=e.detail.authHeader,this._profile=e.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(e){this._busyTaskCount+=e,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const e=this.querySelector("header"),t=e&&e.querySelector("aside"),s=this.querySelector("footer");if(!(e&&t&&t.classList.contains("hideable")))return;let i=ke.content.cloneNode(!0);e.insertBefore(i,e.firstElementChild),(i=e.firstElementChild).addEventListener("click",(e=>this._toggleMenu(e,t)));const n=Ee.content.cloneNode(!0);e.insertBefore(n,t),this._spinner=e.querySelector("spinner-sk");const r=document.createElement("span");r.classList.add("grow"),e.appendChild(r),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),e.appendChild(this._dynamicEle);const o=document.createElement("error-toast-sk");s.append(o);const a=Ce.content.cloneNode(!0);s.append(a)}_toggleMenu(e,t){t.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const e={authHeader:this._auth_header};this.addBusyTasks(1),new ye(e.authHeader).details().then((e=>{this._serverDetails=e,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{"PERMISSION_DENIED"===e.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(e),i(`Unexpected error loading details: ${e.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(e)}_fetchPermissions(e,t){return this.addBusyTasks(1),new ye(e.authHeader,e.signal).permissions(t||{}).then((e=>{this._permissions=e,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{403!==e.status&&(console.error(e),i(`Unexpected error loading permissions: ${e.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&M((e=>H` <div class="server-version"> AppEngine version: ${function(e,t){return t&&t.serverVersion?H`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(e,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",t.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${t.serverVersion}</a >`:xe}(e._projectId,e._serverDetails)} Git version:${function(e){if(!e||!e.serverVersion)return"";const t=e.serverVersion.split("-");if(t.length>=3)return console.error(`Invalid Git version. version=${e.serverVersion}`),"";const s=2==t.length?t[1]:t[0];return H`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${s}>${s}</a>`}(e._serverDetails)} </div> <oauth-login ?testing_offline=${e.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(e,t,s){this.render()}});const Ne={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}},Te="--";function Ie(e){if(!e)return{};const t=[];let s=0;for(const i in e)e.hasOwnProperty(i)&&(t.push(i+": "+e[i]),s+=+e[i]);return{average:s=(s/=t.length)?s.toFixed(1):"unknown",zones:t.join(" | ")||"unknown"}}function $e(e,t,s){return s=s||"UNKNOWN",Le(e,t)||Pe(e,t)||[s]}function Se(e,t,s){if(!t)return console.warn("falsey bot passed into column"),"";const i=Ze[e];if(i)return i(t,s);let n=Te;return-1!==Be.indexOf(e)&&(n="none"),function(e,t){if(t)return e.join(" | ");let s="";for(let t=0;t<e.length;t++)e[t]&&e[t].length>s.length&&(s=e[t]);return s}($e(t,e,n).map((t=>Ae(t,e))),s._verbose)}const De={id:function(e,t){return e.botId===t},status:function(e,t){return"quarantined"===t?e.quarantined:"maintenance"===t?!!e.maintenanceMsg:"dead"===t?e.isDead:!e.isDead},task:function(e,t){return"idle"===t?!e.taskId:!!e.taskId}};function Le(e,t){if(!e||!e.dimensions||!t)return null;for(let s=0;s<e.dimensions.length;s++)if(e.dimensions[s].key===t)return e.dimensions[s].value;return null}function Pe(e,t){if(!e||!e.state||!e.state[t])return null;const s=e.state[t];return Array.isArray(s)?s:[s]}const Me=["All","Alive","Busy","Idle","Dead","Quarantined","Maintenance"];function He(){return Me.map((e=>({label:e,key:""})))}function Oe(e,t,s){const i={},n=[];for(const t of e){const e=t.split(":",1)[0],s=t.substring(e.length+1);"status"===e?"alive"===s?i.isDead="FALSE":"quarantined"===s?i.quarantined="TRUE":"maintenance"===s?i.inMaintenance="TRUE":"dead"===s&&(i.isDead="TRUE"):"task"===e?"busy"===s?i.isBusy="TRUE":"idle"===s&&(i.isBusy="FALSE"):n.push({key:e,value:s})}return i.dimensions=n,i.limit=t,s&&(i.cursor=s),i}const Ue=["firstSeenTs","lastSeenTs","leaseExpirationTs"];function Ve(e,t){return e[0].value=parseInt(t.count||0),e[1].value=parseInt(t.count||0)-parseInt(t.dead||0),e[2].value=parseInt(t.busy||0),e[3].value=parseInt(t.count||0)-parseInt(t.busy||0),e[4].value=parseInt(t.dead||0),e[5].value=parseInt(t.quarantined||0),e[6].value=parseInt(t.maintenance||0),e}const Be=["device_os","device_type","gpu"],Ge=((We=["id","task"])||(We=[]),function(e,t){let s=We.indexOf(e);-1===s&&(s=We.length+1);let i=We.indexOf(t);return-1===i&&(i=We.length+1),s===i?e.localeCompare(t):s-i});var We;const Re={cores:!0,cpu:!0,gpu:!0,"host-cpu":!0,machineType:!0,os:!0,python:!0,xcode_version:!0,zone:!0},Ke=["quarantined","error","id"],ze=["task","externalIp","lastSeen","firstSeen","version","disk_space","uptime","running_time","status","internal_ip","battery_level","battery_voltage","battery_temperature","battery_status","battery_health","bot_temperature","device_temperature","serial_number"],Fe={id:"Bot Id",task:"Current Task",externalIp:"External IP",firstSeen:"First Seen",lastSeen:"Last Seen",version:"Client Code Version",android_devices:"Android Devices",battery_health:"Battery Health",battery_level:"Battery Level (%)",battery_status:"Battery Status",battery_temperature:"Battery Temp (°C)",battery_voltage:"Battery Voltage (mV)",bot_temperature:"Bot Temp (°C)",cores:"CPU Core Count",cpu:"CPU type",device:"Non-android Device",device_os:"Device OS",device_temperature:"Device Temp (°C)",device_type:"Device Type",disk_space:"Free Space (MB)",gpu:"GPU type",internal_ip:"Internal or Local IP",os:"OS",pool:"Pool",running_time:"Swarming Uptime",serial_number:"Device Serial Number",status:"Status",uptime:"Bot Uptime",xcode_version:"XCode Version"},qe={1:"Unknown",2:"Good",3:"Overheated",4:"Dead",5:"Over Voltage",6:"Unspecified Failure",7:"Too Cold"},je={1:"Unknown",2:"Charging",3:"Discharging",4:"Not Charging",5:"Full"};function Xe(e){return e.isDead?4:e.quarantined?3:e.maintenanceMsg?2:1}const Qe=["id"],Je={disk_space:(e,t,s)=>e*V()(t.disks[0].mb,s.disks[0].mb),id:(e,t,s)=>e*V()(t.botId,s.botId),firstSeen:(e,t,s)=>e*V()(t.firstSeenTs,s.firstSeenTs),lastSeen:(e,t,s)=>e*V()(t.lastSeenTs,s.lastSeenTs),status:(e,t,s)=>{const i=Xe(t),n=Xe(s);return i!==n?e*(i-n):t.isDead||t.quarantined||t.maintenanceMsg?e*(t.lastSeenTs-s.lastSeenTs):0},running_time:(e,t,s)=>e*V()(Pe(t,"running_time"),Pe(s,"running_time")),uptime:(e,t,s)=>e*V()(Pe(t,"uptime"),Pe(s,"uptime"))};function Ye(e){return(t,s)=>{const i=t.state.devices;return i&&i.length?i.map(e).join(" | "):"N/A - no devices"}}const Ze={version:(e,t)=>{const s=e.version||"UNKNOWN";return t._verbose?s:s.substring(0,10)},externalIp:(e,t)=>e.externalIp||Te,firstSeen:(e,t)=>e.humanized.time.firstSeenTs,id:(e,t)=>H`<a target="_blank" rel="noopener" href=${function(e){return`/bot?id=${e}`}(e.botId)} >${e.botId}</a >`,lastSeen:(e,t)=>t._verbose?function(e){let t=e.toString(),s=t.substring(t.indexOf("("));return e.toLocaleString()+" "+s}(e.lastSeenTs):function(e){return e?ne(e.getTime()):"eons"}(e.lastSeenTs)+" ago",status:(e,t)=>{if(e.isDead)return`Dead. Last seen ${ne(e.lastSeenTs)} ago`;if(e.quarantined){let t=Pe(e,"quarantined");t&&(t=t[0]),t&&"true"!==t&&!0!==t||(t=$e(e,"error")[0]),"UNKNOWN"===t&&(t=Le(e,"quarantined")||"UNKNOWN");const s=[];return function(e){return e.state.devices||[]}(e).forEach((function(e){s.push(e.state)})),s.length&&(t+=` devices: [${s.join(", ")}]`),`Quarantined: ${t}`}return e.maintenanceMsg?`Maintenance: ${e.maintenanceMsg}`:"Alive"},task:(e,t)=>{if(!e.taskId)return"idle";let s=e.taskId,i=e.taskName;return e.isDead&&(s="[died on task]",i=`Bot ${e.botId} was last seen running task ${e.taskId} (${e.taskName})`),H`<a target="_blank" rel="noopener" title=${i} href=${function(e,t){if(e)return`/task?id=${e=e.substring(0,e.length-1)+"0"}`}(e.taskId)} >${s}</a >`},android_devices:(e,t)=>{const s=$e(e,"android_devices","0");return t._verbose?s.join(" | ")+" devices available":Math.max(...s)+" devices available"},battery_health:Ye((e=>{const t=e.battery&&e.battery.health||"UNKNOWN";return`${qe[t]||""} (${t})`})),battery_level:Ye((e=>e.battery&&e.battery.level||"UNKNOWN")),battery_status:Ye((e=>{const t=e.battery&&e.battery.status||"UNKNOWN";return`${je[t]||""} (${t})`})),battery_temperature:Ye((e=>e.battery&&e.battery.temperature/10||"UNKNOWN")),battery_voltage:Ye((e=>e.battery&&e.battery.voltage||"UNKNOWN")),bot_temperature:(e,t)=>t._verbose?e.state.temp.zones||"UNKNOWN":e.state.temp.average||"UNKNOWN",device_temperature:(e,t)=>{const s=e.state.devices;return s&&s.length?s.map((e=>t._verbose?e.temp.zones||UNKNOWN:e.temp.average||UNKNOWN)).join(" | "):"N/A - no devices"},disk_space:(e,t)=>{const s=[];for(const t of e.disks){const e=re(t.mb,ee);s.push(`${t.id} ${e} (${t.mb})`)}return t._verbose?s.join(" | "):s[0]},internal_ip:(e,t)=>$e(e,"ip",Te)[0],running_time:(e,t)=>{const s=Pe(e,"running_time");return s?ie(s):"UNKNOWN"},serial_number:Ye((e=>e.serial||"UNKNOWN")),uptime:(e,t)=>{const s=Pe(e,"uptime");return s?ie(s):"UNKNOWN"}};function et(e,t){return`${e}:${t}`}function tt(e,t){if(!t)return!0;if(!e)return!1;t=t.trim().toLocaleLowerCase(),e=e.toLocaleLowerCase();const s=t.split(" ");for(const t of s)if(-1!==e.indexOf(t))return!0;return!1}const st=document.createElement("template");st.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',window.customElements.define("expand-less-icon-sk",class extends HTMLElement{connectedCallback(){let e=st.content.cloneNode(!0);this.appendChild(e)}});const it=document.createElement("template");function nt(e){return e?H`<expand-less-icon-sk></expand-less-icon-sk>`:H`<expand-more-icon-sk></expand-more-icon-sk>`}it.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>',window.customElements.define("expand-more-icon-sk",class extends HTMLElement{connectedCallback(){let e=it.content.cloneNode(!0);this.appendChild(e)}});class rt extends de{get service(){return"swarming.v2.Tasks"}cancel(e,t){return this._call("CancelTask",{taskId:e,killRunning:t})}stdout(e,t,s){return this._call("GetStdout",{taskId:e,offset:t,length:s})}request(e){return this._call("GetRequest",{taskId:e})}result(e,t){return this._call("GetResult",{taskId:e,includePerformanceStats:t})}new(e){return this._call("NewTask",e)}count(e){return this._call("CountTasks",e)}list(e){return e.state||(e={...e,state:"QUERY_ALL"}),this._call("ListTasks",e)}massCancel(e){return this._call("CancelTasks",e)}}class ot extends HTMLElement{constructor(e){super(),this._template=e,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){z(this,"testing_offline"),this._authHeaderEvent=e=>{this._auth_header=e.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(e,t,s){"PERMISSION_DENIED"!==e.codeName||s?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(e,t,s){403!==e.status||s?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){M(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,M(this._template(this),this,{eventContext:this}))}attributeChangedCallback(e,t,s){this.render()}_createTasksService(){return new rt(this.authHeader,this._fetchController.signal)}_createBotService(){return new ue(this.authHeader,this._fetchController.signal)}}const at=e=>H`  <select-sk class="selector keys" @scroll=${e._scrollCheck} @selection-changed=${e._primaryKeyChanged} > ${e._filteredPrimaryArr.map((t=>((e,t)=>H` <div class="item" ?selected=${t._primaryKey===e}> <span class="key">${e}</span> </div>`)(t,e)))} </select-sk>  <select-sk class="selector values" disabled> ${(e=>{if(!e._primaryKey)return"";let t=e._primaryMap[e._primaryKey];return t?(t=function(e,t,s){const i=(s=s.trim()).indexOf(":");return-1!==i&&(s=s.substring(i+1)),!s||tt(t,s)?e:e.filter((e=>!!tt(e=Ae(e,t),s)))}(t,e._primaryKey,e._filterQuery),function(e){return Re[e]}(e._primaryKey)?t.sort(V()):t.sort(),t.map((t=>H` <div class="item"> <span class="value">${Ae(t,e._primaryKey)}</span> <span class="flex"></span> <add-circle-icon-sk ?hidden=${e._filters.indexOf(et(e._primaryKey,t))>=0} @click=${()=>e._addFilter(et(e._primaryKey,t))} > </add-circle-icon-sk> </div>`))):H` <div class="information_only"> Hmm... no preloaded values. Maybe try typing your filter like ${e._primaryKey}:foo-bar in the above box and hitting enter. </div>`})(e)} </select-sk>`,lt=(e,t)=>H` <tr> <td> <a href=${O(e._makeSummaryURL(t,!0))}>${t.label}</a>: </td> <td>${t.value}</td> </tr>`,ct=e=>H` <div class=header> <div class=filter_box ?hidden=${!e.loggedInAndAuthorized}> <search-icon-sk></search-icon-sk> <input id=filter_search class=search type=text placeholder='Search filters or supply a filter and press enter' @input=${e._refilterPrimaryKeys} @keyup=${e._filterSearch}> </input>  <div></div> ${at(e)} ${(e=>H` <div class="options"> <div class="verbose"> <checkbox-sk ?checked=${e._verbose} @click=${e._toggleVerbose}> </checkbox-sk> <span>Verbose Entries</span> </div> <a href=${e._matchingTasksLink()}>View Matching Tasks</a> <button id="delete_all" ?disabled=${!e.permissions.deleteBots} @click=${e._promptMassDelete} > DELETE ALL DEAD BOTS </button> </div>`)(e)} </div> ${(e=>H` <div class="summary" ?hidden=${!e._showFleetCounts}> <div class="fleet_header hider title" @click=${e._toggleFleetsCount}> <span>Fleet</span> ${nt(e._showFleetCounts)} </div> <table id="fleet_counts"> ${e._fleetCounts.map((t=>((e,t)=>H` <tr> <td> <a href=${O(e._makeSummaryURL(t,!1))}>${t.label}</a >: </td> <td>${t.value}</td> </tr>`)(e,t)))} </table> </div> <div class="summary"> <div class="fleet_header shower title" ?hidden=${e._showFleetCounts} @click=${e._toggleFleetsCount} > <span>Fleet</span> ${nt(e._showFleetCounts)} </div> <div class="title">Selected</div> <table id="query_counts"> ${lt(e,{label:"Displayed",value:e._bots.length})} ${e._queryCounts.map((t=>lt(e,t)))} </table> </div>`)(e)} </div> </div> <div class=chip_container> ${e._filters.map((t=>((e,t)=>H` <span class="chip"> <span>${function(e){const t=e.indexOf(":");if(t<0)return e;const s=e.substring(0,t);return`${s}:${Ae(e.substring(t+1),s.split("-tag")[0])}`}(e)}</span> <cancel-icon-sk @click=${()=>t._removeFilter(e)}></cancel-icon-sk> </span>`)(t,e)))} </div>`,ht=e=>H` <swarming-app id=swapp ?testing_offline=${e.testing_offline}> <header> <div class=title>Swarming Bot List</div> <aside class=hideable> <a href=/>Home</a> <a href=/tasklist>Task List</a> <a href=/bot>Bot Page</a> <a href=/task>Task Page</a> </aside> </header>  <main @click=${t=>e._showColSelector&&e._toggleColSelector(t)}> <h2 class=message ?hidden=${e.loggedInAndAuthorized}>${e._message}</h2> ${e.loggedInAndAuthorized?ct(e):""} <table class=bot-table ?hidden=${!e.loggedInAndAuthorized}> <thead> <tr> ${(e=>H`  <th class="col_options" @click=${e._toggleColSelector}> <span class="show_widget"> <more-vert-icon-sk tabindex="0" @keypress=${e._toggleColSelector} ></more-vert-icon-sk> </span> <span>Bot Id</span> <sort-toggle @click=${e=>e.stopPropagation()&&e.preventDefault()} key="id" .currentKey=${e._sort} .direction=${e._dir} > </sort-toggle> ${(e=>e._showColSelector?H`  <div class=col_selector @click=${e=>e.stopPropagation()}> <input id=column_search class=search type=text placeholder='Search columns to show' @input=${e._refilterPossibleColumns}  @keyup=${e._columnSearch}> </input> ${e._filteredPossibleColumns.map((t=>((e,t)=>H` <div class="item"> <span class="key">${e}</span> <span class="flex"></span> <checkbox-sk ?checked=${t._cols.indexOf(e)>=0} ?disabled=${Qe.indexOf(e)>=0} @click=${s=>t._toggleCol(s,e)} @keypress=${s=>t._toggleCol(s,e)} > </checkbox-sk> </div>`)(t,e)))} </div>`:"")(e)} </th>`)(e)}  ${e._cols.slice(1).map((t=>((e,t)=>H` <th> ${function(e){return Fe[e]||e}(e)} <sort-toggle .key=${e} .currentKey=${t._sort} .direction=${t._dir}> </sort-toggle> </th>`)(t,e)))} </tr> </thead> <tbody>${e._sortBots().map((t=>((e,t)=>H` <tr class="bot-row ${t._botClass(e)}"> ${t._cols.map((s=>((e,t,s)=>H` <td>${Se(e,t,s)}</td>`)(s,e,t)))} </tr>`)(t,e)))}</tbody> </table> <button ?hidden=${!e.loggedInAndAuthorized||!!e._filters.length||e._showAll} @click=${e._forceShowAll}> Show All </button> </main> <footer></footer> <dialog-pop-over> <div class='delete content'> <bot-mass-delete .authHeader=${e.authHeader} .dimensions=${function(e){const t=Object.keys(De);return e.filter((e=>{for(const s of t)if(e.startsWith(s+":"))return!1;return!0}))}(e._filters)}> </bot-mass-delete> <button class=goback tabindex=0 @click=${e._closePopup} ?disabled=${e._startedDeleting&&!e._finishedDeleting}> ${e._startedDeleting?"DISMISS":"GO BACK - DON'T DELETE ANYTHING"} </button> </div> </dialog-pop-over> </swarming-app>`;window.customElements.define("bot-list",class extends ot{constructor(){super(ht),this._bots=[],this._cols=[],this._dir="",this._filters=[],this._limit=0,this._primaryKey="",this._showAll=!1,this._showFleetCounts=!1,this._sort="",this._verbose=!1,this._fleetCounts=He(),this._queryCounts=He(),this._stateChanged=K((()=>({c:this._cols,d:this._dir,e:this._showFleetCounts,f:this._filters,k:this._primaryKey,s:this._sort,show_all:this._showAll,v:this._verbose})),(e=>{(function(e){const t={last_seen:"lastSeen",first_seen:"firstSeen",external_ip:"externalIp"};e.c=(e.c||[]).map((e=>t[e]||e));const s=t[e.s];s&&(e.s=s)})(e),this._cols=e.c,e.c.length||(this._cols=["id","task","os","status"]),this._dir=e.d||"asc",this._filters=e.f||[],this._primaryKey=e.k,this._sort=e.s||"id",this._verbose=e.v,this._showFleetCounts=e.e,this._limit=100,this._showAll=e.show_all,this._fetch(),this.render()})),this._primaryArr=[],this._filteredPrimaryArr=[],this._possibleColumns=[],this._filteredPossibleColumns=[],this._primaryMap={},this._message="You must sign in to see anything useful.",this._showColSelector=!1,this._columnQuery="",this._filterQuery="",this._fetchController=null,this._ignoreScrolls=0}connectedCallback(){super.connectedCallback(),this._loginEvent=e=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this._sortEvent=e=>{this._sort=e.detail.key,this._dir=e.detail.direction,this._stateChanged(),this.render()},this.addEventListener("sort-change",this._sortEvent),this._startedMassDeletingEvent=e=>{this._startedDeleting=!0,this._finishedDeleting=!1,this.render()},this.addEventListener("bots-deleting-started",this._startedMassDeletingEvent),this._finishedMassDeletingEvent=e=>{this._startedDeleting=!0,this._finishedDeleting=!0,this.render()},this.addEventListener("bots-deleting-finished",this._finishedMassDeletingEvent)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent),this.removeEventListener("sort-change",this._sortEvent),this.removeEventListener("bots-deleting-started",this._startedMassDeletingEvent),this.removeEventListener("bots-deleting-finished",this._finishedMassDeletingEvent)}_addFilter(e){this._filters.indexOf(e)>=0||(this._filters.push(e),this._stateChanged(),this._bots=function(e,t){const s=[];for(const t of e){const e=t.indexOf(":"),i=t.slice(0,e),n=t.slice(e+1);s.push([i,n])}return t.filter((e=>{let t=!0;for(const i of s){const[s,n]=i;De[s]?t&=De[s](e,n):t&=-1!==$e(e,s,[]).indexOf(n)}return t}))}(this._filters,this._bots),this._fetch(),this.render())}_botClass(e){let t="";return e.isDead&&(t+="dead "),e.quarantined&&(t+="quarantined "),e.maintenanceMsg&&(t+="maintenance "),e.version!==this.serverDetails.botVersion&&(t+="old_version"),t}_closePopup(e){t("dialog-pop-over",this).hide(),this._startedDeleting=!1,this._finishedDeleting=!1}_columnSearch(e){if("Enter"!==e.key)return;const s=t("#column_search",this),n=s.value.trim();if(-1!==this._possibleColumns.indexOf(n)){if(s.value="",this._columnQuery="",-1!==this._cols.indexOf(n))return this._refilterPossibleColumns(),void i(`Column "${n}" already displayed.`,5e3);this._cols.push(n),this._stateChanged(),this._refilterPossibleColumns()}else i(`Column "${n}" is not valid.`,5e3)}_fetch(){if(!this.loggedInAndAuthorized||!this._limit)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const e={authHeader:this.authHeader,signal:this._fetchController.signal};this.app._fetchPermissions(e,{tags:this._filters}).then((()=>{this._primaryMap={pool:this.permissions.listBots||[]},this._primaryArr=["pool"],this._filteredPrimaryArr=this._primaryArr.slice(),this._refilterPossibleColumns()}));const t=this._createBotService();this.app.addBusyTasks(1);let s=Oe(this._filters,this._limit);t.list(s).then((e=>{this._bots=[];const i=e=>{this._bots=this._bots.concat(function(e){if(!e)return[];for(const t of e){t.state=t.state&&JSON.parse(t.state)||{},ce(t,Ue);const e=t.state.disks||{},s=Object.keys(e);if(s.length){t.disks=[];for(let i=0;i<s.length;i++)t.disks.push({id:s[i],mb:e[s[i]].free_mb});t.disks.sort((function(e,t){return t.mb-e.mb}))}else t.disks=[{id:"unknown",mb:0}];t.state.temp=Ie(t.state.temp);const i=[],n=t&&t.state&&t.state.devices||{};for(const e in n)if(n.hasOwnProperty(e)){const s=n[e];s.serial=e,s.okay="available"===s.state;const r=Le(t,"device_type")||["UNKNOWN"];s.device_type=r[0],s.temp=Ie(s.temp),i.push(s)}i.sort(((e,t)=>e.serial<t.serial?-1:e.serial>t.serial?1:0)),t.state.devices=i}return e}(e.items)),this.render(),(this._filters.length||this._showAll)&&e.cursor?(this._limit=200,s=Oe(this._filters,this._limit,e.cursor),t.list(s).then(i).catch((e=>this.prpcError(e,"bots/list (paging)",!0)))):this.app.finishedTask()};i(e)})).catch((e=>this.prpcError(e,"bots/list",!0))),this.app.addBusyTasks(1),t.count(s.dimensions).then((e=>{this._queryCounts=Ve(this._queryCounts,e),this.render(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/count (query)",!0))),this._fleetCounts._queried||(this._fleetCounts._queried=!0,this.app.addBusyTasks(1),t.count([]).then((e=>{this._fleetCounts=Ve(this._fleetCounts,e),this.render(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/count (fleet)",!0)))),this.app.addBusyTasks(1);const i=this._filters.filter((e=>e.startsWith("pool:"))).map((e=>e.replace("pool:","")))[0]||"";new ue(this.authHeader).dimensions(i).then((e=>{this._primaryMap=function(e){const t={};(e=e||[]).forEach((function(e){Ke.indexOf(e.key)>=0||(t[e.key]=e.value)})),t.android_devices&&t.android_devices.push("0");for(const e of Be)t[e]&&-1===t[e].indexOf("none")&&t[e].push("none");return t.id=null,t.task=["busy","idle"],t.status=["alive","dead","quarantined","maintenance"],t}(e.botsDimensions),this._possibleColumns=function(e){if(!e)return[];const t=[];return e.forEach((function(e){-1===Ke.indexOf(e.key)&&t.push(e.key)})),t.push("id"),Array.prototype.push.apply(t,ze),t.sort(),t}(e.botsDimensions),this._filteredPossibleColumns=this._possibleColumns.slice(),this._primaryArr=Object.keys(this._primaryMap),this._primaryArr.sort(),this._filteredPrimaryArr=this._primaryArr.slice(),this._refilterPossibleColumns(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/dimensions",!0)))}_filterSearch(e){if("Enter"!==e.key)return;const s=t("#filter_search",this),n=s.value.trim();if(-1!==n.indexOf(":")){if(s.value="",this._filterQuery="",this._primaryKey="",-1!==this._filters.indexOf(n))return this._refilterPrimaryKeys(),void i(`Filter "${n}" is already active`,5e3);this._addFilter(n),this._refilterPrimaryKeys()}else i('Invalid filter.  Should be like "foo:bar"',5e3)}_forceShowAll(){this._showAll=!0,this._stateChanged(),this._fetch()}_makeSummaryURL(e,t){if(!e||"Displayed"===e.label||"All"===e.label)return;const s=e.label.toLowerCase();let i="status:"+s;"busy"!==s&&"idle"!==s||(i="task:"+s);const n=new URL(window.location.href);if(t){if(-1!==n.searchParams.getAll("f").indexOf(i))return;return n.searchParams.append("f",i),n.href}const r={s:[this._sort],c:this._cols,v:[this._verbose],f:[i],e:[!0]};return n.pathname+"?"+B(r)}_matchingTasksLink(){const e=["name","state","createdTs"],t=this._filters.filter((e=>!De[e.split(":")[0]]));for(const s of t){const t=s.split(":",1)[0];-1===e.indexOf(t)&&e.push(t)}return function(e=[],t=[],s,i){const n=[];for(const t of e)if(t.key&&t.value)if(Array.isArray(t.value))for(const e of t.value)n.push(t.key+":"+e);else n.push(t.key+":"+t.value);else n.push(t);const r={f:n,c:t};return s&&(r.st=[s.getTime()]),i&&(r.et=[i.getTime()],r.n=[!1]),"/tasklist?"+B(r)}(t,e)}_primaryKeyChanged(e){this._primaryKey=this._filteredPrimaryArr[e.detail.selection],this._stateChanged(),this.render()}_promptMassDelete(e){t("bot-mass-delete",this).show(),t("dialog-pop-over",this).show(),t("dialog-pop-over button.goback",this).focus()}_refilterPossibleColumns(e){const s=t("#column_search",this);this._columnQuery=s&&s.value||"",this._filteredPossibleColumns=function(e,t){return t?e.filter((e=>tt(e,t))):e}(this._possibleColumns,this._columnQuery),function(e,t){const s={};for(const e of t)s[e]=!0;e.sort(((e,t)=>{const i=s[e],n=s[t];return i&&!n?-1:n&&!i?1:i&&n?Ge(e,t):e.localeCompare(t)}))}(this._filteredPossibleColumns,this._cols),this.render()}_refilterPrimaryKeys(e){this._filterQuery=t("#filter_search",this).value,this._filteredPrimaryArr=function(e,t,s){if(!s)return e;if(-1===(s=s.trim()).indexOf(":"))return e.filter((e=>{if(tt(e,s))return!0;const i=t[e]||[];for(let t of i)if(tt(t=Ae(t,e),s))return!0;return!1}));const i=(s=s.split(":")[0])+"-tag";return e.filter((e=>e===s||e===i))}(this._primaryArr,this._primaryMap,this._filterQuery),this._filterQuery&&this._filteredPrimaryArr.length>0&&-1===this._filteredPrimaryArr.indexOf(this._primaryKey)&&(this._primaryKey=this._filteredPrimaryArr[0],this._stateChanged()),this.render()}_removeFilter(e){const t=this._filters.indexOf(e);-1!==t&&(this._filters.splice(t,1),this._stateChanged(),this._fetch(),this.render())}render(){(function(e){e.sort(Ge)})(this._cols),super.render(),this._scrollToPrimaryKey()}_scrollCheck(){this._ignoreScrolls>0?this._ignoreScrolls--:this._humanScrolledKeys=!0}_scrollToPrimaryKey(){const e=t(".keys.selector",this);if(this._primaryKey&&!this._humanScrolledKeys&&e){const s=t(".item[selected]",e);s&&(this._ignoreScrolls++,e.scrollTo({top:s.offsetTop-160}))}}_sortBots(){return this._bots.sort(((e,t)=>{const s=this._sort;if(!s)return 0;let i=1;"desc"===this._dir&&(i=-1);const n=Je[s];if(n)return n(i,e,t);let r=Se(s,e,this);"none"===r&&(r="zzz");let o=Se(s,t,this);return"none"===o&&(o="zzz"),i*V()(r,o)})),this._bots}_toggleCol(e,t){if(Qe.indexOf(t)>=0)return;e.preventDefault(),e.stopPropagation();const s=this._cols.indexOf(t);s>=0?this._cols.splice(s,1):this._cols.push(t),this._refilterPossibleColumns(),this._stateChanged(),this.render()}_toggleColSelector(e){e.preventDefault(),e.stopPropagation(),this._showColSelector=!this._showColSelector,this._refilterPossibleColumns()}_toggleFleetsCount(e){e.preventDefault(),e.stopPropagation(),this._showFleetCounts=!this._showFleetCounts,this._stateChanged(),this.render()}_toggleVerbose(e){e.preventDefault(),this._verbose=!this._verbose,this._stateChanged(),this.render()}})})()})();
\ No newline at end of file
+(()=>{var e={445:function(e,t){"use strict";var s=this&&this.__awaiter||function(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const e in t.RpcCode)i[t.RpcCode[e]]=e;function n(e){return i[e]}t.rpcCodeToCodeName=n,t.PrpcClient=class{constructor(e=null){e=e||{},this.host=e.host||document.location.host,this.accessToken=e.accessToken||null,this.insecure=e.hasOwnProperty("insecure")&&Boolean(e.insecure),this.fetchImpl=e.fetchImpl||window.fetch.bind(window)}call(e,i,n,a){return s(this,void 0,void 0,(function*(){if(!e)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!n)throw new TypeError("missing required argument: message");if(!(n instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const s=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${e}/${i}`,l=this._requestOptions(n,a),c=yield this.fetchImpl(s,l);if(!c.headers.has("X-Prpc-Grpc-Code"))throw new o(c.status,"Invalid response: no X-Prpc-Grpc-Code response header");const h=Number.parseInt(c.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(h))throw new o(c.status,"Invalid X-Prpc-Grpc-Code response header");const d=yield c.text();if(h!==t.RpcCode.OK)throw new r(h,d);if(!d.startsWith(")]}'"))throw new o(c.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(d.substr(4))}))}_requestOptions(e,t){const s={accept:"application/json","content-type":"application/json"};return t&&Object.assign(s,t),this.accessToken&&(s.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:s,body:JSON.stringify(e)}}};class r extends Error{constructor(e,t){if(super(),this.code=e,this.description=t,null===e)throw new Error("missing required argument: code");this.codeName=n(e)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}t.GrpcError=r;class o extends Error{constructor(e,t){if(super(),this.httpStatus=e,this.description=t,null===e)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}t.ProtocolError=o},28:e=>{e.exports=function e(t,s){"use strict";var i,n,r=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,h=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},d=h(t).replace(o,"")||"",u=h(s).replace(o,"")||"",p=d.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=u.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),_=parseInt(d.match(l),16)||1!==p.length&&d.match(a)&&Date.parse(d),f=parseInt(u.match(l),16)||_&&u.match(a)&&Date.parse(u)||null;if(f){if(_<f)return-1;if(_>f)return 1}for(var g=0,v=Math.max(p.length,m.length);g<v;g++){if(i=!(p[g]||"").match(c)&&parseFloat(p[g])||p[g]||0,n=!(m[g]||"").match(c)&&parseFloat(m[g])||m[g]||0,isNaN(i)!==isNaN(n))return isNaN(i)?1:-1;if(typeof i!=typeof n&&(i+="",n+=""),i<n)return-1;if(i>n)return 1}return 0}}},t={};function s(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=new Promise((function(e,t){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)})),t=(e,t=document)=>t.querySelector(e);function i(e,t=1e4){"object"==typeof e&&(e=e.message||JSON.stringify(e));var s={message:e,duration:t};document.dispatchEvent(new CustomEvent("error-sk",{detail:s,bubbles:!0}))}const n=new WeakMap,r=e=>(...t)=>{const s=e(...t);return n.set(s,!0),s},o=e=>"function"==typeof e&&n.has(e),a=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,l=(e,t,s=null)=>{let i=t;for(;i!==s;){const t=i.nextSibling;e.removeChild(i),i=t}},c={},h={},d=`{{lit-${String(Math.random()).slice(2)}}}`,u=`\x3c!--${d}--\x3e`,p=new RegExp(`${d}|${u}`),m="$lit$";class _{constructor(e,t){this.parts=[],this.element=t;let s=-1,i=0;const n=[],r=t=>{const o=t.content,a=document.createTreeWalker(o,133,null,!1);let l=0;for(;a.nextNode();){s++;const t=a.currentNode;if(1===t.nodeType){if(t.hasAttributes()){const n=t.attributes;let r=0;for(let e=0;e<n.length;e++)n[e].value.indexOf(d)>=0&&r++;for(;r-- >0;){const n=e.strings[i],r=v.exec(n)[2],o=r.toLowerCase()+m,a=t.getAttribute(o).split(p);this.parts.push({type:"attribute",index:s,name:r,strings:a}),t.removeAttribute(o),i+=a.length-1}}"TEMPLATE"===t.tagName&&r(t)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(d)>=0){const r=t.parentNode,o=e.split(p),a=o.length-1;for(let e=0;e<a;e++)r.insertBefore(""===o[e]?g():document.createTextNode(o[e]),t),this.parts.push({type:"node",index:++s});""===o[a]?(r.insertBefore(g(),t),n.push(t)):t.data=o[a],i+=a}}else if(8===t.nodeType)if(t.data===d){const e=t.parentNode;null!==t.previousSibling&&s!==l||(s++,e.insertBefore(g(),t)),l=s,this.parts.push({type:"node",index:s}),null===t.nextSibling?t.data="":(n.push(t),s--),i++}else{let e=-1;for(;-1!==(e=t.data.indexOf(d,e+1));)this.parts.push({type:"node",index:-1})}}};r(t);for(const e of n)e.parentNode.removeChild(e)}}const f=e=>-1!==e.index,g=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class b{constructor(e,t,s){this._parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this._parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this._parts)void 0!==e&&e.commit()}_clone(){const e=a?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=this.template.parts;let s=0,i=0;const n=e=>{const r=document.createTreeWalker(e,133,null,!1);let o=r.nextNode();for(;s<t.length&&null!==o;){const e=t[s];if(f(e))if(i===e.index){if("node"===e.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(o.previousSibling),this._parts.push(e)}else this._parts.push(...this.processor.handleAttributeExpressions(o,e.name,e.strings,this.options));s++}else i++,"TEMPLATE"===o.nodeName&&n(o.content),o=r.nextNode();else this._parts.push(void 0),s++}};return n(e),a&&(document.adoptNode(e),customElements.upgrade(e)),e}}class w{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="";for(let s=0;s<e;s++){const e=this.strings[s],i=v.exec(e);t+=i?e.substr(0,i.index)+i[1]+i[2]+m+i[3]+d:e+u}return t+this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}const y=e=>null===e||!("object"==typeof e||"function"==typeof e);class k{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new E(this)}_getValue(){const e=this.strings,t=e.length-1;let s="";for(let i=0;i<t;i++){s+=e[i];const t=this.parts[i];if(void 0!==t){const e=t.value;if(null!=e&&(Array.isArray(e)||"string"!=typeof e&&e[Symbol.iterator]))for(const t of e)s+="string"==typeof t?t:String(t);else s+="string"==typeof e?e:String(e)}}return s+e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class E{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===c||y(e)&&e===this.value||(this.value=e,o(e)||(this.committer.dirty=!0))}commit(){for(;o(this.value);){const e=this.value;this.value=c,e(this)}this.value!==c&&this.committer.commit()}}class x{constructor(e){this.value=void 0,this._pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(g()),this.endNode=e.appendChild(g())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e._insert(this.startNode=g()),e._insert(this.endNode=g())}insertAfterPart(e){e._insert(this.startNode=g()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this._pendingValue=e}commit(){for(;o(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}const e=this._pendingValue;e!==c&&(y(e)?e!==this.value&&this._commitText(e):e instanceof w?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===h?(this.value=h,this.clear()):this._commitText(e))}_insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}_commitNode(e){this.value!==e&&(this.clear(),this._insert(e),this.value=e)}_commitText(e){const t=this.startNode.nextSibling;e=null==e?"":e,t===this.endNode.previousSibling&&3===t.nodeType?t.data=e:this._commitNode(document.createTextNode("string"==typeof e?e:String(e))),this.value=e}_commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof b&&this.value.template===t)this.value.update(e.values);else{const s=new b(t,e.processor,this.options),i=s._clone();s.update(e.values),this._commitNode(i),this.value=s}}_commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,i=0;for(const n of e)void 0===(s=t[i])&&(s=new x(this.options),t.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(t[i-1])),s.setValue(n),s.commit(),i++;i<t.length&&(t.length=i,this.clear(s&&s.endNode))}clear(e=this.startNode){l(this.startNode.parentNode,e.nextSibling,this.endNode)}}class C{constructor(e,t,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this._pendingValue=e}commit(){for(;o(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=c}}class A extends k{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new N(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class N extends E{}let T=!1;try{const e={get capture(){return T=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class I{constructor(e,t,s){this.value=void 0,this._pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this._boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this._pendingValue=e}commit(){for(;o(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=this._pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=$(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=c}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const $=e=>e&&(T?{capture:e.capture,passive:e.passive,once:e.once}:e.capture),S=new class{handleAttributeExpressions(e,t,s,i){const n=t[0];return"."===n?new A(e,t.slice(1),s).parts:"@"===n?[new I(e,t.slice(1),i.eventContext)]:"?"===n?[new C(e,t.slice(1),s)]:new k(e,t,s).parts}handleTextExpression(e){return new x(e)}};function D(e){let t=L.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},L.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const i=e.strings.join(d);return void 0===(s=t.keyString.get(i))&&(s=new _(e,e.getTemplateElement()),t.keyString.set(i,s)),t.stringsArray.set(e.strings,s),s}const L=new Map,P=new WeakMap,M=(e,t,s)=>{let i=P.get(t);void 0===i&&(l(t,t.firstChild),P.set(t,i=new x(Object.assign({templateFactory:D},s))),i.appendInto(t)),i.setValue(e),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const H=(e,...t)=>new w(e,t,"html",S),O=r((e=>t=>{if(void 0===e&&t instanceof E){if(e!==t.value){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else t.setValue(e)}));var U=s(28),V=s.n(U);function B(e){if(!e)return"";var t=[];return Object.keys(e).sort().forEach((function(s){e[s].forEach((function(e){t.push(encodeURIComponent(s)+"="+encodeURIComponent(e))}))})),t.join("&")}function G(e){var t=[];return Object.keys(e).sort().forEach((function(s){Array.isArray(e[s])?e[s].forEach((function(e){t.push(encodeURIComponent(s)+"="+encodeURIComponent(e))})):"object"==typeof e[s]?t.push(encodeURIComponent(s)+"="+encodeURIComponent(G(e[s]))):t.push(encodeURIComponent(s)+"="+encodeURIComponent(e[s]))})),t.join("&")}function W(e,t){t=t||{};for(var s={},i=e.split("&"),n=0;n<i.length;n++){var r=i[n].split("=",2);if(2==r.length){var o=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]);if(t.hasOwnProperty(o))switch(typeof t[o]){case"boolean":s[o]="true"==a;break;case"number":s[o]=Number(a);break;case"object":if(Array.isArray(t[o])){var l=s[o]||[];l.push(a),s[o]=l}else s[o]=W(a,t[o]);break;default:s[o]=a}else s[o]=a}}return s}const R=e=>JSON.parse(JSON.stringify(e));function K(t,s){let i=R(t()),n=!1;const r=()=>{n=!0;let e=W(window.location.search.slice(1),i);s(function(e,t){let s={};return Object.keys(t).forEach((function(i){e.hasOwnProperty(i)?s[i]=R(e[i]):s[i]=R(t[i])})),s}(e,i))};return e.then(r),window.addEventListener("popstate",r),()=>{if(!n)return;let e=G(function(e,t){let s={};return Object.keys(e).forEach((function(i){(function(e,t){if(typeof e!=typeof t)return!1;let s=typeof e;return"string"===s||"boolean"===s||"number"===s?e===t:"object"===s?Array.isArray(s)?JSON.stringify(e)===JSON.stringify(t):G(e)===G(t):void 0})(e[i],t[i])||(s[i]=e[i])})),s}(t(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+e)}}function z(e,t){if(e.hasOwnProperty(t)){let s=e[t];delete e[t],e[t]=s}}class F extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),z(this,"checked"),z(this,"disabled"),z(this,"name"),z(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(e){let t=!!e;this._input.checked=t,e?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){let t=!!e;this._input.disabled=t,t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(e){this.setAttribute("name",e),this._input.setAttribute("name",e)}get label(){return this._input.getAttribute("label")}set label(e){this.setAttribute("label",e),this._input.setAttribute("label",e)}attributeChangedCallback(e,t,s){if(!this._input)return;let i=null!=s;switch(e){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=s;break;case"label":this._label.textContent=s}}}window.customElements.define("checkbox-sk",F);const q=document.createElement("template");q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>',window.customElements.define("add-circle-icon-sk",class extends HTMLElement{connectedCallback(){let e=q.content.cloneNode(!0);this.appendChild(e)}});const j=document.createElement("template");j.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',window.customElements.define("cancel-icon-sk",class extends HTMLElement{connectedCallback(){let e=j.content.cloneNode(!0);this.appendChild(e)}});const X=document.createElement("template");X.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>',window.customElements.define("more-vert-icon-sk",class extends HTMLElement{connectedCallback(){let e=X.content.cloneNode(!0);this.appendChild(e)}});const Q=document.createElement("template");Q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',window.customElements.define("search-icon-sk",class extends HTMLElement{connectedCallback(){let e=Q.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("select-sk",class extends HTMLElement{constructor(){super(),this._obs=new MutationObserver((()=>this._bubbleUp())),this._selection=-1}connectedCallback(){z(this,"selection"),z(this,"disabled"),this.addEventListener("click",this._click),this._obs.observe(this,{childList:!0}),this._bubbleUp()}disconnectedCallback(){this.removeEventListener("click",this._click),this._obs.disconnect()}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?(this.setAttribute("disabled",""),this.selection=-1):(this.removeAttribute("disabled"),this._bubbleUp())}get selection(){return this._selection}set selection(e){this.disabled||(null!=e||(e=-1),this._selection=+e,this._rationalize())}_click(e){if(this.disabled)return;let t=this._selection,s=e.target;for(;s&&s.parentElement!==this;)s=s.parentElement;if(s&&s.parentElement===this)for(let e=0;e<this.children.length;e++)if(this.children[e]===s){this._selection=e;break}this._rationalize(),t!=this._selection&&this.dispatchEvent(new CustomEvent("selection-changed",{detail:{selection:this._selection},bubbles:!0}))}_rationalize(){for(let e=0;e<this.children.length;e++)this._selection===e?this.children[e].setAttribute("selected",""):this.children[e].removeAttribute("selected")}_bubbleUp(){if(this._selection=-1,!this.disabled){for(let e=0;e<this.children.length;e++)if(this.children[e].hasAttribute("selected")){this._selection=e;break}this._rationalize()}}});const J=new WeakMap,Y=r(((...e)=>t=>{let s=J.get(t);void 0===s&&(s={values:[]},J.set(t,s));const i=s.values;s.values=e;for(let n=0;n<e.length&&!(void 0!==s.lastRenderedIndex&&n>s.lastRenderedIndex);n++){const r=e[n];if(y(r)||"function"!=typeof r.then){t.setValue(r),s.lastRenderedIndex=n;break}void 0!==s.lastRenderedIndex&&"function"==typeof r.then&&r===i[n]||(s.lastRenderedIndex=void 0,Promise.resolve(r).then((e=>{const i=s.values.indexOf(r);i>-1&&(void 0===s.lastRenderedIndex||i<s.lastRenderedIndex)&&(s.lastRenderedIndex=i,t.setValue(e),t.commit())})))}})),Z=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}],ee=1048576,te=1024*ee,se=[{units:" PB",delta:0x4000000000000},{units:" TB",delta:1099511627776},{units:" GB",delta:te},{units:" MB",delta:ee},{units:" KB",delta:1024},{units:" B",delta:1}];function ie(e){if(e<0&&(e=-e),0===e)return"  0s";let t="";for(let s=0;s<Z.length;s++)if(Z[s].delta<=e){let i=Math.floor(e/Z[s].delta)+Z[s].units;for(;i.length<4;)i=" "+i;t+=i,e%=Z[s].delta}return t}function ne(e){let t=(("number"==typeof e?e:Date.parse(e))-Date.now())/1e3;return t<0&&(t*=-1),oe(t,Z)}function re(e,t=1){return Number.isInteger(t)&&(e*=t),oe(e,se)}function oe(e,t){for(let s=0;s<t.length-1;s++)if(Math.round(e/t[s+1].delta)*t[s+1].delta/t[s].delta>=1)return Math.round(e/t[s].delta)+t[s].units;let s=t.length-1;return Math.round(e/t[s].delta)+t[s].units}function ae(e,t,s=!0){z(e,t),void 0===e[t]&&e.hasAttribute(t)&&(e[t]=e.getAttribute(t),s&&e.removeAttribute(t))}class le{constructor(e){this._time=new Proxy(e,{get(e,t,s){let i=Reflect.get(e,t,s);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const n=i.toString(),r=n.substring(n.indexOf("("));return`${i.toLocaleString()} ${r}`}})}get time(){return this._time}}function ce(e,t){if(void 0!==e){for(const s of t){const t=e[s];"string"==typeof t&&(e[s]=new Date(t))}e.humanized=new le(e)}}var he=s(445);class de{constructor(e,t=null,s={}){const i={...s,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=e,t){const e=(e,s)=>(s.signal=t,fetch(e,s));i.fetchImpl=e}this._client=new he.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(e,t){const s={authorization:this._token};return this._client.call(this.service,e,t,s)}}class ue extends de{get service(){return"swarming.v2.Bots"}bot(e){return this._call("GetBot",{botId:e})}tasks(e,t){const s={sort:4,state:10,botId:e,cursor:t,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",s)}terminate(e,t){const s={botId:e,reason:t};return this._call("TerminateBot",s)}events(e,t){const s={limit:50,botId:e,cursor:t};return this._call("ListBotEvents",s)}delete(e){return this._call("DeleteBot",{botId:e})}count(e){return this._call("CountBots",{dimensions:e})}dimensions(e){return this._call("GetBotDimensions",{pool:e})}list(e){return this._call("ListBots",e)}}const pe=e=>H`<li>${e.key}:${e.value}</li>`;function me(e,t){const s=`Unexpected error loading ${t}: ${e.message}`;console.error(s),i(s,5e3)}window.customElements.define("bot-mass-delete",class extends HTMLElement{constructor(){super(),this._count="...",this._readyToDelete=!1,this._started=!1,this._finished=!1,this._progress=0,this._dimensions=void 0}connectedCallback(){ae(this,"authHeader"),ae(this,"dimensions"),this.render()}set dimensions(e){"string"==typeof e&&(e=e.split(",")),e.sort(),this._dimensions=e.map((e=>{const[t,s]=e.split(":");return{key:t,value:s}}))}get dimensions(){return this._dimensions}_deleteAll(){this._started=!0,this.dispatchEvent(new CustomEvent("bots-deleting-started",{bubbles:!0}));const e={dimensions:this.dimensions,limit:200,isDead:"TRUE"},t=new ue(this.authHeader);let s=[];t.list(e).then((e=>{const i=e=>{if(s=s.concat(e.items||[]),this.render(),e.cursor){const s={cursor:e.cursor,dimensions:this.dimensions,limit:200,isDead:"TRUE"};t.list(s).then(i).catch((e=>me(e,"bot-mass-delete/list (paging)")))}else{const e=s=>{if(!s.length)return this._finished=!0,this.render(),void this.dispatchEvent(new CustomEvent("bots-deleting-finished",{bubbles:!0}));const i=s.pop();t.delete(i.botId).then((()=>{this._progress++,this.render(),e(s)})).catch((e=>me(e,"bot-mass-delete/delete")))};e(s)}};i(e)})).catch((e=>me(e,"bot-mass-delete/list"))),this.render()}_fetchCount(){if(!this.authHeader)return void console.warn("no authHeader received, try refreshing the page?");const e=new ue(this.authHeader).count(this.dimensions).then((e=>(this._readyToDelete=!0,this.render(),parseInt(e.dead||0)))).catch((e=>me(e,"bot-mass-delete/count")));this._count=H`${Y(e,"...")}`}render(){var e;M(H` <div> You are about to delete all DEAD bots with the following dimensions: <ul> ${(e=this).dimensions.map(pe)} </ul> This is about ${e._count} bots. Once you start the process, the only way to partially stop it is to close this browser window. If that sounds good, click the button below. </div> <button class="delete" ?disabled=${!e._readyToDelete||e._started} @click=${e._deleteAll} tabindex="0" > Delete the bots </button> <div> <div ?hidden=${!e._started}> Progress: ${e._progress} deleted${e._finished?" - DONE.":"."} </div> <div> Note: the bot deletion is being done in browser - closing the window will stop the mass deletion. </div> </div> `,this,{eventContext:this})}show(){this._readyToDelete=!1,this._started=!1,this._finished=!1,this._progress=0,this._fetchCount(),this.render()}});const _e=document.createElement("template");_e.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const e=_e.content.cloneNode(!0);if(this.appendChild(e),this._backdrop=t(".backdrop",this),this._content=t(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const e=window.innerWidth,t=window.innerHeight,s=Math.min(this._content.offsetWidth,e-50),i=Math.min(this._content.offsetHeight,t-50);this._content.style.width=s,this._content.style.left=(e-s)/2,this._content.style.top=(t-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}});const fe=document.createElement("template");fe.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>',window.customElements.define("arrow-drop-down-icon-sk",class extends HTMLElement{connectedCallback(){let e=fe.content.cloneNode(!0);this.appendChild(e)}});const ge=document.createElement("template");ge.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 14l5-5 5 5z"/></svg>',window.customElements.define("arrow-drop-up-icon-sk",class extends HTMLElement{connectedCallback(){let e=ge.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("sort-toggle",class extends HTMLElement{constructor(){super()}connectedCallback(){ae(this,"currentKey"),ae(this,"key"),ae(this,"direction"),this.addEventListener("click",(()=>{this.toggle()})),this.render()}get currentKey(){return this._currentKey}set currentKey(e){this._currentKey=e,this.render()}get key(){return this._key}set key(e){this._key=e,this.render()}get direction(){return this._direction}set direction(e){this._direction=e,this.render()}toggle(){this.currentKey===this.key&&"asc"===this.direction?this.direction="desc":this.direction="asc",this.dispatchEvent(new CustomEvent("sort-change",{detail:{direction:this.direction,key:this.key},bubbles:!0}))}render(){var e;M(H` <arrow-drop-down-icon-sk ?hidden=${(e=this).key===e.currentKey&&"asc"===e.direction} > </arrow-drop-down-icon-sk> <arrow-drop-up-icon-sk ?hidden=${e.key===e.currentKey&&"desc"===e.direction} > </arrow-drop-up-icon-sk>`,this,{eventContext:this})}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),z(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(e){this.setAttribute("duration",e)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(e){e.detail.duration&&(this._toast.duration=e.detail.duration),this._toast.textContent=e.detail.message,this._toast.show()}});const ve=document.createElement("template");ve.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let e=ve.content.cloneNode(!0);this.appendChild(e)}});const be=document.createElement("template");function we(e){if(e.ok)return e.json();throw{message:`Bad network response: ${e.statusText}`,resp:e,status:e.status}}be.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let e=be.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){z(this,"active")}get active(){return this.hasAttribute("active")}set active(e){e?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){z(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((e=>{"anonymous:anonymous"!=e.identity&&(this._fireLoginEvent(e),this.render())}),(e=>{console.error(e),i(`Error getting auth state: ${JSON.stringify(e)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(e){this._profile={email:e.email,imageURL:e.picture},this._auth_header=`Bearer ${e.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(e){const t=window.location.pathname+window.location.search;window.location=t&&"/"!=t?`/auth/openid/${e}?r=${encodeURIComponent(t)}`:`/auth/openid/${e}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(we)}render(){var e;M((e=this).authHeader?H` <div> <img class="center" id="avatar" src="${e._profile.imageURL}" width="30" height="30" /> <span class="center">${e._profile.email}</span> <span class="center">|</span> <a class="center" @click=${e._logOut} href="#">Sign out</a> </div>`:H` <div> <a @click=${e._logIn} href="#">Sign in</a> </div>`,this,{eventContext:this})}attributeChangedCallback(e,t,s){this.render()}});class ye extends de{get service(){return"swarming.v2.Swarming"}permissions(e){return this._call("GetPermissions",e)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const ke=document.createElement("template");ke.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const Ee=document.createElement("template");Ee.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const xe="You must log in to see more details",Ce=document.createElement("template");function Ae(e,t){if(!Ne[t]||"none"===e||!e)return e;let s=Ne[t][e];if("gpu"===t){const i=e.split("-")[0];s=Ne[t][i]}else if("os"===t&&e.startsWith("Windows")){const i=e.split(".")[0];s=Ne[t][i]}return s?`${s} (${e})`:e}Ce.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:xe,botVersion:"",casViewerServer:""};const e=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,e),this._permissions={}}connectedCallback(){z(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(e=>{this._auth_header=e.detail.authHeader,this._profile=e.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(e){this._busyTaskCount+=e,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const e=this.querySelector("header"),t=e&&e.querySelector("aside"),s=this.querySelector("footer");if(!(e&&t&&t.classList.contains("hideable")))return;let i=ke.content.cloneNode(!0);e.insertBefore(i,e.firstElementChild),(i=e.firstElementChild).addEventListener("click",(e=>this._toggleMenu(e,t)));const n=Ee.content.cloneNode(!0);e.insertBefore(n,t),this._spinner=e.querySelector("spinner-sk");const r=document.createElement("span");r.classList.add("grow"),e.appendChild(r),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),e.appendChild(this._dynamicEle);const o=document.createElement("error-toast-sk");s.append(o);const a=Ce.content.cloneNode(!0);s.append(a)}_toggleMenu(e,t){t.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const e={authHeader:this._auth_header};this.addBusyTasks(1),new ye(e.authHeader).details().then((e=>{this._serverDetails=e,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{"PERMISSION_DENIED"===e.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(e),i(`Unexpected error loading details: ${e.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(e)}_fetchPermissions(e,t){return this.addBusyTasks(1),new ye(e.authHeader,e.signal).permissions(t||{}).then((e=>{this._permissions=e,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{403!==e.status&&(console.error(e),i(`Unexpected error loading permissions: ${e.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&M((e=>H` <div class="server-version"> AppEngine version: ${function(e,t){return t&&t.serverVersion?H`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(e,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",t.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${t.serverVersion}</a >`:xe}(e._projectId,e._serverDetails)} Git version:${function(e){if(!e||!e.serverVersion)return"";const t=e.serverVersion.split("-");if(t.length>=3)return console.error(`Invalid Git version. version=${e.serverVersion}`),"";const s=2==t.length?t[1]:t[0];return H`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${s}>${s}</a>`}(e._serverDetails)} </div> <oauth-login ?testing_offline=${e.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(e,t,s){this.render()}});const Ne={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL",tangorpro:"Pixel Tablet","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}},Te="--";function Ie(e){if(!e)return{};const t=[];let s=0;for(const i in e)e.hasOwnProperty(i)&&(t.push(i+": "+e[i]),s+=+e[i]);return{average:s=(s/=t.length)?s.toFixed(1):"unknown",zones:t.join(" | ")||"unknown"}}function $e(e,t,s){return s=s||"UNKNOWN",Le(e,t)||Pe(e,t)||[s]}function Se(e,t,s){if(!t)return console.warn("falsey bot passed into column"),"";const i=Ze[e];if(i)return i(t,s);let n=Te;return-1!==Be.indexOf(e)&&(n="none"),function(e,t){if(t)return e.join(" | ");let s="";for(let t=0;t<e.length;t++)e[t]&&e[t].length>s.length&&(s=e[t]);return s}($e(t,e,n).map((t=>Ae(t,e))),s._verbose)}const De={id:function(e,t){return e.botId===t},status:function(e,t){return"quarantined"===t?e.quarantined:"maintenance"===t?!!e.maintenanceMsg:"dead"===t?e.isDead:!e.isDead},task:function(e,t){return"idle"===t?!e.taskId:!!e.taskId}};function Le(e,t){if(!e||!e.dimensions||!t)return null;for(let s=0;s<e.dimensions.length;s++)if(e.dimensions[s].key===t)return e.dimensions[s].value;return null}function Pe(e,t){if(!e||!e.state||!e.state[t])return null;const s=e.state[t];return Array.isArray(s)?s:[s]}const Me=["All","Alive","Busy","Idle","Dead","Quarantined","Maintenance"];function He(){return Me.map((e=>({label:e,key:""})))}function Oe(e,t,s){const i={},n=[];for(const t of e){const e=t.split(":",1)[0],s=t.substring(e.length+1);"status"===e?"alive"===s?i.isDead="FALSE":"quarantined"===s?i.quarantined="TRUE":"maintenance"===s?i.inMaintenance="TRUE":"dead"===s&&(i.isDead="TRUE"):"task"===e?"busy"===s?i.isBusy="TRUE":"idle"===s&&(i.isBusy="FALSE"):n.push({key:e,value:s})}return i.dimensions=n,i.limit=t,s&&(i.cursor=s),i}const Ue=["firstSeenTs","lastSeenTs","leaseExpirationTs"];function Ve(e,t){return e[0].value=parseInt(t.count||0),e[1].value=parseInt(t.count||0)-parseInt(t.dead||0),e[2].value=parseInt(t.busy||0),e[3].value=parseInt(t.count||0)-parseInt(t.busy||0),e[4].value=parseInt(t.dead||0),e[5].value=parseInt(t.quarantined||0),e[6].value=parseInt(t.maintenance||0),e}const Be=["device_os","device_type","gpu"],Ge=((We=["id","task"])||(We=[]),function(e,t){let s=We.indexOf(e);-1===s&&(s=We.length+1);let i=We.indexOf(t);return-1===i&&(i=We.length+1),s===i?e.localeCompare(t):s-i});var We;const Re={cores:!0,cpu:!0,gpu:!0,"host-cpu":!0,machineType:!0,os:!0,python:!0,xcode_version:!0,zone:!0},Ke=["quarantined","error","id"],ze=["task","externalIp","lastSeen","firstSeen","version","disk_space","uptime","running_time","status","internal_ip","battery_level","battery_voltage","battery_temperature","battery_status","battery_health","bot_temperature","device_temperature","serial_number"],Fe={id:"Bot Id",task:"Current Task",externalIp:"External IP",firstSeen:"First Seen",lastSeen:"Last Seen",version:"Client Code Version",android_devices:"Android Devices",battery_health:"Battery Health",battery_level:"Battery Level (%)",battery_status:"Battery Status",battery_temperature:"Battery Temp (°C)",battery_voltage:"Battery Voltage (mV)",bot_temperature:"Bot Temp (°C)",cores:"CPU Core Count",cpu:"CPU type",device:"Non-android Device",device_os:"Device OS",device_temperature:"Device Temp (°C)",device_type:"Device Type",disk_space:"Free Space (MB)",gpu:"GPU type",internal_ip:"Internal or Local IP",os:"OS",pool:"Pool",running_time:"Swarming Uptime",serial_number:"Device Serial Number",status:"Status",uptime:"Bot Uptime",xcode_version:"XCode Version"},qe={1:"Unknown",2:"Good",3:"Overheated",4:"Dead",5:"Over Voltage",6:"Unspecified Failure",7:"Too Cold"},je={1:"Unknown",2:"Charging",3:"Discharging",4:"Not Charging",5:"Full"};function Xe(e){return e.isDead?4:e.quarantined?3:e.maintenanceMsg?2:1}const Qe=["id"],Je={disk_space:(e,t,s)=>e*V()(t.disks[0].mb,s.disks[0].mb),id:(e,t,s)=>e*V()(t.botId,s.botId),firstSeen:(e,t,s)=>e*V()(t.firstSeenTs,s.firstSeenTs),lastSeen:(e,t,s)=>e*V()(t.lastSeenTs,s.lastSeenTs),status:(e,t,s)=>{const i=Xe(t),n=Xe(s);return i!==n?e*(i-n):t.isDead||t.quarantined||t.maintenanceMsg?e*(t.lastSeenTs-s.lastSeenTs):0},running_time:(e,t,s)=>e*V()(Pe(t,"running_time"),Pe(s,"running_time")),uptime:(e,t,s)=>e*V()(Pe(t,"uptime"),Pe(s,"uptime"))};function Ye(e){return(t,s)=>{const i=t.state.devices;return i&&i.length?i.map(e).join(" | "):"N/A - no devices"}}const Ze={version:(e,t)=>{const s=e.version||"UNKNOWN";return t._verbose?s:s.substring(0,10)},externalIp:(e,t)=>e.externalIp||Te,firstSeen:(e,t)=>e.humanized.time.firstSeenTs,id:(e,t)=>H`<a target="_blank" rel="noopener" href=${function(e){return`/bot?id=${e}`}(e.botId)} >${e.botId}</a >`,lastSeen:(e,t)=>t._verbose?function(e){let t=e.toString(),s=t.substring(t.indexOf("("));return e.toLocaleString()+" "+s}(e.lastSeenTs):function(e){return e?ne(e.getTime()):"eons"}(e.lastSeenTs)+" ago",status:(e,t)=>{if(e.isDead)return`Dead. Last seen ${ne(e.lastSeenTs)} ago`;if(e.quarantined){let t=Pe(e,"quarantined");t&&(t=t[0]),t&&"true"!==t&&!0!==t||(t=$e(e,"error")[0]),"UNKNOWN"===t&&(t=Le(e,"quarantined")||"UNKNOWN");const s=[];return function(e){return e.state.devices||[]}(e).forEach((function(e){s.push(e.state)})),s.length&&(t+=` devices: [${s.join(", ")}]`),`Quarantined: ${t}`}return e.maintenanceMsg?`Maintenance: ${e.maintenanceMsg}`:"Alive"},task:(e,t)=>{if(!e.taskId)return"idle";let s=e.taskId,i=e.taskName;return e.isDead&&(s="[died on task]",i=`Bot ${e.botId} was last seen running task ${e.taskId} (${e.taskName})`),H`<a target="_blank" rel="noopener" title=${i} href=${function(e,t){if(e)return`/task?id=${e=e.substring(0,e.length-1)+"0"}`}(e.taskId)} >${s}</a >`},android_devices:(e,t)=>{const s=$e(e,"android_devices","0");return t._verbose?s.join(" | ")+" devices available":Math.max(...s)+" devices available"},battery_health:Ye((e=>{const t=e.battery&&e.battery.health||"UNKNOWN";return`${qe[t]||""} (${t})`})),battery_level:Ye((e=>e.battery&&e.battery.level||"UNKNOWN")),battery_status:Ye((e=>{const t=e.battery&&e.battery.status||"UNKNOWN";return`${je[t]||""} (${t})`})),battery_temperature:Ye((e=>e.battery&&e.battery.temperature/10||"UNKNOWN")),battery_voltage:Ye((e=>e.battery&&e.battery.voltage||"UNKNOWN")),bot_temperature:(e,t)=>t._verbose?e.state.temp.zones||"UNKNOWN":e.state.temp.average||"UNKNOWN",device_temperature:(e,t)=>{const s=e.state.devices;return s&&s.length?s.map((e=>t._verbose?e.temp.zones||UNKNOWN:e.temp.average||UNKNOWN)).join(" | "):"N/A - no devices"},disk_space:(e,t)=>{const s=[];for(const t of e.disks){const e=re(t.mb,ee);s.push(`${t.id} ${e} (${t.mb})`)}return t._verbose?s.join(" | "):s[0]},internal_ip:(e,t)=>$e(e,"ip",Te)[0],running_time:(e,t)=>{const s=Pe(e,"running_time");return s?ie(s):"UNKNOWN"},serial_number:Ye((e=>e.serial||"UNKNOWN")),uptime:(e,t)=>{const s=Pe(e,"uptime");return s?ie(s):"UNKNOWN"}};function et(e,t){return`${e}:${t}`}function tt(e,t){if(!t)return!0;if(!e)return!1;t=t.trim().toLocaleLowerCase(),e=e.toLocaleLowerCase();const s=t.split(" ");for(const t of s)if(-1!==e.indexOf(t))return!0;return!1}const st=document.createElement("template");st.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',window.customElements.define("expand-less-icon-sk",class extends HTMLElement{connectedCallback(){let e=st.content.cloneNode(!0);this.appendChild(e)}});const it=document.createElement("template");function nt(e){return e?H`<expand-less-icon-sk></expand-less-icon-sk>`:H`<expand-more-icon-sk></expand-more-icon-sk>`}it.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>',window.customElements.define("expand-more-icon-sk",class extends HTMLElement{connectedCallback(){let e=it.content.cloneNode(!0);this.appendChild(e)}});class rt extends de{get service(){return"swarming.v2.Tasks"}cancel(e,t){return this._call("CancelTask",{taskId:e,killRunning:t})}stdout(e,t,s){return this._call("GetStdout",{taskId:e,offset:t,length:s})}request(e){return this._call("GetRequest",{taskId:e})}result(e,t){return this._call("GetResult",{taskId:e,includePerformanceStats:t})}new(e){return this._call("NewTask",e)}count(e){return this._call("CountTasks",e)}list(e){return e.state||(e={...e,state:"QUERY_ALL"}),this._call("ListTasks",e)}massCancel(e){return this._call("CancelTasks",e)}}class ot extends HTMLElement{constructor(e){super(),this._template=e,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){z(this,"testing_offline"),this._authHeaderEvent=e=>{this._auth_header=e.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(e,t,s){"PERMISSION_DENIED"!==e.codeName||s?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(e,t,s){403!==e.status||s?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){M(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,M(this._template(this),this,{eventContext:this}))}attributeChangedCallback(e,t,s){this.render()}_createTasksService(){return new rt(this.authHeader,this._fetchController.signal)}_createBotService(){return new ue(this.authHeader,this._fetchController.signal)}}const at=e=>H`  <select-sk class="selector keys" @scroll=${e._scrollCheck} @selection-changed=${e._primaryKeyChanged} > ${e._filteredPrimaryArr.map((t=>((e,t)=>H` <div class="item" ?selected=${t._primaryKey===e}> <span class="key">${e}</span> </div>`)(t,e)))} </select-sk>  <select-sk class="selector values" disabled> ${(e=>{if(!e._primaryKey)return"";let t=e._primaryMap[e._primaryKey];return t?(t=function(e,t,s){const i=(s=s.trim()).indexOf(":");return-1!==i&&(s=s.substring(i+1)),!s||tt(t,s)?e:e.filter((e=>!!tt(e=Ae(e,t),s)))}(t,e._primaryKey,e._filterQuery),function(e){return Re[e]}(e._primaryKey)?t.sort(V()):t.sort(),t.map((t=>H` <div class="item"> <span class="value">${Ae(t,e._primaryKey)}</span> <span class="flex"></span> <add-circle-icon-sk ?hidden=${e._filters.indexOf(et(e._primaryKey,t))>=0} @click=${()=>e._addFilter(et(e._primaryKey,t))} > </add-circle-icon-sk> </div>`))):H` <div class="information_only"> Hmm... no preloaded values. Maybe try typing your filter like ${e._primaryKey}:foo-bar in the above box and hitting enter. </div>`})(e)} </select-sk>`,lt=(e,t)=>H` <tr> <td> <a href=${O(e._makeSummaryURL(t,!0))}>${t.label}</a>: </td> <td>${t.value}</td> </tr>`,ct=e=>H` <div class=header> <div class=filter_box ?hidden=${!e.loggedInAndAuthorized}> <search-icon-sk></search-icon-sk> <input id=filter_search class=search type=text placeholder='Search filters or supply a filter and press enter' @input=${e._refilterPrimaryKeys} @keyup=${e._filterSearch}> </input>  <div></div> ${at(e)} ${(e=>H` <div class="options"> <div class="verbose"> <checkbox-sk ?checked=${e._verbose} @click=${e._toggleVerbose}> </checkbox-sk> <span>Verbose Entries</span> </div> <a href=${e._matchingTasksLink()}>View Matching Tasks</a> <button id="delete_all" ?disabled=${!e.permissions.deleteBots} @click=${e._promptMassDelete} > DELETE ALL DEAD BOTS </button> </div>`)(e)} </div> ${(e=>H` <div class="summary" ?hidden=${!e._showFleetCounts}> <div class="fleet_header hider title" @click=${e._toggleFleetsCount}> <span>Fleet</span> ${nt(e._showFleetCounts)} </div> <table id="fleet_counts"> ${e._fleetCounts.map((t=>((e,t)=>H` <tr> <td> <a href=${O(e._makeSummaryURL(t,!1))}>${t.label}</a >: </td> <td>${t.value}</td> </tr>`)(e,t)))} </table> </div> <div class="summary"> <div class="fleet_header shower title" ?hidden=${e._showFleetCounts} @click=${e._toggleFleetsCount} > <span>Fleet</span> ${nt(e._showFleetCounts)} </div> <div class="title">Selected</div> <table id="query_counts"> ${lt(e,{label:"Displayed",value:e._bots.length})} ${e._queryCounts.map((t=>lt(e,t)))} </table> </div>`)(e)} </div> </div> <div class=chip_container> ${e._filters.map((t=>((e,t)=>H` <span class="chip"> <span>${function(e){const t=e.indexOf(":");if(t<0)return e;const s=e.substring(0,t);return`${s}:${Ae(e.substring(t+1),s.split("-tag")[0])}`}(e)}</span> <cancel-icon-sk @click=${()=>t._removeFilter(e)}></cancel-icon-sk> </span>`)(t,e)))} </div>`,ht=e=>H` <swarming-app id=swapp ?testing_offline=${e.testing_offline}> <header> <div class=title>Swarming Bot List</div> <aside class=hideable> <a href=/>Home</a> <a href=/tasklist>Task List</a> <a href=/bot>Bot Page</a> <a href=/task>Task Page</a> </aside> </header>  <main @click=${t=>e._showColSelector&&e._toggleColSelector(t)}> <h2 class=message ?hidden=${e.loggedInAndAuthorized}>${e._message}</h2> ${e.loggedInAndAuthorized?ct(e):""} <table class=bot-table ?hidden=${!e.loggedInAndAuthorized}> <thead> <tr> ${(e=>H`  <th class="col_options" @click=${e._toggleColSelector}> <span class="show_widget"> <more-vert-icon-sk tabindex="0" @keypress=${e._toggleColSelector} ></more-vert-icon-sk> </span> <span>Bot Id</span> <sort-toggle @click=${e=>e.stopPropagation()&&e.preventDefault()} key="id" .currentKey=${e._sort} .direction=${e._dir} > </sort-toggle> ${(e=>e._showColSelector?H`  <div class=col_selector @click=${e=>e.stopPropagation()}> <input id=column_search class=search type=text placeholder='Search columns to show' @input=${e._refilterPossibleColumns}  @keyup=${e._columnSearch}> </input> ${e._filteredPossibleColumns.map((t=>((e,t)=>H` <div class="item"> <span class="key">${e}</span> <span class="flex"></span> <checkbox-sk ?checked=${t._cols.indexOf(e)>=0} ?disabled=${Qe.indexOf(e)>=0} @click=${s=>t._toggleCol(s,e)} @keypress=${s=>t._toggleCol(s,e)} > </checkbox-sk> </div>`)(t,e)))} </div>`:"")(e)} </th>`)(e)}  ${e._cols.slice(1).map((t=>((e,t)=>H` <th> ${function(e){return Fe[e]||e}(e)} <sort-toggle .key=${e} .currentKey=${t._sort} .direction=${t._dir}> </sort-toggle> </th>`)(t,e)))} </tr> </thead> <tbody>${e._sortBots().map((t=>((e,t)=>H` <tr class="bot-row ${t._botClass(e)}"> ${t._cols.map((s=>((e,t,s)=>H` <td>${Se(e,t,s)}</td>`)(s,e,t)))} </tr>`)(t,e)))}</tbody> </table> <button ?hidden=${!e.loggedInAndAuthorized||!!e._filters.length||e._showAll} @click=${e._forceShowAll}> Show All </button> </main> <footer></footer> <dialog-pop-over> <div class='delete content'> <bot-mass-delete .authHeader=${e.authHeader} .dimensions=${function(e){const t=Object.keys(De);return e.filter((e=>{for(const s of t)if(e.startsWith(s+":"))return!1;return!0}))}(e._filters)}> </bot-mass-delete> <button class=goback tabindex=0 @click=${e._closePopup} ?disabled=${e._startedDeleting&&!e._finishedDeleting}> ${e._startedDeleting?"DISMISS":"GO BACK - DON'T DELETE ANYTHING"} </button> </div> </dialog-pop-over> </swarming-app>`;window.customElements.define("bot-list",class extends ot{constructor(){super(ht),this._bots=[],this._cols=[],this._dir="",this._filters=[],this._limit=0,this._primaryKey="",this._showAll=!1,this._showFleetCounts=!1,this._sort="",this._verbose=!1,this._fleetCounts=He(),this._queryCounts=He(),this._stateChanged=K((()=>({c:this._cols,d:this._dir,e:this._showFleetCounts,f:this._filters,k:this._primaryKey,s:this._sort,show_all:this._showAll,v:this._verbose})),(e=>{(function(e){const t={last_seen:"lastSeen",first_seen:"firstSeen",external_ip:"externalIp"};e.c=(e.c||[]).map((e=>t[e]||e));const s=t[e.s];s&&(e.s=s)})(e),this._cols=e.c,e.c.length||(this._cols=["id","task","os","status"]),this._dir=e.d||"asc",this._filters=e.f||[],this._primaryKey=e.k,this._sort=e.s||"id",this._verbose=e.v,this._showFleetCounts=e.e,this._limit=100,this._showAll=e.show_all,this._fetch(),this.render()})),this._primaryArr=[],this._filteredPrimaryArr=[],this._possibleColumns=[],this._filteredPossibleColumns=[],this._primaryMap={},this._message="You must sign in to see anything useful.",this._showColSelector=!1,this._columnQuery="",this._filterQuery="",this._fetchController=null,this._ignoreScrolls=0}connectedCallback(){super.connectedCallback(),this._loginEvent=e=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this._sortEvent=e=>{this._sort=e.detail.key,this._dir=e.detail.direction,this._stateChanged(),this.render()},this.addEventListener("sort-change",this._sortEvent),this._startedMassDeletingEvent=e=>{this._startedDeleting=!0,this._finishedDeleting=!1,this.render()},this.addEventListener("bots-deleting-started",this._startedMassDeletingEvent),this._finishedMassDeletingEvent=e=>{this._startedDeleting=!0,this._finishedDeleting=!0,this.render()},this.addEventListener("bots-deleting-finished",this._finishedMassDeletingEvent)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent),this.removeEventListener("sort-change",this._sortEvent),this.removeEventListener("bots-deleting-started",this._startedMassDeletingEvent),this.removeEventListener("bots-deleting-finished",this._finishedMassDeletingEvent)}_addFilter(e){this._filters.indexOf(e)>=0||(this._filters.push(e),this._stateChanged(),this._bots=function(e,t){const s=[];for(const t of e){const e=t.indexOf(":"),i=t.slice(0,e),n=t.slice(e+1);s.push([i,n])}return t.filter((e=>{let t=!0;for(const i of s){const[s,n]=i;De[s]?t&=De[s](e,n):t&=-1!==$e(e,s,[]).indexOf(n)}return t}))}(this._filters,this._bots),this._fetch(),this.render())}_botClass(e){let t="";return e.isDead&&(t+="dead "),e.quarantined&&(t+="quarantined "),e.maintenanceMsg&&(t+="maintenance "),e.version!==this.serverDetails.botVersion&&(t+="old_version"),t}_closePopup(e){t("dialog-pop-over",this).hide(),this._startedDeleting=!1,this._finishedDeleting=!1}_columnSearch(e){if("Enter"!==e.key)return;const s=t("#column_search",this),n=s.value.trim();if(-1!==this._possibleColumns.indexOf(n)){if(s.value="",this._columnQuery="",-1!==this._cols.indexOf(n))return this._refilterPossibleColumns(),void i(`Column "${n}" already displayed.`,5e3);this._cols.push(n),this._stateChanged(),this._refilterPossibleColumns()}else i(`Column "${n}" is not valid.`,5e3)}_fetch(){if(!this.loggedInAndAuthorized||!this._limit)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const e={authHeader:this.authHeader,signal:this._fetchController.signal};this.app._fetchPermissions(e,{tags:this._filters}).then((()=>{this._primaryMap={pool:this.permissions.listBots||[]},this._primaryArr=["pool"],this._filteredPrimaryArr=this._primaryArr.slice(),this._refilterPossibleColumns()}));const t=this._createBotService();this.app.addBusyTasks(1);let s=Oe(this._filters,this._limit);t.list(s).then((e=>{this._bots=[];const i=e=>{this._bots=this._bots.concat(function(e){if(!e)return[];for(const t of e){t.state=t.state&&JSON.parse(t.state)||{},ce(t,Ue);const e=t.state.disks||{},s=Object.keys(e);if(s.length){t.disks=[];for(let i=0;i<s.length;i++)t.disks.push({id:s[i],mb:e[s[i]].free_mb});t.disks.sort((function(e,t){return t.mb-e.mb}))}else t.disks=[{id:"unknown",mb:0}];t.state.temp=Ie(t.state.temp);const i=[],n=t&&t.state&&t.state.devices||{};for(const e in n)if(n.hasOwnProperty(e)){const s=n[e];s.serial=e,s.okay="available"===s.state;const r=Le(t,"device_type")||["UNKNOWN"];s.device_type=r[0],s.temp=Ie(s.temp),i.push(s)}i.sort(((e,t)=>e.serial<t.serial?-1:e.serial>t.serial?1:0)),t.state.devices=i}return e}(e.items)),this.render(),(this._filters.length||this._showAll)&&e.cursor?(this._limit=200,s=Oe(this._filters,this._limit,e.cursor),t.list(s).then(i).catch((e=>this.prpcError(e,"bots/list (paging)",!0)))):this.app.finishedTask()};i(e)})).catch((e=>this.prpcError(e,"bots/list",!0))),this.app.addBusyTasks(1),t.count(s.dimensions).then((e=>{this._queryCounts=Ve(this._queryCounts,e),this.render(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/count (query)",!0))),this._fleetCounts._queried||(this._fleetCounts._queried=!0,this.app.addBusyTasks(1),t.count([]).then((e=>{this._fleetCounts=Ve(this._fleetCounts,e),this.render(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/count (fleet)",!0)))),this.app.addBusyTasks(1);const i=this._filters.filter((e=>e.startsWith("pool:"))).map((e=>e.replace("pool:","")))[0]||"";new ue(this.authHeader).dimensions(i).then((e=>{this._primaryMap=function(e){const t={};(e=e||[]).forEach((function(e){Ke.indexOf(e.key)>=0||(t[e.key]=e.value)})),t.android_devices&&t.android_devices.push("0");for(const e of Be)t[e]&&-1===t[e].indexOf("none")&&t[e].push("none");return t.id=null,t.task=["busy","idle"],t.status=["alive","dead","quarantined","maintenance"],t}(e.botsDimensions),this._possibleColumns=function(e){if(!e)return[];const t=[];return e.forEach((function(e){-1===Ke.indexOf(e.key)&&t.push(e.key)})),t.push("id"),Array.prototype.push.apply(t,ze),t.sort(),t}(e.botsDimensions),this._filteredPossibleColumns=this._possibleColumns.slice(),this._primaryArr=Object.keys(this._primaryMap),this._primaryArr.sort(),this._filteredPrimaryArr=this._primaryArr.slice(),this._refilterPossibleColumns(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/dimensions",!0)))}_filterSearch(e){if("Enter"!==e.key)return;const s=t("#filter_search",this),n=s.value.trim();if(-1!==n.indexOf(":")){if(s.value="",this._filterQuery="",this._primaryKey="",-1!==this._filters.indexOf(n))return this._refilterPrimaryKeys(),void i(`Filter "${n}" is already active`,5e3);this._addFilter(n),this._refilterPrimaryKeys()}else i('Invalid filter.  Should be like "foo:bar"',5e3)}_forceShowAll(){this._showAll=!0,this._stateChanged(),this._fetch()}_makeSummaryURL(e,t){if(!e||"Displayed"===e.label||"All"===e.label)return;const s=e.label.toLowerCase();let i="status:"+s;"busy"!==s&&"idle"!==s||(i="task:"+s);const n=new URL(window.location.href);if(t){if(-1!==n.searchParams.getAll("f").indexOf(i))return;return n.searchParams.append("f",i),n.href}const r={s:[this._sort],c:this._cols,v:[this._verbose],f:[i],e:[!0]};return n.pathname+"?"+B(r)}_matchingTasksLink(){const e=["name","state","createdTs"],t=this._filters.filter((e=>!De[e.split(":")[0]]));for(const s of t){const t=s.split(":",1)[0];-1===e.indexOf(t)&&e.push(t)}return function(e=[],t=[],s,i){const n=[];for(const t of e)if(t.key&&t.value)if(Array.isArray(t.value))for(const e of t.value)n.push(t.key+":"+e);else n.push(t.key+":"+t.value);else n.push(t);const r={f:n,c:t};return s&&(r.st=[s.getTime()]),i&&(r.et=[i.getTime()],r.n=[!1]),"/tasklist?"+B(r)}(t,e)}_primaryKeyChanged(e){this._primaryKey=this._filteredPrimaryArr[e.detail.selection],this._stateChanged(),this.render()}_promptMassDelete(e){t("bot-mass-delete",this).show(),t("dialog-pop-over",this).show(),t("dialog-pop-over button.goback",this).focus()}_refilterPossibleColumns(e){const s=t("#column_search",this);this._columnQuery=s&&s.value||"",this._filteredPossibleColumns=function(e,t){return t?e.filter((e=>tt(e,t))):e}(this._possibleColumns,this._columnQuery),function(e,t){const s={};for(const e of t)s[e]=!0;e.sort(((e,t)=>{const i=s[e],n=s[t];return i&&!n?-1:n&&!i?1:i&&n?Ge(e,t):e.localeCompare(t)}))}(this._filteredPossibleColumns,this._cols),this.render()}_refilterPrimaryKeys(e){this._filterQuery=t("#filter_search",this).value,this._filteredPrimaryArr=function(e,t,s){if(!s)return e;if(-1===(s=s.trim()).indexOf(":"))return e.filter((e=>{if(tt(e,s))return!0;const i=t[e]||[];for(let t of i)if(tt(t=Ae(t,e),s))return!0;return!1}));const i=(s=s.split(":")[0])+"-tag";return e.filter((e=>e===s||e===i))}(this._primaryArr,this._primaryMap,this._filterQuery),this._filterQuery&&this._filteredPrimaryArr.length>0&&-1===this._filteredPrimaryArr.indexOf(this._primaryKey)&&(this._primaryKey=this._filteredPrimaryArr[0],this._stateChanged()),this.render()}_removeFilter(e){const t=this._filters.indexOf(e);-1!==t&&(this._filters.splice(t,1),this._stateChanged(),this._fetch(),this.render())}render(){(function(e){e.sort(Ge)})(this._cols),super.render(),this._scrollToPrimaryKey()}_scrollCheck(){this._ignoreScrolls>0?this._ignoreScrolls--:this._humanScrolledKeys=!0}_scrollToPrimaryKey(){const e=t(".keys.selector",this);if(this._primaryKey&&!this._humanScrolledKeys&&e){const s=t(".item[selected]",e);s&&(this._ignoreScrolls++,e.scrollTo({top:s.offsetTop-160}))}}_sortBots(){return this._bots.sort(((e,t)=>{const s=this._sort;if(!s)return 0;let i=1;"desc"===this._dir&&(i=-1);const n=Je[s];if(n)return n(i,e,t);let r=Se(s,e,this);"none"===r&&(r="zzz");let o=Se(s,t,this);return"none"===o&&(o="zzz"),i*V()(r,o)})),this._bots}_toggleCol(e,t){if(Qe.indexOf(t)>=0)return;e.preventDefault(),e.stopPropagation();const s=this._cols.indexOf(t);s>=0?this._cols.splice(s,1):this._cols.push(t),this._refilterPossibleColumns(),this._stateChanged(),this.render()}_toggleColSelector(e){e.preventDefault(),e.stopPropagation(),this._showColSelector=!this._showColSelector,this._refilterPossibleColumns()}_toggleFleetsCount(e){e.preventDefault(),e.stopPropagation(),this._showFleetCounts=!this._showFleetCounts,this._stateChanged(),this.render()}_toggleVerbose(e){e.preventDefault(),this._verbose=!this._verbose,this._stateChanged(),this.render()}})})()})();
\ No newline at end of file
diff --git a/appengine/swarming/ui2/dist/public_botlist_index.html b/appengine/swarming/ui2/dist/public_botlist_index.html
index d543854..b438e18 100644
--- a/appengine/swarming/ui2/dist/public_botlist_index.html
+++ b/appengine/swarming/ui2/dist/public_botlist_index.html
@@ -1 +1 @@
-<script defer src="/newres/public_botlist_index-bundle.js?7db6eda7e0004f7abdb1"></script><link href="/newres/public_botlist_index-bundle.css" rel="stylesheet"><title>Bot List - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><bot-list></bot-list>
\ No newline at end of file
+<script defer src="/newres/public_botlist_index-bundle.js?c9b689905a4bc9932712"></script><link href="/newres/public_botlist_index-bundle.css" rel="stylesheet"><title>Bot List - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><bot-list></bot-list>
\ No newline at end of file
diff --git a/appengine/swarming/ui2/dist/public_task_index-bundle.js b/appengine/swarming/ui2/dist/public_task_index-bundle.js
index 767fa50..d75d15c 100644
--- a/appengine/swarming/ui2/dist/public_task_index-bundle.js
+++ b/appengine/swarming/ui2/dist/public_task_index-bundle.js
@@ -1 +1 @@
-(()=>{"use strict";var t={445:function(t,e){var s=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(n,r){function o(t){try{d(i.next(t))}catch(t){r(t)}}function a(t){try{d(i.throw(t))}catch(t){r(t)}}function d(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}d((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const t in e.RpcCode)i[e.RpcCode[t]]=t;function n(t){return i[t]}e.rpcCodeToCodeName=n,e.PrpcClient=class{constructor(t=null){t=t||{},this.host=t.host||document.location.host,this.accessToken=t.accessToken||null,this.insecure=t.hasOwnProperty("insecure")&&Boolean(t.insecure),this.fetchImpl=t.fetchImpl||window.fetch.bind(window)}call(t,i,n,a){return s(this,void 0,void 0,(function*(){if(!t)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!n)throw new TypeError("missing required argument: message");if(!(n instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const s=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${t}/${i}`,d=this._requestOptions(n,a),l=yield this.fetchImpl(s,d);if(!l.headers.has("X-Prpc-Grpc-Code"))throw new o(l.status,"Invalid response: no X-Prpc-Grpc-Code response header");const c=Number.parseInt(l.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(c))throw new o(l.status,"Invalid X-Prpc-Grpc-Code response header");const h=yield l.text();if(c!==e.RpcCode.OK)throw new r(c,h);if(!h.startsWith(")]}'"))throw new o(l.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(h.substr(4))}))}_requestOptions(t,e){const s={accept:"application/json","content-type":"application/json"};return e&&Object.assign(s,e),this.accessToken&&(s.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:s,body:JSON.stringify(t)}}};class r extends Error{constructor(t,e){if(super(),this.code=t,this.description=e,null===t)throw new Error("missing required argument: code");this.codeName=n(t)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}e.GrpcError=r;class o extends Error{constructor(t,e){if(super(),this.httpStatus=t,this.description=e,null===t)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}e.ProtocolError=o}},e={};function s(i){var n=e[i];if(void 0!==n)return n.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,s),r.exports}(()=>{const t=new Promise((function(t,e){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)})),e=(t,e=document)=>Array.prototype.slice.call(e.querySelectorAll(t)),i=(t,e=document)=>e.querySelector(t);function n(t,e=1e4){"object"==typeof t&&(t=t.message||JSON.stringify(t));var s={message:t,duration:e};document.dispatchEvent(new CustomEvent("error-sk",{detail:s,bubbles:!0}))}const r=new WeakMap,o=t=>"function"==typeof t&&r.has(t),a=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,d=(t,e,s=null)=>{let i=e;for(;i!==s;){const e=i.nextSibling;t.removeChild(i),i=e}},l={},c={},h=`{{lit-${String(Math.random()).slice(2)}}}`,u=`\x3c!--${h}--\x3e`,p=new RegExp(`${h}|${u}`),m="$lit$";class _{constructor(t,e){this.parts=[],this.element=e;let s=-1,i=0;const n=[],r=e=>{const o=e.content,a=document.createTreeWalker(o,133,null,!1);let d=0;for(;a.nextNode();){s++;const e=a.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const n=e.attributes;let r=0;for(let t=0;t<n.length;t++)n[t].value.indexOf(h)>=0&&r++;for(;r-- >0;){const n=t.strings[i],r=v.exec(n)[2],o=r.toLowerCase()+m,a=e.getAttribute(o).split(p);this.parts.push({type:"attribute",index:s,name:r,strings:a}),e.removeAttribute(o),i+=a.length-1}}"TEMPLATE"===e.tagName&&r(e)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(h)>=0){const r=e.parentNode,o=t.split(p),a=o.length-1;for(let t=0;t<a;t++)r.insertBefore(""===o[t]?f():document.createTextNode(o[t]),e),this.parts.push({type:"node",index:++s});""===o[a]?(r.insertBefore(f(),e),n.push(e)):e.data=o[a],i+=a}}else if(8===e.nodeType)if(e.data===h){const t=e.parentNode;null!==e.previousSibling&&s!==d||(s++,t.insertBefore(f(),e)),d=s,this.parts.push({type:"node",index:s}),null===e.nextSibling?e.data="":(n.push(e),s--),i++}else{let t=-1;for(;-1!==(t=e.data.indexOf(h,t+1));)this.parts.push({type:"node",index:-1})}}};r(e);for(const t of n)t.parentNode.removeChild(t)}}const g=t=>-1!==t.index,f=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class b{constructor(t,e,s){this._parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this._parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=a?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let s=0,i=0;const n=t=>{const r=document.createTreeWalker(t,133,null,!1);let o=r.nextNode();for(;s<e.length&&null!==o;){const t=e[s];if(g(t))if(i===t.index){if("node"===t.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(o.previousSibling),this._parts.push(t)}else this._parts.push(...this.processor.handleAttributeExpressions(o,t.name,t.strings,this.options));s++}else i++,"TEMPLATE"===o.nodeName&&n(o.content),o=r.nextNode();else this._parts.push(void 0),s++}};return n(t),a&&(document.adoptNode(t),customElements.upgrade(t)),t}}class k{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="";for(let s=0;s<t;s++){const t=this.strings[s],i=v.exec(t);e+=i?t.substr(0,i.index)+i[1]+i[2]+m+i[3]+h:t+u}return e+this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const w=t=>null===t||!("object"==typeof t||"function"==typeof t);class y{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new $(this)}_getValue(){const t=this.strings,e=t.length-1;let s="";for(let i=0;i<e;i++){s+=t[i];const e=this.parts[i];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)s+="string"==typeof e?e:String(e);else s+="string"==typeof t?t:String(t)}}return s+t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class ${constructor(t){this.value=void 0,this.committer=t}setValue(t){t===l||w(t)&&t===this.value||(this.value=t,o(t)||(this.committer.dirty=!0))}commit(){for(;o(this.value);){const t=this.value;this.value=l,t(this)}this.value!==l&&this.committer.commit()}}class I{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(f()),this.endNode=t.appendChild(f())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=f()),t._insert(this.endNode=f())}insertAfterPart(t){t._insert(this.startNode=f()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}const t=this._pendingValue;t!==l&&(w(t)?t!==this.value&&this._commitText(t):t instanceof k?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):t===c?(this.value=c,this.clear()):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof b&&this.value.template===e)this.value.update(t.values);else{const s=new b(e,t.processor,this.options),i=s._clone();s.update(t.values),this._commitNode(i),this.value=s}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,i=0;for(const n of t)void 0===(s=e[i])&&(s=new I(this.options),e.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(e[i-1])),s.setValue(n),s.commit(),i++;i<e.length&&(e.length=i,this.clear(s&&s.endNode))}clear(t=this.startNode){d(this.startNode.parentNode,t.nextSibling,this.endNode)}}class T{constructor(t,e,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=l}}class E extends y{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new C(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class C extends ${}let S=!1;try{const t={get capture(){return S=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class D{constructor(t,e,s){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this._boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=this._pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=x(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=l}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const x=t=>t&&(S?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),N=new class{handleAttributeExpressions(t,e,s,i){const n=e[0];return"."===n?new E(t,e.slice(1),s).parts:"@"===n?[new D(t,e.slice(1),i.eventContext)]:"?"===n?[new T(t,e.slice(1),s)]:new y(t,e,s).parts}handleTextExpression(t){return new I(t)}};function A(t){let e=P.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},P.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(h);return void 0===(s=e.keyString.get(i))&&(s=new _(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const P=new Map,L=new WeakMap,H=(t,e,s)=>{let i=L.get(e);void 0===i&&(d(e,e.firstChild),L.set(e,i=new I(Object.assign({templateFactory:A},s))),i.appendInto(e)),i.setValue(t),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const O=(t,...e)=>new k(t,e,"html",N),M=(G=t=>e=>{if(void 0===t&&e instanceof $){if(t!==e.value){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else e.setValue(t)},(...t)=>{const e=G(...t);return r.set(e,!0),e});var G;function B(t){if(!t)return"";var e=[];return Object.keys(t).sort().forEach((function(s){t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))}))})),e.join("&")}function R(t){var e=[];return Object.keys(t).sort().forEach((function(s){Array.isArray(t[s])?t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))})):"object"==typeof t[s]?e.push(encodeURIComponent(s)+"="+encodeURIComponent(R(t[s]))):e.push(encodeURIComponent(s)+"="+encodeURIComponent(t[s]))})),e.join("&")}function U(t,e){e=e||{};for(var s={},i=t.split("&"),n=0;n<i.length;n++){var r=i[n].split("=",2);if(2==r.length){var o=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]);if(e.hasOwnProperty(o))switch(typeof e[o]){case"boolean":s[o]="true"==a;break;case"number":s[o]=Number(a);break;case"object":if(Array.isArray(e[o])){var d=s[o]||[];d.push(a),s[o]=d}else s[o]=U(a,e[o]);break;default:s[o]=a}else s[o]=a}}return s}const V=t=>JSON.parse(JSON.stringify(t));function q(e,s){let i=V(e()),n=!1;const r=()=>{n=!0;let t=U(window.location.search.slice(1),i);s(function(t,e){let s={};return Object.keys(e).forEach((function(i){t.hasOwnProperty(i)?s[i]=V(t[i]):s[i]=V(e[i])})),s}(t,i))};return t.then(r),window.addEventListener("popstate",r),()=>{if(!n)return;let t=R(function(t,e){let s={};return Object.keys(t).forEach((function(i){(function(t,e){if(typeof t!=typeof e)return!1;let s=typeof t;return"string"===s||"boolean"===s||"number"===s?t===e:"object"===s?Array.isArray(s)?JSON.stringify(t)===JSON.stringify(e):R(t)===R(e):void 0})(t[i],e[i])||(s[i]=t[i])})),s}(e(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+t)}}function W(t,e){if(t.hasOwnProperty(e)){let s=t[e];delete t[e],t[e]=s}}class F extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),W(this,"checked"),W(this,"disabled"),W(this,"name"),W(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(t){let e=!!t;this._input.checked=e,t?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){let e=!!t;this._input.disabled=e,e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(t){this.setAttribute("name",t),this._input.setAttribute("name",t)}get label(){return this._input.getAttribute("label")}set label(t){this.setAttribute("label",t),this._input.setAttribute("label",t)}attributeChangedCallback(t,e,s){if(!this._input)return;let i=null!=s;switch(t){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=s;break;case"label":this._label.textContent=s}}}window.customElements.define("checkbox-sk",F);const z=document.createElement("template");z.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("add-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=z.content.cloneNode(!0);this.appendChild(t)}});const j=document.createElement("template");j.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("remove-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=j.content.cloneNode(!0);this.appendChild(t)}});const X=document.createElement("template");X.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const t=X.content.cloneNode(!0);if(this.appendChild(t),this._backdrop=i(".backdrop",this),this._content=i(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const t=window.innerWidth,e=window.innerHeight,s=Math.min(this._content.offsetWidth,t-50),i=Math.min(this._content.offsetHeight,e-50);this._content.style.width=s,this._content.style.left=(t-s)/2,this._content.style.top=(e-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}});const J=Symbol("loadScript"),K=Symbol("instance");let Y;const Q=new class{get[K](){return Y}set[K](t){Y=t}constructor(){if(this[K])return this[K];this[K]=this}reset(){Y=null}[J](){return this.scriptPromise||(this.scriptPromise=new Promise((t=>{const e=document.getElementsByTagName("body")[0],s=document.createElement("script");s.type="text/javascript",s.onload=function(){Q.api=window.google,Q.api.charts.load("current",{packages:["corechart","table"]}),Q.api.charts.setOnLoadCallback((()=>{t()}))},s.src="https://www.gstatic.com/charts/loader.js",e.appendChild(s)}))),this.scriptPromise}load(t,e){return this[J]().then((()=>{if(e){let s={};s=e instanceof Object?e:Array.isArray(e)?{packages:e}:{packages:[e]},this.api.charts.load("current",s),this.api.charts.setOnLoadCallback(t)}else{if("function"!=typeof t)throw"callback must be a function";t()}}))}},Z=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}],tt=1048576,et=1024*tt,st=[{units:" PB",delta:0x4000000000000},{units:" TB",delta:1099511627776},{units:" GB",delta:et},{units:" MB",delta:tt},{units:" KB",delta:1024},{units:" B",delta:1}];function it(t){if(t<0&&(t=-t),0===t)return"  0s";let e="";for(let s=0;s<Z.length;s++)if(Z[s].delta<=t){let i=Math.floor(t/Z[s].delta)+Z[s].units;for(;i.length<4;)i=" "+i;e+=i,t%=Z[s].delta}return e}function nt(t,e=1){return Number.isInteger(e)&&(t*=e),function(t,e){for(let s=0;s<e.length-1;s++)if(Math.round(t/e[s+1].delta)*e[s+1].delta/e[s].delta>=1)return Math.round(t/e[s].delta)+e[s].units;let s=e.length-1;return Math.round(t/e[s].delta)+e[s].units}(t,st)}function rt(t){let e=t.toString(),s=e.substring(e.indexOf("("));return t.toLocaleString()+" "+s}function ot(t=[],e=[]){const s=[];for(const e of t)if(e.key&&e.value)if(Array.isArray(e.value))for(const t of e.value)s.push(e.key+":"+t);else s.push(e.key+":"+e.value);else s.push(e);return"/botlist?"+B({f:s,c:e})}function at(t){if(0===t||"0"===t)return"0s";if(!t)return"--";const e=parseFloat(t);return e?e>60?it(e):e.toFixed(2)+"s":t+" seconds"}function dt(t,e,s=!0){W(t,e),void 0===t[e]&&t.hasAttribute(e)&&(t[e]=t.getAttribute(e),s&&t.removeAttribute(e))}function lt(t=[],e=[],s,i){const n=[];for(const e of t)if(e.key&&e.value)if(Array.isArray(e.value))for(const t of e.value)n.push(e.key+":"+t);else n.push(e.key+":"+e.value);else n.push(e);const r={f:n,c:e};return s&&(r.st=[s.getTime()]),i&&(r.et=[i.getTime()],r.n=[!1]),"/tasklist?"+B(r)}function ct(t,e){if(t)return e||(t=t.substring(0,t.length-1)+"0"),`/task?id=${t}`}class ht{constructor(t){this._time=new Proxy(t,{get(t,e,s){let i=Reflect.get(t,e,s);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const n=i.toString(),r=n.substring(n.indexOf("("));return`${i.toLocaleString()} ${r}`}})}get time(){return this._time}}function ut(t,e){if(void 0!==t){for(const s of e){const e=t[s];"string"==typeof e&&(t[s]=new Date(e))}t.humanized=new ht(t)}}function pt(t){if(void 0!==t)return t.humanized=new ht(t),t}const mt=new Promise(((t,e)=>{try{Q.load(t)}catch(t){e(t)}}));function _t(t){return"string"==typeof t?JSON.parse(t):t}window.customElements.define("stacked-time-chart",class extends HTMLElement{constructor(){super(),this._loaded=!1,this._error=""}connectedCallback(){dt(this,"colors"),dt(this,"labels"),dt(this,"values"),this._colors=_t(this._colors),this._labels=_t(this._labels),this._values=_t(this._values),mt.then((()=>{this._loaded=!0,this.render()})).catch((t=>{console.error(t),this._error="Could not load Google Charts JS from Internet",this.render()})),this.render()}get colors(){return this._colors}set colors(t){this._colors=t,this.render()}get labels(){return this._labels}set labels(t){this._labels=t,this.render()}get values(){return this._values}set values(t){this._values=t,this.render()}drawChart(){const t=Q.api.visualization.arrayToDataTable([["Type"].concat(this._labels),[""].concat(this._values)]);let e=0;for(const t of this._values)e+=+t;const s=[{v:0,f:""}];let i=0;if(e<120){for(let t=10;t<e;t+=10)s.push({v:t,f:t+"s"});i=5}else if(e<1500){for(let t=60;t<e;t+=60)s.push({v:t,f:t/60+"m"});i=e<300?5:e<900?1:0}else if(e<1e6){for(let t=600;t<e;t+=600)s.push({v:t,f:t/60+"m"});i=e<6e3?10:e<12e3?5:1}const n={width:400,height:250,isStacked:!0,chartArea:{width:"100%",height:"65%"},legend:{position:"top",maxLines:1,alignment:"center",textStyle:{fontSize:12}},colors:this._colors,hAxis:{title:"Time",ticks:s,minorGridlines:{count:i}}};new Q.api.visualization.BarChart(this.firstElementChild).draw(t,n)}render(){H(O`<div id="chart">${this._error}</div>`,this,{eventContext:this}),this._loaded&&this.drawChart()}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),W(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(t){this.setAttribute("duration",t)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(t){t.detail.duration&&(this._toast.duration=t.detail.duration),this._toast.textContent=t.detail.message,this._toast.show()}});const gt=document.createElement("template");gt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let t=gt.content.cloneNode(!0);this.appendChild(t)}});const ft=document.createElement("template");function vt(t){if(t.ok)return t.json();throw{message:`Bad network response: ${t.statusText}`,resp:t,status:t.status}}ft.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let t=ft.content.cloneNode(!0);this.appendChild(t)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){W(this,"active")}get active(){return this.hasAttribute("active")}set active(t){t?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){W(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((t=>{"anonymous:anonymous"!=t.identity&&(this._fireLoginEvent(t),this.render())}),(t=>{console.error(t),n(`Error getting auth state: ${JSON.stringify(t)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(t){this._profile={email:t.email,imageURL:t.picture},this._auth_header=`Bearer ${t.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(t){const e=window.location.pathname+window.location.search;window.location=e&&"/"!=e?`/auth/openid/${t}?r=${encodeURIComponent(e)}`:`/auth/openid/${t}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(vt)}render(){H((t=>t.authHeader?O` <div> <img class="center" id="avatar" src="${t._profile.imageURL}" width="30" height="30" /> <span class="center">${t._profile.email}</span> <span class="center">|</span> <a class="center" @click=${t._logOut} href="#">Sign out</a> </div>`:O` <div> <a @click=${t._logIn} href="#">Sign in</a> </div>`)(this),this,{eventContext:this})}attributeChangedCallback(t,e,s){this.render()}});var bt=s(445);class kt{constructor(t,e=null,s={}){const i={...s,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=t,e){const t=(t,s)=>(s.signal=e,fetch(t,s));i.fetchImpl=t}this._client=new bt.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(t,e){const s={authorization:this._token};return this._client.call(this.service,t,e,s)}}class wt extends kt{get service(){return"swarming.v2.Swarming"}permissions(t){return this._call("GetPermissions",t)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const yt=document.createElement("template");yt.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const $t=document.createElement("template");$t.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const It="You must log in to see more details",Tt=document.createElement("template");function Et(t,e){if(!Ct[e]||"none"===t||!t)return t;let s=Ct[e][t];if("gpu"===e){const i=t.split("-")[0];s=Ct[e][i]}else if("os"===e&&t.startsWith("Windows")){const i=t.split(".")[0];s=Ct[e][i]}return s?`${s} (${t})`:t}Tt.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:It,botVersion:"",casViewerServer:""};const t=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,t),this._permissions={}}connectedCallback(){W(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(t=>{this._auth_header=t.detail.authHeader,this._profile=t.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(t){this._busyTaskCount+=t,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const t=this.querySelector("header"),e=t&&t.querySelector("aside"),s=this.querySelector("footer");if(!(t&&e&&e.classList.contains("hideable")))return;let i=yt.content.cloneNode(!0);t.insertBefore(i,t.firstElementChild),(i=t.firstElementChild).addEventListener("click",(t=>this._toggleMenu(t,e)));const n=$t.content.cloneNode(!0);t.insertBefore(n,e),this._spinner=t.querySelector("spinner-sk");const r=document.createElement("span");r.classList.add("grow"),t.appendChild(r),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),t.appendChild(this._dynamicEle);const o=document.createElement("error-toast-sk");s.append(o);const a=Tt.content.cloneNode(!0);s.append(a)}_toggleMenu(t,e){e.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const t={authHeader:this._auth_header};this.addBusyTasks(1),new wt(t.authHeader).details().then((t=>{this._serverDetails=t,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{"PERMISSION_DENIED"===t.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(t),n(`Unexpected error loading details: ${t.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(t)}_fetchPermissions(t,e){return this.addBusyTasks(1),new wt(t.authHeader,t.signal).permissions(e||{}).then((t=>{this._permissions=t,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{403!==t.status&&(console.error(t),n(`Unexpected error loading permissions: ${t.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&H((t=>O` <div class="server-version"> AppEngine version: ${function(t,e){return e&&e.serverVersion?O`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(t,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",e.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${e.serverVersion}</a >`:It}(t._projectId,t._serverDetails)} Git version:${function(t){if(!t||!t.serverVersion)return"";const e=t.serverVersion.split("-");if(e.length>=3)return console.error(`Invalid Git version. version=${t.serverVersion}`),"";const s=2==e.length?e[1]:e[0];return O`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${s}>${s}</a>`}(t._serverDetails)} </div> <oauth-login ?testing_offline=${t.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(t,e,s){this.render()}});const Ct={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}},St=new Set(["PENDING","RUNNING"]),Dt=new Set(["TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED"]);function xt(t,e){const s=t.filter((function(t){return t.key===e}));if(!s.length)return null;const i=s[0].value;return i.length?i[0]:null}function Nt(t,e){return`${t}/${e.casInstance}/blobs/${e.digest.hash}/${e.digest.sizeBytes||0}/tree`}const At="${SWARMING_TASK_ID}";function Pt(t){return t.dedupedFrom}function Lt(t){return t&&"PENDING"!==t.state&&"NO_RESOURCE"!==t.state&&"CANCELED"!==t.state&&"EXPIRED"!==t.state}const Ht=["abandoned_ts","bot_idle_since_ts","completed_ts","created_ts","modified_ts","started_ts","abandonedTs","botIdleSinceTs","completedTs","createdTs","modifiedTs","startedTs"];class Ot extends kt{get service(){return"swarming.v2.Tasks"}cancel(t,e){return this._call("CancelTask",{taskId:t,killRunning:e})}stdout(t,e,s){return this._call("GetStdout",{taskId:t,offset:e,length:s})}request(t){return this._call("GetRequest",{taskId:t})}result(t,e){return this._call("GetResult",{taskId:t,includePerformanceStats:e})}new(t){return this._call("NewTask",t)}count(t){return this._call("CountTasks",t)}list(t){return t.state||(t={...t,state:"QUERY_ALL"}),this._call("ListTasks",t)}massCancel(t){return this._call("CancelTasks",t)}}class Mt extends kt{get service(){return"swarming.v2.Bots"}bot(t){return this._call("GetBot",{botId:t})}tasks(t,e){const s={sort:4,state:10,botId:t,cursor:e,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",s)}terminate(t,e){const s={botId:t,reason:e};return this._call("TerminateBot",s)}events(t,e){const s={limit:50,botId:t,cursor:e};return this._call("ListBotEvents",s)}delete(t){return this._call("DeleteBot",{botId:t})}count(t){return this._call("CountBots",{dimensions:t})}dimensions(t){return this._call("GetBotDimensions",{pool:t})}list(t){return this._call("ListBots",t)}}class Gt extends HTMLElement{constructor(t){super(),this._template=t,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){W(this,"testing_offline"),this._authHeaderEvent=t=>{this._auth_header=t.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(t,e,s){"PERMISSION_DENIED"!==t.codeName||s?"AbortError"!==t.name&&(console.error(t),n(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(t,e,s){403!==t.status||s?"AbortError"!==t.name&&(console.error(t),n(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){H(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,H(this._template(this),this,{eventContext:this}))}attributeChangedCallback(t,e,s){this.render()}_createTasksService(){return new Ot(this.authHeader,this._fetchController.signal)}_createBotService(){return new Mt(this.authHeader,this._fetchController.signal)}}const Bt=(t,e,s,i)=>{let n="https://console.cloud.google.com/logs/query";if(n+=`;query=${encodeURIComponent(e)}`,s&&(n+=`;cursorTimestamp=${s.toISOString()}`,i)){const t=[s,i].map((t=>t.toISOString())).join("/");n+=`;timeRange=${encodeURIComponent(t)}`}return n+`?project=${t}`},Rt='resource.type="gae_app"\n'+['protoPayload.resource:"/internal/"','protoPayload.resource:"/swarming/api/v1/bot/"','protoPayload.method!="GET"'].join(" OR ")+"\n",Ut=(t,e)=>{if(!t.createdTs)return[null,null];const s=new Date(t.createdTs.getTime()-6e4),i=e.completedTs||e.abandonedTs;return[s,i?new Date(i.getTime()+6e4):new Date]},Vt=(t,e,s,i,n)=>O` <tr ?hidden=${!e}> <td class=${"PENDING"===t.state?"bold":""}> ${"PENDING"===t.state?"Why Pending?":"Fleet Capacity"} </td> <td> ${qt(e,"count",0)} <a href=${ot(n.dimensions)}>bots</a> could possibly run this task (${qt(e,"busy",0)} busy, ${qt(e,"dead",0)} dead, ${qt(e,"quarantined",0)} quarantined, ${qt(e,"maintenance",0)} maintenance) </td> </tr> <tr ?hidden=${!s||!i}> <td>Similar Load</td> <td> ${qt(s)} <a href=${lt((n.dimensions||[]).concat({key:"state",value:"PENDING"}))} > similar pending tasks</a >, ${qt(i)} <a href=${lt((n.dimensions||[]).concat({key:"state",value:"RUNNING"}))} > similar running tasks</a > </td> </tr> `,qt=(t,e,s)=>!t||e&&void 0===t[e]?void 0!==s?s:O`<span class="italic">&lt;counting&gt</span>`:e?t[e]:t,Wt=t=>O` <tr> <td class="break-all"> <b class="dim_key">${t.key}:</b>${Et(t.value,t.key)} </td> </tr> `,Ft=(t,e,s)=>s.digest?O` <tr> <td>${t}</td> <td> <a href=${Nt(e,s)} target="_blank"> ${s.digest.hash}/${s.digest.sizeBytes} </a> </td> </tr>`:"",zt=(t,e,s)=>t&&t.length?O` <tr> <td rowspan=${t.length+1}>${e}</td> </tr> ${t.map(jt(s))}`:O` <tr> <td>${e}</td> <td>--</td> </tr>`,jt=t=>e=>O` <tr> <td class="break-all">${t(e)}</td> </tr> `,Xt=(t,e,s)=>O` <tr> <td>${t.path}/</td> </tr> <tr> <td class="break-all"> <span class="cipd-header">Requested: </span>${t.requested} </td> </tr> <tr ?hidden=${!s}> <td class="break-all"> <span class="cipd-header">Actual: </span> <a href=${function(t,e){if(!t||!e)return;const s=t.split(":");return 2===s.length?`${e}/p/${s[0]}/+/${s[1]}`:void 0}(t.actual,e.server)} target="_blank" rel="noopener" > ${t.actual} </a> </td> </tr> `,Jt=(t,e,s)=>{if(!t._taskId||t._notFound)return"";let i=null,n=null,r=null;if(s&&s.botDimensions){for(const t of s.botDimensions)"gcp"==t.key&&(n=t.value[0]),"zone"==t.key&&(r=t.value.reduce(((t,e)=>t.length>e.length?t:e)));(i=s.botLogsCloudProject)&&(n=i)}const o=!!n;return O` <div class="title">Logs Information</div> <div class="horizontal layout wrap"> <table class="task-info left"> <tbody> <tr> <td>Task related server Logs</td> <td> <a href=${((t,e,s,i)=>{const n=Rt+e.slice(0,-1),[r,o]=Ut(s,i);return Bt(t,n,r,o)})(t._projectId,t._taskId,e,s)} target="_blank" > View on Cloud Console </a> </td> </tr> <tr> <td>Bot related server Logs</td> <td> <a href=${((t,e,s)=>{const i=Rt+s.botId,[n,r]=Ut(e,s);return Bt(t,i,n,r)})(t._projectId,e,s)} target="_blank" ?hidden=${!s.botId} > View on Cloud Console </a> <p ?hidden=${s.botId}>--</p> </td> </tr> <tr> <td>Bot Logs</td> <td> <a href=${((t,e,s,i)=>{const n=`labels."compute.googleapis.com/resource_name":"${(t=>{if(!t)return t;const e=t.split("--");if(2==e.length)return e[0];if(e.length>2)throw Error("Unable to parse composite bot ID: "+t);return t})(i.botId)}"`;let r,o;if(i.startedTs){r=new Date(i.startedTs.getTime()-6e4);const t=i.completedTs||i.abandonedTs;o=t?new Date(t.getTime()+6e4):new Date}return Bt(t,n,r,o)})(n,0,0,s)} target="_blank" ?hidden=${!o} > View on Cloud Console </a> <p ?hidden=${o}>--</p> </td> </tr> </tbody> </table> </div> `},Kt=(t,e,s,i)=>{if(!t._taskId||t._notFound)return"";if(!s||!Lt(s))return O` <div class="title">Task Execution</div> <div class="task-execution"> This space left blank until a bot is assigned to the task. </div> `;if(Pt(s))return O` <div class="title">Task was Deduplicated</div> <p class="deduplicated"> This task was deduplicated from task <a href=${ct(s.dedupedFrom)}>${s.dedupedFrom}</a>. For more information on deduplication, see <a href="https://chromium.googlesource.com/infra/luci/luci-py/+/master/appengine/swarming/doc/Detailed-Design.md#task-deduplication" > the docs</a >. </p>`;i.properties||(i.properties={});const n=s.botDimensions||[],r=i.properties.dimensions||[];for(const t of n){for(const e of r)e.key===t.key&&(t.highlight=!0);if(t.values=[],t.value)for(const e of t.value){const s={name:Et(e,t.key)};for(const i of r)i.key===t.key&&i.value===e&&(s.bold=!0);t.values.push(s)}}return O` <div class=title>Task Execution</div> <table class=task-execution> <tr> <td>Bot assigned to task</td> <td><a href=${function(t){if(t)return"/bot?id="+t}(s.botId)}>${s.botId}</td> </tr> <tr> <td>Bot idle since</td> <td>${s.humanized.time.botIdleSinceTs}</td> </tr> <tr> <td rowspan=${n.length+1}> Dimensions </td> </tr> ${n.map((t=>Yt(t,r)))} <tr> <td>Exit Code</td> <td>${s.exitCode}</td> </tr> <tr> <td>Failure</td> <td class=${s.failure?"failed_task":""}>${!!s.failure}</td> </tr> <tr> <td>Internal Failure</td> <td class=${s.internalFailure?"exception":""}>${s.internalFailure}</td> </tr> <tr> <td>Cost (USD)</td> <td>$${function(t){return t&&t.costsUsd&&t.costsUsd.length?t.costsUsd[0].toFixed(4):0}(s)}</td> </tr> ${((t,e,s)=>s?O` <tr> <td>${"Missing CAS Input(s)"}</td> <td class="exception"> ${(s||[]).map((t=>((t,e)=>O` <tr> <tr> <td> <b>Instance: </b> ${e.casInstance} </td> </tr> <tr> <td> <b>Digest: </b> <a href=${Nt(t,e)} target='_blank'> ${e.digest.hash}/${e.digest.sizeBytes} </a> </td> </tr> </tr> `)(e,t)))} </td> </tr>`:"")(0,t._app._serverDetails.casViewerServer,s.missingCas)} ${((t,e)=>e?O` <tr> <td>${"Missing CIPD Package(s)"}</td> <td class="exception"> ${(e||[]).map((t=>(t=>O` <tr> <td> <b>Path: </b> ${t.path} </td> </tr> <tr> <td> <b>Package: </b> ${t.packageName} </td> </tr> <tr> <td> <b>Version: </b> ${t.version} </td> </tr> `)(t)))} </td> </tr> `:"")(0,s.missingCipd)} ${Ft("CAS Outputs",t._app._serverDetails.casViewerServer,s.casOutputRoot||{})} <tr> <td>Bot Version</td> <td>${s.botVersion}</td> </tr> <tr> <td>Server Version</td> <td>${s.serverVersions}</td> </tr> </table>`},Yt=(t,e)=>O` <tr> <td class=${t.highlight?"highlight":""}> <b class="dim_key">${t.key}:</b>${t.values.map(Qt)} </td> </tr> `,Qt=t=>O`<span class="break-all dim ${t.bold?"bold":""}" >${t.name}</span >`,Zt=t=>O`<div>${t}</div>`,te=t=>O` <tr> <td><input value=${t.key}></input></td> <td><input value=${t.value}></input></td> </tr> `,ee=t=>O` <swarming-app id=swapp ?testing_offline=${t.testing_offline}> <header> <div class=title>Swarming Task Page</div> <aside class=hideable> <a href=/>Home</a> <a href=/botlist>Bot List</a> <a href=/tasklist>Task List</a> <a href=/bot>Bot Page</a> </aside> </header> <main class="horizontal layout wrap"> <h2 class=message ?hidden=${t.loggedInAndAuthorized}>${t._message}</h2> <div class="left grow" ?hidden=${!t.loggedInAndAuthorized}> ${(t=>!t._taskId||t._notFound?O` <div class=id_buttons> <input id=id_input placeholder="Task ID" @change=${t._updateID}></input> <span class=message>Enter a Task ID to get started.</span> </div>`:O` <div class=id_buttons> <input id=id_input placeholder="Task ID" @change=${t._updateID}></input> <button title="Retry the task" @click=${t._promptRetry} class=retry ?hidden=${!function(t){return t&&t.properties&&t.properties.idempotent}(t._request)}>retry</button> <button title="Re-queue the task, but don't run it automatically" @click=${t._promptDebug} class=debug>debug</button> <button title="Cancel a pending task, so it does not start" ?hidden=${"PENDING"!==t._result.state} ?disabled=${!t.permissions.cancelTask} @click=${t._promptCancel} class=cancel>cancel</button> <button title="Kill a running task, so it stops as soon as possible" ?hidden=${"RUNNING"!==t._result.state} ?disabled=${!t.permissions.cancelTask} @click=${t._promptCancel} class=kill>kill</button> </div>`)(t)} <h2 class=not_found ?hidden=${!t._notFound||!t._taskId}> Task not found </h2> ${(t=>!t._taskId||t._notFound?"":t._request.taskSlices&&t._request.taskSlices.length>1?O` <div class="slice-picker"> ${t._request.taskSlices.map(((e,s)=>((t,e)=>O` <div class="tab" ?selected=${t._currentSliceIdx===e} @click=${()=>t._setSlice(e)} > Task Slice ${e+1} </div> `)(t,s)))} </div>`:"")(t)} ${((t,e,s,i)=>!t._taskId||t._notFound?"":(i.properties||(i.properties={}),O` <table class="task-info request-info ${function(t,e){return t&&e&&-1!==t._currentSliceIdx&&t._currentSliceIdx!==e.currentTaskSlice?"inactive":""}(t,s)}"> <tbody> <tr> <td>Name</td> <td>${e.name}</td> </tr> ${((t,e,s)=>O` <tr> <td>State</td> <td class=${function(t){if(!t||!t.state)return"";const e=t.state;return Dt.has(e)?"exception":"BOT_DIED"===e?"bot_died":"CLIENT_ERROR"===e?"client_error":St.has(e)?"pending_task":"COMPLETED"===e&&t.failure?"failed_task":""}(s)}> ${function(t,e){if(!t||!t.state)return"";if(void 0!==e&&t.currentTaskSlice!==e)return"THIS SLICE DID NOT RUN. Select another slice above.";const s=t.state;return"COMPLETED"===s?t.failure?"COMPLETED (FAILURE)":Pt(t)?"COMPLETED (DEDUPED)":"COMPLETED (SUCCESS)":s}(s,t._currentSliceIdx)} </td> </tr> ${Vt(s,t._capacityCounts[t._currentSliceIdx],t._pendingCounts[t._currentSliceIdx],t._runningCounts[t._currentSliceIdx],t._currentSlice.properties||{})} <tr ?hidden=${!s.dedupedFrom} class="highlighted"> <td><b>Deduped From</b></td> <td> <a href=${ct(s.dedupedFrom)} target="_blank"> ${s.dedupedFrom} </a> </td> </tr> <tr ?hidden=${!s.dedupedFrom}> <td>Deduped On</td> <td title=${e.createdTs}>${e.humanized.time.createdTs}</td> </tr> `)(t,e,s)} ${((t,e,s)=>O` <tr> <td>Priority</td> <td>${t.priority}</td> </tr> <tr> <td>Wait for Capacity</td> <td>${!!s.waitForCapacity}</td> </tr> <tr> <td>Slice Scheduling Deadline</td> <td>${function(t,e){if(!e.createdTs)return"";const s=1e3*t.expirationSecs;return rt(new Date(e.createdTs.getTime()+s))}(s,t)}</td> </tr> <tr> <td>User</td> <td>${t.user||"--"}</td> </tr> <tr> <td>Authenticated</td> <td>${t.authenticated}</td> </tr> <tr ?hidden=${!t.serviceAccount}> <td>Service Account</td> <td>${t.serviceAccount}</td> </tr> <tr ?hidden=${!t.realm}> <td>Realm</td> <td>${t.realm}</td> </tr> <tr ?hidden=${!s.properties.secretBytes}> <td>Has Secret Bytes</td> <td title="The secret bytes are present on the machine, but not in the UI/API" > true </td> </tr> <tr ?hidden=${!t.parentTaskId}> <td>Parent Task</td> <td> <a href=${ct(t.parentTaskId)}> ${t.parentTaskId} </a> </td> </tr> <tr ?hidden=${!e}> <td>Child Tasks</td> <td> <a href=${lt([{key:"parent_task_id-tag",value:e.runId}],[],e.startedTs,e.completedTs)} > Task List </a> </td> </tr> `)(e,s,i)} ${(t=>O` <tr> <td rowspan=${t.length+1}> Dimensions <br /> <a title="The list of bots that matches the list of dimensions" href=${ot(t)} >Bots</a > <a title="The list of tasks that matches the list of dimensions" href=${lt(t)} >Tasks</a > </td> </tr> ${t.map(Wt)} `)(i.properties.dimensions||[])} ${Ft("CAS Inputs",t._app._serverDetails.casViewerServer,i.properties.casInputRoot||{})} <tr ?hidden=${!s.resultdbInfo}> <td>ResultDB</td> <td>Enabled</td> </tr> ${zt(i.properties.outputs,"Expected outputs",(t=>t))} ${(t=>t&&t.source_revision?O` <tr> <td>Associated Commit</td> <td> <a href=${t.source_repo.replace("%s",t.source_revision)}> ${t.source_revision.substring(0,12)} </a> </td> </tr> `:"")(e.tagMap)} <tr class="details"> <td>More Details</td> <td> <button @click=${t._toggleDetails} ?hidden=${t._showDetails}> <add-circle-outline-icon-sk></add-circle-outline-icon-sk> </button> <button @click=${t._toggleDetails} ?hidden=${!t._showDetails}> <remove-circle-outline-icon-sk></remove-circle-outline-icon-sk> </button> </td> </tr> </tbody> <tbody ?hidden=${!t._showDetails}> ${((t,e,s)=>O` <tr> <td>Command</td> <td class="code break-all"> ${(t.command||[]).join(" ")||"--"} </td> </tr> <tr> <td>Relative Cwd</td> <td class="code break-all">${t.relativeCwd||"--"}</td> </tr> ${zt(e,"Environment Vars",(t=>t.key+"="+t.value))} ${zt(s,"Environment Prefixes",(t=>t.key+"="+t.value.join(":")))} <tr> <td>Idempotent</td> <td>${!!t.idempotent}</td> </tr> `)(i.properties,i.properties.env||[],i.properties.envPrefixes||[])} ${zt(e.tags,"Tags",(t=>t))} <tr> <td>Execution timeout</td> <td> ${at(i.properties.executionTimeoutSecs)} </td> </tr> <tr> <td>I/O timeout</td> <td>${at(i.properties.ioTimeoutSecs)}</td> </tr> <tr> <td>Grace period</td> <td>${at(i.properties.gracePeriodSecs)}</td> </tr> ${((t,e)=>{if(!t)return O` <tr> <td>Uses CIPD</td> <td>false</td> </tr>`;const s=(t=JSON.parse(JSON.stringify(t))).packages||[],i=e.cipdPins&&e.cipdPins.packages||[];for(let t=0;t<s.length;t++){const e=s[t];e.requested=`${e.packageName}:${e.version}`,i[t]&&(e.actual=`${i[t].packageName}:${i[t].version}`)}let n="(available when task is run)";e.cipdPins&&e.cipdPins.clientPackage&&(n=e.cipdPins.clientPackage.packageName);let r=s.length;return i.length?r*=3:r*=2,r+=1,O` <tr> <td>CIPD server</td> <td> <a href=${t.server}>${t.server}</a> </td> </tr> <tr> <td>CIPD version</td> <td class="break-all"> ${t.clientPackage&&t.clientPackage.version} </td> </tr> <tr> <td>CIPD package name</td> <td>${n}</td> </tr> <tr> <td rowspan=${r}>CIPD packages</td> </tr> ${s.map((e=>Xt(e,t,!!i.length)))} `})(i.properties.cipdInput,s)} ${zt(i.properties.caches,"Named Caches",(t=>t.name+":"+t.path))} </tbody> </table> `))(t,t._request,t._result,t._currentSlice)} ${((t,e,s)=>{if(!t._taskId||t._notFound||Pt(s))return"";const i=s.performanceStats||{};return O` <div class="title">Task Timing Information</div> <div class="horizontal layout wrap"> <table class="task-info task-timing left"> <tbody> <tr> <td>Created</td> <td title=${e.createdTs}> ${e.humanized.time.createdTs} </td> </tr> <tr ?hidden=${!Lt(s)}> <td>Started</td> <td title=${s.startedTs}> ${s.humanized.time.startedTs} </td> </tr> <tr> <td>Scheduling Deadline</td> <td>${function(t){if(!t.createdTs)return"";const e=1e3*t.expirationSecs;return rt(new Date(t.createdTs.getTime()+e))}(e)}</td> </tr> <tr ?hidden=${!s.completedTs}> <td>Completed</td> <td title=${s.completedTs}> ${s.humanized.time.completedTs} </td> </tr> <tr ?hidden=${!s.abandonedTs}> <td>Abandoned</td> <td title=${s.abandonedTs}> ${s.humanized.time.abandonedTs} </td> </tr> <tr> <td>Last updated</td> <td title=${s.modifiedTs}> ${s.humanized.time.modifiedTs} </td> </tr> <tr> <td>Pending Time</td> <td class="pending">${s.humanPending}</td> </tr> <tr> <td>Total Overhead</td> <td class="overhead"> ${at(i.botOverhead)} </td> </tr> <tr> <td>Running Time</td> <td class="running" title="An asterisk indicates the task is still running and thus the time is dynamic." > ${s.humanDuration} </td> </tr> </tbody> </table> <!-- Overheads calculated from task result is not accurate. It contains only the overheads for cipd package installation, task inputs download, task outputs upload. But there are other overheads that are not negligible, such as named cache install/uninstall, removing working dirs. <div class=right> <stacked-time-chart labels='["Pending", "Overhead", "Running", "Overhead"]' colors='["#E69F00", "#D55E00", "#0072B2", "#D55E00"]' .values=${function(t){let e=0,s=0;return t.performanceStats&&(s=t.performanceStats.isolatedUpload&&t.performanceStats.isolatedUpload.duration||0,e=t.performanceStats.botOverhead-s),[t.pending,e,t.duration,s].map((function(t){return t?Math.round(10*t)/10:0}))}(s)}> </stacked-time-chart> </div> --> </div> `})(t,t._request,t._result)} ${Jt(t,t._request,t._result)} ${Kt(t,t._request,t._result,t._currentSlice)} ${((t,e)=>{if(!t._taskId||t._notFound||!e)return"";const s=t=>at((e[t]||{}).duration||0),i=e.isolatedDownload||{},n=e.isolatedUpload||{};return O` <div class="title">Performance Stats</div> <table class="performance-stats"> <tr> <td title="This includes time taken to download inputs, isolate outputs, and setup CIPD" > Total Overhead </td> <td>${at(e.botOverhead||0)}</td> </tr> <tr> <td>Cache trimming before the task</td> <td>${s("cacheTrim")}</td> </tr> <tr> <td>Installing CIPD packages</td> <td>${s("packageInstallation")}</td> </tr> <tr> <td>Installing Named Caches</td> <td>${s("namedCachesInstall")}</td> </tr> <tr> <td>Uninstalling Named Caches</td> <td>${s("namedCachesUninstall")}</td> </tr> <tr> <td>Downloading Inputs</td> <td>${s("isolatedDownload")}</td> </tr> <tr> <td>Uploading Outputs</td> <td>${s("isolatedUpload")}</td> </tr> <tr> <td>Cleanup directories</td> <td>${s("cleanup")}</td> </tr> <tr> <td>Initial bot cache</td> <td> ${i.initialNumberItems||0} items; ${nt(i.initialSize||0)} </td> </tr> <tr> <td>Inputs (downloaded)</td> <td> ${i.numItemsCold||0} items; ${nt(i.totalBytesItemsCold||0)} </td> </tr> <tr> <td>Inputs (cached)</td> <td> ${i.numItemsHot||0} items; ${nt(i.totalBytesItemsHot||0)} </td> </tr> <tr> <td>Outputs (uploaded)</td> <td> ${n.numItemsCold||0} items; ${nt(n.totalBytesItemsCold||0)} </td> </tr> <tr> <td>Outputs (cached)</td> <td> ${n.numItemsHot||0} items; ${nt(n.totalBytesItemsHot||0)} </td> </tr> </table>`})(t,t._result.performanceStats)} ${((t,e)=>{if(!t._taskId||t._notFound||function(t){if(!t||!t.tags||!t.tags.length)return!1;const e=["buildbucket_bucket","buildbucket_build_id","buildbucket_hostname"];return t.tags.some((t=>e.some((e=>t.startsWith(e)))))}(t._request))return"";const s=e.properties&&e.properties.casInputRoot||{},i=s.digest&&`${s.digest.hash}/${s.digest.sizeBytes}`,n=window.location.hostname;return O` <div class="title">Reproducing the task locally</div> <div class="reproduce"> <div ?hidden=${!i}> <div>Download inputs files into directory <i>foo</i>:</div> <div class="code bottom_space"> # (if needed, use "\\\${platform}" as-is) cipd install "infra/tools/luci/cas/\\\${platform}" -root bar<br /> # (if needed) ./bar/cas login<br /> ./bar/cas download -cas-instance ${s.casInstance} -digest ${i} -dir foo </div> </div> <div>Run this task locally:</div> <div class="code bottom_space"> # (if needed, use "\\\${platform}" as-is) cipd install "infra/tools/luci/swarming/\\\${platform}" -root bar<br /> # (if needed) ./bar/swarming login<br /> # '-realm' is only needed if resultdb is enabled for the task.<br /> # Please use a realm that has 'role/resultdb.invocationCreator' in the realms.cfg of your project.<br /> mkdir repro_dir && cd repro_dir<br /> ../bar/swarming reproduce -S ${n} -realm project:foo ${t._taskId} </div> <div>Download output results into directory <i>foo</i>:</div> <div class="code bottom_space"> # (if needed, use "\\\${platform}" as-is) cipd install "infra/tools/luci/swarming/\\\${platform}" -root bar<br /> # (if needed) ./bar/swarming login<br /> mkdir collect_dir && cd collect_dir<br /> ../bar/swarming collect -S ${n} -output-dir=foo ${t._taskId} </div> </div> `})(t,t._currentSlice)} </div> <div class="right grow" ?hidden=${!t.loggedInAndAuthorized}> ${(t=>!t._taskId||t._notFound?"":O` <div class="horizontal layout"> <div class="output-picker"> <div class="tab" selected>Raw Output</div> <div class="tab" ?hidden=${!function(t){if(!t||!t._request||!t._request.tagMap)return!1;const e=t._request.tagMap;return e.allow_milo||e.luci_project}(t)}> <a rel="noopener" target="_blank" href=${M(function(t){if(!t||!t._request||!t._request.tagMap)return;const e=t._request.tagMap,s=e.milo_host;let i=e.log_location;if(i&&s){if(-1!==(i=i.replace("logdog://","")).indexOf(At)){if(!t._result||!t._result.runId)return;i=i.replace(At,t._result.runId)}return s.replace("%s",i)}const n=t.serverDetails.displayServerUrlTemplate;return n&&t._taskId?n.replace("%s",t._taskId):void 0}(t))} > Rich Output </a> </div> <checkbox-sk id="wide_logs" ?checked=${t._wideLogs} @click=${t._toggleWidth} > </checkbox-sk> <span>Full Width Logs</span> </div> </div> <div class="code stdout tabbed ${t._wideLogs?"wide":"break-all"}"> ${t._stdout.map(Zt)} </div>`)(t)} </div> </main> <footer></footer> <dialog-pop-over id=retry> <div class='retry-dialog content'> ${((t,e)=>{const s=e.dimensions||[];return O` <div class=prompt> <h2> Are you sure you want to ${t._isPromptDebug?"debug":"retry"} task ${t._taskId}? </h2> <div class="vertical grid"> <div class=ib ?hidden=${!t._isPromptDebug}> <span>Realm (you may need to change pool dimension as well)</span> <input type="text" id=task_realm value="${t._request.realm}"></input> </div> <div class=ib ?hidden=${!t._isPromptDebug}> <span>Lease Duration</span> <input type="text" id=lease_duration value=4h></input> </div> <div class=ib> <checkbox-sk class=same-bot ?disabled=${!Lt(t._result)} ?checked=${t._useSameBot} @click=${t._toggleSameBot}> </checkbox-sk> <span>Run task on the same bot</span> </div> <br> </div> <div>If you want to modify any dimensions (e.g. specify a bot's id), do so now.</div> <table ?hidden=${t._useSameBot}> <thead> <tr> <th>Key</th> <th>Value</th> </tr> </thead> <tbody id=retry_inputs> ${s.map(te)} ${te({key:"",value:""})} </tbody> </table> </div>`})(t,t._currentSlice.properties||{})} <div class="horizontal layout end"> <button @click=${t._closePopups} class=cancel tabindex=0>Cancel</button> <button @click=${t._promptCallback} class=ok tabindex=0>OK</button> </div> </div> </dialog-pop-over> <dialog-pop-over id=cancel> <div class='cancel-dialog content'> Are you sure you want to ${t._prompt} task ${t._taskId}? <div class="horizontal layout end"> <button @click=${t._closePopups} class=cancel tabindex=0>NO</button> <button @click=${t._promptCallback} class=ok tabindex=0>YES</button> </div> </div> </dialog-pop-over> </swarming-app> `;window.customElements.define("task-page",class extends Gt{constructor(){super(ee),this._taskId="",this._showDetails=!1,this._wideLogs=!1,this._urlParamsLoaded=!1;const t=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,t),this._stateChanged=q((()=>({id:this._taskId,d:this._showDetails,w:this._wideLogs})),(t=>{this._taskId=t.id||this._taskId,this._showDetails=t.d,this._wideLogs=t.w,this._urlParamsLoaded=!0,this._fetch(),this.render()})),this._request=pt({}),this._result=pt({}),this._stdout=[],this._stdoutOffset=0,this._currentSlice={},this._currentSliceIdx=-1,this._notFound=!1,this._extraTries=[],this._capacityCounts=[],this._pendingCounts=[],this._runningCounts=[],this._message="You must sign in to see anything useful.",this._fetchController=null,this._promptCallback=()=>{},this._isPromptDebug=!1,this._useSameBot=!1,this._logFetchPeriod=1e4}connectedCallback(){super.connectedCallback(),this._loginEvent=t=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this.render()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent)}_cancelTask(){let t=!1;"RUNNING"===this._result.state&&(t=!0),this.app.addBusyTasks(1),this._createTasksService().cancel(this._taskId,t).then((t=>{this._closePopups(),n("Request sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"task/cancel")))}_closePopups(){this._promptCallback=()=>{},e("dialog-pop-over",this).map((t=>t.hide()))}_collectDimensions(){const t=[];if(this._useSameBot)t.push({key:"id",value:xt(this._result.botDimensions,"id")},{key:"pool",value:xt(this._result.botDimensions,"pool")});else{const s=e("#retry_inputs tr",this);for(const e of s){const s=e.children[0].firstElementChild.value,i=e.children[1].firstElementChild.value;s&&i&&t.push({key:s,value:i})}if(!t.length)return n("You must specify some dimensions (pool is required)",6e3),null;if(!xt(t,"pool"))return n("The pool dimension is required"),null}return t}_currentSliceProperties(){return JSON.parse(JSON.stringify(this._currentSlice.properties))}_debugTask(){const t=function(t){let e=t.slice(0,-1);if(!/[1-9][0-9]*/.test(e))return null;switch(e=parseInt(e),t.slice(-1)){case"h":e*=60;case"m":e*=60;case"s":break;default:return null}return e}(i("#lease_duration").value),e=this._currentSliceProperties(),s=this._collectDimensions();s&&(e.dimensions=s,e.secretBytes="",e.idempotent=!1,e.executionTimeoutSecs=t,e.ioTimeoutSecs=t,e.command=["python3","-c",`import os, sys, time\nprint('Mapping task: ${location.origin}/task?id=${this._taskId}')\nprint('Files are mapped into: ' + os.getcwd())\nprint('')\nprint('Bot id: ' + os.environ['SWARMING_BOT_ID'])\nprint('Bot leased for: ${t} seconds')\nprint('How to access this bot: http://go/swarming-ssh')\nprint('When done, reboot the host')\nprint('')\nprint('Some tests may fail without the following env vars set:')\nprint('PATH=' + os.environ['PATH'])\nprint('LUCI_CONTEXT=' + os.environ['LUCI_CONTEXT'])\nsys.stdout.flush()\ntime.sleep(${t})`],this._newTask({name:`leased to ${this.profile.email} for debugging`,poolTaskTemplate:"SKIP",priority:20,realm:i("#task_realm").value||this._request.realm,serviceAccount:this._request.serviceAccount,tags:["debug_task:1"],taskSlices:[{expirationSecs:this._request.expirationSecs,properties:e}],user:this.profile.email}),this._closePopups())}_fetch(){if(!this.loggedInAndAuthorized||!this._urlParamsLoaded||!this._taskId)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const t={authHeader:this.authHeader,signal:this._fetchController.signal};this.app._fetchPermissions(t,{taskId:this._taskId}),this._fetchTaskInfo(t),this._fetchStdOut(t)}_fetchTaskInfo(t){this.app.addBusyTasks(2);let e=-1;const s=this._createTasksService();s.request(this._taskId).then((s=>{this._notFound=!1,this._request=function(t){if(!t)return pt({});ut(t,Ht),t.tagMap={},t.tags=t.tags||[];for(const e of t.tags){const s=e.split(":",1)[0],i=e.substring(s.length+1);t.tagMap[s]=i}return t}(s),this._fetchCounts(this._request,t),e>=0?this._setSlice(e):this.render(),this.app.finishedTask()})).catch((t=>{404===t.status&&(this._request=pt({}),this._notFound=!0,this.render()),this.fetchError(t,"task/request")})),this._extraTries=[],s.result(this._taskId,!0).then((t=>{this._result=function(t){if(!t)return pt({});ut(t,Ht);const e=new Date;!t.duration&&"RUNNING"===t.state&&t.startedTs?t.duration=(e-t.startedTs)/1e3:!t.duration&&"BOT_DIED"===t.state&&t.startedTs&&t.abandonedTs&&(t.duration=(t.abandonedTs-t.startedTs)/1e3),t.humanDuration=at(t.duration),"RUNNING"===t.state?t.humanDuration+="*":"BOT_DIED"===t.state&&(t.humanDuration+=" -- died");const s=t.startedTs||t.abandonedTs||new Date;return t.createdTs?s<=t.createdTs?(t.pending=0,t.humanPending="0s"):(t.pending=(s-t.createdTs)/1e3,t.humanPending=function(t,e){return t?(e||(e=new Date),it((e.getTime()-t.getTime())/1e3)||"0s"):"eons"}(t.createdTs,s)):(t.pending=0,t.humanPending=""),t.currentTaskSlice=parseInt(t.currentTaskSlice)||0,t}(t),e=+this._result.currentTaskSlice,this._setSlice(e),this.app.finishedTask()})).catch((t=>this.prpcError(t,"task/result")))}_fetchStdOut(t){this.app.addBusyTasks(1);let e="";const s=()=>{this._createTasksService().stdout(this._taskId,this._stdoutOffset,102400).then((i=>{e||(e=i.state);const n=i.output?function(t){return new TextDecoder("utf-8",{fatal:!1}).decode(function(t){const e=atob(t);return Uint8Array.from(e,(t=>t.codePointAt(0)))}(t))}(i.output):"",r=new Blob([n]).size;this._stdoutOffset+=r;const o=n.replace(/\r\n/g,"\n"),a=o.lastIndexOf("\n");let d=o,l="";-1!==a&&(d=o.substring(0,a+1),l=o.substring(a+1)),this._stdout.length&&!this._stdout[this._stdout.length-1].endsWith("\n")?(this._stdout[this._stdout.length-1]+=d,l&&this._stdout.push(l)):(this._stdout.push(d),l&&this._stdout.push(l)),this.render(),i.state!==e&&this._fetchTaskInfo(t),"RUNNING"===i.state||"PENDING"===i.state?r<102400?setTimeout(s,this._logFetchPeriod):s():r<102400?this.app.finishedTask():s(),e=i.state})).catch((t=>this.prpcError(t,"task/request")))};s()}_fetchCounts(t,e){const s=t.taskSlices.length;this.app.addBusyTasks(3*s),this._capacityCounts=[],this._capacityCounts.fill(void 0,0,s),this._pendingCounts=[],this._pendingCounts.fill(void 0,0,s),this._runningCounts=[],this._pendingCounts.fill(void 0,0,s);for(let e=0;e<s;e++){const s=[],i=[],n=e;for(const n of t.taskSlices[e].properties.dimensions)i.push(n),s.push(`${n.key}:${n.value}`);this._createBotService().count(i).then((t=>{this._capacityCounts[n]=t,this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bots/count slice "+e,!0)));const r=new Date;r.setSeconds(0),r.setDate(r.getDate()-1);const o=this._createTasksService();o.count({tags:s,start:r,state:"QUERY_RUNNING"}).then((t=>{this._runningCounts[n]=t.count||"0",this.render(),this.app.finishedTask()})).catch((t=>this.fetchError(t,"tasks/running slice "+e,!0))),o.count({tags:s,start:r,state:"QUERY_PENDING"}).then((t=>{this._pendingCounts[n]=t.count||"0",this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"tasks/pending slice "+e,!0)))}}_newTask(t){this.app.addBusyTasks(1),this._createTasksService().new(t).then((t=>{t&&t.taskId&&(this._taskId=t.taskId,this._stateChanged(),this._fetch(),this.render(),this.app.finishedTask())})).catch((t=>this.prpcError(t,"newtask")))}_promptCancel(){this._prompt="cancel","RUNNING"===this._result.state&&(this._prompt="kill"),this._promptCallback=this._cancelTask,this.render(),i("dialog-pop-over#cancel",this).show(),i("dialog-pop-over#cancel button.cancel",this).focus()}_promptDebug(){this._request?(this._isPromptDebug=!0,this._useSameBot=!1,this._promptCallback=this._debugTask,this.render(),i("dialog-pop-over#retry",this).show(),i("dialog-pop-over#retry button.cancel",this).focus()):n("Task not yet loaded",3e3)}_promptRetry(){this._request?(this._isPromptDebug=!1,this._useSameBot=!1,this._promptCallback=this._retryTask,this.render(),i("dialog-pop-over#retry",this).show(),i("dialog-pop-over#retry button.cancel",this).focus()):n("Task not yet loaded",3e3)}render(){super.render(),i("#id_input",this).value=this._taskId}_retryTask(){const t=this._currentSliceProperties(),e=[...this._request.tags];e.includes("retry:1")||e.push("retry:1");const s=this._collectDimensions();s&&(t.dimensions=s,t.secretBytes="",t.idempotent=!1,this._newTask({name:this._request.name+" (retry)",poolTaskTemplate:"SKIP",priority:this._request.priority,taskSlices:[{expirationSecs:this._request.expirationSecs,properties:t}],serviceAccount:this._request.serviceAccount,tags:e,user:this.profile.email,resultdb:{enable:Boolean(this._result.resultdbInfo)},realm:this._request.realm}),this._closePopups())}_setSlice(t){this._currentSliceIdx=t,this._request.taskSlices&&(this._currentSlice=this._request.taskSlices[t],this.render())}_toggleDetails(t){this._showDetails=!this._showDetails,this._stateChanged(),this.render()}_toggleSameBot(t){t.preventDefault(),Lt(this._result)&&(this._useSameBot=!this._useSameBot,this.render())}_toggleWidth(t){t.preventDefault(),this._wideLogs=!this._wideLogs,this._stateChanged(),this.render()}_updateID(t){const e=i("#id_input",this);this._taskId=e.value,this._stdout=[],this._stdoutOffset=0,this._stateChanged(),this._fetch(),this.render()}})})()})();
\ No newline at end of file
+(()=>{"use strict";var t={445:function(t,e){var s=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(n,r){function o(t){try{d(i.next(t))}catch(t){r(t)}}function a(t){try{d(i.throw(t))}catch(t){r(t)}}function d(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}d((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const t in e.RpcCode)i[e.RpcCode[t]]=t;function n(t){return i[t]}e.rpcCodeToCodeName=n,e.PrpcClient=class{constructor(t=null){t=t||{},this.host=t.host||document.location.host,this.accessToken=t.accessToken||null,this.insecure=t.hasOwnProperty("insecure")&&Boolean(t.insecure),this.fetchImpl=t.fetchImpl||window.fetch.bind(window)}call(t,i,n,a){return s(this,void 0,void 0,(function*(){if(!t)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!n)throw new TypeError("missing required argument: message");if(!(n instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const s=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${t}/${i}`,d=this._requestOptions(n,a),l=yield this.fetchImpl(s,d);if(!l.headers.has("X-Prpc-Grpc-Code"))throw new o(l.status,"Invalid response: no X-Prpc-Grpc-Code response header");const c=Number.parseInt(l.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(c))throw new o(l.status,"Invalid X-Prpc-Grpc-Code response header");const h=yield l.text();if(c!==e.RpcCode.OK)throw new r(c,h);if(!h.startsWith(")]}'"))throw new o(l.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(h.substr(4))}))}_requestOptions(t,e){const s={accept:"application/json","content-type":"application/json"};return e&&Object.assign(s,e),this.accessToken&&(s.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:s,body:JSON.stringify(t)}}};class r extends Error{constructor(t,e){if(super(),this.code=t,this.description=e,null===t)throw new Error("missing required argument: code");this.codeName=n(t)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}e.GrpcError=r;class o extends Error{constructor(t,e){if(super(),this.httpStatus=t,this.description=e,null===t)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}e.ProtocolError=o}},e={};function s(i){var n=e[i];if(void 0!==n)return n.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,s),r.exports}(()=>{const t=new Promise((function(t,e){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)})),e=(t,e=document)=>Array.prototype.slice.call(e.querySelectorAll(t)),i=(t,e=document)=>e.querySelector(t);function n(t,e=1e4){"object"==typeof t&&(t=t.message||JSON.stringify(t));var s={message:t,duration:e};document.dispatchEvent(new CustomEvent("error-sk",{detail:s,bubbles:!0}))}const r=new WeakMap,o=t=>"function"==typeof t&&r.has(t),a=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,d=(t,e,s=null)=>{let i=e;for(;i!==s;){const e=i.nextSibling;t.removeChild(i),i=e}},l={},c={},h=`{{lit-${String(Math.random()).slice(2)}}}`,u=`\x3c!--${h}--\x3e`,p=new RegExp(`${h}|${u}`),m="$lit$";class _{constructor(t,e){this.parts=[],this.element=e;let s=-1,i=0;const n=[],r=e=>{const o=e.content,a=document.createTreeWalker(o,133,null,!1);let d=0;for(;a.nextNode();){s++;const e=a.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const n=e.attributes;let r=0;for(let t=0;t<n.length;t++)n[t].value.indexOf(h)>=0&&r++;for(;r-- >0;){const n=t.strings[i],r=v.exec(n)[2],o=r.toLowerCase()+m,a=e.getAttribute(o).split(p);this.parts.push({type:"attribute",index:s,name:r,strings:a}),e.removeAttribute(o),i+=a.length-1}}"TEMPLATE"===e.tagName&&r(e)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(h)>=0){const r=e.parentNode,o=t.split(p),a=o.length-1;for(let t=0;t<a;t++)r.insertBefore(""===o[t]?f():document.createTextNode(o[t]),e),this.parts.push({type:"node",index:++s});""===o[a]?(r.insertBefore(f(),e),n.push(e)):e.data=o[a],i+=a}}else if(8===e.nodeType)if(e.data===h){const t=e.parentNode;null!==e.previousSibling&&s!==d||(s++,t.insertBefore(f(),e)),d=s,this.parts.push({type:"node",index:s}),null===e.nextSibling?e.data="":(n.push(e),s--),i++}else{let t=-1;for(;-1!==(t=e.data.indexOf(h,t+1));)this.parts.push({type:"node",index:-1})}}};r(e);for(const t of n)t.parentNode.removeChild(t)}}const g=t=>-1!==t.index,f=()=>document.createComment(""),v=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class b{constructor(t,e,s){this._parts=[],this.template=t,this.processor=e,this.options=s}update(t){let e=0;for(const s of this._parts)void 0!==s&&s.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=a?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let s=0,i=0;const n=t=>{const r=document.createTreeWalker(t,133,null,!1);let o=r.nextNode();for(;s<e.length&&null!==o;){const t=e[s];if(g(t))if(i===t.index){if("node"===t.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(o.previousSibling),this._parts.push(t)}else this._parts.push(...this.processor.handleAttributeExpressions(o,t.name,t.strings,this.options));s++}else i++,"TEMPLATE"===o.nodeName&&n(o.content),o=r.nextNode();else this._parts.push(void 0),s++}};return n(t),a&&(document.adoptNode(t),customElements.upgrade(t)),t}}class k{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="";for(let s=0;s<t;s++){const t=this.strings[s],i=v.exec(t);e+=i?t.substr(0,i.index)+i[1]+i[2]+m+i[3]+h:t+u}return e+this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const w=t=>null===t||!("object"==typeof t||"function"==typeof t);class y{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t<s.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new $(this)}_getValue(){const t=this.strings,e=t.length-1;let s="";for(let i=0;i<e;i++){s+=t[i];const e=this.parts[i];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)s+="string"==typeof e?e:String(e);else s+="string"==typeof t?t:String(t)}}return s+t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class ${constructor(t){this.value=void 0,this.committer=t}setValue(t){t===l||w(t)&&t===this.value||(this.value=t,o(t)||(this.committer.dirty=!0))}commit(){for(;o(this.value);){const t=this.value;this.value=l,t(this)}this.value!==l&&this.committer.commit()}}class I{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(f()),this.endNode=t.appendChild(f())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=f()),t._insert(this.endNode=f())}insertAfterPart(t){t._insert(this.startNode=f()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}const t=this._pendingValue;t!==l&&(w(t)?t!==this.value&&this._commitText(t):t instanceof k?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):t===c?(this.value=c,this.clear()):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof b&&this.value.template===e)this.value.update(t.values);else{const s=new b(e,t.processor,this.options),i=s._clone();s.update(t.values),this._commitNode(i),this.value=s}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let s,i=0;for(const n of t)void 0===(s=e[i])&&(s=new I(this.options),e.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(e[i-1])),s.setValue(n),s.commit(),i++;i<e.length&&(e.length=i,this.clear(s&&s.endNode))}clear(t=this.startNode){d(this.startNode.parentNode,t.nextSibling,this.endNode)}}class T{constructor(t,e,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=l}}class E extends y{constructor(t,e,s){super(t,e,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new C(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class C extends ${}let S=!1;try{const t={get capture(){return S=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class D{constructor(t,e,s){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this._boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this._pendingValue=t}commit(){for(;o(this._pendingValue);){const t=this._pendingValue;this._pendingValue=l,t(this)}if(this._pendingValue===l)return;const t=this._pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=x(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=l}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const x=t=>t&&(S?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),N=new class{handleAttributeExpressions(t,e,s,i){const n=e[0];return"."===n?new E(t,e.slice(1),s).parts:"@"===n?[new D(t,e.slice(1),i.eventContext)]:"?"===n?[new T(t,e.slice(1),s)]:new y(t,e,s).parts}handleTextExpression(t){return new I(t)}};function A(t){let e=P.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},P.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(h);return void 0===(s=e.keyString.get(i))&&(s=new _(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const P=new Map,L=new WeakMap,H=(t,e,s)=>{let i=L.get(e);void 0===i&&(d(e,e.firstChild),L.set(e,i=new I(Object.assign({templateFactory:A},s))),i.appendInto(e)),i.setValue(t),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const O=(t,...e)=>new k(t,e,"html",N),M=(G=t=>e=>{if(void 0===t&&e instanceof $){if(t!==e.value){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else e.setValue(t)},(...t)=>{const e=G(...t);return r.set(e,!0),e});var G;function B(t){if(!t)return"";var e=[];return Object.keys(t).sort().forEach((function(s){t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))}))})),e.join("&")}function R(t){var e=[];return Object.keys(t).sort().forEach((function(s){Array.isArray(t[s])?t[s].forEach((function(t){e.push(encodeURIComponent(s)+"="+encodeURIComponent(t))})):"object"==typeof t[s]?e.push(encodeURIComponent(s)+"="+encodeURIComponent(R(t[s]))):e.push(encodeURIComponent(s)+"="+encodeURIComponent(t[s]))})),e.join("&")}function U(t,e){e=e||{};for(var s={},i=t.split("&"),n=0;n<i.length;n++){var r=i[n].split("=",2);if(2==r.length){var o=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]);if(e.hasOwnProperty(o))switch(typeof e[o]){case"boolean":s[o]="true"==a;break;case"number":s[o]=Number(a);break;case"object":if(Array.isArray(e[o])){var d=s[o]||[];d.push(a),s[o]=d}else s[o]=U(a,e[o]);break;default:s[o]=a}else s[o]=a}}return s}const V=t=>JSON.parse(JSON.stringify(t));function q(e,s){let i=V(e()),n=!1;const r=()=>{n=!0;let t=U(window.location.search.slice(1),i);s(function(t,e){let s={};return Object.keys(e).forEach((function(i){t.hasOwnProperty(i)?s[i]=V(t[i]):s[i]=V(e[i])})),s}(t,i))};return t.then(r),window.addEventListener("popstate",r),()=>{if(!n)return;let t=R(function(t,e){let s={};return Object.keys(t).forEach((function(i){(function(t,e){if(typeof t!=typeof e)return!1;let s=typeof t;return"string"===s||"boolean"===s||"number"===s?t===e:"object"===s?Array.isArray(s)?JSON.stringify(t)===JSON.stringify(e):R(t)===R(e):void 0})(t[i],e[i])||(s[i]=t[i])})),s}(e(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+t)}}function W(t,e){if(t.hasOwnProperty(e)){let s=t[e];delete t[e],t[e]=s}}class F extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),W(this,"checked"),W(this,"disabled"),W(this,"name"),W(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(t){let e=!!t;this._input.checked=e,t?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){let e=!!t;this._input.disabled=e,e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(t){this.setAttribute("name",t),this._input.setAttribute("name",t)}get label(){return this._input.getAttribute("label")}set label(t){this.setAttribute("label",t),this._input.setAttribute("label",t)}attributeChangedCallback(t,e,s){if(!this._input)return;let i=null!=s;switch(t){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=s;break;case"label":this._label.textContent=s}}}window.customElements.define("checkbox-sk",F);const z=document.createElement("template");z.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("add-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=z.content.cloneNode(!0);this.appendChild(t)}});const j=document.createElement("template");j.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',window.customElements.define("remove-circle-outline-icon-sk",class extends HTMLElement{connectedCallback(){let t=j.content.cloneNode(!0);this.appendChild(t)}});const X=document.createElement("template");X.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const t=X.content.cloneNode(!0);if(this.appendChild(t),this._backdrop=i(".backdrop",this),this._content=i(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const t=window.innerWidth,e=window.innerHeight,s=Math.min(this._content.offsetWidth,t-50),i=Math.min(this._content.offsetHeight,e-50);this._content.style.width=s,this._content.style.left=(t-s)/2,this._content.style.top=(e-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}});const J=Symbol("loadScript"),K=Symbol("instance");let Y;const Q=new class{get[K](){return Y}set[K](t){Y=t}constructor(){if(this[K])return this[K];this[K]=this}reset(){Y=null}[J](){return this.scriptPromise||(this.scriptPromise=new Promise((t=>{const e=document.getElementsByTagName("body")[0],s=document.createElement("script");s.type="text/javascript",s.onload=function(){Q.api=window.google,Q.api.charts.load("current",{packages:["corechart","table"]}),Q.api.charts.setOnLoadCallback((()=>{t()}))},s.src="https://www.gstatic.com/charts/loader.js",e.appendChild(s)}))),this.scriptPromise}load(t,e){return this[J]().then((()=>{if(e){let s={};s=e instanceof Object?e:Array.isArray(e)?{packages:e}:{packages:[e]},this.api.charts.load("current",s),this.api.charts.setOnLoadCallback(t)}else{if("function"!=typeof t)throw"callback must be a function";t()}}))}},Z=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}],tt=1048576,et=1024*tt,st=[{units:" PB",delta:0x4000000000000},{units:" TB",delta:1099511627776},{units:" GB",delta:et},{units:" MB",delta:tt},{units:" KB",delta:1024},{units:" B",delta:1}];function it(t){if(t<0&&(t=-t),0===t)return"  0s";let e="";for(let s=0;s<Z.length;s++)if(Z[s].delta<=t){let i=Math.floor(t/Z[s].delta)+Z[s].units;for(;i.length<4;)i=" "+i;e+=i,t%=Z[s].delta}return e}function nt(t,e=1){return Number.isInteger(e)&&(t*=e),function(t,e){for(let s=0;s<e.length-1;s++)if(Math.round(t/e[s+1].delta)*e[s+1].delta/e[s].delta>=1)return Math.round(t/e[s].delta)+e[s].units;let s=e.length-1;return Math.round(t/e[s].delta)+e[s].units}(t,st)}function rt(t){let e=t.toString(),s=e.substring(e.indexOf("("));return t.toLocaleString()+" "+s}function ot(t=[],e=[]){const s=[];for(const e of t)if(e.key&&e.value)if(Array.isArray(e.value))for(const t of e.value)s.push(e.key+":"+t);else s.push(e.key+":"+e.value);else s.push(e);return"/botlist?"+B({f:s,c:e})}function at(t){if(0===t||"0"===t)return"0s";if(!t)return"--";const e=parseFloat(t);return e?e>60?it(e):e.toFixed(2)+"s":t+" seconds"}function dt(t,e,s=!0){W(t,e),void 0===t[e]&&t.hasAttribute(e)&&(t[e]=t.getAttribute(e),s&&t.removeAttribute(e))}function lt(t=[],e=[],s,i){const n=[];for(const e of t)if(e.key&&e.value)if(Array.isArray(e.value))for(const t of e.value)n.push(e.key+":"+t);else n.push(e.key+":"+e.value);else n.push(e);const r={f:n,c:e};return s&&(r.st=[s.getTime()]),i&&(r.et=[i.getTime()],r.n=[!1]),"/tasklist?"+B(r)}function ct(t,e){if(t)return e||(t=t.substring(0,t.length-1)+"0"),`/task?id=${t}`}class ht{constructor(t){this._time=new Proxy(t,{get(t,e,s){let i=Reflect.get(t,e,s);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const n=i.toString(),r=n.substring(n.indexOf("("));return`${i.toLocaleString()} ${r}`}})}get time(){return this._time}}function ut(t,e){if(void 0!==t){for(const s of e){const e=t[s];"string"==typeof e&&(t[s]=new Date(e))}t.humanized=new ht(t)}}function pt(t){if(void 0!==t)return t.humanized=new ht(t),t}const mt=new Promise(((t,e)=>{try{Q.load(t)}catch(t){e(t)}}));function _t(t){return"string"==typeof t?JSON.parse(t):t}window.customElements.define("stacked-time-chart",class extends HTMLElement{constructor(){super(),this._loaded=!1,this._error=""}connectedCallback(){dt(this,"colors"),dt(this,"labels"),dt(this,"values"),this._colors=_t(this._colors),this._labels=_t(this._labels),this._values=_t(this._values),mt.then((()=>{this._loaded=!0,this.render()})).catch((t=>{console.error(t),this._error="Could not load Google Charts JS from Internet",this.render()})),this.render()}get colors(){return this._colors}set colors(t){this._colors=t,this.render()}get labels(){return this._labels}set labels(t){this._labels=t,this.render()}get values(){return this._values}set values(t){this._values=t,this.render()}drawChart(){const t=Q.api.visualization.arrayToDataTable([["Type"].concat(this._labels),[""].concat(this._values)]);let e=0;for(const t of this._values)e+=+t;const s=[{v:0,f:""}];let i=0;if(e<120){for(let t=10;t<e;t+=10)s.push({v:t,f:t+"s"});i=5}else if(e<1500){for(let t=60;t<e;t+=60)s.push({v:t,f:t/60+"m"});i=e<300?5:e<900?1:0}else if(e<1e6){for(let t=600;t<e;t+=600)s.push({v:t,f:t/60+"m"});i=e<6e3?10:e<12e3?5:1}const n={width:400,height:250,isStacked:!0,chartArea:{width:"100%",height:"65%"},legend:{position:"top",maxLines:1,alignment:"center",textStyle:{fontSize:12}},colors:this._colors,hAxis:{title:"Time",ticks:s,minorGridlines:{count:i}}};new Q.api.visualization.BarChart(this.firstElementChild).draw(t,n)}render(){H(O`<div id="chart">${this._error}</div>`,this,{eventContext:this}),this._loaded&&this.drawChart()}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),W(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(t){this.setAttribute("duration",t)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(t){t.detail.duration&&(this._toast.duration=t.detail.duration),this._toast.textContent=t.detail.message,this._toast.show()}});const gt=document.createElement("template");gt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let t=gt.content.cloneNode(!0);this.appendChild(t)}});const ft=document.createElement("template");function vt(t){if(t.ok)return t.json();throw{message:`Bad network response: ${t.statusText}`,resp:t,status:t.status}}ft.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let t=ft.content.cloneNode(!0);this.appendChild(t)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){W(this,"active")}get active(){return this.hasAttribute("active")}set active(t){t?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){W(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((t=>{"anonymous:anonymous"!=t.identity&&(this._fireLoginEvent(t),this.render())}),(t=>{console.error(t),n(`Error getting auth state: ${JSON.stringify(t)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(t){this._profile={email:t.email,imageURL:t.picture},this._auth_header=`Bearer ${t.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(t){const e=window.location.pathname+window.location.search;window.location=e&&"/"!=e?`/auth/openid/${t}?r=${encodeURIComponent(e)}`:`/auth/openid/${t}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(vt)}render(){H((t=>t.authHeader?O` <div> <img class="center" id="avatar" src="${t._profile.imageURL}" width="30" height="30" /> <span class="center">${t._profile.email}</span> <span class="center">|</span> <a class="center" @click=${t._logOut} href="#">Sign out</a> </div>`:O` <div> <a @click=${t._logIn} href="#">Sign in</a> </div>`)(this),this,{eventContext:this})}attributeChangedCallback(t,e,s){this.render()}});var bt=s(445);class kt{constructor(t,e=null,s={}){const i={...s,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=t,e){const t=(t,s)=>(s.signal=e,fetch(t,s));i.fetchImpl=t}this._client=new bt.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(t,e){const s={authorization:this._token};return this._client.call(this.service,t,e,s)}}class wt extends kt{get service(){return"swarming.v2.Swarming"}permissions(t){return this._call("GetPermissions",t)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const yt=document.createElement("template");yt.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const $t=document.createElement("template");$t.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const It="You must log in to see more details",Tt=document.createElement("template");function Et(t,e){if(!Ct[e]||"none"===t||!t)return t;let s=Ct[e][t];if("gpu"===e){const i=t.split("-")[0];s=Ct[e][i]}else if("os"===e&&t.startsWith("Windows")){const i=t.split(".")[0];s=Ct[e][i]}return s?`${s} (${t})`:t}Tt.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:It,botVersion:"",casViewerServer:""};const t=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,t),this._permissions={}}connectedCallback(){W(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(t=>{this._auth_header=t.detail.authHeader,this._profile=t.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(t){this._busyTaskCount+=t,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const t=this.querySelector("header"),e=t&&t.querySelector("aside"),s=this.querySelector("footer");if(!(t&&e&&e.classList.contains("hideable")))return;let i=yt.content.cloneNode(!0);t.insertBefore(i,t.firstElementChild),(i=t.firstElementChild).addEventListener("click",(t=>this._toggleMenu(t,e)));const n=$t.content.cloneNode(!0);t.insertBefore(n,e),this._spinner=t.querySelector("spinner-sk");const r=document.createElement("span");r.classList.add("grow"),t.appendChild(r),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),t.appendChild(this._dynamicEle);const o=document.createElement("error-toast-sk");s.append(o);const a=Tt.content.cloneNode(!0);s.append(a)}_toggleMenu(t,e){e.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const t={authHeader:this._auth_header};this.addBusyTasks(1),new wt(t.authHeader).details().then((t=>{this._serverDetails=t,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{"PERMISSION_DENIED"===t.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(t),n(`Unexpected error loading details: ${t.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(t)}_fetchPermissions(t,e){return this.addBusyTasks(1),new wt(t.authHeader,t.signal).permissions(e||{}).then((t=>{this._permissions=t,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((t=>{403!==t.status&&(console.error(t),n(`Unexpected error loading permissions: ${t.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&H((t=>O` <div class="server-version"> AppEngine version: ${function(t,e){return e&&e.serverVersion?O`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(t,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",e.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${e.serverVersion}</a >`:It}(t._projectId,t._serverDetails)} Git version:${function(t){if(!t||!t.serverVersion)return"";const e=t.serverVersion.split("-");if(e.length>=3)return console.error(`Invalid Git version. version=${t.serverVersion}`),"";const s=2==e.length?e[1]:e[0];return O`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${s}>${s}</a>`}(t._serverDetails)} </div> <oauth-login ?testing_offline=${t.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(t,e,s){this.render()}});const Ct={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL",tangorpro:"Pixel Tablet","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}},St=new Set(["PENDING","RUNNING"]),Dt=new Set(["TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED"]);function xt(t,e){const s=t.filter((function(t){return t.key===e}));if(!s.length)return null;const i=s[0].value;return i.length?i[0]:null}function Nt(t,e){return`${t}/${e.casInstance}/blobs/${e.digest.hash}/${e.digest.sizeBytes||0}/tree`}const At="${SWARMING_TASK_ID}";function Pt(t){return t.dedupedFrom}function Lt(t){return t&&"PENDING"!==t.state&&"NO_RESOURCE"!==t.state&&"CANCELED"!==t.state&&"EXPIRED"!==t.state}const Ht=["abandoned_ts","bot_idle_since_ts","completed_ts","created_ts","modified_ts","started_ts","abandonedTs","botIdleSinceTs","completedTs","createdTs","modifiedTs","startedTs"];class Ot extends kt{get service(){return"swarming.v2.Tasks"}cancel(t,e){return this._call("CancelTask",{taskId:t,killRunning:e})}stdout(t,e,s){return this._call("GetStdout",{taskId:t,offset:e,length:s})}request(t){return this._call("GetRequest",{taskId:t})}result(t,e){return this._call("GetResult",{taskId:t,includePerformanceStats:e})}new(t){return this._call("NewTask",t)}count(t){return this._call("CountTasks",t)}list(t){return t.state||(t={...t,state:"QUERY_ALL"}),this._call("ListTasks",t)}massCancel(t){return this._call("CancelTasks",t)}}class Mt extends kt{get service(){return"swarming.v2.Bots"}bot(t){return this._call("GetBot",{botId:t})}tasks(t,e){const s={sort:4,state:10,botId:t,cursor:e,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",s)}terminate(t,e){const s={botId:t,reason:e};return this._call("TerminateBot",s)}events(t,e){const s={limit:50,botId:t,cursor:e};return this._call("ListBotEvents",s)}delete(t){return this._call("DeleteBot",{botId:t})}count(t){return this._call("CountBots",{dimensions:t})}dimensions(t){return this._call("GetBotDimensions",{pool:t})}list(t){return this._call("ListBots",t)}}class Gt extends HTMLElement{constructor(t){super(),this._template=t,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){W(this,"testing_offline"),this._authHeaderEvent=t=>{this._auth_header=t.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(t){t?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(t,e,s){"PERMISSION_DENIED"!==t.codeName||s?"AbortError"!==t.name&&(console.error(t),n(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(t,e,s){403!==t.status||s?"AbortError"!==t.name&&(console.error(t),n(`Unexpected error loading ${e}: ${t.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){H(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,H(this._template(this),this,{eventContext:this}))}attributeChangedCallback(t,e,s){this.render()}_createTasksService(){return new Ot(this.authHeader,this._fetchController.signal)}_createBotService(){return new Mt(this.authHeader,this._fetchController.signal)}}const Bt=(t,e,s,i)=>{let n="https://console.cloud.google.com/logs/query";if(n+=`;query=${encodeURIComponent(e)}`,s&&(n+=`;cursorTimestamp=${s.toISOString()}`,i)){const t=[s,i].map((t=>t.toISOString())).join("/");n+=`;timeRange=${encodeURIComponent(t)}`}return n+`?project=${t}`},Rt='resource.type="gae_app"\n'+['protoPayload.resource:"/internal/"','protoPayload.resource:"/swarming/api/v1/bot/"','protoPayload.method!="GET"'].join(" OR ")+"\n",Ut=(t,e)=>{if(!t.createdTs)return[null,null];const s=new Date(t.createdTs.getTime()-6e4),i=e.completedTs||e.abandonedTs;return[s,i?new Date(i.getTime()+6e4):new Date]},Vt=(t,e,s,i,n)=>O` <tr ?hidden=${!e}> <td class=${"PENDING"===t.state?"bold":""}> ${"PENDING"===t.state?"Why Pending?":"Fleet Capacity"} </td> <td> ${qt(e,"count",0)} <a href=${ot(n.dimensions)}>bots</a> could possibly run this task (${qt(e,"busy",0)} busy, ${qt(e,"dead",0)} dead, ${qt(e,"quarantined",0)} quarantined, ${qt(e,"maintenance",0)} maintenance) </td> </tr> <tr ?hidden=${!s||!i}> <td>Similar Load</td> <td> ${qt(s)} <a href=${lt((n.dimensions||[]).concat({key:"state",value:"PENDING"}))} > similar pending tasks</a >, ${qt(i)} <a href=${lt((n.dimensions||[]).concat({key:"state",value:"RUNNING"}))} > similar running tasks</a > </td> </tr> `,qt=(t,e,s)=>!t||e&&void 0===t[e]?void 0!==s?s:O`<span class="italic">&lt;counting&gt</span>`:e?t[e]:t,Wt=t=>O` <tr> <td class="break-all"> <b class="dim_key">${t.key}:</b>${Et(t.value,t.key)} </td> </tr> `,Ft=(t,e,s)=>s.digest?O` <tr> <td>${t}</td> <td> <a href=${Nt(e,s)} target="_blank"> ${s.digest.hash}/${s.digest.sizeBytes} </a> </td> </tr>`:"",zt=(t,e,s)=>t&&t.length?O` <tr> <td rowspan=${t.length+1}>${e}</td> </tr> ${t.map(jt(s))}`:O` <tr> <td>${e}</td> <td>--</td> </tr>`,jt=t=>e=>O` <tr> <td class="break-all">${t(e)}</td> </tr> `,Xt=(t,e,s)=>O` <tr> <td>${t.path}/</td> </tr> <tr> <td class="break-all"> <span class="cipd-header">Requested: </span>${t.requested} </td> </tr> <tr ?hidden=${!s}> <td class="break-all"> <span class="cipd-header">Actual: </span> <a href=${function(t,e){if(!t||!e)return;const s=t.split(":");return 2===s.length?`${e}/p/${s[0]}/+/${s[1]}`:void 0}(t.actual,e.server)} target="_blank" rel="noopener" > ${t.actual} </a> </td> </tr> `,Jt=(t,e,s)=>{if(!t._taskId||t._notFound)return"";let i=null,n=null,r=null;if(s&&s.botDimensions){for(const t of s.botDimensions)"gcp"==t.key&&(n=t.value[0]),"zone"==t.key&&(r=t.value.reduce(((t,e)=>t.length>e.length?t:e)));(i=s.botLogsCloudProject)&&(n=i)}const o=!!n;return O` <div class="title">Logs Information</div> <div class="horizontal layout wrap"> <table class="task-info left"> <tbody> <tr> <td>Task related server Logs</td> <td> <a href=${((t,e,s,i)=>{const n=Rt+e.slice(0,-1),[r,o]=Ut(s,i);return Bt(t,n,r,o)})(t._projectId,t._taskId,e,s)} target="_blank" > View on Cloud Console </a> </td> </tr> <tr> <td>Bot related server Logs</td> <td> <a href=${((t,e,s)=>{const i=Rt+s.botId,[n,r]=Ut(e,s);return Bt(t,i,n,r)})(t._projectId,e,s)} target="_blank" ?hidden=${!s.botId} > View on Cloud Console </a> <p ?hidden=${s.botId}>--</p> </td> </tr> <tr> <td>Bot Logs</td> <td> <a href=${((t,e,s,i)=>{const n=`labels."compute.googleapis.com/resource_name":"${(t=>{if(!t)return t;const e=t.split("--");if(2==e.length)return e[0];if(e.length>2)throw Error("Unable to parse composite bot ID: "+t);return t})(i.botId)}"`;let r,o;if(i.startedTs){r=new Date(i.startedTs.getTime()-6e4);const t=i.completedTs||i.abandonedTs;o=t?new Date(t.getTime()+6e4):new Date}return Bt(t,n,r,o)})(n,0,0,s)} target="_blank" ?hidden=${!o} > View on Cloud Console </a> <p ?hidden=${o}>--</p> </td> </tr> </tbody> </table> </div> `},Kt=(t,e,s,i)=>{if(!t._taskId||t._notFound)return"";if(!s||!Lt(s))return O` <div class="title">Task Execution</div> <div class="task-execution"> This space left blank until a bot is assigned to the task. </div> `;if(Pt(s))return O` <div class="title">Task was Deduplicated</div> <p class="deduplicated"> This task was deduplicated from task <a href=${ct(s.dedupedFrom)}>${s.dedupedFrom}</a>. For more information on deduplication, see <a href="https://chromium.googlesource.com/infra/luci/luci-py/+/master/appengine/swarming/doc/Detailed-Design.md#task-deduplication" > the docs</a >. </p>`;i.properties||(i.properties={});const n=s.botDimensions||[],r=i.properties.dimensions||[];for(const t of n){for(const e of r)e.key===t.key&&(t.highlight=!0);if(t.values=[],t.value)for(const e of t.value){const s={name:Et(e,t.key)};for(const i of r)i.key===t.key&&i.value===e&&(s.bold=!0);t.values.push(s)}}return O` <div class=title>Task Execution</div> <table class=task-execution> <tr> <td>Bot assigned to task</td> <td><a href=${function(t){if(t)return"/bot?id="+t}(s.botId)}>${s.botId}</td> </tr> <tr> <td>Bot idle since</td> <td>${s.humanized.time.botIdleSinceTs}</td> </tr> <tr> <td rowspan=${n.length+1}> Dimensions </td> </tr> ${n.map((t=>Yt(t,r)))} <tr> <td>Exit Code</td> <td>${s.exitCode}</td> </tr> <tr> <td>Failure</td> <td class=${s.failure?"failed_task":""}>${!!s.failure}</td> </tr> <tr> <td>Internal Failure</td> <td class=${s.internalFailure?"exception":""}>${s.internalFailure}</td> </tr> <tr> <td>Cost (USD)</td> <td>$${function(t){return t&&t.costsUsd&&t.costsUsd.length?t.costsUsd[0].toFixed(4):0}(s)}</td> </tr> ${((t,e,s)=>s?O` <tr> <td>${"Missing CAS Input(s)"}</td> <td class="exception"> ${(s||[]).map((t=>((t,e)=>O` <tr> <tr> <td> <b>Instance: </b> ${e.casInstance} </td> </tr> <tr> <td> <b>Digest: </b> <a href=${Nt(t,e)} target='_blank'> ${e.digest.hash}/${e.digest.sizeBytes} </a> </td> </tr> </tr> `)(e,t)))} </td> </tr>`:"")(0,t._app._serverDetails.casViewerServer,s.missingCas)} ${((t,e)=>e?O` <tr> <td>${"Missing CIPD Package(s)"}</td> <td class="exception"> ${(e||[]).map((t=>(t=>O` <tr> <td> <b>Path: </b> ${t.path} </td> </tr> <tr> <td> <b>Package: </b> ${t.packageName} </td> </tr> <tr> <td> <b>Version: </b> ${t.version} </td> </tr> `)(t)))} </td> </tr> `:"")(0,s.missingCipd)} ${Ft("CAS Outputs",t._app._serverDetails.casViewerServer,s.casOutputRoot||{})} <tr> <td>Bot Version</td> <td>${s.botVersion}</td> </tr> <tr> <td>Server Version</td> <td>${s.serverVersions}</td> </tr> </table>`},Yt=(t,e)=>O` <tr> <td class=${t.highlight?"highlight":""}> <b class="dim_key">${t.key}:</b>${t.values.map(Qt)} </td> </tr> `,Qt=t=>O`<span class="break-all dim ${t.bold?"bold":""}" >${t.name}</span >`,Zt=t=>O`<div>${t}</div>`,te=t=>O` <tr> <td><input value=${t.key}></input></td> <td><input value=${t.value}></input></td> </tr> `,ee=t=>O` <swarming-app id=swapp ?testing_offline=${t.testing_offline}> <header> <div class=title>Swarming Task Page</div> <aside class=hideable> <a href=/>Home</a> <a href=/botlist>Bot List</a> <a href=/tasklist>Task List</a> <a href=/bot>Bot Page</a> </aside> </header> <main class="horizontal layout wrap"> <h2 class=message ?hidden=${t.loggedInAndAuthorized}>${t._message}</h2> <div class="left grow" ?hidden=${!t.loggedInAndAuthorized}> ${(t=>!t._taskId||t._notFound?O` <div class=id_buttons> <input id=id_input placeholder="Task ID" @change=${t._updateID}></input> <span class=message>Enter a Task ID to get started.</span> </div>`:O` <div class=id_buttons> <input id=id_input placeholder="Task ID" @change=${t._updateID}></input> <button title="Retry the task" @click=${t._promptRetry} class=retry ?hidden=${!function(t){return t&&t.properties&&t.properties.idempotent}(t._request)}>retry</button> <button title="Re-queue the task, but don't run it automatically" @click=${t._promptDebug} class=debug>debug</button> <button title="Cancel a pending task, so it does not start" ?hidden=${"PENDING"!==t._result.state} ?disabled=${!t.permissions.cancelTask} @click=${t._promptCancel} class=cancel>cancel</button> <button title="Kill a running task, so it stops as soon as possible" ?hidden=${"RUNNING"!==t._result.state} ?disabled=${!t.permissions.cancelTask} @click=${t._promptCancel} class=kill>kill</button> </div>`)(t)} <h2 class=not_found ?hidden=${!t._notFound||!t._taskId}> Task not found </h2> ${(t=>!t._taskId||t._notFound?"":t._request.taskSlices&&t._request.taskSlices.length>1?O` <div class="slice-picker"> ${t._request.taskSlices.map(((e,s)=>((t,e)=>O` <div class="tab" ?selected=${t._currentSliceIdx===e} @click=${()=>t._setSlice(e)} > Task Slice ${e+1} </div> `)(t,s)))} </div>`:"")(t)} ${((t,e,s,i)=>!t._taskId||t._notFound?"":(i.properties||(i.properties={}),O` <table class="task-info request-info ${function(t,e){return t&&e&&-1!==t._currentSliceIdx&&t._currentSliceIdx!==e.currentTaskSlice?"inactive":""}(t,s)}"> <tbody> <tr> <td>Name</td> <td>${e.name}</td> </tr> ${((t,e,s)=>O` <tr> <td>State</td> <td class=${function(t){if(!t||!t.state)return"";const e=t.state;return Dt.has(e)?"exception":"BOT_DIED"===e?"bot_died":"CLIENT_ERROR"===e?"client_error":St.has(e)?"pending_task":"COMPLETED"===e&&t.failure?"failed_task":""}(s)}> ${function(t,e){if(!t||!t.state)return"";if(void 0!==e&&t.currentTaskSlice!==e)return"THIS SLICE DID NOT RUN. Select another slice above.";const s=t.state;return"COMPLETED"===s?t.failure?"COMPLETED (FAILURE)":Pt(t)?"COMPLETED (DEDUPED)":"COMPLETED (SUCCESS)":s}(s,t._currentSliceIdx)} </td> </tr> ${Vt(s,t._capacityCounts[t._currentSliceIdx],t._pendingCounts[t._currentSliceIdx],t._runningCounts[t._currentSliceIdx],t._currentSlice.properties||{})} <tr ?hidden=${!s.dedupedFrom} class="highlighted"> <td><b>Deduped From</b></td> <td> <a href=${ct(s.dedupedFrom)} target="_blank"> ${s.dedupedFrom} </a> </td> </tr> <tr ?hidden=${!s.dedupedFrom}> <td>Deduped On</td> <td title=${e.createdTs}>${e.humanized.time.createdTs}</td> </tr> `)(t,e,s)} ${((t,e,s)=>O` <tr> <td>Priority</td> <td>${t.priority}</td> </tr> <tr> <td>Wait for Capacity</td> <td>${!!s.waitForCapacity}</td> </tr> <tr> <td>Slice Scheduling Deadline</td> <td>${function(t,e){if(!e.createdTs)return"";const s=1e3*t.expirationSecs;return rt(new Date(e.createdTs.getTime()+s))}(s,t)}</td> </tr> <tr> <td>User</td> <td>${t.user||"--"}</td> </tr> <tr> <td>Authenticated</td> <td>${t.authenticated}</td> </tr> <tr ?hidden=${!t.serviceAccount}> <td>Service Account</td> <td>${t.serviceAccount}</td> </tr> <tr ?hidden=${!t.realm}> <td>Realm</td> <td>${t.realm}</td> </tr> <tr ?hidden=${!s.properties.secretBytes}> <td>Has Secret Bytes</td> <td title="The secret bytes are present on the machine, but not in the UI/API" > true </td> </tr> <tr ?hidden=${!t.parentTaskId}> <td>Parent Task</td> <td> <a href=${ct(t.parentTaskId)}> ${t.parentTaskId} </a> </td> </tr> <tr ?hidden=${!e}> <td>Child Tasks</td> <td> <a href=${lt([{key:"parent_task_id-tag",value:e.runId}],[],e.startedTs,e.completedTs)} > Task List </a> </td> </tr> `)(e,s,i)} ${(t=>O` <tr> <td rowspan=${t.length+1}> Dimensions <br /> <a title="The list of bots that matches the list of dimensions" href=${ot(t)} >Bots</a > <a title="The list of tasks that matches the list of dimensions" href=${lt(t)} >Tasks</a > </td> </tr> ${t.map(Wt)} `)(i.properties.dimensions||[])} ${Ft("CAS Inputs",t._app._serverDetails.casViewerServer,i.properties.casInputRoot||{})} <tr ?hidden=${!s.resultdbInfo}> <td>ResultDB</td> <td>Enabled</td> </tr> ${zt(i.properties.outputs,"Expected outputs",(t=>t))} ${(t=>t&&t.source_revision?O` <tr> <td>Associated Commit</td> <td> <a href=${t.source_repo.replace("%s",t.source_revision)}> ${t.source_revision.substring(0,12)} </a> </td> </tr> `:"")(e.tagMap)} <tr class="details"> <td>More Details</td> <td> <button @click=${t._toggleDetails} ?hidden=${t._showDetails}> <add-circle-outline-icon-sk></add-circle-outline-icon-sk> </button> <button @click=${t._toggleDetails} ?hidden=${!t._showDetails}> <remove-circle-outline-icon-sk></remove-circle-outline-icon-sk> </button> </td> </tr> </tbody> <tbody ?hidden=${!t._showDetails}> ${((t,e,s)=>O` <tr> <td>Command</td> <td class="code break-all"> ${(t.command||[]).join(" ")||"--"} </td> </tr> <tr> <td>Relative Cwd</td> <td class="code break-all">${t.relativeCwd||"--"}</td> </tr> ${zt(e,"Environment Vars",(t=>t.key+"="+t.value))} ${zt(s,"Environment Prefixes",(t=>t.key+"="+t.value.join(":")))} <tr> <td>Idempotent</td> <td>${!!t.idempotent}</td> </tr> `)(i.properties,i.properties.env||[],i.properties.envPrefixes||[])} ${zt(e.tags,"Tags",(t=>t))} <tr> <td>Execution timeout</td> <td> ${at(i.properties.executionTimeoutSecs)} </td> </tr> <tr> <td>I/O timeout</td> <td>${at(i.properties.ioTimeoutSecs)}</td> </tr> <tr> <td>Grace period</td> <td>${at(i.properties.gracePeriodSecs)}</td> </tr> ${((t,e)=>{if(!t)return O` <tr> <td>Uses CIPD</td> <td>false</td> </tr>`;const s=(t=JSON.parse(JSON.stringify(t))).packages||[],i=e.cipdPins&&e.cipdPins.packages||[];for(let t=0;t<s.length;t++){const e=s[t];e.requested=`${e.packageName}:${e.version}`,i[t]&&(e.actual=`${i[t].packageName}:${i[t].version}`)}let n="(available when task is run)";e.cipdPins&&e.cipdPins.clientPackage&&(n=e.cipdPins.clientPackage.packageName);let r=s.length;return i.length?r*=3:r*=2,r+=1,O` <tr> <td>CIPD server</td> <td> <a href=${t.server}>${t.server}</a> </td> </tr> <tr> <td>CIPD version</td> <td class="break-all"> ${t.clientPackage&&t.clientPackage.version} </td> </tr> <tr> <td>CIPD package name</td> <td>${n}</td> </tr> <tr> <td rowspan=${r}>CIPD packages</td> </tr> ${s.map((e=>Xt(e,t,!!i.length)))} `})(i.properties.cipdInput,s)} ${zt(i.properties.caches,"Named Caches",(t=>t.name+":"+t.path))} </tbody> </table> `))(t,t._request,t._result,t._currentSlice)} ${((t,e,s)=>{if(!t._taskId||t._notFound||Pt(s))return"";const i=s.performanceStats||{};return O` <div class="title">Task Timing Information</div> <div class="horizontal layout wrap"> <table class="task-info task-timing left"> <tbody> <tr> <td>Created</td> <td title=${e.createdTs}> ${e.humanized.time.createdTs} </td> </tr> <tr ?hidden=${!Lt(s)}> <td>Started</td> <td title=${s.startedTs}> ${s.humanized.time.startedTs} </td> </tr> <tr> <td>Scheduling Deadline</td> <td>${function(t){if(!t.createdTs)return"";const e=1e3*t.expirationSecs;return rt(new Date(t.createdTs.getTime()+e))}(e)}</td> </tr> <tr ?hidden=${!s.completedTs}> <td>Completed</td> <td title=${s.completedTs}> ${s.humanized.time.completedTs} </td> </tr> <tr ?hidden=${!s.abandonedTs}> <td>Abandoned</td> <td title=${s.abandonedTs}> ${s.humanized.time.abandonedTs} </td> </tr> <tr> <td>Last updated</td> <td title=${s.modifiedTs}> ${s.humanized.time.modifiedTs} </td> </tr> <tr> <td>Pending Time</td> <td class="pending">${s.humanPending}</td> </tr> <tr> <td>Total Overhead</td> <td class="overhead"> ${at(i.botOverhead)} </td> </tr> <tr> <td>Running Time</td> <td class="running" title="An asterisk indicates the task is still running and thus the time is dynamic." > ${s.humanDuration} </td> </tr> </tbody> </table> <!-- Overheads calculated from task result is not accurate. It contains only the overheads for cipd package installation, task inputs download, task outputs upload. But there are other overheads that are not negligible, such as named cache install/uninstall, removing working dirs. <div class=right> <stacked-time-chart labels='["Pending", "Overhead", "Running", "Overhead"]' colors='["#E69F00", "#D55E00", "#0072B2", "#D55E00"]' .values=${function(t){let e=0,s=0;return t.performanceStats&&(s=t.performanceStats.isolatedUpload&&t.performanceStats.isolatedUpload.duration||0,e=t.performanceStats.botOverhead-s),[t.pending,e,t.duration,s].map((function(t){return t?Math.round(10*t)/10:0}))}(s)}> </stacked-time-chart> </div> --> </div> `})(t,t._request,t._result)} ${Jt(t,t._request,t._result)} ${Kt(t,t._request,t._result,t._currentSlice)} ${((t,e)=>{if(!t._taskId||t._notFound||!e)return"";const s=t=>at((e[t]||{}).duration||0),i=e.isolatedDownload||{},n=e.isolatedUpload||{};return O` <div class="title">Performance Stats</div> <table class="performance-stats"> <tr> <td title="This includes time taken to download inputs, isolate outputs, and setup CIPD" > Total Overhead </td> <td>${at(e.botOverhead||0)}</td> </tr> <tr> <td>Cache trimming before the task</td> <td>${s("cacheTrim")}</td> </tr> <tr> <td>Installing CIPD packages</td> <td>${s("packageInstallation")}</td> </tr> <tr> <td>Installing Named Caches</td> <td>${s("namedCachesInstall")}</td> </tr> <tr> <td>Uninstalling Named Caches</td> <td>${s("namedCachesUninstall")}</td> </tr> <tr> <td>Downloading Inputs</td> <td>${s("isolatedDownload")}</td> </tr> <tr> <td>Uploading Outputs</td> <td>${s("isolatedUpload")}</td> </tr> <tr> <td>Cleanup directories</td> <td>${s("cleanup")}</td> </tr> <tr> <td>Initial bot cache</td> <td> ${i.initialNumberItems||0} items; ${nt(i.initialSize||0)} </td> </tr> <tr> <td>Inputs (downloaded)</td> <td> ${i.numItemsCold||0} items; ${nt(i.totalBytesItemsCold||0)} </td> </tr> <tr> <td>Inputs (cached)</td> <td> ${i.numItemsHot||0} items; ${nt(i.totalBytesItemsHot||0)} </td> </tr> <tr> <td>Outputs (uploaded)</td> <td> ${n.numItemsCold||0} items; ${nt(n.totalBytesItemsCold||0)} </td> </tr> <tr> <td>Outputs (cached)</td> <td> ${n.numItemsHot||0} items; ${nt(n.totalBytesItemsHot||0)} </td> </tr> </table>`})(t,t._result.performanceStats)} ${((t,e)=>{if(!t._taskId||t._notFound||function(t){if(!t||!t.tags||!t.tags.length)return!1;const e=["buildbucket_bucket","buildbucket_build_id","buildbucket_hostname"];return t.tags.some((t=>e.some((e=>t.startsWith(e)))))}(t._request))return"";const s=e.properties&&e.properties.casInputRoot||{},i=s.digest&&`${s.digest.hash}/${s.digest.sizeBytes}`,n=window.location.hostname;return O` <div class="title">Reproducing the task locally</div> <div class="reproduce"> <div ?hidden=${!i}> <div>Download inputs files into directory <i>foo</i>:</div> <div class="code bottom_space"> # (if needed, use "\\\${platform}" as-is) cipd install "infra/tools/luci/cas/\\\${platform}" -root bar<br /> # (if needed) ./bar/cas login<br /> ./bar/cas download -cas-instance ${s.casInstance} -digest ${i} -dir foo </div> </div> <div>Run this task locally:</div> <div class="code bottom_space"> # (if needed, use "\\\${platform}" as-is) cipd install "infra/tools/luci/swarming/\\\${platform}" -root bar<br /> # (if needed) ./bar/swarming login<br /> # '-realm' is only needed if resultdb is enabled for the task.<br /> # Please use a realm that has 'role/resultdb.invocationCreator' in the realms.cfg of your project.<br /> mkdir repro_dir && cd repro_dir<br /> ../bar/swarming reproduce -S ${n} -realm project:foo ${t._taskId} </div> <div>Download output results into directory <i>foo</i>:</div> <div class="code bottom_space"> # (if needed, use "\\\${platform}" as-is) cipd install "infra/tools/luci/swarming/\\\${platform}" -root bar<br /> # (if needed) ./bar/swarming login<br /> mkdir collect_dir && cd collect_dir<br /> ../bar/swarming collect -S ${n} -output-dir=foo ${t._taskId} </div> </div> `})(t,t._currentSlice)} </div> <div class="right grow" ?hidden=${!t.loggedInAndAuthorized}> ${(t=>!t._taskId||t._notFound?"":O` <div class="horizontal layout"> <div class="output-picker"> <div class="tab" selected>Raw Output</div> <div class="tab" ?hidden=${!function(t){if(!t||!t._request||!t._request.tagMap)return!1;const e=t._request.tagMap;return e.allow_milo||e.luci_project}(t)}> <a rel="noopener" target="_blank" href=${M(function(t){if(!t||!t._request||!t._request.tagMap)return;const e=t._request.tagMap,s=e.milo_host;let i=e.log_location;if(i&&s){if(-1!==(i=i.replace("logdog://","")).indexOf(At)){if(!t._result||!t._result.runId)return;i=i.replace(At,t._result.runId)}return s.replace("%s",i)}const n=t.serverDetails.displayServerUrlTemplate;return n&&t._taskId?n.replace("%s",t._taskId):void 0}(t))} > Rich Output </a> </div> <checkbox-sk id="wide_logs" ?checked=${t._wideLogs} @click=${t._toggleWidth} > </checkbox-sk> <span>Full Width Logs</span> </div> </div> <div class="code stdout tabbed ${t._wideLogs?"wide":"break-all"}"> ${t._stdout.map(Zt)} </div>`)(t)} </div> </main> <footer></footer> <dialog-pop-over id=retry> <div class='retry-dialog content'> ${((t,e)=>{const s=e.dimensions||[];return O` <div class=prompt> <h2> Are you sure you want to ${t._isPromptDebug?"debug":"retry"} task ${t._taskId}? </h2> <div class="vertical grid"> <div class=ib ?hidden=${!t._isPromptDebug}> <span>Realm (you may need to change pool dimension as well)</span> <input type="text" id=task_realm value="${t._request.realm}"></input> </div> <div class=ib ?hidden=${!t._isPromptDebug}> <span>Lease Duration</span> <input type="text" id=lease_duration value=4h></input> </div> <div class=ib> <checkbox-sk class=same-bot ?disabled=${!Lt(t._result)} ?checked=${t._useSameBot} @click=${t._toggleSameBot}> </checkbox-sk> <span>Run task on the same bot</span> </div> <br> </div> <div>If you want to modify any dimensions (e.g. specify a bot's id), do so now.</div> <table ?hidden=${t._useSameBot}> <thead> <tr> <th>Key</th> <th>Value</th> </tr> </thead> <tbody id=retry_inputs> ${s.map(te)} ${te({key:"",value:""})} </tbody> </table> </div>`})(t,t._currentSlice.properties||{})} <div class="horizontal layout end"> <button @click=${t._closePopups} class=cancel tabindex=0>Cancel</button> <button @click=${t._promptCallback} class=ok tabindex=0>OK</button> </div> </div> </dialog-pop-over> <dialog-pop-over id=cancel> <div class='cancel-dialog content'> Are you sure you want to ${t._prompt} task ${t._taskId}? <div class="horizontal layout end"> <button @click=${t._closePopups} class=cancel tabindex=0>NO</button> <button @click=${t._promptCallback} class=ok tabindex=0>YES</button> </div> </div> </dialog-pop-over> </swarming-app> `;window.customElements.define("task-page",class extends Gt{constructor(){super(ee),this._taskId="",this._showDetails=!1,this._wideLogs=!1,this._urlParamsLoaded=!1;const t=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,t),this._stateChanged=q((()=>({id:this._taskId,d:this._showDetails,w:this._wideLogs})),(t=>{this._taskId=t.id||this._taskId,this._showDetails=t.d,this._wideLogs=t.w,this._urlParamsLoaded=!0,this._fetch(),this.render()})),this._request=pt({}),this._result=pt({}),this._stdout=[],this._stdoutOffset=0,this._currentSlice={},this._currentSliceIdx=-1,this._notFound=!1,this._extraTries=[],this._capacityCounts=[],this._pendingCounts=[],this._runningCounts=[],this._message="You must sign in to see anything useful.",this._fetchController=null,this._promptCallback=()=>{},this._isPromptDebug=!1,this._useSameBot=!1,this._logFetchPeriod=1e4}connectedCallback(){super.connectedCallback(),this._loginEvent=t=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this.render()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent)}_cancelTask(){let t=!1;"RUNNING"===this._result.state&&(t=!0),this.app.addBusyTasks(1),this._createTasksService().cancel(this._taskId,t).then((t=>{this._closePopups(),n("Request sent",4e3),this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"task/cancel")))}_closePopups(){this._promptCallback=()=>{},e("dialog-pop-over",this).map((t=>t.hide()))}_collectDimensions(){const t=[];if(this._useSameBot)t.push({key:"id",value:xt(this._result.botDimensions,"id")},{key:"pool",value:xt(this._result.botDimensions,"pool")});else{const s=e("#retry_inputs tr",this);for(const e of s){const s=e.children[0].firstElementChild.value,i=e.children[1].firstElementChild.value;s&&i&&t.push({key:s,value:i})}if(!t.length)return n("You must specify some dimensions (pool is required)",6e3),null;if(!xt(t,"pool"))return n("The pool dimension is required"),null}return t}_currentSliceProperties(){return JSON.parse(JSON.stringify(this._currentSlice.properties))}_debugTask(){const t=function(t){let e=t.slice(0,-1);if(!/[1-9][0-9]*/.test(e))return null;switch(e=parseInt(e),t.slice(-1)){case"h":e*=60;case"m":e*=60;case"s":break;default:return null}return e}(i("#lease_duration").value),e=this._currentSliceProperties(),s=this._collectDimensions();s&&(e.dimensions=s,e.secretBytes="",e.idempotent=!1,e.executionTimeoutSecs=t,e.ioTimeoutSecs=t,e.command=["python3","-c",`import os, sys, time\nprint('Mapping task: ${location.origin}/task?id=${this._taskId}')\nprint('Files are mapped into: ' + os.getcwd())\nprint('')\nprint('Bot id: ' + os.environ['SWARMING_BOT_ID'])\nprint('Bot leased for: ${t} seconds')\nprint('How to access this bot: http://go/swarming-ssh')\nprint('When done, reboot the host')\nprint('')\nprint('Some tests may fail without the following env vars set:')\nprint('PATH=' + os.environ['PATH'])\nprint('LUCI_CONTEXT=' + os.environ['LUCI_CONTEXT'])\nsys.stdout.flush()\ntime.sleep(${t})`],this._newTask({name:`leased to ${this.profile.email} for debugging`,poolTaskTemplate:"SKIP",priority:20,realm:i("#task_realm").value||this._request.realm,serviceAccount:this._request.serviceAccount,tags:["debug_task:1"],taskSlices:[{expirationSecs:this._request.expirationSecs,properties:e}],user:this.profile.email}),this._closePopups())}_fetch(){if(!this.loggedInAndAuthorized||!this._urlParamsLoaded||!this._taskId)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const t={authHeader:this.authHeader,signal:this._fetchController.signal};this.app._fetchPermissions(t,{taskId:this._taskId}),this._fetchTaskInfo(t),this._fetchStdOut(t)}_fetchTaskInfo(t){this.app.addBusyTasks(2);let e=-1;const s=this._createTasksService();s.request(this._taskId).then((s=>{this._notFound=!1,this._request=function(t){if(!t)return pt({});ut(t,Ht),t.tagMap={},t.tags=t.tags||[];for(const e of t.tags){const s=e.split(":",1)[0],i=e.substring(s.length+1);t.tagMap[s]=i}return t}(s),this._fetchCounts(this._request,t),e>=0?this._setSlice(e):this.render(),this.app.finishedTask()})).catch((t=>{404===t.status&&(this._request=pt({}),this._notFound=!0,this.render()),this.fetchError(t,"task/request")})),this._extraTries=[],s.result(this._taskId,!0).then((t=>{this._result=function(t){if(!t)return pt({});ut(t,Ht);const e=new Date;!t.duration&&"RUNNING"===t.state&&t.startedTs?t.duration=(e-t.startedTs)/1e3:!t.duration&&"BOT_DIED"===t.state&&t.startedTs&&t.abandonedTs&&(t.duration=(t.abandonedTs-t.startedTs)/1e3),t.humanDuration=at(t.duration),"RUNNING"===t.state?t.humanDuration+="*":"BOT_DIED"===t.state&&(t.humanDuration+=" -- died");const s=t.startedTs||t.abandonedTs||new Date;return t.createdTs?s<=t.createdTs?(t.pending=0,t.humanPending="0s"):(t.pending=(s-t.createdTs)/1e3,t.humanPending=function(t,e){return t?(e||(e=new Date),it((e.getTime()-t.getTime())/1e3)||"0s"):"eons"}(t.createdTs,s)):(t.pending=0,t.humanPending=""),t.currentTaskSlice=parseInt(t.currentTaskSlice)||0,t}(t),e=+this._result.currentTaskSlice,this._setSlice(e),this.app.finishedTask()})).catch((t=>this.prpcError(t,"task/result")))}_fetchStdOut(t){this.app.addBusyTasks(1);let e="";const s=()=>{this._createTasksService().stdout(this._taskId,this._stdoutOffset,102400).then((i=>{e||(e=i.state);const n=i.output?function(t){return new TextDecoder("utf-8",{fatal:!1}).decode(function(t){const e=atob(t);return Uint8Array.from(e,(t=>t.codePointAt(0)))}(t))}(i.output):"",r=new Blob([n]).size;this._stdoutOffset+=r;const o=n.replace(/\r\n/g,"\n"),a=o.lastIndexOf("\n");let d=o,l="";-1!==a&&(d=o.substring(0,a+1),l=o.substring(a+1)),this._stdout.length&&!this._stdout[this._stdout.length-1].endsWith("\n")?(this._stdout[this._stdout.length-1]+=d,l&&this._stdout.push(l)):(this._stdout.push(d),l&&this._stdout.push(l)),this.render(),i.state!==e&&this._fetchTaskInfo(t),"RUNNING"===i.state||"PENDING"===i.state?r<102400?setTimeout(s,this._logFetchPeriod):s():r<102400?this.app.finishedTask():s(),e=i.state})).catch((t=>this.prpcError(t,"task/request")))};s()}_fetchCounts(t,e){const s=t.taskSlices.length;this.app.addBusyTasks(3*s),this._capacityCounts=[],this._capacityCounts.fill(void 0,0,s),this._pendingCounts=[],this._pendingCounts.fill(void 0,0,s),this._runningCounts=[],this._pendingCounts.fill(void 0,0,s);for(let e=0;e<s;e++){const s=[],i=[],n=e;for(const n of t.taskSlices[e].properties.dimensions)i.push(n),s.push(`${n.key}:${n.value}`);this._createBotService().count(i).then((t=>{this._capacityCounts[n]=t,this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"bots/count slice "+e,!0)));const r=new Date;r.setSeconds(0),r.setDate(r.getDate()-1);const o=this._createTasksService();o.count({tags:s,start:r,state:"QUERY_RUNNING"}).then((t=>{this._runningCounts[n]=t.count||"0",this.render(),this.app.finishedTask()})).catch((t=>this.fetchError(t,"tasks/running slice "+e,!0))),o.count({tags:s,start:r,state:"QUERY_PENDING"}).then((t=>{this._pendingCounts[n]=t.count||"0",this.render(),this.app.finishedTask()})).catch((t=>this.prpcError(t,"tasks/pending slice "+e,!0)))}}_newTask(t){this.app.addBusyTasks(1),this._createTasksService().new(t).then((t=>{t&&t.taskId&&(this._taskId=t.taskId,this._stateChanged(),this._fetch(),this.render(),this.app.finishedTask())})).catch((t=>this.prpcError(t,"newtask")))}_promptCancel(){this._prompt="cancel","RUNNING"===this._result.state&&(this._prompt="kill"),this._promptCallback=this._cancelTask,this.render(),i("dialog-pop-over#cancel",this).show(),i("dialog-pop-over#cancel button.cancel",this).focus()}_promptDebug(){this._request?(this._isPromptDebug=!0,this._useSameBot=!1,this._promptCallback=this._debugTask,this.render(),i("dialog-pop-over#retry",this).show(),i("dialog-pop-over#retry button.cancel",this).focus()):n("Task not yet loaded",3e3)}_promptRetry(){this._request?(this._isPromptDebug=!1,this._useSameBot=!1,this._promptCallback=this._retryTask,this.render(),i("dialog-pop-over#retry",this).show(),i("dialog-pop-over#retry button.cancel",this).focus()):n("Task not yet loaded",3e3)}render(){super.render(),i("#id_input",this).value=this._taskId}_retryTask(){const t=this._currentSliceProperties(),e=[...this._request.tags];e.includes("retry:1")||e.push("retry:1");const s=this._collectDimensions();s&&(t.dimensions=s,t.secretBytes="",t.idempotent=!1,this._newTask({name:this._request.name+" (retry)",poolTaskTemplate:"SKIP",priority:this._request.priority,taskSlices:[{expirationSecs:this._request.expirationSecs,properties:t}],serviceAccount:this._request.serviceAccount,tags:e,user:this.profile.email,resultdb:{enable:Boolean(this._result.resultdbInfo)},realm:this._request.realm}),this._closePopups())}_setSlice(t){this._currentSliceIdx=t,this._request.taskSlices&&(this._currentSlice=this._request.taskSlices[t],this.render())}_toggleDetails(t){this._showDetails=!this._showDetails,this._stateChanged(),this.render()}_toggleSameBot(t){t.preventDefault(),Lt(this._result)&&(this._useSameBot=!this._useSameBot,this.render())}_toggleWidth(t){t.preventDefault(),this._wideLogs=!this._wideLogs,this._stateChanged(),this.render()}_updateID(t){const e=i("#id_input",this);this._taskId=e.value,this._stdout=[],this._stdoutOffset=0,this._stateChanged(),this._fetch(),this.render()}})})()})();
\ No newline at end of file
diff --git a/appengine/swarming/ui2/dist/public_task_index.html b/appengine/swarming/ui2/dist/public_task_index.html
index ce80739..0042b7a 100644
--- a/appengine/swarming/ui2/dist/public_task_index.html
+++ b/appengine/swarming/ui2/dist/public_task_index.html
@@ -1 +1 @@
-<script defer src="/newres/public_task_index-bundle.js?8d5340cee8116958e519"></script><link href="/newres/public_task_index-bundle.css" rel="stylesheet"><title>Task Page - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><task-page></task-page>
\ No newline at end of file
+<script defer src="/newres/public_task_index-bundle.js?b4f9d38572b71de32835"></script><link href="/newres/public_task_index-bundle.css" rel="stylesheet"><title>Task Page - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><task-page></task-page>
\ No newline at end of file
diff --git a/appengine/swarming/ui2/dist/public_tasklist_index-bundle.js b/appengine/swarming/ui2/dist/public_tasklist_index-bundle.js
index 9d14023..8b5dcfd 100644
--- a/appengine/swarming/ui2/dist/public_tasklist_index-bundle.js
+++ b/appengine/swarming/ui2/dist/public_tasklist_index-bundle.js
@@ -1 +1 @@
-(()=>{var e={445:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(s,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,o)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const e in t.RpcCode)i[t.RpcCode[e]]=e;function s(e){return i[e]}t.rpcCodeToCodeName=s,t.PrpcClient=class{constructor(e=null){e=e||{},this.host=e.host||document.location.host,this.accessToken=e.accessToken||null,this.insecure=e.hasOwnProperty("insecure")&&Boolean(e.insecure),this.fetchImpl=e.fetchImpl||window.fetch.bind(window)}call(e,i,s,o){return n(this,void 0,void 0,(function*(){if(!e)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!s)throw new TypeError("missing required argument: message");if(!(s instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const n=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${e}/${i}`,l=this._requestOptions(s,o),c=yield this.fetchImpl(n,l);if(!c.headers.has("X-Prpc-Grpc-Code"))throw new r(c.status,"Invalid response: no X-Prpc-Grpc-Code response header");const d=Number.parseInt(c.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(d))throw new r(c.status,"Invalid X-Prpc-Grpc-Code response header");const u=yield c.text();if(d!==t.RpcCode.OK)throw new a(d,u);if(!u.startsWith(")]}'"))throw new r(c.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(u.substr(4))}))}_requestOptions(e,t){const n={accept:"application/json","content-type":"application/json"};return t&&Object.assign(n,t),this.accessToken&&(n.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:n,body:JSON.stringify(e)}}};class a extends Error{constructor(e,t){if(super(),this.code=e,this.description=t,null===e)throw new Error("missing required argument: code");this.codeName=s(e)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}t.GrpcError=a;class r extends Error{constructor(e,t){if(super(),this.httpStatus=e,this.description=t,null===e)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}t.ProtocolError=r},124:()=>{"use strict";"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var i=function(t){t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))},s=0,a=t;s<a.length;s++)i(a[s]);return e})},28:e=>{e.exports=function e(t,n){"use strict";var i,s,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,r=/(^[ ]*|[ ]*$)/g,o=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,d=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},u=d(t).replace(r,"")||"",h=d(n).replace(r,"")||"",f=u.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=h.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=parseInt(u.match(l),16)||1!==f.length&&u.match(o)&&Date.parse(u),g=parseInt(h.match(l),16)||p&&h.match(o)&&Date.parse(h)||null;if(g){if(p<g)return-1;if(p>g)return 1}for(var v=0,_=Math.max(f.length,m.length);v<_;v++){if(i=!(f[v]||"").match(c)&&parseFloat(f[v])||f[v]||0,s=!(m[v]||"").match(c)&&parseFloat(m[v])||m[v]||0,isNaN(i)!==isNaN(s))return isNaN(i)?1:-1;if(typeof i!=typeof s&&(i+="",s+=""),i<s)return-1;if(i>s)return 1}return 0}}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=new Promise((function(e,t){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)})),t=(e,t=document)=>t.querySelector(e);function i(e,t=1e4){"object"==typeof e&&(e=e.message||JSON.stringify(e));var n={message:e,duration:t};document.dispatchEvent(new CustomEvent("error-sk",{detail:n,bubbles:!0}))}const s=new WeakMap,a=e=>(...t)=>{const n=e(...t);return s.set(n,!0),n},r=e=>"function"==typeof e&&s.has(e),o=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,l=(e,t,n=null)=>{let i=t;for(;i!==n;){const t=i.nextSibling;e.removeChild(i),i=t}},c={},d={},u=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${u}--\x3e`,f=new RegExp(`${u}|${h}`),m="$lit$";class p{constructor(e,t){this.parts=[],this.element=t;let n=-1,i=0;const s=[],a=t=>{const r=t.content,o=document.createTreeWalker(r,133,null,!1);let l=0;for(;o.nextNode();){n++;const t=o.currentNode;if(1===t.nodeType){if(t.hasAttributes()){const s=t.attributes;let a=0;for(let e=0;e<s.length;e++)s[e].value.indexOf(u)>=0&&a++;for(;a-- >0;){const s=e.strings[i],a=_.exec(s)[2],r=a.toLowerCase()+m,o=t.getAttribute(r).split(f);this.parts.push({type:"attribute",index:n,name:a,strings:o}),t.removeAttribute(r),i+=o.length-1}}"TEMPLATE"===t.tagName&&a(t)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(u)>=0){const a=t.parentNode,r=e.split(f),o=r.length-1;for(let e=0;e<o;e++)a.insertBefore(""===r[e]?v():document.createTextNode(r[e]),t),this.parts.push({type:"node",index:++n});""===r[o]?(a.insertBefore(v(),t),s.push(t)):t.data=r[o],i+=o}}else if(8===t.nodeType)if(t.data===u){const e=t.parentNode;null!==t.previousSibling&&n!==l||(n++,e.insertBefore(v(),t)),l=n,this.parts.push({type:"node",index:n}),null===t.nextSibling?t.data="":(s.push(t),n--),i++}else{let e=-1;for(;-1!==(e=t.data.indexOf(u,e+1));)this.parts.push({type:"node",index:-1})}}};a(t);for(const e of s)e.parentNode.removeChild(e)}}const g=e=>-1!==e.index,v=()=>document.createComment(""),_=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class b{constructor(e,t,n){this._parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this._parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this._parts)void 0!==e&&e.commit()}_clone(){const e=o?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=this.template.parts;let n=0,i=0;const s=e=>{const a=document.createTreeWalker(e,133,null,!1);let r=a.nextNode();for(;n<t.length&&null!==r;){const e=t[n];if(g(e))if(i===e.index){if("node"===e.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(r.previousSibling),this._parts.push(e)}else this._parts.push(...this.processor.handleAttributeExpressions(r,e.name,e.strings,this.options));n++}else i++,"TEMPLATE"===r.nodeName&&s(r.content),r=a.nextNode();else this._parts.push(void 0),n++}};return s(e),o&&(document.adoptNode(e),customElements.upgrade(e)),e}}class w{constructor(e,t,n,i){this.strings=e,this.values=t,this.type=n,this.processor=i}getHTML(){const e=this.strings.length-1;let t="";for(let n=0;n<e;n++){const e=this.strings[n],i=_.exec(e);t+=i?e.substr(0,i.index)+i[1]+i[2]+m+i[3]+u:e+h}return t+this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}const y=e=>null===e||!("object"==typeof e||"function"==typeof e);class C{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e<n.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new D(this)}_getValue(){const e=this.strings,t=e.length-1;let n="";for(let i=0;i<t;i++){n+=e[i];const t=this.parts[i];if(void 0!==t){const e=t.value;if(null!=e&&(Array.isArray(e)||"string"!=typeof e&&e[Symbol.iterator]))for(const t of e)n+="string"==typeof t?t:String(t);else n+="string"==typeof e?e:String(e)}}return n+e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class D{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===c||y(e)&&e===this.value||(this.value=e,r(e)||(this.committer.dirty=!0))}commit(){for(;r(this.value);){const e=this.value;this.value=c,e(this)}this.value!==c&&this.committer.commit()}}class k{constructor(e){this.value=void 0,this._pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(v()),this.endNode=e.appendChild(v())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e._insert(this.startNode=v()),e._insert(this.endNode=v())}insertAfterPart(e){e._insert(this.startNode=v()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this._pendingValue=e}commit(){for(;r(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}const e=this._pendingValue;e!==c&&(y(e)?e!==this.value&&this._commitText(e):e instanceof w?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===d?(this.value=d,this.clear()):this._commitText(e))}_insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}_commitNode(e){this.value!==e&&(this.clear(),this._insert(e),this.value=e)}_commitText(e){const t=this.startNode.nextSibling;e=null==e?"":e,t===this.endNode.previousSibling&&3===t.nodeType?t.data=e:this._commitNode(document.createTextNode("string"==typeof e?e:String(e))),this.value=e}_commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof b&&this.value.template===t)this.value.update(e.values);else{const n=new b(t,e.processor,this.options),i=n._clone();n.update(e.values),this._commitNode(i),this.value=n}}_commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let n,i=0;for(const s of e)void 0===(n=t[i])&&(n=new k(this.options),t.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(t[i-1])),n.setValue(s),n.commit(),i++;i<t.length&&(t.length=i,this.clear(n&&n.endNode))}clear(e=this.startNode){l(this.startNode.parentNode,e.nextSibling,this.endNode)}}class E{constructor(e,t,n){if(this.value=void 0,this._pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=n}setValue(e){this._pendingValue=e}commit(){for(;r(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=c}}class T extends C{constructor(e,t,n){super(e,t,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new M(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class M extends D{}let x=!1;try{const e={get capture(){return x=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class I{constructor(e,t,n){this.value=void 0,this._pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this._boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this._pendingValue=e}commit(){for(;r(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=this._pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=A(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=c}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const A=e=>e&&(x?{capture:e.capture,passive:e.passive,once:e.once}:e.capture),N=new class{handleAttributeExpressions(e,t,n,i){const s=t[0];return"."===s?new T(e,t.slice(1),n).parts:"@"===s?[new I(e,t.slice(1),i.eventContext)]:"?"===s?[new E(e,t.slice(1),n)]:new C(e,t,n).parts}handleTextExpression(e){return new k(e)}};function S(e){let t=P.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},P.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const i=e.strings.join(u);return void 0===(n=t.keyString.get(i))&&(n=new p(e,e.getTemplateElement()),t.keyString.set(i,n)),t.stringsArray.set(e.strings,n),n}const P=new Map,L=new WeakMap,O=(e,t,n)=>{let i=L.get(t);void 0===i&&(l(t,t.firstChild),L.set(t,i=new k(Object.assign({templateFactory:S},n))),i.appendInto(t)),i.setValue(e),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const H=(e,...t)=>new w(e,t,"html",N),$=a((e=>t=>{if(void 0===e&&t instanceof D){if(e!==t.value){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else t.setValue(e)})),R=new WeakMap,F=a(((...e)=>t=>{let n=R.get(t);void 0===n&&(n={values:[]},R.set(t,n));const i=n.values;n.values=e;for(let s=0;s<e.length&&!(void 0!==n.lastRenderedIndex&&s>n.lastRenderedIndex);s++){const a=e[s];if(y(a)||"function"!=typeof a.then){t.setValue(a),n.lastRenderedIndex=s;break}void 0!==n.lastRenderedIndex&&"function"==typeof a.then&&a===i[s]||(n.lastRenderedIndex=void 0,Promise.resolve(a).then((e=>{const i=n.values.indexOf(a);i>-1&&(void 0===n.lastRenderedIndex||i<n.lastRenderedIndex)&&(n.lastRenderedIndex=i,t.setValue(e),t.commit())})))}}));var U=n(28),Y=n.n(U);function j(e){var t=[];return Object.keys(e).sort().forEach((function(n){Array.isArray(e[n])?e[n].forEach((function(e){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):"object"==typeof e[n]?t.push(encodeURIComponent(n)+"="+encodeURIComponent(j(e[n]))):t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]))})),t.join("&")}function G(e,t){t=t||{};for(var n={},i=e.split("&"),s=0;s<i.length;s++){var a=i[s].split("=",2);if(2==a.length){var r=decodeURIComponent(a[0]),o=decodeURIComponent(a[1]);if(t.hasOwnProperty(r))switch(typeof t[r]){case"boolean":n[r]="true"==o;break;case"number":n[r]=Number(o);break;case"object":if(Array.isArray(t[r])){var l=n[r]||[];l.push(o),n[r]=l}else n[r]=G(o,t[r]);break;default:n[r]=o}else n[r]=o}}return n}const W=e=>JSON.parse(JSON.stringify(e));function V(t,n){let i=W(t()),s=!1;const a=()=>{s=!0;let e=G(window.location.search.slice(1),i);n(function(e,t){let n={};return Object.keys(t).forEach((function(i){e.hasOwnProperty(i)?n[i]=W(e[i]):n[i]=W(t[i])})),n}(e,i))};return e.then(a),window.addEventListener("popstate",a),()=>{if(!s)return;let e=j(function(e,t){let n={};return Object.keys(e).forEach((function(i){(function(e,t){if(typeof e!=typeof t)return!1;let n=typeof e;return"string"===n||"boolean"===n||"number"===n?e===t:"object"===n?Array.isArray(n)?JSON.stringify(e)===JSON.stringify(t):j(e)===j(t):void 0})(e[i],t[i])||(n[i]=e[i])})),n}(t(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+e)}}function B(e,t){if(e.hasOwnProperty(t)){let n=e[t];delete e[t],e[t]=n}}class z extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),B(this,"checked"),B(this,"disabled"),B(this,"name"),B(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(e){let t=!!e;this._input.checked=t,e?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){let t=!!e;this._input.disabled=t,t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(e){this.setAttribute("name",e),this._input.setAttribute("name",e)}get label(){return this._input.getAttribute("label")}set label(e){this.setAttribute("label",e),this._input.setAttribute("label",e)}attributeChangedCallback(e,t,n){if(!this._input)return;let i=null!=n;switch(e){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=n;break;case"label":this._label.textContent=n}}}window.customElements.define("checkbox-sk",z);const K=document.createElement("template");K.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>',window.customElements.define("add-circle-icon-sk",class extends HTMLElement{connectedCallback(){let e=K.content.cloneNode(!0);this.appendChild(e)}});const Q=document.createElement("template");Q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',window.customElements.define("cancel-icon-sk",class extends HTMLElement{connectedCallback(){let e=Q.content.cloneNode(!0);this.appendChild(e)}});const q=document.createElement("template");q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>',window.customElements.define("more-horiz-icon-sk",class extends HTMLElement{connectedCallback(){let e=q.content.cloneNode(!0);this.appendChild(e)}});const X=document.createElement("template");X.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>',window.customElements.define("more-vert-icon-sk",class extends HTMLElement{connectedCallback(){let e=X.content.cloneNode(!0);this.appendChild(e)}});const J=document.createElement("template");J.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',window.customElements.define("search-icon-sk",class extends HTMLElement{connectedCallback(){let e=J.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("select-sk",class extends HTMLElement{constructor(){super(),this._obs=new MutationObserver((()=>this._bubbleUp())),this._selection=-1}connectedCallback(){B(this,"selection"),B(this,"disabled"),this.addEventListener("click",this._click),this._obs.observe(this,{childList:!0}),this._bubbleUp()}disconnectedCallback(){this.removeEventListener("click",this._click),this._obs.disconnect()}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?(this.setAttribute("disabled",""),this.selection=-1):(this.removeAttribute("disabled"),this._bubbleUp())}get selection(){return this._selection}set selection(e){this.disabled||(null!=e||(e=-1),this._selection=+e,this._rationalize())}_click(e){if(this.disabled)return;let t=this._selection,n=e.target;for(;n&&n.parentElement!==this;)n=n.parentElement;if(n&&n.parentElement===this)for(let e=0;e<this.children.length;e++)if(this.children[e]===n){this._selection=e;break}this._rationalize(),t!=this._selection&&this.dispatchEvent(new CustomEvent("selection-changed",{detail:{selection:this._selection},bubbles:!0}))}_rationalize(){for(let e=0;e<this.children.length;e++)this._selection===e?this.children[e].setAttribute("selected",""):this.children[e].removeAttribute("selected")}_bubbleUp(){if(this._selection=-1,!this.disabled){for(let e=0;e<this.children.length;e++)if(this.children[e].hasAttribute("selected")){this._selection=e;break}this._rationalize()}}});const Z=document.createElement("template");Z.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const e=Z.content.cloneNode(!0);if(this.appendChild(e),this._backdrop=t(".backdrop",this),this._content=t(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const e=window.innerWidth,t=window.innerHeight,n=Math.min(this._content.offsetWidth,e-50),i=Math.min(this._content.offsetHeight,t-50);this._content.style.width=n,this._content.style.left=(e-n)/2,this._content.style.top=(t-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}});const ee=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}];function te(e){if(0===e||"0"===e)return"0s";if(!e)return"--";const t=parseFloat(e);return t?t>60?function(e){if(e<0&&(e=-e),0===e)return"  0s";let t="";for(let n=0;n<ee.length;n++)if(ee[n].delta<=e){let i=Math.floor(e/ee[n].delta)+ee[n].units;for(;i.length<4;)i=" "+i;t+=i,e%=ee[n].delta}return t}(t):t.toFixed(2)+"s":e+" seconds"}function ne(e,t,n=!0){B(e,t),void 0===e[t]&&e.hasAttribute(t)&&(e[t]=e.getAttribute(t),n&&e.removeAttribute(t))}const ie=/_[a-zA-Z]/g;function se(e){return e.replace(ie,(function(e){return e.substring(1).charAt(0).toUpperCase()+e.substring(2)}))}class ae{constructor(e){this._time=new Proxy(e,{get(e,t,n){let i=Reflect.get(e,t,n);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const s=i.toString(),a=s.substring(s.indexOf("("));return`${i.toLocaleString()} ${a}`}})}get time(){return this._time}}function re(e,t){if(void 0!==e){for(const n of t){const t=e[n];"string"==typeof t&&(e[n]=new Date(t))}e.humanized=new ae(e)}}const oe=document.createElement("template");oe.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>',window.customElements.define("arrow-drop-down-icon-sk",class extends HTMLElement{connectedCallback(){let e=oe.content.cloneNode(!0);this.appendChild(e)}});const le=document.createElement("template");le.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 14l5-5 5 5z"/></svg>',window.customElements.define("arrow-drop-up-icon-sk",class extends HTMLElement{connectedCallback(){let e=le.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("sort-toggle",class extends HTMLElement{constructor(){super()}connectedCallback(){ne(this,"currentKey"),ne(this,"key"),ne(this,"direction"),this.addEventListener("click",(()=>{this.toggle()})),this.render()}get currentKey(){return this._currentKey}set currentKey(e){this._currentKey=e,this.render()}get key(){return this._key}set key(e){this._key=e,this.render()}get direction(){return this._direction}set direction(e){this._direction=e,this.render()}toggle(){this.currentKey===this.key&&"asc"===this.direction?this.direction="desc":this.direction="asc",this.dispatchEvent(new CustomEvent("sort-change",{detail:{direction:this.direction,key:this.key},bubbles:!0}))}render(){var e;O(H` <arrow-drop-down-icon-sk ?hidden=${(e=this).key===e.currentKey&&"asc"===e.direction} > </arrow-drop-down-icon-sk> <arrow-drop-up-icon-sk ?hidden=${e.key===e.currentKey&&"desc"===e.direction} > </arrow-drop-up-icon-sk>`,this,{eventContext:this})}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),B(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(e){this.setAttribute("duration",e)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(e){e.detail.duration&&(this._toast.duration=e.detail.duration),this._toast.textContent=e.detail.message,this._toast.show()}});const ce=document.createElement("template");ce.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let e=ce.content.cloneNode(!0);this.appendChild(e)}});const de=document.createElement("template");function ue(e){if(e.ok)return e.json();throw{message:`Bad network response: ${e.statusText}`,resp:e,status:e.status}}de.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let e=de.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){B(this,"active")}get active(){return this.hasAttribute("active")}set active(e){e?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){B(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((e=>{"anonymous:anonymous"!=e.identity&&(this._fireLoginEvent(e),this.render())}),(e=>{console.error(e),i(`Error getting auth state: ${JSON.stringify(e)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(e){this._profile={email:e.email,imageURL:e.picture},this._auth_header=`Bearer ${e.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(e){const t=window.location.pathname+window.location.search;window.location=t&&"/"!=t?`/auth/openid/${e}?r=${encodeURIComponent(t)}`:`/auth/openid/${e}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(ue)}render(){var e;O((e=this).authHeader?H` <div> <img class="center" id="avatar" src="${e._profile.imageURL}" width="30" height="30" /> <span class="center">${e._profile.email}</span> <span class="center">|</span> <a class="center" @click=${e._logOut} href="#">Sign out</a> </div>`:H` <div> <a @click=${e._logIn} href="#">Sign in</a> </div>`,this,{eventContext:this})}attributeChangedCallback(e,t,n){this.render()}});var he=n(445);class fe{constructor(e,t=null,n={}){const i={...n,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=e,t){const e=(e,n)=>(n.signal=t,fetch(e,n));i.fetchImpl=e}this._client=new he.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(e,t){const n={authorization:this._token};return this._client.call(this.service,e,t,n)}}class me extends fe{get service(){return"swarming.v2.Swarming"}permissions(e){return this._call("GetPermissions",e)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const pe=document.createElement("template");pe.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const ge=document.createElement("template");ge.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const ve="You must log in to see more details",_e=document.createElement("template");_e.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:ve,botVersion:"",casViewerServer:""};const e=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,e),this._permissions={}}connectedCallback(){B(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(e=>{this._auth_header=e.detail.authHeader,this._profile=e.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(e){this._busyTaskCount+=e,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const e=this.querySelector("header"),t=e&&e.querySelector("aside"),n=this.querySelector("footer");if(!(e&&t&&t.classList.contains("hideable")))return;let i=pe.content.cloneNode(!0);e.insertBefore(i,e.firstElementChild),(i=e.firstElementChild).addEventListener("click",(e=>this._toggleMenu(e,t)));const s=ge.content.cloneNode(!0);e.insertBefore(s,t),this._spinner=e.querySelector("spinner-sk");const a=document.createElement("span");a.classList.add("grow"),e.appendChild(a),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),e.appendChild(this._dynamicEle);const r=document.createElement("error-toast-sk");n.append(r);const o=_e.content.cloneNode(!0);n.append(o)}_toggleMenu(e,t){t.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const e={authHeader:this._auth_header};this.addBusyTasks(1),new me(e.authHeader).details().then((e=>{this._serverDetails=e,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{"PERMISSION_DENIED"===e.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(e),i(`Unexpected error loading details: ${e.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(e)}_fetchPermissions(e,t){return this.addBusyTasks(1),new me(e.authHeader,e.signal).permissions(t||{}).then((e=>{this._permissions=e,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{403!==e.status&&(console.error(e),i(`Unexpected error loading permissions: ${e.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&O((e=>H` <div class="server-version"> AppEngine version: ${function(e,t){return t&&t.serverVersion?H`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(e,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",t.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${t.serverVersion}</a >`:ve}(e._projectId,e._serverDetails)} Git version:${function(e){if(!e||!e.serverVersion)return"";const t=e.serverVersion.split("-");if(t.length>=3)return console.error(`Invalid Git version. version=${e.serverVersion}`),"";const n=2==t.length?t[1]:t[0];return H`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${n}>${n}</a>`}(e._serverDetails)} </div> <oauth-login ?testing_offline=${e.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(e,t,n){this.render()}});class be extends fe{get service(){return"swarming.v2.Tasks"}cancel(e,t){return this._call("CancelTask",{taskId:e,killRunning:t})}stdout(e,t,n){return this._call("GetStdout",{taskId:e,offset:t,length:n})}request(e){return this._call("GetRequest",{taskId:e})}result(e,t){return this._call("GetResult",{taskId:e,includePerformanceStats:t})}new(e){return this._call("NewTask",e)}count(e){return this._call("CountTasks",e)}list(e){return e.state||(e={...e,state:"QUERY_ALL"}),this._call("ListTasks",e)}massCancel(e){return this._call("CancelTasks",e)}}function we(e,t){if(!ye[t]||"none"===e||!e)return e;let n=ye[t][e];if("gpu"===t){const i=e.split("-")[0];n=ye[t][i]}else if("os"===t&&e.startsWith("Windows")){const i=e.split(".")[0];n=ye[t][i]}return n?`${n} (${e})`:e}const ye={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}},Ce=new Set(["PENDING","RUNNING"]),De=new Set(["TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED"]),ke=[{label:"Total",value:"...",filter:"QUERY_ALL"},{label:"Success",value:"...",filter:"QUERY_COMPLETED_SUCCESS"},{label:"Failure",value:"...",filter:"QUERY_COMPLETED_FAILURE"},{label:"Pending",value:"...",filter:"QUERY_PENDING"},{label:"Running",value:"...",filter:"QUERY_RUNNING"},{label:"Timed Out",value:"...",filter:"QUERY_TIMED_OUT"},{label:"Bot Died",value:"...",filter:"QUERY_BOT_DIED"},{label:"Client Error",value:"...",filter:"QUERY_CLIENT_ERROR"},{label:"Deduplicated",value:"...",filter:"QUERY_DEDUPED"},{label:"Expired",value:"...",filter:"QUERY_EXPIRED"},{label:"No Resource",value:"...",filter:"QUERY_NO_RESOURCE"},{label:"Canceled",value:"...",filter:"QUERY_CANCELED"},{label:"Killed",value:"...",filter:"QUERY_KILLED"}],Ee=["ALL","COMPLETED","COMPLETED_SUCCESS","COMPLETED_FAILURE","RUNNING","PENDING","PENDING_RUNNING","BOT_DIED","DEDUPED","TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED","CLIENT_ERROR"],Te=["quarantined","error"],Me="--";function xe(e,t){if(!e.name)for(const t of je)e[t]=!0;if(Array.isArray(t))for(const n of t)-1===Te.indexOf(n.key)&&(e[n.key+"-tag"]=!0);else for(const n in t)t.hasOwnProperty(n)&&(e[n+"-tag"]=!0)}function Ie(e,t){if(e.state||(e.state=Ee),Array.isArray(t)){for(const n of t)if(-1===Te.indexOf(n.key)){let t=e[n.key+"-tag"];for(const e of n.value)t=Pe(t,e);e[n.key+"-tag"]=t}}else for(const n in t)if(t.hasOwnProperty(n)){let i=e[n+"-tag"];for(const e of t[n])i=Pe(i,e);e[n+"-tag"]=i}}function Ae(e,t,n){if(!t)return console.warn("falsey task passed into column"),"";const i=We[e];if(i)return i(t,n);e=$e(e);let s=t.tagMap[e];return s?(s=s.map((t=>we(t,e))),n._verbose?s.join(" | "):s[0]):t[e]||Me}const Ne={state:function(e,t){const n=e.state;if(t===n||"QUERY_ALL"===t)return!0;if("QUERY_PENDING_RUNNING"===t)return Ce.has(n);const i=e.failure;return"QUERY_COMPLETED_SUCCESS"===t?"COMPLETED"===n&&!i:"QUERY_COMPLETED_FAILURE"===t?"COMPLETED"===n&&i:"QUERY_DEDUPED"===t?"COMPLETED"===n&&e.dedupedFrom:void 0}};function Se(e){return e&&e.endsWith("-tag")?`${$e(e)} (tag)`:Ue[e]||e}function Pe(e,t){if(!e||!e.length)return[t];if(-1!==e.indexOf(t))return e;for(let n=0;n<e.length;n++)if(t<e[n])return e.splice(n,0,t),e;return e.push(t),e}function Le(e,t){const n={},i=[];for(const t of e){let e=t.split(":",1)[0];const s=t.substring(e.length+1);"state"===(e=$e(e))?s.startsWith("QUERY_")?n.state=s.toUpperCase():n.state=`QUERY_${s.toUpperCase()}`:i.push(e+":"+s)}return i.length>0&&(n.tags=i),n.limit=t.limit,t.cursor&&(n.cursor=t.cursor),n.start=t.start,n.end=t.end,n}const Oe=((He=["name","createdTs","pendingTime","startedTs","duration","completedTs","abandonedTs","modifiedTs"])||(He=[]),function(e,t){let n=He.indexOf(e);-1===n&&(n=He.length+1);let i=He.indexOf(t);return-1===i&&(i=He.length+1),n===i?e.localeCompare(t):n-i});var He;function $e(e){return e&&e.endsWith("-tag")?e.substring(0,e.length-4):e}function Re(e){return e.replace("-tag:",":")}const Fe={"cores-tag":!0,"cpu-tag":!0,"gpu-tag":!0,"machine_type-tag":!0,"os-tag":!0,"priority-tag":!0,"python-tag":!0,"xcode_version-tag":!0,"zone-tag":!0},Ue={abandonedTs:"Abandoned On",completedTs:"Completed On",bot:"Bot Assigned",costsUsd:"Cost (USD)",createdTs:"Created On",duration:"Duration",name:"Task Name",modifiedTs:"Last Modified",startedTs:"Started Working On",state:"state (of task)",user:"Requesting User",pendingTime:"Time Spent Pending"},Ye=["abandonedTs","completedTs","createdTs","modifiedTs","startedTs"],je=["name","state","costsUsd","dedupedFrom","duration","pendingTime","serverVersions","bot","exitCode",...Ye],Ge="An asterisk indicates the task is still running and thus the time is dynamic.",We={abandonedTs:e=>e.humanized.time.abandonedTs,bot:e=>{const t=e.botId;return t?H`<a target="_blank" rel="noopener" href=${function(e){if(e)return"/bot?id="+e}(t)} >${t}</a >`:Me},completedTs:e=>e.humanized.time.completedTs,costsUsd:function(e){return e.costSavedUsd?e.costSavedUsd:e.costsUsd},createdTs:e=>e.humanized.time.createdTs,duration:e=>e.humanDuration.indexOf("*")?H`<span title=${Ge} >${e.humanDuration}</span >`:e.humanDuration,exitCode:e=>e.exitCode||"--",modifiedTs:e=>e.humanized.time.modifiedTs,name:(e,t)=>{let n=e.name;return!t._verbose&&e.name.length>70&&(n=n.slice(0,67)+"..."),H`<a target="_blank" rel="noopener" title=${e.name} href=${function(e,t){if(e)return`/task?id=${e=e.substring(0,e.length-1)+"0"}`}(e.taskId)} >${n}</a >`},pendingTime:e=>e.humanPendingTime.indexOf("*")?H`<span title=${Ge} >${e.humanPendingTime}</span >`:e.humanPendingTime,sourceRevision:e=>e.sourceRevision.substring(0,8),startedTs:e=>e.humanized.time.startedTs,state:e=>{const t=e.state;return"COMPLETED"===t?e.failure?"COMPLETED (FAILURE)":e.dedupedFrom?"COMPLETED (DEDUPED)":"COMPLETED (SUCCESS)":t}},Ve={abandonedTs:Be("abandonedTs"),bot:(e,t,n)=>e*Y()(t.botId||"z",n.botId||"z"),completedTs:Be("completedTs"),createdTs:Be("createdTs"),duration:ze("duration"),modifiedTs:Be("modifiedTs"),name:(e,t,n)=>e*Y()(t.name,n.name),pendingTime:ze("pendingTime"),startedTs:Be("startedTs")};function Be(e){return(t,n,i)=>t*((n[e]||"9999")-(i[e]||"9999"))}function ze(e){return(t,n,i)=>t*((void 0!==n[e]?n[e]:1e12)-(void 0!==i[e]?i[e]:1e12))}class Ke{constructor(e,t){this._milliseconds=1e3*parseInt(e||0)+parseInt(t||0)}get seconds(){return e=this._milliseconds,1e3*Math.round(e/1e3);var e}get milliseconds(){return this._milliseconds}get date(){return new Date(this.milliseconds)}static fromMilliseconds(e){return new Ke(0,e)}static hoursAgo(e){return new Ke(0,Date.now()-36e5*e)}toJSON(){return this.date.toJSON()}}const Qe=e=>H`<li>${e}</li>`;function qe(e,t){const n=`Unexpected error loading ${t}: ${e.message}`;console.error(n),i(n,5e3)}window.customElements.define("task-mass-cancel",class extends HTMLElement{constructor(){super(),this._readyToCancel=!1,this._started=!1,this._finished=!1,this._both=!1,this._progress=0}connectedCallback(){ne(this,"authHeader"),ne(this,"end"),ne(this,"start"),ne(this,"tags"),"string"==typeof this.tags&&(this.tags=this.tags.split(",")),this.start&&(this.start=Ke.fromMilliseconds(this.start)),this.end&&(this.end=Ke.fromMilliseconds(this.end)),this.tags.sort(),this.render()}_cancelAll(){this._started=!0,this.dispatchEvent(new CustomEvent("tasks-canceling-started",{bubbles:!0})),this.render();const e={limit:100,tags:this.tags,start:this.start,end:this.end};this._both&&(e.killRunning=!0);const t=new be(this.authHeader),n=e=>{if(this._progress+=parseInt(e.matched||0),this.render(),e.cursor){const i={limit:100,tags:this.tags,start:this.start,end:this.end,cursor:e.cursor};this._both&&(i.killRunning=!0),t.massCancel(i).then(n).catch((e=>qe(e,"task-mass-cancel/cancel (paging)")))}else this._finished=!0,this.render(),this.dispatchEvent(new CustomEvent("tasks-canceling-finished",{bubbles:!0}))};t.massCancel(e).then(n).catch((e=>qe(e,"task-mass-cancel/cancel")))}_count(){return void 0===this._pendingCount||void 0===this._runningCount?"...":this._both?this._pendingCount+this._runningCount:this._pendingCount}_fetchCount(){if(!this.authHeader)return void console.warn("no authHeader received, try refreshing the page?");const e=new be(this.authHeader),t={state:"QUERY_PENDING",tags:this.tags,start:Ke.hoursAgo(168),end:new Date},n=e.count(t).then((e=>{this._pendingCount=parseInt(e.count||0)})).catch((e=>qe(e,"task-mass-cancel/pending"))),i={state:"QUERY_RUNNING",tags:this.tags,start:Ke.hoursAgo(168),end:new Date},s=e.count(i).then((e=>{this._runningCount=parseInt(e.count||0)})).catch((e=>qe(e,"task-mass-cancel/running")));Promise.all([n,s]).then((()=>{this._readyToCancel=!0,this.render()}))}render(){var e;O(H` <div> You are about to cancel all PENDING bots with the following tags: <ul> ${(e=this).tags.map(Qe)} </ul> <div> <checkbox-sk ?checked=${e._both} ?disabled=${e._started} @click=${e._toggleBoth} tabindex="0" > </checkbox-sk> Also include RUNNING tasks. </div> This is about ${e._count()} tasks. Once you start the process, the only way to partially stop it is to close this browser window. If that sounds good, click the button below. </div> <button class="cancel" ?disabled=${!e._readyToCancel||e._started} @click=${e._cancelAll} > Cancel the tasks </button> <div> <div ?hidden=${!e._started}> Progress: ${e._progress} canceled${e._finished?" - DONE.":"."} </div> <div> Note: tasks queued for cancellation will be canceled as soon as possible, but there may be some delay between when this dialog box is closed and all tasks actually being canceled. </div> </div> `,this,{eventContext:this})}show(){this._readyToCancel=!1,this._started=!1,this._finished=!1,this._progress=0,this._fetchCount(),this.render()}_toggleBoth(e){e.preventDefault(),this._started||(this._both=!this._both,this.render())}});var Xe=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Je={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Ze={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const et=Ze;var tt=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},nt=function(e){return!0===e?1:0};function it(e,t){var n;return function(){var i=this,s=arguments;clearTimeout(n),n=setTimeout((function(){return e.apply(i,s)}),t)}}var st=function(e){return e instanceof Array?e:[e]};function at(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function rt(e,t,n){var i=window.document.createElement(e);return t=t||"",n=n||"",i.className=t,void 0!==n&&(i.textContent=n),i}function ot(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function lt(e,t){return t(e)?e:e.parentNode?lt(e.parentNode,t):void 0}function ct(e,t){var n=rt("div","numInputWrapper"),i=rt("input","numInput "+e),s=rt("span","arrowUp"),a=rt("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?i.type="number":(i.type="text",i.pattern="\\d*"),void 0!==t)for(var r in t)i.setAttribute(r,t[r]);return n.appendChild(i),n.appendChild(s),n.appendChild(a),n}function dt(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var ut=function(){},ht=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},ft={D:ut,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*nt(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var i=parseInt(t),s=new Date(e.getFullYear(),0,2+7*(i-1),0,0,0,0);return s.setDate(s.getDate()-s.getDay()+n.firstDayOfWeek),s},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:ut,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:ut,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},mt={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},pt={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[pt.w(e,t,n)]},F:function(e,t,n){return ht(pt.n(e,t,n)-1,!1,t)},G:function(e,t,n){return tt(pt.h(e,t,n))},H:function(e){return tt(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[nt(e.getHours()>11)]},M:function(e,t){return ht(e.getMonth(),!0,t)},S:function(e){return tt(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return tt(e.getFullYear(),4)},d:function(e){return tt(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return tt(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return tt(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},gt=function(e){var t=e.config,n=void 0===t?Je:t,i=e.l10n,s=void 0===i?Ze:i,a=e.isMobile,r=void 0!==a&&a;return function(e,t,i){var a=i||s;return void 0===n.formatDate||r?t.split("").map((function(t,i,s){return pt[t]&&"\\"!==s[i-1]?pt[t](e,a,n):"\\"!==t?t:""})).join(""):n.formatDate(e,t,a)}},vt=function(e){var t=e.config,n=void 0===t?Je:t,i=e.l10n,s=void 0===i?Ze:i;return function(e,t,i,a){if(0===e||e){var r,o=a||s,l=e;if(e instanceof Date)r=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)r=new Date(e);else if("string"==typeof e){var c=t||(n||Je).dateFormat,d=String(e).trim();if("today"===d)r=new Date,i=!0;else if(n&&n.parseDate)r=n.parseDate(e,c);else if(/Z$/.test(d)||/GMT$/.test(d))r=new Date(e);else{for(var u=void 0,h=[],f=0,m=0,p="";f<c.length;f++){var g=c[f],v="\\"===g,_="\\"===c[f-1]||v;if(mt[g]&&!_){p+=mt[g];var b=new RegExp(p).exec(e);b&&(u=!0)&&h["Y"!==g?"push":"unshift"]({fn:ft[g],val:b[++m]})}else v||(p+=".")}r=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),h.forEach((function(e){var t=e.fn,n=e.val;return r=t(r,n,o)||r})),r=u?r:void 0}}if(r instanceof Date&&!isNaN(r.getTime()))return!0===i&&r.setHours(0,0,0,0),r;n.errorHandler(new Error("Invalid date provided: "+l))}}};function _t(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var bt=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},wt=function(e,t,n){return 3600*e+60*t+n},yt=function(e){var t=Math.floor(e/3600),n=(e-3600*t)/60;return[t,n,e-3600*t-60*n]},Ct={DAY:864e5};function Dt(e){var t=e.defaultHour,n=e.defaultMinute,i=e.defaultSeconds;if(void 0!==e.minDate){var s=e.minDate.getHours(),a=e.minDate.getMinutes(),r=e.minDate.getSeconds();t<s&&(t=s),t===s&&n<a&&(n=a),t===s&&n===a&&i<r&&(i=e.minDate.getSeconds())}if(void 0!==e.maxDate){var o=e.maxDate.getHours(),l=e.maxDate.getMinutes();(t=Math.min(t,o))===o&&(n=Math.min(l,n)),t===o&&n===l&&(i=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:i}}n(124);var kt=function(){return(kt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},Et=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),s=0;for(t=0;t<n;t++)for(var a=arguments[t],r=0,o=a.length;r<o;r++,s++)i[s]=a[r];return i},Tt=300;function Mt(e,t){var n={config:kt(kt({},Je),It.defaultConfig),l10n:et};function i(){var e;return(null===(e=n.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function s(e){return e.bind(n)}function a(){var e=n.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==n.calendarContainer&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),void 0!==n.daysContainer){var t=(n.days.offsetWidth+1)*e.showMonths;n.daysContainer.style.width=t+"px",n.calendarContainer.style.width=t+(void 0!==n.weekWrapper?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}}))}function r(e){if(0===n.selectedDates.length){var t=void 0===n.config.minDate||_t(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),i=Dt(n.config);t.setHours(i.hours,i.minutes,i.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,i=dt(e),s=i;void 0!==n.amPM&&i===n.amPM&&(n.amPM.textContent=n.l10n.amPM[nt(n.amPM.textContent===n.l10n.amPM[0])]);var a=parseFloat(s.getAttribute("min")),r=parseFloat(s.getAttribute("max")),o=parseFloat(s.getAttribute("step")),l=parseInt(s.value,10),c=l+o*(e.delta||(t?38===e.which?1:-1:0));if(void 0!==s.value&&2===s.value.length){var d=s===n.hourElement,u=s===n.minuteElement;c<a?(c=r+c+nt(!d)+(nt(d)&&nt(!n.amPM)),u&&p(void 0,-1,n.hourElement)):c>r&&(c=s===n.hourElement?c-r-nt(!n.amPM):a,u&&p(void 0,1,n.hourElement)),n.amPM&&d&&(1===o?c+l===23:Math.abs(c-l)>o)&&(n.amPM.textContent=n.l10n.amPM[nt(n.amPM.textContent===n.l10n.amPM[0])]),s.value=tt(c)}}(e);var s=n._input.value;o(),Z(),n._input.value!==s&&n._debouncedChange()}function o(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,i=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,s=(parseInt(n.minuteElement.value,10)||0)%60,a=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=i,t=n.amPM.textContent,i=e%12+12*nt(t===n.l10n.amPM[1]));var r=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===_t(n.latestSelectedDateObj,n.config.minDate,!0),o=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===_t(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var l=wt(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),d=wt(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),u=wt(i,s,a);if(u>d&&u<l){var h=yt(l);i=h[0],s=h[1],a=h[2]}}else{if(o){var f=void 0!==n.config.maxTime?n.config.maxTime:n.config.maxDate;(i=Math.min(i,f.getHours()))===f.getHours()&&(s=Math.min(s,f.getMinutes())),s===f.getMinutes()&&(a=Math.min(a,f.getSeconds()))}if(r){var m=void 0!==n.config.minTime?n.config.minTime:n.config.minDate;(i=Math.max(i,m.getHours()))===m.getHours()&&s<m.getMinutes()&&(s=m.getMinutes()),s===m.getMinutes()&&(a=Math.max(a,m.getSeconds()))}}c(i,s,a)}}function l(e){var t=e||n.latestSelectedDateObj;t&&t instanceof Date&&c(t.getHours(),t.getMinutes(),t.getSeconds())}function c(e,t,i){void 0!==n.latestSelectedDateObj&&n.latestSelectedDateObj.setHours(e%24,t,i||0,0),n.hourElement&&n.minuteElement&&!n.isMobile&&(n.hourElement.value=tt(n.config.time_24hr?e:(12+e)%12+12*nt(e%12==0)),n.minuteElement.value=tt(t),void 0!==n.amPM&&(n.amPM.textContent=n.l10n.amPM[nt(e>=12)]),void 0!==n.secondElement&&(n.secondElement.value=tt(i)))}function d(e){var t=dt(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&A(n)}function u(e,t,i,s){return t instanceof Array?t.forEach((function(t){return u(e,t,i,s)})):e instanceof Array?e.forEach((function(e){return u(e,t,i,s)})):(e.addEventListener(t,i,s),void n._handlers.push({remove:function(){return e.removeEventListener(t,i,s)}}))}function h(){K("onChange")}function f(e,t){var i=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),s=n.currentYear,a=n.currentMonth;try{void 0!==i&&(n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth())}catch(e){e.message="Invalid date supplied: "+i,n.config.errorHandler(e)}t&&n.currentYear!==s&&(K("onYearChange"),C()),!t||n.currentYear===s&&n.currentMonth===a||K("onMonthChange"),n.redraw()}function m(e){var t=dt(e);~t.className.indexOf("arrow")&&p(e,t.classList.contains("arrowUp")?1:-1)}function p(e,t,n){var i=e&&dt(e),s=n||i&&i.parentNode&&i.parentNode.firstChild,a=Q("increment");a.delta=t,s&&s.dispatchEvent(a)}function g(e,t,i,s){var a=N(t,!0),r=rt("span",e,t.getDate().toString());return r.dateObj=t,r.$i=s,r.setAttribute("aria-label",n.formatDate(t,n.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===_t(t,n.now)&&(n.todayDateElem=r,r.classList.add("today"),r.setAttribute("aria-current","date")),a?(r.tabIndex=-1,q(t)&&(r.classList.add("selected"),n.selectedDateElem=r,"range"===n.config.mode&&(at(r,"startRange",n.selectedDates[0]&&0===_t(t,n.selectedDates[0],!0)),at(r,"endRange",n.selectedDates[1]&&0===_t(t,n.selectedDates[1],!0)),"nextMonthDay"===e&&r.classList.add("inRange")))):r.classList.add("flatpickr-disabled"),"range"===n.config.mode&&function(e){return!("range"!==n.config.mode||n.selectedDates.length<2)&&_t(e,n.selectedDates[0])>=0&&_t(e,n.selectedDates[1])<=0}(t)&&!q(t)&&r.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&s%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(t)+"</span>"),K("onDayCreate",r),r}function v(e){e.focus(),"range"===n.config.mode&&O(e)}function _(e){for(var t=e>0?0:n.config.showMonths-1,i=e>0?n.config.showMonths:-1,s=t;s!=i;s+=e)for(var a=n.daysContainer.children[s],r=e>0?0:a.children.length-1,o=e>0?a.children.length:-1,l=r;l!=o;l+=e){var c=a.children[l];if(-1===c.className.indexOf("hidden")&&N(c.dateObj))return c}}function b(e,t){var s=i(),a=S(s||document.body),r=void 0!==e?e:a?s:void 0!==n.selectedDateElem&&S(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&S(n.todayDateElem)?n.todayDateElem:_(t>0?1:-1);void 0===r?n._input.focus():a?function(e,t){for(var i=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,s=t>0?n.config.showMonths:-1,a=t>0?1:-1,r=i-n.currentMonth;r!=s;r+=a)for(var o=n.daysContainer.children[r],l=i-n.currentMonth===r?e.$i+t:t<0?o.children.length-1:0,c=o.children.length,d=l;d>=0&&d<c&&d!=(t>0?c:-1);d+=a){var u=o.children[d];if(-1===u.className.indexOf("hidden")&&N(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return v(u)}n.changeMonth(a),b(_(a),0)}(r,t):v(r)}function w(e,t){for(var i=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,s=n.utils.getDaysInMonth((t-1+12)%12,e),a=n.utils.getDaysInMonth(t,e),r=window.document.createDocumentFragment(),o=n.config.showMonths>1,l=o?"prevMonthDay hidden":"prevMonthDay",c=o?"nextMonthDay hidden":"nextMonthDay",d=s+1-i,u=0;d<=s;d++,u++)r.appendChild(g("flatpickr-day "+l,new Date(e,t-1,d),0,u));for(d=1;d<=a;d++,u++)r.appendChild(g("flatpickr-day",new Date(e,t,d),0,u));for(var h=a+1;h<=42-i&&(1===n.config.showMonths||u%7!=0);h++,u++)r.appendChild(g("flatpickr-day "+c,new Date(e,t+1,h%a),0,u));var f=rt("div","dayContainer");return f.appendChild(r),f}function y(){if(void 0!==n.daysContainer){ot(n.daysContainer),n.weekNumbers&&ot(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<n.config.showMonths;t++){var i=new Date(n.currentYear,n.currentMonth,1);i.setMonth(n.currentMonth+t),e.appendChild(w(i.getFullYear(),i.getMonth()))}n.daysContainer.appendChild(e),n.days=n.daysContainer.firstChild,"range"===n.config.mode&&1===n.selectedDates.length&&O()}}function C(){if(!(n.config.showMonths>1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&e<n.config.minDate.getMonth()||void 0!==n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()&&e>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var i=rt("option","flatpickr-monthDropdown-month");i.value=new Date(n.currentYear,t).getMonth().toString(),i.textContent=ht(t,n.config.shorthandCurrentMonth,n.l10n),i.tabIndex=-1,n.currentMonth===t&&(i.selected=!0),n.monthsDropdownContainer.appendChild(i)}}}function D(){var e,t=rt("div","flatpickr-month"),i=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=rt("span","cur-month"):(n.monthsDropdownContainer=rt("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),u(n.monthsDropdownContainer,"change",(function(e){var t=dt(e),i=parseInt(t.value,10);n.changeMonth(i-n.currentMonth),K("onMonthChange")})),C(),e=n.monthsDropdownContainer);var s=ct("cur-year",{tabindex:"-1"}),a=s.getElementsByTagName("input")[0];a.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&a.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(a.setAttribute("max",n.config.maxDate.getFullYear().toString()),a.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var r=rt("div","flatpickr-current-month");return r.appendChild(e),r.appendChild(s),i.appendChild(r),t.appendChild(i),{container:t,yearElement:a,monthElement:e}}function k(){ot(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=D();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function E(){n.weekdayContainer?ot(n.weekdayContainer):n.weekdayContainer=rt("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=rt("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return T(),n.weekdayContainer}function T(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=Et(n.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=Et(t.splice(e,t.length),t.splice(0,e)));for(var i=n.config.showMonths;i--;)n.weekdayContainer.children[i].innerHTML="\n      <span class='flatpickr-weekday'>\n        "+t.join("</span><span class='flatpickr-weekday'>")+"\n      </span>\n      "}}function M(e,t){void 0===t&&(t=!0);var i=t?e:e-n.currentMonth;i<0&&!0===n._hidePrevMonthArrow||i>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=i,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,K("onYearChange"),C()),y(),K("onMonthChange"),X())}function x(e){return n.calendarContainer.contains(e)}function I(e){if(n.isOpen&&!n.config.inline){var t=dt(e),i=x(t),s=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput))||i||x(e.relatedTarget)),a=!n.config.ignoredFocusElements.some((function(e){return e.contains(t)}));s&&a&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&r(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function A(e){if(!(!e||n.config.minDate&&e<n.config.minDate.getFullYear()||n.config.maxDate&&e>n.config.maxDate.getFullYear())){var t=e,i=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),i&&(n.redraw(),K("onYearChange"),C())}}function N(e,t){var i;void 0===t&&(t=!0);var s=n.parseDate(e,void 0,t);if(n.config.minDate&&s&&_t(s,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&s&&_t(s,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===s)return!1;for(var a=!!n.config.enable,r=null!==(i=n.config.enable)&&void 0!==i?i:n.config.disable,o=0,l=void 0;o<r.length;o++){if("function"==typeof(l=r[o])&&l(s))return a;if(l instanceof Date&&void 0!==s&&l.getTime()===s.getTime())return a;if("string"==typeof l){var c=n.parseDate(l,void 0,!0);return c&&c.getTime()===s.getTime()?a:!a}if("object"==typeof l&&void 0!==s&&l.from&&l.to&&s.getTime()>=l.from.getTime()&&s.getTime()<=l.to.getTime())return a}return!a}function S(e){return void 0!==n.daysContainer&&-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e)}function P(e){var t=e.target===n._input,i=n._input.value.trimEnd()!==J();!t||!i||e.relatedTarget&&x(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function L(t){var s=dt(t),a=n.config.wrap?e.contains(s):s===n._input,l=n.config.allowInput,c=n.isOpen&&(!l||!a),d=n.config.inline&&a&&!l;if(13===t.keyCode&&a){if(l)return n.setDate(n._input.value,!0,s===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),s.blur();n.open()}else if(x(s)||c||d){var u=!!n.timeContainer&&n.timeContainer.contains(s);switch(t.keyCode){case 13:u?(t.preventDefault(),r(),j()):G(t);break;case 27:t.preventDefault(),j();break;case 8:case 46:a&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(u||a)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var h=i();if(void 0!==n.daysContainer&&(!1===l||h&&S(h))){var f=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),M(f),b(_(1),0)):b(void 0,f)}}break;case 38:case 40:t.preventDefault();var m=40===t.keyCode?1:-1;n.daysContainer&&void 0!==s.$i||s===n.input||s===n.altInput?t.ctrlKey?(t.stopPropagation(),A(n.currentYear-m),b(_(1),0)):u||b(void 0,7*m):s===n.currentYearElement?A(n.currentYear-m):n.config.enableTime&&(!u&&n.hourElement&&n.hourElement.focus(),r(t),n._debouncedChange());break;case 9:if(u){var p=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter((function(e){return e})),g=p.indexOf(s);if(-1!==g){var v=p[g+(t.shiftKey?-1:1)];t.preventDefault(),(v||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(s)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&s===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],o(),Z();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],o(),Z()}(a||x(s))&&K("onKeyDown",t)}function O(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var i=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),s=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),a=Math.min(i,n.selectedDates[0].getTime()),r=Math.max(i,n.selectedDates[0].getTime()),o=!1,l=0,c=0,d=a;d<r;d+=Ct.DAY)N(new Date(d),!0)||(o=o||d>a&&d<r,d<s&&(!l||d>l)?l=d:d>s&&(!c||d<c)&&(c=d));Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+t)).forEach((function(t){var a=t.dateObj.getTime(),r=l>0&&a<l||c>0&&a>c;if(r)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){t.classList.remove(e)}));o&&!r||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){t.classList.remove(e)})),void 0!==e&&(e.classList.add(i<=n.selectedDates[0].getTime()?"startRange":"endRange"),s<i&&a===s?t.classList.add("startRange"):s>i&&a===s&&t.classList.add("endRange"),a>=l&&(0===c||a<=c)&&bt(a,s,i)&&t.classList.add("inRange")))}))}}function H(){!n.isOpen||n.config.static||n.config.inline||U()}function $(e){return function(t){var i=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),s=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==i&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter((function(e){return N(e)})),n.selectedDates.length||"min"!==e||l(i),Z()),n.daysContainer&&(Y(),void 0!==i?n.currentYearElement[e]=i.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!s&&void 0!==i&&s.getFullYear()===i.getFullYear())}}function R(){return n.config.wrap?e.querySelector("[data-input]"):e}function F(){"object"!=typeof n.config.locale&&void 0===It.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=kt(kt({},It.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?It.l10ns[n.config.locale]:void 0),mt.D="("+n.l10n.weekdays.shorthand.join("|")+")",mt.l="("+n.l10n.weekdays.longhand.join("|")+")",mt.M="("+n.l10n.months.shorthand.join("|")+")",mt.F="("+n.l10n.months.longhand.join("|")+")",mt.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===kt(kt({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===It.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=gt(n),n.parseDate=vt({config:n.config,l10n:n.l10n})}function U(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){K("onPreCalendarPosition");var t=e||n._positionElement,i=Array.prototype.reduce.call(n.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),s=n.calendarContainer.offsetWidth,a=n.config.position.split(" "),r=a[0],o=a.length>1?a[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,d="above"===r||"below"!==r&&c<i&&l.top>i,u=window.pageYOffset+l.top+(d?-i-2:t.offsetHeight+2);if(at(n.calendarContainer,"arrowTop",!d),at(n.calendarContainer,"arrowBottom",d),!n.config.inline){var h=window.pageXOffset+l.left,f=!1,m=!1;"center"===o?(h-=(s-l.width)/2,f=!0):"right"===o&&(h-=s-l.width,m=!0),at(n.calendarContainer,"arrowLeft",!f&&!m),at(n.calendarContainer,"arrowCenter",f),at(n.calendarContainer,"arrowRight",m);var p=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=h+s>window.document.body.offsetWidth,v=p+s>window.document.body.offsetWidth;if(at(n.calendarContainer,"rightMost",g),!n.config.static)if(n.calendarContainer.style.top=u+"px",g)if(v){var _=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];if(n.cssRules){try{n.cssRules}catch(e){continue}e=n;break}}return null!=e?e:(i=document.createElement("style"),document.head.appendChild(i),i.sheet);var i}();if(void 0===_)return;var b=window.document.body.offsetWidth,w=Math.max(0,b/2-s/2),y=_.cssRules.length,C="{left:"+l.left+"px;right:auto;}";at(n.calendarContainer,"rightMost",!1),at(n.calendarContainer,"centerMost",!0),_.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+C,y),n.calendarContainer.style.left=w+"px",n.calendarContainer.style.right="auto"}else n.calendarContainer.style.left="auto",n.calendarContainer.style.right=p+"px";else n.calendarContainer.style.left=h+"px",n.calendarContainer.style.right="auto"}}}else n.config.position(n,e)}function Y(){n.config.noCalendar||n.isMobile||(C(),X(),y())}function j(){n._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(n.close,0):n.close()}function G(e){e.preventDefault(),e.stopPropagation();var t=lt(dt(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==t){var i=t,s=n.latestSelectedDateObj=new Date(i.dateObj.getTime()),a=(s.getMonth()<n.currentMonth||s.getMonth()>n.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=i,"single"===n.config.mode)n.selectedDates=[s];else if("multiple"===n.config.mode){var r=q(s);r?n.selectedDates.splice(parseInt(r),1):n.selectedDates.push(s)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=s,n.selectedDates.push(s),0!==_t(s,n.selectedDates[0],!0)&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(o(),a){var l=n.currentYear!==s.getFullYear();n.currentYear=s.getFullYear(),n.currentMonth=s.getMonth(),l&&(K("onYearChange"),C()),K("onMonthChange")}if(X(),y(),Z(),a||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():v(i),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var c="single"===n.config.mode&&!n.config.enableTime,d="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(c||d)&&j()}h()}}n.parseDate=vt({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=u,n._setHoursFromDate=l,n._positionCalendar=U,n.changeMonth=M,n.changeYear=A,n.clear=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!0),n.input.value="",void 0!==n.altInput&&(n.altInput.value=""),void 0!==n.mobileInput&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),!0===n.config.enableTime){var i=Dt(n.config);c(i.hours,i.minutes,i.seconds)}n.redraw(),e&&K("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active")),K("onClose")},n.onMouseOver=O,n._createElement=rt,n.createDay=g,n.destroy=function(){void 0!==n.config&&K("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete n[e]}catch(e){}}))},n.isEnabled=N,n.jumpToDate=f,n.updateValue=Z,n.open=function(e,t){if(void 0===t&&(t=n._positionElement),!0===n.isMobile){if(e){e.preventDefault();var i=dt(e);i&&i.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void K("onOpen")}if(!n._input.disabled&&!n.config.inline){var s=n.isOpen;n.isOpen=!0,s||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),K("onOpen"),U(t)),!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return n.hourElement.select()}),50))}},n.redraw=Y,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var i in Object.assign(n.config,e),e)void 0!==W[i]&&W[i].forEach((function(e){return e()}));else n.config[e]=t,void 0!==W[e]?W[e].forEach((function(e){return e()})):Xe.indexOf(e)>-1&&(n.config[e]=st(t));n.redraw(),Z(!0)},n.setDate=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=n.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);V(e,i),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),f(void 0,t),l(),0===n.selectedDates.length&&n.clear(!1),Z(t),t&&K("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var W={locale:[F,T],showMonths:[k,a,E],minDate:[f],maxDate:[f],positionElement:[z],clickOpens:[function(){!0===n.config.clickOpens?(u(n._input,"focus",n.open),u(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function V(e,t){var i=[];if(e instanceof Array)i=e.map((function(e){return n.parseDate(e,t)}));else if(e instanceof Date||"number"==typeof e)i=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":i=[n.parseDate(e,t)];break;case"multiple":i=e.split(n.config.conjunction).map((function(e){return n.parseDate(e,t)}));break;case"range":i=e.split(n.l10n.rangeSeparator).map((function(e){return n.parseDate(e,t)}))}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?i:i.filter((function(e){return e instanceof Date&&N(e,!1)})),"range"===n.config.mode&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function B(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function z(){n._positionElement=n.config.positionElement||n._input}function K(e,t){if(void 0!==n.config){var i=n.config[e];if(void 0!==i&&i.length>0)for(var s=0;i[s]&&s<i.length;s++)i[s](n.selectedDates,n.input.value,n,t);"onChange"===e&&(n.input.dispatchEvent(Q("change")),n.input.dispatchEvent(Q("input")))}}function Q(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function q(e){for(var t=0;t<n.selectedDates.length;t++){var i=n.selectedDates[t];if(i instanceof Date&&0===_t(i,e))return""+t}return!1}function X(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach((function(e,t){var i=new Date(n.currentYear,n.currentMonth,1);i.setMonth(n.currentMonth+t),n.config.showMonths>1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=ht(i.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=i.getMonth().toString(),e.value=i.getFullYear().toString()})),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=void 0!==n.config.maxDate&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function J(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map((function(e){return n.formatDate(e,t)})).filter((function(e,t,i){return"range"!==n.config.mode||n.config.enableTime||i.indexOf(e)===t})).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function Z(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=J(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=J(n.config.altFormat)),!1!==e&&K("onValueUpdate")}function ee(e){var t=dt(e),i=n.prevMonthNav.contains(t),s=n.nextMonthNav.contains(t);i||s?M(i?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var i=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=kt(kt({},JSON.parse(JSON.stringify(e.dataset||{}))),t),r={};n.config.parseDate=a.parseDate,n.config.formatDate=a.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=B(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=B(e)}});var o="time"===a.mode;if(!a.dateFormat&&(a.enableTime||o)){var l=It.defaultConfig.dateFormat||Je.dateFormat;r.dateFormat=a.noCalendar||o?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||o)&&!a.altFormat){var c=It.defaultConfig.altFormat||Je.altFormat;r.altFormat=a.noCalendar||o?"h:i"+(a.enableSeconds?":S K":" K"):c+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:$("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:$("max")});var d=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:d("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:d("max")}),"time"===a.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,r,a);for(var u=0;u<i.length;u++)n.config[i[u]]=!0===n.config[i[u]]||"true"===n.config[i[u]];for(Xe.filter((function(e){return void 0!==n.config[e]})).forEach((function(e){n.config[e]=st(n.config[e]||[]).map(s)})),n.isMobile=!n.config.disableMobile&&!n.config.inline&&"single"===n.config.mode&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),u=0;u<n.config.plugins.length;u++){var h=n.config.plugins[u](n)||{};for(var f in h)Xe.indexOf(f)>-1?n.config[f]=st(h[f]).map(s).concat(n.config[f]):void 0===a[f]&&(n.config[f]=h[f])}a.altInputClass||(n.config.altInputClass=R().className+" "+n.config.altInputClass),K("onParseConfig")}(),F(),n.input=R(),n.input?(n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=rt(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),z()):n.config.errorHandler(new Error("Invalid input element specified")),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&V(e,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]),void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=rt("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=rt("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=rt("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=rt("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,k(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(at(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(at(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],X(),n.monthNav)),n.innerContainer=rt("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=rt("div","flatpickr-weekwrapper");e.appendChild(rt("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=rt("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),i=t.weekWrapper,s=t.weekNumbers;n.innerContainer.appendChild(i),n.weekNumbers=s,n.weekWrapper=i}n.rContainer=rt("div","flatpickr-rContainer"),n.rContainer.appendChild(E()),n.daysContainer||(n.daysContainer=rt("div","flatpickr-days"),n.daysContainer.tabIndex=-1),y(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=Dt(n.config);n.timeContainer=rt("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=rt("span","flatpickr-time-separator",":"),i=ct("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=i.getElementsByTagName("input")[0];var s=ct("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=s.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=tt(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=tt(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(i),n.timeContainer.appendChild(t),n.timeContainer.appendChild(s),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var a=ct("flatpickr-second");n.secondElement=a.getElementsByTagName("input")[0],n.secondElement.value=tt(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(rt("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(a)}return n.config.time_24hr||(n.amPM=rt("span","flatpickr-am-pm",n.l10n.amPM[nt((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}()),at(n.calendarContainer,"rangeMode","range"===n.config.mode),at(n.calendarContainer,"animate",!0===n.config.animate),at(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var a=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!a&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var r=rt("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(r,n.element),r.appendChild(n.element),n.altInput&&r.appendChild(n.altInput),r.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){if(n.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),(function(t){return u(t,"click",n[e])}))})),n.isMobile)!function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=rt("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}u(n.mobileInput,"change",(function(e){n.setDate(dt(e).value,!1,n.mobileFormatStr),K("onChange"),K("onClose")}))}();else{var e=it(H,50);n._debouncedChange=it(h,Tt),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&u(n.daysContainer,"mouseover",(function(e){"range"===n.config.mode&&O(dt(e))})),u(n._input,"keydown",L),void 0!==n.calendarContainer&&u(n.calendarContainer,"keydown",L),n.config.inline||n.config.static||u(window,"resize",e),void 0!==window.ontouchstart?u(window.document,"touchstart",I):u(window.document,"mousedown",I),u(window.document,"focus",I,{capture:!0}),!0===n.config.clickOpens&&(u(n._input,"focus",n.open),u(n._input,"click",n.open)),void 0!==n.daysContainer&&(u(n.monthNav,"click",ee),u(n.monthNav,["keyup","increment"],d),u(n.daysContainer,"click",G)),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&(u(n.timeContainer,["increment"],r),u(n.timeContainer,"blur",r,{capture:!0}),u(n.timeContainer,"click",m),u([n.hourElement,n.minuteElement],["focus","click"],(function(e){return dt(e).select()})),void 0!==n.secondElement&&u(n.secondElement,"focus",(function(){return n.secondElement&&n.secondElement.select()})),void 0!==n.amPM&&u(n.amPM,"click",(function(e){r(e)}))),n.config.allowInput&&u(n._input,"blur",P)}}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&l(n.config.noCalendar?n.latestSelectedDateObj:void 0),Z(!1)),a();var i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&i&&U(),K("onReady")}(),n}function xt(e,t){for(var n=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),i=[],s=0;s<n.length;s++){var a=n[s];try{if(null!==a.getAttribute("data-fp-omit"))continue;void 0!==a._flatpickr&&(a._flatpickr.destroy(),a._flatpickr=void 0),a._flatpickr=Mt(a,t||{}),i.push(a._flatpickr)}catch(e){console.error(e)}}return 1===i.length?i[0]:i}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return xt(this,e)},HTMLElement.prototype.flatpickr=function(e){return xt([this],e)});var It=function(e,t){return"string"==typeof e?xt(window.document.querySelectorAll(e),t):e instanceof Node?xt([e],t):xt(e,t)};It.defaultConfig={},It.l10ns={en:kt({},et),default:kt({},et)},It.localize=function(e){It.l10ns.default=kt(kt({},It.l10ns.default),e)},It.setDefaults=function(e){It.defaultConfig=kt(kt({},It.defaultConfig),e)},It.parseDate=vt({}),It.formatDate=gt({}),It.compareDates=_t,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return xt(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=It);const At=It;function Nt(e,t){return t?e.filter((e=>Pt(e,t))):e}function St(e,t){return`${e}:${t}`}function Pt(e,t){if(!t)return!0;if(!e)return!1;t=t.trim().toLocaleLowerCase(),e=e.toLocaleLowerCase();const n=t.split(" ");for(const t of n)if(-1!==e.indexOf(t))return!0;return!1}const Lt=document.createElement("template");Lt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',window.customElements.define("expand-less-icon-sk",class extends HTMLElement{connectedCallback(){let e=Lt.content.cloneNode(!0);this.appendChild(e)}});const Ot=document.createElement("template");Ot.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>',window.customElements.define("expand-more-icon-sk",class extends HTMLElement{connectedCallback(){let e=Ot.content.cloneNode(!0);this.appendChild(e)}});class Ht extends fe{get service(){return"swarming.v2.Bots"}bot(e){return this._call("GetBot",{botId:e})}tasks(e,t){const n={sort:4,state:10,botId:e,cursor:t,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",n)}terminate(e,t){const n={botId:e,reason:t};return this._call("TerminateBot",n)}events(e,t){const n={limit:50,botId:e,cursor:t};return this._call("ListBotEvents",n)}delete(e){return this._call("DeleteBot",{botId:e})}count(e){return this._call("CountBots",{dimensions:e})}dimensions(e){return this._call("GetBotDimensions",{pool:e})}list(e){return this._call("ListBots",e)}}class $t extends HTMLElement{constructor(e){super(),this._template=e,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){B(this,"testing_offline"),this._authHeaderEvent=e=>{this._auth_header=e.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(e,t,n){"PERMISSION_DENIED"!==e.codeName||n?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(e,t,n){403!==e.status||n?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){O(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,O(this._template(this),this,{eventContext:this}))}attributeChangedCallback(e,t,n){this.render()}_createTasksService(){return new be(this.authHeader,this._fetchController.signal)}_createBotService(){return new Ht(this.authHeader,this._fetchController.signal)}}const Rt=(e,t)=>H` <tr> <td> <a href=${$(e._makeSummaryURL(t.filter))}>${t.label}</a >: </td> <td>${t.value}</td> </tr>`,Ft=e=>H` <div class=header ?hidden=${!e.loggedInAndAuthorized}> <div class=filter_box> <search-icon-sk></search-icon-sk> <input id=filter_search class=search type=text placeholder='Search filters or supply a filter and press enter' @input=${e._refilterPrimaryKeys} @keyup=${e._filterSearch}> </input>  <div></div> ${(e=>H`  <select-sk class="selector keys" @scroll=${e._scrollCheck} @selection-changed=${e._primaryKeyChanged} > ${e._filteredPrimaryArr.map((t=>((e,t)=>H` <div class="item" ?selected=${t._primaryKey===e}> <span class="key">${function(e){return e&&e.endsWith("-tag")?`${$e(e)} (tag)`:"state"===e?"state (of task)":e}(e)}</span> </div>`)(t,e)))} </select-sk>  <select-sk class="selector values" disabled> ${(e=>{if(!e._primaryKey)return"";let t=e._primaryMap[e._primaryKey];return t?(t=function(e,t,n){const i=(n=n.trim()).indexOf(":");return-1!==i&&(n=n.substring(i+1)),!n||Pt(t,n)?e:e.filter((e=>!!Pt(e=we(e,t),n)))}(t,e._primaryKey,e._filterQuery),function(e){return Fe[e]}(e._primaryKey)?t.sort(Y()):t.sort(),t.map((t=>H` <div class="item"> <span class="value" >${we(t,$e(e._primaryKey))}</span > <span class="flex"></span> <add-circle-icon-sk ?hidden=${e._filters.indexOf(St(e._primaryKey,t))>=0} @click=${()=>e._addFilter(St(e._primaryKey,t))} > </add-circle-icon-sk> </div>`))):H` <div class="information_only"> Hmm... no preloaded values. Maybe try typing your filter like ${e._primaryKey}:foo-bar in the above box and hitting enter. </div>`})(e)} </select-sk>`)(e)} ${(e=>H` <div class=options> <div class=verbose> <checkbox-sk ?checked=${e._verbose} @click=${e._toggleVerbose} label="Verbose Entries"> </checkbox-sk> </div> <div class=picker> <div class=time> <span class=label title="Show only tasks created after this time">Start:</span> <input id=start_time></input> </div> <div class=time> <span class=label title="Show only tasks created before this time">End:</span> <input id=end_time ?disabled=${e._now}></input> <checkbox-sk ?checked=${e._now} @click=${e._toggleNow}> </checkbox-sk> <span>Now</span> </div> </div> <a href=${e._matchingBotsLink()}>View Matching Bots</a>  <button id=cancel_all ?disabled=${!e.permissions.cancelTask} @click=${e._promptMassCancel}> CANCEL ALL TASKS </button> </div>`)(e)} </div> ${(e=>H` <div class="summary"> <div class="title" @click=${e._toggleAllStates}> Selected Tasks ${function(e){return e?H`<expand-less-icon-sk></expand-less-icon-sk>`:H`<expand-more-icon-sk></expand-more-icon-sk>`}(e._allStates)} </div> <table id="query_counts"> ${Rt(e,{label:"Displayed",value:e._tasks.length})} ${e._queryCounts.filter(e._filterCounts.bind(e)).map((t=>Rt(e,t)))} </table> <more-horiz-icon-sk @click=${e._toggleAllStates} ?hidden=${e._allStates} > </more-horiz-icon-sk> </div>`)(e)} </div> </div> <div class=chip_container> ${e._filters.map((t=>((e,t)=>H` <span class="chip"> <span>${function(e){const t=e.indexOf(":");if(t<0)return e;const n=e.substring(0,t);return`${n}:${we(e.substring(t+1),n.split("-tag")[0])}`}(e)}</span> <cancel-icon-sk @click=${()=>t._removeFilter(e)}></cancel-icon-sk> </span>`)(t,e)))} </div>`,Ut=e=>H` <swarming-app id=swapp ?testing_offline=${e.testing_offline}> <header> <div class=title>Swarming Task List</div> <aside class=hideable> <a href=/>Home</a> <a href=/botlist>Bot List</a> <a href=/bot>Bot Page</a> <a href=/task>Task Page</a> </aside> </header>  <main @click=${t=>e._showColSelector&&e._toggleColSelector(t)}> <h2 class=message ?hidden=${e.loggedInAndAuthorized}>${e._message}</h2> ${Ft(e)} <table class=task-table ?hidden=${!e.loggedInAndAuthorized}> <thead> <tr> <tr> ${((e,t)=>H`  <th class="col_options" @click=${e._toggleColSelector}> <span class="show_widget"> <more-vert-icon-sk tabindex="0" @keypress=${e._toggleColSelector} ></more-vert-icon-sk> </span> <span>${Se(t)}</span> <sort-toggle @click=${e=>e.stopPropagation()&&e.preventDefault()} key="name" .currentKey=${e._sort} .direction=${e._dir} > </sort-toggle> ${(e=>e._showColSelector?H`  <div class=col_selector @click=${e=>e.stopPropagation()}> <input id=column_search class=search type=text placeholder='Search columns to show' @input=${e._refilterPossibleColumns}  @keyup=${e._columnSearch}> </input> ${e._filteredPossibleColumns.map((t=>((e,t)=>H` <div class="item"> <span class="key">${Se(e)}</span> <span class="flex"></span> <checkbox-sk ?checked=${t._cols.indexOf(e)>=0} @click=${n=>t._toggleCol(n,e)} @keypress=${n=>t._toggleCol(n,e)} data-key=${e} > </checkbox-sk> </div>`)(t,e)))} </div>`:"")(e)} </th>`)(e,e._cols[0])}  ${e._cols.slice(1).map((t=>((e,t)=>H` <th> ${Se(e)} <sort-toggle .key=${e} .currentKey=${t._sort} .direction=${t._dir}> </sort-toggle> </th>`)(t,e)))} </tr> </tr> </thead> <tbody>${e._sortTasks().map((t=>((e,t)=>H` <tr class="task-row ${function(e){const t=Ae("state",e);return De.has(t)?"exception":"BOT_DIED"===t?"bot_died":"CLIENT_ERROR"===t?"client_error":"COMPLETED (FAILURE)"===t?"failed_task":Ce.has(t)?"pending_task":""}(e)}"> ${t._cols.map((n=>((e,t,n)=>H` <td>${Ae(e,t,n)}</td>`)(n,e,t)))} </tr>`)(t,e)))}</tbody> </table> </main> <footer></footer> <dialog-pop-over> <div class='cancel content'> <task-mass-cancel .authHeader=${e.authHeader} .start=${e._startTime.milliseconds} .end=${e._endTime.milliseconds} .tags=${function(e){const t=Object.keys(Ne);return e.filter((e=>{for(const n of t)if(e.startsWith(n+":"))return!1;return!0}))}(e._filters).map(Re)}></task-mass-cancel> <button class=goback tabindex=0 @click=${e._closePopup} ?disabled=${e._startedCanceling&&!e._finishedCanceling}> ${e._startedCanceling?"DISMISS":"GO BACK - DON'T CANCEL ANYTHING"} </button> </div> </dialog-pop-over> </swarming-app>`;window.customElements.define("task-list",class extends $t{constructor(){super(Ut),this._tasks=[],this._cols=[],this._dir="",this._endTime=Ke.fromMilliseconds(Date.now()),this._filters=[],this._limit=0,this._now=!0,this._primaryKey="",this._sort="",this._startTime=Ke.hoursAgo(24),this._verbose=!1,this._allStates=window.innerWidth<600||window.innerHeight<600,this._stateChanged=V((()=>({c:this._cols,d:this._dir,st:this._startTime.milliseconds,et:this._endTime.milliseconds,f:this._filters,k:this._primaryKey,n:this._now,s:this._sort,at:this._allStates,v:this._verbose})),(e=>{var t;(t=e).c&&(t.c=t.c.map((e=>se(e)))),t.s&&(t.s=se(t.s)),this._allStates=e.at,this._cols=e.c,e.c.length||(this._cols=["name","state","bot","createdTs","pendingTime","duration","pool-tag"]),this._dir=e.d||"desc",this._filters=e.f||[],this._filters=function(e){return e.map((e=>{const t=e.indexOf(":");if(t<0)return e;const n=e.substring(0,t);return n.endsWith("-tag")||"state"===n?e:n+"-tag"+e.substring(t)}))}(this._filters),this._limit=100,this._now=e.n,this._primaryKey=e.k,this._endTime=Ke.fromMilliseconds(this._now||!e.et?Date.now():e.et),this._startTime=Ke.fromMilliseconds(e.st||Ke.hoursAgo(24).milliseconds),this._sort=e.s||"createdTs",this._verbose=e.v,this._fetch(),this.render(),this._initDatePickers()})),this._filteredPrimaryArr=[],this._possibleColumns={},this._primaryMap={},this._queryCounts=ke,this._message="You must sign in to see anything useful.",this._showColSelector=!1,this._columnQuery="",this._filterQuery="",this._fetchController=null,this._knownDimensions=[],this._ignoreScrolls=0}connectedCallback(){super.connectedCallback(),this._loginEvent=e=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this._sortEvent=e=>{this._sort=e.detail.key,this._dir=e.detail.direction,this._stateChanged(),this.render()},this.addEventListener("sort-change",this._sortEvent),this._startedMassCancelingEvent=e=>{this._startedCanceling=!0,this._finishedCanceling=!1,this.render()},this.addEventListener("tasks-canceling-started",this._startedMassCancelingEvent),this._finishedMassCancelingEvent=e=>{this._startedCanceling=!0,this._finishedCanceling=!0,this.render()},this.addEventListener("tasks-canceling-finished",this._finishedMassCancelingEvent)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent),this.removeEventListener("sort-change",this._sortEvent),this.removeEventListener("tasks-canceling-started",this._startedMassCancelingEvent),this.removeEventListener("tasks-canceling-finished",this._finishedMassCancelingEvent)}_addFilter(e){this._filters.indexOf(e)>=0||(this._filters.push(e),this._stateChanged(),this._tasks=function(e,t){const n=[];for(const t of e){const e=t.indexOf(":"),i=t.slice(0,e),s=t.slice(e+1);n.push([i,s])}return t.filter((e=>{let t=!0;for(const i of n){let[n,s]=i;Ne[n]?t=t&&Ne[n](e,s):(n=$e(n),t=t&&-1!==(e.tagMap[n]||[]).indexOf(s))}return t}))}(this._filters,this._tasks),this._fetch(),this.render())}_closePopup(e){t("dialog-pop-over",this).hide(),this._startedCanceling=!1,this._finishedCanceling=!1,this.render()}_columnSearch(e){if("Enter"!==e.key)return;const n=t("#column_search",this),s=n.value.trim();if(this._possibleColumns[s]){if(n.value="",this._columnQuery="",-1!==this._cols.indexOf(s))return this._refilterPossibleColumns(),void i(`Column "${s}" already displayed.`,5e3);this._cols.push(s),this._stateChanged(),this._refilterPossibleColumns()}else i(`Column "${s}" is not valid.`,5e3)}_fetch(){if(!this.loggedInAndAuthorized||!this._limit)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const e={authHeader:this.authHeader,signal:this._fetchController.signal},t=this._filters.filter((e=>"state"!=e.split(":")[0])).map((e=>e.replace("-tag","")));this.app._fetchPermissions(e,{tags:t}).then((()=>{const e=[{key:"pool",value:this.permissions.listTasks||[]}];xe(this._possibleColumns,e),Ie(this._primaryMap,e),delete this._primaryMap.state,this._knownDimensions=["pool"],this._rebuildFilterables(),this.render()})),this.app.addBusyTasks(1);let n=Le(this._filters,{limit:this._limit,start:this._startTime,end:this._now?new Date:this._endTime});const i=this._createTasksService();i.list(n).then((e=>{this._tasks=[];const t=e=>{const s={};this._tasks=this._tasks.concat(function(e,t){if(!e)return[];const n=new Date;for(const i of e){re(i,Ye);const e={};i.tags=i.tags||[];for(const n of i.tags){const i=n.split(":",1)[0],s=n.substring(i.length+1);e[i]?e[i].push(s):e[i]=[s],t[i]=Pe(t[i],s)}i.tagMap=e,i.costsUsd&&Array.isArray(i.costsUsd)?i.costsUsd.forEach((function(e,t){i.costsUsd[t]="$"+e.toFixed(4),"RUNNING"===i.state&&i.startedTs&&(i.costsUsd[t]=i.costsUsd[t]+"*")})):i.costsUsd=Me,i.costSavedUsd&&(i.costSavedUsd="-$"+i.costSavedUsd.toFixed(4)),!i.duration&&"RUNNING"===i.state&&i.startedTs&&(i.duration=(n-i.startedTs)/1e3),i.humanDuration=te(i.duration),"RUNNING"===i.state&&i.startedTs&&(i.humanDuration=i.humanDuration+"*");const s=i.startedTs||i.abandonedTs||new Date,a=i.createdTs&&s<i.createdTs;i.pendingTime=void 0,!a&&i.createdTs&&(i.pendingTime=(s-i.createdTs)/1e3),i.humanPendingTime=te(i.pendingTime),a||!i.createdTs||i.startedTs||i.abandonedTs||(i.humanPendingTime=i.humanPendingTime+"*")}return e}(e.items,s)),xe(this._possibleColumns,s),Ie(this._primaryMap,s),this._rebuildFilterables(),this.render(),this._filters.length&&e.cursor?(this._limit=200,n=Le(this._filters,{cursor:e.cursor,limit:this._limit,start:this._startTime,end:this._now?new Date:this._endTime}),i.list(n).then(t).catch((e=>{this.prpcError(e,"tasks/list (paging)",!0)}))):this.app.finishedTask()};t(e)})).catch((e=>this.prpcError(e,"tasks/list",!0))),this._fetchCounts(n),this.app.addBusyTasks(1);const s=this._filters.filter((e=>e.startsWith("pool-tag:"))).map((e=>e.replace("pool-tag:","")))[0]||"";this._createBotService().dimensions(s).then((e=>{xe(this._possibleColumns,e.botsDimensions),Ie(this._primaryMap,e.botsDimensions),this._knownDimensions=(e.botsDimensions||[]).map((e=>e.key)),this._rebuildFilterables(),this.render(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/dimensions",!0)))}_fetchCounts(e){const t=ke.slice(1).map((e=>e.filter));this.app.addBusyTasks(1+t.length);const n={...e};delete n.limit;const i=this._createTasksService(),s=i.count(n).then((e=>(this.app.finishedTask(),e.count||0))).catch((e=>this.prpcError(e,"count/total",!0)));this._queryCounts[0].value=H`${F(s,"...")}`;const a={...n};delete a.state;for(let e=0;e<t.length;e++){const n={...a,state:t[e]},s=i.count(n).then((e=>(this.app.finishedTask(),e.count||0))).catch((n=>this.prpcError(n,`count/${t[e]}`,!0)));this._queryCounts[1+e].value=H`${F(s,"...")}`}}_filterSearch(e){if("Enter"!==e.key)return;const n=t("#filter_search",this);let s=n.value.trim();const a=s.indexOf(":");if(-1===a)return void i('Invalid filter.  Should be like "foo:bar"',5e3);const r=s.substring(0,a);if("state"===r||r.endsWith("-tag")||(i(`Filters should only be on state or something-tag.\n                   Auto-correcting ${r} to ${r}-tag.`,6e3),s=r+"-tag"+s.substring(a)),n.value="",this._filterQuery="",this._primaryKey="",-1!==this._filters.indexOf(s))return this._refilterPrimaryKeys(),void i(`Filter "${s}" is already active`,5e3);this._addFilter(s),this._refilterPrimaryKeys()}_initDatePickers(){this._startEle||this._endEle||(this._startEle=t("#start_time",this),this._endEle=t("#end_time",this),this._startEle&&this._endEle&&(At(this._startEle,{appendTo:t(".picker",this),defaultDate:this._startTime.date,enableTime:!0,onClose:e=>{this._startTime=Ke.fromMilliseconds(e[0].getTime()),this._stateChanged(),this._fetch(),this.render()},onOpen:()=>{this._endEle._flatpickr.isOpen&&this._endEle._flatpickr.close()}}),At(this._endEle,{appendTo:t(".picker",this),defaultDate:this._endTime.date,enableTime:!0,onClose:e=>{this._endTime=Ke.fromMilliseconds(e[0].getTime()),this._stateChanged(),this._fetch(),this.render()}})))}_filterCounts(e,t){return!!this._allStates||t<7}_makeSummaryURL(e){if(!e)return;const t=this._filters.filter((e=>!e.startsWith("state")));return t.push(`state:${e}`),`/tasklist?${j({c:this._cols,d:this._dir,st:this._startTime.milliseconds,et:this._endTime.milliseconds,f:t,k:this._primaryKey,n:this._now,s:this._sort,at:this._allStates,v:this._verbose})}`}_matchingBotsLink(){const e=["id","os","task","status"],t=this._filters.map((e=>e.replace("-tag",""))).filter((e=>{const t=e.split(":")[0];return"state"!==t&&-1!==this._knownDimensions.indexOf(t)}));for(const n of t){const t=n.split(":",1)[0];-1===e.indexOf(t)&&e.push(t)}return function(e=[],t=[]){const n=[];for(const t of e)if(t.key&&t.value)if(Array.isArray(t.value))for(const e of t.value)n.push(t.key+":"+e);else n.push(t.key+":"+t.value);else n.push(t);return"/botlist?"+function(e){if(!e)return"";var t=[];return Object.keys(e).sort().forEach((function(n){e[n].forEach((function(e){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}))})),t.join("&")}({f:n,c:t})}(t,e)}_primaryKeyChanged(e){this._primaryKey=this._filteredPrimaryArr[e.detail.selection],this._stateChanged(),this.render()}_promptMassCancel(e){t("task-mass-cancel",this).show(),t("dialog-pop-over",this).show(),t("dialog-pop-over button.goback",this).focus()}_rebuildFilterables(){this._filteredPossibleColumns=Nt(Object.keys(this._possibleColumns),this._columnQuery),this._primaryArr=Object.keys(this._primaryMap),this._primaryArr.sort(),this._filteredPrimaryArr=this._primaryArr.slice()}_refilterPrimaryKeys(e){this._filterQuery=t("#filter_search",this).value,this._filteredPrimaryArr=function(e,t,n){if(!n)return e;if(-1===(n=n.trim()).indexOf(":"))return e.filter((e=>{if(Pt(e,n))return!0;const i=t[e]||[];for(let t of i)if(Pt(t=we(t,e),n))return!0;return!1}));const i=(n=n.split(":")[0])+"-tag";return e.filter((e=>e===n||e===i))}(this._primaryArr,this._primaryMap,this._filterQuery),this._filterQuery&&this._filteredPrimaryArr.length>0&&-1===this._filteredPrimaryArr.indexOf(this._primaryKey)&&(this._primaryKey=this._filteredPrimaryArr[0],this._stateChanged()),this.render()}_refilterPossibleColumns(e){const n=t("#column_search",this);this._columnQuery=n&&n.value||"",this._filteredPossibleColumns=Nt(Object.keys(this._possibleColumns),this._columnQuery),function(e,t){const n={};for(const e of t)n[e]=!0;e.sort(((e,t)=>{const i=n[e],s=n[t];return i&&!s?-1:s&&!i?1:i&&s?Oe(e,t):e.localeCompare(t)}))}(this._filteredPossibleColumns,this._cols),this.render()}_removeFilter(e){const t=this._filters.indexOf(e);-1!==t&&(this._filters.splice(t,1),this._stateChanged(),this._fetch(),this.render())}render(){this._cols.sort(Oe),super.render(),this._scrollToPrimaryKey()}_scrollCheck(){this._ignoreScrolls>0?this._ignoreScrolls--:this._humanScrolledKeys=!0}_scrollToPrimaryKey(){if(this._primaryKey&&!this._humanScrolledKeys){const e=t(".keys.selector",this),n=t(".item[selected]",e);n&&(this._ignoreScrolls++,e.scrollTo({top:n.offsetTop-160}))}}_sortTasks(){return this._tasks.sort(((e,t)=>{const n=this._sort;if(!n)return 0;let i=1;"desc"===this._dir&&(i=-1);const s=Ve[n];if(s)return s(i,e,t);let a=Ae(n,e,this);"none"!==a&&"--"!==a||(a="zzz");let r=Ae(n,t,this);return"none"!==r&&"--"!==r||(r="zzz"),i*Y()(a,r)})),this._tasks}_toggleAllStates(e){this._allStates=!this._allStates,this._stateChanged(),this.render()}_toggleCol(e,t){e.preventDefault(),e.stopPropagation();const n=this._cols.indexOf(t);n>=0?this._cols.splice(n,1):this._cols.push(t),this._refilterPossibleColumns(),this._stateChanged(),this.render()}_toggleColSelector(e){e.preventDefault(),e.stopPropagation(),this._showColSelector=!this._showColSelector,this._refilterPossibleColumns()}_toggleNow(e){e.preventDefault(),this._now=!this._now,this._stateChanged(),this._fetch(),this.render()}_toggleVerbose(e){e.preventDefault(),this._verbose=!this._verbose,this._stateChanged(),this.render()}})})()})();
\ No newline at end of file
+(()=>{var e={445:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(s,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,o)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcCode=Object.freeze({OK:0,CANCELED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16});const i={};for(const e in t.RpcCode)i[t.RpcCode[e]]=e;function s(e){return i[e]}t.rpcCodeToCodeName=s,t.PrpcClient=class{constructor(e=null){e=e||{},this.host=e.host||document.location.host,this.accessToken=e.accessToken||null,this.insecure=e.hasOwnProperty("insecure")&&Boolean(e.insecure),this.fetchImpl=e.fetchImpl||window.fetch.bind(window)}call(e,i,s,o){return n(this,void 0,void 0,(function*(){if(!e)throw new TypeError("missing required argument: service");if(!i)throw new TypeError("missing required argument: method");if(!s)throw new TypeError("missing required argument: message");if(!(s instanceof Object))throw new TypeError("argument `message` must be a protobuf object");const n=`${!0===this.insecure?"http:":"https:"}//${this.host}/prpc/${e}/${i}`,l=this._requestOptions(s,o),c=yield this.fetchImpl(n,l);if(!c.headers.has("X-Prpc-Grpc-Code"))throw new r(c.status,"Invalid response: no X-Prpc-Grpc-Code response header");const d=Number.parseInt(c.headers.get("X-Prpc-Grpc-Code"),10);if(Number.isNaN(d))throw new r(c.status,"Invalid X-Prpc-Grpc-Code response header");const u=yield c.text();if(d!==t.RpcCode.OK)throw new a(d,u);if(!u.startsWith(")]}'"))throw new r(c.status,"Response body does not start with XSSI prefix: )]}'");return JSON.parse(u.substr(4))}))}_requestOptions(e,t){const n={accept:"application/json","content-type":"application/json"};return t&&Object.assign(n,t),this.accessToken&&(n.authorization=`Bearer ${this.accessToken}`),{credentials:"omit",method:"POST",headers:n,body:JSON.stringify(e)}}};class a extends Error{constructor(e,t){if(super(),this.code=e,this.description=t,null===e)throw new Error("missing required argument: code");this.codeName=s(e)}get message(){return`code: ${this.code} (${this.codeName}) desc: ${this.description}`}}t.GrpcError=a;class r extends Error{constructor(e,t){if(super(),this.httpStatus=e,this.description=t,null===e)throw new Error("missing required argument: httpStatus")}get message(){return`status: ${this.httpStatus} desc: ${this.description}`}}t.ProtocolError=r},124:()=>{"use strict";"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var i=function(t){t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))},s=0,a=t;s<a.length;s++)i(a[s]);return e})},28:e=>{e.exports=function e(t,n){"use strict";var i,s,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,r=/(^[ ]*|[ ]*$)/g,o=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,d=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},u=d(t).replace(r,"")||"",h=d(n).replace(r,"")||"",f=u.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=h.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=parseInt(u.match(l),16)||1!==f.length&&u.match(o)&&Date.parse(u),g=parseInt(h.match(l),16)||p&&h.match(o)&&Date.parse(h)||null;if(g){if(p<g)return-1;if(p>g)return 1}for(var v=0,_=Math.max(f.length,m.length);v<_;v++){if(i=!(f[v]||"").match(c)&&parseFloat(f[v])||f[v]||0,s=!(m[v]||"").match(c)&&parseFloat(m[v])||m[v]||0,isNaN(i)!==isNaN(s))return isNaN(i)?1:-1;if(typeof i!=typeof s&&(i+="",s+=""),i<s)return-1;if(i>s)return 1}return 0}}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=new Promise((function(e,t){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)})),t=(e,t=document)=>t.querySelector(e);function i(e,t=1e4){"object"==typeof e&&(e=e.message||JSON.stringify(e));var n={message:e,duration:t};document.dispatchEvent(new CustomEvent("error-sk",{detail:n,bubbles:!0}))}const s=new WeakMap,a=e=>(...t)=>{const n=e(...t);return s.set(n,!0),n},r=e=>"function"==typeof e&&s.has(e),o=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,l=(e,t,n=null)=>{let i=t;for(;i!==n;){const t=i.nextSibling;e.removeChild(i),i=t}},c={},d={},u=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${u}--\x3e`,f=new RegExp(`${u}|${h}`),m="$lit$";class p{constructor(e,t){this.parts=[],this.element=t;let n=-1,i=0;const s=[],a=t=>{const r=t.content,o=document.createTreeWalker(r,133,null,!1);let l=0;for(;o.nextNode();){n++;const t=o.currentNode;if(1===t.nodeType){if(t.hasAttributes()){const s=t.attributes;let a=0;for(let e=0;e<s.length;e++)s[e].value.indexOf(u)>=0&&a++;for(;a-- >0;){const s=e.strings[i],a=_.exec(s)[2],r=a.toLowerCase()+m,o=t.getAttribute(r).split(f);this.parts.push({type:"attribute",index:n,name:a,strings:o}),t.removeAttribute(r),i+=o.length-1}}"TEMPLATE"===t.tagName&&a(t)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(u)>=0){const a=t.parentNode,r=e.split(f),o=r.length-1;for(let e=0;e<o;e++)a.insertBefore(""===r[e]?v():document.createTextNode(r[e]),t),this.parts.push({type:"node",index:++n});""===r[o]?(a.insertBefore(v(),t),s.push(t)):t.data=r[o],i+=o}}else if(8===t.nodeType)if(t.data===u){const e=t.parentNode;null!==t.previousSibling&&n!==l||(n++,e.insertBefore(v(),t)),l=n,this.parts.push({type:"node",index:n}),null===t.nextSibling?t.data="":(s.push(t),n--),i++}else{let e=-1;for(;-1!==(e=t.data.indexOf(u,e+1));)this.parts.push({type:"node",index:-1})}}};a(t);for(const e of s)e.parentNode.removeChild(e)}}const g=e=>-1!==e.index,v=()=>document.createComment(""),_=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class b{constructor(e,t,n){this._parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this._parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this._parts)void 0!==e&&e.commit()}_clone(){const e=o?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=this.template.parts;let n=0,i=0;const s=e=>{const a=document.createTreeWalker(e,133,null,!1);let r=a.nextNode();for(;n<t.length&&null!==r;){const e=t[n];if(g(e))if(i===e.index){if("node"===e.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(r.previousSibling),this._parts.push(e)}else this._parts.push(...this.processor.handleAttributeExpressions(r,e.name,e.strings,this.options));n++}else i++,"TEMPLATE"===r.nodeName&&s(r.content),r=a.nextNode();else this._parts.push(void 0),n++}};return s(e),o&&(document.adoptNode(e),customElements.upgrade(e)),e}}class w{constructor(e,t,n,i){this.strings=e,this.values=t,this.type=n,this.processor=i}getHTML(){const e=this.strings.length-1;let t="";for(let n=0;n<e;n++){const e=this.strings[n],i=_.exec(e);t+=i?e.substr(0,i.index)+i[1]+i[2]+m+i[3]+u:e+h}return t+this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}const y=e=>null===e||!("object"==typeof e||"function"==typeof e);class C{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e<n.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new D(this)}_getValue(){const e=this.strings,t=e.length-1;let n="";for(let i=0;i<t;i++){n+=e[i];const t=this.parts[i];if(void 0!==t){const e=t.value;if(null!=e&&(Array.isArray(e)||"string"!=typeof e&&e[Symbol.iterator]))for(const t of e)n+="string"==typeof t?t:String(t);else n+="string"==typeof e?e:String(e)}}return n+e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class D{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===c||y(e)&&e===this.value||(this.value=e,r(e)||(this.committer.dirty=!0))}commit(){for(;r(this.value);){const e=this.value;this.value=c,e(this)}this.value!==c&&this.committer.commit()}}class k{constructor(e){this.value=void 0,this._pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(v()),this.endNode=e.appendChild(v())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e._insert(this.startNode=v()),e._insert(this.endNode=v())}insertAfterPart(e){e._insert(this.startNode=v()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this._pendingValue=e}commit(){for(;r(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}const e=this._pendingValue;e!==c&&(y(e)?e!==this.value&&this._commitText(e):e instanceof w?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===d?(this.value=d,this.clear()):this._commitText(e))}_insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}_commitNode(e){this.value!==e&&(this.clear(),this._insert(e),this.value=e)}_commitText(e){const t=this.startNode.nextSibling;e=null==e?"":e,t===this.endNode.previousSibling&&3===t.nodeType?t.data=e:this._commitNode(document.createTextNode("string"==typeof e?e:String(e))),this.value=e}_commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof b&&this.value.template===t)this.value.update(e.values);else{const n=new b(t,e.processor,this.options),i=n._clone();n.update(e.values),this._commitNode(i),this.value=n}}_commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let n,i=0;for(const s of e)void 0===(n=t[i])&&(n=new k(this.options),t.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(t[i-1])),n.setValue(s),n.commit(),i++;i<t.length&&(t.length=i,this.clear(n&&n.endNode))}clear(e=this.startNode){l(this.startNode.parentNode,e.nextSibling,this.endNode)}}class E{constructor(e,t,n){if(this.value=void 0,this._pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=n}setValue(e){this._pendingValue=e}commit(){for(;r(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=c}}class T extends C{constructor(e,t,n){super(e,t,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new M(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class M extends D{}let x=!1;try{const e={get capture(){return x=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class I{constructor(e,t,n){this.value=void 0,this._pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this._boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this._pendingValue=e}commit(){for(;r(this._pendingValue);){const e=this._pendingValue;this._pendingValue=c,e(this)}if(this._pendingValue===c)return;const e=this._pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),i&&(this._options=A(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=c}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const A=e=>e&&(x?{capture:e.capture,passive:e.passive,once:e.once}:e.capture),N=new class{handleAttributeExpressions(e,t,n,i){const s=t[0];return"."===s?new T(e,t.slice(1),n).parts:"@"===s?[new I(e,t.slice(1),i.eventContext)]:"?"===s?[new E(e,t.slice(1),n)]:new C(e,t,n).parts}handleTextExpression(e){return new k(e)}};function S(e){let t=P.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},P.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const i=e.strings.join(u);return void 0===(n=t.keyString.get(i))&&(n=new p(e,e.getTemplateElement()),t.keyString.set(i,n)),t.stringsArray.set(e.strings,n),n}const P=new Map,L=new WeakMap,O=(e,t,n)=>{let i=L.get(t);void 0===i&&(l(t,t.firstChild),L.set(t,i=new k(Object.assign({templateFactory:S},n))),i.appendInto(t)),i.setValue(e),i.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const H=(e,...t)=>new w(e,t,"html",N),$=a((e=>t=>{if(void 0===e&&t instanceof D){if(e!==t.value){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else t.setValue(e)})),R=new WeakMap,F=a(((...e)=>t=>{let n=R.get(t);void 0===n&&(n={values:[]},R.set(t,n));const i=n.values;n.values=e;for(let s=0;s<e.length&&!(void 0!==n.lastRenderedIndex&&s>n.lastRenderedIndex);s++){const a=e[s];if(y(a)||"function"!=typeof a.then){t.setValue(a),n.lastRenderedIndex=s;break}void 0!==n.lastRenderedIndex&&"function"==typeof a.then&&a===i[s]||(n.lastRenderedIndex=void 0,Promise.resolve(a).then((e=>{const i=n.values.indexOf(a);i>-1&&(void 0===n.lastRenderedIndex||i<n.lastRenderedIndex)&&(n.lastRenderedIndex=i,t.setValue(e),t.commit())})))}}));var U=n(28),Y=n.n(U);function j(e){var t=[];return Object.keys(e).sort().forEach((function(n){Array.isArray(e[n])?e[n].forEach((function(e){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):"object"==typeof e[n]?t.push(encodeURIComponent(n)+"="+encodeURIComponent(j(e[n]))):t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]))})),t.join("&")}function G(e,t){t=t||{};for(var n={},i=e.split("&"),s=0;s<i.length;s++){var a=i[s].split("=",2);if(2==a.length){var r=decodeURIComponent(a[0]),o=decodeURIComponent(a[1]);if(t.hasOwnProperty(r))switch(typeof t[r]){case"boolean":n[r]="true"==o;break;case"number":n[r]=Number(o);break;case"object":if(Array.isArray(t[r])){var l=n[r]||[];l.push(o),n[r]=l}else n[r]=G(o,t[r]);break;default:n[r]=o}else n[r]=o}}return n}const W=e=>JSON.parse(JSON.stringify(e));function V(t,n){let i=W(t()),s=!1;const a=()=>{s=!0;let e=G(window.location.search.slice(1),i);n(function(e,t){let n={};return Object.keys(t).forEach((function(i){e.hasOwnProperty(i)?n[i]=W(e[i]):n[i]=W(t[i])})),n}(e,i))};return e.then(a),window.addEventListener("popstate",a),()=>{if(!s)return;let e=j(function(e,t){let n={};return Object.keys(e).forEach((function(i){(function(e,t){if(typeof e!=typeof t)return!1;let n=typeof e;return"string"===n||"boolean"===n||"number"===n?e===t:"object"===n?Array.isArray(n)?JSON.stringify(e)===JSON.stringify(t):j(e)===j(t):void 0})(e[i],t[i])||(n[i]=e[i])})),n}(t(),i));history.pushState(null,"",window.location.origin+window.location.pathname+"?"+e)}}function B(e,t){if(e.hasOwnProperty(t)){let n=e[t];delete e[t],e[t]=n}}class z extends HTMLElement{get _role(){return"checkbox"}static get observedAttributes(){return["checked","disabled","name","label"]}connectedCallback(){this.innerHTML=`<label><input type=${this._role}></input><span class=box></span><span class=label></span></label>`,this._label=this.querySelector(".label"),this._input=this.querySelector("input"),B(this,"checked"),B(this,"disabled"),B(this,"name"),B(this,"label"),this._input.checked=this.checked,this._input.disabled=this.disabled,this._input.setAttribute("name",this.getAttribute("name")),this._label.textContent=this.getAttribute("label")}get checked(){return this.hasAttribute("checked")}set checked(e){let t=!!e;this._input.checked=t,e?this.setAttribute("checked",""):this.removeAttribute("checked")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){let t=!!e;this._input.disabled=t,t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get name(){return this._input.getAttribute("name")}set name(e){this.setAttribute("name",e),this._input.setAttribute("name",e)}get label(){return this._input.getAttribute("label")}set label(e){this.setAttribute("label",e),this._input.setAttribute("label",e)}attributeChangedCallback(e,t,n){if(!this._input)return;let i=null!=n;switch(e){case"checked":this._input.checked=i;break;case"disabled":this._input.disabled=i;break;case"name":this._input.name=n;break;case"label":this._label.textContent=n}}}window.customElements.define("checkbox-sk",z);const K=document.createElement("template");K.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>',window.customElements.define("add-circle-icon-sk",class extends HTMLElement{connectedCallback(){let e=K.content.cloneNode(!0);this.appendChild(e)}});const Q=document.createElement("template");Q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',window.customElements.define("cancel-icon-sk",class extends HTMLElement{connectedCallback(){let e=Q.content.cloneNode(!0);this.appendChild(e)}});const q=document.createElement("template");q.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>',window.customElements.define("more-horiz-icon-sk",class extends HTMLElement{connectedCallback(){let e=q.content.cloneNode(!0);this.appendChild(e)}});const X=document.createElement("template");X.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>',window.customElements.define("more-vert-icon-sk",class extends HTMLElement{connectedCallback(){let e=X.content.cloneNode(!0);this.appendChild(e)}});const J=document.createElement("template");J.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',window.customElements.define("search-icon-sk",class extends HTMLElement{connectedCallback(){let e=J.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("select-sk",class extends HTMLElement{constructor(){super(),this._obs=new MutationObserver((()=>this._bubbleUp())),this._selection=-1}connectedCallback(){B(this,"selection"),B(this,"disabled"),this.addEventListener("click",this._click),this._obs.observe(this,{childList:!0}),this._bubbleUp()}disconnectedCallback(){this.removeEventListener("click",this._click),this._obs.disconnect()}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?(this.setAttribute("disabled",""),this.selection=-1):(this.removeAttribute("disabled"),this._bubbleUp())}get selection(){return this._selection}set selection(e){this.disabled||(null!=e||(e=-1),this._selection=+e,this._rationalize())}_click(e){if(this.disabled)return;let t=this._selection,n=e.target;for(;n&&n.parentElement!==this;)n=n.parentElement;if(n&&n.parentElement===this)for(let e=0;e<this.children.length;e++)if(this.children[e]===n){this._selection=e;break}this._rationalize(),t!=this._selection&&this.dispatchEvent(new CustomEvent("selection-changed",{detail:{selection:this._selection},bubbles:!0}))}_rationalize(){for(let e=0;e<this.children.length;e++)this._selection===e?this.children[e].setAttribute("selected",""):this.children[e].removeAttribute("selected")}_bubbleUp(){if(this._selection=-1,!this.disabled){for(let e=0;e<this.children.length;e++)if(this.children[e].hasAttribute("selected")){this._selection=e;break}this._rationalize()}}});const Z=document.createElement("template");Z.innerHTML="<div class=backdrop></div>",window.customElements.define("dialog-pop-over",class extends HTMLElement{constructor(){super(),this._backdrop=null,this._content=null}connectedCallback(){const e=Z.content.cloneNode(!0);if(this.appendChild(e),this._backdrop=t(".backdrop",this),this._content=t(".content",this),!this._content)throw new Error("You must have an element with class content to show.")}hide(){this._backdrop.classList.remove("opened"),this._content.classList.remove("opened")}show(){const e=window.innerWidth,t=window.innerHeight,n=Math.min(this._content.offsetWidth,e-50),i=Math.min(this._content.offsetHeight,t-50);this._content.style.width=n,this._content.style.left=(e-n)/2,this._content.style.top=(t-i)/2,this._backdrop.classList.add("opened"),this._content.classList.add("opened")}});const ee=[{units:"w",delta:604800},{units:"d",delta:86400},{units:"h",delta:3600},{units:"m",delta:60},{units:"s",delta:1}];function te(e){if(0===e||"0"===e)return"0s";if(!e)return"--";const t=parseFloat(e);return t?t>60?function(e){if(e<0&&(e=-e),0===e)return"  0s";let t="";for(let n=0;n<ee.length;n++)if(ee[n].delta<=e){let i=Math.floor(e/ee[n].delta)+ee[n].units;for(;i.length<4;)i=" "+i;t+=i,e%=ee[n].delta}return t}(t):t.toFixed(2)+"s":e+" seconds"}function ne(e,t,n=!0){B(e,t),void 0===e[t]&&e.hasAttribute(t)&&(e[t]=e.getAttribute(t),n&&e.removeAttribute(t))}const ie=/_[a-zA-Z]/g;function se(e){return e.replace(ie,(function(e){return e.substring(1).charAt(0).toUpperCase()+e.substring(2)}))}class ae{constructor(e){this._time=new Proxy(e,{get(e,t,n){let i=Reflect.get(e,t,n);if(void 0===i)return i;"string"==typeof i&&(i=new Date(i));const s=i.toString(),a=s.substring(s.indexOf("("));return`${i.toLocaleString()} ${a}`}})}get time(){return this._time}}function re(e,t){if(void 0!==e){for(const n of t){const t=e[n];"string"==typeof t&&(e[n]=new Date(t))}e.humanized=new ae(e)}}const oe=document.createElement("template");oe.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>',window.customElements.define("arrow-drop-down-icon-sk",class extends HTMLElement{connectedCallback(){let e=oe.content.cloneNode(!0);this.appendChild(e)}});const le=document.createElement("template");le.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M7 14l5-5 5 5z"/></svg>',window.customElements.define("arrow-drop-up-icon-sk",class extends HTMLElement{connectedCallback(){let e=le.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("sort-toggle",class extends HTMLElement{constructor(){super()}connectedCallback(){ne(this,"currentKey"),ne(this,"key"),ne(this,"direction"),this.addEventListener("click",(()=>{this.toggle()})),this.render()}get currentKey(){return this._currentKey}set currentKey(e){this._currentKey=e,this.render()}get key(){return this._key}set key(e){this._key=e,this.render()}get direction(){return this._direction}set direction(e){this._direction=e,this.render()}toggle(){this.currentKey===this.key&&"asc"===this.direction?this.direction="desc":this.direction="asc",this.dispatchEvent(new CustomEvent("sort-change",{detail:{direction:this.direction,key:this.key},bubbles:!0}))}render(){var e;O(H` <arrow-drop-down-icon-sk ?hidden=${(e=this).key===e.currentKey&&"asc"===e.direction} > </arrow-drop-down-icon-sk> <arrow-drop-up-icon-sk ?hidden=${e.key===e.currentKey&&"desc"===e.direction} > </arrow-drop-up-icon-sk>`,this,{eventContext:this})}}),window.customElements.define("toast-sk",class extends HTMLElement{constructor(){super(),this._timer=null}connectedCallback(){this.hasAttribute("duration")||(this.duration=5e3),B(this,"duration")}get duration(){return+this.getAttribute("duration")}set duration(e){this.setAttribute("duration",e)}show(){this.setAttribute("shown",""),this.duration>0&&!this._timer&&(this._timer=window.setTimeout((()=>{this._timer=null,this.hide()}),this.duration))}hide(){this.removeAttribute("shown"),this._timer&&(window.clearTimeout(this._timer),this._timer=null)}}),window.customElements.define("error-toast-sk",class extends HTMLElement{connectedCallback(){this.innerHTML="<toast-sk></toast-sk>",this._toast=this.firstElementChild,document.addEventListener("error-sk",this)}disconnectedCallback(){document.removeEventListener("error-sk",this)}handleEvent(e){e.detail.duration&&(this._toast.duration=e.detail.duration),this._toast.textContent=e.detail.message,this._toast.show()}});const ce=document.createElement("template");ce.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',window.customElements.define("bug-report-icon-sk",class extends HTMLElement{connectedCallback(){let e=ce.content.cloneNode(!0);this.appendChild(e)}});const de=document.createElement("template");function ue(e){if(e.ok)return e.json();throw{message:`Bad network response: ${e.statusText}`,resp:e,status:e.status}}de.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',window.customElements.define("menu-icon-sk",class extends HTMLElement{connectedCallback(){let e=de.content.cloneNode(!0);this.appendChild(e)}}),window.customElements.define("spinner-sk",class extends HTMLElement{connectedCallback(){B(this,"active")}get active(){return this.hasAttribute("active")}set active(e){e?this.setAttribute("active",""):this.removeAttribute("active")}}),window.customElements.define("oauth-login",class extends HTMLElement{connectedCallback(){B(this,"testing_offline"),this._auth_header="",this._profile=null,this.testing_offline||this._fetchAuthState().then((e=>{"anonymous:anonymous"!=e.identity&&(this._fireLoginEvent(e),this.render())}),(e=>{console.error(e),i(`Error getting auth state: ${JSON.stringify(e)}`,1e4)})),this.render()}static get observedAttributes(){return["testing_offline"]}get authHeader(){return this._auth_header}get profile(){return this._profile}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}_fireLoginEvent(e){this._profile={email:e.email,imageURL:e.picture},this._auth_header=`Bearer ${e.accessToken}`,this.dispatchEvent(new CustomEvent("log-in",{detail:{authHeader:this._auth_header,profile:this._profile},bubbles:!0}))}_logIn(){this.testing_offline?(this._fireLoginEvent({email:"missing@chromium.org",picture:"http://storage.googleapis.com/gd-wagtail-prod-assets/original_images/logo_google_fonts_color_2x_web_64dp.png",accessToken:"12345678910-boomshakalaka"}),this.render()):this._nagivateTo("login")}_logOut(){this.testing_offline?window.location.reload():this._nagivateTo("logout")}_nagivateTo(e){const t=window.location.pathname+window.location.search;window.location=t&&"/"!=t?`/auth/openid/${e}?r=${encodeURIComponent(t)}`:`/auth/openid/${e}`}_fetchAuthState(){return fetch("/auth/openid/state",{mode:"same-origin",credentials:"same-origin",cache:"no-store"}).then(ue)}render(){var e;O((e=this).authHeader?H` <div> <img class="center" id="avatar" src="${e._profile.imageURL}" width="30" height="30" /> <span class="center">${e._profile.email}</span> <span class="center">|</span> <a class="center" @click=${e._logOut} href="#">Sign out</a> </div>`:H` <div> <a @click=${e._logIn} href="#">Sign in</a> </div>`,this,{eventContext:this})}attributeChangedCallback(e,t,n){this.render()}});var he=n(445);class fe{constructor(e,t=null,n={}){const i={...n,accessToken:void 0};if(window.LIVE_DEMO&&(i.insecure=!0),this._token=e,t){const e=(e,n)=>(n.signal=t,fetch(e,n));i.fetchImpl=e}this._client=new he.PrpcClient(i)}get service(){throw new Error("Subclasses must define service")}_call(e,t){const n={authorization:this._token};return this._client.call(this.service,e,t,n)}}class me extends fe{get service(){return"swarming.v2.Swarming"}permissions(e){return this._call("GetPermissions",e)}details(){return this._call("GetDetails",{})}token(){return this._call("GetToken",{})}}const pe=document.createElement("template");pe.innerHTML="\n<button class=toggle-button>\n  <menu-icon-sk>\n  </menu-icon-sk>\n</button>\n";const ge=document.createElement("template");ge.innerHTML="\n<div class=spinner-spacer>\n  <spinner-sk></spinner-sk>\n</div>\n";const ve="You must log in to see more details",_e=document.createElement("template");_e.innerHTML='\n<a target=_blank rel=noopener\n   href="https://bugs.chromium.org/p/chromium/issues/entry?components=Infra%3ELUCI%3ETaskDistribution%3EUI&owner=vadimsh@chromium.org&status=Assigned">\n  <bug-report-icon-sk class=fab></bug-report-icon-sk>\n</a>',window.customElements.define("swarming-app",class extends HTMLElement{constructor(){super(),this._busyTaskCount=0,this._spinner=null,this._dynamicEle=null,this._auth_header="",this._profile={},this._serverDetails={serverVersion:ve,botVersion:"",casViewerServer:""};const e=location.hostname.indexOf(".appspot.com");this._projectId=location.hostname.substring(0,e),this._permissions={}}connectedCallback(){B(this,"testing_offline"),this._addHTML(),this.addEventListener("log-in",(e=>{this._auth_header=e.detail.authHeader,this._profile=e.detail.profile,this._fetch()})),this.render()}static get observedAttributes(){return["testing_offline"]}get busy(){return!!this._busyTaskCount}get permissions(){return this._permissions}get profile(){return this._profile}get serverDetails(){return this._serverDetails}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}addBusyTasks(e){this._busyTaskCount+=e,this._spinner&&this._busyTaskCount>0&&(this._spinner.active=!0)}finishedTask(){this._busyTaskCount--,this._busyTaskCount<=0&&(this._busyTaskCount=0,this._spinner&&(this._spinner.active=!1),this.dispatchEvent(new CustomEvent("busy-end",{bubbles:!0})))}_addHTML(){const e=this.querySelector("header"),t=e&&e.querySelector("aside"),n=this.querySelector("footer");if(!(e&&t&&t.classList.contains("hideable")))return;let i=pe.content.cloneNode(!0);e.insertBefore(i,e.firstElementChild),(i=e.firstElementChild).addEventListener("click",(e=>this._toggleMenu(e,t)));const s=ge.content.cloneNode(!0);e.insertBefore(s,t),this._spinner=e.querySelector("spinner-sk");const a=document.createElement("span");a.classList.add("grow"),e.appendChild(a),this._dynamicEle=document.createElement("div"),this._dynamicEle.classList.add("right"),e.appendChild(this._dynamicEle);const r=document.createElement("error-toast-sk");n.append(r);const o=_e.content.cloneNode(!0);n.append(o)}_toggleMenu(e,t){t.classList.toggle("shown")}_fetch(){if(!this._auth_header)return;this._serverDetails={serverVersion:"<loading>",botVersion:"<loading>"};const e={authHeader:this._auth_header};this.addBusyTasks(1),new me(e.authHeader).details().then((e=>{this._serverDetails=e,this.render(),this.dispatchEvent(new CustomEvent("server-details-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{"PERMISSION_DENIED"===e.codeName?(this._serverDetails={serverVersion:"User unauthorized - try logging in with a different account",bot_version:""},this.render()):(console.error(e),i(`Unexpected error loading details: ${e.message}`,5e3)),this.finishedTask()})),this._fetchPermissions(e)}_fetchPermissions(e,t){return this.addBusyTasks(1),new me(e.authHeader,e.signal).permissions(t||{}).then((e=>{this._permissions=e,this.render(),this.dispatchEvent(new CustomEvent("permissions-loaded",{bubbles:!0})),this.finishedTask()})).catch((e=>{403!==e.status&&(console.error(e),i(`Unexpected error loading permissions: ${e.message}`,5e3)),this.finishedTask()}))}render(){this._dynamicEle&&O((e=>H` <div class="server-version"> AppEngine version: ${function(e,t){return t&&t.serverVersion?H`<a href=${"https://console.cloud.google.com/appengine/versions?project=".concat(e,"&serviceId=default&pageState=(%22versionsTable%22:(%22f%22:%22%255B%257B_22k_22_3A_22Version_22_2C_22t_22_3A10_2C_22v_22_3A_22_5C_22",t.serverVersion,"_5C_22_22_2C_22s_22_3Atrue_2C_22i_22_3A_22id_22%257D%255D%22))")} > ${t.serverVersion}</a >`:ve}(e._projectId,e._serverDetails)} Git version:${function(e){if(!e||!e.serverVersion)return"";const t=e.serverVersion.split("-");if(t.length>=3)return console.error(`Invalid Git version. version=${e.serverVersion}`),"";const n=2==t.length?t[1]:t[0];return H`<a href=https://chromium.googlesource.com/infra/luci/luci-py/+/${n}>${n}</a>`}(e._serverDetails)} </div> <oauth-login ?testing_offline=${e.testing_offline}> </oauth-login>`)(this),this._dynamicEle)}attributeChangedCallback(e,t,n){this.render()}});class be extends fe{get service(){return"swarming.v2.Tasks"}cancel(e,t){return this._call("CancelTask",{taskId:e,killRunning:t})}stdout(e,t,n){return this._call("GetStdout",{taskId:e,offset:t,length:n})}request(e){return this._call("GetRequest",{taskId:e})}result(e,t){return this._call("GetResult",{taskId:e,includePerformanceStats:t})}new(e){return this._call("NewTask",e)}count(e){return this._call("CountTasks",e)}list(e){return e.state||(e={...e,state:"QUERY_ALL"}),this._call("ListTasks",e)}massCancel(e){return this._call("CancelTasks",e)}}function we(e,t){if(!ye[t]||"none"===e||!e)return e;let n=ye[t][e];if("gpu"===t){const i=e.split("-")[0];n=ye[t][i]}else if("os"===t&&e.startsWith("Windows")){const i=e.split(".")[0];n=ye[t][i]}return n?`${n} (${e})`:e}const ye={device:{"iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7"},device_type:{angler:"Nexus 6p",athene:"Moto G4",blueline:"Pixel 3",bullhead:"Nexus 5X",cheetah:"Pixel 7 Pro",crosshatch:"Pixel 3 XL",darcy:"NVIDIA Shield [2017]",dragon:"Pixel C",flame:"Pixel 4",flo:"Nexus 7 [2013]",flounder:"Nexus 9",foster:"NVIDIA Shield [2015]",fugu:"Nexus Player",gce_x86:"Android on GCE",goyawifi:"Galaxy Tab 3",grouper:"Nexus 7 [2012]",hammerhead:"Nexus 5",herolte:"Galaxy S7 [Global]",heroqlteatt:"Galaxy S7 [AT&T]","iPad4,1":"iPad Air","iPad5,1":"iPad mini 4","iPad6,3":"iPad Pro [9.7 in]","iPhone7,2":"iPhone 6","iPhone9,1":"iPhone 7","iPhone10,1":"iPhone 8",j5xnlte:"Galaxy J5",m0:"Galaxy S3",mako:"Nexus 4",manta:"Nexus 10",marlin:"Pixel XL",mdarcy:"NVIDIA Shield [2019]",oriole:"Pixel 6",panther:"Pixel 7",raven:"Pixel 6 Pro",redfin:"Pixel 5",sailfish:"Pixel",sargo:"Pixel 3a",shamu:"Nexus 6",shiba:"Pixel 8",sprout:"Android One",starlte:"Galaxy S9",taimen:"Pixel 2 XL",tangorpro:"Pixel Tablet","TECNO-KB8":"TECNO Spark 3 Pro",walleye:"Pixel 2",zerofltetmo:"Galaxy S6"},gpu:{1002:"AMD","1002:6613":"AMD Radeon R7 240","1002:6646":"AMD Radeon R9 M280X","1002:6779":"AMD Radeon HD 6450/7450/8450","1002:67ef":"AMD Radeon Pro 560X","1002:679e":"AMD Radeon HD 7800","1002:6821":"AMD Radeon HD 8870M","1002:683d":"AMD Radeon HD 7770/8760","1002:7340":"AMD Radeon RX 5500 XT","1002:9830":"AMD Radeon HD 8400","1002:9874":"AMD Carrizo","1a03":"ASPEED","1a03:2000":"ASPEED Graphics Family","102b":"Matrox","102b:0522":"Matrox MGA G200e","102b:0532":"Matrox MGA G200eW","102b:0534":"Matrox G200eR2","10de":"NVIDIA","10de:08a4":"NVIDIA GeForce 320M","10de:08aa":"NVIDIA GeForce 320M","10de:0a65":"NVIDIA GeForce 210","10de:0fe9":"NVIDIA GeForce GT 750M Mac Edition","10de:0ffa":"NVIDIA Quadro K600","10de:104a":"NVIDIA GeForce GT 610","10de:11c0":"NVIDIA GeForce GTX 660","10de:1244":"NVIDIA GeForce GTX 550 Ti","10de:1401":"NVIDIA GeForce GTX 960","10de:1ba1":"NVIDIA GeForce GTX 1070","10de:1cb3":"NVIDIA Quadro P400","10de:2184":"NVIDIA GeForce GTX 1660",8086:"Intel","8086:0046":"Intel Ironlake HD Graphics","8086:0102":"Intel Sandy Bridge HD Graphics 2000","8086:0116":"Intel Sandy Bridge HD Graphics 3000","8086:0166":"Intel Ivy Bridge HD Graphics 4000","8086:0412":"Intel Haswell HD Graphics 4600","8086:041a":"Intel Haswell HD Graphics","8086:0a16":"Intel Haswell HD Graphics 4400","8086:0a26":"Intel Haswell HD Graphics 5000","8086:0a2e":"Intel Haswell Iris Graphics 5100","8086:0d26":"Intel Haswell Iris Pro Graphics 5200","8086:0f31":"Intel Bay Trail HD Graphics","8086:1616":"Intel Broadwell HD Graphics 5500","8086:161e":"Intel Broadwell HD Graphics 5300","8086:1626":"Intel Broadwell HD Graphics 6000","8086:162b":"Intel Broadwell Iris Graphics 6100","8086:1912":"Intel Skylake HD Graphics 530","8086:191e":"Intel Skylake HD Graphics 515","8086:1926":"Intel Skylake Iris 540/550","8086:193b":"Intel Skylake Iris Pro 580","8086:22b1":"Intel Braswell HD Graphics","8086:3e92":"Intel Coffee Lake S UHD Graphics 630","8086:3e9b":"Intel Coffee Lake H UHD Graphics 630","8086:3ea5":"Intel Coffee Lake Iris Plus Graphics 655","8086:4680":"Intel Alder Lake S UHD Graphics 770","8086:5912":"Intel Kaby Lake HD Graphics 630","8086:591e":"Intel Kaby Lake HD Graphics 615","8086:5926":"Intel Kaby Lake Iris Plus Graphics 640","8086:9bc5":"Intel Comet Lake S UHD Graphics 630",qcom:"Qualcomm","qcom:043a":"Qualcomm Adreno 690"},os:{"Ubuntu-14.04":"Ubuntu 14.04 Trusty Tahr","Ubuntu-16.04":"Ubuntu 16.04 Xenial Xerus","Ubuntu-18.04":"Ubuntu 18.04 Bionic Beaver","Ubuntu-20.04":"Ubuntu 20.04 Focal Fossa","Ubuntu-22.04":"Ubuntu 22.04 Jammy Jellyfish","Windows-10-10240":"Windows 10 version 1507","Windows-10-10586":"Windows 10 version 1511","Windows-10-14393":"Windows 10 version 1607","Windows-10-15063":"Windows 10 version 1703","Windows-10-16299":"Windows 10 version 1709","Windows-10-17134":"Windows 10 version 1803","Windows-10-17763":"Windows 10 version 1809","Windows-10-18362":"Windows 10 version 1903","Windows-10-18363":"Windows 10 version 1909","Windows-10-19042":"Windows 10 version 20H2","Windows-10-19043":"Windows 10 version 21H1","Windows-10-19044":"Windows 10 version 21H2","Windows-10-19045":"Windows 10 version 22H2","Windows-11-22000":"Windows 11 version 21H2","Windows-11-22621":"Windows 11 version 22H2","Windows-11-22631":"Windows 11 version 23H2","Windows-Server-14393":"Windows Server 2016","Windows-Server-17134":"Windows Server version 1803","Windows-Server-17763":"Windows Server 2019 or version 1809","Windows-Server-18362":"Windows Server version 1903","Windows-Server-18363":"Windows Server version 1909"}},Ce=new Set(["PENDING","RUNNING"]),De=new Set(["TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED"]),ke=[{label:"Total",value:"...",filter:"QUERY_ALL"},{label:"Success",value:"...",filter:"QUERY_COMPLETED_SUCCESS"},{label:"Failure",value:"...",filter:"QUERY_COMPLETED_FAILURE"},{label:"Pending",value:"...",filter:"QUERY_PENDING"},{label:"Running",value:"...",filter:"QUERY_RUNNING"},{label:"Timed Out",value:"...",filter:"QUERY_TIMED_OUT"},{label:"Bot Died",value:"...",filter:"QUERY_BOT_DIED"},{label:"Client Error",value:"...",filter:"QUERY_CLIENT_ERROR"},{label:"Deduplicated",value:"...",filter:"QUERY_DEDUPED"},{label:"Expired",value:"...",filter:"QUERY_EXPIRED"},{label:"No Resource",value:"...",filter:"QUERY_NO_RESOURCE"},{label:"Canceled",value:"...",filter:"QUERY_CANCELED"},{label:"Killed",value:"...",filter:"QUERY_KILLED"}],Ee=["ALL","COMPLETED","COMPLETED_SUCCESS","COMPLETED_FAILURE","RUNNING","PENDING","PENDING_RUNNING","BOT_DIED","DEDUPED","TIMED_OUT","EXPIRED","NO_RESOURCE","CANCELED","KILLED","CLIENT_ERROR"],Te=["quarantined","error"],Me="--";function xe(e,t){if(!e.name)for(const t of je)e[t]=!0;if(Array.isArray(t))for(const n of t)-1===Te.indexOf(n.key)&&(e[n.key+"-tag"]=!0);else for(const n in t)t.hasOwnProperty(n)&&(e[n+"-tag"]=!0)}function Ie(e,t){if(e.state||(e.state=Ee),Array.isArray(t)){for(const n of t)if(-1===Te.indexOf(n.key)){let t=e[n.key+"-tag"];for(const e of n.value)t=Pe(t,e);e[n.key+"-tag"]=t}}else for(const n in t)if(t.hasOwnProperty(n)){let i=e[n+"-tag"];for(const e of t[n])i=Pe(i,e);e[n+"-tag"]=i}}function Ae(e,t,n){if(!t)return console.warn("falsey task passed into column"),"";const i=We[e];if(i)return i(t,n);e=$e(e);let s=t.tagMap[e];return s?(s=s.map((t=>we(t,e))),n._verbose?s.join(" | "):s[0]):t[e]||Me}const Ne={state:function(e,t){const n=e.state;if(t===n||"QUERY_ALL"===t)return!0;if("QUERY_PENDING_RUNNING"===t)return Ce.has(n);const i=e.failure;return"QUERY_COMPLETED_SUCCESS"===t?"COMPLETED"===n&&!i:"QUERY_COMPLETED_FAILURE"===t?"COMPLETED"===n&&i:"QUERY_DEDUPED"===t?"COMPLETED"===n&&e.dedupedFrom:void 0}};function Se(e){return e&&e.endsWith("-tag")?`${$e(e)} (tag)`:Ue[e]||e}function Pe(e,t){if(!e||!e.length)return[t];if(-1!==e.indexOf(t))return e;for(let n=0;n<e.length;n++)if(t<e[n])return e.splice(n,0,t),e;return e.push(t),e}function Le(e,t){const n={},i=[];for(const t of e){let e=t.split(":",1)[0];const s=t.substring(e.length+1);"state"===(e=$e(e))?s.startsWith("QUERY_")?n.state=s.toUpperCase():n.state=`QUERY_${s.toUpperCase()}`:i.push(e+":"+s)}return i.length>0&&(n.tags=i),n.limit=t.limit,t.cursor&&(n.cursor=t.cursor),n.start=t.start,n.end=t.end,n}const Oe=((He=["name","createdTs","pendingTime","startedTs","duration","completedTs","abandonedTs","modifiedTs"])||(He=[]),function(e,t){let n=He.indexOf(e);-1===n&&(n=He.length+1);let i=He.indexOf(t);return-1===i&&(i=He.length+1),n===i?e.localeCompare(t):n-i});var He;function $e(e){return e&&e.endsWith("-tag")?e.substring(0,e.length-4):e}function Re(e){return e.replace("-tag:",":")}const Fe={"cores-tag":!0,"cpu-tag":!0,"gpu-tag":!0,"machine_type-tag":!0,"os-tag":!0,"priority-tag":!0,"python-tag":!0,"xcode_version-tag":!0,"zone-tag":!0},Ue={abandonedTs:"Abandoned On",completedTs:"Completed On",bot:"Bot Assigned",costsUsd:"Cost (USD)",createdTs:"Created On",duration:"Duration",name:"Task Name",modifiedTs:"Last Modified",startedTs:"Started Working On",state:"state (of task)",user:"Requesting User",pendingTime:"Time Spent Pending"},Ye=["abandonedTs","completedTs","createdTs","modifiedTs","startedTs"],je=["name","state","costsUsd","dedupedFrom","duration","pendingTime","serverVersions","bot","exitCode",...Ye],Ge="An asterisk indicates the task is still running and thus the time is dynamic.",We={abandonedTs:e=>e.humanized.time.abandonedTs,bot:e=>{const t=e.botId;return t?H`<a target="_blank" rel="noopener" href=${function(e){if(e)return"/bot?id="+e}(t)} >${t}</a >`:Me},completedTs:e=>e.humanized.time.completedTs,costsUsd:function(e){return e.costSavedUsd?e.costSavedUsd:e.costsUsd},createdTs:e=>e.humanized.time.createdTs,duration:e=>e.humanDuration.indexOf("*")?H`<span title=${Ge} >${e.humanDuration}</span >`:e.humanDuration,exitCode:e=>e.exitCode||"--",modifiedTs:e=>e.humanized.time.modifiedTs,name:(e,t)=>{let n=e.name;return!t._verbose&&e.name.length>70&&(n=n.slice(0,67)+"..."),H`<a target="_blank" rel="noopener" title=${e.name} href=${function(e,t){if(e)return`/task?id=${e=e.substring(0,e.length-1)+"0"}`}(e.taskId)} >${n}</a >`},pendingTime:e=>e.humanPendingTime.indexOf("*")?H`<span title=${Ge} >${e.humanPendingTime}</span >`:e.humanPendingTime,sourceRevision:e=>e.sourceRevision.substring(0,8),startedTs:e=>e.humanized.time.startedTs,state:e=>{const t=e.state;return"COMPLETED"===t?e.failure?"COMPLETED (FAILURE)":e.dedupedFrom?"COMPLETED (DEDUPED)":"COMPLETED (SUCCESS)":t}},Ve={abandonedTs:Be("abandonedTs"),bot:(e,t,n)=>e*Y()(t.botId||"z",n.botId||"z"),completedTs:Be("completedTs"),createdTs:Be("createdTs"),duration:ze("duration"),modifiedTs:Be("modifiedTs"),name:(e,t,n)=>e*Y()(t.name,n.name),pendingTime:ze("pendingTime"),startedTs:Be("startedTs")};function Be(e){return(t,n,i)=>t*((n[e]||"9999")-(i[e]||"9999"))}function ze(e){return(t,n,i)=>t*((void 0!==n[e]?n[e]:1e12)-(void 0!==i[e]?i[e]:1e12))}class Ke{constructor(e,t){this._milliseconds=1e3*parseInt(e||0)+parseInt(t||0)}get seconds(){return e=this._milliseconds,1e3*Math.round(e/1e3);var e}get milliseconds(){return this._milliseconds}get date(){return new Date(this.milliseconds)}static fromMilliseconds(e){return new Ke(0,e)}static hoursAgo(e){return new Ke(0,Date.now()-36e5*e)}toJSON(){return this.date.toJSON()}}const Qe=e=>H`<li>${e}</li>`;function qe(e,t){const n=`Unexpected error loading ${t}: ${e.message}`;console.error(n),i(n,5e3)}window.customElements.define("task-mass-cancel",class extends HTMLElement{constructor(){super(),this._readyToCancel=!1,this._started=!1,this._finished=!1,this._both=!1,this._progress=0}connectedCallback(){ne(this,"authHeader"),ne(this,"end"),ne(this,"start"),ne(this,"tags"),"string"==typeof this.tags&&(this.tags=this.tags.split(",")),this.start&&(this.start=Ke.fromMilliseconds(this.start)),this.end&&(this.end=Ke.fromMilliseconds(this.end)),this.tags.sort(),this.render()}_cancelAll(){this._started=!0,this.dispatchEvent(new CustomEvent("tasks-canceling-started",{bubbles:!0})),this.render();const e={limit:100,tags:this.tags,start:this.start,end:this.end};this._both&&(e.killRunning=!0);const t=new be(this.authHeader),n=e=>{if(this._progress+=parseInt(e.matched||0),this.render(),e.cursor){const i={limit:100,tags:this.tags,start:this.start,end:this.end,cursor:e.cursor};this._both&&(i.killRunning=!0),t.massCancel(i).then(n).catch((e=>qe(e,"task-mass-cancel/cancel (paging)")))}else this._finished=!0,this.render(),this.dispatchEvent(new CustomEvent("tasks-canceling-finished",{bubbles:!0}))};t.massCancel(e).then(n).catch((e=>qe(e,"task-mass-cancel/cancel")))}_count(){return void 0===this._pendingCount||void 0===this._runningCount?"...":this._both?this._pendingCount+this._runningCount:this._pendingCount}_fetchCount(){if(!this.authHeader)return void console.warn("no authHeader received, try refreshing the page?");const e=new be(this.authHeader),t={state:"QUERY_PENDING",tags:this.tags,start:Ke.hoursAgo(168),end:new Date},n=e.count(t).then((e=>{this._pendingCount=parseInt(e.count||0)})).catch((e=>qe(e,"task-mass-cancel/pending"))),i={state:"QUERY_RUNNING",tags:this.tags,start:Ke.hoursAgo(168),end:new Date},s=e.count(i).then((e=>{this._runningCount=parseInt(e.count||0)})).catch((e=>qe(e,"task-mass-cancel/running")));Promise.all([n,s]).then((()=>{this._readyToCancel=!0,this.render()}))}render(){var e;O(H` <div> You are about to cancel all PENDING bots with the following tags: <ul> ${(e=this).tags.map(Qe)} </ul> <div> <checkbox-sk ?checked=${e._both} ?disabled=${e._started} @click=${e._toggleBoth} tabindex="0" > </checkbox-sk> Also include RUNNING tasks. </div> This is about ${e._count()} tasks. Once you start the process, the only way to partially stop it is to close this browser window. If that sounds good, click the button below. </div> <button class="cancel" ?disabled=${!e._readyToCancel||e._started} @click=${e._cancelAll} > Cancel the tasks </button> <div> <div ?hidden=${!e._started}> Progress: ${e._progress} canceled${e._finished?" - DONE.":"."} </div> <div> Note: tasks queued for cancellation will be canceled as soon as possible, but there may be some delay between when this dialog box is closed and all tasks actually being canceled. </div> </div> `,this,{eventContext:this})}show(){this._readyToCancel=!1,this._started=!1,this._finished=!1,this._progress=0,this._fetchCount(),this.render()}_toggleBoth(e){e.preventDefault(),this._started||(this._both=!this._both,this.render())}});var Xe=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Je={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Ze={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const et=Ze;var tt=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},nt=function(e){return!0===e?1:0};function it(e,t){var n;return function(){var i=this,s=arguments;clearTimeout(n),n=setTimeout((function(){return e.apply(i,s)}),t)}}var st=function(e){return e instanceof Array?e:[e]};function at(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function rt(e,t,n){var i=window.document.createElement(e);return t=t||"",n=n||"",i.className=t,void 0!==n&&(i.textContent=n),i}function ot(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function lt(e,t){return t(e)?e:e.parentNode?lt(e.parentNode,t):void 0}function ct(e,t){var n=rt("div","numInputWrapper"),i=rt("input","numInput "+e),s=rt("span","arrowUp"),a=rt("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?i.type="number":(i.type="text",i.pattern="\\d*"),void 0!==t)for(var r in t)i.setAttribute(r,t[r]);return n.appendChild(i),n.appendChild(s),n.appendChild(a),n}function dt(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var ut=function(){},ht=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},ft={D:ut,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*nt(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var i=parseInt(t),s=new Date(e.getFullYear(),0,2+7*(i-1),0,0,0,0);return s.setDate(s.getDate()-s.getDay()+n.firstDayOfWeek),s},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:ut,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:ut,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},mt={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},pt={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[pt.w(e,t,n)]},F:function(e,t,n){return ht(pt.n(e,t,n)-1,!1,t)},G:function(e,t,n){return tt(pt.h(e,t,n))},H:function(e){return tt(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[nt(e.getHours()>11)]},M:function(e,t){return ht(e.getMonth(),!0,t)},S:function(e){return tt(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return tt(e.getFullYear(),4)},d:function(e){return tt(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return tt(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return tt(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},gt=function(e){var t=e.config,n=void 0===t?Je:t,i=e.l10n,s=void 0===i?Ze:i,a=e.isMobile,r=void 0!==a&&a;return function(e,t,i){var a=i||s;return void 0===n.formatDate||r?t.split("").map((function(t,i,s){return pt[t]&&"\\"!==s[i-1]?pt[t](e,a,n):"\\"!==t?t:""})).join(""):n.formatDate(e,t,a)}},vt=function(e){var t=e.config,n=void 0===t?Je:t,i=e.l10n,s=void 0===i?Ze:i;return function(e,t,i,a){if(0===e||e){var r,o=a||s,l=e;if(e instanceof Date)r=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)r=new Date(e);else if("string"==typeof e){var c=t||(n||Je).dateFormat,d=String(e).trim();if("today"===d)r=new Date,i=!0;else if(n&&n.parseDate)r=n.parseDate(e,c);else if(/Z$/.test(d)||/GMT$/.test(d))r=new Date(e);else{for(var u=void 0,h=[],f=0,m=0,p="";f<c.length;f++){var g=c[f],v="\\"===g,_="\\"===c[f-1]||v;if(mt[g]&&!_){p+=mt[g];var b=new RegExp(p).exec(e);b&&(u=!0)&&h["Y"!==g?"push":"unshift"]({fn:ft[g],val:b[++m]})}else v||(p+=".")}r=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),h.forEach((function(e){var t=e.fn,n=e.val;return r=t(r,n,o)||r})),r=u?r:void 0}}if(r instanceof Date&&!isNaN(r.getTime()))return!0===i&&r.setHours(0,0,0,0),r;n.errorHandler(new Error("Invalid date provided: "+l))}}};function _t(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var bt=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},wt=function(e,t,n){return 3600*e+60*t+n},yt=function(e){var t=Math.floor(e/3600),n=(e-3600*t)/60;return[t,n,e-3600*t-60*n]},Ct={DAY:864e5};function Dt(e){var t=e.defaultHour,n=e.defaultMinute,i=e.defaultSeconds;if(void 0!==e.minDate){var s=e.minDate.getHours(),a=e.minDate.getMinutes(),r=e.minDate.getSeconds();t<s&&(t=s),t===s&&n<a&&(n=a),t===s&&n===a&&i<r&&(i=e.minDate.getSeconds())}if(void 0!==e.maxDate){var o=e.maxDate.getHours(),l=e.maxDate.getMinutes();(t=Math.min(t,o))===o&&(n=Math.min(l,n)),t===o&&n===l&&(i=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:i}}n(124);var kt=function(){return(kt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},Et=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),s=0;for(t=0;t<n;t++)for(var a=arguments[t],r=0,o=a.length;r<o;r++,s++)i[s]=a[r];return i},Tt=300;function Mt(e,t){var n={config:kt(kt({},Je),It.defaultConfig),l10n:et};function i(){var e;return(null===(e=n.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function s(e){return e.bind(n)}function a(){var e=n.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==n.calendarContainer&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),void 0!==n.daysContainer){var t=(n.days.offsetWidth+1)*e.showMonths;n.daysContainer.style.width=t+"px",n.calendarContainer.style.width=t+(void 0!==n.weekWrapper?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}}))}function r(e){if(0===n.selectedDates.length){var t=void 0===n.config.minDate||_t(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),i=Dt(n.config);t.setHours(i.hours,i.minutes,i.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,i=dt(e),s=i;void 0!==n.amPM&&i===n.amPM&&(n.amPM.textContent=n.l10n.amPM[nt(n.amPM.textContent===n.l10n.amPM[0])]);var a=parseFloat(s.getAttribute("min")),r=parseFloat(s.getAttribute("max")),o=parseFloat(s.getAttribute("step")),l=parseInt(s.value,10),c=l+o*(e.delta||(t?38===e.which?1:-1:0));if(void 0!==s.value&&2===s.value.length){var d=s===n.hourElement,u=s===n.minuteElement;c<a?(c=r+c+nt(!d)+(nt(d)&&nt(!n.amPM)),u&&p(void 0,-1,n.hourElement)):c>r&&(c=s===n.hourElement?c-r-nt(!n.amPM):a,u&&p(void 0,1,n.hourElement)),n.amPM&&d&&(1===o?c+l===23:Math.abs(c-l)>o)&&(n.amPM.textContent=n.l10n.amPM[nt(n.amPM.textContent===n.l10n.amPM[0])]),s.value=tt(c)}}(e);var s=n._input.value;o(),Z(),n._input.value!==s&&n._debouncedChange()}function o(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,i=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,s=(parseInt(n.minuteElement.value,10)||0)%60,a=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=i,t=n.amPM.textContent,i=e%12+12*nt(t===n.l10n.amPM[1]));var r=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===_t(n.latestSelectedDateObj,n.config.minDate,!0),o=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===_t(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var l=wt(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),d=wt(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),u=wt(i,s,a);if(u>d&&u<l){var h=yt(l);i=h[0],s=h[1],a=h[2]}}else{if(o){var f=void 0!==n.config.maxTime?n.config.maxTime:n.config.maxDate;(i=Math.min(i,f.getHours()))===f.getHours()&&(s=Math.min(s,f.getMinutes())),s===f.getMinutes()&&(a=Math.min(a,f.getSeconds()))}if(r){var m=void 0!==n.config.minTime?n.config.minTime:n.config.minDate;(i=Math.max(i,m.getHours()))===m.getHours()&&s<m.getMinutes()&&(s=m.getMinutes()),s===m.getMinutes()&&(a=Math.max(a,m.getSeconds()))}}c(i,s,a)}}function l(e){var t=e||n.latestSelectedDateObj;t&&t instanceof Date&&c(t.getHours(),t.getMinutes(),t.getSeconds())}function c(e,t,i){void 0!==n.latestSelectedDateObj&&n.latestSelectedDateObj.setHours(e%24,t,i||0,0),n.hourElement&&n.minuteElement&&!n.isMobile&&(n.hourElement.value=tt(n.config.time_24hr?e:(12+e)%12+12*nt(e%12==0)),n.minuteElement.value=tt(t),void 0!==n.amPM&&(n.amPM.textContent=n.l10n.amPM[nt(e>=12)]),void 0!==n.secondElement&&(n.secondElement.value=tt(i)))}function d(e){var t=dt(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&A(n)}function u(e,t,i,s){return t instanceof Array?t.forEach((function(t){return u(e,t,i,s)})):e instanceof Array?e.forEach((function(e){return u(e,t,i,s)})):(e.addEventListener(t,i,s),void n._handlers.push({remove:function(){return e.removeEventListener(t,i,s)}}))}function h(){K("onChange")}function f(e,t){var i=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),s=n.currentYear,a=n.currentMonth;try{void 0!==i&&(n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth())}catch(e){e.message="Invalid date supplied: "+i,n.config.errorHandler(e)}t&&n.currentYear!==s&&(K("onYearChange"),C()),!t||n.currentYear===s&&n.currentMonth===a||K("onMonthChange"),n.redraw()}function m(e){var t=dt(e);~t.className.indexOf("arrow")&&p(e,t.classList.contains("arrowUp")?1:-1)}function p(e,t,n){var i=e&&dt(e),s=n||i&&i.parentNode&&i.parentNode.firstChild,a=Q("increment");a.delta=t,s&&s.dispatchEvent(a)}function g(e,t,i,s){var a=N(t,!0),r=rt("span",e,t.getDate().toString());return r.dateObj=t,r.$i=s,r.setAttribute("aria-label",n.formatDate(t,n.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===_t(t,n.now)&&(n.todayDateElem=r,r.classList.add("today"),r.setAttribute("aria-current","date")),a?(r.tabIndex=-1,q(t)&&(r.classList.add("selected"),n.selectedDateElem=r,"range"===n.config.mode&&(at(r,"startRange",n.selectedDates[0]&&0===_t(t,n.selectedDates[0],!0)),at(r,"endRange",n.selectedDates[1]&&0===_t(t,n.selectedDates[1],!0)),"nextMonthDay"===e&&r.classList.add("inRange")))):r.classList.add("flatpickr-disabled"),"range"===n.config.mode&&function(e){return!("range"!==n.config.mode||n.selectedDates.length<2)&&_t(e,n.selectedDates[0])>=0&&_t(e,n.selectedDates[1])<=0}(t)&&!q(t)&&r.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&s%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(t)+"</span>"),K("onDayCreate",r),r}function v(e){e.focus(),"range"===n.config.mode&&O(e)}function _(e){for(var t=e>0?0:n.config.showMonths-1,i=e>0?n.config.showMonths:-1,s=t;s!=i;s+=e)for(var a=n.daysContainer.children[s],r=e>0?0:a.children.length-1,o=e>0?a.children.length:-1,l=r;l!=o;l+=e){var c=a.children[l];if(-1===c.className.indexOf("hidden")&&N(c.dateObj))return c}}function b(e,t){var s=i(),a=S(s||document.body),r=void 0!==e?e:a?s:void 0!==n.selectedDateElem&&S(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&S(n.todayDateElem)?n.todayDateElem:_(t>0?1:-1);void 0===r?n._input.focus():a?function(e,t){for(var i=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,s=t>0?n.config.showMonths:-1,a=t>0?1:-1,r=i-n.currentMonth;r!=s;r+=a)for(var o=n.daysContainer.children[r],l=i-n.currentMonth===r?e.$i+t:t<0?o.children.length-1:0,c=o.children.length,d=l;d>=0&&d<c&&d!=(t>0?c:-1);d+=a){var u=o.children[d];if(-1===u.className.indexOf("hidden")&&N(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return v(u)}n.changeMonth(a),b(_(a),0)}(r,t):v(r)}function w(e,t){for(var i=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,s=n.utils.getDaysInMonth((t-1+12)%12,e),a=n.utils.getDaysInMonth(t,e),r=window.document.createDocumentFragment(),o=n.config.showMonths>1,l=o?"prevMonthDay hidden":"prevMonthDay",c=o?"nextMonthDay hidden":"nextMonthDay",d=s+1-i,u=0;d<=s;d++,u++)r.appendChild(g("flatpickr-day "+l,new Date(e,t-1,d),0,u));for(d=1;d<=a;d++,u++)r.appendChild(g("flatpickr-day",new Date(e,t,d),0,u));for(var h=a+1;h<=42-i&&(1===n.config.showMonths||u%7!=0);h++,u++)r.appendChild(g("flatpickr-day "+c,new Date(e,t+1,h%a),0,u));var f=rt("div","dayContainer");return f.appendChild(r),f}function y(){if(void 0!==n.daysContainer){ot(n.daysContainer),n.weekNumbers&&ot(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<n.config.showMonths;t++){var i=new Date(n.currentYear,n.currentMonth,1);i.setMonth(n.currentMonth+t),e.appendChild(w(i.getFullYear(),i.getMonth()))}n.daysContainer.appendChild(e),n.days=n.daysContainer.firstChild,"range"===n.config.mode&&1===n.selectedDates.length&&O()}}function C(){if(!(n.config.showMonths>1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&e<n.config.minDate.getMonth()||void 0!==n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()&&e>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var i=rt("option","flatpickr-monthDropdown-month");i.value=new Date(n.currentYear,t).getMonth().toString(),i.textContent=ht(t,n.config.shorthandCurrentMonth,n.l10n),i.tabIndex=-1,n.currentMonth===t&&(i.selected=!0),n.monthsDropdownContainer.appendChild(i)}}}function D(){var e,t=rt("div","flatpickr-month"),i=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=rt("span","cur-month"):(n.monthsDropdownContainer=rt("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),u(n.monthsDropdownContainer,"change",(function(e){var t=dt(e),i=parseInt(t.value,10);n.changeMonth(i-n.currentMonth),K("onMonthChange")})),C(),e=n.monthsDropdownContainer);var s=ct("cur-year",{tabindex:"-1"}),a=s.getElementsByTagName("input")[0];a.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&a.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(a.setAttribute("max",n.config.maxDate.getFullYear().toString()),a.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var r=rt("div","flatpickr-current-month");return r.appendChild(e),r.appendChild(s),i.appendChild(r),t.appendChild(i),{container:t,yearElement:a,monthElement:e}}function k(){ot(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=D();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function E(){n.weekdayContainer?ot(n.weekdayContainer):n.weekdayContainer=rt("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=rt("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return T(),n.weekdayContainer}function T(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=Et(n.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=Et(t.splice(e,t.length),t.splice(0,e)));for(var i=n.config.showMonths;i--;)n.weekdayContainer.children[i].innerHTML="\n      <span class='flatpickr-weekday'>\n        "+t.join("</span><span class='flatpickr-weekday'>")+"\n      </span>\n      "}}function M(e,t){void 0===t&&(t=!0);var i=t?e:e-n.currentMonth;i<0&&!0===n._hidePrevMonthArrow||i>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=i,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,K("onYearChange"),C()),y(),K("onMonthChange"),X())}function x(e){return n.calendarContainer.contains(e)}function I(e){if(n.isOpen&&!n.config.inline){var t=dt(e),i=x(t),s=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput))||i||x(e.relatedTarget)),a=!n.config.ignoredFocusElements.some((function(e){return e.contains(t)}));s&&a&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&r(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function A(e){if(!(!e||n.config.minDate&&e<n.config.minDate.getFullYear()||n.config.maxDate&&e>n.config.maxDate.getFullYear())){var t=e,i=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),i&&(n.redraw(),K("onYearChange"),C())}}function N(e,t){var i;void 0===t&&(t=!0);var s=n.parseDate(e,void 0,t);if(n.config.minDate&&s&&_t(s,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&s&&_t(s,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===s)return!1;for(var a=!!n.config.enable,r=null!==(i=n.config.enable)&&void 0!==i?i:n.config.disable,o=0,l=void 0;o<r.length;o++){if("function"==typeof(l=r[o])&&l(s))return a;if(l instanceof Date&&void 0!==s&&l.getTime()===s.getTime())return a;if("string"==typeof l){var c=n.parseDate(l,void 0,!0);return c&&c.getTime()===s.getTime()?a:!a}if("object"==typeof l&&void 0!==s&&l.from&&l.to&&s.getTime()>=l.from.getTime()&&s.getTime()<=l.to.getTime())return a}return!a}function S(e){return void 0!==n.daysContainer&&-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e)}function P(e){var t=e.target===n._input,i=n._input.value.trimEnd()!==J();!t||!i||e.relatedTarget&&x(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function L(t){var s=dt(t),a=n.config.wrap?e.contains(s):s===n._input,l=n.config.allowInput,c=n.isOpen&&(!l||!a),d=n.config.inline&&a&&!l;if(13===t.keyCode&&a){if(l)return n.setDate(n._input.value,!0,s===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),s.blur();n.open()}else if(x(s)||c||d){var u=!!n.timeContainer&&n.timeContainer.contains(s);switch(t.keyCode){case 13:u?(t.preventDefault(),r(),j()):G(t);break;case 27:t.preventDefault(),j();break;case 8:case 46:a&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(u||a)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var h=i();if(void 0!==n.daysContainer&&(!1===l||h&&S(h))){var f=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),M(f),b(_(1),0)):b(void 0,f)}}break;case 38:case 40:t.preventDefault();var m=40===t.keyCode?1:-1;n.daysContainer&&void 0!==s.$i||s===n.input||s===n.altInput?t.ctrlKey?(t.stopPropagation(),A(n.currentYear-m),b(_(1),0)):u||b(void 0,7*m):s===n.currentYearElement?A(n.currentYear-m):n.config.enableTime&&(!u&&n.hourElement&&n.hourElement.focus(),r(t),n._debouncedChange());break;case 9:if(u){var p=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter((function(e){return e})),g=p.indexOf(s);if(-1!==g){var v=p[g+(t.shiftKey?-1:1)];t.preventDefault(),(v||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(s)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&s===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],o(),Z();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],o(),Z()}(a||x(s))&&K("onKeyDown",t)}function O(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var i=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),s=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),a=Math.min(i,n.selectedDates[0].getTime()),r=Math.max(i,n.selectedDates[0].getTime()),o=!1,l=0,c=0,d=a;d<r;d+=Ct.DAY)N(new Date(d),!0)||(o=o||d>a&&d<r,d<s&&(!l||d>l)?l=d:d>s&&(!c||d<c)&&(c=d));Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+t)).forEach((function(t){var a=t.dateObj.getTime(),r=l>0&&a<l||c>0&&a>c;if(r)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){t.classList.remove(e)}));o&&!r||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){t.classList.remove(e)})),void 0!==e&&(e.classList.add(i<=n.selectedDates[0].getTime()?"startRange":"endRange"),s<i&&a===s?t.classList.add("startRange"):s>i&&a===s&&t.classList.add("endRange"),a>=l&&(0===c||a<=c)&&bt(a,s,i)&&t.classList.add("inRange")))}))}}function H(){!n.isOpen||n.config.static||n.config.inline||U()}function $(e){return function(t){var i=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),s=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==i&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter((function(e){return N(e)})),n.selectedDates.length||"min"!==e||l(i),Z()),n.daysContainer&&(Y(),void 0!==i?n.currentYearElement[e]=i.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!s&&void 0!==i&&s.getFullYear()===i.getFullYear())}}function R(){return n.config.wrap?e.querySelector("[data-input]"):e}function F(){"object"!=typeof n.config.locale&&void 0===It.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=kt(kt({},It.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?It.l10ns[n.config.locale]:void 0),mt.D="("+n.l10n.weekdays.shorthand.join("|")+")",mt.l="("+n.l10n.weekdays.longhand.join("|")+")",mt.M="("+n.l10n.months.shorthand.join("|")+")",mt.F="("+n.l10n.months.longhand.join("|")+")",mt.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===kt(kt({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===It.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=gt(n),n.parseDate=vt({config:n.config,l10n:n.l10n})}function U(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){K("onPreCalendarPosition");var t=e||n._positionElement,i=Array.prototype.reduce.call(n.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),s=n.calendarContainer.offsetWidth,a=n.config.position.split(" "),r=a[0],o=a.length>1?a[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,d="above"===r||"below"!==r&&c<i&&l.top>i,u=window.pageYOffset+l.top+(d?-i-2:t.offsetHeight+2);if(at(n.calendarContainer,"arrowTop",!d),at(n.calendarContainer,"arrowBottom",d),!n.config.inline){var h=window.pageXOffset+l.left,f=!1,m=!1;"center"===o?(h-=(s-l.width)/2,f=!0):"right"===o&&(h-=s-l.width,m=!0),at(n.calendarContainer,"arrowLeft",!f&&!m),at(n.calendarContainer,"arrowCenter",f),at(n.calendarContainer,"arrowRight",m);var p=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=h+s>window.document.body.offsetWidth,v=p+s>window.document.body.offsetWidth;if(at(n.calendarContainer,"rightMost",g),!n.config.static)if(n.calendarContainer.style.top=u+"px",g)if(v){var _=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];if(n.cssRules){try{n.cssRules}catch(e){continue}e=n;break}}return null!=e?e:(i=document.createElement("style"),document.head.appendChild(i),i.sheet);var i}();if(void 0===_)return;var b=window.document.body.offsetWidth,w=Math.max(0,b/2-s/2),y=_.cssRules.length,C="{left:"+l.left+"px;right:auto;}";at(n.calendarContainer,"rightMost",!1),at(n.calendarContainer,"centerMost",!0),_.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+C,y),n.calendarContainer.style.left=w+"px",n.calendarContainer.style.right="auto"}else n.calendarContainer.style.left="auto",n.calendarContainer.style.right=p+"px";else n.calendarContainer.style.left=h+"px",n.calendarContainer.style.right="auto"}}}else n.config.position(n,e)}function Y(){n.config.noCalendar||n.isMobile||(C(),X(),y())}function j(){n._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(n.close,0):n.close()}function G(e){e.preventDefault(),e.stopPropagation();var t=lt(dt(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==t){var i=t,s=n.latestSelectedDateObj=new Date(i.dateObj.getTime()),a=(s.getMonth()<n.currentMonth||s.getMonth()>n.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=i,"single"===n.config.mode)n.selectedDates=[s];else if("multiple"===n.config.mode){var r=q(s);r?n.selectedDates.splice(parseInt(r),1):n.selectedDates.push(s)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=s,n.selectedDates.push(s),0!==_t(s,n.selectedDates[0],!0)&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(o(),a){var l=n.currentYear!==s.getFullYear();n.currentYear=s.getFullYear(),n.currentMonth=s.getMonth(),l&&(K("onYearChange"),C()),K("onMonthChange")}if(X(),y(),Z(),a||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():v(i),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var c="single"===n.config.mode&&!n.config.enableTime,d="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(c||d)&&j()}h()}}n.parseDate=vt({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=u,n._setHoursFromDate=l,n._positionCalendar=U,n.changeMonth=M,n.changeYear=A,n.clear=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!0),n.input.value="",void 0!==n.altInput&&(n.altInput.value=""),void 0!==n.mobileInput&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),!0===n.config.enableTime){var i=Dt(n.config);c(i.hours,i.minutes,i.seconds)}n.redraw(),e&&K("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active")),K("onClose")},n.onMouseOver=O,n._createElement=rt,n.createDay=g,n.destroy=function(){void 0!==n.config&&K("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete n[e]}catch(e){}}))},n.isEnabled=N,n.jumpToDate=f,n.updateValue=Z,n.open=function(e,t){if(void 0===t&&(t=n._positionElement),!0===n.isMobile){if(e){e.preventDefault();var i=dt(e);i&&i.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void K("onOpen")}if(!n._input.disabled&&!n.config.inline){var s=n.isOpen;n.isOpen=!0,s||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),K("onOpen"),U(t)),!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return n.hourElement.select()}),50))}},n.redraw=Y,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var i in Object.assign(n.config,e),e)void 0!==W[i]&&W[i].forEach((function(e){return e()}));else n.config[e]=t,void 0!==W[e]?W[e].forEach((function(e){return e()})):Xe.indexOf(e)>-1&&(n.config[e]=st(t));n.redraw(),Z(!0)},n.setDate=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=n.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);V(e,i),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),f(void 0,t),l(),0===n.selectedDates.length&&n.clear(!1),Z(t),t&&K("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var W={locale:[F,T],showMonths:[k,a,E],minDate:[f],maxDate:[f],positionElement:[z],clickOpens:[function(){!0===n.config.clickOpens?(u(n._input,"focus",n.open),u(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function V(e,t){var i=[];if(e instanceof Array)i=e.map((function(e){return n.parseDate(e,t)}));else if(e instanceof Date||"number"==typeof e)i=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":i=[n.parseDate(e,t)];break;case"multiple":i=e.split(n.config.conjunction).map((function(e){return n.parseDate(e,t)}));break;case"range":i=e.split(n.l10n.rangeSeparator).map((function(e){return n.parseDate(e,t)}))}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?i:i.filter((function(e){return e instanceof Date&&N(e,!1)})),"range"===n.config.mode&&n.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function B(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function z(){n._positionElement=n.config.positionElement||n._input}function K(e,t){if(void 0!==n.config){var i=n.config[e];if(void 0!==i&&i.length>0)for(var s=0;i[s]&&s<i.length;s++)i[s](n.selectedDates,n.input.value,n,t);"onChange"===e&&(n.input.dispatchEvent(Q("change")),n.input.dispatchEvent(Q("input")))}}function Q(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function q(e){for(var t=0;t<n.selectedDates.length;t++){var i=n.selectedDates[t];if(i instanceof Date&&0===_t(i,e))return""+t}return!1}function X(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach((function(e,t){var i=new Date(n.currentYear,n.currentMonth,1);i.setMonth(n.currentMonth+t),n.config.showMonths>1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=ht(i.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=i.getMonth().toString(),e.value=i.getFullYear().toString()})),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=void 0!==n.config.maxDate&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function J(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map((function(e){return n.formatDate(e,t)})).filter((function(e,t,i){return"range"!==n.config.mode||n.config.enableTime||i.indexOf(e)===t})).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function Z(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=J(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=J(n.config.altFormat)),!1!==e&&K("onValueUpdate")}function ee(e){var t=dt(e),i=n.prevMonthNav.contains(t),s=n.nextMonthNav.contains(t);i||s?M(i?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var i=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=kt(kt({},JSON.parse(JSON.stringify(e.dataset||{}))),t),r={};n.config.parseDate=a.parseDate,n.config.formatDate=a.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=B(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=B(e)}});var o="time"===a.mode;if(!a.dateFormat&&(a.enableTime||o)){var l=It.defaultConfig.dateFormat||Je.dateFormat;r.dateFormat=a.noCalendar||o?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||o)&&!a.altFormat){var c=It.defaultConfig.altFormat||Je.altFormat;r.altFormat=a.noCalendar||o?"h:i"+(a.enableSeconds?":S K":" K"):c+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:$("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:$("max")});var d=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:d("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:d("max")}),"time"===a.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,r,a);for(var u=0;u<i.length;u++)n.config[i[u]]=!0===n.config[i[u]]||"true"===n.config[i[u]];for(Xe.filter((function(e){return void 0!==n.config[e]})).forEach((function(e){n.config[e]=st(n.config[e]||[]).map(s)})),n.isMobile=!n.config.disableMobile&&!n.config.inline&&"single"===n.config.mode&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),u=0;u<n.config.plugins.length;u++){var h=n.config.plugins[u](n)||{};for(var f in h)Xe.indexOf(f)>-1?n.config[f]=st(h[f]).map(s).concat(n.config[f]):void 0===a[f]&&(n.config[f]=h[f])}a.altInputClass||(n.config.altInputClass=R().className+" "+n.config.altInputClass),K("onParseConfig")}(),F(),n.input=R(),n.input?(n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=rt(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),z()):n.config.errorHandler(new Error("Invalid input element specified")),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&V(e,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]),void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=rt("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=rt("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=rt("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=rt("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,k(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(at(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(at(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],X(),n.monthNav)),n.innerContainer=rt("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=rt("div","flatpickr-weekwrapper");e.appendChild(rt("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=rt("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),i=t.weekWrapper,s=t.weekNumbers;n.innerContainer.appendChild(i),n.weekNumbers=s,n.weekWrapper=i}n.rContainer=rt("div","flatpickr-rContainer"),n.rContainer.appendChild(E()),n.daysContainer||(n.daysContainer=rt("div","flatpickr-days"),n.daysContainer.tabIndex=-1),y(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=Dt(n.config);n.timeContainer=rt("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=rt("span","flatpickr-time-separator",":"),i=ct("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=i.getElementsByTagName("input")[0];var s=ct("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=s.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=tt(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=tt(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(i),n.timeContainer.appendChild(t),n.timeContainer.appendChild(s),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var a=ct("flatpickr-second");n.secondElement=a.getElementsByTagName("input")[0],n.secondElement.value=tt(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(rt("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(a)}return n.config.time_24hr||(n.amPM=rt("span","flatpickr-am-pm",n.l10n.amPM[nt((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}()),at(n.calendarContainer,"rangeMode","range"===n.config.mode),at(n.calendarContainer,"animate",!0===n.config.animate),at(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var a=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!a&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var r=rt("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(r,n.element),r.appendChild(n.element),n.altInput&&r.appendChild(n.altInput),r.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){if(n.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),(function(t){return u(t,"click",n[e])}))})),n.isMobile)!function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=rt("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}u(n.mobileInput,"change",(function(e){n.setDate(dt(e).value,!1,n.mobileFormatStr),K("onChange"),K("onClose")}))}();else{var e=it(H,50);n._debouncedChange=it(h,Tt),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&u(n.daysContainer,"mouseover",(function(e){"range"===n.config.mode&&O(dt(e))})),u(n._input,"keydown",L),void 0!==n.calendarContainer&&u(n.calendarContainer,"keydown",L),n.config.inline||n.config.static||u(window,"resize",e),void 0!==window.ontouchstart?u(window.document,"touchstart",I):u(window.document,"mousedown",I),u(window.document,"focus",I,{capture:!0}),!0===n.config.clickOpens&&(u(n._input,"focus",n.open),u(n._input,"click",n.open)),void 0!==n.daysContainer&&(u(n.monthNav,"click",ee),u(n.monthNav,["keyup","increment"],d),u(n.daysContainer,"click",G)),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&(u(n.timeContainer,["increment"],r),u(n.timeContainer,"blur",r,{capture:!0}),u(n.timeContainer,"click",m),u([n.hourElement,n.minuteElement],["focus","click"],(function(e){return dt(e).select()})),void 0!==n.secondElement&&u(n.secondElement,"focus",(function(){return n.secondElement&&n.secondElement.select()})),void 0!==n.amPM&&u(n.amPM,"click",(function(e){r(e)}))),n.config.allowInput&&u(n._input,"blur",P)}}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&l(n.config.noCalendar?n.latestSelectedDateObj:void 0),Z(!1)),a();var i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&i&&U(),K("onReady")}(),n}function xt(e,t){for(var n=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),i=[],s=0;s<n.length;s++){var a=n[s];try{if(null!==a.getAttribute("data-fp-omit"))continue;void 0!==a._flatpickr&&(a._flatpickr.destroy(),a._flatpickr=void 0),a._flatpickr=Mt(a,t||{}),i.push(a._flatpickr)}catch(e){console.error(e)}}return 1===i.length?i[0]:i}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return xt(this,e)},HTMLElement.prototype.flatpickr=function(e){return xt([this],e)});var It=function(e,t){return"string"==typeof e?xt(window.document.querySelectorAll(e),t):e instanceof Node?xt([e],t):xt(e,t)};It.defaultConfig={},It.l10ns={en:kt({},et),default:kt({},et)},It.localize=function(e){It.l10ns.default=kt(kt({},It.l10ns.default),e)},It.setDefaults=function(e){It.defaultConfig=kt(kt({},It.defaultConfig),e)},It.parseDate=vt({}),It.formatDate=gt({}),It.compareDates=_t,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return xt(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=It);const At=It;function Nt(e,t){return t?e.filter((e=>Pt(e,t))):e}function St(e,t){return`${e}:${t}`}function Pt(e,t){if(!t)return!0;if(!e)return!1;t=t.trim().toLocaleLowerCase(),e=e.toLocaleLowerCase();const n=t.split(" ");for(const t of n)if(-1!==e.indexOf(t))return!0;return!1}const Lt=document.createElement("template");Lt.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',window.customElements.define("expand-less-icon-sk",class extends HTMLElement{connectedCallback(){let e=Lt.content.cloneNode(!0);this.appendChild(e)}});const Ot=document.createElement("template");Ot.innerHTML='<svg class="icon-sk-svg" xmlns="http://www.w3.org/2000/svg" width=24 height=24 viewBox="0 0 24 24"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>',window.customElements.define("expand-more-icon-sk",class extends HTMLElement{connectedCallback(){let e=Ot.content.cloneNode(!0);this.appendChild(e)}});class Ht extends fe{get service(){return"swarming.v2.Bots"}bot(e){return this._call("GetBot",{botId:e})}tasks(e,t){const n={sort:4,state:10,botId:e,cursor:t,limit:30,includePerformanceStats:!0};return this._call("ListBotTasks",n)}terminate(e,t){const n={botId:e,reason:t};return this._call("TerminateBot",n)}events(e,t){const n={limit:50,botId:e,cursor:t};return this._call("ListBotEvents",n)}delete(e){return this._call("DeleteBot",{botId:e})}count(e){return this._call("CountBots",{dimensions:e})}dimensions(e){return this._call("GetBotDimensions",{pool:e})}list(e){return this._call("ListBots",e)}}class $t extends HTMLElement{constructor(e){super(),this._template=e,this._app=null,this._auth_header="",this._profile=null,this._notAuthorized=!1}connectedCallback(){B(this,"testing_offline"),this._authHeaderEvent=e=>{this._auth_header=e.detail.authHeader},this.addEventListener("log-in",this._authHeaderEvent)}disconnectedCallback(){this.removeEventListener("log-in",this._authHeaderEvent)}static get observedAttributes(){return["testing_offline"]}get app(){return this._app}get authHeader(){return this._auth_header}get loggedInAndAuthorized(){return!!this._auth_header&&!this._notAuthorized}get permissions(){return this._app&&this._app.permissions||{}}get profile(){return this._app&&this._app.profile||{}}get serverDetails(){return this._app&&this._app.serverDetails||{}}get testing_offline(){return this.hasAttribute("testing_offline")}set testing_offline(e){e?this.setAttribute("testing_offline",!0):this.removeAttribute("testing_offline")}prpcError(e,t,n){"PERMISSION_DENIED"!==e.codeName||n?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}fetchError(e,t,n){403!==e.status||n?"AbortError"!==e.name&&(console.error(e),i(`Unexpected error loading ${t}: ${e.message}`,5e3)):(this._message="User unauthorized - try logging in with a different account",this._notAuthorized=!0,this.render()),this._app.finishedTask()}render(){O(this._template(this),this,{eventContext:this}),this._app||(this._app=this.firstElementChild,O(this._template(this),this,{eventContext:this}))}attributeChangedCallback(e,t,n){this.render()}_createTasksService(){return new be(this.authHeader,this._fetchController.signal)}_createBotService(){return new Ht(this.authHeader,this._fetchController.signal)}}const Rt=(e,t)=>H` <tr> <td> <a href=${$(e._makeSummaryURL(t.filter))}>${t.label}</a >: </td> <td>${t.value}</td> </tr>`,Ft=e=>H` <div class=header ?hidden=${!e.loggedInAndAuthorized}> <div class=filter_box> <search-icon-sk></search-icon-sk> <input id=filter_search class=search type=text placeholder='Search filters or supply a filter and press enter' @input=${e._refilterPrimaryKeys} @keyup=${e._filterSearch}> </input>  <div></div> ${(e=>H`  <select-sk class="selector keys" @scroll=${e._scrollCheck} @selection-changed=${e._primaryKeyChanged} > ${e._filteredPrimaryArr.map((t=>((e,t)=>H` <div class="item" ?selected=${t._primaryKey===e}> <span class="key">${function(e){return e&&e.endsWith("-tag")?`${$e(e)} (tag)`:"state"===e?"state (of task)":e}(e)}</span> </div>`)(t,e)))} </select-sk>  <select-sk class="selector values" disabled> ${(e=>{if(!e._primaryKey)return"";let t=e._primaryMap[e._primaryKey];return t?(t=function(e,t,n){const i=(n=n.trim()).indexOf(":");return-1!==i&&(n=n.substring(i+1)),!n||Pt(t,n)?e:e.filter((e=>!!Pt(e=we(e,t),n)))}(t,e._primaryKey,e._filterQuery),function(e){return Fe[e]}(e._primaryKey)?t.sort(Y()):t.sort(),t.map((t=>H` <div class="item"> <span class="value" >${we(t,$e(e._primaryKey))}</span > <span class="flex"></span> <add-circle-icon-sk ?hidden=${e._filters.indexOf(St(e._primaryKey,t))>=0} @click=${()=>e._addFilter(St(e._primaryKey,t))} > </add-circle-icon-sk> </div>`))):H` <div class="information_only"> Hmm... no preloaded values. Maybe try typing your filter like ${e._primaryKey}:foo-bar in the above box and hitting enter. </div>`})(e)} </select-sk>`)(e)} ${(e=>H` <div class=options> <div class=verbose> <checkbox-sk ?checked=${e._verbose} @click=${e._toggleVerbose} label="Verbose Entries"> </checkbox-sk> </div> <div class=picker> <div class=time> <span class=label title="Show only tasks created after this time">Start:</span> <input id=start_time></input> </div> <div class=time> <span class=label title="Show only tasks created before this time">End:</span> <input id=end_time ?disabled=${e._now}></input> <checkbox-sk ?checked=${e._now} @click=${e._toggleNow}> </checkbox-sk> <span>Now</span> </div> </div> <a href=${e._matchingBotsLink()}>View Matching Bots</a>  <button id=cancel_all ?disabled=${!e.permissions.cancelTask} @click=${e._promptMassCancel}> CANCEL ALL TASKS </button> </div>`)(e)} </div> ${(e=>H` <div class="summary"> <div class="title" @click=${e._toggleAllStates}> Selected Tasks ${function(e){return e?H`<expand-less-icon-sk></expand-less-icon-sk>`:H`<expand-more-icon-sk></expand-more-icon-sk>`}(e._allStates)} </div> <table id="query_counts"> ${Rt(e,{label:"Displayed",value:e._tasks.length})} ${e._queryCounts.filter(e._filterCounts.bind(e)).map((t=>Rt(e,t)))} </table> <more-horiz-icon-sk @click=${e._toggleAllStates} ?hidden=${e._allStates} > </more-horiz-icon-sk> </div>`)(e)} </div> </div> <div class=chip_container> ${e._filters.map((t=>((e,t)=>H` <span class="chip"> <span>${function(e){const t=e.indexOf(":");if(t<0)return e;const n=e.substring(0,t);return`${n}:${we(e.substring(t+1),n.split("-tag")[0])}`}(e)}</span> <cancel-icon-sk @click=${()=>t._removeFilter(e)}></cancel-icon-sk> </span>`)(t,e)))} </div>`,Ut=e=>H` <swarming-app id=swapp ?testing_offline=${e.testing_offline}> <header> <div class=title>Swarming Task List</div> <aside class=hideable> <a href=/>Home</a> <a href=/botlist>Bot List</a> <a href=/bot>Bot Page</a> <a href=/task>Task Page</a> </aside> </header>  <main @click=${t=>e._showColSelector&&e._toggleColSelector(t)}> <h2 class=message ?hidden=${e.loggedInAndAuthorized}>${e._message}</h2> ${Ft(e)} <table class=task-table ?hidden=${!e.loggedInAndAuthorized}> <thead> <tr> <tr> ${((e,t)=>H`  <th class="col_options" @click=${e._toggleColSelector}> <span class="show_widget"> <more-vert-icon-sk tabindex="0" @keypress=${e._toggleColSelector} ></more-vert-icon-sk> </span> <span>${Se(t)}</span> <sort-toggle @click=${e=>e.stopPropagation()&&e.preventDefault()} key="name" .currentKey=${e._sort} .direction=${e._dir} > </sort-toggle> ${(e=>e._showColSelector?H`  <div class=col_selector @click=${e=>e.stopPropagation()}> <input id=column_search class=search type=text placeholder='Search columns to show' @input=${e._refilterPossibleColumns}  @keyup=${e._columnSearch}> </input> ${e._filteredPossibleColumns.map((t=>((e,t)=>H` <div class="item"> <span class="key">${Se(e)}</span> <span class="flex"></span> <checkbox-sk ?checked=${t._cols.indexOf(e)>=0} @click=${n=>t._toggleCol(n,e)} @keypress=${n=>t._toggleCol(n,e)} data-key=${e} > </checkbox-sk> </div>`)(t,e)))} </div>`:"")(e)} </th>`)(e,e._cols[0])}  ${e._cols.slice(1).map((t=>((e,t)=>H` <th> ${Se(e)} <sort-toggle .key=${e} .currentKey=${t._sort} .direction=${t._dir}> </sort-toggle> </th>`)(t,e)))} </tr> </tr> </thead> <tbody>${e._sortTasks().map((t=>((e,t)=>H` <tr class="task-row ${function(e){const t=Ae("state",e);return De.has(t)?"exception":"BOT_DIED"===t?"bot_died":"CLIENT_ERROR"===t?"client_error":"COMPLETED (FAILURE)"===t?"failed_task":Ce.has(t)?"pending_task":""}(e)}"> ${t._cols.map((n=>((e,t,n)=>H` <td>${Ae(e,t,n)}</td>`)(n,e,t)))} </tr>`)(t,e)))}</tbody> </table> </main> <footer></footer> <dialog-pop-over> <div class='cancel content'> <task-mass-cancel .authHeader=${e.authHeader} .start=${e._startTime.milliseconds} .end=${e._endTime.milliseconds} .tags=${function(e){const t=Object.keys(Ne);return e.filter((e=>{for(const n of t)if(e.startsWith(n+":"))return!1;return!0}))}(e._filters).map(Re)}></task-mass-cancel> <button class=goback tabindex=0 @click=${e._closePopup} ?disabled=${e._startedCanceling&&!e._finishedCanceling}> ${e._startedCanceling?"DISMISS":"GO BACK - DON'T CANCEL ANYTHING"} </button> </div> </dialog-pop-over> </swarming-app>`;window.customElements.define("task-list",class extends $t{constructor(){super(Ut),this._tasks=[],this._cols=[],this._dir="",this._endTime=Ke.fromMilliseconds(Date.now()),this._filters=[],this._limit=0,this._now=!0,this._primaryKey="",this._sort="",this._startTime=Ke.hoursAgo(24),this._verbose=!1,this._allStates=window.innerWidth<600||window.innerHeight<600,this._stateChanged=V((()=>({c:this._cols,d:this._dir,st:this._startTime.milliseconds,et:this._endTime.milliseconds,f:this._filters,k:this._primaryKey,n:this._now,s:this._sort,at:this._allStates,v:this._verbose})),(e=>{var t;(t=e).c&&(t.c=t.c.map((e=>se(e)))),t.s&&(t.s=se(t.s)),this._allStates=e.at,this._cols=e.c,e.c.length||(this._cols=["name","state","bot","createdTs","pendingTime","duration","pool-tag"]),this._dir=e.d||"desc",this._filters=e.f||[],this._filters=function(e){return e.map((e=>{const t=e.indexOf(":");if(t<0)return e;const n=e.substring(0,t);return n.endsWith("-tag")||"state"===n?e:n+"-tag"+e.substring(t)}))}(this._filters),this._limit=100,this._now=e.n,this._primaryKey=e.k,this._endTime=Ke.fromMilliseconds(this._now||!e.et?Date.now():e.et),this._startTime=Ke.fromMilliseconds(e.st||Ke.hoursAgo(24).milliseconds),this._sort=e.s||"createdTs",this._verbose=e.v,this._fetch(),this.render(),this._initDatePickers()})),this._filteredPrimaryArr=[],this._possibleColumns={},this._primaryMap={},this._queryCounts=ke,this._message="You must sign in to see anything useful.",this._showColSelector=!1,this._columnQuery="",this._filterQuery="",this._fetchController=null,this._knownDimensions=[],this._ignoreScrolls=0}connectedCallback(){super.connectedCallback(),this._loginEvent=e=>{this._fetch(),this.render()},this.addEventListener("log-in",this._loginEvent),this._sortEvent=e=>{this._sort=e.detail.key,this._dir=e.detail.direction,this._stateChanged(),this.render()},this.addEventListener("sort-change",this._sortEvent),this._startedMassCancelingEvent=e=>{this._startedCanceling=!0,this._finishedCanceling=!1,this.render()},this.addEventListener("tasks-canceling-started",this._startedMassCancelingEvent),this._finishedMassCancelingEvent=e=>{this._startedCanceling=!0,this._finishedCanceling=!0,this.render()},this.addEventListener("tasks-canceling-finished",this._finishedMassCancelingEvent)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("log-in",this._loginEvent),this.removeEventListener("sort-change",this._sortEvent),this.removeEventListener("tasks-canceling-started",this._startedMassCancelingEvent),this.removeEventListener("tasks-canceling-finished",this._finishedMassCancelingEvent)}_addFilter(e){this._filters.indexOf(e)>=0||(this._filters.push(e),this._stateChanged(),this._tasks=function(e,t){const n=[];for(const t of e){const e=t.indexOf(":"),i=t.slice(0,e),s=t.slice(e+1);n.push([i,s])}return t.filter((e=>{let t=!0;for(const i of n){let[n,s]=i;Ne[n]?t=t&&Ne[n](e,s):(n=$e(n),t=t&&-1!==(e.tagMap[n]||[]).indexOf(s))}return t}))}(this._filters,this._tasks),this._fetch(),this.render())}_closePopup(e){t("dialog-pop-over",this).hide(),this._startedCanceling=!1,this._finishedCanceling=!1,this.render()}_columnSearch(e){if("Enter"!==e.key)return;const n=t("#column_search",this),s=n.value.trim();if(this._possibleColumns[s]){if(n.value="",this._columnQuery="",-1!==this._cols.indexOf(s))return this._refilterPossibleColumns(),void i(`Column "${s}" already displayed.`,5e3);this._cols.push(s),this._stateChanged(),this._refilterPossibleColumns()}else i(`Column "${s}" is not valid.`,5e3)}_fetch(){if(!this.loggedInAndAuthorized||!this._limit)return;this._fetchController&&this._fetchController.abort(),this._fetchController=new AbortController;const e={authHeader:this.authHeader,signal:this._fetchController.signal},t=this._filters.filter((e=>"state"!=e.split(":")[0])).map((e=>e.replace("-tag","")));this.app._fetchPermissions(e,{tags:t}).then((()=>{const e=[{key:"pool",value:this.permissions.listTasks||[]}];xe(this._possibleColumns,e),Ie(this._primaryMap,e),delete this._primaryMap.state,this._knownDimensions=["pool"],this._rebuildFilterables(),this.render()})),this.app.addBusyTasks(1);let n=Le(this._filters,{limit:this._limit,start:this._startTime,end:this._now?new Date:this._endTime});const i=this._createTasksService();i.list(n).then((e=>{this._tasks=[];const t=e=>{const s={};this._tasks=this._tasks.concat(function(e,t){if(!e)return[];const n=new Date;for(const i of e){re(i,Ye);const e={};i.tags=i.tags||[];for(const n of i.tags){const i=n.split(":",1)[0],s=n.substring(i.length+1);e[i]?e[i].push(s):e[i]=[s],t[i]=Pe(t[i],s)}i.tagMap=e,i.costsUsd&&Array.isArray(i.costsUsd)?i.costsUsd.forEach((function(e,t){i.costsUsd[t]="$"+e.toFixed(4),"RUNNING"===i.state&&i.startedTs&&(i.costsUsd[t]=i.costsUsd[t]+"*")})):i.costsUsd=Me,i.costSavedUsd&&(i.costSavedUsd="-$"+i.costSavedUsd.toFixed(4)),!i.duration&&"RUNNING"===i.state&&i.startedTs&&(i.duration=(n-i.startedTs)/1e3),i.humanDuration=te(i.duration),"RUNNING"===i.state&&i.startedTs&&(i.humanDuration=i.humanDuration+"*");const s=i.startedTs||i.abandonedTs||new Date,a=i.createdTs&&s<i.createdTs;i.pendingTime=void 0,!a&&i.createdTs&&(i.pendingTime=(s-i.createdTs)/1e3),i.humanPendingTime=te(i.pendingTime),a||!i.createdTs||i.startedTs||i.abandonedTs||(i.humanPendingTime=i.humanPendingTime+"*")}return e}(e.items,s)),xe(this._possibleColumns,s),Ie(this._primaryMap,s),this._rebuildFilterables(),this.render(),this._filters.length&&e.cursor?(this._limit=200,n=Le(this._filters,{cursor:e.cursor,limit:this._limit,start:this._startTime,end:this._now?new Date:this._endTime}),i.list(n).then(t).catch((e=>{this.prpcError(e,"tasks/list (paging)",!0)}))):this.app.finishedTask()};t(e)})).catch((e=>this.prpcError(e,"tasks/list",!0))),this._fetchCounts(n),this.app.addBusyTasks(1);const s=this._filters.filter((e=>e.startsWith("pool-tag:"))).map((e=>e.replace("pool-tag:","")))[0]||"";this._createBotService().dimensions(s).then((e=>{xe(this._possibleColumns,e.botsDimensions),Ie(this._primaryMap,e.botsDimensions),this._knownDimensions=(e.botsDimensions||[]).map((e=>e.key)),this._rebuildFilterables(),this.render(),this.app.finishedTask()})).catch((e=>this.prpcError(e,"bots/dimensions",!0)))}_fetchCounts(e){const t=ke.slice(1).map((e=>e.filter));this.app.addBusyTasks(1+t.length);const n={...e};delete n.limit;const i=this._createTasksService(),s=i.count(n).then((e=>(this.app.finishedTask(),e.count||0))).catch((e=>this.prpcError(e,"count/total",!0)));this._queryCounts[0].value=H`${F(s,"...")}`;const a={...n};delete a.state;for(let e=0;e<t.length;e++){const n={...a,state:t[e]},s=i.count(n).then((e=>(this.app.finishedTask(),e.count||0))).catch((n=>this.prpcError(n,`count/${t[e]}`,!0)));this._queryCounts[1+e].value=H`${F(s,"...")}`}}_filterSearch(e){if("Enter"!==e.key)return;const n=t("#filter_search",this);let s=n.value.trim();const a=s.indexOf(":");if(-1===a)return void i('Invalid filter.  Should be like "foo:bar"',5e3);const r=s.substring(0,a);if("state"===r||r.endsWith("-tag")||(i(`Filters should only be on state or something-tag.\n                   Auto-correcting ${r} to ${r}-tag.`,6e3),s=r+"-tag"+s.substring(a)),n.value="",this._filterQuery="",this._primaryKey="",-1!==this._filters.indexOf(s))return this._refilterPrimaryKeys(),void i(`Filter "${s}" is already active`,5e3);this._addFilter(s),this._refilterPrimaryKeys()}_initDatePickers(){this._startEle||this._endEle||(this._startEle=t("#start_time",this),this._endEle=t("#end_time",this),this._startEle&&this._endEle&&(At(this._startEle,{appendTo:t(".picker",this),defaultDate:this._startTime.date,enableTime:!0,onClose:e=>{this._startTime=Ke.fromMilliseconds(e[0].getTime()),this._stateChanged(),this._fetch(),this.render()},onOpen:()=>{this._endEle._flatpickr.isOpen&&this._endEle._flatpickr.close()}}),At(this._endEle,{appendTo:t(".picker",this),defaultDate:this._endTime.date,enableTime:!0,onClose:e=>{this._endTime=Ke.fromMilliseconds(e[0].getTime()),this._stateChanged(),this._fetch(),this.render()}})))}_filterCounts(e,t){return!!this._allStates||t<7}_makeSummaryURL(e){if(!e)return;const t=this._filters.filter((e=>!e.startsWith("state")));return t.push(`state:${e}`),`/tasklist?${j({c:this._cols,d:this._dir,st:this._startTime.milliseconds,et:this._endTime.milliseconds,f:t,k:this._primaryKey,n:this._now,s:this._sort,at:this._allStates,v:this._verbose})}`}_matchingBotsLink(){const e=["id","os","task","status"],t=this._filters.map((e=>e.replace("-tag",""))).filter((e=>{const t=e.split(":")[0];return"state"!==t&&-1!==this._knownDimensions.indexOf(t)}));for(const n of t){const t=n.split(":",1)[0];-1===e.indexOf(t)&&e.push(t)}return function(e=[],t=[]){const n=[];for(const t of e)if(t.key&&t.value)if(Array.isArray(t.value))for(const e of t.value)n.push(t.key+":"+e);else n.push(t.key+":"+t.value);else n.push(t);return"/botlist?"+function(e){if(!e)return"";var t=[];return Object.keys(e).sort().forEach((function(n){e[n].forEach((function(e){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}))})),t.join("&")}({f:n,c:t})}(t,e)}_primaryKeyChanged(e){this._primaryKey=this._filteredPrimaryArr[e.detail.selection],this._stateChanged(),this.render()}_promptMassCancel(e){t("task-mass-cancel",this).show(),t("dialog-pop-over",this).show(),t("dialog-pop-over button.goback",this).focus()}_rebuildFilterables(){this._filteredPossibleColumns=Nt(Object.keys(this._possibleColumns),this._columnQuery),this._primaryArr=Object.keys(this._primaryMap),this._primaryArr.sort(),this._filteredPrimaryArr=this._primaryArr.slice()}_refilterPrimaryKeys(e){this._filterQuery=t("#filter_search",this).value,this._filteredPrimaryArr=function(e,t,n){if(!n)return e;if(-1===(n=n.trim()).indexOf(":"))return e.filter((e=>{if(Pt(e,n))return!0;const i=t[e]||[];for(let t of i)if(Pt(t=we(t,e),n))return!0;return!1}));const i=(n=n.split(":")[0])+"-tag";return e.filter((e=>e===n||e===i))}(this._primaryArr,this._primaryMap,this._filterQuery),this._filterQuery&&this._filteredPrimaryArr.length>0&&-1===this._filteredPrimaryArr.indexOf(this._primaryKey)&&(this._primaryKey=this._filteredPrimaryArr[0],this._stateChanged()),this.render()}_refilterPossibleColumns(e){const n=t("#column_search",this);this._columnQuery=n&&n.value||"",this._filteredPossibleColumns=Nt(Object.keys(this._possibleColumns),this._columnQuery),function(e,t){const n={};for(const e of t)n[e]=!0;e.sort(((e,t)=>{const i=n[e],s=n[t];return i&&!s?-1:s&&!i?1:i&&s?Oe(e,t):e.localeCompare(t)}))}(this._filteredPossibleColumns,this._cols),this.render()}_removeFilter(e){const t=this._filters.indexOf(e);-1!==t&&(this._filters.splice(t,1),this._stateChanged(),this._fetch(),this.render())}render(){this._cols.sort(Oe),super.render(),this._scrollToPrimaryKey()}_scrollCheck(){this._ignoreScrolls>0?this._ignoreScrolls--:this._humanScrolledKeys=!0}_scrollToPrimaryKey(){if(this._primaryKey&&!this._humanScrolledKeys){const e=t(".keys.selector",this),n=t(".item[selected]",e);n&&(this._ignoreScrolls++,e.scrollTo({top:n.offsetTop-160}))}}_sortTasks(){return this._tasks.sort(((e,t)=>{const n=this._sort;if(!n)return 0;let i=1;"desc"===this._dir&&(i=-1);const s=Ve[n];if(s)return s(i,e,t);let a=Ae(n,e,this);"none"!==a&&"--"!==a||(a="zzz");let r=Ae(n,t,this);return"none"!==r&&"--"!==r||(r="zzz"),i*Y()(a,r)})),this._tasks}_toggleAllStates(e){this._allStates=!this._allStates,this._stateChanged(),this.render()}_toggleCol(e,t){e.preventDefault(),e.stopPropagation();const n=this._cols.indexOf(t);n>=0?this._cols.splice(n,1):this._cols.push(t),this._refilterPossibleColumns(),this._stateChanged(),this.render()}_toggleColSelector(e){e.preventDefault(),e.stopPropagation(),this._showColSelector=!this._showColSelector,this._refilterPossibleColumns()}_toggleNow(e){e.preventDefault(),this._now=!this._now,this._stateChanged(),this._fetch(),this.render()}_toggleVerbose(e){e.preventDefault(),this._verbose=!this._verbose,this._stateChanged(),this.render()}})})()})();
\ No newline at end of file
diff --git a/appengine/swarming/ui2/dist/public_tasklist_index.html b/appengine/swarming/ui2/dist/public_tasklist_index.html
index 823daee..31b846b 100644
--- a/appengine/swarming/ui2/dist/public_tasklist_index.html
+++ b/appengine/swarming/ui2/dist/public_tasklist_index.html
@@ -1 +1 @@
-<script defer src="/newres/public_tasklist_index-bundle.js?18ee4c0eb07ae44276a3"></script><link href="/newres/public_tasklist_index-bundle.css" rel="stylesheet"><title>Task List - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><task-list></task-list>
\ No newline at end of file
+<script defer src="/newres/public_tasklist_index-bundle.js?5013829e6d459d69ed84"></script><link href="/newres/public_tasklist_index-bundle.css" rel="stylesheet"><title>Task List - Swarming</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>if(!window.customElements){var s=document.createElement("script");s.src="/newres/custom-elements.min.js",document.write(s.outerHTML)}</script><task-list></task-list>
\ No newline at end of file
diff --git a/appengine/swarming/ui2/modules/alias.js b/appengine/swarming/ui2/modules/alias.js
index b387e82..8bc5f9a 100644
--- a/appengine/swarming/ui2/modules/alias.js
+++ b/appengine/swarming/ui2/modules/alias.js
@@ -74,6 +74,7 @@
   sprout: "Android One",
   starlte: "Galaxy S9",
   taimen: "Pixel 2 XL",
+  tangorpro: "Pixel Tablet",
   "TECNO-KB8": "TECNO Spark 3 Pro",
   walleye: "Pixel 2",
   zerofltetmo: "Galaxy S6",