PageSourceSearch

https://portal.mytruage.org/_next/static/chunks/pages/reports/transaction-summaries-dfab65cc272a0590.js

js mytruage.org collected 2026-10-01 15:29:35 UTC 24,468 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5259],{24932:function(e,t,n){"use strict";var r=n(6620),a=n(52322);t.Z=(0,r.Z)((0,a.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload")},46782:function(e,t,n){var r,a;void 0!==(r="function"==typeof(a=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){o(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var l="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,i=l.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=l.saveAs||("object"!=typeof window||window!==l?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(e,n,i){var o=l.URL||l.webkitURL,s=document.createElement("a");n=n||e.name||"download",s.download=n,s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?a(s):r(s.href)?t(e,n,i):a(s,s.target="_blank")):(s.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(s.href)},4e4),setTimeout(function(){a(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,l){if(n=n||e.name||"download","string"!=typeof e){var i;navigator.msSaveOrOpenBlob((void 0===(i=l)?i={autoBom:!1}:"object"!=typeof i&&(console.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,l);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){a(o)})}}:function(e,n,r,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var o="application/octet-stream"===e.type,s=/constructor/i.test(l.HTMLElement)||l.safari,d=/CriOS\/[\d]+/.test(navigator.userAgent);if((d||o&&s||i)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=d?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var c=l.URL||l.webkitURL,p=c.createObjectURL(e);a?a.location=p:location.href=p,a=null,setTimeout(function(){c.revokeObjectURL(p)},4e4)}});l.saveAs=o.saveAs=o,e.exports=o})?a.apply(t,[]):a)&&(e.exports=r)},24854:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reports/transaction-summaries",function(){return n(35116)}])},46510:function(e,t,n){"use strict";n.d(t,{b:function(){return p}});var r=n(52322),a=n(2784),l=n(75132),i=n(72841),o=n(56961),s=n(53939),d=n(76429),u=n(30430),c=n(63502);let p=e=>{let{onChange:t,selectedParticipant:n,styles:p={},data:f={}}=e,[m,h]=(0,a.useState)([]),[x,g]=(0,a.useState)(!1),[b,v]=(0,a.useState)([]),[y,w]=(0,a.useState)(""),j=(0,a.useRef)(null),S=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,{data:n}=await d.h.call(s.qh.SEARCH_PARTICIPANTS,{query:{filter:(null==f?void 0:f.filter)||null,limit:t,searchText:null==e?void 0:e.searchValue}});return n.items},C=(0,a.useCallback)((0,u.Ds)(async e=>{g(!0);let t=await S({searchValue:e});h(t),g(!1)},300),[]),T=(e,n)=>{let r=n?n.id:null;t(r)},I=(e,t,r)=>{if("input"===r&&n)T(e,null);else if("reset"==r&&t.length)return;w(t||""),C(t||"")};(0,a.useEffect)(()=>{(async()=>{g(!0);let e=await S();h(e),g(!1)})()},[]),(0,a.useEffect)(()=>{(async()=>{if(!n||m.some(e=>e.id===n))return;g(!0);let{data:e}=await d.h.call(s.qh.GET_PARTICIPANT,{params:{participantId:n}});e&&h(t=>[e,...t]),g(!1)})()},[n]),(0,a.useEffect)(()=>{let e=m.map(e=>({id:e.id,label:"".concat(e.displayName," - ").concat(e.legalName)}));v(e.filter(e=>{var t;return!(null==f?void 0:null===(t=f.ignoreParticipantIds)||void 0===t?void 0:t.includes(e.id))}))},[m]);let E=(0,a.useMemo)(()=>{var e;return null!==(e=b.find(e=>e.id===n))&&void 0!==e?e:null},[n,b]);return(0,r.jsx)(l.Z,{options:b,loading:x,onClose:(e,t)=>{if("selectOption"!==t){j.current.querySelector("input");let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;e.call(j.current,"");let t=new Event("input",{bubbles:!0});j.current.dispatchEvent(t)}},onChange:T,disabled:f.disabled,onInputChange:I,value:E,isOptionEqualToValue:(e,t)=>
1e.id===t.id,renderInput:e=>{var t;return(0,r.jsx)(c.M,{...e,label:"".concat((null==f?void 0:f.labelName)||"Search Participants"),inputRef:j,name:"participants",error:Boolean(null==f?void 0:f.errors),helperText:(null==f?void 0:null===(t=f.errors)||void 0===t?void 0:t.message)||"",value:y,fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{padding:"0 2px",minHeight:"3rem",...p}},InputProps:{...e.InputProps,endAdornment:x?(0,r.jsx)(i.Z,{color:"inherit",size:20}):null}})},renderOption:(e,t)=>{let{key:n,...a}=e;return(0,r.jsx)("li",{style:{cursor:"pointer",backgroundColor:e["aria-selected"]?"#e0e0e0":"transparent"},onMouseEnter:e=>e.currentTarget.style.backgroundColor="#f0f0f0",onMouseLeave:e=>e.currentTarget.style.backgroundColor="transparent",...a,children:t.label},n)},ListboxComponent:e=>{let{children:t,...n}=e;return(0,r.jsxs)("ul",{...n,style:{padding:0,margin:0},children:[!y&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("li",{style:{padding:"8px 16px",fontSize:"12px"},children:"Recent 100 Records"}),(0,r.jsx)(o.Z,{})]}),t]})}})}},82320:function(e,t,n){"use strict";n.d(t,{B:function(){return p}});var r=n(52322),a=n(2784),l=n(42921),i=n(72841),o=n(25665),s=n(66198),d=n(24032),u=n(83458),c=n(38551);let p=e=>{var t;let{loading:n,bulkActions:p=[],enableBulkSelection:f=!1,...m}=e,[h,x]=(0,a.useState)([]),g=(0,a.useCallback)(e=>{x(e)},[]),b=(0,a.useCallback)(t=>{var n;let r=h.map(e=>String(e)),a=(null===(n=e.rows)||void 0===n?void 0:n.filter(e=>h.includes(e.id)))||[],l=()=>x([]);t.onClick(r,a,l)},[h,e.rows]),v=h.length,y=f&&v>0,w=(null===(t=e.rows)||void 0===t?void 0:t.filter(e=>h.includes(e.id)))||[];return(0,r.jsxs)(r.Fragment,{children:[n&&(0,r.jsx)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",background:"rgb(57 57 57 / 30%)",zIndex:"9"},children:(0,r.jsx)(i.Z,{sx:{marginLeft:"260px"}})}),y&&(0,r.jsxs)(o.Z,{sx:{backgroundColor:"#f8f9fa",borderBottom:"1px solid #e0e0e0",minHeight:"56px !important",px:2},children:[(0,r.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",flex:1},children:[(0,r.jsx)(s.Z,{label:"".concat(v," row").concat(v>1?"s":""," selected"),variant:"filled",size:"small",sx:{mr:2,backgroundColor:"#393A39",color:"#ffffff",fontWeight:500}}),(0,r.jsx)(l.Z,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:p.map((e,t)=>{let n="function"==typeof e.disabled?e.disabled(w):e.disabled,a="function"==typeof e.tooltip?e.tooltip(w):e.tooltip,l=(0,r.jsx)(c.F,{variant:"outlined",size:"small",startIcon:e.icon,onClick:()=>b(e),disabled:n,task:e.task,taskOptions:e.taskOptions,sx:{textTransform:"none",minWidth:"auto",px:2,borderColor:"#393A39",color:"#393A39",backgroundColor:"#ffffff","&:hover":{backgroundColor:"#393A39",color:"#ffffff",borderColor:"#393A39"},"&.MuiButton-outlinedError":{borderColor:"#d32f2f",color:"#d32f2f","&:hover":{backgroundColor:"#d32f2f",color:"#ffffff"}},..."error"===e.color&&{borderColor:"#d32f2f",color:"#d32f2f","&:hover":{backgroundColor:"#d32f2f",color:"#ffffff"}}},children:e.label},t);return a?(0,r.jsx)(d.Z,{title:a,arrow:!0,children:(0,r.jsx)("span",{children:l})},t):l})})]}),(0,r.jsx)(c.F,{variant:"text",size:"small",onClick:()=>x([]),sx:{textTransform:"none",color:"#636463","&:hover":{backgroundColor:"rgba(57, 58, 57, 0.04)"}},children:"Clear Selection"})]}),(0,r.jsx)(u._,{...m,pagination:!0,loading:!1,paginationMode:"server",disableSelectionOnClick:!0,experimentalFeatures:{newEditingApi:!0},checkboxSelection:f,disableColumnMenu:!0,disableColumnSelector:!0,selectionModel:f?h:void 0,onSelectionModelChange:f?g:void 0,keepNonExistentRowsSelected:!1,sx:{"& .MuiDataGrid-main":{borderTop:y?"none":void 0},"& .MuiDataGrid-row.Mui-selected":{backgroundColor:"rgba(57, 58, 57, 0.08)","&:hover":{backgroundColor:"rgba(57, 58, 57, 0.12)"}},"& .MuiDataGrid-row:hover":{backgroundColor:"rgba(57, 58, 57, 0.04)"},"& .MuiCheckbox-root":{color:"#636463","&.Mui-checked":{color:"#393A39"}},"& .MuiDataGrid-columnHeaderCheckbox .MuiCheckbox-root":{color:"#636463","&.Mui-checked":{color:"#393A39"}}}})]})}},69745:function(e,t,n){"use strict";n.d(t,{M:function(){return p}});var r=n(52322),a=n(76635),l=n.n(a);n(2784);var i=n(41633),o=n(86152),s=n(9366),d=n(63955),u=n(19034),c=n.n(u);let p=e=>{let{formState:t,control:n,label:a,name:u,disableFuture:p=!0,minDate:f,maxDate:m,required:h,...x}=e,g=()=>l().get(t,"errors.".concat(u,".message"),"");return(0,r.jsx)(d.Qr,{name:u,control:n,render:e=>{let{field:t}=e;return(0,r.jsx)(i._,{dateAdapter:s.Q,children:(0,r.jsx)(o.M,{label:a,disableFuture:p,minDate:f?c()(f):void 0,maxDate:m?c()(m):void 0,...t,slotProps:{textField:{error:Boolean(g()),helperText:g(),required:h},field:{readOnly:!0}},...x})})}})}},63502:function(e,t,n){"use strict";n.d(t,{M:function(){return l}});var r=n(52322),a=n(45596);function l(e){return(0,r.jsx)(a.Z,{type:"text",fullWidth:!0,...e})}n(2784)},79747:function(e,t,n){"use strict";n.d(t,{m:function(){return f}});var r=n(52322),a=n(76635),l=n.n(a),i=n(69506),o=n(45986),s=n(28903),d=n(94380),u=n(80982),c=n(2784),p=n(63955);let f=e=>{let{formState:t,items:n,control:a,label:f,name:m,multiple:h,disabled:x,required:g,customOnChange:b,customStyle:v,haveDefaultValue:y,MenuProps:w,onOpen:j,onClose:S,...C}=e,T=(0,c.useRef)(null),[I,E]=(0,c.useState)(),D={light:"rgba(0, 0, 0, 7%)",dark:"rgb(57 58 57 / 35%)"},M=()=>l().get(t,"errors.".concat(m,".message"),""),{onClose:k,PaperProps:A,TransitionProps:N,...O}=null!=w?w:{};return(0,r.jsx)(p.Qr,{name:m||"",control:a,render:e=>
1{let{field:{onChange:t,...a}}=e;return(0,r.jsxs)(i.Z,{ref:T,fullWidth:!0,error:Boolean(M()),children:[(0,r.jsx)(o.Z,{required:g,children:f}),(0,r.jsxs)(s.Z,{...a,...C,MenuProps:{...O,TransitionProps:{...N,onExited:e=>{var t;null==N||null===(t=N.onExited)||void 0===t||t.call(N,e),E(void 0)}},PaperProps:{...A,style:{...null==A?void 0:A.style,...null!=I?{width:I,maxWidth:I,minWidth:I}:{}},sx:[{"& .MuiMenuItem-root":{whiteSpace:"normal",wordBreak:"break-word"},"& .MuiMenuItem-root.Mui-selected":{backgroundColor:D.dark},"& .MuiMenuItem-root:hover":{backgroundColor:D.light},"& .MuiMenuItem-root.Mui-selected:hover":{backgroundColor:D.dark}},null==A?void 0:A.sx]}},onOpen:e=>{var t;null==j||j(e);let n=null===(t=T.current)||void 0===t?void 0:t.offsetWidth;n?E(n):requestAnimationFrame(()=>{var e;let t=null===(e=T.current)||void 0===e?void 0:e.offsetWidth;t&&E(t)})},onClose:e=>{null==k||k(e,"backdropClick"),null==S||S(e)},onChange:e=>{t(e),b&&b(e)},label:f,multiple:h,disabled:x,sx:v,children:[!h&&!y&&(0,r.jsx)(d.Z,{value:"",children:(0,r.jsx)("em",{children:"None"})}),n.map(e=>(0,r.jsx)(d.Z,{value:e.value,disabled:e.disabled,children:e.text},e.value))]}),(0,r.jsx)(u.Z,{children:M()})]})}})}},45305:function(e,t,n){"use strict";n.d(t,{k:function(){return h}});var r=n(52322),a=n(2784),l=n(75132),i=n(72841),o=n(56961),s=n(53939),d=n(27447),u=n(2578),c=n(76429),p=n(68499),f=n(30430),m=n(63502);let h=e=>{let{onChange:t,selectedStores:n=[],selectedStore:h,styles:x={},multiple:g=!1,data:b={},limitTags:v}=e,[y,w]=(0,a.useState)([]),{user:j}=(0,d.Eu)(),S=void 0==b.participantId?null==j?void 0:j.participant.id:b.participantId,{hasPermission:C}=(0,p.X)(),[T,I]=(0,a.useState)(!0),[E,D]=(0,a.useState)([]),[M,k]=(0,a.useState)([]),A=(0,a.useRef)(null),[N,O]=(0,a.useState)(""),R=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=C(u.XB.LIST_STORES)?s.bF.LIST_STORE:s.bF.LIST_USER_STORES;if(!S)return[];b.envType&&(e.envType=b.envType),b.listStoresWithDevices&&(e.activeAndPendingDevices=!0);let{data:r}=await c.h.call(n,{params:{participantId:S,userId:null==j?void 0:j.id},query:{limit:t,...e}});return r.items},Z=(0,a.useCallback)((0,f.Ds)((e,t,n)=>{if("clear"!==n&&(g||"input"!==n)){if("reset"===n)return}else P(e,null,n);"string"==typeof t&&t.length&&(async()=>{if("string"==typeof t&&t.length){I(!0);let e={displayName:"".concat(u.fq.LIKE,":").concat(t),legalName:"".concat(u.fq.LIKE,":").concat(t)},n=await R({filter:e});w(n),I(!1)}})()}),[S,b.envType]),_=(e,t,n)=>{"reset"!==n&&O(t||""),Z(e,t,n)},P=(e,n,r)=>{if(g){let e=n?n.map(e=>e.id):[];t(e),O("")}else{let e=n?n.id:null;t(e)}};(0,a.useEffect)(()=>{(async()=>{k([]),I(!0);let e=await R();w(e),I(!1)})()},[S,b.envType]),(0,a.useEffect)(()=>{(async()=>{if(S){if(I(!0),g&&n.length){let e=await Promise.all(n.filter(e=>!M.find(t=>t.id===e)).map(async e=>{let{data:t}=await c.h.call(s.bF.GET_STORE,{params:{participantId:S,storeId:e}});return t}));D(e)}else if(!g&&h&&!M.find(e=>e.id===h)){let{data:e}=await c.h.call(s.bF.GET_STORE,{params:{participantId:S,storeId:h}});D(e)}I(!1)}})()},[g?n:h,S]),(0,a.useEffect)(()=>{let e=[...M];y.forEach(t=>{e.some(e=>e.id===t.id)||e.push({id:t.id,label:"".concat(t.displayName," - ").concat(t.legalName),participantId:t.participantId})}),g?E.forEach(t=>{e.some(e=>e.id===t.id)||e.push({id:t.id,label:"".concat(t.displayName," - ").concat(t.legalName),participantId:t.participantId})}):g||!E.id||e.find(e=>e.id===E.id)||e.push({id:E.id,label:"".concat(E.displayName," - ").concat(E.legalName),participantId:E.participantId}),e.sort((e,t)=>e.label.localeCompare(t.label)),k(e=e.filter(e=>{var t;return!(null==b?void 0:null===(t=b.ignoreStoreIds)||void 0===t?void 0:t.includes(e.id))&&e.participantId===S}))},[y,E]);let L=(0,a.useMemo)(()=>{var e;return g?n.map(e=>M.find(t=>t.id===e)||null).filter(e=>null!==e):null!==(e=M.find(e=>e.id===h))&&void 0!==e?e:null},[g?n:h,M,E]);return(0,r.jsx)(l.Z,{multiple:g,limitTags:v||-1,options:M,...g&&{inputValue:N},loading:T,onClose:(e,t)=>{if("selectOption"!==t){A.current.querySelector("input");let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;e.call(A.current,"");let t=new Event("input",{bubbles:!0});A.current.dispatchEvent(t)}},onChange:P,groupBy:e=>e.group,isOptionEqualToValue:(e,t)=>
1e.id===(null==t?void 0:t.id),onInputChange:_,value:L||!g&&N,renderInput:e=>(0,r.jsx)(m.M,{...e,label:"Search Stores",inputRef:A,name:"stores",error:Boolean(null==b?void 0:b.errors),helperText:(null==b?void 0:b.errors)?b.errors.message:"",sx:{"& .MuiOutlinedInput-root":{padding:"0 8px",minHeight:"3rem",width:"100%",...x}},fullWidth:!0,InputProps:{...e.InputProps,endAdornment:(0,r.jsx)(r.Fragment,{children:T&&(0,r.jsx)(i.Z,{color:"inherit",size:20})})}}),renderOption:(e,t,n)=>{let{selected:a}=n;return(0,r.jsx)("li",{style:{cursor:"pointer",backgroundColor:e["aria-selected"]?"#e0e0e0":"transparent"},onMouseEnter:e=>e.currentTarget.style.backgroundColor="#f0f0f0",onMouseLeave:e=>e.currentTarget.style.backgroundColor=a?"#e0e0e0":"transparent",...e,children:(null==t?void 0:t.label)||t})},ListboxComponent:e=>{let{children:t,...n}=e;return(0,r.jsxs)("ul",{...n,style:{padding:0,margin:0},children:[!N&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("li",{style:{padding:"8px 16px",fontSize:"12px"},children:"Recent 100 Records"}),(0,r.jsx)(o.Z,{})]}),t]})}})}},35116:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Y}});var r=n(52322),a=n(2784),l=n(37944),i=n(41075),o=n(17377),s=n(42921),d=n(53939),u=n(82320),c=n(5632),p=n(79747),f=n(48601),m=n(38551),h=n(63955),x=n(6812),g=n(24932),b=n(76429),v=n(45118),y=n(46782),w=n.n(y),j=n(19034),S=n.n(j),C=n(76635),T=n.n(C),I=n(69745),E=n(62197),D=n(72841),M=n(2578),k=n(30430),A=n(45305),N=n(46510),O=n(27447);let R="total",Z=f.Ry({participantId:f.Z_().required().label("Organization"),storeIds:f.IX(f.Z_().noSpecial()).label("Store Name"),startDate:f.hT().required().label("Start Date").test("within-6-months-start","Start date must be within the previous 6 months",function(e){if(!e)return!0;let t=S()().subtract(6,"months");return S()(e).isSameOrAfter(t,"day")}),endDate:f.hT().required().label("End Date").test("within-6-months-end","End date must be within the previous 6 months",function(e){if(!e)return!0;let t=S()().subtract(6,"months");return S()(e).isSameOrAfter(t,"day")}).test("date-ran g","End date must be within 1 month from the start date.",function(e){let t=this.parent.startDate;return!t||!e||1>S()(e).diff(S()(t),"months")}),groupBy:f.Z_().label("Group By"),envType:f.Z_().label("Environment")}).required(),_=[{field:"type",headerName:"Type",editable:!1,sortable:!1,width:200,renderCell:e=>(0,r.jsx)(E.Z,{sx:e.row.id===R?{fontWeight:"bold"}:{},children:e.row.type})},{field:"count",headerName:"Count",editable:!1,sortable:!1,width:150,renderCell:e=>(0,r.jsx)(E.Z,{sx:e.row.id===R?{fontWeight:"bold"}:{},children:e.row.count})}],P={field:"percentage",headerName:"Percentage",editable:!1,sortable:!1,width:150},L=[{field:"participantName",headerName:"Organization",editable:!1,sortable:!1,width:300},{field:"storeName",headerName:"Store Name",editable:!1,sortable:!1,width:300},{field:"storeLegalName",headerName:"Store Brand Name",editable:!1,sortable:!1,width:300},{field:"date",headerName:"Date",editable:!1,sortable:!1,width:300},..._],B=[{field:"participantName",headerName:"Organization",editable:!1,sortable:!1,width:300},{field:"storeName",headerName:"Store Name",editable:!1,sortable:!1,width:300},{field:"storeLegalName",headerName:"Store Brand Name",editable:!1,sortable:!1,width:300},..._,P,{field:"totalCount",headerName:"Sum of Count",editable:!1,sortable:!1,width:150}],F=[_[0],{..._[1],headerName:"Sum of Count"},P];function Y(){var e;let t=(0,c.useRouter)(),n=(0,v.Z)(),[f,y]=(0,a.useState)(!1),[j,C]=(0,a.useState)(!1),{user:E}=(0,O.Eu)(),[R,_]=(0,a.useState)([]),[P,Y]=(0,a.useState)({}),q=(null===(e=E.participant)||void 0===e?void 0:e.type)===M.tQ.TRUAGE_ADMINISTRATION,{handleSubmit:W,formState:G,control:U,setValue:z,getValues:H,trigger:Q,watch:X}=(0,h.cI)({resolver:(0,x.X)(Z),defaultValues:{participantId:"",storeIds:[],startDate:null,endDate:null,groupBy:"",envType:M.Q4.PRODUCTION}}),V=e=>{let{toCsv:t,generate:n}=e,r=H("participantId"),a=H("storeIds"),l=H("startDate"),i=H("endDate"),o=H("groupBy"),s=H("envType");a.sort();let d={participantId:r,startDate:l&&S()(l).format("YYYY-MM-DD"),endDate:i&&S()(i).format("YYYY-MM-DD")};return(null==a?void 0:a.length)&&(d.storeIds=a),o&&(d.groupBy=o),s&&(d.envType=s),t&&(d.toCsv=t),n&&(d.generate=n),d},K=async()=>{_([]),Y({});try{C(!0);let{data:{items:e,meta:t}}
1=await b.h.call(d.bF.GET_TRANSACTION_SUMMARIES,{query:{filter:V({})}});_(e),Y(t)}catch(e){n.exception(e)}finally{C(!1)}},J=()=>{let{"filter[participantId]":e,"filter[storeIds]":n,"filter[startDate]":r,"filter[endDate]":a,"filter[groupBy]":l,"filter[envType]":i,"filter[generate]":o}=(0,k.XI)(decodeURIComponent(t.asPath).split("?")[1]);z("participantId",e||""),z("startDate",r?S()(r,"YYYY-MM-DD"):null),z("endDate",a?S()(a,"YYYY-MM-DD"):null);let s=[];n&&(s=T().isArray(n)?n:[n]),z("storeIds",s),z("groupBy",l||""),z("envType",i||M.Q4.PRODUCTION),r&&a&&o&&K()};(0,a.useEffect)(()=>{t.isReady&&J()},[t.isReady,t.asPath]);let $=e=>{0>S()(e.endDate).diff(S()(e.startDate))?n.error("End date must be after Start date"):t.push({query:(0,k.L3)(V({generate:!0}),"filter")}),Q("participantId")},ee=async()=>{try{n.success("Download is in progress"),y(!0);let{data:e}=await b.h.call(d.bF.GET_TRANSACTION_SUMMARIES,{query:{filter:V({toCsv:!0})}});if(e){let t=new Blob([e],{type:"text/csv"});w().saveAs(t,"transaction-summaries".concat(S().utc().unix(),".csv"))}}catch(e){n.exception(e)}finally{y(!1)}};(0,a.useEffect)(()=>{if(!q){var e;z("participantId",null==E?void 0:null===(e=E.participant)||void 0===e?void 0:e.id)}},[]);let et=X("storeIds"),en=X("participantId"),er=X("envType");return(0,r.jsx)(l.A,{title:"Transaction Summaries",children:f?(0,r.jsx)(s.Z,{sx:{height:"calc(100vh - 90px)",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(D.Z,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{sx:{display:"flex",justifyContent:"space-between",gap:"5px",paddingTop:"0.5rem",alignItems:{xs:"end",sm:"end",md:"end",lg:"center"},flexDirection:{xs:"column",sm:"column",md:"column",lg:"column",xl:"row"}},component:"form",noValidate:!0,onSubmit:W($),children:(0,r.jsxs)(s.Z,{sx:{mt:"10px",display:"flex",flex:"1",width:"100%",flexWrap:{sm:"wrap",lg:"nowrap"},gap:"5px",justifyContent:{xs:"space-between",sm:"space-between",md:"space-between",lg:"unset"}},children:[q&&(0,r.jsx)(s.Z,{sx:{width:{xs:"100%",sm:"100%",md:"100%",lg:"100%"},mt:{xs:"10px",sm:"10px",md:"10px",lg:"0px"}},children:(0,r.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column",maxWidth:{xs:"100%",sm:"100%",md:"100%",lg:"100%"},mb:1},children:(0,r.jsx)(N.b,{onChange:e=>{if(z("participantId",null!=e?e:null,{shouldDirty:!0}),e){let[n,r]=H(["startDate","endDate"]);t.push({query:(0,k.L3)({participantId:e,...n?{startDate:n.format("YYYY-MM-DD")}:{},...r?{endDate:r.format("YYYY-MM-DD")}:{}},"filter")}),Q("participantId")}},selectedParticipant:en,data:{errors:G.errors.participantId,filter:{type:"".concat(M.fq.EQUALS,":").concat(M.tQ.RETAILER),status:"".concat(M.fq.NOT_EQUALS,":").concat(M.wA.CREATED)}}})})}),(0,r.jsx)(s.Z,{sx:{width:{xs:"100%",sm:"100%",md:"100%",lg:"100%"},minWidth:{lg:"9rem"},maxWidth:{lg:"11rem"},mt:{xs:"10px",sm:"10px",md:"10px",lg:"0px"}},children:(0,r.jsx)(p.m,{name:"envType",label:"Environment",control:U,formState:G,haveDefaultValue:!0,items:T().map(T().values(M.Q4),e=>({value:e,text:(0,k.kC)(e)})),customOnChange:()=>{z("storeIds",[],{shouldDirty:!0})},customStyle:{height:"3rem"}})}),(0,r.jsx)(s.Z,{sx:{width:{xs:"100%",sm:"100%",md:"100%",lg:"100%"},mt:{xs:"10px",sm:"10px",md:"10px",lg:"0px"}},children:(0,r.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column",maxWidth:{xs:"100%",sm:"100%",md:"100%",lg:"100%"},mb:1},children:(0,r.jsx)(A.k,{onChange:e=>{z("storeIds",e,{shouldDirty:!0})},multiple:!0,selectedStores:et,data:{participantId:en,envType:er,listStoresWithDevices:!0}})})}),(0,r.jsxs)(s.Z,{sx:{display:"flex",flex:"1",gap:"5px",width:"100%",minWidth:{lg:"300px",xl:"410px"}},children:[(0,r.jsx)(I.M,{name:"startDate",control:U,formState:G,label:"Start Date",sx:{"& > div":{height:"3rem"},width:{sm:"50%",lg:"100%"}},minDate:S()().subtract(6,"months").toDate()}),(0,r.jsx)(I.M,{name:"endDate",control:U,formState:G,label:"End Date",disableFuture:!0,minDate:S()().subtract(6,"months").toDate(),sx:{"& > div":{height:"3rem"},width:{sm:"50%",lg:"100%"}}})]}),(0,r.jsx)(s.Z,{sx:{mt:{xs:"10px",sm:"10px",md:"10px",lg:"unset"},width:{xs:"100%",sm:"100%",md:"100%",lg:"100%"},minWidth:{lg:"8rem"},maxWidth:{lg:"10rem"}},children:(0,r.jsx)(p.m,{name:"groupBy",label:"Group By",control:U,formState:G,items:T().map(T().filter(T().values(M.AG),e=>e!==M.AG.TYPE_AND_STORE),e=>({value:e,text:(0,k.kC)(e)})),customStyle:{height:"3rem"},MenuProps:{style:{maxHeight:"30rem"}}})}),(0,r.jsxs)(s.Z,{sx:{display:"flex",alignItem:"center",gap:"5px",width:{sm:"100%",xl:"auto"}},children:[(0,r.jsx)(m.F,{type:"submit",sx:{height:"2.9rem",width:{xs:"100%",sm:"100%",xl:"auto"}},children:"Generate"}),(0,r.jsx)(s.Z,{sx:{},children:(0,r.jsx)(m.F,{label:"Download",sx:{height:"2.9rem"},onClick:W(ee),children:(0,r.jsx)(g.Z,{sx:{fontSize:"1.5rem"}})})})]})]})}),(0,r.jsx)(s.Z,{sx:{height:"100%",pt:1},children:(0,r.jsx)(i.ZP,{item:!0,sx:{height:"calc(100vh - 142px)"},children:(0,r.jsx)(o.Z,{sx:{display:"flex",flexDirection:"column",height:"100%",width:"100%"},children:(0,r.jsx)(u.B,{loading:j,rows:R.length?[...R,{id:"total",type:"Grand Total",count:P.totalTransactions}]:R,columns:(()=>{switch(null==P?void 0:P.groupBy){case M.AG.STORE:return B;case M.AG.TYPE:return F;default:return L}})(),rowCount:0,hideFooter:!0})})})})]})})}}},function(e){e.O(0,[3835,6997,6475,5180,8180,8462,1075,6198,5132,2828,3458,487,7944,9774,2888,179],function(){return e(e.s=24854)}),_N_E=e.O()}]);

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.