From 36b261adad8bb2a69612e79b65dcaf0e873d5971 Mon Sep 17 00:00:00 2001 From: geoff-nunan <39071789+geoff-nunan@users.noreply.github.com> Date: Tue, 18 Jan 2022 15:07:39 +1100 Subject: [PATCH] update the version of the LibreEventEditorPanel packaged with the docker-compose file. --- Standalone/docker-compose.yml | 2 +- .../grafana/plugins/libre-event-editor-panel/module.js | 2 +- .../libre-event-editor-panel/module.js.LICENSE.txt | 9 +++++++++ .../grafana/plugins/libre-event-editor-panel/plugin.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Standalone/docker-compose.yml b/Standalone/docker-compose.yml index 69642ff..b5d4f9e 100644 --- a/Standalone/docker-compose.yml +++ b/Standalone/docker-compose.yml @@ -233,7 +233,7 @@ services: condition: service_healthy container_name: libre-edge-agent appsmith: - image: appsmith/appsmith-ce + image: appsmith/appsmith-ce:v1.6.6 container_name: appsmith-ce environment: - APPSMITH_MAIL_ENABLED=true diff --git a/Standalone/grafana/plugins/libre-event-editor-panel/module.js b/Standalone/grafana/plugins/libre-event-editor-panel/module.js index 17332db..8ee9764 100644 --- a/Standalone/grafana/plugins/libre-event-editor-panel/module.js +++ b/Standalone/grafana/plugins/libre-event-editor-panel/module.js @@ -1,3 +1,3 @@ /*! For license information please see module.js.LICENSE.txt */ -define(["react","@grafana/ui","@grafana/data","@grafana/runtime"],(function(e,t,n,a){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=4)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=a},function(e,t,n){"use strict";n.r(t);var a=n(2),r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,r,l=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(a=l.next()).done;)i.push(a.value)}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return i}var i=n(0),o=n.n(i),u=n(3),c=n(1);function s(e){var t=e.startDateTime,n=e.endDateTime,r=e.onAfterChange,u=l(Object(i.useState)(t),2),s=u[0],d=u[1],m=t.valueOf(),f=n.valueOf(),v=Math.floor((f-m)/6e4);return o.a.createElement("div",null,o.a.createElement("h3",null," Split Event by Time "),o.a.createElement("div",null,"Selected Time: ",o.a.createElement("b",null,s&&s.toLocaleString())," "),o.a.createElement("div",null,o.a.createElement(c.Slider,{step:1,value:[0],min:0,max:v,tooltipAlwaysVisible:!0,onChange:function(e){d(Object(a.dateTimeAsMoment)(t).add(e,"minute").toDate())},onAfterChange:function(e){r(s)}})),o.a.createElement(c.HorizontalGroup,null,o.a.createElement("div",null," ","Start Time: ",o.a.createElement("b",null,t.toLocaleString())," "),o.a.createElement("div",null," ","End Time: ",o.a.createElement("b",null,n.toLocaleString()))))}var d=function e(t){var n=t.reasons,a=t.onFinalReasonSelection,r=t.parentReason,u=function(e,t){return void 0===t?e.filter((function(e,t,n){return null===e.parent})):e.filter((function(e,n,a){return e.parent===t.id}))}(n,r),s=l(Object(i.useState)(),2),d=s[0],m=s[1];return u.length<1?(a(r),null):(a(void 0),o.a.createElement(c.VerticalGroup,null,o.a.createElement("div",null,o.a.createElement(c.HorizontalGroup,{spacing:"lg"},n.length>0&&u.map((function(e){return o.a.createElement(c.Button,{key:e.id,variant:e.id!==(null==d?void 0:d.id)?"primary":"destructive",size:"sm",onClick:function(){e===d?(m(void 0),a(void 0)):m(e)}},e.text)})))),o.a.createElement("div",null,d&&o.a.createElement(e,{reasons:n,parentReason:d,onFinalReasonSelection:a}))))};function m(e){var t=e.machineEvent,n=e.equipment,a=e.title,r=e.reasons,u=e.dismissModal,m=e.onAssignReason,f=e.onSplitEvent,v=e.onEditComment,p=l(Object(i.useState)(void 0),2),E=p[0],g=p[1],h=l(Object(i.useState)(void 0),2),y=h[0],T=h[1],M=l(Object(i.useState)(t.comment?t.comment:""),2),b=M[0],S=M[1],D=(null==t?void 0:t.endDateTime)?new Date(t.endDateTime):new Date,C=new Date(t.startDateTime);return o.a.createElement(c.Modal,{isOpen:!!t,title:a,onDismiss:u,onClickBackdrop:u},o.a.createElement("div",null,o.a.createElement("div",null,o.a.createElement("h3",null," Edit Event Comment "),o.a.createElement("div",null,o.a.createElement(c.TextArea,{css:{},invalid:!1,placeholder:"Type your comment here",disabled:!1,value:b,onChange:function(e){return S(e.target.value)}})),o.a.createElement("div",null,o.a.createElement(c.Button,{onClick:function(){return v(n,t,b)}},"Edit Comment"))),o.a.createElement("hr",null),o.a.createElement("div",null,o.a.createElement(c.VerticalGroup,null,o.a.createElement("h3",null," Assign Reason to Event "),o.a.createElement("div",null,o.a.createElement(d,{reasons:r,onFinalReasonSelection:function(e){console.log(E),g(e)}})),o.a.createElement("div",null,E&&o.a.createElement(c.HorizontalGroup,null,o.a.createElement(c.Button,{size:"md",onClick:function(){m(n,t,E)}},"Assign Reason"))))),o.a.createElement("hr",null),o.a.createElement("div",null,o.a.createElement(s,{startDateTime:new Date(C),endDateTime:D,onAfterChange:T}),o.a.createElement("div",null,o.a.createElement("div",null,y&&o.a.createElement(c.Button,{onClick:function(){f(n,t,y)}}," ","Split Event"," "))))))}var f=a.AppEvents.alertError,v=a.AppEvents.alertSuccess;!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e),t.type="refresh"}(a.BusEventBase);var p=function(e){var t={id:""};if(!e)return t;var n=e.fields.find((function(e){return"id"===e.name}));return n&&(t.id=n.values.get(n.values.length-1)),t},E=function(e){if(!e)return[];for(var t=e.fields.find((function(e){return"packMLStatus"===e.name})),n=e.fields.find((function(e){return"startDateTime"===e.name})),a=e.fields.find((function(e){return"endDateTime"===e.name})),r=e.fields.find((function(e){return"duration"===e.name})),l=e.fields.find((function(e){return"reasonCategoryCode"===e.name})),i=e.fields.find((function(e){return"reasonCode"===e.name})),o=e.fields.find((function(e){return"reasonText"===e.name})),u=e.fields.find((function(e){return"comments"===e.name})),c=[],s=0;s0){var t=e[0].getElementsByClassName("toolbar-button");if(t.length>0)t[0].click()}},g=function(){r(null)},h=e.width,T=y(e.data),M=T.reasons,b=T.equipment,S=T.reasonsWithParents,D=T.events,C=null==D?void 0:D.length,O=null==M?void 0:M.length;return C&&O?o.a.createElement("div",null,n?o.a.createElement(m,{machineEvent:n,equipment:b,title:"Event Log Editor",reasons:M.concat(S),dismissModal:g,onAssignReason:function(e,t,n){var r='\n mutation\n {\n updateEventLogTS(input:[{eventStartTime:"'+Object(a.dateTimeAsMoment)(t.startDateTime).utc().format()+'",equipment:{id:"'+e.id+'"}, reasonText: "'+n.text+'", reasonCategoryCode:"'+n.categoryCode+'"}]){\n equipment{id}\n eventTime\n reasonCategoryCode\n reasonCode\n reasonText\n PackMLStatus\n reasonValue\n reasonValueUoM\n comment\n previousTime\n }\n }\n ';d(r)},onSplitEvent:function(e,t,n){var r=Object(a.dateTimeAsMoment)(t.startDateTime).format("YYYY-MM-DDTHH:mm:ssZ"),l=Object(a.dateTimeAsMoment)(n).format("YYYY-MM-DDTHH:mm:ssZ"),i='mutation{\n splitEventLogTS(input:[{eventStartTime:"'+r+'", packMLStatus:"'+t.packMLStatus+'", equipment: {id:"'+e.id+'"}},{eventStartTime:"'+l+'", packMLStatus:"'+t.packMLStatus+'", equipment: {id:"'+e.id+'"}}]){\n eventTime\n }\n }';d(i)},onEditComment:function(e,t,n){var a='\n mutation\n {\n updateEventLogTS(input:[{eventStartTime:"'+t.startDateTime+'",equipment:{id:"'+e.id+'"}, comment: "'+n+'"}]){\n equipment{id}\n eventTime\n reasonCategoryCode\n reasonCode\n reasonText\n PackMLStatus\n reasonValue\n reasonValueUoM\n comment\n previousTime\n }\n }\n ';d(a)}}):o.a.createElement(o.a.Fragment,null),o.a.createElement("table",{width:h},o.a.createElement("thead",null,o.a.createElement("tr",null,o.a.createElement("th",null,"Start"),o.a.createElement("th",null,"End"),o.a.createElement("th",null,"Duration"),o.a.createElement("th",null,"Time Category"),o.a.createElement("th",null,"Reason"),o.a.createElement("th",null,"Comment"))),o.a.createElement("tbody",null,D.length>0&&D.map((function(t){return o.a.createElement("tr",{onClick:function(n){return function(t,n){var a=y(e.data).reasons;a&&a.length>0&&r(n)}(0,t)},onMouseOver:function(e){return function(e,t){e.target.parentElement.style.background=s.palette.gray95,e.target.parentElement.style.color=s.palette.black}(e)},onMouseLeave:function(e){return function(e){e.target.parentElement.style.background=null,e.target.parentElement.style.color=null}(e)},key:t.startDateTime},o.a.createElement("td",null,Object(a.dateTimeAsMoment)(t.startDateTime).format("YYYY-MM-DD[, ]HH:mm:ss")),o.a.createElement("td",null,t.endDateTime&&Object(a.dateTimeAsMoment)(t.endDateTime).format("YYYY-MM-DD[, ]HH:mm:ss")),o.a.createElement("td",null,(n=t.duration,l=Math.floor(n/86400),i=Math.floor((n-24*l*3600)/3600),u=Math.floor((n-24*l*3600-60*i*60)/60),c=Math.floor(n-24*l*3600-60*i*60-60*u),(l?l+" Days ":"")+(i?i+" Hours ":"")+(u?u+" Minutes ":"")+(c?c+" Seconds ":""))),o.a.createElement("td",null,t.timeType),o.a.createElement("td",null,t.reason),o.a.createElement("td",null,t.comment));var n,l,i,u,c}))))):o.a.createElement("div",null,"No data")})).setNoPadding().setPanelOptions((function(e){e.addTextInput({path:"eventMetric",name:"Event Metric",description:"Name of Query Metric with Event Data",defaultValue:"Events"}).addTextInput({path:"reasonMetric",name:"Reason Metric",description:"Name of Query Metric with Reason Data",defaultValue:"Reasons"})}))}])})); +define(["react","@grafana/ui","@grafana/data","@grafana/runtime"],(function(e,t,n,r){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=15)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";e.exports=n(14)},function(e,t){e.exports=r},function(e,t,n){"use strict";var r=n(3),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function s(e){return r.isMemo(e)?a:u[e.$$typeof]||o}u[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[r.Memo]=a;var l=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(g){var o=p(n);o&&o!==g&&e(t,o,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var u=s(t),m=s(n),h=0;h1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var E=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&x(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i=A&&(A=t+1),P.set(e,t),k.set(t,e)},O="style["+S+'][data-styled-version="5.3.1"]',F=new RegExp("^"+S+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),M=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(S))return r}}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(S,"active"),r.setAttribute("data-styled-version","5.3.1");var a=j();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},_=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(l+=e+",")})),r+=""+u+s+'{content:"'+l+'"}/*!sc*/\n'}}}return r}(this)},e}(),V=/(a)(d)/gi,$=function(e){return String.fromCharCode(e+(e>25?39:97))};function q(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=$(t%52)+n;return($(t%52)+n).replace(V,"$1-$2")}var Y=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},U=function(e){return Y(5381,e)};function X(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var u=n(i,"."+a,void 0,r);t.insertRules(r,a,u)}o.push(a),this.staticRulesId=a}else{for(var s=this.rules.length,l=Y(this.baseHash,n.hash),c="",d=0;d>>0);if(!t.hasNameForId(r,m)){var h=n(c,"."+m,void 0,r);t.insertRules(r,m,h)}o.push(m)}}return o.join(" ")},e}(),J=/^\s*\/\/.*$/gm,Q=[":","[",".","#"];function ee(e){var t,n,r,o,i=void 0===e?v:e,a=i.options,u=void 0===a?v:a,l=i.plugins,c=void 0===l?h:l,d=new s.a(u),f=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,u,s,l,c,d){switch(n){case 1:if(0===c&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===l)return r+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),g=function(e,r,i){return 0===r&&-1!==Q.indexOf(i[n.length])||i.match(o)?e:"."+t};function m(e,i,a,u){void 0===u&&(u="&");var s=e.replace(J,""),l=i&&a?a+" "+i+" { "+s+" }":s;return t=u,n=i,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),d(a||!i?"":i,l)}return d.use([].concat(c,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,g))},p,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=c.length?c.reduce((function(e,t){return t.name||x(15),Y(e,t.name)}),5381).toString():"",m}var te=i.a.createContext(),ne=(te.Consumer,i.a.createContext()),re=(ne.Consumer,new W),oe=ee();function ie(){return Object(o.useContext)(te)||re}function ae(){return Object(o.useContext)(ne)||oe}function ue(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],r=t[1],a=ie(),s=Object(o.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),l=Object(o.useMemo)((function(){return ee({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(o.useEffect)((function(){u()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),i.a.createElement(te.Provider,{value:s},i.a.createElement(ne.Provider,{value:l},e.children))}var se=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=oe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return x(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=oe),this.name+e.hash},e}(),le=/([A-Z])/,ce=/([A-Z])/g,de=/^ms-/,fe=function(e){return"-"+e.toLowerCase()};function pe(e){return le.test(e)?e.replace(ce,fe).replace(de,"-ms-"):e}var ge=function(e){return null==e||!1===e||""===e};function me(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,u=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,we=/(^-|-$)/g;function Se(e){return e.replace(be,"-").replace(we,"")}var Re=function(e){return q(U(e)>>>0)};function Ce(e){return"string"==typeof e&&!0}var xe=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ee=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Pe(e,t,n){var r=e[n];xe(t)&&xe(r)?ke(r,t):e[n]=t}function ke(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(o[n]=e[n]);return o}(t,["componentId"]),i=r&&r+"-"+(Ce(e)?e:Se(b(e)));return Te(e,p({},o,{attrs:R,componentId:i}),n)},Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?ke({},e.defaultProps,t):t}}),x.toString=function(){return"."+x.styledComponentId},a&&f()(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),x}var Be=function(e){return function e(t,n,o){if(void 0===o&&(o=v),!Object(r.isValidElementType)(n))return x(1,String(n));var i=function(){return t(n,o,ve.apply(void 0,arguments))};return i.withConfig=function(r){return e(t,n,p({},o,{},r))},i.attrs=function(r){return e(t,n,p({},o,{attrs:Array.prototype.concat(o.attrs,r).filter(Boolean)}))},i}(Te,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Be[e]=Be(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=X(e),W.registerId(this.componentId+1)}var t=e.prototype;t.createStyles=function(e,t,n,r){var o=r(me(this.rules,t,n,r).join(""),""),i=this.componentId+e;n.insertRules(i,i,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&W.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}();!function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=j();return""},this.getStyleTags=function(){return e.sealed?x(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return x(2);var n=((t={})[S]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=j();return r&&(n.nonce=r),[i.a.createElement("style",p({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new W({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?x(2):i.a.createElement(ue,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return x(3)}}();t.a=Be}).call(this,n(13))},function(e,t){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(t),s=0;sr&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0s.charCodeAt(8))break;case 115:a=a.replace(s,"-webkit-"+s)+";"+a;break;case 207:case 102:a=a.replace(s,"-webkit-"+(102u.charCodeAt(0)&&(u=u.trim()),u=[u],0p)&&(z=(N=N.replace(" ",":")).length),0=0||(o[n]=e[n]);return o}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var u={init:"init"},s=function(e){var t=e.value;return void 0===t?"":t},l=function(){return t.createElement(t.Fragment,null," ")},c={Cell:s,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function d(){for(var e=arguments.length,t=new Array(e),n=0;n(i="number"==typeof i?i:1/0)){var a=o;o=i,i=a}return e.filter((function(e){return t.some((function(t){var n=e.values[t];return n>=o&&n<=i}))}))};Ce.autoRemove=function(e){return!e||"number"!=typeof e[0]&&"number"!=typeof e[1]};var xe=Object.freeze({__proto__:null,text:ge,exactText:me,exactTextCase:he,includes:ve,includesAll:ye,includesSome:be,includesValue:we,exact:Se,equals:Re,between:Ce});u.resetFilters="resetFilters",u.setFilter="setFilter",u.setAllFilters="setAllFilters";var Ee=function(e){e.stateReducers.push(Pe),e.useInstance.push(ke)};function Pe(e,t,n,r){if(t.type===u.init)return o({filters:[]},e);if(t.type===u.resetFilters)return o({},e,{filters:r.initialState.filters||[]});if(t.type===u.setFilter){var i=t.columnId,a=t.filterValue,s=r.allColumns,l=r.filterTypes,c=s.find((function(e){return e.id===i}));if(!c)throw new Error("React-Table: Could not find a column with id: "+i);var d=O(c.filter,l||{},xe),f=e.filters.find((function(e){return e.id===i})),p=h(a,f&&f.value);return F(d.autoRemove,p,c)?o({},e,{filters:e.filters.filter((function(e){return e.id!==i}))}):o({},e,f?{filters:e.filters.map((function(e){return e.id===i?{id:i,value:p}:e}))}:{filters:[].concat(e.filters,[{id:i,value:p}])})}if(t.type===u.setAllFilters){var g=t.filters,m=r.allColumns,v=r.filterTypes;return o({},e,{filters:h(g,e.filters).filter((function(e){var t=m.find((function(t){return t.id===e.id}));return!F(O(t.filter,v||{},xe).autoRemove,e.value,t)}))})}}function ke(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.rowsById,a=e.allColumns,s=e.filterTypes,l=e.manualFilters,c=e.defaultCanFilter,d=void 0!==c&&c,f=e.disableFilters,p=e.state.filters,g=e.dispatch,m=e.autoResetFilters,h=void 0===m||m,y=t.useCallback((function(e,t){g({type:u.setFilter,columnId:e,filterValue:t})}),[g]),w=t.useCallback((function(e){g({type:u.setAllFilters,filters:e})}),[g]);a.forEach((function(e){var t=e.id,n=e.accessor,r=e.defaultCanFilter,o=e.disableFilters;e.canFilter=n?A(!0!==o&&void 0,!0!==f&&void 0,!0):A(r,d,!1),e.setFilter=function(t){return y(e.id,t)};var i=p.find((function(e){return e.id===t}));e.filterValue=i&&i.value}));var S=t.useMemo((function(){if(l||!p.length)return[r,o,i];var e=[],t={};return[function n(r,o){void 0===o&&(o=0);var i=r;return(i=p.reduce((function(e,t){var n=t.id,r=t.value,i=a.find((function(e){return e.id===n}));if(!i)return e;0===o&&(i.preFilteredRows=e);var u=O(i.filter,s||{},xe);return u?(i.filteredRows=u(e,[n],r),i.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+i.id+"."),e)}),r)).forEach((function(r){e.push(r),t[r.id]=r,r.subRows&&(r.subRows=r.subRows&&r.subRows.length>0?n(r.subRows,o+1):r.subRows)})),i}(r),e,t]}),[l,p,r,o,i,a,s]),R=S[0],C=S[1],x=S[2];t.useMemo((function(){a.filter((function(e){return!p.find((function(t){return t.id===e.id}))})).forEach((function(e){e.preFilteredRows=R,e.filteredRows=R}))}),[R,p,a]);var E=v(h);b((function(){E()&&g({type:u.resetFilters})}),[g,l?null:n]),Object.assign(e,{preFilteredRows:r,preFilteredFlatRows:o,preFilteredRowsById:i,filteredRows:R,filteredFlatRows:C,filteredRowsById:x,rows:R,flatRows:C,rowsById:x,setFilter:y,setAllFilters:w})}Ee.pluginName="useFilters",u.resetGlobalFilter="resetGlobalFilter",u.setGlobalFilter="setGlobalFilter";var Ae=function(e){e.stateReducers.push(Ie),e.useInstance.push(Te)};function Ie(e,t,n,r){if(t.type===u.resetGlobalFilter)return o({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===u.setGlobalFilter){var a=t.filterValue,s=r.userFilterTypes,l=O(r.globalFilter,s||{},xe),c=h(a,e.globalFilter);return F(l.autoRemove,c)?(e.globalFilter,i(e,["globalFilter"])):o({},e,{globalFilter:c})}}function Te(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.rowsById,a=e.allColumns,s=e.filterTypes,l=e.globalFilter,c=e.manualGlobalFilter,d=e.state.globalFilter,f=e.dispatch,p=e.autoResetGlobalFilter,g=void 0===p||p,m=e.disableGlobalFilter,h=t.useCallback((function(e){f({type:u.setGlobalFilter,filterValue:e})}),[f]),y=t.useMemo((function(){if(c||void 0===d)return[r,o,i];var e=[],t={},n=O(l,s||{},xe);if(!n)return console.warn("Could not find a valid 'globalFilter' option."),r;a.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=A(!0!==t&&void 0,!0!==m&&void 0,!0)}));var u=a.filter((function(e){return!0===e.canFilter}));return[function r(o){return(o=n(o,u.map((function(e){return e.id})),d)).forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?r(n.subRows):n.subRows})),o}(r),e,t]}),[c,d,l,s,a,r,o,i,m]),w=y[0],S=y[1],R=y[2],C=v(g);b((function(){C()&&f({type:u.resetGlobalFilter})}),[f,c?null:n]),Object.assign(e,{preGlobalFilteredRows:r,preGlobalFilteredFlatRows:o,preGlobalFilteredRowsById:i,globalFilteredRows:w,globalFilteredFlatRows:S,globalFilteredRowsById:R,rows:w,flatRows:S,rowsById:R,setGlobalFilter:h,disableGlobalFilter:m})}function Be(e,t){return t.reduce((function(e,t){return e+("number"==typeof t?t:0)}),0)}Ae.pluginName="useGlobalFilter";var Oe=Object.freeze({__proto__:null,sum:Be,min:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e))})),t},max:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.max(t,e))})),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e),n=Math.max(n,e))})),t+".."+n},average:function(e){return Be(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort((function(e,t){return e-t}));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),Fe=[],Me={};u.resetGroupBy="resetGroupBy",u.setGroupBy="setGroupBy",u.toggleGroupBy="toggleGroupBy";var Ge=function(e){e.getGroupByToggleProps=[je],e.stateReducers.push(He),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.groupBy])})),e.visibleColumns.push(_e),e.useInstance.push(De),e.prepareRow.push(Le)};Ge.pluginName="useGroupBy";var je=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(e){e.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function He(e,t,n,r){if(t.type===u.init)return o({groupBy:[]},e);if(t.type===u.resetGroupBy)return o({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===u.setGroupBy)return o({},e,{groupBy:t.value});if(t.type===u.toggleGroupBy){var i=t.columnId,a=t.value,s=void 0!==a?a:!e.groupBy.includes(i);return o({},e,s?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter((function(e){return e!==i}))})}}function _e(e,t){var n=t.instance.state.groupBy,r=n.map((function(t){return e.find((function(e){return e.id===t}))})).filter(Boolean),o=e.filter((function(e){return!n.includes(e.id)}));return(e=[].concat(r,o)).forEach((function(e){e.isGrouped=n.includes(e.id),e.groupedIndex=n.indexOf(e.id)})),e}var ze={};function De(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.rowsById,a=e.allColumns,s=e.flatHeaders,l=e.groupByFn,c=void 0===l?Ne:l,d=e.manualGroupBy,p=e.aggregations,g=void 0===p?ze:p,h=e.plugins,y=e.state.groupBy,w=e.dispatch,S=e.autoResetGroupBy,R=void 0===S||S,C=e.disableGroupBy,x=e.defaultCanGroupBy,E=e.getHooks;m(h,["useColumnOrder","useFilters"],"useGroupBy");var P=v(e);a.forEach((function(t){var n=t.accessor,r=t.defaultGroupBy,o=t.disableGroupBy;t.canGroupBy=n?A(t.canGroupBy,!0!==o&&void 0,!0!==C&&void 0,!0):A(t.canGroupBy,r,x,!1),t.canGroupBy&&(t.toggleGroupBy=function(){return e.toggleGroupBy(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var k=t.useCallback((function(e,t){w({type:u.toggleGroupBy,columnId:e,value:t})}),[w]),I=t.useCallback((function(e){w({type:u.setGroupBy,value:e})}),[w]);s.forEach((function(e){e.getGroupByToggleProps=f(E().getGroupByToggleProps,{instance:P(),header:e})}));var B=t.useMemo((function(){if(d||!y.length)return[r,o,i,Fe,Me,o,i];var e=y.filter((function(e){return a.find((function(t){return t.id===e}))})),t=[],n={},u=[],s={},l=[],f={},p=function r(o,i,d){if(void 0===i&&(i=0),i===e.length)return o;var p=e[i],m=c(o,p);return Object.entries(m).map((function(o,c){var m=o[0],h=o[1],v=p+":"+m,y=r(h,i+1,v=d?d+">"+v:v),b=i?T(h,"leafRows"):h,w=function(t,n,r){var o={};return a.forEach((function(i){if(e.includes(i.id))o[i.id]=n[0]?n[0].values[i.id]:null;else{var a="function"==typeof i.aggregate?i.aggregate:g[i.aggregate]||Oe[i.aggregate];if(a){var u=n.map((function(e){return e.values[i.id]})),s=t.map((function(e){var t=e.values[i.id];if(!r&&i.aggregateValue){var n="function"==typeof i.aggregateValue?i.aggregateValue:g[i.aggregateValue]||Oe[i.aggregateValue];if(!n)throw console.info({column:i}),new Error("React Table: Invalid column.aggregateValue option for column listed above");t=n(t,e,i)}return t}));o[i.id]=a(s,u)}else{if(i.aggregate)throw console.info({column:i}),new Error("React Table: Invalid column.aggregate option for column listed above");o[i.id]=null}}})),o}(b,h,i),S={id:v,isGrouped:!0,groupByID:p,groupByVal:m,values:w,subRows:y,leafRows:b,depth:i,index:c};return y.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(u.push(e),s[e.id]=e):(l.push(e),f[e.id]=e)})),S}))}(r);return p.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(u.push(e),s[e.id]=e):(l.push(e),f[e.id]=e)})),[p,t,n,u,s,l,f]}),[d,y,r,o,i,a,g,c]),O=B[0],F=B[1],M=B[2],G=B[3],j=B[4],H=B[5],_=B[6],z=v(R);b((function(){z()&&w({type:u.resetGroupBy})}),[w,d?null:n]),Object.assign(e,{preGroupedRows:r,preGroupedFlatRow:o,preGroupedRowsById:i,groupedRows:O,groupedFlatRows:F,groupedRowsById:M,onlyGroupedFlatRows:G,onlyGroupedRowsById:j,nonGroupedFlatRows:H,nonGroupedRowsById:_,rows:O,flatRows:F,rowsById:M,toggleGroupBy:k,setGroupBy:I})}function Le(e){e.allCells.forEach((function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&(null==(n=e.subRows)?void 0:n.length)}))}function Ne(e,t){return e.reduce((function(e,n,r){var o=""+n.values[t];return e[o]=Array.isArray(e[o])?e[o]:[],e[o].push(n),e}),{})}var We=/([0-9]+)/gm;function Ve(e,t){return e===t?0:e>t?1:-1}function $e(e,t,n){return[e.values[n],t.values[n]]}function qe(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}var Ye=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=$e(e,t,n),o=r[0],i=r[1];for(o=qe(o),i=qe(i),o=o.split(We).filter(Boolean),i=i.split(We).filter(Boolean);o.length&&i.length;){var a=o.shift(),u=i.shift(),s=parseInt(a,10),l=parseInt(u,10),c=[s,l].sort();if(isNaN(c[0])){if(a>u)return 1;if(u>a)return-1}else{if(isNaN(c[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}}return o.length-i.length},datetime:function(e,t,n){var r=$e(e,t,n),o=r[0],i=r[1];return Ve(o=o.getTime(),i=i.getTime())},basic:function(e,t,n){var r=$e(e,t,n);return Ve(r[0],r[1])},string:function(e,t,n){var r=$e(e,t,n),o=r[0],i=r[1];for(o=o.split("").filter(Boolean),i=i.split("").filter(Boolean);o.length&&i.length;){var a=o.shift(),u=i.shift(),s=a.toLowerCase(),l=u.toLowerCase();if(s>l)return 1;if(l>s)return-1;if(a>u)return 1;if(u>a)return-1}return o.length-i.length},number:function(e,t,n){var r=$e(e,t,n),o=r[0],i=r[1],a=/[^0-9.]/gi;return Ve(o=Number(String(o).replace(a,"")),i=Number(String(i).replace(a,"")))}});u.resetSortBy="resetSortBy",u.setSortBy="setSortBy",u.toggleSortBy="toggleSortBy",u.clearSortBy="clearSortBy",c.sortType="alphanumeric",c.sortDescFirst=!1;var Ue=function(e){e.getSortByToggleProps=[Xe],e.stateReducers.push(Ke),e.useInstance.push(Ze)};Ue.pluginName="useSortBy";var Xe=function(e,t){var n=t.instance,r=t.column,o=n.isMultiSortEvent,i=void 0===o?function(e){return e.shiftKey}:o;return[e,{onClick:r.canSort?function(e){e.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&i(e))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function Ke(e,t,n,r){if(t.type===u.init)return o({sortBy:[]},e);if(t.type===u.resetSortBy)return o({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===u.clearSortBy)return o({},e,{sortBy:e.sortBy.filter((function(e){return e.id!==t.columnId}))});if(t.type===u.setSortBy)return o({},e,{sortBy:t.sortBy});if(t.type===u.toggleSortBy){var i,a=t.columnId,s=t.desc,l=t.multi,c=r.allColumns,d=r.disableMultiSort,f=r.disableSortRemove,p=r.disableMultiRemove,g=r.maxMultiSortColCount,m=void 0===g?Number.MAX_SAFE_INTEGER:g,h=e.sortBy,v=c.find((function(e){return e.id===a})).sortDescFirst,y=h.find((function(e){return e.id===a})),b=h.findIndex((function(e){return e.id===a})),w=null!=s,S=[];return"toggle"!=(i=!d&&l?y?"toggle":"add":b!==h.length-1||1!==h.length?"replace":y?"toggle":"replace")||f||w||l&&p||!(y&&y.desc&&!v||!y.desc&&v)||(i="remove"),"replace"===i?S=[{id:a,desc:w?s:v}]:"add"===i?(S=[].concat(h,[{id:a,desc:w?s:v}])).splice(0,S.length-m):"toggle"===i?S=h.map((function(e){return e.id===a?o({},e,{desc:w?s:!y.desc}):e})):"remove"===i&&(S=h.filter((function(e){return e.id!==a}))),o({},e,{sortBy:S})}}function Ze(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.allColumns,a=e.orderByFn,s=void 0===a?Je:a,l=e.sortTypes,c=e.manualSortBy,d=e.defaultCanSort,p=e.disableSortBy,g=e.flatHeaders,h=e.state.sortBy,y=e.dispatch,w=e.plugins,S=e.getHooks,R=e.autoResetSortBy,C=void 0===R||R;m(w,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var x=t.useCallback((function(e){y({type:u.setSortBy,sortBy:e})}),[y]),E=t.useCallback((function(e,t,n){y({type:u.toggleSortBy,columnId:e,desc:t,multi:n})}),[y]),P=v(e);g.forEach((function(e){var t=e.accessor,n=e.canSort,r=e.disableSortBy,o=e.id,i=t?A(!0!==r&&void 0,!0!==p&&void 0,!0):A(d,n,!1);e.canSort=i,e.canSort&&(e.toggleSortBy=function(t,n){return E(e.id,t,n)},e.clearSortBy=function(){y({type:u.clearSortBy,columnId:e.id})}),e.getSortByToggleProps=f(S().getSortByToggleProps,{instance:P(),column:e});var a=h.find((function(e){return e.id===o}));e.isSorted=!!a,e.sortedIndex=h.findIndex((function(e){return e.id===o})),e.isSortedDesc=e.isSorted?a.desc:void 0}));var k=t.useMemo((function(){if(c||!h.length)return[r,o];var e=[],t=h.filter((function(e){return i.find((function(t){return t.id===e.id}))}));return[function n(r){var o=s(r,t.map((function(e){var t=i.find((function(t){return t.id===e.id}));if(!t)throw new Error("React-Table: Could not find a column with id: "+e.id+" while sorting");var n=t.sortType,r=I(n)||(l||{})[n]||Ye[n];if(!r)throw new Error("React-Table: Could not find a valid sortType of '"+n+"' for column '"+e.id+"'.");return function(t,n){return r(t,n,e.id,e.desc)}})),t.map((function(e){var t=i.find((function(t){return t.id===e.id}));return t&&t.sortInverted?e.desc:!e.desc})));return o.forEach((function(t){e.push(t),t.subRows&&0!==t.subRows.length&&(t.subRows=n(t.subRows))})),o}(r),e]}),[c,h,r,o,i,s,l]),T=k[0],B=k[1],O=v(C);b((function(){O()&&y({type:u.resetSortBy})}),[c?null:n]),Object.assign(e,{preSortedRows:r,preSortedFlatRows:o,sortedRows:T,sortedFlatRows:B,rows:T,flatRows:B,setSortBy:x,toggleSortBy:E})}function Je(e,t,n){return[].concat(e).sort((function(e,r){for(var o=0;oe.pageIndex?l=-1===i?a.length>=e.pageSize:s-1),l?o({},e,{pageIndex:s}):e}if(t.type===u.setPageSize){var c=t.pageSize,d=e.pageSize*e.pageIndex;return o({},e,{pageIndex:Math.floor(d/c),pageSize:c})}}function tt(e){var n=e.rows,r=e.autoResetPage,o=void 0===r||r,i=e.manualExpandedKey,a=void 0===i?"expanded":i,s=e.plugins,l=e.pageCount,c=e.paginateExpandedRows,d=void 0===c||c,f=e.expandSubRows,p=void 0===f||f,g=e.state,h=g.pageSize,y=g.pageIndex,w=g.expanded,S=g.globalFilter,R=g.filters,C=g.groupBy,x=g.sortBy,E=e.dispatch,P=e.data,k=e.manualPagination;m(s,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var A=v(o);b((function(){A()&&E({type:u.resetPage})}),[E,k?null:P,S,R,C,x]);var I=k?l:Math.ceil(n.length/h),T=t.useMemo((function(){return I>0?[].concat(new Array(I)).fill(null).map((function(e,t){return t})):[]}),[I]),O=t.useMemo((function(){var e;if(k)e=n;else{var t=h*y,r=t+h;e=n.slice(t,r)}return d?e:B(e,{manualExpandedKey:a,expanded:w,expandSubRows:p})}),[p,w,a,k,y,h,d,n]),F=y>0,M=-1===I?O.length>=h:y-1&&i.push(o.splice(t,1)[0])};o.length&&r.length;)a();return[].concat(i,o)}function Bt(e){var n=e.dispatch;e.setColumnOrder=t.useCallback((function(e){return n({type:u.setColumnOrder,columnOrder:e})}),[n])}At.pluginName="useColumnOrder",c.canResize=!0,u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize";var Ot=function(e){e.getResizerProps=[Ft],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(Mt),e.useInstance.push(jt),e.useInstanceBeforeDimensions.push(Gt)},Ft=function(e,t){var n=t.instance,r=t.header,o=n.dispatch,i=function(e,t){var n=!1;if("touchstart"===e.type){if(e.touches&&e.touches.length>1)return;n=!0}var r=function(e){var t=[];return function e(n){n.columns&&n.columns.length&&n.columns.map(e),t.push(n)}(e),t}(t).map((function(e){return[e.id,e.totalWidth]})),i=n?Math.round(e.touches[0].clientX):e.clientX,a=function(e){o({type:u.columnResizing,clientX:e})},s=function(){return o({type:u.columnDoneResizing})},l={mouse:{moveEvent:"mousemove",moveHandler:function(e){return a(e.clientX)},upEvent:"mouseup",upHandler:function(e){document.removeEventListener("mousemove",l.mouse.moveHandler),document.removeEventListener("mouseup",l.mouse.upHandler),s()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),a(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(e){document.removeEventListener(l.touch.moveEvent,l.touch.moveHandler),document.removeEventListener(l.touch.upEvent,l.touch.moveHandler),s()}}},c=n?l.touch:l.mouse,d=!!function(){if("boolean"==typeof G)return G;var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return G=e}()&&{passive:!1};document.addEventListener(c.moveEvent,c.moveHandler,d),document.addEventListener(c.upEvent,c.upHandler,d),o({type:u.columnStartResizing,columnId:t.id,columnWidth:t.totalWidth,headerIdWidths:r,clientX:i})};return[e,{onMouseDown:function(e){return e.persist()||i(e,r)},onTouchStart:function(e){return e.persist()||i(e,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Mt(e,t){if(t.type===u.init)return o({columnResizing:{columnWidths:{}}},e);if(t.type===u.resetResize)return o({},e,{columnResizing:{columnWidths:{}}});if(t.type===u.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,a=t.headerIdWidths;return o({},e,{columnResizing:o({},e.columnResizing,{startX:n,headerIdWidths:a,columnWidth:i,isResizingColumn:r})})}if(t.type===u.columnResizing){var s=t.clientX,l=e.columnResizing,c=l.startX,d=l.columnWidth,f=l.headerIdWidths,p=(s-c)/d,g={};return(void 0===f?[]:f).forEach((function(e){var t=e[0],n=e[1];g[t]=Math.max(n+n*p,0)})),o({},e,{columnResizing:o({},e.columnResizing,{columnWidths:o({},e.columnResizing.columnWidths,{},g)})})}return t.type===u.columnDoneResizing?o({},e,{columnResizing:o({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Ot.pluginName="useResizeColumns";var Gt=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,o=e.state.columnResizing,i=v(e);t.forEach((function(e){var t=A(!0!==e.disableResizing&&void 0,!0!==n&&void 0,!0);e.canResize=t,e.width=o.columnWidths[e.id]||e.originalWidth||e.width,e.isResizing=o.isResizingColumn===e.id,t&&(e.getResizerProps=f(r().getResizerProps,{instance:i(),header:e}))}))};function jt(e){var n=e.plugins,r=e.dispatch,o=e.autoResetResize,i=void 0===o||o,a=e.columns;m(n,["useAbsoluteLayout"],"useResizeColumns");var s=v(i);b((function(){s()&&r({type:u.resetResize})}),[a]);var l=t.useCallback((function(){return r({type:u.resetResize})}),[r]);Object.assign(e,{resetResizing:l})}var Ht={position:"absolute",top:0},_t=function(e){e.getTableBodyProps.push(zt),e.getRowProps.push(zt),e.getHeaderGroupProps.push(zt),e.getFooterGroupProps.push(zt),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:o({},Ht,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:o({},Ht,{left:n.column.totalLeft+"px",width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:o({},Ht,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]}))};_t.pluginName="useAbsoluteLayout";var zt=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},Dt={display:"inline-block",boxSizing:"border-box"},Lt=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},Nt=function(e){e.getRowProps.push(Lt),e.getHeaderGroupProps.push(Lt),e.getFooterGroupProps.push(Lt),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:o({},Dt,{width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:o({},Dt,{width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:o({},Dt,{width:n.totalWidth+"px"})}]}))};function Wt(e){e.getTableProps.push(Vt),e.getRowProps.push($t),e.getHeaderGroupProps.push($t),e.getFooterGroupProps.push($t),e.getHeaderProps.push(qt),e.getCellProps.push(Yt),e.getFooterProps.push(Ut)}Nt.pluginName="useBlockLayout",Wt.pluginName="useFlexLayout";var Vt=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},$t=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},qt=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Yt=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},Ut=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function Xt(e){e.stateReducers.push(Jt),e.getTableProps.push(Kt),e.getHeaderProps.push(Zt)}Xt.pluginName="useGridLayout";var Kt=function(e,t){return[e,{style:{display:"grid",gridTemplateColumns:t.instance.state.gridLayout.columnWidths.map((function(e){return e})).join(" ")}}]},Zt=function(e,t){return[e,{id:"header-cell-"+t.column.id,style:{position:"sticky"}}]};function Jt(e,t,n,r){if("init"===t.type)return o({gridLayout:{columnWidths:r.columns.map((function(){return"auto"}))}},e);if("columnStartResizing"===t.type){var i=t.columnId,a=r.visibleColumns.findIndex((function(e){return e.id===i})),u=function(e){var t,n=null==(t=document.getElementById("header-cell-"+e))?void 0:t.offsetWidth;if(void 0!==n)return n}(i);return void 0!==u?o({},e,{gridLayout:o({},e.gridLayout,{columnId:i,columnIndex:a,startingWidth:u})}):e}if("columnResizing"===t.type){var s=e.gridLayout,l=s.columnIndex,c=s.startingWidth,d=s.columnWidths,f=c-(e.columnResizing.startX-t.clientX),p=[].concat(d);return p[l]=f+"px",o({},e,{gridLayout:o({},e.gridLayout,{columnWidths:p})})}}e._UNSTABLE_usePivotColumns=nt,e.actions=u,e.defaultColumn=c,e.defaultGroupByFn=Ne,e.defaultOrderByFn=Je,e.defaultRenderer=s,e.emptyRenderer=l,e.ensurePluginOrder=m,e.flexRender=S,e.functionalUpdate=h,e.loopHooks=g,e.makePropGetter=f,e.makeRenderer=w,e.reduceHooks=p,e.safeUseLayoutEffect=y,e.useAbsoluteLayout=_t,e.useAsyncDebounce=function(e,n){void 0===n&&(n=0);var o=t.useRef({}),i=v(e),a=v(n);return t.useCallback(function(){var e=r(regeneratorRuntime.mark((function e(){var t,n,u,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=s.length,n=new Array(t),u=0;u1?n-1:0),i=1;i1)for(var n=1;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var u=n(0),s=n.n(u),l=n(4),c=n(1);function d(e){var t=e.startDateTime,n=e.endDateTime,o=e.onAfterChange,i=a(Object(u.useState)(t),2),l=i[0],d=i[1],f=t.valueOf(),p=n.valueOf(),g=Math.floor((p-f)/6e4);return s.a.createElement("div",null,s.a.createElement("h3",null," Split Event by Time "),s.a.createElement("div",null,"Selected Time: ",s.a.createElement("b",null,l&&l.toLocaleString())," "),s.a.createElement("div",null,s.a.createElement(c.Slider,{step:1,value:[0],min:0,max:g,tooltipAlwaysVisible:!0,onChange:function(e){d(Object(r.dateTimeAsMoment)(t).add(e,"minute").toDate())},onAfterChange:function(e){o(l)}}),s.a.createElement("div",null,s.a.createElement("h5",{style:{textAlign:"right"}},"Minutes"))),s.a.createElement(c.HorizontalGroup,null,s.a.createElement("div",null," ","Start Time: ",s.a.createElement("b",null,t.toLocaleString())," "),s.a.createElement("div",null," ","End Time: ",s.a.createElement("b",null,n.toLocaleString()))))}var f=function e(t){var n=t.reasons,r=t.onFinalReasonSelection,o=t.parentReason,i=function(e,t){return void 0===t?e.filter((function(e,t,n){return null===e.parent})):e.filter((function(e,n,r){return e.parent===t.id}))}(n,o),l=a(Object(u.useState)(),2),d=l[0],f=l[1];return i.length<1?(r(o),null):(r(void 0),s.a.createElement(c.VerticalGroup,null,s.a.createElement("div",null,s.a.createElement(c.HorizontalGroup,{spacing:"lg"},n.length>0&&i.map((function(e){return s.a.createElement(c.Button,{key:e.id,variant:e.id!==(null==d?void 0:d.id)?"primary":"destructive",size:"sm",onClick:function(){e===d?(f(void 0),r(void 0)):f(e)}},e.text)})))),s.a.createElement("div",null,d&&s.a.createElement(e,{reasons:n,parentReason:d,onFinalReasonSelection:r}))))};function p(e){var t=e.machineEvent,n=e.equipment,r=e.title,o=e.reasons,i=e.dismissModal,l=e.onAssignReason,p=e.onSplitEvent,g=e.onEditComment,m=a(Object(u.useState)(void 0),2),h=m[0],v=m[1],y=a(Object(u.useState)(void 0),2),b=y[0],w=y[1],S=a(Object(u.useState)(t.comment?t.comment:""),2),R=S[0],C=S[1],x=(null==t?void 0:t.endDateTime)?new Date(t.endDateTime):new Date,E=new Date(t.startDateTime);return s.a.createElement(c.Modal,{isOpen:!!t,title:r,onDismiss:i,onClickBackdrop:i},s.a.createElement("div",null,s.a.createElement("div",null,s.a.createElement("h3",null," Edit Event Comment "),s.a.createElement("div",null,s.a.createElement(c.TextArea,{css:{},invalid:!1,placeholder:"Type your comment here",disabled:!1,value:R,onChange:function(e){return C(e.target.value)}})),s.a.createElement("div",null,s.a.createElement(c.Button,{onClick:function(){return g(n,t,R)}},"Edit Comment"))),s.a.createElement("hr",null),s.a.createElement("div",null,s.a.createElement(c.VerticalGroup,null,s.a.createElement("h3",null," Assign Reason to Event "),s.a.createElement("div",null,s.a.createElement(f,{reasons:o,onFinalReasonSelection:function(e){console.log(h),v(e)}})),s.a.createElement("div",null,h&&s.a.createElement(c.HorizontalGroup,null,s.a.createElement(c.Button,{size:"md",onClick:function(){l(n,t,h)}},"Assign Reason"))))),s.a.createElement("hr",null),s.a.createElement("div",null,s.a.createElement(d,{startDateTime:new Date(E),endDateTime:x,onAfterChange:w}),s.a.createElement("div",null,s.a.createElement("div",null,b&&s.a.createElement(c.Button,{onClick:function(){p(n,t,b)}}," ","Split Event"," "))))))}var g,m=n(7),h=n(8);function v(e){var t=e.columns,n=e.data,r=e.onRowClick,o=Object(m.useTable)({columns:t,data:n}),a=o.getTableProps,u=o.getTableBodyProps,l=o.headerGroups,c=o.rows,d=o.prepareRow;return s.a.createElement("table",i({className:"fixed_header"},a()),s.a.createElement("thead",null,l.map((function(e){return s.a.createElement("tr",i({className:"header_row"},e.getHeaderGroupProps()),e.headers.map((function(e){return s.a.createElement("th",i({},e.getHeaderProps()),e.render("Header"))})))}))),s.a.createElement("tbody",i({},u()),c.map((function(e,t){return d(e),s.a.createElement("tr",i({},e.getRowProps(),{onClick:function(){r(e.original.rowData)}}),e.cells.map((function(e){return s.a.createElement("td",i({},e.getCellProps()),e.render("Cell"))})))}))))}function y(e){var t,n,o=e.events,i=e.setModalData,a=e.theme,u=e.options,l=h.a.div(g||(t=["\n table{\n width:100%\n }\n padding-left: 5px;\n \n .fixed_header{\n table-layout: fixed;\n }\n \n .fixed_header tbody{\n display:block;\n width: 100%;\n overflow: auto;\n height: ","px;\n }\n \n .fixed_header thead tr {\n display: block;\n }\n \n \n .fixed_header th, .fixed_header td {\n text-align: left;\n width: 300px;\n }\n tr {\n :not(.header_row):hover{\n background-color: ",";\n color: ",";\n cursor: pointer;\n height: 1.2em; /* more precisely it should be (2.4x2.4)/2.8 */\n border-color: ",";\n box-shadow: 0 0 10px ",";\n }\n }\n }\n "],n=["\n table{\n width:100%\n }\n padding-left: 5px;\n \n .fixed_header{\n table-layout: fixed;\n }\n \n .fixed_header tbody{\n display:block;\n width: 100%;\n overflow: auto;\n height: ","px;\n }\n \n .fixed_header thead tr {\n display: block;\n }\n \n \n .fixed_header th, .fixed_header td {\n text-align: left;\n width: 300px;\n }\n tr {\n :not(.header_row):hover{\n background-color: ",";\n color: ",";\n cursor: pointer;\n height: 1.2em; /* more precisely it should be (2.4x2.4)/2.8 */\n border-color: ",";\n box-shadow: 0 0 10px ",";\n }\n }\n }\n "],Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,g=t),u.height-21,a.palette.gray95,a.palette.black,a.palette.gray95,a.palette.gray95),c=s.a.useMemo((function(){return[{Header:"PackML State",accessor:"packmlstate"},{Header:"Start",accessor:"start"},{Header:"End",accessor:"end"},{Header:"Duration",accessor:"duration"},{Header:"Time Category",accessor:"timeCategory"},{Header:"Reason",accessor:"reason"},{Header:"Comment",accessor:"comment"}]}),[]),d=s.a.useMemo((function(){return function(e){return e.map((function(e){return{start:Object(r.dateTimeAsMoment)(e.startDateTime).format("YYYY-MM-DD[, ]HH:mm:ss"),end:e.endDateTime&&Object(r.dateTimeAsMoment)(e.endDateTime).format("YYYY-MM-DD[, ]HH:mm:ss"),duration:(t=e.duration,n=Math.floor(t/86400),o=Math.floor((t-24*n*3600)/3600),i=Math.floor((t-24*n*3600-60*o*60)/60),a=Math.floor(t-24*n*3600-60*o*60-60*i),(n?n+" Days ":"")+(o?o+" Hours ":"")+(i?i+" Minutes ":"")+(a?a+" Seconds ":"")),timeCategory:e.timeType,reason:e.reason,comment:e.comment,packmlstate:e.packMLStatus,rowData:e};var t,n,o,i,a}))}(o)}),[o]);return s.a.createElement(l,null,s.a.createElement(v,{columns:c,data:d,onRowClick:i}))}var b=r.AppEvents.alertError,w=r.AppEvents.alertSuccess;!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e),t.type="refresh"}(r.BusEventBase);var S=function(e){var t={id:""};if(!e)return t;var n=e.fields.find((function(e){return"id"===e.name}));return n&&(t.id=n.values.get(n.values.length-1)),t},R=function(e){if(!e)return[];for(var t=e.fields.find((function(e){return"packMLStatus"===e.name})),n=e.fields.find((function(e){return"startDateTime"===e.name})),r=e.fields.find((function(e){return"endDateTime"===e.name})),o=e.fields.find((function(e){return"duration"===e.name})),i=e.fields.find((function(e){return"reasonCategoryCode"===e.name})),a=e.fields.find((function(e){return"reasonCode"===e.name})),u=e.fields.find((function(e){return"reasonText"===e.name})),s=e.fields.find((function(e){return"comments"===e.name})),l=[],c=0;c0){var t=e[0].getElementsByClassName("toolbar-button");if(t.length>0)t[0].click()}},m=function(){o(null)},h={height:e.height,width:e.width},v=E(e.data),S=v.reasons,R=v.equipment,C=v.reasonsWithParents,x=v.events,P=null==x?void 0:x.length,k=null==S?void 0:S.length;return P&&k?s.a.createElement("div",null,s.a.createElement(y,{events:x,setModalData:o,theme:i,options:h}),n?s.a.createElement(p,{machineEvent:n,equipment:R,title:"Event Log Editor",reasons:S.concat(C),dismissModal:m,onAssignReason:function(e,t,n){var o='\n mutation\n {\n updateEventLogTs(input:[{eventStartTime:"'+Object(r.dateTimeAsMoment)(t.startDateTime).utc().format()+'",equipment:{id:"'+e.id+'"}, reasonText: "'+n.text+'", reasonCategoryCode:"'+n.categoryCode+'"}]){\n equipment{id}\n eventTime\n reasonCategoryCode\n reasonCode\n reasonText\n PackMLStatus\n reasonValue\n reasonValueUoM\n comment\n previousTime\n }\n }\n ';d(o)},onSplitEvent:function(e,t,n){var o=Object(r.dateTimeAsMoment)(t.startDateTime).format("YYYY-MM-DDTHH:mm:ssZ"),i=Object(r.dateTimeAsMoment)(n).format("YYYY-MM-DDTHH:mm:ssZ"),a='mutation{\n splitEventLogTs(input:[{eventStartTime:"'+o+'", packMLStatus:"'+t.packMLStatus+'", equipment: {id:"'+e.id+'"}},{eventStartTime:"'+i+'", packMLStatus:"'+t.packMLStatus+'", equipment: {id:"'+e.id+'"}}]){\n eventTime\n }\n }';d(a)},onEditComment:function(e,t,n){var o='\n mutation\n {\n updateEventLogTs(input:[{eventStartTime:"'+Object(r.dateTimeAsMoment)(t.startDateTime).utc().format()+'",equipment:{id:"'+e.id+'"}, comment: "'+n+'"}]){\n equipment{id}\n eventTime\n reasonCategoryCode\n reasonCode\n reasonText\n PackMLStatus\n reasonValue\n reasonValueUoM\n comment\n previousTime\n }\n }\n ';d(o)}}):s.a.createElement(s.a.Fragment,null)):s.a.createElement("div",null,"No data")})).setNoPadding().setPanelOptions((function(e){e.addTextInput({path:"eventMetric",name:"Event Metric",description:"Name of Query Metric with Event Data",defaultValue:"Events"}).addTextInput({path:"reasonMetric",name:"Reason Metric",description:"Name of Query Metric with Reason Data",defaultValue:"Reasons"})}))}])})); //# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/Standalone/grafana/plugins/libre-event-editor-panel/module.js.LICENSE.txt b/Standalone/grafana/plugins/libre-event-editor-panel/module.js.LICENSE.txt index c18ab1d..07bed6d 100644 --- a/Standalone/grafana/plugins/libre-event-editor-panel/module.js.LICENSE.txt +++ b/Standalone/grafana/plugins/libre-event-editor-panel/module.js.LICENSE.txt @@ -12,3 +12,12 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ + +/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/Standalone/grafana/plugins/libre-event-editor-panel/plugin.json b/Standalone/grafana/plugins/libre-event-editor-panel/plugin.json index 95eba81..0b0a68f 100644 --- a/Standalone/grafana/plugins/libre-event-editor-panel/plugin.json +++ b/Standalone/grafana/plugins/libre-event-editor-panel/plugin.json @@ -33,7 +33,7 @@ ], "screenshots": [], "version": "1.0.0", - "updated": "2021-10-07" + "updated": "2022-01-18" }, "dependencies": { "grafanaDependency": ">=7.0.0",