1"use strict";(globalThis.webpackChunkpulse=globalThis.webpackChunkpulse||[]).push([[2653],{78321(e,t,s){s.d(t,{A:()=>c});s(9950);var n=s(67818),i=(s(62391),s(34940)),l=s(65276),o=s(69123),a=s(23166),r=s(44414);const c=e=>{let{showTableView:t=!1,onToggleTableView:s,onExportCSV:c,onViewAll:d,viewAllText:h="View All",showViewAll:x=!1,disabled:u=!1,className:m="",buttonColor:p="soft-dark",buttonSize:f="sm",style:g={},hasChartView:j=!0,showExport:b=!0,exportLabel:y="export_as_csv",onDownloadPDF:N=null}=e;const{t:v}=(0,n.Bd)();return x||j||b||!!N?(0,r.jsxs)(a.A,{className:`d-inline-block ${m}`,style:g,children:[(0,r.jsx)(o.A,{className:`btn btn-${p} btn-${f} lh-1`,disabled:u,children:(0,r.jsx)("i",{className:"ri-more-fill"})}),(0,r.jsxs)(l.A,{container:"body",end:!0,children:[x&&(0,r.jsxs)(i.A,{className:"d-flex align-items-center",onClick:d,disabled:u,children:[(0,r.jsx)("i",{className:"ri-list-unordered lh-1 me-1"}),h]}),j&&(0,r.jsxs)(i.A,{className:"d-flex align-items-center",onClick:s,disabled:u,children:[(0,r.jsx)("i",{className:(t?"ri-bar-chart-2-fill":"ri-table-fill")+" lh-1 me-1"}),v(t?"show_chart":"show_table")]}),b&&(0,r.jsxs)(i.A,{className:"d-flex align-items-center",onClick:c,disabled:u,children:[(0,r.jsx)("i",{className:"ri-file-download-fill lh-1 me-1"}),v(y)]}),N&&(0,r.jsxs)(i.A,{className:"d-flex align-items-center",onClick:N,disabled:u,children:[(0,r.jsx)("i",{className:"ri-file-pdf-fill lh-1 me-1"}),"Download as PDF"]})]})]}):null}},82653(e,t,s){s.r(t),s.d(t,{default:()=>v});var n=s(9950),i=s(84084),l=s(88156),o=s(17504),a=s(42869),r=s(69787),c=s(61295),d=s(14171),h=s(8081),x=s(61340),u=s(10877),m=s(87537),p=s(78321),f=s(97917),g=s(44414);const j=e=>{let{data:t}=e;const[s,o]=(0,n.useState)(!1),a=(0,n.useCallback)(()=>o(e=>!e),[]),r=(0,n.useMemo)(()=>{if(!t||0===t.length)return{};const e={};return t.forEach(t=>{const s=t.section||"Other";e[s]||(e[s]=[]),e[s].push(t)}),e},[t]),c=(0,n.useMemo)(()=>{if(!t||0===t.length)return[];const e=new Set;t.forEach(t=>{Object.keys(t.choices||{}).forEach(t=>{e.add(t)})});const s=Array.from(e),n=["Yes","No","N/A"];return s.sort((e,t)=>{const s=n.indexOf(e),i=n.indexOf(t);return-1!==s&&-1!==i?s-i:-1!==s?-1:-1!==i?1:e.localeCompare(t)})},[t]),d=(0,n.useCallback)(()=>{const e=[];Object.keys(r).sort().forEach(t=>{r[t].forEach(s=>{const n={section:t,question:s.question_name,non_compliant:s.total};
1c.forEach((e,t)=>{var i;const l=null===(i=s.choices)||void 0===i?void 0:i[e],o=(null===l||void 0===l?void 0:l.count)||0,a=(null===l||void 0===l?void 0:l.percentage)||0;n[`choice_${t+1}`]=`${e}: ${o} (${a.toFixed(1)}%)`}),e.push(n)})});const t=[{name:"Section",selector:e=>e.section},{name:"Question",selector:e=>e.question},...c.map((e,t)=>({name:`Choice ${t+1}`,selector:e=>e[`choice_${t+1}`]}))];(0,f.yx)(e,t,"Non_Scoring_Question_Performance_Analysis")},[r,c]);if(!t||0===t.length)return null;const j=e=>{switch(e){case"Yes":return"#28a745";case"No":return"#dc3545";case"N/A":return"#6c757d";default:return"#495057"}},b=function(){return(0,g.jsx)("div",{className:"table-responsive",children:(0,g.jsxs)("table",{className:"table table-borderless align-middle mb-0",children:[(0,g.jsx)("thead",{className:"table-light",children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{className:"text-muted text-uppercase",style:{fontWeight:"600",fontSize:"13px",minWidth:"180px"},children:"Section"}),(0,g.jsx)("th",{className:"text-muted text-uppercase",style:{fontWeight:"600",fontSize:"13px",minWidth:"250px"},children:"Question"}),(0,g.jsx)("th",{className:"text-muted text-uppercase",style:{fontWeight:"600",fontSize:"13px",minWidth:"200px"},children:"Responses"})]})}),(0,g.jsx)("tbody",{children:Object.keys(r).sort().map((e,t)=>(0,g.jsx)(n.Fragment,{children:r[e].map((t,s)=>(0,g.jsxs)("tr",{children:[0===s?(0,g.jsx)("td",{rowSpan:r[e].length,style:{fontSize:"14px",verticalAlign:"top"},children:(0,g.jsx)("div",{className:"fw-medium",style:{color:"#1a1d29",paddingTop:"0.5rem"},children:e})}):null,(0,g.jsx)("td",{style:{fontSize:"14px"},children:(0,g.jsx)("div",{className:"fw-medium",style:{color:"#1a1d29"},children:t.question_name})}),(0,g.jsx)("td",{style:{fontSize:"13px"},children:(0,g.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Object.entries(t.choices||{}).map(e=>{let[t,s]=e;const n=(null===s||void 0===s?void 0:s.count)||0,i=(null===s||void 0===s?void 0:s.percentage)||0;return(0,g.jsxs)("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",background:"#f8f9fa",borderRadius:"6px",padding:"4px 10px",minWidth:"70px"},children:[(0,g.jsx)("span",{style:{color:j(t),fontWeight:"600",fontSize:"13px"},children:t}),(0,g.jsxs)("span",{className:"text-muted",style:{fontSize:"12px"},children:[n," (",i.toFixed(1),"%)"]})]},t)})})})]},t.question_id||s))},t))})]})})};return(0,g.jsxs)(n.Fragment,{children:[(0,g.jsxs)(h.A,{isOpen:s,centered:!0,size:"xl",toggle:a,children:[(0,g.jsx)(x.A,{toggle:a,children:"Non-Scoring Question Performance Analysis"}),(0,g.jsx)(u.A,{children:b(!0)})]}),(0,g.jsxs)(i.A,{className:"mb-3",children:[(0,g.jsxs)(m.A,{className:"d-flex justify-content-between align-items-center border-0 bg-white",children:[(0,g.jsx)("h5",{className:"card-title mb-0",style:{fontSize:"1.25rem",fontWeight:"600"},children:"Non-Scoring Question Performance Analysis"}),(0,g.jsx)(p.A,{onExportCSV:d,hasChartView:!1,showExport:!0,onMaximize:a})]}),(0,g.jsx)(l.A,{children:b(!1)})]})]})},b=e=>{let{data:t}=e;const[s,o]=(0,n.useState)(!1),a=(0,n.useCallback)(()=>o(e=>!e),[]),r=(0,n.useMemo)(()=>{if(!t||0===t.length)return[];const e=new Set;return t.forEach(t=>{Object.keys(t.data||{}).forEach(t=>e.add(t))}),Array.from(e).sort()},[t]),c=(0,n.useCallback)(()=>{const e=[];t.forEach(t=>{r.forEach(s=>{const n=t.data[s];if(n){var i,l,o,a,r,c,d,h,x;const u={question_name:t.question_name,section:t.section,site:s,yes_count:(null===(i=n.Yes)||void 0===i?void 0:i.count)||0,yes_percentage:(null===(l=n.Yes)||void 0===l||null===(o=l.percentage)||void 0===o?void 0:o.toFixed(1))||"0.0",no_count:(null===(a=n.No)||void 0===a?void 0:a.count)||0,no_percentage:(null===(r=n.No)||void 0===r||null===(c=r.percentage)||void 0===c?void 0:c.toFixed(1))||"0.0",na_count:(null===(d=n["N/A"])||void 0===d?void 0:d.count)||0,na_percentage:(null===(h=n["N/A"])||void 0===h||null===(x=h.percentage)||void 0===x?void 0:x.toFixed(1))||"0.0"};e.push(u)}})});(0,f.yx)(e,[{name:"Question",selector:e=>e.question_name},{name:"Section",selector:e=>e.section},{name:"Site",selector:e=>e.site},{name:"Yes Count",selector:e=>e.yes_count},{name:"Yes %",selector:e=>e.yes_percentage},{name:"No Count",selector:e=>e.no_count},{name:"No %",selector:e=>e.no_percentage},{name:"N/A Count",selector:e=>e.na_count},{name:"N/A %",selector:e=>e.na_percentage}],"Question_wise_Non_Compliance_Matrix")},[t,r]);if(!t||0===t.length)return null;const d=function(){return(0,g.jsx)("div",{className:"table-responsive",children:(0,g.jsxs)("table",{className:"table table-borderless align-middle mb-0",children:[(0,g.jsx)("thead",{className:"table-light",children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{className:"text-muted text-uppercase",style:{fontWeight:"600",fontSize:"13px",minWidth:"250px"},children:"Question"}),(0,g.jsx)("th",{className:"text-muted text-uppercase",style:{fontWeight:"600",fontSize:"13px",minWidth:"150px"},children:"Section"}),r.map(e=>(0,g.jsx)("th",{className:"text-muted text-uppercase text-center",style:{fontWeight:"600",fontSize:"13px",minWidth:"150px"},children:e},e))]})}),(0,g.jsx)("tbody",{children:t.map((e,t)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{style:{fontSize:"14px"},children:(0,g.jsx)("div",{className:"fw-medium",style:{color:"#1a1d29"},children:e.question_name})}),(0,g.jsx)("td",{style:{fontSize:"14px"},children:(0,g.jsx)("span",{className:"text-muted",children:e.section})}),r.map(t=>{var s,n,i,l,o,a;const r=e.data[t];if(!r)return(0,g.jsx)("td",{className:"text-center text-muted",style:{fontSize:"14px"},children:"\u2014"},t);const c=(null===(s=r.Yes)||void 0===s?void 0:s.count)||0,d=(null===(n=r.Yes)||void 0===n?void 0:n.percentage)||0,h=(null===(i=r.No)||void 0===i?void 0:i.count)||0,x=(null===(l=r.No)||void 0===l?void 0:l.percentage)||0,u=(null===(o=r["N/A"])||void 0===o?void 0:o.count)||0,m=(null===(a=r["N/A"])||void 0===a?void 0:a.percentage)||0;return(0,g.jsx)("td",{className:"text-center",style:{fontSize:"13px"},children:(0,g.jsxs)("div",{style:{lineHeight:"1.6"},children:[c>0&&(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{style:{color:"#28a745",fontWeight:"500"},children:"Yes:"})," ",(0,g.jsxs)("span",{className:"text-muted",children:[c," (",d.toFixed(1),"%)"]})]}),h>0&&(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{style:{color:"#dc3545",fontWeight:"500"},children:"No:"})," ",(0,g.jsxs)("span",{className:"text-muted",children:[h," (",x.toFixed(1),"%)"]})]}),u>0&&(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{style:{color:"#6c757d",fontWeight:"500"},children:"N/A:"})," ",(0,g.jsxs)("span",{className:"text-muted",children:[u," (",m.toFixed(1),"%)"]})]}),0===c&&0===h&&0===u&&(0,g.jsx)("span",{className:"text-muted",children:"\u2014"})]})},t)})]},e.question_id||t))})]})})};return(0,g.jsxs)(n.Fragment,{children:[(0,g.jsxs)(h.A,{isOpen:s,centered:!0,size:"xl",toggle:a,children:[(0,g.jsx)(x.A,{toggle:a,children:"Question-wise Non-Compliance Matrix"}),(0,g.jsx)(u.A,{children:d(!0)})]}),(0,g.jsxs)(i.A,{className:"mb-3",children:[(0,g.jsxs)(m.A,{className:"d-flex justify-content-between align-items-center border-0 bg-white",children:[(0,g.jsx)("h5",{className:"card-title mb-0",style:{fontSize:"1.25rem",fontWeight:"600"},children:"Question-wise Non-Compliance Matrix"}),(0,g.jsx)(p.A,{onExportCSV:c,hasChartView:!1,showExport:!0,onMaximize:a})]}),(0,g.jsx)(l.A,{children:d(!1)})]})]})};var y=s(44874);const N=a.Un.filter(e=>"locations"!==e.id).map(e=>"checklists"===e.id?{...e,removable:!1,required:!0,defaultHidden:!1}:e),v=()=>
1{const[e,t]=(0,n.useState)(!1),[s,a]=(0,n.useState)(null),[h,x]=(0,n.useState)(!1),[u,m]=(0,n.useState)(null),[p,f]=(0,n.useState)({}),[v,_]=(0,n.useState)(0);(0,n.useEffect)(()=>{h||(async()=>{try{const e=await(0,d.Tcg)();null!==e&&void 0!==e&&e.checklist_id&&(f({checklists:[e.checklist_id],dates:["Last 30 days"]}),_(e=>e+1))}catch(e){console.error("Error fetching latest checklist:",e)}finally{x(!0)}})()},[h]);const A=(0,n.useCallback)(e=>{m(e)},[]);(0,n.useEffect)(()=>{var e;if(null!==u&&void 0!==u&&u.fromDate&&(null===u||void 0===u||null===(e=u.checklistIds)||void 0===e?void 0:e.length)>0){const e={fromDate:u.fromDate,toDate:u.toDate,checklistIds:u.checklistIds,regionIds:u.regionIds||[]};S(e)}},[u]);const S=async e=>{try{t(!0);const s={fromDate:e.fromDate,toDate:e.toDate,region_list:e.regionIds||[],LocationIds:e.locationIds||[],checklistIds:e.checklistIds||[],star:3,top:5,bottom:5},n=await(0,d.ryL)(s);a(n)}catch(s){console.error("Error fetching report data:",s),(0,c.A)("Failed to fetch report data",!1)}finally{t(!1)}},w=s&&(s.non_scoring_questions_data&&s.non_scoring_questions_data.length>0||s.non_scoring_questions_data_site_wise&&s.non_scoring_questions_data_site_wise.length>0);return(0,g.jsx)("div",{className:"page-content",children:(0,g.jsxs)("div",{className:"container-fluid",children:[(0,g.jsxs)(i.A,{className:"mb-3",children:[(0,g.jsxs)("div",{style:{padding:"1rem 2rem",borderBottom:"1px solid #e5e7eb",backgroundColor:"#ffffff",position:"relative"},children:[(0,g.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[(0,g.jsx)(y.A,{}),(0,g.jsx)("h4",{style:{margin:0,padding:0,fontSize:"1.5rem",fontWeight:"600",color:"#111827"},children:"Non Scoring Analytics"})]}),(0,g.jsx)("p",{style:{display:"block",margin:0,marginLeft:"calc(36px + 1rem)",padding:0,fontSize:"0.95rem",color:"#6b7280"},children:"Analysis of non-scoring questions across inspections"})]}),(0,g.jsx)(l.A,{style:{padding:"1rem 2rem"},className:"border-top",children:(0,g.jsx)(o.A,{type:"analytics",onFilterChange:A,initialFilters:p,registryOverride:N},v)})]}),e&&(0,g.jsx)(r.A,{}),!e&&!s&&(0,g.jsx)(i.A,{children:(0,g.jsxs)(l.A,{className:"text-center py-5",children:[(0,g.jsx)("i",{className:"ri-bar-chart-box-line",style:{fontSize:"3rem",color:"#878a99"}}),(0,g.jsx)("h5",{className:"mt-3 text-muted",children:"No Report Data"}),(0,g.jsx)("p",{className:"text-muted mb-0",children:"Select a checklist and date range, then apply filters to generate the report."})]})}),s&&(0,g.jsx)("div",{children:w?(0,g.jsxs)(g.Fragment,{children:[s.non_scoring_questions_data&&s.non_scoring_questions_data.length>0&&(0,g.jsx)(j,{data:s.non_scoring_questions_data}),s.non_scoring_questions_data_site_wise&&s.non_scoring_questions_data_site_wise.length>0&&(0,g.jsx)(b,{data:s.non_scoring_questions_data_site_wise})]}):(0,g.jsx)(i.A,{children:(0,g.jsxs)(l.A,{className:"text-center py-5",children:[(0,g.jsx)("i",{className:"ri-file-unknow-line",style:{fontSize:"3rem",color:"#878a99"}}),(0,g.jsx)("h5",{className:"mt-3 text-muted",children:"No Non-Scoring Data Available"}),(0,g.jsx)("p",{className:"text-muted mb-0",children:"The selected checklist does not contain non-scoring questions or no data is available for the selected period."})]})})})]})})}},44874(e,t,s){s.d(t,{A:()=>o});var n=s(9950),i=s(16673),l=s(44414);const o=e=>{let{fallbackPath:t="/analytics-library",className:s=""}=e;const o=(0,i.W6)(),a=n.useRef(null);n.useEffect(()=>{if(a.current){const e=a.current;Object.assign(e.style,{width:"36px",height:"36px",minWidth:"36px",maxWidth:"36px",minHeight:"36px",maxHeight:"36px",display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"8px",color:"#374151",cursor:"pointer",padding:"0",margin:"0",fontSize:"14px",fontWeight:"400",lineHeight:"1",textDecoration:"none",textAlign:"center",boxShadow:"none",outline:"none",appearance:"none",transition:"border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease"})}},[]);return(0,l.jsx)("button",{ref:a,type:"button",className:`al-back-button ${s}`,onClick:()=>{o.length>1?o.goBack():o.push(t)},onMouseEnter:()=>{a.current&&(a.current.style.borderColor="var(--vz-primary, #405189)",a.current.style.backgroundColor="rgba(64, 81, 137, 0.06)",a.current.style.color="var(--vz-primary, #405189)")},onMouseLeave:()=>{a.current&&(a.current.style.borderColor="#e5e7eb",a.current.style.backgroundColor="#ffffff",a.current.style.color="#374151")},"aria-label":"Back",title:"Back",children:(0,l.jsx)("i",{className:"ri-arrow-left-line"})})}}}]);
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.