1"use strict"; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="11e950b2-7b98-5965-a9b4-cc56289f290d")}catch(e){}}(); 3(self.webpackChunkclient=self.webpackChunkclient||[]).push([["3841"],{49518(e,s,t){t.d(s,{L:()=>l});var i=t(15526),n=t(30495),a=t(79942),o=t(38107),r=t(97983),c=t(50846),h=t(50042);class l extends c.Q{constructor(e){super("winemback.authentication",e,()=>(0,n.Yq)(n.jI.shared().tokens["jwt/retention"].post,this.userId).pipe((0,a.vV)(e=>{var s,{token:t,xhr:i}=e;return{data:t,ttl:(null==(s=(0,h.a)(i))?void 0:s.maxAge)||Number.MAX_SAFE_INTEGER}}),(0,a.ex)(e=>{this.setState(e.data,void 0,e.ttl)}))),this.setState(null,void 0,Number.MAX_SAFE_INTEGER),this.userId=e,this.refreshSubject=new o.m(1)}refresh(){this.refreshSubject.next(void 0)}shouldRefreshData(){return this.refreshSubject.pipe((0,r.u)(()=>!0))}auth(){return(0,n.p6)(n.jI.shared().tokens["jwt/retention"].post,this.userId).pipe((0,a.vV)(e=>{var s,{data:t,xhr:i}=e;return{data:t.token,ttl:(null==(s=(0,h.a)(i))?void 0:s.maxAge)||Number.MAX_SAFE_INTEGER}}),(0,a.ex)(e=>{var{data:s,ttl:t}=e;this.setState(s,void 0,t)}))}}l.shared=(0,i.G)(e=>new l(e))},93719(e,s,t){t.d(s,{q:()=>g});var i=t(8733),n=t(82788),a=t(30131),o=t(38107),r=t(97156),c=t(17524),h=t(15526),l=t(94375),u=t(74380),d=t(28138),p=t(84190),b=t(53940),m=t(36580),v=t(49518),k=5*l.b.second;class f{constructor(e,s,t,a,o){this.ws=null,this.retry=0,this.timer=null,this.isOpened=!1,this.close=()=>{this.closeWebSocket(),this.messagesSubject.complete(),this.subscription.unsubscribe()},this.update=e=>{e!==this.userId&&(this.userId=e,this.isOpened&&this.closeWebSocket(),this.userId&&this.connect(this.userId))},this.makeUrl=e,this.apiHost=s,this.token=t,this.maxRetry=a,this.fallback=o,this.messagesSubject=new i.B,this.messages=this.messagesSubject.asObservable(),this.subscription=new n.yU,this.subscription.add(u.o.shared().data().pipe((0,d.T)(e=>e.id)).safeSubscribe(e=>this.update(e)))}connect(e){if(this.maxRetry&&++this.retry>this.maxRetry){this.fallback&&this.fallback();return}(0,a.H)(fetch("https://"+this.apiHost+"/contacts/"+e+"/notifications/shards",{headers:{authorization:'External jwt="'+this.token+'"'}})).pipe((0,p.n)(e=>e.json())).safeSubscribe(s=>{var t=new WebSocket(this.makeUrl(s.key,s.shard));this.ws=t,t.onopen=()=>{this.retry=0,this.isOpened=!0,this.onOpen&&this.onOpen()},t.onmessage=e=>{this.messagesSubject.next(e)},t.onerror=()=>{this.isOpened=!1,this.onClose&&this.onClose()},t.onclose=()=>{this.isOpened=!1,this.reconnect(e),this.onClose&&this.onClose()}})}send(e){return!!this.ws&&!!this.isOpened&&(this.ws.send(e),!0)}reconnect(e){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.connect(e)},k)}closeWebSocket(){this.ws&&(this.timer&&clearTimeout(this.timer),this.timer=null,this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.close(),this.ws=null,this.isOpened=!1,this.retry=0)}}class g{constructor(e){this.connection=null,this.hosts=new o.m(1),this.activeSubject=new r.t(!1),this.userId=e,this.messagesSubject=new i.B,this.messages=this.messagesSubject.asObservable(),this.token=v.L.shared(this.userId).data().pipe((0,b.p)(e=>!!e),(0,m.t)(1))}makeUrl(e,s,t){return"wss://rt"+s+"."+t+"/contacts/notifications/ws?key="+e}setHosts(e,s){this.hosts.next({api:e,websocket:s})}controlConnection(e){this.activeSubject.getValue()!==e&&(e?this.open():this.close())}open(){this.activeSubject.next(!0),(0,c.z)([this.hosts,this.token]).safeSubscribe(e=>{var[s,t]=e;this.connection=new f((e,t)=>this.makeUrl(e,t,s.websocket),s.api,t),this.connection.messages.safeSubscribe(e=>{if(e.data)try{var s=JSON.parse(e.data);this.messagesSubject.next(s)}catch(e){}})})}closeSocket(){this.connection&&(this.connection.close(),this.connection=null)}close(){this.activeSubject.next(!1),this.closeSocket()}}g.shared=(0,h.G)(e=>new g(e))},83358(e,s,t){t.d(s,{WinembackPopup:()=>w});var i=t(42062),n=t(10519),a=t(64147),o=t(63196),r=t(31085);let c=(0,i.memo)(e=>{var{content:s,containerRef:t,onClick:i,onClose:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{onClick:n}),(0,r.jsx)("div",{ref:t,className:"notifications-winemback-popup__content",dangerouslySetInnerHTML:{__html:s},onClick:i})]})});var h=t(91994),l=t(64651),u=t(66691),d=t(58245),p=t(60688),b=t(15526),m=t(12640);class v{constructor(e){this.userId=e}logShown(e,s,t){m._.shared(this.userId).logEvent("retention-popup-shown",{"message-id":e,reason:s,page:t}).safeSubscribe()}logCloseClicked(e){m._.shared(this.userId).logEvent("retention-popup-close-clicked",{"message-id":e}).safeSubscribe()}logCtaClicked(e){m._.shared(this.userId).logEvent("retention-popup-cta-clicked",{"message-id":e}).safeSubscribe()}}v.shared=(0,b.G)(e=>new v(e));var k=t(90786),f="data-track-click",g=(0,i.memo)(e=>{var s,{id:t,reason:n,userId:a,onClose:o}=e,h=(s=(0,i.useRef)(null),(0,i.useEffect)(()=>{var e=s.current;if(e){var i=e=>{var s=e.target,i=null==s?void 0:s.closest("["+f+"]"),n=null==i?void 0:i.dataset.trackClick;n&&p.j.shared().logNotificationOpened(t,n)};return e.addEventListener("click",i),()=>{e.removeEventListener("click",i)}}},[t]),(0,i.useEffect)(()=>{var e=s.current;if(e){var i=e.querySelectorAll("[data-track-view]");if(0!==i.length){var n=new IntersectionObserver(e=>
3{e.forEach(e=>{if(e.isIntersecting){var s=e.target.dataset.trackView;s&&p.j.shared().logNotificationDisplayed(t,s),n.unobserve(e.target)}})});return i.forEach(e=>n.observe(e)),()=>{n.disconnect()}}}},[t]),s),l=(0,i.useCallback)(e=>{var s=e.target,i=null==s?void 0:s.closest("a");i&&i.hostname===location.hostname&&i.pathname===location.pathname&&i.search===location.search&&(v.shared(a).logCtaClicked(t),null===i.closest("["+f+"]")&&p.j.shared().logNotificationOpened(t))},[t,a]);(0,i.useEffect)(()=>{p.j.shared().logNotificationDisplayed(t),v.shared(a).logShown(t,n,(0,k.p)())},[t,n,a]);var u=(0,i.useCallback)(()=>{v.shared(a).logCloseClicked(t),null==o||o()},[t,a,o]);return(0,r.jsx)(c,Object.assign({},e,{containerRef:h,onClick:l,onClose:u}))}),w=(0,i.memo)(()=>{var e=(0,h.w)(),{offer:s,acceptOffer:t}=(0,a.g)(e?n.m.shared(e):void 0);(0,l.Fd)(()=>{null==t||t()},[t]);var i=(0,u.uN)(d.A,[]);return e&&s?(0,r.jsx)(g,{content:s.content,id:s.messageId,reason:s.event,userId:e,onClose:i}):null})},90786(e,s,t){t.d(s,{p:()=>i});function i(){var e=window.location.hash.replace(/^#/,"");return e.includes("inbox")?"inbox":""===e||e.includes("search")?"search_results":isNaN(Number(e))?"other":"profile"}},60688(e,s,t){t.d(s,{j:()=>a});var i=t(15526),n=t(33799);class a{logNotificationReceived(e){n.V.shared().trackNotificationReceived({messageId:e})}logNotificationDisplayed(e,s){n.V.shared().trackNotificationDisplayed({messageId:e,source:s})}logNotificationOpened(e,s){n.V.shared().trackNotificationOpened({messageId:e,source:s})}}a.shared=(0,i.G)(()=>new a)}}]); 4//# sourceMappingURL=sourcemaps/0369ae5fc4f71145.js.map 5//# debugId=11e950b2-7b98-5965-a9b4-cc56289f290d
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.