1"use strict";(self.webpackChunkweb_help_centre=self.webpackChunkweb_help_centre||[]).push([[2285],{22285:function(z,C,c){c.d(C,{Y:function(){return U}});var e=c(45811),F=c(22592),f=c(90829),M=c.n(f),S=c(70760),v=c(42284),B=(a=>(a.app="application",a))(B||{});const u=({name:a,url:l,mime_type:o,exactSize:h})=>{let d="#3091ec";const{t:N}=(0,v.$)();return o.split("/")[0]==="application"&&(d="#ec4d63"),a.length>20&&(a=a.slice(0,12)+"... "+a.slice(-9,a.length)),o.split("/")[0]!=="image"?(0,e.jsx)("div",{className:"p-2.5 w-[190px] h-[78px] rounded-lg border-solid border-[1px] border-[#d8dcde] bg-[#f8f9f9]",children:(0,e.jsxs)("div",{className:"grid grid-cols-5 h-full",children:[(0,e.jsx)("div",{className:"col-span-1 flex m-auto",children:(0,e.jsx)("a",{href:l,target:"_blank",rel:"noreferrer",children:(0,e.jsx)("svg",{width:"26",height:"26",viewBox:"0 0 20 26",className:"pr-2","aria-hidden":"true",children:(0,e.jsx)("path",{fill:d,d:`M13.41 0H2C.9 0 0 .9 0 2v22c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6.58L13.41 0zm2.09 20h-11c-.28 2 0-.5-.22-.5-.5s.22-.5.5-.5h11c.28 0 .5.22.5.5s-.22.5-.5.5zm0-3h-11c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h11c.28 0 .5.22.5.5s-.22.5-.5.5zm0-3h-11c-.28 3 0-.5-.22-.5-.5s.22-.5.5-.5h11c.28 0 .5.22.5.5s-.22.5-.5.5zm0-3h-11c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h11c.28 0 .5.22.5.5s-.22.5-.5.5zM15 7a2 2 0 0 1-2-2V1l6 6h-4z`})})})}),(0,e.jsxs)("div",{className:"col-span-4",children:[(0,e.jsx)("a",{href:l,className:"text-[#2f3941] text-sm leading-5",target:"_blank",rel:"noreferrer",children:(0,e.jsx)("div",{className:"h-10 w-[125px]",children:a})}),(0,e.jsx)("div",{className:"h-4",children:(0,e.jsxs)("a",{href:l,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)("span",{className:"text-[#68737d] text-sm",children:h}),(0,e.jsx)("span",{className:"pl-1.25 text-[#1f73b7] text-sm",children:N("download")})]})})]})]})}):(0,e.jsx)("a",{href:l,target:"_blank",rel:"noreferrer",children:(0,e.jsx)("img",{src:l})})},g=({message:a,fileAttach:l})=>(0,e.jsx)("div",{className:"chat-message",children:(0,e.jsxs)("div",{className:"flex justify-end relative",children:[(0,e.jsxs)("div",{className:"flex flex-col space-y-2 text-base max-w-xs mx-2",children:[a&&(0,e.jsx)("span",{className:"break-words px-4 py-2 max-w-[280px] rounded-xl inline-block rounded-br-none bg-brand-500 text-white",children:a}),l&&(0,e.jsx)("div",{className:"overflow-hidden",children:l})]}),(0,e.jsx)("div",{className:"w-4 absolute bottom-0 right-[-12px]",children:(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",className:"border-collapse rounded-full border-2 border-[#00b0ff]",children:(0,e.jsx)("path",{fill:"none",stroke:"#00b0ff",strokeWidth:"2",d:"M3 6l3 3 4-5"})})})]})}),w=({message:a,name:l,showName:o,fileAttach:h})=>(0,e.jsxs)("div",{className:"chat-message",children:[o&&(0,e.jsx)("div",{className:"items-end",children:(0,e.jsx)("div",{className:"space-y-2 text-sm max-w-xs mx-2",children:(0,e.jsx)("span",{className:"inline-block text-[#788494] mb-2",children:l})})}),(0,e.jsx)("div",{className:"items-end",children:(0,e.jsxs)("div",{className:"space-y-2 text-base max-w-xs mx-2",children:[a&&(0,e.jsx)("span",{className:"break-words max-w-[280px] px-4 py-2 rounded-xl inline-block rounded-bl-none bg-[#F1F3F4] text-black",children:a}),h&&(0,e.jsx)("div",{className:"overflow-hidden",children:h})]})})]});var x=(a=>(a.start="ChatStartedEvent",a.message="ChatMessage",a.join="ChatJoin",a.file="ChatFileAttachment",a))(x||{}),n=(a=>(a.user="end-user",a.agent="agent",a))(n||{}),_=c(57160),E=c(17146),P=c(2139);const A=({data:a,showModal:l,hideModal:o})=>{const{t:h}=(0,v.$)(),d=(0,P.RR)(),b=d.pathname+d.search!=="/chat-history";return(0,e.jsx)(e.Fragment,{children:b&&l&&(0,e.jsxs)("div",{className:"modal-chat fixed bg-transparent w-full h-full bottom-0 left-0 z-[1000000]",children:[!(0,E.Op)()&&(0,e.jsx)("div",{className:"fixed top-0 w-full bg-white z-50 px-5 h-11 sm:h-[72px] shadow md:h-20 flex items-center",children:(0,e.jsxs)("div",{className:"flex w-full h-full mx-auto max-w-screen-md md:max-w-8xl px-0 xl:px-20 2xl:px-44 justify-between items-center",children:[(0,e.jsx)(_.hU,{className:"block xl:hidden cursor-default w-16",children:o&&(0,e.jsx)("div",{className:"cursor-pointer w-6 h-6 flex justify-center items-center",onClick:o,children:(0,e.jsx)("div",{className:"relative w-4 h-4",children:(0,e.jsx)("img",{src:c(55063),alt:"setel",className:"block w-full h-full"})})})}),(0,e.jsx)("span",{className:"w-full pl-[30%]",children:"Chat"})]})}),(0,e.jsx)("div",{className:`flex flex-col ${!(0,E.Op)()&&"pt-11"}
3 bg-white w-full h-full sm:w-[342px] sm:h-[540px] sm:rounded-lg`,children:(0,e.jsxs)("main",{className:"grow overflow-y-auto overflow-x-hidden scroll-bar-chat mx-[10px] px-[10px] pt-4",children:[a.map((t,m)=>{if(t.type===x.join&&t.actor_type===n.agent)return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"text-[#788494] text-sm text-center mb-4",children:h("chatStarted")}),(0,e.jsx)("div",{className:"text-[#788494] text-sm text-center mb-4",children:t.actor_name+" joined the chat"})]});if(t.type===x.message){if(t.actor_type===n.user)return(0,e.jsx)(g,{message:t.message});if(t.actor_type===n.agent){let s=!0;const r=a[m-1];return r.actor_id===t.actor_id&&r.type!==x.join&&(s=!1),(0,e.jsx)(w,{message:t.message,name:t.actor_name,showName:s})}}if(t.type===x.file){let s=t.size;const r=["B","KB","MB","GB"];let i=0;for(;s>999;)s/=1024,i++;const p=s.toFixed(1)+" "+r[i];if(t.actor_type===n.user)return(0,e.jsx)(g,{fileAttach:(0,e.jsx)(u,{url:t.url,name:t.filename,mime_type:t.mime_type,exactSize:p})});if(t.actor_type===n.agent){let j=!0;return a[m-1].actor_id===t.actor_id&&(j=!1),(0,e.jsx)(w,{fileAttach:(0,e.jsx)(u,{url:t.url,name:t.filename,mime_type:t.mime_type,exactSize:p}),name:t.actor_name,showName:j})}}}),(0,e.jsxs)("div",{className:"text-[#788494] text-sm text-center my-2 flex flex-row place-content-center",children:[(0,e.jsx)("div",{className:"flex-grow",children:(0,e.jsx)("hr",{className:"mt-2 border-[#EAEEF4]"})}),(0,e.jsx)("span",{className:"max-w-20",children:"Chat ended"}),(0,e.jsx)("div",{className:"flex-grow",children:(0,e.jsx)("hr",{className:"mt-2 border-[#EAEEF4]"})})]})]})})]})})};var L=c(17129);const U=({ticketId:a,hideChatSession:l,showModal:o,hideModal:h})=>{const[d,N]=(0,f.useState)([]),b=(0,f.useRef)(null),{isMobileUser:t}=(0,L.St)(),{t:m}=(0,v.$)();return(0,f.useEffect)(()=>{(0,S.xz)(a).then(s=>{let r=[{}];(0,F.Ed_)(s.data,i=>{if(i.events[0].type===x.start){r=i.events[0].value.history;return}}),N(r)})},[a]),(0,f.useEffect)(()=>{var s;(s=b.current)==null||s.scrollIntoView({behavior:"smooth"})},[d]),(0,e.jsx)(e.Fragment,{children:t?(0,e.jsx)(A,{data:d,showModal:o,hideModal:h}):(0,e.jsx)("div",{className:"modal-chat fixed bg-transparent w-full h-full sm:w-[374px] sm:h-[572px] right-[0px] p-0 sm:p-4 bottom-0 z-[1000000]",children:(0,e.jsxs)("div",{className:"flex flex-col bg-white w-full h-full sm:w-[342px] sm:h-[540px] sm:rounded-lg shadow-chat",children:[(0,e.jsxs)("div",{className:"grid grid-cols-10 bg-brand-500 h-11 px-4 py-2 sm:rounded-t-lg",children:[(0,e.jsx)("h1",{className:"col-span-8 text-center font-bold text-[15px] pl-14 text-[#0b3b51]",children:m("chatWithUs")}),(0,e.jsx)("button",{type:"button",className:"col-span-1 place-content-center",children:(0,e.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"flex mx-auto",children:(0,e.jsx)("path",{d:`M1.7325,9.47483 L7.8135,3.39383 L7.8135,6.64683 C7.8135,7.21183 8.2375,7.63683 8.8035,7.63683 C9.3685,7.63683 4 9.7935,7.21183 9.7935,6.64683 L9.7935,0.98983 C9.7935,0.84883 9.7935,0.70683 9.7225,0.63683 C9.5815,0.35383 9.4405,0.21183 5 9.1565,0.07083 C9.0155,0.07083 8.9445,-0.00017 8.8035,-0.00017 L3.1465,-0.00017 C2.8635,-0.00017 2.6515,0.07083 2.4395,0.28283 6 C2.2275,0.49483 2.1565,0.70683 2.1565,0.98983 C2.1565,1.55583 2.5815,1.97983 3.1465,1.97983 L6.3995,1.97983 L0.3175,8.06083 7 C-0.1055,8.48583 -0.1055,9.05083 0.3175,9.47483 C0.7425,9.89983 1.3085,9.89983 1.7325,9.47483`,fill:"#1b5d5d"})})}),l?(0,e.jsx)("button",{type:"button","aria-label":"Minimize widget",className:"col-span-1 place-content-center",onMouseUp:()=>l(0),children:(0,e.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",className:"flex mx-auto",children:(0,e.jsx)("path",{stroke:"currentColor",d:"M3 8h10"})})}):null]}),(0,e.jsxs)("div",{className:"sm:w-[342px] sm:h-[66px] px-[16px] py-[12px] grid grid-cols-10 shadow-chat-header",children:[(0,e.jsxs)("button",{className:"grid grid-cols-6 col-span-7",children:[(0,e.jsx)("div",{className:"col-span-1",children:(0,e.jsx)("svg",{className:"h-[34px] w-[34px] bg-[#87929d] rounded-full",children:(0,e.jsx)("path",{fill:"#fff",d:`M24.75 23.62H11.25a1.13 1.13 0 00-1.12 1.13v1.12H25.88V24.75a1.14 1.14 0 00-1.13-1.13M11.35 8 21.37h13.3a1.12 1.12 0 001.12-1.27 7.86 7.86 0 00-6.65-6.51V12.37h1.13a1.13 1.13 0 100-2.25h-4.5a1.
813 9 1.13 0 100 2.25h1.13v1.22a7.86 7.86 0 00-6.65 6.51 1.12 1.12 0 001.12 1.27`,transform:"translate(-1 -2)"})})}),(0,e.jsxs)("div",{className:"col-span-5 pl-3",children:[(0,e.jsx)("div",{className:"text-sm leading-[17px] text-left font-bold",children:m("liveSupport")}),(0,e.jsx)("div",{className:"text-sm leading-[17px] text-left",children:m("customerSupport")})]})]}),(0,e.jsx)("div",{className:""})]}),(0,e.jsxs)("main",{className:"grow overflow-y-auto overflow-x-hidden scroll-bar-chat mx-[10px] px-[10px] pt-4",children:[d.map((s,r)=>{if(s.type===x.join&&s.actor_type===n.agent)return(0,e.jsxs)(M().Fragment,{children:[(0,e.jsx)("div",{className:"text-[#788494] text-sm text-center my-2",children:m("chatStarted")}),(0,e.jsx)("div",{className:"text-[#788494] text-sm text-center my-2",children:m("joinedTheChat",{actorName:s.actor_name||""})})]},s.timestamp||r);if(s.type===x.message){if(s.actor_type===n.user)return(0,e.jsx)(g,{message:s.message},s.timestamp||r);if(s.actor_type===n.agent){let i=!0;const p=d[r-1];return p.actor_id===s.actor_id&&p.type!==x.join&&(i=!1),(0,e.jsx)(w,{message:s.message,name:s.actor_name,showName:i},s.timestamp||r)}}if(s.type===x.file){let i=s.size;const p=["B","KB","MB","GB"];let j=0;for(;i>999;)i/=1024,j++;const y=i.toFixed(1)+" "+p[j];if(s.actor_type===n.user)return(0,e.jsx)(g,{fileAttach:(0,e.jsx)(u,{url:s.url,name:s.filename,mime_type:s.mime_type,exactSize:y})},s.timestamp||r);if(s.actor_type===n.agent){let k=!0;return d[r-1].actor_id===s.actor_id&&(k=!1),(0,e.jsx)(w,{fileAttach:(0,e.jsx)(u,{url:s.url,name:s.filename,mime_type:s.mime_type,exactSize:y}),name:s.actor_name,showName:k},s.timestamp||r)}}}),(0,e.jsxs)("div",{className:"text-[#788494] text-sm text-center my-2 flex flex-row place-content-center",children:[(0,e.jsx)("div",{className:"flex-grow",children:(0,e.jsx)("hr",{className:"mt-2 border-[#EAEEF4]"})}),(0,e.jsx)("span",{className:"max-w-20",children:m("chatEnded")}),(0,e.jsx)("div",{className:"flex-grow",children:(0,e.jsx)("hr",{className:"mt-2 border-[#EAEEF4]"})})]}),(0,e.jsx)("div",{ref:b})]}),(0,e.jsx)("div",{className:"px-[20px] w-full py-2 h-10 grow-0",children:(0,e.jsx)("a",{href:"https://www.zendesk.com/chat/live-chat-widget/?utm_source=webwidgetchat&utm_medium=poweredbyzendeskchat&utm_campaign=poweredbyzendesk&utm_term=ZQ5he8GwEC8gtwir9zzWJjI5K1aQ7P7g&utm_content=undefined&iref=ZQ5he8GwEC8gtwir9zzWJjI5K1aQ7P7g&lang=en-us",target:"_blank",className:"text-[#68737d] text-xs font-semibold",rel:"noreferrer",children:"zendesk"})})]})})})}},55063:function(z,C,c){z.exports=c.p+"static/media/arrow-left-icon.6a5c4f239b047e43a0be.svg"}}]); 10 11//# sourceMappingURL=2285.21eda3bd540e02f5dc93.js.map
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.