(function(){var f={7125:function(f){f.exports=''},7375:function(f){f.exports=''},7020:function(f){f.exports=''},9303:function(f){f.exports=''},7121:function(f){f.exports=''},4868:function(f){f.exports=''},8667:function(f){f.exports=''},5021:function(f){f.exports=''},3036:function(f){f.exports=''},2673:function(f){f.exports=''},6780:function(f){f.exports=''},9374:function(f){f.exports=''},8070:function(f){f.exports=''},1255:function(f){f.exports=''},1091:function(f){f.exports=''},7867:function(f){f.exports=''},6058:function(f){f.exports=''},8105:function(f){f.exports=''},4965:function(f){f.exports=''},6504:function(f){f.exports=''},6454:function(f){f.exports=''},9290:function(f){f.exports=''},401:function(f){f.exports=''},8176:function(f){f.exports=''},8233:function(f){f.exports=''},33:function(f){f.exports=''},2889:function(f){f.exports=''},7549:function(f){f.exports=''},7327:function(f){f.exports=''},7511:function(f){f.exports=''},2711:function(f){f.exports=''},1658:function(f){f.exports=''},5008:function(f){f.exports=''},3457:function(f){f.exports=''},7658:function(f){f.exports=''},5128:function(f){f.exports=''},3687:function(f){f.exports=''},9507:function(f){f.exports=''},2030:function(f){f.exports=''},6124:function(f){f.exports=''},8304:function(f){f.exports=''},4283:function(f){f.exports=''},5389:function(f){f.exports=''},2331:function(f){f.exports='end-call'},4126:function(f){f.exports=''},8088:function(f){f.exports=''},2019:function(f){f.exports=''},3914:function(f){f.exports=''},7469:function(f){f.exports=''},3969:function(f){f.exports=''},1027:function(f){f.exports=''},2059:function(f){f.exports=''},5001:function(f){f.exports=''},964:function(f){f.exports=''},5379:function(f){f.exports=''},5387:function(f){f.exports=''},4127:function(f){f.exports=''},4540:function(f){f.exports=''},814:function(f){f.exports=''},4005:function(f){f.exports=''},6925:function(f){f.exports=''},6607:function(f){f.exports=''},7431:function(f){f.exports=''},7829:function(f){f.exports=''},6316:function(f){f.exports=''},2761:function(f){f.exports=''},1652:function(f){f.exports=''},728:function(f){f.exports=''},4773:function(f){f.exports=''},9429:function(f){f.exports=''},6491:function(f){f.exports=''},8327:function(f){f.exports=''},1199:function(f){f.exports=''},517:function(f){f.exports=''},8144:function(f){f.exports=''},6402:function(f){f.exports=''},483:function(f){f.exports=''},5366:function(f){f.exports=''},894:function(f){f.exports=''},6351:function(f){f.exports=''},8509:function(f){f.exports='
'},8329:function(f){f.exports=''},1508:function(f){f.exports=''},3436:function(f){f.exports=''},1728:function(f){f.exports=''},3733:function(f){f.exports=''},1222:function(f){f.exports=''},4862:function(f){f.exports=''},4223:function(f){f.exports=''},530:function(f){f.exports=''},874:function(f){f.exports=''},4763:function(f){f.exports=''},7840:function(f){f.exports=''},548:function(f){f.exports=''},1225:function(f){f.exports=''},1163:function(f){f.exports=''},3939:function(f){f.exports=''},1986:function(f){f.exports=''},1744:function(f){f.exports=''},7140:function(f){f.exports=''},1049:function(f){f.exports=''},2324:function(f){f.exports=''},9384:function(f){f.exports=''},5661:function(f){f.exports=''},9434:function(f){f.exports=''},2306:function(f){f.exports=''},7203:function(f){f.exports=''},310:function(f){f.exports=''},1022:function(f){f.exports=''},319:function(f){f.exports=''},6417:function(f){f.exports=''},9597:function(f){f.exports=''},456:function(f){f.exports=''},8849:function(f){f.exports=''},5069:function(f){f.exports=''},504:function(f){f.exports=''},4717:function(f){f.exports=''},2281:function(f){f.exports=''},5268:function(f){f.exports=''},342:function(f){f.exports=''},7214:function(f){f.exports=''},8988:function(f){f.exports=''},6673:function(f){f.exports=''},10:function(f){f.exports=''},1688:function(f){f.exports=''},7938:function(f){f.exports=''},6042:function(f){f.exports=''},9851:function(f){f.exports=''},2079:function(f){f.exports=''},567:function(f){f.exports=''},902:function(f){f.exports=''},7005:function(f){f.exports=''},295:function(f){f.exports=''},6204:function(f){f.exports=''},9961:function(f){f.exports=''},9252:function(f){f.exports=''},2582:function(f){f.exports=''},2162:function(f){f.exports=''},622:function(f){f.exports=''},2669:function(f){f.exports=''},2616:function(f){f.exports=''},9346:function(f){f.exports=''},5862:function(f){f.exports=''},6885:function(f){f.exports=''},7316:function(f){f.exports=''},2027:function(f,P,n){"use strict";const A=f=>"true"===f;var e=n(9322),H=n(641),v=n(2644);function r(f,P,n,A,r,c){const O=(0,H.g2)("MainView"),j=(0,H.g2)("ImageSlider"),X=(0,H.g2)("FileAttachModal");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(["micro-app-support-root",A.styles["root"],A.styles[A.resolvedThemeClass]])},[(0,H.bF)(e.eB,{name:"mainview"},{default:(0,H.k6)((()=>[(0,H.bo)((0,H.bF)(O,{id:f.$globalElementIdRegistry.mainView,onShowUploadFileModal:P[0]||(P[0]=f=>A.showAttachFileModal=!0)},null,8,["id"]),[[e.aG,A.getActiveView===A.ActiveSupportView.Main]])])),_:1}),A.getImagesForSlider.length?((0,H.uX)(),(0,H.Wv)(j,{key:0,"images-array":A.getImagesForSlider,onCloseSlider:P[1]||(P[1]=f=>A.setImagesForSlider([]))},null,8,["images-array"])):(0,H.Q3)("",!0),A.showAttachFileModal?((0,H.uX)(),(0,H.Wv)(X,{key:1,onHideModal:P[2]||(P[2]=f=>A.showAttachFileModal=!1)})):(0,H.Q3)("",!0)],2)}var c={root:"o4Y1J5TJi8Ix2yw_LOKi",volnaTheme:"IuVqPNbAPY8RcT3oFhPc",legzoTheme:"c68omidv2H4PijjCpbmv",jetTheme:"e0Zld2volEwAKNlFM3na","fresh-basicTheme":"DmNpzuoEPILk6pBHEmgt","fresh-darkTheme":"V_EJhBqQWzgSIUWzpKfx",solTheme:"Jbhb7h3kHs0HNgt1JpEx",dripTheme:"uaGjdOuQuGEiXhqsYgTY",izziTheme:"BE3zkhpCrQ1LRZvYTJ00",stardaTheme:"_ILdV3NNRuUlqxghUK6W",roxTheme:"Ki_PND7Q5IsIE_EMNcgW",onegoTheme:"wfOHQo3HZUDL7ienI4T8",lexTheme:"J87z9KeAn19y4gBEJbDl",irwinTheme:"fhm5ir4zddse_btIvMQ2",gizboTheme:"msvm69KZGGQrfEQNcl8O",flagmanTheme:"sd4FyV9xRsdSWmaET_zD",martinTheme:"jwyDCdITf_Ailqei8EWD","monro-basicTheme":"CbUeL94aVxwazcfuClHc","monro-darkTheme":"aQq2aKEzlFYlf1LeutXz"},O=n(203),j=n(9841),X=n(3381);const x=(f,P)=>{if(0===f||1===f&&2===P)return 0;const n=f>10&&f<20,A=f%10===1;return!n&&A||f>1&&2===P?1:!n&&f%10>=2&&f%10<=4||P<4?2:3},t=(f,P)=>{if(0===f||1===f&&2===P)return 0;if(1===f||f>1&&2===P)return 1;const n=f>10&&f<20;return!n&&f%10>=2&&f%10<=4||P<4?2:3},z=(0,X.hU)({locale:"ru",fallbackLocale:"en",pluralizationRules:{pl:t,ru:x,ua:x}}),w=(f,P,n)=>{z.global.locale=f,z.global.setLocaleMessage(f,P)};n(4114);const D=f=>{window.send_data&&window.send_data(f),window.dataLayer&&window.dataLayer.push(f)},p={process_id:0},d=f=>{p.process_id=f},T=(f,P={})=>{D({event:"Element Available",element:f,process_id:p.process_id,...P})},o=(f={})=>{D({event:"Support LiveChat",process_id:p.process_id,...f})},B=(f,P)=>{const n=f=>{const n=f;P(n.detail)};(0,H.sV)((()=>{window.addEventListener(f,n)})),(0,H.hi)((()=>{window.removeEventListener(f,n)}))},g=(f,P)=>{const n=n=>{if(null===(null===f||void 0===f?void 0:f.value))return;const{target:A}=n;f.value===A||f.value.contains(A)||P(n)};(0,H.sV)((()=>{document.addEventListener("click",n)})),(0,H.hi)((()=>{document.removeEventListener("click",n)}))};var u;(function(f){f[f["Main"]=0]="Main",f[f["None"]=1]="None"})(u||(u={}));var s,M,a=n(9596);(function(f){f["GET"]="GET",f["POST"]="POST",f["DELETE"]="DELETE"})(s||(s={})),function(f){f["json"]="application/json",f["formUrlEncoded"]="application/x-www-form-urlencoded"}(M||(M={}));const l=async(f,P)=>{const n={...(null===P||void 0===P?void 0:P.headers)||{},accept:"application/json"},A=null!==P&&void 0!==P&&P.content?b(null===P||void 0===P?void 0:P.content):{body:null};A.body&&A.type&&(n["content-type"]=A.type);const e=await fetch(f,{method:(null===P||void 0===P?void 0:P.method)||s.GET,headers:n,body:A.body});if(!e.ok){let f={status:e.status};if("0"!==e.headers.get("content-length"))try{const P=await e.json();f={...P,status:e.status}}catch(H){console.error("Ошибка при разборе JSON:",H)}return Promise.reject(f)}return await e.json()},b=f=>f instanceof FormData?{body:f}:f instanceof G?{body:f.serialize(),type:M.formUrlEncoded}:{body:JSON.stringify(f),type:M.json};class G{constructor(f){(0,a.A)(this,"payload",void 0),this.payload=f}serialize(){return Object.keys(this.payload).map((f=>`${f}=${encodeURIComponent(this.payload[f])}`)).join("&")}}var y=n(4710),Y=n(7607),i=n(6011);n(6573),n(8100),n(7936);const h=f=>{let P=[...f.initialOperationState?f.initialOperationState:[]];const n={total:P.length,complete:0,executeAmount:f.executeAmount,inProgress:!1},A=()=>{if(n.complete===n.total)return n.total=n.complete=0,void(n.inProgress=!1);const e=()=>{const f=[];while(f.lengthf()))).finally((()=>{var P;n.complete+=H.length,null===(P=f.onCompleteProgress)||void 0===P||P.call(f,n.complete,n.total),A()}))};return{start:()=>{n.inProgress||A()},addOperations:f=>{P.push(...f),n.total+=f.length},clear:()=>{P=[],n.total=n.complete=0,n.inProgress=!1}}},C=(f,P)=>{let n,A=!0,e=!1;const H=()=>{A=!1,n=setTimeout((()=>{e=!0,P().then((()=>{e=!1,A||H()}))}),f)},v=()=>{A=!0,clearTimeout(n)};return{start:H,stop:v,isOperationExecuting:()=>e,isStopped:()=>A}},k=f=>void 0===f||null===f,m=f=>"function"===typeof f;var q,L=new WeakMap;class Z{constructor(){(0,y.A)(this,L,new Map)}emit(...f){var P;const[n,...A]=f;null===(P=(0,Y.A)(L,this).get(n))||void 0===P||P.forEach((f=>{f.apply(f,A)}))}subscribe(f,P){let n;(0,Y.A)(L,this).has(f)?n=(0,Y.A)(L,this).get(f):(n=[],(0,Y.A)(L,this).set(f,n));const A=(...f)=>P.apply(P,f);return n.push(A),()=>n.splice(n.indexOf(A),1)}subscribeOnce(f,P){const n=this.subscribe(f,((...f)=>(n(),P.apply(P,f))))}}(function(f){f[f["CLOSE_NORMAL"]=1e3]="CLOSE_NORMAL",f[f["GOING_AWAY"]=1001]="GOING_AWAY",f[f["CLOSE_ABNORMAL"]=1006]="CLOSE_ABNORMAL"})(q||(q={}));var R=new WeakMap;class F extends Z{constructor(f){super(),(0,y.A)(this,R,void 0),(0,i.A)(R,this,new WebSocket(f)),(0,Y.A)(R,this).binaryType="arraybuffer",(0,Y.A)(R,this).onopen=f=>{this.emit("open",f)},(0,Y.A)(R,this).onmessage=f=>{if(f.data instanceof ArrayBuffer)return void this.emit("message",f.data);const P=JSON.parse(f.data);P.data&&(P.data=JSON.parse(P.data)),this.emit("message",P)},(0,Y.A)(R,this).onclose=f=>{this.emit("close",f)}}send(f){(0,Y.A)(R,this).readyState!==WebSocket.OPEN?(console.error("Failed attempt to send payload to socket"),console.error("socket url -> "+(0,Y.A)(R,this).url),console.error("payload -> ",f)):(0,Y.A)(R,this).send(f instanceof ArrayBuffer?f:JSON.stringify(f))}close(){(0,Y.A)(R,this).close(q.CLOSE_NORMAL,"regular close request")}}const Q=window.location.origin,U=f=>[Q,"chat/support/api/cms/v4/strings",f].join("/"),J=f=>l(U(f)).then((f=>f.data.chat));n(4979);const N="mf-anon-user-id-key",K=()=>{let f=localStorage.getItem(N);return f||(f=V(245),localStorage.setItem(N,f)),f},V=(f=10)=>{const P=(f,P)=>[...Array(P-f).keys(),P-f].map((P=>f+P)),n=P(65,90),A=P(97,122),e=P(48,57),H=n.concat(A).concat(e);let v="";for(let r=0;r{if(void 0===f)throw new TypeError("result of Array.find expected to be found");return f},W=f=>{const[,P]=f.split("."),{exp:n}=JSON.parse(atob(P));return{exp:n}},S=f=>{try{return JSON.parse(f)}catch(P){return!1}},E=f=>P=>P.toLowerCase()===f;var _;(function(f){f["legzo"]="legzo",f["volna"]="volna",f["jet"]="jet",f["freshBasic"]="fresh-basic",f["freshDark"]="fresh-dark",f["sol"]="sol",f["drip"]="drip",f["izzi"]="izzi",f["starda"]="starda",f["rox"]="rox",f["onego"]="onego",f["lex"]="lex",f["irwin"]="irwin",f["gizbo"]="gizbo",f["flagman"]="flagman",f["martin"]="martin",f["monroBasic"]="monro-basic",f["monroDark"]="monro-dark"})(_||(_={}));const $=[{displayName:"Legzo",indicator:E("legzo"),themes:[_.legzo]},{displayName:"Volna",indicator:E("volna"),themes:[_.volna]},{displayName:"Jet",indicator:E("jet"),themes:[_.jet]},{displayName:"Fresh",indicator:E("fresh"),themes:[_.freshBasic,_.freshDark]},{displayName:"Sol",indicator:E("sol"),themes:[_.sol]},{displayName:"Drip",indicator:E("drip"),themes:[_.drip]},{displayName:"Izzi",indicator:E("izzi"),themes:[_.izzi]},{displayName:"Starda",indicator:E("starda"),themes:[_.starda]},{displayName:"Rox",indicator:E("rox"),themes:[_.rox]},{displayName:"Onego",indicator:E("onego"),themes:[_.onego]},{displayName:"Lex",indicator:E("lex"),themes:[_.lex]},{displayName:"Irwin",indicator:E("irwin"),themes:[_.irwin]},{displayName:"Gizbo",indicator:E("gizbo"),themes:[_.gizbo]},{displayName:"Flagman",indicator:E("flagman"),themes:[_.flagman]},{displayName:"Martin",indicator:E("martin"),themes:[_.martin]},{displayName:"Monro",indicator:E("monro"),themes:[_.monroBasic,_.monroDark]}],ff=f=>-1!==$.findIndex((P=>P.themes.includes(f))),Pf=f=>-1!==$.findIndex((P=>P.indicator(f))),nf=f=>I($.find((P=>P.indicator(f)))).displayName,Af=()=>({activeView:u.None,languageCode:"ru",translations:{},siteName:String(),theme:String(),productDisplayName:String(),userId:null,userEnvironment:{},imagesForSlider:[],styleOverrides:{}}),ef=(0,O.nY)("main-app-store",{state:()=>Af(),getters:{getSiteName(f){return f.siteName},getProductDisplayName(f){return f.productDisplayName},getTheme(f){return f.theme},getActiveView(f){return f.activeView},getLanguageCode(f){return f.languageCode},getTranslations(f){return f.translations[f.languageCode]},getUserId(f){return f.userId},getUserEnvironment(f){return f.userEnvironment},getImagesForSlider(f){return f.imagesForSlider},getStyleOverrides(f){return f.styleOverrides}},actions:{toggleActiveView(){this.activeView=this.activeView===u.Main?u.None:u.Main},async setLanguageCode(f){this.languageCode=f,this.translations[this.languageCode]=await J(this.languageCode)},setSiteName(f){this.siteName=f,this.productDisplayName=nf(f)},setTheme(f){this.theme=f},setUserId(f){this.userId=f},setUserOs(f){this.userEnvironment.os=f},setUserIp(f){this.userEnvironment.ip=f},setUserBrowser(f){this.userEnvironment.browser=f},setUserCountryCode(f){this.userEnvironment.countryCode=f},setImagesForSlider(f){this.imagesForSlider=f},setStyleOverrides(f){this.styleOverrides=f}}});function Hf(f,P,n,A,e,r){const c=(0,H.g2)("CommonButton"),O=(0,H.g2)("ConnectionError"),j=(0,H.g2)("ActionBar"),X=(0,H.g2)("CallArea"),x=(0,H.g2)("ChatArea"),t=(0,H.g2)("LoadingOverlay");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["mainframe"],{[A.styles["isExpanded"]]:A.isExpanded}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["header"])},[(0,H.bF)(c,{id:f.$globalElementIdRegistry.collapseMainViewButton,icon:"minimize",iconSize:"size-20",onCustomClick:A.toggleActiveView},null,8,["id","onCustomClick"])],2),(0,H.Lk)("div",{class:(0,v.C4)([A.styles["content"],{[A.styles["isVideoAreaMobileVisible"]]:A.isVideoAreaMobileVisible}])},[A.isConnectionErrorState||A.isInternalError||A.isRoomAlreadyClosedError?((0,H.uX)(),(0,H.Wv)(O,{key:0,isInternalError:A.isInternalError,isRoomAlreadyClosedError:A.isRoomAlreadyClosedError,onInitChat:A.initChat},null,8,["isInternalError","isRoomAlreadyClosedError","onInitChat"])):(0,H.Q3)("",!0),A.isSignedInState?((0,H.uX)(),(0,H.CE)(H.FK,{key:1},[(0,H.bF)(j),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["area"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messageContent"])},[(0,H.bF)(X,{class:(0,v.C4)([A.styles["callArea"],{[A.styles["isVisible"]]:A.isActiveCall&&A.isLocalActiveCall}]),onOnEndCall:A.onEndCall,onOnExpand:A.onExpand,onOnExpandVideoAreaInMobile:A.onExpandVideoAreaInMobile},null,8,["class","onOnEndCall","onOnExpand","onOnExpandVideoAreaInMobile"]),(0,H.bF)(x,{onRestoreChat:A.initChat,onShowUploadFileModal:P[0]||(P[0]=P=>f.$emit("showUploadFileModal"))},null,8,["onRestoreChat"])],2)],2)],64)):(0,H.Q3)("",!0),A.isLoadingState||A.isClosingRoom?((0,H.uX)(),(0,H.Wv)(t,{key:2})):(0,H.Q3)("",!0)],2)],2)}var vf={mainframe:"fUDfP8D7SnsMxrBG8CwS",isExpanded:"tujusNDw9xU1SgQnXsKb",header:"vO7zigIBk4xkEGuLXmGo",content:"s1qCk468R7c7Uxgh_Vf1",isVideoAreaMobileVisible:"gi3l5tL4zQIxzy_YsxEm",area:"CcUH4LpbN43GabF7PPo7",callArea:"f5aGxfhVt40HS_BRGPd8",isVisible:"a48zc9LsCbUOejp671nc",messageContent:"XIJ6ItckNI0xherlwIgb"};const rf={key:1};function cf(f,P,n,A,r,c){const O=(0,H.g2)("Icon");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["button"],{[A.styles["disabled"]]:n.disabled}]),onClick:P[0]||(P[0]=(0,e.D$)(((...f)=>A.handleClick&&A.handleClick(...f)),["stop"]))},[n.icon?((0,H.uX)(),(0,H.Wv)(O,{key:0,"icon-name":n.icon,class:(0,v.C4)({[A.styles["icon"]]:n.text}),size:n.iconSize},null,8,["icon-name","class","size"])):(0,H.Q3)("",!0),n.text?((0,H.uX)(),(0,H.CE)("span",rf,(0,v.v_)(n.text),1)):(0,H.Q3)("",!0)],2)}const Of=["innerHTML"];function jf(f,P,n,A,e,r){return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["icon"],A.styles[n.size]]),style:(0,v.Tr)(n.dynamicStyles),innerHTML:A.icon},null,14,Of)}var Xf={icon:"R7jD60kJL6Uadf3GR_Iv",dynamic:"jnAF54no9kJu7S6KgqNu","parent-height":"nxk6xyEHqgx4L5ts5zZx","size-44":"NCrze4zJ5k7336sW0Otw","size-39":"uEW6pn4DLr4Mph1gYiCB","size-28":"koBS9rdwxL0wvdbnvf4q","size-26":"A8wpeeSCJfIHJwNOGoFV","size-24":"WqBKAIHMx4gI9OFxitOA","size-22":"m_LIFYtxAK7av5jAfTHY","size-20":"r9TtuMjGnyUeuoZ7ZhLG","size-18":"UVNGUREWq4ofXRZsUPx0","size-16":"ZWIJmYWvSpo3yjIRIPFd","size-15":"f1vvaKg5J07Jzw0ZmcNa","size-14":"ifOxhQIgKoiUbJA6ANIQ","size-13":"mgHOJAu4OKgCxFdLItWd","size-12":"_8IPBQToQc4H9dUd9iXj","size-10":"x7EnEy1fK2cHN0k4QoXp","size-8":"tiVBEcMONn0DBP1bs9HM"},xf={name:"icon",props:{iconName:{type:String,default:null},size:{type:String,default:"dynamic"},iconUrl:{type:String,default:null},dynamicStyles:Object},setup(f){const P=(0,H.EW)((()=>f.iconUrl?``:n(2424)(`./${f.iconName}.svg`)));return{styles:Xf,icon:P}}},tf=n(6262);const zf=(0,tf.A)(xf,[["render",jf]]);var wf=zf,Df={button:"m9ByUAFcDnM73EmQ3AVZ",disabled:"AILQjFHs0CSPqQ_6LiTs",icon:"TLUuvL2_pfcxe354pTyq"},pf={name:"common-button",components:{Icon:wf},emits:["customClick"],props:{icon:{type:String,default:null},iconSize:{type:String,default:"dynamic"},text:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(f,P){const n=()=>{f.disabled||P.emit("customClick")};return{handleClick:n,styles:Df,Icon:wf}}};const df=(0,tf.A)(pf,[["render",cf]]);var Tf=df;const of={key:0};function Bf(f,P,n,A,e,r){const c=(0,H.g2)("Icon");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["overlay"])},[(0,H.bF)(c,{"icon-name":A.iconName,size:"size-39"},null,8,["icon-name"]),n.text?((0,H.uX)(),(0,H.CE)("span",of,(0,v.v_)(n.text),1)):(0,H.Q3)("",!0)],2)}var gf={overlay:"ao8AGRWatjM8D1GJAY43","clockwise-rotation":"SJ7g6jJ9GywyuB7tdmYY"},uf={name:"loading-overlay",components:{Icon:wf},props:{text:{type:String,default:""}},setup(){const{getTheme:f}=(0,O.bP)(ef()),P=(0,H.EW)((()=>`tenants/${f.value}/loader`));return{styles:gf,iconName:P}}};const sf=(0,tf.A)(uf,[["render",Bf]]);var Mf=sf;const af="mf-support--disable-scroll",lf={desktop:768},bf=()=>window.innerWidth<=lf.desktop,Gf=f=>{const P=(0,j.KR)(!1);let n=0;B("resize",(()=>{P.value=bf()})),(0,H.wB)(P,(P=>{A(P&&!f.value)})),P.value=bf(),(0,H.wB)(f,(f=>{A(!f&&P.value)}));const A=f=>{f?(n=window.scrollY,document.body.classList.add(af)):(document.body.classList.remove(af),setTimeout((()=>{window.scrollTo(0,n)}),0))}},yf=f=>void 0===f||null===f,Yf=f=>"string"===typeof f&&f.length>0,hf=f=>Array.isArray(f)&&f.length>0,Cf=()=>({init:!0}),kf=f=>!yf(f)&&!0===f.init,mf=f=>!yf(f)&&!0===f.loading,qf=f=>!yf(f)&&!0===f.error,Lf=f=>!kf(f)&&!qf(f)&&!mf(f),Zf={isLoading:mf,isError:qf,isLoadedDataModel:Lf,isInitialState:kf},Rf=Cf;var Ff,Qf;(function(f){f[f["PreForm"]=0]="PreForm",f[f["PostForm"]=1]="PostForm",f[f["ActiveRoom"]=2]="ActiveRoom",f[f["ClosedRoom"]=3]="ClosedRoom"})(Ff||(Ff={})),function(f){f[f["IncomingCall"]=0]="IncomingCall",f[f["ActiveCall"]=1]="ActiveCall"}(Qf||(Qf={}));const Uf=Zf.isInitialState,Jf=Zf.isLoading,Nf=Zf.isError,Kf=Zf.isLoadedDataModel;var Vf,If,Wf,Sf;n(4603),n(7566),n(8721);(function(f){f[f["chatCreatedByUser"]=1]="chatCreatedByUser",f[f["chatCloseByCustomer"]=2]="chatCloseByCustomer",f[f["chatCloseByManager"]=3]="chatCloseByManager",f[f["chatCloseAuto"]=4]="chatCloseAuto",f[f["supervisorConnected"]=5]="supervisorConnected",f[f["supervisorDisconnected"]=6]="supervisorDisconnected",f[f["managerConnected"]=7]="managerConnected",f[f["managerDisconnected"]=8]="managerDisconnected",f[f["managerTransferToLine"]=9]="managerTransferToLine",f[f["managerTransferToManager"]=10]="managerTransferToManager",f[f["customerLiked"]=11]="customerLiked",f[f["findManager"]=12]="findManager",f[f["findWaitManager"]=13]="findWaitManager",f[f["customerDisliked"]=14]="customerDisliked",f[f["formAnswers"]=16]="formAnswers",f[f["liveswitchCallInit"]=17]="liveswitchCallInit",f[f["liveswitchUserAccept"]=18]="liveswitchUserAccept",f[f["liveswitchUserTimeout"]=19]="liveswitchUserTimeout",f[f["liveswitchUserReject"]=20]="liveswitchUserReject",f[f["liveswitchUserLeave"]=21]="liveswitchUserLeave",f[f["liveswitchSupportLeave"]=22]="liveswitchSupportLeave",f[f["liveswitchCallRequest"]=23]="liveswitchCallRequest",f[f["chatUserActivityBan"]=25]="chatUserActivityBan"})(Vf||(Vf={})),function(f){f["PreChat"]="pre-chat",f["PostChat"]="post-chat"}(If||(If={})),function(f){f[f["system"]=1]="system",f[f["customer"]=30]="customer",f[f["customerAttach"]=31]="customerAttach",f[f["manager"]=60]="manager",f[f["managerAttach"]=61]="managerAttach",f[f["privateSystemAttach"]=5]="privateSystemAttach",f[f["privateSystem"]=6]="privateSystem",f[f["private"]=90]="private",f[f["callConnect"]=11]="callConnect",f[f["callReconnect"]=12]="callReconnect",f[f["callDisconnect"]=13]="callDisconnect",f[f["callRequest"]=14]="callRequest",f[f["primary"]=2]="primary"}(Wf||(Wf={})),function(f){f[f["wait"]=0]="wait",f[f["inProgress"]=1]="inProgress",f[f["closeCustomer"]=2]="closeCustomer",f[f["closeManager"]=3]="closeManager",f[f["closeAuto"]=4]="closeAuto",f[f["inactive"]=5]="inactive"}(Sf||(Sf={}));const Ef=f=>[Sf.closeManager,Sf.closeAuto,Sf.closeCustomer].includes(f);var _f;(function(f){f[f["None"]=0]="None",f[f["PreForm"]=1]="PreForm",f[f["ActiveRoom"]=2]="ActiveRoom",f[f["PostForm"]=3]="PostForm",f[f["Closed"]=4]="Closed"})(_f||(_f={}));const $f=f=>f.hasOwnProperty("status")&&f.hasOwnProperty("retry_after")&&f.hasOwnProperty("error")&&429===f.status,fP=f=>{const P=[401,502,503,504];return!1===(null===f||void 0===f?void 0:f.success)&&"Room already is closed"===(null===f||void 0===f?void 0:f.message)||f.hasOwnProperty("status")&&P.includes(f.status)};var PP;(function(f){f[f["TOO_MANY_REQUESTS"]=0]="TOO_MANY_REQUESTS",f[f["INTERNAL_SERVER_ERRORS"]=1]="INTERNAL_SERVER_ERRORS",f[f["ROOM_ALREADY_CLOSED"]=2]="ROOM_ALREADY_CLOSED"})(PP||(PP={}));const nP=f=>({...f}),AP=f=>({id:f.id,questions:f.questions.map(nP)}),eP=f=>{if(f.message_type===Wf.system){const P=S(f.msg),n=[Vf.chatCreatedByUser,Vf.chatCloseByManager,Vf.chatCloseByCustomer,Vf.managerConnected,Vf.managerDisconnected];if(!1===P)throw new Error("Unknown system message "+f.msg);const A=P.subtype;return n.includes(A)?{id:f.id,type:Wf.system,createdAt:vP(f.created_at),subtype:P.subtype,name:P.name}:P.subtype===Vf.managerTransferToManager?{id:f.id,type:Wf.system,createdAt:vP(f.created_at),subtype:P.subtype,from:P.from,to:P.to}:P.subtype===Vf.formAnswers?{id:f.id,type:Wf.system,createdAt:vP(f.created_at),subtype:P.subtype,preForm:P.preForm,answers:P.answers}:{id:f.id,type:Wf.system,createdAt:vP(f.created_at),subtype:P.subtype}}const P={id:f.id,type:f.message_type,files:f.files,createdAt:vP(f.created_at),content:f.msg};return f.message_type!==Wf.manager&&f.message_type!==Wf.managerAttach||(P.agentDetails={avatarUrl:f.manager.avatar_link,name:f.manager.name}),P},HP=f=>({id:f.id,name:f.name,avatarUrl:f.avatar_link}),vP=f=>1e3*f,rP=[window.location.origin,"support"].join("/"),cP=`${rP}/api/v1`,OP=`${cP}/customers`,jP=`${OP}/room`,XP=[window.location.origin,"api/v2","player/settings"].join("/"),xP={signin:`${OP}/signin`,refreshToken:`${OP}/refreshToken`,auth:XP,form:f=>`${OP}/form/${f}`,formSubmit:(f,P=!1)=>P?`${OP}/form/${f}/skip`:`${OP}/form/${f}/answer`,roomInfo:f=>`${jP}/${f}/info`,room:f=>`${jP}/${f}`,roomMessages:f=>`${jP}/${f}/messages`,roomMessagesUpload:f=>`${jP}/${f}/messages/upload`,mediaCallEvent:f=>`${jP}/${f}/liveswitch/event`,callRequest:f=>`${jP}/${f}/liveswitch/request-call`,liveSwitchToken:f=>`${jP}/${f}/liveswitch/token`},tP=f=>{const P={};return Yf(f)&&(P["x-authorization"]=`Bearer ${f}`),P},zP=f=>!yf(f.preform),wP=()=>l(xP.auth).then((f=>f.messenger.token)),DP=async(f,P)=>l(xP.signin,{method:s.POST,headers:tP(P),content:f?{key:f}:void 0}).then((f=>(localStorage.setItem("atkn",f.data.token),f.data))).catch((f=>Promise.reject(fP(f)?{isError:!0,type:PP.INTERNAL_SERVER_ERRORS}:f))),pP=async f=>l(xP.refreshToken,{headers:tP(f)}).then((f=>(localStorage.setItem("atkn",f.data.accessToken),f.data.accessToken))),dP=(f,P)=>l(xP.roomInfo(P),{headers:tP(f)}).then((f=>f.data)),TP=f=>l(xP.form(If.PostChat),{headers:tP(f)}),oP=(f,P,n)=>l(xP.formSubmit(n.type,0===P.length),{method:0===P.length?s.GET:s.POST,headers:tP(f),content:P.length>0?{data:P,room_id:n.type===If.PostChat?n.roomId:void 0}:void 0}).then((f=>n.type===If.PreChat?f.data.room_id:void 0)),BP=(f,P,n,A,e)=>l(xP.roomMessages(P),{method:s.POST,headers:tP(f),content:{msg:A,message_type:hf(e)?Wf.customerAttach:Wf.customer,files:e,sender_id:n,timestamp:(new Date).toISOString(),reply_id:null,replyMessage:null}}).then((f=>({id:f.data.id,files:f.data.files}))).catch((f=>Promise.reject($f(f)?{isError:!0,retryTimer:f.retry_after,type:PP.TOO_MANY_REQUESTS}:f))),gP=(f,P,n)=>l(xP.roomMessagesUpload(P),{method:s.POST,headers:tP(f),content:uP(n)}).then((f=>f.data.pop())),uP=f=>{const P=new FormData;return P.append("file",f),P},sP=(f,P)=>l(xP.room(P),{method:s.DELETE,headers:tP(f)}).then((f=>{if(fP(f))return Promise.reject({isError:!0,type:PP.ROOM_ALREADY_CLOSED})})).catch((f=>{if(fP(f))return Promise.reject({isError:!0,type:PP.ROOM_ALREADY_CLOSED})})),MP=(f,P,n,A)=>l(xP.mediaCallEvent(P),{method:s.POST,headers:tP(f),content:{channelId:n,type:A},keepalive:!0}),aP=(f,P,n)=>l(xP.callRequest(P),{method:s.POST,headers:tP(f),content:{msg:'{"type":1,"subtype":23}',message_type:1,sender_id:n,timestamp:(new Date).toISOString()},keepalive:!0}),lP=(f,P,n,A,e)=>l(xP.liveSwitchToken(P),{method:s.POST,headers:tP(f),content:{type:"register",userId:n,deviceId:A,clientId:e},keepalive:!0}).then((f=>f.data.token)),bP=1e4,GP=f=>{let P;return{start:(n,A)=>{const e=()=>{const H=vP(W(n).exp),v=H-Date.now()-bP;P=setTimeout((async()=>{n=await f(n),A(n),e()}),v)};e()},stop:()=>{clearTimeout(P)}}};class yP{constructor(f,P){(0,a.A)(this,"accessTokenGetter",void 0),(0,a.A)(this,"userId",void 0),(0,a.A)(this,"roomId",void 0),this.accessTokenGetter=f,this.userId=P}async getInitialRoomData(){const f=await dP(this.accessTokenGetter(),this.roomId);return{liveSwitch:f.liveswitch_channel,messages:f.messages,roomStatus:f.room.status,agent:f.manager}}submitPreForm(f){return oP(this.accessTokenGetter(),f,{type:If.PreChat}).then((f=>f))}submitPostForm(f){return oP(this.accessTokenGetter(),f,{type:If.PostChat,roomId:this.roomId}).then((()=>Promise.resolve()))}uploadFile(f){return gP(this.accessTokenGetter(),this.roomId,f)}sendMessage(f,P){return BP(this.accessTokenGetter(),this.roomId,this.userId,f,P)}sendMediaCallEvent(f,P){return MP(this.accessTokenGetter(),this.roomId,f,P)}sendCallRequest(){return aP(this.accessTokenGetter(),this.roomId,this.userId)}closeChat(){return sP(this.accessTokenGetter(),this.roomId)}}class YP extends yP{constructor(...f){super(...f),(0,a.A)(this,"receiver",void 0),(0,a.A)(this,"connectPromise",void 0),(0,a.A)(this,"state",void 0)}connect(f,P){this.roomId=f;const n=this.getInitialRoomData();return this.receiver=C(3e3,(()=>this.roomDataOperation(P))),this.connectPromise=n.then((f=>{this.state={agent:f.agent,liveSwitch:f.liveSwitch,lastMessageId:[...f.messages].pop().id},this.receiver.start()})),n}async disconnect(){return this.receiver.stop(),await this.connectPromise,Promise.resolve()}async roomDataOperation(f){var P,n;const A=await this.getInitialRoomData();if(A.roomStatus===Sf.closeAuto||A.roomStatus===Sf.closeCustomer||A.roomStatus===Sf.closeManager)return f.roomClosed(A.roomStatus),Promise.resolve();this.state.agent&&yf(A.agent)?f.agentDisconnected():yf(A.agent)||!yf(this.state.agent)&&A.agent.id===this.state.agent.id||f.agentUpdated(A.agent),this.state.liveSwitch&&yf(A.liveSwitch)?f.callUpdate("","","userTimeout"):yf(A.liveSwitch)||!yf(this.state.liveSwitch)&&(null===(P=A.liveSwitch)||void 0===P?void 0:P.channel_id)===(null===(n=this.state.liveSwitch)||void 0===n?void 0:n.channel_id)||f.callUpdate(A.liveSwitch.channel_id,A.liveSwitch.applicationId,"callInit");const e=[];return A.messages.reverse(),A.messages.every((f=>f.id!==this.state.lastMessageId&&(e.push(f),!0))),e.reverse(),e.forEach((P=>{f.newMessageReceived(P),this.state.lastMessageId=P.id,iP(P)})),Promise.resolve()}}const iP=f=>f.message_type===Wf.system&&f.msg.includes("User started the call");n(7467),n(4732),n(9577);const hP=f=>"pusher:connection_established"===f.event,CP=f=>"pusher:subscription_succeeded"===f.event,kP=f=>"mbss.pong"===f.event,mP={createSubscribeToChannelMessage:(f,P)=>({event:"pusher:subscribe",data:{auth:f,channel:P}}),createUnsubscribeFromChannelMessage:f=>({event:"pusher:unsubscribe",data:{channel:f}}),createPingSystemMessage:()=>{const f=new Uint8Array([9]);return f.buffer}},qP=async(f,P,n,A)=>l(f,{method:s.POST,headers:{"x-authorization":`Bearer ${A}`},content:new G({socket_id:P,channel_name:n})}),LP=()=>{const f=document.location.search;if(null!==f&&void 0!==f&&f.startsWith("?")){const P=f.substring(1).split("&").find((f=>0===f.toLowerCase().indexOf("mbssping")));if(void 0!==P){const[,f]=P.split("="),n=parseInt(f);return Number.isNaN(n)?2:n}}return 4},ZP=1e3*LP(),RP=f=>{let P;const n={opened:!1,socketId:void 0,channels:{},pinger:C(ZP,(()=>{const f=P.subscribe("message",(P=>{kP(P)&&f()}));return P.send(mP.createPingSystemMessage()),Promise.resolve()}))};return new Promise(((A,e)=>{const H=(c=!1)=>{P=new F(f.url),P.subscribeOnce("open",(()=>{var P;(n.pinger.start(),n.opened=!0,c)&&(null===(P=f.connectionRestored)||void 0===P||P.call(f))})),P.subscribe("close",(P=>{if(console.log(P),n.pinger.stop(),n.opened){if((P.code!==q.CLOSE_NORMAL||!P.wasClean)&&(f.connectionAbnormallyClosed(P),f.reconnectOnError)){H(!0);const f=Object.keys(n.channels);f.forEach((f=>{r(f,n.channels[f].channelAuthenticator)}))}}else!c&&e(P)}));const O=P.subscribe("message",(f=>{hP(f)&&(n.socketId=f.data.socket_id,O(),!c&&A(v))}));P.subscribe("message",(f=>{if(!hP(f)&&!kP(f)){const{event:P,channel:A,data:e}=f;if(!k(n.channels[A])){const f=n.channels[A].listeners[P];k(f)||f(e)}}}))},v={disconnect:()=>{P.close()},subscribeToChannel:async(f,P,A)=>{if(!k(n.channels[f]))throw new Error(`subscription to channel ${f} already exists or in progress`);return n.channels[f]={channelAuthenticator:A,listeners:P},r(f,A)},unsubscribeFromChannel:f=>(P.send(mP.createUnsubscribeFromChannelMessage(f)),delete n.channels[f],Promise.resolve())},r=(A,e)=>new Promise((H=>{const v=P.subscribe("message",(f=>{CP(f)&&f.channel===A&&(v(),H())})),r=m(e)?qP(f.authUrl,n.socketId,A,e()):Promise.resolve({auth:e.authToken});r.then((f=>{P.send(mP.createSubscribeToChannelMessage(f.auth,A))}))}));H()}))};class FP extends yP{constructor(f,P,n){super(f,P),(0,a.A)(this,"abnormalConnectionCloseHandler",void 0),(0,a.A)(this,"connectedClient",void 0),(0,a.A)(this,"connectPromise",Promise.resolve()),this.abnormalConnectionCloseHandler=n}async connect(f,P){return this.roomId=f,this.connectPromise=RP({url:UP(),authUrl:JP(),connectionAbnormallyClosed:f=>{this.abnormalConnectionCloseHandler(f)}}).then((f=>{this.connectedClient=f})),await this.connectPromise,await this.connectedClient.subscribeToChannel(`private-customer_room.${this.roomId}`,{"App\\Events\\Room\\ManagerConnectedEvent":f=>{f.manager.id===f.room.manager_id&&P.agentUpdated(f.manager)},"App\\Events\\Room\\ManagerDisconnectedEvent":()=>{P.agentDisconnected()},"App\\Events\\Room\\MessageNewEvent":f=>{P.newMessageReceived(f.message)},"App\\Events\\Room\\RoomChangeStatusEvent":f=>{switch(f.room.status){case Sf.closeCustomer:case Sf.closeManager:case Sf.closeAuto:P.roomClosed(f.room.status)}},"App\\Events\\Room\\UserTyping":()=>{P.agentTyping()},"App\\Events\\Room\\CallEvent":f=>{P.callUpdate(f.channelId,f.applicationId,f.type)}},this.accessTokenGetter),this.getInitialRoomData()}async disconnect(){return await this.connectPromise,this.connectedClient.disconnect(),Promise.resolve()}}const QP="app_key",UP=()=>["http:"===window.location.protocol?"ws:/":"wss:/",window.location.host,"support","app",QP].join("/"),JP=()=>[window.location.origin,"support","api/broadcasting/auth"].join("/");class NP extends Z{constructor(f,P){super(),(0,a.A)(this,"activeTransport",void 0),(0,a.A)(this,"mainTransport",void 0),(0,a.A)(this,"fallbackTransport",void 0),(0,a.A)(this,"operationBatcher",h({executeAmount:1})),(0,a.A)(this,"mainTransportReconnector",C(3e3,(()=>this.reconnectMainTransport()))),(0,a.A)(this,"roomId",void 0),(0,a.A)(this,"listeners",void 0),(0,a.A)(this,"submitPostForm",void 0),(0,a.A)(this,"submitPreForm",void 0),(0,a.A)(this,"uploadFile",void 0),(0,a.A)(this,"sendMessage",void 0),(0,a.A)(this,"sendMediaCallEvent",void 0),(0,a.A)(this,"sendCallRequest",void 0),(0,a.A)(this,"closeChat",void 0),this.mainTransport=new FP(f,P,(async f=>{this.emit("reconnect",await this.onMainTransportConnectionLost(f))})),this.fallbackTransport=new YP(f,P),this.activeTransport=this.mainTransport,this.registerDirectCalls()}async connect(f,P){return this.roomId=f,this.listeners=P,this.mainTransport.connect(f,P).catch((f=>this.onMainTransportConnectionLost(f)))}disconnect(){if(this.activeTransport===this.mainTransport)return this.mainTransport.disconnect();this.mainTransportReconnector.stop();const f=[this.fallbackTransport.disconnect()];return this.mainTransportReconnector.isOperationExecuting()&&f.push(this.mainTransport.disconnect()),Promise.all(f).then((()=>Promise.resolve()))}async onMainTransportConnectionLost(f){console.log("Lost connection with Main Transport. Switching to fallback API"),console.log("WS CloseEvent code -> "+f.code),o({phase:"socket_connection",reason:"lost"}),this.activeTransport=this.fallbackTransport,this.registerDelayedCalls();const P=await new Promise((f=>{const P=C(5e3,(()=>this.fallbackTransport.connect(this.roomId,this.listeners).then((n=>{P.stop(),f(n)})).catch((f=>{console.log("failed attempt to connect to Fallback Transport"),console.log(f)}))));P.start()}));return this.registerDirectCalls(),console.log("Switched to fallback API"),this.mainTransportReconnector.start(),Ef(P.roomStatus)?this.operationBatcher.clear():this.operationBatcher.start(),P}reconnectMainTransport(){return console.log("Attempt to restore MainTransport Connection"),this.mainTransport.connect(this.roomId,this.listeners).then((()=>{if(this.mainTransportReconnector.isStopped())return console.log("Disconnecting MainTransport due to Master->disconnect Api Call"),this.mainTransport.disconnect();o({phase:"socket_connection",reason:"connected"}),this.activeTransport=this.mainTransport,this.fallbackTransport.disconnect(),console.log("MainTransport Connection restored"),this.mainTransportReconnector.stop()})).catch((f=>{console.log("Failed attempt to restore MainTransport Connection"),console.log(f)}))}registerDirectCalls(){this.submitPostForm=this.createApiProxy("submitPostForm"),this.submitPreForm=this.createApiProxy("submitPreForm"),this.uploadFile=this.createApiProxy("uploadFile"),this.sendMessage=this.createApiProxy("sendMessage"),this.sendMediaCallEvent=this.createApiProxy("sendMediaCallEvent"),this.sendCallRequest=this.createApiProxy("sendCallRequest"),this.closeChat=this.createApiProxy("closeChat")}createApiProxy(f){return function(){return console.log(`Executing Transport method "${f}"`),this.activeTransport[f].call(this.activeTransport,...arguments)}.bind(this)}registerDelayedCalls(){this.submitPostForm=this.createDelayedCall("submitPostForm"),this.submitPreForm=this.createDelayedCall("submitPreForm"),this.uploadFile=this.createDelayedCall("uploadFile"),this.sendMessage=this.createDelayedCall("sendMessage"),this.sendMediaCallEvent=this.createDelayedCall("sendMediaCallEvent"),this.sendCallRequest=this.createDelayedCall("sendCallRequest"),this.closeChat=this.createDelayedCall("closeChat")}createDelayedCall(f){return function(){const P=arguments,n=this,A=this.createApiProxy(f);return console.log('Operation "'+f+'" is delayed while FallbackTransport is not connected'),new Promise((f=>{this.operationBatcher.addOperations([()=>A.call(n,...P).then(f)])}))}.bind(this)}}const KP=()=>({agentUpdated:()=>{},agentDisconnected:()=>{},agentTyping:()=>{},callUpdate:()=>{},newMessageReceived:()=>{}});class VP{constructor(f,P,n){(0,a.A)(this,"accessToken",void 0),(0,a.A)(this,"isConnected",!1),(0,a.A)(this,"roomEventListeners",KP()),(0,a.A)(this,"stateChangeHandler",(()=>{})),(0,a.A)(this,"roomState",{type:_f.None}),(0,a.A)(this,"tokenRefreshService",GP(pP)),(0,a.A)(this,"masterTransport",void 0),(0,a.A)(this,"roomId",void 0),(0,a.A)(this,"analyticsState",{firstAgentMessageReceived:!1,firstCustomerMessageReceived:!1,firstCustomerMessageSent:!1}),this.accessToken=f,this.tokenRefreshService.start(f,(f=>{this.accessToken=f})),this.masterTransport=new NP((()=>this.accessToken),P),this.masterTransport.subscribe("reconnect",(f=>{this.processConnectedRoomData(f)})),"number"===typeof n?(this.roomId=n,this.connectToRoom()):this.setState({type:_f.PreForm,preform:n})}destroy(){this.tokenRefreshService.stop(),this.setStateChangeHandler((()=>{})),this.roomEventListeners=KP()}setStateChangeHandler(f){this.stateChangeHandler=f,f(this.roomState)}listenEvents(f){this.roomEventListeners=f}async submitForm(f){const P=[],n=f.map((f=>(P.push({question:f.phrase,answer:f.answer.phrase}),{question_id:f.id,answer_index:f.answer.answerIndex})));return this.roomState.type===_f.PostForm?(await this.masterTransport.submitPostForm(n),this.setState({type:_f.Closed}),o({phase:"popup-support_chat-postchat-answer",answers:P,roomId:this.roomId}),Promise.resolve()):(this.roomId=await this.masterTransport.submitPreForm(n),o({phase:"popup-support_chat-prechat-answer",answers:P,roomId:this.roomId}),this.connectToRoom())}async sendMessage(f,P){this.analyticsState.firstCustomerMessageSent||(o({phase:"first_user_message",message:f,room_id:this.roomId}),this.analyticsState.firstCustomerMessageSent=!0);const n=[];for(const e of P||[])n.push(this.masterTransport.uploadFile(e));const A=await Promise.all(n);return this.masterTransport.sendMessage(f,A)}async closeChat(){return this.masterTransport.closeChat()}async sendMediaCallEvent(f,P){return this.masterTransport.sendMediaCallEvent(f,P)}async sendCallRequest(){return this.masterTransport.sendCallRequest()}async connectToRoom(){if(this.isConnected)return;const f=await this.masterTransport.connect(this.roomId,{agentUpdated:f=>{this.analyticsState.lastAgent=f,o({phase:"operator_joined",operator_id:f.id,room_id:this.roomId}),this.roomEventListeners.agentUpdated(HP(f))},agentDisconnected:()=>{var f;o({phase:"operator_left",operator_id:null===(f=this.analyticsState.lastAgent)||void 0===f?void 0:f.id,room_id:this.roomId}),this.roomEventListeners.agentDisconnected()},newMessageReceived:f=>{var P;f.message_type!==Wf.manager&&f.message_type!==Wf.managerAttach||this.analyticsState.firstAgentMessageReceived||(o({phase:"first_operator_message",message:f.msg,operator_id:null===(P=this.analyticsState.lastAgent)||void 0===P?void 0:P.id,room_id:this.roomId}),this.analyticsState.firstAgentMessageReceived=!0);f.message_type!==Wf.customer&&f.message_type!==Wf.customerAttach||this.analyticsState.firstCustomerMessageReceived||(o({phase:"first_user_message_received",message:f,room_id:this.roomId}),this.analyticsState.firstCustomerMessageReceived=!0),this.roomEventListeners.newMessageReceived(eP(f))},roomClosed:async f=>{this.processClosedRoomStatus(f)},callUpdate:(f,P,n)=>{this.roomEventListeners.callUpdate(f,P,n,this.roomId)},agentTyping:()=>{this.roomEventListeners.agentTyping()}});this.isConnected=!0,this.processConnectedRoomData(f)}async processConnectedRoomData(f){if(Ef(f.roomStatus))this.processClosedRoomStatus(f.roomStatus);else{const P={type:_f.ActiveRoom,messages:f.messages.map(eP),liveSwitch:f.liveSwitch};yf(f.agent)||(o({phase:"operator_joined",operator_id:f.agent,room_id:this.roomId}),P.agent=HP(f.agent)),this.setState(P),o({phase:"room_created",room_id:this.roomId})}}async processClosedRoomStatus(f){var P;this.masterTransport.disconnect(),this.isConnected=!1;const n=await TP(this.accessToken);yf(n.data)?this.setState({type:_f.Closed}):this.setState({type:_f.PostForm,postform:n.data}),o({phase:f===Sf.closeAuto?"room_timeout":f===Sf.closeCustomer?"user_closed_room":"operator_closed_room",operator_id:null===(P=this.analyticsState.lastAgent)||void 0===P?void 0:P.id,room_id:this.roomId})}setState(f){this.roomState=f,this.stateChangeHandler(f)}}const IP=(f,P)=>DP(f,P).then((f=>new VP(f.token,f.user.id,zP(f)?AP(f.preform):f.room_id))),WP=f=>f.type!==Wf.system,SP=f=>f.subtype===Vf.managerTransferToManager;var EP,_P,$P;(function(f){f[f["ONLINE"]=0]="ONLINE",f[f["TEMPORARY_OFFLINE"]=1]="TEMPORARY_OFFLINE",f[f["OFFLINE"]=2]="OFFLINE"})(EP||(EP={})),function(f){f[f["SupportAgent"]=0]="SupportAgent",f[f["FormAnswerOption"]=1]="FormAnswerOption",f[f["Customer"]=2]="Customer",f[f["Technical"]=3]="Technical",f[f["Call"]=4]="Call",f[f["System"]=5]="System"}(_P||(_P={})),function(f){f[f["Sending"]=0]="Sending",f[f["Sent"]=1]="Sent",f[f["SentFailed"]=2]="SentFailed",f[f["Delivered"]=3]="Delivered",f[f["Read"]=4]="Read"}($P||($P={}));const fn={[Vf.chatCreatedByUser]:"MBSS.chat_create",[Vf.chatCloseAuto]:"MBSS.chat_close_auto",[Vf.chatCloseByManager]:"MBSS.chat_close_manager",[Vf.chatCloseByCustomer]:"MBSS.chat_close_customer",[Vf.managerConnected]:"MBSS.manager_connected",[Vf.managerDisconnected]:"MBSS.manager_disconnected",[Vf.managerTransferToLine]:"MBSS.manager_transfer_to_line",[Vf.managerTransferToManager]:"MBSS.manager_transfer_to_manager",[Vf.customerLiked]:"MBSS.customer_liked",[Vf.findManager]:"MBSS.find_manager",[Vf.findWaitManager]:"MBSS.find_wait_manager",[Vf.customerDisliked]:"MBSS.customer_disliked",[Vf.liveswitchCallInit]:"MBSS.liveswitch_call_init",[Vf.liveswitchUserAccept]:"MBSS.liveswitch_user_accept",[Vf.liveswitchUserTimeout]:"MBSS.liveswitch_user_timeout",[Vf.liveswitchUserReject]:"MBSS.liveswitch_user_reject",[Vf.liveswitchUserLeave]:"MBSS.liveswitch_user_leave",[Vf.liveswitchSupportLeave]:"MBSS.liveswitch_support_leave",[Vf.liveswitchCallRequest]:"MBSS.call_request"},Pn=f=>f.type===Wf.customer||f.type===Wf.customerAttach,nn=f=>{if(k(Wf[f.type]))return console.error("unknown message type ",f.type,f),!1;if(f.type===Wf.system){const P=f.subtype;if(k(Vf[P]))return console.error("unknown system message type ",P,f),!1}return!0},An=f=>f.replace(/"/g,'"'),en=(f,P,n)=>{if(WP(f)&&Pn(f))return{content:An(f.content),files:f.files,createdAt:f.createdAt,id:f.id,type:_P.Customer,status:P};if(f.type===Wf.manager||f.type===Wf.managerAttach)return{content:An(f.content),files:f.files,createdAt:f.createdAt,id:f.id,type:_P.SupportAgent,agentDetails:{avatarUrl:f.agentDetails.avatarUrl,name:f.agentDetails.name}};if(f.type===Wf.primary)return{id:f.id,type:_P.Technical,createdAt:f.createdAt,content:An(f.content)};if(f.type===Wf.system){const P=f=>{const P=fn[f.subtype];if(f.subtype===Vf.chatCloseByCustomer||f.subtype===Vf.chatCloseByManager||f.subtype===Vf.chatCreatedByUser||f.subtype===Vf.managerConnected||f.subtype===Vf.managerDisconnected){const A=[void 0,null,"guest"].includes(f.name);return A?`${n("MBSS.guest")} ${n(P)}`:n(P,{name:f.name})}return SP(f)?n(P,{from:f.from,to:f.to}):P?n(P):""};return{id:f.id,type:_P.System,createdAt:f.createdAt,content:P(f)}}if(f.type===Wf.callConnect||f.type===Wf.callDisconnect)return{id:f.id,type:_P.Call,content:An(f.content),createdAt:f.createdAt};throw new Error("unregistered Message type : "+f.type+". "+JSON.stringify(f))};var Hn=JSON.parse('{"MS":"https://cloud.liveswitch.io"}');let vn;const rn=Hn.MS,cn=()=>{const f=(0,j.KR)(null),P=(0,j.KR)(NaN),A=(0,j.KR)(null),e=(0,j.KR)(!1),H=(0,j.KR)(1e3),v=(0,j.KR)(6e4),r=(0,j.KR)(null),c=(0,j.KR)(null),O=(0,j.KR)(null),X=(0,j.KR)(),x=(0,j.KR)({}),t=(0,j.KR)(null);let z;const w=(0,j.KR)(null),D=(0,j.KR)(null),p=(0,j.KR)(null),d=(0,j.KR)([]),T=(0,j.KR)([]),o=(0,j.KR)([]),B=(0,j.KR)();let g=null;const u=P=>(f.value=new g.Client(rn,P),f.value),s=async()=>{const n=localStorage.getItem("atkn"),A=f.value||{},e=A.getUserId(),H=A.getDeviceId(),v=A.getId(),r=await lP(String(n),P.value,e,H,v);return r},M=f=>{A.value=f[0],console.log("CHANNEL",A.value),A.value.addOnRemoteUpstreamConnectionOpen((f=>{console.log("An upstream connection opened."),l(f)})),X.value=a(r.value),console.log("upstreamConnection.value",X.value);for(const P of A.value.getRemoteUpstreamConnectionInfos())l(P)},a=f=>{const P=new g.AudioStream(f),n=new g.VideoStream(f),e=B.value?A.value.createSfuUpstreamConnection(P,n):A.value.createSfuUpstreamConnection(P);e.addOnStateChange((P=>{console.log(`Upstream connection is ${new g.ConnectionStateWrapper(P.getState()).toString()}.`);const n=P.getState();n===g.ConnectionState.Closing||n===g.ConnectionState.Failing?P.getRemoteClosed()&&console.log(`Upstream connection ${P.getId()} was closed`):n===g.ConnectionState.Failed&&a(f)}));const H=e.getConfig();return H.setLocalAudioMuted(!0),H.setLocalVideoMuted(!0),e.update(H),e.open(),e},l=f=>{const P=new g.RemoteMedia,n=new g.AudioStream(P);console.log("remoteConnectionInfo",f);const e=new g.DomLayoutManager(document.getElementById("remote"));e.addRemoteMedia(P),console.log("lManager",e);const H=A.value.createSfuDownstreamConnection(f,n);return x.value[H.getId()]=H,console.log("downstream connections -> "+Object.keys(x.value)),H.addOnStateChange((f=>{console.log(`Downstream connection is ${new g.ConnectionStateWrapper(f.getState()).toString()}.`),f.getState()!==g.ConnectionState.Closing&&f.getState()!==g.ConnectionState.Failing||(delete x.value[H.getId()],t.value.removeRemoteMedia(P),P.destroy())})),H.open(),H},b=(f,A)=>n.e(832).then(n.t.bind(n,479,23)).then((n=>(g=n,P.value=A,new Promise((P=>{h().then((()=>{C(f).then((()=>{G().then((()=>{z=Date.now(),P()}))}))}))}))))),G=()=>Promise.all([new Promise((f=>{y().then((P=>{w.value=P;for(const[f,n]of P.entries())d.value.push({label:n.getName(),value:f});f()}))})),new Promise((f=>{i().then((P=>{D.value=P;for(const[f,n]of P.entries())T.value.push({label:n.getName(),value:f});f()}))})),new Promise((f=>{Y().then((P=>{p.value=P;for(const[f,n]of P.entries())o.value.push({label:n.getName(),value:f});f()}))}))]),y=()=>{var f;return null===(f=r.value)||void 0===f?void 0:f.getAudioInputs()},Y=()=>{var f;return null===(f=r.value)||void 0===f?void 0:f.getVideoInputs()},i=()=>new g.RemoteMedia(!0,!1).getAudioSinkOutputs(),h=async()=>{const f=()=>new Promise((f=>{navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((function(P){console.log("Video stream data",{stream:P}),P.getVideoTracks().forEach((f=>{f.stop()})),f(!0)})).catch((function(){f(!1)}))}));return t.value=new g.DomLayoutManager(document.getElementById("liveswitch")),null===r.value&&(B.value=await f(),r.value=new g.LocalMedia(!0,B.value),t.value.setLocalMedia(r.value)),new Promise(((f,P)=>{r.value.start().then((()=>{console.log("Media capture started."),f()})).fail((f=>{console.log(f.message),P(f)}))}))},C=async P=>{u(P);const n=new g.Promise,A=await s();return e.value=!1,f.value.addOnStateChange((()=>{console.log(`Client is ${String(new g.ClientStateWrapper(f.value.getState()))}.`),f.value.getState()!==g.ClientState.Unregistered||e.value||(console.log(`Registering with backoff = ${H.value}.`),setTimeout((()=>{H.value<=v.value&&(H.value+=H.value),f.value.register(A).then((f=>{H.value=200,M(f),n.resolve(null)})).fail((f=>{console.log("Failed to register with Gateway."),n.reject(f)}))}),H.value))})),f.value.register(A).then((f=>{M(f),n.resolve(null)})).fail((f=>{console.log("Failed to register with Gateway."),n.reject(f)})),n},k=()=>q((f=>f.setLocalAudioMuted(!f.getLocalAudioMuted()))).then((f=>Promise.resolve(f.getLocalAudioMuted()))),m=()=>q((f=>f.setLocalVideoMuted(!f.getLocalVideoMuted()))).then((f=>Promise.resolve(f.getLocalVideoMuted()))),q=f=>{const P=X.value.getConfig();return f(P),new Promise((f=>{X.value.update(P).then((()=>{f(P)}))}))},L=()=>Z().then((()=>{const f=X.value?X.value.close():Promise.resolve(),P=Promise.all(Object.values(x.value).map((f=>f.close())));return Promise.all([f,P])})).then((()=>(console.log("All connections closed."),R()))).then((()=>(F(),Promise.resolve()))),Z=()=>new Promise(((f,P)=>{r.value?(console.log(r.value),r.value.stop().then((()=>{console.log("Media capture stopped."),r.value=null,f()})).fail((f=>{console.log("Failed to stop media capture:",f.message),P(f)}))):(console.log("No local media to stop."),f())})),R=()=>{var P;return e.value=!0,null===(P=f.value)||void 0===P?void 0:P.unregister().fail((()=>g.Log.error("Unregistration failed.")))},F=()=>{w.value=null,D.value=null,p.value=null,d.value=[],T.value=[],o.value=[],z=0},Q=()=>{O.value||(O.value=new g.LocalMedia(!1,!0,!0)),console.log("screenSharingUpstreamConnection",c),console.log("localScreenMedia",O.value.getState()),console.log("ls.LocalMediaState",g.LocalMediaState),O.value.getState()===g.LocalMediaState.New||r.value.getState()===g.LocalMediaState.Stopped?U():J()},U=()=>{O.value.start().then((()=>{console.log("Screen capture started."),c.value=a(O.value),console.log("screenSharingUpstreamConnection",c)})).fail((()=>{console.log("Screen capture could not be started.")})),t.value.addRemoteMedia(O.value)},J=()=>{c.value.close().then((()=>{O.value.stop(),t.value.removeRemoteMedia(O.value),O.value=null}))};return{runLocalMedia:b,leaveLocalMedia:L,toggleMuteLocalAudio:k,toggleMuteLocalVideo:m,toggleScreenSharing:Q,getMeta:()=>({startTimeStamp:z})}};function On(){return vn||(vn=cn()),vn}function jn(){const f=(0,j.KR)(navigator.onLine),P=(0,j.KR)(0),n=(0,j.KR)(EP.ONLINE),A=parseInt("20");let e;const v=()=>{e||(e=setInterval((()=>{P.value++}),1e3))},r=()=>{clearInterval(e),e=void 0},c=()=>{if(f.value=navigator.onLine,navigator.onLine)return P.value=0,void r();v()};return(0,H.sV)((()=>{window.addEventListener("online",c),window.addEventListener("offline",c)})),(0,H.hi)((()=>{window.removeEventListener("online",c),window.removeEventListener("offline",c),r()})),(0,H.wB)([f,P],(([f,P])=>{n.value=!f&&P>=A?EP.OFFLINE:!f&&PKf(f)&&f.type===Ff.ActiveRoom,xn=f=>f.filter((f=>f.preForm)).length>0,tn=f=>f.reduce(((f,P)=>(P.preForm?P.answers.forEach((n=>{f.push({id:`${P.id}-question-${n.question}`,type:Wf.primary,content:n.question,createdAt:P.createdAt}),f.push({id:`${P.id}-answer-${n.answer}`,type:Wf.customer,content:n.answer,createdAt:P.createdAt})})):f.push(P),f)),[]),zn=(0,O.nY)("support-chat-store",(()=>{const f=(0,j.KR)(Rf()),P=[],n=jn(),A=(0,j.KR)({isError:!1,type:null}),e=(0,j.KR)(void 0);let v;const r=(0,X.s9)(),c=(f,P)=>r.t(f,P||{}),O=P=>{var n;if(P!==EP.OFFLINE)return;const A=f.value;A.messages=null===(n=A.messages)||void 0===n?void 0:n.map((f=>"status"in f&&f.status===$P.Sending?{...f,status:$P.SentFailed}:f))},x=n=>{let A,H=!1;v=n,n.setStateChangeHandler((P=>{if(P.type===_f.PreForm)f.value={type:Ff.PreForm,formId:P.preform.id,questions:P.preform.questions};else if(P.type===_f.ActiveRoom){const n=e.value;n&&i(n.content);const A=yf(P.agent)?void 0:{...P.agent,isTyping:!1},v=yf(P.liveSwitch)?void 0:{type:P.liveSwitch.status,channelId:P.liveSwitch.channel_id,applicationId:P.liveSwitch.applicationId},r=xn(P.messages)?tn(P.messages.filter(nn)).map((f=>en(f,$P.Delivered,c))):P.messages.filter(nn).map((f=>en(f,$P.Delivered,c))),O={type:Ff.ActiveRoom,agent:A,messages:r};v&&(O.call=v),f.value=O,H=!0}else P.type===_f.PostForm?f.value={type:Ff.PostForm,formId:P.postform.id,messages:[...s.value],questions:P.postform.questions}:P.type===_f.Closed&&(n.destroy(),f.value={type:Ff.ClosedRoom,messages:[...s.value]})})),n.listenEvents({newMessageReceived:n=>{if(H){const A=f.value;if(Pn(n)){const f=f=>({id:e})=>{if(e!==n.id)return;const H=A.messages.findIndex((f=>f.id===n.id)),v=A.messages[H];v.status=$P.Delivered,A.messages=[...A.messages.slice(0,H),v,...A.messages.slice(H+1)],P.splice(P.indexOf(f),1)},e=f=>n=>{console.error("Ошибка при отправке сообщения ",n),P.splice(P.indexOf(f),1)};P.forEach((P=>P.then(f(P)).catch(e(P))))}else nn(n)&&A.messages.push(en(n,$P.Delivered,c))}},agentUpdated:P=>{f.value.agent={...P,isTyping:!1}},agentDisconnected:()=>{delete f.value.agent},agentTyping:()=>{f.value.agent.isTyping=!0,clearTimeout(A),A=setTimeout((()=>{Xn(f.value)&&f.value.agent&&(f.value.agent.isTyping=!1)}),3e3)},callUpdate:async(P,n,A,e)=>{const H=f.value;if("callInit"===A&&(H.call={applicationId:n,channelId:P,type:Qf.IncomingCall}),"userAccept"===A&&(await On().runLocalMedia(H.call.applicationId,Number(e)),H.call.type=Qf.ActiveCall),"supportLeave"===A||"userLeave"===A){if(!H.call)return;H.call.type===Qf.ActiveCall&&On().leaveLocalMedia(),delete H.call}"userReject"!==A&&"userTimeout"!==A||delete H.call}})},t=(0,H.EW)((()=>Uf(f.value))),z=(0,H.EW)((()=>Jf(f.value))),w=(0,H.EW)((()=>Nf(f.value))),D=(0,H.EW)((()=>Kf(f.value))),p=(0,H.EW)((()=>!0===f.value.closing)),d=(0,H.EW)((()=>Kf(f.value)&&f.value.type===Ff.ClosedRoom)),T=(0,H.EW)((()=>Xn(f.value))),B=(0,H.EW)((()=>Kf(f.value)&&f.value.type===Ff.PreForm)),g=(0,H.EW)((()=>Kf(f.value)&&f.value.type===Ff.PostForm)),u=(0,H.EW)((()=>f.value.agent)),s=(0,H.EW)((()=>f.value.messages)),M=(0,H.EW)((()=>f.value.questions)),a=(0,H.EW)((()=>f.value.call)),l=(0,H.EW)((()=>A.value)),b=(0,H.EW)((()=>e.value));(0,H.wB)(n,(f=>{O(f)}));const G=async P=>{m(),f.value={loading:!0,error:!1};const n=P?void 0:K();return IP(n,P?await wP():void 0).then((f=>{x(f)})).catch((P=>{P.type===PP.INTERNAL_SERVER_ERRORS&&(A.value={isError:P.isError,type:PP.INTERNAL_SERVER_ERRORS}),o({phase:"channel_unavailable"}),f.value={error:!0}}))},y=async P=>{const n=f.value;return f.value.closing=!0,v.submitForm(P.map((f=>{const P=n.questions.find((P=>P.id===f.questionId));return{id:P.id,phrase:P.question,answer:{answerIndex:f.optionIndex,phrase:P.answers[f.optionIndex]}}})))},Y=async n=>{const{id:A,content:e,fileBlobs:H}=n,r=f.value;let c=r.messages.findIndex((({id:f})=>f===A));const O={...r.messages[c],status:$P.Sending};r.messages=[...r.messages.slice(0,c),...r.messages.slice(c+1),O],c=r.messages.length-1;const j=v.sendMessage(e,H);P.push(j);const X=({id:f,files:P})=>{O.id=f,O.files=P,O.status=$P.Sent,r.messages=[...r.messages.slice(0,c),...r.messages.slice(c+1),O]},x=f=>{console.error("Ошибка при отправке сообщения:",f)};return j.then(X).catch(x)},i=(n,H)=>{const r=f.value,c={type:_P.Customer,status:$P.Sending,createdAt:(new Date).getTime(),id:`temp_msg_identity_${Date.now()}`,content:n,fileBlobs:H,files:Array(...H||[]).map((f=>({id:f.name,name:f.name,url:URL.createObjectURL(f)})))};r.messages=[...r.messages||[],c];const O=v.sendMessage(n,H);P.push(O);const j=({id:P,files:n})=>{const A=f.value;c.id=P,c.files=n,c.fileBlobs=void 0,c.status=$P.Sent;const H=A.messages.indexOf(c);return A.messages=-1!==H?[...A.messages.slice(0,H),c,...A.messages.slice(H+1)]:[...A.messages,c],e.value=void 0,Promise.resolve()},X=f=>{f.type===PP.TOO_MANY_REQUESTS&&(A.value={isError:f.isError,type:PP.TOO_MANY_REQUESTS,retryTimer:f.retryTimer}),console.error("Ошибка при отправке сообщения:",f)};return O.then(j).catch(X)},h=()=>{const P=f.value;P.messages=[]},C=async()=>{const P=f.value;P.closing=!0,v.closeChat().then().catch((f=>{f.type===PP.ROOM_ALREADY_CLOSED&&(A.value={isError:f.isError,type:PP.ROOM_ALREADY_CLOSED})}))},k=f=>{e.value=f},m=()=>{A.value={isError:!1,type:null}},q=()=>{v.sendCallRequest()},L=()=>{v.sendMediaCallEvent(f.value.call.channelId,"userAccept")},Z=()=>{v.sendMediaCallEvent(f.value.call.channelId,"userLeave")},R=()=>v.sendMediaCallEvent(f.value.call.channelId,"userReject");return{isInitialState:t,isLoadingState:z,isConnectionErrorState:w,isSignedInState:D,isClosingRoom:p,isClosedRoomState:d,isActiveRoomState:T,isPreFormState:B,isPostFormState:g,getAgentInfo:u,getActiveRoomMessages:s,getFormStateQuestions:M,getCallInfo:a,getNetworkStatusType:n,getErrorState:l,getTransactionMessage:b,init:G,submitForm:y,sendMessage:i,resendMessage:Y,closeChat:C,sendRequestForCall:q,acceptCall:L,leaveCall:Z,rejectCall:R,clearMessageHistory:h,prependMessage:k}}));function wn(f,P,n,A,e,r){const c=(0,H.g2)("ActionButton");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["wrap"],{[A.styles["withoutOpacity"]]:n.isRoomAlreadyClosedError}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["content"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["text"])},(0,v.v_)(A.errorText),3)],2),n.isInternalError||n.isRoomAlreadyClosedError?((0,H.uX)(),(0,H.Wv)(c,{key:0,class:(0,v.C4)(A.styles["button"]),id:f.$globalElementIdRegistry.bottomActionButton,text:A.restoreChatText,disabled:A.getNetworkStatusType!==A.NetworkStatus.ONLINE,onActionEmit:A.onActionButtonClick},null,8,["class","id","text","disabled","onActionEmit"])):(0,H.Q3)("",!0)],2)}var Dn={wrap:"LkCS41JnjpgdErrEu6QY",withoutOpacity:"RlYlQmA3D3YgM88jyFpv",content:"Y6xJraIjcZ02Mo3eiPzE",text:"q2ouO8QeB14NjGd82wUh",button:"VbPFjgjAlMFpPAVMzfg8"};function pn(f,P,n,A,e,r){const c=(0,H.g2)("CommonButton");return(0,H.uX)(),(0,H.Wv)(c,{class:(0,v.C4)([A.styles["button"],{[A.styles["disabled"]]:n.disabled}]),disabled:n.disabled,text:n.text,onCustomClick:P[0]||(P[0]=P=>f.$emit("actionEmit"))},null,8,["class","disabled","text"])}var dn={button:"xkh8xxEy0RcRFlv1vF8H",disabled:"qwurHul6Jg0wbmRxHB1E"},Tn={name:"action-button",props:{text:{type:String,required:!0},disabled:{type:Boolean,required:!0}},components:{CommonButton:Tf},emits:["actionEmit"],setup(){return{styles:dn}}};const on=(0,tf.A)(Tn,[["render",pn]]);var Bn=on,gn={name:"connection-error",components:{ActionButton:Bn,CommonButton:Tf},emits:["initChat"],props:{isInternalError:Boolean,isRoomAlreadyClosedError:Boolean},setup(f,P){const n=(0,X.s9)(),A=(0,j.KR)(EP),e=zn(),{getNetworkStatusType:v}=(0,O.bP)(e),r=n.t("MBSS.restore_chat"),c=(0,H.EW)((()=>f.isInternalError?n.t("MBSS.internal_error"):f.isRoomAlreadyClosedError?n.t("MBSS.room_already_closed_error"):n.t("MBSS.support_signin_tma"))),x=()=>{P.emit("initChat")};return{styles:Dn,errorText:c,restoreChatText:r,NetworkStatus:A,getNetworkStatusType:v,onActionButtonClick:x}}};const un=(0,tf.A)(gn,[["render",wn]]);var sn=un;const Mn=["id"],an=["id"];function ln(f,P,n,A,e,r){const c=(0,H.g2)("Icon"),O=(0,H.g2)("CommonButton"),j=(0,H.g2)("ConfirmationForm");return(0,H.uX)(),(0,H.CE)(H.FK,null,[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["actionBar"])},[(0,H.bF)(c,{id:f.$globalElementIdRegistry.avatarManager,"icon-url":A.agentDetails.iconUrl,"icon-name":A.agentDetails.icon,class:(0,v.C4)(A.styles["logoContainer"]),size:"size-44"},null,8,["id","icon-url","icon-name","class"]),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["agentInfo"])},[(0,H.Lk)("span",{id:f.$globalElementIdRegistry.actionBarHeading,class:(0,v.C4)([A.styles["agentName"],{[A.styles["managerConnected"]]:void 0!==A.getAgentInfo}])},(0,v.v_)(A.agentDetails.name),11,Mn),A.getNetworkStatusType===A.NetworkStatus.ONLINE?((0,H.uX)(),(0,H.CE)("span",{key:0,class:(0,v.C4)(A.styles["additionalInfo"])},(0,v.v_)(A.agentDetails.info),3)):(0,H.Q3)("",!0),A.getNetworkStatusType!==A.NetworkStatus.OFFLINE||A.isActiveCall?(0,H.Q3)("",!0):((0,H.uX)(),(0,H.CE)("div",{key:1,class:(0,v.C4)(A.styles["offlinePanel"])},[(0,H.bF)(c,{"icon-name":"wifi-off"}),(0,H.eW)(" "+(0,v.v_)(A.infoNetworkIsOffline),1)],2)),A.getNetworkStatusType!==A.NetworkStatus.ONLINE?((0,H.uX)(),(0,H.CE)("span",{key:2,class:(0,v.C4)({[A.styles["infoTemporaryOffline"]]:A.getNetworkStatusType===A.NetworkStatus.TEMPORARY_OFFLINE,[A.styles["infoOffline"]]:A.getNetworkStatusType===A.NetworkStatus.OFFLINE})},[(0,H.Lk)("span",null,(0,v.v_)(A.agentDetails.offline),1)],2)):(0,H.Q3)("",!0)],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["spacer"])},null,2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["control"])},[void 0!==A.getAgentInfo?((0,H.uX)(),(0,H.CE)("button",{key:0,id:f.$globalElementIdRegistry.callButtonInActionBar,ref:"callButton",class:(0,v.C4)(A.styles["callButton"]),onClick:P[0]||(P[0]=f=>A.isTooltipVisible=!0)},[(0,H.bF)(c,{"icon-name":"phone",size:"size-24"})],10,an)):(0,H.Q3)("",!0),A.isTooltipVisible?((0,H.uX)(),(0,H.CE)("div",{key:1,ref:"tooltip",class:(0,v.C4)(A.styles["tooltip"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["triangle"])},null,2),(0,H.Lk)("h4",{class:(0,v.C4)(A.styles["tooltipTitle"])},(0,v.v_)(A.tooltipTitle),3),(0,H.Lk)("p",{class:(0,v.C4)(A.styles["tooltipText"])},(0,v.v_)(A.tooltipText),3),(0,H.Lk)("footer",{class:(0,v.C4)(A.styles["tooltipFooter"])},[(0,H.bF)(O,{id:f.$globalElementIdRegistry.cancelCallButtonInActionBar,class:(0,v.C4)([A.styles["button"],A.styles["cancel"]]),text:A.tooltipCancel,onClick:A.closeTooltip},null,8,["id","class","text","onClick"]),(0,H.bF)(O,{id:f.$globalElementIdRegistry.requestButtonInActionBar,class:(0,v.C4)([A.styles["button"],A.styles["confirm"]]),text:A.tooltipConfirm,onClick:A.sendCallRequest},null,8,["id","class","text","onClick"])],2)],2)):(0,H.Q3)("",!0),A.isActiveRoomState?((0,H.uX)(),(0,H.Wv)(O,{key:2,id:f.$globalElementIdRegistry.closeChatButton,class:(0,v.C4)(A.styles["closeChatButton"]),text:f.$t("MBSS.close_chat"),disabled:A.getNetworkStatusType!==A.NetworkStatus.ONLINE,onCustomClick:P[1]||(P[1]=f=>A.showConfirmationForm=!0)},null,8,["id","class","text","disabled"])):(0,H.Q3)("",!0)],2)],2),A.getNetworkStatusType!==A.NetworkStatus.OFFLINE||A.isActiveCall?(0,H.Q3)("",!0):((0,H.uX)(),(0,H.CE)("div",{key:0,class:(0,v.C4)(A.styles["offlinePanel"])},[(0,H.bF)(c,{"icon-name":"wifi-off"}),(0,H.eW)(" "+(0,v.v_)(A.infoNetworkIsOffline),1)],2)),A.showConfirmationForm?((0,H.uX)(),(0,H.Wv)(j,{key:1,"confirm-button-id":f.$globalElementIdRegistry.closeConfirmationButton,onCloseChat:A.close,onCloseModal:P[2]||(P[2]=f=>A.showConfirmationForm=!1)},null,8,["confirm-button-id","onCloseChat"])):(0,H.Q3)("",!0)],64)}var bn={actionBar:"nQfQVJEYINsJIRdtt8ur",offlinePanel:"gVmDOPbXLLQlSWtKbNsA",logoContainer:"z8YxPy7No8cQWEgqLNbW",agentInfo:"D1cgvqwHc6c7MI0qV9bj",agentName:"_KVJ81N43HkqMBT3u8XT",managerConnected:"qxSzLkgl7YYFT1jFd3g4",additionalInfo:"lNk2cLYlkaELi81zyykM",infoTemporaryOffline:"cqC5ravCfJg_YLgSTxz0",infoOffline:"nOQJL3VMAW45a7BoNDD0",spacer:"prKk8Pkf1goiWQb58NyW",closeChatButton:"TBGVKWbDo1gIHstnQltg",control:"PElp32X5drY5tBKv7C3b",callButton:"dfjiHoNoyolbKQEhHKyz",tooltip:"Yr_cLFb3_rk4zMkBJOIT",tooltipTitle:"_9Y67o8lu3IHBtQn8Vhl",tooltipText:"B4J0_fciAQMB3BHdwGqd",tooltipFooter:"T7myxOfb3Ssfk6uoIbw4",triangle:"xraVptlkvEoehj2MXBci",button:"gjQvuF2poLc7yf9nT6fk",cancel:"rAYUexW0TQXM9NV7Dobp",confirm:"bxJBO4woHPMg75yc8m8o",disabled:"KI8uwsBPhQ4zgE6DoJSI"};function Gn(f,P,n,A,e,r){const c=(0,H.g2)("CommonButton");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["modalMask"])},[(0,H.Lk)("div",{ref:"modal",class:(0,v.C4)(A.styles["modalContainer"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["modalHeader"])},(0,v.v_)(f.$t("MBSS.confirmation_form_close_chat")),3),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["modalBody"])},(0,v.v_)(f.$t("MBSS.confirmation_form_able_to_restore")),3),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["buttonContainer"])},[(0,H.bF)(c,{class:(0,v.C4)(A.styles["cancelButton"]),onClick:P[0]||(P[0]=P=>f.$emit("closeModal")),text:f.$t("MBSS.confirmation_form_cancel")},null,8,["class","text"]),(0,H.bF)(c,{class:(0,v.C4)(A.styles["closeButton"]),id:n.confirmButtonId,onClick:P[1]||(P[1]=P=>f.$emit("closeChat")),text:f.$t("MBSS.confirmation_form_close")},null,8,["class","id","text"])],2)],2)],2)}var yn={modalMask:"sfJGgfhikL8PpVbfFqfD",modalContainer:"TIJ5DB0Y_zoTim2wNceE",modalHeader:"dRCaUrOp6mUn7AjwYiCO",modalBody:"wV8FfDNcO4odTdifZp5V",buttonContainer:"kBe9sw9o7QQON77vs1VE",cancelButton:"WoepuYunQMfFhEhXP0M8",closeButton:"mxAkFO7qOSUsL646nSFv"},Yn={name:"confirmation-form",components:{CommonButton:Tf},emits:["closeModal","closeChat"],props:{confirmButtonId:{type:String,required:!1}},setup(f,P){const n=(0,j.KR)(null);return g(n,(()=>{P.emit("closeModal")})),{styles:yn,modal:n}}};const hn=(0,tf.A)(Yn,[["render",Gn]]);var Cn=hn,kn={name:"action-bar",components:{Icon:wf,CommonButton:Tf,ConfirmationForm:Cn},emits:["showConfirmationForm"],setup(){const f=zn(),{isActiveRoomState:P,getAgentInfo:n,getNetworkStatusType:A,getCallInfo:e}=(0,O.bP)(f),{getTheme:v,getProductDisplayName:r}=(0,O.bP)(ef()),{closeChat:c,sendRequestForCall:x}=f,t=(0,X.s9)(),z=(0,j.KR)(!1),w=(0,j.KR)(!1),D=(0,j.KR)(EP),p=(0,j.KR)(!1),d=(0,j.KR)(null),T=(0,j.KR)(null),o=t.t("MBSS.network_offline"),B=t.t("MBSS.tooltip_title"),u=t.t("MBSS.tooltip_text"),s=t.t("MBSS.tooltip_cancel"),M=t.t("MBSS.tooltip_confirm"),a=()=>{p.value=!1},l=()=>{x(),a()};g(T,(f=>{const{target:P}=f;d.value===P||d.value.contains(P)||a()}));const b=f=>f.toLowerCase().includes("onego")?"1GO":f,G=()=>{z.value=!1,c()},y=(0,H.EW)((()=>{const f=n.value;return f?{iconUrl:f.avatarUrl,name:f.name,info:t.t("MBSS.support_agent"),offline:t.t("MBSS.offline_info")}:{icon:`tenants/${v.value}/logo`,name:t.t("MBSS.techsupport_prd",{product:b(r.value)}),info:t.t("MBSS.online_info"),offline:t.t("MBSS.offline_info")}}));return(0,H.wB)(e,(f=>{(null===f||void 0===f?void 0:f.type)!==Qf.ActiveCall?w.value&&(w.value=!1):w.value=!0}),{deep:!0}),{isActiveCall:w,infoNetworkIsOffline:o,NetworkStatus:D,getNetworkStatusType:A,styles:bn,isActiveRoomState:P,agentDetails:y,getAgentInfo:n,showConfirmationForm:z,close:G,closeTooltip:a,sendCallRequest:l,isTooltipVisible:p,callButton:d,tooltip:T,tooltipTitle:B,tooltipText:u,tooltipCancel:s,tooltipConfirm:M}}};const mn=(0,tf.A)(kn,[["render",ln]]);var qn=mn;function Ln(f,P,n,A,e,r){const c=(0,H.g2)("MessageArea"),O=(0,H.g2)("TextInputForm"),j=(0,H.g2)("ActionButton");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["wrapper"])},[(0,H.bF)(c,{messages:A.messages,"is-typing":A.isAgentTyping,"is-incoming-call":A.isIncomingCall,"is-too-many-requests":A.isTooManyRequests,"error-message":A.tooManyRequestsInfo,onFormMessageClick:A.onFormMessageClick,onAcceptIncomingCall:A.onAcceptIncomingCall,onRejectIncomingCall:A.onRejectIncomingCall},null,8,["messages","is-typing","is-incoming-call","is-too-many-requests","error-message","onFormMessageClick","onAcceptIncomingCall","onRejectIncomingCall"]),(0,H.Lk)("div",{class:(0,v.C4)({[A.styles["footerChat"]]:A.isActiveRoomState,[A.styles["footerForm"]]:!A.isActiveRoomState})},[A.isActiveRoomState?((0,H.uX)(),(0,H.Wv)(O,{key:0,"send-message":A.sendMessage,"add-files-for-upload":A.sendMessage,"is-input-disabled":A.isInputDisabled,onShowUploadFileModal:P[0]||(P[0]=P=>f.$emit("showUploadFileModal"))},null,8,["send-message","add-files-for-upload","is-input-disabled"])):((0,H.uX)(),(0,H.Wv)(j,{key:1,id:f.$globalElementIdRegistry.bottomActionButton,text:A.nextButtonState.text,disabled:A.nextButtonState.disabled||A.getNetworkStatusType!==A.NetworkStatus.ONLINE,onActionEmit:A.onActionButtonClick},null,8,["id","text","disabled","onActionEmit"]))],2)],2)}var Zn={wrapper:"jT17g0TS62kxwzB7u7CQ",footerChat:"RQWtQFKFhLM9HllWSJ4W",footerForm:"AeH3yiGZmD8vWlzoDInO"};function Rn(f,P,n,A,r,c){const O=(0,H.g2)("TechnicalMessage"),j=(0,H.g2)("SystemMessage"),X=(0,H.g2)("FormMessage"),x=(0,H.g2)("AgentMessage"),t=(0,H.g2)("CustomerMessage"),z=(0,H.g2)("ScrollableItem"),w=(0,H.g2)("CallRequestMessage"),D=(0,H.g2)("AgentTypingMessage");return(0,H.uX)(),(0,H.CE)("div",{ref:"list",class:(0,v.C4)(A.styles["container"])},[(0,H.Lk)("div",{ref:"area",class:(0,v.C4)(A.styles["scrollableAreaPs"]),onClick:P[5]||(P[5]=(0,e.D$)((()=>{}),["stop"]))},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messagesContainer"])},[((0,H.uX)(!0),(0,H.CE)(H.FK,null,(0,H.pI)(A.groupMessages(n.messages),((e,r)=>((0,H.uX)(),(0,H.CE)("div",null,[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messageGroupHeader"])},(0,v.v_)(A.getDateSeparator(r)),3),(0,H.Lk)("div",{class:(0,v.C4)([A.styles["formMessageContainer"],{[A.styles["inline"]]:A.isAvailableInlineForFormMessages}])},[((0,H.uX)(!0),(0,H.CE)(H.FK,null,(0,H.pI)(e,(n=>((0,H.uX)(),(0,H.Wv)(z,{key:n.id,"handle-read":()=>A.readMessage(n.id),"condition-param":!n.read,"scroll-value-top":A.scrollValueTop,"scroll-value-bottom":A.scrollValueBottom,class:(0,v.C4)([A.styles["messageWrapper"],{[A.styles["customerMessage"]]:n.type===A.MessageType.Customer},{[A.styles["notFormMessage"]]:n.type!==A.MessageType.FormAnswerOption}])},{default:(0,H.k6)((()=>[n.content.length>0&&n.type===A.MessageType.Technical?((0,H.uX)(),(0,H.Wv)(O,{key:0,message:n},null,8,["message"])):(0,H.Q3)("",!0),n.content.length>0&&n.type===A.MessageType.System?((0,H.uX)(),(0,H.Wv)(j,{key:1,message:n},null,8,["message"])):(0,H.Q3)("",!0),n.content.length>0&&n.type===A.MessageType.FormAnswerOption?((0,H.uX)(),(0,H.Wv)(X,{key:2,message:n,onClick:P[0]||(P[0]=P=>{f.$emit("formMessageClick",P)})},null,8,["message"])):(0,H.Q3)("",!0),(n.content.length>0||void 0!==n.files)&&n.type===A.MessageType.SupportAgent?((0,H.uX)(),(0,H.Wv)(x,{key:3,message:n,onShowImageSlider:P[1]||(P[1]=f=>A.showImageSlider(f))},null,8,["message"])):(0,H.Q3)("",!0),(n.content.length>0||void 0!==n.files)&&n.type===A.MessageType.Customer?((0,H.uX)(),(0,H.Wv)(t,{key:4,message:n,resendMessage:A.tryResendMessage,onShowImageSlider:P[2]||(P[2]=f=>A.showImageSlider(f))},null,8,["message","resendMessage"])):(0,H.Q3)("",!0)])),_:2},1032,["handle-read","condition-param","scroll-value-top","scroll-value-bottom","class"])))),128)),n.isTooManyRequests?((0,H.uX)(),(0,H.Wv)(j,{key:0,message:n.errorMessage},null,8,["message"])):(0,H.Q3)("",!0)],2),n.isIncomingCall?((0,H.uX)(),(0,H.Wv)(w,{key:0,"agent-name":A.getAgentInfo.name,onRejectCall:P[3]||(P[3]=P=>f.$emit("rejectIncomingCall")),onAcceptCall:P[4]||(P[4]=P=>f.$emit("acceptIncomingCall"))},null,8,["agent-name"])):(0,H.Q3)("",!0),n.isTyping?((0,H.uX)(),(0,H.Wv)(D,{key:1,content:f.$t("MBSS.typing"),name:A.getAgentInfo.name,url:A.getAgentInfo.avatarUrl},null,8,["content","name","url"])):(0,H.Q3)("",!0)])))),256))],2)],2)],2)}var Fn={container:"Fzvsz7ICSS4xJPQw3uEy",scrollableArea:"a5FPLarY8okzkAnJ83L0",scrollableAreaPs:"SYQDoJklOuEZaAoPjDHq",messagesContainer:"RjK4RDznkVgOAthelLfw",loading:"xJ2WjYLVTfUv_JkBpk92",area:"Rw3n94fxuxowQu_wBaJ7",overlay:"ynRr7MSHV8yXUJ7kY7Gj",messageGroupHeader:"mdy1cK0COQQamLxwRT7k",customerMessage:"YefvbXxSXGAviQHPfRYl",formMessageContainer:"tulKWnTjJhg2LSTu0CCR",inline:"OfUF2QP6NXYux6gDTSGz",messageWrapper:"MGAGEEYyK0cIV8hNFiaG",notFormMessage:"pfKK5pUq8oCePyijeOta"},Qn=n(6430);const Un=f=>{const P=(0,X.s9)(),n=document.createElement("div");n.innerHTML=f;const A=n.querySelectorAll("[data-alias]");return A.forEach((f=>{"span"===f.tagName.toLowerCase()&&(f.innerText=P.t(`MBSS.${f.dataset.alias.replaceAll(".","_")}`))})),n.innerHTML},Jn=f=>{const P=(0,X.s9)(),n=ef(),A=(new Date).toDateString(),e=new Date(Date.now()-864e5).toDateString();return f===A?P.t("general.today"):f===e?P.t("general.yesterday"):new Intl.DateTimeFormat(n.getLanguageCode,{month:"short",day:"2-digit"}).format(new Date(f))},Nn=f=>f.reduce(((f,P)=>{const n=new Date(P.createdAt).toDateString();return f[n]||(f[n]=[]),f[n].push(P),f}),{}),Kn=f=>{const P=[];return f.forEach((f=>{var n;f&&(f.type!==_P.Customer&&f.type!==_P.SupportAgent||hf(f.files)&&(null===(n=f.files)||void 0===n||n.forEach((f=>{P.push(f.url)}))))})),P},Vn=f=>{const P=f.split(".");return P[P.length-1].toLowerCase()},In=f=>["jpg","gif","bmp","png","svg","jpeg","ico","heif"].includes(Vn(f)),Wn=f=>["m4v","avi","mpg","mp4","mov","wmv","3gp","hevc"].includes(Vn(f)),Sn=f=>"pdf"===Vn(f),En=f=>"tiff"===Vn(f),_n=f=>{switch(!0){case Wn(f):return"video-player";case Sn(f):return"pdf";case En(f):return"tiff-file-icon";default:return"files"}},$n={ref:"element"};function fA(f,P,n,A,e,v){return(0,H.uX)(),(0,H.CE)("div",$n,[(0,H.RG)(f.$slots,"default")],512)}const PA=(f,P,n)=>{const A=f.offsetTop,e=f.offsetHeight;return Boolean(P<=A&&A+e<=n)};var nA={name:"scrollable-item",props:{scrollValueTop:{type:Number,default:0},scrollValueBottom:{type:Number,default:0},conditionParam:Boolean,timeout:{type:Number,default:1e3},lastMessage:{type:Object,default:()=>({})},messageId:{type:String,default:""},handleRead:{type:Function,default:()=>{}},listContentLength:{type:Number,default:1},highLightMessageId:{type:String,default:""}},setup(f){const P=(0,j.KR)(null);(0,H.sV)((()=>{n()})),(0,H.wB)((()=>f.scrollValueTop),((f,P)=>{f!==P&&n()})),(0,H.wB)((()=>f.lastMessage),(async(f,P)=>{f&&(null===f||void 0===f?void 0:f.id)!==(null===P||void 0===P?void 0:P.id)&&(await(0,H.dY)(),n())})),(0,H.wB)((()=>f.highLightMessageId),(async(f,P)=>{f&&f!==P&&(await(0,H.dY)(),n())}));const n=()=>{A()&&f.handleRead()},A=()=>!(!f.conditionParam||!P.value)&&PA(P.value,f.scrollValueTop,f.scrollValueBottom);return{element:P}}};const AA=(0,tf.A)(nA,[["render",fA]]);var eA=AA;const HA=["data-message-id"],vA=(0,H.eW)("   "),rA=["innerHTML"];function cA(f,P,n,A,e,r){const c=(0,H.g2)("icon");return(0,H.uX)(),(0,H.CE)("div",{"data-message-id":n.message.id,class:(0,v.C4)(A.styles["messageWrap"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messageWrapRight"])},[(0,H.bF)(c,{class:(0,v.C4)(A.styles["icon"]),"icon-name":A.iconUrl,size:"size-20"},null,8,["class","icon-name"]),(0,H.Lk)("div",null,[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["nickname"])},[(0,H.eW)((0,v.v_)(f.$t("general.сustom-support")),1),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["colon"])},":",2)],2),vA,(0,H.Lk)("span",{class:(0,v.C4)(A.styles["messageData"]),innerHTML:A.addAliasToMessage(n.message.content)},null,10,rA)]),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["time"])},(0,v.v_)(A.renderTimeAsHourMinute(n.message.createdAt)),3)],2)],10,HA)}var OA={messageWrap:"tORD2EcRTEqoLOUzdX63",icon:"YY9nCZeyOo6YRBRQUM00",time:"Jco8OuGadRE1plgyKmn8",messageWrapRight:"iwrCD_53tQDlGTOXtdzc",nickname:"tSUDRzDDFZAn0VBOuSEf",colon:"wH89W40anJADr9EiEGMK",messageData:"PRrno6uSNOko_kuEL75C"};const jA=f=>new Date(f).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}).replace(/AM|PM/,""),XA=(f,P)=>{const n=setInterval((()=>{f.value=Math.round((Date.now()-P)/1e3)}),1e3);return()=>clearInterval(n)};var xA={name:"technical-message",components:{Icon:wf},props:{message:{type:Object,required:!0}},setup(){const{getTheme:f}=(0,O.bP)(ef()),P=(0,H.EW)((()=>`tenants/${f.value}/minilogo`));return{styles:OA,addAliasToMessage:Un,renderTimeAsHourMinute:jA,iconUrl:P}}};const tA=(0,tf.A)(xA,[["render",cA]]);var zA=tA;const wA=["data-message-id"],DA=["data-message-id"],pA=["onClick"],dA=["src"],TA=["innerHTML"];function oA(f,P,n,A,r,c){const O=(0,H.g2)("Icon"),j=(0,H.g2)("icon");return(0,H.uX)(),(0,H.CE)("div",{"data-message-id":n.message.id,class:(0,v.C4)([A.styles["messageContainer"],{[A.styles["offline"]]:n.message.status===A.MessageStatusType.SentFailed}]),onClick:P[0]||(P[0]=()=>n.message.status===A.MessageStatusType.SentFailed&&n.resendMessage(n.message))},[(0,H.Lk)("div",{"data-message-id":n.message.id,class:(0,v.C4)([A.styles["messageWrap"],{[A.styles["offline"]]:n.message.status===A.MessageStatusType.SentFailed}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messageWrapRight"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["textWrap"])},[(0,H.Lk)("span",{class:(0,v.C4)([A.styles["messageData"],A.styles["messageFile"]])},[((0,H.uX)(!0),(0,H.CE)(H.FK,null,(0,H.pI)(n.message.files,(P=>((0,H.uX)(),(0,H.CE)("span",{class:(0,v.C4)(A.styles["fileWrap"]),onClick:(0,e.D$)((n=>f.$emit("showImageSlider",{url:P.url,name:P.name})),["prevent"])},[A.isImage(P.name)?((0,H.uX)(),(0,H.CE)("img",{key:0,src:P.url},null,8,dA)):((0,H.uX)(),(0,H.Wv)(O,{key:1,class:(0,v.C4)(A.styles["fileIcon"]),"icon-name":A.getIcon(P.name)},null,8,["class","icon-name"])),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["fileName"])},(0,v.v_)(P.name),3),P.size?((0,H.uX)(),(0,H.CE)("span",{key:2,class:(0,v.C4)(A.styles["fileSize"])},(0,v.v_)(P.size),3)):(0,H.Q3)("",!0)],10,pA)))),256)),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["messageContent"]),innerHTML:A.cleanMessageContent},null,10,TA)],2)],2),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["timeStatusSection"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["time"])},(0,v.v_)(A.renderTimeAsHourMinute(n.message.createdAt)),3),(0,H.bF)(j,{class:(0,v.C4)([A.styles["status"],{[A.styles["offline"]]:n.message.status===A.MessageStatusType.SentFailed}]),"icon-name":A.getStatusIcon(n.message.status),size:"size-16"},null,8,["class","icon-name"])],2)],2)],10,DA),n.message.status===A.MessageStatusType.SentFailed?((0,H.uX)(),(0,H.CE)("div",{key:0,class:(0,v.C4)(A.styles["resendButton"])},(0,v.v_)(A.resendBtnText),3)):(0,H.Q3)("",!0)],10,wA)}var BA={messageContainer:"oIFJlPfX3LEPuaI6h7QF",offline:"NQX43tdXqQ0V7VuZJ9K5",messageWrap:"B6sWhg5TmkBlOVOZLQjf",messageWrapRight:"hN1v1ZLqQP8V1hvrkxto",timeStatusSection:"VK74c3rnGWAyax4PEYjg",time:"mCkIVXdQm6Ah9pSQ1jAB",status:"l_FhZC_nfAdO0NS94Zjz",unread:"EuVxSDkm44G_360x854V",textWrap:"bNs5abJRnXwL82TdAHde",messageFile:"DvfnBGrxbHg0PBYO96Jm",messageContent:"I5A4fQCTQYcoUWZoBx8h",fileIcon:"YQkUIFw2DPQTiD9Z44aI",fileWrap:"GioQjdV92qEdBPkVh0WA",fileName:"JzKP7IeRG08KU1fq2iB3",fileSize:"DrF1Lzk074olMruCbcyp",resendButton:"YgKmxLAYcj6BD7IgSs9E"},gA=n(9418),uA={name:"customer-message",components:{Icon:wf},props:{message:{type:Object,default:()=>{}},resendMessage:{type:Function,default:()=>{}},imagesForSlider:{type:Array,default:()=>[]}},emits:["showImageSlider"],setup(f){const P=(0,X.s9)(),n=(0,j.KR)([]),A=(0,j.KR)(!1),e=(0,j.KR)($P),v=P.t("MBSS.resend_btn_text"),r=(0,H.EW)((()=>{const P=f.message.content;return gA.A.sanitize(P)})),c=f=>{switch(f){case $P.Sending:return"message_waiting";case $P.Sent:return"message_sent";case $P.SentFailed:return"message_send_failed";case $P.Delivered:case $P.Read:return"message_read"}};return{cleanMessageContent:r,styles:BA,addAliasToMessage:Un,isImage:In,getIcon:_n,getStatusIcon:c,showImageSlider:A,imagesArray:n,renderTimeAsHourMinute:jA,MessageStatusType:e,resendBtnText:v}}};const sA=(0,tf.A)(uA,[["render",oA]]);var MA=sA;const aA=["data-message-id"],lA=["innerHTML"];function bA(f,P,n,A,e,r){return(0,H.uX)(),(0,H.CE)("div",{"data-message-id":n.message.id,class:(0,v.C4)([A.styles["messageWrap"],{[A.styles["selected"]]:n.message.selected}]),onClick:P[0]||(P[0]=P=>f.$emit("click",n.message.context))},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messageWrapRight"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["textWrap"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["messageData"]),innerHTML:n.message.content},null,10,lA)],2)],2)],10,aA)}var GA={messageWrap:"XGeu8dnF0ZQMeyHGsOle",selected:"My00uhIdM4Qom6xoUtQz",messageWrapRight:"vN9Icq0udpoCbt3rogZ6"},yA={name:"form-message",emits:["click"],props:{message:{type:Object,default:()=>{}}},setup(){return{styles:GA,addAliasToMessage:Un}}};const YA=(0,tf.A)(yA,[["render",bA]]);var iA=YA;const hA=["data-message-id"],CA=["onClick"],kA=["src"],mA={key:1},qA=["innerHTML"];function LA(f,P,n,A,r,c){const O=(0,H.g2)("icon"),j=(0,H.g2)("Icon");return(0,H.uX)(),(0,H.CE)("div",{"data-message-id":n.message.id,class:(0,v.C4)([A.styles["messageWrap"]])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messageWrapRight"])},[(0,H.bF)(O,{class:(0,v.C4)(A.styles["icon"]),"icon-url":n.message.agentDetails.avatarUrl,size:"size-20"},null,8,["class","icon-url"]),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["textWrap"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["nickname"])},(0,v.v_)(n.message.agentDetails.name),3),(0,H.Lk)("span",{class:(0,v.C4)([A.styles["messageData"],A.styles["messageFile"]])},[((0,H.uX)(!0),(0,H.CE)(H.FK,null,(0,H.pI)(n.message.files,(P=>((0,H.uX)(),(0,H.CE)("span",{class:(0,v.C4)(A.styles["messageImageContainer"]),onClick:(0,e.D$)((n=>f.$emit("showImageSlider",{url:P.url,name:P.name})),["prevent"])},[A.isImage(P.name)?((0,H.uX)(),(0,H.CE)("img",{key:0,src:P.url},null,8,kA)):((0,H.uX)(),(0,H.CE)("span",mA,[(0,H.bF)(j,{size:"20","icon-name":A.getIcon(P.name)},null,8,["icon-name"])])),(0,H.Lk)("p",null,(0,v.v_)(P.name),1)],10,CA)))),256)),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["messageContent"]),innerHTML:A.cleanMessageContent},null,10,qA)],2)],2),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["time"])},(0,v.v_)(A.renderTimeAsHourMinute(n.message.createdAt)),3)],2)],10,hA)}var ZA={messageWrap:"Qwcb6ZmeT88cTZj7V1pr",icon:"LlFwgjdtaU5bke8rXh6k",time:"LD0hdlujGceImMAgsOgk",messageWrapRight:"_Au1iwIxRuQhku6RtlZi",nickname:"qlgJfFtX46hRJsqmQGLI",messageData:"NCTCXiCt7kIxkffyM8zE",textWrap:"si9sDVaQNgCRLQQarQ3M",messageFile:"FuStWcb6GYxYc3Xvqwxn",messageContent:"IMcXTjm2wecz53YfbNi6",messageImageContainer:"DMygKxtrF4AHrUXGbt7B"},RA={name:"agent-message",components:{Icon:wf},props:{message:{type:Object,default:()=>{}}},emits:["showImageSlider"],setup(f){const P=(0,H.EW)((()=>{const P=f.message.content;return gA.A.sanitize(P)}));return{cleanMessageContent:P,styles:ZA,renderTimeAsHourMinute:jA,isImage:In,getIcon:_n}}};const FA=(0,tf.A)(RA,[["render",LA]]);var QA=FA;function UA(f,P,n,A,e,r){const c=(0,H.g2)("icon");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["messageWrap"]])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["messageWrapRight"])},[(0,H.bF)(c,{class:(0,v.C4)(A.styles["icon"]),"icon-url":n.url,size:"size-20"},null,8,["class","icon-url"]),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["textWrap"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["text"])},(0,v.v_)(n.name)+" "+(0,v.v_)(n.content),3)],2)],2)],2)}var JA={messageWrap:"puO028koHT0IMQ9vDXg9",icon:"kwYmCoKYqkoJ3_BmiCqs",messageWrapRight:"NKN7dhUx3VocZt7mzEQf",text:"VTnBdfrbKHMdB1eM5dNP",textWrap:"BJ8cpB5YQ007rM5UrQLX"},NA={name:"agent-typing-message",components:{Icon:wf},props:{content:{type:String,required:!0},name:{type:String,required:!0},url:{type:String,required:!0}},emits:["showImageSlider"],setup(){return{styles:JA,renderTimeAsHourMinute:jA}}};const KA=(0,tf.A)(NA,[["render",UA]]);var VA=KA;function IA(f,P,n,A,e,r){const c=(0,H.g2)("CommonButton");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["container"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["infoText"])},(0,v.v_)(f.$t("MBSS.calling",{agentName:n.agentName})),3),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["buttonsContainer"])},[(0,H.bF)(c,{class:(0,v.C4)(A.styles["reject"]),text:f.$t("MBSS.reject"),onCustomClick:A.handleReject,disabled:A.isDisabled},null,8,["class","text","onCustomClick","disabled"]),(0,H.bF)(c,{class:(0,v.C4)(A.styles["accept"]),text:f.$t("MBSS.accept"),onCustomClick:A.handleAccept,disabled:A.isDisabled},null,8,["class","text","onCustomClick","disabled"])],2)],2)}var WA={container:"PfkIlHugTY0ncSLeH9rd",buttonsContainer:"gqck0fvzpkYuqiaRXXbI",reject:"pc5Y3tHMP2AnNIImBqB_",accept:"BMDRqmKsSDARWuQnXjS9"},SA={name:"call-request-message",props:{agentName:{type:String,required:!0}},components:{CommonButton:Tf},emits:["rejectCall","acceptCall"],setup(f,P){const n=(0,j.KR)(!1),A=()=>{n.value=!0,P.emit("rejectCall")},e=()=>{n.value=!0,P.emit("acceptCall")};return(0,H.xo)((()=>{n.value=!1})),{styles:WA,isDisabled:n,handleReject:A,handleAccept:e}}};const EA=(0,tf.A)(SA,[["render",IA]]);var _A=EA;const $A=["data-message-id"],fe=["innerHTML"];function Pe(f,P,n,A,e,r){return(0,H.uX)(),(0,H.CE)("div",{"data-message-id":n.message.id,class:(0,v.C4)(A.styles["messageWrap"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["text"]),innerHTML:A.addAliasToMessage(n.message.content)},null,10,fe)],10,$A)}var ne={messageWrap:"HuWBA0Dfh8ov7Ab18rBR",text:"wacXVwPcSf8X1SZE6eb6"},Ae={name:"system-message",props:{message:{type:Object,required:!0}},setup(){return{styles:ne,addAliasToMessage:Un,renderTimeAsHourMinute:jA}}};const ee=(0,tf.A)(Ae,[["render",Pe]]);var He=ee,ve={name:"message-area",components:{SystemMessage:He,CallRequestMessage:_A,AgentTypingMessage:VA,AgentMessage:QA,CustomerMessage:MA,FormMessage:iA,TechnicalMessage:zA,ScrollableItem:eA},emits:["formMessageClick","acceptIncomingCall","rejectIncomingCall"],props:{messages:{type:Array,required:!0},isTyping:{type:Boolean,required:!0},isIncomingCall:{type:Boolean,required:!0},isTooManyRequests:Boolean,errorMessage:Object},setup(f){const P=ef(),n=zn(),{setImagesForSlider:A}=P,{getActiveView:e}=(0,O.bP)(P),{resendMessage:v}=n,{getAgentInfo:r,getNetworkStatusType:c}=(0,O.bP)(n),X=(0,j.KR)(null),x=(0,j.KR)(null);let t=null;const z=(0,j.KR)(null),w=(0,j.KR)(null),D=(0,j.KR)(!1),p=()=>{x.value.style.height="0px",x.value.style.height=X.value.clientHeight+"px",t.update()},d=P=>{if(In(P.name)){const n=[],e=Kn(f.messages),H=e.indexOf(P.url);for(let f=0;f{s(f.messages),t=Qn.A.init(x.value,{damping:.15,thumbMinSize:20,renderByPixels:!0,alwaysShowTracks:!0,continuousScrolling:!1}),t.addListener(T),await(0,H.dY)(),z.value=x.value.scrollHeight,w.value=x.value.scrollHeight,x.value.scrollTop=x.value.scrollHeight-x.value.offsetHeight,setTimeout(o,250)})),(0,H.wB)(e,(f=>{f===u.Main&&setTimeout(o,250)}));const T=f=>{z.value=f.offset.y,w.value=f.limit.y},o=()=>{x.value&&(t.scrollTo(0,t.limit.y,500),t.update())},g=()=>{},s=f=>{const P=f.filter((({type:f})=>f===_P.FormAnswerOption)),n=P.length;if(0===n)return void(D.value=!1);const A=parseInt("400"),e=40,H=7,v=A-e*n,r=Math.floor(v/H),c=P.reduce(((f,{content:P})=>P.length+f),0);D.value=c<=r},M=f=>{c.value!==EP.OFFLINE&&v(f)};return(0,H.wB)(f,(async f=>{await(0,H.dY)(),t.update(),o(),s(f.messages)})),{styles:Fn,area:x,scrollValueTop:z,scrollValueBottom:w,scrollToBottom:o,readMessage:g,getDateSeparator:Jn,getImagesForSlider:Kn,MessageType:_P,list:X,groupMessages:Nn,showImageSlider:d,getAgentInfo:r,tryResendMessage:M,isAvailableInlineForFormMessages:D}}};const re=(0,tf.A)(ve,[["render",Rn]]);var ce=re;const Oe=["id"];function je(f,P,n,A,e,r){const c=(0,H.g2)("Icon"),O=(0,H.g2)("TextEditor"),j=(0,H.g2)("CommonButton");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["formSubmitWrap"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["formSubmit"])},[(0,H.bF)(c,{id:f.$globalElementIdRegistry.attachButton,"icon-name":"attach",size:"size-22",class:(0,v.C4)(A.styles["attachIcon"]),onClick:P[0]||(P[0]=P=>f.$emit("showUploadFileModal"))},null,8,["id","class"]),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["formWrapLeft"])},[(0,H.bF)(O,{ref:"textEditor","editable-field-id":f.$globalElementIdRegistry.messageTextInput,class:(0,v.C4)(A.styles["textarea"]),disabled:n.isInputDisabled,onOnContent:A.onContent,onEnterKeyUp:A.send},null,8,["editable-field-id","class","disabled","onOnContent","onEnterKeyUp"])],2),A.content?((0,H.uX)(),(0,H.CE)("div",{key:0,class:(0,v.C4)(A.styles["sendButtonContainer"])},[(0,H.bF)(j,{id:f.$globalElementIdRegistry.sendMessageButton,disabled:A.availableTextLength<0,class:(0,v.C4)(A.styles["sendButton"]),icon:"send","icon-size":"size-20",onCustomClick:A.send},null,8,["id","disabled","class","onCustomClick"])],2)):(0,H.Q3)("",!0)],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["footer"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["footerActions"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["footerText"]),id:f.$globalElementIdRegistry.textMessageCounter},(0,v.v_)(A.availableTextLength),11,Oe)],2)],2)],2)}var Xe={formSubmit:"lHIM_cxMwREfttCHBBFG",formSubmitWrap:"LP2eTuOYrUxwBMU1wQfs",formWrapLeft:"ultIyLWUl4k1tMR7x0i5",form:"S2ZTEDUH87ex4DsLJTRA","textarea-native":"bSNCGpZtsiYq2QfxwRE5",textarea:"xmNeafp6BuYt_yrDgfPm",attachIcon:"DQF1vseMh8q5AnOWnEBh",footer:"y6mn0q564Y8ekCWBiFuJ",footerActions:"mVnKM_zsZkkUQveN0O6M",footerText:"Txa9egtrYxUG2KmRPJwY",sendButtonContainer:"__6DbjblntoKGiMSefyF",sendButton:"ITabPcb9Hk0AXOR7E79l"};const xe=["disabled","id","placeholder","maxlength"];function te(f,P,n,A,r,c){return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["wrap"])},[(0,H.bo)((0,H.Lk)("textarea",{disabled:n.disabled,id:n.editableFieldId,class:(0,v.C4)(A.styles["input"]),ref:"textarea","onUpdate:modelValue":P[0]||(P[0]=f=>A.input=f),onInput:P[1]||(P[1]=(...f)=>A.onChange&&A.onChange(...f)),onKeyup:P[2]||(P[2]=(0,e.jR)(((...f)=>A.onPressEnter&&A.onPressEnter(...f)),["enter"])),onKeydown:P[3]||(P[3]=(0,e.jR)((0,e.D$)((()=>{}),["prevent"]),["enter"])),placeholder:A.placeholder,maxlength:n.maxLength},null,42,xe),[[e.Jo,A.input]])],2)}var ze={wrap:"D5L042_Aq1AnEz34wYo5",input:"O_BwMGF7XagiAbTDJ6Pe"},we={name:"text-editor",emits:["onContent","showUsersList","enterKeyUp","onToUsers","onTextLength","onTagMessageId","onTextHeight"],expose:["clearInput"],props:{editableFieldId:{type:String,required:!1},disabled:{type:Boolean,required:!1},maxLength:{type:Number,required:!1}},setup(f,P){const n=(0,j.KR)(""),A=(0,j.KR)(null),e=(0,j.KR)({}),H=(0,j.KR)(null),v=(0,X.s9)(),r=v.t("general.enter_your_message"),c=f=>{const P=H.value||parseFloat(getComputedStyle(A.value).lineHeight);H.value=P,A.value.style.height="";const n=A.value.scrollHeight,e=4,v=P*e;A.value.style.height=`${f?P:Math.min(n,v)}px`},O=()=>{const A=n.value.slice(-1);c(!1),P.emit("onContent",n.value),P.emit("onTextLength",n.value.length),"@"===A&&f.useTags&&P.emit("showUsersList",!0)},x=()=>{P.emit("enterKeyUp")},t=async()=>{n.value="",c(!0),O()};return{input:n,textarea:A,placeholder:r,content:e,styles:ze,onChange:O,onPressEnter:x,clearInput:t}}};const De=(0,tf.A)(we,[["render",te]]);var pe=De,de={name:"text-input-form",components:{Icon:wf,CommonButton:Tf,TextEditor:pe},props:{sendMessage:{type:Function,default:()=>{}},typingUser:{type:Function,default:()=>{}},isTyping:Boolean,isInputDisabled:Boolean,addFilesForUpload:{type:Function,required:!0}},emits:["showUploadFileModal"],setup(f){const P=(0,j.KR)(""),n=(0,j.KR)(null),A=(0,j.KR)(null),e=1e3,v=(0,j.KR)(!1),r=f=>{P.value=f},c=()=>{P.value&&P.value.length<=e&&(P.value=O(P.value),f.sendMessage(P.value),n.value.clearInput())},O=f=>{let P=0,n="";for(let A=0;Ae-P.value.length));return{textEditor:n,content:P,send:c,element:A,disabled:v,styles:Xe,onContent:r,availableTextLength:X}}};const Te=(0,tf.A)(de,[["render",je]]);var oe=Te,Be={name:"chat-area",components:{MessageArea:ce,TextInputForm:oe,ActionButton:Bn},emits:["restoreChat","showUploadFileModal"],setup(f,P){const n=(0,X.s9)(),A=zn(),e=(0,j.KR)(!1),{isActiveRoomState:v,isClosedRoomState:r,isPostFormState:c,getActiveRoomMessages:x,getFormStateQuestions:t,getAgentInfo:z,getCallInfo:w,getNetworkStatusType:D,getErrorState:p,getTransactionMessage:d}=(0,O.bP)(A),T=(0,j.KR)(!1),o=(0,j.KR)({id:"is-too-many-requests",content:null}),{sendMessage:B,submitForm:g,acceptCall:u,rejectCall:s}=A,M=(0,j.KR)(EP),a=(0,j.KR)({activeQIndex:0,answers:new Map}),l=(0,j.KR)([]),b=(0,j.KR)([]),G=(new Date).getTime(),y=n.t("general.next"),Y=n.t("MBSS.begin_chat_cmd"),i=n.t("MBSS.close_chat"),h=n.t("MBSS.restore_chat"),C=(0,j.KR)({text:y,disabled:!0}),k=(0,H.EW)((()=>{if(v.value)return d.value?[d.value,...x.value]:[...x.value];if(r.value)return C.value.text=h,C.value.disabled=!1,x.value;const f=t.value,P=f[a.value.activeQIndex],n=a.value.answers.get(P.id);C.value.text=a.value.activeQIndex({type:_P.FormAnswerOption,id:`${P.id}_${A}`,content:f,context:{questionId:P.id,optionIndex:A},selected:n===A,createdAt:G})))],l.value})),m=f=>{a.value.answers.set(f.questionId,f.optionIndex)},q=()=>{var f;if(r.value)P.emit("restoreChat");else if((null===(f=t.value)||void 0===f?void 0:f.length)===a.value.activeQIndex+1){const f=[];for(const[P,n]of a.value.answers.entries())f.push({questionId:P,optionIndex:n});g(f),a.value={activeQIndex:0,answers:new Map}}else{const f=a.value.answers,{questionId:P,optionIndex:n}=Array.from(f,(([f,P])=>({questionId:f,optionIndex:P})))[a.value.activeQIndex],A=k.value[0],e=k.value.filter((({context:f})=>f&&f.questionId===P&&f.optionIndex===n)),H=e.map((f=>({type:_P.Customer,status:$P.Delivered,id:f.id,createdAt:f.createdAt,content:f.content})))[0];b.value=[...b.value,A,H],a.value.activeQIndex++}},L=(0,H.EW)((()=>v.value&&z.value&&!0===z.value.isTyping||!1)),Z=(0,H.EW)((()=>{var f;return(null===(f=w.value)||void 0===f?void 0:f.type)===Qf.IncomingCall})),R=()=>{u()},F=()=>{s()};return(0,H.wB)([()=>p.value,D],(([f,P])=>{f.isError&&f.type===PP.TOO_MANY_REQUESTS?(e.value=!0,T.value=!0,o.value={id:"is-too-many-requests",content:n.t("MBSS.blocked_user_message",{seconds:f.retryTimer})},setTimeout((()=>{T.value=!1,e.value=P===EP.OFFLINE}),1e3*f.retryTimer)):e.value=P===EP.OFFLINE})),{styles:Zn,sendMessage:B,nextButtonState:C,messages:k,getActiveRoomMessages:x,getNetworkStatusType:D,getErrorState:p,isActiveRoomState:v,MessageType:_P,onFormMessageClick:m,onActionButtonClick:q,isAgentTyping:L,isIncomingCall:Z,onAcceptIncomingCall:R,onRejectIncomingCall:F,NetworkStatus:M,isInputDisabled:e,isTooManyRequests:T,tooManyRequestsInfo:o}}};const ge=(0,tf.A)(Be,[["render",Ln]]);var ue=ge;const se=(0,H.Lk)("div",null,"00:01",-1);function Me(f,P,n,A,e,r){const c=(0,H.g2)("Icon"),O=(0,H.g2)("CommonButton");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["container"])},[A.openModal?((0,H.uX)(),(0,H.CE)("div",{key:0,class:(0,v.C4)(A.styles["open"])},[(0,H.bF)(c,{"icon-name":"close-call-section",size:"size-20",class:(0,v.C4)(A.styles["closeModal"]),onClick:P[0]||(P[0]=f=>A.openModal=!1)},null,8,["class"]),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["callArea"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["userAvatar"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["avatarOuter"])},[(0,H.bF)(c,{"icon-name":"user","border-radius":"border-radius-100"})],2)],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["agentAvatar"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["avatarOuter"])},[(0,H.bF)(c,{class:(0,v.C4)(A.styles["avatar"]),"icon-url":A.agentDetails.iconUrl,"icon-name":A.agentDetails.icon},null,8,["class","icon-url","icon-name"])],2)],2)],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["footer"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["footerCallTime"])},[(0,H.bF)(c,{"icon-name":"headset",size:"size-20"}),se],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["callButtons"])},[(0,H.bF)(O,{class:(0,v.C4)(A.styles["muteButton"]),"icon-size":"size-28",icon:"microphone"},null,8,["class"]),(0,H.bF)(O,{class:(0,v.C4)(A.styles["callEndButton"]),"icon-size":"size-28",icon:"call-end"},null,8,["class"])],2)],2)],2)):((0,H.uX)(),(0,H.CE)("div",{key:1,class:(0,v.C4)(A.styles["collapsed"])},[(0,H.bF)(c,{class:(0,v.C4)(A.styles["openModalIcon"]),"icon-name":"open-call-section",size:"size-10",onClick:P[1]||(P[1]=f=>A.openModal=!0)},null,8,["class"]),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["actionButtons"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["timeSection"])},[(0,H.bF)(c,{"icon-name":"headset",size:"size-20"}),(0,H.Lk)("div",null,(0,v.v_)(A.passedTime),1)],2),(0,H.bF)(O,{class:(0,v.C4)(A.styles["muteButton"]),"icon-size":"size-28",icon:A.audioMuted?"microphone-off":"microphone",onCustomClick:A.onMute},null,8,["class","icon","onCustomClick"]),(0,H.bF)(O,{class:(0,v.C4)(A.styles["callEndButton"]),"icon-size":"size-28",icon:"call-end",onCustomClick:A.onEndCall},null,8,["class","onCustomClick"])],2)],2))],2)}var ae={container:"ujVZ57B0Yktg_CYIHRFF",collapsed:"EX44hGhlPykhlKygFbf8",actionButtons:"nBiWFZLRSq0dKl77vyAd",timeSection:"tAJADay7t7c7HvDfOYRb",muteButton:"Y4V5TyW3Fh41S0jKj8OQ",callEndButton:"HN3jt44XALm7tYU1K1F8",open:"fi1QrOMqLvMxsewZbkFW",openModalIcon:"GjZ0pcgv4usQ4HCu0cmx",userAvatar:"hf1Cv6_oyysFTI1apfjw",agentAvatar:"zv5DhGGlaFwcuY3AwcIY",avatar:"EBtmsHspqIAipGMZL1Be",closeModal:"SmGffSXCgGwUhvsAuUxE",callArea:"CZBNFvBO5hQGvPtYD6eE",footer:"KicNqp6mxQkaLgABcHoo",footerCallTime:"bZlDzBJiKIHHdoYaat2C",callButtons:"gkcGTcVG2MN_6OA1oruN",avatarOuter:"rdmP0B2KjXcAzDNMSUOd",pulse:"vHvIXWwSZbM70DfCqsUQ"},le={name:"side-bar",components:{CommonButton:Tf,Icon:wf},setup(){const f=zn(),{getAgentInfo:P}=(0,O.bP)(f),{getTheme:n,getProductDisplayName:A}=(0,O.bP)(ef()),e=On(),v=(0,X.s9)(),r=(0,j.KR)(!1),c=(0,H.EW)((()=>{const f=P.value;return f?{iconUrl:f.avatarUrl,name:f.name,info:v.t("MBSS.support_agent")}:{icon:`tenants/${n.value}/logo`,name:v.t("MBSS.techsupport_prd",{product:A.value}),info:v.t("MBSS.online_info")}})),x=(0,j.KR)(!1),t=(0,j.KR)(0),z=async()=>{x.value=await e.toggleMuteLocalAudio()},w=async()=>{f.leaveCall()};let D;(0,H.sV)((()=>{D=XA(t,e.getMeta().startTimeStamp)})),(0,H.hi)((()=>{D()}));const p=(0,H.EW)((()=>{const f=t.value,P=f%60,n=(f-P)/60,A=f=>f>=10?f.toString():`0${f}`;return`${A(n)}:${A(P)}`}));return{styles:ae,openModal:r,agentDetails:c,onMute:z,audioMuted:x,onEndCall:w,passedTime:p}}};const be=(0,tf.A)(le,[["render",Me]]);var Ge=be;function ye(f,P,n,A,r,c){var O,j;const X=(0,H.g2)("VideoAreaMobile"),x=(0,H.g2)("Icon"),t=(0,H.g2)("NetworkInfo"),z=(0,H.g2)("MicrophoneInfo");return(0,H.uX)(),(0,H.CE)("section",{class:(0,v.C4)([A.styles["wrapper"],{[A.styles["expanded"]]:A.isCallAreaExpanded},{[A.styles["expandedMobile"]]:A.isMobileVideoAreaVisible}])},[A.isMobile?((0,H.uX)(),(0,H.CE)("section",{key:0,class:(0,v.C4)([A.styles["videoAreaMobile"],{[A.styles["isVisible"]]:A.isMobileVideoAreaVisible}])},[(0,H.bF)(X,{passedTime:A.passedTime,isMicrophoneOn:A.isMicrophoneOn,isVideoOn:A.isVideoOn,isWifiLow:A.isWifiLow,agentDetails:A.agentDetails,onOnGoBack:A.onGoBack,onToggleMicrophone:A.toggleMicrophone,onToggleVideo:A.toggleVideo,onOnEndCall:A.onEndCall},null,8,["passedTime","isMicrophoneOn","isVideoOn","isWifiLow","agentDetails","onOnGoBack","onToggleMicrophone","onToggleVideo","onOnEndCall"])],2)):(0,H.Q3)("",!0),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["topPart"])},[(0,H.Lk)("header",{class:(0,v.C4)([A.styles["header"],{[A.styles["expanded"]]:A.isCallAreaExpanded}])},[A.isCallAreaExpanded?((0,H.uX)(),(0,H.CE)("span",{key:1,class:(0,v.C4)(A.styles["headerBtn"]),onClick:P[1]||(P[1]=(...f)=>A.toggleCallSection&&A.toggleCallSection(...f))},[(0,H.bF)(x,{size:"size-20","icon-name":"close-call-section"})],2)):((0,H.uX)(),(0,H.CE)("span",{key:0,class:(0,v.C4)(A.styles["headerBtn"]),onClick:P[0]||(P[0]=(...f)=>A.toggleCallSection&&A.toggleCallSection(...f))},[(0,H.bF)(x,{size:"size-20","icon-name":"open-call-section"})],2))],2),A.getNetworkStatusType!==A.NetworkStatus.ONLINE&&A.isCallAreaExpanded?((0,H.uX)(),(0,H.Wv)(t,{key:0})):(0,H.Q3)("",!0)],2),(0,H.Lk)("div",{class:(0,v.C4)([A.styles["videoContent"],{[A.styles["withVideo"]]:A.isVideoOn},{[A.styles["isVisible"]]:A.isCallAreaExpanded}])},[!A.isMicrophoneOn&&A.isCallAreaExpanded?((0,H.uX)(),(0,H.Wv)(z,{key:0})):(0,H.Q3)("",!0),A.isMobile?(0,H.Q3)("",!0):((0,H.uX)(),(0,H.CE)("div",{key:1,id:"liveswitch",class:(0,v.C4)([A.styles["videoContainer"],{[A.styles["isVisible"]]:A.isVideoOn}])},null,2)),(0,H.Lk)("div",{class:(0,v.C4)([A.styles["avatarContainer"],{[A.styles["isVisible"]]:!A.isVideoOn}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["halo"])},null,2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["halo2"])},null,2),(0,H.bF)(x,{class:(0,v.C4)(A.styles["avatar"]),"icon-name":"user_avatar"},null,8,["class"])],2),(0,H.Lk)("div",{class:(0,v.C4)([A.styles["avatarWrapper"],{[A.styles["whenVideo"]]:A.isVideoOn}])},[(0,H.Lk)("div",{class:(0,v.C4)([A.styles["avatarContainer"],{[A.styles["isVisible"]]:!0}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["halo"])},null,2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["halo2"])},null,2),(0,H.bF)(x,{class:(0,v.C4)(A.styles["avatar"]),"icon-url":null===(O=A.agentDetails)||void 0===O?void 0:O.iconUrl,"icon-name":A.agentDetails.icon},null,8,["class","icon-url","icon-name"])],2)],2)],2),(0,H.Lk)("footer",{class:(0,v.C4)([A.styles["footer"],{[A.styles["expanded"]]:A.isCallAreaExpanded}]),onClick:P[4]||(P[4]=(...f)=>A.handleClickOutsideControls&&A.handleClickOutsideControls(...f))},[(0,H.Lk)("div",{class:(0,v.C4)([A.styles["timer"],{[A.styles["expanded"]]:A.isCallAreaExpanded}])},[(0,H.bF)(x,{"icon-name":"headset",size:"size-20"}),(0,H.Lk)("span",null,(0,v.v_)(A.passedTime),1)],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["agentContainerMobile"])},[(0,H.bF)(x,{class:(0,v.C4)(A.styles["avatarMobile"]),"icon-url":null===(j=A.agentDetails)||void 0===j?void 0:j.iconUrl,"icon-name":A.agentDetails.icon},null,8,["class","icon-url","icon-name"]),(0,H.Lk)("div",null,[(0,H.Lk)("p",{class:(0,v.C4)(A.styles["agentName"])},(0,v.v_)(A.agentDetails.name),3),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["timerMobile"])},[(0,H.bF)(x,{"icon-name":"headset",size:"size-20"}),(0,H.Lk)("span",null,(0,v.v_)(A.passedTime),1)],2)])],2),(0,H.Lk)("div",{class:(0,v.C4)([A.styles["controls"],{[A.styles["expanded"]]:A.isCallAreaExpanded}]),onClick:P[3]||(P[3]=(0,e.D$)((()=>{}),["stop"]))},[(0,H.Lk)("button",{class:(0,v.C4)([A.styles["button"],{[A.styles["active"]]:A.isMicrophoneOn}])},[A.isMicrophoneOn?((0,H.uX)(),(0,H.Wv)(x,{key:0,"icon-name":"microphone",size:"size-28",onClick:A.toggleMicrophone},null,8,["onClick"])):((0,H.uX)(),(0,H.Wv)(x,{key:1,"icon-name":"microphone-off",size:"size-28",onClick:A.toggleMicrophone},null,8,["onClick"]))],2),(0,H.Lk)("button",{class:(0,v.C4)([A.styles["button"],{[A.styles["active"]]:A.isVideoOn}])},[A.isVideoOn?((0,H.uX)(),(0,H.Wv)(x,{key:0,"icon-name":"video-on",size:"size-28",onClick:A.toggleVideo},null,8,["onClick"])):((0,H.uX)(),(0,H.Wv)(x,{key:1,"icon-name":"video-off",size:"size-28",onClick:A.toggleVideo},null,8,["onClick"]))],2),(0,H.Lk)("button",{class:(0,v.C4)([A.styles["button"],A.styles["callEnd"]]),onClick:P[2]||(P[2]=(...f)=>A.onEndCall&&A.onEndCall(...f))},[(0,H.bF)(x,{"icon-name":"call-end",size:"size-28"})],2),(0,H.Q3)("",!0)],2)],2),A.getNetworkStatusType!==A.NetworkStatus.ONLINE?((0,H.uX)(),(0,H.Wv)(t,{key:1,"is-mobile":!0})):(0,H.Q3)("",!0),A.isMicrophoneOn?(0,H.Q3)("",!0):((0,H.uX)(),(0,H.Wv)(z,{key:2,"is-mobile":!0}))],2)}function Ye(f,P,n,A,e,r){const c=(0,H.g2)("Icon");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["wrapper"],{[A.styles["isOffline"]]:A.getNetworkStatusType===A.NetworkStatus.OFFLINE},{[A.styles["isMobile"]]:n.isMobile}])},[A.getNetworkStatusType===A.NetworkStatus.TEMPORARY_OFFLINE?((0,H.uX)(),(0,H.Wv)(c,{key:0,size:"size-20","icon-name":"wifi-low"})):(0,H.Q3)("",!0),A.getNetworkStatusType===A.NetworkStatus.OFFLINE?((0,H.uX)(),(0,H.Wv)(c,{key:1,size:"size-20","icon-name":"wifi-off"})):(0,H.Q3)("",!0),(0,H.Lk)("span",null,(0,v.v_)(A.getNetworkStatusType===A.NetworkStatus.OFFLINE?A.infoNetworkIsOffline:A.networkProblemsMessage),1)],2)}var ie={wrapper:"KwBEBXVxlNguwW_Ex60l",isOffline:"fYrezthH84YbWT5eA1VX",isMobile:"JEDYgYYeDiglWKcnagkr"},he={name:"network-info",components:{Icon:wf},props:{isMobile:Boolean},setup(){const f=(0,X.s9)(),P=(0,j.KR)(EP),n=zn(),{getNetworkStatusType:A}=(0,O.bP)(n),e=f.t("MBSS.bad_network_connection"),H=f.t("MBSS.network_offline");return{styles:ie,networkProblemsMessage:e,infoNetworkIsOffline:H,NetworkStatus:P,getNetworkStatusType:A}}};const Ce=(0,tf.A)(he,[["render",Ye]]);var ke=Ce;function me(f,P,n,A,e,r){const c=(0,H.g2)("Icon");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["wrapper"],{[A.styles["isMobile"]]:n.isMobile},{[A.styles["isMobileExpanded"]]:n.isMobileExpanded}])},[(0,H.bF)(c,{size:"size-20","icon-name":"microphone-off"}),(0,H.Lk)("span",null,(0,v.v_)(A.microphoneOffMessage),1)],2)}var qe={wrapper:"bzZ54qKzGncxjfBI6T5r",isMobile:"jMQ9KZiC8AsHRBK8ggFo",isMobileExpanded:"VLnrh1MIz4ojBlAs06VE"},Le={name:"microphone-info",components:{Icon:wf},props:{isMobile:Boolean,isMobileExpanded:Boolean},setup(){const f=(0,X.s9)(),P=f.t("MBSS.microphone_off");return{styles:qe,microphoneOffMessage:P}}};const Ze=(0,tf.A)(Le,[["render",me]]);var Re=Ze,Fe={wrapper:"qrI_Qx640EcyQIReDQrV",expanded:"ur1rBomL5twyL2hyjEl1",expandedMobile:"DTK27roFj3wO0g_UC3J5",agentContainerMobile:"s22U1VKxc1MRLHahm9Wf",topPart:"jhdqWAE3610RcYHAXHUM",header:"vGiOtQIl6BoRLR1EtkvP",headerBtn:"ZIzt2zEU170JOD5Oh8uh",videoAreaContainer:"QxfTXz1nH6s7xtIQT210",videoAreaForAvatars:"obk7NFXRRRYurkSB_pZp",avatarContainer:"IPrH1y3g80Ao3go1_2Pa",isVisible:"LGEm_q3J5PAXRycD_n72",avatarWrapper:"iK3bPX05qAMkeXK2M_LA",whenVideo:"hyIhAu5dJcD3Pe4BxDPC",avatar:"ROjZC7EcLQ4s4ltiB5Z7",avatarMobile:"Ajnn_nEXMkMSTFZAzjev",agentName:"TLYqwYPK0a8y8Kp7rxaj",halo:"XS4KoliTlCc7cfWpqlww",pulse:"LIUekL7nych0tKoCgeDs",halo2:"w9F3dvz9jes3AX44kxwY",footer:"z6hSavTyJfk08m33L3H6",controls:"uFS1Ik9laEdK8GwiXzvT",timer:"u5zjocvuj4BtrqMGCx3e",timerMobile:"Se3UWW6zkAkl_PXVkfio",button:"wA5bEIArwKMTQy3D_GTb",active:"nInZT0XKRMWf813ST1BJ",callEnd:"CFqWvXHU2KMesUHYXU7T",videoContent:"KV2n8jTpMkMGgJJyn5iu",withVideo:"MnWsbRgFEQjtdAAnZFZI",videoContainer:"Z2xbi8UekWMin29umDzs",videoAreaMobile:"_fjtpSgC0kcazwgZnp88"};function Qe(f,P,n,A,e,r){var c;const O=(0,H.g2)("Icon"),j=(0,H.g2)("NetworkInfo"),X=(0,H.g2)("MicrophoneInfo");return(0,H.uX)(),(0,H.CE)(H.FK,null,[(0,H.Lk)("header",{class:(0,v.C4)(A.styles["header"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["buttonBack"]),onClick:P[0]||(P[0]=(...f)=>A.goBack&&A.goBack(...f))},[(0,H.bF)(O,{size:"size-20","icon-name":"arrow-left"})],2),(0,H.Lk)("div",{class:(0,v.C4)(A.stylesCallArea["timerMobile"])},[(0,H.bF)(O,{"icon-name":"headset",size:"size-20"}),(0,H.Lk)("span",null,(0,v.v_)(n.passedTime),1)],2)],2),(0,H.Lk)("section",{class:(0,v.C4)(A.styles["area"])},[n.isWifiLow?((0,H.uX)(),(0,H.Wv)(j,{key:0,"is-mobile":!0,"is-mobile-expanded":!0})):(0,H.Q3)("",!0),n.isMicrophoneOn?(0,H.Q3)("",!0):((0,H.uX)(),(0,H.Wv)(X,{key:1,"is-mobile":!0,"is-mobile-expanded":!0})),(0,H.Lk)("div",{id:"liveswitch",class:(0,v.C4)([A.styles["videoContainer"],{[A.styles["isVisible"]]:n.isVideoOn}])},null,2),(0,H.Lk)("div",{class:(0,v.C4)([A.stylesCallArea["avatarContainer"],{[A.stylesCallArea["isVisible"]]:!n.isVideoOn}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.stylesCallArea["halo"])},null,2),(0,H.Lk)("div",{class:(0,v.C4)(A.stylesCallArea["halo2"])},null,2),(0,H.bF)(O,{class:(0,v.C4)(A.stylesCallArea["avatar"]),"icon-name":"user_avatar"},null,8,["class"])],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["agentAvatarArea"])},[(0,H.Lk)("div",{class:(0,v.C4)([A.styles["avatarContainer"],{[A.styles["isVisible"]]:!0}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.stylesCallArea["halo"])},null,2),(0,H.Lk)("div",{class:(0,v.C4)(A.stylesCallArea["halo2"])},null,2),(0,H.bF)(O,{class:(0,v.C4)(A.styles["avatar"]),"icon-url":null===(c=n.agentDetails)||void 0===c?void 0:c.iconUrl,"icon-name":n.agentDetails.icon},null,8,["class","icon-url","icon-name"])],2)],2)],2),(0,H.Lk)("footer",{class:(0,v.C4)(A.styles["footer"])},[(0,H.Lk)("button",{class:(0,v.C4)([A.stylesCallArea["button"],{[A.stylesCallArea["active"]]:n.isMicrophoneOn}])},[n.isMicrophoneOn?((0,H.uX)(),(0,H.Wv)(O,{key:0,"icon-name":"microphone",size:"size-28",onClick:A.toggleMicrophone},null,8,["onClick"])):((0,H.uX)(),(0,H.Wv)(O,{key:1,"icon-name":"microphone-off",size:"size-28",onClick:A.toggleMicrophone},null,8,["onClick"]))],2),(0,H.Lk)("button",{class:(0,v.C4)([A.stylesCallArea["button"],{[A.stylesCallArea["active"]]:n.isVideoOn}])},[n.isVideoOn?((0,H.uX)(),(0,H.Wv)(O,{key:0,"icon-name":"video-on",size:"size-28",onClick:A.toggleVideo},null,8,["onClick"])):((0,H.uX)(),(0,H.Wv)(O,{key:1,"icon-name":"video-off",size:"size-28",onClick:A.toggleVideo},null,8,["onClick"]))],2),(0,H.Lk)("button",{class:(0,v.C4)([A.stylesCallArea["button"],A.stylesCallArea["callEnd"]]),onClick:P[1]||(P[1]=(...f)=>A.onEndCall&&A.onEndCall(...f))},[(0,H.bF)(O,{"icon-name":"call-end",size:"size-28"})],2),(0,H.Lk)("button",{class:(0,v.C4)(A.stylesCallArea["button"])},[(0,H.bF)(O,{"icon-name":"chat-btn",size:"size-28",onClick:A.goBack},null,8,["onClick"])],2)],2)],64)}var Ue={header:"ZZ9ue38CiEiKhYfPOjnZ",area:"VNiTXdPpKEqcCu1BrkhM",footer:"idN_n5eMA2xbb6t0Cn7E",buttonBack:"AkcihMfSeHMlWdj5_OBb",agentAvatarArea:"HmtXwnQC1WgaayKRfMiq",avatarContainer:"K1MLtCH00i0Fn41spqJP",isVisible:"yC7VvU9zfdQkKoG4XoJd",avatar:"oJdYOHHU7acWQvtJX5bU",videoContainer:"zWGKvwqYYQERng_WQ2pv"},Je={name:"video-area-mobile",emits:["onGoBack","toggleMicrophone","toggleVideo","onEndCall"],props:{passedTime:String,isMicrophoneOn:Boolean,isVideoOn:Boolean,isWifiLow:Boolean,agentDetails:Object},components:{MicrophoneInfo:Re,NetworkInfo:ke,Icon:wf},setup(f,P){const n=()=>{P.emit("onGoBack")},A=async()=>{P.emit("toggleMicrophone")},e=async()=>{P.emit("toggleVideo")},H=()=>{P.emit("onEndCall")};return{stylesCallArea:Fe,styles:Ue,goBack:n,onEndCall:H,toggleMicrophone:A,toggleVideo:e}}};const Ne=(0,tf.A)(Je,[["render",Qe]]);var Ke=Ne;function Ve(){const f=(0,j.KR)(window.innerWidth<=lf.desktop),P=()=>{const P=window.matchMedia("(max-width: 1024px) and (orientation: landscape) and (pointer: coarse) and (hover: none)").matches,n=window.innerWidth<=lf.desktop;f.value=n||P};return(0,H.sV)((()=>{window.addEventListener("resize",P)})),(0,H.xo)((()=>{window.removeEventListener("resize",P)})),f}var Ie={name:"call-area",components:{VideoAreaMobile:Ke,MicrophoneInfo:Re,NetworkInfo:ke,Icon:wf},emits:["onEndCall","onExpandVideoAreaInMobile","onExpand"],setup(f,P){let n;const A=(0,j.KR)(!1),e=(0,j.KR)(!1),v=(0,j.KR)(!1),r=(0,j.KR)(!1),c=(0,j.KR)(!1),x=(0,j.KR)(!1),t=(0,j.KR)(0),z=(0,j.KR)(EP),w=Ve(),D=(0,X.s9)(),p=On(),d=zn(),{getTheme:T,getProductDisplayName:o}=(0,O.bP)(ef()),{getAgentInfo:B,getCallInfo:g,getNetworkStatusType:u}=(0,O.bP)(d),s=(0,H.EW)((()=>{const f=B.value;return f?{iconUrl:f.avatarUrl,name:f.name,info:D.t("MBSS.support_agent")}:{icon:`tenants/${T.value}/logo`,name:D.t("MBSS.techsupport_prd",{product:o.value}),info:D.t("MBSS.online_info")}})),M=(0,H.EW)((()=>{const f=t.value,P=f%60,n=(f-P)/60,A=f=>f>=10?f.toString():`0${f}`;return isNaN(n)||isNaN(P)?"00:00":`${A(n)}:${A(P)}`})),a=()=>{const f=!e.value;e.value=f,P.emit("onExpand",f)},l=async()=>{v.value=!await p.toggleMuteLocalAudio()},b=async()=>{const f=!await p.toggleMuteLocalVideo();f&&!A.value&&w&&(A.value=!0,P.emit("onExpandVideoAreaInMobile",!0)),r.value=f},G=()=>{c.value=!c.value},y=()=>{d.leaveCall(),p.leaveLocalMedia(),i()},Y=()=>{A.value=!1,P.emit("onExpandVideoAreaInMobile",!1)},i=()=>{P.emit("onEndCall"),P.emit("onExpand",!1),e.value=!1,v.value=!1,r.value=!1,c.value=!1,x.value=!1,t.value=0},h=()=>{!A.value&&w&&(A.value=!0,P.emit("onExpandVideoAreaInMobile",!0))};return(0,H.wB)(u,(f=>{if(f!==EP.ONLINE)return x.value=!0,void y();x.value=!1})),(0,H.wB)(g,(f=>{void 0!==f?(null===f||void 0===f?void 0:f.type)!==Qf.ActiveCall?n&&0!==n.value&&n():n=XA(t,p.getMeta().startTimeStamp):i()}),{deep:!0}),{styles:Fe,agentDetails:s,passedTime:M,isCallAreaExpanded:e,isMobile:w,isMicrophoneOn:v,isVideoOn:r,isSharingOn:c,isMobileVideoAreaVisible:A,isWifiLow:x,NetworkStatus:z,getNetworkStatusType:u,toggleCallSection:a,toggleMicrophone:l,toggleVideo:b,toggleSharing:G,handleClickOutsideControls:h,onEndCall:y,onGoBack:Y}}};const We=(0,tf.A)(Ie,[["render",ye]]);var Se=We,Ee={name:"main-view",components:{CallArea:Se,CommonButton:Tf,LoadingOverlay:Mf,ConnectionError:sn,ActionBar:qn,ChatArea:ue,ActiveCallSideBar:Ge},emits:["showUploadFileModal"],setup(){const f=(0,j.KR)(!1),P=ef(),{toggleActiveView:n}=P,A=On(),{getActiveView:e,getUserId:v,getLanguageCode:r,getUserEnvironment:c}=(0,O.bP)(P),X=zn(),{clearMessageHistory:x,leaveCall:t}=X,{isInitialState:z,isLoadingState:w,isConnectionErrorState:D,isSignedInState:p,isClosingRoom:d,getCallInfo:o,getErrorState:B,isPreFormState:g,isPostFormState:s}=(0,O.bP)(X),M=(0,H.EW)((()=>B.value.isError&&B.value.type===PP.INTERNAL_SERVER_ERRORS)),a=(0,H.EW)((()=>B.value.isError&&B.value.type===PP.ROOM_ALREADY_CLOSED)),l=(0,H.EW)((()=>e.value!==u.Main)),b=(0,j.KR)(!1),G=(0,j.KR)(!1),y=(0,j.KR)(!1),Y=(0,j.KR)(!1),i=f=>{G.value=f},h=f=>{f?f&&y.value||(y.value=!0):y.value=!1};Gf(l),(0,H.wB)(o,(f=>{const P=A.getMeta().startTimeStamp;b.value=(null===f||void 0===f?void 0:f.type)===Qf.ActiveCall&&P>0,Y.value=(null===f||void 0===f?void 0:f.type)===Qf.ActiveCall&&P>0}),{deep:!0}),(0,H.wB)(g,((f,P)=>{f&&f!==P&&T("popup-support_chat-prechat")})),(0,H.wB)(s,((f,P)=>{f&&f!==P&&T("popup-support_chat-postchat")})),(0,H.wB)(l,(async P=>{(!P&&z.value||f.value&&e.value===u.Main)&&(C(),f.value=!1)})),(0,H.wB)(v,(P=>{P||(x(),b.value&&t(),e.value===u.Main&&n(),f.value=!0)}));const C=()=>{X.init(v.value,r.value,c.value)},k=()=>{Y.value=!1,G.value=!1};return(0,H.sV)((()=>{window.onbeforeunload=()=>{b.value&&t()}})),{styles:vf,toggleActiveView:n,isInternalError:M,isRoomAlreadyClosedError:a,isLoadingState:w,isConnectionErrorState:D,isSignedInState:p,isClosingRoom:d,isActiveCall:b,isLocalActiveCall:Y,isVideoAreaMobileVisible:y,isExpanded:G,initChat:C,onEndCall:k,onExpand:i,onExpandVideoAreaInMobile:h}}};const _e=(0,tf.A)(Ee,[["render",Hf]]);var $e=_e;function fH(f,P,n,A,e,v){const r=(0,H.g2)("VueEasyLightbox");return(0,H.uX)(),(0,H.CE)("div",null,[(0,H.bF)(r,{visible:!0,imgs:n.imagesArray,onHide:P[0]||(P[0]=P=>f.$emit("closeSlider"))},null,8,["imgs"])])}var PH=n(6880),nH={},AH={name:"image-slider",components:{VueEasyLightbox:PH.A},props:{imagesArray:{type:Array,default:()=>[]}},emits:["closeSlider"],setup(){return{styles:nH}}};const eH=(0,tf.A)(AH,[["render",fH]]);var HH=eH;const vH={style:{display:"block"},for:"uploadFile"},rH=["disabled"],cH={key:0},OH={key:1},jH={key:2},XH=["src"];function xH(f,P,n,A,e,r){const c=(0,H.g2)("Icon"),O=(0,H.g2)("CommonButton"),j=(0,H.g2)("icon"),X=(0,H.g2)("TextEditor");return(0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)(A.styles["modalMask"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["modalWrapper"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["modalContainer"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["modalHeader"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["heading"])},(0,v.v_)(f.$t("MBSS.attach_files")),3),(0,H.bF)(c,{id:f.$globalElementIdRegistry.closeButtonForAttachFiles,class:(0,v.C4)(A.styles["closeIcon"]),"icon-name":"cross",size:"size-13",onClick:P[0]||(P[0]=P=>f.$emit("hideModal"))},null,8,["id","class"]),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["description"])},(0,v.v_)(f.$t("MBSS.attach_files_info",{countLimit:A.filesCountLimit,sizeLimit:A.fileSizeLimitInMb})),3)],2),(0,H.Lk)("div",null,[(0,H.Lk)("label",vH,[(0,H.bF)(O,{id:f.$globalElementIdRegistry.loadMoreButtonForAttachFiles,class:(0,v.C4)([A.styles["loadFile"],{[A.styles["disabled"]]:A.addFilesDisabled}]),icon:"upload",text:f.$t("MBSS.upload"),"icon-size":"size-14",disabled:A.addFilesDisabled},null,8,["id","class","text","disabled"])]),(0,H.Lk)("input",{id:"uploadFile",ref:"uploadFile",style:{display:"none"},multiple:"",class:(0,v.C4)(A.styles["uploadFileInput"]),type:"file",accept:"image/*, video/*, application/pdf",disabled:A.addFilesDisabled,onChange:P[1]||(P[1]=f=>A.onFileChanged(f))},null,42,rH)]),A.maxSizeLimitError||Object.keys(A.fileArray).length>5||A.unsupportedFiles.length>0?((0,H.uX)(),(0,H.CE)("div",{key:0,class:(0,v.C4)(A.styles["errorContainer"])},[A.maxSizeLimitError?((0,H.uX)(),(0,H.CE)("span",cH,(0,v.v_)(f.$t("MBSS.total_size_limit",{sizeLimit:A.fileSizeLimitInMb})),1)):A.unsupportedFiles.length>0?((0,H.uX)(),(0,H.CE)("span",OH,(0,v.v_)(`${A.unsupportedFiles.join(", ")} ${f.$t("MBSS.wrong_file_type")}`),1)):((0,H.uX)(),(0,H.CE)("span",jH,(0,v.v_)(f.$t("MBSS.total_count_limit",{countLimit:A.filesCountLimit})),1))],2)):(0,H.Q3)("",!0),(0,H.Lk)("div",{ref:"fileList",class:(0,v.C4)([A.styles["fileList"],A.styles["scrollableAreaPs"]])},[((0,H.uX)(!0),(0,H.CE)(H.FK,null,(0,H.pI)(A.fileArray,(P=>((0,H.uX)(),(0,H.CE)("div",{class:(0,v.C4)([A.styles["fileSectionWrap"],{[A.styles["error"]]:P.size>A.fileSizeLimit||A.getNetworkStatusType!==A.NetworkStatus.ONLINE}])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["fileSection"])},[A.isImage(P.name)?((0,H.uX)(),(0,H.CE)("img",{key:0,src:A.getFileURL(P),class:(0,v.C4)(A.styles["fileIcon"])},null,10,XH)):A.isTiff(P.name)?((0,H.uX)(),(0,H.Wv)(c,{key:1,"icon-name":"tiff-file-icon",class:(0,v.C4)(A.styles["fileIcon"])},null,8,["class"])):A.isPdf(P.name)?((0,H.uX)(),(0,H.Wv)(c,{key:2,"icon-name":"pdf",class:(0,v.C4)(A.styles["fileIcon"])},null,8,["class"])):A.isVideo(P.name)?((0,H.uX)(),(0,H.Wv)(c,{key:3,"icon-name":"video-player",class:(0,v.C4)(A.styles["fileIcon"])},null,8,["class"])):((0,H.uX)(),(0,H.Wv)(c,{key:4,"icon-name":"files",class:(0,v.C4)(A.styles["fileIcon"])},null,8,["class"])),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["fileInfo"])},[(0,H.Lk)("span",{class:(0,v.C4)(A.styles["fileName"])},(0,v.v_)(P.name),3),(0,H.Lk)("span",{class:(0,v.C4)(A.styles["fileSize"])},(0,v.v_)(A.formatBytes(P.size)),3)],2),(0,H.bF)(j,{class:(0,v.C4)(A.styles["deleteIcon"]),"icon-name":"delete",size:"size-15",onClick:f=>A.removeFile(P.name)},null,8,["class","onClick"])],2),P.size>A.fileSizeLimit?((0,H.uX)(),(0,H.CE)("div",{key:0,class:(0,v.C4)(A.styles["errorMessage"])},(0,v.v_)(f.$t("MBSS.file_limit")),3)):(0,H.Q3)("",!0),A.getNetworkStatusType!==A.NetworkStatus.ONLINE?((0,H.uX)(),(0,H.CE)("div",{key:1,class:(0,v.C4)(A.styles["errorMessage"])},(0,v.v_)(f.$t("MBSS.file_error_when_offline")),3)):(0,H.Q3)("",!0)],2)))),256))],2),(0,H.Lk)("div",{class:(0,v.C4)(A.styles["footer"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["formSubmit"])},[(0,H.Lk)("div",{class:(0,v.C4)(A.styles["formWrapLeft"])},[(0,H.bF)(X,{ref:"textEditor","editable-field-id":f.$globalElementIdRegistry.inputForAttachFiles,class:(0,v.C4)(A.styles["textarea"]),"max-length":A.textSizeLimit,onOnContent:A.onContent},null,8,["editable-field-id","class","max-length","onOnContent"])],2)],2),A.isMobile?((0,H.uX)(),(0,H.Wv)(O,{key:0,id:f.$globalElementIdRegistry.sendButtonForAttachFiles,disabled:A.sendFilesDisabled||A.getNetworkStatusType!==A.NetworkStatus.ONLINE,class:(0,v.C4)(A.styles["sendButton"]),icon:"send",onCustomClick:A.sendFiles},null,8,["id","disabled","class","onCustomClick"])):((0,H.uX)(),(0,H.Wv)(O,{key:1,id:f.$globalElementIdRegistry.sendButtonForAttachFiles,class:(0,v.C4)([A.styles["sendButton"],{[A.styles["disabledButton"]]:A.sendFilesDisabled||A.getNetworkStatusType!==A.NetworkStatus.ONLINE}]),disabled:A.sendFilesDisabled||A.getNetworkStatusType!==A.NetworkStatus.ONLINE,text:f.$t("MBSS.send_files"),onCustomClick:A.sendFiles},null,8,["id","class","disabled","text","onCustomClick"]))],2)],2)],2)],2)}var tH={modalMask:"tyYylsSKi5kvwbiv3knd",modalWrapper:"G_htKNPRc3gku4A5sGZn",modalContainer:"xhFER8WGp6EutLDOqCS1",modalHeader:"Qc0EVtqAsboASbkRIydP",heading:"TBzu_2na4aUbV8IJbXXk",closeIcon:"ACN9gi4bbNMJaQHoIGgv",description:"vI_omkmJMzYnHCbgsreI",errorContainer:"UXlxlh2UQVsAyfmS6j1a",loadFile:"toLbnWNnk4UNx6RxR8Ax",disabled:"EDcMoiJ9uZA4buHrYn4N",fileSectionWrap:"YaYk1Tg5pT4u_KdzKMAW",fileSection:"Ol66r9EApYdZatTAOUZ4",fileInfo:"Uf5RWhiphDINchDohjdf",fileIcon:"Fs4EG1Tc2K4J9uHifpF8",fileName:"_2Eam4RcV5YmlJnX2sUE",fileSize:"s0CVapsGar8YBeouRjez",deleteIcon:"rAQgWeUHkpbPpx8lR2NY",error:"iXxnVkBXf5ERPTUhcusW",errorMessage:"L1WjlDbAkhEyEpMYvI_U",modalBody:"A5w0BJE2uPYN08mp06Bl",footer:"Pg6TOU7TjZIqX8ifRSCH",formSubmit:"l7ZazkcQK_UyONr9r25B",formWrapLeft:"cEPOwb5kXuofnTy8nznm",textarea:"cO5eRxSGPEaoijks4ILh",sendButton:"t3GKTFeXH0Th1xyLuYoM",disabledButton:"Euk41lJzRIo6bjTM1pcT",fileList:"pOZL4_gtKHQnxIjEL4D5",uploadFileInput:"iGssVTKBrQFyQmvaI1Ha"},zH=n(9205),wH={name:"file-attach-modal",components:{TextEditor:pe,Icon:wf,CommonButton:Tf},props:{imagesArray:{type:Array,default:()=>[]}},emits:["hideModal"],setup(f,P){const n=Ve(),A=zn(),{sendMessage:e}=A,{getNetworkStatusType:v}=(0,O.bP)(A),r=(0,j.KR)(EP),c=(0,j.KR)(null),X=(0,j.KR)({}),x=(0,j.KR)(null),t=(0,j.KR)(""),z=(0,j.KR)([]),w=1e7,D=1e3,p=5,d="10 Mb";let T=null;const o=(0,H.EW)((()=>{let f=0;return Object.keys(X.value).forEach((P=>{f+=X.value[P].size})),f>w})),B=(0,H.EW)((()=>o.value||Object.keys(X.value).length>=p)),g=(0,H.EW)((()=>o.value||0===Object.keys(X.value).length||Object.keys(X.value).length>p)),u=f=>{const P=f.target.files,n=["image/*","video/*","application/pdf"];z.value=[];for(let A=0;Af.match(P)))?X.value[P[A].name]=P[A]:z.value.push(P[A].name)}c.value.value="",(0,H.dY)(),T.update()},s=f=>{t.value=f},M=f=>URL.createObjectURL(f),a=f=>{delete X.value[f],(0,H.dY)(),T.update()},l=(f,P=2)=>{if(!parseInt(f))return"0 Bytes";const n=1024,A=P<0?0:P,e=["Bytes","KB","MB"],H=Math.floor(Math.log(f)/Math.log(n));return`${parseFloat((f/Math.pow(n,H)).toFixed(A))} ${e[H]}`},b=()=>{const f=[];Object.keys(X.value).forEach((P=>{f.push(X.value[P])})),e(t.value,f),P.emit("hideModal")};return(0,H.sV)((async()=>{T=new zH.A(x.value,{wheelSpeed:1,swipeEasing:!0,scrollingThreshold:1500,wheelPropagation:!1,minScrollbarLength:50}),setTimeout(T.update,500)})),{styles:tH,uploadFile:c,onFileChanged:u,fileArray:X,getFileURL:M,isImage:In,isVideo:Wn,isPdf:Sn,isTiff:En,formatBytes:l,removeFile:a,fileList:x,maxSizeLimitError:o,sendFilesDisabled:g,onContent:s,fileSizeLimit:w,filesCountLimit:p,fileSizeLimitInMb:d,sendFiles:b,getNetworkStatusType:v,NetworkStatus:r,textSizeLimit:D,isMobile:n,addFilesDisabled:B,unsupportedFiles:z}}};const DH=(0,tf.A)(wH,[["render",xH]]);var pH=DH,dH={components:{ImageSlider:HH,MainView:$e,FileAttachModal:pH},setup(){const f=ef(),P=zn(),{getActiveView:n,getTranslations:A,getLanguageCode:e,getImagesForSlider:v,getTheme:r}=(0,O.bP)(f),{prependMessage:x}=P,{toggleActiveView:t,setImagesForSlider:z}=f,D=(0,X.s9)(),p=(0,j.KR)(!1);(0,H.wB)(A,(f=>{w(e.value,f,D)})),(0,H.wB)(n,(f=>{f===u.Main?(d(Date.now()),T("popup-support_chat")):(d(0),window.dispatchEvent(new CustomEvent("chat-micro-app-hide")))})),B("chat-micro-app-open",(f=>{if(n.value!==u.Main&&t(),f){const P={content:null===f||void 0===f?void 0:f.messageDraft,createdAt:(new Date).getTime(),files:void 0,id:`temp_msg_identity_${Date.now()}`,status:$P.Sending,type:_P.Customer};x(P)}})),(0,H.sV)((()=>{o({phase:"support_chat_instance_created"})}));const g=(0,H.EW)((()=>`${r.value}Theme`));return{styles:c,ActiveSupportView:u,getActiveView:n,getImagesForSlider:v,setImagesForSlider:z,resolvedThemeClass:g,showAttachFileModal:p}}};const TH=(0,tf.A)(dH,[["render",r]]);var oH=TH,BH=JSON.parse('{"mainView":"mbss-main-view","activator":"mbss-activator","collapseMainViewButton":"mbss-collapse-view-btn","sendMessageButton":"mbss-send-message-btn","messageTextInput":"mbss-message-text-input","closeChatButton":"mbss-close-chat-btn","closeConfirmationButton":"mbss-close-confirmation-btn","bottomActionButton":"mbss-bottom-action-btn","callButtonInActionBar":"mbss-call-btn-in-action-bar","requestButtonInActionBar":"mbss-request-btn-in-action-bar","cancelCallButtonInActionBar":"mbss-cancel-call-btn-in-action-bar","attachButton":"mbss-attach-btn","closeButtonForAttachFiles":"mbss-close-button-for-attach-files","loadMoreButtonForAttachFiles":"mbss-load-more-button-for-attach-files","sendButtonForAttachFiles":"mbss-send-button-for-attach-files","inputForAttachFiles":"mbss-input-for-attach-files","textMessageCounter":"mbss-text-message-counter","avatarManager":"mbss-avatar-manager","actionBarHeading":"mbss-action-bar-heading"}');class gH{constructor(f){(0,a.A)(this,"mainView",void 0),(0,a.A)(this,"activator",void 0),(0,a.A)(this,"collapseMainViewButton",void 0),(0,a.A)(this,"sendMessageButton",void 0),(0,a.A)(this,"messageTextInput",void 0),(0,a.A)(this,"closeChatButton",void 0),(0,a.A)(this,"closeConfirmationButton",void 0),(0,a.A)(this,"bottomActionButton",void 0),(0,a.A)(this,"callButtonInActionBar",void 0),(0,a.A)(this,"requestButtonInActionBar",void 0),(0,a.A)(this,"cancelCallButtonInActionBar",void 0),(0,a.A)(this,"attachButton",void 0),(0,a.A)(this,"closeButtonForAttachFiles",void 0),(0,a.A)(this,"loadMoreButtonForAttachFiles",void 0),(0,a.A)(this,"sendButtonForAttachFiles",void 0),(0,a.A)(this,"inputForAttachFiles",void 0),(0,a.A)(this,"textMessageCounter",void 0),(0,a.A)(this,"avatarManager",void 0),(0,a.A)(this,"actionBarHeading",void 0),(0,a.A)(this,"requiredAttributesList",["mainView","activator","collapseMainViewButton","sendMessageButton","messageTextInput","closeChatButton","closeConfirmationButton","bottomActionButton","callButtonInActionBar","requestButtonInActionBar","cancelCallButtonInActionBar","attachButton","closeButtonForAttachFiles","loadMoreButtonForAttachFiles","sendButtonForAttachFiles","inputForAttachFiles","textMessageCounter","avatarManager","actionBarHeading"]);const P=Object.keys(f),n=P.reduce(((P,n)=>{const A=P.indexOf(n);if(-1===A)throw new Error(`elements.json contains unknown property "${n}"`);if(!Yf(f[n]))throw new Error(`elements.json contains property "${n}" which should be non-empty string`);return this[n]=f[n],P.splice(A,1),P}),[...this.requiredAttributesList]);if(n.length>0)throw new Error(`elements.json should contain additional members : ${n.join(", ")}`)}}const uH={install:f=>{f.config.globalProperties.$globalElementIdRegistry=new gH(BH)}},sH={customElementTagName:"micro-app-support",events:{chatLoaded:"chat-micro-app-loaded",chatDestroyed:"chat-micro-app-destroy"}};let MH;const aH=f=>"0"===f,lH=["lang","player-id","theme","site-name","force-show","ip","browser","os","country","uuid","start-page","first-name","last-name","email","address","city","postal-code","state"];class bH extends HTMLElement{static get observedAttributes(){return lH}disconnectedCallback(){const f=ef();f.$reset()}async attributeChangedCallback(f,P,n){const e=ef();switch(f){case"force-show":A(n)&&e.getActiveView!==u.Main&&e.toggleActiveView();break;case"lang":try{new Intl.DateTimeFormat(n)}catch(H){const f="en";console.error(`Unsupported lang=${n} attribute value. Fallback one '${f}' is used`),n=f}e.setLanguageCode(n);break;case"player-id":e.setUserId(aH(n)?null:n);break;case"site-name":if(!Pf(n))throw new Error(`site-name ${n} atttribute value is not supported`);e.setSiteName(n);break;case"theme":if(!ff(n))throw new Error(`theme ${n} atttribute value is not supported`);e.setTheme(n);break;case"ip":e.setUserIp(n);break;case"os":e.setUserOs(n);break;case"browser":e.setUserBrowser(n);break;case"country":e.setUserCountryCode(n)}}constructor(){super(),MH=GH(),MH.mount(this)}}o({phase:"support_chat_loaded",success:!0,result:0}),window.addEventListener(sH.events.chatLoaded,(()=>{window.customElements.get(sH.customElementTagName)?(MH=GH(),MH.mount(document.querySelector(sH.customElementTagName))):window.customElements.define(sH.customElementTagName,bH)})),window.addEventListener(sH.events.chatDestroyed,(()=>{MH.unmount(),localStorage.removeItem("atkn")}));const GH=()=>(0,e.Ef)(oH).use((0,O.Ey)()).use(z).use(uH)},2424:function(f,P,n){var A={"./Pinned.svg":7125,"./add-contact.svg":7375,"./add-friends.svg":7020,"./arr-3-l.svg":9303,"./arr-3-r.svg":7121,"./arrow-left.svg":4868,"./arrow-right.svg":8667,"./arrow_down.svg":5021,"./attach.svg":3036,"./au.svg":2673,"./avatar.svg":6780,"./block-user.svg":9374,"./bot_icon.svg":8070,"./br.svg":1255,"./call-end.svg":1091,"./call.svg":7867,"./chat-btn.svg":6058,"./chat-collapsed.svg":8105,"./chat-icon.svg":4965,"./chat.en.svg":6504,"./chat.it.svg":6454,"./chat.ru.svg":9290,"./chat.svg":401,"./close-call-section.svg":8176,"./close.svg":8233,"./cross.svg":33,"./cross_m.svg":2889,"./currencies/AUD.svg":7549,"./currencies/BLR.svg":7327,"./currencies/CAD.svg":7511,"./currencies/EUR.svg":2711,"./currencies/INR.svg":1658,"./currencies/JPY.svg":5008,"./currencies/KRW.svg":3457,"./currencies/KZT.svg":7658,"./currencies/RUB.svg":5128,"./currencies/USD.svg":3687,"./currency_chip.svg":9507,"./delete.svg":2030,"./dislike.svg":6124,"./dog-quote.svg":8304,"./dog.svg":4283,"./email.svg":5389,"./end-call.svg":2331,"./eye.svg":4126,"./files.svg":8088,"./headset.svg":2019,"./like.svg":3914,"./line.svg":7469,"./message_delivered.svg":3969,"./message_read.svg":1027,"./message_send_failed.svg":2059,"./message_sent.svg":5001,"./message_waiting.svg":964,"./microphone-off.svg":5379,"./microphone.svg":5387,"./minimize.svg":4127,"./moderator.svg":4540,"./no.svg":814,"./ok.svg":4005,"./open-call-section.svg":6925,"./openNewWindow.svg":6607,"./pdf.svg":7431,"./phone.svg":7829,"./pin.svg":6316,"./play.svg":2761,"./record.svg":1652,"./rules.svg":728,"./screen-share-on.svg":4773,"./screen-share.svg":9429,"./search.svg":6491,"./send-message.svg":8327,"./send-moderator.svg":1199,"./send.svg":517,"./settings.svg":8144,"./sidebar-arrows-union.svg":6402,"./subtract.svg":483,"./tenants/drip/loader.svg":5366,"./tenants/drip/logo.svg":894,"./tenants/drip/minilogo.svg":6351,"./tenants/flagman/loader.svg":8509,"./tenants/flagman/logo.svg":8329,"./tenants/flagman/minilogo.svg":1508,"./tenants/fresh-basic/loader.svg":3436,"./tenants/fresh-basic/logo.svg":1728,"./tenants/fresh-basic/minilogo.svg":3733,"./tenants/fresh-dark/loader.svg":1222,"./tenants/fresh-dark/logo.svg":4862,"./tenants/fresh-dark/minilogo.svg":4223,"./tenants/gizbo/loader.svg":530,"./tenants/gizbo/logo.svg":874,"./tenants/gizbo/minilogo.svg":4763,"./tenants/irwin/loader.svg":7840,"./tenants/irwin/logo.svg":548,"./tenants/irwin/minilogo.svg":1225,"./tenants/izzi/loader.svg":1163,"./tenants/izzi/logo.svg":3939,"./tenants/izzi/minilogo.svg":1986,"./tenants/jet/loader.svg":1744,"./tenants/jet/logo.svg":7140,"./tenants/jet/minilogo.svg":1049,"./tenants/legzo/loader.svg":2324,"./tenants/legzo/logo.svg":9384,"./tenants/legzo/minilogo.svg":5661,"./tenants/lex/loader.svg":9434,"./tenants/lex/logo.svg":2306,"./tenants/lex/minilogo.svg":7203,"./tenants/martin/loader.svg":310,"./tenants/martin/logo.svg":1022,"./tenants/martin/minilogo.svg":319,"./tenants/monro-basic/loader.svg":6417,"./tenants/monro-basic/logo.svg":9597,"./tenants/monro-basic/minilogo.svg":456,"./tenants/monro-dark/loader.svg":8849,"./tenants/monro-dark/logo.svg":5069,"./tenants/monro-dark/minilogo.svg":504,"./tenants/onego/loader.svg":4717,"./tenants/onego/logo.svg":2281,"./tenants/onego/minilogo.svg":5268,"./tenants/rox/loader.svg":342,"./tenants/rox/logo.svg":7214,"./tenants/rox/minilogo.svg":8988,"./tenants/sol/loader.svg":6673,"./tenants/sol/logo.svg":10,"./tenants/sol/minilogo.svg":1688,"./tenants/starda/loader.svg":7938,"./tenants/starda/logo.svg":6042,"./tenants/starda/minilogo.svg":9851,"./tenants/volna/loader.svg":2079,"./tenants/volna/logo.svg":567,"./tenants/volna/minilogo.svg":902,"./tiff-file-icon.svg":7005,"./trash.svg":295,"./union.svg":6204,"./upload-2.svg":9961,"./upload.svg":9252,"./user.svg":2582,"./user_avatar.svg":2162,"./userpic.svg":622,"./vector_stroke.svg":2669,"./video-off.svg":2616,"./video-on.svg":9346,"./video-player.svg":5862,"./wifi-low.svg":6885,"./wifi-off.svg":7316};function e(f){var P=H(f);return n(P)}function H(f){if(!n.o(A,f)){var P=new Error("Cannot find module '"+f+"'");throw P.code="MODULE_NOT_FOUND",P}return A[f]}e.keys=function(){return Object.keys(A)},e.resolve=H,f.exports=e,e.id=2424}},P={};function n(A){var e=P[A];if(void 0!==e)return e.exports;var H=P[A]={exports:{}};return f[A].call(H.exports,H,H.exports,n),H.exports}n.m=f,function(){var f=[];n.O=function(P,A,e,H){if(!A){var v=1/0;for(j=0;j=H)&&Object.keys(n.O).every((function(f){return n.O[f](A[c])}))?A.splice(c--,1):(r=!1,H0&&f[j-1][2]>H;j--)f[j]=f[j-1];f[j]=[A,e,H]}}(),function(){var f,P=Object.getPrototypeOf?function(f){return Object.getPrototypeOf(f)}:function(f){return f.__proto__};n.t=function(A,e){if(1&e&&(A=this(A)),8&e)return A;if("object"===typeof A&&A){if(4&e&&A.__esModule)return A;if(16&e&&"function"===typeof A.then)return A}var H=Object.create(null);n.r(H);var v={};f=f||[null,P({}),P([]),P(P)];for(var r=2&e&&A;"object"==typeof r&&!~f.indexOf(r);r=P(r))Object.getOwnPropertyNames(r).forEach((function(f){v[f]=function(){return A[f]}}));return v["default"]=function(){return A},n.d(H,v),H}}(),function(){n.d=function(f,P){for(var A in P)n.o(P,A)&&!n.o(f,A)&&Object.defineProperty(f,A,{enumerable:!0,get:P[A]})}}(),function(){n.f={},n.e=function(f){return Promise.all(Object.keys(n.f).reduce((function(P,A){return n.f[A](f,P),P}),[]))}}(),function(){n.u=function(f){return"npmliveswitch.chat.chat."+n.h().slice(0,8)+".js"}}(),function(){n.miniCssF=function(f){}}(),function(){n.h=function(){return"65c0672f5c48155b"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(f){if("object"===typeof window)return window}}()}(),function(){n.o=function(f,P){return Object.prototype.hasOwnProperty.call(f,P)}}(),function(){var f={},P="@mf/support:";n.l=function(A,e,H,v){if(f[A])f[A].push(e);else{var r,c;if(void 0!==H)for(var O=document.getElementsByTagName("script"),j=0;j