1"use strict"; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f9b4a162-6562-52bc-874d-198761bf2c77")}catch(e){}}(); 3(self.rspackChunkcount_app=self.rspackChunkcount_app||[]).push([[1363],{92894(e,t,l){l.r(t);var s=l(74848),a=l(96540),r=l(40961),i=l(43403),n=l(40506),o=l(19157),d=l(42132);t.default=e=>{var t,l;let{isOpen:c,setIsOpen:x,receipt:h,isExpenseReporting:u=!1,type:f="",title:m="",setActiveAttachment:p=null,activeAttachmentUrl:w=null,isLoading:v=!1}=e,j=(0,a.useRef)(null),C=(0,a.useRef)(null),L=(0,a.useRef)(null),g=(0,a.useRef)(null),[b,y]=(0,a.useState)(!0),[N,k]=(0,a.useState)(!1),[E,M]=(0,a.useState)(null),[Z,S]=(0,a.useState)([]),[F,A]=(0,a.useState)(!1),[D,T]=(0,a.useState)(""),_=u?h:w||(null==h||null==(l=h.images)||null==(t=l[0])?void 0:t.receiptUrl)||h,H="string"==typeof f&&f.toLowerCase().startsWith("image/"),P="string"==typeof f&&f.toLowerCase().includes("pdf"),R="string"==typeof f&&f.toLowerCase().startsWith("video/"),z="string"==typeof _&&_.split("?")[0].toLowerCase().includes(".pdf"),B=(0,i.iF2)(f)||(0,i.Va_)(_);(0,a.useEffect)(()=>{c||(k(!1),M(null),S([]),A(!1),T(""))},[c]),(0,a.useEffect)(()=>{if(!c||!_||"string"!=typeof _)return;if(!B){k(!1),M(null),S([]),A(!1),T("");return}let e=!1;k(!0),M(null),S([]),A(!1),T("");let t=!!(f||"").toLowerCase().includes("csv")||"string"==typeof _&&_.split("?")[0].toLowerCase().endsWith(".csv");return(async()=>{try{let l=await fetch(_);if(!l.ok)throw Error("Failed to load");if(e)return;if(t){let t=await l.text(),{rows:s,truncated:a}=(0,n.b)(t);e||(S(s),A(a))}else{let t=await l.arrayBuffer(),{rows:s,truncated:a,sheetName:r}=await (0,n.v)(t);e||(S(s),A(a),T(r||""))}}catch(t){e||M("Could not load a preview. Try downloading the file.")}finally{e||k(!1)}})(),()=>{e=!0}},[c,_,f,B]),(0,a.useEffect)(()=>{let e=e=>{let{keyCode:t}=e;c&&27===t&&x(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),(0,a.useEffect)(()=>{!c&&p&&setTimeout(()=>p(null),200)},[c,p]),(0,a.useEffect)(()=>{c?y(!0):y(!1)},[c,_]),(0,a.useEffect)(()=>{if(!c||!_)return;let e=("string"==typeof _?_.split("?")[0].toLowerCase():"").includes(".pdf");if(!("string"==typeof f&&f.toLowerCase().includes("pdf"))&&!e)return;let t=window.setTimeout(()=>{y(!1)},8e3);return()=>window.clearTimeout(t)},[c,_,f]);let V=_||h||w,W=()=>{if(!V)return;let e=document.createElement("a");e.href=V,e.setAttribute("download",m),e.setAttribute("target","_blank"),document.body.appendChild(e),e.click(),document.body.removeChild(e)};return"u"<typeof document||!c?null:(0,r.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-[2147483005] flex items-center justify-center overflow-hidden p-3 sm:p-4","data-count-modal-root":!0,role:"dialog","aria-modal":"true","aria-label":m||"Attachment",children:[(0,s.jsx)("div",{role:"presentation",className:"absolute inset-0 bg-[#22272b] bg-opacity-90",onClick:e=>{e.target===e.currentTarget&&x(!1)}}),(0,s.jsxs)("div",{ref:g,className:"relative z-10 flex max-h-[min(100dvh-1.5rem,100vh)] w-full max-w-[min(100vw-1.5rem,1200px)] flex-col overflow-auto overflow-x-hidden rounded-xl bg-slate-800 shadow-lg dark:bg-slate-800",children:[(0,s.jsx)("div",{className:" dark:border-slate-700 py-[1.313rem] px-4",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("div",{ref:j,className:" whitespace-nowrap max-w-[70%] w-fit text-ellipsis overflow-hidden font-medium text-[18px] leading-[2.375rem] text-[#71777D]",children:m}),(0,s.jsxs)("div",{ref:L,className:"flex gap-4 ",children:[(0,s.jsxs)("button",{className:"text-[#71777D] hover:text-slate-500 disabled:opacity-50 disabled:cursor-not-allowed",onClick:e=>{e.stopPropagation(),W()},disabled:!V,type:"button",children:[(0,s.jsx)("div",{className:"sr-only",children:"Download"}),(0,s.jsx)("svg",{width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"stroke-[#c7d1db] hover:text-slate-200",children:(0,s.jsx)("path",{d:"M5.25589 16C3.8899 15.0291 3 13.4422 3 11.6493C3 9.20008 4.8 6.9375 7.5 6.5C8.34694 4.48637 10.3514 3 12.6893 3C15.684 3 18.1317 5.32251 18.3 8.25C19.8893 8.94488 21 10.6503 21 12.4969C21 14.0582 20.206 15.4339 19 16.2417M12 21V11M12 21L9 18M12 21L15 18",className:"stroke-current",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),(0,s.jsxs)("button",{className:"text-[#71777D] hover:text-slate-500 ",onClick:e=>{e.stopPropagation(),x(!1)},type:"button",children:[(0,s.jsx)("div",{className:"sr-only",children:"Close"}),(0,s.jsxs)("svg",{width:"28",height:"29",viewBox:"0 0 28 29",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"fill-[#c7d1db] hover:text-slate-200",children:[(0,s.jsx)("rect",{x:"6.17676",y:"8.6582",width:"2.3292",height:"19.7982",rx:"1.1646",transform:"rotate(-45 6.17676 8.6582)",className:"fill-current"}),(0,s.jsx)("rect",{x:"20.1768",y:"7.01172",width:"2.3292",height:"19.7982",rx:"1.1646",transform:"rotate(45 20.1768 7.01172)",className:"fill-current"})]})]})]})]})}),(0,s.jsx)("div",{className:"flex-1 flex justify-center items-center w-full px-4",children:v?(0,s.jsx)("div",{className:"flex min-h-[40dvh] w-full items-center justify-center",children:(0,s.jsx)(o.aH,{})}):(0,i.ZT6)(f)||(0,i.E8x)(_)||R?(0,s.jsx)("video",{className:"w-fit mx-auto border border-gray-300 rounded-xl object-contain overflow-auto",style:{maxHeight:"calc(100dvh - 120px)"},controls:!0,ref:C,children:(0,s.jsx)("source",{src:_,type:"video/mp4"})}):(0,i.nz_)(f)||(0,i.gV4)(_)||H?(0,s.jsx)("img",{ref:C,src:_,alt:"Uploaded receipt",className:"w-fit mx-auto border border-gray-300 rounded-xl object-contain overflow-auto",style:{maxHeight:"calc(100dvh - 120px)"}}):P||z?(0,s.jsxs)("div",{className:"relative mx-auto w-full max-w-[900px] min-h-[50dvh] flex items-center justify-center",children:[b?(0,s.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-[#22272b]/40",children:(0,s.jsx)(o.aH,{})}):null,(0,s.jsx)("iframe",{ref:C,src:_,title:"Receipt PDF",className:"w-full h-[80rem] border border-gray-300 rounded-xl",style:{maxHeight:"calc(100dvh - 120px)",opacity:+!b},onLoad:()=>y(!1)})]}):B?(0,s.jsx)("div",{ref:C,className:"w-full max-w-[1100px] pb-6 flex flex-col items-stretch gap-2",children:N?(0,s.jsx)("div",{className:"flex min-h-[40dvh] w-full items-center justify-center",children:(0,s.jsx)(o.aH,{})}):E?(0,s.jsx)("p",{className:"text-center text-slate-500",children:E}):(0,s.jsxs)(s.Fragment,{children:[D?(0,s.jsx)("p",{className:"text-center text-sm text-slate-500",children:D}):null,(0,s.jsx)("div",{className:"max-h-[min(72dvh,calc(100dvh-140px))] w-full overflow-auto rounded-xl border border-slate-600 bg-slate-900/50",role:"region","aria-label":"Spreadsheet preview",children:0===Z.length?(0,s.jsx)("p",{className:"p-6 text-center text-slate-500",children:"No rows to display."}):(0,s.jsx)("table",{className:"min-w-full border-collapse text-left text-xs text-slate-500",children:(0,s.jsx)("tbody",{children:Z.map((e,t)=>(0,s.jsx)("tr",{className:"border-b border-slate-600/80 even:bg-slate-900/30",children:(e||[]).map((e,l)=>(0,s.jsx)("td",{className:"max-w-[min(18rem,28vw)] whitespace-nowrap px-2 py-1.5 align-top text-slate-500",children:(0,s.jsx)("span",{className:"block overflow-hidden text-ellipsis",children:null==e?"":String(e)})},"c-".concat(t,"-").concat(l)))},"r-".concat(t)))})})}),F?(0,s.jsx)("p",{className:"text-center text-sm text-slate-500",children:"Showing the first 500 rows."}):null]})}):(0,s.jsxs)("div",{ref:C,className:"w-[460px] max-w-full flex flex-col items-center gap-10",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4",children:[(0,s.jsx)("div",{className:"h-20 rounded-full w-20 inline-flex justify-center items-center bg-[#FEF9F6]",children:(0,s.jsx)(d.A,{})})," ",(0,s.jsxs)("p",{className:"text-white text-center text-[20px]",children:[" ",m]})]}),(0,s.jsx)("p",{className:"text-white text-center text-[20px]",children:"This file has no preview available. Please download to view."}),(0,s.jsx)("button",{type:"button",className:"h-11 bg-brand-solid text-on-brand w-[130px] rounded",onClick:W,children:"Download"})]})})]})]}),document.body)}},42132(e,t,l){var s=l(74848);l(96540),t.A=e=>{let{className:t=""}=e;return(0,s.jsxs)("svg",{width:"50",height:"36",viewBox:"0 0 50 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,s.jsx)("path",{d:"M20.3312 1.18997L23.0311 4.42325C23.5219 5.01102 24.2651 5.32619 25.0278 5.26986L37.0187 4.38501C38.8816 4.24749 40.503 5.64965 40.6402 7.51675L42.271 29.7136C42.4082 31.5807 41.0092 33.2057 39.1463 33.3433L5.90056 35.7968C4.03766 35.9343 2.41629 34.5322 2.27908 32.6651L0.178405 4.07135C0.08198 2.75961 1.06484 1.61799 2.37362 1.52134L18.3343 0.343363C19.0972 0.287036 19.8402 0.602207 20.3312 1.18997Z",fill:"#E48642"}),(0,s.jsx)("g",{opacity:"0.3",children:(0,s.jsx)("path",{d:"M20.3312 1.18997L23.0311 4.42325C23.5219 5.01102 24.2651 5.32619 25.0278 5.26986L37.0187 4.38501C38.8816 4.24749 40.503 5.64965 40.6402 7.51675L42.271 29.7136C42.4082 31.5807 41.0092 33.2057 39.1463 33.3433L5.90056 35.7968C4.03766 35.9343 2.41629 34.5322 2.27908 32.6651L0.178405 4.07135C0.08198 2.75961 1.06484 1.61799 2.37362 1.52134L18.3343 0.343363C19.0972 0.287036 19.8402 0.602207 20.3312 1.18997Z",fill:"black"})}),(0,s.jsx)("path",{d:"M14.3844 3.2221L3.00237 4.06211C2.74617 4.08095 2.52099 3.88635 2.5022 3.62958L2.50126 3.61601C2.48246 3.35924 2.67663 3.13355 2.93282 3.11471L14.3149 2.2747C14.5711 2.25586 14.7963 2.45046 14.8151 2.70723L14.816 2.7208C14.8348 2.97757 14.6406 3.20307 14.3844 3.2221Z",fill:"white"}),(0,s.jsx)("path",{d:"M12.807 5.24651L3.13518 5.9603C2.87899 5.97914 2.65381 5.78454 2.63501 5.52777L2.63407 5.51421C2.61527 5.25743 2.80944 5.03175 3.06563 5.01291L12.7374 4.29911C12.9936 4.28027 13.2188 4.47488 13.2376 4.73165L13.2386 4.74521C13.2573 5.
300217 13.0632 5.22767 12.807 5.24651Z",fill:"white"}),(0,s.jsx)("path",{d:"M40.2472 32.079L5.32256 34.6563C4.44684 34.7209 3.6777 34.0557 3.61323 33.178L2.02776 11.5976C1.96329 10.7199 2.62699 9.94901 3.50271 9.88439L38.4273 7.30707C39.303 7.24245 40.0722 7.90765 40.1366 8.78534L41.7221 30.3658C41.7866 31.2433 41.1229 32.0144 40.2472 32.079Z",fill:"#E0E0E0"}),(0,s.jsx)("path",{d:"M40.2466 32.0788L5.82256 34.6192C4.94684 34.6838 4.1777 34.0186 4.11323 33.1409L2.52776 11.5607C2.46329 10.683 3.12699 9.91208 4.00271 9.84747L38.4268 7.30707C39.3025 7.24245 40.0716 7.90765 40.1361 8.78534L41.7216 30.3658C41.786 31.2431 41.1223 32.0142 40.2466 32.0788Z",fill:"white"}),(0,s.jsx)("path",{d:"M6.94531 34.5378L14.1518 34.006L7.6278 12.5L6.94531 34.5378Z",fill:"#F5F5F5"}),(0,s.jsx)("path",{d:"M47.0338 26.0547L12.5007 31.8817C11.6348 32.0279 10.8072 31.4373 10.6613 30.5694L7.07686 9.23085C6.931 8.36295 7.52027 7.53349 8.38621 7.3873L42.9193 1.56031C43.7852 1.41412 44.6128 2.00472 44.7587 2.87261L48.3431 24.2112C48.4888 25.0791 47.8997 25.9085 47.0338 26.0547Z",fill:"white"}),(0,s.jsx)("path",{opacity:"0.3",d:"M47.0467 26.0539L13.0085 31.7973C12.1426 31.9435 11.315 31.3529 11.1691 30.485L7.58468 9.14642C7.43882 8.27852 8.02808 7.44906 8.89402 7.30287L42.9322 1.55933C43.7981 1.41315 44.6257 2.00374 44.7716 2.87164L48.356 24.2102C48.5017 25.0783 47.9126 25.9078 47.0467 26.0539Z",fill:"#E48642"}),(0,s.jsx)("path",{opacity:"0.2",d:"M42.4837 6.1538L10.7883 11.5019C10.4063 11.5663 10.0413 11.306 9.97702 10.9232L9.79883 9.86239C9.73455 9.47958 9.99432 9.11374 10.3763 9.04931L42.0717 3.7012C42.4536 3.63677 42.8186 3.89712 42.8829 4.27992L43.0611 5.34073C43.1254 5.72353 42.8654 6.08938 42.4837 6.1538Z",fill:"#E48642"}),(0,s.jsx)("path",{opacity:"0.2",d:"M42.8393 8.06026L11.0997 13.4159C10.73 13.4783 10.4785 13.8324 10.5407 14.203L10.6977 15.1376C10.7599 15.5081 11.1132 15.7602 11.483 15.6978L43.2225 10.3422C43.5923 10.2798 43.8438 9.92566 43.7815 9.5551L43.6246 8.62033C43.5624 8.24996 43.209 7.9979 42.8393 8.06026Z",fill:"#E48642"}),(0,s.jsx)("path",{d:"M47.0824 33.2465L47.0156 33.0704C47.4504 32.9048 47.8487 32.6638 48.2 32.3545L48.324 32.496C47.9558 32.8204 47.538 33.0728 47.0824 33.2465Z",fill:"#E48642"}),(0,s.jsx)("path",{d:"M49.2928 31.2523L49.125 31.1677C49.4398 30.5399 49.5789 29.8364 49.5274 29.1334L49.3201 26.3145L49.5077 26.3008L49.715 29.1196C49.7691 29.8566 49.6231 30.5941 49.2928 31.2523Z",fill:"#E48642"}),(0,s.jsx)("path",{d:"M45.8867 32.8451L9.32341 35.5434V35.544L5.90625 35.7962C7.79358 35.657 9.21082 34.0107 9.07173 32.1191L7.96783 17.0932C7.8761 15.844 8.81215 14.7566 10.0585 14.6647L45.5247 12.0472C46.771 11.9553 47.856 12.8935 47.9477 14.1427L49.0516 29.1688C49.1905 31.0598 47.7735 32.7059 45.8867 32.8451Z",fill:"#E48642"})]})}},40506(e,t,l){let s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[],l="",s=!1;for(let a=0;a<e.length;a+=1){let r=e[a],i=e[a+1];'"'===r?s&&'"'===i?(l+='"',a+=1):s=!s:","!==r||s?l+=r:(t.push(l.trim()),l="")}return t.push(l.trim()),t},a=async e=>{let t=(await Promise.all([l.e(6471),l.e(2053)]).then(l.t.bind(l,91402,23))).default,s=t.read(e,{type:"array",cellDates:!1}),a=s.SheetNames[0]||"",r=s.Sheets[a];if(!r)return{rows:[],truncated:!1,sheetName:a};let i=t.utils.sheet_to_json(r,{header:1,defval:"",raw:!1}),n=i.length;return{rows:(n>500?i.slice(0,500):i).map(e=>(Array.isArray(e)?e:[]).slice(0,50).map(e=>null==e?"":String(e))),truncated:n>500,sheetName:a}};l.d(t,{},{b:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(/\r?\n/),l=t.length;return{rows:t.slice(0,500).map(e=>s(e).slice(0,50)),truncated:l>500,totalRowCount:l}},v:a})}}]); 4//# sourceMappingURL=1363.0cdf1506.chunk.js.map 5//# debugId=f9b4a162-6562-52bc-874d-198761bf2c77
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.