diff options
Diffstat (limited to '')
-rw-r--r-- | web/gui/v2/6181.007ffc3728cc5a74130a.chunk.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/web/gui/v2/6181.007ffc3728cc5a74130a.chunk.js b/web/gui/v2/6181.007ffc3728cc5a74130a.chunk.js new file mode 100644 index 000000000..4fd461222 --- /dev/null +++ b/web/gui/v2/6181.007ffc3728cc5a74130a.chunk.js @@ -0,0 +1 @@ +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9ed39e90-0dcc-45d5-aa71-1ea4d9548e4f",e._sentryDebugIdIdentifier="sentry-dbid-9ed39e90-0dcc-45d5-aa71-1ea4d9548e4f")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[6181],{16512:function(e,t,n){n.d(t,{Q0:function(){return o},R4:function(){return m},TT:function(){return i},WL:function(){return d},Y:function(){return c},by:function(){return s},qY:function(){return l},rU:function(){return f},xL:function(){return u}});var a=n(71893),r=n(93416),o=a.default.img.withConfig({displayName:"styled__Illustration",componentId:"sc-1yhntgl-0"})(["margin:0 auto;"]),l=(0,a.default)(r.Text).withConfig({displayName:"styled__StyledText",componentId:"sc-1yhntgl-1"})(["display:block;"]),c=a.default.div.withConfig({displayName:"styled__TextHeader",componentId:"sc-1yhntgl-2"})(["margin-bottom:",";font-weight:700;"],(0,r.getSizeBy)(2)),d=a.default.div.withConfig({displayName:"styled__StaticCheckmarks",componentId:"sc-1yhntgl-3"})(["margin-top:",";margin-bottom:",";"],(0,r.getSizeBy)(2),(0,r.getSizeBy)(5)),i=a.default.div.withConfig({displayName:"styled__CheckmarkLine",componentId:"sc-1yhntgl-4"})(["display:flex;align-items:center;"]),u=(0,a.default)(r.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1yhntgl-5"})(["margin-right:4px;height:18px;> use{fill:",";}"],(0,r.getColor)("primary")),s=(0,a.default)(u).withConfig({displayName:"styled__HelpIcon",componentId:"sc-1yhntgl-6"})(["vertical-align:middle;"]),m=a.default.div.withConfig({displayName:"styled__LearnMoreSection",componentId:"sc-1yhntgl-7"})(["margin-top:",";"],(0,r.getSizeBy)(4)),f=a.default.a.withConfig({displayName:"styled__Link",componentId:"sc-1yhntgl-8"})(["text-decoration:underline;color:",";&:visited{color:",";}"],(0,r.getColor)("success"),(0,r.getColor)("success"))},76181:function(e,t,n){n.r(t),n.d(t,{default:function(){return it}});var a=n(67294),r=n(89250),o=n(39878),l=n(4474),c=n(74059),d=n(29748),i=n(37518),u=n(5934),s=n(47133),m=n(54227),f=n(79619),h=n(78266),g=function(){return a.createElement(h.Z,{title:"Loading charts...","data-testid":"dashboardLoading"})},p=n(29439),b=n(61152),E=n(87462),v=n(45987),y=n(93416),C=n(87574),x=n(97945),w=["compact"],I=function(e){var t=e.compact,n=(0,v.Z)(e,w),r=(0,b.Z)("addChartModal"),o=(0,p.Z)(r,2)[1],l=(0,x.Mm)().length>0;return a.createElement(y.Flex,(0,E.Z)({column:!0,alignItems:"center",justifyContent:"center",overflow:{vertical:"auto"},flex:!0,basis:0,"data-testid":"dashboardBlankSlate"},n),!t&&a.createElement(y.Flex,{as:"img",src:C.X,height:"35%"}),a.createElement(y.H3,{margin:[6,0,2]},"Empty Dashboard"),l?a.createElement(a.Fragment,null,a.createElement(y.Text,{textAlign:"center"},"Let\u2019s fill your dashboard."),a.createElement(y.Text,{textAlign:"center"},"Go to a node view or node list and add one chart to this Dashboard or just use")):a.createElement(a.Fragment,null,a.createElement(y.Text,{textAlign:"center"},"You don't have any available node to retrieve charts from."),a.createElement(y.Text,{textAlign:"center"},"Please verify your nodes' state and/or connect a new node to Netdata")),!t&&a.createElement(y.Button,{margin:[8,0,0,0],onClick:o,disabled:!l,label:"Add chart","data-testid":"dashboardBlankSlate-addChart"}))},D=n(93433),k=(n(92222),n(21249),n(57640),n(9924),n(69826),n(41539),n(31672),n(2490),n(59461),n(2707),n(47941),n(16645)),O=n(7693),Z=n(92903),S=n(96929),_=n(40970),j=n(84147),T=n(91128),M=n(97723),N=n(4942),P=(n(15581),n(34514),n(54747),n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070),n(89692)),F=n(16978),L=n(9058),B=n(82351),A=function(){return a.createElement(y.Flex,{column:!0,width:"300px",gap:1},a.createElement(y.TextSmall,{strong:!0,color:"white"},"Not finding a chart?"),a.createElement(y.TextSmall,{color:"white"},"When selecting",a.createElement(y.TextSmall,{strong:!0,color:"white",margin:[0,1]},"All Nodes"),"you search and add charts using their context. The outcome will be a composite chart over All Nodes, like on the Overview tab."),a.createElement(y.TextSmall,{color:"white"},"When you select a",a.createElement(y.TextSmall,{strong:!0,color:"white",margin:[0,1]},"specific Node"),"you search and add charts using their name. The result is a specific chart over the node selected, like on Single Node tab."))},H=function(){return a.createElement(B.Z,{isBasic:!0,plain:!0,content:A,align:"bottom"},a.createElement(y.Icon,{name:"question",color:"textDescription",size:"small"}))};function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){(0,N.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var z=function(e){var t=e.spaceId,n=e.roomId,r=e.value,o=e.onChange,l=e.options,c=e.testid,d=e.selectedNodeIds,i=null===r||void 0===r?void 0:r.value,u=(0,L.e)(),s=(0,j.Cd)(i&&n,i),m=(0,a.useMemo)((function(){u.getNodes({id:"newDashboardChart"}).forEach((function(e){return e.destroy()}));var e=(0,P.ZP)(s),a=e.info,r=e.valueRange,o=e.height,l=e.colors,c=u.makeChart({attributes:R({id:"newDashboardChart",contextScope:[i],host:"/api/v3/spaces/".concat(t,"/rooms/").concat(n),roomId:n,info:a,valueRange:r,height:o+207,enabledNavigation:!1,selectedNodes:d},l&&{colors:l})});return u.getRoot().appendChild(c),c}),[u,i]);return(0,a.useEffect)((function(){return function(){return m.destroy()}}),[]),a.createElement(y.Flex,{gap:6,column:!0},a.createElement(y.Flex,{gap:2,column:!0,"data-testid":c},a.createElement(y.Flex,{gap:2},a.createElement(y.H5,null,"Context in room overview"),a.createElement(H,null)),a.createElement(y.Select,{options:l,value:r,onChange:o,isClearable:!0,form:c})),r&&a.createElement(y.Flex,{height:{min:"320px"},column:!0},a.createElement(F.Z,{chart:m,margin:[2,0,0]})))},J={label:"All Nodes",value:"all-nodes"},V={label:"All Nodes (no reachable nodes)",value:"all-nodes",isDisabled:!0},W=function(e){var t=e.id,n=e.isLive,a=e.nodeStatus,r=e.name;return{label:n?r:"".concat(r," (").concat(a,")"),value:t,isDisabled:!n}},Y=function(e){return{value:e,label:e}},q=function(e){var t=e.id,n=e.onClose,r=(0,c.th)(),o=(0,i.UL)(),l=(0,s.LJ)(t,"name"),d=(0,i.Hm)("name"),u=(0,S.zN)(),m=(0,x.HZ)().length>0,f=(0,S.fD)(),h=(0,x.Ne)(u),g=(0,M.jN)(t),b=m?J:V,E=(0,a.useState)(b.value),v=(0,p.Z)(E,2),C=v[0],w=v[1],I=(0,a.useState)(null),N=(0,p.Z)(I,2),P=N[0],F=N[1],B=(0,a.useMemo)((function(){return[b].concat((0,D.Z)(h.map(W)))}),[h]),A=(0,a.useMemo)((function(){return B.find((function(e){return e.value===C}))}),[B,C]),H=(0,a.useCallback)((function(e){w((null===e||void 0===e?void 0:e.value)||b.value),F(null)}),[]),U=(0,a.useMemo)((function(){return C===b.value?[]:[C]}),[C]),R=(0,_.Z)(o,U,{spaceId:r});if(R)throw R;var q=(0,j.Cd)(o),K=(0,a.useMemo)((function(){return Object.keys(q).sort((function(e,t){return e.localeCompare(t,void 0,{sensitivity:"accent",ignorePunctuation:!0})})).map(Y)}),[q]);(0,a.useEffect)((function(){K.length&&A&&F((function(e){return e||K[0].value}))}),[P,K,A]);var Q=(0,a.useMemo)((function(){return P&&Y(P)}),[P]),X=(0,a.useCallback)((function(e){return F(null===e||void 0===e?void 0:e.value)}),[]),G=q[P],$=(0,L.e)(),ee=(0,a.useCallback)((function(){var e=$.getNode({id:"newDashboardChart"}).getAttributes(),t=e.aggregationMethod,a=e.selectedDimensions,r=e.groupBy,o=e.groupByLabel,l=e.groupingMethod,c=e.chartType,d=e.selectedLabels,i=e.selectedNodes,u=e.selectedInstances,s=e.nodesScope,m=e.contextScope;g(m,{aggregationMethod:t,selectedDimensions:a,groupBy:r,groupByLabel:o,groupingMethod:l,chartType:c,selectedLabels:d,selectedNodes:i,selectedInstances:u,nodesScope:s},(function(){return setTimeout(n)}))}),[C,G]),te=!P,ne=(0,T.Z)();return(0,a.useEffect)((function(){return ne(!0),function(){return ne(!1)}})),a.createElement(k.u6,{onClose:n},a.createElement(O.x,{onClose:n,title:"Add Chart to Dashboard"},a.createElement(y.Button,{label:"Add chart",icon:"plus",onClick:ee,disabled:te,"data-testid":"addChartModal-addChart-button"})),a.createElement(Z.B,null,"Add Charts to ",l),a.createElement(k.TZ,{overflow:"visible"},a.createElement(y.Flex,{gap:6,column:!0},a.createElement(y.Flex,{gap:2,column:!0,"data-testid":"addChartModal-selectNodes"},a.createElement(y.H5,null,"Nodes in ",d),a.createElement(y.Select,{options:B,value:A,onChange:H,isLoading:!f,isClearable:!0,form:"addChartModal-selectNodes"})),Q&&a.createElement(z,{id:t,spaceId:r,roomId:o,value:Q,onChange:X,options:K,testid:"addChartModal-selectChart",selectedNodeIds:U}))))},K=n(91268),Q=n(38626),X=function(e){var t=e.id,n=(0,s.LJ)(t,"name");return a.createElement(Q.Z,{TextComponent:y.H0,text:n})},G=function(){var e=(0,b.Z)("addChartModal"),t=(0,p.Z)(e,2)[1];return(0,x.Mm)().length>0?a.createElement(y.Button,{neutral:!0,flavour:"hollow",label:"Add chart",icon:"chart_added",onClick:t,"data-testid":"dashboardHeaderActionBar-addChart-button","data-ga":"action-bar::click-add-chart::cust-dashboard"}):null},$=function(e){var t=e.id,n=(0,M.Kq)(t);return a.createElement(y.Button,{neutral:!0,flavour:"hollow",label:"Add text",icon:"text_add",onClick:n,"data-testid":"dashboardHeaderActionBar-addText-button","data-ga":"action-bar::click-add-text::cust-dashboard"})},ee=n(93017),te=n(67336),ne=n(14428),ae=function(e){var t=e.id,n=(0,ee.Z)(),r=(0,p.Z)(n,2)[1],o=(0,te.O9)(t,{onFail:r}),l=(0,s.LJ)(t,"processing"),c=(0,s.LJ)(t,"isOwner"),d=(0,s.DS)(t);return a.createElement(ne.Z,{permission:c?"dashboard:Update":"dashboard:UpdateSelf",flavour:"hollow",label:"Save",icon:"save",onClick:o,disabled:d,isLoading:l,"data-testid":"dashboardHeaderActionBar-save-button","data-ga":"action-bar::click-save::cust-dashboard"})},re=function(e){var t=e.id;return a.createElement(y.Flex,{gap:2},a.createElement(G,null),a.createElement($,{id:t}),a.createElement(ae,{id:t}))},oe=(0,a.memo)(re),le=n(71992),ce=n(46667),de=n(62200),ie=n(59112),ue=n(16512),se=function(e){var t=e.close,n=(0,a.useState)(!0),o=(0,p.Z)(n,2),l=o[0],c=o[1],d=(0,s.r0)(),u=(0,s.HI)({id:d,key:"name"}),f=(0,p.Z)(u,2),h=f[0],g=f[1],b=(0,a.useState)(h),E=(0,p.Z)(b,2),v=E[0],x=E[1],w=(0,te.O9)(d),I=(0,m.UK)(),D=(0,r.s0)(),S=(0,i.A3)(),_=v.length>0,j=l&&_&&v!==h,T=(0,a.useCallback)((function(){g(v),w().then((function(e){var n=e.data.slug,a="".concat(S,"/dashboards/").concat(n);I({id:d,slug:n,path:a}),D(a,{replace:!0}),t()}))}),[t,v,d,S]);return a.createElement(k.u6,{onClose:t,"data-testid":"renameDashboard-modal"},a.createElement(O.x,{onClose:t,title:"Rename Dashboard"},a.createElement(y.Button,{label:"Save Changes",onClick:T,disabled:!j})),a.createElement(Z.B,{"data-testid":"renameDashboard-title"},"Rename dashboard ",h),a.createElement(k.TZ,null,a.createElement(ie.Z,{value:v,label:"Name",onChange:function(e){x(e.target.value)},isValid:l,setIsValid:c,isDirty:_,instantFeedback:"all",onKeyDown:function(e){return e.keyCode===de.DV&&j&&T()},"data-testid":"renameDashboard-input"}),a.createElement(y.Flex,{column:!0,justifyContent:"between",height:"100%",margin:[8,0,16],"data-testid":"renameDashboard-learnMoreSection"},a.createElement(ue.R4,null,a.createElement(ue.by,{name:"help"}),a.createElement(y.Text,null,"Learn more about Dashboards")," ",a.createElement(ue.rU,{href:"https://learn.netdata.cloud/docs/cloud/visualize/dashboards",target:"_blank",rel:"noopener noreferrer"},"In our documentation")),a.createElement(ue.Q0,{src:C.X}))))},me=function(){var e=(0,r.s0)(),t=(0,c.uk)(),n=(0,i.vf)(),o=(0,s.r0)(),l=(0,s.LJ)(o).name,d=(0,i.Hm)("name"),u=(0,ce.Z)(),m=(0,p.Z)(u,4),f=m[0],h=m[2],g=m[3],b=(0,ce.Z)(),E=(0,p.Z)(b,4),v=E[0],C=E[2],x=E[3],w=(0,a.useCallback)((function(){e("/spaces/".concat(t,"/rooms/").concat(n,"/dashboards"))}),[t,n]),I=(0,M.CO)(o,{onSuccess:w});return a.createElement(a.Fragment,null,a.createElement(le.Z,{category:"dashboard",context:"title",testId:"dashboardDropdown"},(function(e){var t=e.close;return a.createElement(a.Fragment,null,a.createElement(le.h,{icon:"pencilOutline",onClick:function(){t(),C()},"data-testid":"renameDashboard-option","data-ga":"dropdown-item::click-rename-dashboard::cust-dashboard"},"Rename Dashboard"),a.createElement(le.h,{icon:"trashcan",color:"errorText",onClick:function(){t(),h()},"data-testid":"removeDashboard-option","data-ga":"dropdown-item::click-remove-dashboard::cust-dashboard"},"Delete Dashboard"))})),v&&a.createElement(se,{close:x}),f&&a.createElement(y.ConfirmationDialog,{confirmLabel:"Yes, delete","data-ga":"delete-dashboard-dialog","data-testid":"deleteDashboardDialog",handleConfirm:I,handleDecline:g,message:a.createElement(a.Fragment,null,"You are about to delete ",a.createElement("strong",null,l)," from ",a.createElement("strong",null,d),".",a.createElement("br",null),"Are you sure you want to continue?"),title:"Delete ".concat(l)}))},fe=function(e){var t=e.id;return a.createElement(y.Flex,{justifyContent:"between",padding:[3,2.5],"data-testid":"dashboardHeader"},a.createElement(y.Flex,{alignItems:"center"},a.createElement(me,null),a.createElement(X,{id:t})),a.createElement(oe,{id:t}))},he=(0,a.memo)(fe),ge=n(69968),pe=n.n(ge),be=(n(48564),n(79424),n(41943)),Ee=["style","className","onMouseDown","onMouseUp","onTouchEnd","children"],ve=["id","Component"],ye=(0,ge.WidthProvider)(pe()),Ce=(0,a.forwardRef)((function(e,t){var n=e.style,r=e.className,o=e.onMouseDown,l=e.onMouseUp,c=e.onTouchEnd,d=e.children,i=(0,v.Z)(e,Ee);return a.createElement("div",(0,E.Z)({style:n,className:r,ref:t,onMouseDown:o,onMouseUp:l,onTouchEnd:c},i),d.map((function(e){return"function"===typeof e?e({onMouseDown:o,onMouseUp:l,onTouchEnd:c}):e})))})),xe=function(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,minH:e.minH}},we=function(e){var t=e.id,n=e.Component,r=(0,v.Z)(e,ve),o=(0,be.ZL)(t),l=(0,p.Z)(o,2),c=l[0],d=l[1],i=(0,a.useCallback)((function(e){var t=e.map(xe);d(t)}),[]),u=(0,a.useMemo)((function(){return c.map((function(e){var r=e.i;return a.createElement(Ce,{key:r},(function(e){return a.createElement(n,(0,E.Z)({key:r,id:t,cardId:r},e))}))}))}),[c]);return a.createElement(y.Flex,{column:!0,gap:2,width:"100%",overflow:"auto"},a.createElement(ye,(0,E.Z)({},r,{layout:c,onLayoutChange:i,measureBeforeMount:!0,useCSSTransforms:!0,preventCollision:!1,isDroppable:!0}),u))};we.defaultProps={rowHeight:30,cols:12};var Ie=we,De=n(45215),ke=n(22841),Oe=n(71893),Ze=(0,Oe.default)(y.Flex).attrs({height:"100%",background:"mainBackground",round:!0,cursor:"move"}).withConfig({displayName:"container__Card",componentId:"sc-esi601-0"})(["box-shadow:0px 0px 1px rgba(0,0,0,0.04),0px 2px 6px rgba(0,0,0,0.04),0px 10px 20px rgba(0,0,0,0.04);"]),Se=(0,Oe.default)(y.Flex).attrs({column:!0,cursor:"default",height:{max:"100%"},overflow:"hidden",onMouseDown:function(e){return e.stopPropagation()}}).withConfig({displayName:"content__CardContent",componentId:"sc-1x8kdiw-0"})([""]),_e=function(e){var t=e.chart;return a.createElement(Se,{flex:!0,"data-testid":"chartContent"},a.createElement(F.Z,{chart:t}))},je=["id","cardId","onMouseDown","onMouseUp","onTouchEnd"],Te=["nodeId"];function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(n),!0).forEach((function(t){(0,N.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pe=(0,a.memo)((function(e){var t=e.id,n=e.cardId,r=e.onMouseDown,o=e.onMouseUp,l=e.onTouchEnd,c=(0,v.Z)(e,je),d=(0,L.e)(),i=(0,ke._q)(t,n)||{},u=i.nodeId,s=(0,v.Z)(i,Te),m=(0,a.useMemo)((function(){var e=d.makeChart({attributes:Ne(Ne({cardId:n,dashboardId:t},s),!!u&&{nodesScope:[u]}),makeTrack:De.vL});return(0,De.ZO)(d,t).appendChild(e),e}),[t,n]);return(0,a.useLayoutEffect)((function(){m.updateAttributes({onMouseDownDrag:r,onMouseUpDrag:o,onTouchEndDrag:l})}),[r,o,l]),a.createElement(Ze,(0,E.Z)({"data-testid":"chartCard-".concat((s.contextScope||[]).join(","))},c),a.createElement(_e,{chart:m}))})),Fe=Pe,Le="text",Be="customDashboard",Ae=function(e){var t=e.id,n=e.cardId,r=e.onClick,o=(0,ke.I_)(t,n,"editing"),l=(0,ke.IT)(t,n,"editing");return a.createElement(le.h,{icon:"pencilSolid",onClick:function(){r(),l(!0)},"data-ga":"".concat(Le,"-reset::").concat(Be),"data-testid":"textCard-edit",disabled:o},"Edit")},He=function(e){var t=e.id,n=e.cardId,r=(0,M.Zj)(t,n);return a.createElement(le.h,{icon:"trashcan",onClick:r,"data-ga":"".concat(Le,"-reset::").concat(Be),"data-testid":"textCard-remove"},"Remove")},Ue=function(e){var t=e.id,n=e.cardId;return a.createElement(le.Z,{category:Le,context:Be,testId:"chartTextDropdown"},(function(e){var r=e.close;return a.createElement(a.Fragment,null,a.createElement(Ae,{id:t,cardId:n,onClick:r}),a.createElement(He,{id:t,cardId:n}))}))},Re=function(e){var t=e.id,n=e.cardId;return a.createElement(y.Flex,{alignSelf:"start","data-testid":"textCardHeader"},a.createElement(Ue,{id:t,cardId:n}))},ze=(n(66992),n(88674),n(78783),n(33948),(0,n(2145).Z)((function(){return Promise.all([n.e(5575),n.e(1189)]).then(n.bind(n,8937))}),"Editor")),Je=function(e){return a.createElement(a.Suspense,{fallback:""},a.createElement(ze,e))},Ve=(0,Oe.default)(y.Flex).attrs({as:"form",column:!0,flex:!0,gap:2,onMouseDown:function(e){return e.stopPropagation()}}).withConfig({displayName:"form__CardContent",componentId:"sc-3tcqxu-0"})(["cursor:auto;"]),We={toolbar:!1,placeholder:{text:"Type your text",hideOnClick:!1}},Ye=function(e){var t=e.id,n=e.cardId,r=(0,ke.I_)(t,n,"text"),o=(0,ke.IT)(t,n,"editing"),l=(0,ke.IT)(t,n,"text"),c=(0,a.useState)(r),d=(0,p.Z)(c,2),i=d[0],u=d[1],s=(0,a.useCallback)((function(){return o(!1)}),[]),m=(0,a.useCallback)((function(){l(i),o(!1)}),[i]);return a.createElement(Ve,{"data-testid":"textCardForm"},a.createElement(y.Flex,{round:!0,border:!0,padding:[2],column:!0},a.createElement(Je,{autoFocus:!0,text:i,options:We,onChange:u})),a.createElement(y.Flex,{justifyContent:"end",gap:1},a.createElement(y.Button,{type:"button",flavour:"borderless",label:"Cancel",small:!0,width:"initial",onClick:s,"data-testid":"textCardForm-cancel"}),a.createElement(y.Button,{type:"button",label:"Done",small:!0,width:"initial",onClick:m,"data-testid":"textCardForm-done"})))},qe=function(e){return e.stopPropagation()},Ke={toolbar:!1,disableEditing:!0,placeholder:{text:"Type your text",hideOnClick:!1}},Qe=function(e){var t=e.id,n=e.cardId,r=(0,ke.I_)(t,n,"text");return a.createElement(y.Box,{"data-testid":"textCardContent",onMouseDown:qe},a.createElement(Je,{text:r,options:Ke}))},Xe=(0,Oe.default)(Ze).withConfig({displayName:"text__StyledCard",componentId:"sc-1f67m9f-0"})(["cursor:move;"]),Ge=["id","cardId"],$e={chart:Fe,text:(0,a.memo)((function(e){var t=e.id,n=e.cardId,r=(0,ke.I_)(t,n,"editing");return a.createElement(Xe,{column:!0,"data-testid":"textCard"},a.createElement(Re,{id:t,cardId:n}),r&&a.createElement(Ye,{id:t,cardId:n}),!r&&a.createElement(Qe,{id:t,cardId:n}))}))},et=function(e){var t=e.id,n=e.cardId,r=(0,v.Z)(e,Ge),o=(0,ke.I_)(t,n,"type"),l=$e[o]||$e.chart;return a.createElement(l,(0,E.Z)({id:t,cardId:n},r))},tt=["id"],nt=function(e){var t=e.id,n=(0,v.Z)(e,tt);return(0,De.ZP)(t),a.createElement(Ie,(0,E.Z)({id:t,Component:et},n))};function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function rt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?at(Object(n),!0).forEach((function(t){(0,N.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ot=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,a.useContext)(r.Us).navigator,o=(0,r.TH)();(0,a.useEffect)((function(){if(t){var a=n.block((function(t){var n=rt(rt({},t),{},{retry:function(){a(),t.retry()}});e(n)}));return a}}),[n,e,t,o])}((0,a.useCallback)((function(t){"REPLACE"!==t.action?window.confirm(e)&&t.retry():t.retry()}),[e]),t)},lt=function(e){var t=e.id,n=(0,b.Z)("addChartModal"),r=(0,p.Z)(n,4),o=r[0],l=r[3],c=(0,s.LJ)(t),d=c.fullyLoaded,i=c.cardIds;return function(e){var t=(0,s.DS)(e);ot("Are you sure you want to leave this dashboard?\nChanges will be lost.",!t)}(t),a.createElement(K.Z,{padding:[3],margin:[0,0,8]},a.createElement(he,{id:t}),d&&i.length>0&&a.createElement(nt,{id:t}),d&&0===i.length&&a.createElement(I,null),o&&a.createElement(q,{id:t,onClose:l}))},ct=n(82210),dt=n(63346),it=(0,a.memo)((function(){(0,d.Z)(),function(){var e=(0,r.UO)().dashboardSlug,t=(0,o.Jh)(),n=(0,o.FP)();(0,a.useEffect)((function(){n!==e&&t(e)}),[n,e]),(0,a.useEffect)((function(){return function(){return t(null)}}),[])}(),(0,l.Pf)();var e=(0,c.th)(),t=(0,c.uk)(),n=(0,i.UL)(),h=(0,i.vf)(),p=(0,s.r0)(),b=(0,s.FV)("slug"),E=(0,s.FV)("state");(0,m.bV)({title:b,id:p,destination:b,type:"dashboards"});var v=(0,u.L)();return(0,f.Z)(v&&p,{spaceId:e,spaceSlug:t,roomId:n,roomSlug:h})?a.createElement(g,null):a.createElement(dt.ZP,{feature:"Dashboard",dashboardId:p},"notAvailable"==E?a.createElement(ct.Z,{flavour:"dashboard"}):a.createElement(lt,{id:p}))}))}}]);
\ No newline at end of file |