mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-31 17:10:11 +08:00
2 lines
183 KiB
JavaScript
2 lines
183 KiB
JavaScript
(this.webpackJsonpui=this.webpackJsonpui||[]).push([[0],{803:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),c=a(28),s=a.n(c),i=a(887),o=a(27),l=a(113),u=a(2),d=a(6),j=a(40),b=a(42),p=a(845),h=a(879),O=a(884),f=a(885),x=a(877),g=a(811),k=a(812),v=a(874),y=a(875),m=a(886),S=a(814),T=a(118),_=a(848),A=a(813),E=a(347),C=a.n(E),R=a(349),I=a.n(R),w=a(352),q=a.n(w),P=a(354),N=a.n(P),D=a(351),L=a.n(D),B=a(355),H=a.n(B),U=a(353),K=a.n(U),z=a(350),G=a.n(z),V=a(348),M=a.n(V),Q={HOME:"".concat(window.ROOT_PATH,"/"),SETTINGS:"".concat(window.ROOT_PATH,"/settings"),SERVERS:"".concat(window.ROOT_PATH,"/servers"),SCHEDULERS:"".concat(window.ROOT_PATH,"/schedulers"),QUEUE_DETAILS:"".concat(window.ROOT_PATH,"/queues/:qname"),REDIS:"".concat(window.ROOT_PATH,"/redis"),TASK_DETAILS:"".concat(window.ROOT_PATH,"/queues/:qname/tasks/:taskId"),METRICS:"".concat(window.ROOT_PATH,"/metrics")};function W(e,t){var a=Q.QUEUE_DETAILS.replace(":qname",e);return t?"".concat(a,"?status=").concat(t):a}function F(e,t){return Q.TASK_DETAILS.replace(":qname",e).replace(":taskId",t)}var Y=a(356),J="POLL_INTERVAL_CHANGE",X="THEME_PREFERENCE_CHANGE",$="TOGGLE_DRAWER",Z="TASK_ROWS_PER_PAGE_CHANGE",ee="DAILY_STATS_KEY_CHANGE";function te(e){return{type:Z,value:e}}var ae=a(847),ne=a(45),re=a(245),ce=a.n(re),se=a(247),ie=a.n(se),oe=a(246),le=a.n(oe),ue=a(244),de=a.n(ue),je=a(1),be=Object(p.a)((function(e){return Object(ae.a)({root:{flexShrink:0,marginLeft:e.spacing(2.5)}})}));var pe=function(e){var t=be(),a=Object(ne.a)(),n=e.count,r=e.page,c=e.rowsPerPage,s=e.onPageChange;return Object(je.jsxs)("div",{className:t.root,children:[Object(je.jsx)(_.a,{onClick:function(e){s(e,0)},disabled:0===r,"aria-label":"first page",children:"rtl"===a.direction?Object(je.jsx)(de.a,{}):Object(je.jsx)(ce.a,{})}),Object(je.jsx)(_.a,{onClick:function(e){s(e,r-1)},disabled:0===r,"aria-label":"previous page",children:"rtl"===a.direction?Object(je.jsx)(le.a,{}):Object(je.jsx)(ie.a,{})}),Object(je.jsx)(_.a,{onClick:function(e){s(e,r+1)},disabled:r>=Math.ceil(n/c)-1,"aria-label":"next page",children:"rtl"===a.direction?Object(je.jsx)(ie.a,{}):Object(je.jsx)(le.a,{})}),Object(je.jsx)(_.a,{onClick:function(e){s(e,Math.max(0,Math.ceil(n/c)-1))},disabled:r>=Math.ceil(n/c)-1,"aria-label":"last page",children:"rtl"===a.direction?Object(je.jsx)(ce.a,{}):Object(je.jsx)(de.a,{})})]})},he=[10,20,30,60,100],Oe=a(870),fe=a(871),xe=a(167),ge=a(250),ke=a.n(ge),ve=a(890),ye=a(872),me=a(4),Se=a.n(me),Te=a(10),_e=a(19),Ae=a.n(_e),Ee=a(126),Ce=a.n(Ee),Re="".concat(window.ROOT_PATH,"/api");function Ie(){return we.apply(this,arguments)}function we(){return(we=Object(Te.a)(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"get",url:"".concat(Re,"/queues")});case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qe(e){return Pe.apply(this,arguments)}function Pe(){return(Pe=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t)});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(e){return De.apply(this,arguments)}function De(){return(De=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,":pause")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(e){return Be.apply(this,arguments)}function Be(){return(Be=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,":resume")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function He(){return Ue.apply(this,arguments)}function Ue(){return(Ue=Object(Te.a)(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"get",url:"".concat(Re,"/queue_stats")});case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ke(e,t){return ze.apply(this,arguments)}function ze(){return(ze=Object(Te.a)(Se.a.mark((function e(t,a){var n,r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(Re,"/queues/").concat(t,"/tasks/").concat(a),e.next=3,Ae()({method:"get",url:n});case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(e,t){return Ve.apply(this,arguments)}function Ve(){return(Ve=Object(Te.a)(Se.a.mark((function e(t,a){var n,r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(Re,"/queues/").concat(t,"/active_tasks"),a&&(n+="?".concat(Ce.a.stringify(a))),e.next=4,Ae()({method:"get",url:n});case 4:return r=e.sent,e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(e,t){return Qe.apply(this,arguments)}function Qe(){return(Qe=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/active_tasks/").concat(a,":cancel")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(e){return Fe.apply(this,arguments)}function Fe(){return(Fe=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/active_tasks:cancel_all")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(e,t){return Je.apply(this,arguments)}function Je(){return(Je=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/active_tasks:batch_cancel"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xe(e,t){return $e.apply(this,arguments)}function $e(){return($e=Object(Te.a)(Se.a.mark((function e(t,a){var n,r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(Re,"/queues/").concat(t,"/pending_tasks"),a&&(n+="?".concat(Ce.a.stringify(a))),e.next=4,Ae()({method:"get",url:n});case 4:return r=e.sent,e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ze(e,t){return et.apply(this,arguments)}function et(){return(et=Object(Te.a)(Se.a.mark((function e(t,a){var n,r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(Re,"/queues/").concat(t,"/scheduled_tasks"),a&&(n+="?".concat(Ce.a.stringify(a))),e.next=4,Ae()({method:"get",url:n});case 4:return r=e.sent,e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tt(e,t){return at.apply(this,arguments)}function at(){return(at=Object(Te.a)(Se.a.mark((function e(t,a){var n,r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(Re,"/queues/").concat(t,"/retry_tasks"),a&&(n+="?".concat(Ce.a.stringify(a))),e.next=4,Ae()({method:"get",url:n});case 4:return r=e.sent,e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nt(e,t){return rt.apply(this,arguments)}function rt(){return(rt=Object(Te.a)(Se.a.mark((function e(t,a){var n,r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(Re,"/queues/").concat(t,"/archived_tasks"),a&&(n+="?".concat(Ce.a.stringify(a))),e.next=4,Ae()({method:"get",url:n});case 4:return r=e.sent,e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ct(e,t){return st.apply(this,arguments)}function st(){return(st=Object(Te.a)(Se.a.mark((function e(t,a){var n,r;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(Re,"/queues/").concat(t,"/completed_tasks"),a&&(n+="?".concat(Ce.a.stringify(a))),e.next=4,Ae()({method:"get",url:n});case 4:return r=e.sent,e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function it(e,t){return ot.apply(this,arguments)}function ot(){return(ot=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/pending_tasks/").concat(a,":archive")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lt(e,t){return ut.apply(this,arguments)}function ut(){return(ut=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/pending_tasks:batch_archive"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dt(e){return jt.apply(this,arguments)}function jt(){return(jt=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/pending_tasks:archive_all")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bt(e,t){return pt.apply(this,arguments)}function pt(){return(pt=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/pending_tasks/").concat(a)});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ht(e,t){return Ot.apply(this,arguments)}function Ot(){return(Ot=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/pending_tasks:batch_delete"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ft(e){return xt.apply(this,arguments)}function xt(){return(xt=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/pending_tasks:delete_all")});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gt(e,t){return kt.apply(this,arguments)}function kt(){return(kt=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks/").concat(a,":run")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vt(e,t){return yt.apply(this,arguments)}function yt(){return(yt=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks/").concat(a,":archive")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mt(e,t){return St.apply(this,arguments)}function St(){return(St=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks/").concat(a)});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tt(e,t){return _t.apply(this,arguments)}function _t(){return(_t=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks:batch_delete"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(e){return Et.apply(this,arguments)}function Et(){return(Et=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks:delete_all")});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ct(e,t){return Rt.apply(this,arguments)}function Rt(){return(Rt=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks:batch_run"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(e){return wt.apply(this,arguments)}function wt(){return(wt=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks:run_all")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qt(e,t){return Pt.apply(this,arguments)}function Pt(){return(Pt=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks:batch_archive"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(e){return Dt.apply(this,arguments)}function Dt(){return(Dt=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/scheduled_tasks:archive_all")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lt(e,t){return Bt.apply(this,arguments)}function Bt(){return(Bt=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks/").concat(a,":run")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ht(e,t){return Ut.apply(this,arguments)}function Ut(){return(Ut=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks/").concat(a,":archive")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kt(e,t){return zt.apply(this,arguments)}function zt(){return(zt=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks/").concat(a)});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gt(e,t){return Vt.apply(this,arguments)}function Vt(){return(Vt=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks:batch_delete"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(e){return Qt.apply(this,arguments)}function Qt(){return(Qt=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks:delete_all")});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wt(e,t){return Ft.apply(this,arguments)}function Ft(){return(Ft=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks:batch_run"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yt(e){return Jt.apply(this,arguments)}function Jt(){return(Jt=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks:run_all")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xt(e,t){return $t.apply(this,arguments)}function $t(){return($t=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks:batch_archive"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zt(e){return ea.apply(this,arguments)}function ea(){return(ea=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/retry_tasks:archive_all")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ta(e,t){return aa.apply(this,arguments)}function aa(){return(aa=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/archived_tasks/").concat(a,":run")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function na(e,t){return ra.apply(this,arguments)}function ra(){return(ra=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/archived_tasks/").concat(a)});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ca(e,t){return sa.apply(this,arguments)}function sa(){return(sa=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/archived_tasks:batch_delete"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ia(e){return oa.apply(this,arguments)}function oa(){return(oa=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/archived_tasks:delete_all")});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function la(e,t){return ua.apply(this,arguments)}function ua(){return(ua=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/archived_tasks:batch_run"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function da(e){return ja.apply(this,arguments)}function ja(){return(ja=Object(Te.a)(Se.a.mark((function e(t){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/archived_tasks:run_all")});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ba(e,t){return pa.apply(this,arguments)}function pa(){return(pa=Object(Te.a)(Se.a.mark((function e(t,a){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/completed_tasks/").concat(a)});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ha(e,t){return Oa.apply(this,arguments)}function Oa(){return(Oa=Object(Te.a)(Se.a.mark((function e(t,a){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"post",url:"".concat(Re,"/queues/").concat(t,"/completed_tasks:batch_delete"),data:{task_ids:a}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fa(e){return xa.apply(this,arguments)}function xa(){return(xa=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"delete",url:"".concat(Re,"/queues/").concat(t,"/completed_tasks:delete_all")});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ga(){return ka.apply(this,arguments)}function ka(){return(ka=Object(Te.a)(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"get",url:"".concat(Re,"/servers")});case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function va(){return ya.apply(this,arguments)}function ya(){return(ya=Object(Te.a)(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"get",url:"".concat(Re,"/scheduler_entries")});case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ma(e){return Sa.apply(this,arguments)}function Sa(){return(Sa=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"get",url:"".concat(Re,"/scheduler_entries/").concat(t,"/enqueue_events")});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ta(){return _a.apply(this,arguments)}function _a(){return(_a=Object(Te.a)(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ae()({method:"get",url:"".concat(Re,"/redis_info")});case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Aa(e){var t=e.response;return t?"".concat(t.status," (").concat(t.statusText,"): ").concat(t.data):"error: no error response data available"}function Ea(e){var t=e.response;return t?t.data:"Unknown error occurred. See the logs for details."}function Ca(e){var t=Math.floor(e/3600),a=Math.floor((e-3600*t)/60);return{hour:t,minute:a,second:e-3600*t-60*a,totalSeconds:e}}function Ra(e,t){var a=e-t;return Ca(Math.floor(a/1e3))}function Ia(e){if(e.hour>24){var t=Math.floor(e.hour/24);return t+(1===t?" day":" days")}return(0!==e.hour?"".concat(e.hour,"h"):"")+(0!==e.minute?"".concat(e.minute,"m"):"")+"".concat(e.second,"s")}function wa(e){try{var t=Ra(Date.parse(e),Date.now());return t.totalSeconds<1?"now":"in "+Ia(t)}catch(a){return"-"}}function qa(e){try{return Pa(Date.parse(e)/1e3)}catch(t){return console.error("Could not parse timestamp: ",e,t),"-"}}function Pa(e){return 0===e?"":Ia(Ra(Date.now(),1e3*e))+" ago"}function Na(e){var t=e.indexOf("-");return-1===t?e:e.substr(0,t)}function Da(e,t){if(0===t)return"0.00%";var a=(e/t*100).toFixed(2);return"".concat(a," %")}var La="LIST_QUEUES_BEGIN",Ba="LIST_QUEUES_SUCCESS",Ha="LIST_QUEUES_ERROR",Ua="DELETE_QUEUE_BEGIN",Ka="DELETE_QUEUE_SUCCESS",za="DELETE_QUEUE_ERROR",Ga="PAUSE_QUEUE_BEGIN",Va="PAUSE_QUEUE_SUCCESS",Ma="PAUSE_QUEUE_ERROR",Qa="RESUME_QUEUE_BEGIN",Wa="RESUME_QUEUE_SUCCESS",Fa="RESUME_QUEUE_ERROR";function Ya(){return function(){var e=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:La}),e.prev=1,e.next=4,Ie();case 4:a=e.sent,t({type:Ba,payload:a}),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.error("listQueuesAsync: ".concat(Aa(e.t0))),t({type:Ha,error:Ea(e.t0)});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()}function Ja(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:Ua,queue:e}),t.prev=1,t.next=4,qe(e);case 4:a({type:Ka,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0),a({type:za,queue:e,error:Ea(t.t0)});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()}var Xa="LIST_QUEUE_STATS_BEGIN",$a="LIST_QUEUE_STATS_SUCCESS",Za="LIST_QUEUE_STATS_ERROR";var en=a(849),tn=a(850),an=a(853),nn=a(203),rn=a(204),cn=a(165),sn=a(162),on=a(360);var ln=function(e){var t=Object(b.f)();return Object(je.jsx)(en.a,{children:Object(je.jsxs)(tn.a,{data:e.data,maxBarSize:120,onClick:function(a){var n=e.data.map((function(e){return e.queue}));a&&a.activeLabel&&n.includes(a.activeLabel)&&t.push(W(a.activeLabel))},style:{cursor:"pointer"},children:[Object(je.jsx)(an.a,{strokeDasharray:"3 3"}),Object(je.jsx)(nn.a,{dataKey:"queue"}),Object(je.jsx)(rn.a,{}),Object(je.jsx)(cn.a,{}),Object(je.jsx)(sn.a,{}),Object(je.jsx)(on.a,{dataKey:"active",stackId:"a",fill:"#1967d2"}),Object(je.jsx)(on.a,{dataKey:"pending",stackId:"a",fill:"#669df6"}),Object(je.jsx)(on.a,{dataKey:"scheduled",stackId:"a",fill:"#fdd663"}),Object(je.jsx)(on.a,{dataKey:"retry",stackId:"a",fill:"#f666a9"}),Object(je.jsx)(on.a,{dataKey:"archived",stackId:"a",fill:"#ac4776"}),Object(je.jsx)(on.a,{dataKey:"completed",stackId:"a",fill:"#4bb543"})]})})};var un=function(e){var t=Object(ne.a)();return Object(je.jsx)(en.a,{children:Object(je.jsxs)(tn.a,{data:e.data,maxBarSize:120,children:[Object(je.jsx)(an.a,{strokeDasharray:"3 3"}),Object(je.jsx)(nn.a,{dataKey:"queue"}),Object(je.jsx)(rn.a,{}),Object(je.jsx)(cn.a,{}),Object(je.jsx)(sn.a,{}),Object(je.jsx)(on.a,{dataKey:"succeeded",stackId:"a",fill:t.palette.success.light}),Object(je.jsx)(on.a,{dataKey:"failed",stackId:"a",fill:t.palette.error.light})]})})},dn=a(14),jn=a(99),bn=a(860),pn=a(864),hn=a(863),On=a(859),fn=a(861),xn=a(862),gn=a(896),kn=a(865),vn=a(332),yn=a.n(vn),mn=a(331),Sn=a.n(mn),Tn=a(53),_n=a.n(Tn),An=a(56),En=a.n(An),Cn=a(808),Rn=a(854),In=a(858),wn=a(856),qn=a(857),Pn=a(855);var Nn,Dn=Object(o.b)((function(e,t){var a=!1;if(null!==t.queue){var n=e.queues.data.find((function(e){var a;return e.name===(null===(a=t.queue)||void 0===a?void 0:a.queue)}));void 0!==n&&(a=n.requestPending)}return{requestPending:a}}),{deleteQueueAsync:Ja})((function(e){return Object(je.jsx)(Rn.a,{open:null!==e.queue,onClose:e.onClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:null!==e.queue&&(e.queue.size>0?Object(je.jsxs)(je.Fragment,{children:[Object(je.jsx)(Pn.a,{id:"alert-dialog-title",children:"Queue is not empty"}),Object(je.jsx)(wn.a,{children:Object(je.jsxs)(qn.a,{id:"alert-dialog-description",children:['You are trying to delete a non-emtpy queue "',e.queue.queue,'". Please empty the queue first before deleting.']})}),Object(je.jsx)(In.a,{children:Object(je.jsx)(Cn.a,{onClick:e.onClose,color:"primary",children:"OK"})})]}):Object(je.jsxs)(je.Fragment,{children:[Object(je.jsxs)(Pn.a,{id:"alert-dialog-title",children:['Are you sure you want to delete "',e.queue.queue,'"?']}),Object(je.jsx)(wn.a,{children:Object(je.jsx)(qn.a,{id:"alert-dialog-description",children:"You can't undo this action."})}),Object(je.jsxs)(In.a,{children:[Object(je.jsx)(Cn.a,{onClick:e.onClose,disabled:e.requestPending,color:"primary",children:"Cancel"}),Object(je.jsx)(Cn.a,{onClick:function(){e.queue&&(e.deleteQueueAsync(e.queue.queue),e.onClose())},disabled:e.requestPending,color:"primary",autoFocus:!0,children:"Delete"})]})]}))})}));!function(e){e.Asc="asc",e.Desc="desc"}(Nn||(Nn={}));var Ln,Bn=a(207),Hn=a.n(Bn),Un=Object(p.a)((function(e){return{table:{minWidth:650},fixedCell:{position:"sticky",zIndex:1,left:0,background:e.palette.background.paper}}}));!function(e){e[e.Queue=0]="Queue",e[e.State=1]="State",e[e.Size=2]="Size",e[e.MemoryUsage=3]="MemoryUsage",e[e.Processed=4]="Processed",e[e.Failed=5]="Failed",e[e.ErrorRate=6]="ErrorRate",e[e.None=7]="None"}(Ln||(Ln={}));var Kn=[{label:"Queue",key:"queue",sortBy:Ln.Queue,align:"left"},{label:"State",key:"state",sortBy:Ln.State,align:"left"},{label:"Size",key:"size",sortBy:Ln.Size,align:"right"},{label:"Memory usage",key:"memory_usage",sortBy:Ln.MemoryUsage,align:"right"},{label:"Processed",key:"processed",sortBy:Ln.Processed,align:"right"},{label:"Failed",key:"failed",sortBy:Ln.Failed,align:"right"},{label:"Error rate",key:"error_rate",sortBy:Ln.ErrorRate,align:"right"},{label:"Actions",key:"actions",sortBy:Ln.None,align:"center"}];function zn(e,t){var a=Object(jn.a)(e);return a.sort(t),a}function Gn(e){var t=Un(),a=Object(n.useState)(Ln.Queue),c=Object(dn.a)(a,2),s=c[0],i=c[1],o=Object(n.useState)(Nn.Asc),l=Object(dn.a)(o,2),u=l[0],j=l[1],b=Object(n.useState)(null),p=Object(dn.a)(b,2),h=p[0],O=p[1];return Object(je.jsxs)(r.a.Fragment,{children:[Object(je.jsx)(On.a,{children:Object(je.jsxs)(bn.a,{className:t.table,"aria-label":"queues overview table",children:[Object(je.jsx)(fn.a,{children:Object(je.jsx)(xn.a,{children:Kn.map((function(e,a){return Object(je.jsx)(hn.a,{align:e.align,className:Object(d.default)(0===a&&t.fixedCell),children:e.sortBy!==Ln.None?Object(je.jsx)(gn.a,{active:s===e.sortBy,direction:u,onClick:(n=e.sortBy,function(e){if(n===s){var t=u===Nn.Asc?Nn.Desc:Nn.Asc;j(t)}else i(n)}),children:e.label}):Object(je.jsx)("div",{children:e.label})},e.key);var n}))})}),Object(je.jsx)(pn.a,{children:zn(e.queues,(function(e,t){var a;switch(s){case Ln.Queue:if(e.queue===t.queue)return 0;a=e.queue<t.queue;break;case Ln.State:if(e.paused===t.paused)return 0;a=!e.paused;break;case Ln.Size:if(e.size===t.size)return 0;a=e.size<t.size;break;case Ln.MemoryUsage:if(e.memory_usage_bytes===t.memory_usage_bytes)return 0;a=e.memory_usage_bytes<t.memory_usage_bytes;break;case Ln.Processed:if(e.processed===t.processed)return 0;a=e.processed<t.processed;break;case Ln.Failed:if(e.failed===t.failed)return 0;a=e.failed<t.failed;break;case Ln.ErrorRate:var n=e.failed/e.processed,r=t.failed/t.processed;if(n===r)return 0;a=n<r;break;default:throw"Unexpected order by value: ".concat(s)}return u===Nn.Asc?a?-1:1:a?1:-1})).map((function(t){return Object(je.jsx)(Mn,{queue:t,onPauseClick:function(){return e.onPauseClick(t.queue)},onResumeClick:function(){return e.onResumeClick(t.queue)},onDeleteClick:function(){return O(t)}},t.queue)}))})]})}),Object(je.jsx)(Dn,{onClose:function(){O(null)},queue:h})]})}var Vn=Object(p.a)((function(e){return{row:{"&:last-child td":{borderBottomWidth:0},"&:last-child th":{borderBottomWidth:0}},linkText:{textDecoration:"none",color:e.palette.text.primary,"&:hover":{textDecoration:"underline"}},textGreen:{color:e.palette.success.dark},textRed:{color:e.palette.error.dark},boldCell:{fontWeight:600},fixedCell:{position:"sticky",zIndex:1,left:0,background:e.palette.background.paper},actionIconsContainer:{display:"flex",justifyContent:"center",minWidth:"100px"}}}));function Mn(e){var t=Vn(),a=e.queue,c=Object(n.useState)(!1),s=Object(dn.a)(c,2),i=s[0],o=s[1];return Object(je.jsxs)(xn.a,{className:t.row,children:[Object(je.jsx)(hn.a,{component:"th",scope:"row",className:Object(d.default)(t.boldCell,t.fixedCell),children:Object(je.jsx)(j.b,{to:W(a.queue),className:t.linkText,children:a.queue})}),Object(je.jsx)(hn.a,{children:a.paused?Object(je.jsx)("span",{className:t.textRed,children:"paused"}):Object(je.jsx)("span",{className:t.textGreen,children:"run"})}),Object(je.jsx)(hn.a,{align:"right",children:a.size}),Object(je.jsx)(hn.a,{align:"right",children:Hn()(a.memory_usage_bytes)}),Object(je.jsx)(hn.a,{align:"right",children:a.processed}),Object(je.jsx)(hn.a,{align:"right",children:a.failed}),Object(je.jsx)(hn.a,{align:"right",children:Da(a.failed,a.processed)}),Object(je.jsx)(hn.a,{align:"center",onMouseEnter:function(){return o(!0)},onMouseLeave:function(){return o(!1)},children:Object(je.jsx)("div",{className:t.actionIconsContainer,children:i?Object(je.jsxs)(r.a.Fragment,{children:[a.paused?Object(je.jsx)(kn.a,{title:"Resume",children:Object(je.jsx)(_.a,{color:"secondary",onClick:e.onResumeClick,disabled:a.requestPending,size:"small",children:Object(je.jsx)(Sn.a,{fontSize:"small"})})}):Object(je.jsx)(kn.a,{title:"Pause",children:Object(je.jsx)(_.a,{color:"primary",onClick:e.onPauseClick,disabled:a.requestPending,size:"small",children:Object(je.jsx)(yn.a,{fontSize:"small"})})}),Object(je.jsx)(kn.a,{title:"Delete",children:Object(je.jsx)(_.a,{onClick:e.onDeleteClick,size:"small",children:Object(je.jsx)(_n.a,{fontSize:"small"})})})]}):Object(je.jsx)(_.a,{size:"small",children:Object(je.jsx)(En.a,{fontSize:"small"})})})})]},a.queue)}var Qn=a(9),Wn=Object(Qn.a)((function(e){return{tooltip:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",maxWidth:400,fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9"}}}))(kn.a),Fn=a(866),Yn=a(333),Jn=a.n(Yn),Xn=a(810),$n=a(366),Zn=a(809),er=a(868),tr=a(867),ar=Object(p.a)((function(e){return{popper:{zIndex:2},buttonContained:{backgroundColor:fr(e)?"#303030":e.palette.background.default,color:e.palette.text.primary,"&:hover":{backgroundColor:e.palette.action.hover}}}}));function nr(e){var t=ar(),a=r.a.useState(!1),n=Object(dn.a)(a,2),c=n[0],s=n[1],i=r.a.useRef(null),o=r.a.useState(e.initialSelectedKey),l=Object(dn.a)(o,2),d=l[0],j=l[1],b=function(e){i.current&&i.current.contains(e.target)||s(!1)},p=e.options.find((function(e){return e.key===d}));return Object(je.jsxs)(je.Fragment,{children:[Object(je.jsxs)(Fn.a,{variant:"contained",ref:i,"aria-label":"split button",size:"small",disableElevation:!0,children:[Object(je.jsx)(Cn.a,{classes:{contained:t.buttonContained},children:p?p.label:"Select Option"}),Object(je.jsx)(Cn.a,{size:"small","aria-controls":c?"split-button-menu":void 0,"aria-expanded":c?"true":void 0,"aria-label":"select option","aria-haspopup":"menu",onClick:function(){s((function(e){return!e}))},classes:{contained:t.buttonContained},children:Object(je.jsx)(Jn.a,{})})]}),Object(je.jsx)(Zn.a,{open:c,anchorEl:i.current,role:void 0,transition:!0,disablePortal:!0,className:t.popper,children:function(t){var a=t.TransitionProps,n=t.placement;return Object(je.jsx)($n.a,Object(u.a)(Object(u.a)({},a),{},{style:{transformOrigin:"bottom"===n?"center top":"center bottom"},children:Object(je.jsx)(xe.a,{children:Object(je.jsx)(Xn.a,{onClickAway:b,children:Object(je.jsx)(tr.a,{id:"split-button-menu",children:e.options.map((function(t){return Object(je.jsx)(er.a,{selected:t.key===d,onClick:function(a){return n=t.key,j(n),s(!1),void e.onSelect(n);var n},children:t.label},t.key)}))})})})}))}})]})}function rr(e,t){Object(n.useEffect)((function(){e();var a=setInterval(e,1e3*t);return function(){return clearInterval(a)}}),[t,e])}var cr=a(43),sr=a(869),ir=a(334);function or(e){var t=function(e,t){var a={};for(var n in e){var r,c=Object(cr.a)(e[n]);try{for(c.s();!(r=c.n()).done;){var s=r.value;a.hasOwnProperty(s.date)||(a[s.date]={succeeded:0,failed:0,date:s.date}),a[s.date].succeeded+=s.processed-s.failed,a[s.date].failed+=s.failed}}catch(i){c.e(i)}finally{c.f()}}return Object.values(a).sort(lr).slice(-t)}(e.data,e.numDays),a=Object(ne.a)();return Object(je.jsx)(en.a,{children:Object(je.jsxs)(sr.a,{data:t,children:[Object(je.jsx)(an.a,{strokeDasharray:"3 3"}),Object(je.jsx)(nn.a,{dataKey:"date",minTickGap:10}),Object(je.jsx)(rn.a,{}),Object(je.jsx)(cn.a,{}),Object(je.jsx)(sn.a,{}),Object(je.jsx)(ir.a,{type:"monotone",dataKey:"succeeded",stroke:a.palette.success.main}),Object(je.jsx)(ir.a,{type:"monotone",dataKey:"failed",stroke:a.palette.error.main})]})})}function lr(e,t){return Date.parse(e.date)-Date.parse(t.date)}var ur=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(4),paddingBottom:e.spacing(4)},paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column"},chartHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:e.spacing(2)},chartHeaderTitle:{display:"flex",alignItems:"center"},chartContainer:{width:"100%",height:"300px"},infoIcon:{marginLeft:e.spacing(1),color:e.palette.grey[500],cursor:"pointer"},tooltipSection:{marginBottom:"4px"},tableContainer:{marginBottom:e.spacing(2)}}}));var dr={listQueuesAsync:Ya,pauseQueueAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:Ga,queue:e}),t.prev=1,t.next=4,Ne(e);case 4:a({type:Va,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("pauseQueueAsynq: ",Aa(t.t0)),a({type:Ma,queue:e,error:Ea(t.t0)});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},resumeQueueAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:Qa,queue:e}),t.prev=1,t.next=4,Le(e);case 4:a({type:Wa,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("resumeQueueAsync: ",Aa(t.t0)),a({type:Fa,queue:e,error:Ea(t.t0)});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},deleteQueueAsync:Ja,listQueueStatsAsync:function(){return function(){var e=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:Xa}),e.prev=1,e.next=4,He();case 4:a=e.sent,t({type:$a,payload:a}),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.error("listQueueStatsAsync: ",Aa(e.t0)),t({type:Za,error:Ea(e.t0)});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()},dailyStatsKeyChange:function(e){return{type:ee,value:e}}};var jr,br=Object(o.b)((function(e){return{loading:e.queues.loading,queues:e.queues.data.map((function(e){return Object(u.a)(Object(u.a)({},e.currentStats),{},{requestPending:e.requestPending})})),error:e.queues.error,pollInterval:e.settings.pollInterval,queueStats:e.queueStats.data,dailyStatsKey:e.settings.dailyStatsChartType}}),dr)((function(e){var t=e.pollInterval,a=e.listQueuesAsync,r=e.queues,c=e.listQueueStatsAsync,s=e.dailyStatsKey,i=ur();rr(a,t);var o=r.map((function(e){return e.queue})).sort().join(",");Object(n.useEffect)((function(){c()}),[c,o]);var l=r.map((function(e){return{queue:e.queue,succeeded:e.processed-e.failed,failed:e.failed}}));return Object(je.jsx)(Oe.a,{maxWidth:"lg",className:i.container,children:Object(je.jsxs)(fe.a,{container:!0,spacing:3,children:[e.error.length>0&&Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsxs)(ve.a,{severity:"error",children:[Object(je.jsx)(ye.a,{children:"Error"}),"Could not retrieve queues live data \u2014"," ",Object(je.jsx)("strong",{children:"See the logs for details"})]})}),Object(je.jsx)(fe.a,{item:!0,xs:6,children:Object(je.jsxs)(xe.a,{className:i.paper,variant:"outlined",children:[Object(je.jsx)("div",{className:i.chartHeader,children:Object(je.jsxs)("div",{className:i.chartHeaderTitle,children:[Object(je.jsx)(T.a,{variant:"h6",children:"Queue Size"}),Object(je.jsx)(Wn,{title:Object(je.jsxs)("div",{children:[Object(je.jsx)("div",{className:i.tooltipSection,children:"Total number of tasks in the queue"}),Object(je.jsxs)("div",{className:i.tooltipSection,children:[Object(je.jsx)("strong",{children:"Active"}),": number of tasks currently being processed"]}),Object(je.jsxs)("div",{className:i.tooltipSection,children:[Object(je.jsx)("strong",{children:"Pending"}),": number of tasks ready to be processed"]}),Object(je.jsxs)("div",{className:i.tooltipSection,children:[Object(je.jsx)("strong",{children:"Scheduled"}),": number of tasks scheduled to be processed in the future"]}),Object(je.jsxs)("div",{className:i.tooltipSection,children:[Object(je.jsx)("strong",{children:"Retry"}),": number of tasks scheduled to be retried in the future"]}),Object(je.jsxs)("div",{children:[Object(je.jsx)("strong",{children:"Archived"}),": number of tasks exhausted their retries"]})]}),children:Object(je.jsx)(ke.a,{fontSize:"small",className:i.infoIcon})})]})}),Object(je.jsx)("div",{className:i.chartContainer,children:Object(je.jsx)(ln,{data:r})})]})}),Object(je.jsx)(fe.a,{item:!0,xs:6,children:Object(je.jsxs)(xe.a,{className:i.paper,variant:"outlined",children:[Object(je.jsxs)("div",{className:i.chartHeader,children:[Object(je.jsxs)("div",{className:i.chartHeaderTitle,children:[Object(je.jsx)(T.a,{variant:"h6",children:"Tasks Processed"}),Object(je.jsx)(Wn,{title:Object(je.jsxs)("div",{children:[Object(je.jsx)("div",{className:i.tooltipSection,children:"Total number of tasks processed in a given day (UTC)"}),Object(je.jsxs)("div",{className:i.tooltipSection,children:[Object(je.jsx)("strong",{children:"Succeeded"}),": number of tasks successfully processed"]}),Object(je.jsxs)("div",{children:[Object(je.jsx)("strong",{children:"Failed"}),": number of tasks failed to be processed"]})]}),children:Object(je.jsx)(ke.a,{fontSize:"small",className:i.infoIcon})})]}),Object(je.jsx)("div",{children:Object(je.jsx)(nr,{options:[{label:"Today",key:"today"},{label:"Last 7d",key:"last-7d"},{label:"Last 30d",key:"last-30d"},{label:"Last 90d",key:"last-90d"}],initialSelectedKey:s,onSelect:function(t){return e.dailyStatsKeyChange(t)}})})]}),Object(je.jsxs)("div",{className:i.chartContainer,children:["today"===s&&Object(je.jsx)(un,{data:l}),"last-7d"===s&&Object(je.jsx)(or,{data:e.queueStats,numDays:7}),"last-30d"===s&&Object(je.jsx)(or,{data:e.queueStats,numDays:30}),"last-90d"===s&&Object(je.jsx)(or,{data:e.queueStats,numDays:90})]})]})}),Object(je.jsx)(fe.a,{item:!0,xs:12,className:i.tableContainer,children:Object(je.jsx)(xe.a,{className:i.paper,variant:"outlined",children:Object(je.jsx)(Gn,{queues:r,onPauseClick:e.pauseQueueAsync,onResumeClick:e.resumeQueueAsync,onDeleteClick:e.deleteQueueAsync})})})]})})}));!function(e){e[e.SystemDefault=0]="SystemDefault",e[e.Always=1]="Always",e[e.Never=2]="Never"}(jr||(jr={}));var pr={pollInterval:8,themePreference:jr.SystemDefault,isDrawerOpen:!0,taskRowsPerPage:20,dailyStatsChartType:"last-7d"};var hr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case J:return Object(u.a)(Object(u.a)({},e),{},{pollInterval:t.value});case X:return Object(u.a)(Object(u.a)({},e),{},{themePreference:t.value});case $:return Object(u.a)(Object(u.a)({},e),{},{isDrawerOpen:!e.isDrawerOpen});case Z:return Object(u.a)(Object(u.a)({},e),{},{taskRowsPerPage:t.value});case ee:return Object(u.a)(Object(u.a)({},e),{},{dailyStatsChartType:t.value});default:return e}},Or=a(873);function fr(e){return"dark"===e.palette.type}var xr="CLOSE_SNACKBAR";var gr=Object(p.a)((function(e){return{listItem:{borderTopRightRadius:"24px",borderBottomRightRadius:"24px"},selected:{backgroundColor:fr(e)?"".concat(e.palette.secondary.main,"30"):"".concat(e.palette.primary.main,"30")},selectedText:{fontWeight:600,color:fr(e)?e.palette.secondary.main:e.palette.primary.main},selectedIcon:{color:fr(e)?e.palette.secondary.main:e.palette.primary.main}}}));var kr=function(e){var t=gr(),a=e.icon,n=e.primary,c=e.to,s=Object(b.i)({path:c,strict:!0,sensitive:!0,exact:!0}),i=r.a.useMemo((function(){return r.a.forwardRef((function(e,t){return Object(je.jsx)(j.b,Object(u.a)({to:c,ref:t},e))}))}),[c]);return Object(je.jsx)("li",{children:Object(je.jsx)(kn.a,{title:n,placement:"right",children:Object(je.jsxs)(k.a,{button:!0,component:i,className:Object(d.default)(t.listItem,s&&t.selected),children:[a&&Object(je.jsx)(v.a,{className:Object(d.default)(s&&t.selectedIcon),children:a}),Object(je.jsx)(y.a,{primary:n,classes:{primary:s?t.selectedText:void 0}})]})})})},vr=a(368),yr=a(340),mr=a.n(yr),Sr=a(891),Tr=a(335),_r=a(336);function Ar(e){var t=fr(Object(ne.a)())?Tr.a:_r.a;return Object(je.jsx)(Sr.a,{language:e.language,style:t,customStyle:e.customStyle,children:e.children})}var Er=a(339),Cr=a.n(Er),Rr="LIST_SCHEDULER_ENTRIES_BEGIN",Ir="LIST_SCHEDULER_ENTRIES_SUCCESS",wr="LIST_SCHEDULER_ENTRIES_ERROR",qr="LIST_SCHEDULER_ENQUEUE_EVENTS_BEGIN",Pr="LIST_SCHEDULER_ENQUEUE_EVENTS_SUCCESS",Nr="LIST_SCHEDULER_ENQUEUE_EVENTS_ERROR";function Dr(e,t){return e.enqueueEventsByEntryId[t]||{data:[],loading:!1}}var Lr={loading:!1,data:[],error:"",enqueueEventsByEntryId:{}};var Br=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Rr:return Object(u.a)(Object(u.a)({},e),{},{loading:!0});case Ir:return Object(u.a)(Object(u.a)({},e),{},{error:"",loading:!1,data:t.payload.entries});case wr:return Object(u.a)(Object(u.a)({},e),{},{loading:!1,error:t.error});case qr:var a=Dr(e,t.entryId);return Object(u.a)(Object(u.a)({},e),{},{enqueueEventsByEntryId:Object(u.a)(Object(u.a)({},e.enqueueEventsByEntryId),{},Object(l.a)({},t.entryId,Object(u.a)(Object(u.a)({},a),{},{loading:!0})))});case Pr:var n=function(e,t){return Date.parse(t.enqueued_at)-Date.parse(e.enqueued_at)},r=Dr(e,t.entryId),c=Cr()([].concat(Object(jn.a)(r.data),Object(jn.a)(t.payload.events)),"task_id").sort(n);return Object(u.a)(Object(u.a)({},e),{},{enqueueEventsByEntryId:Object(u.a)(Object(u.a)({},e.enqueueEventsByEntryId),{},Object(l.a)({},t.entryId,{loading:!1,data:c}))});case Nr:var s=Dr(e,t.entryId);return Object(u.a)(Object(u.a)({},e),{},{enqueueEventsByEntryId:Object(u.a)(Object(u.a)({},e.enqueueEventsByEntryId),{},Object(l.a)({},t.entryId,Object(u.a)(Object(u.a)({},s),{},{loading:!1})))});default:return e}},Hr=Object(p.a)((function(e){return{table:{height:"80vh"},stickyHeaderCell:{background:e.palette.background.paper}}}));var Ur,Kr=Object(o.b)((function(e,t){return{events:Dr(e.schedulerEntries,t.entryId)}}),{listSchedulerEnqueueEventsAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){var n;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:qr,entryId:e}),t.prev=1,t.next=4,ma(e);case 4:n=t.sent,a({type:Pr,payload:n,entryId:e}),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),console.error("listSchedulerEnqueueEventsAsync: ",Aa(t.t0)),a({type:Nr,error:Ea(t.t0),entryId:e});case 12:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(e){return t.apply(this,arguments)}}()}})((function(e){var t=Hr(),a=e.listSchedulerEnqueueEventsAsync,r=e.entryId,c=e.events;return Object(n.useEffect)((function(){a(r)}),[r,a]),Object(je.jsx)(On.a,{className:t.table,children:Object(je.jsxs)(bn.a,{stickyHeader:!0,"aria-label":"scheduler enqueue events table",size:"small",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{classes:{stickyHeader:t.stickyHeaderCell},children:"Enqueued"}),Object(je.jsx)(hn.a,{classes:{stickyHeader:t.stickyHeaderCell},children:"Task ID"})]})}),Object(je.jsx)(pn.a,{children:c.data.map((function(e){return Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{component:"th",scope:"row",children:qa(e.enqueued_at)}),Object(je.jsx)(hn.a,{children:e.task_id})]},e.task_id)}))})]})})})),zr=Object(p.a)((function(e){return{table:{minWidth:650},noBorder:{border:"none"},fixedCell:{position:"sticky",zIndex:1,left:0,background:e.palette.background.paper},modal:{display:"flex",alignItems:"center",justifyContent:"center"},modalContent:{background:e.palette.background.paper,padding:e.spacing(2),width:"540px",outline:"none",borderRadius:e.shape.borderRadius},eventsTable:{maxHeight:"80vh"}}}));!function(e){e[e.EntryId=0]="EntryId",e[e.Spec=1]="Spec",e[e.Type=2]="Type",e[e.Payload=3]="Payload",e[e.Options=4]="Options",e[e.NextEnqueue=5]="NextEnqueue",e[e.PrevEnqueue=6]="PrevEnqueue",e[e.None=7]="None"}(Ur||(Ur={}));var Gr=[{label:"Entry ID",key:"entry_id",sortBy:Ur.EntryId,align:"left"},{label:"Spec",key:"spec",sortBy:Ur.Spec,align:"left"},{label:"Type",key:"type",sortBy:Ur.Type,align:"left"},{label:"Payload",key:"task_payload",sortBy:Ur.Payload,align:"left"},{label:"Options",key:"options",sortBy:Ur.Options,align:"left"},{label:"Next Enqueue",key:"next_enqueue",sortBy:Ur.NextEnqueue,align:"left"},{label:"Prev Enqueue",key:"prev_enqueue",sortBy:Ur.PrevEnqueue,align:"left"},{label:"",key:"show_history",sortBy:Ur.None,align:"left"}];function Vr(e,t){var a=Object(jn.a)(e);return a.sort(t),a}function Mr(e){var t=zr(),a=Object(n.useState)(Ur.EntryId),r=Object(dn.a)(a,2),c=r[0],s=r[1],i=Object(n.useState)(Nn.Asc),o=Object(dn.a)(i,2),l=o[0],u=o[1],j=Object(n.useState)(""),b=Object(dn.a)(j,2),p=b[0],h=b[1];return 0===e.entries.length?Object(je.jsxs)(ve.a,{severity:"info",children:[Object(je.jsx)(ye.a,{children:"Info"}),"No entries found at this time."]}):Object(je.jsx)(je.Fragment,{children:Object(je.jsxs)(On.a,{children:[Object(je.jsxs)(bn.a,{className:t.table,"aria-label":"scheduler entries table",children:[Object(je.jsx)(fn.a,{children:Object(je.jsx)(xn.a,{children:Gr.map((function(e,a){return Object(je.jsx)(hn.a,{align:e.align,className:Object(d.default)(0===a&&t.fixedCell),children:Object(je.jsx)(gn.a,{active:e.sortBy===c,direction:l,onClick:(n=e.sortBy,function(e){if(n===c){var t=l===Nn.Asc?Nn.Desc:Nn.Asc;u(t)}else s(n)}),children:e.label})},e.key);var n}))})}),Object(je.jsx)(pn.a,{children:Vr(e.entries,(function(e,t){var a;switch(c){case Ur.EntryId:if(e.id===t.id)return 0;a=e.id<t.id;break;case Ur.Spec:if(e.spec===t.spec)return 0;a=e.spec<t.spec;break;case Ur.Type:if(e.task_type===t.task_type)return 0;a=e.task_type<t.task_type;break;case Ur.Payload:if(e.task_payload===t.task_payload)return 0;a=e.task_payload<t.task_payload;break;case Ur.Options:if(e.options===t.options)return 0;a=e.options<t.options;break;case Ur.NextEnqueue:if(e.next_enqueue_at===t.next_enqueue_at)return 0;a=e.next_enqueue_at<t.next_enqueue_at;break;case Ur.PrevEnqueue:var n=e.prev_enqueue_at||"",r=t.prev_enqueue_at||"";if(n===r)return 0;a=n<r;break;default:throw"Unexpected order by value: ".concat(c)}return l===Nn.Asc?a?-1:1:a?1:-1})).map((function(t,a){return Object(je.jsx)(Wr,{entry:t,isLastRow:a===e.entries.length-1,onShowHistoryClick:function(){return h(t.id)}},t.id)}))})]}),Object(je.jsx)(vr.a,{open:""!==p,onClose:function(){return h("")},className:t.modal,children:Object(je.jsxs)("div",{className:t.modalContent,children:[Object(je.jsx)(T.a,{variant:"h6",gutterBottom:!0,color:"textPrimary",children:"Recent History"}),Object(je.jsx)(Kr,{entryId:p})]})})]})})}var Qr=Object(p.a)((function(e){return{rowRoot:{"& > *":{borderBottom:"unset"}},noBorder:{border:"none"}}}));function Wr(e){var t=e.entry,a=e.isLastRow,n=Qr();return Object(je.jsxs)(xn.a,{className:n.rowRoot,children:[Object(je.jsx)(hn.a,{component:"th",scope:"row",className:Object(d.default)(a&&n.noBorder),children:t.id}),Object(je.jsx)(hn.a,{className:Object(d.default)(a&&n.noBorder),children:t.spec}),Object(je.jsx)(hn.a,{className:Object(d.default)(a&&n.noBorder),children:t.task_type}),Object(je.jsx)(hn.a,{className:Object(d.default)(a&&n.noBorder),children:Object(je.jsx)(Ar,{language:"json",children:t.task_payload})}),Object(je.jsx)(hn.a,{className:Object(d.default)(a&&n.noBorder),children:Object(je.jsx)(Ar,{language:"go",children:t.options.length>0?t.options.join(", "):"No options"})}),Object(je.jsx)(hn.a,{className:Object(d.default)(a&&n.noBorder),children:wa(t.next_enqueue_at)}),Object(je.jsx)(hn.a,{className:Object(d.default)(a&&n.noBorder),children:t.prev_enqueue_at?qa(t.prev_enqueue_at):"N/A"}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(kn.a,{title:"See History",children:Object(je.jsx)(_.a,{"aria-label":"expand row",size:"small",onClick:e.onShowHistoryClick,children:Object(je.jsx)(mr.a,{})})})})]})}var Fr=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(4),paddingBottom:e.spacing(4)},paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column"},heading:{paddingLeft:e.spacing(2),marginBottom:e.spacing(1)}}}));var Yr=Object(o.b)((function(e){return{loading:e.schedulerEntries.loading,error:e.schedulerEntries.error,entries:e.schedulerEntries.data,pollInterval:e.settings.pollInterval}}),{listSchedulerEntriesAsync:function(){return function(){var e=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:Rr}),e.prev=1,e.next=4,va();case 4:a=e.sent,t({type:Ir,payload:a}),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.error("listSchedulerEnqueueEventsAsync: ".concat(Aa(e.t0))),t({type:wr,error:Ea(e.t0)});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()}})((function(e){var t=e.pollInterval,a=e.listSchedulerEntriesAsync,n=Fr();return rr(a,t),Object(je.jsx)(Oe.a,{maxWidth:"lg",className:n.container,children:Object(je.jsx)(fe.a,{container:!0,spacing:3,children:""===e.error?Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsxs)(xe.a,{className:n.paper,variant:"outlined",children:[Object(je.jsx)(T.a,{variant:"h6",className:n.heading,children:"Scheduler Entries"}),Object(je.jsx)(Mr,{entries:e.entries})]})}):Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsxs)(ve.a,{severity:"error",children:[Object(je.jsx)(ye.a,{children:"Error"}),"Could not retrieve scheduler entries live data \u2014"," ",Object(je.jsx)("strong",{children:"See the logs for details"})]})})})})})),Jr=a(359),Xr=a(898),$r=a(897),Zr=a(341),ec=a.n(Zr),tc=a(876),ac=a(893),nc=a(892),rc=a(251),cc=a.n(rc),sc="GET_TASK_INFO_BEGIN",ic="GET_TASK_INFO_SUCCESS",oc="GET_TASK_INFO_ERROR",lc="LIST_ACTIVE_TASKS_BEGIN",uc="LIST_ACTIVE_TASKS_SUCCESS",dc="LIST_ACTIVE_TASKS_ERROR",jc="LIST_PENDING_TASKS_BEGIN",bc="LIST_PENDING_TASKS_SUCCESS",pc="LIST_PENDING_TASKS_ERROR",hc="LIST_SCHEDULED_TASKS_BEGIN",Oc="LIST_SCHEDULED_TASKS_SUCCESS",fc="LIST_SCHEDULED_TASKS_ERROR",xc="LIST_RETRY_TASKS_BEGIN",gc="LIST_RETRY_TASKS_SUCCESS",kc="LIST_RETRY_TASKS_ERROR",vc="LIST_ARCHIVED_TASKS_BEGIN",yc="LIST_ARCHIVED_TASKS_SUCCESS",mc="LIST_ARCHIVED_TASKS_ERROR",Sc="LIST_COMPLETED_TASKS_BEGIN",Tc="LIST_COMPLETED_TASKS_SUCCESS",_c="LIST_COMPLETED_TASKS_ERROR",Ac="CANCEL_ACTIVE_TASK_BEGIN",Ec="CANCEL_ACTIVE_TASK_SUCCESS",Cc="CANCEL_ACTIVE_TASK_ERROR",Rc="CANCEL_ALL_ACTIVE_TASKS_BEGIN",Ic="CANCEL_ALL_ACTIVE_TASKS_SUCCESS",wc="CANCEL_ALL_ACTIVE_TASKS_ERROR",qc="BATCH_CANCEL_ACTIVE_TASKS_BEGIN",Pc="BATCH_CANCEL_ACTIVE_TASKS_SUCCESS",Nc="BATCH_CANCEL_ACTIVE_TASKS_ERROR",Dc="RUN_SCHEDULED_TASK_BEGIN",Lc="RUN_SCHEDULED_TASK_SUCCESS",Bc="RUN_SCHEDULED_TASK_ERROR",Hc="RUN_RETRY_TASK_BEGIN",Uc="RUN_RETRY_TASK_SUCCESS",Kc="RUN_RETRY_TASK_ERROR",zc="RUN_ARCHIVED_TASK_BEGIN",Gc="RUN_ARCHIVED_TASK_SUCCESS",Vc="RUN_ARCHIVED_TASK_ERROR",Mc="DELETE_PENDING_TASK_BEGIN",Qc="DELETE_PENDING_TASK_SUCCESS",Wc="DELETE_PENDING_TASK_ERROR",Fc="ARCHIVE_PENDING_TASK_BEGIN",Yc="ARCHIVE_PENDING_TASK_SUCCESS",Jc="ARCHIVE_PENDING_TASK_ERROR",Xc="DELETE_SCHEDULED_TASK_BEGIN",$c="DELETE_SCHEDULED_TASK_SUCCESS",Zc="DELETE_SCHEDULED_TASK_ERROR",es="ARCHIVE_SCHEDULED_TASK_BEGIN",ts="ARCHIVE_SCHEDULED_TASK_SUCCESS",as="ARCHIVE_SCHEDULED_TASK_ERROR",ns="ARCHIVE_RETRY_TASK_BEGIN",rs="ARCHIVE_RETRY_TASK_SUCCESS",cs="ARCHIVE_RETRY_TASK_ERROR",ss="BATCH_ARCHIVE_PENDING_TASKS_BEGIN",is="BATCH_ARCHIVE_PENDING_TASKS_SUCCESS",os="BATCH_RUN_PENDING_TASKS_ERROR",ls="BATCH_DELETE_PENDING_TASKS_BEGIN",us="BATCH_DELETE_PENDING_TASKS_SUCCESS",ds="BATCH_DELETE_PENDING_TASKS_ERROR",js="DELETE_ALL_PENDING_TASKS_BEGIN",bs="DELETE_ALL_PENDING_TASKS_SUCCESS",ps="DELETE_ALL_PENDING_TASKS_ERROR",hs="ARCHIVE_ALL_PENDING_TASKS_BEGIN",Os="ARCHIVE_ALL_PENDING_TASKS_SUCCESS",fs="ARCHIVE_ALL_PENDING_TASKS_ERROR",xs="BATCH_RUN_SCHEDULED_TASKS_BEGIN",gs="BATCH_RUN_SCHEDULED_TASKS_SUCCESS",ks="BATCH_RUN_SCHEDULED_TASKS_ERROR",vs="BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN",ys="BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS",ms="BATCH_RUN_SCHEDULED_TASKS_ERROR",Ss="BATCH_DELETE_SCHEDULED_TASKS_BEGIN",Ts="BATCH_DELETE_SCHEDULED_TASKS_SUCCESS",_s="BATCH_DELETE_SCHEDULED_TASKS_ERROR",As="RUN_ALL_SCHEDULED_TASKS_BEGIN",Es="RUN_ALL_SCHEDULED_TASKS_SUCCESS",Cs="RUN_ALL_SCHEDULED_TASKS_ERROR",Rs="ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN",Is="ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS",ws="ARCHIVE_ALL_SCHEDULED_TASKS_ERROR",qs="DELETE_ALL_SCHEDULED_TASKS_BEGIN",Ps="DELETE_ALL_SCHEDULED_TASKS_SUCCESS",Ns="DELETE_ALL_SCHEDULED_TASKS_ERROR",Ds="DELETE_RETRY_TASK_BEGIN",Ls="DELETE_RETRY_TASK_SUCCESS",Bs="DELETE_RETRY_TASK_ERROR",Hs="BATCH_RUN_RETRY_TASKS_BEGIN",Us="BATCH_RUN_RETRY_TASKS_SUCCESS",Ks="BATCH_RUN_RETRY_TASKS_ERROR",zs="BATCH_ARCHIVE_RETRY_TASKS_BEGIN",Gs="BATCH_ARCHIVE_RETRY_TASKS_SUCCESS",Vs="BATCH_ARCHIVE_RETRY_TASKS_ERROR",Ms="BATCH_DELETE_RETRY_TASKS_BEGIN",Qs="BATCH_DELETE_RETRY_TASKS_SUCCESS",Ws="BATCH_DELETE_RETRY_TASKS_ERROR",Fs="RUN_ALL_RETRY_TASKS_BEGIN",Ys="RUN_ALL_RETRY_TASKS_SUCCESS",Js="RUN_ALL_RETRY_TASKS_ERROR",Xs="ARCHIVE_ALL_RETRY_TASKS_BEGIN",$s="ARCHIVE_ALL_RETRY_TASKS_SUCCESS",Zs="ARCHIVE_ALL_RETRY_TASKS_ERROR",ei="DELETE_ALL_RETRY_TASKS_BEGIN",ti="DELETE_ALL_RETRY_TASKS_SUCCESS",ai="DELETE_ALL_RETRY_TASKS_ERROR",ni="DELETE_ARCHIVED_TASK_BEGIN",ri="DELETE_ARCHIVED_TASK_SUCCESS",ci="DELETE_ARCHIVED_TASK_ERROR",si="BATCH_RUN_ARCHIVED_TASKS_BEGIN",ii="BATCH_RUN_ARCHIVED_TASKS_SUCCESS",oi="BATCH_RUN_ARCHIVED_TASKS_ERROR",li="BATCH_DELETE_ARCHIVED_TASKS_BEGIN",ui="BATCH_DELETE_ARCHIVED_TASKS_SUCCESS",di="BATCH_DELETE_ARCHIVED_TASKS_ERROR",ji="RUN_ALL_ARCHIVED_TASKS_BEGIN",bi="RUN_ALL_ARCHIVED_TASKS_SUCCESS",pi="RUN_ALL_ARCHIVED_TASKS_ERROR",hi="DELETE_ALL_ARCHIVED_TASKS_BEGIN",Oi="DELETE_ALL_ARCHIVED_TASKS_SUCCESS",fi="DELETE_ALL_ARCHIVED_TASKS_ERROR",xi="DELETE_COMPLETED_TASK_BEGIN",gi="DELETE_COMPLETED_TASK_SUCCESS",ki="DELETE_COMPLETED_TASK_ERROR",vi="DELETE_ALL_COMPLETED_TASKS_BEGIN",yi="DELETE_ALL_COMPLETED_TASKS_SUCCESS",mi="DELETE_ALL_COMPLETED_TASKS_ERROR",Si="BATCH_DELETE_COMPLETED_TASKS_BEGIN",Ti="BATCH_DELETE_COMPLETED_TASKS_SUCCESS",_i="BATCH_DELETE_COMPLETED_TASKS_ERROR";var Ai=a(361),Ei=Object(p.a)((function(e){return{actionsContainer:{display:"flex",padding:"4px"},moreIcon:{marginRight:"8px"},iconGroup:{paddingLeft:e.spacing(1),borderLeft:"1px solid ".concat(e.palette.grey[100])}}}));function Ci(e){var t=Ei(),a=Object(n.useState)(null),r=Object(dn.a)(a,2),c=r[0],s=r[1],i=function(){return s(null)};return Object(je.jsxs)("div",{className:t.actionsContainer,children:[Object(je.jsx)(kn.a,{title:"More Actions",children:Object(je.jsx)(_.a,{"aria-label":"actions",className:t.moreIcon,onClick:function(e){s(e.currentTarget)},children:Object(je.jsx)(En.a,{})})}),Object(je.jsx)(Ai.a,{id:"action-menu",keepMounted:!0,anchorEl:c,open:Boolean(c),onClose:i,children:e.menuItemActions.map((function(e){return Object(je.jsx)(er.a,{onClick:function(){e.onClick(),i()},disabled:e.disabled,children:e.label},e.label)}))}),e.showIconButtons&&Object(je.jsx)("div",{className:t.iconGroup,children:e.iconButtonActions.map((function(e){return Object(je.jsx)(kn.a,{title:e.tooltip,children:Object(je.jsx)(_.a,{onClick:e.onClick,disabled:e.disabled,children:e.icon})},e.tooltip)}))})]})}var Ri=Object(p.a)((function(e){return{table:{minWidth:650},stickyHeaderCell:{background:e.palette.background.paper},alert:{borderTopLeftRadius:0,borderTopRightRadius:0},pagination:{border:"none"}}}));var Ii={listActiveTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:lc,queue:e}),a.prev=1,a.next=4,Ge(e,t);case 4:r=a.sent,n({type:uc,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("listActiveTasksAsync: ",Aa(a.t0)),n({type:dc,queue:e,error:Ea(a.t0)});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},cancelActiveTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Ac,queue:e,taskId:t}),a.prev=1,a.next=4,Me(e,t);case 4:n({type:Ec,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("cancelActiveTaskAsync: ",Aa(a.t0)),n({type:Cc,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},batchCancelActiveTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:qc,queue:e,taskIds:t}),a.prev=1,a.next=4,Ye(e,t);case 4:r=a.sent,n({type:Pc,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchCancelActiveTasksAsync: ",Aa(a.t0)),n({type:Nc,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},cancelAllActiveTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:Rc,queue:e}),t.prev=1,t.next=4,We(e);case 4:a({type:Ic,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("cancelAllActiveTasksAsync: ",Aa(t.t0)),a({type:wc,error:Ea(t.t0),queue:e});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},taskRowsPerPageChange:te},wi=[{key:"id",label:"ID",align:"left"},{key:"type",label:"Type",align:"left"},{key:"payload",label:"Payload",align:"left"},{key:"status",label:"Status",align:"left"},{key:"start-time",label:"Started",align:"left"},{key:"deadline",label:"Deadline",align:"left"},{key:"actions",label:"Actions",align:"center"}],qi=Object(o.b)((function(e){return{loading:e.tasks.activeTasks.loading,error:e.tasks.activeTasks.error,tasks:e.tasks.activeTasks.data,batchActionPending:e.tasks.activeTasks.batchActionPending,allActionPending:e.tasks.activeTasks.allActionPending,pollInterval:e.settings.pollInterval,pageSize:e.settings.taskRowsPerPage}}),Ii);var Pi=Object(p.a)((function(e){return{root:{cursor:"pointer","&:hover":{boxShadow:e.shadows[2]},"&:hover .MuiTableCell-root":{borderBottomColor:e.palette.background.paper}}}}));function Ni(e){var t=e.task,a=Pi(),n=Object(b.f)();return Object(je.jsxs)(xn.a,{className:a.root,selected:e.isSelected,onClick:function(){return n.push(F(t.queue,t.id))},children:[Object(je.jsx)(hn.a,{padding:"checkbox",onClick:function(e){return e.stopPropagation()},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{onChange:function(t){return e.onSelectChange(t.target.checked)},checked:e.isSelected})})}),Object(je.jsx)(hn.a,{component:"th",scope:"row",children:Na(t.id)}),Object(je.jsx)(hn.a,{children:t.type}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:t.payload})}),Object(je.jsx)(hn.a,{children:t.canceling?"Canceling":"Running"}),Object(je.jsx)(hn.a,{children:"-"===t.start_time?"just now":qa(t.start_time)}),Object(je.jsx)(hn.a,{children:"-"===t.deadline?"-":wa(t.deadline)}),Object(je.jsx)(hn.a,{align:"center",onMouseEnter:e.onActionCellEnter,onMouseLeave:e.onActionCellLeave,onClick:function(e){return e.stopPropagation()},children:e.showActions?Object(je.jsx)(r.a.Fragment,{children:Object(je.jsx)(kn.a,{title:"Cancel",children:Object(je.jsx)(_.a,{onClick:e.onCancelClick,disabled:t.requestPending||t.canceling,size:"small",children:Object(je.jsx)(cc.a,{fontSize:"small"})})})}):Object(je.jsx)(_.a,{size:"small",onClick:e.onActionCellEnter,children:Object(je.jsx)(En.a,{fontSize:"small"})})})]},t.id)}var Di=qi((function(e){var t=e.pollInterval,a=e.listActiveTasksAsync,r=e.queue,c=e.pageSize,s=Ri(),i=Object(n.useState)(0),o=Object(dn.a)(i,2),l=o[0],u=o[1],d=Object(n.useState)([]),j=Object(dn.a)(d,2),b=j[0],p=j[1],h=Object(n.useState)(""),O=Object(dn.a)(h,2),f=O[0],x=O[1];if(rr(Object(n.useCallback)((function(){a(r,{page:l+1,size:c})}),[l,c,r,a]),t),e.error.length>0)return Object(je.jsxs)(ve.a,{severity:"error",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Error"}),e.error]});if(0===e.tasks.length)return Object(je.jsxs)(ve.a,{severity:"info",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Info"}),"No active tasks at this time."]});var g=e.tasks.length,k=b.length;return Object(je.jsxs)("div",{children:[Object(je.jsx)(Ci,{showIconButtons:k>0,iconButtonActions:[{tooltip:"Cancel",icon:Object(je.jsx)(cc.a,{}),onClick:function(){e.batchCancelActiveTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending}],menuItemActions:[{label:"Cancel All",onClick:function(){e.cancelAllActiveTasksAsync(r)},disabled:e.allActionPending}]}),Object(je.jsx)(On.a,{component:xe.a,children:Object(je.jsxs)(bn.a,{stickyHeader:!0,className:s.table,"aria-label":"active tasks table",size:"small",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{padding:"checkbox",classes:{stickyHeader:s.stickyHeaderCell},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{indeterminate:k>0&&k<g,checked:g>0&&k===g,onChange:function(t){if(t.target.checked){var a=e.tasks.map((function(e){return e.id}));p(a)}else p([])},inputProps:{"aria-label":"select all tasks shown in the table"}})})}),wi.map((function(e){return Object(je.jsx)(hn.a,{align:e.align,classes:{stickyHeader:s.stickyHeaderCell},children:e.label},e.key)}))]})}),Object(je.jsx)(pn.a,{children:e.tasks.map((function(t){return Object(je.jsx)(Ni,{task:t,isSelected:b.includes(t.id),onSelectChange:function(e){p(e?b.concat(t.id):b.filter((function(e){return e!==t.id})))},onCancelClick:function(){e.cancelActiveTaskAsync(r,t.id)},onActionCellEnter:function(){return x(t.id)},onActionCellLeave:function(){return x("")},showActions:f===t.id},t.id)}))}),Object(je.jsx)(tc.a,{children:Object(je.jsx)(xn.a,{children:Object(je.jsx)(ac.a,{rowsPerPageOptions:he,colSpan:wi.length+1,count:e.tasks.length,rowsPerPage:c,page:l,SelectProps:{inputProps:{"aria-label":"rows per page"},native:!0},onPageChange:function(e,t){u(t)},onRowsPerPageChange:function(t){e.taskRowsPerPageChange(parseInt(t.target.value,10)),u(0)},ActionsComponent:pe,className:s.pagination})})})]})})]})})),Li=a(100),Bi=a.n(Li),Hi=Object(p.a)((function(e){return{table:{minWidth:650},stickyHeaderCell:{background:e.palette.background.paper},alert:{borderTopLeftRadius:0,borderTopRightRadius:0},pagination:{border:"none"}}}));var Ui={listPendingTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:jc,queue:e}),a.prev=1,a.next=4,Xe(e,t);case 4:r=a.sent,n({type:bc,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("listPendingTasksAsync: ",Aa(a.t0)),n({type:pc,queue:e,error:Ea(a.t0)});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},deletePendingTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Mc,queue:e,taskId:t}),a.prev=1,a.next=4,bt(e,t);case 4:n({type:Qc,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("deletePendingTaskAsync: ",Aa(a.t0)),n({type:Wc,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},batchDeletePendingTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:ls,queue:e,taskIds:t}),a.prev=1,a.next=4,ht(e,t);case 4:r=a.sent,n({type:us,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchDeletePendingTasksAsync: ",Aa(a.t0)),n({type:ds,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},deleteAllPendingTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){var n;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:js,queue:e}),t.prev=1,t.next=4,ft(e);case 4:n=t.sent,a({type:bs,deleted:n.deleted,queue:e}),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),console.error("deleteAllPendingTasksAsync: ",Aa(t.t0)),a({type:ps,error:Ea(t.t0),queue:e});case 12:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(e){return t.apply(this,arguments)}}()},archivePendingTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Fc,queue:e,taskId:t}),a.prev=1,a.next=4,it(e,t);case 4:n({type:Yc,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("archivePendingTaskAsync: ",Aa(a.t0)),n({type:Jc,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},batchArchivePendingTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:ss,queue:e,taskIds:t}),a.prev=1,a.next=4,lt(e,t);case 4:r=a.sent,n({type:is,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchArchivePendingTasksAsync: ",Aa(a.t0)),n({type:os,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},archiveAllPendingTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:hs,queue:e}),t.prev=1,t.next=4,dt(e);case 4:a({type:Os,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("archiveAllPendingTasksAsync: ",Aa(t.t0)),a({type:fs,error:Ea(t.t0),queue:e});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},taskRowsPerPageChange:te},Ki=Object(o.b)((function(e){return{loading:e.tasks.pendingTasks.loading,error:e.tasks.pendingTasks.error,tasks:e.tasks.pendingTasks.data,batchActionPending:e.tasks.pendingTasks.batchActionPending,allActionPending:e.tasks.pendingTasks.allActionPending,pollInterval:e.settings.pollInterval,pageSize:e.settings.taskRowsPerPage}}),Ui);var zi=Object(p.a)((function(e){return{root:{cursor:"pointer","&:hover":{boxShadow:e.shadows[2]},"&:hover .MuiTableCell-root":{borderBottomColor:e.palette.background.paper}},actionCell:{width:"96px"},actionButton:{marginLeft:3,marginRight:3}}}));function Gi(e){var t=e.task,a=zi(),n=Object(b.f)();return Object(je.jsxs)(xn.a,{className:a.root,selected:e.isSelected,onClick:function(){return n.push(F(t.queue,t.id))},children:[Object(je.jsx)(hn.a,{padding:"checkbox",onClick:function(e){return e.stopPropagation()},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{onChange:function(t){return e.onSelectChange(t.target.checked)},checked:e.isSelected})})}),Object(je.jsx)(hn.a,{component:"th",scope:"row",children:Na(t.id)}),Object(je.jsx)(hn.a,{children:t.type}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:t.payload})}),Object(je.jsx)(hn.a,{align:"right",children:t.retried}),Object(je.jsx)(hn.a,{align:"right",children:t.max_retry}),Object(je.jsx)(hn.a,{align:"center",className:a.actionCell,onMouseEnter:e.onActionCellEnter,onMouseLeave:e.onActionCellLeave,onClick:function(e){return e.stopPropagation()},children:e.showActions?Object(je.jsxs)(r.a.Fragment,{children:[Object(je.jsx)(kn.a,{title:"Delete",children:Object(je.jsx)(_.a,{onClick:e.onDeleteClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(_n.a,{fontSize:"small"})})}),Object(je.jsx)(kn.a,{title:"Archive",children:Object(je.jsx)(_.a,{onClick:e.onArchiveClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(Bi.a,{fontSize:"small"})})})]}):Object(je.jsx)(_.a,{size:"small",onClick:e.onActionCellEnter,children:Object(je.jsx)(En.a,{fontSize:"small"})})})]},t.id)}var Vi=Ki((function(e){var t=e.pollInterval,a=e.listPendingTasksAsync,r=e.queue,c=e.pageSize,s=Hi(),i=Object(n.useState)(0),o=Object(dn.a)(i,2),l=o[0],u=o[1],d=Object(n.useState)([]),j=Object(dn.a)(d,2),b=j[0],p=j[1],h=Object(n.useState)(""),O=Object(dn.a)(h,2),f=O[0],x=O[1];if(rr(Object(n.useCallback)((function(){a(r,{page:l+1,size:c})}),[l,c,r,a]),t),e.error.length>0)return Object(je.jsxs)(ve.a,{severity:"error",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Error"}),e.error]});if(0===e.tasks.length)return Object(je.jsxs)(ve.a,{severity:"info",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Info"}),"No pending tasks at this time."]});var g=[{key:"id",label:"ID",align:"left"},{key:"type",label:"Type",align:"left"},{key:"paylod",label:"Payload",align:"left"},{key:"retried",label:"Retried",align:"right"},{key:"max_retry",label:"Max Retry",align:"right"},{key:"actions",label:"Actions",align:"center"}],k=e.tasks.length,v=b.length;return Object(je.jsxs)("div",{children:[Object(je.jsx)(Ci,{showIconButtons:v>0,iconButtonActions:[{tooltip:"Delete",icon:Object(je.jsx)(_n.a,{}),onClick:function(){e.batchDeletePendingTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending},{tooltip:"Archive",icon:Object(je.jsx)(Bi.a,{}),onClick:function(){e.batchArchivePendingTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending}],menuItemActions:[{label:"Delete All",onClick:function(){e.deleteAllPendingTasksAsync(r)},disabled:e.allActionPending},{label:"Archive All",onClick:function(){e.archiveAllPendingTasksAsync(r)},disabled:e.allActionPending}]}),Object(je.jsx)(On.a,{component:xe.a,children:Object(je.jsxs)(bn.a,{stickyHeader:!0,className:s.table,"aria-label":"pending tasks table",size:"small",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{padding:"checkbox",classes:{stickyHeader:s.stickyHeaderCell},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{indeterminate:v>0&&v<k,checked:k>0&&v===k,onChange:function(t){if(t.target.checked){var a=e.tasks.map((function(e){return e.id}));p(a)}else p([])},inputProps:{"aria-label":"select all tasks shown in the table"}})})}),g.map((function(e){return Object(je.jsx)(hn.a,{align:e.align,classes:{stickyHeader:s.stickyHeaderCell},children:e.label},e.key)}))]})}),Object(je.jsx)(pn.a,{children:e.tasks.map((function(t){return Object(je.jsx)(Gi,{task:t,isSelected:b.includes(t.id),onSelectChange:function(e){p(e?b.concat(t.id):b.filter((function(e){return e!==t.id})))},allActionPending:e.allActionPending,onDeleteClick:function(){return e.deletePendingTaskAsync(r,t.id)},onArchiveClick:function(){e.archivePendingTaskAsync(r,t.id)},onActionCellEnter:function(){return x(t.id)},onActionCellLeave:function(){return x("")},showActions:f===t.id},t.id)}))}),Object(je.jsx)(tc.a,{children:Object(je.jsx)(xn.a,{children:Object(je.jsx)(ac.a,{rowsPerPageOptions:he,colSpan:g.length+1,count:e.totalTaskCount,rowsPerPage:c,page:l,SelectProps:{inputProps:{"aria-label":"rows per page"},native:!0},onPageChange:function(e,t){u(t)},onRowsPerPageChange:function(t){e.taskRowsPerPageChange(parseInt(t.target.value,10)),u(0)},ActionsComponent:pe,className:s.pagination})})})]})})]})})),Mi=a(101),Qi=a.n(Mi),Wi=Object(p.a)((function(e){return{table:{minWidth:650},stickyHeaderCell:{background:e.palette.background.paper},alert:{borderTopLeftRadius:0,borderTopRightRadius:0},pagination:{border:"none"}}}));var Fi={listScheduledTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:hc,queue:e}),a.prev=1,a.next=4,Ze(e,t);case 4:r=a.sent,n({type:Oc,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("listScheduledTasksAsync: ",Aa(a.t0)),n({type:fc,queue:e,error:Ea(a.t0)});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},batchDeleteScheduledTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Ss,queue:e,taskIds:t}),a.prev=1,a.next=4,Tt(e,t);case 4:r=a.sent,n({type:Ts,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchDeleteScheduledTasksAsync: ",Aa(a.t0)),n({type:_s,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},batchRunScheduledTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:xs,queue:e,taskIds:t}),a.prev=1,a.next=4,Ct(e,t);case 4:r=a.sent,n({type:gs,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchRunScheduledTasksAsync: ",Aa(a.t0)),n({type:ks,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},batchArchiveScheduledTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:vs,queue:e,taskIds:t}),a.prev=1,a.next=4,qt(e,t);case 4:r=a.sent,n({type:ys,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchArchiveScheduledTasksAsync: ",Aa(a.t0)),n({type:ms,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},deleteAllScheduledTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){var n;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:qs,queue:e}),t.prev=1,t.next=4,At(e);case 4:n=t.sent,a({type:Ps,deleted:n.deleted,queue:e}),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),console.error("deleteAllScheduledTasksAsync: ",Aa(t.t0)),a({type:Ns,error:Ea(t.t0),queue:e});case 12:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(e){return t.apply(this,arguments)}}()},runAllScheduledTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:As,queue:e}),t.prev=1,t.next=4,It(e);case 4:a({type:Es,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("runAllScheduledTasksAsync: ",Aa(t.t0)),a({type:Cs,error:Ea(t.t0),queue:e});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},archiveAllScheduledTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:Rs,queue:e}),t.prev=1,t.next=4,Nt(e);case 4:a({type:Is,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("archiveAllScheduledTasksAsync: ",Aa(t.t0)),a({type:ws,error:Ea(t.t0),queue:e});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},deleteScheduledTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Xc,queue:e,taskId:t}),a.prev=1,a.next=4,mt(e,t);case 4:n({type:$c,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("deleteScheduledTaskAsync: ",Aa(a.t0)),n({type:Zc,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},runScheduledTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Dc,queue:e,taskId:t}),a.prev=1,a.next=4,gt(e,t);case 4:n({type:Lc,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("runScheduledTaskAsync: ",Aa(a.t0)),n({type:Bc,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},archiveScheduledTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:es,queue:e,taskId:t}),a.prev=1,a.next=4,vt(e,t);case 4:n({type:ts,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("archiveScheduledTaskAsync: ",Aa(a.t0)),n({type:as,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},taskRowsPerPageChange:te},Yi=Object(o.b)((function(e){return{loading:e.tasks.scheduledTasks.loading,error:e.tasks.scheduledTasks.error,tasks:e.tasks.scheduledTasks.data,batchActionPending:e.tasks.scheduledTasks.batchActionPending,allActionPending:e.tasks.scheduledTasks.allActionPending,pollInterval:e.settings.pollInterval,pageSize:e.settings.taskRowsPerPage}}),Fi);var Ji=Object(p.a)((function(e){return{root:{cursor:"pointer","&:hover":{boxShadow:e.shadows[2]},"&:hover .MuiTableCell-root":{borderBottomColor:e.palette.background.paper}},actionCell:{width:"140px"},actionButton:{marginLeft:3,marginRight:3}}}));function Xi(e){var t=e.task,a=Ji(),n=Object(b.f)();return Object(je.jsxs)(xn.a,{className:a.root,selected:e.isSelected,onClick:function(){return n.push(F(t.queue,t.id))},children:[Object(je.jsx)(hn.a,{padding:"checkbox",onClick:function(e){return e.stopPropagation()},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{onChange:function(t){return e.onSelectChange(t.target.checked)},checked:e.isSelected})})}),Object(je.jsx)(hn.a,{component:"th",scope:"row",children:Na(t.id)}),Object(je.jsx)(hn.a,{children:t.type}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:t.payload})}),Object(je.jsx)(hn.a,{children:wa(t.next_process_at)}),Object(je.jsx)(hn.a,{align:"center",className:a.actionCell,onMouseEnter:e.onActionCellEnter,onMouseLeave:e.onActionCellLeave,onClick:function(e){return e.stopPropagation()},children:e.showActions?Object(je.jsxs)(r.a.Fragment,{children:[Object(je.jsx)(kn.a,{title:"Delete",children:Object(je.jsx)(_.a,{onClick:e.onDeleteClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(_n.a,{fontSize:"small"})})}),Object(je.jsx)(kn.a,{title:"Archive",children:Object(je.jsx)(_.a,{onClick:e.onArchiveClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(Bi.a,{fontSize:"small"})})}),Object(je.jsx)(kn.a,{title:"Run",children:Object(je.jsx)(_.a,{onClick:e.onRunClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(Qi.a,{fontSize:"small"})})})]}):Object(je.jsx)(_.a,{size:"small",onClick:e.onActionCellEnter,children:Object(je.jsx)(En.a,{fontSize:"small"})})})]},t.id)}var $i=Yi((function(e){var t=e.pollInterval,a=e.listScheduledTasksAsync,r=e.queue,c=e.pageSize,s=Wi(),i=Object(n.useState)(0),o=Object(dn.a)(i,2),l=o[0],u=o[1],d=Object(n.useState)([]),j=Object(dn.a)(d,2),b=j[0],p=j[1],h=Object(n.useState)(""),O=Object(dn.a)(h,2),f=O[0],x=O[1];if(rr(Object(n.useCallback)((function(){a(r,{page:l+1,size:c})}),[l,c,r,a]),t),e.error.length>0)return Object(je.jsxs)(ve.a,{severity:"error",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Error"}),e.error]});if(0===e.tasks.length)return Object(je.jsxs)(ve.a,{severity:"info",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Info"}),"No scheduled tasks at this time."]});var g=[{key:"id",label:"ID",align:"left"},{key:"type",label:"Type",align:"left"},{key:"payload",label:"Payload",align:"left"},{key:"process_in",label:"Process In",align:"left"},{key:"actions",label:"Actions",align:"center"}],k=e.tasks.length,v=b.length;return Object(je.jsxs)("div",{children:[Object(je.jsx)(Ci,{showIconButtons:v>0,iconButtonActions:[{tooltip:"Delete",icon:Object(je.jsx)(_n.a,{}),onClick:function(){e.batchDeleteScheduledTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending},{tooltip:"Archive",icon:Object(je.jsx)(Bi.a,{}),onClick:function(){e.batchArchiveScheduledTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending},{tooltip:"Run",icon:Object(je.jsx)(Qi.a,{}),onClick:function(){e.batchRunScheduledTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending}],menuItemActions:[{label:"Delete All",onClick:function(){e.deleteAllScheduledTasksAsync(r)},disabled:e.allActionPending},{label:"Archive All",onClick:function(){e.archiveAllScheduledTasksAsync(r)},disabled:e.allActionPending},{label:"Run All",onClick:function(){e.runAllScheduledTasksAsync(r)},disabled:e.allActionPending}]}),Object(je.jsx)(On.a,{component:xe.a,children:Object(je.jsxs)(bn.a,{stickyHeader:!0,className:s.table,"aria-label":"scheduled tasks table",size:"small",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{padding:"checkbox",classes:{stickyHeader:s.stickyHeaderCell},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{indeterminate:v>0&&v<k,checked:k>0&&v===k,onChange:function(t){if(t.target.checked){var a=e.tasks.map((function(e){return e.id}));p(a)}else p([])},inputProps:{"aria-label":"select all tasks shown in the table"}})})}),g.map((function(e){return Object(je.jsx)(hn.a,{align:e.align,classes:{stickyHeader:s.stickyHeaderCell},children:e.label},e.label)}))]})}),Object(je.jsx)(pn.a,{children:e.tasks.map((function(t){return Object(je.jsx)(Xi,{task:t,allActionPending:e.allActionPending,isSelected:b.includes(t.id),onSelectChange:function(e){p(e?b.concat(t.id):b.filter((function(e){return e!==t.id})))},onRunClick:function(){e.runScheduledTaskAsync(r,t.id)},onDeleteClick:function(){e.deleteScheduledTaskAsync(r,t.id)},onArchiveClick:function(){e.archiveScheduledTaskAsync(r,t.id)},onActionCellEnter:function(){return x(t.id)},onActionCellLeave:function(){return x("")},showActions:f===t.id},t.id)}))}),Object(je.jsx)(tc.a,{children:Object(je.jsx)(xn.a,{children:Object(je.jsx)(ac.a,{rowsPerPageOptions:he,colSpan:g.length+1,count:e.totalTaskCount,rowsPerPage:c,page:l,SelectProps:{inputProps:{"aria-label":"rows per page"},native:!0},onPageChange:function(e,t){u(t)},onRowsPerPageChange:function(t){e.taskRowsPerPageChange(parseInt(t.target.value,10)),u(0)},ActionsComponent:pe,className:s.pagination})})})]})})]})})),Zi=Object(p.a)((function(e){return{table:{minWidth:650},stickyHeaderCell:{background:e.palette.background.paper},alert:{borderTopLeftRadius:0,borderTopRightRadius:0},pagination:{border:"none"}}}));var eo={batchDeleteRetryTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Ms,queue:e,taskIds:t}),a.prev=1,a.next=4,Gt(e,t);case 4:r=a.sent,n({type:Qs,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchDeleteRetryTasksAsync: ",Aa(a.t0)),n({type:Ws,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},batchRunRetryTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Hs,queue:e,taskIds:t}),a.prev=1,a.next=4,Wt(e,t);case 4:r=a.sent,n({type:Us,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchRunRetryTasksAsync: ",Aa(a.t0)),n({type:Ks,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},batchArchiveRetryTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:zs,queue:e,taskIds:t}),a.prev=1,a.next=4,Xt(e,t);case 4:r=a.sent,n({type:Gs,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchArchiveRetryTasksAsync: ",Aa(a.t0)),n({type:Vs,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},deleteAllRetryTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){var n;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:ei,queue:e}),t.prev=1,t.next=4,Mt(e);case 4:n=t.sent,a({type:ti,deleted:n.deleted,queue:e}),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),console.error("deleteAllRetryTasksAsync: ",Aa(t.t0)),a({type:ai,error:Ea(t.t0),queue:e});case 12:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(e){return t.apply(this,arguments)}}()},runAllRetryTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:Fs,queue:e}),t.prev=1,t.next=4,Yt(e);case 4:a({type:Ys,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("runAllRetryTasksAsync: ",Aa(t.t0)),a({type:Js,error:Ea(t.t0),queue:e});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},archiveAllRetryTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:Xs,queue:e}),t.prev=1,t.next=4,Zt(e);case 4:a({type:$s,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("archiveAllRetryTasksAsync: ",Aa(t.t0)),a({type:Zs,error:Ea(t.t0),queue:e});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},listRetryTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:xc,queue:e}),a.prev=1,a.next=4,tt(e,t);case 4:r=a.sent,n({type:gc,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("listRetryTasksAsync: ",Aa(a.t0)),n({type:kc,queue:e,error:Ea(a.t0)});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},deleteRetryTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Ds,queue:e,taskId:t}),a.prev=1,a.next=4,Kt(e,t);case 4:n({type:Ls,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("deleteRetryTaskAsync: ",Aa(a.t0)),n({type:Bs,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},runRetryTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Hc,queue:e,taskId:t}),a.prev=1,a.next=4,Lt(e,t);case 4:n({type:Uc,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("runRetryTaskAsync: ",Aa(a.t0)),n({type:Kc,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},archiveRetryTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:ns,queue:e,taskId:t}),a.prev=1,a.next=4,Ht(e,t);case 4:n({type:rs,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("archiveRetryTaskAsync: ",Aa(a.t0)),n({type:cs,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},taskRowsPerPageChange:te},to=Object(o.b)((function(e){return{loading:e.tasks.retryTasks.loading,error:e.tasks.retryTasks.error,tasks:e.tasks.retryTasks.data,batchActionPending:e.tasks.retryTasks.batchActionPending,allActionPending:e.tasks.retryTasks.allActionPending,pollInterval:e.settings.pollInterval,pageSize:e.settings.taskRowsPerPage}}),eo);var ao=Object(p.a)((function(e){return{root:{cursor:"pointer","&:hover":{boxShadow:e.shadows[2]},"&:hover .MuiTableCell-root":{borderBottomColor:e.palette.background.paper}},actionCell:{width:"140px"},actionButton:{marginLeft:3,marginRight:3}}}));function no(e){var t=e.task,a=ao(),n=Object(b.f)();return Object(je.jsxs)(xn.a,{className:a.root,selected:e.isSelected,onClick:function(){return n.push(F(t.queue,t.id))},children:[Object(je.jsx)(hn.a,{padding:"checkbox",onClick:function(e){return e.stopPropagation()},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{onChange:function(t){return e.onSelectChange(t.target.checked)},checked:e.isSelected})})}),Object(je.jsx)(hn.a,{component:"th",scope:"row",children:Na(t.id)}),Object(je.jsx)(hn.a,{children:t.type}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:t.payload})}),Object(je.jsx)(hn.a,{children:wa(t.next_process_at)}),Object(je.jsx)(hn.a,{children:t.error_message}),Object(je.jsx)(hn.a,{align:"right",children:t.retried}),Object(je.jsx)(hn.a,{align:"right",children:t.max_retry}),Object(je.jsx)(hn.a,{align:"center",className:a.actionCell,onMouseEnter:e.onActionCellEnter,onMouseLeave:e.onActionCellLeave,onClick:function(e){return e.stopPropagation()},children:e.showActions?Object(je.jsxs)(r.a.Fragment,{children:[Object(je.jsx)(kn.a,{title:"Delete",children:Object(je.jsx)(_.a,{onClick:e.onDeleteClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(_n.a,{fontSize:"small"})})}),Object(je.jsx)(kn.a,{title:"Archive",children:Object(je.jsx)(_.a,{onClick:e.onArchiveClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(Bi.a,{fontSize:"small"})})}),Object(je.jsx)(kn.a,{title:"Run",children:Object(je.jsx)(_.a,{onClick:e.onRunClick,disabled:t.requestPending||e.allActionPending,size:"small",className:a.actionButton,children:Object(je.jsx)(Qi.a,{fontSize:"small"})})})]}):Object(je.jsx)(_.a,{size:"small",onClick:e.onActionCellEnter,children:Object(je.jsx)(En.a,{fontSize:"small"})})})]},t.id)}var ro=to((function(e){var t=e.pollInterval,a=e.listRetryTasksAsync,r=e.queue,c=e.pageSize,s=Zi(),i=Object(n.useState)(0),o=Object(dn.a)(i,2),l=o[0],u=o[1],d=Object(n.useState)([]),j=Object(dn.a)(d,2),b=j[0],p=j[1],h=Object(n.useState)(""),O=Object(dn.a)(h,2),f=O[0],x=O[1];if(rr(Object(n.useCallback)((function(){a(r,{page:l+1,size:c})}),[l,c,r,a]),t),e.error.length>0)return Object(je.jsxs)(ve.a,{severity:"error",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Error"}),e.error]});if(0===e.tasks.length)return Object(je.jsxs)(ve.a,{severity:"info",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Info"}),"No retry tasks at this time."]});var g=[{key:"id",label:"ID",align:"left"},{key:"type",label:"Type",align:"left"},{key:"payload",label:"Payload",align:"left"},{key:"retry_in",label:"Retry In",align:"left"},{key:"last_error",label:"Last Error",align:"left"},{key:"retried",label:"Retried",align:"right"},{key:"max_retry",label:"Max Retry",align:"right"},{key:"actions",label:"Actions",align:"center"}],k=e.tasks.length,v=b.length;return Object(je.jsxs)("div",{children:[Object(je.jsx)(Ci,{showIconButtons:v>0,iconButtonActions:[{tooltip:"Delete",icon:Object(je.jsx)(_n.a,{}),onClick:function(){e.batchDeleteRetryTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending},{tooltip:"Archive",icon:Object(je.jsx)(Bi.a,{}),onClick:function(){e.batchArchiveRetryTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending},{tooltip:"Run",icon:Object(je.jsx)(Qi.a,{}),onClick:function(){e.batchRunRetryTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending}],menuItemActions:[{label:"Delete All",onClick:function(){e.deleteAllRetryTasksAsync(r)},disabled:e.allActionPending},{label:"Archive All",onClick:function(){e.archiveAllRetryTasksAsync(r)},disabled:e.allActionPending},{label:"Run All",onClick:function(){e.runAllRetryTasksAsync(r)},disabled:e.allActionPending}]}),Object(je.jsx)(On.a,{component:xe.a,children:Object(je.jsxs)(bn.a,{stickyHeader:!0,className:s.table,"aria-label":"retry tasks table",size:"small",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{padding:"checkbox",classes:{stickyHeader:s.stickyHeaderCell},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{indeterminate:v>0&&v<k,checked:k>0&&v===k,onChange:function(t){if(t.target.checked){var a=e.tasks.map((function(e){return e.id}));p(a)}else p([])},inputProps:{"aria-label":"select all tasks shown in the table"}})})}),g.map((function(e){return Object(je.jsx)(hn.a,{align:e.align,classes:{stickyHeader:s.stickyHeaderCell},children:e.label},e.label)}))]})}),Object(je.jsx)(pn.a,{children:e.tasks.map((function(t){return Object(je.jsx)(no,{task:t,allActionPending:e.allActionPending,isSelected:b.includes(t.id),onSelectChange:function(e){p(e?b.concat(t.id):b.filter((function(e){return e!==t.id})))},onRunClick:function(){e.runRetryTaskAsync(t.queue,t.id)},onDeleteClick:function(){e.deleteRetryTaskAsync(t.queue,t.id)},onArchiveClick:function(){e.archiveRetryTaskAsync(t.queue,t.id)},onActionCellEnter:function(){return x(t.id)},onActionCellLeave:function(){return x("")},showActions:f===t.id},t.id)}))}),Object(je.jsx)(tc.a,{children:Object(je.jsx)(xn.a,{children:Object(je.jsx)(ac.a,{rowsPerPageOptions:he,colSpan:g.length+1,count:e.totalTaskCount,rowsPerPage:c,page:l,SelectProps:{inputProps:{"aria-label":"rows per page"},native:!0},onPageChange:function(e,t){u(t)},onRowsPerPageChange:function(t){e.taskRowsPerPageChange(parseInt(t.target.value,10)),u(0)},ActionsComponent:pe,className:s.pagination})})})]})})]})})),co=Object(p.a)((function(e){return{table:{minWidth:650},stickyHeaderCell:{background:e.palette.background.paper},alert:{borderTopLeftRadius:0,borderTopRightRadius:0},pagination:{border:"none"}}}));var so={listArchivedTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:vc,queue:e}),a.prev=1,a.next=4,nt(e,t);case 4:r=a.sent,n({type:yc,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("listArchivedTasksAsync: ",Aa(a.t0)),n({type:mc,queue:e,error:Ea(a.t0)});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},runArchivedTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:zc,queue:e,taskId:t}),a.prev=1,a.next=4,ta(e,t);case 4:n({type:Gc,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("runArchivedTaskAsync: ",Aa(a.t0)),n({type:Vc,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},runAllArchivedTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:ji,queue:e}),t.prev=1,t.next=4,da(e);case 4:a({type:bi,queue:e}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(1),console.error("runAllArchivedTasksAsync: ",Aa(t.t0)),a({type:pi,error:Ea(t.t0),queue:e});case 11:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()},deleteArchivedTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:ni,queue:e,taskId:t}),a.prev=1,a.next=4,na(e,t);case 4:n({type:ri,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("deleteArchivedTaskAsync: ",Aa(a.t0)),n({type:ci,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},deleteAllArchivedTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){var n;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:hi,queue:e}),t.prev=1,t.next=4,ia(e);case 4:n=t.sent,a({type:Oi,deleted:n.deleted,queue:e}),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),console.error("deleteAllArchivedTasksAsync: ",Aa(t.t0)),a({type:fi,error:Ea(t.t0),queue:e});case 12:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(e){return t.apply(this,arguments)}}()},batchRunArchivedTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:si,queue:e,taskIds:t}),a.prev=1,a.next=4,la(e,t);case 4:r=a.sent,n({type:ii,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchRunArchivedTasksAsync: ",Aa(a.t0)),n({type:oi,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},batchDeleteArchivedTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:li,queue:e,taskIds:t}),a.prev=1,a.next=4,ca(e,t);case 4:r=a.sent,n({type:ui,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchDeleteArchivedTasksAsync: ",Aa(a.t0)),n({type:di,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},taskRowsPerPageChange:te},io=Object(o.b)((function(e){return{loading:e.tasks.archivedTasks.loading,error:e.tasks.archivedTasks.error,tasks:e.tasks.archivedTasks.data,batchActionPending:e.tasks.archivedTasks.batchActionPending,allActionPending:e.tasks.archivedTasks.allActionPending,pollInterval:e.settings.pollInterval,pageSize:e.settings.taskRowsPerPage}}),so);var oo=Object(p.a)((function(e){return{root:{cursor:"pointer","&:hover":{boxShadow:e.shadows[2]},"&:hover .MuiTableCell-root":{borderBottomColor:e.palette.background.paper}},actionCell:{width:"96px"},actionButton:{marginLeft:3,marginRight:3}}}));function lo(e){var t=e.task,a=oo(),n=Object(b.f)();return Object(je.jsxs)(xn.a,{className:a.root,selected:e.isSelected,onClick:function(){return n.push(F(t.queue,t.id))},children:[Object(je.jsx)(hn.a,{padding:"checkbox",onClick:function(e){return e.stopPropagation()},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{onChange:function(t){return e.onSelectChange(t.target.checked)},checked:e.isSelected})})}),Object(je.jsx)(hn.a,{component:"th",scope:"row",children:Na(t.id)}),Object(je.jsx)(hn.a,{children:t.type}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:t.payload})}),Object(je.jsx)(hn.a,{children:qa(t.last_failed_at)}),Object(je.jsx)(hn.a,{children:t.error_message}),Object(je.jsx)(hn.a,{align:"center",className:a.actionCell,onMouseEnter:e.onActionCellEnter,onMouseLeave:e.onActionCellLeave,onClick:function(e){return e.stopPropagation()},children:e.showActions?Object(je.jsxs)(r.a.Fragment,{children:[Object(je.jsx)(kn.a,{title:"Delete",children:Object(je.jsx)(_.a,{className:a.actionButton,onClick:e.onDeleteClick,disabled:t.requestPending||e.allActionPending,size:"small",children:Object(je.jsx)(_n.a,{fontSize:"small"})})}),Object(je.jsx)(kn.a,{title:"Run",children:Object(je.jsx)(_.a,{className:a.actionButton,onClick:e.onRunClick,disabled:t.requestPending||e.allActionPending,size:"small",children:Object(je.jsx)(Qi.a,{fontSize:"small"})})})]}):Object(je.jsx)(_.a,{size:"small",onClick:e.onActionCellEnter,children:Object(je.jsx)(En.a,{fontSize:"small"})})})]},t.id)}var uo=io((function(e){var t=e.pollInterval,a=e.listArchivedTasksAsync,r=e.queue,c=e.pageSize,s=co(),i=Object(n.useState)(0),o=Object(dn.a)(i,2),l=o[0],u=o[1],d=Object(n.useState)([]),j=Object(dn.a)(d,2),b=j[0],p=j[1],h=Object(n.useState)(""),O=Object(dn.a)(h,2),f=O[0],x=O[1];if(rr(Object(n.useCallback)((function(){a(r,{page:l+1,size:c})}),[l,c,r,a]),t),e.error.length>0)return Object(je.jsxs)(ve.a,{severity:"error",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Error"}),e.error]});if(0===e.tasks.length)return Object(je.jsxs)(ve.a,{severity:"info",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Info"}),"No archived tasks at this time."]});var g=[{key:"id",label:"ID",align:"left"},{key:"type",label:"Type",align:"left"},{key:"payload",label:"Payload",align:"left"},{key:"last_failed",label:"Last Failed",align:"left"},{key:"last_error",label:"Last Error",align:"left"},{key:"actions",label:"Actions",align:"center"}],k=e.tasks.length,v=b.length;return Object(je.jsxs)("div",{children:[Object(je.jsx)(Ci,{showIconButtons:v>0,iconButtonActions:[{tooltip:"Delete",icon:Object(je.jsx)(_n.a,{}),onClick:function(){e.batchDeleteArchivedTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending},{tooltip:"Run",icon:Object(je.jsx)(Qi.a,{}),onClick:function(){e.batchRunArchivedTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending}],menuItemActions:[{label:"Delete All",onClick:function(){e.deleteAllArchivedTasksAsync(r)},disabled:e.allActionPending},{label:"Run All",onClick:function(){e.runAllArchivedTasksAsync(r)},disabled:e.allActionPending}]}),Object(je.jsx)(On.a,{component:xe.a,children:Object(je.jsxs)(bn.a,{stickyHeader:!0,className:s.table,"aria-label":"archived tasks table",size:"small",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{padding:"checkbox",classes:{stickyHeader:s.stickyHeaderCell},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{indeterminate:v>0&&v<k,checked:k>0&&v===k,onChange:function(t){if(t.target.checked){var a=e.tasks.map((function(e){return e.id}));p(a)}else p([])},inputProps:{"aria-label":"select all tasks shown in the table"}})})}),g.map((function(e){return Object(je.jsx)(hn.a,{align:e.align,classes:{stickyHeader:s.stickyHeaderCell},children:e.label},e.key)}))]})}),Object(je.jsx)(pn.a,{children:e.tasks.map((function(t){return Object(je.jsx)(lo,{task:t,isSelected:b.includes(t.id),onSelectChange:function(e){p(e?b.concat(t.id):b.filter((function(e){return e!==t.id})))},onRunClick:function(){e.runArchivedTaskAsync(r,t.id)},onDeleteClick:function(){e.deleteArchivedTaskAsync(r,t.id)},allActionPending:e.allActionPending,onActionCellEnter:function(){return x(t.id)},onActionCellLeave:function(){return x("")},showActions:f===t.id},t.id)}))}),Object(je.jsx)(tc.a,{children:Object(je.jsx)(xn.a,{children:Object(je.jsx)(ac.a,{rowsPerPageOptions:he,colSpan:g.length+1,count:e.totalTaskCount,rowsPerPage:c,page:l,SelectProps:{inputProps:{"aria-label":"rows per page"},native:!0},onPageChange:function(e,t){u(t)},onRowsPerPageChange:function(t){e.taskRowsPerPageChange(parseInt(t.target.value,10)),u(0)},ActionsComponent:pe,className:s.pagination})})})]})})]})})),jo=Object(p.a)((function(e){return{table:{minWidth:650},stickyHeaderCell:{background:e.palette.background.paper},alert:{borderTopLeftRadius:0,borderTopRightRadius:0},pagination:{border:"none"}}}));var bo={listCompletedTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,n({type:Sc,queue:e}),a.next=4,ct(e,t);case 4:r=a.sent,n({type:Tc,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(0),console.error("listCompletedTasksAsync: ",Aa(a.t0)),n({type:_c,queue:e,error:Ea(a.t0)});case 12:case"end":return a.stop()}}),a,null,[[0,8]])})));return function(e){return a.apply(this,arguments)}}()},deleteCompletedTaskAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:xi,queue:e,taskId:t}),a.prev=1,a.next=4,ba(e,t);case 4:n({type:gi,queue:e,taskId:t}),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(1),console.error("deleteCompletedTaskAsync: ",Aa(a.t0)),n({type:ki,error:Ea(a.t0),queue:e,taskId:t});case 11:case"end":return a.stop()}}),a,null,[[1,7]])})));return function(e){return a.apply(this,arguments)}}()},deleteAllCompletedTasksAsync:function(e){return function(){var t=Object(Te.a)(Se.a.mark((function t(a){var n;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a({type:vi,queue:e}),t.prev=1,t.next=4,fa(e);case 4:n=t.sent,a({type:yi,deleted:n.deleted,queue:e}),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),console.error("deleteAllCompletedTasksAsync: ",Aa(t.t0)),a({type:mi,error:Ea(t.t0),queue:e});case 12:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(e){return t.apply(this,arguments)}}()},batchDeleteCompletedTasksAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:Si,queue:e,taskIds:t}),a.prev=1,a.next=4,ha(e,t);case 4:r=a.sent,n({type:Ti,queue:e,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("batchDeleteCompletedTasksAsync: ",Aa(a.t0)),n({type:_i,error:Ea(a.t0),queue:e,taskIds:t});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},taskRowsPerPageChange:te},po=Object(o.b)((function(e){return{loading:e.tasks.completedTasks.loading,error:e.tasks.completedTasks.error,tasks:e.tasks.completedTasks.data,batchActionPending:e.tasks.completedTasks.batchActionPending,allActionPending:e.tasks.completedTasks.allActionPending,pollInterval:e.settings.pollInterval,pageSize:e.settings.taskRowsPerPage}}),bo);var ho=Object(p.a)((function(e){return{root:{cursor:"pointer","&:hover":{boxShadow:e.shadows[2]},"&:hover .MuiTableCell-root":{borderBottomColor:e.palette.background.paper}},actionCell:{width:"96px"},actionButton:{marginLeft:3,marginRight:3}}}));function Oo(e){var t=e.task,a=ho(),n=Object(b.f)();return Object(je.jsxs)(xn.a,{className:a.root,selected:e.isSelected,onClick:function(){return n.push(F(t.queue,t.id))},children:[Object(je.jsx)(hn.a,{padding:"checkbox",onClick:function(e){return e.stopPropagation()},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{onChange:function(t){return e.onSelectChange(t.target.checked)},checked:e.isSelected})})}),Object(je.jsx)(hn.a,{component:"th",scope:"row",children:Na(t.id)}),Object(je.jsx)(hn.a,{children:t.type}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:t.payload})}),Object(je.jsx)(hn.a,{children:qa(t.completed_at)}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:t.result})}),Object(je.jsx)(hn.a,{children:t.ttl_seconds>0?"".concat(Ia(Ca(t.ttl_seconds))," left"):"expired"}),Object(je.jsx)(hn.a,{align:"center",className:a.actionCell,onMouseEnter:e.onActionCellEnter,onMouseLeave:e.onActionCellLeave,onClick:function(e){return e.stopPropagation()},children:e.showActions?Object(je.jsx)(r.a.Fragment,{children:Object(je.jsx)(kn.a,{title:"Delete",children:Object(je.jsx)(_.a,{className:a.actionButton,onClick:e.onDeleteClick,disabled:t.requestPending||e.allActionPending,size:"small",children:Object(je.jsx)(_n.a,{fontSize:"small"})})})}):Object(je.jsx)(_.a,{size:"small",onClick:e.onActionCellEnter,children:Object(je.jsx)(En.a,{fontSize:"small"})})})]},t.id)}var fo=po((function(e){var t=e.pollInterval,a=e.listCompletedTasksAsync,r=e.queue,c=e.pageSize,s=jo(),i=Object(n.useState)(0),o=Object(dn.a)(i,2),l=o[0],u=o[1],d=Object(n.useState)([]),j=Object(dn.a)(d,2),b=j[0],p=j[1],h=Object(n.useState)(""),O=Object(dn.a)(h,2),f=O[0],x=O[1];if(rr(Object(n.useCallback)((function(){a(r,{page:l+1,size:c})}),[l,c,r,a]),t),e.error.length>0)return Object(je.jsxs)(ve.a,{severity:"error",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Error"}),e.error]});if(0===e.tasks.length)return Object(je.jsxs)(ve.a,{severity:"info",className:s.alert,children:[Object(je.jsx)(ye.a,{children:"Info"}),"No completed tasks at this time."]});var g=[{key:"id",label:"ID",align:"left"},{key:"type",label:"Type",align:"left"},{key:"payload",label:"Payload",align:"left"},{key:"completed_at",label:"Completed",align:"left"},{key:"result",label:"Result",align:"left"},{key:"ttl",label:"TTL",align:"left"},{key:"actions",label:"Actions",align:"center"}],k=e.tasks.length,v=b.length;return Object(je.jsxs)("div",{children:[Object(je.jsx)(Ci,{showIconButtons:v>0,iconButtonActions:[{tooltip:"Delete",icon:Object(je.jsx)(_n.a,{}),onClick:function(){e.batchDeleteCompletedTasksAsync(r,b).then((function(){return p([])}))},disabled:e.batchActionPending}],menuItemActions:[{label:"Delete All",onClick:function(){e.deleteAllCompletedTasksAsync(r)},disabled:e.allActionPending}]}),Object(je.jsx)(On.a,{component:xe.a,children:Object(je.jsxs)(bn.a,{stickyHeader:!0,className:s.table,"aria-label":"archived tasks table",size:"small",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{padding:"checkbox",classes:{stickyHeader:s.stickyHeaderCell},children:Object(je.jsx)(_.a,{children:Object(je.jsx)(nc.a,{indeterminate:v>0&&v<k,checked:k>0&&v===k,onChange:function(t){if(t.target.checked){var a=e.tasks.map((function(e){return e.id}));p(a)}else p([])},inputProps:{"aria-label":"select all tasks shown in the table"}})})}),g.map((function(e){return Object(je.jsx)(hn.a,{align:e.align,classes:{stickyHeader:s.stickyHeaderCell},children:e.label},e.key)}))]})}),Object(je.jsx)(pn.a,{children:e.tasks.map((function(t){return Object(je.jsx)(Oo,{task:t,isSelected:b.includes(t.id),onSelectChange:function(e){p(e?b.concat(t.id):b.filter((function(e){return e!==t.id})))},onDeleteClick:function(){e.deleteCompletedTaskAsync(r,t.id)},allActionPending:e.allActionPending,onActionCellEnter:function(){return x(t.id)},onActionCellLeave:function(){return x("")},showActions:f===t.id},t.id)}))}),Object(je.jsx)(tc.a,{children:Object(je.jsx)(xn.a,{children:Object(je.jsx)(ac.a,{rowsPerPageOptions:he,colSpan:g.length+1,count:e.totalTaskCount,rowsPerPage:c,page:l,SelectProps:{inputProps:{"aria-label":"rows per page"},native:!0},onPageChange:function(e,t){u(t)},onRowsPerPageChange:function(t){e.taskRowsPerPageChange(parseInt(t.target.value,10)),u(0)},ActionsComponent:pe,className:s.pagination})})})]})})]})}));function xo(e){var t=e.children,a=e.value,n=e.selected,r=Object(Jr.a)(e,["children","value","selected"]);return Object(je.jsx)("div",Object(u.a)(Object(u.a)({role:"tabpanel",hidden:a!==n,id:"scrollable-auto-tabpanel-".concat(n),"aria-labelledby":"scrollable-auto-tab-".concat(n),style:{flex:1,overflowY:"scroll"}},r),{},{children:a===n&&t}))}var go=Object(o.b)((function(e,t){var a=e.queues.data.find((function(e){return e.name===t.queue}));return{currentStats:a?a.currentStats:{queue:t.queue,paused:!1,size:0,active:0,pending:0,scheduled:0,retry:0,archived:0,completed:0,processed:0,failed:0,timestamp:"n/a"}}})),ko=Object(p.a)((function(e){return{container:{width:"100%",height:"100%",background:e.palette.background.paper},header:{display:"flex",alignItems:"center",paddingTop:e.spacing(1)},heading:{paddingTop:e.spacing(1),paddingBottom:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},chip:{marginLeft:e.spacing(1)},taskcount:{fontSize:"12px",color:e.palette.text.secondary,background:fr(e)?"#303030":e.palette.background.default,textAlign:"center",padding:"3px 6px",borderRadius:"10px",marginLeft:"2px"},searchbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},search:{position:"relative",width:"312px",borderRadius:"18px",backgroundColor:fr(e)?"#303030":e.palette.grey[100],"&:hover, &:focus":{backgroundColor:fr(e)?"#303030":e.palette.grey[200]}},searchIcon:{padding:e.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},inputRoot:{color:"inherit",width:"100%"},inputInput:{padding:e.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(e.spacing(4),"px)"),width:"100%",fontSize:"0.85rem"}}}));var vo=go((function(e){var t=e.currentStats,a=ko(),r=Object(b.f)(),c=[{key:"active",label:"Active",count:t.active},{key:"pending",label:"Pending",count:t.pending},{key:"scheduled",label:"Scheduled",count:t.scheduled},{key:"retry",label:"Retry",count:t.retry},{key:"archived",label:"Archived",count:t.archived},{key:"completed",label:"Completed",count:t.completed}],s=Object(n.useState)(""),i=Object(dn.a)(s,2),o=i[0],l=i[1];return Object(je.jsxs)(xe.a,{variant:"outlined",className:a.container,children:[Object(je.jsxs)("div",{className:a.header,children:[Object(je.jsx)(T.a,{color:"textPrimary",className:a.heading,children:"Tasks"}),Object(je.jsx)("div",{children:c.map((function(t){return Object(je.jsx)(Xr.a,{className:a.chip,label:Object(je.jsxs)("div",{children:[t.label," ",Object(je.jsx)("span",{className:a.taskcount,children:t.count})]}),variant:"outlined",color:e.selected===t.key?"primary":"default",onClick:function(){return r.push(W(e.queue,t.key))}},t.key)}))}),Object(je.jsx)("div",{className:a.searchbar,children:Object(je.jsxs)("div",{className:a.search,children:[Object(je.jsx)("div",{className:a.searchIcon,children:Object(je.jsx)(ec.a,{})}),Object(je.jsx)($r.a,{placeholder:"Search by ID",classes:{root:a.inputRoot,input:a.inputInput},value:o,onChange:function(e){l(e.target.value)},inputProps:{"aria-label":"search",onKeyDown:function(t){"Enter"===t.key&&r.push(F(e.queue,o.trim()))}}})]})})]}),Object(je.jsx)(xo,{value:"active",selected:e.selected,children:Object(je.jsx)(Di,{queue:e.queue})}),Object(je.jsx)(xo,{value:"pending",selected:e.selected,children:Object(je.jsx)(Vi,{queue:e.queue,totalTaskCount:t.pending})}),Object(je.jsx)(xo,{value:"scheduled",selected:e.selected,children:Object(je.jsx)($i,{queue:e.queue,totalTaskCount:t.scheduled})}),Object(je.jsx)(xo,{value:"retry",selected:e.selected,children:Object(je.jsx)(ro,{queue:e.queue,totalTaskCount:t.retry})}),Object(je.jsx)(xo,{value:"archived",selected:e.selected,children:Object(je.jsx)(uo,{queue:e.queue,totalTaskCount:t.archived})}),Object(je.jsx)(xo,{value:"completed",selected:e.selected,children:Object(je.jsx)(fo,{queue:e.queue,totalTaskCount:t.completed})})]})})),yo=Object(p.a)((function(e){return{banner:{paddingTop:e.spacing(2),paddingBottom:e.spacing(2),display:"flex"},bannerItem:{flexGrow:1,borderLeft:"1px solid ".concat(e.palette.divider),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}}));var mo=Object(o.b)((function(e,t){var a=e.queues.data.find((function(e){return e.name===t.qname}));return{queue:null===a||void 0===a?void 0:a.currentStats}}))((function(e){var t=yo(),a=e.queue,n=e.qname;return Object(je.jsxs)("div",{className:t.banner,children:[Object(je.jsxs)("div",{className:t.bannerItem,children:[Object(je.jsx)(T.a,{variant:"subtitle2",color:"textPrimary",gutterBottom:!0,children:"Queue name"}),Object(je.jsx)(T.a,{color:"textSecondary",children:n})]}),Object(je.jsxs)("div",{className:t.bannerItem,children:[Object(je.jsx)(T.a,{variant:"subtitle2",color:"textPrimary",gutterBottom:!0,children:"Queue state"}),Object(je.jsx)(T.a,{color:"textSecondary",children:a?a.paused?"paused":"run":"-"})]}),Object(je.jsxs)("div",{className:t.bannerItem,children:[Object(je.jsx)(T.a,{variant:"subtitle2",color:"textPrimary",gutterBottom:!0,children:"Queue size"}),Object(je.jsx)(T.a,{color:"textSecondary",children:a?a.size:"-"})]}),Object(je.jsxs)("div",{className:t.bannerItem,children:[Object(je.jsx)(T.a,{variant:"subtitle2",color:"textPrimary",gutterBottom:!0,children:"Memory usage"}),Object(je.jsx)(T.a,{color:"textSecondary",children:a?Hn()(a.memory_usage_bytes):"-"})]}),Object(je.jsxs)("div",{className:t.bannerItem,children:[Object(je.jsx)(T.a,{variant:"subtitle2",color:"textPrimary",gutterBottom:!0,children:"Processed"}),Object(je.jsx)(T.a,{color:"textSecondary",children:a?a.processed:"-"})]}),Object(je.jsxs)("div",{className:t.bannerItem,children:[Object(je.jsx)(T.a,{variant:"subtitle2",color:"textPrimary",gutterBottom:!0,children:"Failed"}),Object(je.jsx)(T.a,{color:"textSecondary",children:a?a.failed:"-"})]}),Object(je.jsxs)("div",{className:t.bannerItem,children:[Object(je.jsx)(T.a,{variant:"subtitle2",color:"textPrimary",gutterBottom:!0,children:"Error rate"}),Object(je.jsx)(T.a,{color:"textSecondary",children:a?Da(a.failed,a.processed):"-"})]})]})})),So=a(18),To=a(894),_o=a(342),Ao=a.n(_o),Eo=Object(Qn.a)((function(e){return{root:{backgroundColor:fr(e)?"#303030":e.palette.background.default,height:e.spacing(3),color:e.palette.text.secondary,fontWeight:e.typography.fontWeightRegular,"&:hover, &:focus":{backgroundColor:e.palette.action.hover},"&:active":{boxShadow:e.shadows[1],backgroundColor:Object(So.c)(e.palette.action.hover,.12)}}}}))(Xr.a);function Co(e){var t=Object(b.f)(),a=Object(n.useState)(null),r=Object(dn.a)(a,2),c=r[0],s=r[1],i=function(e){e.preventDefault(),s(e.currentTarget)},o=function(){s(null)};return Object(je.jsxs)(je.Fragment,{children:[Object(je.jsxs)(To.a,{"aria-label":"breadcrumb",children:[Object(je.jsx)(Eo,{component:j.b,to:Q.HOME,label:"Queues",onClick:function(){return t.push(Q.HOME)}}),Object(je.jsx)(Eo,{label:e.queueName,deleteIcon:Object(je.jsx)(Ao.a,{}),onClick:i,onDelete:i}),e.taskId&&Object(je.jsx)(Eo,{label:"task:".concat(e.taskId)})]}),Object(je.jsx)(Ai.a,{id:"queue-breadcrumb-menu",anchorEl:c,keepMounted:!0,open:Boolean(c),onClose:o,children:e.queues.sort().map((function(e){return Object(je.jsx)(er.a,{onClick:function(){t.push(W(e)),o()},children:e},e)}))})]})}var Ro=Object(o.b)((function(e){return{queues:e.queues.data.map((function(e){return e.name}))}}),{listQueuesAsync:Ya}),Io=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(2)},breadcrumbs:{marginBottom:e.spacing(2)},banner:{marginBottom:e.spacing(2)},tasksTable:{marginBottom:e.spacing(4)}}}));var wo=["active","pending","scheduled","retry","archived","completed"];var qo=Ro((function(e){var t=Io(),a=Object(b.h)().qname,r=new URLSearchParams(Object(b.g)().search).get("status");r&&wo.includes(r)||(r="active");var c=e.listQueuesAsync;return Object(n.useEffect)((function(){c()}),[c]),Object(je.jsx)(Oe.a,{maxWidth:"lg",children:Object(je.jsxs)(fe.a,{container:!0,spacing:0,className:t.container,children:[Object(je.jsx)(fe.a,{item:!0,xs:12,className:t.breadcrumbs,children:Object(je.jsx)(Co,{queues:e.queues,queueName:a})}),Object(je.jsx)(fe.a,{item:!0,xs:12,className:t.banner,children:Object(je.jsx)(mo,{qname:a})}),Object(je.jsx)(fe.a,{item:!0,xs:12,className:t.tasksTable,children:Object(je.jsx)(vo,{queue:a,selected:r})})]})})})),Po=a(343),No=a.n(Po);var Do=Object(o.b)((function(e){return{loading:e.tasks.taskInfo.loading,error:e.tasks.taskInfo.error,taskInfo:e.tasks.taskInfo.data,pollInterval:e.settings.pollInterval,queues:e.queues.data.map((function(e){return e.name}))}}),{getTaskInfoAsync:function(e,t){return function(){var a=Object(Te.a)(Se.a.mark((function a(n){var r;return Se.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n({type:sc}),a.prev=1,a.next=4,Ke(e,t);case 4:r=a.sent,n({type:ic,payload:r}),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(1),console.error("getTaskInfoAsync: ",Aa(a.t0)),n({type:oc,error:Ea(a.t0)});case 12:case"end":return a.stop()}}),a,null,[[1,8]])})));return function(e){return a.apply(this,arguments)}}()},listQueuesAsync:Ya}),Lo=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(2)},alert:{borderTopLeftRadius:0,borderTopRightRadius:0},paper:{padding:e.spacing(2),marginTop:e.spacing(2)},breadcrumbs:{marginBottom:e.spacing(2)},infoRow:{display:"flex",alignItems:"center",paddingTop:e.spacing(1)},infoKeyCell:{width:"140px"},infoValueCell:{width:"auto"},footer:{paddingTop:e.spacing(3),paddingBottom:e.spacing(3)}}}));var Bo=Do((function(e){var t=Lo(),a=Object(b.h)(),r=a.qname,c=a.taskId,s=e.getTaskInfoAsync,i=e.pollInterval,o=e.listQueuesAsync,l=e.taskInfo,u=Object(b.f)();return rr(Object(n.useMemo)((function(){return function(){s(r,c)}}),[r,c,s]),i),Object(n.useEffect)((function(){o()}),[o]),Object(je.jsx)(Oe.a,{maxWidth:"lg",className:t.container,children:Object(je.jsxs)(fe.a,{container:!0,spacing:0,children:[Object(je.jsx)(fe.a,{item:!0,xs:12,className:t.breadcrumbs,children:Object(je.jsx)(Co,{queues:e.queues,queueName:r,taskId:c})}),Object(je.jsxs)(fe.a,{item:!0,xs:12,md:6,children:[e.error?Object(je.jsxs)(ve.a,{severity:"error",className:t.alert,children:[Object(je.jsx)(ye.a,{children:"Error"}),e.error]}):Object(je.jsxs)(xe.a,{className:t.paper,variant:"outlined",children:[Object(je.jsx)(T.a,{variant:"h6",children:"Task Info"}),Object(je.jsxs)("div",{children:[Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["ID:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:null===l||void 0===l?void 0:l.id})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Type:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:null===l||void 0===l?void 0:l.type})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["State:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:null===l||void 0===l?void 0:l.state})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Queue:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:null===l||void 0===l?void 0:l.queue})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Retry:"," "]}),Object(je.jsxs)(T.a,{className:t.infoValueCell,children:[null===l||void 0===l?void 0:l.retried,"/",null===l||void 0===l?void 0:l.max_retry]})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Last Failure:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:(null===l||void 0===l?void 0:l.last_failed_at)?Object(je.jsxs)(T.a,{children:[null===l||void 0===l?void 0:l.error_message," (",null===l||void 0===l?void 0:l.last_failed_at,")"]}):Object(je.jsx)(T.a,{children:" - "})})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Next Process Time:"," "]}),(null===l||void 0===l?void 0:l.next_process_at)?Object(je.jsx)(T.a,{children:null===l||void 0===l?void 0:l.next_process_at}):Object(je.jsx)(T.a,{children:" - "})]})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Timeout:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:(null===l||void 0===l?void 0:l.timeout_seconds)?Object(je.jsxs)(T.a,{children:[null===l||void 0===l?void 0:l.timeout_seconds," seconds"]}):Object(je.jsx)(T.a,{children:" - "})})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Deadline:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:(null===l||void 0===l?void 0:l.deadline)?Object(je.jsx)(T.a,{children:null===l||void 0===l?void 0:l.deadline}):Object(je.jsx)(T.a,{children:" - "})})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Payload:"," "]}),Object(je.jsx)("div",{className:t.infoValueCell,children:(null===l||void 0===l?void 0:l.payload)&&Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:l.payload})})]}),"completed"===(null===l||void 0===l?void 0:l.state)&&Object(je.jsxs)(je.Fragment,{children:[Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Completed:"," "]}),Object(je.jsx)("div",{className:t.infoValueCell,children:Object(je.jsxs)(T.a,{children:[qa(l.completed_at)," (",l.completed_at,")"]})})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["Result:"," "]}),Object(je.jsx)("div",{className:t.infoValueCell,children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0,maxWidth:400},children:l.result})})]}),Object(je.jsxs)("div",{className:t.infoRow,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",className:t.infoKeyCell,children:["TTL:"," "]}),Object(je.jsx)(T.a,{className:t.infoValueCell,children:Object(je.jsx)(T.a,{children:l.ttl_seconds>0?"".concat(Ia(Ca(l.ttl_seconds))," left"):"expired"})})]})]})]}),Object(je.jsx)("div",{className:t.footer,children:Object(je.jsx)(Cn.a,{startIcon:Object(je.jsx)(No.a,{}),onClick:function(){return u.goBack()},children:"Go Back"})})]})]})})})),Ho=a(895),Uo=a(344),Ko=a.n(Uo),zo=a(888),Go=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(4),paddingBottom:e.spacing(4)},paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column"},formControl:{margin:e.spacing(1),display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center"},selectEmpty:{marginTop:e.spacing(2)},select:{width:"200px"}}}));var Vo={pollIntervalChange:function(e){return{type:J,value:e}},selectTheme:function(e){return{type:X,value:e}}};var Mo,Qo=Object(o.b)((function(e){return{pollInterval:e.settings.pollInterval,themePreference:e.settings.themePreference}}),Vo)((function(e){var t=Go(),a=Object(n.useState)(e.pollInterval),r=Object(dn.a)(a,2),c=r[0],s=r[1];return Object(je.jsx)(Oe.a,{maxWidth:"lg",className:t.container,children:Object(je.jsxs)(fe.a,{container:!0,spacing:3,justify:"center",children:[Object(je.jsx)(fe.a,{item:!0,xs:1}),Object(je.jsx)(fe.a,{item:!0,xs:6,children:Object(je.jsx)(T.a,{variant:"h5",color:"textPrimary",children:"Settings"})}),Object(je.jsx)(fe.a,{item:!0,xs:5}),Object(je.jsx)(fe.a,{item:!0,xs:1}),Object(je.jsx)(fe.a,{item:!0,xs:6,children:Object(je.jsxs)(xe.a,{className:t.paper,variant:"outlined",children:[Object(je.jsx)(T.a,{color:"textPrimary",children:"Polling Interval"}),Object(je.jsx)(T.a,{gutterBottom:!0,color:"textSecondary",variant:"subtitle1",children:"Web UI will fetch live data with the specified interval"}),Object(je.jsxs)(T.a,{gutterBottom:!0,color:"textSecondary",variant:"subtitle1",children:["Currently: Every"," ",1===c?"second":"".concat(c," seconds")]}),Object(je.jsx)(Ho.a,{value:c,onChange:function(e,t){s(t)},onChangeCommitted:function(t,a){e.pollIntervalChange(a)},"aria-labelledby":"continuous-slider",valueLabelDisplay:"auto",step:1,marks:!0,min:2,max:20})]})}),Object(je.jsx)(fe.a,{xs:5}),Object(je.jsx)(fe.a,{item:!0,xs:1}),Object(je.jsx)(fe.a,{item:!0,xs:6,children:Object(je.jsx)(xe.a,{className:t.paper,variant:"outlined",children:Object(je.jsxs)(Ko.a,{variant:"outlined",className:t.formControl,children:[Object(je.jsx)(T.a,{color:"textPrimary",children:"Dark Theme"}),Object(je.jsxs)(zo.a,{labelId:"theme-label",id:"theme-selected",value:e.themePreference,onChange:function(t){e.selectTheme(t.target.value)},label:"theme preference",className:t.select,children:[Object(je.jsx)(er.a,{value:jr.SystemDefault,children:"System Default"}),Object(je.jsx)(er.a,{value:jr.Always,children:"Always"}),Object(je.jsx)(er.a,{value:jr.Never,children:"Never"})]})]})})}),Object(je.jsx)(fe.a,{item:!0,xs:5})]})})})),Wo=a(899),Fo=a(880),Yo=a(346),Jo=a.n(Yo),Xo=a(345),$o=a.n(Xo),Zo=Object(p.a)((function(e){return{table:{minWidth:650},fixedCell:{position:"sticky",zIndex:1,left:0,background:e.palette.background.paper}}}));!function(e){e[e.HostPID=0]="HostPID",e[e.Status=1]="Status",e[e.ActiveWorkers=2]="ActiveWorkers",e[e.Queues=3]="Queues",e[e.Started=4]="Started"}(Mo||(Mo={}));var el=[{label:"Host:PID",key:"host",sortBy:Mo.HostPID,align:"left"},{label:"Started",key:"started",sortBy:Mo.Started,align:"left"},{label:"Status",key:"status",sortBy:Mo.Status,align:"left"},{label:"Queues",key:"queues",sortBy:Mo.Queues,align:"left"},{label:"Active Workers",key:"workers",sortBy:Mo.ActiveWorkers,align:"left"}];function tl(e,t){var a=Object(jn.a)(e);return a.sort(t),a}function al(e){var t=Zo(),a=Object(n.useState)(Mo.HostPID),r=Object(dn.a)(a,2),c=r[0],s=r[1],i=Object(n.useState)(Nn.Asc),o=Object(dn.a)(i,2),l=o[0],u=o[1];return 0===e.servers.length?Object(je.jsxs)(ve.a,{severity:"info",children:[Object(je.jsx)(ye.a,{children:"Info"}),"No servers found at this time."]}):Object(je.jsx)(On.a,{children:Object(je.jsxs)(bn.a,{className:t.table,"aria-label":"server info table",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[el.map((function(e,a){return Object(je.jsx)(hn.a,{align:e.align,className:Object(d.default)(0===a&&t.fixedCell),children:Object(je.jsx)(gn.a,{active:e.sortBy===c,direction:l,onClick:(n=e.sortBy,function(e){if(n===c){var t=l===Nn.Asc?Nn.Desc:Nn.Asc;u(t)}else s(n)}),children:e.label})},e.key);var n})),Object(je.jsx)(hn.a,{})]})}),Object(je.jsx)(pn.a,{children:tl(e.servers,(function(e,t){var a=!1;switch(c){case Mo.HostPID:if(e.host===t.host&&e.pid===t.pid)return 0;a=e.host===t.host?e.pid<t.pid:e.host<t.host;break;case Mo.Started:var n=Date.parse(e.start_time),r=Date.parse(t.start_time);if(n===r)return 0;a=n<r;break;case Mo.Status:if(e.status===t.status)return 0;a=e.status<t.status;break;case Mo.Queues:var s=Object.keys(e.queue_priorities).join(","),i=Object.keys(t.queue_priorities).join(",");if(s===i)return 0;a=s<i;break;case Mo.ActiveWorkers:if(e.active_workers.length===t.active_workers.length)return 0;a=e.active_workers.length<t.active_workers.length;break;default:throw"Unexpected order by value: ".concat(c)}return l===Nn.Asc?a?-1:1:a?1:-1})).map((function(e){return Object(je.jsx)(rl,{server:e},e.id)}))})]})})}var nl=Object(p.a)((function(e){return{rowRoot:{"& > *":{borderBottom:"unset"}},noBorder:{border:"none"},link:{color:e.palette.text.primary}}}));function rl(e){var t=nl(),a=e.server,c=Object(n.useState)(!1),s=Object(dn.a)(c,2),i=s[0],o=s[1],l=Object.keys(a.queue_priorities);return Object(je.jsxs)(r.a.Fragment,{children:[Object(je.jsxs)(xn.a,{className:t.rowRoot,children:[Object(je.jsxs)(hn.a,{children:[a.host,":",a.pid]}),Object(je.jsx)(hn.a,{children:qa(a.start_time)}),Object(je.jsx)(hn.a,{children:a.status}),Object(je.jsx)(hn.a,{children:l.map((function(e,a){return Object(je.jsxs)("span",{children:[Object(je.jsx)(j.b,{to:W(e),className:t.link,children:e}),a===l.length-1?"":", "]},e)}))}),Object(je.jsxs)(hn.a,{children:[a.active_workers.length,"/",a.concurrency]}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(kn.a,{title:i?"Hide Details":"Show Details",children:Object(je.jsx)(_.a,{"aria-label":"expand row",size:"small",onClick:function(){return o(!i)},children:i?Object(je.jsx)($o.a,{}):Object(je.jsx)(Jo.a,{})})})})]}),Object(je.jsx)(xn.a,{className:t.rowRoot,children:Object(je.jsx)(hn.a,{style:{paddingBottom:0,paddingTop:0},colSpan:6,children:Object(je.jsx)(Fo.a,{in:i,timeout:"auto",unmountOnExit:!0,children:Object(je.jsxs)(fe.a,{container:!0,spacing:2,children:[Object(je.jsxs)(fe.a,{item:!0,xs:9,children:[Object(je.jsx)(T.a,{variant:"subtitle1",gutterBottom:!0,color:"textSecondary",children:"Active Workers"}),Object(je.jsxs)(bn.a,{size:"small","aria-label":"active workers",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{children:"Task ID"}),Object(je.jsx)(hn.a,{children:"Task Payload"}),Object(je.jsx)(hn.a,{children:"Queue"}),Object(je.jsx)(hn.a,{children:"Started"})]})}),Object(je.jsx)(pn.a,{children:a.active_workers.map((function(e){return Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{component:"th",scope:"row",children:Na(e.task_id)}),Object(je.jsx)(hn.a,{children:Object(je.jsx)(Ar,{language:"json",customStyle:{margin:0},children:e.task_payload})}),Object(je.jsx)(hn.a,{children:e.queue}),Object(je.jsx)(hn.a,{children:qa(e.start_time)})]},e.task_id)}))})]})]}),Object(je.jsxs)(fe.a,{item:!0,xs:3,children:[Object(je.jsx)(T.a,{variant:"subtitle1",gutterBottom:!0,color:"textSecondary",children:"Queue Priority"}),Object(je.jsxs)(bn.a,{size:"small","aria-label":"active workers",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{children:"Queue"}),Object(je.jsx)(hn.a,{align:"right",children:"Priority"})]})}),Object(je.jsx)(pn.a,{children:l.map((function(e){return Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{children:Object(je.jsx)(j.b,{to:W(e),className:t.link,children:e})}),Object(je.jsx)(hn.a,{align:"right",children:a.queue_priorities[e]})]},e)}))})]}),Object(je.jsxs)(Wo.a,{margin:2,children:[Object(je.jsxs)(T.a,{variant:"subtitle2",component:"span",children:["Strict Priority:"," "]}),Object(je.jsx)(T.a,{variant:"button",component:"span",children:a.strict_priority_enabled?"ON":"OFF"})]})]})]})})})})]})}var cl="LIST_SERVERS_BEGIN",sl="LIST_SERVERS_SUCCESS",il="LIST_SERVERS_ERROR";var ol=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(4),paddingBottom:e.spacing(4)},paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column"},heading:{paddingLeft:e.spacing(2),marginBottom:e.spacing(1)}}}));var ll=Object(o.b)((function(e){return{loading:e.servers.loading,error:e.servers.error,servers:e.servers.data,pollInterval:e.settings.pollInterval}}),{listServersAsync:function(){return function(){var e=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:cl}),e.prev=1,e.next=4,ga();case 4:a=e.sent,t({type:sl,payload:a}),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.error("listServersAsync: ".concat(Aa(e.t0))),t({type:il,error:Ea(e.t0)});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()}})((function(e){var t=e.pollInterval,a=e.listServersAsync,n=ol();return rr(a,t),Object(je.jsx)(Oe.a,{maxWidth:"lg",className:n.container,children:Object(je.jsx)(fe.a,{container:!0,spacing:3,children:""===e.error?Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsxs)(xe.a,{className:n.paper,variant:"outlined",children:[Object(je.jsx)(T.a,{variant:"h6",className:n.heading,children:"Servers"}),Object(je.jsx)(al,{servers:e.servers})]})}):Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsxs)(ve.a,{severity:"error",children:[Object(je.jsx)(ye.a,{children:"Error"}),"Could not retrieve servers live data \u2014"," ",Object(je.jsx)("strong",{children:"See the logs for details"})]})})})})})),ul=a(882),dl=a(883),jl="GET_REDIS_INFO_BEGIN",bl="GET_REDIS_INFO_SUCCESS",pl="GET_REDIS_INFO_ERROR";var hl=Object(p.a)((function(e){return{table:{minWidth:650}}}));function Ol(e){var t=hl();return Object(je.jsx)(On.a,{children:Object(je.jsxs)(bn.a,{className:t.table,"aria-label":"queue location table",children:[Object(je.jsx)(fn.a,{children:Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{children:"Queue"}),Object(je.jsx)(hn.a,{children:"KeySlot"}),Object(je.jsx)(hn.a,{children:"Node Addresses"})]})}),Object(je.jsx)(pn.a,{children:e.queueLocations.map((function(e){return Object(je.jsxs)(xn.a,{children:[Object(je.jsx)(hn.a,{component:"th",scope:"row",children:e.queue}),Object(je.jsx)(hn.a,{children:e.keyslot}),Object(je.jsx)(hn.a,{children:e.nodes.join(", ")})]},e.queue)}))})]})})}var fl=a(881),xl=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(4),paddingBottom:e.spacing(4)}}}));function gl(e){var t=e.redisInfo;return Object(je.jsxs)(je.Fragment,{children:[Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsx)(T.a,{variant:"h6",color:"textSecondary",children:"Server"})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Version",content:t.redis_version})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Uptime",content:"".concat(t.uptime_in_days," days")})}),Object(je.jsx)(fe.a,{item:!0,xs:6}),Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsx)(T.a,{variant:"h6",color:"textSecondary",children:"Memory"})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Used Memory",content:t.used_memory_human})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Peak Memory Used",content:t.used_memory_peak_human})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Memory Fragmentation Ratio",content:t.mem_fragmentation_ratio})}),Object(je.jsx)(fe.a,{item:!0,xs:3}),Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsx)(T.a,{variant:"h6",color:"textSecondary",children:"Connections"})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Connected Clients",content:t.connected_clients})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Connected Replicas",content:t.connected_slaves})}),Object(je.jsx)(fe.a,{item:!0,xs:6}),Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsx)(T.a,{variant:"h6",color:"textSecondary",children:"Persistence"})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Last Save to Disk",content:Pa(parseInt(t.rdb_last_save_time))})}),Object(je.jsx)(fe.a,{item:!0,xs:3,children:Object(je.jsx)(kl,{title:"Number of Changes Since Last Dump",content:t.rdb_changes_since_last_save})}),Object(je.jsx)(fe.a,{item:!0,xs:6})]})}function kl(e){return Object(je.jsx)(ul.a,{variant:"outlined",children:Object(je.jsxs)(dl.a,{children:[Object(je.jsx)(T.a,{gutterBottom:!0,color:"textPrimary",variant:"h5",align:"center",children:e.content}),Object(je.jsx)(T.a,{color:"textSecondary",variant:"subtitle2",align:"center",children:e.title})]})})}var vl=Object(o.b)((function(e){return{loading:e.redis.loading,error:e.redis.error,redisInfo:e.redis.data,redisAddress:e.redis.address,redisInfoRaw:e.redis.rawData,redisClusterEnabled:e.redis.cluster,redisClusterNodesRaw:e.redis.rawClusterNodes,queueLocations:e.redis.queueLocations,pollInterval:e.settings.pollInterval,themePreference:e.settings.themePreference}}),{getRedisInfoAsync:function(){return function(){var e=Object(Te.a)(Se.a.mark((function e(t){var a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:jl}),e.prev=1,e.next=4,Ta();case 4:a=e.sent,t({type:bl,payload:a}),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.error("getRedisInfoAsync: ".concat(Aa(e.t0))),t({type:pl,error:Ea(e.t0)});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()}})((function(e){var t=xl(),a=e.pollInterval,n=e.getRedisInfoAsync,r=e.redisInfo,c=e.redisInfoRaw,s=e.redisClusterEnabled,i=e.redisClusterNodesRaw,o=e.queueLocations;return rr(n,a),Object(je.jsx)(Oe.a,{maxWidth:"lg",className:t.container,children:Object(je.jsx)(fe.a,{container:!0,spacing:3,children:""===e.error?Object(je.jsxs)(je.Fragment,{children:[Object(je.jsxs)(fe.a,{item:!0,xs:12,children:[Object(je.jsx)(T.a,{variant:"h5",color:"textPrimary",children:s?"Redis Cluster Info":"Redis Info"}),!s&&Object(je.jsxs)(T.a,{variant:"subtitle1",color:"textSecondary",children:["Connected to: ",e.redisAddress]})]}),o&&o.length>0&&Object(je.jsxs)(fe.a,{item:!0,xs:12,children:[Object(je.jsx)(T.a,{variant:"h6",color:"textSecondary",children:"Queue Location in Cluster"}),Object(je.jsx)(Ol,{queueLocations:o})]}),i&&Object(je.jsx)(je.Fragment,{children:Object(je.jsxs)(fe.a,{item:!0,xs:12,children:[Object(je.jsxs)(T.a,{variant:"h6",color:"textSecondary",children:[Object(je.jsx)(fl.a,{href:"https://redis.io/commands/cluster-nodes",target:"_",children:"CLUSTER NODES"})," ","Command Output"]}),Object(je.jsx)(Ar,{language:"yaml",children:i})]})}),r&&!s&&Object(je.jsx)(gl,{redisInfo:r}),c&&Object(je.jsx)(je.Fragment,{children:Object(je.jsxs)(fe.a,{item:!0,xs:6,children:[Object(je.jsxs)(T.a,{variant:"h6",color:"textSecondary",children:[s?Object(je.jsx)(fl.a,{href:"https://redis.io/commands/cluster-info",target:"_",children:"CLUSTER INFO"}):Object(je.jsx)(fl.a,{href:"https://redis.io/commands/info",target:"_",children:"INFO"})," ","Command Output"]}),Object(je.jsx)(Ar,{language:"yaml",children:c})]})})]}):Object(je.jsx)(fe.a,{item:!0,xs:12,children:Object(je.jsxs)(ve.a,{severity:"error",children:[Object(je.jsx)(ye.a,{children:"Error"}),"Could not retrieve redis live data \u2014"," ",Object(je.jsx)("strong",{children:"See the logs for details"})]})})})})})),yl="GET_METRICS_BEGIN",ml="GET_METRICS_SUCCESS",Sl="GET_METRICS_ERROR";var Tl=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(4),paddingBottom:e.spacing(4)}}}));var _l=function(){var e=Tl();return Object(n.useEffect)((function(){console.log("DEBUG: getting metrics...")}),[]),Object(je.jsx)(Oe.a,{maxWidth:"lg",className:e.container,children:Object(je.jsx)(fe.a,{container:!0,spacing:3,children:Object(je.jsx)(fe.a,{item:!0,xs:12,children:"Hello Metrics"})})})},Al=Object(p.a)((function(e){return{container:{paddingTop:e.spacing(4),paddingBottom:e.spacing(4)},headingText:{fontWeight:"bold"}}}));function El(){var e=Al();return Object(je.jsx)(Oe.a,{maxWidth:"lg",className:e.container,children:Object(je.jsx)(fe.a,{container:!0,spacing:3,children:Object(je.jsxs)(fe.a,{item:!0,xs:12,children:[Object(je.jsx)(T.a,{variant:"h5",align:"center",className:e.headingText,children:"Oops!"}),Object(je.jsx)(T.a,{variant:"subtitle1",color:"textSecondary",align:"center",children:"404 - Page Not Found"})]})})})}var Cl={closeSnackbar:function(){return{type:xr}},toggleDrawer:function(){return{type:$}}};function Rl(e){return Object(je.jsx)(A.a,Object(u.a)(Object(u.a)({},e),{},{direction:"up"}))}var Il=Object(o.b)((function(e){return{snackbar:e.snackbar,themePreference:e.settings.themePreference,isDrawerOpen:e.settings.isDrawerOpen}}),Cl)((function(e){var t=function(e){var t=Object(Or.a)("(prefers-color-scheme: dark)");return e===jr.Always?t=!0:e===jr.Never&&(t=!1),Object(Y.a)({palette:{primary:{main:"#4379FF"},secondary:{main:"#97FBD1"},background:{default:"#f5f7f9"},type:t?"dark":"light"}})}(e.themePreference),a=function(e){return Object(p.a)({root:{display:"flex"},toolbar:{paddingRight:24},toolbarIcon:Object(u.a)({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 8px"},e.mixins.toolbar),appBar:{backgroundColor:e.palette.background.paper,zIndex:e.zIndex.drawer+1},menuButton:{marginRight:e.spacing(1),color:fr(e)?e.palette.grey[100]:e.palette.grey[700]},menuButtonHidden:{display:"none"},title:{flexGrow:1},drawerPaper:{position:"relative",whiteSpace:"nowrap",width:220,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),border:"none"},drawerPaperClose:Object(l.a)({overflowX:"hidden",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),width:e.spacing(7)},e.breakpoints.up("sm"),{width:e.spacing(9)}),snackbar:{background:e.palette.grey.A400,color:"#ffffff"},snackbarCloseIcon:{color:e.palette.grey[400]},appBarSpacer:e.mixins.toolbar,mainContainer:{display:"flex",width:"100vw"},content:{flex:1,height:"100vh",overflow:"hidden",background:e.palette.background.paper},contentWrapper:{height:"100%",display:"flex",paddingTop:"64px",overflow:"scroll"},sidebarContainer:{display:"flex",justifyContent:"space-between",height:"100%",flexDirection:"column"},listItem:{borderTopRightRadius:"24px",borderBottomRightRadius:"24px"}})}(t)();return Object(je.jsx)(h.a,{theme:t,children:Object(je.jsx)(j.a,{children:Object(je.jsxs)("div",{className:a.root,children:[Object(je.jsx)(O.a,{position:"absolute",className:a.appBar,variant:"outlined",children:Object(je.jsxs)(x.a,{className:a.toolbar,children:[Object(je.jsx)(_.a,{edge:"start",color:"inherit","aria-label":"open drawer",onClick:e.toggleDrawer,className:a.menuButton,children:Object(je.jsx)(C.a,{})}),Object(je.jsx)(T.a,{component:"h1",variant:"h6",noWrap:!0,className:a.title,color:"textPrimary",children:"Asynq Monitoring"})]})}),Object(je.jsxs)("div",{className:a.mainContainer,children:[Object(je.jsxs)(f.a,{variant:"permanent",classes:{paper:Object(d.default)(a.drawerPaper,!e.isDrawerOpen&&a.drawerPaperClose)},open:e.isDrawerOpen,children:[Object(je.jsx)(m.a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},open:e.snackbar.isOpen,autoHideDuration:6e3,onClose:e.closeSnackbar,TransitionComponent:Rl,children:Object(je.jsx)(S.a,{message:e.snackbar.message,className:a.snackbar,action:Object(je.jsx)(_.a,{size:"small","aria-label":"close",color:"inherit",onClick:e.closeSnackbar,children:Object(je.jsx)(M.a,{className:a.snackbarCloseIcon,fontSize:"small"})})})}),Object(je.jsx)("div",{className:a.appBarSpacer}),Object(je.jsxs)("div",{className:a.sidebarContainer,children:[Object(je.jsx)(g.a,{children:Object(je.jsxs)("div",{children:[Object(je.jsx)(kr,{to:Q.HOME,primary:"Queues",icon:Object(je.jsx)(I.a,{})}),Object(je.jsx)(kr,{to:Q.SERVERS,primary:"Servers",icon:Object(je.jsx)(G.a,{})}),Object(je.jsx)(kr,{to:Q.SCHEDULERS,primary:"Schedulers",icon:Object(je.jsx)(L.a,{})}),Object(je.jsx)(kr,{to:Q.REDIS,primary:"Redis",icon:Object(je.jsx)(q.a,{})}),window.PROMETHEUS_SERVER_ADDRESS&&Object(je.jsx)(kr,{to:Q.METRICS,primary:"Metrics",icon:Object(je.jsx)(K.a,{})})]})}),Object(je.jsxs)(g.a,{children:[Object(je.jsx)(kr,{to:Q.SETTINGS,primary:"Settings",icon:Object(je.jsx)(N.a,{})}),Object(je.jsxs)(k.a,{button:!0,component:"a",className:a.listItem,href:"https://github.com/hibiken/asynqmon/issues",target:"_blank",children:[Object(je.jsx)(v.a,{children:Object(je.jsx)(H.a,{})}),Object(je.jsx)(y.a,{primary:"Send Feedback"})]})]})]})]}),Object(je.jsx)("main",{className:a.content,children:Object(je.jsx)("div",{className:a.contentWrapper,children:Object(je.jsxs)(b.c,{children:[Object(je.jsx)(b.a,{exact:!0,path:Q.TASK_DETAILS,children:Object(je.jsx)(Bo,{})}),Object(je.jsx)(b.a,{exact:!0,path:Q.QUEUE_DETAILS,children:Object(je.jsx)(qo,{})}),Object(je.jsx)(b.a,{exact:!0,path:Q.SCHEDULERS,children:Object(je.jsx)(Yr,{})}),Object(je.jsx)(b.a,{exact:!0,path:Q.SERVERS,children:Object(je.jsx)(ll,{})}),Object(je.jsx)(b.a,{exact:!0,path:Q.REDIS,children:Object(je.jsx)(vl,{})}),Object(je.jsx)(b.a,{exact:!0,path:Q.SETTINGS,children:Object(je.jsx)(Qo,{})}),Object(je.jsx)(b.a,{exact:!0,path:Q.HOME,children:Object(je.jsx)(br,{})}),Object(je.jsx)(b.a,{exact:!0,path:Q.METRICS,children:Object(je.jsx)(_l,{})}),Object(je.jsx)(b.a,{path:"*",children:Object(je.jsx)(El,{})})]})})})]})]})})})})),wl=a(92),ql=a(358),Pl={data:[],loading:!1,error:""};var Nl=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case La:return Object(u.a)(Object(u.a)({},e),{},{loading:!0});case Ba:var a=t.payload.queues;return Object(u.a)(Object(u.a)({},e),{},{loading:!1,error:"",data:a.map((function(e){return{name:e.queue,currentStats:e,requestPending:!1}}))});case Ha:return Object(u.a)(Object(u.a)({},e),{},{loading:!1,error:t.error});case Ua:case Ga:case Qa:var n=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}));return Object(u.a)(Object(u.a)({},e),{},{data:n});case Ka:var r=e.data.filter((function(e){return e.name!==t.queue}));return Object(u.a)(Object(u.a)({},e),{},{data:r});case Va:var c=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1,currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{paused:!0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:c});case Wa:var s=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1,currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{paused:!1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:s});case za:case Ma:case Fa:var i=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}));return Object(u.a)(Object(u.a)({},e),{},{data:i});case uc:case bc:case Oc:case gc:case yc:var o=e.data.filter((function(e){return e.name!==t.queue})).concat({name:t.queue,currentStats:t.payload.stats,requestPending:!1});return Object(u.a)(Object(u.a)({},e),{},{data:o});case Lc:var l=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+1,scheduled:e.currentStats.scheduled-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:l});case Uc:var d=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+1,retry:e.currentStats.retry-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:d});case Gc:var j=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+1,archived:e.currentStats.archived-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:j});case Yc:var b=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+1,pending:e.currentStats.pending-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:b});case ts:var p=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+1,scheduled:e.currentStats.scheduled-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:p});case rs:var h=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+1,retry:e.currentStats.retry-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:h});case Qc:var O=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-1,pending:e.currentStats.pending-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:O});case $c:var f=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-1,scheduled:e.currentStats.scheduled-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:f});case is:var x=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+t.payload.archived_ids.length,pending:e.currentStats.pending-t.payload.archived_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:x});case us:var g=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.payload.deleted_ids.length,pending:e.currentStats.pending-t.payload.deleted_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:g});case Os:var k=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+e.currentStats.pending,pending:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:k});case bs:var v=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.deleted,pending:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:v});case gs:var y=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+t.payload.pending_ids.length,scheduled:e.currentStats.scheduled-t.payload.pending_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:y});case ys:var m=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+t.payload.archived_ids.length,scheduled:e.currentStats.scheduled-t.payload.archived_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:m});case Ts:var S=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.payload.deleted_ids.length,scheduled:e.currentStats.scheduled-t.payload.deleted_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:S});case Es:var T=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+e.currentStats.scheduled,scheduled:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:T});case Is:var _=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+e.currentStats.scheduled,scheduled:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:_});case Ps:var A=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.deleted,scheduled:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:A});case Ls:var E=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-1,retry:e.currentStats.retry-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:E});case Us:var C=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+t.payload.pending_ids.length,retry:e.currentStats.retry-t.payload.pending_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:C});case Gs:var R=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.pending+t.payload.archived_ids.length,retry:e.currentStats.retry-t.payload.archived_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:R});case Qs:var I=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.payload.deleted_ids.length,retry:e.currentStats.retry-t.payload.deleted_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:I});case Ys:var w=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+e.currentStats.retry,retry:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:w});case $s:var q=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{archived:e.currentStats.archived+e.currentStats.retry,retry:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:q});case ti:var P=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.deleted,retry:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:P});case ri:var N=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-1,archived:e.currentStats.archived-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:N});case gi:var D=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-1,completed:e.currentStats.completed-1})})}));return Object(u.a)(Object(u.a)({},e),{},{data:D});case ii:var L=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+t.payload.pending_ids.length,archived:e.currentStats.archived-t.payload.pending_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:L});case ui:var B=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.payload.deleted_ids.length,archived:e.currentStats.archived-t.payload.deleted_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:B});case Ti:var H=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.payload.deleted_ids.length,completed:e.currentStats.completed-t.payload.deleted_ids.length})})}));return Object(u.a)(Object(u.a)({},e),{},{data:H});case bi:var U=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{pending:e.currentStats.pending+e.currentStats.archived,archived:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:U});case Oi:var K=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.deleted,archived:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:K});case yi:var z=e.data.map((function(e){return e.name!==t.queue?e:Object(u.a)(Object(u.a)({},e),{},{currentStats:Object(u.a)(Object(u.a)({},e.currentStats),{},{size:e.currentStats.size-t.deleted,completed:0})})}));return Object(u.a)(Object(u.a)({},e),{},{data:z});default:return e}},Dl={activeTasks:{loading:!1,batchActionPending:!1,allActionPending:!1,error:"",data:[]},pendingTasks:{loading:!1,batchActionPending:!1,allActionPending:!1,error:"",data:[]},scheduledTasks:{loading:!1,batchActionPending:!1,allActionPending:!1,error:"",data:[]},retryTasks:{loading:!1,batchActionPending:!1,allActionPending:!1,error:"",data:[]},archivedTasks:{loading:!1,batchActionPending:!1,allActionPending:!1,error:"",data:[]},completedTasks:{loading:!1,batchActionPending:!1,allActionPending:!1,error:"",data:[]},taskInfo:{loading:!1,error:""}};var Ll=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case sc:return Object(u.a)(Object(u.a)({},e),{},{taskInfo:Object(u.a)(Object(u.a)({},e.taskInfo),{},{loading:!0})});case oc:return Object(u.a)(Object(u.a)({},e),{},{taskInfo:{loading:!1,error:t.error}});case ic:return Object(u.a)(Object(u.a)({},e),{},{taskInfo:{loading:!1,error:"",data:t.payload}});case lc:return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{loading:!0})});case uc:return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{loading:!1,error:"",data:t.payload.tasks.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{canceling:!1,requestPending:!1})}))})});case dc:return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{loading:!1,error:t.error,data:[]})});case jc:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{loading:!0})});case bc:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{loading:!1,error:"",data:t.payload.tasks.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case pc:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{loading:!1,error:t.error,data:[]})});case hc:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{loading:!0})});case Oc:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{loading:!1,error:"",data:t.payload.tasks.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case fc:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{loading:!1,error:t.error,data:[]})});case xc:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{loading:!0})});case gc:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{loading:!1,error:"",data:t.payload.tasks.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case kc:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{loading:!1,error:t.error,data:[]})});case vc:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{loading:!0})});case yc:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{loading:!1,error:"",data:t.payload.tasks.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case mc:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{loading:!1,error:t.error,data:[]})});case Sc:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{loading:!0})});case Tc:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{loading:!1,error:"",data:t.payload.tasks.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case _c:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{loading:!1,error:t.error,data:[]})});case xi:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{data:e.completedTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}))})});case gi:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{data:e.completedTasks.data.filter((function(e){return e.id!==t.taskId}))})});case ki:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{data:e.completedTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case vi:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{allActionPending:!0})});case yi:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{allActionPending:!1,data:[]})});case mi:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{allActionPending:!1})});case Si:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{batchActionPending:!0,data:e.completedTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!0}):e}))})});case Ti:var a=e.completedTasks.data.filter((function(e){return!t.payload.deleted_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{batchActionPending:!1,data:a})});case _i:return Object(u.a)(Object(u.a)({},e),{},{completedTasks:Object(u.a)(Object(u.a)({},e.completedTasks),{},{batchActionPending:!1,data:e.completedTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!1}):e}))})});case Ac:var n=e.activeTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{data:n})});case Ec:var r=e.activeTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1,canceling:!0})}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{data:r})});case Cc:var c=e.activeTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{data:c})});case qc:var s=e.activeTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!0}):e}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{batchActionPending:!0,data:s})});case Pc:var i=e.activeTasks.data.map((function(e){return t.payload.canceled_ids.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{canceling:!0,requestPending:!1}):t.payload.error_ids.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!1}):e}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{batchActionPending:!1,data:i})});case Nc:var o=e.activeTasks.data.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{batchActionPending:!1,data:o})});case Rc:var l=e.activeTasks.data.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{allActionPending:!0,data:l})});case Ic:var d=e.activeTasks.data.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1,canceling:!0})}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{allActionPending:!1,data:d})});case wc:var j=e.activeTasks.data.map((function(e){return Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}));return Object(u.a)(Object(u.a)({},e),{},{activeTasks:Object(u.a)(Object(u.a)({},e.activeTasks),{},{allActionPending:!1,data:j})});case Fc:case Mc:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{data:e.pendingTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}))})});case Yc:case Qc:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{data:e.pendingTasks.data.filter((function(e){return e.id!==t.taskId}))})});case Jc:case Wc:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{data:e.pendingTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case hs:case js:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{allActionPending:!0})});case Os:case bs:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{allActionPending:!1,data:[]})});case fs:case ps:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{allActionPending:!1})});case ss:case ls:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{batchActionPending:!0,data:e.pendingTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!0}):e}))})});case is:var b=e.pendingTasks.data.filter((function(e){return!t.payload.archived_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{batchActionPending:!1,data:b})});case us:var p=e.pendingTasks.data.filter((function(e){return!t.payload.deleted_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{batchActionPending:!1,data:p})});case os:case ds:return Object(u.a)(Object(u.a)({},e),{},{pendingTasks:Object(u.a)(Object(u.a)({},e.pendingTasks),{},{batchActionPending:!1,data:e.pendingTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!1}):e}))})});case Dc:case es:case Xc:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{data:e.scheduledTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}))})});case Lc:case ts:case $c:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{data:e.scheduledTasks.data.filter((function(e){return e.id!==t.taskId}))})});case Bc:case as:case Zc:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{data:e.scheduledTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case As:case Rs:case qs:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{allActionPending:!0})});case Es:case Is:case Ps:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{allActionPending:!1,data:[]})});case Cs:case ws:case Ns:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{allActionPending:!1})});case xs:case vs:case Ss:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{batchActionPending:!0,data:e.scheduledTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!0}):e}))})});case gs:var h=e.scheduledTasks.data.filter((function(e){return!t.payload.pending_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{batchActionPending:!1,data:h})});case ys:var O=e.scheduledTasks.data.filter((function(e){return!t.payload.archived_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{batchActionPending:!1,data:O})});case Ts:var f=e.scheduledTasks.data.filter((function(e){return!t.payload.deleted_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{batchActionPending:!1,data:f})});case ks:case ms:case _s:return Object(u.a)(Object(u.a)({},e),{},{scheduledTasks:Object(u.a)(Object(u.a)({},e.scheduledTasks),{},{batchActionPending:!1,data:e.scheduledTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!1}):e}))})});case Hc:case ns:case Ds:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{data:e.retryTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}))})});case Uc:case rs:case Ls:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{data:e.retryTasks.data.filter((function(e){return e.id!==t.taskId}))})});case Kc:case cs:case Bs:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{data:e.retryTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case Fs:case Xs:case ei:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{allActionPending:!0})});case Ys:case $s:case ti:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{allActionPending:!1,data:[]})});case Js:case Zs:case ai:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{allActionPending:!1})});case Hs:case zs:case Ms:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{batchActionPending:!0,data:e.retryTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!0}):e}))})});case Us:var x=e.retryTasks.data.filter((function(e){return!t.payload.pending_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{batchActionPending:!1,data:x})});case Gs:var g=e.retryTasks.data.filter((function(e){return!t.payload.archived_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{batchActionPending:!1,data:g})});case Qs:var k=e.retryTasks.data.filter((function(e){return!t.payload.deleted_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{batchActionPending:!1,data:k})});case Ks:case Vs:case Ws:return Object(u.a)(Object(u.a)({},e),{},{retryTasks:Object(u.a)(Object(u.a)({},e.retryTasks),{},{batchActionPending:!1,data:e.retryTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!1}):e}))})});case zc:case ni:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{data:e.archivedTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!0})}))})});case Gc:case ri:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{data:e.archivedTasks.data.filter((function(e){return e.id!==t.taskId}))})});case Vc:case ci:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{data:e.archivedTasks.data.map((function(e){return e.id!==t.taskId?e:Object(u.a)(Object(u.a)({},e),{},{requestPending:!1})}))})});case ji:case hi:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{allActionPending:!0})});case bi:case Oi:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{allActionPending:!1,data:[]})});case pi:case fi:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{allActionPending:!1})});case si:case li:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{batchActionPending:!0,data:e.archivedTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!0}):e}))})});case ii:var v=e.archivedTasks.data.filter((function(e){return!t.payload.pending_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{batchActionPending:!1,data:v})});case ui:var y=e.archivedTasks.data.filter((function(e){return!t.payload.deleted_ids.includes(e.id)}));return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{batchActionPending:!1,data:y})});case oi:case di:return Object(u.a)(Object(u.a)({},e),{},{archivedTasks:Object(u.a)(Object(u.a)({},e.archivedTasks),{},{batchActionPending:!1,data:e.archivedTasks.data.map((function(e){return t.taskIds.includes(e.id)?Object(u.a)(Object(u.a)({},e),{},{requestPending:!1}):e}))})});default:return e}},Bl={loading:!1,error:"",data:[]};var Hl={isOpen:!1,message:""};var Ul=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case xr:return Object(u.a)(Object(u.a)({},e),{},{isOpen:!1});case Pc:var a=t.payload.canceled_ids.length;return{isOpen:!0,message:"Cancelation signal sent to ".concat(a," ").concat(1===a?"task":"tasks")};case Ic:return{isOpen:!0,message:"Cancelation signal sent to all tasks in ".concat(t.queue," queue")};case Lc:return{isOpen:!0,message:"Scheduled task is now pending"};case Uc:return{isOpen:!0,message:"Retry task is now pending"};case Gc:return{isOpen:!0,message:"Archived task is now pending"};case Yc:return{isOpen:!0,message:"Pending task is now archived"};case ts:return{isOpen:!0,message:"Scheduled task is now archived"};case rs:return{isOpen:!0,message:"Retry task is now archived"};case Qc:return{isOpen:!0,message:"Pending task deleted"};case $c:return{isOpen:!0,message:"Scheduled task deleted"};case gs:var n=t.payload.pending_ids.length;return{isOpen:!0,message:"".concat(n," scheduled ").concat(1===n?"task is":"tasks are"," now pending")};case is:var r=t.payload.archived_ids.length;return{isOpen:!0,message:"".concat(r," pending ").concat(1===r?"task is":"tasks are"," now archived")};case us:var c=t.payload.deleted_ids.length;return{isOpen:!0,message:"".concat(c," pending ").concat(1===c?"task":"tasks"," deleted")};case ys:var s=t.payload.archived_ids.length;return{isOpen:!0,message:"".concat(s," scheduled ").concat(1===s?"task is":"tasks are"," now archived")};case Ts:var i=t.payload.deleted_ids.length;return{isOpen:!0,message:"".concat(i," scheduled ").concat(1===i?"task":"tasks"," deleted")};case Os:return{isOpen:!0,message:"All pending tasks are now archived"};case bs:return{isOpen:!0,message:"All pending tasks deleted"};case Es:return{isOpen:!0,message:"All scheduled tasks are now pending"};case Is:return{isOpen:!0,message:"All scheduled tasks are now archived"};case Ps:return{isOpen:!0,message:"All scheduled tasks deleted"};case Ls:return{isOpen:!0,message:"Retry task deleted"};case Us:var o=t.payload.pending_ids.length;return{isOpen:!0,message:"".concat(o," retry ").concat(1===o?"task is":"tasks are"," now pending")};case Gs:var l=t.payload.archived_ids.length;return{isOpen:!0,message:"".concat(l," retry ").concat(1===l?"task is":"tasks are"," now archived")};case Qs:var d=t.payload.deleted_ids.length;return{isOpen:!0,message:"".concat(d," retry ").concat(1===d?"task":"tasks"," deleted")};case Ys:return{isOpen:!0,message:"All retry tasks are now pending"};case $s:return{isOpen:!0,message:"All retry tasks are now archived"};case ti:return{isOpen:!0,message:"All retry tasks deleted"};case ri:return{isOpen:!0,message:"Archived task deleted"};case ii:var j=t.payload.pending_ids.length;return{isOpen:!0,message:"".concat(j," archived ").concat(1===j?"task is":"tasks are"," now pending")};case ui:var b=t.payload.deleted_ids.length;return{isOpen:!0,message:"".concat(b," archived ").concat(1===b?"task":"tasks"," deleted")};case bi:return{isOpen:!0,message:"All archived tasks are now pending"};case Oi:return{isOpen:!0,message:"All archived tasks deleted"};case gi:return{isOpen:!0,message:"Completed task deleted"};case yi:return{isOpen:!0,message:"All completed tasks deleted"};case Ti:var p=t.payload.deleted_ids.length;return{isOpen:!0,message:"".concat(p," completed ").concat(1===p?"task":"tasks"," deleted")};default:return e}},Kl={loading:!1,data:{}};function zl(e,t){var a=new Date(e),n=new Date(t);return a.getUTCDate()===n.getUTCDate()&&a.getUTCMonth()===n.getUTCMonth()&&a.getUTCFullYear()===n.getUTCFullYear()}var Gl={loading:!1,error:"",address:"",data:null,rawData:null,cluster:!1,rawClusterNodes:null,queueLocations:null};var Vl={loading:!1,error:"",data:null};var Ml="asynqmon:state";var Ql=Object(wl.b)({settings:hr,queues:Nl,tasks:Ll,servers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case cl:return Object(u.a)(Object(u.a)({},e),{},{loading:!0});case sl:return{loading:!1,error:"",data:t.payload.servers};case il:return Object(u.a)(Object(u.a)({},e),{},{error:t.error,loading:!1});default:return e}},schedulerEntries:Br,snackbar:Ul,queueStats:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Kl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Xa:return Object(u.a)(Object(u.a)({},e),{},{loading:!0});case $a:return{data:t.payload.stats,loading:!1};case Za:return Object(u.a)(Object(u.a)({},e),{},{loading:!1});case Ba:var a,n=Object(u.a)({},e.data),r=Object(cr.a)(t.payload.queues);try{var c=function(){var e=a.value,t=n[e.queue];if(!t)return"continue";var r=t.map((function(t){return zl(t.date,e.timestamp)?Object(u.a)(Object(u.a)({},t),{},{processed:e.processed,failed:e.failed}):t}));n[e.queue]=r};for(r.s();!(a=r.n()).done;)c()}catch(s){r.e(s)}finally{r.f()}return Object(u.a)(Object(u.a)({},e),{},{data:n});default:return e}},redis:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case jl:return Object(u.a)(Object(u.a)({},e),{},{loading:!0});case pl:return Object(u.a)(Object(u.a)({},e),{},{loading:!1,error:t.error});case bl:return{loading:!1,error:"",address:t.payload.address,data:t.payload.info,rawData:t.payload.raw_info,cluster:t.payload.cluster,rawClusterNodes:t.payload.raw_cluster_nodes,queueLocations:t.payload.queue_locations};default:return e}},metrics:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yl:return Object(u.a)(Object(u.a)({},e),{},{loading:!0});case Sl:return Object(u.a)(Object(u.a)({},e),{},{loading:!1,error:t.error});case ml:return{loading:!1,error:"",data:t.payload};default:return e}}}),Wl=function(){try{var e=localStorage.getItem(Ml);if(null===e)return{};var t=JSON.parse(e);return{settings:Object(u.a)(Object(u.a)({},pr),t.settings||{})}}catch(a){return console.log("loadState: could not load state ",a),{}}}(),Fl=Object(ql.a)({reducer:Ql,preloadedState:Wl});Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var Yl=void 0;Fl.subscribe((function(){Yl!==(Yl=Fl.getState().settings)&&function(e){try{var t=JSON.stringify({settings:e.settings});localStorage.setItem(Ml,t)}catch(a){console.error("saveState: could not save state: ",a)}}(Fl.getState())})),s.a.render(Object(je.jsxs)(r.a.StrictMode,{children:[Object(je.jsx)(i.a,{}),Object(je.jsx)(o.a,{store:Fl,children:Object(je.jsx)(Il,{})})]}),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[803,1,2]]]);
|
|
//# sourceMappingURL=main.aac2a828.chunk.js.map
|