PageSourceSearch

https://app.cloudfix.com/_next/static/chunks/4151-5146d388df07c46a.js

js cloudfix.com collected 2026-09-24 18:30:27 UTC 79,751 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4151],{3750:function(e,t,l){l.d(t,{v:function(){return r}});var s=l(53704),a=l(53762),n=l(16396),i=l(21902);a.kL.register(a.uw,a.f$,a.ZL,a.Dx,a.u,a.De);let r=e=>{let{config:t}=e;(0,i.useEffect)(()=>{let e=async()=>{{let e=(await l.e(5351).then(l.bind(l,75351))).default;a.kL.register(e)}};e()},[]);let r=["rgba(54, 162, 235, 0.5)","rgba(255, 99, 132, 0.5)","rgba(75, 192, 192, 0.5)","rgba(255, 206, 86, 0.5)"],o={labels:t.labels,datasets:t.series.map((e,t)=>({label:e.label,data:e.data,backgroundColor:r[r.length-1-t%r.length],borderColor:r[r.length-1-t%r.length].replace("0.5","1"),borderWidth:1,borderRadius:4,barPercentage:.9,categoryPercentage:.8})).reverse()},c={responsive:!0,maintainAspectRatio:!0,aspectRatio:2,scales:{x:{stacked:!0,title:{display:!!t.xAxisLabel,text:t.xAxisLabel,font:{weight:"bold"}},grid:{display:!1}},y:{stacked:!1,beginAtZero:!0,title:{display:!!t.yAxisLabel,text:t.yAxisLabel,font:{weight:"bold"}},grid:{color:"rgba(0, 0, 0, 0.1)"},...void 0!==t.yMin&&{min:t.yMin},...void 0!==t.yMax&&{max:t.yMax}}},plugins:{title:{display:!!t.title,text:t.title||"",font:{size:16,weight:"bold"},padding:{bottom:20}},legend:{position:"top",labels:{padding:20,boxWidth:12,usePointStyle:!0}},tooltip:{backgroundColor:"rgba(255, 255, 255, 0.9)",titleColor:"#000",bodyColor:"#000",borderColor:"rgba(0, 0, 0, 0.1)",borderWidth:1,padding:10,callbacks:{label:e=>{let t=e.parsed.y;return" ".concat(e.dataset.label,": ").concat(t.toLocaleString())}}},zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:"x"}}}};return(0,s.jsx)("div",{className:"relative mt-4 h-[400px] w-full max-w-[800px] rounded-lg bg-white p-4 shadow-sm",children:(0,s.jsx)(n.$Q,{data:o,options:c})})}},1876:function(e,t,l){l.d(t,{w:function(){return d}});var s=l(53704),a=l(53762),n=l(16396),i=l(21902),r=l(19064);let o=["avg","min","max"],c=["rgba(255, 99, 132, 0.8)","rgba(54, 162, 235, 0.8)","rgba(255, 205, 86, 0.8)","rgba(75, 192, 192, 0.8)","rgba(153, 102, 255, 0.8)","rgba(255, 159, 64, 0.8)"];a.kL.register(a.uw,a.f$,a.od,a.jn,a.Dx,a.u,a.De,{id:"crosshair",afterDatasetsDraw:e=>{var t,l;let{ctx:s,chartArea:a}=e,{top:n,bottom:i}=a;if((null===(t=e.tooltip)||void 0===t?void 0:t.opacity)===0)return;let r=null===(l=e.tooltip)||void 0===l?void 0:l.dataPoints;if(!r||0===r.length)return;let o=r[0].element.x;s.save(),s.beginPath(),s.setLineDash([5,5]),s.lineWidth=1,s.strokeStyle="rgba(102, 102, 102, 0.8)",s.moveTo(o,n),s.lineTo(o,i),s.stroke(),s.restore()}},{id:"verticalLines",afterDatasetsDraw:e=>{var t;let{ctx:l,chartArea:s}=e,{top:a,bottom:n,left:i,right:r}=s,o=null===(t=e.config.options)||void 0===t?void 0:t.verticalLines;o&&0!==o.length&&(l.save(),o.forEach(e=>{let t=i+e.position*(r-i);t<i||t>r||(l.beginPath(),l.setLineDash([3,3]),l.lineWidth=2,l.strokeStyle="rgba(255, 99, 132, 0.8)",l.moveTo(t,a),l.lineTo(t,n),l.stroke())}),l.restore())}},{id:"linearLines",afterDatasetsDraw:e=>{var t;let{ctx:l,chartArea:s,scales:a}=e,{top:n,bottom:i,left:r,right:o}=s,d=null===(t=e.config.options)||void 0===t?void 0:t.linearLines;d&&0!==d.length&&(l.save(),d.forEach((e,t)=>{let s=a.y,d=c[t%c.length],u=s.getPixelForValue(e.startY),x=s.getPixelForValue(e.endY);(u<n||u>i)&&(x<n||x>i)||(l.beginPath(),l.setLineDash([5,5]),l.lineWidth=2,l.strokeStyle=d,l.moveTo(r,u),l.lineTo(o,x),l.stroke())}),l.restore())}});let d=e=>{let{config:t}=e;(0,i.useEffect)(()=>{let e=async()=>{{let e=(await l.e(5351).then(l.bind(l,75351))).default;a.kL.register(e)}};e()},[]);let d=t.labelDensity||1,u=(0,r.nj)(d),[x,m]=(0,i.useState)(d),[p,f]=(0,i.useState)("avg"),h=(e,t,l)=>{let s=d/t;if(s<=1)return e;let a=[];for(let t=0;t<e.length;t+=s){let n;let i=e.slice(t,t+s);switch(l){case"min":n=Math.min(...i);break;case"max":n=Math.max(...i);break;default:n=i.reduce((e,t)=>e+t,0)/i.length}a.push(n)}return a},b={labels:t.labels.filter((e,t)=>t%(d/x)==0),datasets:[...t.series.map(e=>({label:e.label,data:h(e.data,x,p),fill:!1,borderColor:e.color,backgroundColor:e.color,borderWidth:1,pointRadius:1,pointStyle:"circle",pointBackgroun
1dColor:e.color,tension:.4,cubicInterpolationMode:"monotone"})),...(t.linearLines||[]).map((e,t)=>({label:e.label||"Linear Line ".concat(t+1),data:[],fill:!1,borderColor:c[t%c.length],backgroundColor:c[t%c.length],borderWidth:2,borderDash:[5,5],pointRadius:0,showLine:!1}))]},g=e=>{m(e)},y={responsive:!0,maintainAspectRatio:!0,aspectRatio:2,interaction:{mode:"index",intersect:!1},hover:{mode:"index",intersect:!1},scales:{x:{title:{display:!!t.xAxisLabel,text:t.xAxisLabel,padding:10,font:{size:12,weight:"bold"}},ticks:{maxRotation:45,minRotation:45}},y:{title:{display:!!t.yAxisLabel,text:t.yAxisLabel,padding:10,font:{size:12,weight:"bold"}},...void 0!==t.yMin&&{min:t.yMin},...void 0!==t.yMax&&{max:t.yMax}}},plugins:{title:{display:!!t.title,text:t.title||"",padding:{top:10,bottom:30},font:{size:16,weight:"bold"}},legend:{display:!0,position:"top"},tooltip:{enabled:!0,mode:"index",intersect:!1,position:"nearest",backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,titleColor:"white",bodyColor:"white",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,displayColors:!0,callbacks:{title:e=>{var t;return(null===(t=e[0])||void 0===t?void 0:t.label)||""},label:e=>{let t=e.dataset.label||"",l=e.parsed.y;return"".concat(t,": ").concat("number"==typeof l?l.toFixed(2):l)}}},zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:"x"}}},animation:!1,datasets:{line:{tension:.4}},verticalLines:t.verticalLine,linearLines:t.linearLines};return(0,s.jsxs)("div",{className:"relative mt-4 h-[400px] w-full max-w-[800px]",children:[(0,s.jsxs)("div",{className:"absolute inset-x-0 top-[40px] flex justify-between px-4",children:[d>1&&(0,s.jsx)("div",{className:"flex gap-1",children:u.map(e=>(0,s.jsx)("button",{onClick:()=>g(e),className:"rounded px-2 py-1 text-sm ".concat(x===e?"bg-blue-500 text-white":"bg-gray-100 text-black hover:bg-gray-200"),children:e},e))}),t.enableStats&&(0,s.jsx)("div",{className:"flex gap-1",children:o.map(e=>(0,s.jsx)("button",{onClick:()=>f(e),className:"rounded px-2 py-1 text-sm ".concat(p===e?"bg-blue-500 text-white":"bg-gray-100 text-black hover:bg-gray-200"),children:e},e))})]}),(0,s.jsx)(n.x1,{data:b,options:y})]})}},84685:function(e,t,l){l.d(t,{G:function(){return u}});var s=l(53704),a=l(53762),n=l(16396),i=l(21902);a.kL.register(a.f$,a.WV,a.od,a.jn,a.Dx,a.u,a.De);let r={OK:"rgba(75, 192, 192, 0.6)",INFO:"rgba(54, 162, 235, 0.6)",WARNING:"rgba(255, 206, 86, 0.6)",CRITICAL:"rgba(255, 99, 132, 0.6)"},o={OK:"rgba(75, 192, 192, 1)",INFO:"rgba(54, 162, 235, 1)",WARNING:"rgba(255, 206, 86, 1)",CRITICAL:"rgba(255, 99, 132, 1)"},c="Perfect Alignment",d={id:"updateReferenceLine",afterUpdate:e=>{let t=e.data.datasets.findIndex(e=>e.label===c);if(-1===t)return;let l=e.scales.x,s=e.scales.y;if(!l||!s)return;let a=l.min,n=l.max,i=s.min,r=s.max,o=Math.max(a,i),d=Math.min(n,r);e.data.datasets[t].data=[{x:o,y:o},{x:d,y:d}]}},u=e=>{var t;let{config:u,selectedSeverity:x,onSeverityToggle:m}=e;(0,i.useEffect)(()=>{let e=async()=>{{let e=(await l.e(5351).then(l.bind(l,75351))).default;a.kL.register(e,d)}};e()},[]);let p=(null===(t=u.series[0])||void 0===t?void 0:t.data)||[],f=p.reduce((e,t)=>{let l=t.severity||"OK";return e[l]||(e[l]=[]),e[l].push({x:t.x,y:t.y,businessUnit:t.businessUnit,severity:l,variancePercent:t.variancePercent}),e},{}),h=p.map(e=>e.x||0).filter(e=>e>0),b=p.map(e=>e.y||0).filter(e=>e>0);if(0===h.length||0===b.length)return(0,s.jsx)("div",{className:"relative mt-4 w-full max-w-6xl rounded-lg bg-white p-6 shadow-sm",children:(0,s.jsx)("div",{className:"flex h-64 items-center justify-center text-gray-500",children:"No budget data available."})});let g=Math.max(1,.5*Math.min(Math.min(...h),Math.min(...b))),y=1.15*Math.max(Math.max(...h),Math.max(...b)),v=Object.entries(f).filter(e=>{let[t]=e;return!x||t===x}).map(e=>{let[t,l]=e;return{label:t,data:l,backgroundColor:r[t],borderColor:o[t],borderWidth:2,pointRadius:8,pointHoverRadius:10}}),j={datasets:[...v,{label:c,type:"line",data:[{x:g,y:g},{x:y,y:y}],borderColor:"rgba(0, 0, 0, 0.3)",borderWidth:2,borderDash:[5,5],pointRadius:0,fill:!1,showLine:!0,tooltip:{callbacks:{label:()=>c}}}]},N={responsive:!0,maintainAspectRatio:!0,aspectRatio:1.5,scales:{x:{type:"logarithmic",position:"bottom",title:{display:!0,text:u.xAxisLabel||"Configured Budget Limit (USD)",font:{weight:"bold",size:14}},min:g,max:y,ticks:{maxTicksLimit:8,callback:e=>
1"$".concat(Math.round(Number(e)).toLocaleString())}},y:{type:"logarithmic",title:{display:!0,text:u.yAxisLabel||"Forecasted End-of-Quarter Cost (USD)",font:{weight:"bold",size:14}},min:g,max:y,ticks:{maxTicksLimit:8,callback:e=>"$".concat(Math.round(Number(e)).toLocaleString())}}},plugins:{title:{display:!!u.title,text:u.title||"Budget Alignment Scatter Plot",font:{size:18,weight:"bold"},padding:{bottom:20}},legend:{display:!0,position:"top",labels:{padding:15,usePointStyle:!0,pointStyle:"circle",font:{size:12}},onClick:(e,t)=>{let l=t.text;l!==c&&m&&m(l)}},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,titleColor:"white",bodyColor:"white",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,callbacks:{title:e=>{let t=e[0].raw;return t.businessUnit||"Business Unit"},label:e=>{let t=e.raw;return t.variancePercent&&t.severity?["Budget: $".concat(t.x.toLocaleString()),"Forecast: $".concat(t.y.toLocaleString()),"Variance: ".concat(t.variancePercent.toFixed(1),"%"),"Severity: ".concat(t.severity)]:["Budget: $".concat(t.x.toLocaleString(),", Forecast: $").concat(t.y.toLocaleString())]}}},zoom:{pan:{enabled:!0,mode:"xy"},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:"xy"}}},onClick:(e,t,l)=>{if(t.length>0){let e=l.data.datasets[t[0].datasetIndex].data[t[0].index];console.log("Clicked business unit:",e.businessUnit)}}};return(0,s.jsxs)("div",{className:"relative mt-4 w-full max-w-6xl rounded-lg bg-white p-6 shadow-sm",children:[(0,s.jsx)(n.bp,{data:j,options:N}),(0,s.jsxs)("div",{className:"mt-6 rounded-md bg-gray-50 p-4",children:[(0,s.jsx)("h4",{className:"mb-2 text-sm font-semibold text-gray-700",children:"Severity Levels:"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs text-gray-600 md:grid-cols-4",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"mr-2 size-3 rounded-full bg-green-500"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:"OK:"})," <95%"]})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"mr-2 size-3 rounded-full bg-blue-500"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:"INFO:"})," 95-99%"]})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"mr-2 size-3 rounded-full bg-yellow-500"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:"WARNING:"})," 100-109%"]})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"mr-2 size-3 rounded-full bg-red-500"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:"CRITICAL:"})," ≥110%"]})]})]})]})]})}},19064:function(e,t,l){l.d(t,{nj:function(){return i},py:function(){return n}});let s=e=>{let t=["rgb(75, 192, 192)","rgb(255, 99, 132)","rgb(54, 162, 235)","rgb(255, 159, 64)","rgb(153, 102, 255)","rgb(255, 205, 86)","rgb(201, 203, 207)"];if(e<=t.length)return t.slice(0,e);let l=Array.from({length:e-t.length},(l,s)=>{let a=360*(s+t.length)/e;return"hsl(".concat(a,", 70%, 50%)")});return[...t,...l]},a=e=>{let t={},l=e.trim().split("\n");return l.forEach(e=>{let[l,...s]=e.split(":").map(e=>e.trim());l&&s.length&&(t[l]=s.join(":").split("|").map(e=>e.trim()))}),t},n=e=>{try{var t,l,n,i,r,o,c,d,u,x,m,p,f;let h=a(e),b=Number(null===(t=h.labelDensity)||void 0===t?void 0:t[0])||1,g=null!==(m=null===(n=h.labels)||void 0===n?void 0:null===(l=n[0])||void 0===l?void 0:l.split(",").map(e=>e.trim()))&&void 0!==m?m:[],y=null!==(p=h.data)&&void 0!==p?p:[],v=null!==(f=h.seriesLabels)&&void 0!==f?f:y.map((e,t)=>"Series ".concat(t+1)),j=s(y.length),N=y.map((e,t)=>({label:v[t],data:e.split(",").map(Number),color:j[t]})),w=h.verticalLine?h.verticalLine.flatMap(e=>e.split("|").map(e=>{let t=e.trim();return{position:Number(t),label:""}}).filter(e=>!Number.isNaN(e.position)&&0!==e.position||0===e.position)):[],k=h.linearLabels?h.linearLabels.flatMap(e=>e.split("|").map(e=>e.trim())):[],C=0,S=h.linearLines?h.linearLines.flatMap(e=>e.split("|").map(e=>{let[t,l]=e.split(",").map(e=>Number(e.trim())),s={startY:t,endY:l,label:k[C]||""};return C++,s}).filter(e=>!Number.isNaN(Number(e.startY))&&!Number.isNaN(Number(e.endY)))):[];return{labels:g,series:N,title:null===(i=h.title)||void 0===i?void 0:i[0],xAxisLabel:null===(r=h.xAxisLabel)||void 0===r?void 0:r[0],yAxisLabel:null===(o=h.yAxisLabel)||void 0===o?void 0:o[0],yMin:(null===(c=h.yMin)||void 0===c?void 0:c[0])?Number(h.yMin[0]):void 0,yMax:(null===(d=h.yMax)||void 0===d?void 0:d[0])?Number(h.yMax[0]):void 0,labelDensity:b,enableStats:(null===(u=h.enableStats)||void 0===u?void 0:u[0])==="true",type:(null===(x=h.type)||void 0===x?void 0:x[0])||"line",verticalLine:w.length>0?w:void 0,linearLines:S.length>0?S:void 0}}catch(e){return console.error("Failed to parse chart config:",e),{labels:[],series:[],type:"line"}}},i=e=>{let t=[];for(let l=1;l<=e;l++)e%l==0&&t.push(l);return t.sort((e,t)=>
1e-t)}},25547:function(e,t,l){l.d(t,{R:function(){return L}});var s=l(49852),a=l(53704),n=l(20705),i=l(48397),r=l(3015),o=l(21902),c=l(1876),d=l(3750),u=l(53762),x=l(16396);u.kL.register(u.qi,u.Dx,u.u,u.De);let m=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#6B7280","#14B8A6"],p=e=>{var t;let{config:l}=e,s=(null===(t=l.series[0])||void 0===t?void 0:t.data)||[],n=s.map((e,t)=>m[t%m.length]),i={labels:l.labels,datasets:[{data:s,backgroundColor:n,borderColor:"#ffffff",borderWidth:2,hoverBorderWidth:3,hoverBackgroundColor:n.map(e=>{let t=e.replace("#",""),l=Math.floor(.5*Number.parseInt(t.substring(0,2),16)),s=Math.floor(.5*Number.parseInt(t.substring(2,4),16)),a=Math.floor(.5*Number.parseInt(t.substring(4,6),16));return"#".concat(l.toString(16).padStart(2,"0")).concat(s.toString(16).padStart(2,"0")).concat(a.toString(16).padStart(2,"0"))})}]},r={responsive:!0,maintainAspectRatio:!0,aspectRatio:1,plugins:{title:{display:!!l.title,text:l.title||"",padding:{top:10,bottom:20},font:{size:16,weight:"bold"}},legend:{display:!0,position:"bottom",labels:{padding:20,usePointStyle:!0,pointStyle:"circle"}},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,titleColor:"white",bodyColor:"white",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,displayColors:!0,callbacks:{label:e=>{let t=e.label||"",l=e.parsed,s=e.dataset.data.reduce((e,t)=>e+t,0);return"".concat(t,": ").concat(l," (").concat(s>0?Math.round(l/s*100):0,"%)")}}}},animation:{animateRotate:!0,animateScale:!1},cutout:"50%"};return(0,a.jsx)("div",{className:"relative mx-auto mt-4 h-[400px] w-full max-w-[400px]",children:(0,a.jsx)(x.$I,{data:i,options:r})})};var f=l(84685),h=l(19064);let b=e=>{let{config:t}=e;switch(console.log("Chart type from config:",t.type),t.type){case"bar":return(0,a.jsx)(d.v,{config:t});case"doughnut":return(0,a.jsx)(p,{config:t});case"scatter":return(0,a.jsx)(f.G,{config:t});default:return(0,a.jsx)(c.w,{config:t})}},g=e=>{let{charts:t}=e,[l,s]=(0,o.useState)(0);return(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)("div",{className:"mb-4 border-b border-gray-200",children:(0,a.jsx)("nav",{className:"-mb-px flex","aria-label":"Tabs",children:t.map((e,t)=>(0,a.jsx)("button",{onClick:()=>s(t),className:"relative min-w-0 flex-1 overflow-hidden whitespace-nowrap rounded-none bg-white px-1 py-4 text-center text-sm font-medium hover:bg-gray-50\n                ".concat(l===t?"text-blue-600":"text-gray-500 hover:border-gray-300 hover:text-gray-700"),style:{borderBottom:l===t?"2px solid #3b82f6":"2px solid #d1d5db"},"aria-current":l===t?"page":void 0,children:e.title},t))})}),(0,a.jsx)("div",{className:"flex justify-center p-4",children:(0,a.jsx)("div",{className:"w-full max-w-4xl",children:(0,a.jsx)(b,{config:t[l].config})})})]})};var y=l(97910),v=l(64144),j=l(46848),N=l(54512),w=l(98929),k=l(11347);function C(){let e=(0,s._)(["\n"],["\\n"]);return C=function(){return e},e}let S=new Map,E=e=>{if(S.has(e))return S.get(e);let t=(0,h.py)(e);return S.set(e,t),t},A=e=>{try{let t=e.trim().split("---").map(e=>{let t=e.trim(),l=E(t);return{title:l.title||"Chart",config:l}});return(0,a.jsx)(g,{charts:t})}catch(e){return console.error("Error parsing charts:",e),(0,a.jsx)("div",{children:"Error parsing charts"})}},T=e=>{let t=E(e);return(0,a.jsx)("div",{className:"flex w-full justify-center",children:(0,a.jsx)(b,{config:t})})},I=e=>{let t=e.trim().split("\n");return(0,a.jsx)("div",{className:"flex w-full justify-between gap-4 py-4",children:t.map((e,t)=>{let l=e.indexOf(","),s=e.substring(0,l).trim(),n=e.substring(l+1).trim(),i="text-teal-500";return 0===t?i="text-yellow-500":1===t&&(i="text-pink-500"),(0,a.jsxs)("div",{className:"flex-1 text-center",children:[(0,a.jsx)("div",{className:"text-base font-bold text-gray-900",children:s}),(0,a.jsx)("div",{className:"mt-2 text-4xl font-bold ".concat(i),children:n})]},t)})})},z={h1:e=>{let{...t}=e;return(0,a.jsxs)("h1",{className:"my-4 flex items-center justify-center text-center text-2xl font-bold",children:[(0,a.jsx)("img",{src:"https://cloudfix.com/wp-content/uploads/cropped-cloudfix_favicon-192x192.png",alt:"Cloudfix Logo",className:"mr-2 inline-block size-8"}),(0,a.jsx)("span",{...t})]})},h2:e=>{let{...t}=e;return(0,a.jsx)("h2",{className:"my-3 inline-block rounded-lg border border-cloudfix-blue bg-blue-50 px-4 py-2 text-xl font-semibold",...t})},h3:e=>{let{...t}=e;return(0,a.jsx)("h3",{className:"mb-3 mt-4 text-lg font-semibold text-gray-800",...t})},a:e=>{let{...t}=e;return(0,a.jsx)("a",{className:"font-bold text-cloudfix-blue",target:"_blank",...t})},code:e=>{let{className:t,children:l,...s}=e,n=String(l).trim(),i=/language-(\w+)/.exec(t||"");if(!i)return(0,a.jsx)("code",{className:"rounded bg-gray-200 px-1 py-0.5",...s,children:l});switch(i[1]){case"charts":return A(n);case"chart":return T(n);case"headlines":return I(n);default:return(0,a.jsx)("code",{className:"rounded bg-gray-200 px-1 py-0.5",...s,children:l})}},blockquote:e=>{let{...t}=e;
1return(0,a.jsx)("blockquote",{className:"my-4 rounded-r border-l-4 border-cloudfix-blue bg-blue-50 py-2 pl-4 italic text-gray-600",...t})},em:e=>{let{...t}=e;return(0,a.jsx)("em",{className:"text-sm text-gray-500",...t})},strong:e=>{let{...t}=e;return(0,a.jsx)("strong",{className:"text-base font-bold text-black",...t})},ul:e=>{let{...t}=e;return(0,a.jsx)("ul",{className:"my-2 ml-8 list-disc",...t})},ol:e=>{let{...t}=e;return(0,a.jsx)("ol",{className:"my-2 ml-8 list-decimal",...t})},li:e=>{let{...t}=e;return(0,a.jsx)("li",{className:"pl-2 marker:mr-4",...t})},table:e=>{let{...t}=e;return(0,a.jsx)("div",{className:"mx-auto my-4 flex w-full max-w-7xl justify-center",children:(0,a.jsx)("table",{className:"w-full border-collapse",...t})})},tr:e=>{let{...t}=e;return(0,a.jsx)("tr",{className:"transition-colors duration-150 hover:bg-gray-50",...t})},th:e=>{let{...t}=e;return(0,a.jsx)("th",{className:"border border-gray-300 bg-blue-50 px-4 py-2 text-left",...t})},td:e=>{let{...t}=e;return(0,a.jsx)("td",{className:"border border-gray-300 px-4 py-2",...t})}},R=()=>(0,a.jsx)(y.tmK,{className:"size-4 text-white hover:text-cloudfix-blue"});function L(e){var t;let{isPSAvailable:l,isActive:s,onClickClose:c,recommendationId:d}=e,[u,x]=(0,o.useState)(!1),[m,p]=(0,o.useState)(""),[f,h]=(0,o.useState)(!1),[b,g]=(0,o.useState)(!1),{createSharedReportMutation:S}=(0,N.Z)(),{setAlert:E}=(0,w.V)(),{getRecommendationReportQuery:A}=(0,k.h)(),T=A(d||"",s&&!!d),I=(null===(t=T.data)||void 0===t?void 0:t.finderReport)||"",L=u&&m?m.replaceAll(String.raw(C()),"\n"):I,{toPDF:D,targetRef:O}=(0,j.Eb)({filename:"".concat((()=>{let e=L.split("\n")[0];return e.startsWith("# ")?e.substring(2).trim():"cloudfix-report"})(),".pdf"),method:"open",page:{margin:20,format:"a4",orientation:"portrait"}}),F=(0,o.useRef)({content:"",processed:null}),M=e=>{if(e===F.current.content)return F.current.processed;let t=e?(0,a.jsx)(n.U,{className:"prose max-w-none",remarkPlugins:[i.Z],components:z,children:e}):null;return F.current={content:e,processed:t},t},[P,U]=L.split("### Resource Tags"),[V,_]=P.split("\n## Support\n"),q=(null==U?void 0:U.split("*")[0])||"",Z=q.split("\n").map(e=>{let[t,l]=e.replace("- ","").trim().split(": ");return{key:t,value:l}}).filter(e=>e.key&&e.value),W=null==_?void 0:_.trim();return(0,a.jsx)(r.u_,{isActive:s,onEscKeyDown:c,children:(0,a.jsxs)("div",{className:"absolute inset-y-5 mx-36 flex flex-col rounded-xl bg-white",children:[(0,a.jsx)("button",{className:"-mx-6 self-end",onClick:c,type:"button",children:(0,a.jsx)(y.b0D,{className:" fill-white stroke-white"})}),(0,a.jsx)("div",{className:"absolute right-0 top-0 -mx-6 mt-8 flex items-start gap-2 self-end",children:(0,a.jsx)("button",{className:"".concat(b?"cursor-not-allowed opacity-50":"hover:text-cloudfix-blue"," text-white transition-colors"),onClick:()=>{if(!b){if(!d){E({type:"error",messages:["Cannot share report: Recommendation ID is missing"]});return}g(!0),S.mutateAsync({recommendationId:d}).then(e=>{let t=e.data;navigator.clipboard.writeText(t.shareUrl),E({type:"success",messages:["Share link copied to clipboard!"]}),g(!1)}).catch(e=>{let t="Failed to create share link";e&&"object"==typeof e&&"response"in e&&e.response&&"object"==typeof e.response&&"data"in e.response&&(t="Failed to create share link: ".concat(String(e.response.data))),E({type:"error",messages:[t]}),g(!1)})}},type:"button",title:"Share this report",disabled:b,children:b?(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("svg",{className:"mt-1 size-4 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):(0,a.jsx)(R,{})})}),u&&(0,a.jsx)("div",{className:"w-full px-4",children:(0,a.jsx)("textarea",{className:"w-full rounded-md border border-gray-300 bg-gray-800 p-3 text-sm text-white",value:m,onChange:e=>p(e.target.value),placeholder:"Enter custom markdown here. Clear the field to show original content.",rows:4})}),(0,a.jsx)("div",{className:"absolute right-0 top-0 -mx-6 mt-16 flex items-start gap-2 self
1-end",children:(0,a.jsx)("button",{className:"text-white transition-colors hover:text-gray-600",onClick:()=>{navigator.clipboard.writeText(L)},type:"button",title:"Copy markdown",children:(0,a.jsx)(y.TIy,{size:16})})}),(0,a.jsx)("div",{className:"absolute right-0 top-0 -mx-6 mt-24 flex items-start gap-2 self-end",children:(0,a.jsx)("button",{className:"text-white transition-colors hover:text-gray-600",onClick:()=>D(),type:"button",title:"Download PDF",children:(0,a.jsx)(y._8t,{size:16})})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto pb-4",children:(0,a.jsxs)("div",{ref:O,"data-theme":"light",className:"markdown-body flex w-full flex-col gap-y-2 rounded-xl",children:[(0,a.jsx)("div",{className:"px-8 pb-2",children:M(V)}),(0,a.jsx)("div",{className:"space-y-4 px-5 pb-4",children:(0,a.jsxs)("div",{className:"rounded-lg",children:[(0,a.jsxs)("button",{onClick:()=>h(!f),className:"flex w-full items-center p-3 hover:bg-gray-50",children:[f?(0,a.jsx)(y.g8U,{className:"mr-2 size-5 text-gray-500"}):(0,a.jsx)(y.v4q,{className:"mr-2 size-5 text-gray-500"}),(0,a.jsx)("span",{className:"text-xl font-medium",children:"Support"})]}),f&&(0,a.jsx)("div",{className:"border-t border-cloudfix-blue p-3",children:M(W)})]})})]})}),(0,a.jsxs)("div",{className:"rounded-b-xl bg-cloudfix-blue px-8 py-2 text-white shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]",children:[" ",(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 pt-2 text-base font-semibold",children:"Resource Tags"}),(0,a.jsxs)("div",{className:"relative mr-2",children:[(0,a.jsx)("div",{className:"flex max-h-20 flex-wrap gap-2 overflow-y-auto pb-4",children:Z.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-full bg-white px-3 py-1 text-sm text-black",children:[(0,a.jsx)("span",{className:"font-light",children:e.key}),(0,a.jsxs)("span",{className:"font-semibold",children:[": ",e.value]})]},t))}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-cloudfix-blue to-transparent"})]})]}),(0,a.jsx)("div",{className:"flex gap-3 self-center",children:l&&(0,a.jsx)("a",{onClick:e=>{e.stopPropagation()},href:v.nU,className:"hyperlink",target:"_blank",rel:"noreferrer",children:(0,a.jsx)("button",{className:"rounded-lg bg-white px-6 py-2 font-semibold text-black shadow-lg transition-colors hover:bg-white/90",children:"Support"})})})]}),(0,a.jsx)("p",{className:"py-1 text-center text-sm font-light italic text-blue-300",children:"This report was generated by CloudFix to help you optimize your AWS resources and reduce costs."})]})]})]})})}},95447:function(e,t,l){var s=l(53704),a=l(21902),n=l(71339),i=l(22401),r=l(3015);t.Z=function(e){let{onChange:t,onSearch:l,onReset:o,value:c,isActive:d=!1}=e;function u(e){e.preventDefault(),l()}return(0,s.jsx)(n.J,{children:e=>{let{open:l,close:x}=e;return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(n.J.Button,{className:"order-none focus:outline-none \n                ".concat(l?"":"text-opacity-90","\n                rounded-sm text-white "),children:(0,s.jsx)(r.m2,{active:d,className:""})}),(0,s.jsx)(i.u,{as:a.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:(0,s.jsx)(n.J.Panel,{className:"absolute z-10 rounded-md border border-gray-200 bg-white shadow-md ",focus:!0,children:(0,s.jsx)("div",{children:(0,s.jsxs)("form",{className:"flex w-full flex-col gap-3 p-3",onSubmit:u,children:[(0,s.jsx)(r.II,{onChange:t,placeholder:"Search...",required:!0,type:"text",externalValue:c}),(0,s.jsxs)("div",{className:"flex w-full gap-3",children:[(0,s.jsx)(r.zx,{className:"w-full",onClick:()=>{o(),x()},styleType:"white",type:"button",children:"Reset"}),(0,s.jsx)(r.zx,{className:"w-full",styleType:"purple",type:"submit",onClick:()=>{x()},children:"Ok"})]})]})})})})]})}})}},77905:function(e,t,l){var s=l(53704),a=l(3015);l(21902);var n=l(30222),i=l(35464);t.Z=function(e){let{recommendationSummary:t,onClickClose:l}=e,{subCategoryTypeDescription:r,categoryTypeDescription:o,categoryTypeName:c,realizedSavings:d,potentialSavings:u,completedSavings:x,supportArt
1icle:m}=t;return(0,s.jsx)(a.u_,{isActive:!0,children:(0,s.jsxs)("div",{className:"absolute top-24 flex w-2/5 flex-col rounded-xl bg-white px-7 py-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:l,type:"button",children:(0,s.jsx)(a.b0,{})}),(0,s.jsxs)("div",{className:"flex w-11/12 flex-col gap-y-2",children:[(0,s.jsx)("p",{className:"pb-5 text-base font-medium",children:"Recommendation Details"}),(0,s.jsx)("p",{className:"text-sm text-cloudfix-gray",children:r}),(0,s.jsxs)("p",{className:"border-b pb-5 text-sm text-cloudfix-gray",children:[c," - ",o]}),(0,s.jsx)("p",{className:"border-b pb-5 text-sm text-cloudfix-gray",children:m.split(", ").map((e,t)=>{let[l,a]=e.split("|");return(0,s.jsxs)("div",{children:[(0,s.jsxs)("a",{href:l,className:"hyperlink",target:"_blank",rel:"noreferrer",children:[a," Support Article"]},t),(0,s.jsx)("br",{})]},l)})}),(0,n.EN)(u)&&(0,s.jsxs)("p",{className:"py-4 text-sm text-cloudfix-gray ",children:[(0,i.el)(u)," potential savings"]}),(0,n.EN)(x)&&(0,s.jsxs)("p",{className:"py-4 text-sm text-cloudfix-gray ",children:[(0,i.el)(x)," completed savings"]}),(0,n.EN)(d)&&(0,s.jsxs)("p",{className:"py-4 text-sm text-cloudfix-gray ",children:[(0,i.el)(d)," realized savings"]})]})]})})}},91994:function(e,t,l){l.d(t,{Z:function(){return r}});var s=l(53704),a=l(21902),n=l(46853),i=l(3015);function r(e){let{placeholder:t,options:l=[],value:r,onChange:o,buttonClassName:c="",optionsClassName:d=""}=e,u=(0,a.useRef)(null),x=(0,a.useMemo)(()=>{var e;return null!==(e=l.filter(e=>e.value===r)[0])&&void 0!==e?e:{}},[r,l]),m=()=>{var e,t,l,s;if(!u)return;let a=null==u?void 0:null===(e=u.current)||void 0===e?void 0:e.getBoundingClientRect(),n=null==u?void 0:null===(t=u.current)||void 0===t?void 0:t.offsetHeight,i=null==u?void 0:null===(s=u.current)||void 0===s?void 0:null===(l=s.className)||void 0===l?void 0:l.includes("bottom-full");if(!a||!n)return;let r=window.innerHeight-a.bottom;return r<0||i?"bottom-full mb-[6px]":"top-full mt-[6px]"};return(0,s.jsx)(n.R,{value:x,onChange:e=>null==o?void 0:o(e),children:e=>{var r;let{open:o}=e;return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)(n.R.Button,{className:"".concat(c," flex items-center justify-between gap-2 rounded-md border border-[#E4E6EE] ").concat(o?"bg-[#E7E8EB]":"bg-[#F8F9FB]"," px-[14px] py-[11px] text-cloudfix-gray"),children:[(0,s.jsx)("span",{className:"truncate",children:null!==(r=null==x?void 0:x.label)&&void 0!==r?r:t}),(0,s.jsx)("div",{children:(0,s.jsx)(i.kd,{})})]}),(0,s.jsx)(n.R.Options,{ref:u,className:"absolute z-50 max-h-[200px] overflow-y-scroll rounded-md border border-[#E4E6EE] bg-[#F8F9FB] px-[7px] text-xs text-cloudfix-gray scrollbar-thin scrollbar-thumb-gray-200 ".concat(m()," ").concat(d),children:l.map((e,t)=>(0,s.jsx)(n.R.Option,{value:e,as:a.Fragment,children:a=>{let{selected:n}=a;return(0,s.jsxs)("li",{className:"".concat(t!==l.length-1?"border-b":""," ").concat(n?"text-cloudfix-blue":""," flex cursor-pointer items-center justify-between gap-2 border-[#E4E6EE] px-[7px] py-[10px] "),children:[e.label," ",n&&(0,s.jsx)("div",{className:"w-[17px]",children:(0,s.jsx)(i.fU,{})})]})}},t))})]})}})}},86570:function(e,t,l){l.d(t,{lE:function(){return w},Ls:function(){return C},BN:function(){return O},pf:function(){return v},F8:function(){return R},Ok:function(){return L},XX:function(){return I},dQ:function(){return f},jq:function(){return b},oz:function(){return z.Z},pq:function(){return y}});var s=l(53704),a=l(21902);l(85870),l(15603);var n=l(37865),i=l(64593),r=l(55435),o=l(56677),c=l(39862),d=l(92258),u=l(1320),x=l(22581),m=l(73030);let p=e=>{let{cx:t,cy:l,innerRadius:a,outerRadius:i,startAngle:r,endAngle:o,fill:c,value:d}=e;return(0,s.jsxs)("g",{children:[(0,s.jsx)("text",{className:"text-4xl font-medium",dy:8,fill:"#fff",textAnchor:"middle",x:t,y:l,children:"$".concat((0,x.V2)(d,1))}),(0,s.jsx)(n.L,{cx:t,cy:l,endAngle:o,fill:c,innerRadius:a,outerRadius:i,startAngle:r})]})};function f(e){let{data:t,className:l,title:n="",hasTooltip:f=!1,cx:h,cy:b}=e,[g,y]=a.useState(-1),v=()=>{y(-1)},j=t.map(e=>e.value).reduce(function(e,t){return e+t},0);return(0,s.jsx)("div",{className:l,children:(0,s.jsx)(i.h,{height:"100%",width:"100%",children:(0,s.jsxs)(r.u,{height:400,width:400,onMouseLeave:v,children:[(0,s.jsx)("text",{color:"#000",dominantBaseline:"middle",fill:"#fff",fontSize:20,textAnchor:"middle",x:192,y:185,children:-1===g?n:t[g].fixerCategory!=m.hc.Zero?t[g].fixerCategory:n}),(0,s.jsxs)(o.b,{activeIndex:g,activeShape:p,cx:h,cy:b,data:t,dataKey:"value",fill:"#1c95b8",height:200,innerRadius:90,onMouseEnter:(e,t)=>{y(t)},onMouseLeave:v,outerRadius:120,stroke:"#1d8dc6",strokeWidth:5,width:400,children:[t.map((e,t)=>
1(0,s.jsx)(c.b,{fill:(0,x.W9)(e.fixerCategory),opacity:g!==t&&-1!==g?.5:1},"cell-".concat(t))),(0,s.jsx)(d._,{className:"text-4xl font-medium",dy:8,fill:"white",position:"centerBottom",value:-1===g?"$".concat((0,x.V2)(j,2)):""})]}),!!f&&(0,s.jsx)(u.u,{})]})})})}let h={isHigh:{status:"High",color:"#D04C49"},isMedium:{status:"Medium",color:"#BBA800"},isLow:{status:"Low",color:"#3E991E"}};var b=function(e){let t,l,{levelStatus:a}=e;switch(a){case"High":({status:t,color:l}=h.isHigh);break;case"Medium":({status:t,color:l}=h.isMedium);break;case"Low":({status:t,color:l}=h.isLow)}return(0,s.jsx)("span",{className:"flex w-full justify-center",children:t&&(0,s.jsxs)("span",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("div",{style:{width:"10px",height:"10px",backgroundColor:l,borderRadius:"50%"}}),(0,s.jsx)("span",{children:t})]})})},g=l(3015),y=function(e){let{className:t="",step:l,stepCounter:a,isStepLoading:n,tip:i}=e,r=a===l?"border-[1px] border-solid border-white/40 border-opacity-40 shadow-inner bg-white/40":"",o=a===l?"":"text-white/40";return(0,s.jsxs)("div",{className:"flex h-36 w-full items-center rounded-xl bg-white-twenty-percent pl-5 lg:px-5 xl:w-4/5 2xl:w-3/4 ".concat(r," ").concat(t),children:[(0,s.jsx)("div",{className:"flex size-9 items-center justify-center",children:n&&a===l?(0,s.jsx)(g.Ab,{className:"size-full animate-spin"}):a>=l?(0,s.jsx)(g.rE,{className:"size-full",color:"white"}):(0,s.jsx)("div",{className:"size-full rounded-full border-2 border-solid border-white/40"})}),(0,s.jsxs)("div",{className:"ml-6 lg:ml-8",children:[(0,s.jsxs)("h3",{className:"text-lg lg:text-2xl ".concat(o),children:["Step ",l]}),(0,s.jsx)("p",{className:"mt-2 text-base font-extralight lg:text-2xl ".concat(o),children:i})]})]},l)};l(77905);var v=function(e){let{name:t,message:l,onClickClose:a,onClickDelete:n,isActive:i=!1,isLoading:r=!1}=e;return(0,s.jsx)(g.u_,{isActive:i,children:(0,s.jsxs)("div",{className:"absolute top-24 flex w-[480px] flex-col rounded-xl bg-white p-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:a,type:"button",children:(0,s.jsx)(g.b0,{})}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-4",children:[(0,s.jsx)("p",{className:"pb-2 text-lg font-medium",children:"Confirm Delete"}),(0,s.jsxs)("p",{className:"text-center",children:[l,(0,s.jsx)("span",{className:"font-bold",children:t}),"?"]}),(0,s.jsxs)("div",{className:"flex justify-between gap-x-4 px-2",children:[(0,s.jsx)(g.zx,{onClick:a,disabled:r,styleType:"white",type:"button",className:"w-full",children:"Cancel"}),(0,s.jsx)(g.zx,{onClick:n,disabled:r,styleType:"purple",type:"button",className:"w-full",children:"Delete"})]})]})]})})},j=l(57548),N=l(30222),w=function(e){let{user:t={firstName:"",lastName:"",username:"",role:m.i4.READER,companyName:"",compliantStatus:"",id:"",entitlementTier:"",tenantId:"",hasPsSupport:!1,permissions:[]},type:l="create",onClose:n,onClickSave:i,isActive:r=!1,isLoading:o=!1,dataSummaryFilters:c,isLoadingSummaryFilters:d=!1}=e,[u,p]=(0,a.useState)(""),[f,h]=(0,a.useState)(""),[b,y]=(0,a.useState)(""),[v,w]=(0,a.useState)((0,x.e)(m.i4.READER)),[k,C]=(0,a.useState)(void 0),[S,E]=(0,a.useState)(void 0),[A,T]=(0,a.useState)(void 0),[I,z]=(0,a.useState)([]),[R,L]=(0,a.useState)([]),[D,O]=(0,a.useState)([]),[F,M]=(0,a.useState)([]),P=(0,a.useMemo)(()=>{var e;return null!==(e=null==c?void 0:c.ous.map(e=>({value:e.id,label:e.name})))&&void 0!==e?e:[]},[c]),U=(0,a.useMemo)(()=>{let e=new Map;return null==c||c.ous.forEach(t=>{t.accounts.forEach(t=>{e.set(t.id,t.name)})}),Array.from(e.entries()).map(e=>{let[t,l]=e;return{value:t,label:(0,N.EN)(l)&&""!==l?"".concat(l," (").concat(t,")"):t}})},[c]),V=(0,a.useMemo)(()=>{let e=new Set;return null==c||c.ous.forEach(t=>{t.accounts.forEach(t=>{t.regions.forEach(t=>{e.add(t.id)})})}),Array.from(e).map(e=>({value:e,label:e}))},[c]),_=(0,a.useMemo)(()=>{let e=new Set;return null==c||c.ous.forEach(t=>{t.accounts.forEach(t=>{t.regions.forEach(t=>{t.tags.forEach(t=>{t.options.forEach(l=>{e.add("".concat(t.name,"|").concat(l))})})})})}),Array.from(e).map(e=>{let[t,l]=e.split("|");return{value:{tagName:t,tagValue:l},label:"".concat(t," | ").concat(l)}})},[c]);(0,a.useEffect)(()=>
1{if("edit"!==l||!t.filters||d||!c)return;let e=t.filters;if(z((e.ou||[]).map(e=>{var t;return{value:e,label:(null===(t=P.find(t=>t.value===e))||void 0===t?void 0:t.label)||e}})),L((e.account||[]).map(e=>{var t;return{value:e,label:(null===(t=U.find(t=>t.value===e))||void 0===t?void 0:t.label)||e}})),O((e.region||[]).map(e=>{var t;return{value:e,label:(null===(t=V.find(t=>t.value===e))||void 0===t?void 0:t.label)||e}})),e.tagKey&&e.tagValue){let t=e.tagKey||[],l=e.tagValue||[];M(t.map((e,t)=>({value:{tagName:e,tagValue:l[t]||""},label:"".concat(e," | ").concat(l[t]||"")})))}},[l,t,P,U,V,c,d]),(0,a.useEffect)(()=>{"edit"===l&&(p(t.username),h(t.firstName),y(t.lastName),w(t.role))},[l,t]);let q=()=>{if("create"===l&&!(0,x.vV)(u)){C("Please enter a valid email address");return}let e={ou:I.map(e=>e.value),account:R.map(e=>e.value),region:D.map(e=>e.value),tagKey:F.map(e=>e.value.tagName),tagValue:F.map(e=>e.value.tagValue)};i({username:u,firstName:f,lastName:b,role:v,filters:e})},Z=e=>t=>{let l;"firstName"===e&&t.length>0&&(t.length<2||t.length>32)&&(l="".concat("firstName"===e?"First Name":"Last Name"," must be between 2 and 32 characters")),"firstName"===e?(h(t),E(l)):(y(t),T(l))},W=(0,a.useMemo)(()=>{let e="edit"!==l&&((0,N.EN)(k)||!u);return e||(0,N.EN)(S)||(0,N.EN)(A)||!f},[k,S,A,u,f,l]);return(0,s.jsx)(g.u_,{isActive:r,children:(0,s.jsxs)("div",{className:"absolute top-24 flex w-[580px] flex-col rounded-xl bg-white p-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:n,type:"button",children:(0,s.jsx)(g.b0,{})}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-5",children:[(0,s.jsxs)("p",{className:"text-lg font-medium",children:["create"===l?"Add":"Update"," User"]}),(0,s.jsx)(g.II,{label:"Email",onChange:e=>{p(e),"create"===l&&C(e.length>0&&!(0,x.vV)(e)?"Please enter a valid email address":void 0)},placeholder:"Enter user email",required:!0,type:"email",externalValue:u,disabled:"edit"===l,errorMessage:"edit"===l?void 0:k}),(0,s.jsx)(g.II,{label:"First Name",onChange:Z("firstName"),placeholder:"Enter user first name",required:!0,type:"text",externalValue:f,errorMessage:S}
1),(0,s.jsx)(g.II,{label:"Last Name",onChange:Z("lastName"),placeholder:"Enter user last name",required:!0,type:"text",externalValue:b,errorMessage:A}),(0,s.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,s.jsxs)("div",{className:"mb-4 grid grid-cols-2 gap-4",children:[(0,s.jsx)("div",{className:"col-span-1",children:(0,s.jsx)(j.Z,{placeholder:"All OUs",options:P,isLoading:d,values:I,onChange:e=>{z(e)},buttonClassName:"w-full"})}),(0,s.jsx)("div",{className:"col-span-1",children:(0,s.jsx)(j.Z,{placeholder:"All Accounts",options:U,isLoading:d,values:R,onChange:e=>{L(e)},buttonClassName:"w-full"})}),(0,s.jsx)("div",{className:"col-span-1",children:(0,s.jsx)(j.Z,{placeholder:"All Regions",options:V,isLoading:d,values:D,onChange:e=>{O(e)},buttonClassName:"w-full"})}),(0,s.jsx)("div",{className:"col-span-1",children:(0,s.jsx)(j.Z,{placeholder:"All Tags",options:_,values:F,isLoading:d,onChange:e=>{M(e)},isTagSelect:!0,buttonClassName:"w-full"})})]}),(0,s.jsx)("div",{className:"mb-4 flex justify-end",children:(0,s.jsx)(g.zx,{styleType:"white",type:"button",onClick:()=>{z([]),L([]),O([]),M([])},disabled:!I.length&&!R.length&&!F.length&&!D.length,className:"px-4 py-2 text-sm",children:"Clear Filters"})}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("label",{className:"mb-2 text-xs font-normal text-gray-700",children:"Role"}),(0,s.jsx)("select",{id:"role",name:"role",className:"form-select block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",value:v,onChange:e=>w(e.target.value),children:Object.values(m.i4).map(e=>(0,s.jsx)("option",{value:e,children:(0,x.e)(e)},e))})]})]}),(0,s.jsxs)("div",{className:"flex justify-between gap-x-4 px-4",children:[(0,s.jsx)(g.zx,{onClick:n,styleType:"white",type:"button",className:"w-full",children:"Cancel"}),(0,s.jsx)(g.zx,{onClick:()=>{o||W||q()},styleType:"purple",type:"button",className:"w-full",disabled:o||W,dataCy:"create"===l?"create-user-button":"update-user-button",children:"create"===l?"Create User":"Update User"})]})]})]})})};g.MC,g.GF;let k=[];for(let e=0;e<11;e++)k.push({label:(0,s.jsx)("div",{className:"flex h-[14px] w-[6px] items-center justify-center",children:(0,s.jsx)("span",{className:"pl-1 pt-0.5",children:e})}),concurrency:e});var C=function(e){let{webhook:t={name:"",id:"",customerId:0,url:"",secret:"",active:!0,registrationDate:new Date,expirationDate:new Date},type:l="create",onClickClose:n,onClickSave:i,isActive:r=!1,isLoading:o=!1,isError:c=!1,errorMessage:d=""}=e,[u,m]=(0,a.useState)(t.name),[p,f]=(0,a.useState)(t.url),[h,b]=(0,a.useState)(t.secret),[y,v]=(0,a.useState)(t.active),[j,N]=(0,a.useState)("");return(0,a.useEffect)(()=>{"edit"===l&&(m(t.name),f(t.url),b(t.secret),v(t.active))},[t,l]),(0,a.useEffect)(()=>{p&&!(0,x.jv)(p)?N("Please enter a valid webhook url. Make sure to specify the https:// protocol."):N("")},[p]),(0,s.jsx)(g.u_,{isActive:r,children:(0,s.jsxs)("div",{className:"absolute top-24 flex w-2/6 flex-col rounded-xl bg-white px-7 py-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:n,type:"button",children:(0,s.jsx)(g.b0,{})}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-5",children:[(0,s.jsxs)("p",{className:"text-lg font-medium",children:["create"===l?"Add":"Update"," Webhook"]}),o&&(0,s.jsx)(g.bZ,{type:"info",messages:["create"===l?"Adding a new webhook...":"Please wait, we are trying to update webhook..."]}),c&&(0,s.jsx)(g.bZ,{type:"error",messages:[d]}),(0,s.jsx)(g.II,{label:"Name",onChange:m,placeholder:"Enter webhook name",required:!0,type:"text",externalValue:u,disabled:"edit"===l}),(0,s.jsx)(g.II,{label:"Url",onChange:f,placeholder:"Enter webhook url",required:!0,type:"text",externalValue:p}),""!==j&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:j}),(0,s.jsx)(g.II,{label:"Secret",onChange:b,placeholder:"Enter webhook secret",required:!0,type:"text",externalValue:h}),(0,s.jsx)("p",{className:"text-xs",children:"Status"}),(0,s.jsx)("fieldset",{children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{className:"size-4 border-gray-300 text-cloudfix-blue focus:ring-cloudfix-blue",defaultChecked:!0===y,id:"active",name:"webhook-status",onClick:()=>v(!0),type:"radio"}),(0,s.jsx)("label",{className:"ml-3 block text-sm ",htmlFor:"Active",children:"Active"})]},"active"),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{className:"size-4 border-gray-300 text-cloudfix-blue focus:ring-cloudfix-blue",defaultChecked:!1===y,id:"inactive-webhooks",name:"webhook-status",onClick:()=>v(!1),type:"radio"}),(0,s.jsx)("label",{className:"ml-3 block text-sm ",htmlFor:"In-Active",children:"Inactive"})]},"inactive")]})}),(0,s.jsxs)("div",{className:"flex justify-between gap-x-4 px-4",children:[(0,s.jsx)(g.zx,{onClick:n,styleType:"white",type:"button",className:"w-full",children:"Cancel"}),(0,s.jsx)(g.zx,{onClick:function(){t.name=u,t.url=p,t.secret=h,t.active=y,i(t)},disabled:(null==j?void 0:j.length)>0||!h,styleType:"purple",type:"button",className:"w-full",children:"create"===l?"Save":"Update"})]})]})]})})},S=l(25547),E=l(93478),A=l(35464),T=l(20328);function I(e){let{isActive:t,isExecuting:l,closeModal:n,recommendationOptions:i,resourceId:r,handleExecute:o,onPsExecute:c,hasPsSupport:d=!1,isPSSupported:u=!1,isSentToPS:p=!1,accountFixerDisabled:f=!1}=e,[h,b]=(0,a.useState)(null),[y,v]=(0,a.useState)(E.w.None),[j,w]=(0,a.useState)(void 0),k=r;i.some(e=>{var t;let l=null!==(t=(0,x.NA)(e.parameters,"currentInstanceType"))&&void 0!==t?t:(0,x.NA)(e.resourceFixedConfiguration,"currentInstanceType");return!!(0,N.EN)(l)&&(k="".concat(r," (").concat(l,")"),!0)});let C=i.some(e=>{var t;return(0,N.EN)(null!==(t=(0,x.NA)(e.parameters,"targetInstanceType"))&&void 0!==t?t:(0,x.NA)(e.resourceFixedConfiguration,"targetInstanceType"))});return(0,a.useEffect)(()=>{b(null),v(E.w.None)},[t]),(0,s.jsxs)(g.u_,{isActive:t,onEscKeyDown:n,children:[(0,s.jsxs)("div",{className:"absolute top-24 flex w-[45%] flex-col overflow-auto rounded-xl bg-white p-5 pb-3",style:{maxHeight:"80%"},children:[(0,s.jsx)("button",{className:"self-end",onClick:n,type:"button",children:(0,s.jsx)(g.b0,{})}),(0,s.jsxs)("div",{className:"mt-8 flex-col gap-x-2 ",children:[(0,s.jsxs)("p",{className:"sticky pb-5 text-center text-lg font-medium",children:["Fix options for resource ",(0,s.jsx)("b",{children:k})]}),(0,s.jsx)("div",{className:"flex size-full flex-col gap-y-2 overflow-y-auto py-2 pr-5 scrollbar-thin scrollbar-track-white scrollbar-thumb-gray-400",children:(0,s.jsxs)("table",{className:"mx-2 w-[98%] self-stretch",children:[(0,s.jsx)("thead",{className:"sticky top-0 z-10 bg-white",children:(0,s.jsxs)("tr",{className:"h-[60px] border-b border-b-gray-300 p-5",children:[["POTENTIAL SAVINGS"].map((e,t)=>(0,s.jsx)("th",{className:"w-1/4 px-5 py-3 text-center",children:e},t)),C?(0,s.jsx)("th",{className:"w-[30%] px-5 py-3 text-center",children:"TARGET TYPE"}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("th",{className:"w-1/5 px-5 py-3 text-center",children:"DETAILS"}),(0,s.jsx)("th",{className:"w-1/5 px-5 py-3 text-center",children:"ACTION"})]})}),(0,s.jsx)("tbody",{children:i.map((e,t)=>{var a,n;return(0,s.jsxs)("tr",{className:"border-b border-b-gray-300 text-sm hover:bg-cloudfix-light-gray",children:[(0,s.jsx)("td",{className:"items-center justify-center p-5 text-center",children:(0,A.el)(e.savings)}),C?(0,s.jsx)("td",{className:"items-center justify-center whitespace-pre-wrap p-5 text-center",children:null!==(n=null!==(a=(0,x.NA)(e.parameters,"targetInstanceType"))&&void 0!==a?a:(0,x.NA)(e.resourceFixedConfiguration,"targetInstanceType"))&&void 0!==n?n:"N/A"}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("td",{className:"flex items-center justify-center py-5 text-center",children:(0,s.jsx)(g.zx,{onClick:()=>{w(e.recommendationID),v(E.w.DetailsModal)},className:"w-[75px] cursor-pointer px-2 py-1",styleType:"purple",textSize:"text-xs",type:"button",stopFurtherPropagation:!0,children:"Details"})}),(0,s.jsx)("td",{className:"py-5 text-center",children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,x.Dr)(e,l,b)})})]},t)})})]})})]}),(0,s.jsxs)("div",{className:"flex h-full items-center justify-end gap-x-2 py-[10px]",children:[(0,s.jsx)(T.S,{to:m.y3.RECOMMENDATIONS_WRITE,children:u&&(0,s.jsx)(g.Zm,{hasPS:d,disabled:p||l,onExecute:c,isAlreadyRequested:p})}),(0,s.jsx)(g.zx,{onClick:n,styleType:"purple",type:"button",className:"w-full",children:"Close"})]})]}),(0,s.jsx)(S.R,{isActive:y===E.w.DetailsModal,onClickClose:()=>
1{v(E.w.None)},recommendationId:j}),(0,s.jsx)(g.u_,{isActive:(0,N.EN)(h),onEscKeyDown:()=>b(null),children:(0,s.jsxs)("div",{className:"absolute top-32 flex w-[300] flex-col overflow-y-auto rounded-xl bg-white p-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:()=>b(null),type:"button",children:(0,s.jsx)(g.b0,{})}),!f&&(0,s.jsxs)("div",{className:"mt-2 flex  flex-col justify-between gap-x-4",children:[(0,s.jsx)("div",{className:"mt-4 gap-x-2 ",children:"Execute this fix?"}),(0,s.jsx)("div",{className:"flex  h-full flex-col gap-y-4 pt-[10px]",children:(0,s.jsx)(g.zx,{onClick:()=>o(h),styleType:"purple",type:"button",className:"w-full",disabled:l,children:"EXECUTE NOW"})})]}),f&&(0,s.jsx)("div",{className:"mt-2 flex  flex-col justify-between gap-x-4",children:(0,s.jsx)("div",{className:"mt-4 gap-x-2 ",children:"Account fixer is disabled on Excluded Accounts settings."})})]})})]})}var z=l(95447),R=function(e){let{opportunityType:t,resourceIds:l,onClickClose:a,onClickExecute:n,isActive:i=!1,isExecuting:r=!1,isAccountFixerDisabled:o=!1}=e;return(0,s.jsx)(g.u_,{isActive:i,onEscKeyDown:a,children:(0,s.jsxs)("div",{className:"absolute top-12 flex max-w-xl flex-col rounded-xl bg-white px-[30px] pt-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:a,type:"button",children:(0,s.jsx)(g.b0,{})}),(0,s.jsx)("span",{className:"text-base font-medium",children:"Confirm Fixer Execution"}),(0,s.jsxs)("div",{className:"mt-[14px] text-xs font-normal text-cloudfix-gray",children:["Please confirm the execution of",(0,s.jsx)("span",{className:"font-bold",children:" "+t})," for the following resource(s):"]}),(0,s.jsx)("div",{className:"mt-4 flex gap-x-2 ",children:(0,s.jsx)("ul",{className:"flex h-[237px] w-full flex-col gap-y-2 overflow-y-auto py-2 pr-5 scrollbar-thin scrollbar-track-white scrollbar-thumb-gray-400 ",children:l.map((e,t)=>(0,s.jsx)("li",{className:"flex items-center gap-x-4 border-b border-b-[#D9D9D9] py-2 last:border-b-0",children:(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("span",{className:"text-xs font-normal text-cloudfix-gray",children:["".concat(t+1,". "),e]})})},t))})}),o&&(0,s.jsx)("div",{className:"mt-4 flex gap-x-2",children:(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsx)("span",{className:"text-sm font-semibold text-cloudfix-advanced-legend",children:"Selected resources contain an excluded account. Check excluded accounts on settings"})})}),(0,s.jsxs)("div",{className:"flex size-full items-center justify-end gap-x-2 py-[20px]",children:[(0,s.jsx)(g.zx,{onClick:a,styleType:"white",type:"button",className:"w-full",disabled:r,children:"Cancel"}),(0,s.jsx)(g.zx,{onClick:n,styleType:"purple",type:"button",className:"w-full",disabled:r||o,children:"Execute"})]})]})})},L=function(e){let{accountName:t,opportunityType:l,onClickClose:a,onClickGenerate:n,isActive:i=!1,isApproving:r,errorText:o,templateOrRunbook:c="Template"}=e;return(0,s.jsx)(g.u_,{isActive:i,onEscKeyDown:a,children:(0,s.jsxs)("div",{className:"absolute top-24 flex w-[480px] flex-col rounded-xl bg-white p-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:a,type:"button",children:(0,s.jsx)(g.b0,{})}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-6",children:[(0,s.jsxs)("p",{className:"pb-5 text-center text-lg font-medium",children:["Confirm Generate ",c]}),(0,s.jsxs)("p",{className:"text-center",children:["Are you sure you want to generate ",c.toLowerCase()," ",(0,s.jsx)("span",{className:"font-bold",children:l})," for account ",(0,s.jsx)("span",{className:"font-bold",children:t}),"?"]}),void 0!==o&&(0,s.jsx)("p",{className:"overflow-auto pb-5 text-center font-medium text-red-600",children:o}),(0,s.jsxs)("div",{className:"flex justify-between gap-x-4 px-4",children:[(0,s.jsx)(g.zx,{onClick:a,styleType:"white",type:"button",className:"w-full",disabled:r,children:"Cancel"}),(0,s.jsx)(g.zx,{onClick:n,styleType:"purple",type:"button",className:"w-full",disabled:r,children:"Generate"})]})]})]})})};l(91994);var D=l(15123),O=function(e){let{onClickClose:t,onClickSave:l,isActive:n=!1,isLoading:i=!1,accountOptions:r=[]}=e,[o,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)([]);function x(){l(d.map(e=>({accountId:e.value,onboarding:!1,finder:!1,fixer:!1}))),u([])}return(0,a.useEffect)(()=>{0===d.length?c(!1):c(!0)},[d]),(0,s.jsx)(g.u_,{isActive:n,children:(0,s.jsxs)("div",{className:"absolute top-24 flex w-1/4 flex-col rounded-xl bg-white p-5",children:[(0,s.jsx)("button",{className:"self-end",onClick:t,type:"button",children:(0,s.jsx)(g.b0,{})}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-5",children:[(0,s.jsx)("p",{className:"text-lg font-medium",children:"Add Excluded A
1ccount"}),i&&(0,s.jsx)(g.bZ,{type:"info",messages:["Adding a new excluded account..."]}),(0,s.jsx)(j.Z,{buttonClassName:"h-full w-full text-sm",placeholder:"Select the account(s)",options:r.toSorted((e,t)=>e.accountId.localeCompare(t.accountId)).map(e=>({label:"".concat(e.accountName," - ").concat(e.accountId),value:e.accountId})),values:d,onChange:e=>u(e),placeHolderLength:40}),(0,s.jsxs)("div",{className:"flex justify-between gap-x-4 px-4",children:[(0,s.jsx)(g.zx,{onClick:t,styleType:"white",type:"button",className:"w-full",children:"Cancel"}),o?(0,s.jsx)(g.zx,{onClick:x,styleType:"purple",type:"button",className:"w-full",children:"Add"}):(0,s.jsx)(D.ZP,{message:"Please select at least one account",children:(0,s.jsx)(g.zx,{onClick:x,styleType:"purple",type:"button",className:"w-full",disabled:!0,children:"Add"})})]})]})]})})};l(3750),l(1876)},93478:function(e,t,l){l.d(t,{w:function(){return a},Z:function(){return V}});var s,a,n=l(53704),i=l(88407),r=l(3015),o=l(5643),c=l(86570),d=l(23514),u=l(73030),x=l(21902),m=l(35464),p=l(33572),f=l(54512),h=l(87648),b=l(98929),g=l(7099),y=l(53400),v=l(22581),j=l(48046),N=l(2993),w=l(30222),k=l(69533),C=l(4022),S=l.n(C),E=l(64144);function A(){return"true"===localStorage.getItem(E.sU)}var T=l(97910),I=l(46653),z=l(25547),R=function(e){let{opportunityType:t,resourceIds:l,onClickClose:s,onClickExecute:a,isActive:i=!1,isExecuting:o=!1,isAccountFixerDisabled:c=!1}=e;return(0,n.jsx)(r.u_,{isActive:i,onEscKeyDown:s,children:(0,n.jsxs)("div",{className:"absolute top-12 flex max-w-xl flex-col rounded-xl bg-white px-[30px] pt-5",children:[(0,n.jsx)("button",{className:"self-end",onClick:s,type:"button",children:(0,n.jsx)(r.b0,{})}),(0,n.jsx)("span",{className:"text-base font-medium",children:"Confirm Ticket Creation"}),(0,n.jsxs)("div",{className:"mt-[14px] text-xs font-normal text-cloudfix-gray",children:["Please confirm the ticket creation for",(0,n.jsx)("span",{className:"font-bold",children:" "+t})," for the following resource(s):"]}),(0,n.jsx)("div",{className:"mt-4 flex gap-x-2 ",children:(0,n.jsx)("ul",{className:"flex h-[237px] w-full flex-col gap-y-2 overflow-y-auto py-2 pr-5 scrollbar-thin scrollbar-track-white scrollbar-thumb-gray-400 ",children:l.map((e,t)=>(0,n.jsx)("li",{className:"flex items-center gap-x-4 border-b border-b-[#D9D9D9] py-2 last:border-b-0",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("span",{className:"text-xs font-normal text-cloudfix-gray",children:["".concat(t+1,". "),e]})})},t))})}),c&&(0,n.jsx)("div",{className:"mt-4 flex gap-x-2",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsx)("span",{className:"text-sm font-semibold text-cloudfix-advanced-legend",children:"Selected resources contain an excluded account. Check excluded accounts on settings"})})}),(0,n.jsxs)("div",{className:"flex size-full items-center justify-end gap-x-2 py-[20px]",children:[(0,n.jsx)(r.zx,{onClick:s,styleType:"white",type:"button",className:"w-full",disabled:o,children:"Cancel"}),(0,n.jsx)(r.zx,{onClick:a,styleType:"purple",type:"button",className:"w-full",disabled:o||c,children:"Create Tickets"})]})]})})},L=l(76873),D=l(91994),O=l(42350),F=function(e){let{opportunityType:t,resourceIds:l,onClickClose:s,onClickExecute:a,isActive:i=!1,isExecuting:o=!1}=e,[c,d]=x.useState(void 0),[u,m]=x.useState("");function p(){return u.trim().length>250}return(0,n.jsx)(r.u_,{isActive:i,onEscKeyDown:s,children:(0,n.jsxs)("div",{className:"absolute top-12 flex max-w-xl flex-col rounded-xl bg-white px-[30px] pt-5",children:[(0,n.jsx)("button",{className:"self-end",onClick:s,type:"button",children:(0,n.jsx)(r.b0,{})}),(0,n.jsx)("span",{className:"text-base font-medium",children:"Snooze Recommendation(s)"}),(0,n.jsxs)("div",{className:"mt-[14px] text-xs font-normal text-cloudfix-gray",children:["The following recommendation(s) for",(0,n.jsx)("span",{className:"font-bold",children:" "+t})," will no longer be shown for the specified duration"]}),(0,n.jsxs)("div",{className:"mt-4 flex items-center gap-x-2",children:[(0,n.jsx)("span",{className:"text-xs font-bold text-cloudfix-gray",children:"Snooze recommendation(s) for"}),(0,n.jsx)(D.Z,{buttonClassName:"h-full w-full text-sm",optionsClassName:"w-full text-xs",placeholder:"Select the duration",options:[{value:30,label:"30 days"},{value:60,label:"60 days"},{value:90,label:"90 days"},{value:365,label:"365 days"},{value:-1,label:"Permanently"}],value:c,onChange:e=>d(e.value)})]}),(0,n.jsx)("div",{className:"mt-4 flex gap-x-2 ",children:(0,n.jsx)("ul",{className:"flex h-[237px] w-full flex-col gap-y-2 overflow-y-auto py-2 pr-5 scrollbar-thin scrollbar-track-white scrollbar-thumb-gray-400 ",children:l.map((e,t)=>(0,n.jsx)("li",{className:"flex items-center gap-x-4 border-b border-b-[#D9D9D9] py-2 last:border-b-0",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("span",{className:"text-xs font-normal text-cloudfix-gray",children:["".concat(t+1,". "),e]})})},t))})}),(0,n.jsx)("div",{className:"mt-8 flex w-full flex-col gap-y-2",children:(0,n.jsx)(L.Z,{id:"outlined-multiline-static",label:"Reason for snoozing recommendation(s)",multiline:!0,rows:2,size:"small",defaultValue:u,onChange:e=>m(e.target.value),error:p(),helperText:p()?"Reason must be less than 250 characters":""})}),(0,n.jsxs)("div",{className:"flex size-full items-center justify-end gap-x-2 py-[20px]",children:[(0,n.jsx)(r.zx,{onClick:s,styleType:"white",type:"button",className:"w-full",disabled:o,children:"Cancel"}),(0,n.jsx)(r.zx,{onClick:()=>a(function(e){if(!e)return;let t=new Date("2100-01-01");return e>0&&(t=(0,O.Z)(new Date,e)),t.getTime()}(c),u),styleType:"purple",type:"button",className:"w-full",disabled:!c||o||p(),children:"Confirm"})]})]})})},M=l(53184),P=l(20328);let U=e=>["Scheduled","In Progress","Suggested","Needs Stack Upgrade"].includes(e);(s=a||(a={})).RunRecommendations="runrecommendations",s.PostponeRecommendations="postponerecommendations",s.CreateTickets="createTickets",s.MetaRecOptions="metaRecOptions",s.InfoModal="info-modal",s.DetailsModal="details-modal",s.None="";var V=function(e){let{opportunityType:t,dataRecommendations:l,isErrorRecommendations:s,refetchRecommendations:a,opportunityName:C,activeParentKeyProcessing:[E,L],showsCostsAndSavings:D=!0,templatesNeedApproval:O,emptyMsgForTab:V,isLoadingRecommendations:_,isFetchingRecommendations:q,supportsAutoFix:Z,isPSAvailable:W,excludedAccounts:B,createTicketEnabled:K}=e,G=(0,I.useRouter)(),{hasPermission:$}=(0,g.T)(),[H,X]=(0,x.useState)(""),[J,Y]=(0,x.useState)(""),[Q,ee]=(0,x.useState)(""),[et,el]=(0,x.useState)(""),[es,ea]=(0,x.useState)(""),[en,ei]=(0,x.useState)(""),[er,eo]=(0,x.useState)(!0),[ec,ed]=(0,x.useState)(""),[eu,ex]=(0,x.useState)([]),[em,ep]=(0,x.useState)([]),[ef,eh
1]=(0,x.useState)(""),[eb,eg]=(0,x.useState)(!1),[ey,ev]=(0,x.useState)(),[ej,eN]=(0,x.useState)(!1),[ew,ek]=(0,x.useState)([]),[eC,eS]=(0,x.useState)(""),[eE,eA]=(0,x.useState)((0,n.jsx)(n.Fragment,{})),[eT,eI]=(0,x.useState)(""),[ez,eR]=(0,x.useState)(!1),[eL,eD]=(0,x.useState)(!1),{alert:eO,setAlert:eF}=(0,b.V)(),{createChangeRequestsMutation:eM,createPsSupportRequestsMutation:eP,createTicketsMutation:eU,postponeRecommendationsMutation:eV}=(0,f.Z)(),e_=(0,x.useMemo)(A,[]),eq=eM(),eZ=eU(),eW=eP(),eB=eV(),{handleFilter:eK,filteredColumns:eG,handleRemoveFilter:e$,isInFilteredColumns:eH,displayTableRows:eX,setTableRows:eJ,sortedBy:eY,handleSort:eQ,handleSelectAll:e0,handleSelectResource:e1}=(0,h.x)({key:"estimatedSavings",comparison:j.U.dollar,direction:"desc"}),e2=!eX.some(e=>e.isSelected);(0,p.f)(ec,E,L);let e5=e=>{ek(e.metaOptions),eS(e.resourceId),ev(e),eN(void 0!==e.zendeskTicketId),ed("metaRecOptions")},e4=e=>Z?(0,v.gg)(e,void 0,!1):1===e.metaOptions.length?(0,v.Dr)(e.metaOptions[0],!1,t=>{ex([t]),ep([e.id]),ed("runrecommendations")}):U(e.status)?(0,v.gg)(e,{onClickStatusParametersFF:e=>{eA((0,v.Kh)(e)),ed("info-modal"),eI("Fix Parameters")}},!0):(0,n.jsxs)("div",{className:"flex w-full flex-row items-center justify-center gap-x-2",children:[(0,n.jsx)(r.zx,{onClick:()=>e5(e),className:"w-[75px] px-2 py-1",styleType:"".concat(e.zendeskTicketId?"yellow":"purple"),textSize:"text-xs",type:"button",stopFurtherPropagation:!0,children:"Options"}),e.zendeskTicketId&&e7(e)]}),e3=e=>{eh(e.id),ep([e.id]),ex([e.resourceId||""]),ed("details-modal")},e6=e=>{if((Z||!(e.metaOptions.length>1))&&e.reportAvailable)return(0,n.jsx)(r.zx,{className:"mx-2 w-[75px] px-2 py-1",styleType:"purple",textSize:"text-xs",type:"button",onClick:()=>e3(e),stopFurtherPropagation:!0,children:"Details"})},e9=()=>{let e={...G.query};Object.keys(G.query).includes("modal")&&(delete e.modal,Object.keys(G.query).includes("selectedRecommendations")&&delete e.selectedRecommendations,G.push({pathname:G.pathname,query:e},void 0,{shallow:!0})),ed("")},e8=e=>{0==e.length&&(O?ei("Please generate runbooks to unlock recommendations"):ei(V));let t=B.filter(e=>e.fixer).map(e=>e.accountId),[l,s]=S().partition(e,e=>e.metaRecommendationsId),a=S().groupBy(l,e=>e.metaRecommendationsId),i=S().mapValues(a,e=>{var t,l,s;e.sort((e,t)=>{var l,s;return(null!==(l=t.annualSavings)&&void 0!==l?l:0)-(null!==(s=e.annualSavings)&&void 0!==s?s:0)});let a=e.find(e=>["Scheduled","In Progress","Suggested"].includes(e.status)),n={...e[0],annualSavings:null!==(l=null==a?void 0:a.annualSavings)&&void 0!==l?l:e[0].annualSavings,status:null!==(s=null==a?void 0:a.status)&&void 0!==s?s:e[0].status,scheduledAt:null===(t=e.find(e=>e.scheduledAt))||void 0===t?void 0:t.scheduledAt,metaOptions:e.map(v.XC),isTemplateApproved:e.every(e=>e.isTemplateApproved||e.manualFix),isTemplateAvailable:e.every(e=>e.isTemplateAvailable||e.manualFix)};return n}),r=s.map(e=>({...e,metaOptions:[(0,v.XC)(e)]})),o=e=>{var t;let l=null!==(t=e.metaOptions)&&void 0!==t?t:[],s=l.map(e=>e.resourceFixedConfiguration).filter(w.EN),a={};return s.forEach(e=>{Object.entries(e).forEach(e=>{let[t,l]=e;a[t]?a[t].push(l):a[t]=[l]})}),JSON.stringify(a)},c=(0,n.jsxs)("span",{className:"break-normal",children:["This recommendation belongs to an",(0,n.jsx)("br",{}),"account that is disabled",(0,n.jsx)("br",{}),"for fixer execution"]});return[...r,...Object.values(i)].map(e=>({id:e.id,resourceId:e.resourceId,...(0,v.gL)(e),...(0,v.Vh)(e),accountName:e.accountNickname,accountId:e.accountId,organizationalUnitName:e.organizationalUnitName,organizationalUnitId:e.ouId,region:e.region,cost:(0,m.el)(e.annualCost),status:(0,v.D0)(e),estimatedSavings:(0,m.el)(e.annualSavings),isSelected:em.includes(e.id),isSelectable:!0,isTemplateApproved:e.isTemplateApproved,isSelectDisabled:t.includes(e.accountId),isSelectDisabledTooltip:t.includes(e.accountId)?c:void 0,statusColumn:e4(e),zendeskTicketId:e.zendeskTicketId,metaOptions:e.metaOptions,detailsColumn:e6(e),ticketStatus:e.ticketStatus,ticketUrl:e.ticketUrl,logicalSavings:e.annualSavings,logicalCost:e.annualCost,resourceFixedConfig:o(e),snoozeColumn:(0,n.jsx)("div",{className:"flex flex-row items-center justify-center",children:(0,n.jsx)(M.XAp,{className:"text-cloudfix-blue",size:28,onClick:t=>{t.stopPropagation(),ex([e.resourceId]),ep([e.id]),ed("postponerecommendations")}})})}))}
1,e7=e=>(0,n.jsx)(r.u,{message:"Professional Services is currently working on it (Ticket: ZD-".concat(e.zendeskTicketId,")."),children:(0,n.jsx)(T.zVT,{className:"mt-[2px] size-5 text-slate-400",fill:"#265A2C"})});if((0,x.useEffect)(()=>{!function(){if(void 0===l)return;let e=e8(l);eJ(e),eo(!1)}()},[l]),(0,x.useEffect)(()=>{Y(""),X(""),ee(""),el("")},[eG,eX]),(0,x.useEffect)(()=>{var e;let t=new Map(B.map(e=>[e.accountId,e.fixer])),s=null!==(e=null==l?void 0:l.filter(e=>em.includes(e.id)||e.resourceId===eC))&&void 0!==e?e:[];eR(void 0!==s.filter(e=>!0===t.get(e.accountId)).shift())},[em,eC,l,B]),(0,x.useEffect)(()=>{eo(_)},[_]),(0,x.useEffect)(()=>{if("metaRecOptions"===G.query.modal){let e=eX.filter(e=>e.logicalResource.includes(G.query.selectedRecommendations)).shift();e&&e5(e)}},[eX,G]),(0,x.useEffect)(()=>{let{modal:e,selectedRecommendations:t}=G.query;if("runrecommendations"===e&&t){var s;let a=[];a=Array.isArray(t)?t:[t];let n=null!==(s=null==l?void 0:l.filter(e=>a.includes(e.id)))&&void 0!==s?s:[];ep(n.map(e=>e.id)),ex(n.map(e=>""===e.resourceName?e.resourceId:"".concat(e.resourceName," (").concat(e.resourceId,")"))),ed(e)}else if("details-modal"===e&&t){let e=null==l?void 0:l.find(e=>e.id===G.query.selectedRecommendations);e&&e3(e)}},[G,l]),(0,x.useEffect)(()=>{let e={...G.query};""===ec||Object.keys(G.query).includes("modal")||(e={...e,modal:ec},"runrecommendations"===ec&&(e={...e,selectedRecommendations:em}),"metaRecOptions"===ec&&(e={...e,selectedRecommendations:eC}),"details-modal"===ec&&ef&&(e={...e,selectedRecommendations:ef}),G.push({pathname:G.pathname,query:e},void 0,{shallow:!0}))},[ec,G,em,eC,ef]),s)return(0,n.jsx)("div",{className:"flex size-full items-center justify-center text-white",children:"Unable to get Resources."});function te(){eo(!1),ex([]),ep([]),eg(!1),e9()}function tt(e){return"mx-1 w-[75px] px-2 py-1 ".concat(e?"cursor-not-allowed":"cursor-pointer"," ")}return(0,n.jsxs)(i.O.Panel,{as:"div",className:"flex h-full flex-col pt-4",children:[(0,n.jsxs)("div",{className:"flex min-w-fit flex-row-reverse px-6",children:[(0,n.jsx)(y.CSVLink,{headers:[{label:"RESOURCE",key:"logicalResource"},{label:"ACCOUNT NAME",key:"accountName"},{label:"ACCOUNT ID",key:"accountId"},{label:"ORGANIZATIONAL UNIT NAME",key:"organizationalUnitName"},{label:"ORGANIZATIONAL UNIT ID",key:"organizationalUnitId"},{label:"REGION",key:"region"},{label:"COST",key:"logicalCost"},{label:"POTENTIAL SAVINGS",key:"logicalSavings"},{label:"STATUS",key:"status"},{label:"CONFIGURATION",key:"resourceFixedConfig"}],data:null!=eX?eX:[],filename:"Recommendations for Finder - ".concat(C),children:(0,n.jsx)(r.zx,{className:"mx-1 w-[75px] px-2 py-1",styleType:"grey",textSize:"text-xs",type:"button",disabled:q,children:"EXPORT"})}),(0,n.jsx)(r.zx,{className:"mx-1 w-[75px] px-2 py-1",styleType:"purple",textSize:"text-xs",type:"button",onClick:()=>{eo(!0),a()},disabled:q,children:"RELOAD"}),Z?function(){let e=eX.filter(e=>e.isSelected),t=e.some(e=>!e.isTemplateApproved||"Ready"!==e.status),l=e2?"No Recommendation selected":t?"Some selected Recommendations cannot be executed yet":"",s=e2||q||t;return(0,n.jsx)(P.S,{to:u.y3.RECOMMENDATIONS_WRITE,children:(0,n.jsx)(r.yr,{className:"z-50 w-[250px] break-normal",xPosition:"left",isDisabled:""===l,message:(0,n.jsx)("span",{children:l}),yPosition:"bottom",children:(0,n.jsx)(r.zx,{className:tt(s),styleType:"green",textSize:"text-xs",type:"button",disabled:s,onClick:e2?void 0:()=>{ex(e.map(e=>e.logicalResource)),ep(e.map(e=>e.id)),ed("runrecommendations")},children:"EXECUTE"})})})}():(0,n.jsx)(n.Fragment,{}),function(){let e=eX.filter(e=>e.isSelected),t=e2||q;return(0,n.jsx)(P.S,{to:u.y3.RUNBOOKS_WRITE,children:(0,n.jsx)(r.yr,{className:"z-50 w-[250px] break-normal",xPosition:"left",isDisabled:!t,message:(0,n.jsx)("span",{children:"No Recommendation selected"}),yPosition:"bottom",children:(0,n.jsx)(r.zx,{className:tt(t),styleType:"purple",textSize:"text-xs",type:"button",disabled:t,onClick:e2?void 0:()=>{ex(e.map(e=>e.logicalResource)),ep(e.map(e=>e.id)),ed("postponerecommendations")},children:"SNOOZE"})})})}(),K&&(0,n.jsx)(P.S,{to:u.y3.RECOMMENDATIONS_WRITE,children:(0,n.jsx)(r.yr,{className:"z-50 w-[250px] break-normal",xPosition:"left",isDisabled:!e2,message:(0,n.jsx)("span",{children:"No Recommendation selected"}),yPosition:"bottom",children:(0,n.jsx)(r.zx,{className:"mx-1 w-[130px] px-2 py-1 ".concat(e2?"cursor-not-allowed":"cursor-pointer"," "),styleType:"purple",textSize:"text-xs",type:"button",disabled:e2||q,onClick:e2?void 0:()=>{let e=eX.filter(e=>e.isSelected);ex(e.map(e=>e.logicalResource)),ep(e.map(e=>e.id)),ed("createTickets")},children:"CREATE TICKETS"})})})]}),(0,n.jsx)("div",{className:"flex min-h-0 w-full min-w-full shrink-0 grow basis-0",children:(0,n.jsx)(d.i,{columns:function(){let e=$(u.y3.SNOOZE_WRITE)?{header:(0,n.jsx)("div",{className:"flex flex-row items-center justify-center",children:"SNOOZE"}),property:"snoozeColumn",position:"Center"}:void 0,t={header:(0,n.jsxs)("div",{className:"flex flex-row items-center gap-x-1",children:["RESOURCE"," ",(0,n.jsx)(o.tV,{className:"size-3",direction:eY.direction,enabled:"logicalResource"===eY.key,onClick:()=>eQ({key:"logicalResource",comparison:j.U.string,firstDirection:"asc"})}),(0,n.jsx)(c.oz,{onChange:ee,onReset:()=>{e$("resource"),ee("")},onSearch:()=>eK("logicalResource","resource",Q),value:Q,isActive:eH("resource")})]}),property:"resource"},s={header:(0,n.jsxs)("div",{className:"flex flex-row items-center gap-x-1",children:["ACCOUNTS"," ",(0,n.jsx)(o.tV,{className:"size-3",direction:eY.direction,enabled:"logicalAccount"===eY.key,onClick:()=>eQ({key:"logicalAccount",comparison:j.U.string,firstDirection:"asc"})}),(0,n.jsx)(c.oz,{onChange:Y,onReset:()=>{e$("account"),Y("")},onSearch:()=>eK("logicalAccount","account",J),value:J,isActive:eH("account")}
1)]}),property:"account"},a={header:(0,n.jsxs)("div",{className:"flex flex-row items-center gap-x-1",children:["ORGANIZATIONAL UNIT"," ",(0,n.jsx)(o.tV,{className:"size-3",direction:eY.direction,enabled:"logicalOrganizationalUnit"===eY.key,onClick:()=>eQ({key:"logicalOrganizationalUnit",comparison:j.U.string,firstDirection:"asc"})}),(0,n.jsx)(c.oz,{onChange:X,onReset:()=>{e$("organizationalUnit"),X("")},onSearch:()=>eK("logicalOrganizationalUnit","organizationalUnit",H),value:H,isActive:eH("organizationalUnit")})]}),property:"organizationalUnit"},i={header:(0,n.jsxs)("div",{className:"flex flex-row items-center gap-x-1",children:["REGION"," ",(0,n.jsx)(o.tV,{className:"size-3",direction:eY.direction,enabled:"region"===eY.key,onClick:()=>eQ({key:"region",comparison:j.U.string,firstDirection:"asc"})}),(0,n.jsx)(c.oz,{onChange:el,onReset:()=>{e$("region"),el("")},onSearch:()=>eK("region","region",et),value:et,isActive:eH("region")})]}),property:"region"},d=D?{header:(0,n.jsxs)("div",{className:"flex flex-row justify-center",children:["COST",(0,n.jsx)(o.tV,{className:"size-3",direction:eY.direction,enabled:"cost"===eY.key,onClick:()=>eQ({key:"cost",firstDirection:"desc"})})]}),property:"cost",position:"Center"}:void 0,x=D?{header:(0,n.jsxs)("div",{className:"flex flex-row justify-center",children:["POTENTIAL SAVINGS",(0,n.jsx)(o.tV,{className:"size-3",direction:eY.direction,enabled:"estimatedSavings"===eY.key,onClick:()=>eQ({key:"estimatedSavings",firstDirection:"desc"})})]}),property:"estimatedSavings",position:"Center"}:void 0,m={header:(0,n.jsxs)("div",{className:"flex flex-row items-center justify-center",children:[Z?"STATUS":"ACTION",Z?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.oz,{onChange:ea,onReset:()=>{e$("status"),ea("")},onSearch:()=>eK("status","statusColumn",es),value:es,isActive:eH("statusColumn")}),(0,n.jsx)(o.tV,{className:"size-3",direction:eY.direction,enabled:"status"===eY.key,onClick:()=>eQ({key:"status",comparison:j.U.string,firstDirection:"asc"})})]}):(0,n.jsx)(n.Fragment,{})]}),property:"statusColumn",position:"Center"},p=K?{header:(0,n.jsx)("div",{className:"flex flex-row items-center justify-center",children:"TICKET"}),property:"ticketColumn",position:"Center",render:e=>e.ticketStatus===u.mk.NO_TICKET?(0,n.jsx)(r.zx,{className:"mx-2 w-[100px] px-2 py-1",styleType:"purple",textSize:"text-xs",onClick:()=>f(e.id,e.resourceId),stopFurtherPropagation:!0,children:"Create Ticket"}):e.ticketStatus===u.mk.CREATED&&(0,w.EN)(e.ticketUrl)?(0,n.jsx)(r.zx,{className:"mx-2 w-[100px] px-2 py-1",styleType:"green",textSize:"text-xs",onClick:()=>window.open(e.ticketUrl,"_blank"),stopFurtherPropagation:!0,children:"Open Ticket"}):null}:void 0,f=(e,t)=>{ex([t]),ep([e]),ed("createTickets")},h=(null==l?void 0:l.some(e=>e.reportAvailable))?{header:(0,n.jsx)("div",{className:"flex flex-row items-center justify-center",children:"DETAILS"}),property:"detailsColumn",position:"Center"}:void 0;return[t,s,a,i,d,x,h,m,p,e].filter(w.EN)}(),data:eX,isBordered:!0,isSelectable:!0,onClickSelect:e1,onClickSelectAll:e0,isLoading:er,filteredColumns:eG,onRemoveFilter:e$,emptyTableMessage:en,onClickTableRow:(e,t)=>{e1(t.id)},backgroundFetching:q})}),(0,n.jsx)(c.F8,{opportunityType:C,resourceIds:eu,onClickClose:()=>{e9()},onClickExecute:()=>{em.length>0&&((0,k.L)("Fixers executed",{ffName:t}),eg(!0),eq.mutateAsync({recommendationIds:em}).then(async()=>{eo(!1),await a(),eF({messages:["Successfully submitted ".concat(C," execution for ").concat(em.length," resource(s)")],type:"success"})}).catch(e=>{eF({messages:[(0,N.i)(e,"Failed to submit fixer execution(s)")],type:"error"})}).finally(()=>{ex([]),ep([]),eg(!1),eN(!1),e9()}))},isActive:"runrecommendations"===ec,isExecuting:eb,isAccountFixerDisabled:ez}),(0,n.jsx)(F,{opportunityType:C,resourceIds:eu,onClickClose:()=>{e9()},onClickExecute:function(e,t){if(eg(!0),!e){eF({messages:["Please select a date"],type:"error"}),te();return}em.length>0&&eB.mutateAsync({recommendationIds:em,postponeUntil:e,reason:t}).then(async()=>{eo(!1),await a(),eF({messages:["Successfully snoozed ".concat(em.length," resource(s)")],type:"success"})}).catch(e=>{eF({messages:[(0,N.i)(e,"Failed to snooze recommendations")],type:"error"})}).finally(()=>{te()})},isActive:"postponerecommendations"===ec,isExecuting:eb}),(0,n.jsx)(R,{opportunityType:C,resourceIds:eu,onClickClose:()=>{e9()},onClickExecute:()=>{em.length>0&&(eD(!0),eZ.mutateAsync({recommendationIds:em}).then(async()=>
1{eD(!1),await a(),eF({messages:["Successfully submitted ".concat(C," ticket creation for ").concat(em.length," resource(s)")],type:"success"})}).catch(e=>{eF({messages:[(0,N.i)(e,"Failed to submit ticket creation(s)")],type:"error"})}).finally(()=>{ex([]),ep([]),eD(!1),e9()}))},isActive:"createTickets"===ec,isExecuting:eL,isAccountFixerDisabled:ez}),eO&&(0,n.jsx)("div",{className:"absolute left-0 top-0 z-50 p-5 drop-shadow-2xl",children:(0,n.jsx)(r.bZ,{...eO})}),(0,n.jsx)(c.XX,{recommendationOptions:ew,isActive:"metaRecOptions"===ec,isExecuting:eb,closeModal:e9,resourceId:eC,handleExecute:function(e){(0,k.L)("Fixers executed",{ffName:t}),eg(!0),eq.mutateAsync({recommendationIds:[e]}).then(async()=>{eo(!1),await a(),eF({messages:["Successfully submitted recommendation for execution"],type:"success"})}).catch(e=>{eF({messages:[(0,N.i)(e,"Failed to submit fixer execution")],type:"error"})}).finally(()=>{ex([]),ep([]),eg(!1),ed("")})},hasPsSupport:e_,isPSSupported:W,onPsExecute:function(){(0,w.EN)(ey)&&((0,k.L)("Fixers PS support requested",{ffName:null==ey?void 0:ey.opportunityType}),eg(!0),function(e,t,l){eW.mutateAsync({recommendationIds:e}).then(async()=>{eo(!1),await a();let s=l?"resource: ".concat(l):"".concat(e.length," resource(s)");eF({messages:["Successfully submitted ".concat(t," Professional Service request for ").concat(s)],type:"success"})}).catch(e=>{eF({messages:[(0,N.i)(e,"Failed to submit Professional Service request(s)")],type:"error"})}).finally(()=>{ex([]),ep([]),eg(!1),ed(""),ek([]),eS(""),ev(null),eN(!1)})}([ey.id],ey.opportunityType,ey.resourceName))},isSentToPS:ej,accountFixerDisabled:ez}),(0,n.jsx)(z.R,{isPSAvailable:W,isActive:"details-modal"===ec,onClickClose:e9,recommendationId:em[0],resourceId:eu[0],setActiveModal:ed,setSelectedResourceIds:ex,setSelectedRecommendationIds:ep}),(0,n.jsx)(r.u_,{isActive:"info-modal"===ec,onEscKeyDown:e9,children:(0,n.jsxs)("div",{className:"absolute top-24 flex w-[45%] flex-col overflow-y-auto rounded-xl bg-white p-5",children:[(0,n.jsx)("button",{className:"self-end",onClick:e9,type:"button",children:(0,n.jsx)(r.b0,{})}),(0,n.jsx)("div",{className:"mt-8 flex gap-x-2 ",children:(0,n.jsxs)("div",{className:"flex w-full flex-col gap-y-2 overflow-y-auto py-2 pr-5 scrollbar-thin scrollbar-track-white scrollbar-thumb-gray-400",children:[(0,n.jsx)("p",{className:"pb-5 text-center text-lg font-medium ",children:eT}),(0,n.jsx)("div",{className:"flex h-[300px] w-full flex-col gap-y-2 overflow-y-auto py-2 pr-5 scrollbar-thin scrollbar-track-white scrollbar-thumb-gray-400",children:eE})]})}),(0,n.jsx)("div",{className:"mt-2 flex justify-between gap-x-4 pr-6",children:(0,n.jsx)(r.zx,{onClick:e9,styleType:"purple",type:"button",className:"w-full",children:"OK"})})]})})]})}},20328:function(e,t,l){l.d(t,{S:function(){return i}});var s=l(53704);l(21902);var a=l(7099),n=l(73030);let i=e=>{let{to:t,children:l,fallback:i=null}=e,{hasPermission:r}=(0,a.T)();return r(t)||r(n.y3.ALL_ALL)?(0,s.jsx)(s.Fragment,{children:l}):(0,s.jsx)(s.Fragment,{children:i})}},33572:function(e,t,l){l.d(t,{f:function(){return n}});var s=l(21902),a=l(30222);function n(e,t,l){(0,s.useEffect)(()=>{""!==e&&(0,a.EN)(e)?t&&l(!1):t||l(!0)},[e])}},87648:function(e,t,l){l.d(t,{x:function(){return d}});var s=l(21902),a=l(48046),n=l(30222),i=l(4022),r=l.n(i),o=l(46653);let c=e=>"asc"==e?"desc":"asc",d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{direction:"none",key:"",comparison:a.U.dollar},t=(0,o.useRouter)(),[l,i]=(0,s.useState)([]),[d,u]=(0,s.useState)([]),[x,m]=(0,s.useState)([]),[p,f]=(0,s.useState)([]),[h,b]=(0,s.useState)({...e,direction:e.direction}),g=e=>{let l={...t.query};0===e.length?delete l.tableFilter:l.tableFilter=e.map(e=>{let{key:t,column:l,value:s}=e;return"".concat(t,",").concat(l,",").concat(s)}),t.push({pathname:t.pathname,query:{...l}},void 0,{shallow:!0})},y=e=>{let t=l.filter(t=>t.key!==e&&t.column!==e);i(t),g(t)},v=e=>{let{key:t,comparison:l=a.U.dollar,firstDirection:i="desc",reverse:o=!0}=e;if(""==t){f(x);return}let d=[];t instanceof Array?d.push(...t):d.push(t);let u=i;
1if(r().isEqual(t,h.key)&&(u=o?c(h.direction):h.direction),b({key:t,direction:u,comparison:l}),!(0,n.EN)(x))return;let m=[...x].sort((e,t)=>{let a=0,n="asc"===u?1:-1;for(let o=0;o<d.length&&0===a;o++){var i,r;let c=l instanceof Array?l[o]:l,u=e[d[o]],x=t[d[o]];s.isValidElement(u)&&(u=null!==(i=u.key)&&void 0!==i?i:""),s.isValidElement(x)&&(x=null!==(r=x.key)&&void 0!==r?r:""),a=c("".concat(u.toString()),"".concat(x.toString()))*n}return a});f(m)};return(0,s.useEffect)(()=>{if(l.length>0&&(0,n.EN)(d)){let e=l.map(e=>d.filter(t=>{let l=t[e.key];return String(l).toLowerCase().includes(e.value.toLowerCase())})),t=e.reduce((e,t)=>e.filter(e=>t.includes(e)),d);m(t)}else m(d)},[l,d]),(0,s.useEffect)(()=>{""!=h.key?v({key:h.key,comparison:h.comparison,reverse:!1}):f(x)},[x]),(0,s.useEffect)(()=>{let e=t.query.tableFilter;(0,n.EN)(e)&&i((Array.isArray(e)?e:[e]).map(e=>{let[t,l,s]=e.split(",");return{key:t,column:l,value:s}}))},[t.query.tableFilter]),{filteredColumns:l,isInFilteredColumns:e=>(0,n.EN)(l.find(t=>t.column===e)),handleFilter:(e,t,s)=>{if(""===(s=s.trim())){y(e);return}let a=[...l],n=l.findIndex(t=>t.key===e);-1===n?a.push({key:e,column:t,value:s}):a[n]={key:e,column:t,value:s},i(a),g(a)},handleRemoveFilter:y,displayTableRows:p,setTableRows:u,sortedBy:h,handleSort:v,handleSelectResource:e=>{f(p.map(t=>t.id===e?{...t,isSelected:!t.isSelectDisabled&&!t.isSelected}:t))},handleSelectAll:()=>{let e=p.filter(e=>e.isVisible),t=e.filter(e=>!(0,n.EN)(e.isSelectDisabled)||!e.isSelectDisabled).every(e=>e.isSelected);f(p.map(e=>({...e,isSelected:e.isVisible?!t&&(!(0,n.EN)(e.isSelectDisabled)||!e.isSelectDisabled):e.isSelected})))}}}},2993:function(e,t,l){l.d(t,{i:function(){return a},y:function(){return n}});var s=l(9669);function a(e,t){var l,s,a;return(null==e?void 0:null===(l=e.response)||void 0===l?void 0:l.data)?(t+='. Request failed with message "'.concat(JSON.stringify(e.response.data),'"'),(null==e?void 0:null===(s=e.response)||void 0===s?void 0:s.statusText)?t+=' and status "'.concat(e.response.statusText,'"'):(null==e?void 0:null===(a=e.response)||void 0===a?void 0:a.statusCode)&&(t+=" and status code ".concat(e.response.statusCode))):t+=": ".concat(JSON.stringify(e)),t}function n(e,t){if(e instanceof s.AxiosError){var l;if(null==e?void 0:null===(l=e.response)||void 0===l?void 0:l.data)return e.response.data}return t}},48046:function(e,t,l){l.d(t,{U:function(){return a}});var s=l(35464);let a={string:(e,t)=>(null!=e?e:"").toString().localeCompare(null!=t?t:""),number:(e,t)=>{let l=Number.parseFloat(e)||0,s=Number.parseFloat(t)||0;return l-s},dollar:(e,t)=>{try{let l=(0,s.RO)(null!=e?e:"0"),a=(0,s.RO)(null!=t?t:"0");return l-a}catch(e){return 0}},bool:(e,t)=>(e?1:0)-(t?1:0),timeStamp:(e,t)=>{let l=new Date(e).getTime(),s=new Date(t).getTime();return l-s},nil:(e,t)=>0}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.