@ytsaurus/ui 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/public/build/assets-manifest.json +39 -39
  2. package/dist/public/build/css/{9030.30b67fe6.chunk.css → 3792.a5336147.chunk.css} +1 -1
  3. package/dist/public/build/css/{9030.30b67fe6.chunk.css.map → 3792.a5336147.chunk.css.map} +1 -1
  4. package/dist/public/build/js/2142.9a9a44af.chunk.js +2 -0
  5. package/dist/public/build/js/2142.9a9a44af.chunk.js.map +1 -0
  6. package/dist/public/build/js/3225.0ca5646d.chunk.js +2 -0
  7. package/dist/public/build/js/3225.0ca5646d.chunk.js.map +1 -0
  8. package/dist/public/build/js/{9030.200c7642.chunk.js → 3792.1af8dc36.chunk.js} +2 -2
  9. package/dist/public/build/js/{9030.200c7642.chunk.js.map → 3792.1af8dc36.chunk.js.map} +1 -1
  10. package/dist/public/build/js/3848.db687afa.chunk.js +2 -0
  11. package/dist/public/build/js/3848.db687afa.chunk.js.map +1 -0
  12. package/dist/public/build/js/{9361.f5606246.chunk.js → 9361.632ac658.chunk.js} +3 -3
  13. package/dist/public/build/js/9361.632ac658.chunk.js.map +1 -0
  14. package/dist/public/build/js/acl.86dde5b4.chunk.js +2 -0
  15. package/dist/public/build/js/acl.86dde5b4.chunk.js.map +1 -0
  16. package/dist/public/build/js/{chart-kit.6c826f92.chunk.js → chart-kit.bc706a72.chunk.js} +2 -2
  17. package/dist/public/build/js/{chart-kit.6c826f92.chunk.js.map → chart-kit.bc706a72.chunk.js.map} +1 -1
  18. package/dist/public/build/js/{cluster-page-wrapper.24759f54.chunk.js → cluster-page-wrapper.69410672.chunk.js} +2 -2
  19. package/dist/public/build/js/{cluster-page-wrapper.24759f54.chunk.js.map → cluster-page-wrapper.69410672.chunk.js.map} +1 -1
  20. package/dist/public/build/js/{dashboard.5baf76be.chunk.js → dashboard.705aef5e.chunk.js} +2 -2
  21. package/dist/public/build/js/{dashboard.5baf76be.chunk.js.map → dashboard.705aef5e.chunk.js.map} +1 -1
  22. package/dist/public/build/js/{incarnations.db35d3e7.chunk.js → incarnations.b6c8305d.chunk.js} +2 -2
  23. package/dist/public/build/js/incarnations.b6c8305d.chunk.js.map +1 -0
  24. package/dist/public/build/js/main.2691b74a.js +3 -0
  25. package/dist/public/build/js/main.2691b74a.js.map +1 -0
  26. package/dist/public/build/js/navigation.b95d53a4.chunk.js +2 -0
  27. package/dist/public/build/js/navigation.b95d53a4.chunk.js.map +1 -0
  28. package/dist/public/build/js/{runtime.0bd241cc.js → runtime.cd2507d5.js} +2 -2
  29. package/dist/public/build/js/{runtime.0bd241cc.js.map → runtime.cd2507d5.js.map} +1 -1
  30. package/dist/public/build/js/settings-panel.5508764a.chunk.js +2 -0
  31. package/dist/public/build/js/settings-panel.5508764a.chunk.js.map +1 -0
  32. package/dist/public/build/js/{yt-df-dialog.3c75c1c6.chunk.js → yt-df-dialog.d8b77493.chunk.js} +3 -3
  33. package/dist/public/build/js/yt-df-dialog.d8b77493.chunk.js.map +1 -0
  34. package/dist/public/build/js/yt-queries-list.9b028808.chunk.js +2 -0
  35. package/dist/public/build/js/yt-queries-list.9b028808.chunk.js.map +1 -0
  36. package/dist/public/build/manifest.json +34 -34
  37. package/package.json +2 -2
  38. package/dist/public/build/js/2142.e3f4501e.chunk.js +0 -2
  39. package/dist/public/build/js/2142.e3f4501e.chunk.js.map +0 -1
  40. package/dist/public/build/js/3225.1bafd8e7.chunk.js +0 -2
  41. package/dist/public/build/js/3225.1bafd8e7.chunk.js.map +0 -1
  42. package/dist/public/build/js/3792.87728e87.chunk.js +0 -2
  43. package/dist/public/build/js/3792.87728e87.chunk.js.map +0 -1
  44. package/dist/public/build/js/9361.f5606246.chunk.js.map +0 -1
  45. package/dist/public/build/js/acl.ad72cb19.chunk.js +0 -2
  46. package/dist/public/build/js/acl.ad72cb19.chunk.js.map +0 -1
  47. package/dist/public/build/js/incarnations.db35d3e7.chunk.js.map +0 -1
  48. package/dist/public/build/js/main.10db4a06.js +0 -3
  49. package/dist/public/build/js/main.10db4a06.js.map +0 -1
  50. package/dist/public/build/js/navigation.dd0f8fc8.chunk.js +0 -2
  51. package/dist/public/build/js/navigation.dd0f8fc8.chunk.js.map +0 -1
  52. package/dist/public/build/js/settings-panel.4be91fef.chunk.js +0 -2
  53. package/dist/public/build/js/settings-panel.4be91fef.chunk.js.map +0 -1
  54. package/dist/public/build/js/yt-df-dialog.3c75c1c6.chunk.js.map +0 -1
  55. package/dist/public/build/js/yt-queries-list.e40d766e.chunk.js +0 -2
  56. package/dist/public/build/js/yt-queries-list.e40d766e.chunk.js.map +0 -1
  57. /package/dist/public/build/js/{9361.f5606246.chunk.js.LICENSE.txt → 9361.632ac658.chunk.js.LICENSE.txt} +0 -0
  58. /package/dist/public/build/js/{main.10db4a06.js.LICENSE.txt → main.2691b74a.js.LICENSE.txt} +0 -0
  59. /package/dist/public/build/js/{yt-df-dialog.3c75c1c6.chunk.js.LICENSE.txt → yt-df-dialog.d8b77493.chunk.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ (self.webpackChunk_ytsaurus_ui=self.webpackChunk_ytsaurus_ui||[]).push([[999,3848],{3764:(e,t,n)=>{"use strict";n.d(t,{Cj:()=>o,gL:()=>c});var r=n(53775),i=n(28407),s=n(77810),a=n(33882);n(64772),n(13717),n(64922),n(95976);var o=(0,a.A)(s.lazy((0,i.A)((0,r.A)().mark((function e(){return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all([n.e(8096),n.e(9202)]).then(n.bind(n,72042)));case 1:case"end":return e.stop()}}),e)}))))),l=["rgb(77, 162, 241)","rgb(255, 61, 100)"];function c(e){return l[e%l.length]}},5800:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(40319),i=n(18801),s=(n(77810),n(15647)),a=n(97536),o=n(57614),l=n(92611);const c=JSON.parse('{"tooltip-content":"Show attributes"}'),u=JSON.parse('{"tooltip-content":"Показать аттрибуты"}'),d=(0,l.Kc)("yt:attributes-button",{en:c,ru:u});var p=n(64922),h=["title","getPathProps","path","exactPath","attribute","attributes","openAttributesModal","withTooltip","tooltipProps"];const m=(0,s.Ng)(null,{openAttributesModal:o.V6})((function(e){var t=e.title,n=e.getPathProps,s=void 0===n?function(){return{}}:n,o=e.path,l=e.exactPath,c=e.attribute,u=e.attributes,m=e.openAttributesModal,f=e.withTooltip,v=void 0===f||f,g=e.tooltipProps,b=void 0===g?{placement:"bottom-end",content:d("tooltip-content")}:g,A=(0,i.A)(e,h);return(0,p.jsx)(a.A,(0,r.A)((0,r.A)({},A),{},{tooltipProps:b,withTooltip:v,onClick:function(){var e=(0,r.A)({path:o,exactPath:l},s());m((0,r.A)((0,r.A)({title:t},e),{},{attribute:c,attributes:u}))}}))}))},9331:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(77810),i=n(76872),s=n(88787),a=n(64922),o=(0,i.A)("expand-icon");function l(e){var t=e.className,n=e.data,i=e.expanded,l=e.visible,c=e.onClick,u=i?"angle-up":"angle-down",d=r.useCallback((function(){c&&c(n,i)}),[n,c,i]);return(0,a.jsx)("span",{className:o({visible:Boolean(l),clickable:void 0!==c},t),onClick:d,children:(0,a.jsx)(s.A,{awesome:u})})}},11687:(e,t,n)=>{"use strict";n.d(t,{F:()=>S});var r=n(64922),i=n(72890),s=n(6542),a=n(84099),o=n(32235),l=n(17774),c=n(40590),u=n(70243),d=n(77810);const p=d.createContext(null),h=()=>{const e=d.useContext(p);if(!e)throw new Error('Alert: `useAlertContext` hook is used out of "AlertContext"');return e},m=e=>{const{view:t}=h();return(0,r.jsx)(s.$,Object.assign({view:"filled"===t?"normal-contrast":void 0},e))};const f=(0,n(21086).om)("alert"),v=({layout:e,view:t,children:n})=>(0,r.jsx)(p.Provider,{value:{layout:e,view:t},children:n});var g=n(12663);var b=n(44315);var A=n(16822);var x=n(71182);const y={danger:{filled:e=>d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),d.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14M6.53 5.47a.75.75 0 0 0-1.06 1.06L6.94 8 5.47 9.47a.75.75 0 1 0 1.06 1.06L8 9.06l1.47 1.47a.75.75 0 1 0 1.06-1.06L9.06 8l1.47-1.47a.75.75 0 1 0-1.06-1.06L8 6.94z",clipRule:"evenodd"})),outlined:e=>d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),d.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.5 8a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0M6.53 5.47a.75.75 0 0 0-1.06 1.06L6.94 8 5.47 9.47a.75.75 0 1 0 1.06 1.06L8 9.06l1.47 1.47a.75.75 0 1 0 1.06-1.06L9.06 8l1.47-1.47a.75.75 0 1 0-1.06-1.06L8 6.94z",clipRule:"evenodd"}))},info:{filled:e=>d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),d.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0M8 7.75a.75.75 0 0 1 .75.75V11a.75.75 0 0 1-1.5 0V8.5A.75.75 0 0 1 8 7.75",clipRule:"evenodd"})),outlined:g.A},success:{filled:e=>d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),d.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m3.1-8.55a.75.75 0 1 0-1.2-.9L7.419 8.858 6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z",clipRule:"evenodd"})),outlined:b.A},warning:{filled:e=>d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),d.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.835 2.244c.963-1.665 3.367-1.665 4.33 0l4.916 8.505c.964 1.666-.24 3.751-2.164 3.751H3.083c-1.925 0-3.128-2.085-2.165-3.751zM8 5a.75.75 0 0 1 .75.75v2a.75.75 0 1 1-1.5 0v-2A.75.75 0 0 1 8 5m1 5.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0",clipRule:"evenodd"})),outlined:A.A},utility:{filled:e=>d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),d.createElement("path",{fill:"currentColor",d:"m14.61 6.914-7.632 8.08a1.614 1.614 0 0 1-2.69-1.66L5.5 10H2.677A1.677 1.677 0 0 1 1.12 7.7l2.323-5.807A2.22 2.22 0 0 1 5.5.5h4c.968 0 1.637.967 1.298 1.873L10 4.5h3.569a1.431 1.431 0 0 1 1.04 2.414"})),outlined:x.A},normal:null};var j=n(89648),w=n(37338);const k=JSON.parse('{"label_close":"Close"}'),_=JSON.parse('{"label_close":"Закрыть"}'),C=(0,w.N)({en:k,ru:_},"Alert"),S=e=>{const{theme:t="normal",view:n="filled",layout:d="vertical",message:p,className:h,corners:m,style:g,onClose:b,align:A,qa:x}=e;return(0,r.jsx)(v,{layout:d,view:n,children:(0,r.jsx)(a.Z,{style:g,className:f({corners:m},(0,c.Y)({py:4,px:5},h)),theme:t,view:n,qa:x,children:(0,r.jsxs)(u.s,{gap:"3",alignItems:A,children:[void 0===e.icon?(0,r.jsx)(S.Icon,{theme:t,view:n}):e.icon,(0,r.jsxs)(u.s,{direction:"vertical"===d?"column":"row",gap:"5",grow:!0,children:[(0,r.jsx)(u.s,{gap:"2",grow:!0,className:f("text-content"),children:(0,r.jsxs)(u.s,{direction:"column",gap:"1",grow:!0,justifyContent:A,children:["string"==typeof e.title?(0,r.jsx)(S.Title,{text:e.title}):e.title,p]})}),Array.isArray(e.actions)?(0,r.jsx)(S.Actions,{items:e.actions}):e.actions]}),b&&(0,r.jsx)(s.$,{view:"flat",className:f("close-btn"),onClick:b,extraProps:{"aria-label":C("label_close")},children:(0,r.jsx)(o.I,{data:i.A,size:18,className:(0,l.$)({color:"secondary"})})})]})})})};S.Icon=({className:e,theme:t,view:n="filled",size:i=18})=>{const s=y[t];if(!s)return null;let a;return"success"===t?a="positive":"normal"!==t&&(a=t),(0,r.jsx)("div",{className:f("icon",(0,l.$)({color:a},e)),children:(0,r.jsx)(o.I,{data:s[n],size:i})})},S.Title=({text:e,className:t})=>(0,r.jsx)(j.E,{variant:"subheader-2",className:f("title",t),children:e}),S.Actions=({items:e,children:t,className:n})=>{const{layout:i}=h();return(0,r.jsx)(u.s,{className:f("actions",{minContent:"horizontal"===i},n),direction:"row",gap:"3",wrap:!0,alignItems:"horizontal"===i?"center":"flex-start",children:(null==e?void 0:e.map((({handler:e,text:t},n)=>(0,r.jsx)(m,{onClick:e,children:t},n))))||t})},S.Action=m},13717:(e,t,n)=>{"use strict";n.d(t,{Tt:()=>i.Tt,rN:()=>r.r});var r=n(67691),i=n(13685)},15672:(e,t,n)=>{"use strict";n.d(t,{t1:()=>r.t}),n(40319),n(77810);var r=n(54299);n(64922),r.S},21952:(e,t,n)=>{"use strict";n.d(t,{A:()=>M});var r=n(40319),i=n(29121),s=n(12937),a=n(66134),o=n(10785),l=n(77810),c=n(75826),u=n.n(c),d=n(76872),p=n(5992),h=n(96843),m=n.n(h),f=n(5800),v=n(11394),g=n(49133),b=n(41652),A=n(11970),x=n(16727),y=n(51744),j=n(73822),w=n(68175),k=n(53332),_={state:{align:"left",get:function(e){return e.state}},phase:{align:"left",caption:"State : Phase",get:function(e){if("total"===e.state)return"Total";var t=j.A.format.Readable,n=t(e.state),r=t(e.phase||j.A.format.NO_VALUE);return"".concat(n," : ").concat(r)}},progress:{align:"center",caption:"",get:function(e){return{value:e.progress&&e.progress.duration,theme:{initializing:"grass",preparing:"mint",pending:"aqua",materializing:"bluejeans",running:"lavander",completing:"grapefruit",reviving:"bittersweet",reviving_jobs:"sunflower",failed:"grapefruit"}[e.state]||"mediumgray"}}},duration:{align:"right",get:function(e){return e.duration}},start_time:{align:"left",get:function(e){return e.time}},actions:{align:"center",caption:""}},C="default",S="withActions";function T(e,t){var n=function(e){return{theme:"light",striped:!1,virtual:!0,header:!1,size:"m",computeKey:function(e){return e.state+"/"+e.time},columns:{items:(0,k.TU)(_),sets:(0,w.A)((0,w.A)({},C,{items:[e,"progress","duration","start_time"]}),S,{items:[e,"progress","duration","start_time","actions"]}),mode:C}}}(t),i=n;return e&&((i=(0,r.A)({},n)).columns=(0,r.A)((0,r.A)({},i.columns),{},{mode:S})),i}var N=n(64922),E=(u().array,(0,d.A)("events")),P=(0,d.A)("operation-detail"),R=(0,p.Zz)(b.A,g.A)(v.A);function I(e,t){var n;return null===(n=_[t])||void 0===n?void 0:n.get(e)}var M=function(e){function t(){return(0,i.A)(this,t),(0,a.A)(this,t,arguments)}return(0,o.A)(t,e),(0,s.A)(t,[{key:"templates",get:function(){return{start_time:function(e,t){var n=I(e,t);return n?(0,N.jsx)(x.Bj.Time,{time:n,settings:{format:"full"},valueFormat:"DateTime"}):null},finish_time:function(e,t){var n=I(e,t);return n?(0,N.jsx)(x.Bj.Time,{time:n,settings:{format:"full"},valueFormat:"DateTime"}):null},duration:function(e,t){if(y.Jh.isFinalState(e))return j.A.format.NO_VALUE;var n=I(e,t);return(0,N.jsx)(x.Bj.Time,{time:n,settings:{format:"milliseconds"},valueFormat:"TimeDuration"})},progress:function(e,t){if(y.Jh.isNotFinalState(e)&&"total"!==e.state){var n=e.progress.duration,r=I(e,t),i=r.theme,s=r.value;return(0,N.jsxs)("div",{className:P("events-progress",{theme:i}),children:[(0,N.jsx)("span",{className:P("events-progress-percentage","elements-secondary-text"),children:j.A.format.Percent(n)}),(0,N.jsx)(A.k,{value:s,size:"s"})]})}},state:function(e,t){var n=I(e,t);return(0,N.jsx)(x.Bj.Readable,{value:n})},phase:function(e,t){var n=I(e,t);return(0,N.jsx)(x.Bj.Readable,{value:n})},actions:function(e){var t=(e||{}).attributes;return m()(t)?null:(0,N.jsx)(f.A,{title:"Event attributes",attributes:e.attributes})}}}},{key:"render",value:function(){var e=this.props,t=e.events,n=e.type,i=t.slice(),s=i.pop(),a=s.showAttributesColumn;return(0,N.jsx)("div",{className:E(),children:(0,N.jsx)(R,(0,r.A)((0,r.A)({},T(a,n)),{},{items:i,css:E(),footer:s,templates:this.templates}))})}}])}(l.Component);M.defaultProps={type:"state"}},25820:function(e){e.exports=function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,s=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,o=31536e6,l=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:o,months:l,days:s,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof b},p=function(e,t,n){return new b(e,n,t.$l)},h=function(e){return t.p(e)+"s"},m=function(e){return e<0},f=function(e){return m(e)?Math.ceil(e):Math.floor(e)},v=function(e){return Math.abs(e)},g=function(e,t){return e?m(e)?{negative:!0,format:""+v(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return p(e*u[h(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){r.$d[h(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var i=e.match(c);if(i){var s=i.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=s[0],this.$d.months=s[1],this.$d.weeks=s[2],this.$d.days=s[3],this.$d.hours=s[4],this.$d.minutes=s[5],this.$d.seconds=s[6],this.calMilliseconds(),this}}return this}var v=m.prototype;return v.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},v.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=f(e/o),e%=o,this.$d.months=f(e/l),e%=l,this.$d.days=f(e/s),e%=s,this.$d.hours=f(e/i),e%=i,this.$d.minutes=f(e/r),e%=r,this.$d.seconds=f(e/n),e%=n,this.$d.milliseconds=e},v.toISOString=function(){var e=g(this.$d.years,"Y"),t=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=g(n,"D"),i=g(this.$d.hours,"H"),s=g(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3,a=Math.round(1e3*a)/1e3);var o=g(a,"S"),l=e.negative||t.negative||r.negative||i.negative||s.negative||o.negative,c=i.format||s.format||o.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+r.format+c+i.format+s.format+o.format;return"P"===u||"-P"===u?"P0D":u},v.toJSON=function(){return this.toISOString()},v.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(a,(function(e,t){return t||String(r[e])}))},v.as=function(e){return this.$ms/u[h(e)]},v.get=function(e){var t=this.$ms,n=h(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?f(t/u[n]):this.$d[n],t||0},v.add=function(e,t,n){var r;return r=t?e*u[h(t)]:d(e)?e.$ms:p(e,this).$ms,p(this.$ms+r*(n?-1:1),this)},v.subtract=function(e,t){return this.add(e,t,!0)},v.locale=function(e){var t=this.clone();return t.$l=e,t},v.clone=function(){return p(this.$ms,this)},v.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},v.valueOf=function(){return this.asMilliseconds()},v.milliseconds=function(){return this.get("milliseconds")},v.asMilliseconds=function(){return this.as("milliseconds")},v.seconds=function(){return this.get("seconds")},v.asSeconds=function(){return this.as("seconds")},v.minutes=function(){return this.get("minutes")},v.asMinutes=function(){return this.as("minutes")},v.hours=function(){return this.get("hours")},v.asHours=function(){return this.as("hours")},v.days=function(){return this.get("days")},v.asDays=function(){return this.as("days")},v.weeks=function(){return this.get("weeks")},v.asWeeks=function(){return this.as("weeks")},v.months=function(){return this.get("months")},v.asMonths=function(){return this.as("months")},v.years=function(){return this.get("years")},v.asYears=function(){return this.as("years")},m}(),A=function(e,t,n){return e.add(t.years()*n,"y").add(t.months()*n,"M").add(t.days()*n,"d").add(t.hours()*n,"h").add(t.minutes()*n,"m").add(t.seconds()*n,"s").add(t.milliseconds()*n,"ms")};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){var n=i.locale();return p(e,{$l:n},t)},i.isDuration=d;var s=r.prototype.add,a=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?A(this,e,1):s.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?A(this,e,-1):a.bind(this)(e,t)}}}()},27652:(e,t,n)=>{"use strict";n.d(t,{c:()=>o,w:()=>a});var r=n(53746),i=n.n(r),s=n(11843);function a(e){return new(i())(e).load(null,1e4)}function o(e){return function(t,n){var r=(0,s.Y)(n());return Promise.all([a(r.regular),a(r.monospace)]).then((function(){return e}))}}},36161:(e,t,n)=>{"use strict";n.d(t,{A:()=>l}),n(77810);var r=n(76872),i=n(64965),s=n(73822),a=n(64922),o=(0,r.A)("elements-message");function l(){var e=(0,i.W5)().params.tab;return(0,a.jsx)("div",{className:o({theme:"warning"}),children:(0,a.jsx)("p",{className:o("paragraph"),children:e?'Viewer for tab "'.concat(s.A.format.ReadableField(e),'" is not implemented.'):"Viewer for this tab is not implemented."})})}},40860:(e,t,n)=>{"use strict";n.d(t,{q:()=>s}),n(77810);var r=n(70915),i=n(64922);function s(e){var t=e.className;return(0,i.jsx)(r.A,{className:t,hoverContent:"The job is stale, the information may be obsolete"})}},41652:(e,t,n)=>{"use strict";n.d(t,{A:()=>A});var r=n(40319),i=n(29121),s=n(12937),a=n(66134),o=n(10785),l=n(77810),c=n(15647),u=n(5992),d=n(76872),p=n(89067),h=n(33951),m=n(53332),f=n(92736),v=n(26264),g=(n(9909),n(64922)),b={toggleColumnSortOrder:h.z};const A=(0,u.Zz)((0,c.Ng)((function(e){return{sortState:e.tables}}),b),(function(e){var t;return t=function(t){function n(){return(0,i.A)(this,n),(0,a.A)(this,n,arguments)}return(0,o.A)(n,t),(0,s.A)(n,[{key:"renderStickyHead",value:function(){var e=this.props.top,t=(0,d.A)("elements-table-wrapper")({sticky:"top"});return(0,g.jsx)("div",{className:t,style:{top:e},children:(0,g.jsx)("table",{className:(0,f.xV)(this.props),children:(0,g.jsx)(p.A,(0,r.A)({},this.props))})})}},{key:"render",value:function(){return(0,g.jsxs)(l.Fragment,{children:[this.renderStickyHead(),(0,g.jsx)(e,(0,r.A)({},this.props))]})}}])}(l.Component),t.displayName="WithStickyHead(".concat((0,m.Mn)(e),")"),t.defaultProps={templates:{},size:"m",theme:"bordered",padded:!1,striped:!0,top:v.uF},t}))},46357:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var r=n(40319),i=n(22636),s=n(15647),a=n(52797);function o(e){var t=(0,s.d4)(a.dB);(0,i.gj)((0,r.A)((0,r.A)({},e),{},{subPage:e.subPage||"ui.".concat(t)}))}},46747:(e,t,n)=>{"use strict";n.d(t,{J:()=>p});var r=n(64922),i=n(77810),s=n(72890),a=n(11415),o=n(48382),l=n(32235),c=n(21086);const u=(0,c.om)("label"),d={xs:{copyIconSize:12,closeIconSize:12},s:{copyIconSize:14,closeIconSize:14},m:{copyIconSize:16,closeIconSize:16}},p=i.forwardRef((function(e,t){const{type:n="default",theme:c="normal",size:p="xs",title:h,icon:m,children:f,onCloseClick:v,className:g,disabled:b,copyText:A,closeButtonLabel:x,copyButtonLabel:y,interactive:j=!1,value:w,onCopy:k,onClick:_,qa:C}=e,S=Boolean(""!==f&&i.Children.count(f)>0),T="close"===n&&S,N="copy"===n&&S,E="function"==typeof _,P=Boolean(N&&A),R=(E||P||j)&&!b,{copyIconSize:I,closeIconSize:M}=d[p],O=m&&(0,r.jsx)("div",{className:u("addon",{side:S?"start":void 0,type:"icon"}),children:m}),z=S&&(0,r.jsxs)("div",{className:u("text"),children:[(0,r.jsx)("div",{className:u("content"),children:f}),Boolean(w)&&(0,r.jsxs)("div",{className:u("value"),children:[(0,r.jsx)("div",{className:u("separator"),children:":"}),(0,r.jsx)("div",{className:u("key"),children:w})]})]}),L=e=>{let n;return N?n=(0,r.jsx)("button",{type:"button","aria-label":y||void 0,onClick:E?_:void 0,disabled:b,className:u("addon",{side:"end",type:"button"}),"data-qa":"copy-button",children:(0,r.jsx)(a.u,{status:e||"pending",size:I})}):T&&(n=(0,r.jsx)("button",{type:"button",onClick:v,"aria-label":x||void 0,disabled:b,className:u("addon",{side:"end",type:"button"}),"data-qa":"close-button",children:(0,r.jsx)(l.I,{size:M,data:s.A})})),(0,r.jsxs)("div",{ref:t,className:u({theme:c,size:p,interactive:R,disabled:b},g),title:h,"data-qa":C,children:[O,E?(0,r.jsx)("button",{disabled:b,type:"button",onClick:_,className:u("main-button"),"data-qa":"main-button",children:z}):z,n]})};return P&&A&&!E?(0,r.jsx)(o.$,{text:A,onCopy:k,timeout:1e3,children:e=>L(e)}):L()}))},49133:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(40319),i=n(29121),s=n(12937),a=n(66134),o=n(10785),l=n(77810),c=n(76872),u=n(17036),d=n(92736),p=(n(9909),n(64922)),h=function(e){function t(e){var n;return(0,i.A)(this,t),(n=(0,a.A)(this,t,[e])).state={},n}return(0,o.A)(t,e),(0,s.A)(t,[{key:"renderRow",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=this.props,i=r.css,s=r.itemHeight,a=r.templates,o=r.itemMods,l=r.selectedIndex,c=r.computeKey,d=r.cssHover,h=this.state,m=h.columnSet,f=h.columnItems,v=l===t,g="function"==typeof c?c(e):n;return(0,p.jsx)(u.A,{columnSet:m,columnItems:f,item:e,itemHeight:s,css:i,templates:a,selected:v,index:t,itemMods:o,cssHover:d},g)}},{key:"render",value:function(){var e=(0,c.A)(d.R9)("footer"),t=this.props.footer;return(0,p.jsx)("tfoot",{className:e,children:this.renderRow(t,0)})}}],[{key:"getDerivedStateFromProps",value:function(e){var t=e.columns,n=(0,d.PM)(t);return{columnItems:n.items,columnSet:n.set}}}])}(l.Component);h.defaultProps={templates:{},cssHover:!1};var m=n(53332);const f=function(e){var t;return t=function(t){function n(){return(0,i.A)(this,n),(0,a.A)(this,n,arguments)}return(0,o.A)(n,t),(0,s.A)(n,[{key:"renderStickyFooter",value:function(){var e=(0,c.A)("elements-table-wrapper")({sticky:"bottom"}),t=this.props.footer;return(0,p.jsx)("div",{className:e,children:(0,p.jsx)("table",{className:(0,d.xV)(this.props),children:(0,p.jsx)(h,(0,r.A)((0,r.A)({},this.props),{},{footer:t}))})})}},{key:"render",value:function(){return(0,p.jsxs)(l.Fragment,{children:[(0,p.jsx)(e,(0,r.A)({},this.props)),this.props.footer&&this.renderStickyFooter()]})}}])}(l.Component),t.displayName="WithStickyFooter(".concat((0,m.Mn)(e),")"),t.defaultProps={size:"m"},t}},49528:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(77810);const i=e=>r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M3 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m5 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0",clipRule:"evenodd"}))},51741:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(77810);const i=e=>r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.53 2.97a.75.75 0 0 1 0 1.06L6.56 8l3.97 3.97a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 0",clipRule:"evenodd"}))},53302:(e,t,n)=>{"use strict";n.d(t,{A:()=>l}),n(77810);var r=n(76872),i=n(73822),s=n(88787),a=n(64922),o=(0,r.A)("status-label");function l(e){var t=e.className,n=e.label,r=e.renderPlaque,l=e.text,c=e.state,u=e.iconState,d=e.hideIcon,p=function(e){var t;return null!==(t={materializing:"preparing",initializing:"preparing",preparing:"preparing",pending:"preparing",starting:"preparing",waiting:"preparing",running:"running",completing:"running",failing:"running",aborting:"running",reviving:"running",suspended:"suspended",failed:"failed",completed:"completed",aborted:"aborted",Unknown:"unknown",Stopped:"suspended",Paused:"suspended",Working:"running",Draining:"running",Pausing:"running",Completed:"completed"}[e])&&void 0!==t?t:"unknown"}(n),h=function(e){return{preparing:"clock",running:"play-circle",suspended:"pause-circle",failed:"times-circle",completed:"check-circle",aborted:"times-circle",unknown:"question-circle"}[e]}(null!=u?u:p),m={state:null!=c?c:p};return n||l||c?(0,a.jsxs)("span",{className:o(null,r?o("plaque",m,t):o(m,t)),children:[!d&&(0,a.jsx)(s.A,{awesome:h}),(0,a.jsx)("span",{children:null!=l?l:i.A.format.ReadableField(n)})]}):(0,a.jsx)("span",{})}},53364:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(40319),i=n(29121),s=n(12937),a=n(66134),o=n(10785),l=n(77810),c=n(22483),u=n(53332),d=n(26264),p=n(64922);function h(e){var t;return t=function(t){function n(){return(0,i.A)(this,n),(0,a.A)(this,n,arguments)}return(0,o.A)(n,t),(0,s.A)(n,[{key:"render",value:function(){return c.createPortal((0,p.jsx)(e,(0,r.A)({},this.props)),document.getElementById(d.g))}}])}(l.Component),t.displayName="WithSplit(".concat((0,u.Mn)(e),")"),t}},53746:e=>{!function(){function t(e,t){document.addEventListener?e.addEventListener("scroll",t,!1):e.attachEvent("scroll",t)}function n(e){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(e)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function r(e,t){e.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+t+";"}function i(e){var t=e.g.offsetWidth,n=t+100;return e.j.style.width=n+"px",e.i.scrollLeft=n,e.h.scrollLeft=e.h.scrollWidth+100,e.l!==t&&(e.l=t,!0)}function s(e,n){function r(){var e=s;i(e)&&null!==e.g.parentNode&&n(e.l)}var s=e;t(e.h,r),t(e.i,r),i(e)}function a(e,t,n){t=t||{},n=n||window,this.family=e,this.style=t.style||"normal",this.weight=t.weight||"normal",this.stretch=t.stretch||"normal",this.context=n}var o=null,l=null,c=null,u=null;function d(e){return null===u&&(u=!!e.document.fonts),u}function p(e,t){var n=e.style,r=e.weight;if(null===c){var i=document.createElement("div");try{i.style.font="condensed 100px sans-serif"}catch(e){}c=""!==i.style.font}return[n,r,c?e.stretch:"","100px",t].join(" ")}a.prototype.load=function(e,t){var i=this,a=e||"BESbswy",c=0,u=t||3e3,h=(new Date).getTime();return new Promise((function(e,t){if(d(i.context)&&!function(e){return null===l&&(d(e)&&/Apple/.test(window.navigator.vendor)?(e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),l=!!e&&603>parseInt(e[1],10)):l=!1),l}(i.context)){var m=new Promise((function(e,t){!function n(){(new Date).getTime()-h>=u?t(Error(u+"ms timeout exceeded")):i.context.document.fonts.load(p(i,'"'+i.family+'"'),a).then((function(t){1<=t.length?e():setTimeout(n,25)}),t)}()})),f=new Promise((function(e,t){c=setTimeout((function(){t(Error(u+"ms timeout exceeded"))}),u)}));Promise.race([f,m]).then((function(){clearTimeout(c),e(i)}),t)}else!function(e){document.body?e():document.addEventListener?document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t),e()})):document.attachEvent("onreadystatechange",(function t(){"interactive"!=document.readyState&&"complete"!=document.readyState||(document.detachEvent("onreadystatechange",t),e())}))}((function(){function l(){var t;(t=-1!=v&&-1!=g||-1!=v&&-1!=b||-1!=g&&-1!=b)&&((t=v!=g&&v!=b&&g!=b)||(null===o&&(t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),o=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))),t=o&&(v==A&&g==A&&b==A||v==x&&g==x&&b==x||v==y&&g==y&&b==y)),t=!t),t&&(null!==j.parentNode&&j.parentNode.removeChild(j),clearTimeout(c),e(i))}var d=new n(a),m=new n(a),f=new n(a),v=-1,g=-1,b=-1,A=-1,x=-1,y=-1,j=document.createElement("div");j.dir="ltr",r(d,p(i,"sans-serif")),r(m,p(i,"serif")),r(f,p(i,"monospace")),j.appendChild(d.g),j.appendChild(m.g),j.appendChild(f.g),i.context.document.body.appendChild(j),A=d.g.offsetWidth,x=m.g.offsetWidth,y=f.g.offsetWidth,function e(){if((new Date).getTime()-h>=u)null!==j.parentNode&&j.parentNode.removeChild(j),t(Error(u+"ms timeout exceeded"));else{var n=i.context.document.hidden;!0!==n&&void 0!==n||(v=d.g.offsetWidth,g=m.g.offsetWidth,b=f.g.offsetWidth,l()),c=setTimeout(e,50)}}(),s(d,(function(e){v=e,l()})),r(d,p(i,'"'+i.family+'",sans-serif')),s(m,(function(e){g=e,l()})),r(m,p(i,'"'+i.family+'",serif')),s(f,(function(e){b=e,l()})),r(f,p(i,'"'+i.family+'",monospace'))}))}))},e.exports=a}()},62561:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(77810),i=n(76426),s=n(88787);const a=(0,n(92611).Kc)("yt:chart-link",{en:{View:"View"},ru:{View:"Смотреть"}});var o=n(64922);function l(e){var t=e.className,n=e.url,l=e.title,c=e.theme,u=e.children,d=e.hideIcon,p=e.face,h=e.wrapContent;if(!n)return null;var m=d?null:(0,o.jsx)(s.A,{awesome:"chart-bar",face:p}),f=u?(0,o.jsxs)(r.Fragment,{children:[m,u]}):m;return(0,o.jsx)(i.A,{className:t,target:"_blank",theme:c,url:n,title:null!=l?l:a("View"),children:h?h(f):f})}const c=r.memo(l)},63082:(e,t,n)=>{"use strict";n.d(t,{X:()=>x});var r=n(64922),i=n(77810),s=n(81214),a=n.n(s),o=n(25930),l=n.n(o),c=n(23313),u=n.n(c),d=n(21086),p=n(82835),h=n(37338);const m=JSON.parse('{"label_empty":"No data","label-actions":"Actions","label-row-select":"Select"}'),f=JSON.parse('{"label_empty":"Нет данных","label-actions":"Действия","label-row-select":"Выбрать"}'),v=(0,h.N)({en:m,ru:f},"Table");function g(e){(0,p.m)(`[Table] Physical values (left, right) of "${e}" property are deprecated. Use logical values (start, end) instead.`)}function b(e,t){return"left"===e?(g(t),"start"):"right"===e?(g(t),"end"):e}const A=(0,d.om)("table");class x extends i.Component{constructor(){super(...arguments),this.state={activeScrollElement:"scrollContainer",columnsStyles:Array.from(this.props.columns,(()=>({}))),columnHeaderRefs:Array.from(this.props.columns,(()=>i.createRef()))},this.tableRef=i.createRef(),this.scrollContainerRef=i.createRef(),this.horizontalScrollBarRef=i.createRef(),this.horizontalScrollBarInnerRef=i.createRef(),this.renderRow=(e,t)=>{const{columns:n,isRowDisabled:i,onRowClick:s,onRowMouseEnter:a,onRowMouseLeave:o,onRowMouseDown:l,getRowClassNames:c,verticalAlign:u,edgePadding:d,wordWrap:p,getRowDescriptor:h}=this.props,{columnsStyles:m}=this.state,f=null==h?void 0:h(e,t),v=(null==f?void 0:f.disabled)||(null==i?void 0:i(e,t))||!1,g=(null==f?void 0:f.classNames)||(null==c?void 0:c(e,t))||[],y=Boolean(!v&&s);return(0,r.jsx)("tr",{onClick:!v&&s?s.bind(null,e,t):void 0,onMouseEnter:!v&&a?a.bind(null,e,t):void 0,onMouseLeave:!v&&o?o.bind(null,e,t):void 0,onMouseDown:!v&&l?l.bind(null,e,t):void 0,className:A("row",{disabled:v,interactive:y,"vertical-align":u},g.join(" ")),children:n.map(((n,i)=>{const{id:s,align:a,primary:o,className:l,sticky:c}=n,u=x.getBodyCellContent(n,e,t),h=b(a,"column.align"),f=b(c,"column.sticky");return(0,r.jsx)("td",{style:m[i],className:A("cell",{align:h,primary:o,sticky:f,"edge-padding":d,"word-wrap":p},l),children:u},s)}))},x.getRowId(this.props,e,t))},this.handleScrollContainerMouseenter=()=>{this.setState({activeScrollElement:"scrollContainer"})},this.handleScrollContainerScroll=()=>{"scrollContainer"===this.state.activeScrollElement&&this.horizontalScrollBarRef.current&&this.scrollContainerRef.current&&(this.horizontalScrollBarRef.current.scrollLeft=this.scrollContainerRef.current.scrollLeft)},this.handleHorizontalScrollBarMouseenter=()=>{this.setState({activeScrollElement:"scrollBar"})},this.handleHorizontalScrollBarScroll=()=>{"scrollBar"===this.state.activeScrollElement&&this.horizontalScrollBarRef.current&&this.scrollContainerRef.current&&(this.scrollContainerRef.current.scrollLeft=this.horizontalScrollBarRef.current.scrollLeft)}}static getRowId(e,t,n){const{data:r,getRowId:i,getRowDescriptor:s}=e,a=null!=n?n:r.indexOf(t),o=null==s?void 0:s(t,a);return void 0!==(null==o?void 0:o.id)?o.id:"function"==typeof i?i(t,a):String(i&&i in t?t[i]:a)}static getHeadCellContent(e){const{id:t,name:n}=e;let r;return r="function"==typeof n?n():"string"==typeof n?n:t,r}static getBodyCellContent(e,t,n){const{id:r,template:i,placeholder:s}=e;let o,c;return o="function"==typeof s?s(t,n):null!=s?s:"—","function"==typeof i?c=i(t,n):"string"==typeof i?c=a()(t,i):l()(t,r)&&(c=a()(t,r)),[void 0,null,""].includes(c)&&o?o:c}static getDerivedStateFromProps(e,t){return e.columns.length===t.columnHeaderRefs.length?null:{columnHeaderRefs:Array.from(e.columns,(()=>i.createRef()))}}componentDidMount(){this.props.stickyHorizontalScroll&&(this.tableResizeObserver=new ResizeObserver((e=>{var t;const{contentRect:n}=e[0];null===(t=this.horizontalScrollBarInnerRef.current)||void 0===t||t.style.setProperty("width",`${n.width}px`)})),this.tableRef.current&&this.tableResizeObserver.observe(this.tableRef.current),this.scrollContainerRef.current&&(this.scrollContainerRef.current.addEventListener("scroll",this.handleScrollContainerScroll),this.scrollContainerRef.current.addEventListener("mouseenter",this.handleScrollContainerMouseenter)),this.horizontalScrollBarRef.current&&(this.horizontalScrollBarRef.current.addEventListener("scroll",this.handleHorizontalScrollBarScroll),this.horizontalScrollBarRef.current.addEventListener("mouseenter",this.handleHorizontalScrollBarMouseenter))),this.columnsResizeObserver=new ResizeObserver((e=>{window.requestAnimationFrame((()=>{Array.isArray(e)&&e.length&&this.updateColumnStyles()}))})),this.tableRef.current&&this.columnsResizeObserver.observe(this.tableRef.current),this.updateColumnStyles()}componentDidUpdate(e){this.props.columns!==e.columns&&this.updateColumnStyles()}componentWillUnmount(){this.props.stickyHorizontalScroll&&(this.tableResizeObserver&&this.tableResizeObserver.disconnect(),this.scrollContainerRef.current&&(this.scrollContainerRef.current.removeEventListener("scroll",this.handleScrollContainerScroll),this.scrollContainerRef.current.removeEventListener("mouseenter",this.handleScrollContainerMouseenter)),this.horizontalScrollBarRef.current&&(this.horizontalScrollBarRef.current.removeEventListener("scroll",this.handleHorizontalScrollBarScroll),this.horizontalScrollBarRef.current.removeEventListener("mouseenter",this.handleHorizontalScrollBarMouseenter))),this.columnsResizeObserver&&this.columnsResizeObserver.disconnect()}render(){const{columns:e,stickyHorizontalScroll:t,className:n,qa:s}=this.props,a=e.some((({primary:e})=>e));return(0,r.jsx)("div",{className:A({"with-primary":a,"with-sticky-scroll":t},n),"data-qa":s,children:t?(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("div",{ref:this.scrollContainerRef,className:A("scroll-container"),children:this.renderTable()}),this.renderHorizontalScrollBar()]}):this.renderTable()})}renderHead(){const{columns:e,edgePadding:t,wordWrap:n}=this.props,{columnsStyles:i}=this.state;return(0,r.jsx)("thead",{className:A("head"),children:(0,r.jsx)("tr",{className:A("row"),children:e.map(((e,s)=>{const{id:a,align:o,primary:l,sticky:c,className:u}=e,d=b(o,"column.align"),p=b(c,"column.sticky"),h=x.getHeadCellContent(e);return(0,r.jsx)("th",{ref:this.state.columnHeaderRefs[s],style:i[s],className:A("cell",{align:d,primary:l,sticky:p,"edge-padding":t,"word-wrap":n},u),children:h},a)}))})})}renderBody(){const{data:e}=this.props;return(0,r.jsx)("tbody",{className:A("body"),children:e.length>0?e.map(this.renderRow):this.renderEmptyRow()})}renderTable(){const{width:e="auto"}=this.props;return(0,r.jsxs)("table",{ref:this.tableRef,className:A("table",{width:e}),children:[this.renderHead(),this.renderBody()]})}renderEmptyRow(){const{columns:e,emptyMessage:t}=this.props;return(0,r.jsx)("tr",{className:A("row",{empty:!0}),children:(0,r.jsx)("td",{className:A("cell"),colSpan:e.length,children:t||v("label_empty")})})}renderHorizontalScrollBar(){const{stickyHorizontalScroll:e,stickyHorizontalScrollBreakpoint:t=0}=this.props;return(0,r.jsx)("div",{ref:this.horizontalScrollBarRef,className:A("horizontal-scroll-bar",{"sticky-horizontal-scroll":e}),style:{bottom:`${t}px`},"data-qa":"sticky-horizontal-scroll-breakpoint-qa",children:(0,r.jsx)("div",{ref:this.horizontalScrollBarInnerRef,className:A("horizontal-scroll-bar-inner")})})}updateColumnStyles(){this.setState((e=>{const t=e.columnHeaderRefs.map((e=>null===e.current?void 0:e.current.getBoundingClientRect().width));return{columnsStyles:this.props.columns.map(((e,n)=>this.getColumnStyles(n,t)))}}))}getColumnStyles(e,t){const{columns:n}=this.props,r=n[e],i={};if("string"==typeof r.width)return{maxWidth:0,width:r.width};if(void 0!==r.width&&(i.width=r.width),!r.sticky)return i;const s="left"===r.sticky||"start"===r.sticky?t.slice(0,e):t.slice(e+1);return i["left"===r.sticky||"start"===r.sticky?"insetInlineStart":"insetInlineEnd"]=s.reduce(((e,t)=>u()(t)?e+t:e),0),i}}x.defaultProps={edgePadding:!0}},63509:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>sd});var r=n(77810),i=n(76872),s=n(64965),a=n(9736),o=n(68175),l=n(40319),c=n(15647),u=n(96833),d=n.n(u),p=n(65304),h=n.n(p),m=n(27528),f=n.n(m),v=n(75414),g=n.n(v),b=n(8208),A=n(11960),x=n(76426),y=n(78519),j=n(24893),w=n(84092),k=n.n(w),_=n(53775),C=n(28407),S=n(10720),T=n(40519),N=n(29746),E=n(97270),P=n(39760),R=n.n(P),I=n(17239),M=n.n(I),O=n(63281),z=n.n(O);function L(e){return!M()(e,(function(e){return Boolean(N.A.getValue(e))}))}function V(e){return N.A.getValue(e,"/@progress/tasks")}var B=n(70353),F=n(49214),D=n.n(F),J=n(7787),H=n(85593),U="tasks/";function W(e){return{path:N.A.getValue(e),originalPath:N.A.getValue(e,"/@original_path"),name:N.A.getValue(e,"/@file_name"),executable:N.A.getBoolean(e,"/@executable")}}function $(e){var t=f()(e,(function(e,t){return{name:t,value:e}}));return z()(t,"name")}function Y(e){var t=N.A.getValue(e,"/@spec/started_by"),n=N.A.getValue(t,"/command")||[],r=D()($(t),(function(e){return"command"!==e.name}));if(r.length||n.length)return{fields:r,command:n}}function q(e){var t=N.A.getValue(e,"/@spec/transfer_manager");if(t)return{id:t.task_id,url:J.Ay.makeUrlForTransferTask(e)}}function X(e,t,n){if(e.isRunning()){var r=e.getLivePreviewPath(t,n),i=r.path,s=r.virtualPath;if(s)return{path:s,supported:!0};if(i)return{path:i,transaction:N.A.getValue(e,"/@async_scheduler_transaction_id"),supported:!0}}return{supported:!1}}function K(e){var t,n=function(e){var t=N.A.getValue(e,"/@ranges");if(void 0===t){var n,r=N.A.getValue(e,"/@upper_limit"),i=N.A.getValue(e,"/@lower_limit");void 0!==r&&((n=n||{}).upper_limit=r),void 0!==i&&((n=n||{}).lower_limit=i),n&&(t=[n]),n&&(t=[n])}return t}(e),r=N.A.getValue(e,"/@columns");return n&&((t=t||{}).ranges=n),r&&((t=t||{}).columns=r),t}function G(e,t,n,r,i,s){var a=N.A.getValue(n),o=N.A.getValue(n,"/@cluster"),c=N.A.getValue(n,"/@original_path"),u=function(e,t,n,r){return N.A.get(n,"/@transaction_id")||("running"===e.state?N.A.get(e,"/@".concat("stderr"===t?"debug_output":t,"_transaction_id")):r?N.A.get(e,"/@user_transaction_id"):void 0)}(e,t,n,i);return(0,l.A)((0,l.A)({path:a},o?{cluster:o}:{}),{},{originalPath:c,transaction:u,livePreview:X(e,t,s),append:N.A.getBoolean(n,"/@append"),teleport:N.A.getBoolean(n,"/@teleport"),primary:N.A.getBoolean(n,"/@primary"),foreign:N.A.getBoolean(n,"/@foreign"),filters:K(n),typedFilters:K(r)})}function Z(e){var t,n=[];return R()(e,(function(e){try{var r=e.cluster,i=N.A.YPath.create(e.path,"absolute"),s=i.getKey(),a=i.toSubpath(-2).stringify(),o=r?"".concat(r,":").concat(a):a;t!==o&&(t=o,n.push((0,l.A)({path:a,transaction:e.transaction,isFolder:!0},r?{cluster:r}:{}))),n.push(Object.assign(e,{name:s}))}catch(e){console.error("groupTables error",e)}})),n}function Q(e,t){var n,r="input";switch(e.type){case"remote_copy":case"merge":case"map":case"reduce":case"map_reduce":case"sort":case"join_reduce":var i=N.A.get(e.$typedAttributes,"/spec/input_table_paths");n=N.A.get(e,"/@spec/input_table_paths"),n=f()(n,(function(n,s){return G(e,r,n,i[s],t)}));break;case"erase":var s=N.A.get(e.$typedAttributes,"/spec/input_table_path");n=(n=N.A.get(e,"/@spec/table_path"))&&[G(e,r,n,s,t)]}return Z(n)}function ee(e,t){var n=N.A.get(e.$typedAttributes,"/spec/input_table_paths"),r=N.A.get(e,"/@spec/stderr_table_path");return Z(r=r&&[G(e,"stderr",r,n,t)])}function te(e){var t=N.A.get(e.$typedAttributes,"/spec/core_table_path");return Z(t?[G(e,"core",t,[],!1)]:[])}function ne(e,t){var n,r="output";switch(e.type){case"map":case"reduce":case"map_reduce":case"join_reduce":var i=N.A.get(e.$typedAttributes,"/spec/input_table_paths");n=N.A.get(e,"/@spec/output_table_paths"),n=f()(n,(function(n,s){return G(e,r,n,i[s],t,s)}));break;case"merge":case"sort":case"remote_copy":var s=N.A.get(e.$typedAttributes,"/spec/input_table_path");n=(n=N.A.get(e,"/@spec/output_table_path"))&&[G(e,r,n,s,t)]}return Z(n)}function re(e){var t;switch(e.type){case"map_reduce":case"sort":t=X(e,"intermediate")}if(t&&t.supported)return t}function ie(e){return 0===e.indexOf(U)?e.substring(U.length)+"_task":e}function se(e,t){try{var n,r=N.A.getValue(e,"/@spec/"+t),i=N.A.getValue(r,"/environment");i=$(i);var s=N.A.getValue(r,"/command"),a=N.A.getValue(r,"/class_name"),o=N.A.getValue(r,"/job_count"),l=f()(N.A.getValue(r,"/file_paths"),W),c=N.A.getValue(r,"/layer_paths");if(s||a||o||null!=l&&l.length||null!==(n=i)&&void 0!==n&&n.length)return{type:t,caption:ie(t),command:s,className:a,jobCount:o,files:l,environment:i,layerPaths:c}}catch(e){console.error("prepareScript error:",e)}}function ae(e){var t=N.A.getValue(e,"/@spec/tasks");if(t)return f()(h()(t),(function(t){return se(e,U+t)}))}function oe(e){return D()(e,(function(e){return!e.isFolder}))}function le(e,t){var n,r=[],i=0,s=(0,B.A)(e);try{for(s.s();!(n=s.n()).done;){var a=n.value;if(a.isFolder||i++,i===t+1)break;r.push(a)}}catch(e){s.e(e)}finally{s.f()}return r}var ce=n(51744),ue=n(73822);function de(e){return ue.A.format.SmallNumber(e,{significantDigits:4})}var pe,he=n(50358),me=n(24050),fe=n(26264),ve=n(13322),ge=n(74360),be=n(66134),Ae=n(10785),xe=n(18801),ye=n(29121),je=n(12937),we=n(41655),ke=n.n(we),_e=n(18472),Ce=["id"],Se=function(){function e(t){(0,ye.A)(this,e),this.id=void 0,this.$value=void 0,this.$attributes=void 0,this.state=void 0,this.pools=[];var n=t.id,r=(0,xe.A)(t,Ce);this.$value=n,this.id=n,this.$attributes=r,this.state=N.A.getValue(r,"/state")}return(0,je.A)(e,[{key:"isRunning",value:function(){return-1!==e.RUNNING_STATES.indexOf(this.state)}},{key:"isPreparing",value:function(){return-1!==e.PREPARING_STATES.indexOf(this.state)}},{key:"inIntermediateState",value:function(){return-1!==e.INTERMEDIATE_STATES.indexOf(this.state)}},{key:"successfullyCompleted",value:function(){return"completed"===this.state}},{key:"computePools",value:function(e){var t=N.A.getValue(e,"/runtime_parameters/scheduling_options_per_pool_tree"),n=N.A.getValue(e,"/scheduling_attributes_per_pool_tree"),r=N.A.getValue(e,"/slot_index_per_pool_tree")||{};this.pools=f()(t,(function(e,t){var i=t,s=e.pool,a=N.A.getValue(n,"/".concat(i));return{tree:i,pool:s,isEphemeral:N.A.getValue(a,"/running_in_ephemeral_pool")||!1,isLightweight:N.A.getValue(a,"/running_in_lightweight_pool")||!1,slotIndex:r[t],weight:e.weight||1}}))}}])}();pe=Se,Se.PREPARING_STATES=["materializing","initializing","preparing","pending"],Se.RUNNING_STATES=["running","completing","failing","aborting","reviving"],Se.INTERMEDIATE_STATES=[].concat((0,ve.A)(pe.RUNNING_STATES),(0,ve.A)(pe.PREPARING_STATES));var Te=function(e){function t(e){var n;(0,ye.A)(this,t),(n=(0,be.A)(this,t,[e])).weight=void 0,n.title=void 0,n.type=void 0,n.user=void 0,n.suspended=void 0,n.input=void 0,n.output=void 0,n.startTime=void 0,n.finishTime=void 0,n.duration=void 0,n.jobs=void 0,n.completedJobs=void 0,n.runningJobs=void 0,n.failedJobs=void 0,n.totalJobs=void 0,n.completedJobsProgress=void 0,n.runningJobsProgress=void 0,n.jobsProgress=void 0;var r=n.$attributes,i=N.A.getValue(r,"/brief_spec");n.title=N.A.getValue(i,"/title"),n.type=N.A.getValue(r,"/type"),n.user=N.A.getValue(r,"/authenticated_user"),n.suspended=N.A.getValue(r,"/suspended");var s="remote_copy"===n.type?N.A.get(n,"/@brief_spec/cluster_name"):void 0;n.input=n.computeIOProperties(i,"input",s),n.output=n.computeIOProperties(i,"output"),n.computePools(r),1===n.pools.length&&(n.weight=n.pools[0].weight),n.startTime=N.A.getValue(r,"/start_time"),n.finishTime=N.A.getValue(r,"/finish_time"),n.duration=ke()(n.finishTime)-ke()(n.startTime);var a=N.A.getValue(r,"/brief_progress"),o=n.jobs=N.A.getValue(a,"/jobs");return void 0!==o&&(n.completedJobs="object"===(0,ge.A)(o.completed)?o.completed.total:o.completed,n.runningJobs=o.running,n.failedJobs=o.failed,n.totalJobs=o.total,n.completedJobsProgress=n.completedJobs/n.totalJobs*100,n.runningJobsProgress=n.runningJobs/n.totalJobs*100,n.jobsProgress=n.completedJobsProgress+n.runningJobsProgress),n}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"computeIOProperties",value:function(e,t,n){var r=N.A.get(e,"/"+t+"_table_paths"),i={count:N.A.getValue(r,"/@count"),table:N.A.getValue(r,"/0"),url:void 0,remote:void 0};return n&&(i.url=function(e,t,n){return"/"+e+"/navigation?path="+t}(n,i.table),i.remote=!0),i}}])}(Se),Ne=function(e){function t(e,n){var r;(0,ye.A)(this,t),(r=(0,be.A)(this,t,[e])).$typedAttributes=void 0,r.alias=void 0,r.type=void 0,r.user=void 0,r.suspended=void 0,r.startTime=void 0,r.finishTime=void 0,r.duration=void 0,r.jobs=void 0,r.completedJobs=void 0,r.runningJobs=void 0,r.failedJobs=void 0,r.totalJobs=void 0,r.completedJobsProgress=void 0,r.runningJobsProgress=void 0,r.jobsProgress=void 0,r.totalFailedJobs=void 0,r.failedJobsProgress=void 0,r.description=void 0,r.title=void 0,r.typedSpec=void 0,r.typedProvidedSpec=void 0,r.typedFullSpec=void 0,r.typedUnrecognizedSpec=void 0,r.live_preview=void 0,r.$typedAttributes=n;var i=r.$attributes,s=r.$typedAttributes,a=N.A.getValue(i,"/spec"),o=N.A.getValue(i,"/full_spec");r.alias=N.A.getValue(a,"/alias"),r.typedSpec=N.A.getValue(s,"/spec"),r.typedProvidedSpec=N.A.getValue(s,"/provided_spec"),r.typedFullSpec=N.A.getValue(s,"/full_spec"),r.typedUnrecognizedSpec=N.A.getValue(s,"/unrecognized_spec"),r.title=N.A.getValue(a,"/title");var l=N.A.getValue(i,"/runtime_parameters/annotations");r.description=N.A.getValue(l,"/description"),r.description=r.description||N.A.getValue(a,"/description"),r.type=N.A.getValue(i,"/operation_type")||N.A.getValue(i,"/type"),r.user=N.A.getValue(i,"/authenticated_user"),r.suspended=N.A.getValue(i,"/suspended"),r.startTime=N.A.getValue(i,"/start_time"),r.finishTime=N.A.getValue(i,"/finish_time"),r.duration=ke()(r.finishTime)-ke()(r.startTime),r.computePools(i);var c=N.A.getValue(i,"/progress"),u=r.jobs=N.A.getValue(c,"/jobs");return void 0!==u&&(r.completedJobs="object"===(0,ge.A)(u.completed)?u.completed.total:u.completed,r.runningJobs=u.running,r.totalJobs=u.total,r.completedJobsProgress=r.completedJobs/r.totalJobs*100,r.runningJobsProgress=r.runningJobs/r.totalJobs*100,r.jobsProgress=r.completedJobsProgress+r.runningJobsProgress,r.failedJobs=u.failed,o&&(r.totalFailedJobs=N.A.getValue(o,"/max_failed_job_count")),r.failedJobsProgress=r.totalFailedJobs?r.failedJobs/r.totalFailedJobs*100:0),r.live_preview=N.A.getValue(c,"/live_preview"),r}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"getLivePreviewPath",value:function(e,t){var n=N.A.getBoolean(this.live_preview,"/virtual_table_format/".concat(e,"_supported")),r=!n&&N.A.getBoolean(this.live_preview,"/".concat(e,"_supported")),i=n?"/controller_orchid/live_previews":"",s="//sys/operations/".concat(ue.A.utils.extractFirstByte(this.id),"/").concat(this.id).concat(i);switch(e){case"output":return Ee("".concat(s,"/output_").concat(t||0),n,r);case"stderr":return Ee("".concat(s,"/stderr"),n,r);case"intermediate":return Ee("".concat(s,"/intermediate"),n,r);case"core":return n?Ee("".concat(s,"/core"),n,!1):{}}return{}}}])}(Se);function Ee(e,t,n){return t?{virtualPath:e}:{path:n?e:void 0}}function Pe(e,t){return void 0===e?t:e}function Re(e){return function(t){var n=t.operations.jobs.filters[e];return Pe(n.value,n.defaultValue)}}var Ie=(0,_e.Mz)([Re("filterBy"),Re("jobId")],(function(e,t){return"id"===e&&Boolean(t)})),Me=n(39686),Oe=n(53332),ze=n(48971);function Le(e){var t="[0-9a-fA-F]{1,8}";return new RegExp("^".concat(t,"-").concat(t,"-").concat(t,"-").concat(t,"$")).test(e)}function Ve(e){var t=new RegExp("^\\*[0-9a-zA-Z_-]+$");return Le(e)||t.test(e)}var Be=n(76365),Fe=n(33952),De=n(27859),Je=n(48553),He=new Be.A,Ue=n(52797),We=n(58860),$e=new S.I,Ye=new Be.A;function qe(e){return function(t,n){var r=!Le(e),i=Object.assign({include_scheduler:!0,output_format:fe.r$},r?{operation_alias:e}:{operation_id:e});return t({type:me.ZO.REQUEST,data:{isAlias:r,id:e}}),De.X8.getOperation({parameters:i,setup:{JSONSerializer:We.b}},Ye).then(Me.w1).then((function(r){var i=(0,a.A)(r,2),s=i[0],o=i[1],c=(0,Oe.VS)(s),u=new Ne(c,s),d=function(){var r=(0,Me.pj)(u),i=function(e,t){var n,r,i=function(e){if("remote_copy"===e.type)return{cluster:N.A.getValue(e,"/@spec/cluster_name"),network:N.A.getValue(e,"/@spec/network_name")}}(e);return{startedBy:Y(e),remote:i,transferTask:q(e),mode:N.A.getValue(e,"/@spec/mode"),input:(n=Q(e,t),r=null==i?void 0:i.cluster,r?f()(n,(function(e){return(0,l.A)((0,l.A)({},e),{},{remote:!0,url:(0,H.K)((0,l.A)({cluster:r},e))})})):n),output:ne(e,t),stderr:ee(e,t),intermediate:re(e),coredumps:te(e),mapper:se(e,"mapper"),reducer:se(e,"reducer"),reduceCombiner:se(e,"reduce_combiner"),tasks:ae(e)}}(u,o),s=(0,he.P)(N.A.getValue(u,"/@alerts")),a=N.A.getValue(u,"/@alert_events"),c=function(e){if("aborted"===e.state||"failed"===e.state)return N.A.getValue(e,"/@result")}(u),d=function(e){var t=N.A.getValue(e,"/@progress");if(t&&e.isRunning()){var n=N.A.getValue(t,"/scheduling_info_per_pool_tree");return n&&f()(n,(function(e,t){return{progress:e,name:t}}))}}(u),p=(0,ce.k7)(u),m=function(e){if(N.A.getValue(e,"/@progress")){var t=[],n=N.A.getValue(e,"/@progress/estimated_input_statistics");return n&&t.push({name:"Estimated input",value:n}),t.concat(function(e){if(V(e))return function(e){var t=N.A.getValue(e,"/@progress/data_flow"),n=N.A.getValue(e,"/@progress/tasks"),r=g()(t,(function(e,t){var n=t.source_name,r=t.target_name,i=t.job_data_statistics,s=t.teleport_data_statistics;return e.push({from:n,to:r,info:t,value:h()(i).reduce((function(e,t){var n=N.A.getValue(i[t]),r=N.A.getValue(s[t]);return e[t]=n+r,e}),{}),job_data_statistics:L(i)?null:i,teleport_data_statistics:L(s)?null:s}),e}),[]),i=g()(n,(function(e,t,n){return e[t.task_name]=n,e}),{});return z()(r,(function(e){var t=e.from;return"input"===t?-1:i[t]}))}(e);var t=N.A.getValue(e,"/@progress/data_flow_graph"),n=N.A.getValue(t,"/topological_ordering"),r=N.A.getValue(t,"/edges"),i=[];return t&&R()(n,(function(e){R()(r[e],(function(t,n){i.push({from:e,to:n,value:t.statistics})}))})),i}(e))}}(u);null!=c&&c.error&&(0,E.Qw)([c.error],(function(t){var r,i=N.A.getValue(t,"/attributes"),s=N.A.getValue(i,"/job_id"),a=null!==(r=i.$value)&&void 0!==r?r:i;if("string"==typeof s){var o=(0,Ue.dB)(n());Object.assign(a,{job_id:{$attributes:{_type_tag:"url"},$value:{href:"".concat(window.location.origin,"/").concat(o,"/job/").concat(e,"/").concat(s),text:s}}})}}));var v,b,A={specification:i,alerts:s,alert_events:a,error:c,runtime:d,events:p,resources:m};t({type:me.ZO.SUCCESS,data:{operation:u,actions:r,details:A}}),t((v=e,function(e,t){if(0!==(0,Je.Vc)(t()))return e({type:me.MZ.REQUEST}),De.Qq.listJobs(De.Vu.listJobs100,{parameters:{operation_id:v,sort_field:"start_time",sort_order:"descending",attributes:["monitoring_descriptor","start_time","finish_time"],with_monitoring_descriptor:!0},cancellation:He.removeAllAndSave}).then((function(t){var n=t.jobs;e({type:me.MZ.SUCCESS,data:{jobs:n,operation_id:v}})})).catch((function(t){(0,Be.m)(t)?e({type:me.MZ.CANCELLED}):e({type:me.MZ.FAILURE,data:{error:t}})}))})),t((b=u.pools,function(){var e=(0,C.A)((0,_.A)().mark((function e(t){var n,r,i,s;return(0,_.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null==b?void 0:b.map((function(e){return e.tree})),e.next=3,De.Qq.executeBatch(De.Vu.operationTreeConfigs,{requests:n.map((function(e){return{command:"get",parameters:(0,l.A)({path:"//sys/pool_trees/".concat(e,"/@config/main_resource")},T.R)}}))});case 3:return r=e.sent,e.next=6,(0,ze.fI)(De.Qq.executeBatch(De.Vu.operationTreeConfigs,{requests:n.map((function(e){return{command:"get",parameters:(0,l.A)({path:"//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/pools/<Root>/resource_limits")},T.R)}}))}),{toasterName:"operationTreeConfigs",skipSuccessToast:!0,batchType:"v3",errorTitle:"Failed to load tree limits"});case 6:return i=e.sent,e.next=9,(0,ze.fI)(De.Qq.executeBatch(De.Vu.operationTreeConfigs,{requests:n.map((function(e){return{command:"get",parameters:(0,l.A)({path:"//sys/pool_trees/".concat(e,"/@config")},T.R)}}))}),{toasterName:"operationTreeConfigs",skipSuccessToast:!0,batchType:"v3",errorTitle:"Failed to load tree configs"});case 9:s=e.sent,t({type:me.O2,data:{treeConfigs:s.map((function(e,t){return{tree:n[t],config:(0,l.A)((0,l.A)({},e.output),{},{resource_limits:i[t].output,main_resource:r[t].output||"cpu"})}}))}});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()))};u.inIntermediateState()?t(function(e,t){return function(){var n=(0,C.A)((0,_.A)().mark((function n(r){var i;return(0,_.A)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=N.A.get(e,"/@output_transaction_id"))||"0-0-0-0"===i){n.next=6;break}return r({type:me.M2.REQUEST}),n.abrupt("return",De.Qq.get(De.Vu.operationIntermediateResourceUsage,{path:"#"+i+"/@resource_usage"}).then((function(e){t();var n,i=(n=e,f()(n,(function(e,t){return(0,l.A)((0,l.A)({},e),{},{account:t})})));r({type:me.M2.SUCCESS,data:{resources:e,intermediateResources:i}})})).catch((function(){t(),r({type:me.M2.FAILURE})})));case 6:t(),r({type:me.M2.CANCELLED});case 8:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(u,d)):d()})).catch((function(r){var i=!n().operations.detail.loaded;r.code!==Fe.N.CANCELLED&&(i||$e.add({name:"get operation",autoHiding:!1,theme:"danger",title:"Failed to load operation",content:r.message,actions:[{label:" view",onClick:function(){return(0,ze.eW)(r)}}]}),t({type:me.ZO.FAILURE,data:{message:'Error occured when loading operation "'.concat(e,'"'),details:r}}))}))}}var Xe=n(29063),Ke=n(59028),Ge=n(53144),Ze=n.n(Ge),Qe=n(31470),et=n.n(Qe),tt=["state"],nt=function(e){return e.operations.list.filters},rt=function(e){var t;return(null===(t=e.operations.list.filters.poolTree.counters)||void 0===t?void 0:t.pool_tree_counts)||{}},it=function(e){var t;return(null===(t=function(e){return nt(e).pool}(e).counters)||void 0===t?void 0:t.pool_counts)||{}},st=function(e){var t;return(null===(t=function(e){return nt(e).user}(e).counters)||void 0===t?void 0:t.user_counts)||{}},at=(0,_e.Mz)([rt],ft),ot=(0,_e.Mz)([Ue.iq,rt],(function(e,t){return vt(e,t)})),lt=(0,_e.Mz)([at,ot],Ze()),ct=(0,_e.Mz)([it],ft),ut=(0,_e.Mz)([Ue.K6,it],vt),dt=(0,_e.Mz)([ct,ut],Ze()),pt=(0,_e.Mz)([st],ft),ht=(0,_e.Mz)([Ue.Le,st],vt),mt=(0,_e.Mz)([pt,ht],Ze());function ft(e){return z()(f()(e,(function(e,t){return{value:t,text:t,counter:e}})),"text")}function vt(e,t){return z()(f()(D()(e,(function(e){return void 0===t[e]})),(function(e){return{value:e,text:e}})),"text")}var gt=[{value:"withStderr",text:"With stderr"},{value:"withFailContext",text:"With fail context"},{value:"withSpec",text:"With full input"},{value:"withCompetitors",text:"With competitive jobs"},{value:"withMonitoringDescriptor",text:"With monitoring descriptor"},{value:"withInterruptionInfo",text:"With interruption info"}],bt=f()(gt,(function(e){return e.value})),At=(0,_e.Mz)([nt],(function(e){var t=e.text,n=e.user,r=e.subject,i=e.permissions,s=e.pool,a=e.poolTree,o=e.state,c=e.type,u=e.failedJobs,d=wt(r),p=wt(i),h=d||(null==p?void 0:p.length)>0?{subject:d,permissions:p||[]}:void 0,m={filter:wt(t),user:wt(n),pool:wt(s),pool_tree:wt(a),type:wt(c),with_failed_jobs:wt(u),access:h};return(0,l.A)({state:wt(o)},m)}));function xt(e){var t=e.operations.list.timeRange,n=t.from;return{to_time:t.to,from_time:n}}var yt=(0,_e.Mz)([At,Ue.ID,xt,Ue.dB],(function(e,t,n,r){var i,s=n.from_time,a=n.to_time;if(null!==(i=(0,Ue.lt)(r).operationPageSettings)&&void 0!==i&&i.disableOptimizationForYTFRONT2838)return e;var o=e.state,c=(0,xe.A)(e,tt);return Boolean(s||a)&&!M()(c,Boolean)&&(c.user=t),(0,l.A)({state:o},c)})),jt=(0,_e.Mz)([At,yt],(function(e,t){if(!et()(e,t))return t.user}));function wt(e){return e.value===e.defaultValue?void 0:e.value}function kt(e,t){return t===Xe.Uu.ARCHIVE?ke()(e).toISOString():void 0}function _t(e,t){return t===Xe.Uu.ARCHIVE?ke()(e).subtract(6,"hours").toISOString():void 0}function Ct(e){return(0,l.A)((0,l.A)((0,l.A)((0,l.A)({},function(e){return yt(e)}(e)),xt(e)),{cursor_time:(t=e.operations.list.cursor).from,cursor_direction:t.direction}),{},{include_archive:e.operations.list.dataMode===Xe.Uu.ARCHIVE,limit:20},T.R);var t}var St=n(19314),Tt=n(11896),Nt=["operations","incomplete"],Et=new Be.A;function Pt(e){var t=e.timestamp,n=e.direction,r=e.firstPageReached,i=e.lastPageReached,s=e.resetLoadingStatus,a=void 0===s||s;return{type:Xe.DE,data:{timestamp:t,direction:n,firstPageReached:r,lastPageReached:i,resetLoadingStatus:a}}}function Rt(){return function(e,t){var n=t();return e(It((0,Ue.dB)(n),Ct(n)))}}function It(e,t){return function(n){n({type:Xe.bb});var r=new De.CT(e,Tt.c.OPERATIONS_LIST);return r.fetch(De.Vu.listOperations,De.Qq.listOperations(De.Vu.listOperations,{parameters:t,cancellation:Et.removeAllAndSave})).then((function(e){var t=e.operations,i=e.incomplete,s=(0,xe.A)(e,Nt);n(function(e){return function(t,n){var r=n().operations.list.cursor.direction;r===Xe.Iv.PAST?t(Pt({lastPageReached:!e,resetLoadingStatus:!1})):r===Xe.Iv.FUTURE&&t(Pt({firstPageReached:!e,resetLoadingStatus:!1}))}}(i)),n({type:Xe.xX,data:r.wrap("parse",(function(){return f()(t,(function(e){return new Te(e)}))}))}),n({type:Xe.bZ,data:s})})).catch((function(e){e.code===k().codes.CANCELLED?n({type:Xe.nO}):n({type:Xe.ce,data:{message:"Could not load operations.",details:e}})}))}}function Mt(){return Pt({timestamp:null,direction:Xe.Iv.PAST,firstPageReached:!0,lastPageReached:!1})}function Ot(e,t){return function(n){n({type:Xe.bS,data:{name:e,value:t}}),n(Mt())}}function zt(){return function(e,t){var n=t().operations.list.dataMode,r=ke()();e({type:Xe.EE,data:{from:_t(r,n),to:kt(r,n)}})}}function Lt(e,t){return function(n){n({type:Xe.vk,data:{dataMode:Xe.Uu.ARCHIVE,from:e,to:t}}),n(Mt())}}function Vt(){return{type:Xe.FW}}function Bt(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:Xe.dj,data:{operation:e,editable:t}}}var Ft=n(64922),Dt=(0,i.A)("operation-pools-weights"),Jt=function(e){return g()(e,(function(e,t){var n=t.pool;return e[t.tree]=n,e}),{})},Ht=function(e){return g()(e,(function(e,t){var n=t.weight;return e[t.tree]=String(n),e}),{})},Ut=function(e){var t=e.cluster,n=e.operation,i=e.editable,s=e.pools,a=e.weights,c=e.setPools,u=e.setWeights;return f()(n.pools,(function(e){var n=e.tree,d=s[n],p="".concat(d," [").concat(n,"]"),h="/".concat(t,"/").concat(fe.YW.SCHEDULING,"?tree=").concat(n,"&pool=").concat(d,"&tab=monitor");return(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)("div",{className:Dt("pool","elements-form_field"),children:i?(0,Ft.jsx)(j.k,{value:d,onUpdate:function(e){c((0,l.A)((0,l.A)({},s),{},(0,o.A)({},n,e)))}}):(0,Ft.jsx)("span",{className:"elements-ellipsis",children:(0,Ft.jsx)(x.A,{url:h,title:p,children:(0,Ft.jsx)("span",{className:Dt("pool-link"),children:d})})})}),(0,Ft.jsx)("div",{className:Dt("tree","elements-form_field"),children:n}),(0,Ft.jsx)("div",{className:Dt("weight","elements-form_field"),children:i?(0,Ft.jsx)(j.k,{value:a[n],onUpdate:function(e){u((0,l.A)((0,l.A)({},a),{},(0,o.A)({},n,e)))}}):(0,Ft.jsx)("span",{className:"elements-ellipsis",children:a[n]})})]},n)}))},Wt={hideEditPoolsWeightsModal:function(){return{type:Xe.O8}},setPoolsAndWeights:function(e,t,n){var r=window.location.pathname.split("/"),i=3===r.length&&r[2]===fe.YW.OPERATIONS,s=e.$value,a=g()(e.pools,(function(e,t){return e[t.tree]=t,e}),{});return function(e){e({type:Xe.wn.REQUEST});var r=g()(t,(function(e,r,i){var s=a[i];return n[i]&&s.weight!==Number(n[i])&&(e[i]=Object.assign({},{weight:Number(n[i])})),s.pool!==t[i]&&(e[i]=Object.assign(e[i]||{},{pool:t[i]})),e}),{});return k().v3.updateOperationParameters({operation_id:s,_parameters:{scheduling_options_per_pool_tree:r}}).then((function(){e(i?Rt():qe(s)),e({type:Xe.wn.SUCCESS}),e({type:Xe.O8})})).catch((function(t){t.code===k().codes.CANCELLED?e({type:Xe.wn.CANCELLED}):e({type:Xe.wn.FAILURE,data:{error:t}})}))}}};const $t=(0,c.Ng)((function(e){var t=e.operations.page.editWeightModal;return{loading:t.loading,loaded:t.loaded,error:t.error,errorData:t.errorData,visible:t.visible,editable:t.editable,operation:t.operation,cluster:(0,Ue.dB)(e)}}),Wt)((function(e){var t=e.operation,n=e.setPoolsAndWeights,i=(0,r.useState)(Jt(t.pools)),s=(0,a.A)(i,2),o=s[0],c=s[1],u=(0,r.useState)(Ht(t.pools)),p=(0,a.A)(u,2),m=p[0],f=p[1];(0,r.useEffect)((function(){c(Jt(t.pools)),f(Ht(t.pools))}),[t.$value]);var v=e.loading,g=e.error,x=e.errorData,j=e.visible,w=e.editable,k=e.hideEditPoolsWeightsModal,_=(0,Ft.jsxs)("div",{className:Dt("title"),children:[w?"Edit":"View"," pools and weights"]});return(0,Ft.jsx)(A.A,{size:"l",title:_,loading:v,visible:j,footer:w,confirmText:"Apply",onConfirm:function(){n(t,o,m)},onCancel:k,isConfirmDisabled:function(){var e={operation:t},n="completed"!==e&&"failed"!==e&&"aborted"!==e,r=d()(h()(m),(function(e){var t=Number(m[e]);return!isNaN(t)&&t>0})),i=d()(h()(o),(function(e){var t=o[e];return Boolean(t)}));return!n||!r||!i},content:(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)("div",{className:Dt("name"),children:(0,Ft.jsx)(y.A,{value:t.title||t.$value,inline:!0})}),(0,Ft.jsxs)("div",{className:Dt(),children:[(0,Ft.jsx)("div",{className:Dt("header"),children:"Pool"}),(0,Ft.jsx)("div",{className:Dt("header"),children:"Tree"}),(0,Ft.jsx)("div",{className:Dt("header"),children:"Weight"}),Ut((0,l.A)((0,l.A)({},e),{},{pools:o,weights:m,setPools:c,setWeights:f}))]}),g&&(0,Ft.jsx)(b.z,{className:Dt("error"),error:x})]})})}));var Yt=n(18983),qt=n.n(Yt),Xt=n(3659),Kt=n(11970),Gt=n(53302),Zt=(0,i.A)("operation-progress"),Qt=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderCounter",value:function(e,t,n){var r=this.props,i=r.cluster,s=r.onLinkClick,a=this.props.operation.$value,o="/".concat(i,"/operations/").concat(a,"/jobs?state=").concat(e),l="View ".concat(e," jobs");return(0,Ft.jsxs)("div",{className:"operation-progress__counter",children:[(0,Ft.jsx)("span",{className:"operation-progress__counter-state",children:(0,Ft.jsx)(x.A,{theme:"ghost",title:l,url:o,routed:!0,onClick:s?function(){s(e)}:void 0,children:ue.A.format.ReadableField(e)})}),(0,Ft.jsxs)("span",{className:"operation-progress__counter-value",children:[ue.A.format.Number(t),"  /  ",ue.A.format.Number(n)]})]})}},{key:"renderFailedJobCounters",value:function(){var e=this.props.operation,t=e.failedJobs,n=e.totalFailedJobs;return void 0!==n&&(0,Ft.jsx)("div",{className:"operation-progress__counters",children:this.renderCounter("failed",t,n)})}},{key:"renderJobCounters",value:function(){var e=this.props.operation,t=e.state,n=e.totalJobs,r=e.failedJobs,i=e.completedJobs,s=e.runningJobs;return e.isPreparing()?null:void 0!==n&&(0,Ft.jsxs)("div",{className:"operation-progress__counters",children:[e.inIntermediateState()&&this.renderCounter("running",s,n),"failed"===t&&this.renderCounter("failed",r,n),this.renderCounter("completed",i,n)]})}},{key:"renderState",value:function(){var e=this.props,t=e.showState,n=e.operation,r=n.suspended,i=n.state;return t?(0,Ft.jsx)("div",{className:Zt("state"),children:(0,Ft.jsx)(Gt.A,{label:r?"suspended":i})}):null}},{key:"renderFailedProgressBar",value:function(){var e=this.props.operation.failedJobsProgress;return(0,Ft.jsxs)("div",{className:"operation-progress__bar",children:[this.renderState(),(0,Ft.jsx)(Kt.k,{size:"s",value:e||0,theme:"danger"})]})}},{key:"renderProgressBar",value:function(){var e,t=this.props.operation,n=t.state,r=t.jobsProgress,i=t.completedJobsProgress,s=t.runningJobsProgress;switch(n){case"running":e=t.inIntermediateState()&&(0,Ft.jsx)(Kt.k,{size:"s",value:r||0,stack:[{value:i||0,theme:"success"},{value:s||0,theme:"info"}]});break;case"completed":e=(0,Ft.jsx)(Kt.k,{size:"s",value:100,theme:"success"});break;case"failed":e=(0,Ft.jsx)(Kt.k,{size:"s",value:100,theme:"danger"});break;case"aborted":e=(0,Ft.jsx)(Kt.k,{size:"s",value:100,theme:"default"});break;default:e=(0,Ft.jsx)(Kt.k,{size:"s",value:0})}return(0,Ft.jsxs)("div",{className:"operation-progress__bar",children:[this.renderState(),e]})}},{key:"render",value:function(){var e=this.props.type;return(0,Ft.jsxs)("div",{className:"operation-progress",children:["running"===e?this.renderProgressBar():this.renderFailedProgressBar(),"running"===e?this.renderJobCounters():this.renderFailedJobCounters()]})}}])}(r.Component);Qt.defaultProps={type:"running"};const en=(0,c.Ng)((function(e){return{cluster:(0,Ue.dB)(e)}}))(Qt);var tn=n(42321),nn=n(44131),rn=n(11394),sn=n(95664),an=n(58299),on=n(88787),ln=n(88191),cn=n(19410),un=n(7313),dn=n(64772),pn=n(56765),hn=["table","count"],mn=(0,i.A)("yt-operations-list-path-item");function fn(e){var t=e.caption,n=e.item,i=e.transaction_id,s=e.user_transaction_id,o=n.table,c=n.count,u=(0,xe.A)(n,hn),d=r.useState(),p=(0,a.A)(d,2),h=p[0],m=p[1];return r.useEffect((function(){var e=N.A.getValue(o,"/@transaction_id");return(0,Me.AY)(e)?m(e):(0,Me.AY)(i)?m(i):void(0,Me.QB)(s).then((function(){return m(s)}))}),[o,s,i]),(0,Ft.jsxs)("div",{className:mn(null,"elements-meta-item"),children:[(0,Ft.jsx)("div",{className:"elements-meta-item__key",children:dn.A.ReadableField(t)}),(0,Ft.jsx)("div",{className:"elements-meta-item__value",children:(0,Ft.jsxs)("span",{className:mn("item-io"),children:[(0,Ft.jsx)("span",{className:mn("item-count"),children:c}),(0,Ft.jsx)(pn.A,(0,l.A)((0,l.A)({path:N.A.getValue(o)},u),{},{transaction:h,theme:"ghost",className:mn("item-io-table")}))]})})]},t)}var vn=(0,i.A)("operations-list");function gn(e,t){var n=function(e){return void 0!==e.title?e.title:e.$value}(e);return(0,Ft.jsx)(x.A,{routed:!0,className:"elements-ellipsis",url:"".concat(qt()(t,"/"),"/").concat(e.$value),theme:"primary",children:(0,Ft.jsx)("span",{children:Xt.A.decode(n)})})}function bn(e){return(0,Ft.jsx)(nn.A,{text:e.$value,view:"flat-secondary",size:"s",title:"Copy operation id",className:vn("item-title-copy")})}function An(e){var t=e.awesomeIcon,n=e.children,r=e.title;return(0,Ft.jsxs)("div",{className:vn("user-pool-item"),children:[(0,Ft.jsx)("div",{className:vn("user-pool-item-icon"),children:(0,Ft.jsx)(cn.m,{content:r,to:"left",allowUnmounted:!0,children:(0,Ft.jsx)(on.A,{face:"solid",awesome:t})})}),(0,Ft.jsx)("div",{className:vn("user-pool-item-name"),children:n})]})}var xn=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return(e=(0,be.A)(this,t,[].concat(i))).renderTitle=function(t){var n=e.props.match.url,r="running"===N.A.getValue(t,"/@state"),i=r?N.A.getValue(t,"/@brief_spec/input_transaction_id"):void 0,s=r?N.A.getValue(t,"/@brief_spec/output_transaction_id"):void 0,a=r?N.A.getValue(t,"/@brief_spec/user_transaction_id"):void 0;return(0,Ft.jsxs)("div",{children:[(0,Ft.jsxs)("div",{className:vn("item-title"),children:[bn(t),gn(t,n)]}),(0,Ft.jsxs)("div",{className:vn("item-io"),children:[t.input.count>0&&(0,Ft.jsx)(fn,{caption:"in",item:t.input,user_transaction_id:a,transaction:i}),t.output.count>0&&(0,Ft.jsx)(fn,{caption:"out",item:t.output,user_transaction_id:a,transaction:s})]})]})},e.renderUserPool=function(t){var n=e.props,i=n.showEditPoolsWeightsModal,s=n.cluster,a=t.pools,o=t.user,l=t.state,c=(null==a?void 0:a.length)>1||!1;return(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)(An,{awesomeIcon:"user",title:"User",children:(0,Ft.jsx)(sn.R,{name:o})}),(0,Ft.jsx)(An,{awesomeIcon:"poll-people",title:"Pool",children:c?e.renderMultiplePools(t):(0,Ft.jsx)(tn.CD,{onEdit:function(){return i(t)},cluster:s,pools:a,state:l,compact:!0,allowDetachEditBtn:!0})}),!c&&(0,Ft.jsx)(An,{awesomeIcon:"weight-hanging",title:"Weight",children:(0,Ft.jsx)(tn.tJ,{onEdit:function(){return i(t)},operation:t,pool:a[0]})})]})},e.renderActions=function(t){var n=e.props.promptAction,r=(0,Me.pj)(t);return(0,Ft.jsx)("div",{className:vn("actions"),children:r.map((function(r){var i=r.icon,s=r.name,a=r.$value,o=ue.A.format.Readable(s),c=r.message||(0,Ft.jsxs)("span",{children:["Are you sure you want to ",(0,Ft.jsx)("strong",{children:r.name})," the operation"," ",a,"?"]}),u=function(n){var i=n.currentOption;return(0,Me.wF)((0,l.A)((0,l.A)({},r),{},{operation:t,currentOption:i})).then((function(){e.props.updateOperationsList()}))};return(0,Ft.jsx)(an.A,{withTooltip:!0,size:"m",view:"flat-secondary",tooltipProps:{placement:"bottom",content:o},onClick:function(){return n((0,l.A)((0,l.A)({},r),{},{message:c,handler:u}))},children:(0,Ft.jsx)(on.A,{awesome:i})},s)}))})},e.settings={css:"operations-list",theme:"light",striped:!1,virtualType:"simple",getItemLink:function(t){return"".concat(e.props.match.url,"/").concat(t.$value)},computeKey:function(e){return e.$value},columns:{sets:{default:{items:["title","type","user_pool","start_time","progress","actions"]}},mode:"default",items:{title:{name:"title",sort:!1,align:"left"},type:{name:"type",sort:!1,align:"left"},user:{name:"user",sort:!1,align:"left"},pool:{name:"pool",sort:!1,align:"left"},user_pool:{name:"user_pool",sort:!1,caption:"User / Pool",align:"left"},start_time:{name:"start_time",sort:!1,align:"left"},progress:{name:"progress",sort:!1,align:"left",caption:"State / Progress"},actions:{name:"actions",caption:"",sort:!1,align:"right"}}},templates:{title:e.renderTitle,user_pool:e.renderUserPool,type:t.renderType,start_time:t.renderStartTime,progress:t.renderProgress,actions:e.renderActions}},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderMultiplePools",value:function(e){var t=this.props.showEditPoolsWeightsModal;return(0,Ft.jsxs)("span",{className:vn("multiply-pools"),children:[e.pools.length,(0,Ft.jsxs)(an.A,{size:"s",view:"flat-secondary",title:"Show pools and weights",className:vn("view-button"),onClick:function(){return t(e,!1)},children:[(0,Ft.jsx)(on.A,{awesome:"eye"})," View"]}),(0,Ft.jsx)(an.A,{size:"s",view:"flat-secondary",title:"Edit pools and weights",className:vn("edit-button"),onClick:function(){return t(e)},children:(0,Ft.jsx)(on.A,{awesome:"pencil"})})]})}},{key:"render",value:function(){var e=this.props,t=e.operations,n=e.initialLoading;return(0,Ft.jsx)(rn.A,(0,l.A)({emptyDataDescription:"Please, change your filtering settings to see search results",isLoading:n,items:t},this.settings))}}],[{key:"renderType",value:function(e){return(0,Ft.jsx)(ln.S,{value:e.type})}},{key:"renderStartTime",value:function(e){return(0,Ft.jsxs)("div",{className:vn("item-start-time"),children:[(0,Ft.jsx)("div",{className:vn("item-start-time-human"),children:ue.A.format.DateTime(e.startTime,{format:"human"})}),(0,Ft.jsx)("div",{className:vn("item-start-time-default"),children:ue.A.format.DateTime(e.startTime)}),(0,Ft.jsx)("div",{className:vn("item-duration"),title:"Duration",children:ue.A.format.TimeDuration(e.duration)})]})}},{key:"renderProgress",value:function(e){return(0,Ft.jsx)(en,{operation:e,showState:!0})}}])}(r.Component),yn={showEditPoolsWeightsModal:Bt,promptAction:un.Jm,updateOperationsList:Rt};const jn=(0,s.y)((0,c.Ng)((function(e){var t=e.operations,n=e.global,r=t.list,i=r.isLoading,s=r.hasLoaded;return{initialLoading:i&&!s,cluster:n.cluster,operations:t.list.operations}}),yn)(xn));var wn=n(82931),kn=n(99800),_n=(0,i.A)("operations-list"),Cn=(0,i.A)("elements-toolbar"),Sn=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).state={transition:!1,value:""},e.gotoDetails=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.filter.value;Ve(t)&&e.setState({transition:!0,value:t})},e.handleKeyDown=function(t){"Enter"===t.key&&e.gotoDetails(t.target.value)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"value",get:function(){var e=this.state.value,t=this.props.filter.value;return e||t}},{key:"render",value:function(){var e=this,t=this.props,n=t.match,r=t.updateFilter,i=t.activePreset,a=t.filter.value;return this.state.transition?(0,Ft.jsx)(s.rd,{to:"".concat(n.url,"/").concat(this.value)}):(0,Ft.jsxs)("div",{className:_n("toolbar-text-filter",Cn("component")),children:[(0,Ft.jsx)(kn.A,{placeholder:"Filter operations...",size:"m",value:this.value,onChange:function(e){return r("text",e)},debounce:500,onKeyDown:this.handleKeyDown,pin:"round-brick"},i),(0,Ft.jsx)(an.A,{view:"action",pin:"brick-round",onClick:function(){return e.gotoDetails(a)},disabled:!Ve(this.value),children:"Go to operation"})]})}}])}(r.Component),Tn={updateFilter:Ot};const Nn=(0,s.y)((0,c.Ng)((function(e){var t=e.operations;return{filter:t.list.filters.text,activePreset:t.list.activePreset}}),Tn)(Sn));var En=n(36146),Pn=n.n(En),Rn=n(30002),In=n.n(Rn),Mn=n(6542),On=n(75826),zn=n.n(On),Ln=(0,i.A)("elements-form"),Vn=(0,i.A)("timepicker"),Bn="HH:mm",Fn=(zn().shape({_isAMomentObject:zn().oneOf([!0])}),function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).state={time:"",date:""},e.handleTimeChange=function(t){var n=e.props.onChange,r=e._checkInputTimeValidity(t);e.setState({time:t}),r&&n(e._prepareOutputDate(t))},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"_checkInputTimeValidity",value:function(e){return new RegExp("[0-9]{2}:[0-9]{2}").test(e)&&ke()(e,Bn).isValid()}},{key:"_checkDateValidity",value:function(e){var t=this.props.minDate,n=ke()(e).unix();return!t||n>ke()(t).unix()}},{key:"_prepareOutputDate",value:function(e){var t=this.state.date,n=ke()(t),r=ke()(e,Bn);return r.year(n.year()),r.month(n.month()),r.date(n.date()),r.toISOString()}},{key:"renderIcon",value:function(e){return(0,Ft.jsx)(on.A,{awesome:e})}},{key:"render",value:function(){var e=this.state.time,t=this.props.disabled,n=this._prepareOutputDate(e),r=this._checkInputTimeValidity(e),i=this._checkDateValidity(n),s=r&&i,a=s?"":"Time should be specified as HH:MM.\nEstimated start time should be less than estimated finish time.";return(0,Ft.jsx)("div",{className:Ln("field",{theme:s?"valid":"invalid"},Vn()),children:(0,Ft.jsx)(j.k,{theme:"normal",size:"s",value:e,disabled:t,onUpdate:this.handleTimeChange,iconRight:this.renderIcon("clock"),controlAttrs:{maxLength:5,title:a},className:Vn("control"),placeholder:"HH:mm"})})}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.date!==t.date?{time:ke()(e.date).format(Bn),date:e.date}:null}}])}(r.Component));Fn.defaultProps={minDate:null,disabled:!1};var Dn=n(87604),Jn=n(15672),Hn=(0,i.A)("operations-list"),Un=(0,i.A)("elements-toolbar"),Wn=(0,i.A)("elements-form"),$n={range:!1,controlSize:"s",format:"dd-MM-yyyy",outputFormat:"datetime",className:"operations-datepicker-control",popupClassName:"operations-datepicker-popup"},Yn={custom:{text:"custom",value:"custom"},twoHours:{text:"last 2 hours",value:"twoHours",hours:2},day:{text:"last day",value:"day",hours:24},week:{text:"last week",value:"week",hours:168}};function qn(){var e=(0,c.d4)((function(e){return e.operations.list})),t=e.dataMode,n=e.timeRange,i=n.from,s=n.to,o=(0,c.wA)(),u=(0,r.useState)({modalVisible:!1,activeTypeValue:Yn.custom.value,from:i||ke()().subtract(6,"hours").toISOString(),to:s||ke()().toISOString()}),d=(0,a.A)(u,2),p=d[0],h=d[1],m=(0,r.useCallback)((function(){h((0,l.A)((0,l.A)({},p),{},{modalVisible:!0}))}),[p]),f=(0,r.useCallback)((function(){h((0,l.A)((0,l.A)({},p),{},{modalVisible:!1}))}),[p]),v=(0,r.useCallback)((function(){f(),o((function(e){e({type:Xe.vk,data:{dataMode:Xe.Uu.CURRENT}}),e(Mt())}))}),[o,f]),g=(0,r.useCallback)((function(){f(),"custom"===p.activeTypeValue?o(Lt(p.from,p.to)):o(Lt(ke()().subtract(Yn[p.activeTypeValue].hours,"hours").toISOString(),ke()().toISOString()))}),[o,f,p]),b=(0,r.useCallback)((function(){if(t===Xe.Uu.CURRENT)return"Current operations";var e="DD-MM-YYYY HH:mm";return ke()(i).format(e)+" — "+ke()(s).format(e)}),[t,i,s]),x=(0,r.useCallback)((function(e){var t=Pn()(e,(function(e,t){if(e){var n=ke()(p[t]).toObject(),r=n.hours,i=n.minutes;return ke()(e).add({hours:r,minutes:i}).toISOString()}return e}));h((0,l.A)((0,l.A)({},p),t))}),[p]),y=(0,r.useCallback)((function(e){return h((0,l.A)((0,l.A)({},p),e))}),[p]),j=(0,r.useCallback)((function(e){var t=e.target.value;h((0,l.A)((0,l.A)({},p),{},{activeTypeValue:t},"custom"!==t&&{from:ke()().subtract(Yn[t].hours,"hours").toISOString(),to:ke()().toISOString()}))}),[p]),w=b(),k=t===Xe.Uu.ARCHIVE,_=p.activeTypeValue!==Yn.custom.value;return(0,Ft.jsxs)("div",{className:Hn("archive-range",Un("component")),children:[(0,Ft.jsx)(A.A,{title:"Choose range",size:"s",confirmText:"Apply",cancelText:"Show current",cl:Wn("time-modal"),visible:p.modalVisible,content:(0,Ft.jsxs)("div",{className:Wn(null,"operations-archive-filter"),children:[(0,Ft.jsx)("div",{className:Wn("button-group"),children:(0,Ft.jsx)(Dn.A,{name:"time-range",items:In()(Yn),value:p.activeTypeValue,onChange:j})}),(0,Ft.jsxs)("div",{children:[(0,Ft.jsx)("div",{className:Wn("label"),children:"From"}),(0,Ft.jsxs)("div",{className:Wn("field-group"),children:[(0,Ft.jsx)("span",{className:Wn("field"),children:(0,Ft.jsx)(Jn.t1,(0,l.A)((0,l.A)({},$n),{},{disabled:_,from:p.from,onUpdate:function(e){var t=e.from;return t&&x({from:t})}}))}),(0,Ft.jsx)("span",{className:Wn("field"),children:p.from&&(0,Ft.jsx)(Fn,{disabled:_,date:p.from,onChange:function(e){return y({from:e})}})})]}),(0,Ft.jsx)("div",{className:Wn("label"),children:"To"}),(0,Ft.jsxs)("div",{className:Wn("field-group"),children:[(0,Ft.jsx)("span",{className:Wn("field"),children:(0,Ft.jsx)(Jn.t1,(0,l.A)((0,l.A)({},$n),{},{disabled:_,to:p.to,onUpdate:function(e){var t=e.from;return t&&x({to:t})}}))}),(0,Ft.jsx)("span",{className:Wn("field"),children:p.to&&(0,Ft.jsx)(Fn,{disabled:_,date:p.to,onChange:function(e){return y({to:e})}})})]})]})]}),renderCustomCancel:function(e){return(0,Ft.jsx)(Mn.$,{title:"Show current",className:e,onClick:v,children:"Show current"})},onCancel:f,onConfirm:g}),(0,Ft.jsxs)(an.J,{type:"submit",selected:k,title:w,onClick:m,children:[w,(0,Ft.jsx)(on.A,{awesome:"calendar-alt"})]})]})}var Xn=n(67270),Kn=n(87319),Gn=["name","value","type","placeholder"],Zn=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).onRadioChange=function(t){return e.props.updateFilter(e.props.name,t)},e.onCheckChange=function(t){return e.props.updateFilter(e.props.name,t)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"items",get:function(){var e=this.props,t=e.value,n=e.states,r=e.counters,i=e.withCounters,s=!1,a=f()(n,(function(e){var n="string"==typeof e?e:e.name,a=r&&(r[n]||0);return n===t&&(s=!0),{value:n,text:e.caption||ue.A.format.ReadableField(n),count:i?a:void 0}}));return"string"!=typeof t||s||a.push({value:t,text:ue.A.format.ReadableField(t)}),a}},{key:"render",value:function(){var e=this.props,t=e.name,n=e.value,r=e.type,i=e.placeholder,s=(0,xe.A)(e,Gn),a=this.props.multiple,o="function"==typeof i?i(n):i,c="radio"===r?this.onRadioChange:this.onCheckChange;return(0,Ft.jsx)(Xn.A,(0,l.A)((0,l.A)({hideFilter:!0},s),{},{placeholder:o,value:Array.isArray(n)?n:[n],type:r,items:this.items,onUpdate:function(e){return c(a?e:e[0])},label:ue.A.format.FirstUppercase(t)+":"}))}}])}(r.Component);Zn.defaultProps={withCounters:!0,type:"radio"};const Qn=(0,c.Ng)((function(e,t){var n=e.operations.list.filters,r=t.name,i=t.states,s=n[r],a=s.defaultValue,o=s.value,l=function(e,t,n){var r=N.A.getValue(n,"/".concat(e,"_counts"));return ue.A.filter.countCategoriesNG({items:f()(r,(function(e,t){return{count:e,value:t}})),categories:ue.A.filter.flattenCategoriesNG(t,"name"),custom:function(e,t){t[e.value]+=e.count,t.all+=e.count}})}(r,i,s.counters);return{value:Pe(o,a),defaultValue:a,counters:l}}),{updateFilter:Ot})(Zn);var er=n(59188),tr=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).gotoFirstPage=function(){e.props.gotoOperationsPage(Xe.b4.FIRST)},e.gotoLastPage=function(){e.props.gotoOperationsPage(Xe.b4.LAST)},e.gotoNextPage=function(){e.props.gotoOperationsPage(Xe.b4.NEXT)},e.gotoPrevPage=function(){e.props.gotoOperationsPage(Xe.b4.PREV)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(){var e=this.props,t=e.firstPageReached,n=e.lastPageReached;return(0,Ft.jsx)(er.A,{size:"s",first:{handler:this.gotoFirstPage,disabled:t},previous:{handler:this.gotoPrevPage,hotkeyHandler:this.gotoPrevPage,hotkeyScope:"all",hotkey:"ctrl+left, command+left"},next:{handler:this.gotoNextPage,hotkeyHandler:this.gotoNextPage,hotkeyScope:"all",hotkey:"ctrl+right, command+right"},last:{handler:this.gotoLastPage,disabled:n}})}}])}(r.Component),nr={gotoOperationsPage:function(e){return function(t,n){var r=n().operations.list,i=r.dataMode,s=r.timeRange,a=r.cursor,o=r.operations;switch(e){case Xe.b4.FIRST:t(Mt()),i===Xe.Uu.CURRENT&&t(zt());break;case Xe.b4.LAST:i===Xe.Uu.CURRENT&&t(zt()),t(Pt({timestamp:s.from,direction:Xe.Iv.FUTURE,firstPageReached:!1,lastPageReached:!0}));break;case Xe.b4.NEXT:a.lastPageReached||(i===Xe.Uu.CURRENT&&t(zt()),t(Pt({timestamp:N.A.getValue(o[o.length-1],"/@start_time"),direction:Xe.Iv.PAST,firstPageReached:!1})));break;case Xe.b4.PREV:a.firstPageReached||(i===Xe.Uu.CURRENT&&t(zt()),t(Pt({timestamp:N.A.getValue(o[0],"/@start_time"),direction:Xe.Iv.FUTURE,lastPageReached:!1})))}}}};const rr=(0,c.Ng)((function(e){var t=e.operations.list.cursor;return{firstPageReached:t.firstPageReached,lastPageReached:t.lastPageReached}}),nr)(tr);var ir=n(28325),sr=n(91071),ar=n(79329),or=n(66026),lr=n(21594),cr=(0,_e.Mz)([function(e){return e.operations.list.isLoading},function(e){return e.operations.list.hasLoaded},function(e){return e.operations.list.hasError}],(function(e,t,n){var r=(0,ze.Ts)(e,t,n);return(0,ze.RP)(r)})),ur=(0,_e.Mz)([or.Cq,Ue.ID],(function(e,t){var n=D()(Object.keys(e),(function(e){return e.startsWith(St.dK.OPERATION_PRESETS.value)}));return(0,l.A)((0,l.A)({},function(e){return(0,o.A)((0,o.A)({},sr.Kp,{name:"My/Running",preconfigured:!0,filters:(0,l.A)((0,l.A)({},sr.E4),{},{user:e,state:"running"})}),"failed",{name:"My/Failed",preconfigured:!0,filters:(0,l.A)((0,l.A)({},sr.E4),{},{user:e,state:"failed"})})}(t)),g()(n,(function(t,n){return t[n.slice((St.dK.OPERATION_PRESETS.value+lr.yV).length)]=(0,l.A)({},e[n]),t}),{}))})),dr=(0,_e.Mz)([nt,ur],(function(e,t){return g()(t,(function(t,n,r){var i=n.filters;return d()(i,(function(t,n){var r,i=n;return et()(null===(r=e[i])||void 0===r?void 0:r.value,t)}))&&t.add(r),t}),new Set)})),pr="toolbar-presets",hr=(0,i.A)("operations-list"),mr=(0,i.A)("elements-toolbar"),fr=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).state={presetName:"",isPresetDefault:!1},e.onConfirm=function(){var t=e.props,n=t.saveFilterPreset,r=t.toggleSaveFilterPresetDialog,i=e.state;n(i.presetName,i.isPresetDefault).then((function(){e.setState({presetName:"",isPresetDefault:!1}),r()}))},e.makeRemoveHandler=function(t){return function(n){n.stopPropagation(),e.props.removeFilterPreset(t)}},e.isPresetNameEmpty=function(){return!e.state.presetName},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.applyFilterPreset,n=e.defaultPreset,r=e.presets;e.location.search.length<=1&&t(r[n],!1)}},{key:"renderSavePresetDialog",value:function(){var e=this,t=this.props,n=t.dialog,s=t.toggleSaveFilterPresetDialog,a=this.state,o=a.presetName,l=a.isPresetDefault,c=(0,i.A)("elements-form"),u="save-preset-filter";return(0,Ft.jsx)(A.A,{title:"Save filter",confirmText:"Save",visible:n.isSaving,onCancel:s,onConfirm:this.onConfirm,isConfirmDisabled:this.isPresetNameEmpty,content:(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsxs)("div",{className:c("field"),children:[(0,Ft.jsx)("label",{htmlFor:u,className:c("label"),title:"Filter name",children:"Filter name"}),(0,Ft.jsx)(j.k,{id:u,value:o,onUpdate:function(t){return e.setState({presetName:t})},autoFocus:!0})]}),(0,Ft.jsx)("div",{className:c("field"),children:(0,Ft.jsx)(ir.S,{checked:l,onChange:function(t){return e.setState({isPresetDefault:t})},children:"Default filter"})})]})})}},{key:"render",value:function(){var e=this,t=this.props,n=t.defaultPreset,r=t.presets,i=t.applyFilterPreset,s=t.activePresets;return(0,Ft.jsxs)("div",{className:hr(pr,mr("container")),children:[this.renderSavePresetDialog(),f()(r,(function(t,r){var a=s.has(r);return(0,Ft.jsx)("div",{className:hr(pr,mr("component")),children:(0,Ft.jsx)(Mn.$,{className:hr("preset",{active:a}),onClick:function(){return i(t)},role:"button",selected:a,children:(0,Ft.jsxs)("span",{className:hr("preset-content"),children:[(0,Ft.jsxs)("span",{className:hr("preset-name"),children:[n===r&&(0,Ft.jsx)(on.A,{awesome:"star-alt"})," ",t.name]}),!t.preconfigured&&(0,Ft.jsx)("span",{className:hr("preset-remove"),onClick:e.makeRemoveHandler(r),children:(0,Ft.jsx)(on.A,{face:"solid",awesome:"times"})})]})})},r)}))]})}}])}(r.Component),vr={applyFilterPreset:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(n){n({type:Xe.a6,data:{preset:e}}),t&&n(Mt())}},removeFilterPreset:function(e){return function(t){t((0,Ke.dH)(e,St.dK.OPERATION_PRESETS))}},saveFilterPreset:function(e,t){return function(n,r){var i=Promise.resolve(),s=ue.A.guid();return t&&(i=n((0,Ke.ZC)(Xe.Pc,St.dK.OPERATION,s))),i.then((function(){var t,i;n((0,Ke.ZC)(s,St.dK.OPERATION_PRESETS,{name:e,filters:(t=r(),i=t.operations.list.filters,g()(i,(function(e,t,n){var r=t.value;return(0,l.A)((0,l.A)({},e),{},(0,o.A)({},n,r))}),{}))}))}))}},toggleSaveFilterPresetDialog:Vt};const gr=(0,s.y)((0,c.Ng)((function(e){var t=e.operations,n=(0,ar.th)(e)(Xe.Pc,St.dK.OPERATION),r=ur(e);return r[n]||(n=sr.Kp),{presets:r,activePresets:dr(e),defaultPreset:n,dialog:t.list.savePresetDialog}}),vr)(fr));var br=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(){var e=this.props,n=e.states,r=e.name,i=e.placeholder,s=e.updateFilter,a=e.value,o=e.defaultValue,l=e.pin;return(0,Ft.jsx)(Kn.A,{apply:function(e){return s(r,e||o)},filter:t.simpleSuggestLoader,text:a!==o?a:"",items:n,placeholder:i,zIndexGroupLevel:1,clear:function(){return s(r,o)},pin:l},a)}}],[{key:"simpleSuggestLoader",value:function(e,t){return t=t.toLowerCase(),D()(e,(function(e){var n="string"==typeof e?e:e.value;return!t||-1!==n.toLowerCase().indexOf(t)}))}}])}(r.Component),Ar=function(e,t){var n=nt(e)[t],r=n.defaultValue;return{name:t,value:Pe(n.value,r),defaultValue:r}},xr=(0,c.Ng)((function(e){return(0,l.A)((0,l.A)({},Ar(e,"poolTree")),{},{states:lt(e),placeholder:"Pool tree..."})}),{updateFilter:Ot})(br),yr=(0,c.Ng)((function(e){return(0,l.A)((0,l.A)({},Ar(e,"pool")),{},{states:dt(e),placeholder:"Filter pool..."})}),{updateFilter:Ot})(br),jr=(0,c.Ng)((function(e){var t=jt(e);return(0,l.A)((0,l.A)({},Ar(e,"user")),{},{states:mt(e),placeholder:t||"Started by..."})}),{updateFilter:Ot})(br);function wr(){var e=(0,c.wA)(),t=(0,c.d4)(nt).subject.value;return(0,Ft.jsx)("div",{children:J.Ay.renderUserSuggest({value:"string"==typeof t&&t?[t]:[],onUpdate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=(0,a.A)(t,1)[0];e(Ot("subject",n))},width:"max",pin:"round-clear",placeholder:"Accessible for...",hasClear:!0})})}var kr=r.memo(wr),_r=n(74069),Cr=(0,i.A)("operations-list"),Sr=(0,i.A)("elements-toolbar"),Tr=Sr("component"),Nr=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"preparePermissionsPlaceholder",value:function(e){return 0===e.length?"Select...":f()(e,(function(e){return e[0].toUpperCase()})).join(", ")}},{key:"renderTopSection",value:function(){return(0,Ft.jsxs)("div",{className:Sr("container"),children:[(0,Ft.jsx)(Nn,{}),(0,Ft.jsxs)("div",{className:Cr("toolbar-pool-filter",Tr),children:[(0,Ft.jsx)(_r.DG,{}),(0,Ft.jsx)(xr,{pin:"round-clear"}),(0,Ft.jsx)(yr,{pin:"brick-round"})]}),(0,Ft.jsx)(qn,{}),(0,Ft.jsx)("div",{className:Cr("toolbar-pagination",Tr),children:(0,Ft.jsx)(rr,{})})]})}},{key:"renderBottomSection",value:function(){var e=this.props,t=e.failedJobsFilter,n=e.updateFilter,r=e.toggleSaveFilterPresetDialog;return(0,Ft.jsxs)("div",{className:Sr("container"),children:[(0,Ft.jsx)("div",{className:Cr("toolbar-user-filter",Tr),children:(0,Ft.jsx)(jr,{})}),(0,Ft.jsxs)("div",{className:Cr("toolbar-access-filters",Tr),children:[(0,Ft.jsx)(kr,{pin:"round-clear"}),(0,Ft.jsx)(Qn,{type:"check",name:"permissions",withCounters:!1,placeholder:this.preparePermissionsPlaceholder,states:[{name:"read",show:!0},{name:"manage",show:!0}],width:170,multiple:!0,pin:"brick-round"})]}),(0,Ft.jsx)("div",{className:Cr("toolbar-state-filter",Tr),children:(0,Ft.jsx)(Qn,{name:"state",states:[{name:"all",caption:"All states",show:!0},{name:"pending",show:!0},{name:"running",show:!0},{name:"completed",show:!0},{name:"failed",show:!0},{name:"aborted",show:!0}],width:200})}),(0,Ft.jsx)("div",{className:Cr("toolbar-type-filter",Tr),children:(0,Ft.jsx)(Qn,{name:"type",states:[{name:"all",caption:"All types",show:!0},{name:"map",show:!0},{name:"reduce",show:!0},{name:"map_reduce",show:!0},{name:"join_reduce",show:!0},{name:"merge",show:!0},{name:"sort",show:!0},{name:"erase",show:!0},{name:"remote_copy",show:!0},{name:"vanilla",show:!0}],width:200})}),(0,Ft.jsx)("div",{className:Cr("failed-jobs",Tr),children:(0,Ft.jsxs)(an.J,{selected:t.value,onClick:function(){return n("failedJobs",!t.value)},children:["Only ops with failed jobs:"," ",(0,Ft.jsx)("span",{className:Cr("only-jobs-with-failed-counter"),children:t.counter})]})}),(0,Ft.jsx)("div",{className:Cr("toolbar-save-preset",Tr),children:(0,Ft.jsxs)(an.A,{title:"Save filter",onClick:r,className:Cr("save-preset"),children:[(0,Ft.jsx)(on.A,{awesome:"save",face:"regular"}),"  Save filter"]})})]})}},{key:"renderWarning_uiissue_2838",value:function(){return(0,Ft.jsxs)("div",{className:Cr("ytfront-2838"),children:["At the moment there is the unresolved performance issue with getting unfiltered list of operations from archive,",(0,Ft.jsx)("br",{}),'as a temporary solution UI adds current username to "Started by" filter if there are no any other filters specified.']})}},{key:"render",value:function(){var e=this,t=this.props,n=t.fixedStartedByFilter,i=t.children;return(0,Ft.jsx)(wn.X,{hideShadow:!0,keepWidth:!0,children:function(t){var s=t.stickyTop,a=t.stickyTopClassName;return(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsxs)("div",{className:Cr("toolbar",{sticky:s},[Sr(),a]),children:[e.renderTopSection(),e.renderBottomSection(),n&&e.renderWarning_uiissue_2838(),(0,Ft.jsx)(gr,{})]}),i]})}})}}])}(r.PureComponent);function Er(e){var t=e.children,n=(0,c.d4)(Ue.Le),i=((0,c.d4)((function(e){return e.operations.list.filters}))||{}).failedJobs,s=(0,c.d4)(jt),a=(0,c.wA)(),o=r.useCallback((function(){a(Ot.apply(void 0,arguments))}),[a]),l=r.useCallback((function(){a(Vt.apply(void 0,arguments))}),[a]);return(0,Ft.jsx)(Nr,{subjects:n,failedJobsFilter:i,fixedStartedByFilter:s,updateFilter:o,toggleSaveFilterPresetDialog:l,children:t})}const Pr=r.memo(Er);var Rr=n(13717),Ir=n(46357),Mr=n(22636),Or=(0,i.A)("operations-list");function zr(e){var t=e.timeRange,n=(0,c.wA)(),i=(0,c.d4)(Ue.dB),s=(0,c.d4)(Ct),a=(0,Rr.rN)(i,s),o=r.useCallback((function(){n(It.apply(void 0,(0,ve.A)(a)))}),[n,a]);return(0,Rr.Tt)(o,{onlyOnce:Lr(t)}),null}function Lr(e){var t=e.from,n=e.to;if("string"==typeof t&&"string"==typeof n){var r=ke()(t),i=ke()(n).diff(r);return ke().duration(i).asDays()>=1}return!1}var Vr=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"isTimeRangeChanged",value:function(e){var t=this.props.timeRange;return t.from!==e.from||t.to!==e.to}},{key:"renderError",value:function(){var e=this.props.error,t=e.message,n=e.details;return(0,Ft.jsx)(b.z,{message:t,error:n})}},{key:"firstTimeError",value:function(){var e=this.props,t=e.hasLoaded;return e.hasError&&!t}},{key:"render",value:function(){var e=this.props,t=e.hasError,n=e.inDashboard,r=e.timeRange;return(0,Ft.jsxs)("div",{className:Or(),children:[(0,Ft.jsx)(zr,{timeRange:r}),n&&(0,Ft.jsx)("div",{className:(0,i.A)("elements-heading")({size:"l"}),children:"Operations"}),(0,Ft.jsxs)(Pr,{children:[t&&this.renderError(),!this.firstTimeError()&&(0,Ft.jsx)(jn,{})]})]})}}])}(r.Component);Vr.defaultProps={inDashboard:!1};var Br=(0,c.Ng)((function(e){var t=e.operations.list,n=t.isLoading,r=t.hasLoaded,i=t.hasError,s=t.error;return{timeRange:t.timeRange,isLoading:n,hasLoaded:r,hasError:i,error:s}}))(Vr);function Fr(){var e=(0,c.d4)(cr);return(0,Ir.v)({type:Tt.c.OPERATIONS_LIST,startDeps:[e],allowStart:function(e){return!(0,a.A)(e,1)[0]}}),(0,Mr.ol)({type:Tt.c.OPERATIONS_LIST,stopDeps:[e],allowStop:function(e){return(0,a.A)(e,1)[0]}}),(0,Ft.jsx)(Br,{})}const Dr=r.memo(Fr);var Jr=n(36734),Hr=n(5865),Ur=n(56950),Wr=n(3764),$r=(0,i.A)("yt-histogram");function Yr(e){var t=e.className,n=e.data,i=e.xLabel,s=e.yLabel,o=e.yLogarithmic,c=e.yMin,u=e.xFormat,d=void 0===u?dn.A.Number:u,p=e.yFormat,h=void 0===p?dn.A.Number:p,m=e.renderTooltip,f=void 0===m?Xr:m,v=r.useMemo((function(){var e=function(e){var t=e.min,n=e.max,r=e.count,i=t===n?1:(n-t)/Math.max(r.length,1),s=[void 0].concat((0,ve.A)(r)),a=[t-i/2];if(r.length>1)for(var o=0;o<r.length;++o)a.push(t+o*i+i/2);else a.push(t);return a.push(n+i/2),s.push(void 0),{timeline:a,serieData:s,step:t===n?0:i}}(n),t=e.timeline,r=e.serieData,u=e.step;return{data:{timeline:t,graphs:[(0,l.A)({type:"column",data:o?r.map((function(e){return 0===e?NaN:e})):r,color:(0,Wr.gL)(0),formatter:h},{renderOptions:{size:[1],gap:1}})]},libraryConfig:{axes:{x:{label:i,values:function(e,t){return t.map(d)}},y:{label:s}},scales:{y:{min:c,type:o?"logarithmic":"linear"}},tooltip:{render:function(e){var t,n=e.x,r=(0,a.A)(e.scales,1),i=(0,a.A)(r[0].rows,1)[0].originalValue;return null!==(t=f(h(isNaN(i)?0:i),d(n-u/2),d(n+u/2)))&&void 0!==t?t:"-"}}}}}),[n,i,s,d,h,f,c,o]);return(0,Ft.jsx)("div",{className:$r(null,t),children:(0,Ft.jsx)(Wr.Cj,{type:"yagr",data:v})})}const qr=r.memo(Yr);var Xr=function(e,t,n){return"<b>".concat(e,"</b> for range from <b>").concat(t,"</b> to <b>").concat(n,"</b>")};function Kr(e,t){var n=null!=e?e:{},r=n.min,i=n.max;if(r!==i&&void 0!==r&&void 0!==i){var s=r+(i-r)/10;if(t(r)===t(s))for(var a=0;a<5;++a){var o={digits:a+2};if(t(r,o)!==t(s,o))return{digits:a+3}}}}var Gr=(0,i.A)("operation-detail-partition-sizes"),Zr=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).state={},e.formatX=function(t){var n=e.state.formatSettings;return dn.A.Bytes(t,n)},e.renderTooltip=function(e,t,n){return"<b>".concat(e,"</b> jobs have estimated input job size from ").concat(t," to ").concat(n)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(){var e=this.state.data;return e?(0,Ft.jsx)(Jr.A,{children:(0,Ft.jsx)("div",{className:Gr(),children:(0,Ft.jsx)(qr,{className:Gr("charts"),data:e,yLabel:"partition count",xLabel:"partition data weight",xFormat:this.formatX,yMin:.5,yLogarithmic:!0,renderTooltip:this.renderTooltip})})}):null}}],[{key:"getDerivedStateFromProps",value:function(e){var t=N.A.getValue(e.operation,"/@progress"),n=t&&N.A.getValue(t,"/partition_size_histogram");return{formatSettings:Kr(n,dn.A.Bytes),data:n}}}])}(r.Component),Qr=(0,c.Ng)((function(e){return{operation:e.operations.detail.operation,chartKitTheme:(0,Ue.O4)(e)}}))(Zr);function ei(){var e=(0,c.d4)(Je.Q1);return(0,Ir.v)({type:Tt.c.OPERATION_TAB_PARTITION_SIZES,additionalStartType:Tt.c.OPERATION,startDeps:[e],allowStart:function(e){var t=(0,a.A)(e,1)[0];return!(0,ze.RP)(t)}}),(0,Mr.ol)({type:Tt.c.OPERATION_TAB_PARTITION_SIZES,stopDeps:[e],allowStop:function(e){var t=(0,a.A)(e,1)[0];return(0,ze.RP)(t)}}),(0,Ft.jsx)(Qr,{})}var ti=n(81379),ni=n(16727),ri=n(56796),ii=n(44458),si=n(92611);const ai=JSON.parse('{"columns.type":"Type","columns.period":"Period","less":"Less","more":"More","details":"Details"}'),oi=JSON.parse('{"columns.type":"Тип","columns.period":"Период","less":"Меньше","more":"Больше","details":"Детали"}'),li=(0,si.Kc)("yt:alert-events",{en:ai,ru:oi});var ci=(0,i.A)("alert-events"),ui=[{name:li("columns.type"),render:function(e){var t=e.row;return(0,Ft.jsxs)("span",{children:[dn.A.Readable(t.type),Boolean(t.url)&&(0,Ft.jsxs)(x.A,{url:t.url,theme:"secondary",children:[" ",(0,Ft.jsx)(on.A,{awesome:"question-circle"})]})]})}},{name:li("columns.period"),render:function(e){var t=e.row,n=t.from,i=t.to;return(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)(ni.Bj.Time,{time:n,settings:{format:"full"},valueFormat:"DateTime"})," - ",i?(0,Ft.jsx)(ni.Bj.Time,{time:i,settings:{format:"full"},valueFormat:"DateTime"}):"..."]})}},{name:"",render:function(e){var t=e.row;return(0,Ft.jsx)(ri.S,{onClick:function(){(0,ze.eW)(t.error,{type:"alert",hideOopsMsg:!0,helpURL:t.url})},children:li("details")})}}];function di(e){var t=e.className,n=e.items,i=r.useState(!1),s=(0,a.A)(i,2),o=s[0],l=s[1],c=r.useMemo((function(){return n.sort((function(e,t){return(0,ii.IP)(e.to,t.to,-1,-1)||(0,ii.IP)(e.from,t.from,-1,1)}))}),[n]),u=r.useMemo((function(){return o?c:c.slice(0,5)}),[o,c]),d=r.useCallback((function(){l(!o)}),[o,l]);return(0,Ft.jsxs)("div",{className:t,children:[(0,Ft.jsx)(ti.Ay,{className:ci(),columns:ui,data:u,settings:{displayIndices:!1,sortable:!1},useThemeYT:!0,disableRightGap:!0,rowClassName:function(e){return ci("row",{current:!e.to})}}),c.length>5?(0,Ft.jsx)(ri.S,{onClick:d,children:li(o?"less":"more")}):null]})}const pi=r.memo(di);var hi=n(33832),mi=n(4386),fi=function(e){var t=e.description,n=(0,c.d4)(mi.LC);if(function(e){var t=Xt.A.utils.yson,n=t.attributes,r=t.type,i=!Object.hasOwnProperty.call(n(e),"_type_tag");return"object"===r(e)&&i}(t)){var r=N.A.getValue(t),i=h()(r).sort(),s=f()(i,(function(e){return{key:e,value:(0,Ft.jsx)(hi.A,{settings:n,value:r[e]})}}));return(0,Ft.jsx)(tn.Ay,{items:s})}return(0,Ft.jsx)(y.A,{settings:n,value:t})},vi=n(98115),gi=n(70243),bi=n(80268),Ai=n(62250),xi=["row_count","compressed_data_size","uncompressed_data_size","data_weight","chunk_count"],yi={theme:"light",size:"m",striped:!1,virtual:!1},ji=(0,l.A)((0,l.A)({},yi),{},{columns:{sets:{default:{items:["name"].concat(xi)},withActions:{items:["name"].concat(xi,["actions"])}},items:(0,Oe.TU)({name:{sort:!1,align:"left"},row_count:{sort:!1,align:"right"},compressed_data_size:{sort:!1,align:"right",caption:"Compressed"},uncompressed_data_size:{sort:!1,align:"right",caption:"Uncompressed"},data_weight:{sort:!1,align:"right"},chunk_count:{sort:!1,align:"right",caption:"Slices"},actions:{sort:!1,caption:""}}),mode:"default"}}),wi=(0,l.A)((0,l.A)({},yi),{},{columns:{sets:{default:{items:["account","node_count","disk_space","chunk_count"]}},items:(0,Oe.TU)({account:{sort:!1,align:"left"},disk_space:{sort:!1,align:"right"},chunk_count:{sort:!1,align:"right",caption:"Slices"},node_count:{sort:!1,align:"right"}}),mode:"default"},templates:{key:"operations/detail/resources/intermediate"}}),ki=n(5800),_i=n(9331),Ci=(0,i.A)("resources");function Si(e,t){return ue.A.format.Bytes(e.value[t])}function Ti(e,t){return ue.A.format.Number(e.value[t])}function Ni(e,t){return"".concat(e,"->").concat(t)}function Ei(e,t,n){return{allowExpand:e,resources:e?g()(t,(function(e,t){var r=t.from,i=t.to,s=n[Ni(r,i)];if(e.push(t),s){var a=t.job_data_statistics,o=t.teleport_data_statistics;a&&e.push({inner:"processed by jobs",value:a}),o&&e.push({inner:"teleported",value:o})}return e}),[]):t}}zn().arrayOf(zn().shape({name:zn().string,value:zn().object,from:zn().string,to:zn().string})),zn().array;var Pi=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).state={prevProps:void 0,expandedTasks:{},resources:[],allowExpand:!1},e.rowClassName=function(e){return e.name?Ci("named-row"):e.inner?Ci("inner-row"):null},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"toggleExpand",value:function(e){var t=(0,l.A)({},this.state.expandedTasks);t[e]?delete t[e]:t[e]=!0;var n=this.state.allowExpand,r=this.props.resources;this.setState((0,l.A)({expandedTasks:t},Ei(n,r,t)))}},{key:"getResourceTemplates",value:function(){var e=this.state,t=e.expandedTasks,n=e.allowExpand,i=this;return{name:function(e){var s=e.name,a=e.from,o=e.to,l=e.inner;if(s)return s;if(l)return(0,Ft.jsx)("span",{className:Ci("inner"),children:l});var c=(0,Ft.jsxs)("span",{children:[a," -> ",o]});if(n){var u=Ni(a,o),d=t[u],p=function(){i.toggleExpand(u)};return(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)(_i.A,{expanded:d,onClick:p,visible:!0}),(0,Ft.jsx)("span",{onClick:p,className:Ci("name"),children:c})]})}return c},chunk_count:function(e,t){return Ti.call(this,e,t)},row_count:Ti,data_weight:Si,compressed_data_size:Si,uncompressed_data_size:Si,actions:function(e){var t=e.info,n=e.from,r=e.to;return t?(0,Ft.jsx)(ki.A,{title:"Data flow: ".concat(n," -> ").concat(r),attributes:t}):null}}}},{key:"render",value:function(){var e=this.props,t=e.operation,n=e.intermediateResources,r=this.state,i=r.resources,s=r.allowExpand;return(0,Ft.jsxs)("div",{className:Ci(),children:[(0,Ft.jsx)("div",{className:Ci("table","elements-section"),children:(0,Ft.jsx)(rn.A,(0,l.A)((0,l.A)({},ji),{},{columnsMode:s?"withActions":void 0,css:Ci(),items:i,templates:this.getResourceTemplates(),rowClassName:this.rowClassName}))}),t.isRunning()&&n&&(0,Ft.jsxs)("div",{className:Ci("table","elements-section"),children:[(0,Ft.jsx)("div",{className:"elements-heading elements-heading_size_s",children:"Uncommitted"}),(0,Ft.jsx)(rn.A,(0,l.A)((0,l.A)({},wi),{},{css:Ci(),items:n}))]})]})}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(e===t.prevProps)return null;var n=e.operation,r=e.resources,i=V(n);return(0,l.A)({allowExpand:i},Ei(i,r,t.expandedTasks))}}])}(r.Component);const Ri=Pi;var Ii=n(4214),Mi=["className","renderToggler"],Oi=(0,i.A)("elements-heading"),zi=(0,i.A)("collapsible-table"),Li=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderHeading",value:function(){var e=this.props,t=e.heading,n=e.allItemsCount;return(0,Ft.jsxs)("div",{className:Oi({size:"s"}),children:[(0,Ft.jsx)("span",{className:zi("heading"),children:ue.A.format.ReadableField(t)}),(0,Ft.jsx)("span",{className:zi("size"),children:n})]})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.renderToggler,r=(0,xe.A)(e,Mi);return(0,Ft.jsxs)("div",{className:zi(null,t),children:[this.renderHeading(),(0,Ft.jsx)(rn.A,(0,l.A)({},r)),n()]})}}])}(r.Component);const Vi=(0,Ii.A)(Li);var Bi={theme:"light",size:"s",striped:!1,virtual:!1,templates:{key:"operations/detail/specification/io",data:{}},columns:{sets:{input:{items:["name","filters","tags"]},output:{items:["name","live_preview","tags"]},stderr:{items:["name","live_preview","tags"]}},items:{name:{sort:!1,align:"left",name:"name"},live_preview:{sort:!1,align:"left",name:"live_preview"},filters:{sort:!1,align:"left",name:"filters"},tags:{sort:!1,align:"left",name:"tags"}}}},Fi=(0,l.A)((0,l.A)({},Bi),{},{columns:(0,l.A)((0,l.A)({},Bi.columns),{},{mode:"input"})}),Di=(0,l.A)((0,l.A)({},Bi),{},{columns:(0,l.A)((0,l.A)({},Bi.columns),{},{mode:"output"})}),Ji=(0,l.A)((0,l.A)({},Bi),{},{columns:(0,l.A)((0,l.A)({},Bi.columns),{},{mode:"stderr"})}),Hi=(0,i.A)("elements-heading"),Ui=(0,i.A)("specification"),Wi=zn().shape({type:zn().string.isRequired,caption:zn().string,command:zn().string,className:zn().string,jobCount:zn().number,files:zn().arrayOf(zn().shape({path:zn().string,name:zn().string,executable:zn().bool})),environment:zn().arrayOf(zn().shape({name:zn().string,value:zn().string}))}),$i=(zn().shape({transferTask:zn().shape({id:zn().string.isRequired,url:zn().string}),mode:zn().string,remote:zn().shape({cluster:zn().string.isRequired,network:zn().string}),startedBy:zn().shape({command:zn().arrayOf(zn().string).isRequired,fields:zn().arrayOf(zn().object).isRequired}),intermediate:zn().shape({supported:zn().bool.isRequired,path:zn().string,transaction:zn().string}),mapper:Wi,reducer:Wi,reduceCombiner:Wi,tasks:zn().arrayOf(Wi)}),function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderTransferTask",value:function(e){var t=e.id,n=e.url,r=e.mode;return(0,Ft.jsx)(tn.Ay,{className:Ui("meta"),items:[{key:"mode",value:r,visible:Boolean(r)},{key:"transfer task",value:(0,Ft.jsx)(tn.ts,{id:t,url:n}),visible:Boolean(t||n)}]})}},{key:"renderRemote",value:function(e){var t=e.cluster,n=e.network;return(0,Ft.jsxs)("div",{className:Ui("remote"),children:[(0,Ft.jsx)("div",{className:Hi({size:"s"}),children:"Remote"}),(0,Ft.jsx)(tn.Ay,{items:[{key:"cluster",value:t},{key:"network",value:n}]})]})}},{key:"renderStartedBy",value:function(e){var t=e.fields,n=void 0===t?[]:t,r=e.command,i=n.map((function(e){return{key:e.name,value:"object"===(0,ge.A)(e.value)?(0,Ft.jsx)(y.A,{value:e.value}):e.value}}));return i.push({key:"command",value:(0,Ft.jsx)(tn.qe,{value:r,lineCount:5}),visible:Boolean(null==r?void 0:r.length)}),(0,Ft.jsxs)("div",{className:Ui("started-by"),children:[(0,Ft.jsx)("div",{className:Hi({size:"s"}),children:"Started by"}),(0,Ft.jsx)(tn.Ay,{items:i})]})}},{key:"renderScript",value:function(e){var t=e.type,n=e.caption,r=e.className,i=e.jobCount,s=e.environment,a=e.files,o=e.command,l=e.layerPaths,c=this.props.cluster;return(0,Ft.jsxs)("div",{className:Ui("mapper"),children:[(0,Ft.jsx)("div",{className:Hi({size:"s"}),children:ue.A.format.ReadableField(n||t)}),(0,Ft.jsx)(tn.Ay,{items:[{key:"class name",value:r,visible:Boolean(r)},{key:"job count",value:i,visible:Boolean(i)},{key:"environment",value:(0,Ft.jsx)(tn.u0,{environments:s}),visible:s.length>0},{key:"files",value:(0,Ft.jsx)(tn.AA,{files:a,cluster:c}),visible:a.length>0},{key:"command",value:(0,Ft.jsx)(tn.qe,{value:o,lineCount:5}),visible:Boolean(o)},{key:"layer paths",value:(0,Ft.jsx)(tn.KI,{paths:l,cluster:c}),visible:Boolean(l)}]})]},"".concat(t,"/").concat(n,"/").concat(r))}},{key:"renderIO",value:function(e,t,n){return(0,Ft.jsx)(Vi,(0,l.A)((0,l.A)({},n),{},{prepareVisibleItems:oe,filterVisibleItems:le,className:Ui(e),css:Ui("io"),heading:e,items:t}))}},{key:"renderIntermediate",value:function(e,t){var n=this.props.cluster;return(0,Ft.jsxs)("div",{className:Ui("intermediate"),children:[(0,Ft.jsx)("div",{className:Hi({size:"s"}),children:t}),(0,Ft.jsx)(tn.dM,(0,l.A)((0,l.A)({},e),{},{cluster:n}))]})}},{key:"renderTasks",value:function(){var e=this;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t&&e.renderScript(t)}))}},{key:"render",value:function(){var e=this.props.specification,t=e.mode,n=e.transferTask,r=e.remote,i=e.startedBy,s=e.mapper,a=e.reducer,o=e.reduceCombiner,c=e.input,u=e.intermediate,d=e.output,p=e.stderr,h=e.tasks,m=e.coredumps;return(0,Ft.jsxs)("div",{className:Ui(),children:[(n||t)&&this.renderTransferTask((0,l.A)((0,l.A)({},n),{},{mode:t})),r&&this.renderRemote(r),i&&this.renderStartedBy(i),(null==c?void 0:c.length)>0&&this.renderIO("input",c,Fi),u&&this.renderIntermediate(u,"Intermediate"),(null==d?void 0:d.length)>0&&this.renderIO("output",d,Di),(null==p?void 0:p.length)>0&&this.renderIO("stderr",p,Ji),(null==m?void 0:m.length)>0&&this.renderIO("core",m,Ji),s&&this.renderScript(s),a&&this.renderScript(a),o&&this.renderScript(o),h&&this.renderTasks(h)]})}}])}(r.Component)),Yi=n(9262),qi=n(87446),Xi=n(32235),Ki=n(79703),Gi=(0,i.A)("elements-heading"),Zi=(0,i.A)("runtime"),Qi=function(e){var t=(e.progress||{}).starvation_status;return(t?ue.A.format.Readable(t):void 0)||null},es={showEditPoolsWeightsModal:Bt},ts=(0,c.Ng)(null,es),ns=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).handlePoolEditClick=function(){var t=e.props;(0,t.showEditPoolsWeightsModal)(t.operation)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderTree",value:function(e){var t,n,r,i,s,a,o=e.progress,l=e.name,c=this.props,u=c.cluster,d=c.operation,p=c.showEditPoolsWeightsModal,h=c.treeConfigs,m=d.state,f=((null==h?void 0:h.find((function(e){return e.tree===l})))||{}).config,v=(null==f?void 0:f.main_resource)||"cpu",g=null==f||null===(t=f.resource_limits)||void 0===t?void 0:t[v],b=null==o||null===(n=o.detailed_fair_share)||void 0===n?void 0:n.total[v],A=void 0!==g&&void 0!==b?b*g:void 0,x={pool:o.pool,tree:l,weight:o.weight},y=N.A.getValue(d,"/@full_spec/is_gang");return(0,Ft.jsxs)("div",{className:Zi("tree"),children:[(0,Ft.jsx)(gi.s,{gap:2,children:(0,Ft.jsx)("div",{className:Gi({size:"s"}),children:ue.A.format.ReadableField(l)})}),(0,Ft.jsx)(tn.Ay,{items:[[{key:"pool",value:(0,Ft.jsx)(Yi.s,{onEdit:this.handlePoolEditClick,cluster:u,state:m,pool:x,compact:!0})},{key:"weight",value:(0,Ft.jsx)(tn.tJ,{operation:d,pool:x,onEdit:function(){return p(d)}})},{key:"fifo_index",label:(0,Ft.jsx)(qi.m,{content:"Operation's position in the pool's queue. Operations on lower positions will be scheduled sooner.",children:(0,Ft.jsxs)(gi.s,{alignItems:"center",gap:1,children:["FIFO index ",(0,Ft.jsx)(Xi.I,{data:Ki.A,size:16})]})}),value:(0,Ft.jsx)(tn.Bj.FormattedValue,{value:o.fifo_index,format:"Number"})},{key:"fair_share",value:this.props.isAbsoluteValue?ue.A.format.Number(A,{digits:6,digitsOnlyForFloat:!0})+" ".concat(ue.A.format.Readable(v)):de(o.fair_share_ratio)},{key:"usage",value:this.props.isAbsoluteValue?ue.A.format.Number(null==o||null===(r=o.resource_usage)||void 0===r?void 0:r[v],{digits:6,digitsOnlyForFloat:!0})+" ".concat(ue.A.format.Readable(v)):de(o.usage_ratio)},{key:"demand",value:this.props.isAbsoluteValue?ue.A.format.Number(null==o||null===(i=o.resource_demand)||void 0===i?void 0:i[v],{digits:6,digitsOnlyForFloat:!0})+" ".concat(ue.A.format.Readable(v)):de(o.demand_ratio)}],[{key:"dominant_resource",value:ue.A.format.Readable(o.dominant_resource)},{key:"Starvation status",value:(0,Ft.jsx)(Qi,{progress:o})},{key:"scheduling_status",value:ue.A.format.Readable(o.scheduling_status)},{key:"gang",label:(0,Ft.jsx)(qi.m,{content:"Indicates whether operation's jobs perform a single collective computation and must be scheduled simultaneously.",children:(0,Ft.jsxs)(gi.s,{alignItems:"center",gap:1,children:["Gang ",(0,Ft.jsx)(Xi.I,{data:Ki.A,size:16})]})}),value:y?"True":"False"}].concat((0,ve.A)(y?[{key:"scheduling_segment",value:ue.A.format.Readable(o.scheduling_segment)}]:[]),[{key:"partitions",value:(null===(s=o.partitions)||void 0===s?void 0:s.completed)+" / "+(null===(a=o.partitions)||void 0===a?void 0:a.total),visible:Boolean(o.partitions)}])]})]},l)}},{key:"render",value:function(){var e=this,t=this.props.runtime;return(0,Ft.jsx)("div",{className:Zi(),children:f()(t,(function(t){return e.renderTree(t)}))})}}])}(r.Component);const rs=ts(ns);var is=n(21952),ss=n(96843),as=n.n(ss),os=n(84806),ls=n(29081),cs=(0,i.A)("yt-job-counters");function us(e){var t=e.data,n=e.helpUrl,i=e.allowHideEmpty,s=r.useState(!0),o=(0,a.A)(s,2),l=o[0],c=o[1];return(0,Ft.jsxs)("div",{className:cs(),children:[i&&(0,Ft.jsx)("div",{className:cs("filters"),children:(0,Ft.jsx)(ir.S,{checked:l,onUpdate:c,children:"Hide empty"})}),Object.keys(t).map((function(e){var n=t[e];return(0,Ft.jsx)(ps,{name:e,items:i?ds(l,n):n},e)})),(0,ls.fs)((0,Ft.jsx)("div",{className:"elements-section",children:(0,Ft.jsxs)(x.A,{url:n,children:[(0,Ft.jsx)(on.A,{awesome:"book"})," Help"]})}))]})}function ds(e,t){return e?t.filter((function(e){var t=e.value;return Boolean(t)})):t}function ps(e){var t=e.name,n=e.items;return(0,Ft.jsxs)("div",{className:"elements-section",children:[(0,Ft.jsx)("div",{className:"elements-heading elements-heading_size_s",children:t}),n.length?(0,Ft.jsx)(tn.Ay,{items:n}):"No items"]})}var hs=(0,i.A)("operation-jobs-detailed"),ms=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderAborted",value:function(e){var t=e.scheduled.counters,n=[{key:"total",value:e.scheduled.total}].concat((0,ve.A)(t)),r=e.nonScheduled.counters,i=[{key:"total",value:e.nonScheduled.total}].concat((0,ve.A)(r)),s=J.Ay.docsUrls["operations:overview#aborted_jobs"];return(0,Ft.jsx)(us,{helpUrl:s,data:{Scheduled:n,"Non scheduled":i},allowHideEmpty:!0})}},{key:"renderCompleted",value:function(e){var t=[{key:"total",value:e.nonInterrupted.total}],n=e.interrupted.counters,r=[{key:"total",value:e.interrupted.total}].concat((0,ve.A)(n)),i=J.Ay.docsUrls["operations:overview#completed_jobs"];return(0,Ft.jsx)(us,{helpUrl:i,data:{"Non interrupted":t,Interrupted:r}})}},{key:"renderModalContent",value:function(e){var t=this.props.item;return"aborted"===e?this.renderAborted(t.abortedStats):this.renderCompleted(t.completedStats)}},{key:"renderCount",value:function(e,t,n){return"aborted"===e?(0,Ft.jsxs)("span",{children:[ue.A.format.Number(t)," (",ue.A.format.Number(n),")"]}):(0,Ft.jsx)("span",{children:ue.A.format.Number(t+n)})}},{key:"render",value:function(){var e=this.props,t=e.primaryValue,n=e.secondaryValue,r=e.handleClose,i=e.handleShow,s=e.visible,a=e.type,o=e.item,l="".concat(ue.A.format.ReadableField(a)," statistics: ").concat(o.caption),c=this.renderModalContent(a);return(0,Ft.jsxs)(gi.s,{className:hs(),gap:1,children:[(0,Ft.jsxs)(x.A,{theme:"ghost",size:"xs",onClick:i,children:["View"," "]}),this.renderCount(a,t,n),(0,Ft.jsx)(A.A,{onOutsideClick:r,onCancel:r,content:c,visible:s,footer:!1,title:l})]})}}])}(r.Component);const fs=(0,os.A)(ms);function vs(e,t){return ue.A.utils.compareVectors(["other"===e.key?1:-1,e.key],["other"===t.key?1:-1,t.key],"asc")}function gs(e,t){if("object"===(0,ge.A)(e[t])){var n=g()(e[t],(function(e,t,n){return e.counters.push({value:t,key:n}),e.total+=t,e}),{counters:[],total:0});return n.counters.sort(vs),n}return{total:e[t]}}function bs(e){var t=e.completed;return{interrupted:gs(t,"interrupted"),nonInterrupted:gs(t,"non-interrupted"),total:t.total}}function As(e){var t=e.aborted;return{scheduled:gs(t,"scheduled"),nonScheduled:gs(t,"non_scheduled"),total:t.total}}function xs(e){return{counters:e,abortedStats:As(e),completedStats:bs(e)}}var ys={theme:"light",striped:!1,virtual:!1,size:"m",columns:function(){var e=["total","pending","running","completed","failed","aborted","lost"],t={job_type:{sort:!1,align:"left",caption:"Task"}};return R()(e,(function(e){t[e]={sort:!1,align:"right"}})),t.actions={name:"actions",sort:"false",caption:""},{items:(0,Oe.TU)(t),sets:{default:{items:["job_type"].concat(e)},withActions:{items:f()(t,(function(e,t){return t}))}},mode:"default"}}(),computeKey:function(e){return e.type}},js=n(50432),ws=n(29347),ks=n.n(ws),_s=n(81214),Cs=n.n(_s),Ss=n(37918),Ts=n.n(Ss),Ns=n(23488),Es=n.n(Ns),Ps=n(70969),Rs=n.n(Ps);function Is(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(t(e))n(r,void 0,e);else{if(!e)return;r.length&&n(r,e,void 0),Object.keys(null!=e?e:{}).forEach((function(i){r.push(i),Is(e[i],t,n,r),r.pop()}))}}function Ms(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=!0,a={};return Object.keys(e).forEach((function(o){i.push(o);var l=e[o];if(t(l)){if(n(i,void 0,l)){var c=r?r(l):l;void 0!==c&&(a[o]=c,s=!1)}}else if(n(i,l,void 0)){var u=Ms(l,t,n,r,i);void 0!==u&&(a[o]=u,s=!1)}i.pop()})),s?void 0:a}function Os(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object.keys(e).some((function(i){r.push(i);var s=e[i];if(t(s)){if(n(r,void 0,s))return!0}else{if(n(r,s,void 0))return!0;if(Os(s,t,n,r))return!0}return r.pop(),!1}))}var zs=n(23860),Ls=["running"],Vs=["running"],Bs=function(e){return e.operations.detail.operation},Fs=(0,_e.Mz)([Bs],(function(e){return N.A.getValue(e,"/@progress/job_statistics_v2")}));function Ds(e){return Array.isArray(e)}var Js=(0,_e.Mz)([Fs],(function(e){var t,n,r=null!==(t=null==e||null===(n=e.time)||void 0===n?void 0:n.total)&&void 0!==t?t:[],i=g()(r,(function(e,t){return R()(t.tags,(function(t,n){var r=n;t&&(e[r]||(e[r]=new Set),e[r].add(t))})),e}),{});return g()(i,(function(e,t,n){return e[n]=(0,js.A)(Array,(0,ve.A)(t.values())),e}),{})})),Hs=(0,_e.Mz)([function(e){return e.operations.statistics.jobTypeFilter},function(e){return e.operations.statistics.poolTreeFilter},function(e){return e.operations.statistics.filterText},Js],(function(e,t,n,r){var i=r.job_type,s=r.pool_tree;return{activeJobType:-1===i.indexOf(e)?zs.FB:e,activePoolTree:-1===s.indexOf(t)?zs.FB:t,filterText:n}})),Us=function(e){return!as()(Fs(e))},Ws=(0,_e.Mz)([Hs,Fs],(function(e,t){var n=e.activeJobType,r=e.activePoolTree,i=e.filterText;if(!n&&!r&&!i)return t;var s=i.length?function(e){return-1!==e.join("/").indexOf(i)}:function(){return!0};return Ms(null!=t?t:{},Ds,(function(e,t){return!!s(e)||t&&Os(t,Ds,s,e.slice())}),(function(e){return D()(e,(function(e){var t=e.tags,i=t.job_type,s=t.pool_tree;return!(n&&i!==n||r&&s!==r)}))}))})),$s=(0,_e.Mz)([Ws],(function(e){var t=[];return Is(null!=e?e:{},Ds,(function(e,n,r){var i=Boolean(r);t.push({title:e[e.length-1],level:e.length-1,data:r?Ys(r):void 0,isLeafNode:i,name:e.join("/")})})),t}));function Ys(e){var t={};return R()(e,(function(e){var n=e.summary,r=e.tags.job_state;t[r]=function(e,t){if(!t)return e;var n=Rs()([e.count,t.count]),r=Rs()([e.sum,null==t?void 0:t.sum]);return{min:Ts()([e.min,t.min]),max:Es()([e.max,t.max]),count:n,sum:r}}(n,t[r])})),t}var qs=(0,_e.Mz)(Fs,(function(e){var t;return Xs(null==e||null===(t=e.time)||void 0===t?void 0:t.total)}));function Xs(e){var t=Ys(null!=e?e:[]),n=(t.running,(0,xe.A)(t,Ls)),r=ks()(f()(n,"sum"));return r.length?Rs()(r):dn.A.NO_VALUE}var Ks=["job_proxy.cpu.user","job_proxy.cpu.system","user_job.cpu.user","user_job.cpu.system"],Gs=(0,_e.Mz)([Fs],(function(e){var t=g()(Ks,(function(t,n){var r=Cs()(e,n);if(Ds(r)){var i=Xs(r);void 0!==i&&t.push(i)}return t}),[]);return t.length?Rs()(t):dn.A.NO_VALUE})),Zs=(0,_e.Mz)([Bs,Fs],(function(e,t){var n,r,i,s,a=function(e){if(V(e))return function(e){var t=N.A.getValue(e,"/@progress/tasks"),n=f()(t,(function(e){var t=e.task_name,n=e.job_type,r=e.job_counter;return(0,l.A)((0,l.A)({type:t,caption:t,jobType:n},xs(r)),{},{info:e})})),r=N.A.getValue(e,"/@progress/total_job_counter");return n.push((0,l.A)((0,l.A)({type:"total",caption:"total",jobType:"total"},xs(r)),{},{info:r,isTotal:!0})),n}(e);var t=N.A.getValue(e,"/@progress/data_flow_graph"),n=N.A.getValue(t,"/topological_ordering"),r=N.A.getValue(t,"/vertices"),i=[];return t&&(n=function(e){return(e=D()(e,(function(e){var t=String(e).toLowerCase();return"source"!==t&&"sink"!==t}))).push("total"),e}(n),n=D()(n,(function(e){return void 0!==r[e]})),i=f()(n,(function(e){return{type:e,jobType:"total"===e?e:r[e].job_type,counters:r[e].job_counter}})),i=f()(i,(function(e){var t=e.type,n=e.counters;return(0,l.A)({type:t,caption:t,jobType:e.jobType},xs(n))}))),i}(e),o=Ys(null!==(n=null==t||null===(r=t.time)||void 0===r?void 0:r.total)&&void 0!==n?n:[]),c=(o.running,(0,xe.A)(o,Vs)),u=null===(i=c.aborted)||void 0===i?void 0:i.sum,d=null===(s=c.completed)||void 0===s?void 0:s.sum,p=function(e,t){var n;return void 0!==t&&void 0!==e&&(e>0&&t>0?n=e/t*100:e>0?n=100:t>0&&(n=0)),n}(u,d),h=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN,s=null!==(t=null===(n=Ys((null==e||null===(r=e.data)||void 0===r||null===(r=r.input)||void 0===r?void 0:r.data_weight)||[]).completed)||void 0===n?void 0:n.sum)&&void 0!==t?t:0;return s>0?s/(i/1e3):void 0}(t||{},d),m=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN,s=null!==(t=null===(n=Ys((null==e||null===(r=e.data)||void 0===r||null===(r=r.input)||void 0===r?void 0:r.row_count)||[]).completed)||void 0===n?void 0:n.sum)&&void 0!==t?t:0;return i>0?s/(i/1e3):void 0}(t||{},d);return c||u||d||p||h||h||0!==a.length?{items:a,abortedJobsTime:u,completedJobsTime:d,abortedJobsTimeRatio:p,averageReadDataRate:h,averageReadRowRate:m}:{items:[]}})),Qs=(0,i.A)("jobs");function ea(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=[];return R()(e,(function(e){n.push(e);var r=e.caption;t[r]&&n.push({taskInfo:e.info})})),{items:e,visibleItems:n}}var ta=function(e){function t(e){var n;(0,ye.A)(this,t),(n=(0,be.A)(this,t,[e])).state={allowActions:!1,expandedState:{},visibleItems:[],items:[],operation:void 0},n.templates=void 0;var i=n;return n.templates={__default__:function(e,t){return e.counters?(0,Ft.jsx)("span",{children:ue.A.format.Number(e.counters[t])}):null},aborted:function(e){if(null==e||!e.abortedStats)return null;var t=e.abortedStats,n=t.scheduled,r=t.nonScheduled;return(0,Ft.jsx)(fs,{title:"Aborted statistics: ".concat(e.caption),secondaryValue:r.total,primaryValue:n.total,type:"aborted",item:e})},completed:function(e){if(null==e||!e.completedStats)return null;var t=e.completedStats,n=t.nonInterrupted,r=t.interrupted;return(0,Ft.jsx)(fs,{title:"Completed statistics: ".concat(e.caption),secondaryValue:r.total,primaryValue:n.total,type:"completed",item:e})},job_type:function(e){var t=e.caption,n=e.jobType,s=e.taskInfo,a=e.isTotal;if(s)return(0,Ft.jsx)(na,(0,l.A)({},s));var o=i.state,c=o.expandedState,u=o.allowActions,d=!a&&u&&t,p=c[t],h=d?function(){return i.toggleExpand(t)}:void 0;return(0,Ft.jsxs)("div",{className:Qs("job-type"),children:[(0,Ft.jsx)("div",{children:Boolean(t)&&(0,Ft.jsx)(_i.A,{visible:Boolean(h),expanded:Boolean(p),onClick:h})}),(0,Ft.jsxs)("div",{onClick:h,className:Qs("name",{clickable:Boolean(d)}),children:[(0,Ft.jsx)("span",{title:"Task ".concat(t),children:t}),!a&&(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)("br",{}),void 0!==e.jobType&&(0,Ft.jsx)("span",{className:"elements-secondary-text",title:"Job type ".concat(n),children:n})]})]})]})},actions:function(e){var t=e.info,n=e.caption;return t?(0,Ft.jsx)(ki.A,{title:"Tasks: ".concat(n),attributes:t}):null}},n}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"toggleExpand",value:function(e){var t=(0,l.A)({},this.state.expandedState);t[e]?delete t[e]:t[e]=!0,this.setState((0,l.A)({expandedState:t},ea(this.state.items,t)))}},{key:"rowClassName",value:function(e){return e.taskInfo?Qs("row-task-info"):e.isTotal?Qs("row-total"):void 0}},{key:"colSpan",value:function(e,t,n){if(e.taskInfo&&0===n)return 8}},{key:"render",value:function(){var e,t=this.props,n=t.className,r=t.jobs,i=t.collapsibleSize,s=t.collapsed;return null!=r&&null!==(e=r.items)&&void 0!==e&&e.length?(0,Ft.jsx)(vi.A,{name:"Tasks",className:n,size:i,marginDirection:"bottom",collapsed:s,children:this.renderContent()}):null}},{key:"renderContent",value:function(){var e=this.props.jobs,t=e.abortedJobsTimeRatio,n=e.abortedJobsTime,r=e.completedJobsTime,i=e.averageReadDataRate,s=e.averageReadRowRate,a=e.items,o=this.state,c=o.allowActions,u=o.visibleItems;return(0,Ft.jsxs)("div",{className:Qs(),children:[(0,Ft.jsx)(tn.Ay,{items:[[{key:"aborted_jobs_time_ratio",value:(0,Ft.jsx)(tn.Bj.FormattedValue,{value:t,format:"Percent"})},{key:"aborted_jobs_time",value:(0,Ft.jsx)(tn.Bj.FormattedValue,{value:n,format:"TimeDuration"})},{key:"completed_jobs_time",value:(0,Ft.jsx)(tn.Bj.FormattedValue,{value:r,format:"TimeDuration"})}],[{key:"average_read_data_rate",value:(0,Ft.jsx)(tn.Bj.FormattedValue,{value:i,format:"BytesPerSecond"})},{key:"average_read_row_rate",value:(0,Ft.jsx)(tn.Bj.FormattedValue,{value:s,format:function(e){return ue.A.format.NumberPerSecond(e,{measure:"rows"})}})}]]}),(0,Ft.jsx)("div",{className:Qs("table-container"),children:a.length>0&&(0,Ft.jsx)(rn.A,(0,l.A)((0,l.A)({},ys),{},{columnsMode:c?"withActions":void 0,items:u,css:Qs(),templates:this.templates,rowClassName:this.rowClassName,colSpan:this.colSpan}))})]})}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.operation,r=e.jobs.items,i=t.operation,s=t.items,a=t.expandedState,o={};return n!==i&&Object.assign(o,{operation:n,allowActions:V(n)}),r!==s&&Object.assign(o,(0,l.A)({},ea(r,a))),as()(o)?null:o}}])}(r.Component);function na(e){var t=e.job_type,n=e.has_user_job,r=e.input_finished,i=e.completed,s=e.user_job_memory_reserve_factor,a=e.start_time,o=e.completion_time,l=e.ready_time,c=e.exhaust_time,u=N.A.getValue(l),d=N.A.getValue(c),p=u+d;return(0,Ft.jsx)(tn.Ay,{className:Qs("info-meta"),items:[[{key:"job_type",value:(0,Ft.jsx)(tn.Bj.Value,{value:N.A.getValue(t)})},{key:"has_user_job",value:(0,Ft.jsx)(tn.Bj.Readable,{value:String(N.A.getValue(n))})},{key:"input_finished",value:(0,Ft.jsx)(tn.Bj.Readable,{value:String(N.A.getValue(r))})},{key:"completed",value:(0,Ft.jsx)(tn.Bj.Readable,{value:String(N.A.getValue(i))})},{key:"user_job_memory_reserve_factor",value:(0,Ft.jsx)(tn.Bj.Number,{value:N.A.getValue(s)})},{key:"start_time",value:(0,Ft.jsx)(tn.Bj.Time,{time:N.A.getValue(a)})},{key:"completion_time",value:(0,Ft.jsx)(tn.Bj.Time,{time:N.A.getValue(o)})}],[{key:"ready_time",value:(0,Ft.jsx)(tn.Bj.Time,{time:u,valueFormat:"TimeDuration",settings:{format:"milliseconds"}})},{key:"exhaust_time",value:(0,Ft.jsx)(tn.Bj.Time,{time:d,valueFormat:"TimeDuration",settings:{format:"milliseconds"}})},{key:"tail_time_fraction",value:0===p?"n/a":(0,Ft.jsx)(tn.Bj.FormattedValue,{value:d/p*100,format:"Percent",settings:{digits:1}})}]]})}const ra=(0,c.Ng)((function(e){return{jobs:Zs(e),operation:e.operations.detail.operation}}))(ta);var ia=(0,i.A)("operation-details"),sa=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).state={isAbsoluteValue:!0},e.handleSwitchChange=function(t){e.setState({isAbsoluteValue:t})},e.handleEditClick=function(){var t=e.props,n=t.operation;(0,t.showEditPoolsWeightsModal)(n)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderDescription",value:function(){var e=this.props.collapsibleSize,t=this.props.operation.description;return Boolean(t)&&(0,Ft.jsx)(vi.A,{name:"Description",className:ia("description"),size:e,marginDirection:"bottom",children:(0,Ft.jsx)(fi,{description:t})})}},{key:"renderSpecification",value:function(){var e=this.props,t=e.specification,n=e.cluster,r=e.collapsibleSize;return(0,Ft.jsx)(vi.A,{name:"Specification",className:ia("specification"),size:r,marginDirection:"bottom",children:(0,Ft.jsx)($i,{specification:t,cluster:n})})}},{key:"renderAlerts",value:function(){var e=this.props,t=e.alertEvents,n=e.collapsibleSize,r=e.isVanillaGpuOperation;return null!=t&&t.length?(0,Ft.jsx)(vi.A,{name:"Alerts",size:n,marginDirection:"bottom",collapsed:r,children:(0,Ft.jsx)(pi,{items:t})}):null}},{key:"renderError",value:function(){var e=this.props.error;return e&&(0,Ft.jsx)("div",{className:ia("result"),children:(0,Ft.jsx)(b.z,(0,l.A)((0,l.A)({},e),{},{disableLogger:!0}))})}},{key:"renderRuntimeOverview",value:function(){return(0,Ft.jsxs)(an.A,{size:"s",onClick:this.handleEditClick,title:"Edit pools and weights",className:ia("edit-button"),children:[(0,Ft.jsx)(on.A,{awesome:"pencil"})," Edit"]})}},{key:"renderRuntime",value:function(){var e=this.props,t=e.runtime,n=e.operation,r=e.cluster,i=e.collapsibleSize,s=e.treeConfigs;return void 0!==t&&t.length>0&&(0,Ft.jsxs)(vi.A,{name:"Runtime",className:ia("runtime"),overview:this.renderRuntimeOverview(),size:i,marginDirection:"bottom",children:[(0,Ft.jsxs)(gi.s,{className:ia("runtime-switch"),gap:2,children:["Show abs. resources"," ",(0,Ft.jsx)(bi.d,{checked:this.state.isAbsoluteValue,onUpdate:this.handleSwitchChange})]}),(0,Ft.jsx)(rs,{isAbsoluteValue:this.state.isAbsoluteValue,runtime:t,treeConfigs:s,operation:n,cluster:r})]})}},{key:"renderJobs",value:function(){var e=this.props,t=e.collapsibleSize,n=e.isVanillaGpuOperation;return(0,Ft.jsx)(ra,{className:ia("jobs"),collapsibleSize:t,collapsed:n})}},{key:"renderResources",value:function(){var e=this.props,t=e.resources,n=e.intermediateResources,r=e.operation,i=e.collapsibleSize;return t&&"vanilla"!==r.type&&(0,Ft.jsx)(vi.A,{name:"Data flow",className:ia("resources"),size:i,marginDirection:"bottom",children:(0,Ft.jsx)(Ri,{operation:r,resources:t,intermediateResources:n})})}},{key:"renderEvents",value:function(){var e=this.props,t=e.events,n=e.collapsibleSize;return t&&(0,Ft.jsx)(vi.A,{name:"Events",className:ia("events"),size:n,marginDirection:"bottom",children:(0,Ft.jsx)(is.A,{events:t})})}},{key:"render",value:function(){var e=this.props.isVanillaGpuOperation;return(0,Ft.jsxs)("div",{className:ia(),children:[(0,Ft.jsxs)("div",{className:ia("section"),children:[this.renderDescription(),this.renderSpecification()]}),(0,Ft.jsx)("div",{className:ia("section"),children:e?(0,Ft.jsxs)(r.Fragment,{children:[this.renderError(),this.renderRuntime(),this.renderResources(),this.renderEvents(),this.renderAlerts(),this.renderJobs()]}):(0,Ft.jsxs)(r.Fragment,{children:[this.renderAlerts(),this.renderError(),this.renderRuntime(),this.renderJobs(),this.renderResources(),this.renderEvents()]})})]})}}])}(r.Component),aa={showEditPoolsWeightsModal:Bt},oa=(0,c.Ng)((function(e){var t=e.operations.detail.operation;return(0,l.A)((0,l.A)({cluster:(0,Ue.dB)(e),operation:t,treeConfigs:e.operations.detail.treeConfigs},e.operations.detail.details),{},{collapsibleSize:Ai.Y1,alertEvents:(0,Je.dt)(e),isVanillaGpuOperation:"vanilla"===t.type&&(0,Je.dW)(e)})}),aa)(sa);function la(){var e=(0,c.d4)(Je.Q1);return(0,Ir.v)({type:Tt.c.OPERATION_TAB_DETAILS,additionalStartType:Tt.c.OPERATION,startDeps:[e],allowStart:function(e){var t=(0,a.A)(e,1)[0];return!(0,ze.RP)(t)}}),(0,Mr.ol)({type:Tt.c.OPERATION_TAB_DETAILS,stopDeps:[e],allowStop:function(e){var t=(0,a.A)(e,1)[0];return(0,ze.RP)(t)}}),(0,Ft.jsx)(oa,{})}var ca=n(31680),ua=n.n(ca),da=n(38756),pa=n(31229),ha=["id","emptyContent"];function ma(e){var t=e.id,n=e.emptyContent,r=void 0===n?null:n,i=(0,xe.A)(e,ha),s=pa.mH.trackerBaseUrl,a="".concat(s,"/").concat(t);return t?(0,Ft.jsx)(x.A,(0,l.A)((0,l.A)({},i),{},{url:s?a:void 0,children:t})):(0,Ft.jsx)(Ft.Fragment,{children:r})}const fa=r.memo(ma);var va=n(88358),ga=["fraction"],ba=(0,i.A)("experiment-assignments");const Aa=r.memo(ya);var xa=r.memo(ja);function ya(e){var t=e.className,n=(0,c.d4)(Je.x5),i=(0,c.d4)(Je.Bq),s=r.useState(!0),o=(0,a.A)(s,2),l=o[0],u=o[1],d=r.useCallback((function(){u(!l)}),[l,u]);return null!=n&&n.length?(0,Ft.jsx)(vi.O,{className:ba(null,t),name:"Experiments",onToggle:d,collapsed:l,size:Ai.Y1,marginDirection:"bottom",children:f()(n,(function(e,t){return(0,Ft.jsx)(xa,{data:e,operationId:i},t)}))}):null}function ja(e){var t=e.data,n=e.operationId,i=r.useState(!1),s=(0,a.A)(i,2),o=s[0],l=s[1],u=N.A.getValue(t,"/effect"),d=(u.fraction,(0,xe.A)(u,ga)),p=(0,c.d4)(mi.MZ),h=r.useCallback((function(){l(!o),window.dispatchEvent(new Event("resize"))}),[o,l]);return(0,Ft.jsxs)("div",{children:[(0,Ft.jsx)(tn.Ay,{items:[[{key:"Experiment",value:N.A.getValue(t,"/experiment")},{key:"Group",value:N.A.getValue(t,"/group")}],[{key:"Ticket",value:(0,Ft.jsx)(fa,{id:N.A.getValue(t,"/ticket")})},{key:"Dimension",value:N.A.getValue(t,"/dimension")}],[{key:"Effect",value:(0,Ft.jsx)(ri.S,{onClick:h,children:o?"Hide":"Show"})}]]}),o&&(0,Ft.jsx)(y.A,{value:d,settings:p,folding:!0,virtualized:!0,extraTools:(0,Ft.jsx)(va.O,{value:d,settings:p,name:"experiment_assignments_".concat(n)})})]})}var wa=(0,i.A)("operation-specification"),ka=ua()((function(){window.dispatchEvent(new Event("resize"))}),100,{leading:!1}),_a=(0,c.Ng)((function(e){return{operation:e.operations.detail.operation,operationId:(0,Je.Bq)(e)}}))((function(e){var t=e.operation,n=e.operationId,i=J.Ay.docsUrls["operations:operations_options"],s=t.typedProvidedSpec||t.typedSpec,o=t.typedUnrecognizedSpec||{},l=t.typedFullSpec,c=h()(o).length>0,u=r.useState({provided:c,unrecognized:!1,resulting:!0}),d=(0,a.A)(u,2),p=d[0],m=d[1],f=r.useCallback((function(e){m({unrecognized:!0,resulting:!0,provided:e}),ka()})),v=r.useCallback((function(e){m({unrecognized:e,provided:!0,resulting:!0}),ka()})),g=r.useCallback((function(e){m({unrecognized:!0,resulting:e,provided:!0}),ka()}));return(0,Ft.jsx)(Jr.A,{children:(0,Ft.jsxs)("div",{className:wa(),children:[(0,ls.fs)((0,Ft.jsx)("div",{className:wa("help","elements-section"),children:(0,Ft.jsx)(da.A,{url:i})})),(0,Ft.jsx)(vi.O,{name:"Provided specification",onToggle:f,collapsed:p.provided,size:Ai.Y1,marginDirection:"bottom",children:(0,Ft.jsx)(y.A,{value:s,settings:Xt.A.prepareSettings(),folding:!0,virtualized:!0,extraTools:(0,Ft.jsx)(va.O,{value:s,settings:Xt.A.prepareSettings(),name:"provider_specification_".concat(n)})})}),(0,Ft.jsx)(Aa,{}),c&&(0,Ft.jsx)(vi.O,{name:"Unrecognized specification",onToggle:v,collapsed:p.unrecognized,size:Ai.Y1,marginDirection:"bottom",children:(0,Ft.jsx)(y.A,{value:o,settings:Xt.A.prepareSettings(),folding:!0,virtualized:!0,extraTools:(0,Ft.jsx)(va.O,{value:o,settings:Xt.A.prepareSettings(),name:"unrecognized_specification_".concat(n)})})}),l&&(0,Ft.jsx)(vi.O,{name:"Resulting specification",onToggle:g,collapsed:p.resulting,size:Ai.Y1,marginDirection:"bottom",children:(0,Ft.jsx)(y.A,{value:l,settings:Xt.A.prepareSettings(),folding:!0,virtualized:!0,extraTools:(0,Ft.jsx)(va.O,{value:l,settings:Xt.A.prepareSettings(),name:"resulting_specification_".concat(n)})})})]})})}));function Ca(){var e=(0,c.d4)(Je.Q1);return(0,Ir.v)({type:Tt.c.OPERATION_TAB_SPECIFICATION,additionalStartType:Tt.c.OPERATION,startDeps:[e],allowStart:function(e){var t=(0,a.A)(e,1)[0];return!(0,ze.RP)(t)}}),(0,Mr.ol)({type:Tt.c.OPERATION_TAB_SPECIFICATION,stopDeps:[e],allowStop:function(e){var t=(0,a.A)(e,1)[0];return(0,ze.RP)(t)}}),(0,Ft.jsx)(_a,{})}var Sa=n(5675),Ta=n(33023),Na=n(44543),Ea=(0,i.A)("operation-detail-job-sizes"),Pa=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).state={showEstimated:!1},e.formatX=function(t){var n=e.state.formatSettings;return dn.A.Bytes(t,n)},e.renderTooltip=function(e,t,n){return"<b>".concat(e,"</b> jobs have estimated input job size from <b>").concat(t,"</b> to <b>").concat(n,"</b>")},e.toggleEstimated=function(){var t=e.state.showEstimated;e.setState({showEstimated:!t})},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(){var e=this.props.className;return(0,Ft.jsx)(Sa.Ay,{className:e,content:this.renderContent(),toolbar:(0,Ft.jsx)(Ta.M,{itemsToWrap:[{name:"showEstimated",node:(0,Ft.jsx)(ir.S,{size:"l",onUpdate:this.toggleEstimated,checked:this.state.showEstimated,children:"Show estimated"})}]})})}},{key:"prepareJobSizes",value:function(){var e=this.props.operation,t=N.A.getValue(e,"/@progress");return t?{estimatedJobSizeHistogram:N.A.getValue(t,"/estimated_input_data_size_histogram"),jobSizeHistogram:N.A.getValue(t,"/input_data_size_histogram")}:{}}},{key:"renderChart",value:function(e,t){return e?(0,Ft.jsxs)("div",{className:Ea("chart-section"),children:[(0,Ft.jsx)("div",{className:"elements-heading elements-heading_size_m",children:t}),(0,Ft.jsx)(qr,{className:Ea("charts"),data:e,yLabel:"job count",xLabel:"job input data weight",xFormat:this.formatX,yMin:.5,yLogarithmic:!0,renderTooltip:this.renderTooltip})]}):null}},{key:"renderPerTaskCharts",value:function(e){var t=this,n=this.state.showEstimated;return f()(e,(function(e){var r=e.task_name,i=e.estimated_input_data_weight_histogram,s=e.input_data_weight_histogram;return(0,Ft.jsxs)("div",{className:Ea("task-cell",{"per-task":!0}),children:[t.renderChart(s,'Task "'.concat(r,'" actual data weight')),n&&t.renderChart(i,'Task "'.concat(r,'" estimated data weight'))]},r)}))}},{key:"renderCommon",value:function(){var e=this.state.showEstimated,t=this.prepareJobSizes(),n=t.jobSizeHistogram,r=t.estimatedJobSizeHistogram;return(0,Ft.jsxs)("div",{className:Ea("task-cell"),children:[this.renderChart(n,"Input"),e&&this.renderChart(r,"Estimated input")]})}},{key:"renderContent",value:function(){var e=this.props.operation,t=N.A.getValue(this.props.operation,"/@progress/tasks");return(0,Ft.jsx)(Jr.A,{children:(0,Ft.jsx)("div",{className:Ea(),children:(0,Na.H)(e)?this.renderPerTaskCharts(t):this.renderCommon()})})}}],[{key:"getDerivedStateFromProps",value:function(e){var t=N.A.getValue(e.operation,"/@progress"),n=t&&N.A.getValue(t,"/partition_size_histogram");return{formatSettings:Kr(n,dn.A.Bytes),data:n}}}])}(r.Component),Ra=(0,c.Ng)((function(e){return{operation:e.operations.detail.operation,chartKitTheme:(0,Ue.O4)(e)}}))(Pa);function Ia(e){var t=(0,c.d4)(Je.Q1);return(0,Ir.v)({type:Tt.c.OPERATION_TAB_JOB_SIZES,additionalStartType:Tt.c.OPERATION,startDeps:[t],allowStart:function(e){var t=(0,a.A)(e,1)[0];return!(0,ze.RP)(t)}}),(0,Mr.ol)({type:Tt.c.OPERATION_TAB_JOB_SIZES,stopDeps:[t],allowStop:function(e){var t=(0,a.A)(e,1)[0];return(0,ze.RP)(t)}}),(0,Ft.jsx)(Ra,(0,l.A)({},e))}var Ma=n(16883),Oa={completed:{sort:!1,align:"right",tooltipProps:{placement:"bottom",content:"Completed jobs — those which have finished successfully (i.e. consumed entire input and exited with zero exit code). Please note that due to hardware failures some jobs may be run more than once."}},aborted:{sort:!1,align:"right",tooltipProps:{placement:"bottom",content:"Aborted jobs — those with soft failure (i.e. resource overdraft or preemption). Please note that some of aborted jobs may be excluded from statistics."}},failed:{sort:!1,align:"right",tooltipProps:{placement:"bottom",content:"Failed jobs — those with hard failure (i.e. exited with non-zero exit code). Please note that some of failed jobs may be excluded from statistics."}},lost:{sort:!1,align:"right",tooltipProps:{placement:"bottom",content:"Lost jobs — those which have finished successfully but whose results were lost (typically due to hardware failures)."}}},za={theme:"light",size:"s",striped:!1,computeKey:function(e){return"<Root>/".concat(e.name)},tree:!0,columns:{sets:{default:{items:["metric"].concat(Object.keys(Oa))}},items:(0,l.A)((0,l.A)({},Oa),{},{metric:{sort:!1,align:"left"}}),mode:"default"}},La=n(80016),Va=n(16455),Ba=n(10795);function Fa(e){return(0,(0,c.d4)(Va.jS).getStatisticInfo)(e)}function Da(e){var t=e.name,n=e.title,r=Fa(t);return(0,Ft.jsx)(Ba.Ye,{title:n,info:r})}function Ja(e){var t=e.name,n=e.settings,r=e.value,i=Fa(t),s=(0,Ba.Dz)(r,null==i?void 0:i.unit,n),a=dn.A.Number(r,n);return void 0!==s?(0,Ft.jsx)(cn.m,{placement:["right","left"],content:(0,Ft.jsxs)(gi.s,{gap:1,children:[(0,Ft.jsxs)("span",{children:[" ",a]}),!isNaN(r)&&(0,Ft.jsx)(nn.A,{text:"".concat(r),inlineMargins:!0,view:"flat-outlined"})]}),children:s}):a}var Ha=r.memo(Ja),Ua=r.memo(Da),Wa=(0,i.A)("operation-statistics"),$a=(0,i.A)("elements-toolbar"),Ya=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).collapseTable=function(){return e.props.setTreeState(zs.VN.COLLAPSED)},e.expandTable=function(){return e.props.setTreeState(zs.VN.EXPANDED)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"componentWillUnmount",value:function(){this.expandTable()}},{key:"template",get:function(){var e=this.props,t=e.setTreeState,n=e.activeAggregation,r=void 0===n?"avg":n;return{metric:function(e,n,r,i){var s={paddingLeft:40*e.level};if(e.isLeafNode)return(0,Ft.jsxs)("span",{className:Wa("metric"),style:s,children:[(0,Ft.jsx)(on.A,{className:Wa("metric-icon"),awesome:"chart-line"}),(0,Ft.jsx)(Ua,{name:e.name,title:e.title})]});var a=i.collapsed||i.empty?"angle-down":"angle-up",o=i.collapsed||i.empty?"folder":"folder-open";return(0,Ft.jsxs)("span",{className:Wa("group"),style:s,onClick:function(){i.empty||(r.apply(void 0,arguments),t("mixed"))},children:[(0,Ft.jsx)(on.A,{className:Wa("group-icon-toggler"),awesome:a}),(0,Ft.jsx)(on.A,{className:Wa("group-icon"),awesome:o}),(0,Ft.jsx)("span",{children:e.title})]})},__default__:function(e,t){if(e.isLeafNode){var n,i,s,a=null===(n=e.data)||void 0===n?void 0:n[t];return"avg"===r?(i=a&&a.count&&a.sum/a.count)<1&&(s={significantDigits:6}):i=a&&a[r],"count"===r?dn.A.Number(i,s):(0,Ft.jsx)(Ha,{value:i,settings:s,name:e.name})}return null}}}},{key:"renderToolbar",value:function(){var e=this.props,t=e.filterText,n=e.activeAggregation,r=e.jobTypes,i=e.poolTrees,s=e.activeJobType,a=e.activePoolTree;return(0,Ft.jsx)("div",{className:$a(null,Wa("toolbar")),children:(0,Ft.jsxs)("div",{className:$a("container"),children:[(0,Ft.jsx)("div",{className:$a("component",Wa("filter")),children:(0,Ft.jsx)(kn.A,{size:"m",value:t,debounce:zs.Op,onChange:this.props.changeFilterText})}),i.length>1&&(0,Ft.jsx)("div",{className:$a("component"),children:(0,Ft.jsx)(Dn.A,{size:"m",value:null!=a?a:"",onUpdate:this.props.changePoolTreeFilter,items:(0,Oe.SA)(i,""),name:"operation-statistics-pool-tree"})}),r.length>1&&(0,Ft.jsx)("div",{className:$a("component"),children:(0,Ft.jsx)(Dn.A,{size:"m",value:null!=s?s:"",onUpdate:this.props.changeJobType,items:(0,Oe.SA)(r,""),name:"operation-statistics-job-type"})}),(0,Ft.jsx)("div",{className:$a("component"),children:(0,Ft.jsx)(Dn.A,{size:"m",value:n,onChange:this.props.changeAggregation,items:zs.ne,name:"operation-statistics-aggregator"})}),(0,Ft.jsxs)("div",{className:$a("component",Wa("expand-collapse")),children:[(0,Ft.jsx)("span",{className:Wa("expand-metrics"),children:(0,Ft.jsx)(an.A,{size:"m",title:"Expand All",onClick:this.expandTable,children:(0,Ft.jsx)(on.A,{awesome:"arrow-to-bottom"})})}),(0,Ft.jsx)("span",{className:Wa("collapse-metrics"),children:(0,Ft.jsx)(an.A,{size:"m",title:"Collapse All",onClick:this.collapseTable,children:(0,Ft.jsx)(on.A,{awesome:"arrow-to-top"})})})]}),(0,ls.fs)((0,Ft.jsx)("div",{className:$a("component",Wa("help")),children:(0,Ft.jsx)(da.A,{url:J.Ay.docsUrls["problems:jobstatistics"]})}))]})})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.treeState,r=e.items;return(0,Ft.jsx)(Jr.A,{children:(0,Ft.jsxs)("div",{className:Wa(null,t),children:[this.renderToolbar(),(0,Ft.jsx)(La.w,{children:(0,Ft.jsx)(rn.A,(0,l.A)((0,l.A)({},za),{},{templates:this.template,css:Wa(),treeState:n,items:r}))})]})})}}])}(r.Component),qa={setTreeState:function(e){return{type:zs.aj,data:{treeState:e}}},changeFilterText:function(e){return{type:zs.yh,data:{filterText:e}}},changeAggregation:function(e){var t=e.target;return{type:zs.Wc,data:{activeAggregation:t.value}}},changeJobType:function(e){return function(t,n){t({type:zs.U8,data:{jobTypeFilter:e}});var r=n(),i=(0,Je.eu)(r).type,s=(0,or.$_)(r);s&&s[i]!==e&&t((0,Ma.tX)((0,l.A)((0,l.A)({},s),{},(0,o.A)({},i,e))))}},changePoolTreeFilter:function(e){return function(t){t({type:zs.U8,data:{poolTreeFilter:e}})}}},Xa=(0,c.Ng)((function(e){var t=e.operations.statistics,n=t.treeState,r=t.activeAggregation,i=Js(e),s=i.job_type,a=i.pool_tree;return(0,l.A)({items:$s(e),treeState:n,activeAggregation:r,jobTypes:s,poolTrees:a},Hs(e))}),qa)(Ya);function Ka(e){var t=(0,c.d4)(Je.Q1);return(0,Ir.v)({type:Tt.c.OPERATION_TAB_STATISTICS,additionalStartType:Tt.c.OPERATION,startDeps:[t],allowStart:function(e){var t=(0,a.A)(e,1)[0];return!(0,ze.RP)(t)}}),(0,Mr.ol)({type:Tt.c.OPERATION_TAB_STATISTICS,stopDeps:[t],allowStop:function(e){var t=(0,a.A)(e,1)[0];return(0,ze.RP)(t)}}),(0,Ft.jsx)(Xa,(0,l.A)({},e))}var Ga=n(85907),Za=n(33951),Qa=function(e){return e.operations.jobs.jobsErrors},eo=function(e){return e.operations.jobsOperationIncarnations.filter},to=function(e){return e.operations.jobsOperationIncarnations.availableValues},no=n(31285),ro=n.n(no),io=n(82942),so=new Be.A,ao=new Be.A,oo=function(e){return e.operations.detail.operation};function lo(){return function(e,t){var n=t(),r=(0,Ue.Si)(n);return ao.removeAllRequests(),De.X8.getJob({parameters:co(n),cancellation:ao.saveCancelToken}).then((function(t){e({type:Ga.dL.SUCCESS,data:{job:t,clusterConfig:r,operationId:oo(n).$value}}),e(uo())})).catch((function(t){t.code===k().codes.CANCELLED?e({type:Ga.dL.CANCELLED}):e({type:Ga.dL.FAILURE,data:{error:t}})}))}}function co(e){var t=e.operations.detail.operation,n=e.operations.jobs.filters;return{operation_id:t.$value,job_id:n.jobId.value}}function uo(){return function(e,t){var n=t(),r=(0,Ue.Si)(n);return De.X8.listJobs({parameters:ho(n),cancellation:ao.removeAllAndSave}).then((function(t){var i=t.jobs;e({type:Ga.u2.SUCCESS,data:{jobs:i,clusterConfig:r,operationId:oo(n).$value}})})).catch((function(t){t.code===k().codes.CANCELLED?e({type:Ga.u2.CANCELLED}):e({type:Ga.u2.FAILURE,data:{error:t}})}))}}function po(e){var t,n,r,i=e.operations.detail.operation,s=e.operations.jobs,a=s.filters,o=s.pagination,c=e.tables[Ga.MV],u=eo(e);return(0,l.A)((0,l.A)((0,l.A)({operation_id:i.$value},function(e,t){var n=e.filterBy.value||e.filterBy.defaultValue;return{state:mo(e,"state"),type:mo(e,"type"),address:"address"===n?mo(e,"address"):void 0,monitoring_descriptor:"monitoring descriptor"===n?mo(e,"monitoringDescriptor"):void 0,with_stderr:mo(e,"withStderr"),with_monitoring_descriptor:mo(e,"withMonitoringDescriptor"),with_interruption_info:mo(e,"withInterruptionInfo"),with_fail_context:mo(e,"withFailContext"),with_spec:mo(e,"withSpec"),with_competitors:mo(e,"withCompetitors"),sort_field:t.field||"none",sort_order:t.asc?"ascending":"descending",task_name:mo(e,"taskName")}}(a,c)),(n=(t=o).offset,r=t.limit,{offset:Math.max(0,n),limit:r+Ga.Ym})),{},{operation_incarnation:u||void 0})}function ho(e){var t=e.operations.detail.operation,n=e.operations.jobs.job,r=e.tables[Ga.MV];return{operation_id:t.$value,job_competition_id:null==n?void 0:n.attributes.job_competition_id,sort_field:r.field||"none",sort_order:r.asc?"ascending":"descending"}}function mo(e,t){var n=e[t];return n.value===n.defaultValue?void 0:n.value}var fo=new Be.A;function vo(){return function(e,t){var n=t(),r=Ie(n),i=oo(n);if(e(function(e){return function(t){return so.removeAllRequests(),t(io.wd.onRequest({operationId:e.id})),"vanilla"!==e.type?t(io.wd.onReset()):De.Qq.listJobs(De.Vu.jobsOperationIncarnations,{parameters:{operation_id:e.id,limit:1e3},cancellation:so.removeAllAndSave}).then((function(e){t(io.wd.onSuccess({availableValues:ro()(ks()(e.jobs.map((function(e){return e.operation_incarnation}))))}))}))}}({id:i.id,type:i.type})),r)return e(lo());e({type:Ga.kf.REQUEST});var s=[{command:"list_jobs",parameters:po(n)}],o=(0,Ue.Si)(n);return De.Qq.executeBatch(De.Vu.operationGetJobs,{parameters:{requests:s},cancellation:fo.removeAllAndSave}).then((function(t){var n=(0,a.A)(t,1)[0];if(n.error)return Promise.reject(n.error);var r=n.output,s=r.jobs,l=r.errors,c=r.state_counts,u=r.type_counts;e({type:Ga.kf.SUCCESS,data:{jobs:s,jobsErrors:l,operationId:i.id,clusterConfig:o}}),e({type:Ga.bZ,data:{stateCounters:c,typeCounters:u}})})).catch((function(t){(0,Be.m)(t)||e({type:Ga.kf.FAILURE,data:{error:t}})}))}}function go(e){return{type:Ga.Sd,data:e}}function bo(e){return function(t){var n=e.name,r=e.value,i="state"===n;!i||"completed"!==r&&"failed"!==r&&"aborted"!==r?i&&("all"===r||"running"===r)&&t((0,Za.V)({tableId:Ga.MV,columnName:"start_time",asc:!0})):t((0,Za.V)({tableId:Ga.MV,columnName:"finish_time",asc:!1})),"jobId"!==n||r||t({type:Ga.Ru}),t(go(e)),t(xo(sr.b4.FIRST))}}function Ao(e){return function(t){var n=e.id;t({type:Ga.qE.REQUEST}),De.X8.getJobInputPaths({job_id:n,output_format:fe.r$}).then((function(e){t({type:Ga.qE.SUCCESS,data:e})})).catch((function(e){e.code!==k().codes.CANCELLED&&t({type:Ga.qE.FAILURE,data:{error:e}})}))}}function xo(e){return function(t,n){var r=n().operations.jobs.pagination,i=r.limit,s=r.offset,a=null;switch(e){case sr.b4.FIRST:a=0;break;case sr.b4.NEXT:a=s+i;break;case sr.b4.PREV:if((a=Math.max(0,s-i))===s)return;break;default:return}t({type:Ga.GN,data:a}),t(vo())}}var yo=n(63588),jo=n(80999),wo=n(63366),ko=n(62561),_o=n(68748),Co=n(57614),So=n(62911);var To=n(33497),No=n(40860);function Eo(){}Eo.Error=function(e){var t=e.error,n=(0,c.wA)();return(0,Ft.jsx)("div",{children:(0,Ft.jsx)(ni.Bj.Error,{error:t,onClick:function(){return n((0,un.Hm)(t))}})})},Eo.InputPaths=function(e){var t=e.job,n=(0,c.wA)();return(0,Ft.jsx)(x.A,{theme:"ghost",onClick:function(){return n(Ao(t))},children:"View"})},Eo.DebugInfo=function(e){var t=e.type,n=e.job.getDebugInfo(t),r=n.size,i=n.url;return(0,Ft.jsx)(ni.Bj.DownloadLink,{url:i,size:r})},Eo.Progress=function(e){var t=e.state,n=e.progress;switch(t){case"running":return(0,Ft.jsx)(Kt.k,{size:"s",value:100*n,theme:"info"});case"completed":return(0,Ft.jsx)(Kt.k,{size:"s",value:100,theme:"success"});case"failed":return(0,Ft.jsx)(Kt.k,{size:"s",value:100,theme:"danger"});case"aborted":return(0,Ft.jsx)(Kt.k,{size:"s",value:100,theme:"default"});default:return(0,Ft.jsx)(Kt.k,{size:"s",value:0})}};var Po=function(e){return f()(N.A.getValue(e),(function(e,t){var n=ue.A.format.Number(e);return t.endsWith("_data_size")||t.endsWith("_data_weight")?n=ue.A.format.Bytes(e):t.endsWith("_time")&&(n=ue.A.format.TimeDuration(e,{format:"milliseconds"})),{key:ue.A.format.Readable(t),value:(0,Ft.jsx)("div",{style:{textAlign:"right"},children:n})}}))},Ro=function(e){var t=e.statistics,n=e.type;if(!t||"vanilla"===n)return null;var r=N.A.getValues(t,["/processed_input_row_count","/processed_input_uncompressed_data_size"]),i=(0,a.A)(r,2),s=i[0],o=i[1];return s||o?(0,Ft.jsx)(cn.m,{content:(0,Ft.jsx)(tn.Ay,{items:Po(t)}),children:(0,Ft.jsxs)(gi.s,{gap:2,alignItems:"center",wrap:!0,children:[(0,Ft.jsx)("span",{children:ue.A.format.Number(s)}),(0,Ft.jsxs)("span",{children:["(",ue.A.format.Bytes(o),")"]}),(0,Ft.jsx)(Xi.I,{data:Ki.A,size:16})]})}):null};const Io=function(e){return(0,Ft.jsx)("svg",(0,l.A)((0,l.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,Ft.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M3 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m5 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0",clipRule:"evenodd"})}))};var Mo=n(46747),Oo=n(73384),zo=n(20410),Lo=n(75299),Vo=(0,i.A)("yt-job-status-info"),Bo=function(e){var t=e.state,n=e.info,i=(0,Lo.A)(!1),s=(0,a.A)(i,2),o=s[0],l=s[1],c=(0,r.useRef)(null),u=ue.A.format.ReadableField((null==n?void 0:n.preemption_reason)||(null==n?void 0:n.interruption_reason));return(0,Ft.jsxs)(gi.s,{alignItems:"center",gap:1,className:Vo(),children:[ue.A.format.ReadableField(t),Boolean(u)&&(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)("div",{onMouseEnter:l,children:(0,Ft.jsx)(Mo.J,{theme:"warning",ref:c,children:"Interrupted"})}),(0,Ft.jsx)(Oo.z,{open:o,hasArrow:!0,anchorRef:c,onMouseLeave:l,children:(0,Ft.jsxs)("div",{className:Vo("popup"),children:[(0,Ft.jsx)("div",{children:u}),(0,Ft.jsx)(zo.b,{title:"Copy reason",view:"flat-secondary",size:"s",text:u})]})})]})]})},Fo=["text"],Do=(0,i.A)("operation-detail-jobs"),Jo=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return(e=(0,be.A)(this,t,[].concat(i))).actions=[{name:"abort",modalKey:"job_abort",successMessage:"Successfully aborted the job.",errorMessage:"Could not abort the job.",text:"Abort",message:"Aborting job will cause losing its progress, are you sure you want to proceed?",confirmationText:To.e},{name:"abandon",modalKey:"job_abandon",successMessage:"Successfully abandoned the job.",errorMessage:"Could not abandon the job.",text:"Abandon",message:"Abandoning job will cause losing its progress, are you sure you want to proceed?",confirmationText:To.e},{name:"input_context",modalKey:"job_input_context",message:(0,Ft.jsxs)("span",{children:["You are about to ",(0,Ft.jsx)("strong",{children:"dump input context"})," of the job"]}),text:"Dump input context",successMessageTemplate:function(t){var n="/".concat(e.props.cluster,"/navigation?path=").concat(t);return(0,Ft.jsxs)("span",{children:["Successfully dumped the job input context ",(0,Ft.jsx)(x.A,{url:n,children:"here"})]})},errorMessage:"Could not dump the job input context."}],e.prepareJobAction=function(t){var n=t.text,r=(0,xe.A)(t,Fo),i=e.props,s=i.login,a=i.promptAction,o=r.message||(0,Ft.jsxs)("span",{children:["You are about to ",(0,Ft.jsx)("strong",{children:r.name})," a job."]});return{text:n,action:function(e){return a((0,l.A)((0,l.A)({},r),{},{message:o,handler:function(t){var n=t.currentOption;return function(e){var t,n=e.login,r=e.name,i={job_id:e.item.id};switch((0,So.m)().countEvent("operation_detail_running-jobs_action",r),r){case"abort":t=k().v3.abortJob(i);break;case"abandon":t=k().v3.abandonJob(i);break;case"input_context":t=function(e){var t="//tmp/ui/"+e;return k().v3.create({path:t,type:"map_node",recursive:!0,ignore_existing:!0}).then((function(){var e="/input_context_"+ue.A.format.toBase26(ke()().unix());return t+e}))}(n).then((function(e){return k().v3.dumpJobContext(Object.assign({},i,{path:e})).then((function(){return e}))}));break;case"input":t=Promise.resolve("foo")}return t}((0,l.A)((0,l.A)({},e),{},{name:r.name,currentOption:n,login:s}))}}))}}},e.preparedActions=f()(e.actions,e.prepareJobAction),e.renderIdAddress=function(t){var n=e.props.cluster,i=t.id,s=t.address,a=t.job_competition_id,o=t.operationId,l=t.is_stale,c=t.attributes,u=ue.A.format.Address(s),d=N.A.getValue(c,"/start_time"),p=N.A.getValue(c,"/finish_time"),h=N.A.getValue(c,"/monitoring_descriptor"),m=a&&a!==i;return(0,Ft.jsxs)("div",{children:[(0,Ft.jsxs)("div",{className:Do("id","elements-monospace"),children:[(0,Ft.jsx)(nn.A,{text:i,view:"flat-secondary",size:"s",title:"Copy job id"}),(0,Ft.jsx)(x.A,{className:Do("id-job-link"),routed:!0,url:"/".concat(n,"/job/").concat(o,"/").concat(i),theme:"primary",children:i}),l&&(0,Ft.jsx)(No.q,{})]}),(0,Ft.jsxs)("div",{className:Do("host","elements-monospace"),children:[(0,Ft.jsxs)("span",{className:Do("host-name"),children:[(0,Ft.jsx)(nn.A,{text:u,view:"flat-secondary",size:"s",title:"Copy host"}),u]}),(0,Ft.jsx)("span",{className:Do("host-chart-link"),children:(0,Ft.jsx)(ko.A,{url:J.Ay.makeUrlForMonitoringDescriptor(n,{from:d,to:p},h)})})]}),m&&(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)("br",{}),(0,Ft.jsxs)("span",{className:Do("speculative-job-label","elements-monospace elements-ellipsis"),children:["Speculative job for ",a]})]})]})},e.renderErrorAndDebug=function(e){var t=[{key:"error",value:(0,Ft.jsx)(Eo.Error,{error:e.error}),visible:Boolean(e.error)},{key:"input_paths",value:(0,Ft.jsx)(Eo.InputPaths,{job:e}),visible:e.areInputPathsPresent()},{key:"stderr",value:(0,Ft.jsx)(Eo.DebugInfo,{job:e,type:"stderr"}),visible:e.getDebugInfo("stderr").size>0},{key:"fail_context",value:(0,Ft.jsx)(Eo.DebugInfo,{job:e,type:"fail_context"}),visible:e.getDebugInfo("fail_context").size>0},{key:"full_input",value:(0,Ft.jsx)(Eo.DebugInfo,{job:e,type:"full_input"}),visible:Boolean(e.has_spec)}];return(0,Ft.jsx)(tn.Ay,{items:t})},e.renderActions=function(t){var n=e.props.openAttributesModal,r=(0,Ft.jsx)(Mn.$,{view:"flat-secondary",title:"Show actions",children:(0,Ft.jsx)(Xi.I,{data:Io,size:16})}),i=f()(e.preparedActions,(function(e){var n=e.action;return{text:e.text,action:function(){return n({item:t})}}})),s=[{text:"Show attributes",action:function(){return n({title:t.id,attributes:t.attributes})}}];return"running"===t.state?(0,Ft.jsx)(jo.r,{switcher:r,items:[i,s]}):(0,Ft.jsx)(jo.r,{switcher:r,items:s})},e.settings={css:Do(),theme:"light",size:"s",striped:!1,virtual:!1,tableId:Ga.MV,computeKey:function(e){return e.id},columns:{items:{id_address:{name:"id_address",align:"left",caption:"Id / Address",sort:!1},task_name:{name:"task_name",align:"left",caption:"Task name",sort:!0},start_time:{name:"start_time",align:"left",caption:"Start time",sort:!0},finish_time:{name:"finish_time",align:"left",caption:"Finish time",sort:!0},duration:{get:function(e){return e.duration},sort:!0,name:"duration",align:"left"},error:{name:"error",align:"left",caption:"Error / Debug",get:function(e){return e.error}},type:{name:"type",align:"left",sort:!0},progress:{name:"progress",align:"left",sort:!0},actions:{name:"actions",align:"right",caption:"",sort:!1}},sets:{default:{items:["id_address","type","progress","error","start_time","finish_time","duration","actions"]},withTaskName:{items:["id_address","type","progress","error","task_name","start_time","finish_time","duration","actions"]}},mode:e.props.taskNamesNumber>1?"withTaskName":"default"},templates:{id_address:e.renderIdAddress,type:e.renderType,progress:e.renderProgress,error:e.renderErrorAndDebug,start_time:e.renderStartTime,finish_time:e.renderFinishTime,duration:e.renderDuration,actions:e.renderActions,task_name:e.renderTaskName}},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"renderTaskName",value:function(e){return(0,Ft.jsx)("div",{className:Do("task-name","elements-ellipsis"),children:e.task_name})}},{key:"renderProgress",value:function(e){var t=e.state,n=e.progress,r=e.brief_statistics,i=e.type,s=e.interruption_info;return(0,Ft.jsxs)("div",{className:Do("state"),children:[(0,Ft.jsx)("div",{className:Do("state-section","elements-ellipsis"),children:(0,Ft.jsx)(Bo,{info:s,state:t})}),(0,Ft.jsx)("div",{className:Do("state-section"),children:(0,Ft.jsx)(Eo.Progress,{state:t,progress:n})}),(0,Ft.jsx)(Ro,{statistics:r,type:i})]})}},{key:"renderStartTime",value:function(e){return(0,Ft.jsx)(_o.c,{className:Do("start-time"),time:e.startTime,valueFormat:"DateTimeTwoLines"})}},{key:"renderFinishTime",value:function(e){return"running"===e.state?(0,Ft.jsx)("span",{className:Do("in-progress","elements-ellipsis elements-secondary-text"),children:"In progress..."}):(0,Ft.jsx)(_o.c,{className:Do("finish-time"),time:e.finishTime,valueFormat:"DateTimeTwoLines"})}},{key:"renderDuration",value:function(e){return(0,Ft.jsx)("span",{className:"elements-ellipsis",children:ue.A.format.TimeDuration(e.duration)})}},{key:"renderType",value:function(e){return(0,Ft.jsx)("span",{children:ue.A.format.ReadableField(e.type)})}},{key:"renderInputPathsModal",value:function(){var e=this.props,t=e.inputPaths,n=t.paths,r=t.status,i=t.error,s=e.hideInputPaths;if(r===fe.EG.UNINITIALIZED)return null;var a=Xt.A.prepareSettings(),o=r===fe.EG.ERROR?(0,Ft.jsx)(b.z,(0,l.A)({},i)):(0,Ft.jsx)(y.A,{value:n,settings:a});return(0,Ft.jsx)(wo.A,{visible:!0,onCancel:s,loading:r===fe.EG.LOADING,onOutsideClick:s,title:"Input paths",children:o})}},{key:"render",value:function(){var e=this.props,t=e.jobs,n=e.showCompetitiveJobs,i=e.getJobs,s=e.isLoading,a=e.collapsibleSize;if(n){var o=this.props,c=o.job,u=o.competitiveJobs,d=o.getCompetitiveJobs;return(0,Ft.jsxs)(r.Fragment,{children:[this.renderInputPathsModal(),(0,Ft.jsx)(rn.A,(0,l.A)((0,l.A)({},this.settings),{},{items:[c].filter(Boolean),onSort:d,isLoading:s})),u.length>0&&(0,Ft.jsx)(vi.A,{name:"All competitive jobs",className:Do("competitive-jobs"),collapsed:!0,size:a,children:(0,Ft.jsx)(rn.A,(0,l.A)((0,l.A)({},this.settings),{},{items:u,onSort:d,isLoading:s}))})]})}return(0,Ft.jsxs)(r.Fragment,{children:[this.renderInputPathsModal(),(0,Ft.jsx)(rn.A,(0,l.A)((0,l.A)({},this.settings),{},{items:t,onSort:i,isLoading:s}))]})}}])}(r.Component),Ho={openAttributesModal:Co.V6,showInputPaths:Ao,hideInputPaths:function(){return{type:Ga.PN}},showErrorModal:un.Hm,promptAction:un.Jm,getJobs:vo,getCompetitiveJobs:uo};const Uo=(0,c.Ng)((function(e,t){var n,r=e.operations,i=e.global,s=i.cluster,a=i.login,o=Ie(e),l=null===(n=(0,Je.MG)(e))||void 0===n?void 0:n.length,c=function(e){return e.operations.jobs.operationId}(e),u=(0,Je.Bq)(e),d=r.jobs,p=d.jobs;return{jobs:u!==c?[]:p,job:d.job,competitiveJobs:d.competitiveJobs,showCompetitiveJobs:o,inputPaths:d.inputPaths,cluster:s,login:a,collapsibleSize:Ai.Y1,isLoading:t.isLoading||u!==c,taskNamesNumber:l}}),Ho)(Jo),Wo=(0,c.Ng)((function(e,t){var n=e.operations,r=n.jobs.filters,i=t.name,s=t.states,a=t.statesProvider,o=r[i],l=o.defaultValue,c=o.value,u=o.counters,d="function"==typeof a?a(n):s;return{value:Pe(c,l),states:d,counters:u}}),{updateFilter:function(e,t){return bo({name:e,value:t})}})(Zn);var $o=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).gotoFirstPage=function(){return e.props.gotoJobsPage(Xe.b4.FIRST)},e.gotoNextPage=function(){return e.props.gotoJobsPage(Xe.b4.NEXT)},e.gotoPrevPage=function(){return e.props.gotoJobsPage(Xe.b4.PREV)},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(){var e=this.props,t=e.firstPageReached,n=e.lastPageReached,r=e.disabled;return(0,Ft.jsx)(er.A,{size:"s",first:{handler:this.gotoFirstPage,disabled:r||t},previous:{handler:this.gotoPrevPage,hotkeyHandler:this.gotoPrevPage,disabled:r||t,hotkeyScope:"all",hotkey:"ctrl+left, command+left"},next:{handler:this.gotoNextPage,hotkeyHandler:this.gotoNextPage,disabled:r||n,hotkeyScope:"all",hotkey:"ctrl+right, command+right"},last:{disabled:!0}})}}])}(r.Component);const Yo=(0,c.Ng)((function(e){var t=e.operations.jobs.pagination;return{firstPageReached:t.firstPageReached,lastPageReached:t.lastPageReached,limit:t.limit,offset:t.offset}}),{gotoJobsPage:xo})($o);var qo=n(1686),Xo=n.n(qo);const Ko=(0,c.Ng)((function(e,t){var n=e.operations.jobs.filters,r=t.statesProvider,i=t.name,s=n[i],a=s.defaultValue,o=s.value,l=r(s.data);return{value:Pe(o,a),states:l,defaultValue:a,placeholder:"Filter ".concat(i,"...")}}),{updateFilter:function(e,t){return bo({name:e,value:t})}})(br),Go=function(e){var t=e.filterName,n=e.placeholder,i=e.pin,s=(0,c.d4)(Re(t)),a=(0,c.wA)(),o=(0,r.useCallback)((function(e){a(bo({name:t,value:e}))}),[a,t]);return(0,Ft.jsx)(kn.A,{size:"m",placeholder:n,onChange:o,value:null!=s?s:"",pin:i})},Zo=JSON.parse('{"value_address":"Address","value_id":"Id","value_monitoring-descriptor":"Monitoring descriptor","placeholder_filter-id":"Filter id...","placeholder_filter-monitoring-descriptor":"Filter monitoring descriptor..."}'),Qo=JSON.parse('{"value_address":"Адрес","value_id":"Id","value_monitoring-descriptor":"Дескриптор мониторинга","placeholder_filter-id":"Фильтр по id...","placeholder_filter-monitoring-descriptor":"Фильтр по дескриптору мониторинга..."}'),el=(0,si.Kc)("yt:operations.jobs",{en:Zo,ru:Qo});var tl=(0,i.A)("operation-detail-jobs");const nl=function(){var e=(0,c.d4)(Re("filterBy")),t=(0,c.wA)(),n=(0,r.useCallback)((function(e){t(bo({name:"filterBy",value:e}))}),[t]);return(0,Ft.jsxs)(r.Fragment,{children:[(0,Ft.jsx)("div",{className:tl("toolbar-filter-by-select"),children:(0,Ft.jsx)(Xn.A,{value:e?[e]:[],items:f()(["address","id","monitoring_descriptor"],(function(e){return{value:e,text:{address:el("value_address"),id:el("value_id"),monitoring_descriptor:el("value_monitoring-descriptor")}[e]}})),onUpdate:function(e){return n(e[0])},pin:"round-clear",width:"max",hideFilter:!0})}),(0,Ft.jsxs)("div",{className:tl("toolbar-filter-by-value"),children:["address"===e&&(0,Ft.jsx)(Ko,{name:"address",statesProvider:Xo(),pin:"brick-round"}),"id"===e&&(0,Ft.jsx)(Go,{filterName:"jobId",placeholder:el("placeholder_filter-id"),pin:"brick-round"}),"monitoring_descriptor"===e&&(0,Ft.jsx)(Go,{filterName:"monitoringDescriptor",placeholder:el("placeholder_filter-monitoring-descriptor"),pin:"brick-round"})]})]})},rl=function(e){var t,n=(0,c.d4)((t=bt,function(e){return t.filter((function(t){return Re(t)(e)}))})),i=(0,c.wA)(),s=(0,r.useCallback)((function(e){var t,n;i((t=bt,n=e,function(e){t.forEach((function(t){var r=-1!==n.indexOf(t);e(go({name:t,value:r}))})),e(xo(sr.b4.FIRST))}))}),[]);return(0,Ft.jsx)(Xn.A,(0,l.A)((0,l.A)({},e),{},{multiple:!0,value:n,label:"Attributes:",filterable:!0,items:gt,onUpdate:s}))};var il=(0,i.A)("yt-jobs-incarnation-filter");function sl(e){var t=e.disabled,n=e.wrap,r=(0,c.wA)(),i=(0,c.d4)(eo),s=(0,c.d4)(to);return null!=s&&s.length?n((0,Ft.jsx)(Zn,{name:"incarnation",states:s.map((function(e){return{name:e,caption:e}})),disabled:t,width:"auto",value:i,updateFilter:function(e,t){r(function(e){return function(t){t(io.wd.setFilter({filter:e})),t(vo())}}(t))},hideClear:!1,hideFilter:!1,popupClassName:il("popup")})):null}var al=(0,i.A)("operation-detail-jobs"),ol=(0,i.A)("elements-toolbar");function ll(e){var t=e.jobs.filters.type.counters;return ue.A.utils.sortInPredefinedOrder(["all"],h()(t))}var cl=ol("component");function ul(){var e=(0,c.d4)(Ie),t=(0,c.d4)(Je.MG),n=r.useMemo((function(){return[""].concat((0,ve.A)(t.map((function(e){return{name:e,caption:e}}))))}),[t]);return(0,Ft.jsx)("div",{className:al("toolbar"),children:(0,Ft.jsx)("div",{className:ol(),children:(0,Ft.jsxs)("div",{className:ol("container"),children:[(0,Ft.jsx)("div",{className:al("toolbar-filter-by",cl),children:(0,Ft.jsx)(nl,{})}),(0,Ft.jsx)("div",{className:al("toolbar-filter-by",cl),children:(0,Ft.jsx)(Wo,{name:"taskName",states:n,width:"max"})}),(0,Ft.jsx)("div",{className:al("toolbar-state",cl),children:(0,Ft.jsx)(Wo,{name:"type",statesProvider:ll,disabled:e,width:200})}),(0,Ft.jsx)("div",{className:al("toolbar-state",cl),children:(0,Ft.jsx)(Wo,{name:"state",states:["all","running","completed","failed","aborted"],disabled:e,width:200})}),(0,Ft.jsx)("div",{className:al("toolbar-attributes",cl),children:(0,Ft.jsx)(rl,{disabled:e,width:200})}),(0,Ft.jsx)(sl,{disabled:e,wrap:function(e){return(0,Ft.jsxs)("div",{className:al("toolbar-state",cl),children:[e," "]})}}),(0,Ft.jsx)("div",{className:al("toolbar-pagination",cl),children:(0,Ft.jsx)(Yo,{disabled:e})})]})})})}var dl=n(13685),pl=(0,i.A)("operation-jobs-errors");function hl(){var e=(0,c.d4)(Qa);return(0,Ft.jsx)("div",{className:pl(),children:f()(e,(function(e,t){return(0,Ft.jsx)(b.z,{error:e},t)}))})}const ml=r.memo(hl);function fl(e){var t=e.className,n=(0,c.wA)(),i=(0,c.d4)((function(e){return e.operations.jobs.loading})),s=(0,c.d4)((function(e){return e.operations.jobs.loaded})),a=(0,c.d4)((function(e){return e.operations.jobs.error})),o=(0,c.d4)((function(e){return e.operations.jobs.errorData})),l=r.useCallback((function(){n(vo())}),[n]);(0,dl.Tt)(l,{timeout:15e3});var u=i&&!s;return(0,Ft.jsx)(Jr.A,{children:(0,Ft.jsxs)("div",{className:"operation-detail-jobs ".concat(t),children:[(0,Ft.jsx)(ul,{}),(0,Ft.jsxs)(yo.A,{loaded:s,loading:i,error:a,errorData:o,alwaysShowError:!0,children:[(0,Ft.jsx)(ml,{}),(0,Ft.jsx)(Uo,{isLoading:u})]})]})})}function vl(e){var t=(0,c.d4)(Je.Wn),n=(0,c.d4)(Je.Q1);return(0,Ir.v)({type:Tt.c.OPERATION_TAB_JOBS,additionalStartType:Tt.c.OPERATION,startDeps:[t,n],allowStart:function(e){var t=(0,a.A)(e,2),n=t[0],r=t[1];return!(0,ze.RP)(n)||!(0,ze.RP)(r)}}),(0,Mr.ol)({type:Tt.c.OPERATION_TAB_JOBS,stopDeps:[t,n],allowStop:function(e){var t=(0,a.A)(e,2),n=t[0],r=t[1];return(0,ze.RP)(n)&&(0,ze.RP)(r)}}),(0,Ft.jsx)(fl,(0,l.A)({},e))}var gl=n(84549),bl=n(60192),Al=function(e){return e.operations.jobsMonitor.error},xl=function(e){return e.operations.jobsMonitor.loading},yl=function(e){return e.operations.jobsMonitor.loaded},jl=(0,_e.Mz)([function(e){return e.operations.jobsMonitor.jobs}],(function(e){return D()(e,(function(e){var t=e.monitoring_descriptor;return Boolean(t)}))})),wl=(0,_e.Mz)([jl],(function(e){var t,n;return R()(e,(function(e){var r=e.start_time,i=e.finish_time;if(r){var s=ke()(r).valueOf();t=Ts()([s,t])}if(i){var a=ke()(i).valueOf();n=Es()([a,n])}})),{from:t,to:n}})),kl=(0,_e.Mz)([jl],(function(e){var t=new Set(f()(e,"monitoring_descriptor"));return(0,ve.A)(t)})),_l=(0,_e.Mz)([Je.Bq,function(e){return e.operations.jobsMonitor.operation_id},kl,Al],(function(e,t,n,r){return e===t&&(!as()(r)||Boolean(n.length))}));const Cl=JSON.parse('{"alert_no-jobs-with-monitoring-descriptor":"There are no jobs with \\"monitoring_descriptor\\""}'),Sl=JSON.parse('{"alert_no-jobs-with-monitoring-descriptor":"Нет задач с \\"monitoring_descriptor\\""}'),Tl=(0,si.Kc)("yt:operations-jobs-monitor",{en:Cl,ru:Sl});function Nl(){var e=(0,c.d4)(Ue.dB),t=(0,c.d4)(jl),n=(0,c.d4)(Je.eu),r=(0,c.d4)(wl),i=r.from,s=r.to,a=(0,c.d4)(Al),o=(0,c.d4)(yl),l=(0,c.d4)(xl);if(!o&&l)return(0,Ft.jsx)(gl.A,{visible:!0,centered:!0});if(!t.length&&!a)return(0,Ft.jsx)(bl.R,{warning:Tl("alert_no-jobs-with-monitoring-descriptor")});var u=J.Ay.getMonitorComponentForJob();return(0,Ft.jsx)(Jr.A,{children:(0,Ft.jsxs)(gi.s,{direction:"column",gap:1,children:[a&&(0,Ft.jsx)(b.z,{error:a}),(0,Ft.jsx)(u,{cluster:e,from:i,to:s,operation:n,jobs:t})]})})}const El=r.memo(Nl);function Pl(e){var t,n=e.className,r=(0,c.d4)(Je.nz),i=(0,c.d4)(mi.LC),s=(0,c.d4)(Je.Bq);return t=(0,c.d4)(Je.Q1),(0,Ir.v)({type:Tt.c.OPERATION_TAB_ATTRIBUTES,additionalStartType:Tt.c.OPERATION,startDeps:[t],allowStart:function(e){var t=(0,a.A)(e,1)[0];return!(0,ze.RP)(t)}}),(0,Mr.ol)({type:Tt.c.OPERATION_TAB_ATTRIBUTES,stopDeps:[t],allowStop:function(e){var t=(0,a.A)(e,1)[0];return(0,ze.RP)(t)}}),(0,Ft.jsx)(y.A,{className:n,value:r,settings:i,extraTools:(0,Ft.jsx)(va.O,{value:r,settings:i,name:"operation_attributes_".concat(s)}),folding:!0})}const Rl=r.memo(Pl);var Il=n(36161);function Ml(e){var t=e.component,n=(0,c.d4)(Je.eu),r=(0,c.d4)(Ue.dB);return(0,Ft.jsx)(Jr.A,{children:(0,Ft.jsx)(t,{cluster:r,operation:n})})}const Ol=r.memo(Ml);var zl=n(23133),Ll=n(11687),Vl=function(e){return e.operations.jobsTimeline.jobs},Bl=function(e){return e.operations.jobsTimeline.isLoading},Fl=function(e){return e.operations.jobsTimeline.interval},Dl=function(e){return e.operations.jobsTimeline.filter},Jl=function(e){return e.operations.jobsTimeline.selectedJob},Hl=function(e){return e.operations.jobsTimeline.selectedIncarnation},Ul=function(e){return e.operations.jobsTimeline.jobsCountError},Wl=function(e){return e.operations.jobsTimeline.error},$l=function(e){var t=e.operations.jobsTimeline.eventsInterval;return isFinite(t.from)?t:void 0},Yl=(0,_e.Mz)([Vl,Bl],(function(e,t){return 0===e.length&&!t})),ql=(0,_e.Mz)([Vl],(function(e){return(0,ve.A)(e).sort((function(e,t){var n=e.groupName.localeCompare(t.groupName);return 0!==n?n:Number(e.cookieId)-Number(t.cookieId)}))})),Xl=(0,_e.Mz)([Vl,Jl],(function(e,t){return e.find((function(e){var n=e.id;return t===n}))||null})),Kl=(0,_e.Mz)([Fl,$l],(function(e,t){return!(!e||!t||e.from!==t.from||e.to!==t.to)||!e&&!t})),Gl=n(3131),Zl=n(7059),Ql=n.n(Zl),ec=new Be.A,tc=function(e){return function(){var t=(0,C.A)((0,_.A)().mark((function t(n,r){var i,s,a,o,l,c,u;return(0,_.A)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r(),s=(0,Je.Bq)(i),a=Kl(i),e&&n((0,Gl.r1)(!0)),t.prev=4,n((0,Gl.Nh)(void 0)),t.next=8,De.Qq.listJobs(De.Vu.operationGetJobs,{operation_id:s,cancellation:ec.removeAllAndSave,attributes:["events","state","job_cookie","task_name","start_time","finish_time","address","allocation_id","operation_incarnation"]});case 8:if(o=t.sent,!((l=o.jobs).length>1e4)){t.next=13;break}return n((0,Gl.Er)(!0)),t.abrupt("return");case 13:c=l.reduce((function(e,t){if(null==t||!t.events||void 0===t.job_cookie||!t.events.length)return e;var n,r=t.events,i="running"===t.state||"waiting"===t.state,s="aborted"===t.state,a=Ql()(r.at(-1).time).valueOf(),o=t.finish_time?Ql()(t.finish_time).valueOf():a;n=i?Date.now():s?Math.max(a,o):a;for(var l=Ql()(r[0].time).valueOf(),c=(n-l)/100,u={id:t.id,cookieId:t.job_cookie,incarnation:t.operation_incarnation,allocationId:t.allocation_id,groupName:t.task_name||"",events:[],start_time:t.start_time,finish_time:t.finish_time,address:t.address},d=r.length,p=0,h=0;h<d;h++){var m=r[h],f=Ql()(m.time).valueOf(),v=u.events[p];m.state?(u.events.push({state:m.state,startTime:f,endTime:0,phases:[],percent:0}),p=u.events.length-1):u.events[p].phases.push({phase:m.phase,startTime:f}),v&&(v.endTime=f,v.percent=(f-v.startTime)/c)}if(i||s){var g=u.events.length-1,b=u.events[g].startTime;if(i&&(u.events[g].endTime=Date.now(),u.events[g].percent=(Date.now()-b)/c),s){var A=Math.max(o,b);u.events[g].endTime=A,u.events[g].percent=(A-b)/c}}return e.jobs.push(u),e.eventsInterval={from:Math.min(e.eventsInterval.from,l),to:Math.max(e.eventsInterval.to,n)},e}),{jobs:[],eventsInterval:{from:1/0,to:0}}),n((0,Gl.t9)(c)),(e||a)&&n((0,Gl.yb)(c.eventsInterval)),t.next=24;break;case 18:if(t.prev=18,t.t0=t.catch(4),u=t.t0,!(0,Be.m)(u)){t.next=23;break}return t.abrupt("return");case 23:n((0,Gl.Nh)(u));case 24:return t.prev=24,e&&n((0,Gl.r1)(!1)),t.finish(24);case 27:case"end":return t.stop()}}),t,null,[[4,18,24,27]])})));return function(e,n){return t.apply(this,arguments)}}()},nc=n(26116),rc=n(17714);const ic=function(e){return(0,Ft.jsx)("svg",(0,l.A)((0,l.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,Ft.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.5 2.75a.75.75 0 0 0-1.5 0v10.5a.75.75 0 0 0 1.5 0zm14.5 0a.75.75 0 0 0-1.5 0v10.5a.75.75 0 0 0 1.5 0zM6.53 4.97a.75.75 0 0 1 0 1.06L4.56 8l1.97 1.97a.75.75 0 1 1-1.06 1.06l-2.5-2.5a.75.75 0 0 1 0-1.06l2.5-2.5a.75.75 0 0 1 1.06 0m2.94 1.06a.75.75 0 0 1 1.06-1.06l2.5 2.5a.75.75 0 0 1 0 1.06l-2.5 2.5a.75.75 0 1 1-1.06-1.06L11.44 8z",clipRule:"evenodd"})}))};var sc,ac,oc,lc,cc,uc=(0,i.A)("yt-timeline-header"),dc=function(e){var t=e.className,n=(0,c.wA)(),r=(0,c.d4)(Dl),i=(0,c.d4)(Fl);return i?(0,Ft.jsxs)("div",{className:uc(null,t),children:[(0,Ft.jsx)(j.k,{defaultValue:r,placeholder:"Search by job ID",onUpdate:function(e){n((0,Gl.R6)(e))},hasClear:!0}),(0,Ft.jsxs)(gi.s,{children:[(0,Ft.jsx)(Mn.$,{view:"outlined",pin:"brick-brick",onClick:function(){n((function(e,t){var n=$l(t());n&&e((0,Gl.yb)(n))}))},title:"Reset interval",children:(0,Ft.jsx)(Xi.I,{data:ic,size:16})}),(0,Ft.jsx)(rc.K6,{className:uc("range-selector"),value:{start:(0,nc.bQ)(i.from),end:(0,nc.bQ)(i.to)},displayNow:!0,hasScaleButtons:!0,onUpdate:function(e){var t=e.start,r=e.end;n((0,Gl.yb)({from:t.valueOf(),to:r.valueOf()}))}})]})]}):null};function pc(e,t,n){return e>=t&&e<=n}function hc(e,t,n,r){return t-e>r-n?pc(n,e,t)||pc(r,e,t):pc(e,n,r)||pc(t,n,r)}function mc(e,t,n,r,i,s=(e=>e)){const a=Math.abs(i-r),o=function(e,t,n){const r=Math.abs(n-t);return t<n?(e-t)/r:(e-n)/r}(e,t,n);return r<i?r+s(o)*a:i+s(1-o)*a}function fc(e,t,n){return e>n?n:e<t?t:e}class vc{constructor(e=[],t){this._axes=[],this.axes=e,t?.identityFunction&&(this.getAxisId=t.identityFunction)}getAxisId(e){const t=e.id;if(!t)throw new Error("Axis must have a non-empty id property");return t}set axes(e){var t,n;(t=e)===(n=this._axes)||t.length===n.length&&t.every(((e,t)=>e===n[t]))||(this._axes=e,this._sortedAxes=void 0,this._axesByIdMap=void 0)}get axes(){return this._axes}get sortedAxes(){return this._sortedAxes||(this._sortedAxes=this._axes.slice().sort(((e,t)=>e.top-t.top))),this._sortedAxes}get axesById(){return this._axesByIdMap||(this._axesByIdMap=this._axes.reduce(((e,t)=>(e[this.getAxisId(t)]=t,e)),{})),this._axesByIdMap}getAxisById(e){return this.axesById[e]}hasAxis(e){return e in this.axesById}}!function(e){e.Axes="Axes",e.Grid="grid",e.Ruler="ruler",e.Events="events",e.Markers="markers"}(sc||(sc={})),function(e){e[e.STRAIGHT=0]="STRAIGHT",e[e.DASHED=1]="DASHED"}(ac||(ac={})),function(e){e[e.INIT=0]="INIT",e[e.READY=1]="READY"}(oc||(oc={})),function(e){e.NONE="none",e.HORIZONTAL="horizontal",e.DEFAULT="default"}(lc||(lc={})),function(e){e.ON_CLICK_ANYWHERE="on_click_anywhere",e.ON_MARKER_CLICK_ONLY="on_marker_click_only"}(cc||(cc={}));class gc{constructor(e){this.strokeMode=ac.STRAIGHT,this.api=e,this.axesIndex=new vc([],{identityFunction:e=>e.id})}setAxes(e){if(!e||!Array.isArray(e))throw new Error("Axes must be an array");this.axesIndex.axes=e,this.render()}getAxesById(){return this.axesIndex.axesById}getAxisTrackPosition(e,t){if(!e||e.tracksCount<0)throw new Error("Invalid axis configuration");const{axes:n}=this.api.getViewConfiguration(),r=fc(t,0,e.tracksCount-1);return e.top+n.trackHeight*r+n.trackHeight/2}render(){const{axes:e}=this.api.getViewConfiguration(),{ctx:t}=this.api;this.strokeMode===ac.DASHED&&t.setLineDash(e.dashedLinePattern),this.api.useScrollTransform(),t.translate(0,this.api.getRulerHeight());const n=t.canvas.width;t.strokeStyle=e.color.line,t.beginPath(),t.lineWidth=e.lineWidth;const r=this.api.getCameraPosition(),i=this.axesIndex.sortedAxes.filter((t=>hc(t.top,t.top+t.tracksCount*e.trackHeight,r.y0,r.y1)));for(const e of i)for(let i=0;i<e.tracksCount;i+=1){const s=this.getAxisTrackPosition(e,i);s>=r.y0&&s<=r.y1&&(t.moveTo(0,s),t.lineTo(n,s))}t.stroke(),t.setLineDash(e.solidLinePattern)}}const bc=36e5,Ac=24*bc,xc=30*Ac,yc=365*Ac,jc={start:e=>Ql()(e).startOf("hour"),step:e=>Ql()(e).add(1,"hour"),format:"HH"},wc={start:e=>Ql()(e).startOf("month"),step:e=>Ql()(e).add(1,"month"),format:"MMM YYYY"},kc={start:e=>Ql()(e).startOf("year"),step:e=>Ql()(e).add(1,"year"),format:"YYYY"};class _c{constructor(e){this.levelCache=new Map,this.api=e,this.labelLevels=(({color:e})=>{const t=(n=e.rulerWeekendColor,{start:e=>Ql()(e).startOf("day"),step:e=>Ql()(e).add(1,"day"),color(e){const t=Ql()(e).day();return 6===t||0===t?n:null},format:"MMM D"});var n;return[{domain:1e3,start:e=>Ql()(e).startOf("millisecond"),step:e=>Ql()(e).add(1,"millisecond"),format:"SSS[ms]",sup:{start:e=>Ql()(e).startOf("second"),step:e=>Ql()(e).add(1,"second"),format:"ss[′′]"}},{domain:6e4,start:e=>Ql()(e).startOf("second"),step:e=>Ql()(e).add(1,"second"),format:"ss[′′]",sup:{start(e){const t=Ql()(e).startOf("minute");return t.subtract(t.minute()%5,"minute")},step:e=>Ql()(e).add(5,"minute"),format:"mm[′]"}},{domain:bc,start(e){const t=Ql()(e).startOf("minute");return t.subtract(t.minute()%5,"minute")},step:e=>Ql()(e).add(5,"minute"),format:"mm[′]",sup:jc},{domain:Ac,start(e){const t=Ql()(e).startOf("minute");return t.subtract(t.minute()%15,"minute")},step:e=>Ql()(e).add(15,"minute"),format:"mm[′]",sup:jc},{domain:Ac,start:e=>Ql()(e).startOf("hour"),step:e=>Ql()(e).add(1,"hour"),format:"HH",sup:t},{domain:xc,start(e){const t=Ql()(e).startOf("hour");return t.subtract(t.hour()%4,"hour")},step:e=>Ql()(e).add(4,"hour"),format:"HH",sup:t},{domain:xc,start:e=>Ql()(e).startOf("day"),step:e=>Ql()(e).add(1,"day"),color(t){const n=Ql()(t).day();return 6===n||0===n?e.rulerWeekendColor:null},format:"D",sup:wc},{domain:6*xc,start:e=>Ql()(e).startOf("week").add(1,"day"),step:e=>Ql()(e).add(1,"week"),format:"D"},{domain:yc,start:e=>Ql()(e).startOf("month"),step:e=>Ql()(e).add(1,"month"),format:"MMM",sup:kc},{domain:10*yc,start(e){const t=Ql()(e).startOf("month");return t.subtract(t.month()%3,"month")},step:e=>Ql()(e).add(3,"month"),format:"[Q]Q"},{domain:1/0,start:e=>Ql()(e).startOf("year"),step:e=>Ql()(e).add(1,"year"),format:"YYYY"}]})(this.api.getViewConfiguration().ruler)}render(){const{ruler:e}=this.api.getViewConfiguration(),{ctx:t,width:n}=this.api;this.api.useStaticTransform(),t.fillStyle=e.color.background,t.fillRect(0,0,n,e.height),t.font=e.font,t.lineJoin="miter",t.miterLimit=2,t.lineWidth=1,this.renderBottomLine(),this.renderLevels()}renderBottomLine(){const{ruler:e}=this.api.getViewConfiguration(),{ctx:t,width:n}=this.api;t.strokeStyle=e.color.borderColor,t.beginPath(),t.moveTo(0,e.height+t.lineWidth/2),t.lineTo(n,e.height+t.lineWidth/2),t.stroke()}renderLevels(){const{start:e,end:t}=this.api.getInterval(),{ruler:n}=this.api.getViewConfiguration();if(!n)return;const r=t-e,{width:i}=this.api,{level:s,supLevel:a}=this.findAppropriateLevels(r,i);s&&this.renderLevel(s,n.position,n.color.primaryLevel),a&&this.renderLevel(a,n.subPosition,n.color.secondaryLevel)}findAppropriateLevels(e,t){let n,r;for(const i of this.labelLevels){if(e>i.domain)continue;let s=this.levelCache.get(i);if(void 0===s&&(s=this.calculateMarksWidth(i,e,t),this.levelCache.set(i,s)),!(s>t)){n=i,r=n.sup||this.labelLevels[this.labelLevels.indexOf(i)+1];break}}return{level:n,supLevel:r}}calculateMarksWidth(e,t,n){const{ruler:r}=this.api.getViewConfiguration();let i=0;for(let s=Ql()(0);Number(s)<t;s=e.step(s))mc(Number(s),0,t,0,n)>0&&(i+=r.spacing);return i}renderLevel(e,t,n){const{ruler:r}=this.api.getViewConfiguration(),{start:i,end:s}=this.api.getInterval(),{ctx:a,width:o}=this.api;a.strokeStyle=r.color.textOutlineColor;let l=null;for(let r=e.start(i);Number(r)<s;r=e.step(r)){const i=Ql()(r).format(e.format),s=this.timeToPosition(r);s>10&&s<o&&(l||(l=r),a.fillStyle=e.color&&e.color(r)||n,a.strokeText(i,s,t),a.fillText(i,s,t))}this.renderEdgeLabel(e,t,n,l)}renderEdgeLabel(e,t,n,r){const{ctx:i}=this.api,s=this.positionToTime(10),a=Ql()(s).format(e.format),o=fc(10,-1/0,this.timeToPosition(r||this.api.getInterval().end)-i.measureText(a).width-5);i.fillStyle=e.color&&e.color(s)||n,i.strokeText(a,o,t),i.fillText(a,o,t)}timeToPosition(e){const{start:t,end:n}=this.api.getInterval();return mc(Number(e),t,n,0,this.api.width)}positionToTime(e){const{start:t,end:n}=this.api.getInterval();return mc(e,0,this.api.width,t,n)}}const Cc=(e,t,n,r)=>i=>i[t]()%e==0?n:r;class Sc{constructor(e){this.api=e,this.levels=(({color:e})=>[{domain:bc,style:Cc(5,"minute",e.primaryMarkColor,e.secondaryMarkColor),start:e=>Ql()(e).startOf("minute"),step:e=>e.add(1,"minute")},{domain:Ac,style:t=>0===t.hour()&&0===t.minute()?e.boundaryMarkColor:t.minute()%4==0?e.primaryMarkColor:e.secondaryMarkColor,start(e){const t=Ql()(e).startOf("minute");return t.subtract(t.minute()%15,"minute")},step:e=>e.add(15,"minute")},{domain:xc,style:t=>0===t.hour()?e.boundaryMarkColor:t.hour()%4==0?e.primaryMarkColor:e.secondaryMarkColor,start:e=>Ql()(e).startOf("hour"),step:e=>e.add(1,"hour")},{domain:yc,style:t=>1===t.date()?e.boundaryMarkColor:1===t.day()?e.primaryMarkColor:e.secondaryMarkColor,start:e=>Ql()(e).startOf("day"),step:e=>e.add(1,"day")},{domain:5*yc,style:Cc(3,"month",e.primaryMarkColor,e.secondaryMarkColor),start:e=>Ql()(e).startOf("month"),step:e=>Ql()(e).add(1,"month")},{domain:1/0,style:()=>e.primaryMarkColor,start:e=>Ql()(e).startOf("year"),step:e=>e.add(1,"year")}])(this.api.getViewConfiguration().grid)}render(){this.api.useStaticTransform();const{start:e,end:t}=this.api.getInterval(),{ctx:n,width:r}=this.api,i=t-e,s=this.selectGridLevel(i,r);if(!s)return;this.api.useStaticTransform();const a=this.api.getRulerHeight(),o=a,l=n.canvas.height-a;this.renderLevel(o,0,r,l,s)}selectGridLevel(e,t){if(!this.levels.length)return null;for(const n of this.levels)if(!(e>n.domain||this.calculateMarksWidth(n,e)>t+this.api.getViewConfiguration().grid.widthBuffer))return n;return this.levels[this.levels.length-1]}calculateMarksWidth(e,t){let n=Ql()(0),r=0;for(;Number(n)<t;)r+=mc(Number(n),0,t,0,r)>0?this.api.getViewConfiguration().grid.spacing:0,n=e.step(n);return r}renderLevel(e,t,n,r,i){const{grid:s}=this.api.getViewConfiguration(),{start:a,end:o}=this.api.getInterval(),{ctx:l}=this.api;l.lineWidth=s.lineWidth;for(let s=i.start(a);Number(s)<o;s=i.step(s)){const c=Math.floor(mc(Number(s),a,o,t,t+n));l.beginPath(),l.strokeStyle=i.style(s),l.moveTo(c,e),l.lineTo(c,e+r),l.stroke()}}}var Tc=n(48495),Nc=n.n(Tc);function Ec(e){return-1!==navigator.userAgent.indexOf("Mac OS")?e.metaKey:e.ctrlKey}class Pc{constructor(){this.hitboxResult={top:0,right:0,bottom:0,left:0}}}class Rc extends Pc{render(e,t,n,r,i,s,a){let o=t.color||"#333";n&&(o=t.selectedColor||"#546"),e.beginPath(),e.fillStyle=o,e.rect(r,s-a/2,i-r,a),e.fill()}getHitbox(e,t,n){return this.hitboxResult.left=t,this.hitboxResult.right=n,this.hitboxResult}}class Ic{constructor(e){this.allowMultipleSelection=!0,this.activeEvents=null,this.index=new(Nc())(16),this._selectedEvents=new Set,this._events=[],this.handleCanvasMouseup=e=>{const{clickEventsCollectionFilter:t}=this.api.getTimelineSettings();let n=this.getEventsAtPoint(e.offsetX,e.offsetY);t&&(n=t(n)),n.length>0?this.selectEvents(n,{append:Ec(e),toggle:!0}):this.selectEvents([])},this.handleCanvasContextMenu=e=>{e.preventDefault();const t=this.getEventsAtPoint(e.offsetX,e.offsetY),n=t.length>0?t[0]:void 0;this.api.emit("on-context-click",{event:n,time:this.api.positionToTime(e.offsetX),relativeX:e.clientX,relativeY:e.clientY})},this.handleCanvasMousemove=e=>{e.preventDefault();const t=this.getEventsAtPoint(e.offsetX,e.offsetY),n=JSON.stringify(this.activeEvents)===JSON.stringify(t);if(this.activeEvents&&(!n||!t.length)){const e=new Set(t.map((({id:e})=>e)));this.api.emit("on-leave",{event:this.activeEvents.filter((({id:t})=>!e.has(t)))})}if(!t.length)return void(this.activeEvents=null);if(n)return;const r=this.api;this.activeEvents=t,this.api.emit("on-hover",{events:t,time:r.positionToTime(e.offsetX),relativeX:e.clientX,relativeY:e.clientY})},this.api=e,this.addEventListeners()}setEvents(e,t){this._events=e,this.rebuildIndex(),t&&(this._selectedEvents=new Set(t))}getEventsAt(e){const{events:{hitboxPadding:t}}=this.api.getViewConfiguration(),n=-this.api.getRulerHeight()+this.api.canvasScrollTop;return this.index.search({minX:this.api.positionToTime(e.left-t),maxX:this.api.positionToTime(e.right+t),minY:e.top+n-t,maxY:e.bottom+n+t}).map((e=>e.event))}getEventsAtPoint(e,t){return this.getEventsAt(new DOMRect(e-3,t-3,6,6))}setSelectedEvents(e){this._selectedEvents=new Set(e),this.render()}getSelectedEvents(){return this._events.filter((e=>this.isSelectedEvent(e)))}isSelectedEvent(e){return!!e&&this._selectedEvents.has(e.id)}selectEvents(e,t={}){const n=this._selectedEvents;t.append||n.clear();const r=t.toggle?e=>{n.has(e)?n.delete(e):n.add(e)}:e=>n.add(e);if(this.allowMultipleSelection)for(const t of e)r(t.id);else e.length>0&&(n.size>0&&!n.has(e[0].id)&&n.clear(),r(e[0].id));this.api.emit("on-select-change",{events:this.getSelectedEvents()}),this.api.rerender()}render(){const e=this.api.getViewConfiguration(),{start:t,end:n}=this.api.getInterval(),r=this.api.getComponent(sc.Axes);if(!r)return;this.api.useScrollTransform();const i=this.api.ctx,s=e=>this.api.timeToPosition(e);i.translate(0,this.api.getRulerHeight()),i.font=e.events.font,i.lineWidth=2;const a=this.api.getCameraPosition();for(let o=0,l=this._events.length;o<l;o+=1){const l=this._events[o],c=r.getAxesById()[l.axisId];if(!c)continue;const u=r.getAxisTrackPosition(c,l.trackIndex),d=l.to||n;if(c&&hc(t,n,l.from,d)&&u>=a.y0&&u<=a.y1){const t=this.api.timeToPosition(l.from),n=this.api.timeToPosition(d);this.runRenderer(i,l,this.isSelectedEvent(l),t,n,u,c.height,e,s)}}}destroy(){this.api.canvas.removeEventListener("mouseup",this.handleCanvasMouseup),this.api.canvas.removeEventListener("contextmenu",this.handleCanvasContextMenu),this.api.canvas.removeEventListener("mousemove",this.handleCanvasMousemove)}rebuildIndex(){const{end:e}=this.api.getInterval(),{axes:t}=this.api.getViewConfiguration(),n=this.api.getComponent(sc.Axes),r=n.getAxesById(),i=this._events.map((i=>{const s=r[i.axisId],a=n.getAxisTrackPosition(s,i.trackIndex);return{minX:i.from,maxX:i.to?i.to:e,minY:a-t.lineHeight/2,maxY:a+t.lineHeight/2,event:i}}));this.index.clear(),this.index.load(i)}addEventListeners(){this.api.canvas.addEventListener("mouseup",this.handleCanvasMouseup),this.api.canvas.addEventListener("contextmenu",this.handleCanvasContextMenu),this.api.canvas.addEventListener("mousemove",this.handleCanvasMousemove)}runRenderer(e,t,n,r,i,s,a,o,l){t.renderer||(t.renderer=new Rc),t.renderer.render(e,t,n,r,i,s,a,o,l)}}const Mc="#333",Oc="#777",zc="#DDD",Lc="#FFF",Vc="10px sans-serif",Bc={hideRuler:!1,ruler:{spacing:40,position:33,subPosition:16,height:41,font:Vc,color:{background:Lc,primaryLevel:"#111",secondaryLevel:Oc,textOutlineColor:Lc,borderColor:Mc,rulerWeekendColor:"#D30"}},grid:{spacing:40,lineWidth:1,widthBuffer:40,color:{primaryMarkColor:Oc,secondaryMarkColor:zc,boundaryMarkColor:Mc}},axes:{trackHeight:25,lineHeight:25,color:{line:zc},lineWidth:1,dashedLinePattern:[5,3],solidLinePattern:[0,0]},events:{font:Vc,hitboxPadding:2},markers:{font:Vc,groupColor:"rgb(254, 127, 45)",groupColorHover:"red",hitboxPadding:2,collapseMinDistance:4,collapseEnabled:!0,groupZoomEnabled:!0,groupZoomPadding:.2,groupZoomMaxFactor:.5},camera:{zoom:lc.DEFAULT}};class Fc{constructor(e){this.timeline=e,this.canvas=this.timeline.canvas,this.components=new Map,this.ctx=this.canvas.getContext("2d"),this.ctx.globalAlpha=1}addComponent(e,t){this.components.set(e,t)}removeComponent(e){this.components.delete(e)}getComponent(e){if(this.components.has(e))return this.components.get(e)}rerender(e=!0){e&&this.clear(),this.components.size&&(this.ctx.save(),this.components.forEach((e=>{e.rebuildIndex?.(),e.render()})),this.ctx.restore())}getViewConfiguration(){return this.timeline.viewConfiguration}getRulerHeight(){const e=this.timeline.viewConfiguration;return e.hideRuler?0:e.ruler.height||0}getTimelineSettings(){return this.timeline.settings}setRange(e,t){this.timeline.settings.start=e,this.timeline.settings.end=t,this.rerender()}setAxes(e){this.getComponent(sc.Axes).setAxes(e)}setEvents(e,t){this.getComponent(sc.Events).setEvents(e,t),this.rerender()}setSelectedEvents(e){this.getComponent(sc.Events).setSelectedEvents(e)}setMarkers(e){this.getComponent(sc.Markers).setMarkers(e)}setCanvasScrollTop(e){this.timeline.canvasScrollTop=e,this.rerender()}get pixelRatio(){return window.devicePixelRatio||1}get canvasScrollTop(){return this.timeline.canvasScrollTop||0}getInterval(){const{start:e,end:t}=this.timeline.settings;return{start:e,end:t}}getSelectedEvents(){return this.getComponent(sc.Events).getSelectedEvents()}get width(){return this.canvas.width/this.pixelRatio}get height(){return this.canvas.height/this.pixelRatio}get currentTime(){return(e=Date.now())-e%1e3;var e}get emit(){return this.timeline.emit.bind(this.timeline)}widthToTime(e){return this.positionToTime(e)-this.getInterval().start}timeToPosition(e){const t=this.width;return mc(e,this.timeline.settings.start,this.timeline.settings.end,0,t)||0}positionToTime(e){return mc(e,0,this.width,this.timeline.settings.start,this.timeline.settings.end)}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}useStaticTransform(){const e=this.pixelRatio;this.ctx.setTransform(e,0,0,e,0,0)}useScrollTransform(){const e=this.pixelRatio,t=this.canvasScrollTop*e;this.ctx.setTransform(e,0,0,e,0,-t)}destroy(){this.components.forEach(((e,t)=>{e?.destroy?.(),this.removeComponent(t)}))}getCameraPosition(){return{y0:this.canvasScrollTop,y1:this.canvasScrollTop+this.height,x0:0,x1:this.width}}getEventPosition(e){const t=this.getComponent(sc.Axes);if(!t)throw new Error("Invalid axes configuration");const n=t.getAxesById()[e.axisId];if(!n)throw new Error("Invalid axis id");const{end:r}=this.getInterval();return{x0:this.timeToPosition(e.from),x1:this.timeToPosition(e.to||r),y0:t.getAxisTrackPosition(n,e.trackIndex)+this.getRulerHeight()-this.canvasScrollTop,h:n.height}}}var Dc=n(24503),Jc=n.n(Dc);const Hc=25e-5,Uc=2*xc;class Wc{constructor(e){this.emitCameraChange=Jc()(((e,t)=>{this.api.emit("on-camera-change",{from:e,to:t})}),150),this.updateCanvasSize=()=>{const e=window.devicePixelRatio||1,t=this.api.canvas.offsetWidth,n=this.api.canvas.offsetHeight;this.api.canvas.width=Math.floor(t*e),this.api.canvas.height=Math.floor(n*e),this.api.rerender()},this.handleCanvasWheel=e=>{e.stopPropagation(),e.preventDefault();const{start:t,end:n}=this.api.getInterval(),{camera:r}=this.api.getViewConfiguration(),i=r.zoom;if(i===lc.NONE)return;let s=t,a=n,o=!1;const l=a-s;if(Math.abs(e.deltaY)>2)if(e.shiftKey||i===lc.HORIZONTAL){o=!0;const t=l*e.deltaY*Hc;s+=t,a+=t}else{const n=fc(l*(e.deltaY>0?1.15:.9),5e3,Uc);if(e.offsetX>=0&&e.offsetX<=this.api.canvas.offsetWidth&&e.offsetY>=0&&e.offsetY<=this.api.canvas.offsetHeight){const r=this.api.positionToTime(e.offsetX),i=(r-t)/l;s=Math.round(r-i*n),a=Math.round(r+(1-i)*n)}}if(!o&&0!==e.deltaX){const t=(a-s)*e.deltaX*Hc;s+=t,a+=t}s===t&&a===n||(this.api.setRange(s,a),this.emitCameraChange(s,a))},this.handleCanvasMouseup=e=>{const{clickEventsCollectionFilter:t,clickMarkerCollectionFilter:n}=this.api.getTimelineSettings(),r=this.api.getComponent(sc.Events),i=this.api.getComponent(sc.Markers),s=r?r.getEventsAtPoint(e.offsetX,e.offsetY):[],a=i?i.getMarkersAtPoint(e.offsetX,e.offsetY):[];this.api.emit("on-click",{events:t?t(s):s,markers:n?n(a):a})},this.api=e,this.updateCanvasSize(),this.init()}init(){this.resizeObserver=new ResizeObserver((()=>{this.updateCanvasSize()})),this.resizeObserver.observe(this.api.canvas),this.api.canvas.addEventListener("wheel",this.handleCanvasWheel),this.api.canvas.addEventListener("mouseup",this.handleCanvasMouseup)}destroy(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.api.canvas.removeEventListener("wheel",this.handleCanvasWheel),this.api.canvas.removeEventListener("mouseup",this.handleCanvasMouseup)}}class $c{}class Yc extends $c{render({ctx:e,isSelected:t,isHovered:n,marker:r,markerPosition:i,viewConfiguration:s,lastRenderedLabelPosition:a,getLabelSize:o}){const{markers:l}=s,c=r.group?l.groupColor:r.activeColor,u=r.group?l.groupColorHover:r.hoverColor;let d=n?u:r.color;t&&(d=c);let p=0;if(r.label){const l=o(r.label);p=l.height+8,this.renderLabel(e,d,t,n,r,i,l,s.markers,a)}e.strokeStyle=d,e.lineWidth=r.lineWidth||1,e.beginPath(),e.moveTo(i,p),e.lineTo(i,e.canvas.height),e.stroke()}renderLabel(e,t,n,r,i,s,a,o,l){const{width:c,height:u}=a,d=c+8,p=u+8,h=n||r,m=this.calculateSelectedLabelPosition(s,d,h?e.canvas.width:Math.min(e.canvas.width,l.top));(s<l.top||h)&&(h&&(l.top=m),this.drawLabelContent(e,t,i,m,d,p,u,o))}calculateSelectedLabelPosition(e,t,n){return fc(e-t/2,0,n-t)}drawLabelContent(e,t,n,r,i,s,a,o){e.font=o.font,e.fillStyle=t,e.fillRect(r,0,i,s),e.fillStyle=n.labelColor||"#333",e.fillText(n.label,r+4,a+4)}}class qc{constructor(e){this._sortedMarkers=[],this._collapsedMarkers=[],this.index=new(Nc())(16),this.lastRenderedLabelPosition={top:1/0,bottom:1/0},this.textWidthCache=new Map,this._selectedMarkers=new Set,this.hoveredMarker=void 0,this.handleCanvasMouseup=e=>{const{clickMarkerCollectionFilter:t,markerDeselectionMode:n=cc.ON_CLICK_ANYWHERE}=this.api.getTimelineSettings();let r=this.getMarkersAtPoint(e.offsetX,e.offsetY);t&&(r=t(r));const i=r.map((e=>e.time)),s=i.length===this._selectedMarkers.size&&i.every((e=>this._selectedMarkers.has(e))),a=n===cc.ON_MARKER_CLICK_ONLY,o=t=>{this.api.emit("on-marker-select-change",{markers:t,time:this.api.positionToTime(e.offsetX),relativeX:e.clientX,relativeY:e.clientY}),this.api.rerender()};if(!a||r.length){if(s){if(!a)return;return this._selectedMarkers.clear(),void o([])}if(r.length){this._selectedMarkers=new Set(i);const e=r.find((e=>Boolean(e.group)));return e&&this.handleGroupMarkerClick(e),void o(r)}a||(this._selectedMarkers.clear(),o([]))}},this.handleCanvasMousemove=e=>{const t=this.getMarkersAtPoint(e.offsetX,e.offsetY),n=t.length?t[0].time:void 0;this.hoveredMarker!==n&&(this.hoveredMarker=n,this.api.rerender())},this.api=e,this.addEventListeners()}setMarkers(e){this._sortedMarkers=e.slice().sort(((e,t)=>e.time-t.time)),this._collapsedMarkers=[],this.rebuildIndex(),this.render()}getMarkersAt(e){const{markers:{hitboxPadding:t}}=this.api.getViewConfiguration();return this.index.search({minX:this.api.positionToTime(e.left-t),maxX:this.api.positionToTime(e.right+t),minY:0,maxY:this.api.ctx.canvas.height}).filter((e=>!e.marker.nonSelectable)).map((e=>e.marker))}getMarkersAtPoint(e,t){return this.getMarkersAt(new DOMRect(e-3,t-3,6,6))}isSelectedMarker(e){return this._selectedMarkers.has(e)}isHoveredMarker(e){return this.hoveredMarker===e}render(){this.api.useStaticTransform(),this.lastRenderedLabelPosition={top:1/0,bottom:1/0};const{start:e,end:t}=this.api.getInterval(),n=[];for(let r=0;r<this._sortedMarkers.length;r+=1){const i=this._sortedMarkers[r],s=i.label?this.api.widthToTime(this.getLabelSize(i.label).width):0;pc(i.time,e-s,t+s)&&n.push(i)}const r=this.collapseCloseSimilarMarkers(n);this._collapsedMarkers=r,this.rebuildIndexWithCollapsedMarkers();const i=(e,t,n)=>{(e.renderer||new Yc).render({ctx:this.api.ctx,marker:e,isSelected:t,isHovered:n,markerPosition:this.api.timeToPosition(e.time),viewConfiguration:this.api.getViewConfiguration(),lastRenderedLabelPosition:this.lastRenderedLabelPosition,timeToPosition:this.api.timeToPosition,getLabelSize:this.getLabelSize.bind(this)})};for(let e=r.length-1;e>=0;e-=1){const t=r[e];this.isSelectedMarker(t.time)||this.isHoveredMarker(t.time)||i(t,!1,!1)}for(let e=r.length-1;e>=0;e-=1){const t=r[e];this.isSelectedMarker(t.time)&&!this.isHoveredMarker(t.time)&&i(t,!0,!1)}for(let e=r.length-1;e>=0;e-=1){const t=r[e];this.isHoveredMarker(t.time)&&i(t,!1,!0)}}destroy(){this.api.canvas.removeEventListener("mouseup",this.handleCanvasMouseup),this.api.canvas.removeEventListener("mousemove",this.handleCanvasMousemove)}rebuildIndex(){const e=this._sortedMarkers.map((e=>({minX:e.time,maxX:e.time,minY:0,maxY:this.api.ctx.canvas.height,marker:e})));this.index.clear(),this.index.load(e)}getLabelSize(e){if(this.textWidthCache.has(e))return this.textWidthCache.get(e);const t=this.api.ctx.measureText(e),n={width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent};return this.textWidthCache.set(e,n),n}addEventListeners(){this.api.canvas.addEventListener("mouseup",this.handleCanvasMouseup),this.api.canvas.addEventListener("mousemove",this.handleCanvasMousemove)}rebuildIndexWithCollapsedMarkers(){const e=[];for(const t of this._sortedMarkers){const n=t.time,r=t.time,i=0,s=this.api.ctx.canvas.height;e.push({minX:n,maxX:r,minY:i,maxY:s,marker:t})}for(const t of this._collapsedMarkers)if(t.group){const n=t.time,r=t.time,i=0,s=this.api.ctx.canvas.height;e.push({minX:n,maxX:r,minY:i,maxY:s,marker:t})}this.index.clear(),this.index.load(e)}collapseCloseSimilarMarkers(e){if(!e.length)return e;const{markers:t}=this.api.getViewConfiguration();if(!t.collapseEnabled)return e;const n=t.collapseMinDistance;if(n<=0)return e;const r=e.map((e=>({marker:e,position:this.api.timeToPosition(e.time)}))).sort(((e,t)=>e.position-t.position)),i=[];let s=[],a=Number.NEGATIVE_INFINITY;const o=()=>{if(s.length){if(1===s.length)i.push(s[0]);else{const e=this.calculateAverageTime(s),t={...s[0],time:e,label:`${s.length}`,group:!0};i.push(t)}s=[]}};for(const{marker:e,position:t}of r)s.length?Math.abs(t-a)<=n?(s.push(e),a=t):(o(),s.push(e),a=t):(s.push(e),a=t);return o(),i}calculateAverageTime(e){const t=e.reduce(((e,t)=>e+t.time),0);return Math.round(t/e.length)}handleGroupMarkerClick(e){const{markers:t}=this.api.getViewConfiguration();if(!t.groupZoomEnabled)return;const n=this.findMarkersInGroup(e);if(n.length<=1)return;const{start:r,end:i}=this.calculateGroupInterval(n);this.api.setRange(r,i),this.api.emit("on-group-marker-click",{groupMarker:e,originalMarkers:n,newInterval:{start:r,end:i}})}findMarkersInGroup(e){const{markers:t}=this.api.getViewConfiguration(),n=t.collapseMinDistance;if(!n||n<=0)return[e];const r=e.time,i=this.api.timeToPosition(r);return[...this._sortedMarkers,...this._collapsedMarkers].filter((e=>{if(e.group)return!1;const t=this.api.timeToPosition(e.time);return Math.abs(t-i)<=n}))}calculateGroupInterval(e){const{markers:t}=this.api.getViewConfiguration(),{start:n,end:r}=this.api.getInterval(),i=r-n,s=e.map((e=>e.time)),a=Math.min(...s),o=Math.max(...s),l=o-a,c=Math.max(l*t.groupZoomPadding,1e3);let u=a-c,d=o+c;const p=d-u,h=t.groupZoomMaxFactor;if(p>i*h){const e=(a+o)/2,t=i*h/2;u=e-t,d=e+t}return{start:Math.round(u),end:Math.round(d)}}}class Xc{constructor(e){this.eventEmitter=new EventTarget,this.state=oc.INIT,this.viewConfiguration=this.getViewConfig(e.viewConfiguration),this.settings=e.settings}init(e){if(!(e&&e instanceof HTMLCanvasElement))throw new Error("Invalid canvas element provided to Timeline.init()");this.state===oc.INIT&&(this.canvas=e,this.canvasScrollTop=0,this.api=new Fc(this),this.initComponents(),this.api.setAxes(this.settings.axes),this.api.setEvents(this.settings.events),this.api.setMarkers(this.settings.markers||[]),this.api.setSelectedEvents(this.settings.selectedEventIds||[]),this.controller=new Wc(this.api),this.state=oc.READY)}destroy(){this.controller.destroy(),this.api&&this.api.destroy()}on(e,t,n){this.eventEmitter.addEventListener(e,t,n)}off(e,t,n){this.eventEmitter.removeEventListener(e,t,n)}emit(e,t){const n=new CustomEvent(e,{detail:t,bubbles:!1,cancelable:!0});return this.eventEmitter.dispatchEvent(n),n}getViewConfig(e){return e?{ruler:{...Bc.ruler,...e.ruler},grid:{...Bc.grid,...e.grid},axes:{...Bc.axes,...e.axes},markers:{...Bc.markers,...e.markers},events:{...Bc.events,...e.events},camera:{...Bc.camera,...e.camera},hideRuler:void 0===e.hideRuler?Bc.hideRuler:e.hideRuler}:Bc}initComponents(){this.api.addComponent(sc.Grid,new Sc(this.api)),this.api.addComponent(sc.Axes,new gc(this.api)),this.api.addComponent(sc.Events,new Ic(this.api)),this.viewConfiguration.hideRuler||this.api.addComponent(sc.Ruler,new _c(this.api)),this.api.addComponent(sc.Markers,new qc(this.api))}}var Kc=n(53246),Gc=n(89648),Zc=n(63082),Qc=function(e,t){return t&&"running"===e.toLowerCase()&&"running"!==t.toLowerCase()?"running-prev":e},eu=["completed","failed","aborted"],tu=function(e){return-1!==eu.indexOf(e)},nu=(0,i.A)("yt-events-table"),ru=function(e){var t=e.state,n=e.phase;return(0,Ft.jsxs)("div",{className:nu("row",{state:Qc(t,n)}),children:[ue.A.format.ReadableField(t),": ",ue.A.format.ReadableField(n)]})},iu=function(e){return ue.A.format.DateTime(new Date(e).toString())},su=function(e){var t=e.events,n=(0,r.useMemo)((function(){return t.reduce((function(e,t){var n=t.endTime-t.startTime,r=tu(t.state);return e.push({phase:(0,Ft.jsx)(ru,{state:t.state,phase:"—"}),duration:r?ue.A.format.NO_VALUE:ue.A.format.TimeDuration(n,{format:"milliseconds"}),startTime:iu(t.startTime)}),t.phases.forEach((function(n,i){var s=t.phases[i+1],a=(s?s.startTime:t.endTime)-n.startTime;e.push({phase:(0,Ft.jsx)(ru,{state:t.state,phase:n.phase}),duration:r?ue.A.format.NO_VALUE:ue.A.format.TimeDuration(a,{format:"milliseconds"}),startTime:iu(n.startTime)})})),e}),[])}),[t]);return(0,Ft.jsx)(Zc.X,{className:nu(),width:"max",columns:[{id:"phase",name:"State: Phase"},{id:"duration",name:"Duration"},{id:"startTime",name:"Start time"}],data:n})},au=n(25820),ou=n.n(au),lu=n(69461),cu=n.n(lu);Ql().extend(cu()),Ql().extend(ou());var uu=(0,i.A)("yt-event-timeline-meta"),du=function(e){var t=e.title,n=e.value,r=e.showCopy;return(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)(Gc.E,{color:"secondary",children:t}),(0,Ft.jsxs)(gi.s,{alignItems:"flex-start",gap:1,children:[(0,Ft.jsx)("span",{children:n}),r&&(0,Ft.jsx)(nn.A,{className:uu("copy-button"),view:"flat-secondary",text:n,size:"s"})]})]})},pu=function(e){var t,n=e.meta,r=e.showCopyButton,i=e.className;if(n.endTime&&n.startTime){var s=Ql()(n.startTime),a=Ql()(n.endTime).diff(s);t=Ql().duration(a)}return(0,Ft.jsxs)("div",{className:uu(null,i),children:[n.allocationId&&(0,Ft.jsx)(du,{title:"Allocation id",value:n.allocationId,showCopy:r}),n.incarnation&&(0,Ft.jsx)(du,{title:"Incarnation id",value:n.incarnation,showCopy:r}),(0,Ft.jsx)(du,{title:"Address",value:ue.A.format.Address(n.address),showCopy:r}),(0,Ft.jsx)(du,{title:"Start",value:ue.A.format.DateTime(n.startTime),showCopy:r}),(0,Ft.jsx)(du,{title:"End",value:n.endTime?ue.A.format.DateTime(n.endTime):"—",showCopy:r}),t&&(0,Ft.jsx)(du,{title:"Duration",value:ue.A.format.TimeDuration(t.asMilliseconds()),showCopy:r})]})},hu=(0,i.A)("yt-side-panel-empty"),mu=function(){return(0,Ft.jsx)(gi.s,{className:hu(),alignItems:"center",justifyContent:"center",children:(0,Ft.jsx)(bl.R,{className:hu("message"),hint:"Select job for more details"})})},fu=(0,i.A)("yt-events-side-panel"),vu=function(){var e=(0,c.wA)(),t=(0,r.useRef)(null),n=(0,c.d4)(Jl),i=(0,c.d4)(Xl),s=(0,c.d4)(Ue.dB),a=(0,c.d4)(Je.Bq),o=(0,r.useCallback)((function(r){if(n&&t.current&&!t.current.contains(r.target)){var i=r.target,s=i.closest(".yt-operation-timeline"),a=i.closest(".gutter"),o=i.closest(".yt-timeline-header");s||a||o||e((0,Gl.DR)(""))}}),[e,n]);return(0,r.useEffect)((function(){return document.addEventListener("click",o),function(){document.removeEventListener("click",o)}}),[o]),n&&i?(0,Ft.jsxs)("div",{ref:t,className:fu(),children:[(0,Ft.jsx)(gi.s,{alignItems:"center",justifyContent:"space-between",children:(0,Ft.jsx)(gi.s,{alignItems:"center",justifyContent:"center",gap:1,children:(0,Ft.jsxs)(Gc.E,{variant:"subheader-3",children:["Job id"," ",(0,Ft.jsx)(x.A,{theme:"primary",url:"/".concat(s,"/job/").concat(a,"/").concat(n),target:"_blank",children:n})]})})}),(0,Ft.jsx)(pu,{className:fu("meta"),meta:{startTime:i.start_time,endTime:i.finish_time,address:i.address,allocationId:i.allocationId,incarnation:i.incarnation},showCopyButton:!0}),(0,Ft.jsx)("div",{className:fu("separator")}),(0,Ft.jsx)(su,{events:i.events})]}):(0,Ft.jsx)(mu,{})},gu=function(e){return e.Selected="selected",e.SelectedFound="selectedFound",e.Found="found",e.FoundIncarnation="foundIncarnation",e.Transparent="transparent",e.Default="default",e}({}),bu=function(e,t){if(t<0||t>1)throw new Error("Opacity must be between 0 and 1");var n=0,r=0,i=0,s=t,a=e.replace(/\s+/g,"").toLowerCase();if(a.startsWith("#")){var o=a.substring(1);if(3===o.length)n=parseInt(o[0]+o[0],16),r=parseInt(o[1]+o[1],16),i=parseInt(o[2]+o[2],16);else{if(6!==o.length)throw new Error("Invalid HEX color format");n=parseInt(o.substring(0,2),16),r=parseInt(o.substring(2,4),16),i=parseInt(o.substring(4,6),16)}}else{if(!a.startsWith("rgb(")&&!a.startsWith("rgba("))throw new Error("Unsupported color format");var l=a.match(/rgba?\((\d+),(\d+),(\d+)(?:,([\d.]+))?\)/i);if(!l)throw new Error("Invalid RGB/RGBA color format");n=parseInt(l[1],10),r=parseInt(l[2],10),i=parseInt(l[3],10),l[4]&&(s=parseFloat(l[4])*t)}if([n,r,i].some((function(e){return e<0||e>255})))throw new Error("Invalid color values (must be 0-255)");return"rgba(".concat(n,", ").concat(r,", ").concat(i,", ").concat(s,")")},Au=n(60150),xu="#333",yu=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(e,t,n,r,i,s,a,o,l){var c=t.displayMode,u=t.parts,d=s-a/2,p=this.getFixedXCoordinates(r,i),h=p.x1,m=p.x0,f=c===gu.Transparent,v=(h-m)/100;c===gu.Found&&this.renderFilterBackground(e,m,h,d,a),c===gu.FoundIncarnation&&this.renderIncarnationBackground(e,m,h,d,a);var g=m;u.forEach((function(t){var n=t.color,r=t.percentage,i=t.state,s=t.phases,o=t.interval,c=Math.max(0,Math.min(r*v,h-g));if("running"===i.toLowerCase())for(var u=s.length,p=0;p<u;p++){var b=l(s[p].startTime),A=l(p===u-1?o.to:s[p+1].startTime),x=Math.max(m,Math.min(h,b)),y=Math.max(x,Math.min(h,A))-x;if(y>0){var j,w="running"===(null===(j=s[p].phase)||void 0===j?void 0:j.toLowerCase())?n:(0,Au.LB)("--purple-color");e.beginPath(),e.fillStyle=bu(w||xu,f?.4:.7),e.rect(x,d,y,a),e.fill()}}else c>0&&(e.beginPath(),e.fillStyle=bu(n||xu,f?.4:.7),e.rect(g,d,c,a),e.fill());g+=c})),e.beginPath(),e.moveTo(m,d),e.lineTo(m+8,d+a/2),e.lineTo(m,d+a),e.closePath(),e.fillStyle="rgba(0, 0, 0, 0.25)",e.fill(),e.beginPath(),e.moveTo(h,d),e.lineTo(h-8,d+a/2),e.lineTo(h,d+a),e.closePath(),e.fillStyle="rgba(0, 0, 0, 0.25)",e.fill(),n&&this.renderSelectedBorder(e,m,h,d,a,c)}},{key:"renderFilterBackground",value:function(e,t,n,r,i){this.renderBackground(e,t,n,r,i,"rgba(255, 219, 77)")}},{key:"renderIncarnationBackground",value:function(e,t,n,r,i){this.renderBackground(e,t,n,r,i,"rgb(244,94,2)")}},{key:"renderSelectedBorder",value:function(e,t,n,r,i,s){var a=(0,Au.LB)("--g-color-line-brand"),o=(0,Au.LB)("--g-color-base-background"),l=t+1,c=n-t-2,u=r-2,d=i+4;e.beginPath(),e.rect(l,u,c,d),e.strokeStyle=a,e.lineWidth=2,e.stroke();var p=l+1,h=r-1,m=c-2,f=i+2;e.beginPath(),e.rect(p,h,m,f),e.strokeStyle=s===gu.SelectedFound?"rgba(255, 219, 77)":o,e.lineWidth=1,e.stroke()}},{key:"getHitbox",value:function(e,t,n){var r=this.getFixedXCoordinates(t,n),i=r.x0,s=r.x1;return this.hitboxResult.left=i,this.hitboxResult.right=s,this.hitboxResult}},{key:"getFixedXCoordinates",value:function(e,t){return t-e<8?{x0:e,x1:e+8}:{x0:e,x1:t}}},{key:"renderBackground",value:function(e,t,n,r,i,s){e.beginPath(),e.rect(t-2,r-2,n-t+4,i+4),e.fillStyle=s,e.fill()}}])}(Pc),ju=(0,i.A)("yt-event-timeline-tooltip-content-row"),wu=function(e){var t=e.state,n=e.phase,r=e.duration,i=tu(t);return(0,Ft.jsxs)(gi.s,{justifyContent:"space-between",gap:2,className:ju(),children:[(0,Ft.jsxs)("div",{className:ju("title",{state:Qc(t,n)}),children:[ue.A.format.ReadableField(t),":"," ",n?ue.A.format.ReadableField(n):(0,Ft.jsx)(Ft.Fragment,{children:"—"})]}),(0,Ft.jsx)("div",{children:i?ue.A.format.NO_VALUE:ue.A.format.TimeDuration(r,{format:"milliseconds"})})]})},ku=(0,i.A)("yt-event-timeline-tooltip-content"),_u=function(e){var t=e.event,n=t.parts,i=t.jobId,s=t.meta,a=(0,r.useMemo)((function(){return n?n.reduce((function(e,t){var n=t.state,r=t.phases,i=t.interval,s=i.to-i.from,a=r.reduce((function(e,t,r,s){var a=t.phase,o=t.startTime,l=s[r+1],c=(l?l.startTime:i.to)-o;return e.push((0,Ft.jsx)(wu,{phase:a,state:n,duration:c},"text_".concat(a,"_").concat(o))),e}),[]);return[].concat((0,ve.A)(e),[(0,Ft.jsx)(wu,{state:n,duration:s},"text_all_"+s)],(0,ve.A)(a))}),[]):[]}),[n]);return a.length?(0,Ft.jsxs)(gi.s,{direction:"column",gap:3,className:ku(),children:[(0,Ft.jsxs)(Gc.E,{variant:"subheader-2",children:["Job id ",i]}),(0,Ft.jsx)(pu,{meta:s}),(0,Ft.jsx)(gi.s,{direction:"column",gap:1,className:ku("phases"),children:a})]}):null};const Cu=({timeline:e,className:t})=>{const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>(e.init(n.current),()=>{e.destroy()})),[e]),r.createElement("canvas",{ref:n,className:t,tabIndex:0,style:{position:"relative",height:"100%",width:"100%"}})};function Su(e,t,n){const i=(0,r.useCallback)((e=>{n(e.detail,e)}),[n]);(0,r.useLayoutEffect)((()=>{e&&e.on(t,i)}),[e,t,i])}var Tu=n(51188),Nu=(0,i.A)("yt-timeline-group-collapse"),Eu=function(e){var t=e.children,n=e.title,r=e.open,i=void 0===r||r,s=(0,Lo.A)(i),o=(0,a.A)(s,2),l=o[0],c=o[1];return(0,Ft.jsxs)("div",{className:Nu(),children:[(0,Ft.jsxs)(gi.s,{alignItems:"center",gap:2,onClick:c,className:Nu("head"),children:[(0,Ft.jsx)(Xi.I,{data:Tu.A,className:Nu("icon",{open:l})}),n]}),l&&(0,Ft.jsx)("div",{className:Nu("content"),children:t})]})},Pu=function(e){var t=e.timeline,n=e.content,i=e.parentRef,s=e.delay,o=void 0===s?400:s,l=(0,r.useRef)(null),c=(0,r.useState)(void 0),u=(0,a.A)(c,2),d=u[0],p=u[1],h=(0,r.useState)(!1),m=(0,a.A)(h,2),f=m[0],v=m[1],g=(0,r.useRef)();(0,r.useEffect)((function(){return function(){g.current&&clearTimeout(g.current)}}),[]);var b=(0,r.useCallback)((function(e){var n=e.events;g.current&&clearTimeout(g.current);var r=n.find((function(e){return"jobId"in e}));if(r){var i=t.api.getEventPosition(r);p({event:r,position:i}),g.current=setTimeout((function(){v(!0)}),o)}}),[o,t.api]),A=(0,r.useCallback)((function(){g.current&&clearTimeout(g.current),v(!1),p(void 0)}),[]),x=(0,r.useCallback)((function(e){i&&i.current&&i.current.contains(e.target)||A()}),[A,i]);return(0,r.useEffect)((function(){return document.addEventListener("mouseleave",x),function(){document.removeEventListener("mouseleave",x)}}),[x,i]),Su(t,"on-hover",b),Su(t,"on-leave",A),Su(t,"on-camera-change",A),d?(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)("div",{ref:l,style:{position:"absolute",top:d.position.y0-d.position.h/2,left:d.position.x0,width:d.position.x1-d.position.x0,height:d.position.h,zIndex:1,pointerEvents:"none"}}),(0,Ft.jsx)(Oo.z,{anchorRef:l,open:f,onMouseLeave:A,onOutsideClick:A,children:n(d.event)},d.event.id)]}):null},Ru=n(27559),Iu=(0,i.A)("yt-events-block"),Mu=function(e){var t=e.children,n=e.collapse;return n?(0,Ft.jsx)(Eu,(0,l.A)((0,l.A)({},n),{},{children:t})):(0,Ft.jsx)(r.Fragment,{children:t})},Ou=function(e){var t=e.className,n=e.listItems,i=e.timeline,s=e.selectedJob,a=e.rowHeight,o=e.topPadding,l=e.tooltip,c=e.onTimelineClick,u=e.onMarkerClick,d=e.onCameraChange,p=(0,r.useRef)(null),h=(0,r.useRef)(null);(0,r.useEffect)((function(){var e=i.api.getSelectedEvents();s||0===e.length||i.api.setSelectedEvents([])}),[s,i.api]);var m=(0,r.useCallback)((function(){p.current&&i.api.setCanvasScrollTop(p.current.scrollTop)}),[i.api]);return Su(i,"on-camera-change",d),Su(i,"on-select-change",c),Su(i,"on-marker-select-change",u),(0,Ft.jsx)(Mu,{children:(0,Ft.jsxs)(gi.s,{className:Iu(null,t),style:{height:"".concat(Math.min(n.length,25)*a+o,"px")},children:[(0,Ft.jsx)(Ru.w,{className:Iu("list"),items:n,itemHeight:a,scrollRef:p,renderItem:function(e){return(0,Ft.jsx)(gi.s,{className:Iu("list-item"),alignItems:"center",justifyItems:"center",children:(0,Ft.jsx)("div",{className:Iu("list-item-content"),children:e})})},onWrapperScroll:m}),(0,Ft.jsxs)("div",{ref:h,className:Iu("timeline"),children:[(0,Ft.jsx)(Cu,{timeline:i}),(0,Ft.jsx)(Pu,{timeline:i,content:l})]})]})})},zu=function(e){return e.groupName+"_"+e.cookieId.toString()},Lu=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(e){var t=e.ctx,n=e.isSelected,r=e.isHovered,i=e.marker,s=e.markerPosition,a=e.viewConfiguration,o=e.lastRenderedLabelPosition,l=e.getLabelSize,c=a.markers,u=r?i.hoverColor:i.color;i.group&&(u=(r?null==c?void 0:c.groupColorHover:null==c?void 0:c.groupColor)||i.color),n&&(u=i.activeColor),t.strokeStyle=u,t.lineWidth=i.lineWidth||1,i.group?t.setLineDash([5,3]):t.setLineDash([]),t.beginPath(),t.moveTo(s,0),t.lineTo(s,t.canvas.height),t.stroke(),i.label&&(r||n||i.group)&&this.renderLabel(t,u,i,s,a.markers,o,l)}},{key:"renderLabel",value:function(e,t,n,r,i,s,a){var o=a(n.label),l=o.width,c=o.height,u=l+8,d=c+8,p=fc(r-u/2,0,Math.min(e.canvas.width,s.top)-u);e.font=(null==i?void 0:i.font)||"10px sans-serif",e.fillStyle=t,e.roundRect(p,0,u,d,4),e.fill(),e.fillStyle=n.labelColor||"#333",e.fillText(n.label,p+4,c+4)}}])}($c),Vu=function(e){switch(e){case"waiting":return(0,Au.LB)("--default-color");case"running":return(0,Au.LB)("--info-color");case"aborting":case"aborted":return(0,Au.LB)("--g-color-base-misc-heavy");case"completed":return(0,Au.LB)("--success-color");case"failed":return(0,Au.LB)("--danger-color");case"lost":return(0,Au.LB)("--warning-color");default:return(0,Au.LB)("--g-progress-filled-background-color")}},Bu=function(e){function t(){return(0,ye.A)(this,t),(0,be.A)(this,t,arguments)}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"render",value:function(e,t,n,r,i,s,a){var o=2*a,l=s-o/2;e.beginPath(),e.fillStyle="rgba(107, 132, 153, 0.3)",e.rect(r,l,i-r,o),e.fill()}},{key:"getHitbox",value:function(e,t,n){var r=this.getFixedXCoordinates(t,n),i=r.x0,s=r.x1;return this.hitboxResult.left=i,this.hitboxResult.right=s,this.hitboxResult}},{key:"getFixedXCoordinates",value:function(e,t){return t-e<8?{x0:e,x1:e+8}:{x0:e,x1:t}}}])}(Pc),Fu=function(e){var t=e.jobId,n=e.filter,r=void 0===n?"":n,i=e.selectedJob,s=void 0===i?[]:i,a=e.selectedByIncarnation;if(void 0!==a&&a)return gu.FoundIncarnation;var o=Boolean(r),l=s&&Boolean(s[0]),c=o&&t.includes(r),u=s[0]===t;return c&&u?gu.SelectedFound:c?gu.Found:u?gu.Selected:o||l?gu.Transparent:gu.Default},Du="main",Ju=n(53364),Hu=(0,i.A)("yt-operation-timeline"),Uu=(0,Ju.A)(r.Fragment),Wu=function(){var e=(0,c.wA)(),t=(0,c.d4)(ql),n=(0,c.d4)(Fl),i=(0,c.d4)(Jl),s=(0,c.d4)(Hl),o=(0,c.d4)(Dl),l=(0,r.useMemo)((function(){var e=t.reduce((function(e,t){return e.add(ue.A.format.ReadableField(zu(t))),e}),new Set);return Array.from(e)}),[t]),u=(0,r.useMemo)((function(){return new Xc({settings:{start:0,end:0,axes:[],events:[],markers:[],selectedEventIds:[],markerDeselectionMode:cc.ON_MARKER_CLICK_ONLY,clickEventsCollectionFilter:function(e){return e.filter((function(e){return e.renderer instanceof yu})).splice(0,1)},clickMarkerCollectionFilter:function(e){var t=e.find((function(e){return"group"in e}));return t?[t]:e.splice(0,1)}},viewConfiguration:{axes:{trackHeight:30,lineHeight:12},markers:{collapseMinDistance:10},hideRuler:!0}})}),[]),d=(0,r.useCallback)((function(t){var n=t.events;if(n.length){var r=n.find((function(e){return e.renderer instanceof yu}));r&&e((0,Gl.DR)(r.id))}else e((0,Gl.DR)(""))}),[e]),p=(0,r.useCallback)((function(t){var n=t.markers;n.length&&!("group"in n[0])?e((0,Gl.C9)(n[0].incarnationId)):e((0,Gl.C9)(""))}),[e]),h=(0,r.useCallback)((function(t){e((0,Gl.yb)(t))}),[e]),m=(0,r.useCallback)((function(e){return e&&"jobId"in e?(0,Ft.jsx)(_u,{event:e}):null}),[]);return(0,r.useEffect)((function(){e((0,Kc.Po)("JobsTimeline"))}),[e]),(0,r.useEffect)((function(){u.api&&(u.api.setAxes(function(e,t,n){var r,i=new Set,s=(0,B.A)(e);try{for(s.s();!(r=s.n()).done;){var a=r.value;a.allocationId&&i.add(zu(a))}}catch(e){s.e(e)}finally{s.f()}return[{id:"main",tracksCount:i.size,top:15,height:12}]}(t)),u.api.setMarkers(function(e){var t=new Map;return e.forEach((function(e){var n=e.incarnation,r=e.events;if(n&&r.length){var i=t.get(n),s=r[0].startTime;if(i){var a=Math.min(i,s);t.set(n,a)}else t.set(n,s)}})),Array.from(t.entries()).map((function(e){var t=(0,a.A)(e,2),n=t[0];return{time:t[1],color:"rgba(143, 82, 204, 0.8)",hoverColor:"rgb(254, 127, 45)",activeColor:"rgb(254, 127, 45)",labelBackgroundColor:"rgba(143, 82, 204)",label:n,incarnationId:n,lineWidth:2,renderer:new Lu}}))}(t)))}),[t,u]),(0,r.useEffect)((function(){u.api&&u.api.setEvents(function(e){var t,n=e.jobs,r=e.selectedJob,i=void 0===r?[]:r,s=e.selectedIncarnation,o=void 0===s?"":s,l=e.filter,c=void 0===l?"":l,u=new Map,d=new Set,p=(0,B.A)(n);try{for(p.s();!(t=p.n()).done;){var h=t.value;if(h.allocationId){var m=h.events[0],f=h.events[h.events.length-1],v=m.startTime,g=f.endTime,b=zu(h);d.add(b);var A=u.get(h.allocationId);A?(A.from=Math.min(A.from,v),A.to=Math.max(A.to,g)):u.set(h.allocationId,{from:v,to:g,trackId:b})}}}catch(e){p.e(e)}finally{p.f()}var x,y=Array.from(d),j=Array.from(u.entries()).map((function(e){var t=(0,a.A)(e,2),n=t[0],r=t[1];return{id:n,axisId:Du,trackIndex:y.indexOf(r.trackId),from:r.from,to:r.to,renderer:new Bu,allocationId:n}})),w=[],k=(0,B.A)(n);try{for(k.s();!(x=k.n()).done;){var _=x.value,C=zu(_),S=_.events,T=S[0],N=S[S.length-1],E=S.map((function(e){return{percentage:e.percent,color:Vu(e.state),state:e.state,interval:{from:e.startTime,to:e.endTime},phases:e.phases}})),P=Fu({jobId:_.id,filter:c,selectedJob:i,selectedByIncarnation:o===_.incarnation});w.push({id:_.id,axisId:Du,trackIndex:y.indexOf(C),from:T.startTime,to:N.endTime,renderer:new yu,jobId:_.id,parts:E,displayMode:P,meta:{startTime:_.start_time,endTime:_.finish_time,address:_.address,allocationId:_.allocationId,incarnation:_.incarnation}})}}catch(e){k.e(e)}finally{k.f()}return[].concat((0,ve.A)(j),w)}({jobs:t,filter:o,selectedIncarnation:s,selectedJob:i?[i]:[]}))}),[t,o,i,s,u]),(0,r.useEffect)((function(){u.api&&n&&u.api.setRange(n.from||0,n.to||0)}),[n,u]),(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)("div",{className:Hu("wrap"),children:(0,Ft.jsx)(Ou,{className:Hu("block"),timeline:u,listItems:l,selectedJob:i,rowHeight:30,topPadding:15,tooltip:m,onCameraChange:h,onTimelineClick:d,onMarkerClick:p})}),(0,Ft.jsx)(Uu,{children:(0,Ft.jsx)(vu,{})})]})},$u=(0,i.A)("yt-jobs-timeline"),Yu=function(){var e=(0,c.wA)(),t=(0,r.useRef)(!0),n=(0,c.d4)($l),i=(0,c.d4)(Ul),s=(0,c.d4)(Yl),a=(0,c.d4)(Bl),o=(0,c.d4)(Fl),l=(0,c.d4)(Wl),u=(0,r.useCallback)((0,C.A)((0,_.A)().mark((function n(){return(0,_.A)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e(tc(t.current));case 2:t.current=!1;case 3:case"end":return n.stop()}}),n)}))),[e]);return(0,dl.Tt)(u),l?(0,Ft.jsx)(b.z,{error:l}):i?(0,Ft.jsx)(Ll.F,{theme:"info",message:"Too many jobs to display. Max number ".concat(1e4)}):s?(0,Ft.jsx)(Ll.F,{theme:"info",message:"No jobs to display"}):a?(0,Ft.jsx)(gi.s,{justifyContent:"center",children:(0,Ft.jsx)(Hr.a,{})}):o&&n?(0,Ft.jsx)(Sa.Ay,{toolbar:(0,Ft.jsx)(dc,{}),content:(0,Ft.jsx)(Wu,{}),className:$u(),padding:"skip-horizontal"}):null},qu=n(53263),Xu=(0,i.A)("operation-detail"),Ku=(0,i.A)("elements-heading");function Gu(e){var t=e.operationId,n=(0,c.wA)(),i=r.useCallback((function(){n(qe(t))}),[n,t]);return(0,dl.Tt)(i,{timeout:15e3}),null}function Zu(e){var t=e.type;return(0,Ft.jsx)(cn.m,{content:"jobs"===t?"Operation scheduling has started, but not all jobs have been scheduled yet. If the problem persists, contact cluster administrators.":"Not enough resources to start operation scheduling. This may happen if the pool has too many operations in the queue or too low resource guarantees.",children:(0,Ft.jsx)(Gt.A,{state:"running",iconState:"running",text:"Waiting for ".concat(t),renderPlaque:!0})})}var Qu=function(e){function t(){var e;(0,ye.A)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=(0,be.A)(this,t,[].concat(r))).handlePoolsEditClick=function(){var t=e.props,n=t.operation;(0,t.showEditPoolsWeightsModal)(n)},e.renderAction=function(t){var n=e.props,r=n.promptAction,i=n.operation,s=t.message||(0,Ft.jsxs)("span",{children:["Are you sure you want to ",(0,Ft.jsx)("strong",{children:t.name})," the operation?"]}),a=function(n){var r=n.currentOption;return(0,Me.wF)((0,l.A)((0,l.A)({},t),{},{operation:i,currentOption:r})).then((function(){return e.props.getOperation(i.$value)}))};return(0,Ft.jsxs)(an.A,{view:t.theme,className:Xu("action"),title:ue.A.format.ReadableField(t.name),onClick:function(){return r((0,l.A)((0,l.A)({},t),{},{message:s,handler:a}))},children:[(0,Ft.jsx)(on.A,{awesome:t.icon})," ",ue.A.format.ReadableField(t.name)]},t.name)},e.onProgressLinkClick=function(t){(0,e.props.updateListJobsFilter)({name:"state",value:t})},e}return(0,Ae.A)(t,e),(0,je.A)(t,[{key:"settings",get:function(){return Xt.A.prepareSettings()}},{key:"componentDidMount",value:function(){var e=this.props.match.params.operationId;this.props.listOperationEvents(e)}},{key:"renderHeader",value:function(){var e=this.props,t=e.actions,n=void 0===t?[]:t,r=e.runtime,i=e.operation,s=e.isGpuOperation,a=i.type,o=i.user,c=void 0===o?"":o,u=i.state,d=i.suspended,p=i.pools,h=i.title,m=i.$value,f=function(e,t,n,r,i,s){var a,o,l,c=null==r||null===(a=r[0])||void 0===a||null===(a=a.progress)||void 0===a?void 0:a.fair_share_ratio,u=null==r||null===(o=r[0])||void 0===o||null===(o=o.progress)||void 0===o?void 0:o.usage_ratio,d=null==r||null===(l=r[0])||void 0===l||null===(l=l.progress)||void 0===l?void 0:l.demand_ratio,p=1===new Set(null==e?void 0:e.map((function(e){return null==e?void 0:e.tree}))).size,h="vanilla"===i&&p&&"running"===t&&s&&!n;return{isWaitingForResources:h&&c===u&&0===c,isWaitingForJobs:h&&c===d&&void 0!==u&&void 0!==c&&u<c}}(p,u,d,r,a,s),v=f.isWaitingForJobs,g=f.isWaitingForResources,b=v||g?{state:"unknown",iconState:"running",text:"Running"}:{label:d?"suspended":u};return(0,Ft.jsxs)("div",{className:Xu("header","elements-section"),children:[(0,Ft.jsxs)("div",{className:Xu("header-heading",Ku({size:"l"})),children:[ue.A.format.ReadableField(a)," operation by ",(0,Ft.jsx)(sn.R,{name:c})," ",(0,Ft.jsx)(Gt.A,(0,l.A)((0,l.A)({},b),{},{renderPlaque:!0}))," ",v&&(0,Ft.jsx)(Zu,{type:"jobs"}),g&&(0,Ft.jsx)(Zu,{type:"resources"})]}),(0,Ft.jsx)("div",{className:Xu("header-title"),children:(0,Ft.jsx)(y.A,{value:h||m,settings:this.props.ysonSettings,inline:!0})}),(0,Ft.jsx)("div",{className:Xu("actions"),children:n.map(this.renderAction)})]})}},{key:"renderOverview",value:function(){var e=this.props,t=e.operation,n=e.cluster,r=e.totalJobWallTime,i=e.cpuTimeSpent,s=e.erasedTrees,a=e.isGpuOperation,o=t.$value,l=t.user,c=void 0===l?"":l,u=t.type,d=t.startTime,p=t.finishTime,h=t.duration,m=t.pools,f=t.state,v=a&&"vanilla"===u,g=[[{key:"id",value:(0,Ft.jsx)(tn.Bj.Id,{id:o})},{key:"user",value:(0,Ft.jsx)(sn.R,{name:c})},{key:"pools",value:(0,Ft.jsx)(tn.CD,{onEdit:this.handlePoolsEditClick,cluster:n,pools:m,operationRefId:o,state:f,erasedTrees:s,editBtnVisibility:"always"})},{key:"type",value:(0,Ft.jsx)(tn.Bj.Readable,{value:u})}],[{key:"started",value:(0,Ft.jsx)(tn.Bj.Time,{time:d,valueFormat:"DateTime"})},{key:"finished",value:(0,Ft.jsx)(tn.Bj.Time,{time:p,valueFormat:"DateTime"})},{key:"duration",value:(0,Ft.jsx)(tn.Bj.Time,{time:h,valueFormat:"TimeDuration"})},{key:"total job wall time",value:(0,Ft.jsx)(tn.Bj.Time,{time:r,valueFormat:"TimeDuration"}),visible:!v},{key:"total cpu time spent",value:(0,Ft.jsx)(tn.Bj.Time,{time:i,valueFormat:"TimeDuration"}),visible:!v}]];return(0,Ft.jsxs)("div",{className:Xu("overview"),children:[(0,Ft.jsx)("div",{className:Xu("general"),children:(0,Ft.jsx)(tn.Ay,{items:g})}),(0,Ft.jsxs)("div",{className:Xu("progress-wrapper"),children:[(0,Ft.jsx)(en,{operation:t,onLinkClick:this.onProgressLinkClick}),"failed"!==t.state&&(0,Ft.jsx)(en,{operation:t,type:"failed",onLinkClick:this.onProgressLinkClick})]})]})}},{key:"renderTabs",value:function(){var e=this.props,t=e.match.params,n=t.operationId,r=t.tab,i=e.cluster,s=e.operation,a=e.hasStatististicsTab,c=e.jobsMonitorVisible,u=e.monitorTabVisible,d=e.monitorTabTitle,p=e.monitorTabUrlTemplate,h=e.timelineTabVisible,m=e.operationPerformanceUrlTemplate,f=e.operationEvents,v="/".concat(i,"/").concat(fe.YW.OPERATIONS,"/").concat(n),g=(0,l.A)((0,l.A)({},(0,Me.h9)(s)),{},(0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)({},me.oz.STATISTICS,{show:a}),me.oz.JOBS_MONITOR,{show:c||r===me.oz.JOBS_MONITOR}),me.oz.MONITOR,{show:u}),me.oz.JOBS_TIMELINE,{show:h}),me.oz.INCARNATIONS,{show:Boolean(null==f?void 0:f.length)}),me.oz.PERFORMANCE,{show:Boolean(m),external:!0,url:null==m?void 0:m.url,title:null==m?void 0:m.title,routed:!1}));if(p){var b,A=g[me.oz.MONITOR];A.routed=!1,A.external=!0;var x=(null===(b=s.pools)||void 0===b?void 0:b[0])||{};A.url=(0,Me.tG)((0,l.A)((0,l.A)({cluster:i,operation:s},x),{},{urlTemplate:p}))}var y=(0,Oe._4)(v,me.oz,g,void 0,(0,o.A)({},me.oz.MONITOR,null!=d?d:"Monitoring"));return(0,Ft.jsx)("div",{className:Xu("tabs"),children:(0,Ft.jsx)(Ur.A,(0,l.A)((0,l.A)({},y),{},{active:r,routed:!0,routedPreserveLocation:!0,size:Ai.jr}))})}},{key:"renderMain",value:function(){var e=this.props,t=e.match,n=e.cluster,r=e.monitorTabVisible,i=e.jobsMonitorIsSupported,a=e.monitoringComponent,o=e.timelineTabVisible,l=t.url,c=t.params.operationId,u="/".concat(n,"/").concat(fe.YW.OPERATIONS,"/").concat(c);return Le(c)?(0,Ft.jsx)("div",{className:Xu("main"),children:(0,Ft.jsxs)(s.dO,{children:[(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.ATTRIBUTES),render:function(){return(0,Ft.jsx)(Rl,{className:Xu("attributes")})}}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.DETAILS),component:la}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.SPECIFICATION),component:Ca}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.STATISTICS),render:function(){return(0,Ft.jsx)(Ka,{className:Xu("statistics")})}}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.JOBS),render:function(){return(0,Ft.jsx)(vl,{className:Xu("jobs")})}}),o&&(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.JOBS_TIMELINE),render:function(){return(0,Ft.jsx)(Yu,{})}}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.JOB_SIZES),render:function(){return(0,Ft.jsx)(Ia,{className:Xu("job-sizes")})}}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.PARTITION_SIZES),component:ei}),r&&a&&(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.MONITOR),render:function(){return(0,Ft.jsx)(Ol,{component:a})}}),i&&(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.JOBS_MONITOR),component:El}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/").concat(me.oz.INCARNATIONS),render:J.Ay.renderIncarnationsTab}),(0,Ft.jsx)(s.qh,{path:"".concat(u,"/:tab"),component:Il.A}),(0,Ft.jsx)(s.rd,{from:l,to:"".concat(u,"/").concat(me._N)})]})}):this.renderAlias()}},{key:"renderAlias",value:function(){var e=this.props,t=e.match,n=e.cluster,r=e.operation,i=t.url,a=t.params,o=a.operationId,l=a.tab;if(o!==N.A.getValue(r,"/@spec/alias"))return null;var c="/".concat(n,"/").concat(fe.YW.OPERATIONS,"/").concat(r.$value).concat(l?"/"+l:"");return(0,Ft.jsx)(s.rd,{from:i,to:c})}},{key:"renderContent",value:function(e){return e?(0,Ft.jsx)(Hr.a,{}):(0,Ft.jsxs)(r.Fragment,{children:[this.renderHeader(),this.renderOverview(),this.renderTabs(),this.renderMain()]})}},{key:"renderError",value:function(){var e=this.props.errorData;return(0,Ft.jsx)(b.z,{message:e.message,error:e.details})}},{key:"render",value:function(){var e=this.props,t=e.error,n=e.loading,r=e.loaded,i=e.match.params.operationId,s=n&&!r;return(0,Ft.jsxs)(Jr.A,{children:[(0,Ft.jsx)(Gu,{operationId:i}),(0,Ft.jsx)("div",{className:Xu({loading:s}),children:t&&!r?this.renderError():this.renderContent(s)})]})}}])}(r.Component),ed={promptAction:un.Jm,getOperation:qe,showEditPoolsWeightsModal:Bt,updateListJobsFilter:bo,listOperationEvents:function(e){return qu.vl.endpoints.listOperationEvents.initiate({operation_id:e,event_type:"incarnation_started"})}},td=(0,c.Ng)((function(e,t){var n=e.operations.detail,r=n.operation,i=n.errorData,s=n.loading,a=n.loaded,o=n.error,l=n.actions,c=n.details,u=qs(e),d=Gs(e),p=(0,Je.PG)(e),h=c.runtime,m=t.match.params.operationId,f=(0,qu.dE)(e,{operation_id:m,event_type:"incarnation_started"}).data,v=J.Ay.getMonitoringForOperation(r)||{},g=v.component,b=v.urlTemplate,A=v.title,x=Boolean(g)||Boolean(b);return{cluster:(0,zl.KF)(e),operation:r,errorData:i,loading:s,loaded:a,error:o,actions:l,runtime:h,totalJobWallTime:u,cpuTimeSpent:d,erasedTrees:p,monitorTabVisible:x,monitorTabTitle:A,monitorTabUrlTemplate:b,monitoringComponent:g,timelineTabVisible:"vanilla"===(null==r?void 0:r.type),jobsMonitorIsSupported:Boolean(J.Ay.getMonitorComponentForJob()),jobsMonitorVisible:_l(e),hasStatististicsTab:Us(e),isGpuOperation:(0,Je.dW)(e),operationPerformanceUrlTemplate:(0,Je.JK)(e),operationEvents:f,ysonSettings:(0,mi.LC)(e)}}),ed),nd=td(Qu);function rd(e){var t=(0,c.d4)(Je.Q1);return(0,Ir.v)({type:Tt.c.OPERATION,startDeps:[t],allowStart:function(e){var t=(0,a.A)(e,1)[0];return!(0,ze.RP)(t)}}),(0,Ft.jsx)(nd,(0,l.A)({},e))}var id=(0,i.A)("operations");const sd=(0,s.y)((function(e){var t=e.match,n=e.viewContext!==fe.PB?"elements-main-section":"";return(0,Ft.jsxs)("div",{className:id(null,n),children:[(0,Ft.jsx)($t,{}),(0,Ft.jsxs)(s.dO,{children:[(0,Ft.jsx)(s.qh,{path:t.path,exact:!0,render:function(){return(0,Ft.jsx)(Dr,{})}}),(0,Ft.jsx)(s.qh,{path:"".concat(t.path,"/:operationId/:tab?"),component:rd})]})]})}))},63588:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(29121),i=n(12937),s=n(66134),a=n(10785),o=n(77810),l=n(10720),c=n(8208),u=n(73822),d=n(48971),p=n(64922),h=new l.I,m=function(e){function t(){return(0,r.A)(this,t),(0,s.A)(this,t,arguments)}return(0,a.A)(t,e),(0,i.A)(t,[{key:"componentDidUpdate",value:function(){var e=this.props,t=e.error,n=e.loaded,r=e.errorData;t&&n&&h.add({theme:"danger",name:"network",autoHiding:5e5,title:"Oops! something went wrong.",content:r?r.message:u.A.format.NO_VALUE,actions:[{label:" view",onClick:function(){return(0,d.eW)(r)}}]})}},{key:"render",value:function(){var e=this.props,t=e.alwaysShowError,n=void 0!==t&&t,r=e.error,i=e.errorData,s=e.loaded,a=e.children;return!r||!n&&s?a:(0,p.jsx)(c.z,{error:i})}}])}(o.Component)},69461:function(e){e.exports=function(){"use strict";return function(e,t,n){e=e||{};var r=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,s,a,o){for(var l,c,u,d=s.$locale().relativeTime||i,p=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],h=p.length,m=0;m<h;m+=1){var f=p[m];f.d&&(l=a?n(t).diff(s,f.d,!0):s.diff(t,f.d,!0));var v=(e.rounding||Math.round)(Math.abs(l));if(u=l>0,v<=f.r||!f.r){v<=1&&m>0&&(f=p[m-1]);var g=d[f.l];o&&(v=o(""+v)),c="string"==typeof g?g.replace("%d",v):g(v,r,f.l,u);break}}if(r)return c;var b=u?d.future:d.past;return"function"==typeof b?b(c):b.replace("%s",c)},r.to=function(e,t){return s(e,t,this,!0)},r.from=function(e,t){return s(e,t,this)};var a=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(a(this),e)},r.fromNow=function(e){return this.from(a(this),e)}}}()},70915:(e,t,n)=>{"use strict";n.d(t,{A:()=>c}),n(77810);var r=n(76872),i=n(89648),s=n(88787),a=n(19410),o=n(64922),l=(0,r.A)("yt-warning-icon");function c(e){var t=e.className,n=e.hoverContent,r=e.children,c=e.color;return(0,o.jsx)("span",{className:l(null,t),children:(0,o.jsxs)(a.m,{className:l("tooltip"),content:n,children:[(0,o.jsx)(s.A,{className:l("icon",{color:c}),awesome:"exclamation-triangle"}),r&&(0,o.jsx)(i.E,{variant:"inherit",color:c,children:r})]})})}},70940:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(77810);const i=e=>r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.47 13.03a.75.75 0 0 1 0-1.06L9.44 8 5.47 4.03a.75.75 0 0 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0",clipRule:"evenodd"}))},74069:(e,t,n)=>{"use strict";n.d(t,{BL:()=>u,DG:()=>c,sQ:()=>d,si:()=>l});var r=n(9736),i=n(77810),s=n(15647),a=n(53246),o=n(44611);function l(){var e=(0,s.wA)();i.useEffect((function(){e((0,a.Bg)())}),[e])}function c(){return l(),null}function u(){var e=i.useState(),t=(0,r.A)(e,2),n=t[0],s=t[1];return i.useEffect((function(){(0,o.u)().then((function(e){s(e)}))}),[]),n}function d(e){var t=e.children,n=u();return n?t({defaultPoolTree:n}):null}},79703:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(40319),i=n(64922);const s=function(e){return(0,i.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14M6.44 4.54c.43-.354.994-.565 1.56-.565 1.217 0 2.34.82 2.34 2.14 0 .377-.078.745-.298 1.1-.208.339-.513.614-.875.867-.217.153-.325.257-.379.328-.038.052-.038.07-.038.089a.75.75 0 0 1-1.5 0c0-.794.544-1.286 1.057-1.645.28-.196.4-.332.458-.426a.54.54 0 0 0 .075-.312c0-.3-.244-.641-.84-.641a1 1 0 0 0-.608.223c-.167.138-.231.287-.231.418a.75.75 0 0 1-1.5 0c0-.674.345-1.22.78-1.577M8 12a1 1 0 1 0 0-2 1 1 0 0 0 0 2",clipRule:"evenodd"})}))}},80999:(e,t,n)=>{"use strict";n.d(t,{r:()=>P});var r=n(64922),i=n(77810),s=n(49528),a=n(3564),o=n(6542),l=n(32235);const c=(0,n(21086).om)("dropdown-menu"),u=i.createContext({toggle(){},data:void 0});u.displayName="DropdownMenu.Context";var d=n(56911),p=n(51741),h=n(70940),m=n(84033),f=n(119);function v(e,t,n=1,r){const i=(e.length+t-n%e.length)%e.length;return r&&r(e[i])?v(e,i,1,r):i}function g(e,t,n=1,r){const i=(t+n)%e.length;return r&&r(e[i])?g(e,i,1,r):i}var b=n(73384);const A=[],x=i.createContext({activeMenuPath:A,setActiveMenuPath:()=>{},anchorRef:{current:null}}),y=({anchorRef:e,children:t,disabled:n})=>{const[s,a]=i.useState(A);i.useEffect((()=>{n&&a(A)}),[n]);const o=i.useMemo((()=>({activeMenuPath:s,setActiveMenuPath:a,anchorRef:e})),[s,e]);return(0,r.jsx)(x.Provider,{value:o,children:t})},j={text:"",action:()=>{},path:[]};function w(e){return e===j}function k(e){return e.disabled||w(e)}function _(e){var t;return null!==(t=null==e?void 0:e.join(" "))&&void 0!==t?t:""}const C=({items:e,open:t,anchorRef:n,onClose:s,size:a,menuProps:o,children:l,popupProps:d,path:p=[]})=>{const{toggle:h,data:f}=i.useContext(u),{activeMenuPath:A,setActiveMenuPath:y,anchorRef:j}=i.useContext(x),C=p.length>0,S=i.useCallback((()=>{y(p.slice(0,p.length-1))}),[y,p]),T=i.useCallback((e=>{var t;y(p),null===(t=null==d?void 0:d.onMouseEnter)||void 0===t||t.call(d,e)}),[p,d,y]),E=i.useCallback((e=>{var t;S(),null===(t=null==d?void 0:d.onMouseLeave)||void 0===t||t.call(d,e)}),[S,d]),P=i.useCallback(((e,t)=>{var n;e.items&&e.path?y(e.path):(null===(n=e.action)||void 0===n||n.call(e,t,f),h(!1))}),[f,y,h]),R=i.useCallback(((t,n)=>{switch(n.key){case"Escape":return C&&(n.stopPropagation(),null==S||S()),!1;case"Enter":case" ":{const r=e[t],i=null==r?void 0:r.items;return(C||i)&&(n.stopPropagation(),n.preventDefault()),r&&P(r,n),!1}}return!0}),[S,P,C,e]),I=t&&_(p)===_(A),{activeItemIndex:M,setActiveItemIndex:O,reset:z}=function({items:e,skip:t,pageSize:n,processHomeKey:r=!0,processEndKey:s=!0,anchorRef:a,disabled:o=!1,initialValue:l=-1,onAnchorKeyDown:c}){const[u,d]=i.useState(l),p=i.useCallback((()=>{d(l)}),[l]);return i.useEffect((()=>{e&&p()}),[e,p]),i.useLayoutEffect((()=>{if(o)return;if(!e.some((e=>!(null==t?void 0:t(e)))))return;const i=null==a?void 0:a.current;if(!i)return;const l=i=>{if(!1!==(null==c?void 0:c(u,i)))switch(i.key){case"ArrowDown":i.preventDefault(),d((n=>g(e,n,1,t)));break;case"ArrowUp":i.preventDefault(),d((n=>v(e,n,1,t)));break;case"PageDown":if(!n)return;i.preventDefault(),d((r=>g(e,r,n,t)));break;case"PageUp":if(!n)return;i.preventDefault(),d((r=>v(e,r,n,t)));break;case"Home":if(!r)return;i.preventDefault(),d((n=>v(e,n,n,t)));break;case"End":if(!s)return;i.preventDefault(),d((n=>v(e,n,n+1,t)))}};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}}),[u,a,o,e,c,n,s,r,t]),{activeItemIndex:u,setActiveItemIndex:d,reset:p}}({items:e,skip:k,anchorRef:j,onAnchorKeyDown:R,disabled:!I,initialValue:C?0:-1});return i.useEffect((()=>{t||z()}),[t,z]),(0,r.jsx)(b.z,Object.assign({open:t,anchorRef:n,onClose:s},d,{onMouseEnter:T,onMouseLeave:E,children:l||(0,r.jsx)(m.W,Object.assign({className:c("menu"),size:a},o,{children:e.map(((e,n)=>{var i;const a=I&&M===n,o=t&&!a&&0!==A.length&&_(e.path)===_(A.slice(0,e.path.length)),l=Object.assign(Object.assign({},e.extraProps),{onMouseEnter:()=>O(n)});return(0,r.jsx)(N,Object.assign({className:c("menu-item",{separator:w(e),"active-parent":o,"with-submenu":Boolean(null===(i=e.items)||void 0===i?void 0:i.length)},e.className),selected:a,popupProps:d,closeMenu:s},e,{extraProps:l}),n)}))}))}))};function S(e,t){var n;return null!==(n=null==e?void 0:e.every(((e,n)=>e===(null==t?void 0:t[n]))))&&void 0!==n&&n}function T({items:e,path:t}){const{activeMenuPath:n,setActiveMenuPath:r}=i.useContext(x),s=Boolean(t)&&Boolean(null==e?void 0:e.length),a=i.useCallback((()=>{t&&r(t.slice(0,t.length-1))}),[t,r]),o=i.useCallback((()=>{t&&r(t)}),[t,r]);return{hasSubmenu:s,isSubmenuOpen:S(t,n),openSubmenu:o,closeSubmenu:a}}const N=e=>{var{text:t,action:n,items:s,popupProps:a,closeMenu:o,children:v,path:g}=e,b=(0,d.Tt)(e,["text","action","items","popupProps","closeMenu","children","path"]);const{toggle:A,data:x}=i.useContext(u),y=i.useRef(null),j=(0,f.j)(),{hasSubmenu:w,isSubmenuOpen:k,closeSubmenu:_,openSubmenu:S}=T({items:s,path:g}),N=i.useCallback((()=>{const e=()=>{o?o():A(!1)};w?(_(),requestAnimationFrame(e)):e()}),[o,_,w,A]),E=i.useCallback((e=>{w||(null==n||n(e,x),N())}),[n,x,N,w]),P=i.useMemo((()=>Object.assign(Object.assign({},b.extraProps),{onMouseEnter:e=>{var t,n;null===(n=null===(t=b.extraProps)||void 0===t?void 0:t.onMouseEnter)||void 0===n||n.call(t,e),w&&S()},onMouseLeave:e=>{var t,n;null===(n=null===(t=b.extraProps)||void 0===t?void 0:t.onMouseLeave)||void 0===n||n.call(t,e),w&&_()}})),[b.extraProps,_,w,S]),R=i.useMemo((()=>"rtl"===j?["left-start","right-start"]:["right-start","left-start"]),[j]),I=i.useMemo((()=>w?(0,r.jsx)(l.I,{data:"rtl"===j?p.A:h.A,size:10,className:c("sub-menu-arrow")}):b.iconEnd),[w,j,b.iconEnd]);return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.W.Item,Object.assign({ref:y},b,{extraProps:P,onClick:E,iconEnd:I,children:t||v})),w&&s&&(0,r.jsx)(C,{popupProps:Object.assign(Object.assign({},a),{className:c("sub-menu",null==a?void 0:a.className),placement:R}),items:s,path:g,open:k,anchorRef:y,onClose:N})]})};function E(e,t,n=[],r=0){const i=[];let s=!1,a=r;for(const r of e)if(Array.isArray(r)){const e=E(r,t,n,a);0!==i.length&&i.push(t),i.push(...e),a+=e.length,s=!0}else{if(r.hidden)continue;s&&i.push(t);const e=Object.assign(Object.assign({},r),{path:[...n,a++]});r.items&&(e.items=E(r.items,t,e.path)),i.push(e),s=!1}return i}const P=Object.assign((({items:e=[],size:t="m",icon:n=(0,r.jsx)(l.I,{data:s.A}),open:d,onOpenToggle:p,hideOnScroll:h=!0,data:m,disabled:f,switcher:v,renderSwitcher:g,switcherWrapperClassName:b,defaultSwitcherProps:A,defaultSwitcherClassName:x,onSwitcherClick:w,menuProps:k,popupProps:_,children:S})=>{const T=i.useRef(null),{isPopupShown:N,togglePopup:P,closePopup:R}=function(e,t,n){const[r,s]=function(e,t,n,r=void 0!==e&&void 0!==t){const s=function(e,t){const[n,r]=i.useState(e);return[n,i.useCallback((e=>{"function"==typeof e?r((n=>{const r=e(n);return null==t||t(r),r})):(null==t||t(e),r(e))}),[t])]}(e||n,t);return r?[e,t]:s}(e,t,!1),a=i.useCallback((e=>{s((t=>"boolean"==typeof e?e:!t))}),[s]),o=i.useCallback((()=>{s(!1)}),[s]);return i.useEffect((()=>{n&&r&&o()}),[o,n,r]),{isPopupShown:r,togglePopup:a,closePopup:o}}(d,p,f);!function(e,t,n){i.useEffect((()=>{if(n)return;const r=n=>{n.target.contains(t.current)&&e(n)};return document.addEventListener("scroll",r,!0),()=>{document.removeEventListener("scroll",r,!0)}}),[t,e,n])}(R,T,!N||!h);const I=i.useMemo((()=>({toggle:P,data:m})),[m,P]),M=i.useMemo((()=>E(e,j)),[e]),O=i.useCallback((e=>{f||(null==w||w(e),P())}),[f,w,P]),{onKeyDown:z}=(0,a.N)(O),L=i.useMemo((()=>({onClick:O,onKeyDown:z})),[O,z]);return(0,r.jsxs)(u.Provider,{value:I,children:[(0,r.jsx)("div",Object.assign({ref:T,className:c("switcher-wrapper",b)},g?{}:L,{children:(null==g?void 0:g(L))||v||(0,r.jsx)(o.$,Object.assign({view:"flat",size:t},A,{className:c("switcher-button",x),disabled:f,children:n}))})),(0,r.jsx)(y,{anchorRef:T,disabled:!N,children:(0,r.jsx)(C,{items:M,open:N,size:t,menuProps:k,anchorRef:T,onClose:R,popupProps:_,children:S})})]})}),{Item:N})},84033:(e,t,n)=>{"use strict";n.d(t,{W:()=>m});var r=n(64922),i=n(77810),s=n(21086),a=n(2320);const o=(0,s.om)("menu"),l=i.forwardRef((function({label:e,children:t,style:n,className:i,qa:s},l){const c=(0,a.u)();return(0,r.jsx)("li",{ref:l,className:o("list-group-item"),children:(0,r.jsxs)("div",{style:n,className:o("group",i),"data-qa":s,children:[e&&(0,r.jsx)("div",{id:c,className:o("group-label"),children:e}),(0,r.jsx)("ul",{role:"group","aria-labelledby":c,className:o("group-list"),children:t})]})})}));var c=n(3564),u=n(70883);const d=(0,s.om)("menu"),p=i.forwardRef((function({icon:e,iconStart:t=e,iconEnd:n,title:s,disabled:a,active:o,selected:l,href:p,target:h,rel:m,onClick:f,style:v,className:g,theme:b,extraProps:A,children:x,qa:y},j){const{onKeyDown:w}=(0,c.N)(f),k=i.useCallback((e=>{u.o.publish({componentId:"MenuItem",eventId:"click",domEvent:e})}),[]),_={role:"menuitem",onKeyDown:f&&!a?w:void 0},C={title:s,onClick:a?void 0:f,onClickCapture:a?void 0:k,style:v,tabIndex:a?-1:0,className:d("item",{disabled:a,active:o,selected:l,theme:b,interactive:Boolean(f)||Boolean(p)},g),"data-qa":y},S=[t&&(0,r.jsx)("div",{className:d("item-icon"),children:t},"icon-start"),(0,r.jsx)("div",{className:d("item-content"),children:x},"content"),n&&(0,r.jsx)("div",{className:d("item-icon-end"),children:n},"icon-end")];let T;return T=p?(0,r.jsx)("a",Object.assign({},_,A,C,{href:p,target:h,rel:m,children:S})):(0,r.jsx)("div",Object.assign({},_,A,C,{children:S})),(0,r.jsx)("li",{ref:j,className:d("list-item"),children:T})})),h=(0,s.om)("menu"),m=i.forwardRef((function({size:e="m",children:t,style:n,className:i,qa:s},a){return(0,r.jsx)("ul",{ref:a,role:"menu",style:n,className:h({size:e},i),"data-qa":s,children:t})}));m.Item=p,m.Group=l},88191:(e,t,n)=>{"use strict";n.d(t,{S:()=>l});var r=n(77810),i=n(76872),s=n(64772),a=n(64922),o=(0,i.A)("yt-operation-type");function l(e){var t=e.value,n=r.useMemo((function(){return s.A.ReadableField(t)}),[t]);return(0,a.jsx)("span",{className:o(),children:n})}},95976:(e,t,n)=>{"use strict";n.d(t,{c:()=>a}),n(77810);var r=n(76872),i=n(64922),s=(0,r.A)("yt-color-circle");function a(e){var t=e.color,n=e.marginRight,r=void 0===n||n;return(0,i.jsx)("div",{className:s({"margin-right":r}),style:{backgroundColor:t}})}}}]);
2
+ //# sourceMappingURL=3848.db687afa.chunk.js.map