(function(k,i){typeof exports=="object"&&typeof module<"u"?i(require("buildbot-plugin-support"),require("react"),require("mobx-react"),require("react-router-dom"),require("buildbot-data-js"),require("buildbot-ui")):typeof define=="function"&&define.amd?define(["buildbot-plugin-support","react","mobx-react","react-router-dom","buildbot-data-js","buildbot-ui"],i):(k=typeof globalThis<"u"?globalThis:k||self,i(k.BuildbotPluginSupport,k.React,k.mobxReact,k.ReactRouterDOM,k.BuildbotDataJs,k.BuildbotUi))})(this,function(k,i,Ee,ue,O,H){"use strict";function ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var de={exports:{}},K={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Te=i,je=Symbol.for("react.element"),Se=Symbol.for("react.fragment"),$e=Object.prototype.hasOwnProperty,Le=Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ve={key:!0,ref:!0,__self:!0,__source:!0};function me(e,r,t){var s,l={},n=null,a=null;t!==void 0&&(n=""+t),r.key!==void 0&&(n=""+r.key),r.ref!==void 0&&(a=r.ref);for(s in r)$e.call(r,s)&&!Ve.hasOwnProperty(s)&&(l[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps,r)l[s]===void 0&&(l[s]=r[s]);return{$$typeof:je,type:e,key:n,ref:a,props:l,_owner:Le.current}}K.Fragment=Se,K.jsx=me,K.jsxs=me,de.exports=K;var x=de.exports,pe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},fe=i.createContext&&i.createContext(pe),Be=["attr","size","title"];function ke(e,r){if(e==null)return{};var t=qe(e,r),s,l;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)s=n[l],!(r.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(t[s]=e[s])}return t}function qe(e,r){if(e==null)return{};var t={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(r.indexOf(s)>=0)continue;t[s]=e[s]}return t}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},X.apply(this,arguments)}function ve(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,s)}return t}function Y(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ve(Object(t),!0).forEach(function(s){Ae(e,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(t,s))})}return e}function Ae(e,r,t){return r=Me(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Me(e){var r=ze(e,"string");return typeof r=="symbol"?r:r+""}function ze(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var s=t.call(e,r||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function he(e){return e&&e.map((r,t)=>i.createElement(r.tag,Y({key:t},r.attr),he(r.child)))}function Ge(e){return r=>i.createElement(We,X({attr:Y({},e.attr)},r),he(e.child))}function We(e){var r=t=>{var{attr:s,size:l,title:n}=e,a=ke(e,Be),u=l||t.size||"1em",o;return t.className&&(o=t.className),e.className&&(o=(o?o+" ":"")+e.className),i.createElement("svg",X({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,s,a,{className:o,style:Y(Y({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),n&&i.createElement("title",null,n),e.children)};return fe!==void 0?i.createElement(fe.Consumer,null,t=>r(t)):r(pe)}function Qe(e){return Ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"},child:[]}]})(e)}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)({}).hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},N.apply(null,arguments)}function T(e,r){if(e==null)return{};var t={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(r.includes(s))continue;t[s]=e[s]}return t}var be={exports:{}};/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var u=arguments[a];u&&(n=l(n,s(u)))}return n}function s(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var u in n)r.call(n,u)&&n[u]&&(a=l(a,u));return a}function l(n,a){return a?n?n+" "+a:n+a:n}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(be);var De=be.exports;const j=ce(De);var te=i.createContext({});te.Consumer,te.Provider;function L(e,r){var t=i.useContext(te);return e||t[r]||r}var xe={exports:{}},Ue="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",He=Ue,Ke=He;function ge(){}function ye(){}ye.resetWarningCache=ge;var Xe=function(){function e(s,l,n,a,u,o){if(o!==Ke){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}e.isRequired=e;function r(){return e}var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:ye,resetWarningCache:ge};return t.PropTypes=t,t};xe.exports=Xe();var Ye=xe.exports;const re=ce(Ye);var Ze=/-(.)/g;function _e(e){return e.replace(Ze,function(r,t){return t.toUpperCase()})}var Je=["className","bsPrefix","as"],Re=function(r){return r[0].toUpperCase()+_e(r).slice(1)};function et(e,r){var t={},s=t.displayName,l=s===void 0?Re(e):s,n=t.Component,a=t.defaultProps,u=i.forwardRef(function(o,m){var p=o.className,v=o.bsPrefix,c=o.as,f=c===void 0?n||"div":c,g=T(o,Je),y=L(v,e);return i.createElement(f,N({ref:m,className:j(p,y)},g))});return u.defaultProps=a,u.displayName=l,u}var tt=["bsPrefix","className","as"],rt=["xl","lg","md","sm","xs"],Ce=i.forwardRef(function(e,r){var t=e.bsPrefix,s=e.className,l=e.as,n=l===void 0?"div":l,a=T(e,tt),u=L(t,"col"),o=[],m=[];return rt.forEach(function(p){var v=a[p];delete a[p];var c,f,g;if(typeof v=="object"&&v!=null){var y=v.span;c=y===void 0?!0:y,f=v.offset,g=v.order}else c=v;var b=p!=="xs"?"-"+p:"";c&&o.push(c===!0?""+u+b:""+u+b+"-"+c),g!=null&&m.push("order"+b+"-"+g),f!=null&&m.push("offset"+b+"-"+f)}),o.length||o.push(u),i.createElement(n,N({},a,{ref:r,className:j.apply(void 0,[s].concat(o,m))}))});Ce.displayName="Col";var Pe={exports:{}},se={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(s){function l(a,u,o,m,p,v){var c=m||"<<anonymous>>",f=v||o;if(u[o]==null)return a?new Error("Required "+p+" `"+f+"` was not specified "+("in `"+c+"`.")):null;for(var g=arguments.length,y=Array(g>6?g-6:0),b=6;b<g;b++)y[b-6]=arguments[b];return s.apply(void 0,[u,o,c,p,f].concat(y))}var n=l.bind(null,!1);return n.isRequired=l.bind(null,!0),n}e.exports=r.default})(se,se.exports);var st=se.exports;(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var t=st,s=l(t);function l(a){return a&&a.__esModule?a:{default:a}}function n(){for(var a=arguments.length,u=Array(a),o=0;o<a;o++)u[o]=arguments[o];function m(){for(var p=arguments.length,v=Array(p),c=0;c<p;c++)v[c]=arguments[c];var f=null;return u.forEach(function(g){if(f==null){var y=g.apply(void 0,v);y!=null&&(f=y)}}),f}return(0,s.default)(m)}e.exports=r.default})(Pe,Pe.exports);var nt=["as","className","type","tooltip"],it={type:re.string,tooltip:re.bool,as:re.elementType},Q=i.forwardRef(function(e,r){var t=e.as,s=t===void 0?"div":t,l=e.className,n=e.type,a=n===void 0?"valid":n,u=e.tooltip,o=u===void 0?!1:u,m=T(e,nt);return i.createElement(s,N({},m,{ref:r,className:j(l,a+"-"+(o?"tooltip":"feedback"))}))});Q.displayName="Feedback",Q.propTypes=it;var q=i.createContext({controlId:void 0}),at=["id","bsPrefix","bsCustomPrefix","className","type","isValid","isInvalid","isStatic","as"],ne=i.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,l=e.bsCustomPrefix,n=e.className,a=e.type,u=a===void 0?"checkbox":a,o=e.isValid,m=o===void 0?!1:o,p=e.isInvalid,v=p===void 0?!1:p,c=e.isStatic,f=e.as,g=f===void 0?"input":f,y=T(e,at),b=i.useContext(q),w=b.controlId,I=b.custom,d=I?[l,"custom-control-input"]:[s,"form-check-input"],C=d[0],P=d[1];return s=L(C,P),i.createElement(g,N({},y,{ref:r,type:u,id:t||w,className:j(n,s,m&&"is-valid",v&&"is-invalid",c&&"position-static")}))});ne.displayName="FormCheckInput";var lt=["bsPrefix","bsCustomPrefix","className","htmlFor"],ie=i.forwardRef(function(e,r){var t=e.bsPrefix,s=e.bsCustomPrefix,l=e.className,n=e.htmlFor,a=T(e,lt),u=i.useContext(q),o=u.controlId,m=u.custom,p=m?[s,"custom-control-label"]:[t,"form-check-label"],v=p[0],c=p[1];return t=L(v,c),i.createElement("label",N({},a,{ref:r,htmlFor:n||o,className:j(l,t)}))});ie.displayName="FormCheckLabel";var ot=["id","bsPrefix","bsCustomPrefix","inline","disabled","isValid","isInvalid","feedbackTooltip","feedback","className","style","title","type","label","children","custom","as"],G=i.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,l=e.bsCustomPrefix,n=e.inline,a=n===void 0?!1:n,u=e.disabled,o=u===void 0?!1:u,m=e.isValid,p=m===void 0?!1:m,v=e.isInvalid,c=v===void 0?!1:v,f=e.feedbackTooltip,g=f===void 0?!1:f,y=e.feedback,b=e.className,w=e.style,I=e.title,d=I===void 0?"":I,C=e.type,P=C===void 0?"checkbox":C,A=e.label,S=e.children,h=e.custom,F=e.as,V=F===void 0?"input":F,M=T(e,ot),$=P==="switch"?!0:h,B=$?[l,"custom-control"]:[s,"form-check"],W=B[0],z=B[1];s=L(W,z);var D=i.useContext(q),U=D.controlId,ee=i.useMemo(function(){return{controlId:t||U,custom:$}},[U,$,t]),Oe=$||A!=null&&A!==!1&&!S,Nt=i.createElement(ne,N({},M,{type:P==="switch"?"checkbox":P,ref:r,isValid:p,isInvalid:c,isStatic:!Oe,disabled:o,as:V}));return i.createElement(q.Provider,{value:ee},i.createElement("div",{style:w,className:j(b,s,$&&"custom-"+P,a&&s+"-inline")},S||i.createElement(i.Fragment,null,Nt,Oe&&i.createElement(ie,{title:d},A),(p||c)&&i.createElement(Q,{type:p?"valid":"invalid",tooltip:g},y))))});G.displayName="FormCheck",G.Input=ne,G.Label=ie;var ut=["id","bsPrefix","bsCustomPrefix","className","isValid","isInvalid","lang","as"],ae=i.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,l=e.bsCustomPrefix,n=e.className,a=e.isValid,u=e.isInvalid,o=e.lang,m=e.as,p=m===void 0?"input":m,v=T(e,ut),c=i.useContext(q),f=c.controlId,g=c.custom,y="file",b=g?[l,"custom-file-input"]:[s,"form-control-file"],w=b[0],I=b[1];return s=L(w,I),i.createElement(p,N({},v,{ref:r,id:t||f,type:y,lang:o,className:j(n,s,a&&"is-valid",u&&"is-invalid")}))});ae.displayName="FormFileInput";var ct=["bsPrefix","bsCustomPrefix","className","htmlFor"],Z=i.forwardRef(function(e,r){var t=e.bsPrefix,s=e.bsCustomPrefix,l=e.className,n=e.htmlFor,a=T(e,ct),u=i.useContext(q),o=u.controlId,m=u.custom,p=m?[s,"custom-file-label"]:[t,"form-file-label"],v=p[0],c=p[1];return t=L(v,c),i.createElement("label",N({},a,{ref:r,htmlFor:n||o,className:j(l,t),"data-browse":a["data-browse"]}))});Z.displayName="FormFileLabel";var dt=["id","bsPrefix","bsCustomPrefix","disabled","isValid","isInvalid","feedbackTooltip","feedback","className","style","label","children","custom","lang","data-browse","as","inputAs"],_=i.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,l=e.bsCustomPrefix,n=e.disabled,a=n===void 0?!1:n,u=e.isValid,o=u===void 0?!1:u,m=e.isInvalid,p=m===void 0?!1:m,v=e.feedbackTooltip,c=v===void 0?!1:v,f=e.feedback,g=e.className,y=e.style,b=e.label,w=e.children,I=e.custom,d=e.lang,C=e["data-browse"],P=e.as,A=P===void 0?"div":P,S=e.inputAs,h=S===void 0?"input":S,F=T(e,dt),V=I?[l,"custom"]:[s,"form-file"],M=V[0],$=V[1];s=L(M,$);var B="file",W=i.useContext(q),z=W.controlId,D=i.useMemo(function(){return{controlId:t||z,custom:I}},[z,I,t]),U=b!=null&&b!==!1&&!w,ee=i.createElement(ae,N({},F,{ref:r,isValid:o,isInvalid:p,disabled:a,as:h,lang:d}));return i.createElement(q.Provider,{value:D},i.createElement(A,{style:y,className:j(g,s,I&&"custom-"+B)},w||i.createElement(i.Fragment,null,I?i.createElement(i.Fragment,null,ee,U&&i.createElement(Z,{"data-browse":C},b)):i.createElement(i.Fragment,null,U&&i.createElement(Z,null,b),ee),(o||p)&&i.createElement(Q,{type:o?"valid":"invalid",tooltip:c},f))))});_.displayName="FormFile",_.Input=ae,_.Label=Z;var mt=["bsPrefix","bsCustomPrefix","type","size","htmlSize","id","className","isValid","isInvalid","plaintext","readOnly","custom","as"],Ne=i.forwardRef(function(e,r){var t=e.bsPrefix,s=e.bsCustomPrefix,l=e.type,n=e.size,a=e.htmlSize,u=e.id,o=e.className,m=e.isValid,p=m===void 0?!1:m,v=e.isInvalid,c=v===void 0?!1:v,f=e.plaintext,g=e.readOnly,y=e.custom,b=e.as,w=b===void 0?"input":b,I=T(e,mt),d=i.useContext(q),C=d.controlId,P=y?[s,"custom"]:[t,"form-control"],A=P[0],S=P[1];t=L(A,S);var h;if(f){var F;h=(F={},F[t+"-plaintext"]=!0,F)}else if(l==="file"){var V;h=(V={},V[t+"-file"]=!0,V)}else if(l==="range"){var M;h=(M={},M[t+"-range"]=!0,M)}else if(w==="select"&&y){var $;h=($={},$[t+"-select"]=!0,$[t+"-select-"+n]=n,$)}else{var B;h=(B={},B[t]=!0,B[t+"-"+n]=n,B)}return i.createElement(w,N({},I,{type:l,size:a,ref:r,readOnly:g,id:u||C,className:j(o,h,p&&"is-valid",c&&"is-invalid")}))});Ne.displayName="FormControl";const pt=Object.assign(Ne,{Feedback:Q});var ft=["bsPrefix","className","children","controlId","as"],we=i.forwardRef(function(e,r){var t=e.bsPrefix,s=e.className,l=e.children,n=e.controlId,a=e.as,u=a===void 0?"div":a,o=T(e,ft);t=L(t,"form-group");var m=i.useMemo(function(){return{controlId:n}},[n]);return i.createElement(q.Provider,{value:m},i.createElement(u,N({},o,{ref:r,className:j(s,t)}),l))});we.displayName="FormGroup";var vt=["as","bsPrefix","column","srOnly","className","htmlFor"],ht={column:!1,srOnly:!1},le=i.forwardRef(function(e,r){var t=e.as,s=t===void 0?"label":t,l=e.bsPrefix,n=e.column,a=e.srOnly,u=e.className,o=e.htmlFor,m=T(e,vt),p=i.useContext(q),v=p.controlId;l=L(l,"form-label");var c="col-form-label";typeof n=="string"&&(c=c+" "+c+"-"+n);var f=j(u,l,a&&"sr-only",n&&c);return o=o||v,n?i.createElement(Ce,N({ref:r,as:"label",className:f,htmlFor:o},m)):i.createElement(s,N({ref:r,className:f,htmlFor:o},m))});le.displayName="FormLabel",le.defaultProps=ht;var bt=["bsPrefix","className","as","muted"],Ie=i.forwardRef(function(e,r){var t=e.bsPrefix,s=e.className,l=e.as,n=l===void 0?"small":l,a=e.muted,u=T(e,bt);return t=L(t,"form-text"),i.createElement(n,N({},u,{ref:r,className:j(s,t,a&&"text-muted")}))});Ie.displayName="FormText";var J=i.forwardRef(function(e,r){return i.createElement(G,N({},e,{ref:r,type:"switch"}))});J.displayName="Switch",J.Input=G.Input,J.Label=G.Label;var xt=["bsPrefix","inline","className","validated","as"],gt=et("form-row"),yt={inline:!1},E=i.forwardRef(function(e,r){var t=e.bsPrefix,s=e.inline,l=e.className,n=e.validated,a=e.as,u=a===void 0?"form":a,o=T(e,xt);return t=L(t,"form"),i.createElement(u,N({},o,{ref:r,className:j(l,n&&"was-validated",s&&t+"-inline")}))});E.displayName="Form",E.defaultProps=yt,E.Row=gt,E.Group=we,E.Control=pt,E.Check=G,E.File=_,E.Switch=J,E.Label=le,E.Text=Ie;const Fe="(all)",R=new Map;R.set(Fe,O.UNKNOWN);for(const e of O.allResults)R.set(O.intToResultText[e],e);const oe="(all)";function Ct(e,r,t,s,l,n,a,u,o,m){const p=new Map,v=new Set;for(const d of r.array)d.branch===null&&(d.branch="master"),p.set(d.sourcestamp.ssid,{change:d,buildsets:new Map});const c=new Map;for(const d of e.array){if(d.sourcestamps.length===0)continue;const C=d.sourcestamps[d.sourcestamps.length-1],P=p.get(C.ssid);P!==void 0&&(P.buildsets.set(d.bsid,d),v.add(P.change.branch),!(n!==oe&&P.change.branch!==n)&&c.set(P.change.changeid,P))}let f=[...c.values()];f.sort((d,C)=>d.change.changeid-C.change.changeid),f.length>o&&(f=f.slice(f.length-o)),u||(f=f.reverse());const g=[oe,...v.keys()];g.sort((d,C)=>d.localeCompare(C));const y=new Map;for(const d of s.array){const C=y.get(d.buildsetid);C===void 0?y.set(d.buildsetid,[d]):C.push(d)}const b=new Map;for(const d of l.array){if(d.buildrequestid===null)continue;const C=b.get(d.buildrequestid);C===void 0?b.set(d.buildrequestid,[d]):C.push(d)}const w=new Map;for(const d of f)for(const C of d.buildsets.values()){const P=y.get(C.bsid);if(P!==void 0)for(const A of P){const S=(b.get(A.buildrequestid)??[]).filter(V=>a===O.UNKNOWN||V.results===a);if(S.length===0)continue;const h=t.getByIdOrNull(S[0].builderid.toString());if(h===null||!m(h.tags))continue;const F=w.get(h.builderid);F===void 0?w.set(h.builderid,{builder:h,buildsByChangeId:new Map([[d.change.changeid,S]])}):F.buildsByChangeId.set(d.change.changeid,S)}}const I=[...w.values()];return I.sort((d,C)=>d.builder.name.localeCompare(C.builder.name)),[g,f,I]}const Pt=Ee.observer(()=>{const e=O.useDataAccessor([]),r=H.useTagFilterManager("tags"),t=k.buildbotGetSettings(),s=t.getIntegerSetting("Grid.revisionLimit"),l=t.getIntegerSetting("Grid.changeFetchLimit"),n=t.getIntegerSetting("Grid.buildFetchLimit"),a=t.getBooleanSetting("Grid.fullChanges"),u=t.getBooleanSetting("Grid.leftToRight"),[o,m]=i.useState(Fe),[p,v]=i.useState(oe),c=R.get(o),f=O.useDataApiQuery(()=>O.Buildset.getAll(e,{query:{limit:n,order:"-bsid"}})),g=O.useDataApiQuery(()=>O.Change.getAll(e,{query:{limit:l,order:"-changeid"}})),y=O.useDataApiQuery(()=>O.Builder.getAll(e)),b=O.useDataApiQuery(()=>O.Buildrequest.getAll(e,{query:{limit:n,order:"-buildrequestid"}})),w=O.useDataApiQuery(()=>O.Build.getAll(e,{query:{limit:n,order:"-buildrequestid"}}));if(!(f.resolved&&g.resolved&&y.resolved&&b.resolved&&w.resolved))return x.jsx("div",{className:"bb-grid-container",children:x.jsx(H.LoadingIndicator,{})});if(g.array.length===0)return x.jsx("div",{className:"bb-grid-container",children:x.jsxs("p",{children:["No changes. Grid View needs a changesource to be setup, and ",x.jsx(ue.Link,{to:"/changes",children:" changes"})," to be in the system."]})});const[d,C,P]=Ct(f,g,y,b,w,p,c,u,s,h=>r.shouldShowByTags(h)),A=C.slice().sort((h,F)=>F.change.changeid-h.change.changeid).map(h=>x.jsx("th",{className:"change",children:x.jsx(H.ChangeDetails,{change:h.change,compact:!a,showDetails:!1,setShowDetails:()=>{}})})),S=P.map(h=>{const F=h.builder,V=h.buildsByChangeId,M=C.map($=>{const B=$.change,W=[...V.get(B.changeid)??[]];return W.sort((z,D)=>z.buildid-D.buildid),x.jsx("td",{children:W.map(z=>x.jsx(H.BuildLinkWithSummaryTooltip,{build:z},z.id))},B.changeid)});return x.jsxs("tr",{children:[x.jsx("th",{children:x.jsx(ue.Link,{to:`/builders/${F.builderid}`,children:F.name})}),x.jsx("td",{children:r.getElementsForTags(F.tags)}),M]},F.name)});return x.jsxs("div",{className:"container grid",children:[x.jsxs(E,{inline:!0,className:"mb-sm-2",children:[x.jsx(E.Label,{className:"mr-sm-2",children:"Branch"}),x.jsx(E.Control,{className:"mr-sm-2",as:"select",multiple:!1,value:p,onChange:h=>v(h.target.value),children:d.map(h=>x.jsx("option",{children:h}))}),x.jsx(E.Label,{className:"mr-sm-2",children:"Results"}),x.jsx(E.Control,{className:"mr-sm-2",as:"select",multiple:!1,value:o,onChange:h=>m(h.target.value),children:[...R.keys()].map(h=>x.jsx("option",{children:h}))})]}),x.jsxs("table",{className:"table table-condensed table-striped table-hover",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{children:"Builder"}),x.jsxs("th",{children:[r.getFiltersHelpElement(),r.getEnabledFiltersElements()]}),A]})}),x.jsx("tbody",{children:S})]})]})});k.buildbotSetupPlugin(e=>{e.registerMenuGroup({name:"grid",caption:"Grid View",icon:x.jsx(Qe,{}),order:4,route:"/grid",parentName:null}),e.registerRoute({route:"/grid",group:"grid",element:()=>x.jsx(Pt,{})}),e.registerSettingGroup({name:"Grid",caption:"Grid related settings",items:[{type:"boolean",name:"fullChanges",caption:"Show avatar and time ago in change details",defaultValue:!1},{type:"boolean",name:"leftToRight",caption:"Show most recent changes on the right",defaultValue:!1},{type:"integer",name:"revisionLimit",caption:"Maximum number of revisions to display",defaultValue:5},{type:"integer",name:"changeFetchLimit",caption:"Maximum number of changes to fetch",defaultValue:100},{type:"integer",name:"buildFetchLimit",caption:"Maximum number of builds to fetch",defaultValue:1e3}]})})});
