1"use strict";(self.webpackChunkcourtcorrect_platform=self.webpackChunkcourtcorrect_platform||[]).push([[1636],{53426(e,a,s){s.d(a,{i:()=>p});var t=s(96540),r=s(34164),l=s(98114),n=s(66237),o=s(97534),i=s(29577),c=s(18539),d=s(74665);var u=s(74848);const m=({popoverProps:e,renderTrigger:a,createScope:s,onCreate:n,onClose:o,isLoading:m,isSaving:p,saveLabel:h,savingLabel:g,namePlaceholder:b,allowEmptyName:v,trimName:x,popoverClassName:j,triggerClassName:y})=>{const[f,N]=(0,t.useState)(""),[C,S]=(0,t.useState)(s?.defaultValue),k=x?f.trim():f,w=m||p,E=v||k.trim().length>0,A=()=>{!w&&E&&n(k,o,C)};return(0,u.jsx)(c.A,{...e,className:(0,r.$)("TdnTSMlr",j),triggerClassName:y,showArrow:!1,trigger:a(e.isOpen),children:(0,u.jsxs)("div",{className:"fF9op2Kb",children:[(0,u.jsxs)("div",{className:"AuxdOEKo",children:[(0,u.jsx)(i.S,{inputClassName:"acXrhMuK",placeholder:b,value:f,onChange:N,onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?A():"Escape"===e.key&&o()},disabled:w,autoFocus:!0}),(0,u.jsx)(l.$,{className:"zaxTC9z2",variant:"green",size:"m",onClick:A,disabled:w||!E,children:p?g:h})]}),s?(0,u.jsx)(d.m,{variant:"v2",value:C??s.defaultValue,options:s.options,onSelect:e=>{null!==e&&S(e)},isSearchable:!1,isDisabled:w}):null]})})},p=({items:e,groups:a,createScope:s,renderTrigger:d,onCreate:p,onApply:h,onDelete:g,canManage:b,onUpdate:v,isLoading:x=!1,isSaving:j=!1,title:y="Saved Views",createLabel:f="Save View",saveLabel:N="Save",savingLabel:C="Saving...",emptyLabel:S,loadingLabel:k,noOptionsLabel:w="No options",searchPlaceholder:E="Search",namePlaceholder:A="Type name...",searchable:T=!0,allowEmptyName:_=!1,trimName:L=!0,createIcon:F=(0,u.jsx)(o.I,{name:"save",size:16}),popoverClassName:D,triggerClassName:O})=>{const[M,P]=(0,t.useState)(!1),[U,I]=(0,t.useState)(null),[R,V]=(0,t.useState)(""),$=(0,c.f)({isAdaptive:!0,side:"bottom",align:"end"}),{isOpen:B}=$,z=(0,t.useCallback)(()=>{P(!1),I(null),V("")},[]);(0,t.useEffect)(()=>{B||z()},[B,z]);const q=L?R.trim():R,G=x||j,H=_||q.trim().length>0,Y=(0,t.useCallback)(e=>{G||!H||!v||b&&!b(e)||v(e,q,()=>{I(null),V("")})},[b,H,G,q,v]),Z=(0,t.useCallback)(()=>{P(!0),I(null),V("")},[]),K=(0,t.useCallback)(e=>{P(!1),I(e.id),V(e.name)},[]),W=(0,t.useCallback)(e=>(0,u.jsxs)("div",{className:"d8ew0gJl",children:[(0,u.jsx)(i.S,{placeholder:A,value:R,onChange:V,onKeyDown:a=>{a.stopPropagation(),"Enter"===a.key?e():"Escape"===a.key&&z()},disabled:G,autoFocus:!0}),(0,u.jsx)(l.$,{variant:"green",size:"m",onClick:e,disabled:G||!H,children:j?C:N})]}),[H,z,G,j,R,A,N,C]),J=Boolean(x&&k),X=0===e.length?S??w:w,Q=(0,t.useMemo)(()=>e.map(e=>U!==e.id||b&&!b(e)?{label:e.name,value:e.id,onClick:()=>h(e),extraAfterContent:!v&&!g||b&&!b(e)?null:(0,u.jsxs)("div",{className:"FPmmGvfj",children:[v?(0,u.jsx)(o.I,{name:"edit",role:"button","aria-label":`Rename ${e.name}`,onClick:a=>{a.stopPropagation(),x||K(e)}}):null,g?(0,u.jsx)(o.I,{name:"delete",role:"button","aria-label":`Delete ${e.name}`,onClick:a=>{a.stopPropagation(),x||g(e)}}):null]})}:{label:"",value:e.id,className:"NrbAqFup",extraBeforeContent:W(()=>Y(e))}),[b,U,x,e,h,g,v,W,K,Y]),ee=(0,t.useMemo)(()=>a?a.map(a=>({label:a.label,options:Q.filter((s,t)=>a.matches(e[t]))})):Q,[a,e,Q]),ae=(0,t.useCallback)(e=>x||e.value===U,[U,x]),se=(0,t.useCallback)((e,a)=>e.value===U||e.label.toLowerCase().includes(a.trim().toLowerCase()),[U]),te=(0,t.useMemo)(()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"JxkkNRcG",children:(0,u.jsx)("span",{className:"nN4e0vsR",children:y})}),J?(0,u.jsx)("div",{className:"kE41DpRs",children:k}):null]}),[k,J,y]),re=(0,t.useMemo)(()=>J?null:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("hr",{className:"yuLTrG_E"}),(0,u.jsx)("button",{type:"button",className:"MUPGs1Td",disabled:G,onClick:Z,children:(0,u.jsxs)("div",{children:[F,(0,u.jsx)("span",{children:f})]})})]}),[F,f,G,J,Z]);return M?(0,u.jsx)(m,{popoverProps:$,renderTrigger:d,createScope:s,onCreate:p,onClose:z,isLoading:x,isSaving:j,saveLabel:N,savingLabel:C,namePlaceholder:A,allowEmptyName:_,trimName:L,popoverClassName:D,triggerClassName:O}):(0,u.jsx)(n.d,{popoverProps:$,popoverClassName:(0,r.$)("Soqo9VpA",D),triggerClassName:O,popoverTrigger:d(B),placeholder:E,value:null,options:J?[]:ee,dropdownIsLoading:J,dropdownIsSearchable:Boolean(T&&!J&&e.length>0),dropdownIsOptionDisabled:ae,dropdownFilterOption:se,noOptionsMessage:X,beforeContent:te,afterContent:re})}},61516(e,a,s){s.d(a,{R:()=>t.R});var t=s(50712)},20249(e,a,s){s.r(a),s.d(a,{DataDashboardV2Page:()=>J,default:()=>X});var t=s(61225),r=s(96540),l=s(54706),n=s(97534),o=s(30721),i=s(38301),c=s(61516),d=s(67072),u=s(69788),m=s(40688);var p=s(74848);const h=()=>{const[e,a]=(0,r.useState)(!1),{content:s,isLoading:h,error:g,sendRequest:b}=function(e){const[a,s]=(0,r.useState)(""),[l,n]=(0,r.useState)(!1),[o,i]=(0,r.useState)(null),c=(0,t.d4)(e=>e.dashboard.activeTab),{filters:p,dateFrequency:h,hideEmptyLabels:g,breakdown:b,shouldUseHistoricalData:v}=(0,t.d4)(d.rB);return{content:a,isLoading:l,error:o,sendRequest:(0,r.useCallback)(async()=>{n(!0),i(null),s("");try{const a=(0,u.Q)(p,b,h,g,v),t=await fetch(`${m.A.api.url}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({tab:c,filters:a})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);if(!t.body)throw new Error("Response body is null");const r=t.body.getReader(),l=new TextDecoder;let n="";for(;;){const{done:e,value:a}=await r.read();if(e)break;n+=l.decode(a,{stream:!0}),s(n)}}catch(e){const a=e instanceof Error?e.message:"An error occurred while generating AI commentary";
1i(a),console.error("Error generating AI commentary:",e)}finally{n(!1)}},[p,b,c,h,g,v,e])}}("data-dashboard/ai-commentary");return(0,p.jsxs)("div",{className:"qo4ii1am "+(h?"C9rGzmqk":""),children:[(0,p.jsxs)("div",{className:"RMLQT7bu",children:[(0,p.jsx)("h2",{children:"AI Commentary"}),(0,p.jsxs)("div",{className:"_DWueR3L",children:[(0,p.jsx)(o.A,{text:h?"Generating":s.trim().length>0?"Regenerate":"Generate",variant:"green",svgBefore:!h&&(0,p.jsx)(n.I,{name:"refresh-sync",size:20}),disabled:h,size:"small",onClick:()=>{e||a(!0),b()}}),(s.trim().length>0||g)&&!h?(0,p.jsx)(i.A,{isActive:!0,isUp:e,onClick:()=>a(e=>!e)}):null]})]}),e?(0,p.jsx)("div",{className:"_5YpuNizs",children:(0,p.jsx)("div",{className:"qT093B0Y",children:((e,a,s)=>{switch(!0){case!!s:return(0,p.jsxs)("div",{className:"wUdI23Ed",children:["Error: ",s]});case e&&!a:return(0,p.jsx)(l.A,{variant:"text",sx:{fontSize:"1rem"}});default:return(0,p.jsx)(c.R,{content:a})}})(h,s,g)})}):null]})},g=({title:e="Data Dashboard"})=>(0,p.jsxs)("div",{className:"G1l36vUz",children:[(0,p.jsx)("h1",{children:e}),(0,p.jsx)("p",{className:"rFNzq6Vr",children:"Discover, drill-down and export your case data."}),(0,p.jsxs)("p",{className:"ETy0Zpei",children:["Have a special data request? ",(0,p.jsx)("a",{children:"Click here to contact us"})]})]});var b=s(18878),v=s(10423),x=s(85375),j=s(74118),y=s(93137),f=s(42945);const N={tab:y.VB,filters:y.lX,breakdown:y.ru};var C=s(3137);const S=()=>{const e=(0,t.wA)(),{activeTab:a}=(0,t.d4)(e=>e.dashboard);(()=>{const e=(0,t.wA)(),a=(0,t.d4)(e=>e.dashboard.activeTab),{filters:s,breakdown:l,areInitialFilterParamsSet:n}=(0,t.d4)(d.rB),[o,i]=(0,j.ab)(N,{history:"replace",urlKeys:y.ZT}),c=(0,r.useRef)(!1);(0,r.useEffect)(()=>{a&&x.yk.has(a)||e((0,d.YF)((0,x.UD)(o.tab)))},[a,o.tab,e]),(0,r.useEffect)(()=>{n||(c.current?e((0,d.T3)({})):(c.current=!0,e((0,d.YF)(o.tab)),e((0,d.T3)({filters:o.filters??void 0,breakdown:o.breakdown??void 0}))))},[n,e,o]),(0,r.useEffect)(()=>{n&&i({tab:a??x.y9.CASE_VOLUMES,filters:s,breakdown:l})},[n,a,s,l,i]),(0,f.e)({isReady:n})})();const s=(0,r.useCallback)((a,s)=>{e((0,d.YF)(s))},[e]);return(0,p.jsx)(C.V$,{children:(0,p.jsx)(b.A,{value:(0,x.UD)(a),onChange:s,textColor:"inherit","aria-label":"data dashboard report tabs",children:x.Dg.map(e=>(0,p.jsx)(v.A,{value:e.name,label:e.displayName,disabled:!e.isActive},e.name))})})};var k=s(42512),w=s(2543),E=s(86928);const A={[x.y9.CASE_VOLUMES]:"data-dashboard/case-volumes",[x.y9.ISSUE_VOLUMES]:"data-dashboard/issue-volumes",[x.y9.COMPENSATION_VOLUMES]:"data-dashboard/compensation-volumes"};var T=s(89284),_=s(66118),L=s(19203),F=s(44731);const D={responsive:!0,plugins:{legend:{display:!1},title:{display:!0,text:"Bar Chart"}}},O=({data:e,options:a,plugins:s})=>{const t=(0,r.useRef)(null),l=(0,r.useMemo)(()=>{const e={...D.plugins,...a?.plugins};return{...D,...a,plugins:e}},[a]);return(0,p.jsx)("div",{ref:t,className:"DYzv2fhD",children:(0,p.jsx)(F.yP,{height:100,options:l,data:e,plugins:s})})},M="Qa1lwNOm",P=({breakdowns:e,data:a})=>(0,p.jsxs)("div",{className:"x30OPYpj",children:[(0,p.jsxs)("div",{className:"u1PmcyW5",children:["Example:",(0,p.jsx)("span",{className:M}),(0,w.isEmpty)(e)?(0,p.jsx)(p.Fragment,{children:"Case Volumes"}):(0,p.jsx)(p.Fragment,{children:e.map(e=>e.label).join(" > ")})]}),(0,p.jsx)("div",{className:"FBHpCPY5",children:a.datasets.map(e=>{const a=(Array.isArray(e.label)?e.label:null!=e.label?[e.label]:[]).join(" > "),s=e.total,t=e.total_pct;return(0,p.jsxs)("div",{className:"Er4hYNL1",children:[(0,p.jsx)("span",{style:{backgroundColor:e.backgroundColor},className:M}),(0,p.jsxs)("span",{children:[a,null!=s?(0,p.jsxs)("span",{className:"KaJ8nJlp",children:["Total: ",s,null!=t?` (${t} %)`:null]}):null]})]},a)})})]}),U=[[43,167,109],[5,112,222],[223,27,65],[255,180,0],[168,229,101],[138,99,210],[255,162,192],[0,191,179],[255,110,0],[31,122,140],[140,43,167],[212,80,135],[249,93,106],[255,202,58],[25,130,196],[106,76,147],[255,89,94],[138,201,38],[25,142,142],[169,169,179],[51,101,138],[134,187,216],[246,174,45],[242,100,25],[67,170,139],[159,95,128],[61,52,139],[189,191,9],[247,37,133],[114,9,183],[67,97,238],[76,201,240],[144,190,109],[255,0,110],[131,56,236],[6,214,160],[239,71,111],[255,209,102],[17,138,178],[7,59,76],[255,181,167],[252,213,206
1],[216,226,220],[162,210,255],[189,224,254],[205,180,219],[255,200,221],[255,175,204],[181,228,140],[153,217,140]],I=e=>{const a=U.length,s=Math.floor(e/a),t=e%a,[r,l,n]=U[t];return`rgba(${r}, ${l}, ${n}, ${1-.2*s})`};_.t1.register(_.PP,_.kc,_.E8,_.hE,_.m_,_.s$);const R=({breakdowns:e,data:a,isDatasetEmpty:s})=>{const t=(0,r.useMemo)(()=>a?{labels:a.labels,datasets:a.datasets.map((e,a)=>({...e,backgroundColor:I(a)})),total:a.total,avg_days_to_first_close:a.avg_days_to_first_close,avg_days_working:a.avg_days_working,total_compensation:a.total_compensation}:null,[a]);return(0,p.jsxs)(C.Mf,{children:[s?(0,p.jsx)("div",{className:"empty-overlay",children:(0,p.jsx)("p",{children:"No cases found, please try another combination of filters."})}):null,t?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(O,{data:t,options:{plugins:{title:{display:!0,text:"Case Volumes"},datalabels:{anchor:"center",align:"center",clamp:!0,color:"#fff",font:{weight:600,size:11},formatter:e=>"number"==typeof e&&e>0?e:""}}},plugins:[L.A]}),(0,p.jsx)(P,{data:t,breakdowns:e})]}):null]})};var V=s(5032),$=s(31429);const B="c9pvVwHH",z="TWKHxYX5",q={[x.y9.CASE_VOLUMES]:{total:"Total cases:"},[x.y9.ISSUE_VOLUMES]:{total:"Total issues:"},[x.y9.COMPENSATION_VOLUMES]:{total:"Total compensation:"}},G=m.A.currencyOptions[m.A.defaultCurrency]??"",H=e=>`${G}${(0,$.A9)(e)}`,Y=({data:e,isDatasetEmpty:a,breakdowns:s,activeTab:t})=>{const l=(0,r.useMemo)(()=>!e||a?"-":t===x.y9.COMPENSATION_VOLUMES?H(e.total):e.total.toString(),[e,a,t]),n=(0,r.useMemo)(()=>Boolean(s.find(e=>["calendarDaysOpen","workingDaysOpened"].includes(e.id))),[s]),o=(0,r.useMemo)(()=>Boolean(s.find(e=>["compensationType","compensationValue"].includes(e.id))),[s]),i=(0,r.useMemo)(()=>!e||a?null:{averageCalendarCaseAge:e?.avg_days_to_first_close?.toString()||"-",averageWorkingCaseAge:e?.avg_days_working?.toString()||"-",totalCompensation:null!=e?.total_compensation?H(e.total_compensation):"-"},[e,a]);return(0,p.jsxs)("div",{className:"ou3jbg7a",children:[(0,p.jsx)("p",{className:"yUBruwRD",children:q[t]?.total??"Total cases:"}),(0,p.jsx)("p",{className:"fOW3dGp7",children:l}),i?(0,p.jsxs)("div",{className:"j4OECbLZ",children:[n?(0,p.jsxs)("div",{className:"pELIqHdr",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("p",{className:B,children:"Average case age (calendar):"}),(0,p.jsxs)("p",{className:z,children:[i.averageCalendarCaseAge," days"]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("p",{className:B,children:"Average case age (working):"}),(0,p.jsxs)("p",{className:z,children:[i.averageWorkingCaseAge," days"]})]})]}):null,o?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{className:B,children:"Total compensation:"}),(0,p.jsx)("p",{className:z,children:i.totalCompensation})]}):null]}):null]})},Z=({activeTab:e})=>{const a=(0,t.wA)(),{data:s,filters:n,dateFrequency:o,hideEmptyLabels:i,breakdown:c,isLoading:m,isUpdating:h,isDatasetEmpty:g,areInitialFilterParamsSet:b,shouldUseHistoricalData:v}=(0,t.d4)(d.rB),j=(0,t.d4)(e=>e.auth.user?.features.is_rac_category_labels),y=x.nG[e],{data:f,isLoading:N,isFetching:S}=(0,T.T)({enabled:!0,historical:v,entity:y});return(0,r.useEffect)(()=>{f&&(a((0,d.Dh)(f.filters)),a((0,d.S8)(f.customFilters)),a((0,d.sX)(f.customDateFilters)),a((0,d.Tm)(f.customNumberFilters)),a((0,d.Z8)(f.numberFilterFields)),a((0,d.L5)(f.customTextFilters)),a((0,d.ZH)(f.textFilterFields)),a((0,d.ZA)(f.customCurrencyFilters)),a((0,d.LS)(f.currencyFilterFields)),a((0,d.PE)(f.customBreakdowns)))},[a,f]),function({tab:e,filterPayload:a,areInitialFilterParamsSet:s}){const l=(0,t.wA)(),n=(0,r.useRef)(null),o=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!s||!e)return;const t=A[e];t&&(o.current===e&&(0,w.isEqual)(n.current,a)||(n.current=a,o.current=e,l((0,d.$D)(!0)),l((0,d.AG)(!1)),E.A.post(t,a,{timeout:12e4}).then(({data:e})=>{l((0,d.$Z)(e)),l((0,d.AG)(!1))}).catch(e=>{404===e?.status&&"No data found for the specified criteria"===e?.err?.detail&&(l((0,d.$Z)({...e?.data,datasets:[],total:0})),l((0,d.AG)(!0)))}).finally(()=>{l((0,d.F6)(!1)),l((0,d.$D)(!1))})))},[l,e,a,s])}({tab:e,filterPayload:(0,r.useMemo)(()=>(0,u.Q)(n,c,o,i,v),[n,c,o,i,v]),areInitialFilterParamsSet:b}),m?(0,p.jsxs)(C.r3,{children:[(0,p.jsx)(l.A,{className:"controls-skeleton",variant:"text"}),(0,p.jsx)(l.A,{variant:"rounded",width:"100%",height:"30vh"})]}):(0,p.jsxs)(p.Fragment,{children:[h||N||S?(0,p.jsx)(k.A,{}):null,(0,p.jsx)(Y,{data:s,isDatasetEmpty:g,breakdowns:c,activeTab:e}),(0,p.jsx)(V.S,{onBreakdownToggle:e=>{a((0,d.of)(e))},onBreakdownsRemoved:()=>{a((0,d.Zg)())},onResetFilters:()=>{a((0,d.dr)())},isRacCategoryLabels:j,activeTab:e}),(0,p.jsx)(R,{data:s,breakdowns:c,isDatasetEmpty:g})]})},K=()=>{const e=(0,t.d4)(e=>e.dashboard.activeTab);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(g,{}),(0,p.jsx)(S,{}),(0,p.jsx)("div",{children:(e=>{switch(e){case x.y9.CASE_VOLUMES:case x.y9.ISSUE_VOLUMES:case x.y9.COMPENSATION_VOLUMES:return(0,p.jsx)(Z,{activeTab:e});default:return"Not implemented"}})((0,x.UD)(e))}),(0,p.jsx)(h,{})]})};var W=s(28723);const J=()=>
1(0,p.jsx)(W.A,{isSidebar:!0,children:(0,p.jsx)(K,{})}),X=J},50712(e,a,s){s.d(a,{R:()=>i});var t=s(99418),r=s(73557);var l=s(74848);const n=new r.A({html:!0,breaks:!0,linkify:!0}),o=n.renderer.rules.link_open||function(e,a,s,t,r){return r.renderToken(e,a,s)};n.renderer.rules.link_open=(e,a,s,t,r)=>{const l=e[a];return l.attrSet("target","_blank"),l.attrSet("rel","noopener noreferrer"),o(e,a,s,t,r)};const i=({content:e})=>{if(!e)return null;const a=e.replace(/{{([^{}]*)}}/g,'<span style="background-color:#FFD580">$1</span>').replace(/\[\[([^[\]]*)\]\]/g,'<span style="font-size:16px; font-weight: bold;">$1</span>'),s=n.render(a),r=t.A.sanitize(s,{USE_PROFILES:{html:!0},ADD_ATTR:["target","rel","style"]});return(0,l.jsx)("div",{"data-testid":"markdownText",className:"dHqnrXx6",dangerouslySetInnerHTML:{__html:r}})}}}]);
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.