1import{j as e,m as q,a as t,c as O,u as Z}from"./@themenu-design-system-PPvpWM1I.js";import{u as $}from"./@react-intl-CKI24l5Z.js";import{P as R}from"./PublicLayout-DA3VVmLF.js";import{d as M,a as G,r as K,u as P,b as V,c as W,e as B,f as Q,o as J,G as X,L as ee}from"./index-DE1OpxQz.js";import{g as te,a as H}from"./@analytics-DNf5dJTn.js";import{c as ne}from"./customParseFormat-1IX9ELiT.js";import{j as ae}from"./@libphonenumber-js-CKk4m8Ay.js";import"./@react-aria-stately-4PMgXtPH.js";import"./@luxon-DfZoh-A_.js";import"./@utils-CrEFOnIh.js";import"./@swiper-DRyvN9l1.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new n.Error().stack;i&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[i]="5b0c94fa-40b6-4ff2-8fc3-4d85d4400fee",n._sentryDebugIdIdentifier="sentry-dbid-5b0c94fa-40b6-4ff2-8fc3-4d85d4400fee")}catch{}const se=({enabled:n,openChat:i})=>{const{formatMessage:u}=$();return n?e.jsx("div",{className:"border-border-default py-quarck dark:border-border-default-dark [&:not(:last-child)]:border-b",children:e.jsx("div",{className:"-mx-xxs",children:e.jsx("button",{type:"button",onClick:i,className:"w-full rounded-md px-xxs py-xxxs hover:bg-interactive-level0 active:bg-interactive-level0 dark:active:bg-interactive-level0-dark dark:hover:bg-interactive-level0-dark active:[&>div]:scale-[.98]",children:e.jsxs("div",{className:"flex items-center gap-xxxs transition-transform ease-in-out",children:[e.jsx(q,{size:24,name:"chat"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(t,{variant:"callout",className:"text-left",weight:"medium",children:u({id:"cx_channels.chat.title"})}),e.jsx(t,{className:"text-left",variant:"callout",children:u({id:"cx_channels.chat.body"})})]}),e.jsx(q,{size:24,name:"chevron-right"})]})})})}):null},ie=O({base:["mt-32 max-w-[660px] rounded-16 px-s","bg-background-screen-level1 dark:bg-background-screen-level1-dark"]}),oe=O({base:"grid grid-cols-[auto_1fr] gap-x-xxxs gap-y-quarck pt-quarck",variants:{enabled:{true:"pb-xs",false:"pb-quarck"}}}),le=O({base:"text-left",variants:{isClose:{true:"text-content-subdued dark:text-content-subdued-dark"}}}),A=O({base:["col-start-1 col-end-3 row-start-[--row-start] row-end-[--row-end]","grid grid-cols-subgrid","rounded-12 bg-[--background-color]","-mx-xxs px-xxs"],variants:{isClose:{true:"bg-background-contrast dark:bg-background-screen-level0-dark"}}}),ce=O({base:"col-start-2 col-end-3 inline",variants:{phoneContactDisabled:{true:"py-xxxs"}}}),p=O({base:"inline text-content-subdued dark:text-content-subdued-dark"});var L={exports:{}},re=L.exports,U;function de(){return U||(U=1,function(n,i){(function(u,a){n.exports=a()})(re,function(){var u={year:0,month:1,day:2,hour:3,minute:4,second:5},a={};return function(d,o,s){var l,k=function(r,h,c){c===void 0&&(c={});var m=new Date(r),x=function(v,g){g===void 0&&(g={});var y=g.timeZoneName||"short",w=v+"|"+y,N=a[w];return N||(N=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:v,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:y}),a[w]=N),N}(h,c);return x.formatToParts(m)},T=function(r,h){for(var c=k(r,h),m=[],x=0;x<c.length;x+=1){var v=c[x],g=v.type,y=v.value,w=u[g];w>=0&&(m[w]=parseInt(y,10))}var N=m[3],D=N===24?0:N,j=m[0]+"-"+m[1]+"-"+m[2]+" "+D+":"+m[4]+":"+m[5]+":000",b=+r;return(s.utc(j).valueOf()-(b-=b%1e3))/6e4},z=o.prototype;z.tz=function(r,h){if(r===void 0&&(r=l),!this.isValid())return this;var c,m=this.utcOffset(),x=this.toDate(),v=x.toLocaleString("en-US",{timeZone:r}),g=T(+x,r);if(!Number(g))c=this.utcOffset(0,h);else if(c=s(v,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),h){var y=c.utcOffset();c=c.add(m-y,"minute")}return c.$x.$timezone=r,c},z.offsetName=function(r){var h=this.$x.$timezone||s.tz.guess(),c=k(this.valueOf(),h,{timeZoneName:r}).find(function(m){return m.type.toLowerCase()==="timezonename"});return c&&c.value};var F=z.startOf;z.startOf=function(r,h){if(!this.$x||!this.$x.$timezone)return F.call(this,r,h);var c=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return F.call(c,r,h).tz(this.$x.$timezone,!0)},s.tz=function(r,h,c){var m=c&&h,x=c||h||l,v=T(+s(),x);if(typeof r!="string")return s(r).tz(x);var g=s.utc(r,m).valueOf();if(Number.isNaN(g)){var y=s(NaN);return y.$x.$timezone=x,y}var w=function(b,C,E){var _=b-60*C*1e3,f=T(_,E);if(C===f)return[_,C];var I=T(_-=60*(f-C)*1e3,E);return f===I?[_,f]:[b-60*Math.min(f,I)*1e3,Math.max(f,I)]}(g,v,x),N=w[0],D=w[1],j=s(N).utcOffset(D);return j.$x.$timezone=x,j},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(r){l=r}}})}(L)),L.exports}var ue=de();const me=te(ue);M.extend(ne);M.extend(G);M.extend(me);const he=Intl.DateTimeFormat().resolvedOptions().timeZone,xe=new Map([["WEEKDAYS","cx_channels.phone.weekday_slot"],["SATURDAY","cx_channels.phone.saturday_slot"],["SUNDAY","cx_channels.phone.sunday_slot"]]),Y=n=>M(n,"HH:mm:ss.SSSSSS").tz(he).format("H[h]mm").replace("00",""),S=n=>n.charAt(0).toUpperCase()+n.slice(1),pe=n=>{const i=new Date().getDay();return n===i?"cx_channels.phone.one_opening_slot.close.next_day.later":n===i+1?"cx_channels.phone.one_opening_slot.close.next_day.tomorrow":"cx_channels.phone.one_opening_slot.close.next_day.monday"},ge=({slotsCount:n,slots:i,phoneNumber:u})=>{const{formatMessage:a}=$();return e.jsx(e.Fragment,{children:(()=>{switch(n){case 1:{const[d]=i;return e.jsx(t,{variant:"callout",className:"inline",children:a({id:"cx_channels.phone.one_opening_slot"},{slot:S(a({id:d.key})),opening:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:d.open}),closing:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:d.close}),number:()=>e.jsx(t,{variant:"callout",className:"inline whitespace-nowrap",weight:"medium",children:u})})})}case 2:{const[d,o]=i;return e.jsx(t,{variant:"callout",className:"inline",children:a({id:"cx_channels.phone.two_opening_slot"},{slot1:S(a({id:d.key})),opening1:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:d.open}),closing1:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:d.close}),slot2:a({id:o.key}),opening2:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:o.open}),closing2:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:o.close}),number:()=>e.jsx(t,{variant:"callout",className:"inline whitespace-nowrap",weight:"medium",children:u})})})}case 3:{const[d,o,s]=i;return e.jsx(t,{variant:"callout",className:"inline",children:a({id:"cx_channels.phone.three_opening_slot"},{slot1:S(a({id:d.key})),opening1:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:d.open}),closing1:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:d.close}),slot2:a({id:o.key}),opening2:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:o.open}),closing2:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:o.close}),slot3:a({id:s.key}),opening3:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:s.open}),closing3:()=>e.jsx(t,{variant:"callout",className:"inline",weight:"medium",children:s.close}),number:()=>e.jsx(t,{variant:"callout",className:"inline whitespace-nowrap",weight:"medium",children:u})})})}default:return null}})()})},fe=({slotsCount:n,slots:i,nextOpeningDayIndex:u})=>{const{formatMessage:a}=$(),d=a({id:pe(u)});return e.jsx(e.Fragment,{children:(()=>{switch(n){case 1:{const[o]=i;return e.jsx(t,{variant:"callout",className:p(),children:a({id:"cx_channels.phone.one_opening_slot.close"},{slot:S(a({id:o.key})),opening:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:o.open}),closing:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:o.close}),nextOpenDay:d})})}case 2:{const[o,s]=i;return e.jsx(t,{variant:"callout",className:p(),children:a({id:"cx_channels.phone.two_opening_slot.close"},{slot1:S(a({id:o.key})),opening1:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:o.open}),closing1:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:o.close}),slot2:a({id:s.key}),opening2:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:s.open}),closing2:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:s.close}),nextOpenDay:d})})}case 3:{const[o,s,l]=i;return e.jsx(t,{variant:"callout",className:p(),children:a({id:"cx_channels.phone.three_opening_slot.close"},{slot1:S(a({id:o.key})),opening1:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:o.open}),closing1:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:o.close}),slot2:a({id:s.key}),opening2:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:s.open}),closing2:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:s.close}),slot3:a({id:l.key}),opening3:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:l.open}),closing3:()=>e.jsx(t,{variant:"callout",className:p(),weight:"medium",children:l.close}),nextOpenDay:d})})}default:return null}})()})},ve=({isClose:n,...i})=>n?e.jsx(fe,{...i}):e.jsx(ge,{...i}),ye=({deafServiceContactUrl:n,enabled:i,phoneContact:{enabled:u,...a}})=>{const{formatMessage:d}=$(),o=Z(),s=H.useId();if(!i)return null;const l=a.isClose?o.colors.content.subdued:void 0;return e.jsxs("div",{className:oe({enabled:u}),children:[e.jsxs("div",{className:A({isClose:a.isClose,className:"py-xxxs"}),style:{"--row-start":1,"--row-end":2},children:[e.jsx(q,{size:24,color:l,name:a.isClose?"snooze":"iphone",className:"col-start-1 col-end-2"}),u&&e.jsxs("div",{className:"col-start-2 col-end-3",children:[e.jsx(t,{variant:"callout",className:le({isClose:a.isClose}),weight:"medium",children:d({id:"cx_channels.phone.title"})}),e.jsx(ve,{...a})]})]}),e.jsx("div",{className:A(),style:{"--row-start":u?2:1,"--row-end":u?3:2},children:!!n&&e.jsx(t,{variant:"callout",className:ce({phoneContactDisabled:!u}),id:s,children:d({id:"cx_channels.phone.deaf_text"},{link:k=>e.jsx(t,{variant:"callout",component:"a",href:n,className:"inline text-current","aria-labelledby":s,children:k})})})})]})},Ne=async n=>await K({method:"GET",path:"api/v0/customer_channels",credentials:"include",onErrorC
1ollection:{on401Error:n}}),we=()=>{const{isIosDevice:n}=P();H.useEffect(()=>{n&&window.location.assign("swile://cx/customer-channels")},[n])},be=()=>{var F,r,h,c,m,x,v,g,y,w,N,D,j,b,C,E,_;we();const n=V(),{formatMessage:i}=$(),{configuration:{urls:u},isLoading:a}=W(),o={onExit:{action:()=>{n(-1)},label:i({id:"cx_channels.exit"})},pageTitle:i({id:"cx_channels.page_title"})},s=()=>{window.location.assign(u.faqShortcuts.contactForm)},l=B({queryKey:[X],queryFn:()=>Ne(s),staleTime:Number.POSITIVE_INFINITY,enabled:!a}),k=()=>{var f,I;if((I=(f=l.data)==null?void 0:f.chatContact)!=null&&I.jwt)return Q(l.data.chatContact.jwt),J()},T={enabled:!!((F=l.data)!=null&&F.chatContact),openChat:k},z={deafServiceContactUrl:(h=(r=l.data)==null?void 0:r.deafServiceContact)==null?void 0:h.url,enabled:!!((c=l.data)!=null&&c.phoneContact)||!!((m=l.data)!=null&&m.deafServiceContact),phoneContact:{enabled:!!((x=l.data)!=null&&x.phoneContact),isClose:!!((v=l.data)!=null&&v.phoneContact)&&!l.data.phoneContact.isOpen,nextOpeningDayIndex:((y=(g=l.data)==null?void 0:g.phoneContact)==null?void 0:y.nextOpeningDayIndex)||null,slotsCount:((N=(w=l.data)==null?void 0:w.phoneContact)==null?void 0:N.openingHours.length)||0,slots:(((j=(D=l.data)==null?void 0:D.phoneContact)==null?void 0:j.openingHours)||[]).map(f=>({key:xe.get(f.days),days:f.days,open:Y(f.openingTime),close:Y(f.closingTime)})),phoneNumber:(C=(b=l.data)==null?void 0:b.phoneContact)!=null&&C.phoneNumber?ae((_=(E=l.data)==null?void 0:E.phoneContact)==null?void 0:_.phoneNumber).formatInternational():void 0}};return{chatContact:T,isLoading:a||l.isLoading,layout:o,phoneContact:z}},Fe=()=>{const{formatMessage:n}=$(),{chatContact:i,isLoading:u,layout:a,phoneContact:d}=be();return e.jsxs(R,{...a,children:[e.jsx(t,{variant:"largeTitle",className:"text-center",children:n({id:"cx_channels.title"})}),e.jsx(t,{variant:"body",className:"text-center",children:n({id:"cx_channels.body"})}),e.jsx(ee,{isLoading:u,height:145,classes:{skeleton:"!w-[min(100vw,660px)] mt-32 rounded-12"},children:e.jsxs("div",{className:ie(),children:[e.jsx(se,{...i}),e.jsx(ye,{...d})]})})]})};export{Fe as CustomerChannels};
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.