PageSourceSearch

https://www.ourlove.com/app/6134.cb8b8a40f60fef54.js

js ourlove.com collected 2026-10-04 09:10:36 UTC 723,082 bytes, 5 lines download raw bytes

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]="b1106f6d-f047-5e1b-bce6-5704e3236c41")}catch(e){}}();
3(self.webpackChunkclient=self.webpackChunkclient||[]).push([["6134"],{60308(e,s,t){t.d(s,{co:()=>r,td:()=>i,wj:()=>n});var r=RegExp("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\x01-\b\v\f\x0e-\x1f!#-[]-\x7f]|\\\\[\x01-	\v\f\x0e-\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\b\v\f\x0e-\x1f!-ZS-\x7f]|\\\\[\x01-	\v\f\x0e-\x7f])+)\\])","i"),a=RegExp("^"+r.source+"$",r.flags),i=e=>a.test(e.trim());function n(e){if(!i(e))return null;var s=e.split("@");return{name:s[0],domain:s[1]}}},6176(e,s,t){t.d(s,{I:()=>l});var r=t(97156),a=t(34578),i=t(28138),n=t(53193),d=t(53940),o=t(15654),u=t(39971);class l{constructor(){this.offeringHasResult=new r.t(!1)}interceptCanOffer(e){return(0,a.h)(e.pipe((0,n.Q)(this.offeringHasResult.pipe((0,d.p)(e=>e)))),this.offeringHasResult.pipe((0,d.p)(e=>e),(0,i.T)(()=>!1),(0,o.F)()))}afterOfferAccept(e){return this.trackOfferingResult(e)}afterOfferReject(e){return this.trackOfferingResult(e)}afterOfferPostpone(e){return this.trackOfferingResult(e)}trackOfferingResult(e){return u.v.defer(()=>(e.isSuccessful&&this.offeringHasResult.next(!0),u.v.just(void 0)))}}},93623(e,s,t){t.d(s,{q:()=>l});var r=t(30495),a=t(15526),i=t(50846),n=t(86977),d=t(79942),o=t(28138),u=t(34578);class l extends i.Q{constructor(e){super("bonuses.account",e,()=>(0,r.Yq)(r.jI.shared().bonuses.accounts.balance.get,e).pipe((0,d.vV)(e=>({data:e,ttl:Number.MAX_SAFE_INTEGER})))),this.userId=e}dataUpdates(){return(0,u.h)(n.I.shared(this.userId).events("event.bonuses.accounts.balance.credited"),n.I.shared(this.userId).events("event.bonuses.accounts.balance.debited")).pipe((0,o.T)(e=>({data:{balance:e.balance},ttl:Number.MAX_SAFE_INTEGER})))}}l.shared=(0,a.G)(e=>new l(e))},69989(e,s,t){t.d(s,{x:()=>d});var r=t(15526),a=t(48830),i=t(30495),n=t(54157);class d{constructor(e){this.userId=e}feed(e){return new a.c(s=>{i.jI.shared().dialogs.media.fragments[e.type].feed({select:e.select,omit:e.omit,"user-id":e.userId,"attendee-id":e.attendeeId},(e,t)=>{e?s.error(e):s.next((t&&t["video-fragments"]||[]).map(e=>{var s=new Date(e.created);return{userId:e["user-id"],attendeeId:e["attendee-id"],created:s.toISOString()===e.created||e.created.includes("Z")?s:new Date(e.created+"Z"),baseName:e["base-name"],description:e.description}})),s.complete()})})}upload(e,s,t){var r="/dialogs/media/fragments/"+e+"/"+this.userId+"/"+s;return n.l.shared().upload(r,t)}patchFragmentData(e,s,t,r){return new a.c(a=>{i.jI.shared().dialogs.media.fragments[e].patch(this.userId,s,t,r,e=>{e&&a.error(e),a.complete()})})}}d.shared=(0,r.G)(e=>new d(e))},44081(e,s,t){t.d(s,{B:()=>w});var r=t(30495),a=t(15526),i=t(50846),n=t(50042),d=t(79942),o=t(39971),u=t(53940),l=t(84190),c=t(56177),h=t(28138),p=t(97983),v=t(86977),m=t(5801),f=t(94375),b=t(52372),g="call.missed",I=f.b.hour;class w extends i.Q{constructor(e){super("call.missed-call-counter",e,()=>(0,r.p6)(s=>r.jI.shared().users.events.get(e,{types:"+"+g},s,{Accept:"application/json+vnd.sdv.numeric"})).pipe((0,d.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:{missedCallsAmount:(null==t?void 0:t[g+"-fresh"])||0},ttl:(null==(s=(0,n.a)(r))?void 0:s.maxAge)||I}}),(0,d.ZC)(()=>o.v.just({data:{missedCallsAmount:0},ttl:0})))),this.userId=e}dataUpdates(e){return v.I.shared(this.userId).events("event.users.events.added").pipe((0,u.p)(e=>{var s;return s=this.userId,!e.stale&&e.type===g&&e["holder-id"]===s}),(0,l.n)(()=>e(void 0).pipe((0,c.s)(1),(0,m.o)(),(0,h.T)(e=>({options:void 0,data:{missedCallsAmount:(e.data.missedCallsAmount||0)+1},ttl:I})))))}shouldRefreshData(){return v.I.shared(this.userId).realtimeDataShouldBeInvalidated.pipe((0,p.u)(()=>!0))}reset(){return o.v.defer(()=>{var e=this.addOptimisticStateTransformation(()=>({missedCallsAmount:0}));return(0,r.Yq)(r.jI.shared().users.events.patch,this.userId,{type:g,stale:!0}).pipe((0,b.rQ)(e),(0,d.vV)(()=>void 0))})}}w.shared=(0,a.G)(e=>new w(e))},32139(e,s,t){t.d(s,{m:()=>I});var r=t(15526),a=t(38107),i=t(97156),n=t(34578),d=t(56823),o=t(30495),u=t(84190),l=t(97983),c=t(56177),h=t(79942),p=t(86977),v=t(39971),m=t(63984),f=t(58731),b=[{id:"dog",answerVariants:["big-dog","small-dog"]},{id:"living-place",answerVariants:["cottage","apartments"]},{id:"road",answerVariants:["road-1","road-2"]},{id:"car",answerVariants:["sedan","suv"]},{id:"activity",answerVariants:["hiking","board-game"]},{id:"vacation",answerVariants:["museum","beach"]},{id:"dance",answerVariants:["waltz","modern"]},{id:"character",answerVariants:["shrek","captain-hook"]},{id:"drink",answerVariants:["tea","coffee"]},{id:"food",answerVariants:["sushi","steak"]},{id:"outfit",answerVariants:["casual","evening-dress"]},{id:"movie",answerVariants:["fast-n-furious","titanic"]},{id:"body-part",answerVariants:["chest","backside"]},{id:"first-date",answerVariants:["flirting","not-flirting"]},{id:"music-band",answerVariants:["acdc","beatles"]},{id:"brand",answerVariants:["ios","android"]},{id:"sport",answerVariants:["soccer","ice-skating"]},{id:"fear",answerVariants:["spider","perfectionist-hell"]},{id:"genie-wish",answerVariants:["money","love"]},{id:"season",answerVariants:["winter","summer"]}],g="shown-questions";
3class I{constructor(e){this.quizStatusChangedSubject=new a.m(1),this.quizStatusChanged=this.quizStatusChangedSubject.asObservable(),this.questionsSubject=new a.m(1),this.questions=this.questionsSubject.asObservable(),this.answersSubject=new i.t([]),this.answers=this.answersSubject.asObservable(),this.activeQuestionIndexSubject=new i.t(0),this.activeQuestionIndex=this.activeQuestionIndexSubject.asObservable(),this.visibility=new i.t(!0),this.visible=this.visibility.asObservable(),this.blockingReasonSubject=new a.m(1),this.blockingReason=this.blockingReasonSubject.asObservable(),this.idSubject=new i.t(void 0),this.id=this.idSubject.asObservable(),this.shownQuestionsSubject=new a.m(1),this.userId=e,this.persistence=f.y.shared("call-quiz",e),this.shownQuestions=(0,n.h)(this.persistence.load(g).pipe((0,h.vV)(e=>e||[])),this.shownQuestionsSubject.asObservable())}incrementActiveQuestionIndex(){var e=this.activeQuestionIndexSubject.getValue();this.activeQuestionIndexSubject.next(e+1)}prepareQuizData(e){var s=e.map(()=>({userAnswer:void 0,attendeeAnswer:void 0}));this.questionsSubject.next(e),this.answersSubject.next(s)}reset(){this.quizStatusChangedSubject.next({name:"idle"}),this.activeQuestionIndexSubject.next(0),this.questionsSubject.next([]),this.answersSubject.next([]),this.visibility.next(!0),this.blockingReasonSubject.next(void 0),this.idSubject.next(void 0)}start(e){e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.start").safeSubscribe(e=>{this.quizStatusChangedSubject.next({name:"active"});var s=(e.data||[]).map(e=>Object.assign({},e,{answerVariants:e["answer-variants"]}));this.idSubject.next(e.id),this.prepareQuizData(s)})),e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.question.next").safeSubscribe(()=>{this.incrementActiveQuestionIndex()})),e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.answer").safeSubscribe(e=>{var s=this.answersSubject.getValue().map((s,t)=>(t===e.question&&(s.attendeeAnswer=e.answer),s));this.answersSubject.next(s)})),e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.finish").safeSubscribe(e=>{this.quizStatusChangedSubject.next({name:"finished",senderId:e.sender,quizId:e["quiz-id"],recipientId:this.userId})})),e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.hide").safeSubscribe(()=>{this.visibility.next(!1)})),e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.show").safeSubscribe(()=>{this.visibility.next(!0)})),e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.intro.show").safeSubscribe(()=>{this.quizStatusChangedSubject.next({name:"intro"})})),e.add(p.I.shared(this.userId).events("ci:event.video-call-quiz.reject").safeSubscribe(()=>{this.reset()})),e.add(this.shownQuestionsSubject.pipe((0,u.n)(e=>this.persistence.store(g,e))).safeSubscribe())}checkAttendeeAvailability(e){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.attendee.availability.check",payload:{sender:this.userId}}).pipe((0,h.Fg)(()=>(0,n.h)((0,d.O)(1e4).pipe((0,l.u)({available:!1,reason:"noreply"})),p.I.shared(this.userId).events("ci:event.video-call-quiz.attendee.availability").pipe((0,c.s)(1))).toSingle().pipe((0,h.ex)(e=>{!e.available&&e.reason&&this.blockingReasonSubject.next(e.reason)}),(0,h.vV)(e=>e.available))))}sendAvailability(e,s,t){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.attendee.availability",payload:{sender:this.userId,available:s,reason:t}}).pipe((0,h.AB)(void 0))}startQuiz(e,s){var t=(0,m.A)();return this.shownQuestions.toSingle().pipe((0,h.Fg)(e=>e&&b.length-e.length<s?(this.shownQuestionsSubject.next([]),v.v.just([])):v.v.just(e)),(0,h.Fg)(r=>{var a=r.length?b.filter(e=>!r.includes(e.id)):b;a.length<s&&(a=b);var i=a.map(e=>e).sort(()=>.5-Math.random()).slice(0,s);return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.start",payload:{sender:this.userId,data:i,id:t}}).pipe((0,h.ex)(()=>{this.idSubject.next(t),this.quizStatusChangedSubject.next({name:"active"}),this.prepareQuizData(i)}),(0,h.AB)(void 0))}))}stopQuiz(){return new v.v(e=>{this.reset(),e.success(void 0)})}rejectQuizOffer(e){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.reject",payload:{sender:this.userId}}).pipe((0,h.ex)(()=>{this.reset()}),(0,h.AB)(void 0))}nextQuestion(e){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.question.next",payload:{sender:this.userId}}).pipe((0,h.ex)(()=>{this.incrementActiveQuestionIndex()}),(0,h.AB)(void 0))}sendAnswer(e,s,t){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.answer",payload:{sender:this.userId,question:s,answer:t}}).pipe((0,h.ex)(()=>
3{var e=this.answersSubject.getValue().map((e,r)=>(r===s&&(e.userAnswer=t),e));this.answersSubject.next(e)}),(0,h.AB)(void 0))}finishQuiz(e,s){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.finish",payload:{sender:this.userId,quizId:s}}).pipe((0,h.ex)(()=>{this.quizStatusChangedSubject.next({name:"finished",senderId:this.userId,recipientId:e,quizId:s})}),(0,h.AB)(void 0))}sendQuizResults(e,s,t){return(0,o.Yq)(o.jI.shared().dialogs.media.interactive.put,this.userId,e,s,{questionsCount:t.questionsCount,matchedCount:t.matchedCount,details:{answers:t.answers}})}hideQuiz(e){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.hide",payload:{sender:this.userId}}).pipe((0,h.ex)(()=>{this.visibility.next(!1)}),(0,h.AB)(void 0))}showQuiz(e){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.show",payload:{sender:this.userId}}).pipe((0,h.ex)(()=>{this.visibility.next(!0)}),(0,h.AB)(void 0))}showIntro(e){return(0,o.Yq)(o.jI.shared().events.post,e,{label:"event.video-call-quiz.intro.show",payload:{sender:this.userId}}).pipe((0,h.ex)(()=>{this.quizStatusChangedSubject.next({name:"intro"})}),(0,h.AB)(void 0))}quizResults(e,s,t){return(0,o.Yq)(o.jI.shared().dialogs.media.interactive.get,e,s,t).pipe((0,h.vV)(e=>e.details.answers))}markQuestionAsShown(e){return this.shownQuestions.toSingle().pipe((0,h.Fg)(s=>{if(!s.includes(e)){var t=[...s,e];this.shownQuestionsSubject.next(t)}return v.v.just(void 0)}))}}I.shared=(0,r.G)(e=>new I(e))},46120(e,s,t){t.d(s,{U:()=>h});var r=t(15526),a=t(50846),i=t(86977),n=t(92453),d=t(53940),o=t(28138),u=t(30495),l=t(79942),c=t(39971);class h extends a.Q{constructor(e){super("cheers.animation",e,()=>c.v.just({data:{messageTag:"",attendeeId:""},ttl:0})),this.userId=e}animate(e,s){return(0,u.p6)(u.jI.shared().v2.dialogs.cheers.vibrate.post,this.userId,e,{messageId:s}).pipe((0,l.vV)(()=>void 0))}resetData(){this.setState({messageTag:"",attendeeId:""},void 0,0)}dataUpdates(){return i.I.shared(this.userId).events("event.cheers.vibration.added").pipe((0,n.M)(()=>this.resetData()),(0,d.p)(e=>e["recipient-id"]===this.userId),(0,o.T)(e=>({options:void 0,data:{messageTag:e["message-id"],attendeeId:e["recipient-id"]},ttl:0})))}}h.shared=(0,r.G)(e=>new h(e))},44853(e,s,t){t.d(s,{n:()=>o});var r=t(50846),a=t(15526),i=t(30495),n=t(79942),d=t(50042);class o extends r.Q{constructor(e){super("dialogs.smiles.personalized",e,s=>(0,i.p6)(i.jI.shared().v3.smiles["personalized-list"],e,s).pipe((0,n.vV)(e=>{var s,t,{data:r,xhr:a}=e;return{data:r.smilesPacks,ttl:null!=(s=null==(t=(0,d.a)(a))?void 0:t.maxAge)?s:0}})))}}o.shared=(0,a.G)(e=>new o(e))},38806(e,s,t){t.d(s,{mK:()=>A});var r=t(50846),a=t(15526),i=t(34578),n=t(40554),d=t(86977),o=t(28138),u=t(53940),l=t(15654),c=t(50626),h=t(56177),p=t(84190),v=t(72678),m=t(22998),f=t(79942),b=t(58456),g=t(4938),I=t(39971),w=t(94375),S="stickers-pass-data-model",y="expiration";class A extends r.Q{constructor(e){super("dialogs.stickers.pass",e,()=>I.v.zip(v.g.shared(this.userId).data({productType:"sticker-pass"}).toSingle(),b.o.shared(e).data().pipe((0,o.T)(e=>e.includes("stickers.pass.active"))).toSingle(),g.E.shared().currentTime().pipe((0,f.Fg)(e=>m.w.shared(S,this.userId).update(y,s=>s&&s>e?s:void 0)))).pipe((0,f.vV)(e=>{var[s,t,r]=e,a=s[0];return a?{data:{price:a.price,duration:a.properties.duration*w.b.second,active:t,expiresAt:r},ttl:Number.MAX_SAFE_INTEGER}:{data:null,ttl:0}}))),this.userId=e}dataUpdates(e){var s=d.I.shared(this.userId).events("event.store.product.purchased").pipe((0,u.p)(e=>"sticker-pass"===e["product-type"]),(0,o.T)(e=>new Date(e.expiration).getTime())),t=b.o.shared(this.userId).data().pipe((0,o.T)(e=>e.includes("stickers.pass.active")),(0,l.F)(),(0,c.J)(),(0,u.p)(e=>{var[s,t]=e;return s&&!t}),(0,o.T)(()=>void 0));return(0,i.h)(s,t).pipe((0,n.H)(s=>e(void 0).pipe((0,h.s)(1),(0,p.n)(e=>m.w.shared(S,this.userId).store(y,s).pipe((0,f.vV)(()=>e))),(0,u.p)(e=>!!e),(0,o.T)(e=>({data:Object.assign({},e.data,{active:void 0!==s,expiresAt:s}),ttl:Number.MAX_SAFE_INTEGER})))))}}A.shared=(0,a.G)(e=>new A(e))},22871(e,s,t){t.d(s,{S:()=>f});var r=t(50846),a=t(15526),i=t(30495),n=t(79942),d=t(50042),o=t(28138),u=t(40554),l=t(56607),c=t(56177),h=t(86977),p=t(5801),v=t(39971),m=t(52372);class f extends r.Q{constructor(e){super("dialogs.stickers.tasks",e,()=>(0,i.p6)(i.jI.shared().v3.stickers.tasks.get,e).pipe((0,n.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t,ttl:(null==(s=(0,d.a)(r))?void 0:s.maxAge)||Number.MAX_SAFE_INTEGER}}))),this.userId=e}shouldRefreshData(){return h.I.shared(this.userId).events("stickers.tasks.updated").pipe((0,o.T)(e=>()=>e["user-id"]===this.userId&&1===e.status))}dataUpdates(e){return h.I.shared(this.userId).events("stickers.tasks.updated").pipe((0,u.H)(s=>s["user-id"]!==this.userId||0!==s.status?l.w:e(void 0).pipe((0,c.s)(1),(0,p.o)(),(0,o.T)(e=>{var{instances:t,settings:r}=e.data,a=s=>
3({data:{settings:r,instances:s},ttl:e.expiration}),i=t.findIndex(e=>e.taskName===s["task-name"]&&e.payload.packName===s.instance.payload["pack-name"]);return a(-1===i?[...t,{taskName:s["task-name"],state:s.instance.state,payload:{packName:s.instance.payload["pack-name"]}}]:t.map((e,t)=>t===i?Object.assign({},e,{state:s.instance.state}):e))}))))}create(e){return v.v.defer(()=>{var s=this.addOptimisticStateTransformation(s=>{var t,{settings:r,instances:a}=s,i=null==(t=r.find(s=>s.taskName===e.taskName))?void 0:t.packName;if(!i)return s;var n=a.findIndex(s=>s.payload.packName===i&&s.taskName===e.taskName);return -1===n?s:{settings:r,instances:a.map((e,s)=>s===n?Object.assign({},e,{state:"1.0.face.check.inprogress"}):e)}});return(0,i.Yq)(i.jI.shared().v3.stickers.tasks.post,this.userId,e.taskName,{expectedCredits:e.expectedCredits,payload:{photoUrl:e.photoUrl}}).pipe((0,m.rQ)(s))})}updateTask(e,s){return v.v.defer(()=>{var t=this.addOptimisticStateTransformation(s=>{var t,{settings:r,instances:a}=s,i=null==(t=r.find(s=>s.taskName===e))?void 0:t.packName;if(!i)return s;var n=a.findIndex(s=>s.payload.packName===i&&s.taskName===e&&("3.1.generation.attempt.failed"===s.state||"2.2.payment.failed"===s.state||"2.1.insufficient.funds"===s.state||"1.1.face.check.failed"===s.state));return -1===n?s:{settings:r,instances:a.map((e,s)=>{if(s===n){var t="1.1.face.check.failed"===e.state?"1.0.face.check.inprogress":"3.0.generation.inprogress";return Object.assign({},e,{state:t})}return e})}});return(0,i.Yq)(i.jI.shared().v3.stickers.tasks.patch,this.userId,e,{payload:s?{photoUrl:s}:null}).pipe((0,m.rQ)(t))})}deleteTask(e){return v.v.defer(()=>{var s=this.addOptimisticStateTransformation(s=>({settings:s.settings,instances:s.instances.filter(s=>s.taskName!==e)}));return(0,i.Yq)(i.jI.shared().v3.stickers.tasks.delete,this.userId,e).pipe((0,m.rQ)(s))})}}f.shared=(0,a.G)(e=>new f(e))},51234(e,s,t){t.d(s,{N:()=>u});var r=t(15526),a=t(30495),i=t(48830),n=t(56177),d=t(39971),o=t(79942);class u{constructor(e){this.userId=e}suspend(e){return(0,a.br)(a.jI.shared().dialogs.automation.properties.update,"invitation.video",this.userId,{"suspension-duration":e,suspended:!0})}declineVideo(e,s){return(0,a.br)(a.jI.shared().users.videos.invitation.tags.put,e,s,"declined").pipe((0,n.s)(1))}removeTagFromVideo(e,s,t){return(0,a.br)(a.jI.shared().users.videos.invitation.tags.delete,e,s,t).pipe((0,n.s)(1))}videos(e,s,t){return new i.c(r=>{a.jI.shared().users.wildcard.videos.invitation.get({select:e,omit:s,oldest:!!t.oldest,"filter.user-id":t.ownerId,"filter.tags":t.tags},(e,s)=>{e?r.error(e):r.next((s&&s.files||[]).map(e=>({created:new Date(e.created),baseName:e.basename,basePath:e.basepath,tags:e.tags}))),r.complete()})})}tags(e,s){return(0,a.Yq)(a.jI.shared().users.videos.invitation.tags.get,e,s).pipe((0,o.vV)(e=>e.tags),(0,o.ZC)(e=>404===e.status?d.v.just([]):d.v.just(["unapproved"])))}}u.shared=(0,r.G)(e=>new u(e))},61585(e,s,t){t.d(s,{y:()=>c});var r=t(50846),a=t(30495),i=t(15526),n=t(39971),d=t(79942),o=t(52372),u=t(8733),l=t(97983);class c extends r.Q{constructor(e){super("notifications.subscriptions",e,s=>new n.v(t=>{a.jI.shared().v2.notifications.subscriptions.get(s,e,(e,s)=>{if(e)t.error(e);else{var r;t.success({data:Object.keys(r=(null==s?void 0:s.subscriptions)||{}).reduce((e,s)=>(e[s]=+!!r[s].Subscribed,e),{}),ttl:0})}})}
3)),this.userId=e,this.refreshDataSubject=new u.B}patch(e,s,t){return n.v.defer(()=>{var r=this.addOptimisticStateTransformation(e=>Object.assign({},e,s),e);return(0,a.Yq)(a.jI.shared().v2.notifications.subscriptions.patch,e,this.userId,{subscriptions:s,meta:t}).pipe((0,d.ex)(()=>this.refreshDataSubject.next()),(0,o.rQ)(r))})}shouldRefreshData(){return this.refreshDataSubject.pipe((0,l.u)(()=>!0))}}c.shared=(0,i.G)(e=>new c(e))},16824(e,s,t){t.d(s,{a:()=>I});var r=t(4126),a=t(75841),i=t(40554),n=t(84190),d=t(56177),o=t(97983),u=t(5801),l=t(30495),c=t(15526),h=t(54157),p=t(50846),v=t(52372),m=t(79942),f=t(74380),b=t(50042),g=t(39971);class I extends p.Q{constructor(e){super("user.story",e,()=>f.o.shared().data().toSingle().pipe((0,m.Fg)(s=>s.id&&s.id!==e?(0,l.p6)(l.jI.shared().stories.feed.story.get,s.id,e).pipe((0,m.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t,ttl:(null==(s=(0,b.a)(r))?void 0:s.maxAge)||0}})):new g.v(s=>{l.jI.shared().stories.fragments.origin.get(e,(t,r)=>{r?s.success({data:{id:e,fragments:r.files,ctr:0},ttl:0}):s.error(t)},{accept:"application/vnd.sdv.filetags+json"})})))),this.userId=e,this.resource="/stories/"+e+"/fragments"}uploadFragment(e){return h.l.shared().upload(this.resource,e).pipe((0,i.H)(e=>this.mapFileUploadStatus(e)),(0,u.o)())}deleteFragment(e){return(0,r.v)(()=>{var s=this.addOptimisticStateTransformation(s=>Object.assign({},s,{fragments:s.fragments.filter(s=>s.basename!==e)}));return(0,l.br)(l.jI.shared().stories.fragments.delete,this.userId,e).pipe((0,v.KX)(s),(0,n.n)(()=>this.data().pipe((0,d.s)(1),(0,o.u)(void 0))))})}markFragmentViewed(e){return g.v.defer(()=>{var s=this.addOptimisticStateTransformation(s=>Object.assign({},s,{bookmark:e}));return g.v.zip(f.o.shared().data().toSingle(),this.data().toSingle()).pipe((0,m.Fg)(s=>{var[t,r]=s;if(!t.id)return g.v.just();var a=r.fragments.map(e=>e.basename),i=a.indexOf(e),n=i===a.length-1,d=a[i-1]||null;return(0,l.Yq)(l.jI.shared().stories.feed.story.patch,t.id,this.userId,{bookmark:e,previous:d,seen:n})}),(0,v.rQ)(s),(0,m.W_)(void 0))})}activeFragmentUploadFor(e){return h.l.shared().activeUploadFor(this.resource,e).pipe((0,i.H)(e=>this.mapFileUploadStatus(e)))}cancelFragmentUpload(e){return h.l.shared().cancelUpload(this.resource,e)}mapFileUploadStatus(e){return e&&"complete"===e.name?this.data().pipe((0,d.s)(1),(0,o.u)(e)):(0,a.of)(e)}}I.shared=(0,c.G)(e=>new I(e))},9086(e,s,t){t.d(s,{e:()=>E});var r=t(30495),a=t(15526),i=t(97156),n=t(8733),d=t(56823),o=t(75841),u=t(92746),l=t.n(u),c=t(94375),h=t(28138),p=t(15654),v=t(10629),m=t(36580),f=t(49538),b=t(84190),g=t(50626),I=t(56177),w=t(27585),S=t(92453),y=t(2773),A=t(5801),T=t(74380),x=t(79225);function C(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}function F(e){var s=function(e,s){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,s||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:s+""}var D=3*c.b.second,k=c.b.second;class E{constructor(){this.subscriptionsMap=new i.t({}),this.ttl=new n.B,this.availableSubscriptions=new i.t(Number.MAX_SAFE_INTEGER),this.subscriptionSubject=ne
3w n.B,this.subscriptions=this.subscriptionSubject.asObservable(),this.hasAvailableSubscriptions=this.availableSubscriptions.asObservable().pipe((0,h.T)(e=>e>0),(0,p.F)())}start(e){var s=this.subscriptionsMap.asObservable().pipe((0,v.i)(1),(0,h.T)(e=>Object.entries(e).map(e=>{var[s,t]=e;return{"target-id":s,labels:Object.keys(t).sort()}}).sort((e,s)=>e["target-id"]>s["target-id"]?1:-1)),(0,p.F)(l()),(0,m.t)({bufferSize:1,refCount:!0}));e.add(s.pipe((0,f.Z)(D),(0,p.F)(l()),(0,b.n)(()=>this.resubscribe(s))).safeSubscribe()),e.add(this.ttl.pipe((0,b.n)(e=>(0,d.O)(e)),(0,b.n)(()=>this.resubscribe(s))).safeSubscribe()),e.add(T.o.shared().data().pipe((0,h.T)(e=>e.id),(0,g.J)()).safeSubscribe(e=>{var[s,t]=e;"string"!=typeof s||t||this.clearAllSubscriptions()}))}clearAllSubscriptions(){this.availableSubscriptions.next(Number.MAX_SAFE_INTEGER),this.subscriptionsMap.next({})}subscribe(e,s){if(this.availableSubscriptions.value>0){this.availableSubscriptions.next(this.availableSubscriptions.value-1);var t=this.subscriptionsMap.value,r=Object.assign({},t,{[e]:Object.assign({},s.reduce((s,r)=>{var a,i=null==(a=t[e])?void 0:a[r];return Object.assign({},s,{[r]:"number"==typeof i?i+1:1})},{}))});this.subscriptionsMap.next(r)}}unsubscribe(e,s){var t=this.subscriptionsMap.value[e];if(t){this.availableSubscriptions.next(this.availableSubscriptions.value+1);var r=this.subscriptionsMap.value,a=Object.assign({},s.reduce((e,s)=>{var t=e[s];return"number"==typeof t&&t>1?Object.assign({},e,{[s]:t-1}):C(e,[s].map(F))},Object.assign({},t)));if(0===Object.keys(a).length){var i=C(r,[e].map(F));this.subscriptionsMap.next(i)}else this.subscriptionsMap.next(Object.assign({},r,{[e]:a}))}}resubscribe(e){return e.pipe((0,I.s)(1),(0,w.E)(T.o.shared().data().pipe((0,h.T)(e=>e.id),(0,A.o)(),(0,p.F)())),(0,b.n)(e=>{var[s,t]=e,a=x.K.shared(t).id;return(0,r.Yq)(r.jI.shared().events.subscriptions.put,t,a,{subscriptions:s}).asObservable().pipe((0,S.M)(()=>{this.subscriptionSubject.next(s)}))}),(0,S.M)(e=>{e["min-ttl"]&&this.ttl.next(e["min-ttl"]*c.b.second-2*D-k),this.availableSubscriptions.next(e["available-subscriptions"])}),(0,y.W)(e=>(400===e.status?this.availableSubscriptions.next(0):this.subscriptionSubject.next([]),(0,o.of)(void 0))),(0,h.T)(()=>void 0))}}E.shared=(0,a.G)(()=>new E)},34756(e,s,t){t.d(s,{s:()=>p});var r=t(30495),a=t(50846),i=t(50042),n=t(15526),d=t(79942),o=t(8733),u=t(97983),l=t(39971),c=t(91885),h=t(26578);class p extends a.Q{constructor(e){super("users.presents.orders",e,function(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h.t.shared().activeRoles.toSingle().pipe((0,d.Fg)(t=>{var a=r.jI.shared().presents.orders.sent.get;return t.includes("promoter")&&(a=r.jI.shared().presents.orders.received.get),t.includes("agencies-operator")&&(a=r.jI.shared().presents.orders.overlords.received.get),(0,r.p6)(a,e,s).pipe((0,d.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t||{},ttl:(null==(s=(0,i.a)(r))?void 0:s.maxAge)||0}}))}))}),this.refreshSubject=new o.B,this.userId=e}shouldRefreshData(){return this.refreshSubject.pipe((0,u.u)(()=>!0))}sendPresent(e,s,t,a){var i={"recipient-id":s,items:t.map(e=>({id:e.id,"confirmed-price":e.price})),text:a};return(0,r.Yq)(r.jI.shared().presents.orders.post,e,i).pipe((0,d.vV)(e=>c.Q.success(e)),(0,d.ex)(()=>{this.refreshSubject.next(void 0)}),(0,d.ZC)(e=>402===e.status?l.v.just(c.Q.failure("insufficient-funds")):l.v.error(e)))}updateOrder(e,s){return(0,r.Yq)(r.jI.shared().v2.presents.orders.patch,this.userId,e,s).pipe((0,d.ex)(()=>{this.refreshSubject.next(void 0)}))}cancel(e,s){return(0,r.Yq)(r.jI.shared().v2.presents.orders.delete,this.userId,e,s).pipe((0,d.ex)(()=>{this.refreshSubject.next(void 0)}))}}p.shared=(0,n.G)(e=>new p(e))},4509(e,s,t){t.d(s,{K:()=>h});var r=t(30495),a=t(15526),i=t(39971),n=t(79942),d=t(50846),o=t(52372),u=t(50042),l=t(38107),c=t(28138);class h extends d.Q{constructor(e){super("users.targeted.tagged.cards.dislike",e,()=>(0,r.p6)(r.jI.shared().users.targeted.tagged["cards.dislike"].get,e).pipe((0,n.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t,ttl:(null==(s=(0,u.a)(r))?void 0:s.maxAge)||0}}),(0,n.ZC)(()=>i.v.just({data:{"user-ids":[]},ttl:0}
3)))),this.refreshSubject=new l.m(1),this.userId=e}refresh(){this.refreshSubject.next()}shouldRefreshData(){return this.refreshSubject.pipe((0,c.T)(()=>()=>!0))}dislikeUser(e){return i.v.defer(()=>{var s=this.addOptimisticStateTransformation(s=>Object.assign({},s,{"user-ids":[...s["user-ids"],e]}));return(0,r.Yq)(r.jI.shared().users.targeted.tagged["cards.dislike"].put,this.userId,e).pipe((0,o.rQ)(s))})}}h.shared=(0,a.G)(e=>new h(e))},62561(e,s,t){t.d(s,{g:()=>l});var r=t(30495),a=t(15526),i=t(39971),n=t(79942),d=t(50846),o=t(52372),u=t(50042);class l extends d.Q{constructor(e){super("users.targeted.tagged.cards.like",e,()=>(0,r.p6)(r.jI.shared().users.targeted.tagged["cards.like"].get,e).pipe((0,n.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t,ttl:(null==(s=(0,u.a)(r))?void 0:s.maxAge)||0}}),(0,n.ZC)(()=>i.v.just({data:{"user-ids":[]},ttl:0})))),this.userId=e}likeUser(e){return i.v.defer(()=>{var s=this.addOptimisticStateTransformation(s=>Object.assign({},s,{"user-ids":[...s["user-ids"],e]}));return(0,r.Yq)(r.jI.shared().users.targeted.tagged["cards.like"].put,this.userId,e).pipe((0,o.rQ)(s))})}}l.shared=(0,a.G)(e=>new l(e))},58721(e,s,t){let r;t.d(s,{P:()=>e$});var a=t(91994),i=t(42062),n=t(75841),d=t(92453),o=t(28138),u=t(98153),l=t(85378),c=t(7779),h=t(66691),p=t(14321),v=t(14457),m=t(66038),f=t(15526),b=t(17524),g=t(45482),I=t(5801),w=t(84190),S=t(15654),y=t(36580),A=t(39971),T=t(91885),x=t(66382),C=t(89218),F=t(90133),D=t(13462),k=t(86013),E=t(32248),j=t(71352);class R extends C.D{constructor(e){super();var s=g.Session.shared().userId.pipe((0,I.o)()),t=x.j.shared().chatAttendee.pipe((0,o.T)(e=>!e)),r=s.pipe((0,w.n)(s=>(0,b.z)([E.R.shared(e).cachedPresence,x.j.shared().chatAttendee,k.H.shared(s).userHasConversation(e),j.u.shared(s).audio(e),j.u.shared(s).video(e)])),(0,o.T)(s=>{var[t,r,a,i,n]=s,d=!r||e!==r,o=!t.online,u=!i&&!n&&!a&&t.online;return d&&!o&&!u}));this.canOffer=D.T.shared().profileRedesignEnabled.pipe((0,w.n)(e=>e?r:t),(0,w.n)(t=>t?s.pipe((0,w.n)(s=>F.A.shared(s).available(e)),(0,o.T)(e=>e.available)):(0,n.of)(!1)),(0,S.F)(),(0,y.t)(1))}start(){return A.v.just(T.Q.success({}))}}R.shared=(0,f.G)(e=>new R(e));var O=t(96016),M=t(32295),G=t(31085),B=["userId","ownerId","onClick"],P=(r=O.A,(0,i.memo)(e=>{var{userId:s,ownerId:t,onClick:a}=e,n=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,B),d=(0,i.useCallback)(()=>{M.g.shared(s).logWishlistItemClick(t),a()},[s,t,a]);return(0,G.jsx)(r,Object.assign({},n,{onClick:d}))})),_=(0,m.oI)((0,i.memo)(e=>{var{item:s,ownerId:t,onWishlistItemClick:r}=e,{category:n,group:d,purchased:o}=s,u=(0,a.w)(),l=(0,i.useCallback)(()=>{r(d)},[d,r]),c=(0,m.gV)(),h=(0,i.useCallback)(()=>{c(T.Q.success())},[c]),p=(0,i.useCallback)(()=>{c(T.Q.failure("present-image-load-failed"))},[c]);return u?(0,G.jsx)(P,{checked:o,category:n,group:d,ownerId:t,userId:u,onClick:l,onImageLoad:h,onImageError:p}):null}),"users.presents.wishlist.item"),z=t(99870),N=t.n(z),L=t(43168),q=t(31568),V=t(20345),Q=t(15782);let U=(0,i.memo)(e=>{var{size:s,blockLevel:t,variant:r="common",onClick:a}=e,i=(0,Q.A)("/users/presents","choose-presents-profile");return(0,G.jsx)(V.$,{title:i,variant:r,icon:"present",size:s,blockLevel:t,onClick:a})});var Y=t(74003),J=["ownerId","onClick","source"],W=(0,i.memo)(e=>{var{ownerId:s,onClick:t,source:r}=e,a=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,J),i=(0,h.uN)(()=>A.v.defer(()=>(null==t||t(),(0,Y.K)(s,void 0,void 0,{source:r}))),[s,r,t]);return(0,G.jsx)(U,Object.assign({},a,{onClick:i}))}),H=t(36657),X=t(99027),Z=t(60144);let $={wrapper:"users-profile-banners-send-present-presents-category__wrapper"},K=(0,i.memo)(e=>{var{imagePath:s,onClick:t}=e;return(0,G.jsx)("div",{className:$.wrapper,onClick:t,children:(0,G.jsx)(Z.$,{resourceWidth:60,path:s,className:$.image})})});var ee=t(90071),es=["receiverId","category","onClick"],et=(0,i.memo)(e=>{var{receiverId:s,category:t,onClick:r}=e,n=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,es),d=(0,a.w)(),o=(0,i.useCallback)(()=>{d&&ee.x.shared(d).logChoosePresentCategoryClicked(s,t),r()},[r,d,s,t]);return(0,G.jsx)(K,Object.assign({},n,{onClick:o}))}),er=(0,i.memo)(e=>{var{ownerId:s,category:t}=e,r=(0,i.useMemo)(()=>(0,X.Ig)(t),[t]),a=(0,h.uN)(()=>(0,Y.K)(s,t),[s,t]);return(0,G.jsx)(et,{imagePath:r,onClick:a,receiverId:s,category:t})});let ea=(0,i.memo)(e=>{var{ownerId:s,buttonSize:t,onClick:r,categories:a}=e,n=(0,i.useRef)(null),d=(0,i.useRef)(null),[u,l]=(0,H.w)(e=>e.pipe((0,o.T)(e=>Math.floor((e[0].contentRect.width+8)/68))),[],4),c=(0,i.useMemo)(()=>a.slice(0,u),[a,u]);(0,i.useLayoutEffect)(()=>{var e=n.current&&l(n.current);return()=>{null==e||e()}},[l]);var[h,p]=(0,H.w)(e=>e.pipe((0,o.T)(e=>e[0].contentRect.width<=329)),[],!1);(0,i.useLayoutEffect)(()=>{var e=d.current&&p(d.current);return()=>{null==e||e()}},[p]);var v=N()("users-profile-banners-send-present__banner",{"users-profile-banners-send-present__vertical":h});return(0,G.jsxs)("div",{className:v,ref:d,children:[(0,G.jsx)("div",{className:"users-profile-banners-send-present__categories",ref:n,children:c.map(e=>(0,G.jsx)("div",{children:(0,G.jsx)(er,{ownerId:s,category:e})},e))}),(0,G.jsx)("div",{className:"users-profile-banners-send-present__buttonWrapper",children:(0,G.jsx)(W,{ownerId:s,size:t,blockLevel:!0,onClick:r,source:"profile-banner"})})]})});var ei=(0,i.memo)(e=>{var{ownerId:s,userId:t}=e,r=(0,i.useCallback)(()=>
3{t&&ee.x.shared(t).logProfileChoosePresentButtonClicked(s)},[s,t]);return(0,G.jsx)(ea,Object.assign({},e,{onClick:r}))}),en=(0,i.memo)(e=>{var{ownerId:s}=e,t=(0,a.w)(),r=(0,q.sb)(s),n=(0,i.useMemo)(()=>null!=r&&r.gender?"mal"===r.gender?["simple-compliments","food","special","baskets"]:["flowers","baskets","food","gadgets"]:[],[r]);return(0,G.jsx)(ei,Object.assign({},e,{userId:t,categories:n}))}),ed=t(26578),eo=t(40654),eu=t(28280),el=t(85285),ec=t(43751),eh=t(79760);function ep(e,s,t){ec.Y.shared().get(eh.A).actions.open("presents-wishlist-modal",[{props:{receiverId:e,category:s,group:t}}])}var ev=t(81924),em=t(81174),ef=t(91760),eb=t(49904);let eg=(0,i.memo)(e=>{var{items:s,ownerId:t,onWishlistItemClick:r}=e;return(0,G.jsx)("div",{className:"users-presents-wishlist__wrapper",children:s.map(e=>(0,G.jsx)(_,{item:e,onWishlistItemClick:r,ownerId:t},(0,eb.L)(e)))})}),eI={wrapper:"users-presents-wishlist-view-dsgn5815__wrapper",container:"users-presents-wishlist-view-dsgn5815__container",swiperWrapper:"users-presents-wishlist-view-dsgn5815__swiperWrapper",button:"users-presents-wishlist-view-dsgn5815__button",active:"users-presents-wishlist-view-dsgn5815__active",nextButton:"users-presents-wishlist-view-dsgn5815__nextButton",hidden:"users-presents-wishlist-view-dsgn5815__hidden"};var ew=t(78903);let eS=(0,i.memo)(e=>{var{current:s,total:t}=e,r=(0,i.useMemo)(()=>Array.from({length:t},(e,s)=>s),[t]);return(0,G.jsx)("div",{className:"users-presents-wishlist-view-dsgn5815-pagination__container",children:r.map(e=>{var t=N()("users-presents-wishlist-view-dsgn5815-pagination__item",{"users-presents-wishlist-view-dsgn5815-pagination__active":e===s});return(0,G.jsx)("div",{className:t},e)})})});var ey=(0,i.memo)(e=>(0,G.jsx)(eS,Object.assign({},e))),eA=(0,i.lazy)(()=>t.e("5212").then(t.bind(t,38183)).then(e=>({default:e.WishlistSwiper})));let eT=(0,i.memo)(e=>{var{ownerId:s,items:t,onWishlistItemClick:r,presentsNames:a}=e,[n,d]=(0,i.useState)(0),u=(0,i.useRef)(null),l=(0,i.useRef)(null),[c,h]=(0,H.w)(e=>e.pipe((0,o.T)(e=>e[0].contentBoxSize[0].inlineSize<770)),[]);(0,i.useLayoutEffect)(()=>u.current?h(u.current):()=>void 0,[h]);var p=c?"auto":Math.min(3,t.length),v=c?t.length:t.length-3+1,m=n>0,f=n<t.length-3,b=N()(eI.button,eI.prevButton,{[eI.hidden]:!m}),g=N()(eI.button,eI.nextButton,{[eI.hidden]:!f}),I=(0,i.useCallback)(e=>{l.current=e,d(0)},[]),w=(0,i.useCallback)(e=>{c&&(e.progress>=1||e.isEnd)?d(t.length-1):d(e.realIndex)},[t.length,c]),S=(0,i.useCallback)((e,s)=>{c&&(s>=1||e.isEnd||e.snapIndex===t.length-1?e.realIndex<t.length-1&&d(t.length-1):s<1&&d(e.realIndex))},[c,t.length]),y=(0,i.useCallback)(()=>{var e;null==(e=l.current)||e.slideNext()},[]),A=(0,i.useCallback)(()=>{var e;null==(e=l.current)||e.slidePrev()},[]),T=t.length>1,x="wishlist-slider-"+String(c);return(0,G.jsxs)("div",{className:eI.wrapper,children:[(0,G.jsxs)("div",{className:eI.container,ref:u,children:[(0,G.jsx)("div",{className:b,onClick:A,children:(0,G.jsx)(ew.Icon,{name:"arrow-left-redesigned",size:"normal"})}),(0,G.jsx)("div",{className:eI.swiperWrapper,children:(0,G.jsx)(i.Suspense,{children:(0,G.jsx)(eA,{items:t,ownerId:s,onWishlistItemClick:r,presentsNames:a,onSwiperInit:I,onRealIndexChange:w,slidesPerView:p,onProgress:S,slideEnabled:c},x)})}),(0,G.jsx)("div",{className:g,onClick:y,children:(0,G.jsx)(ew.Icon,{name:"arrow-left-redesigned",size:"normal"})})]}),!!T&&(0,G.jsx)(ey,{total:v,current:n})]})});var ex=(0,i.memo)(e=>{var{ownerId:s,onWishlistItemClick:t}=e,r=(0,h.J2)(()=>eo.X.shared(s).wishlist,[s]),a=(0,h.J2)(()=>em.u.shared().version,[],"default"),i=(0,h.GG)(()=>ef.o.shared().getTexts("/texts/presents/names"),[]);return r?"dsgn5815"===a?(0,G.jsx)(eT,{ownerId:s,items:r,presentsNames:i,onWishlistItemClick:t}):(0,G.jsx)(eg,{ownerId:s,items:r,onWishlistItemClick:t}):null});let eC="users-profile-banners-presents-wishlist-banner__choosePresentButton",eF="users-profile-banners-presents-wishlist-banner__mobileButton",eD="users-profile-banners-presents-wishlist-banner__desktopButton",ek=(0,i.memo)(e=>{var{ownerId:s,ownerName:t,ownerIsCurrentUser:r,choosePresentButtonVisible:a,editButtonVisible:n,emptyListExtendedDescriptionVisible:d,placeholderVisible:o,onWishlistItemClick:u,onEditWishlistButtonClick:l,buttonSize:c}=e,h=(0,i.useMemo)(()=>({name:t}),[t]),p=(0,i.useMemo)(()=>N()(eC,eD),[]),v=(0,i.useMemo)(()=>N()(eC,eF),[]),m=(0,Q.A)("users/presents/wishlist","edit"),f=(0,i.useMemo)(()=>({"test-id":"edit-wishlist-button"}),[]);return(0,G.jsxs)("div",{className:"users-profile-banners-presents-wishlist-banner__wrapper",children:[(0,G.jsxs)("div",{className:"users-profile-banners-presents-wishlist-banner__header",children:[(0,G.jsx)("div",{className:"users-profile-banners-presents-wishlist-banner__title",children:r?(0,G.jsx)(ev.LocalizedText,{href:"/users/presents/wishlist#your-wishlist",variant:"profile-whishlist-title"}):(0,G.jsx)(ev.LocalizedText,{href:"/users/presents/wishlist#wishlist-banner-title",variant:"profile-whishlist-title",data:h})}),!!a&&(0,G.jsx)("div",{className:p,children:(0,G.jsx)(W,{ownerId:s,size:c,blockLevel:!0,source:"wishlist"})}),!!n&&(0,G.jsx)("div",{className:eD,children:(0,G.jsx)(V.$,{onClick:l,title:m,variant:"dark-trans
3parent",dataAttributes:f})})]}),(0,G.jsx)("div",{className:"users-profile-banners-presents-wishlist-banner__list",children:o?(0,G.jsxs)("p",{children:[(0,G.jsx)(ev.LocalizedText,{href:"/users/presents/wishlist#empty-wishlist",variant:"profile-whishlist-description"}),!!d&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("br",{}),(0,G.jsx)(ev.LocalizedText,{href:"/users/presents/wishlist#remind-to-complete",variant:"profile-whishlist-description"})]})]}):(0,G.jsx)(ex,{ownerId:s,onWishlistItemClick:u})}),!!a&&(0,G.jsx)("div",{className:v,children:(0,G.jsx)(W,{ownerId:s,size:c,blockLevel:!0,source:"wishlist"})}),!!n&&(0,G.jsx)("div",{className:eF,children:(0,G.jsx)(V.$,{onClick:l,title:m,variant:"dark-transparent",blockLevel:!0,dataAttributes:f})})]})}),eE={placeholderContainer:"users-profile-banners-presents-wishlist-banner-view-dsgn5815__placeholderContainer",textContainer:"users-profile-banners-presents-wishlist-banner-view-dsgn5815__textContainer",buttonContainer:"users-profile-banners-presents-wishlist-banner-view-dsgn5815__buttonContainer",wishlistContainer:"users-profile-banners-presents-wishlist-banner-view-dsgn5815__wishlistContainer"},ej=(0,i.memo)(e=>{var{ownerName:s,ownerId:t,presentsAvailable:r,placeholderVisible:a,onWishlistItemClick:n}=e,d=(0,i.useMemo)(()=>({name:s}),[s]);return a||r?(0,G.jsxs)("div",{className:eE.placeholderContainer,children:[(0,G.jsxs)("div",{className:eE.textContainer,children:[(0,G.jsx)(ev.LocalizedText,{href:r?"/users/presents/wishlist#discover-banner-title":"/users/presents/wishlist#wishlist-banner-title-empty",variant:"profile-banner-title-dsgn5815",data:d}),(0,G.jsx)(ev.LocalizedText,{href:r?"/users/presents/wishlist#discover-banner-description":"/users/presents/wishlist#remind-to-complete-redesign",variant:"profile-banner-description-dsgn5815"})]}),(0,G.jsx)("div",{className:eE.buttonContainer,children:(0,G.jsx)(W,{size:"large",ownerId:t,blockLevel:!0,source:"wishlist",variant:"romantic-accent"})})]}):(0,G.jsxs)("div",{className:eE.wishlistContainer,children:[(0,G.jsxs)("div",{className:eE.textContainer,children:[(0,G.jsx)(ev.LocalizedText,{href:"/users/presents/wishlist#wishlist-banner-title-filled",variant:"profile-banner-title-dsgn5815",data:d}),(0,G.jsx)(ev.LocalizedText,{href:"/users/presents/wishlist#wishlist-banner-description",variant:"profile-banner-description-dsgn5815"})]}),(0,G.jsx)("div",{className:eE.presentsWishlistContainer,children:(0,G.jsx)(ex,{ownerId:t,onWishlistItemClick:n})}),(0,G.jsx)("div",{className:eE.buttonContainer,children:(0,G.jsx)(W,{size:"large",ownerId:t,blockLevel:!0,source:"wishlist",variant:"romantic-accent"})})]})});var eR=t(26316),eO="wishlist",eM=(0,i.memo)(e=>{var{ownerId:s,buttonSize:t,presentsAvailable:r}=e,d=(0,q.sb)(s),u=(0,h.J2)(()=>s?eR.M.shared(s).translatedUser.pipe((0,o.T)(e=>null==e?void 0:e.profile)):(0,n.of)(void 0),[s]),l=(null==u?void 0:u.name)||(null==d?void 0:d.name)||"",c=(0,a.w)(),v=(0,h.J2)(()=>D.T.shared().contactSupportLink,[],""),m=(0,h.J2)(()=>eo.X.shared(s).wishlist.pipe((0,o.T)(e=>0===e.length)),[s],!1),f=(0,h.J2)(()=>eo.X.shared(s).canEdit,[s],!1),b=(0,h.J2)(()=>p.f.shared(s).userIsFeaturedMember,[s],!1),g=(0,h.J2)(()=>c?p.f.shared(c).userIsFeaturedMember:(0,n.of)(!1),[c],!1),I=(0,h.J2)(()=>ed.t.shared().userIsUsual,[],!1),w=b&&I,S=(0,i.useCallback)(e=>{f?ep(s,eO,e):w?(0,Y.K)(s,eO,e,{source:"wishlist"}).safeSubscribe():c&&(!b&&I?eu.X.shared().notifyUser({type:el._.ContactSupportToSendPresent,payload:{supportLink:v}},el.A.Normal):!b&&g?eu.X.shared().notifyUser({type:el._.ContactAgencyToSendPresent},el.A.Normal):eu.X.shared().notifyUser({type:el._.CantSendPresent},el.A.Normal))},[s,w,c,b,g,I,v,f]),y=(0,i.useCallback)(()=>{ep(s)},[s]),A=w&&!f,T=c===s,x=b&&!T&&(g||I);return"dsgn5815"===(0,h.J2)(()=>em.u.shared().version,[],"default")?(0,G.jsx)(ej,{ownerId:s,ownerName:l,presentsAvailable:r,placeholderVisible:m,onWishlistItemClick:S}):(0,G.jsx)(ek,{ownerId:s,ownerName:l,choosePresentButtonVisible:A,editButtonVisible:f,emptyListExtendedDescriptionVisible:x,placeholderVisible:m,onWishlistItemClick:S,ownerIsCurrentUser:T,onEditWishlistButtonClick:y,buttonSize:t})});let eG=(0,i.memo)(e=>{var{ownerId:s,sendEmailBannerVisible:t,presentsBannerVisible:r,wishlistBannerVisible:a}=e,n=(0,i.useMemo)(()=>N()("users-profile-banners-view-default__wrapper",{"users-profile-banners-view-default__hasWishlist":a}),[a]);return t||r||a?(0,G.jsxs)("div",{className:n,children:[!!t&&(0,G.jsx)(L.SendEmailBanner,{ownerId:e.ownerId,short:e.presentsBannerVisible}),!!r&&(0,G.jsx)(en,{ownerId:s}),!!a&&(0,G.jsx)("div",{className:"users-profile-banners-view-default__wishlistWrapper",children:(0,G.jsx)(eM,{ownerId:s})})]}):null});var eB=t(85149);let eP=(0,i.memo)(e=>{var{ownerId:s}=e,t=(0,q.sb)(s),r=(0,i.useMemo)(()=>({name:null==t?void 0:t.name}),[null==t?void 0:t.name]);return(0,G.jsxs)("div",{className:"users-profile-banners-send-cheer-banner__container",children:[(0,G.jsxs)("div",{className:"users-profile-banners-send-cheer-banner__textContainer",children:[(0,G.jsx)(ev.LocalizedText,{href:"/cheers#cheers-banner-title",variant:"profile-banner-title-dsgn5815",data:r}),(0,G.jsx)(ev.LocalizedText,{href:"/cheers#cheers-banner-description",variant:"profile-banner-description-dsgn5815"})]}),(0,G.jsx)("div",{className:"users-profile-banners-send-cheer-banner__buttonContainer",children:(0,G.jsx)(eB.u,{buttonType:"commons/button",attendeeId:s,blockLevel:!0,variant:"popular-member-accent",size:"large"})})]})}),e_=(0,i.memo)(e=>{var{ownerId:s,sendEmailBannerVisible:t,sendCheerBannerVisible:r,presentsBannerVisible:a,wishlistBannerVisible:i}=e;return t||r||a||i?(0,G.jsxs)("div",{className:"users-profile-banners-view-dsgn5815__container",children:[!!t&&(0,G.jsx)(L.SendEmailBanner,{ownerId:s,short:!1}),!!r&&(0,G.jsx)(eP,{ownerId:s}),!!a&&(0,G.jsx)(eM,{ownerId:s,buttonSize:"large",presentsAvailable:!0}),!!i&&(0,G.jsx)(eM,{ownerId:s,buttonSize:"large"})]}):null}),ez="users-profile-banners-view-skeleton__banner",eN="users-profile-banners-view-skeleton__title",eL="users-profile-banners-view-skeleton__button",eq=(0,i.memo)(()=>(0,G.jsxs)("div",{className:"users-profile-banners-view-skeleton__container",children:[(0,G.jsxs)("div",{className:ez,children:[(0,G.jsx)("div",{className:eN}),(0,G.jsx)("div",{className:eL})]}),(0,G.jsxs)("div",{className:ez,children:[(0,G.jsx)("div",{className:eN}),(0,G.jsx)("div",{className:eL})]})]})),eV="users-profile-banners-view-skeleton-dsgn5815__banner",eQ="users-profile-banners-view-skeleton-dsgn5815__textContainer",eU="users-profile-banners-view-skeleton-dsgn5815__title",eY="users-profile-banners-view-skeleton-dsgn5815__description",eJ="users-profile-banners-view-skeleton-dsgn5815__button",eW=(0,i.memo)(()=>(0,G.jsxs)("div",{className:"users-profile-banners-view-skeleton-dsgn5815__container",children:[(0,G.jsxs)("div",{className:eV,children:[(0,G.jsxs)("div",{className:eQ,children:[(0,G.jsx)("div",{className:eU}),(0,G.jsx)("div",{className:eY})]}),(0,G.jsx)("div",{className:eJ})]}),(0,G.jsxs)("div",{className:eV,children:[(0,G.jsxs)("div",{className:eQ,children:[(0,G.jsx)("div",{className:eU}),(0,G.jsx)("div",{className:eY})]}),(0,G.jsx)("div",{className:eJ})]})]}));var eH=t(10083),eX=t(92495),eZ=t(96650),e$=(0,m.VB)((0,i.memo)(e=>{var{ownerId:s}=e,t=(0,a.w)(),r=(0,h.J2)(()=>l.F.shared(s).profile,[s]),f=(0,eH.S)(s),b=(0,eH.I)(s),g=!!(null!=f&&f.online),I=(0,eX.Zm)(eX.zh.LteMobile),w=(0,i.useRef)(!1),S=(0,i.useRef)(!1),y=(0,i.useRef)(!1),A=(0,h.J2)(()=>t?p.f.shared(t).userIsFeaturedMember:(0,n.of)(!1),[t]),T=(0,h.J2)(()=>D.T.shared().presentsEnabled,[]),x=(0,h.J2)(()=>T?v.b.shared(s).canOffer.pipe((0,d.M)(()=>{w.current||u.A.emit("event.wishlist-banner-offering.data-loaded",s),w.current=!0})):(0,n.of)(!1),[s,T]),C=(0,h.J2)(()=>!T||x||A?(0,n.of)(!1):c.f.shared(s).available.pipe((0,d.M)(()=>{y.current||u.A.emit("event.presents-receiving-availability.data-loaded",s),y.current=!0})),[s,T,x,A]),F=(0,h.J2)(()=>R.shared(s).canOffer.pipe((0,d.M)(()=>{S.current||u.A.emit("event.letter-sending-banner-offering.data-loaded",s),S.current=!0})),[s]),E=(0,h.J2)(()=>D.T.shared().sendCheerFromProfileEnabled,[]),O=(0,h.J2)(()=>D.T.shared().cheersOnboardingEnabled,[]),M=(0,h.J2)(()=>t?j.u.shared(t).audio(s):(0,n.of)(!1),[t,s]),B=(0,h.J2)(()=>t?j.u.shared(t).video(s):(0,n.of)(!1),[t,s]),P=(0,h.J2)(()=>t&&s?k.H.shared(t).userHasConversation(s):(0,n.of)(!1),[t,s],!1),z=(0,h.J2)(()=>eZ.j.shared().chatAttendee.pipe((0,o.T)(e=>!e||e!==s)),[s],!0),N=(0,h.J2)(()=>em.u.shared().version,[],"default"),L=!1,q=!1,V=!1,Q=!1,U=!1;return s!==t&&(null==r?void 0:r.error)!=="suspended"&&(void 0===t||t)?null!=r&&r.value&&t&&void 0!==F&&("dsgn5815"!==N||void 0!==E&&(void 0!==M||void 0!==B))&&(L=F,U=!!E&&!O&&z&&("onlineWithCamera"===b&&P||g&&!P||!g&&!P&&I||!!M||!!B),void 0!==x&&void 0!==C&&(Q=!0,q=C,V=x)):(Q=!0,V=x||!1),(0,m.cD)(e=>e.displayName!==_.displayName,[]),(0,m.gV)(Q?{"presents-available":q,"wishlist-banner-visible":V,"send-email-banner-visible":L,"send-cheer-banner-visible":U,userId:s}:void 0),Q?"dsgn5815"===N?(0,G.jsx)(e_,{ownerId:s,sendEmailBannerVisible:L,presentsBannerVisible:q,wishlistBannerVisible:V,sendCheerBannerVisible:U}):(0,G.jsx)(eG,{ownerId:s,sendEmailBannerVisible:L,presentsBannerVisible:q,wishlistBannerVisible:V}):"dsgn5815"===N?(0,G.jsx)(eW,{}):(0,G.jsx)(eq,{})}),"users.profile.banners")},43168(e,s,t){t.d(s,{SendEmailBanner:()=>y});var r=t(42062),a=t(31568),i=t(69199),n=t(91994),d=t(31085),o=["ownerId","onSendLetterClick"];function u(e){return(0,r.memo)(s=>
3{var{ownerId:t,onSendLetterClick:a}=s,u=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(s,o),l=(0,n.w)(),c=(0,r.useCallback)(()=>{null==a||a(),l&&i.G.shared(l).logProfileSendEmailClicked(t)},[a,t,l]),h=Object.assign({},u,{ownerId:t,onSendLetterClick:c});return(0,d.jsx)(e,Object.assign({},h))})}var l=t(99870),c=t.n(l),h=t(29827),p=t(81924);let v=(0,r.memo)(e=>{var{titleL10nHref:s,ownerId:t,product:r,buttonSize:a,onSendLetterClick:i}=e,n=c()("users-profile-banners-send-email__banner",{"users-profile-banners-send-email__flure":"flure"===r});return(0,d.jsxs)("div",{className:n,children:[(0,d.jsx)("p",{className:"users-profile-banners-send-email__title",children:(0,d.jsx)(p.LocalizedText,{variant:"profile-banner-title",href:s})}),(0,d.jsx)("div",{className:"users-profile-banners-send-email__buttonWrapper",children:(0,d.jsx)(h.F,{attendeeId:t,variant:"common",onClick:i,blockLevel:!0,size:a})})]})}),m=(0,r.memo)(e=>{var{ownerId:s,onSendLetterClick:t,ownerName:a}=e,i=(0,r.useMemo)(()=>({name:a}),[a]);return(0,d.jsxs)("div",{className:"users-profile-banners-send-email-view-dsgn5815__container",children:[(0,d.jsxs)("div",{className:"users-profile-banners-send-email-view-dsgn5815__textContainer",children:[(0,d.jsx)(p.LocalizedText,{href:"/users/email#send-email-dsgn5815-title",variant:"profile-banner-title-dsgn5815"}),(0,d.jsx)(p.LocalizedText,{href:"/users/email#send-email-dsgn5815-description",variant:"profile-banner-description-dsgn5815",data:i})]}),(0,d.jsx)("div",{className:"users-profile-banners-send-email-view-dsgn5815__buttonContainer",children:(0,d.jsx)(h.F,{attendeeId:s,size:"large",blockLevel:!0,variant:"border-with-stripes",onClick:t})})]})});var f=t(78675),b=t(66691),g=t(81174),I=["ownerId","short"],w=u(v),S=u(m),y=(0,r.memo)(e=>{var{ownerId:s,short:t}=e,r=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,I),i=f.T.shared().product,n=(0,a.sb)(s),o=function(e,s,t){if(t){if(s)return"/users/email#send-letter-free-title";switch(e){case"mal":return"/users/email#send-letter-free-title-full-male";case"fem":return"/users/email#send-letter-free-title-full-female";default:return"/users/email#send-letter-free-title-full"}}if(s)return"/users/email#send-email-free-title";switch(e){case"mal":return"/users/email#send-email-free-title-full-male";case"fem":return"/users/email#send-email-free-title-full-female";default:return"/users/email#send-email-free-title-full"}}(null==n?void 0:n.gender,t,!1);return"dsgn5815"===(0,b.J2)(()=>g.u.shared().version,[],"default")?(0,d.jsx)(S,Object.assign({},r,{ownerName:null==n?void 0:n.name,ownerId:s})):(0,d.jsx)(w,Object.assign({},r,{product:i,ownerId:s,titleL10nHref:o}))})},41059(e,s,t){t.d(s,{Y:()=>Q});var r=t(42062),a=t(66691),i=t(42696),n=t(31568),d=t(78186),o=t(33366),u=t(31085);let l=(0,r.memo)(e=>{var{timeLeft:s,onRejectClick:t,attendeeName:a,animationSpeed:i,animationSource:n,userIsUsual:l,userName:c,attendeeGender:h}=e,p=(0,r.useMemo)(()=>l?(0,u.jsx)(d.X,{href:"/call/quiz#intro-title-1",data:{name:c,attendeeName:a}}):(0,u.jsx)(d.X,{href:"/call/quiz#intro-title-2",data:{attendeeName:a}}),[l,c,a]),v=(0,r.useMemo)(()=>l?(0,u.jsx)(d.X,{href:"/call/quiz#intro-text-1",data:{gender:h}}):(0,u.jsx)(d.X,{href:"/call/quiz#intro-text-2"}),[l,h]);return(0,u.jsxs)("div",{className:"video-call-quiz-content quiz-intro-wrapper",children:[(0,u.jsx)("h2",{className:"quiz-intro-title",children:p}),(0,u.jsx)("p",{children:!!l&&v}),(0,u.jsxs)("div",{className:"quiz-intro-countdown",children:[(0,u.jsx)("span",{children:s}),(0,u.jsx)(o.f,{src:n,autoplay:!0,className:"quiz-intro-animation",speed:i,keepLastFrame:!0})]}),(0,u.jsx)("p",{className:"quiz-intro-text",children:!l&&v}),!!l&&(0,u.jsx)("button",{className:"quiz-intro-reject-button",onClick:t,children:(0,u.jsx)(d.X,{href:"/call/quiz#intro-reject-button"})})]})});var c=t(13462),h=t(94375),p=t(84190),v=t(28138),m=t(56177),f=t(56823),b=t(3820),g=["onRejectClick","userId","attendeeId","userIsUsual"],I=t(45482),w='{"v":"5.5.7","meta":{"g"
vendor: 2,313 bytes, line 3
3:"LottieFiles AE 0.1.21","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":900,"w":108,"h":108,"nm":"spinner","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"circle","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[54,54,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":899,"s":[100]}],"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0,0.623529434204,0.51372551918,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":900,"st":0,"bm":0}],"markers":[]}',S=(0,r.memo)(e=>{var{onRejectClick:s,userId:t,attendeeId:a,userIsUsual:i}=e,n=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,g);(0,r.useEffect)(()=>{i&&b.K.shared(t).logQuizIntroShown(a)},[i,t,a]);var d=(0,r.useCallback)(()=>{i&&b.K.shared(t).logQuizDeclined(a),s()},[s,t,a,i]);return(0,u.jsx)(l,Object.assign({onRejectClick:d,userIsUsual:i},n))}),y=(0,r.memo)(e=>{var{attendeeId:s,userId:t}=e,r=(0,a.J2)(()=>I.Session.shared().userIsUsual,[]),d=(0,a.uN)(()=>i.dA.shared(t).startQuiz(s),[t,s],!1),o=(0,a.uN)(()=>i.dA.shared(t).rejectQuizOffer(s),[t,s]),l=(0,a.J2)(()=>c.T.shared().videoCallQuiz.introTimeout.pipe((0,p.n)(e=>{var s=e/h.b.second;return(0,f.O)(0,1e3).pipe((0,v.T)(e=>s-e<=0?(r&&d(),0):s-e),(0,m.s)(s+1))})),[r,d]),b=(0,a.J2)(()=>c.T.shared().videoCallQuiz.introTimeout.pipe((0,v.T)(e=>{try{var s=JSON.parse(w),t=(s.op-s.ip)/s.fr*h.b.second;return t/(e||t)}catch(e){return 1}})),[]),g=(0,n.sb)(s),y=null==g?void 0:g.name,A=null==g?void 0:g.gender,T=(0,n.sb)(t),x=null==T?void 0:T.name;return void 0!==l&&y&&x?(0,u.jsx)(S,{userId:t,attendeeId:s,onRejectClick:o,timeLeft:l,attendeeName:y,userIsUsual:!!r,animationSpeed:b,animationSource:w,userName:x,attendeeGender:A}):null}
3),A=t(15782),T=t(54149),x=t(99870),C=t.n(x),F=t(9778);let D=(0,r.memo)(e=>{var{variant:s,quizQuestionAnswer:t,onClick:a,userId:i,attendeeId:n,selected:d,checkMarkVisible:l,answersMismatch:c}=e,h=(0,r.useMemo)(()=>({backgroundImage:"url(/i/call/quiz/"+s+".png)"}),[s]),p=(0,r.useMemo)(()=>C()("quiz-variant",{selected:d},{mismatch:c}),[d,c]);return(0,u.jsxs)("button",{disabled:!!t.userAnswer,style:h,className:p,onClick:a,children:[!!l&&(0,u.jsx)(o.f,{src:'{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.21","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":181,"w":60,"h":60,"nm":"DC-quiz-arrow","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"arrow stroke","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[30,30,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":30,"s":[{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-7.5,-0.75],[-1.875,6.438],[30.063,-30]],"c":false}]},{"i":{"x":0.833,"y":1},"o":{"x":0.333,"y":0},"t":50,"s":[{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-7.5,-0.75],[-1.875,6.438],[7.313,-7]],"c":false}]},{"t":60,"s":[{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-10.031,-3.469],[-1.875,6.438],[7.313,-7]],"c":false}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3.2,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.889]},"o":{"x":[0.333],"y":[0]},"t":30,"s":[100]},{"i":{"x":[0.833],"y":[-0.376]},"o":{"x":[0.167],"y":[-5.556]},"t":50,"s":[0]},{"i":{"x":[0.833],"y":[0.973]},"o":{"x":[0.167],"y":[0.081]},"t":60,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[-0.057]},"t":69.375,"s":[16]},{"i":{"x":[0.833],"y":[0.992]},"o":{"x":[0.167],"y":[0]},"t":81.875,"s":[6]},{"t":102,"s":[16]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"t":50,"s":[100]},{"i":{"x":[0.833],"y":[0.982]},"o":{"x":[0.167],"y":[0]},"t":60,"s":[84]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[-0.032]},"t":69.375,"s":[100]},{"i":{"x":[0.833],"y":[0.966]},"o":{"x":[0.167],"y":[0]},"t":81.875,"s":[88]},{"t":102,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":181,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"circle","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[30,30,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":15,"s":[100,100,100]}],"ix":6,"x":"var $bm_rt;\\nvar n, n, t, t, v, amp, freq, decay, M;\\n$bm_rt = n = 0;\\nif (numKeys > 0) {\\n    $bm_rt = n = nearestKey(time).index;\\n    if (key(n).time > time) {\\n        n--;\\n    }\\n}\\nif (n == 0) {\\n    $bm_rt = t = 0;\\n} else {\\n    $bm_rt = t = $bm_sub(time, key(n).time);\\n}\\nif (n > 0) {\\n    v = velocityAtTime($bm_sub(key(n).time, $bm_div(thisComp.frameDuration, 10)));\\n    amp = 0.4;\\n    freq = 2;\\n    decay = 8;\\n    M = $bm_div(Math.sin($bm_mul($bm_mul($bm_mul(freq, t), 2), Math.PI)), Math.exp($bm_mul(decay, t)));\\n    $bm_rt = $bm_sum(value, $bm_mul($bm_mul(v, amp), M));\\n} else {\\n    $bm_rt = value;\\n}"}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[50,50],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.623529411765,0.513725490196,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":181,"st":0,"bm":0}],"markers":[]}',autoplay:!0,keepLastFrame:!0,className:"quiz-variant-check-mark"}),!!t.userAnswer&&!!t.attendeeAnswer&&(0,u.jsxs)("span",{className:"quiz-variant-avatars",children:[t.userAnswer===s&&(0,u.jsx)(F.UserThumbnail,{ownerId:i,size:50,className:"quiz-variant-avatar"}),t.attendeeAnswer===s&&(0,u.jsx)(F.UserThumbnail,{ownerId:n,size:50,className:"quiz-variant-avatar"})]})]})});var k=["variant","onSelectAnswer","quizQuestionAnswer"],E=(0,r.memo)(e=>{var{variant:s,onSelectAnswer:t,quizQuestionAnswer:a}=e,i=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,k),n=(0,r.useCallback)(()=>{t(s)},[s,t]),d=s===a.userAnswer,o=d&&(!a.userAnswer||!a.attendeeAnswer);return(0,u.jsx)(D,Object.assign({},i,{quizQuestionAnswer:a,variant:s,onClick:n,selected:d,checkMarkVisible:o}))}),j=t(27648),R=t(61285);let O=(0,r.memo)(e=>{var{status:s}=e,t=(0,r.useMemo)(()=>C()("quiz-progress-item",s),[s]);return(0,u.jsx)("div",{className:t})}),M=(0,r.memo)(e=>{var{attendeeName:s,userAnswers:t,attendeeAnswers:r}=e;return(0,u.jsxs)("div",{className:"quiz-progress-container",children:[(0,u.jsxs)("div",{className:"quiz-progress-row",children:[(0,u.jsx)("p",{className:"quiz-progress-name",children:(0,u.jsx)(d.X,{href:"/dialogs/messages#you"})}),t.map(e=>(0,u.jsx)(O,{status:e.status},e.id))]}),(0,u.jsxs)("div",{className:"quiz-progress-row",children:[(0,u.jsx)("p",{className:"quiz-progress-name",children:s}),r.map(e=>(0,u.jsx)(O,{status:e.status},e.id))]})]})});var G=t(85378),B=(0,r.memo)(e=>{var{userId:s,attendeeId:t}=e,n=(0,a.J2)(()=>G.F.shared(t).profile.pipe((0,v.T)(e=>e.isSuccessful?e.value.name:void 0)),[t]),d=(0,a.J2)(()=>i.dA.shared(s).answersStatus,[s]),o=(0,r.useMemo)(()=>null==d?void 0:d.map(e=>{var s=e.status;return"attendeeAnswered"===e.status&&(s="pending"),Object.assign({},e,{status:s})}),[d]),l=(0,r.useMemo)(()=>null==d?void 0:d.map(e=>{var s=e.status;return"answered"===e.status&&(s="pending"),"attendeeAnswered"===e.status&&(s="answered"),Object.assign({},e,{status:s})}),[d]);return null!=o&&o.length&&null!=l&&l.length?(0,u.jsx)(M,{userAnswers:o,attendeeAnswers:l,attendeeName:n}):null});let P=(0,r.memo)(e=>{var{activeQuestionIndex:s,totalQuestionsCount:t,nextButtonDisabled:a,nextButtonVisible:i,onNextButtonClick:n,activeQuestion:l,activeQuestionAnswers:c,userId:h,attendeeId:p,onSelectAnswer:v,waitingTextVisible:m,onHideQuizClick:f,hideQuizButtonVisible:b,attendeeName:g,answersMatch:I,answersMismatch:w}=e,S=(0,A.A)("call/quiz","choose-"+l.id),y=(0,r.useMemo)(()=>s+1,[s]),x=(0,A.A)("dialogs/messages","you"),C=(0,r.useMemo)(()=>{var e=null==x?void 0:x.toLowerCase();return c.userAnswer||c.attendeeAnswer?c.userAnswer?c.attendeeAnswer?null:(0,u.jsx)(d.X,{href:"/call/quiz#waiting-answer",data:{name:g}}):(0,u.jsx)(d.X,{href:"/call/quiz#waiting-answer",data:{name:e}}):(0,u.jsx)(d.X,{href:"/call/quiz#waiting-answers-both",data:{attendeeName:g}})},[x,g,c.attendeeAnswer,c.userAnswer]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(B,{userId:h,attendeeId:p}),(0,u.jsxs)("div",{className:"video-call-quiz-content quiz-container",children:[!!b&&(0,u.jsx)("button",{className:"video-call-quiz-hide-button",onClick:f,children:(0,u.jsx)(j.A,{icon:R.A,typeClass:"video-call-quiz-hide-icon"})}),(0,u.jsxs)("span",{children:[y,"/",t]}),(0,u.jsx)("h3",{className:"quiz-question-title",children:S}),(0,u.jsxs)("div",{className:"quiz-variants-wrapper",children:[(0,u.jsx)("div",{className:"quiz-variants",children:l.answerVariants.map(e=>(0,u.jsx)(E,{variant:e,onSelectAnswer:v,userId:h,attendeeId:p,quizQuestionAnswer:c,answersMismatch:w},e))}
3),!!I&&(0,u.jsx)(o.f,{src:'{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.21","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":241,"w":489,"h":500,"nm":"DC-quiz-falling hearts","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Heart 12","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":145,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":10,"s":[36,-45,0],"to":[62.667,119.333,0],"ti":[-36.667,-222.333,0]},{"t":190,"s":[61,414,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":100,"s":[70,70,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":10,"op":311,"st":10,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Heart 11","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":175,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":40,"s":[140,-33,0],"to":[5.667,142.333,0],"ti":[20.333,-192.333,0]},{"t":220,"s":[135,393,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":130,"s":[75,75,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":40,"op":341,"st":40,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Heart 10","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":155,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":20,"s":[208,-36,0],"to":[32.667,231.333,0],"ti":[-35.667,-213.333,0]},{"t":200,"s":[208,411,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":110,"s":[80,80,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549
vendor: 19,502 bytes, line 3
3019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":20,"op":321,"st":20,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Heart 9","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":165,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":30,"s":[277,-38,0],"to":[-33.833,153.833,0],"ti":[47.333,-194.833,0]},{"t":210,"s":[278,398,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":120,"s":[100,100,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":30,"op":331,"st":30,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Heart 8","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":155,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":20,"s":[342,-36,0],"to":[7.667,131.333,0],"ti":[40.833,-203.833,0]},{"t":200,"s":[341,422,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":110,"s":[100,100,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":20,"op":321,"st":20,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Heart 7","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":145,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":10,"s":[448,-44,0],"to":[-32.333,181.333,0],"ti":[28.333,-190.333,0]},{"t":190,"s":[390,418,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":100,"s":[90,90,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":10,"op":311,"st":10,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"Heart 6","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":135,"s":[100]},{"t":159,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":0,"s":[24,-45,0],"to":[30.667,143.333,0],"ti":[-16.667,-210.333,0]},{"t":180,"s":[29,491,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":90,"s":[80,80,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":301,"st":0,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"Heart 5","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":165,"s":[100]},{"t":210,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":30,"s":[113,-34,0],"to":[5.667,142.333,0],"ti":[0.333,-193.333,0]},{"t":210,"s":[87,450,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":120,"s":[100,100,100]},{"t":210,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":30,"op":331,"st":30,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"Heart 4","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":145,"s":[100]},{"t":190,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":10,"s":[185,-33,0],"to":[-36.333,129.333,0],"ti":[29.333,-174.333,0]},{"t":190,"s":[182,468,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":100,"s":[120,120,100]},{"t":190,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":10,"op":311,"st":10,"bm":0},{"ddd":0,"ind":10,"ty":4,"nm":"Heart 3","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":155,"s":[100]},{"t":200,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":20,"s":[257,-38,0],"to":[-40.333,181.333,0],"ti":[41.333,-210.833,0]},{"t":200,"s":[240,470,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":110,"s":[100,100,100]},{"t":200,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":20,"op":321,"st":20,"bm":0},{"ddd":0,"ind":11,"ty":4,"nm":"Heart 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":145,"s":[100]},{"t":190,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":10,"s":[355,-36,0],"to":[-53.333,151.333,0],"ti":[-20.667,-237.333,0]},{"t":190,"s":[319,473,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":100,"s":[100,100,100]},{"t":190,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":10,"op":311,"st":10,"bm":0},{"ddd":0,"ind":12,"ty":4,"nm":"Heart","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":135,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.305,"y":1},"o":{"x":0.167,"y":0.167},"t":0,"s":[448,-44,0],"to":[-55.333,187.333,0],"ti":[47.333,-184.333,0]},{"t":180,"s":[436,463,0]}],"ix":2},"a":{"a":0,"k":[13.602,12.985,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":90,"s":[120,120,100]},{"t":180,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.004,-3.742],[3.742,-0.04],[0.004,-3.742],[-1.141,-1.476],[0,0],[-1.812,2.359],[-0.005,4.392],[3.741,-0.039]],"o":[[0.004,-3.742],[-3.742,0.039],[-0.005,4.135],[1.805,2.331],[0,0],[1.154,-1.503],[0.004,-3.742],[-3.742,0.04]],"v":[[0,-6.137],[-6.82,-12.84],[-13.602,-5.994],[-8.315,4.59],[-0.037,12.984],[8.225,4.416],[13.602,-6.28],[6.835,-12.984]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.125490196078,0.172549019608,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[13.602,12.984],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":301,"st":0,"bm":0}],"markers":[]}',autoplay:!0,className:"quiz-match-animation"})]}),(0,u.jsxs)("div",{className:"quiz-bottom-wrapper",children:[!!m&&(0,u.jsx)("p",{className:"quiz-waiting-text",children:C}),!!i&&(0,u.jsx)(T.A,{className:"quiz-cta-button",disabled:a,onClick:n,children:y===t?(0,u.jsx)(d.X,{href:"/commons#view-results"}):(0,u.jsx)(d.X,{href:"/commons#next"})})]})]})]})});var _=t(75841),z=t(56607),N=t(39971),L=(0,r.memo)(e=>{var{userId:s,attendeeId:t}=e,n=(0,a.J2)(()=>I.Session.shared().userIsUsual,[]),d=(0,a.J2)(()=>i.dA.shared(s).questions,[s]),o=(0,a.J2)(()=>i.dA.shared(s).activeQuestionIndex,[s]),l=(0,r.useMemo)(()=>{if(d&&void 0!==o)return d[o]},[d,o]),c=(0,a.J2)(()=>void 0===o?(0,_.of)(void 0):i.dA.shared(s).answers.pipe((0,v.T)(e=>{if(e[o])return Object.assign({},e[o])})),[s,o]),h=(0,a.J2)(()=>G.F.shared(t).profile.pipe((0,v.T)(e=>e.isSuccessful?e.value.name:void 0)),[t]),p=(0,a.uN)(()=>d&&d.length-1===o?i.dA.shared(s).finishQuiz(t):i.dA.shared(s).nextQuestion(t),[s,t,d,o]),m=(0,a.uN)(e=>void 0===o?z.w.toSingle():i.dA.shared(s).sendAnswer(t,o,e),[o,s,t]),f=(0,a.uN)(()=>i.dA.shared(s).hideQuiz(t),[s,t]),b=!(null!=c&&c.userAnswer)||!(null!=c&&c.attendeeAnswer),g=!c||!c.userAnswer||!c.attendeeAnswer,w=(null==c?void 0:c.userAnswer)&&c.attendeeAnswer&&c.userAnswer===c.attendeeAnswer,S=(null==c?void 0:c.userAnswer)&&c.attendeeAnswer&&c.userAnswer!==c.attendeeAnswer,y=l&&c&&d&&void 0!==o,A=(0,a.J2)(()=>i.dA.shared(s).shownQuestions,[s],[]),T=(0,a.uN)(()=>l&&!A.includes(l.id)?i.dA.shared(s).markQuestionAsShown(l.id):N.v.just(void 0),[l,s,A]);return(0,r.useEffect)(()=>{y&&T()},[y,T]),y?(0,u.jsx)(P,{userId:s,attendeeId:t,onSelectAnswer:m,onNextButtonClick:p,totalQuestionsCount:d.length,activeQuestionIndex:o,nextButtonDisabled:g,nextButtonVisible:!!n&&!b,activeQuestion:l,activeQuestionAnswers:c,waitingTextVisible:b,onHideQuizClick:f,hideQuizButtonVisible:!!n,attendeeName:h,answersMatch:!!w,answersMismatch:!!S}):null});let q=(0,r.memo)(e=>{var{quizStatus:s,userId:t,attendeeId:r}=e;return(0,u.jsxs)("div",{className:"video-call-quiz-wrapper",children:["intro"===s&&(0,u.jsx)(y,{userId:t,attendeeId:r}),"active"===s&&(0,u.jsx)(L,{userId:t,attendeeId:r})]})});var V=(0,r.memo)(e=>{var{userId:s,attendeeId:t}=e,r=(0,a.J2)(()=>i.dA.shared(s).status.pipe((0,v.T)(e=>e.name)),[s]);return r?(0,u.jsx)(q,{userId:s,attendeeId:t,quizStatus:r}):null});class Q{constructor(e,s){this.name="video-call-quiz",this.userId=e,this.attendeeId=s}render(){return(0,u.jsx)(V,{userId:this.userId,attendeeId:this.attendeeId})}}},59224(e,s,t){t.d(s,{Q:()=>w});var r=t(42062),a=t(78186),i=t(99870),n=t.n(i),d=t(31085);let o=(0,r.memo)(e=>{var{userAnswerImage:s,attendeeAnswerImage:t,answersMatch:a}=e,i=(0,r.useMemo)(()=>n()("quiz-result-line",{success:a}),[a]);return(0,d.jsxs)("div",{className:"quiz-result-row",children:[(0,d.jsx)("img",{className:"quiz-result-image",src:s,alt:""}),(0,d.jsx)("span",{className:i}),(0,d.jsx)("img",{className:"quiz-result-image",src:t,alt:""})]})});var u=(0,r.memo)(e=>{var{quizQuestionAnswer:s}=e,t=(0,r.useMemo)(()=>"/i/call/quiz/"+s.userAnswer+".png",[s.userAnswer]),a=(0,r.useMemo)(()=>"/i/call/quiz/"+s.attendeeAnswer+".png",[s.attendeeAnswer]),i=s.userAnswer===s.attendeeAnswer;return(0,d.jsx)(o,{userAnswerImage:t,attendeeAnswerImage:a,answersMatch:i})}),l=t(54149),c=t(27648),h=t(61285);let p=(0,r.memo)(e=>{var{attendeeName:s,answersCount:t,matchingAnswersCount:i,answers:n,matchingAnswersMoreThanHalf:o,onDoneButtonClick:p}=e,v=(0,r.useMemo)(()=>({matchingAnswersCount:i,answersCount:t}),[t,i]),m=(0,r.useMemo)(()=>o?(0,d.jsx)(a.X,{href:"/call/quiz#result-many-matches",data:{name:s}}):(0,d.jsx)(a.X,{href:"/call/quiz#result-few-matches",data:{name:s}}),[o,s]);return(0,d.jsx)("div",{className:"quiz-result-wrapper",children:(0,d.jsxs)("div",{className:"video-call-quiz-content quiz-result-content",children:[(0,d.jsx)("button",{className:"video-call-quiz-hide-button",onClick:p,children:(0,d.jsx)(c.A,{icon:h.A,typeClass:"video-call-quiz-hide-icon"})}),(0,d.jsx)("p",{className:"quiz-result-title",children:m}),(0,d.jsx)("h3",{children:(0,d.jsx)(a.X,{href:"/call/quiz#result-matches-count",data:v})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"quiz-result-names",children:[(0,d.jsxs)("span",{children:[(0,d.jsx)(a.X,{href:"/dialogs/messages#you"}),":"]}),(0,d.jsxs)("span",{children:[s,":"]})]}),n.map(e=>(0,d.jsx)(u,{quizQuestionAnswer:e},e.userAnswer))]}),(0,d.jsx)(l.A,{className:"quiz-cta-button",onClick:p,children:(0,d.jsx)(a.X,{href:"/commons#done"})})]})})});
3var v=t(66691),m=t(85378),f=t(28138),b=t(42696),g=t(22505),I=(0,r.memo)(e=>{var{userId:s,senderId:t,recipientId:a,quizId:i}=e,n=(0,r.useMemo)(()=>s===t?a:t,[s,a,t]),o=(0,v.J2)(()=>m.F.shared(n).profile.pipe((0,f.T)(e=>e.isSuccessful?e.value.name:void 0)),[n]),u=(0,v.GG)(()=>b.dA.shared(s).quizResults(t,a,i),[s,t,a,i]),l=(0,r.useMemo)(()=>{if(u)return Object.keys(u).length},[u]),c=(0,r.useMemo)(()=>{if(u)return Object.values(u).filter(e=>e.userAnswer===e.attendeeAnswer).length},[u]),h=(0,r.useMemo)(()=>void 0!==c&&void 0!==l&&c>Math.floor(l/2),[c,l]),I=(0,r.useCallback)(()=>{g.Y.shared().close()},[]);return u&&o&&l&&void 0!==c?(0,d.jsx)(p,{attendeeName:o,answersCount:l,matchingAnswersCount:c,answers:u,matchingAnswersMoreThanHalf:h,onDoneButtonClick:I}):null});class w{constructor(e,s,t,r){this.name="video-call-quiz-results",this.userId=e,this.senderId=s,this.recipientId=t,this.quizId=r}render(){return(0,d.jsx)(I,{userId:this.userId,senderId:this.senderId,recipientId:this.recipientId,quizId:this.quizId})}}},85149(e,s,t){t.d(s,{u:()=>S});var r=t(42062),a=t(66691),i=t(81468),n=t(52118),d=t(15782),o=t(54149),u=t(20345),l=t(27648),c=t(50563),h=t(31085),p=["onClick"];let v=(0,r.memo)(e=>{var{onClick:s}=e,t=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,p),r=(0,d.A)("/cheers","send-cheer");return"commons/button"!==t.buttonType||t.variant||(t.variant="light"),"commons/button"===t.buttonType?(0,h.jsx)(u.$,Object.assign({},t,{onClick:s,title:r,variant:t.variant,icon:"gift-card"})):(0,h.jsxs)(o.A,Object.assign({},t,{typeClass:"cheers-send-cheer__button",onClick:s,children:[(0,h.jsx)(l.A,{icon:c.A,typeClass:"cheers-send-cheer__icon"}),r]}))});var m=t(80295),f=t(39971),b=t(79942),g=t(85186),I=t(91994),w=(0,r.memo)(e=>{var{ownerId:s,userId:t,onClick:a}=e,i=(0,r.useCallback)(()=>{t&&g._.shared(t).logProfileSendCheerButtonClicked(s),null==a||a()},[s,t,a]);return(0,h.jsx)(v,Object.assign({},e,{onClick:i}))}),S=(0,r.memo)(e=>{var{attendeeId:s}=e,t=(0,I.w)(),r=(0,a.uN)(()=>(0,m.$)({placement:"profile",attendeeId:s,cheersSet:"common"}).pipe((0,b.Fg)(e=>e.isSuccessful?((0,i.Z)(s,void 0,"cheers"),(0,n.G)(e.value,s,"profile-button")):f.v.error(e.error))),[s],!1);return(0,h.jsx)(w,Object.assign({},e,{ownerId:s,userId:t,onClick:r}))})},29827(e,s,t){t.d(s,{F:()=>p});var r=t(60696),a=t(66691),i=t(42062),n=t(20345),d=t(15782),o=t(31085),u=["onClick","icon"];let l=(0,i.memo)(e=>{var{onClick:s,icon:t="mail"}=e,r=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,u),a=(0,d.A)("/users/email","send-email");return a?(0,o.jsx)(n.$,Object.assign({},r,{icon:t,title:a,onClick:s})):null});var c=t(79942),h=["attendeeId","onClick"],p=(0,i.memo)(e=>{var{attendeeId:s,onClick:t}=e,i=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(e,h),n=(0,a.uN)(()=>(0,r.q)(s,"chat").pipe((0,c.ex)(()=>null==t?void 0:t())),[s,t]);return(0,o.jsx)(l,Object.assign({},i,{onClick:n}))})},68275(e,s,t){t.d(s,{E:()=>k});var r=t(15526),a=t(38107),i=t(48830),n=t(17524),d=t(13462),o=t(65052),u=t(15654),l=t(36580),c=t(53940),h=t(56177),p=t(84190),v=t(28138),m=t(39971),f=t(79942),b=t(91557),g=t(74380),I=t(22081),w=t(59113),S=t(91317),y=t(49518),A=t(93719),T=t(45482),x=t(85378),C=t(12985),F=t(35913),D=t(5801);
3class k{constructor(){this.initializedSubject=new a.m(1),this.initialized=this.initializedSubject.asObservable().pipe((0,o.Z)(!1),(0,u.F)(),(0,l.t)(1)),this.aura=d.T.shared().aura.toSingle().pipe((0,f.Fg)(e=>{var{sdkHost:s}=e;return m.v.from(new Promise((e,t)=>b.S?window.requirejs(["https://"+s+"/sdk/sdk.js"],e,t):t()))}),(0,f.ZC)(()=>m.v.never()),(0,f.hr)())}start(e){e.add(d.T.shared().auraEnabled.pipe((0,c.p)(e=>e),(0,h.s)(1),(0,p.n)(()=>this.initAura())).safeSubscribe(()=>{this.initializedSubject.next(!0)}))}initAura(){return T.Session.shared().userId.pipe((0,D.o)(),(0,p.n)(e=>new i.c(s=>{var t=(0,n.z)([d.T.shared().aura,d.T.shared().winemback.apiHost,d.T.shared().winemback.websocketHost,F.T.shared().product.cheers]).pipe((0,v.T)(s=>{var[t,r,a,i]=s;return{aura:t,winemback:{apiHost:r,websocketHost:a,realtime:{subscribe:s=>{var t=A.q.shared(e).messages.safeSubscribe(s);return()=>t.unsubscribe()}}},product:i}})),r=(0,n.z)([S.P.shared(e).available,S.P.shared(e).settings]).pipe((0,v.T)(e=>{var[s,t]=e;return{available:s,settings:t}})),a=(0,n.z)([y.L.shared(e).data(),g.o.shared().data()]).pipe((0,c.p)(e=>{var[s]=e;return!!s}),(0,v.T)(e=>{var[s,t]=e;return{token:s,id:t.id,email:t.email,name:t.name,birthday:t.birthday,roles:t.roles}})),i=(0,n.z)([a,x.F.shared(e).profile,C.im.shared(e).preferences,I.x.shared(e).tags,w.G.shared(e).emailConfirmed,r]).pipe((0,c.p)(e=>{var[s,t]=e;return!!s.token&&!!s.id&&t.isSuccessful&&!!t.value}),(0,v.T)(e=>{var[s,t,r,a,i,n]=e;return{identity:s,profile:t.value,preferences:r,tags:a,emailConfirmed:i,emailNotifications:n}}));(0,n.z)([this.initialized,this.aura,t,i]).pipe((0,v.T)(e=>{var[t,r,a,i]=e;t?r.updateData(i):r.init({product:a.product,campaignId:a.aura.campaignId,aura:a.aura,winemback:a.winemback,data:i},()=>s.next(!0))})).safeSubscribe()})))}}k.shared=(0,r.G)(()=>new k)},32978(e,s,t){t.d(s,{h:()=>l});var r=t(5801),a=t(79942),i=t(15526),n=t(12640),d=t(89840),o=t(45482),u=t(17524);class l{logToAnnals(e,s){(0,u.z)([o.Session.shared().userId.pipe((0,r.o)()),d.q.shared().enabled]).toSingle().pipe((0,a.Fg)(t=>{var[r,a]=t;return n._.shared(r).logEvent(e,{userId:r,"email-only-experiment":a,mode:s}).toSingle()})).safeSubscribe()}logAuthorizationOverlayLogin(e){this.logToAnnals("event_authorization_overlay_login",e)}logAuthorizationOverlayRegistration(e){this.logToAnnals("event_authorization_overlay_registration",e)}}l.shared=(0,i.G)(()=>new l)},35234(e,s,t){t.d(s,{K:()=>m});var r=t(39971),a=t(79942),i=t(15526),n=t(13462),d=t(69725),o=t(9881),u=t(43751),l=t(79760),c=t(56607),h=t(84190),p=t(50626),v="registration-terms-acceptance";class m{start(e){this.protectionSubscription=n.T.shared().registrationTermsAcceptanceEnabled.pipe((0,h.n)(e=>e?this.protectOverlay():c.w)).safeSubscribe(),e.add(this.protectionSubscription)}stop(){var e;null==(e=this.protectionSubscription)||e.unsubscribe()}protectOverlay(){return d.v.shared().history.pipe((0,p.J)(),(0,h.n)(e=>{var[s,t]=e;return r.v.from(Promise.resolve()).pipe((0,a.Fg)(()=>this.protectOverlayHistory(s,t)))}))}protectOverlayHistory(e,s){return r.v.defer(()=>(s.forEach(s=>{e.includes(v)&&s!==v&&u.Y.shared().get(l.A).actions.close(s)}),!s.includes(v)&&e.includes(v))?(0,o.U)():r.v.just())}}m.shared=(0,i.G)(()=>new m)},35382(e,s,t){t.d(s,{Q:()=>i,o:()=>n});var r=t(79760),a=t(43751),i=e=>{a.Y.shared().get(r.A).actions.open("password-change",[{props:{closeOnSuccess:e},disableManualClose:!e,pinnedToTop:!e}])},n=()=>{a.Y.shared().get(r.A).actions.close("password-change")}},54458(e,s,t){t.d(s,{Q:()=>x});var r=t(15526),a=t(13462),i=t(10845),n=t(43751),d=t(55952),o=t(67276),u=t(69176),l=t(56379),c=t(97156),h=t(17524),p=t(56607),v=t(75841),m=t(28138),f=t(15654),b=t(36580),g=t(84190),I=t(92453),w=t(53940),S=t(56177),y=t(81468),A=t(89515),T=t(66382);class x{constructor(e){this.autoResponseAvailableSubject=new c.t(!1),this.userId=e,this.autoAnswerEnabled=(0,h.z)([l.M.shared(this.userId).initialized,a.T.shared().mcs.callAutoAnswerEnabled,this.autoResponseAvailableSubject]).pipe((0,m.T)(e=>{var[s,t,r]=e;return s&&t&&r}),(0,f.F)(),(0,b.t)({bufferSize:1,refCount:!0}))}start(e){e.add((0,h.z)([this.autoAnswerEnabled,u.B.shared(this.userId).state,o.M.shared(this.userId).state.pipe((0,m.T)(e=>e.status),(0,f.F)()),n.Y.shared().get(i.A,this.userId).store.rxState().pipe((0,m.T)(e=>e.status),(0,f.F)())]).pipe((0,g.n)(e=>{var s,[t,r,a,i]=e;if(!t||"idle"!==a||"idle"!==i||!r.incomingCallsAmount||(null==(s=r.incomingCalls[0])?void 0:s.callType)==="voiceonly")return p.w;var{userId:n,callId:o,token:u,roomId:l,engine:c,iceServers:m,callType:f}=r.incomingCalls[0];return(0,h.z)([d.K.shared(this.userId).id(n),(0,v.of)(n),(0,v.of)({callId:o,roomId:l,token:u,engine:c,iceServers:m,callType:f})])}),(0,I.M)(e=>{var[s,t,r]=e,{callId:a,roomId:i,token:n,engine:d,iceServers:u,callType:l}=r;s?(0,y.Z)(s):A.Y.shared(this.userId).show(t),o.M.shared(this.userId).join(a,{roomId:i,token:n,engine:d,iceServers:u,autoAnswer:!0,callType:l},t)})).safeSubscribe()),e.add(a.T.shared().mcs.roomPreInitializationEnabled.pipe((0,g.n)(e=>e?o.M.shared(this.userId).state.pipe((0,f.F)((e,s)=>e.status===s.status&&e.roomPrepared===s.roomPrepared),(0,w.p)(e=>"speaking"===e.status&&e.roomPrepared),(0,m.T)(e=>e.participants[0])):p.w),(0,g.n)(e=>(0,h.z)([d.K.shared(this.userId).id(e),(0,v.of)(e),T.j.shared().chatAttendee.pipe((0,S.s)(1))]))).safeSubscribe(e=>{var[s,t,r]=e;s&&r!==s&&(0,y.Z)(s),!s&&t&&A.Y.shared(this.userId).show(t)}))}disable(){this.autoResponseAvailableSubject.next(!1)}enable(){this.autoResponseAvailableSubject.next(!0)}}x.shared=(0,r.G)(e=>new x(e))},89515(e,s,t){t.d(s,{Y:()=>m});var r=t(15526),a=t(97156),i=t(15654),n=t(53940),d=t(84190),o=t(28138),u=t(50626),l=t(56177),c=t(67276),h=t(38792),p=t.n(h),v=t
3(98153);class m{constructor(e){this.userId=e,this.stateSubject=new a.t({visible:!1}),this.state=this.stateSubject.asObservable().pipe((0,i.F)(p()))}start(e){e.add(this.state.pipe((0,n.p)(e=>e.visible),(0,d.n)(()=>c.M.shared(this.userId).state.pipe((0,o.T)(e=>e.status),(0,i.F)(),(0,u.J)(),(0,o.T)(e=>{var[s,t]=e;return"idle"!==s&&"idle"===t}),(0,n.p)(e=>e),(0,l.s)(1)))).safeSubscribe(()=>{this.hide()}))}show(e){v.A.emit("command.sidebar.close"),v.A.emit("event.sidebar.chat.opened"),this.stateSubject.next({visible:!0,mcsAttendeeId:e})}hide(){v.A.emit("event.sidebar.chat.closed"),this.stateSubject.next({visible:!1})}}m.shared=(0,r.G)(e=>new m(e))},80295(e,s,t){t.d(s,{$:()=>h});var r=t(39971),a=t(43751),i=t(79760),n=t(34578),d=t(50626),o=t(53940),u=t(28138),l=t(91885),c="cheers-overlay",h=e=>{var s=a.Y.shared().get(i.A).store.rxState().pipe((0,d.J)(),(0,o.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)===c&&(null==t?void 0:t.name)!==c}),(0,u.T)(()=>l.Q.failure("closed"))),t=new r.v(s=>{var{cheersSet:t,placement:r}=e,n=t;n||"profile"!==r||(n="profile"),a.Y.shared().get(i.A).actions.open("cheers-overlay",[{props:Object.assign({},e,{onSubmit:e=>{a.Y.shared().get(i.A).actions.closeAll(),s.success(l.Q.success(e))},cheersSetName:n})}])});return(0,n.h)(s,t).toSingle()}},10853(e,s,t){t.d(s,{j:()=>o});var r=t(15526),a=t(48830),i=t(15654),n=t(36580),d=t(98153);class o{constructor(){this.visible=new a.c(e=>{e.next(!1);var s=()=>{e.next(!0)},t=()=>{e.next(!1)};return d.A.states("event.chat.voice.panel.opened",s,"event.chat.voice.panel.closed",t),()=>{d.A.removeStates("event.chat.voice.panel.opened",s,"event.chat.voice.panel.closed",t)}}).pipe((0,i.F)(),(0,n.t)(1))}}o.shared=(0,r.G)(()=>new o)},66684(e,s,t){t.d(s,{W:()=>m});var r=t(15526),a=t(39971),i=t(79942),n=t(97156),d=t(78213),o=t(75841),u=t(84190),l=t(28138),c=t(15654),h=t(94375),p=t(91885),v=t(76217);class m{constructor(e){this.recordingSubject=new n.t(!1),this.recordingFileSubject=new n.t(null),this.recordingLanguageSubject=new n.t(void 0),this.recording=this.recordingSubject.asObservable(),this.recordingFile=this.recordingFileSubject.asObservable(),this.recordingLanguage=this.recordingLanguageSubject.asObservable(),this.audioChunks=[],this.mediaRecorder=null,this.recordingDuration=this.recording.pipe((0,u.n)(e=>e?(0,d.Y)(h.b.second).pipe((0,l.T)(e=>e+1)):(0,o.of)(0)),(0,l.T)(e=>e*h.b.second),(0,c.F)())}startRecording(){return this.recording.toSingle().pipe((0,i.Fg)(e=>e?a.v.just(p.Q.failure("already-started")):a.v.from((0,v.U)(!0,{video:!1,audio:!0})).pipe((0,i.vV)(e=>(this.recordingSubject.next(!0),this.mediaRecorder=new MediaRecorder(e),this.audioChunks=[],this.mediaRecorder.addEventListener("dataavailable",e=>{this.audioChunks.push(e.data)}),this.mediaRecorder.start(),p.Q.success(void 0))),(0,i.ZC)(e=>(this.recordingSubject.next(!1),"NotAllowedError"===e.name)?a.v.just(p.Q.failure("permission-denied")):a.v.just(p.Q.failure("cancelled"))))))}stopRecording(){return this.recording.toSingle().pipe((0,i.Fg)(e=>e?(this.recordingSubject.next(!1),new a.v(e=>{this.mediaRecorder?(this.mediaRecorder.addEventListener("stop",()=>{var s=this.audioChunks[0].type.split("/")[1].split(";")[0],t=new File(this.audioChunks,"voice."+s,{type:this.audioChunks[0].type});e.success(t)}),this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(e=>e.stop())):e.success(null)})):a.v.just(null)))}setRecordingFile(e){this.recordingFileSubject.next(e)}setRecordingLanguage(e){this.recordingLanguageSubject.next(e)}}m.shared=(0,r.G)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return new m(e)})},70444(e,s,t){t.d(s,{S:()=>v});var r=t(89218),a=t(15526),i=t(17524),n=t(91885),d=t(39971),o=t(28138),u=t(15654),l=t(79942),c=t(13462),h=t(86487),p=t(71598);class v extends r.D{constructor(e){super(),this.userId=e,this.payload=p.q.shared(e).payload,this.canOffer=(0,i.z)([c.T.shared().winembackPopupEnabled,c.T.shared().storiesEnabled,this.payload,p.q.shared(e).mode,h.G.shared().visible]).pipe((0,o.T)(e=>{var[s,t,r,a,i]=e;return s&&t&&!!r&&"minimized"===a&&i}),(0,u.F)())}accept(){return d.v.defer(()=>(p.q.shared(this.userId).setMode("default"),d.v.just(n.Q.success())))}reject(){return this.offer.toSingle().pipe((0,l.Fg)(e=>e?p.q.shared(this.userId).shown(e.messageId).pipe((0,l.vV)(()=>n.Q.success())):d.v.just(n.Q.success())))}start(){return this.offer.toSingle().pipe((0,l.Fg)(e=>null===e?this.payload.toSingle().pipe((0,l.vV)(e=>e?n.Q.success(e):n.Q.failure("offer-not-allowed"))):d.v.just(n.Q.failure("offer-not-allowed"))))}}v.shared=(0,a.G)(e=>new v(e))},59994(e,s,t){t.d(s,{sE:()=>b});var r=t(15526),a=t(38107),i=t(34578),n=t(75841),d=t(56607),o=t(84190),u=t(28138),l=t(15654),c=t(92453),h=t(97928),p=t(98153),v=t(58731),m="communication-panels-toggler",f="initial-active-panel";
3class b{constructor(e){this.activePanelSubject=new a.m,this.activePanel=this.activePanelSubject.asObservable(),this.userId=e}start(e){e.add((0,i.h)(v.y.shared(m,this.userId).load(f).asObservable().pipe((0,o.n)(e=>e?(0,n.of)(e):d.w)),h.n.shared(this.userId).chats.pipe((0,u.T)(e=>e?e.length:0),(0,u.T)(e=>e>2?"chats":"notifications"))).pipe((0,l.F)(),(0,c.M)(e=>{v.y.shared(m,this.userId).store(f,e).safeSubscribe()})).safeSubscribe(e=>{this.togglePanel(e)}))}togglePanel(e){this.activePanelSubject.next(e),p.A.emit("command.panel.toggle",e)}}b.shared=(0,r.G)(e=>new b(e))},89301(e,s,t){t.d(s,{Y:()=>a});var r=t(98153);function a(){return r.A.emit("command.page.open","search")}},16556(e,s,t){t.d(s,{p:()=>g});var r=t(89218),a=t(15526),i=t(17524),n=t(65052),d=t(28138),o=t(15654),u=t(36580),l=t(79942),c=t(13462),h=t(39971),p=t(91885),v=t(67441),m=t(86487),f=t(22081),b="loyalty.vip.tasks.announcement";class g extends r.D{constructor(e){super(),this.userId=e,this.canOffer=(0,i.z)([this.offeringResult.pipe((0,n.Z)(null)),c.T.shared().userLoyaltyTasksEnabled,v.U.shared(e).status,f.x.shared(e).tags,m.G.shared().visible]).pipe((0,d.T)(e=>{var[s,t,r,a,i]=e;return!s&&!!t&&!!i&&("vip"===r||"vip-freeze"===r||"premium"===r)&&!!a.includes(b)}),(0,o.F)(),(0,u.t)({refCount:!0,bufferSize:1}))}start(){return h.v.just(p.Q.success({}))}accept(){return h.v.just(p.Q.success()).pipe((0,l.ex)(()=>{f.x.shared(this.userId).setTagEnabled(b,!1).safeSubscribe()}))}}g.shared=(0,a.G)(e=>new g(e))},49904(e,s,t){t.d(s,{L:()=>r});var r=e=>e.category+"-"+e.group},70964(e,s,t){t.d(s,{T:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logRecorderTipShown(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-tip-shown",{}).safeSubscribe()}logRecorderShown(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-shown",{}).safeSubscribe()}logRecorderTipButtonClicked(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-tip-button-clicked",{}).safeSubscribe()}logPreviewUploadButtonClicked(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-upload-button-clicked",{}).safeSubscribe()}logRecorderClosed(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-closed",{}).safeSubscribe()}logPreviewUploadedSuccessfully(){a._.shared(this.userId).logEvent("vr-video-preview-uploaded-successfully",{}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},53644(e,s,t){t.d(s,{$:()=>n,A:()=>d});var r=t(43751),a=t(79760),i=t(39971),n=()=>new i.v(e=>{r.Y.shared().get(a.A).actions.open("vr-video-preview-recorder",[{props:{},disableManualClose:!0}]),e.success()}),d=()=>new i.v(e=>{r.Y.shared().get(a.A).actions.close("vr-video-preview-recorder"),e.success()})},6664(e,s,t){t.d(s,{A:()=>C});var r=t(89218),a=t(17524),i=t(75841),n=t(15526),d=t(53940),o=t(56177),u=t(84190),l=t(28138),c=t(50626),h=t(15654),p=t(36580),v=t(13462),m=t
3(93708),f=t(96333),b=t(55952),g=t(39971),I=t(91885),w=t(56379),S=t(77252),y=t(4938),A=t(43751),T=t(79760),x=t(79942);class C extends r.D{constructor(e){super();var s=A.Y.shared().get(T.A).store.rxState().pipe((0,d.p)(e=>!(null!=e&&e.name)),(0,o.s)(1),(0,u.n)(()=>(0,a.z)([m.T.shared(e).get(),v.T.shared().vrVideoPreviewRecorder.previewRecordingExpiryTtl,y.E.shared().currentTime()]).pipe((0,l.T)(e=>{var[s,t,r]=e;return!!s&&r-(s.length?Math.max(...s.filter(e=>"declined"!==e.status).map(e=>new Date(e.created).getTime())):0)>=t}))));this.canOffer=v.T.shared().vrVideoPreviewRecorder.enabled.pipe((0,u.n)(t=>t?w.M.shared(e).initialized.pipe((0,u.n)(t=>t?b.K.shared(e).mcsId(e).asObservable().pipe((0,u.n)(t=>t?S.J.shared(e).status.pipe((0,u.n)(r=>"idle"!==r?(0,i.of)(!1):f._.shared(e).presence(t).pipe((0,l.T)(e=>!!(null!=e&&e.devices.includes("vr"))),(0,c.J)(),(0,l.T)(e=>{var[s,t]=e;return!s&&t}),(0,u.n)(e=>e?s:(0,i.of)(!1))))):(0,i.of)(!1))):(0,i.of)(!1))):(0,i.of)(!1)),(0,h.F)(),(0,p.t)({refCount:!0,bufferSize:1}))}start(){return this.offer.toSingle().pipe((0,x.Fg)(e=>e?g.v.just(I.Q.failure("offer-not-allowed")):g.v.just(I.Q.success({}))))}}C.shared=(0,n.G)(e=>new C(e))},95744(e,s,t){t.d(s,{D:()=>n,q:()=>i});var r=t(43751),a=t(79760);function i(e){r.Y.shared().get(a.A).actions.addToQueue("ai-perfect-match",[{props:{initialMatchMcsId:e}}])}function n(){r.Y.shared().get(a.A).actions.close("ai-perfect-match")}},8456(e,s,t){t.d(s,{A:()=>a});var r=t(42460).A;let a={store:t(32842).default,actions:r}},38602(e,s,t){t.d(s,{f:()=>o});var r=t(15526),a=t(4126),i=t(43751),n=t(86036),d=t(36580);class o{constructor(e){this.roles=(0,a.v)(()=>i.Y.shared().get(n.A,e).store.rxState()).pipe((0,d.t)(1))}}o.shared=(0,r.G)(e=>new o(e))},86036(e,s,t){t.d(s,{A:()=>a});var r=t(22082).A;let a={store:t(57384).A,actions:r}},17330(e,s,t){t.d(s,{e:()=>T});var r=t(15526),a=t(45482),i=t(91654),n=t(17524),d=t(34578),o=t(82019),u=t(56177),l=t(28138),c=t(15654),h=t(58731),p=t(94375),v=t(13462),m=t
3(42618),f=t(39971),b=t(79942),g=t(89218),I=t(91885),w=t(22081),S="application-install-offering",y="skipped-offer-counter",A="last-offer-timestamp";class T extends g.D{constructor(e){super(),this.userId=e;var s=h.y.shared(S,e),t=s.load(A),r=s.load(y),f=(0,n.z)([t.asObservable(),r.asObservable()]),b=(0,d.h)(this.offeringResult.pipe((0,o.K)(f)),f);this.canOffer=(0,n.z)([b,a.Session.shared().demoUser(e),i.e.shared(e).hasPurchases.pipe((0,u.s)(1)),v.T.shared().androidAppLink,v.T.shared().iosAppLink,v.T.shared().anotherPlatformInstallOfferingEnabled,w.x.shared(e).tags]).pipe((0,l.T)(e=>{var[[s,t],r,a,i,n,d,o]=e,u=!1;if(o.includes("presence.history.androidapp")||o.includes("presence.history.iosapp"))return!1;var l=Date.now();(!s||!t||1===t&&l-s>30*p.b.day||2===t&&l-s>90*p.b.day||l-s>180*p.b.day)&&(u=!0);var c="web"===(0,m.platform)(),h=c&&"ios"===(0,m.operatingSystem)()&&!!n,v=c&&"android"===(0,m.operatingSystem)()&&!!i,f=c&&!["ios","android"].includes((0,m.operatingSystem)())&&(!!n||!!i);return d&&u&&!r&&a&&(h||v||f)}),(0,c.F)())}start(){return f.v.just(I.Q.success({}))}accept(e){return f.v.just(I.Q.success())}postpone(e){var s=h.y.shared(S,this.userId);return s.load(y).pipe((0,b.Fg)(e=>f.v.zip(s.store(y,(null!=e?e:0)+1),s.store(A,Date.now()))),(0,b.AB)(I.Q.success()))}}T.shared=(0,r.G)(e=>new T(e))},69725(e,s,t){t.d(s,{v:()=>l});var r=t(15526),a=t(28138),i=t(15654),n=t(43751),d=t(79760),o=t(38792),u=t.n(o);class l{constructor(){this.history=n.Y.shared().get(d.A).store.rxState().pipe((0,a.T)(()=>{var e;return null==(e=n.Y.shared().get(d.A).store)?void 0:e.getHistory()}),(0,a.T)(e=>e.map(e=>e.name)),(0,i.F)(u()))}}l.shared=(0,r.G)(()=>new l)},89840(e,s,t){t.d(s,{q:()=>h});var r=t(75841),a=t(15526),i=t(74380),n=t(13462),d=t(84190),o=t(15654),u=t(36580),l="shared_state",c="emailOnlyAuthExperiment";class h{constructor(){this.enabled=n.T.shared().emailAuthorizationEnabled.pipe((0,d.n)(e=>{var s=function(){try{var e=JSON.parse(localStorage.getItem(l)||"")[c];if("boolean"==typeof e)return e}catch(e){}}();if("boolean"==typeof s)return(0,r.of)(s);var t={[c]:e};try{var a=JSON.parse(localStorage.getItem(l)||"");a&&!Array.isArray(a)&&(t=Object.assign({},a,{[c]:e}))}catch(e){}return localStorage.setItem(l,JSON.stringify(t)),(0,r.of)(e)}),(0,o.F)(),(0,u.t)(1))}auth(e){return i.o.shared().requestAuthorization({type:"email",data:{email:e}})}}h.shared=(0,a.G)(()=>new h)},48945(e,s,t){t.d(s,{T:()=>d});var r=t(15526),a=t(46018),i=t(37418),n={SetGender:1,SetUserPreferences:2,SetInterests:3,SetBirthday:4,SetName:5,SetEmail:6,SetPhoto:7};class d{logProfileRequiredStepCompleted(){a.n.shared().logEvent("profile_required_step_completed")}logRegistrationCompleted(){a.n.shared().logEvent("registration_completed")}logRegistrationPhotoAdded(e){a.n.shared().logEvent("registration_photo_added",{photo_type:e})}logModernAuthScreenShown(e){a.n.shared().logEvent("modern_auth_screen_shown",{screen_name:e,screen_number:n[e]})}logOnboardingCompleted(){i.V.shared().logEvent("onboarding","view","completed",void 0)}logOnboardingUploadPhotoView(){i.V.shared().logEvent("onboarding","view","upload_photo",void 0)}logOnboardingUploadPhotoBackButtonClick(){i.V.shared().logEvent("onboarding","click","upload_photo_back_button",void 0)}logOnboardingUploadPhotoCompleted(){i.V.shared().logEvent("onboarding","view","upload_photo_completed",void 0)}logOnboardingUploadPhotoNextButtonClick(e){i.V.shared().logEvent("onboarding","click","upload_photo_next_button",{photoVisibility:e})}logOnboardingUploadPhotoVisibilityCheckboxClick(e){i.V.shared().logEvent("onboarding","click","photo_visibility_checkbox",{photoVisibility:e})}logOnboardingEmailConfirmationViewed(e){i.V.shared().logEvent("onboarding","view","email_confirmation",{known_email_provider:e})}logOnboardingEmailConfirmationChangeEmailClicked(e){i.V.shared().logEvent("onboarding","click","email_confirmation_change_email",{known_email_provider:e})}logOnboardingEmailConfirmationSendAgainClicked(e){i.V.shared().logEvent("onboarding","click","email_confirmation_send_again",{known_email_provider:e})}logOnboardingConfirmationEmailChangeAndResendButtonClick(e){i.V.shared().logEvent("onboarding","click","confirmation_email_change_and_resend_button",{known_email_provider:e})}
3logOnboardingConfirmationEmailChanged(){i.V.shared().logEvent("onboarding","view","confirmation_email_changed",void 0)}logOnboardingConfirmationEmailChangeCancelButtonClick(){i.V.shared().logEvent("onboarding","click","confirmation_email_change_cancel_button",void 0)}logOnboardingEmailConfirmationCheckMailboxButtonClicked(e){i.V.shared().logEvent("onboarding","click","email_confirmation_check_mailbox_button",{known_email_provider:e})}logOnboardingEmailConfirmationProviderClicked(e,s,t){i.V.shared().logEvent("onboarding","click","email_confirmation_provider_selected",{known_email_provider:e,link_type:s,provider_domain:t})}logOnboardingEmailConfirmationEmailNotReceivedClicked(e){i.V.shared().logEvent("onboarding","click","email_confirmation_didnt_receive_email",{known_email_provider:e})}logOnboardingEmailConfirmationCompletedViewed(e){i.V.shared().logEvent("onboarding","view","email_confirmation_completed",{known_email_provider:e})}logOnboardingEmailConfirmationLinkOpenFailed(e,s,t){i.V.shared().logEvent("onboarding","click","email_confirmation_link_open_failed",{known_email_provider:e,link_type:s,provider_domain:t})}}d.shared=(0,r.G)(()=>new d)},15971(e,s,t){t.d(s,{F:()=>i});var r=t(12640),a=t(15526);class i{constructor(e){this.userId=e}logPopupShown(){this.logEvent("banner-we-care-shown",{})}logUserWentFromPopup(e){this.logEvent("banner-we-care-shown-left",{reason:e})}logAcceptAndContinueClicked(){this.logEvent("banner-we-care-clicked",{})}logEvent(e,s){r._.shared(this.userId).logEvent(e,Object.assign({},s,{"user-id":this.userId,date:new Date().toISOString()})).safeSubscribe()}}i.shared=(0,a.G)(e=>new i(e))},99507(e,s,t){t.d(s,{z:()=>l});var r=t(15526),a=t(93623),i=t(28138),n=t(15654),d=t(53940),o=t(86977),u=t(34578);class l{constructor(e){this.balance=a.q.shared(e).data().pipe((0,i.T)(e=>e.balance),(0,n.F)()),this.balanceChanged=(0,u.h)(o.I.shared(e).events("event.bonuses.accounts.balance.credited").pipe((0,d.p)(e=>e.change>0),(0,d.p)(e=>!!e["sender-id"]),(0,i.T)(e=>({amount:e.change,meta:{senderId:e["sender-id"],operation:"credit"}}))),o.I.shared(e).events("event.bonuses.accounts.balance.debited").pipe((0,d.p)(e=>e.change>0),(0,i.T)(e=>({amount:e.change,meta:{operation:"debit"}}))))}}l.shared=(0,r.G)(e=>new l(e))},23486(e,s,t){t.d(s,{o:()=>i});var r=t(15526),a=t(97156);class i{constructor(){this.statusSubject=new a.t("idle"),this.status=this.statusSubject.asObservable()}setStatus(e){this.statusSubject.next(e)}}i.shared=(0,r.G)(()=>new i)},35327(e,s,t){t.d(s,{E:()=>n});var r=t(43751),a=t(79760),i=t(39971),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new i.v(s=>{r.Y.shared().get(a.A).actions.open("bonuses-intro",[{props:e,spinnerEnabled:!0,disableManualClose:!0}]),s.success()})}},8764(e,s,t){t.d(s,{e:()=>b});var r=t(75841),a=t(56607),i=t(34578),n=t(15526),d=t(86977),o=t(15654),u=t(65052),l=t(50626),c=t(84190),h=t(36580),p=t(10845),v=t(43751),m=t(33702),f=t.n(m);class b{constructor(e){var s=v.Y.shared().get(p.A,e).store.rxState().pipe((0,o.F)(f()),(0,u.Z)({status:"idle"}),(0,l.J)(),(0,c.n)(e=>{var[s,t]=e;return"speaking"===s.status&&"idle"===t.status?(0,r.of)(null):a.w}));this.absence=(0,i.h)(s,d.I.shared(e).events("ci:event.call.attendee.absent")).pipe((0,h.t)(1))}start(e){e.add(this.absence.safeSubscribe())}absenceOfAttendee(e){return this.absence.pipe((0,c.n)(s=>s?s.sender===e?(0,r.of)(s.absent):a.w:(0,r.of)(!1)),(0,o.F)(),(0,u.Z)(!1))}}b.shared=(0,n.G)(e=>new b(e))},40553(e,s,t){t.d(s,{C:()=>r});function r(e){return"DSGN5474_Test1"===e||"DSGN5474_Test3"===e}},51830(e,s,t){t.d(s,{m:()=>f});var r=t(15526),a=t(8733),i=t(56607),n=t(43751),d=t(10845),o=t(15654),u=t(28138),l=t(84190),c=t(53940),h=t(56177),p=t(50626),v=t(86977),m=t(14321);class f{constructor(e){this.shouldNotifySubject=new a.B,this.userId=e,this.shouldNotify=this.shouldNotifySubject.asObservable().pipe((0,o.F)())}start(e){var s=n.Y.shared().get(d.A,this.userId).store.rxState().pipe((0,u.T)(e=>"speaking"===e.status?e.attendee:void 0),(0,o.F)());e.add(m.f.shared(this.userId).userIsFeaturedMember.pipe((0,l.n)(e=>e?s:i.w),(0,l.n)(e=>e?v.I.shared(this.userId).events("ci:event.dialogs.media.capture.added").pipe((0,c.p)(s=>s.sender===e),(0,h.s)(1)):i.w)).safeSubscribe(()=>{this.shouldNotifySubject.next(!0)})),e.add(n.Y.shared().get(d.A,this.userId).store.rxState().pipe((0,p.J)(),(0,c.p)(e=>{var[s,t]=e;return"speaking"===s.status&&"idle"===t.status})).safeSubscribe(()=>{this.shouldNotifySubject.next(!1)}))}}f.shared=(0,r.G)(e=>new f(e))},85081(e,s,t){t.d(s,{V:()=>w});var r=t(15526),a=t(43751),i=t(8733),n=t(56607),d=t(75841),o=t(34578),u=t(15654),l=t(50626),c=t(92453),h=t(53940),p=t(84190),v=t(10845),m=t(67276),f=t(55952);function b(e){var[s,t]=e;return"idle"!==s.status&&"ringing"!==s.status&&"idle"===t.status}function g(e){var[s,t]=e;return"idle"!==s.status&&"idle"===t.status}function I(e){var[s,t]=e;return"speaking"!==s.status&&"speaking"===t.status}
3class w{constructor(e){this.completedCallSubject=new i.B,this.userId=e,this.completedCall=this.completedCallSubject.asObservable()}mcsCompletedCall(){var e=null;return m.M.shared(this.userId).state.pipe((0,u.F)((e,s)=>e.status===s.status),(0,l.J)(),(0,c.M)(s=>{I(s)&&null===e&&(e=Date.now())}),(0,h.p)(g),(0,p.n)(s=>{var[t]=s,r=e,a=Date.now();e=null;var i=(null==t?void 0:t.calleeId)||(null==t?void 0:t.participants[0]);return f.K.shared(this.userId).id(i).asObservable().pipe((0,p.n)(e=>null!==r&&e?(0,d.of)({callType:t.callType,source:"mcs",cta:t.cta,attendeeId:e,startedAt:r,finishedAt:a,duration:a-r}):n.w))}))}cpCompletedCall(){var e=null;return a.Y.shared().get(v.A,this.userId).store.rxState().pipe((0,u.F)((e,s)=>e.status===s.status),(0,l.J)(),(0,c.M)(s=>{I(s)&&null===e&&(e=Date.now())}),(0,h.p)(b),(0,p.n)(s=>{var[t]=s,r=e,a=Date.now();return(e=null,null===r)?n.w:(0,d.of)({source:"cp",cta:t.dialSource,attendeeId:t.attendee,startedAt:r,finishedAt:a,duration:a-r})}))}start(e){e.add((0,o.h)(this.mcsCompletedCall(),this.cpCompletedCall()).safeSubscribe(e=>{this.completedCallSubject.next(e)}))}}w.shared=(0,r.G)(e=>new w(e))},9150(e,s,t){t.d(s,{s:()=>n});var r=t(15526),a=t(97156),i=t(15654);class n{constructor(){this.visibleSubject=new a.t(!1),this.visible=this.visibleSubject.asObservable().pipe((0,i.F)())}setVisible(e){this.visibleSubject.next(e)}}n.shared=(0,r.G)(()=>new n)},40866(e,s,t){t.d(s,{U3:()=>B});var r=t(15526),a=t(13462),i=t(89218),n=t(39971),d=t(91885),o=t(22998),u=t(97156),l=t(34578),c=t(75841),h=t(17524),p=t(97983),v=t(84190),m=t(15654),f=t(50626),b=t(92453),g=t(53940),I=t(28138),w=t(53193),S=t(36580),y=t(56177),A=t(79942),T=t(91654),x=t(71534),C=t(67276),F=t(43751),D=t(10845),k=t(55952),E=t(11395),j="call-feedback",R="count-of-shown-call-feedbacks",O="call-feedback-blocked-timestamp",M="count-of-short-calls",G="last-feedback-showed-timestamp";class B extends i.D{constructor(e){super(),this.offerShowedDuringSession=new u.t(!1),this.callStartedTimestamp=null,this.callFinishedTimestamp=null,this.userId=e,this.canOffer=(0,l.h)(this.offeringResult.pipe((0,p.u)(!1)),a.T.shared().callFeedback.enabled.pipe((0,v.n)(e=>e?(0,l.h)(C.M.shared(this.userId).state.pipe((0,m.F)((e,s)=>e.status===s.status),(0,f.J)(),(0,b.M)(e=>{var[s,t]=e;"speaking"===s.status||"speaking"!==t.status||this.callStartedTimestamp||(this.callStartedTimestamp=Date.now()),"idle"!==s.status&&"idle"===t.status&&(this.callFinishedTimestamp=Date.now())}),(0,g.p)(e=>{var[s,t]=e;return"idle"!==s.status&&"voiceonly"!==s.callType&&"idle"===t.status}),(0,v.n)(e=>{var[s]=e,t=(null==s?void 0:s.calleeId)||(null==s?void 0:s.participants[0]);return k.K.shared(this.userId).id(t).asObservable().pipe((0,I.T)(e=>e?{source:"mcs",cta:s.cta,attendeeId:e}:null))})),F.Y.shared().get(D.A,this.userId).store.rxState().pipe((0,m.F)((e,s)=>e.status===s.status),(0,f.J)(),(0,b.M)(e=>{var[s,t]=e;"speaking"===s.status||"speaking"!==t.status||this.callStartedTimestamp||(this.callStartedTimestamp=Date.now()),"idle"!==s.status&&"ringing"!==s.status&&"idle"===t.status&&(this.callFinishedTimestamp=Date.now())}),(0,g.p)(e=>{var[s,t]=e;return"idle"!==s.status&&"ringing"!==s.status&&"idle"===t.status}),(0,I.T)(e=>{var[s]=e;return"idle"!==s.status&&"ringing"!==s.status?{source:"cp",cta:s.dialSource,attendeeId:s.attendee}:null}))).pipe((0,v.n)(e=>{if(null===this.callStartedTimestamp||null===this.callFinishedTimestamp||!e)return this.callFinishedTimestamp=null,this.callStartedTimestamp=null,(0,c.of)(!1);var s=this.callFinishedTimestamp-this.callStartedTimestamp;return this.callFinishedTimestamp=null,this.callStartedTimestamp=null,a.T.shared().callFeedback.shortCallDuration.pipe((0,v.n)(t=>s>t?o.w.shared(j,this.userId).store(M,0).asObservable().pipe((0,p.u)(Object.assign({},e,{duration:s,type:"long-call"}))):(0,c.of)(Object.assign({},e,{duration:s,type:"short-call"}))),(0,v.n)(e=>this.shouldShowOffer(e)),(0,v.n)(e=>e?x.t.shared().visible.pipe((0,I.T)(s=>!s&&e),(0,w.Q)(this.offeringResult)):(0,c.of)(!1)))})):(0,c.of)(!1)))).pipe((0,m.F)(),(0,S.t)({refCount:!0,bufferSize:1}))}start(e){return this.offer.toSingle().pipe((0,A.Fg)(s=>
3null!==s?n.v.just(d.Q.success(e)):(0,h.z)([a.T.shared().callFeedback.feedbacksThreshold,a.T.shared().callFeedback.feedbacksThresholdTtl,o.w.shared(j,this.userId).load(R),o.w.shared(j,this.userId).load(G)]).toSingle().pipe((0,A.Fg)(s=>{var[t,r,a,i]=s,u=!i||Date.now()-i>=r,l=a&&!u?a+1:1;return(l>=t?o.w.shared(j,this.userId).store(O,Date.now()).pipe((0,A.Fg)(()=>o.w.shared(j,this.userId).store(R,0)),(0,A.Fg)(()=>o.w.shared(j,this.userId).store(G,Date.now()))):o.w.shared(j,this.userId).store(R,l).pipe((0,A.Fg)(()=>o.w.shared(j,this.userId).store(G,Date.now())))).pipe((0,A.Fg)(()=>(this.offerShowedDuringSession.next(!0),"short-call"===e.type)?o.w.shared(j,this.userId).store(M,0).pipe((0,A.AB)(d.Q.success(e))):n.v.just(d.Q.success(e))))}))))}shouldShowOffer(e){return(0,h.z)([this.offerShowedDuringSession.asObservable(),a.T.shared().sendCheerTriggerBannersEnabled,a.T.shared().postCallSendCheerBanner]).pipe((0,y.s)(1),(0,v.n)(s=>{var[t,r,i]=s;return t||r&&e.duration>i.minCallDuration?(0,c.of)(!1):(0,h.z)([a.T.shared().callFeedback.feedbacksBlockingTime,o.w.shared(j,this.userId).load(O),T.e.shared(this.userId).balance,E.sM.shared(this.userId).offer]).pipe((0,y.s)(1),(0,v.n)(e=>{var[s,t,r,a]=e;if(!r||a)return(0,c.of)(!0);var i=!!t&&Date.now()-t<s;return(0,c.of)(i)}),(0,v.n)(s=>s?(0,c.of)(!1):"long-call"===e.type?(0,c.of)(e):(0,h.z)([a.T.shared().callFeedback.countOfShortCallsToShow,o.w.shared(j,this.userId).load(M)]).pipe((0,y.s)(1),(0,v.n)(s=>{var[t,r]=s,a=null===r?1:r+1;return a<t?o.w.shared(j,this.userId).store(M,a).asObservable().pipe((0,p.u)(!1)):(0,c.of)(e)}))))}))}}B.shared=(0,r.G)(e=>new B(e))},52127(e,s,t){t.d(s,{a:()=>n});var r=t(15526),a=t(97156),i=t(82483);class n{constructor(){this.hangupSubject=new a.t({hangupIn:null,hangupOut:null}),this.hangup=this.hangupSubject.asObservable(),this.updateHangup=(e,s)=>{this.hangupSubject.next({hangupIn:e,hangupOut:s})},this.clearHangup=()=>{this.hangupSubject.next({hangupIn:null,hangupOut:null})}}start(e){i.g.shared().addListener("event.call.media.hangup.processed",this.updateHangup),i.g.shared().addListener("event.chat.media.destroyed",this.clearHangup),e.add(()=>{i.g.shared().removeListener("event.call.media.hangup.processed",this.updateHangup),i.g.shared().removeListener("event.chat.media.destroyed",this.clearHangup)})}}n.shared=(0,r.G)(()=>new n)},8083(e,s,t){t.d(s,{C:()=>u});var r=t(56379),a=t(15526),i=t(39971),n=t(79942),d=t(38107),o=t(13462);class u{constructor(e){this.itemsSubject=new d.m(1),this.items=this.itemsSubject.asObservable(),this.userId=e}get(e){return r.M.shared(this.userId).initialized.toSingle().pipe((0,n.Fg)(s=>s&&r.M.shared(this.userId).aiPerfectMatchUsers?o.T.shared().aiPerfectMatch.form.ageRanges.toSingle().pipe((0,n.Fg)(s=>{var{userGender:t,matchGender:a,age:d,bodyType:o,personality:u}=e,[l,c]=s[d];return i.v.from(r.M.shared(this.userId).aiPerfectMatchUsers.load({minAge:l,maxAge:c,gender:a,preferredGender:t,bodyType:o,personality:u})).pipe((0,n.ex)(e=>{this.itemsSubject.next(e)}))})):i.v.just([])))}}u.shared=(0,a.G)(e=>new u(e))},6924(e,s,t){t.d(s,{F:()=>y});var r=t(89218),a=t(15526),i=t(13462),n=t(63525),d=t(66778),o=t(69176),u=t(10629),l=t(53940),c=t(28138),h=t(65052),p=t(15654),v=t(84190),m=t(36580),f=t(39971),b=t(91885),g=t(34578),I=t(17524),w=t(75841),S=t(18211);class y extends r.D{constructor(e){super(),this.userId=e;var s=(0,g.h)(d.R.shared().interacted.pipe((0,u.i)(1)),S.C.shared().events.pipe((0,l.p)(e=>"mousedown"===e||"mouseup"===e||"mousemove"===e))).pipe((0,c.T)(()=>!0),(0,h.Z)(!1),(0,p.F)()),t=o.B.shared(e).state.pipe((0,c.T)(e=>{var s;return null!=(s=e.incomingCalls[0])?s:null}),(0,c.T)(e=>(null==e?void 0:e.callType)==="voiceonly"?e.callId:null),(0,p.F)());this.canOffer=(0,I.z)([i.T.shared().mcs.audioCall.enabled,n.f.shared(this.userId).state.pipe((0,c.T)(e=>e.available),(0,p.F)()),i.T.shared().mcs.audioCall.autoAccept.enabled]).pipe((0,v.n)(e=>{var[r,a,i]=e;return r&&a&&i?t.pipe((0,v.n)(e=>e?s:(0,w.of)(!1))):(0,w.of)(!1)}),(0,h.Z)(!1),(0,p.F)(),(0,m.t)({refCount:!0,bufferSize:1}))}start(){return f.v.just(b.Q.success({}))}}y.shared=(0,a.G)(e=>new y(e))},36771(e,s,t){t.d(s,{a:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logNotificationShown(){a._.shared(this.userId).logEvent("mcs-audio-call-available-notification-shown",{}).safeSubscribe()}logPopupShown(e){a._.shared(this.userId).logEvent("mcs-audio-call-unavailable-popup-shown",{status:e}).safeSubscribe()}logPopupClosed(e){a._.shared(this.userId).logEvent("mcs-audio-call-unavailable-popup-closed",{reason:e}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},50262(e,s,t){t.d(s,{n:()=>k}
3);var r=t(15526),a=t(89218),i=t(65428),n=t(17524),d=t(75841),o=t(56823),u=t(13462),l=t(63525),c=t(28138),h=t(15654),p=t(84190),v=t(65052),m=t(53940),f=t(56177),b=t(36580),g=t(39971),I=t(91885),w=t(77252),S=t(29109),y=t(66382),A=t(44999),T=t(78477),x=t(58731),C=t(79942),F="mcs-audio-call-availability-offering",D="last-shown-timestamp";class k extends a.D{constructor(e){super(),this.userId=e,this.canOffer=(0,n.z)([u.T.shared().mcs.audioCall.enabled,u.T.shared().mcs.audioCall.enabledByDefault,l.f.shared(this.userId).audioCallOnlyEnabled,l.f.shared(this.userId).state.pipe((0,c.T)(e=>e.available),(0,h.F)())]).pipe((0,p.n)(e=>{var[s,t,r,a]=e;return s&&t&&r&&a?u.T.shared().mcs.audioCall.availabilityOfferingDelay.pipe((0,p.n)(e=>(0,o.O)(e)),(0,p.n)(()=>i.K.shared().microphone.pipe((0,c.T)(e=>{var s;return null!=(s=null==e?void 0:e.permission)?s:"denied"}))),(0,h.F)(),(0,p.n)(e=>{var s=y.j.shared().chatAttendee.pipe((0,p.n)(e=>e?S.u.shared(this.userId).statusOfChatWith(e).pipe((0,c.T)(e=>!!e),(0,h.F)()):(0,d.of)(!1)));return(0,n.z)([w.J.shared(this.userId).callExists,s,A.l.shared().visible,T.y.shared().data.pipe((0,c.T)(e=>!!e)),this.offer.pipe((0,v.Z)(null))]).pipe((0,c.T)(e=>{var[s,t,r,a,i]=e;return s||t||r||a||i}),(0,m.p)(e=>!e),(0,f.s)(1),(0,p.n)(()=>{var s=(0,n.z)([u.T.shared().mcs.audioCall.lastShownAvailableNotificationThreshold,x.y.shared(F,this.userId).load(D)]).pipe((0,c.T)(e=>{var[s,t]=e;return(null!=t?t:-1/0)<Date.now()-s}));return"allowed"===e?s.pipe((0,c.T)(s=>!!s&&e)):(0,d.of)(e)}))})):(0,d.of)(!1)}),(0,h.F)(),(0,b.t)({refCount:!0,bufferSize:1}))}start(e){return this.offer.toSingle().pipe((0,C.Fg)(s=>s?g.v.just(I.Q.failure("offer-not-allowed")):"allowed"===e?x.y.shared(F,this.userId).store(D,Date.now()).pipe((0,C.vV)(()=>I.Q.success(e))):g.v.just(I.Q.success(e))))}}k.shared=(0,r.G)(e=>new k(e))},59697(e,s,t){t.d(s,{r:()=>n});var r=t(15526),a=t(12640),i=t(17951);class n{constructor(e){this.userId=e}logInviteShown(e){a._.shared(this.userId).logEvent("audio-call-invite-shown",{attendeeId:e}).safeSubscribe(),i._.shared(this.userId).logUserAction({type:"audioinvitation.shown",data:{"attendee-id":e}}).safeSubscribe()}logInviteClosed(e,s){a._.shared(this.userId).logEvent("audio-call-invite-closed",{attendeeId:e,reason:s}).safeSubscribe()}logInviteClicked(e){a._.shared(this.userId).logEvent("audio-call-invite-clicked",{attendeeId:e}).safeSubscribe()}logInviteAudioPlayed(e){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a._.shared(this.userId).logEvent("audio-call-invite-audio-played",{attendeeId:e,playedByHover:s}).safeSubscribe()}}n.shared=(0,r.G)(e=>new n(e))},18040(e,s,t){t.d(s,{E:()=>_});var r=t(89218),a=t(15526),i=t(17524),n=t(75841),d=t(4126),o=t(56823),u=t(30131),l=t(40554),c=t(13462),h=t(28138),p=t(15654),v=t(84190),m=t(80914),f=t(10629),b=t(36580),g=t(53940),I=t(56177),w=t(2773),S=t(13442),y=t(50846),A=t(30495),T=t(79942),x=t(50042);class C extends y.Q{constructor(e){super("users.recommendations.audioinvitation",e,s=>(0,A.p6)(A.jI.shared().users.recommendations.audioinvitation.get,e,s).pipe((0,T.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t?t.users.map(e=>e["user-id"]):[],ttl:(null==(s=(0,x.a)(r))?void 0:s.maxAge)||0}})))}}C.shared=(0,a.G)(e=>new C(e));
3var F=t(13230),D=t(39971),k=t(91885),E=t(29015),j=t(5005),R=t(73628),O=t(33702),M=t.n(O),G=t(12985),B=t(41488),P=t(36214);class _ extends r.D{constructor(e){super(),this.userId=e;var s=(0,i.z)([c.T.shared().mcs.audioCall.enabled,c.T.shared().mcs.audioCall.invite.enabled]).pipe((0,h.T)(e=>{var[s,t]=e;return s&&t}),(0,p.F)());this.canOffer=s.pipe((0,v.n)(e=>e?c.T.shared().mcs.audioCall.invite.offerInterval.pipe((0,v.n)(e=>(0,n.of)(null).pipe((0,m.f)(()=>this.offerLoop(e)),(0,f.i)(1)))):(0,n.of)(!1)),(0,p.F)(M()),(0,b.t)({refCount:!0,bufferSize:1}))}offerLoop(e){return(0,d.v)(()=>{var s=P.wi.shared(this.userId).invite.pipe((0,h.T)(e=>!!e));return(0,i.z)([(0,o.O)(e),(0,B.G)(),s]).pipe((0,g.p)(e=>{var[s,t,r]=e;return!t&&!r}),(0,I.s)(1),(0,v.n)(()=>this.selectUsers()),(0,v.n)(e=>this.processUsers(e)))})}selectUsers(){return G.im.shared(this.userId).preferences.pipe((0,I.s)(1),(0,v.n)(e=>{var{gender:s,preferredGender:t}=e;return s&&t?C.shared(this.userId).data({select:5,gender:s,"preferred-gender":t}).pipe((0,w.W)(()=>(0,n.of)([]))):(0,n.of)([])}))}processUsers(e){return(0,u.H)(e).pipe((0,l.H)(e=>F.N.shared(this.userId).audioCallAvailable(e).pipe((0,I.s)(1),(0,v.n)(s=>s?this.getAudioSample(e).pipe((0,h.T)(s=>!!s&&this.mapAudioCallInviteToUserEvent(e,s))):(0,n.of)(!1)))),(0,S.$)(e=>!!e,!1))}getAudioSample(e){return(0,i.z)([E.xN.shared(this.userId).state.pipe((0,h.T)(e=>{var{locale:s}=e;return s})),E.xN.shared(this.userId).getUserDefaultLocale()]).pipe((0,I.s)(1),(0,h.T)(e=>{var[s,t]=e;return s||t}),(0,v.n)(s=>j.g.shared(this.userId).get(e,s,"profile")))}mapAudioCallInviteToUserEvent(e,s){var t=new Date;return{type:R._j.AudioCallInvite,"event-id":t.getTime(),"holder-id":this.userId,"user-id":e,timestamp:t.toISOString(),stale:!1,stack:1,payload:{"recipient-id":this.userId,meta:{audioSample:s}}}}start(e){return this.offer.toSingle().pipe((0,T.Fg)(s=>s?D.v.just(k.Q.failure("offer-not-allowed")):D.v.just(k.Q.success(e))))}}_.shared=(0,a.G)(e=>new _(e))},23100(e,s,t){t.d(s,{f:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logShown(e,s,t){var{text:r,textEn:i}=s;a._.shared(this.userId).logEvent("chat"===t?"audio-call-motivation-popup-in-chat-shown":"audio-call-motivation-popup-in-profile-shown",{attendeeId:e,text:r,textEn:i}).safeSubscribe()}logClicked(e,s,t){var{text:r,textEn:i}=s;a._.shared(this.userId).logEvent("chat"===t?"audio-call-motivation-popup-in-chat-clicked":"audio-call-motivation-popup-in-profile-clicked",{attendeeId:e,text:r,textEn:i}).safeSubscribe()}logRejected(e,s,t){var{text:r,textEn:i}=s;a._.shared(this.userId).logEvent("chat"===t?"audio-call-motivation-popup-in-chat-rejected":"audio-call-motivation-popup-in-profile-rejected",{attendeeId:e,text:r,textEn:i}).safeSubscribe()}logClosed(e,s,t,r){var{text:i,textEn:n}=s;a._.shared(this.userId).logEvent("chat"===t?"audio-call-motivation-popup-in-chat-closed":"audio-call-motivation-popup-in-profile-closed",{attendeeId:e,text:i,textEn:n,reason:r}).safeSubscribe()}logAccepted(e,s,t){var{text:r,textEn:i}=s;a._.shared(this.userId).logEvent("chat"===t?"audio-call-motivation-popup-in-chat-accepted":"audio-call-motivation-popup-in-profile-accepted",{attendeeId:e,text:r,textEn:i}).safeSubscribe()}logBlocked(e,s){a._.shared(this.userId).logEvent("audio-call-motivation-popup-in-chat-blocked",{attendeeId:e,reason:s}).safeSubscribe()}logClickedInChatLog(e,s){a._.shared(this.userId).logEvent("audio-call-motivation-popup-in-chat-log-clicked",{attendeeId:e,path:s}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},31238(e,s,t){t.d(s,{m:()=>M});var r=t(89218),a=t(15526),i=t(13462),n=t(17524),d=t(75841),o=t(56823),u=t(34578),l=t(13707),c=t(28138),h=t(56177),p=t(84190),v=t(53940),m=t(27585),f=t(65052),b=t(15654),g=t(36580),I=t(77813),w=t(14321),S=t(66382),y=t(13230),A=t(25871),T=t(46822),x=t(29015),C=t(5005),F=t(33702),D=t.n(F),k=t(91885),E=t(79942),j=t(77194),R=t(77252),O=t(21050);class M extends r.D{constructor(e){super();var s=(0,n.z)([i.T.shared().mcs.audioCall.enabled,i.T.shared().audioCallMotivationPopup.enabled,w.f.shared(e).userIsFeaturedMember,T.c.shared().profileId]).pipe((0,p.n)(s=>{var[t,r,a,u]=s;return t&&r&&!a&&u?A.L.shared(e).audioPromoAllowed(u,"mopup").pipe((0,p.n)(s=>s?y.N.shared(e).audioCallAvailable(u).pipe((0,v.p)(e=>e),(0,h.s)(1),(0,p.n)(()=>O.J.shared("profile").canShowAudio()),(0,v.p)(e=>e),(0,h.s)(1),(0,m.E)(i.T.shared().audioCallMotivationPopup.profile.displayStartTime,O.J.shared("profile").closedAt("video")),(0,p.n)(s=>{var[,t,r]=s;return(r>0?(0,d.of)(0):(0,o.O)(t)).pipe((0,c.T)(()=>
3u),(0,p.n)(s=>(0,n.z)([j.N.shared(e).blockedUsers.pipe((0,c.T)(e=>e.includes(s))),w.f.shared(s).userIsFeaturedMember,S.j.shared().chatAttendee.pipe((0,c.T)(e=>!!e)),y.N.shared(e).audioCallAvailable(s),R.J.shared(e).callExists]).pipe((0,h.s)(1),(0,p.n)(t=>{var[r,a,i,o,u]=t;return r||!a||i||!o||u?(0,d.of)(!1):O.J.shared("profile").canShowAudio().pipe((0,v.p)(e=>e),(0,h.s)(1),(0,p.n)(()=>(0,n.z)([x.xN.shared(e).state.pipe((0,c.T)(e=>{var{locale:s}=e;return s})),x.xN.shared(e).getUserDefaultLocale()]).pipe((0,h.s)(1),(0,c.T)(e=>{var[s,t]=e;return s||t}),(0,p.n)(s=>x.xN.shared(e).audioCallSupportedLocales.pipe((0,c.T)(e=>e.includes(s)?s:x.tO))),(0,p.n)(t=>C.g.shared(e).get(s,t,"profile")),(0,c.T)(e=>!!e&&{attendeeId:s,audioSample:e}))))}))))})):(0,d.of)(!1))):(0,d.of)(!1)}));this.canOffer=(0,u.h)(s,this.offeringResult.pipe((0,c.T)(()=>!1))).pipe((0,f.Z)(!1),(0,b.F)(D()),(0,g.t)({bufferSize:1,refCount:!0}))}get offer(){return super.offer.pipe((0,I.Q)(l.T))}start(e){return this.offer.toSingle().pipe((0,E.vV)(s=>s?k.Q.failure("offer-not-allowed"):k.Q.success(e)))}}M.shared=(0,a.G)(e=>new M(e))},63525(e,s,t){t.d(s,{f:()=>y});var r=t(15526),a=t(17524),i=t(75841),n=t(48830),d=t(56607),o=t(13462),u=t(56379),l=t(84190),c=t(15654),h=t(36580),p=t(28138),v=t(14321),m=t(33702),f=t.n(m),b=t(12640);class g{constructor(e){this.userId=e}logAudioCallEnabledValueToggled(e){b._.shared(this.userId).logEvent("mcs-audio-call-settings-toggle",{enabled:e}).safeSubscribe()}}g.shared=(0,r.G)(e=>new g(e));var I=t(96333),w=t(55952),S={available:!1,enabled:!1};class y{constructor(e){this.userId=e,this.state=(0,a.z)([o.T.shared().mcs.enabled,o.T.shared().mcs.audioCall.enabled,u.M.shared(this.userId).initialized,v.f.shared(this.userId).userIsFeaturedMember]).pipe((0,l.n)(e=>e.every(e=>e)?new n.c(e=>{var s=s=>{e.next(s)},t=u.M.shared(this.userId).audioCallSettings;return t&&(e.next(t.getState()),t.addStateListener(s)),()=>{var e;null==(e=u.M.shared(this.userId).audioCallSettings)||e.removeStateListener(s)}}):(0,i.of)(S)),(0,c.F)(f()),(0,h.t)({refCount:!0,bufferSize:1})),this.audioCallOnlyEnabled=(0,a.z)([this.state,u.M.shared(this.userId).initialized.pipe((0,l.n)(e=>e?w.K.shared(this.userId).mcsId(this.userId).asObservable().pipe((0,l.n)(e=>e?I._.shared(this.userId).presence(e).pipe((0,p.T)(e=>{var s,t;return(null==e||null==(s=e.callAvailability)?void 0:s.video)!=="disabled"&&(null==e||null==(t=e.callAvailability)?void 0:t.audio)!=="disabled"}),(0,c.F)()):(0,i.of)(!1))):d.w))]).pipe((0,p.T)(e=>{var[s,t]=e;return s.available&&!t}),(0,c.F)(),(0,h.t)({refCount:!0,bufferSize:1}))}setEnabled(e){var s;null==(s=u.M.shared(this.userId).audioCallSettings)||s.setEnabled(e),g.shared(this.userId).logAudioCallEnabledValueToggled(e)}}y.shared=(0,r.G)(e=>new y(e))},46362(e,s,t){t.d(s,{j:()=>T});var r=t(15526),a=t(8733),i=t(97156),n=t(30131),d=t(80883),o=t(39971),u=t(79942),l=t(56379),c=t(55952),h=t(65052),p=t(84190),v=t(53940),m=t(56177),f=t(92453),b=t(36580),g=t(40554),I=t(28138),w=t(16566),S=t(13462),y=t(4938),A=t(94375);class T{constructor(e){this.refreshSubject=new a.B,this.pagerSubject=new i.t(30),this.loadingMore=!1,this.endReached=!1,this.userId=e,this.state=this.refreshSubject.pipe((0,h.Z)(void 0),(0,p.n)(()=>(this.pagerSubject=new i.t(30),this.loadingMore=!1,this.endReached=!1,l.M.shared(this.userId).initialized.pipe((0,v.p)(e=>e),(0,m.s)(1),(0,p.n)(()=>o.v.zip(y.E.shared().currentTime(),S.T.shared().callsSection.recommendations.daysPeriod.toSingle()).asObservable()),(0,p.n)(e=>{var[s,t]=e,r=Math.floor((s-t*A.b.day)/A.b.second);return new d.UM((e,s)=>this.getItems(e,s,r)).items(this.pagerSubject).pipe((0,f.M)(e=>this.updateStateMeta(e)))})))),(0,b.t)(1))}refresh(){this.refreshSubject.next()}loadMore(){this.loadingMore||this.endReached||(this.loadingMore=!0,this.pagerSubject.next(30))}updateStateMeta(e){this.endReached=e.endReached,this.loadingMore=!1}getItems(e,s,t){var r=l.M.shared(this.userId).callsHistory;return r?o.v.from(r.get({select:e,omit:s,maxLastCallAt:t})).pipe((0,u.W_)([]),(0,u.Fg)(e=>(0,n.H)(e).pipe((0,g.H)(e=>c.K.shared(this.userId).id(e.participantId).asObservable().pipe((0,I.T)(s=>{if(s)return{id:e.id,attendeeId:s,direction:e.direction,callType:e.callType,missed:e.missed,durationMs:e.durationMs,requestedMs:e.requestedMs}}))),(0,v.p)(e=>!!e),(0,w.$)()).toSingle())):o.v.just([])}}T.shared=(0,r.G)(e=>new T(e))},38595(e,s,t){t.d(s,{XO:()=>j});var r=t(89218),a=t(15526),i=t(13462),n=t(36214),d=t(84190),o=t(28138),u=t(15654),l=t(53940),c=t(56177),h=t(53193),p=t(97983),v=t(65052),m=t(36580),f=t(75841),b=t(17524),g=t(34578),I=t(27793),w=t(77252),S=t(39971),y=t(91885),A=t(79942),T=t(22998),x=t(66382),C=t(29109),F=t(9150),D=t(21433),k="speech-to-text-onboarding",E="shown";class j extends r.D{constructor(e){super(),this.userId=e;var s=x.j.shared().chatAttendee.pipe((0,d.n)(e=>e?C.u.shared(this.userId).statusOfChatWith(e).pipe((0,o.T)(e=>!!e)):(0,f.of)(!1)),(0,u.F)()),t=(0,b.z)([(0,I.g)(),w.J.shared(e).callExists,s,F.s.shared().visible,D.r.shared().name.pipe((0,o.T)(e=>!!e))]).pipe((0,o.T)(e=>{var[s,t,r,a,i]=e;return!s&&!t&&!r&&!a&&!i})),r=i.T.shared().mcs.callSpeechToText.onboarding.enabled.pipe((0,d.n)(e=>e?T.w.shared(k,this.userId).load(E).asObservable().pipe((0,d.n)(e=>e?(0,f.of)(!1):n.wi.shared(this.userId).inviteClosed.pipe((0,l.p)(e=>"manual-close"===e.reason||"timeout"===e.reason),(0,c.s)(1),(0,d.n)(()=>t)))):(0,f.of)(!1)),(0,h.Q)(this.offeringResult));this.canOffer=(0,g.h)(r,this.offeringResult.pipe((0,p.u)(!1))).pipe((0,v.Z)(!1),(0,u.F)(),(0,m.t)({refCount:!0,bufferSize:1}))}start(){return this.offer.toSingle().pipe((0,A.Fg)(e=>e?S.v.just(y.Q.failure("offer-not-allowed")):T.w.shared(k,this.userId).store(E,!0).pipe((0,A.AB)(y.Q.success({})))))}}j.shared=(0,a.G)(e=>new j(e))},52874(e,s,t){t.d(s,{a:()=>b});var r=t(15526),a=t(56379),i=t(13462),n=t(75841),d=t(48830),o=t(56607),u=t(84190),l=t(53940),c=t(56177),h=t(15654),p=t(36580),v=t(28138),m=t
3(33702),f=t.n(m);class b{constructor(e){this.userId=e,this.state=i.T.shared().mcs.enabled.pipe((0,u.n)(e=>e?a.M.shared(this.userId).initialized.pipe((0,l.p)(e=>e),(0,c.s)(1),(0,u.n)(()=>new d.c(e=>{var s,t,r=s=>{e.next(s)};return e.next(null==(s=a.M.shared(this.userId).userDevicesVisibility)?void 0:s.getState()),null==(t=a.M.shared(this.userId).userDevicesVisibility)||t.addStateListener(r),()=>{var e;null==(e=a.M.shared(this.userId).userDevicesVisibility)||e.removeStateListener(r)}})),(0,h.F)(f()),(0,p.t)({refCount:!0,bufferSize:1})):(0,n.of)({cameraVisibility:!1,microphoneVisibility:!1}))),this.mcsInitiated=i.T.shared().mcs.enabled.pipe((0,u.n)(e=>e?a.M.shared(this.userId).initialized.pipe((0,l.p)(e=>e),(0,v.T)(()=>void 0)):o.w),(0,c.s)(1))}enableCameraVisibility(){this.mcsInitiated.safeSubscribe(()=>{var e;null==(e=a.M.shared(this.userId).userDevicesVisibility)||e.enableCameraVisibility()})}disableCameraVisibility(){this.mcsInitiated.safeSubscribe(()=>{var e;null==(e=a.M.shared(this.userId).userDevicesVisibility)||e.disableCameraVisibility()})}enableMicrophoneVisibility(){this.mcsInitiated.safeSubscribe(()=>{var e;null==(e=a.M.shared(this.userId).userDevicesVisibility)||e.enableMicrophoneVisibility()})}disableMicrophoneVisibility(){this.mcsInitiated.safeSubscribe(()=>{var e;null==(e=a.M.shared(this.userId).userDevicesVisibility)||e.disableMicrophoneVisibility()})}}b.shared=(0,r.G)(e=>new b(e))},93708(e,s,t){t.d(s,{T:()=>v});var r=t(15526),a=t(75841),i=t(48830),n=t(56379),d=t(84190),o=t(15654),u=t(36580),l=t(33702),c=t.n(l),h=t(39971),p=t(79942);class v{constructor(e){this.userId=e,this.previewExists=n.M.shared(e).initialized.pipe((0,d.n)(s=>s?new i.c(s=>{var t=e=>"approved"===e.status||"moderation"===e.status,r=e=>{var r=!!e.previews.length&&e.previews.some(t);s.next(r)},a=n.M.shared(e).vrVideoPreview;return a?(s.next(a.getState().previews.some(t)),a.addStateListener(r)):s.next(!1),()=>{var s;null==(s=n.M.shared(e).vrVideoPreview)||s.removeStateListener(r)}}):(0,a.of)(void 0)),(0,o.F)(c()),(0,u.t)({refCount:!0,bufferSize:1}))}upload(e,s){return n.M.shared(this.userId).initialized.toSingle().pipe((0,p.Fg)(t=>{var r=n.M.shared(this.userId).vrVideoPreview;return t&&r?h.v.from(r.add(e,s)).pipe((0,p.AB)(void 0)):h.v.just()}))}get(){return n.M.shared(this.userId).initialized.toSingle().pipe((0,p.Fg)(e=>{var s=n.M.shared(this.userId).vrVideoPreview;return e&&s?h.v.from(s.get()).pipe((0,p.vV)(e=>e.previews)):h.v.just(void 0)}))}getMediaUri(e,s,t){return n.M.shared(this.userId).initialized.toSingle().pipe((0,p.Fg)(r=>{var a=n.M.shared(this.userId).vrVideoPreview;return r&&a?h.v.from(a.getMediaUri(e,s,t)):h.v.just(void 0)}))}}v.shared=(0,r.G)(e=>new v(e))},9453(e,s,t){t.d(s,{l:()=>n});var r=t(15526),a=t(97156),i=t(15654);class n{constructor(){this.visibleSubject=new a.t(!1),this.visible=this.visibleSubject.asObservable().pipe((0,i.F)())}setVisible(e){this.visibleSubject.next(e)}}n.shared=(0,r.G)(()=>new n)},84835(e,s,t){t.d(s,{i:()=>U});var r=t(58731),a=t(29109),i=t(14321),n=t(13462),d=t(20287),o=t(15526),u=t(97156),l=t(8733),c=t(75841),h=t(48830),p=t(82788),v=t(56607),m=t(17524),f=t(34578),b=t(15654),g=t(84190),I=t(50626),w=t(28138),S=t(44383),y=t(65052),A=t(53940),T=t(41392),x=t(56177),C=t(92453),F=t(36580),D=t(94375),k=t(45482),E=t(43751),j=t(10845),R=t(67276),O=t(56388),M=t(86013),G=t(32194),B=t(13230),P=t(22605),_=t(25871),z=t(21050),N=t(66382),L=t(10621),q="call-motivation-popup",V="call-motivation-popup-blocked-until",Q=D.b.day;class U{constructor(e){this.popupBlockedUntil=new u.t(0),this.hideMotivationPopupEvent=new l.B,this.offerAttendeeSubject=new u.t(void 0),this.offerCache={},this.userId=e,this.activeChatsMotivationPopupShownState={},this.callPopUpEnabled=n.T.shared().callMotivationPopup.enabled.pipe((0,b.F)(),(0,g.n)(e=>e?k.Session.shared().userIsUsual:(0,c.of)(!1))),this.offerBlockingReasonSubject=ne
3w l.B,this.offerBlockingReason=this.offerBlockingReasonSubject.asObservable()}start(e){var s=new h.c(()=>{var e=new p.yU;return e.add(r.y.shared(q,this.userId).load(V).safeSubscribe(e=>{e&&e>Date.now()&&this.popupBlockedUntil.next(e)})),e.add(a.u.shared(this.userId).activeChats.pipe((0,I.J)(),(0,w.T)(e=>{var[s,t]=e;return s.filter(e=>!t.includes(e))})).safeSubscribe(e=>{e.forEach(e=>{this.activeChatsMotivationPopupShownState[e]&&delete this.activeChatsMotivationPopupShownState[e],z.J.shared("chat").clearAttendeeState(e)})})),e.add(this.hideMotivationPopupEvent.pipe((0,S.S)((e,s)=>"accept"===s.action?0:e+1,0),(0,y.Z)(0)).safeSubscribe(e=>{if(e>=3){var s=Date.now()+Q;this.popupBlockedUntil.next(s),r.y.shared(q,this.userId).store(V,s).safeSubscribe()}})),e.add(this.offerAttendeeSubject.asObservable().pipe((0,I.J)(),(0,A.p)(e=>{var[s,t]=e;return!!s&&!t})).safeSubscribe(e=>{var[s]=e;z.J.shared("chat").notifyClosed("video",Date.now(),s)})),e.add(N.j.shared().chatAttendee.pipe((0,g.n)(e=>e?this.chatIsActive(e).pipe((0,g.n)(s=>s?this.videoAvailable(e).pipe((0,T.B)(100),(0,b.F)()):v.w)):v.w)).safeSubscribe(e=>{z.J.shared("chat").setVideoAvailable(e)})),e});e.add(this.callPopUpEnabled.pipe((0,b.F)(),(0,g.n)(e=>e?s:v.w)).safeSubscribe())}chatIsActive(e){return a.u.shared(this.userId).statusOfChatWith(e).pipe((0,w.T)(s=>(s||this.offerBlockingReasonSubject.next({attendeeId:e,reason:"chat-inactive"}),!!s)),(0,b.F)())}videoAvailable(e){return this.callPopUpEnabled.pipe((0,g.n)(s=>s?_.L.shared(this.userId).videoPromoAllowed(e,"mopup").pipe((0,g.n)(s=>s?(0,m.z)([i.f.shared(e).userIsFeaturedMember,this.chatIsActive(e),this.attendeeAvailableForCall(e),this.motivationPopupIsBlockedByUser(),this.motivationPopupIsBlockedByCall(e),this.callExists(),M.H.shared(this.userId).blockedByUser(e),G.T.shared().visible,O.E.shared(e).video.pipe((0,w.T)(e=>!!e))]).pipe((0,w.T)(s=>{var[t,r,a,i,n,d,o,u,l]=s;return[t&&r&&a&&!n&&!this.activeChatsMotivationPopupShownState[e]&&!d&&!o&&!u&&l,i]}),(0,w.T)(s=>{var[t,r]=s;return t&&r&&this.offerBlockingReasonSubject.next({attendeeId:e,reason:"blocked-by-user"}),t&&!r})):(0,c.of)(!1))):(0,c.of)(!1)),(0,b.F)())}attendeeAvailableForCall(e){return(0,m.z)([P.g.shared(this.userId).canCallTo(e,!0,!1),B.N.shared(this.userId).callIsAvailable(e,!0,!1)]).pipe((0,w.T)(e=>{var[s,t]=e;return s||t}),(0,b.F)())}motivationPopupIsBlockedByUser(){return this.popupBlockedUntil.pipe((0,w.T)(e=>(e||0)-Date.now()>0),(0,b.F)())}motivationPopupIsBlockedByCall(e){return(0,m.z)([d.u.shared(this.userId).calls((0,c.of)(1),e),n.T.shared().callMotivationPopup.daysOfNoVideochatToShow]).pipe((0,w.T)(e=>{var[s,t]=e,r=s.items[0];return!!r&&Date.now()-r.date.getTime()<t*D.b.day}),(0,b.F)())}callExists(){return(0,m.z)([R.M.shared(this.userId).state,E.Y.shared().get(j.A,this.userId).store.rxState()]).pipe((0,w.T)(e=>{var[s,t]=e;return"idle"!==s.status||"idle"!==t.status}),(0,b.F)())}offer(e){return this.offerCache[e]||(this.offerCache[e]=this.videoAvailable(e).pipe((0,g.n)(s=>s?z.J.shared("chat").canShowVideo().pipe((0,A.p)(e=>e),(0,x.s)(1),(0,g.n)(()=>(0,f.h)(O.E.shared(e).video.pipe((0,C.M)(e=>{e&&z.J.shared("chat").notifyShown("video")})),this.hideMotivationPopupEvent.pipe((0,A.p)(s=>s.attendeeId===e),(0,w.T)(()=>void 0))))):(0,c.of)(void 0)),(0,b.F)(L.L),(0,F.t)({refCount:!0,bufferSize:1}),(0,C.M)(s=>{this.offerAttendeeSubject.next(s?e:void 0)}))),this.offerCache[e]}accept(e){this.hideMotivationPopupEvent.next({attendeeId:e,action:"accept",timestamp:Date.now()})}reject(e){this.hideMotivationPopupEvent.next({attendeeId:e,action:"reject",timestamp:Date.now()})}motivationVideoShowed(e){this.activeChatsMotivationPopupShownState[e]=!0}}U.shared=(0,o.G)(e=>new U(e))},84419(e,s,t){t.d(s,{f:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.logOfferDeclined=(e,s)=>{a._.shared(this.userId).logEvent("offer-to-videochat-declined",{attendeeId:e,cta:s}).safeSubscribe()},this.logOfferShowed=(e,s,t)=>{a._.shared(this.userId).logEvent("offer-to-videochat-showed",{attendeeId:e,cta:s,options:t}).safeSubscribe()},this.logOfferAccepted=(e,s,t)=>{a._.shared(this.userId).logEvent("offer-to-videochat-accepted",{attendeeId:e,cta:s,options:t}).safeSubscribe()},this.userId=e}logOfferBlocked(e,s,t){a._.shared(this.userId).logEvent("offer-to-videochat-blocked",{attendeeId:e,reason:s,cta:t}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},48448(e,s,t){t.d(s,{T:()=>R});
3var r=t(15526),a=t(8733),i=t(97156),n=t(75841),d=t(56607),o=t(17524),u=t(56823),l=t(34578),c=t(13462),h=t(15654),p=t(84190),v=t(41392),m=t(50626),f=t(53940),b=t(28138),g=t(92453),I=t(56177),w=t(27585),S=t(45482),y=t(14321),A=t(5801),T=t(46822),x=t(66382),C=t(56388),F=t(86013),D=t(13230),k=t(22605),E=t(25871),j=t(21050);class R{constructor(){this.hideMotivationPopupEvent=new a.B,this.offerVisibility=new i.t(!1),this.offerIsVisible=this.offerVisibility.asObservable(),this.callPopUpEnabled=c.T.shared().callMotivationPopup.profile.enabled.pipe((0,h.F)(),(0,p.n)(e=>e?S.Session.shared().userIsUsual:(0,n.of)(!1))),this.callPopUpEnabled.pipe((0,p.n)(e=>e?T.c.shared().profileId.pipe((0,p.n)(e=>e?this.videoAvailable(e).pipe((0,v.B)(100)):d.w)):d.w)).safeSubscribe(e=>{j.J.shared("profile").setVideoAvailable(e)}),this.callPopUpEnabled.pipe((0,p.n)(e=>e?T.c.shared().profileId.pipe((0,m.J)(),(0,f.p)(e=>{var[s,t]=e;return!!s&&!t})):d.w)).safeSubscribe(e=>{var[s]=e;j.J.shared("profile").clearAttendeeState(s)})}videoAvailable(e){return this.mopupPromoAllowed(e).pipe((0,p.n)(s=>s?(0,o.z)([this.callPopUpEnabled,this.attendeeAvailableForCall(e),y.f.shared(e).userIsFeaturedMember,x.j.shared().chatAttendee.pipe((0,b.T)(e=>!e)),S.Session.shared().userId.pipe((0,A.o)(),(0,p.n)(s=>F.H.shared(s).blockedByUser(e)),(0,b.T)(e=>!e)),C.E.shared(e).video.pipe((0,b.T)(e=>!!e))]).pipe((0,b.T)(e=>e.every(e=>e))):(0,n.of)(!1)),(0,h.F)())}attendeeAvailableForCall(e){return S.Session.shared().userId.pipe((0,A.o)(),(0,p.n)(s=>(0,o.z)([k.g.shared(s).canCallTo(e,!0,!1),D.N.shared(s).callIsAvailable(e,!0,!1)]).pipe((0,b.T)(e=>{var[s,t]=e;return s||t}),(0,h.F)())))}mopupPromoAllowed(e){return S.Session.shared().userId.pipe((0,A.o)(),(0,p.n)(s=>E.L.shared(s).videoPromoAllowed(e,"mopup")))}offer(){return(0,o.z)([this.callPopUpEnabled,T.c.shared().profileId]).pipe((0,p.n)(e=>{var[s,t]=e;return s&&t?this.mopupPromoAllowed(t).pipe((0,p.n)(e=>e?this.offerForAttendee(t):(0,n.of)(void 0))):(0,n.of)(void 0)}),(0,g.M)(e=>{e&&(this.offerVisibility.next(!0),j.J.shared("profile").notifyShown("video"))}))}offerForAttendee(e){return this.attendeeAvailableForCall(e).pipe((0,f.p)(e=>e),(0,I.s)(1),(0,p.n)(()=>j.J.shared("profile").canShowVideo()),(0,f.p)(e=>e),(0,I.s)(1),(0,w.E)(c.T.shared().callMotivationPopup.profile.displayStartTimeRange,j.J.shared("profile").closedAt("audio")),(0,p.n)(s=>{var[,t,r]=s,a=!t||r>0?(0,n.of)(0):(0,u.O)(Math.floor(Math.random()*(t.end-t.start))+t.start);return(0,l.h)(a.pipe((0,p.n)(()=>(0,o.z)([this.attendeeAvailableForCall(e),y.f.shared(e).userIsFeaturedMember,x.j.shared().chatAttendee,S.Session.shared().userId.pipe((0,A.o)(),(0,p.n)(s=>F.H.shared(s).blockedByUser(e)))]).pipe((0,I.s)(1),(0,p.n)(s=>{var[t,r,a,i]=s;return!t||!r||a||i?(0,n.of)(void 0):j.J.shared("profile").canShowVideo().pipe((0,f.p)(e=>e),(0,I.s)(1),(0,p.n)(()=>C.E.shared(e).video))})))),this.hideMotivationPopupEvent.pipe((0,p.n)(s=>s.attendeeId===e?(this.offerVisibility.next(!1),j.J.shared("profile").notifyClosed("video"),(0,n.of)(void 0)):d.w)))}))}accept(e){this.hideMotivationPopupEvent.next({attendeeId:e,action:"accept"})}reject(e){this.hideMotivationPopupEvent.next({attendeeId:e,action:"reject"})}}R.shared=(0,r.G)(()=>new R)},3820(e,s,t){t.d(s,{K:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logQuizIntroShown(e){a._.shared(this.userId).logEvent("video-call-quiz-intro-shown",{attendeeId:e}).safeSubscribe()}logQuizDeclined(e){a._.shared(this.userId).logEvent("video-call-quiz-declined",{attendeeId:e}).safeSubscribe()}logQuizStarted(e,s){a._.shared(this.userId).logEvent("video-call-quiz-started",{attendeeId:e,quizId:s}).safeSubscribe()}logQuizFinished(e,s,t){a._.shared(this.userId).logEvent("video-call-quiz-finished",{attendeeId:e,matchesCount:t,quizId:s}).safeSubscribe()}logQuizBlocked(e,s){a._.shared(this.userId).logEvent("video-call-quiz-blocked",{attendeeId:e,reason:s}).safeSubscribe()}logQuizQuestionAnswered(e,s,t){a._.shared(this.userId).logEvent("video-call-quiz-question-answered",{attendeeId:e,quizId:s,index:t}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},42696(e,s,t){t.d(s,{dA:()=>w});var r=t(15526),a=t(32139),i=t(13462),n=t(65052),d=t(28138),o=t(84190),u=t(38107),l=t
3(34578),c=t(17524),h=t(75841),p=t(14321),v=t(79942),m=t(5801),f=t(58731),b=t(39971),g="call-quiz",I="auto-call-enabled";class w{constructor(e){this.autoStartEnabledSubject=new u.m(1),this.userId=e,this.status=a.m.shared(e).quizStatusChanged.pipe((0,n.Z)({name:"idle"})),this.activeQuestionIndex=a.m.shared(this.userId).activeQuestionIndex,this.questions=a.m.shared(this.userId).questions,this.answers=a.m.shared(this.userId).answers,this.visible=a.m.shared(this.userId).visible,this.blockingReason=a.m.shared(this.userId).blockingReason,this.id=a.m.shared(this.userId).id,this.shownQuestions=a.m.shared(this.userId).shownQuestions,this.autoStartEnabled=(0,l.h)(f.y.shared(g,this.userId).load(I).pipe((0,v.vV)(e=>null==e||e)),this.autoStartEnabledSubject.asObservable()),this.answersStatus=(0,c.z)([this.questions,this.answers,this.activeQuestionIndex]).pipe((0,d.T)(e=>{var[s,t,r]=e;return t.map((e,t)=>({status:t>r?"indefinite":e.userAnswer&&e.attendeeAnswer?e.userAnswer===e.attendeeAnswer?"match":"mismatch":!e.userAnswer&&e.attendeeAnswer?"attendeeAnswered":e.userAnswer&&!e.attendeeAnswer?"answered":"pending",id:s[t].id}))}))}checkAvailability(e){return e?i.T.shared().videoCallQuiz.enabled.pipe((0,o.n)(s=>s?p.f.shared(e).userIsFeaturedMember.pipe((0,o.n)(s=>s?a.m.shared(this.userId).checkAttendeeAvailability(e):(0,h.of)(!1))):(0,h.of)(!1))).toSingle():i.T.shared().videoCallQuiz.enabled.toSingle()}sendAvailability(e,s,t){return a.m.shared(this.userId).sendAvailability(e,s,t)}startQuiz(e){return i.T.shared().videoCallQuiz.questionsCount.toSingle().pipe((0,v.Fg)(s=>a.m.shared(this.userId).startQuiz(e,s)),(0,v.Fg)(()=>this.autoStartEnabled.toSingle()),(0,v.Fg)(e=>e?(this.autoStartEnabledSubject.next(!1),f.y.shared(g,this.userId).store(I,!1)):b.v.just(void 0)))}stopQuiz(){return a.m.shared(this.userId).stopQuiz()}rejectQuizOffer(e){return a.m.shared(this.userId).rejectQuizOffer(e)}nextQuestion(e){return a.m.shared(this.userId).nextQuestion(e)}markQuestionAsShown(e){return a.m.shared(this.userId).markQuestionAsShown(e)}sendAnswer(e,s,t){return a.m.shared(this.userId).sendAnswer(e,s,t)}finishQuiz(e){return this.id.pipe((0,m.o)()).toSingle().pipe((0,v.Fg)(s=>a.m.shared(this.userId).finishQuiz(e,s)))}hideQuiz(e){return a.m.shared(this.userId).hideQuiz(e)}showQuiz(e){return a.m.shared(this.userId).showQuiz(e)}showIntro(e){return a.m.shared(this.userId).showIntro(e)}quizResults(e,s,t){return this.id.toSingle().pipe((0,v.Fg)(r=>void 0!==r&&r===t?this.answers.toSingle():a.m.shared(this.userId).quizResults(e,s,t)))}sendQuizResults(e,s,t){var r=t.length,i=Object.values(t).filter(e=>e.userAnswer===e.attendeeAnswer).length;return a.m.shared(this.userId).sendQuizResults(e,s,{questionsCount:r,matchedCount:i,answers:t})}}w.shared=(0,r.G)(e=>new w(e))},71352(e,s,t){t.d(s,{u:()=>m});var r=t(15526),a=t(32248),i=t(22081),n=t(96333),d=t(75841),o=t(17524),u=t
3(84190),l=t(28138),c=t(15654),h=t(56379),p=t(55952),v=t(14321);class m{constructor(e){this.userId=e}getMCSUserPresence(e){return h.M.shared(this.userId).initialized.pipe((0,u.n)(s=>s?p.K.shared(this.userId).mcsId(e).asObservable().pipe((0,u.n)(e=>e?n._.shared(this.userId).presence(e):(0,d.of)(void 0))):(0,d.of)(void 0)))}audio(e){return v.f.shared(e).userIsFeaturedMember.pipe((0,u.n)(s=>s?a.R.shared(e).cachedPresence.pipe((0,u.n)(s=>s.online?(0,o.z)([this.getMCSUserPresence(e),this.getMCSUserPresence(this.userId)]).pipe((0,l.T)(e=>{var[s,t]=e;return!!(null!=t&&t.features.includes("voiceonly"))&&!!(null!=s&&s.features.includes("voiceonly"))&&!!s.flags.voiceOnlyAvailable&&!!(null!=s&&s.devices.includes("micro"))})):i.x.shared(e).tags.pipe((0,l.T)(e=>e.includes("credits.spent.target.audiochat.30d"))))):(0,d.of)(!0)),(0,c.F)())}video(e){return v.f.shared(e).userIsFeaturedMember.pipe((0,u.n)(s=>s?a.R.shared(e).cachedPresence.pipe((0,u.n)(s=>s.online?this.getMCSUserPresence(e).pipe((0,l.T)(e=>{var t=!!(null!=e&&e.devices.some(e=>"cam"===e||"mobileCam"===e)),r=s.devices.some(e=>"cam"===e.name||"mobilecam"===e.name);return t||r})):i.x.shared(e).tags.pipe((0,l.T)(e=>e.includes("credits.spent.target.videochat"))))):(0,d.of)(!0)),(0,c.F)())}}m.shared=(0,r.G)(e=>new m(e))},38194(e,s,t){t.d(s,{x:()=>D});var r=t(89218),a=t(15526),i=t(75841),n=t(17524),d=t(48830),o=t(34578),u=t(13462),l=t(84190),c=t(28138),h=t(15654),p=t(56177),v=t(53940),m=t(65052),f=t(36580),b=t(21512),g=t(46662),I=t(58705),w=t(82483),S=t(39971),y=t(91885),A=t(88390),T=t(14321),x=t(69081),C=t(77252),F=t(67276);class D extends r.D{constructor(e){super();var s=u.T.shared().callCreditsFastBuyInChat.enabled.pipe((0,l.n)(s=>{if(!s)return(0,i.of)(!1);var t=b.n.shared(e).settings.pipe((0,c.T)(e=>!!(null!=e&&e.enabled)),(0,h.F)()),r=g.he.shared(e).packages().pipe((0,c.T)(e=>!!e.length&&e.some(e=>"membership"!==e.subscription)),(0,h.F)()),a=I.J.shared(e).cards.pipe((0,c.T)(e=>!!e.length)),d=C.J.shared(e).status.pipe((0,c.T)(e=>"speaking"===e));return(0,n.z)([t,r,a,d]).pipe((0,c.T)(e=>{var[s,t,r,a]=e;return!s&&t&&r&&a}))}),(0,c.T)(e=>!e),(0,h.F)()),t=new d.c(e=>{var s=()=>{e.next(!0)},t=()=>{e.next(!1)};return w.g.shared().addListener("event.call.payment.required",s),w.g.shared().addListener("event.call.payment.fullfilled",t),()=>{w.g.shared().removeListener("event.call.payment.required",s),w.g.shared().removeListener("event.call.payment.fullfilled",t)}}).pipe((0,l.n)(s=>s?(0,n.z)([T.f.shared(e).userIsFeaturedMember,u.T.shared().callCreditsFastBuyInChat.enabled]).pipe((0,p.s)(1),(0,c.T)(e=>{var[s,t]=e;return!s&&!t})):(0,i.of)(!1))),r=u.T.shared().mcs.callInterface.pipe((0,l.n)(s=>F.M.shared(e).callIsAudioOnly.pipe((0,l.n)(t=>"new-design"!==s||t?A.P.shared(e).canOffer:(0,i.of)(!1))))),a=x.d.shared(e).paymentIntent.pipe((0,c.T)(e=>e.success),(0,v.p)(Boolean),(0,c.T)(()=>!1)),S=s.pipe((0,l.n)(e=>e?(0,o.h)(t,r,a).pipe((0,m.Z)(!1)):(0,i.of)(!1)));this.canOffer=(0,o.h)(S,this.offeringResult.pipe((0,c.T)(()=>!1))).pipe((0,m.Z)(!1),(0,h.F)(),(0,f.t)({bufferSize:1,refCount:!0}))}start(){return S.v.just(y.Q.success({}))}}D.shared=(0,a.G)(e=>new D(e))},9684(e,s,t){t.d(s,{B:()=>v});var r=t(15526),a=t(75841),i=t(50846),n=t(30495),d=t(79942),o=t(50042);class u extends i.Q{constructor(e){super("cheers.animation.availability",e,s=>(0,n.p6)(n.jI.shared().v2.dialogs.cheers.vibration.check.get,e,s).pipe((0,d.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t.Status,ttl:(null==(s=(0,o.a)(r))?void 0:s.maxAge)||0}})))}}u.shared=(0,r.G)(e=>new u(e));var l=t(46120),c=t(84190),h=t(28138),p=t(13462);class v{constructor(e){this.userId=e}available(e){return p.T.shared().cheerClickAnimationEnabled.pipe((0,c.n)(s=>s?u.shared(this.userId).data(e):(0,a.of)(!1)))}animation(){return l.U.shared(this.userId).data().pipe((0,h.T)(e=>e.messageTag))}animate(e,s){l.U.shared(this.userId).animate(e,s).safeSubscribe()}}v.shared=(0,r.G)(e=>new v(e))},18835(e,s,t){t.d(s,{F:()=>c});var r=t(15526),a=t(86977),i=t(97156),n=t(63093),d=t(53940),o=t(15654),u=t(28138),l=t(44383);class c{constructor(e){this.eventsSubject=new i.t([]),this.userId=e}get(e){return this.eventsSubject.asObservable().pipe((0,n.U)(),(0,d.p)(s=>s.processable&&s["message-id"]===e),(0,o.F)((e,s)=>e["message-id"]===s["message-id"]))}add(e){var s=this.eventsSubject.value.map(s=>e.includes(s["message-id"])?Object.assign({},s,{processable:!0}):s);this.eventsSubject.next(s)}delete(e){var s=[...this.eventsSubject.value].filter(s=>s["message-id"]!==e);this.eventsSubject.next(s)}start(e){e.add(a.I.shared(this.userId).events("event.bonuses.accounts.balance.credited").pipe((0,u.T)(e=>Object.assign({},e,{processable:!1})),(0,l.S)((e,s)=>[...e,s],this.eventsSubject.value)).safeSubscribe(e=>{this.eventsSubject.next(e)}))}}c.shared=(0,r.G)(e=>new c(e))},96306(e,s,t){t.d(s,{CF:()=>Q});var r=t(89218),a=t(75841),i=t(17524),n=t(56607),d=t(34578),o=t(91885),u=t(79942),l=t(28138),c=t(84190),h=t(15654),p=t(41392),v=t(53940),m=t(27585),f=t(65052),b=t(53193),g=t(36580),I=t(33702),w=t.n(I),S=t(44290),y=t(15526),A=t(22998),T=t(4938),x=t(74923),C=t(13462),F=t(93555),D=t(48830),k=t(98153),E=t(38792),j=t.n(E),R=t(50365),O=t(34677);class M{constructor(e){this.userId=e;var s=C.T.shared().currencyDevaluationRatio.pipe((0,l.T)(e=>100/e)),t=e=>new D.c(s=>{var t=t=>
3{if(t.sender===this.userId){var r=(0,R.f)(t,e);r.type===O.Go.Cheer&&s.next(r)}};return k.A.on("event.communication.chat.cheer.add.succeeded",t),k.A.on("event.communication.chat.cheer.add.failed",t),()=>{k.A.removeListener("event.communication.chat.cheer.add.succeeded",t),k.A.removeListener("event.communication.chat.cheer.add.failed",t)}});this.cheerSent=s.pipe((0,c.n)(e=>t(e)),(0,h.F)(j()),(0,g.t)({bufferSize:1,refCount:!0}))}}M.shared=(0,y.G)(e=>new M(e));var G=t(63398),B=t(23486),P=t(91654),_=t(94375),z=t(66382),N=2*_.b.second,L=_.b.second/10,q="cheers-onboarding-banner",V="shown-at";class Q extends r.D{constructor(e){super(),this.userId=e;var s=e=>{var s=(0,F.$)(e),t=S.k.shared().status.pipe((0,l.T)(e=>"active"===e));return s?S.k.shared().has(s).pipe((0,c.n)(e=>e?t:(0,a.of)(!1)),(0,h.F)()):(0,a.of)(!1)},t=B.o.shared().status.pipe((0,l.T)(e=>"active"===e),(0,h.F)()),r=()=>G.X.shared().messageReadingIntent.pipe((0,v.p)(e=>e.sender!==this.userId&&e.type===O.Go.Cheer),(0,m.E)(P.e.shared(this.userId).hasPurchases),(0,c.n)(e=>{var[r,a]=e,n={bannerVariant:a?"cheer-received-customer":"cheer-received-noncustomer",cheerBasename:r.content.basename,attendeeId:r.sender};return(0,i.z)([s(r.content.basename),t]).pipe((0,p.B)(N+L),(0,v.p)(e=>{var[s,t]=e;return!s&&!t}),(0,l.T)(()=>n))})),o=C.T.shared().cheersOnboardingBannerEnabled.pipe((0,c.n)(e=>e?A.w.shared(q,this.userId).load(V).asObservable().pipe((0,c.n)(e=>e?n.w:(0,a.of)(!1))):n.w),(0,c.n)(()=>z.j.shared().chatAttendee),(0,c.n)(()=>(0,d.h)(r(),M.shared(e).cheerSent.pipe((0,c.n)(e=>{var t=e.status===x.n.Delivered,r={successful:t,attendeeId:e.recipient,cheerBasename:e.content.basename,bannerVariant:"cheer-sent"};return t?s(e.content.basename).pipe((0,p.B)(L),(0,l.T)(e=>!e&&r)):(0,a.of)(r)})))),(0,f.Z)(!1),(0,b.Q)(this.offeringResult));this.canOffer=(0,d.h)(this.offeringResult.pipe((0,l.T)(()=>!1)),o).pipe((0,h.F)(w()),(0,g.t)({refCount:!0,bufferSize:1}))}start(e){return T.E.shared().currentTime().pipe((0,u.ex)(e=>{A.w.shared(q,this.userId).store(V,e).safeSubscribe()}),(0,u.ex)(()=>{z.j.shared().chatAttendee.pipe((0,v.p)(s=>e.attendeeId!==s),(0,c.n)(()=>this.rejectOffer()),(0,b.Q)(this.offeringResult)).safeSubscribe()}),(0,u.AB)(o.Q.success(e)))}}Q.shared=(0,y.G)(e=>new Q(e))},66950(e,s,t){t.d(s,{g:()=>A});var r=t(89218),a=t(15526),i=t(17524),n=t(75841),d=t(34578),o=t(14321),u=t(86013),l=t(32248),c=t(44150),h=t(84190),p=t(28138),v=t(65052),m=t(15654),f=t(36580),b=t(66382),g=t(39971),I=t(91885),w=t(13462),S=t(79942),y=t(99185);class A extends r.D{constructor(e){super();var s=(0,i.z)([w.T.shared().bonusesServicesEnabled,o.f.shared(e).userIsFeaturedMember]).pipe((0,h.n)(s=>{var[t,r]=s;return t&&r?b.j.shared().chatAttendee.pipe((0,h.n)(s=>s?(0,i.z)([u.H.shared(e).userHasConversation(s),l.R.shared(s).cachedPresence,c.$.shared(s).cheersSet("openChat"),y.P.shared(e).tags(s)]).pipe((0,p.T)(e=>{var[s,t,r,a]=e;return!s&&t.online&&!!r.length&&!a.includes("contact")})):(0,n.of)(!1))):(0,n.of)(!1)}));this.canOffer=(0,d.h)(s,this.offeringResult.pipe((0,p.T)(()=>!1))).pipe((0,v.Z)(!1),(0,m.F)(),(0,f.t)({bufferSize:1,refCount:!0}))}start(){return b.j.shared().chatAttendee.toSingle().pipe((0,S.Fg)(e=>e?c.$.shared(e).cheersSet("openChat").toSingle().pipe((0,S.vV)(e=>e[0]),(0,S.vV)(e=>{if(e){var s,t=null==(s=e.labels)?void 0:s.find(e=>e.includes("cheers.featuredmember.openchat.discount:")),r=Number(null==t?void 0:t.split(":")[1]);return I.Q.success({paidCheer:e,discount:r||void 0,basePrice:e.bonuses&&r?Number((e.bonuses/(1-r/100)).toFixed(2)):void 0})}return I.Q.failure("offer-not-allowed")})):g.v.just(I.Q.failure("offer-not-allowed"))))}}A.shared=(0,a.G)(e=>new A(e))},33646(e,s,t){t.d(s,{Z:()=>R});var r=t(17524),a=t(75841),i=t(97156),n=t(48830),d=t(82788),o=t(56607),u=t(4126),l=t(28138),c=t(84190),h=t(15654),p=t(40554),v=t(50626),m=t(53940),f=t(56177),b=t(97983),g=t(15526),I=t(43981),w=t(58731),S=t(34677),y=t(29109),A=t(13462),T=t(45482),x=t(62170),C=t(66342),F=t(84321),D=t(9453),k=t(55857),E=t(64805),j="chatCheersRecommendationsClosedMap";class R{constructor(e){this.userId=e,this.persistence=w.y.shared("ChatCheersRecommendations",e);var s=(0,r.z)([x.o.shared(this.userId).state.pipe((0,l.T)(e=>!!(null!=e&&e.userEnabled))),C.A.shared().visible,F.n.shared().visible]).pipe((0,l.T)(e=>e.some(Boolean)));this.recommendationsEnabled=(0,r.z)([A.T.shared().cheersRecommendationsEnabled,E.n.shared(this.userId).available]).pipe((0,c.n)(e=>{var[s,t]=e;return(0,a.of)(s&&!t)}),(0,h.F)(),(0,c.n)(e=>e?T.Session.shared().userIsUsual:(0,a.of)(!1)),(0,c.n)(e=>e?(0,r.z)([s,D.l.shared().visible,k.hw.shared(this.userId).offer]).pipe((0,l.T)(e=>{var[s,t,r]=e;return!s&&!t&&!r})):(0,a.of)(!1))),this.chatCheersRecommendationClosedMap=new i.t({})}start(e){var s=new n.c(()=>{var e=new d.yU;return e.add(this.persistence.load(j).safeSubscribe(e=>{e&&this.chatCheersRecommendationClosedMap.next(e)})),e.add(this.chatCheersRecommendationClosedMap.pipe((0,p.H)(e=>this.persistence.store(j,e))).safeSubscribe()),e.add(y.u.shared(this.userId).activeChats.pipe((0,v.J)(),(0,l.T)(e=>{var[s,t]=e;return t.filter(e=>!s.includes(e))})).safeSubscribe(e=>{var s=this.chatCheersRecommendationClosedMap.getValue(),t=!1;for(var r of e)s[r]&&(delete s[r],t=!0);t&&this.chatCheersRecommendationClosedMap.next(s)})),e.add(I.e.shared(this.userId).newMessage.pipe((0,m.p)(e=>e.sender===this.userId&&e.type===S.Go.Cheer),(0,c.n)(e=>this.hasRecommendationInChatWith(e.recipient).pipe((0,f.s)(1),(0,m.p)(e=>e),(0,b.u)(e))),(0,c.n)(e=>this.removeRecommendationInChatWith(e.recipient))).safeSubscribe()),e});e.add(this.recommendationsEnabled.pipe((0,h.F)(),(0,c.n)(e=>e?s:o.w)).safeSubscribe())}hasRecommendationInChatWith(e){return this.recommendationsEnabled.pipe((0,c.n)(s=>s?(0,r.z)([y.u.shared(this.userId).statusOfChatWith(e),this.chatCheersRecommendationClosedMap]).pipe((0,l.T)(s=>{var[t,r]=s;return!!t&&!r[e]&&t.outgoingMessagesCount>=R.messagesCountThreshold}),(0,h.F)()):(0,a.of)(!1)))}removeRecommendationInChatWith(e){return(0,u.v)(()=>{var s=this.chatCheersRecommendationClosedMap.getValue();return s[e]||(s[e]=!0,this.chatCheersRecommendationClosedMap.next(s)),(0,a.of)(void 0)})}}R.shared=(0,g.G)(e=>new R(e)),R.messagesCountThreshold=17},62683(e,s,t){t.d(s,{X:()=>f});var r=t(89218),a=t(91885),i=t(39971),n=t(15526),d=t(84190),o=t(75841),u=t(34578),l=t(28138),c=t(65052),h=t(15654),p=t(36580),v=t(33646),m=t(66382);class f extends r.D{constructor(e){super();var s=m.j.shared().chatAttendee.pipe((0,d.n)(s=>s?v.Z.shared(e).hasRecommendationInChatWith(s):(0,o.of)(!1)));this.canOffer=(0,u.h)(s,this.offeringResult.pipe((0,l.T)(()=>!1))).pipe((0,c.Z)(!1),(0,h.F)(),(0,p.t)({bufferSize:1,refCount:!0}))}start(){return i.v.just(a.Q.success({}))}}f.shared=(0,n.G)(e=>new f(e))},69254(e,s,t){t.d(s,{$:()=>E});var r=t(89218),a=t(91885),i=t(39971),n=t(79942),d=t(15526),o=t(94375),u=t(4938),l=t(17951),c=t(66382),h=t(33702),p=t.n(h),v=t
3(17524),m=t(75841),f=t(34578),b=t(53940),g=t(28138),I=t(84190),w=t(15654),S=t(36580),y=t(13462),A=t(74923),T=t(34677),x=t(43981),C=t(99185),F=t(85378),D=t(44150),k=t(77252);class E extends r.D{constructor(e){super(),this.userId=e;var s=y.T.shared().sendCheerTriggerBannersEnabled.pipe((0,I.n)(s=>s?c.j.shared().chatAttendee.pipe((0,I.n)(s=>s?(0,v.z)([(0,v.z)([F.F.shared(s).cachedProfile.pipe((0,g.T)(e=>{var s;return null==(s=e.value)||null==(s=s.birthday)?void 0:s["birth-date"]})),u.E.shared().currentTime()]).toSingle().pipe((0,n.vV)(e=>{var[s,t]=e;if(!s)return!1;var r=new Date(s),a=r.getUTCDate(),i=r.getUTCMonth(),n=e=>e.getMonth()===i&&e.getDate()===a;return n(new Date(t))?"today":!!n(new Date(t-o.b.day))&&"yesterday"})),C.P.shared(e).tags(s).pipe((0,g.T)(e=>e.includes("cheers.banner.shown..birthday"))),k.J.shared(e).status.pipe((0,g.T)(e=>"idle"===e),(0,w.F)())]).pipe((0,I.n)(t=>{var[r,i,d]=t;return r&&!i&&d?x.e.shared(e).newMessage.pipe((0,b.p)(t=>t.sender===e&&t.recipient===s&&t.status===A.n.Delivered&&[T.Go.Text,T.Go.Photo,T.Go.Voice,T.Go.Video].includes(t.type)),(0,g.T)(()=>void 0)).pipe((0,I.n)(()=>D.$.shared(s).cheersSet().toSingle().pipe((0,n.vV)(e=>{var s=e.filter(e=>{var s;return null==(s=e.labels)?void 0:s.includes("triggers.birthday")}).sort((e,s)=>e.price-s.price);return s.length>=2?a.Q.success(s.slice(0,2)):a.Q.failure(void 0)}))),(0,g.T)(e=>!!e.value&&{attendeeId:s,type:r,cheers:e.value})):(0,m.of)(!1)})):(0,m.of)(!1))):(0,m.of)(!1)));this.canOffer=(0,f.h)(s,this.offeringResult.pipe((0,g.T)(()=>!1))).pipe((0,w.F)(p()),(0,S.t)({bufferSize:1,refCount:!0}))}start(e){return this.offer.toSingle().pipe((0,n.Fg)(s=>s?i.v.just(a.Q.failure("offer-not-allowed")):l._.shared(this.userId).logUserAction({type:"cheers.banner.shown",data:{target:e.attendeeId,bannerType:"birthday"}}).pipe((0,n.AB)(a.Q.success(e)))))}}E.shared=(0,d.G)(e=>new E(e))},92561(e,s,t){t.d(s,{g:()=>M});var r=t(89218),a=t(91885),i=t(39971),n=t(79942),d=t(52850),o=t(15526),u=t(94375),l=t(4938),c=t(17951),h=t(96089),p=t(66382),v=t(33702),m=t.n(v),f=t(17524),b=t(75841),g=t(34578),I=t(53940),w=t(28138),S=t(84190),y=t(15654),A=t(36580),T=t(13462),x=t(74923),C=t(34677),F=t(43981),D=t(99185),k=t(85378),E=t(44150),j=t(77252),R=[{days:7,name:"day7"},{days:10,name:"day10"},{days:14,name:"day14"},{days:30,name:"day30"}];function O(e){var s=new Date(e);return Math.floor((e-s.getTimezoneOffset()*u.b.minute)/u.b.day)}class M extends r.D{constructor(e){super(),this.userId=e;var s=T.T.shared().sendCheerTriggerBannersEnabled.pipe((0,S.n)(s=>s?(0,f.z)([p.j.shared().chatAttendee,j.J.shared(e).status.pipe((0,w.T)(e=>"idle"===e),(0,y.F)())]).pipe((0,S.n)(s=>{var[t,r]=s;return t&&r?D.P.shared(e).tags(t).pipe((0,w.T)(e=>e.includes("cheers.banner.shown..milestone"))).pipe((0,S.n)(s=>s?(0,b.of)(!1):(0,f.z)([h.U.shared(e).data().pipe((0,w.T)(e=>null==e?void 0:e.find(e=>(null==e?void 0:e["user-id"])===t)),(0,w.T)(e=>e&&e.firstOutgoingDate?Date.parse(e.firstOutgoingDate):null)),l.E.shared().currentTime()]).toSingle().pipe((0,n.vV)(e=>{var[s,t]=e;if(!s||Number.isNaN(s))return!1;var r=O(t)-O(s),a=R.find(e=>e.days===r||e.days+1===r);return!!a&&a.name})).asObservable().pipe((0,S.n)(s=>s?F.e.shared(e).newMessage.pipe((0,I.p)(s=>s.sender===e&&s.recipient===t&&s.status===x.n.Delivered&&[C.Go.Text,C.Go.Photo,C.Go.Voice,C.Go.Video].includes(s.type)),(0,w.T)(()=>void 0)).pipe((0,S.n)(()=>(0,f.z)([E.$.shared(t).cheersSet(),k.F.shared(t).cachedProfile.pipe((0,w.T)(e=>{var s;return null==(s=e.value)?void 0:s.gender}))]).toSingle().pipe((0,n.vV)(e=>{var[s,t]=e;if(!t)return a.Q.failure(void 0);var r=[],i="triggers.milestone."+t+".low",n=[],o="triggers.milestone."+t+".high";return s.forEach(e=>{var s,t;null!=(s=e.labels)&&s.some(e=>e===i)&&r.push(e),null!=(t=e.labels)&&t.some(e=>e===o)&&n.push(e)}),r.length&&n.length?a.Q.success([(0,d.w)(r),(0,d.w)(n)]):a.Q.failure(void 0)}))),(0,w.T)(e=>!!e.value&&{attendeeId:t,type:s,cheers:e.value})):(0,b.of)(!1))))):(0,b.of)(!1)})):(0,b.of)(!1)));this.canOffer=(0,g.h)(s,this.offeringResult.pipe((0,w.T)(()=>!1))).pipe((0,y.F)(m()),(0,A.t)({bufferSize:1,refCount:!0}))}start(e){return this.offer.toSingle().pipe((0,n.Fg)(s=>s?i.v.just(a.Q.failure("offer-not-allowed")):c._.shared(this.userId).logUserAction({type:"cheers.banner.shown",data:{target:e.attendeeId,bannerType:"milestone"}}).pipe((0,n.AB)(a.Q.success(e)))))}}M.shared=(0,o.G)(e=>new M(e))},95380(e,s,t){t.d(s,{W:()=>x});var r=t(89218),a=t(91885),i=t(39971),n=t(79942),d=t(15526),o=t(1
37951),u=t(13462),l=t(66382),c=t(33702),h=t.n(c),p=t(17524),v=t(75841),m=t(34578),f=t(28138),b=t(84190),g=t(15654),I=t(36580),w=t(85081),S=t(44150),y=t(85378),A=t(52850),T=t(99185);class x extends r.D{constructor(e){super(),this.userId=e;var s=(0,p.z)([u.T.shared().sendCheerTriggerBannersEnabled,u.T.shared().postCallSendCheerBanner.pipe((0,f.T)(e=>e.minCallDuration))]).pipe((0,b.n)(s=>{var[t,r]=s;return t?l.j.shared().chatAttendee.pipe((0,b.n)(s=>s?w.V.shared(e).completedCall.pipe((0,b.n)(t=>t.attendeeId!==s||t.duration<=r?(0,v.of)(!1):T.P.shared(e).tags(s).pipe((0,f.T)(e=>!e.includes("cheers.banner.shown..call")),(0,b.n)(e=>e?(0,p.z)([S.$.shared(s).cheersSet(),y.F.shared(s).cachedProfile.pipe((0,f.T)(e=>{var s;return null==(s=e.value)?void 0:s.gender}))]).toSingle().pipe((0,n.vV)(e=>{var[s,t]=e;if(!t)return a.Q.failure(void 0);var r=[],i="triggers.call."+t+".low",n=[],d="triggers.call."+t+".high";return s.forEach(e=>{var s,t;null!=(s=e.labels)&&s.some(e=>e===i)&&r.push(e),null!=(t=e.labels)&&t.some(e=>e===d)&&n.push(e)}),r.length&&n.length?a.Q.success([(0,A.w)(r),(0,A.w)(n)]):a.Q.failure(void 0)})).asObservable().pipe((0,f.T)(e=>!!e.isSuccessful&&{cheers:e.value,attendeeId:s})):(0,v.of)(!1))))):(0,v.of)(!1))):(0,v.of)(!1)}));this.canOffer=(0,m.h)(s,this.offeringResult.pipe((0,f.T)(()=>!1))).pipe((0,g.F)(h()),(0,I.t)({bufferSize:1,refCount:!0}))}start(e){return this.offer.toSingle().pipe((0,n.Fg)(s=>s?i.v.just(a.Q.failure("offer-not-allowed")):o._.shared(this.userId).logUserAction({type:"cheers.banner.shown",data:{target:e.attendeeId,bannerType:"call"}}).pipe((0,n.AB)(a.Q.success(e)))))}}x.shared=(0,d.G)(e=>new x(e))},36165(e,s,t){t.d(s,{h:()=>A});var r=t(15526),a=t(97156),i=t(17524),n=t(56607),d=t(75841),o=t(56823),u=t(13462),l=t(28138),c=t(15654),h=t(84190),p=t(56177),v=t(50626),m=t(65428),f=t(58456),b=t(48830),g=t(56379),I=t(36580);class w{constructor(e){this.faceExists=g.M.shared(e).initialized.pipe((0,h.n)(s=>s?new b.c(s=>{var t=e=>{s.next(e.faceExists)},r=g.M.shared(e).videoAudit;return r&&(s.next(r.getState().faceExists),r.addStateListener(t)),()=>{var s;null==(s=g.M.shared(e).videoAudit)||s.removeStateListener(t)}}):n.w),(0,I.t)({refCount:!0,bufferSize:1}))}}w.shared=(0,r.G)(e=>new w(e));var S=t(77252),y=t(63525);class A{constructor(e){this.shouldNotifySubject=new a.t(!1),this.shouldNotify=this.shouldNotifySubject.asObservable(),this.userId=e}start(e){var s=S.J.shared(this.userId).status.pipe((0,l.T)(e=>"idle"===e),(0,c.F)()),t=(0,i.z)([u.T.shared().userCameraPresenceBlockedNotifying.startDelay,u.T.shared().userCameraPresenceBlockedNotifying.checkingInterval]);e.add((0,i.z)([u.T.shared().userCameraPresenceBlockedNotifying.enabled,y.f.shared(this.userId).audioCallOnlyEnabled]).pipe((0,h.n)(e=>{var[s,t]=e;return!s||t?n.w:m.K.shared().cameraIsActive}),(0,h.n)(e=>e?(this.shouldNotifySubject.next(!1),s.pipe((0,h.n)(e=>e?t.pipe((0,h.n)(e=>{var[s,t]=e;return(0,o.O)(s,t)}),(0,h.n)(()=>f.o.shared(this.userId).data().pipe((0,p.s)(1),(0,l.T)(e=>e.includes("presence.cam")))),(0,v.J)(),(0,l.T)(e=>{var[s,t]=e;return!(s||t)}),(0,c.F)()):(0,d.of)(!1)))):n.w)).safeSubscribe(e=>this.shouldNotifySubject.next(e))),e.add((0,i.z)([u.T.shared().userCameraPresenceBlockedNotifying.enabled,y.f.shared(this.userId).audioCallOnlyEnabled]).pipe((0,h.n)(e=>{var[s,t]=e;return!s||t?n.w:m.K.shared().cameraIsActive}),(0,h.n)(e=>e?(this.shouldNotifySubject.next(!1),s):n.w),(0,h.n)(e=>e?w.shared(this.userId).faceExists:n.w),(0,c.F)()).safeSubscribe(e=>this.shouldNotifySubject.next(!e)))}}A.shared=(0,r.G)(e=>new A(e))},19023(e,s,t){t.d(s,{H:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logDialogsAttachmentTooltipShown(e){var{attendeeId:s,type:t}=e;a._.shared(this.userId).logEvent("attachment-tooltip-in-chat-shown",{userId:this.userId,attendeeId:s,tooltipVersion:"default"===t?1:2}).safeSubscribe()}logDialogsAttachmentTooltipClicked(e){var{attendeeId:s,type:t}=e;a._.shared(this.userId).logEvent("attachment-tooltip-in-chat-clicked",{userId:this.userId,attendeeId:s,tooltipVersion:"default"===t?1:2}).safeSubscribe()}logDialogsAttachmentTooltipClosed(e){var{attendeeId:s,type:t}=e;a._.shared(this.userId).logEvent("attachment-tooltip-in-chat-closed",{userId:this.userId,attendeeId:s,tooltipVersion:"default"===t?1:2}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},44148(e,s,t){t.d(s,{Y:()=>V});var r=t(15526),a=t(89218),i=t(97156),n=t(17524),d=t(75841),o=t(34578),u=t(56823),l=t(37394),c=t(39971),h=t(79942),p=t(91885),v=t(13462),m=t
3(65052),f=t(84190),b=t(53940),g=t(56177),I=t(28138),w=t(15654),S=t(81831),y=t(50626),A=t(97983),T=t(36580),x=t(66382),C=t(94375),F=t(68592),D=t(51718),k=t(69145),E=t(22998),j=t(32389),R=t(29109),O=3*C.b.minute,M=t(67276),G=t(43751),B=t(10845),P=t(9453),_=t(55857),z=t(85081),N="state",L=15*C.b.second,q={skipCount:0,lastSkipTimestamp:null,lastAcceptTimestamp:null};class V extends a.D{constructor(e){super(),this.persistence=E.w.shared("dialogs-attachment-tooltip-offering",e),this.persistenceUpdating=new i.t(!1);var s=this.offeringResult.pipe((0,m.Z)(null),(0,f.n)(()=>this.persistenceUpdating.pipe((0,b.p)(e=>!e),(0,g.s)(1),(0,f.n)(()=>this.persistence.load(N)))),(0,I.T)(e=>null!=e?e:Object.assign({},q))),t=G.Y.shared().get(B.A,e).store.rxState().pipe((0,I.T)(e=>"idle"!==e.status),(0,w.F)()),r=M.M.shared(e).state.pipe((0,I.T)(e=>"idle"!==e.status),(0,w.F)()),a=(0,n.z)([v.T.shared().sendCheerTriggerBannersEnabled,v.T.shared().postCallSendCheerBanner.pipe((0,I.T)(e=>e.minCallDuration))]).pipe((0,f.n)(s=>{var[a,i]=s;if(!a||!i)return(0,d.of)(!1);var u=(0,n.z)([t,r]).pipe((0,I.T)(e=>e.some(Boolean)),(0,w.F)()),l=(0,o.h)(z.V.shared(e).completedCall.pipe((0,m.Z)(null)),u.pipe((0,b.p)(Boolean),(0,I.T)(()=>null)));return(0,n.z)([l,u.pipe((0,f.n)(e=>e?(0,d.of)(!0):(0,d.of)(!1).pipe((0,S.c)(500))))]).pipe((0,I.T)(e=>{var[s,t]=e;return!!t||!!s&&s.duration>i}),(0,w.F)())})),c=P.l.shared().visible.pipe((0,w.F)(),(0,m.Z)(null),(0,y.J)(),(0,f.n)(e=>{var[s,t]=e;return null===s?(0,d.of)(!!t):t?(0,d.of)(!0):(0,u.O)(L).pipe((0,A.u)(!1))}),(0,T.t)(1));this.canOffer=v.T.shared().chatAttachmentTooltipEnabled.pipe((0,f.n)(e=>this.persistenceUpdating.pipe((0,I.T)(s=>!s&&e))),(0,f.n)(i=>i?(0,n.z)([x.j.shared().chatAttendee,v.T.shared().modernChatAttachmentTooltipEnabled]).pipe((0,f.n)(i=>{var[o,h]=i;return o?R.u.shared(e).getActiveChatState(o).pipe((0,I.T)(e=>{var s;return null!=(s=null==e?void 0:e.activationTime)?s:null}),(0,w.F)(),(0,f.n)(e=>{var s;return e?0===(s=Math.max(O-(Date.now()-e),0))?(0,d.of)(!0):(0,u.O)(s).pipe((0,A.u)(!0),(0,m.Z)(!1)):(0,d.of)(!1)})).pipe((0,f.n)(e=>(0,l.T)(()=>e,s.pipe((0,I.T)(e=>(e=>{var{lastSkipTimestamp:s,lastAcceptTimestamp:t,skipCount:r}=e,a=Date.now(),i=t?a-t:null,n=!!i,d=n&&i>C.b.week,o=s?a-s:null,u=!!o&&(1===r&&o>C.b.day||2===r&&o>2*C.b.day||o>C.b.week);return(!n||!!d)&&(!i&&!o||!(r||o)||u)})(e))),(0,d.of)(!1))),(0,f.n)(s=>(0,l.T)(()=>s,(0,n.z)([F.W.shared().recording,k.o.shared().visible,D.b.shared().visible,j.S.shared(e).getDraftMessage(o).pipe((0,I.T)(e=>!!e)),F.W.shared().recordingFile.pipe((0,I.T)(e=>!!e)),_.hw.shared(e).offer.pipe((0,I.T)(e=>!!e)),c,t,r,a]).pipe((0,I.T)(e=>e.some(e=>e)),(0,w.F)()).pipe((0,I.T)(e=>!e&&{attendeeId:o,type:h?"modern":"default"})),(0,d.of)(!1)))):(0,d.of)(!1)})):(0,d.of)(!1)),(0,w.F)(),(0,T.t)(1))}start(e){return c.v.just(p.Q.success(e))}postpone(e){return c.v.just().pipe((0,h.Fg)(()=>this.persistenceUpdating.value?c.v.just(p.Q.success()):(this.persistenceUpdating.next(!0),this.persistence.update(N,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:q;return e.lastSkipTimestamp=Date.now(),e.skipCount=e.skipCount+1,e}).pipe((0,h.Zl)(()=>this.persistenceUpdating.next(!1)),(0,h.AB)(p.Q.success())))))}acceptOffer(){return c.v.just().pipe((0,h.ex)(()=>this.persistenceUpdating.next(!0)),(0,h.Fg)(()=>this.persistence.update(N,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:q;return e.lastAcceptTimestamp=Date.now(),e})),(0,h.Fg)(()=>super.acceptOffer()),(0,h.Zl)(()=>this.persistenceUpdating.next(!1)),(0,h.AB)(p.Q.success()))}}V.shared=(0,r.G)(e=>new V(e))},17713(e,s,t){t.d(s,{I:()=>x});var r=t(15526),a=t(56607),i=t(34578),n=t(75841),d=t(17524),o=t(75900),u=t(84190),l=t(53940),c=t(28138),h=t(97983),p=t(65052),v=t(81831),m=t(15654),f=t(36580),b=t(30495),g=t(79942);class I{constructor(e){this.userId=e}set(e,s){return(0,b.Yq)(b.jI.shared().events.post,e,{label:"event.chat.attendee.activity.set",payload:{"sender-id":this.userId,type:s}}).pipe((0,g.AB)(void 0))}unset(e,s){return(0,b.Yq)(b.jI.shared().events.post,e,{label:"event.chat.attendee.activity.unset",payload:{"sender-id":this.userId,type:s}}).pipe((0,g.AB)(void 0))}}I.shared=(0,r.G)(e=>new I(e));
3var w=t(86977),S=t(43981),y=t(54029),A=t(13462),T=t(94375);class x{constructor(e){this.visibleCache={},this.userId=e}set(e,s){return I.shared(this.userId).set(e,s)}unset(e,s){return I.shared(this.userId).unset(e,s)}visible(e){return this.visibleCache[e]||(this.visibleCache[e]=A.T.shared().chatAttendeeActivityStatusEnabled.pipe((0,u.n)(s=>{if(!s)return a.w;var t=w.I.shared(this.userId).events("ci:event.chat.attendee.activity.set").pipe((0,l.p)(s=>s["sender-id"]===e),(0,c.T)(e=>e.type)),r=w.I.shared(this.userId).events("ci:event.chat.attendee.activity.unset").pipe((0,l.p)(s=>s["sender-id"]===e)),f=S.e.shared(this.userId).newMessage.pipe((0,l.p)(s=>s.sender===e)),b=(0,i.h)(t,f.pipe((0,h.u)(null))).pipe((0,p.Z)(null),(0,u.n)(e=>(0,i.h)((0,n.of)(e),r.pipe((0,l.p)(s=>s.type===e),(0,u.n)(()=>(0,n.of)(null).pipe((0,v.c)(5*T.b.second)))))),(0,m.F)()),g=y.S.shared(this.userId).visible(e),I=S.e.shared(this.userId).newMessage.pipe((0,l.p)(s=>s.sender===this.userId&&s.recipient===e));return(0,d.z)([b,g]).pipe((0,c.T)(e=>{var[s,t]=e;return t?null:s}),(0,m.F)(),(0,u.n)(e=>{if(!e)return(0,n.of)(e);var s=(0,o.x)((0,n.of)(null),(0,n.of)(e)),t=I.pipe((0,u.n)(()=>s));return(0,i.h)(s,t)}))}),(0,f.t)(1))),this.visibleCache[e]}}x.shared=(0,r.G)(e=>new x(e))},65877(e,s,t){t.d(s,{v:()=>J});var r=t(15526),a=t(91825),i=t(72548),n=t(38284),d=t(88215),o=t(96306),u=t(91063),l=t(66950),c=t(7220),h=t(38194),p=t(71040),v=t(88394),m=t(32210),f=t(62683),b=t(92397),g=t(66225),I=t(52393),w=t(53423),S=t(17524),y=t(75841),A=t(84190),T=t(28138),x=t(97983),C=t(65052),F=t(15654),D=t(36580),k=t(79942),E=t(89218),j=t(91885),R=t(58731),O=t(13462),M=t(66382),G=t(86013),B=t(44150),P="matchiversary-banner-offering",_="latest-closing-banner-time";class z extends E.D{constructor(e){super(),this.userRelations=G.H.shared(e);var s=(0,S.z)([M.j.shared().chatAttendee,O.T.shared().matchiversaryBanner.displayDelayTime]).pipe((0,A.n)(e=>{var[s,t]=e;return s?R.y.shared(P,s).load(_).asObservable().pipe((0,T.T)(e=>!e||new Date().getTime()-e>=t)):(0,y.of)(!1)})),t=this.offeringResult.pipe((0,x.u)(!0),(0,C.Z)(!1));this.canOffer=O.T.shared().matchiversaryBanner.enabled.pipe((0,A.n)(e=>e?t.pipe((0,A.n)(()=>M.j.shared().chatAttendee),(0,A.n)(e=>e?(0,S.z)([this.userRelations.oneMonthMatchiversary(e),this.userRelations.oneHundredDaysMatchiversary(e)]).pipe((0,A.n)(e=>{var[t,r]=e;return t||r?s:(0,y.of)(!1)}),(0,T.T)(s=>!!s&&e)):(0,y.of)(!1))):(0,y.of)(!1)),(0,F.F)(),(0,D.t)({refCount:!0,bufferSize:1}))}start(e){return(0,S.z)([B.$.shared(e).cheersSet(),this.userRelations.oneMonthMatchiversary(e)]).toSingle().pipe((0,k.vV)(s=>{var[t,r]=s,a=t.find(e=>{var s;return null==(s=e.labels)?void 0:s.includes("matchiversary")});return j.Q.success(Object.assign({attendeeId:e,oneMonthMatchiversary:r},!!a&&{cheer:a}))}))}accept(e){return R.y.shared(P,e.attendeeId).clear(_).pipe((0,k.AB)(j.Q.success()))}postpone(e){return R.y.shared(P,e.attendeeId).store(_,new Date().getTime()).pipe((0,k.AB)(j.Q.success()))}}z.shared=(0,r.G)(e=>new z(e));var N=t(92561),L=t(69254),q=t(95380),V=t(34578),Q=t(14321),U=t(39971);class Y extends E.D{constructor(){super(),this.attendeeId=M.j.shared().chatAttendee,this.canOffer=O.T.shared().extendedPriceShowEnabled.pipe((0,A.n)(e=>e?(0,V.h)(this.attendeeId.pipe((0,A.n)(e=>e?Q.f.shared(e).userIsFeaturedMember:(0,y.of)(!1))),this.offeringResult.pipe((0,x.u)(!1))):(0,y.of)(!1)),(0,F.F)(),(0,D.t)({refCount:!0,bufferSize:1}))}start(){return U.v.just(j.Q.success({}))}}Y.shared=(0,r.G)(()=>new Y);class J extends a.y{constructor(e){super([{type:"chat-payment-required-banner-offering",offering:p.w.shared(e)},{type:"credits-fast-buy-banner-offering",offering:m.u.shared(e)},{type:"communication-price-banner-offering",offering:Y.shared()},{type:"cheers-onboarding-banner-offering",offering:o.CF.shared(e)},{type:"mystery-gifts-promo-banner-offering",offering:n.S_.shared(e)},{type:"mystery-gifts-credits-package-banner-offering",offering:i.En.shared(e)},{type:"birthday-send-cheer-banner-offering",offering:L.$.shared(e)},{type:"milestone-send-cheer-banner-offering",offering:N.g.shared(e)},{type:"post-call-send-cheer-banner-offering",offering:q.W.shared(e)},{type:"dialogs-themes-promo-banner-offering",offering:d.xJ.shared(e)},{type:"dialogs-stickers-pass-expired-banner-offering",offering:I.ET.shared(e)},{type:"dialogs-stickers-pass-banner-offering",offering:g.fu.shared(e)},{type:"cheers-recommendations-offering",offering:f.X.shared(e)},{type:"add-attendee-to-favorites-offering",offering:u.Q.shared(e)},{type:"paid-cheer-banner-offering",offering:l.g.shared(e)},{type:"voice-messages-sending-limit-warn-offering",offering:c.E.shared(e)},{type:"video-chat-payment-timer-offering",offering:h.x.shared(e)},{type:"call-banner-in-chat-offering",offering:v._.shared(e)},{type:"start-conversation-offering",offering:b.K.shared(e)},{type:"stickers-generation-promo-banner-offering",offering:w.eh.shared(e)},{type:"matchiversary-banner-offering",offering:z.shared(e)}])}}J.shared=(0,r.G)(e=>new J(e))},71040(e,s,t){t.d(s,{w:()=>L});var r=t(15526),a=t(89218),i=t(39971),n=t(84190),d=t(75841),o=t(15654),u=t(52300),l=t(53940),c=t(28138),h=t(44383),p=t(65052),v=t(36580),m=t(34578),f=t(27585),b=t(17524),g=t(41392),I=t(56177),w=t(56607),S=t(91885),y=t(45482),A=t(91654),T=t(10621),x=t(43751),C=t(49844),F=t(66382),D=t(43981
3),k=t(65615),E=t(27888),j=t(41910),R=t(74923),O=t(34677),M=t(70009),G=t(13462),B=t(38112),P=t(79942),_=t(44150),z=t(32210),N=t(92211);class L extends a.D{constructor(e){super();var s=y.Session.shared().userIsUsual.pipe((0,n.n)(s=>s?A.e.shared(e).hasPurchases.pipe((0,n.n)(s=>s?(0,d.of)(!1):j.K.shared(e).missingBalance(E.N.Chat,1).pipe((0,P.vV)(e=>!e||e.amount>0)))):(0,d.of)(!1)),(0,o.F)()),t=s.pipe((0,n.n)(s=>s?F.j.shared().chatAttendee.pipe((0,n.n)(s=>s?x.Y.shared().get(C.Ay,(0,C.OX)(e,s)).store.rxState().pipe((0,l.p)(e=>e.messages.some(e=>e.needPay)),(0,c.T)(()=>({type:"messages-payment-required"}))):u.t)):u.t)),r=N.N.shared().sendCheerIntent.pipe((0,l.p)(e=>"chat-resend"===e.cta),(0,h.S)((e,s)=>new Set(e).add(s.id),new Set),(0,p.Z)(new Set),(0,v.t)({bufferSize:1,refCount:!0})),a=(0,m.h)(s.pipe((0,n.n)(s=>s?D.e.shared(e).newMessage.pipe((0,l.p)(s=>{var t;return!!(null!=(t=s.meta)&&null!=(t=t.tariffication)&&t.final)&&s.sender!==e}),(0,c.T)(()=>({type:"messages-payment-required"}))):u.t)),y.Session.shared().userIsUsual.pipe((0,n.n)(s=>s?D.e.shared(e).newMessage.pipe((0,f.E)(M.G.shared().localize("/users/media/photo","hi-message"),r),(0,l.p)(s=>{var t,r,[a,i]=s;return a.status===R.n.Unpaid&&!(null!=(t=a.meta)&&t.transfer)&&!(null!=(r=a.meta)&&r.bonuses)&&(a.sender!==e||a.content!==i)}),(0,c.T)(e=>{var[s]=e;return s.type===O.Go.Letter?{type:"credits-required-letter-read"}:s.type===O.Go.Cheer?{type:"credits-required-send-gift",message:s}:{type:"credits-required"}}),(0,n.n)(s=>"credits-required-send-gift"!==s.type?(0,d.of)(s):(0,b.z)([z.u.shared(e).canOffer.pipe((0,c.T)(e=>!!e&&"cheers"===e.reason)),r,G.T.shared().cheersFastBuyEnabled]).pipe((0,g.B)(0),(0,I.s)(1),(0,n.n)(e=>{var[t,r,a]=e,i=a&&r.has(s.message.tag);return t||i?w.w:G.T.shared().chatPaymentRequiredSendGiftBannerVariant.pipe((0,n.n)(e=>_.$.shared(s.message.recipient).findByReference(s.message.content.basename).asObservable().pipe((0,n.n)(t=>t?(0,d.of)({type:s.type,variant:e,cheer:t,resendMessageTag:s.message.tag}):w.w))))})))):u.t))),i=k.Q.shared().balanceRefillingIntent.pipe((0,f.E)(A.e.shared(e).canSubscribe,F.j.shared().chatAttendee),(0,n.n)(e=>{var[s,t,r]=e;if(s.reason.attendeeId&&s.reason.attendeeId!==r)return u.t;var a=t?(0,d.of)({type:"membership-required-view-attachment"}):(0,d.of)({type:"credits-required-view-attachment"});switch(s.reason.name){case E.N.OpenLetter:return t?(0,d.of)({type:"membership-required-letter-read"}):(0,d.of)({type:"credits-required-letter-read"});case E.N.SendLetter:return t?(0,d.of)({type:"membership-required-letter-send"}):(0,d.of)({type:"credits-required-letter-send"});case E.N.SendPhoto:case E.N.SendVideo:return(0,d.of)({type:"credits-required-send-attachment"});case E.N.WatchPhoto:case E.N.WatchVideo:return a;case E.N.ListenAudio:return G.T.shared().chatPaymentRequiredBannerListenAudioEnabled.pipe((0,I.s)(1),(0,n.n)(e=>e?a:w.w));case E.N.ViewCollage:return(0,d.of)({type:"credits-required-view-attachment"});default:return u.t}})),S=G.T.shared().chatPaymentRequiredBannerPaywallSourceEnabled.pipe((0,n.n)(s=>s?F.j.shared().chatAttendee.pipe((0,n.n)(s=>s?B.V.shared(e).unpaidFeatures(s).pipe((0,l.p)(e=>!!e.length),(0,c.T)(()=>({type:"messages-payment-required"}))):w.w)):w.w)),L=G.T.shared().messagesViewBlockedEnabled.pipe((0,n.n)(e=>e?F.j.shared().chatAttendee.pipe((0,n.n)(e=>e?(0,d.of)({type:"limit-invites-views"}):u.t)):u.t)),q=(0,m.h)(t,a,i,S,L);this.canOffer=(0,m.h)(q,this.offeringResult.pipe((0,c.T)(()=>!1))).pipe((0,p.Z)(!1),(0,o.F)(T.L),(0,v.t)({bufferSize:1,refCount:!0}))}start(e){return i.v.just(S.Q.success(e))}}L.shared=(0,r.G)(e=>new L(e))},77783(e,s,t){t.d(s,{U:()=>n,h:()=>i});var r=t(34677),a=t(46660);function i(e,s){switch(null==e?void 0:e.type){case a.m$.VideoInvitation:return"video";case a.m$.AudioCallInvite:return"audio";case r.Go.Text:return s?"lets_mingle":"message";case r.Go.Letter:return"letter";case r.Go.Voice:case r.Go.AudioCallMotivationMessage:return"audio";default:return"message"}}function n(e){return e.type===a.m$.VideoInvitation?"video":i(e.content,e.automatic)}},24387(e,s,t){t.d(s,{q:()=>u});var r=t(15526),a=t(97156),i=t(50626),n=t(53940),d=t(66382),o=0;
3class u{constructor(){this.isFirstChatOpenedSubject=new a.t(!0),this.isFirstChatOpenedInSession=this.isFirstChatOpenedSubject.asObservable()}start(e){e.add(d.j.shared().chatAttendee.pipe((0,i.J)(),(0,n.p)(e=>{var[s,t]=e;return null===s&&null!==t})).safeSubscribe(()=>{1==++o?this.isFirstChatOpenedSubject.next(!0):this.isFirstChatOpenedSubject.next(!1)}))}}u.shared=(0,r.G)(()=>new u)},24919(e,s,t){t.d(s,{i:()=>l});var r=t(79942),a=t(15526),i=t(97156),n=t(28138),d=t(15654),o=t(33702),u=t.n(o);class l{constructor(){this.drafts=new i.t({})}getDraft(e){return this.drafts.asObservable().pipe((0,n.T)(s=>s[e]),(0,d.F)(u()))}setDraft(e,s){return this.drafts.asObservable().toSingle().pipe((0,r.ex)(t=>{this.drafts.next(Object.assign({},t,{[e]:s}))}),(0,r.AB)(void 0))}}l.shared=(0,a.G)(()=>new l)},78363(e,s,t){t.d(s,{B:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logReplaceGeneratedLetterResult(e){var s=Object.assign({cancelled:void 0===e.result,rejected:!1===e.result,accepted:!0===e.result},void 0!==e.shouldAskAgain&&{"replace-always":!e.shouldAskAgain});a._.shared(this.userId).logEvent("dialogs-letter-generated-replace-current-text-popup-result",Object.assign({"user-id":this.userId},s)).safeSubscribe()}logGeneratedLetterStarted(e){a._.shared(this.userId).logEvent("dialogs-letter-generated-generation-started",{"user-id":this.userId,mode:e.mode,"request-id":e.requestId,"letter-category":e.letterCategory,"generation-group-id":e.generationGroupId}).safeSubscribe()}logGeneratedLetterAvailability(e){a._.shared(this.userId).logEvent("dialogs-letter-generated-generation-availability",{"user-id":this.userId,"attendee-id":e.attendeeId,available:e.available,"letter-category":e.letterCategory}).safeSubscribe()}logGeneratedLetterValidation(e){a._.shared(this.userId).logEvent("dialogs-letter-generated-validation",Object.assign({"user-id":e.userId,"attendee-id":e.attendeeId,"request-id":e.requestId},e.replyLetterId&&{"reply-letter-id":e.replyLetterId},{errors:e.errors,sent:e.sent})).safeSubscribe()}logGeneratedLetterTranslated(e){a._.shared(this.userId).logEvent("dialogs-letter-generated-translated",{"user-id":e.userId,"attendee-id":e.attendeeId,"generation-request-id":e.generationRequestId,"localization-language":e.localizationLanguage,"letter-category":e.letterCategory}).safeSubscribe()}logGeneratedLetterGenerationComplete(e){var{status:s,userId:t,attendeeId:r,requestId:i,letterCategory:n,replyLetterId:d,content:o,subject:u,language:l,meta:c,letter:h}=e;a._.shared(this.userId).logEvent("dialogs-letter-generated-generation-complete..theone",Object.assign({Status:s,UserId:t,AttendeeId:r,RequestId:i,GeneratedLetterType:n,Content:o,Subject:u,Language:l,Timestamp:new Date().toISOString()},h&&{Letter:{Id:d,SenderId:h.sender_id,RecipientId:h.recipient_id,Text:h.text}},c&&{Meta:Object.assign({},"moderation-failed"===s&&{ModerationResult:{Flagged:c.moderation_result.flagged,Reason:c.moderation_result.reason}},{TimeTaken:{ModerationMs:c.time_taken.moderation_ms,CompletionsMs:c.time_taken.completions_ms},ServiceVersion:c.service_version,Model:{Base:c.model.base,Vendor:c.model.vendor},PromptId:c.prompt_id,TestGroupId:c.test_group_id,ExperimentId:c.experiment_id,Usage:{PromptTokens:c.usage.prompt_tokens,CompletionTokens:c.usage.completion_tokens,TotalTokens:c.usage.total_tokens},Context:{Messages:c.context.messages,Letters:c.context.letters,Facts:c.context.facts,Limit:c.context.limit}})})).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},81731(e,s,t){t.d(s,{c:()=>y});var r=t(15526),a=t(84190),i=t(53940),n=t(56177),d=t(92453),o=t(28138),u=t(77813),l=t(36580),c=t(15654),h=t(97156),p=t(8733),v=t(75841),m=t(13707),f=t(17524),b=t(13462),g=t(91885),I=t(79942),w=t(98086),S=t(98253);class y{constructor(e){this.draftsIsInserted=new h.t({}),this.draftsIsDoubleChecked=new h.t({}),this.reviewIsAccepted=new h.t({}),this.lastGenerationResultSubject=new p.B,this.lastGenerationResult=this.lastGenerationResultSubject.asObservable(),this.statusCache={},this.userId=e}letter(e){var{draftId:s}=e;return this.statusCache[s]||(this.statusCache[s]=b.T.shared().generatedLetterEnabled.pipe((0,a.n)(t=>t?this.draftsIsInserted.asObservable().pipe((0,i.p)(e=>void 0!==e[s]),(0,n.s)(1),(0,a.n)(t=>{var r=t[s];return w.d.shared(this.userId).api.pipe((0,a.n)(t=>"replyLetterId"in e?t.generateLetter({draftId:s,userId:this.userId,replyLetterId:e.replyLetterId,inserted:r}):t.generateLetter({draftId:s,userId:this.userId,attendeeId:e.attendeeId,type:e.type,inserted:r})),(0,d.M)(e=>{r||this.lastGenerationResultSubject.next(e)}),(0,o.T)(e=>(function(e){switch(e.status){case"generating":return g.Q.success({requestId:e.requestId,status:"generating",content:void 0,validationErrors:void 0,subject:void 0});case"success":return g.Q.success({requestId:e.requestId,status:"exists",content:e.text,validationErrors:void 0,subject:e.subject});case"moderation-failed":return g.Q.failure("explicit-error");case"unexpected-error":case"unknown-error":case"timeout":return g.Q.failure("failed");case"creation-unavailable":return g.Q.failure("creation-unavailable");default:return g.Q.failure("unavailable")}})(e)),(0,d.M)(s=>{s.isSuccessful&&"exists"===s.value.status&&!r&&(0,S.Rq)(e)}),(0,a.n)(e=>e.isSuccessful&&"exists"===e.value.status?this.draftsIsInserted.asObservable().pipe((0,o.T)(t=>t[s]?g.Q.success({status:"inserted",content:String(e.value.content),validationErrors:void 0,subject:e.value.subject,requestId:e.value.requestId}):e)):(0,v.of)(e)),(0,a.n)(e=>e.isSuccessful&&"inserted"===e.value.status?this.draftsIsDoubleChecked.asObservable().pipe((0,o.T)(t=>t[s]?g.Q.success({status:"double-checked",content:String(e.value.content),validationErrors:t[s],subject:e.value.subject,requestId:e.value.requestId}):e)):(0,v.of)(e)))})):(0,v.of)(g.Q.failure("unavailable"))),(0,u.Q)(m.T),(0,l.t)({refCount:!0,bufferSize:1}))),this.statusCache[s]}regenerateLetter(e){return w.d.shared(this.userId).api.pipe((0,d.M)(s=>{s.regenerateLetter(e)}),(0,o.T)(()=>void 0)).toSingle()}reviewAccepted(e){return this.reviewIsAccepted.asObservable().pipe((0,o.T)(s=>{var t;return null==(t=s[e])||t}),(0,c.F)())}markDraftAsInserted(e){var s=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return this.draftsIsInserted.asObservable().toSingle().pipe((0,I.ex)(t=>{this.draftsIsInserted.next(Object.assign({},t,{[e]:s}))}),(0,I.AB)(void 0))}markDraftAsDoubleChecked(e,s){return this.draftsIsDoubleChecked.asObservable().toSingle().pipe((0,I.ex)(t=>{this.draftsIsDoubleChecked.next(Object.assign({},t,{[e]:s}))}),(0,I.AB)(void 0))}setReviewAccepted(e,s){return this.reviewIsAccepted.asObservable().toSingle().pipe((0,I.ex)(t=>{this.reviewIsAccepted.next(Object.assign({},t,{[e]:s}))}),(0,I.AB)(void 0))}clearGenerationState(e){return(0,f.z)([this.draftsIsInserted.asObservable().toSingle(),this.draftsIsDoubleChecked.asObservable().toSingle(),this.reviewIsAccepted.asObservable().toSingle(),w.d.shared(this.userId).api]).toSingle().pipe((0,I.ex)(s=>{var[t,r,a,i]=s;i.clearLetterGenerationState(e);var n=Object.assign({},t);delete n[e],this.draftsIsInserted.next(n);var d=Object.assign({},r);delete d[e],this.draftsIsDoubleChecked.next(d);var o=Object.assign({},a);delete o[e],this.reviewIsAccepted.next(o)}),(0,I.AB)(void 0))}}y.shared=(0,r.G)(e=>new y(e))},98253(e,s,t){t.d(s,{Rq:()=>S});var r,a=t(39971),i=t(79942),n=t(45482),d=t(81731),o=t(24919),u=t(98
3153),l=t(43751),c=t(79760),h=t(58731),p=t(34578),v=t(17524),m=t(78363),f=t(50626),b=t(53940),g=t(97983),I="generated-letter-replace-text-overlay",w="should-ask-again",S=(r=function(e){u.A.emit("letter.generate.insert",e,()=>{n.Session.shared().userId.toSingle().pipe((0,i.Fg)(s=>s?d.c.shared(s).markDraftAsInserted(e.draftId):a.v.just())).safeSubscribe()})},function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];n.Session.shared().userId.toSingle().pipe((0,i.Fg)(e=>e?(0,v.z)([h.y.shared(I,e).load(w),o.i.shared().getDraft(s[0].draftId)]).toSingle().pipe((0,i.Fg)(s=>{var[t,r]=s;return!1!==t&&null!=r&&r.text?(0,p.h)(new a.v(e=>{l.Y.shared().get(c.A).actions.open("generated-letter-replace-text-overlay",[{props:{onAccept:s=>{e.success({result:!0,shouldAskAgain:s})},onReject:s=>{e.success({result:!1,shouldAskAgain:s})}}}])}),l.Y.shared().get(c.A).store.rxState().pipe((0,f.J)(),(0,b.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)==="generated-letter-replace-text-overlay"&&(null==t?void 0:t.name)!==(null==s?void 0:s.name)}),(0,g.u)({result:void 0,shouldAskAgain:void 0}))).toSingle().pipe((0,i.ex)(s=>{s.result&&h.y.shared(I,e).store(w,s.shouldAskAgain).safeSubscribe(),m.B.shared(e).logReplaceGeneratedLetterResult(s)}),(0,i.vV)(e=>!!e.result)):a.v.just(!0)})):a.v.just(!1))).safeSubscribe(e=>{if(e)return r(...s)})})},61570(e,s,t){t.d(s,{a:()=>c});var r=t(15526),a=t(22081),i=t(84190),n=t(28138),d=t(15654),o=t(36580),u=t(13462),l=t(75841);class c{constructor(e){this.free=u.T.shared().paidIntroductoryLettersEnabled.pipe((0,i.n)(s=>s?a.x.shared(e).tags.pipe((0,n.T)(e=>e.includes("experiments.letters.introduction.freeletters"))):(0,l.of)(!0)),(0,d.F)(),(0,o.t)(1))}}c.shared=(0,r.G)(e=>new c(e))},60696(e,s,t){t.d(s,{q:()=>i});var r=t(39971),a=t(98153);function i(e,s){return r.v.defer(()=>(a.A.emit("command.sidebar.open","chat",e,"letter"),r.v.just()))}},44999(e,s,t){t.d(s,{l:()=>b});var r=t(15526),a=t(75841),i=t(48830),n=t(98153),d=t(50626),o=t(53940),u=t(65052),l=t(15654),c=t(36580),h=t(28138),p=t(43751),v=t(79760),m=t(38792),f=t.n(m);class b{constructor(){this.visible=(0,a.of)(!1),this.letterId=new i.c(e=>{var s=(s,t,r,a,i,n,d,o,u)=>{e.next({recipient:t,sender:r,id:a,presentAnswer:"present"===i,introductory:"introductory"===i,read:o,cta:u})},t=()=>{e.next(null)},r=p.Y.shared().get(v.A).store.rxState().pipe((0,d.J)(),(0,o.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)==="read-letter"&&(null==t?void 0:t.name)!==(null==s?void 0:s.name)})).safeSubscribe(t);return n.A.sync("event.communication.letter.selected",t).on("event.communication.read-letter.selected",s).on("event.communication.chat.selected",t).on("event.sidebar.closed",t).on("event.sidebar.chat.closed",t),()=>{r.unsubscribe(),n.A.removeListener("event.communication.letter.selected",t).removeListener("event.communication.read-letter.selected",s).removeListener("event.communication.chat.selected",t).removeListener("event.sidebar.closed",t).removeListener("event.sidebar.chat.closed",t)}}).pipe((0,u.Z)(null),(0,l.F)(f()),(0,c.t)({refCount:!0,bufferSize:1})),this.visible=this.letterId.pipe((0,h.T)(e=>!!e))}}b.shared=(0,r.G)(()=>new b)},69199(e,s,t){t.d(s,{G:()=>n});var r=t(15526),a=t(12640),i=t(37418);class n{constructor(e){this.userId=e}logProfileSendEmailClicked(e){a._.shared(this.userId).logEvent("profile-send-email-banner-clicked",{"user-id":this.userId,"attendee-id":e}).safeSubscribe(),i.V.getCandidateInfo(e).safeSubscribe(e=>{i.V.shared().logEvent("profile","click","send_letter_button",{candidate_info:e})})}}n.shared=(0,r.G)(e=>new n(e))},78477(e,s,t){t.d(s,{y:()=>c});var r=t(98153),a=t(15526),i=t(48830),n=t(65052),d=t(15654),o=t(36580),u=t(38792),l=t.n(u);class c{constructor(){this.data=new i.c(e=>{var s=(s,t)=>{t&&("reading-letter"===t.source||"overlay-reading-letter"===t.source)&&t.data&&t.data.letterId?e.next({attendeeId:s,replyLetterId:t.data.letterId,source:t.source,letterCategory:"reply"}):e.next({attendeeId:s,replyLetterId:null,source:(null==t?void 0:t.source)==="recommendation"?"recommendation":null,letterCategory:(null==t?void 0:t.source)==="recommendation"?"by-recommendation":"new"})},t=()=>{e.next(null)};return r.A.sync("event.communication.letter.selected",s).on("event.overlay.letter.deactivated",t).on("event.communication.read-letter.selected",t).on("event.communication.chat.selected",t).on("event.sidebar.closed",t).on("event.sidebar.chat.closed",t),()=>{r.A.removeListener("event.communication.letter.selected",s).removeListener("event.overlay.letter.deactivated",t).removeListener("event.communication.read-letter.selected",t).removeListener("event.communication.chat.selected",t).removeListener("event.sidebar.closed",t).removeListener("event.sidebar.chat.closed",t)}}).pipe((0,n.Z)(null),(0,d.F)(l()),(0,o.t)({refCount:!0,bufferSize:1}))}}c.shared=(0,a.G)(()=>new c)},69145(e,s,t){t.d(s,{o:()=>u});var r=t(98153),a=t(48830),i=t(65052),n=t(15654),d=t(36580),o=t(15526);class u{constructor(){this.visible=new a.c(e=>{var s=s=>{e.next(s)};return r.A.sync("popup.state.changed.attachment",s),()=>{r.A.removeListener("popup.state.changed.attachment",s)}}).pipe((0,i.Z)(!1),(0,n.F)(),(0,d.t)(1))}}u.shared=(0,o.G)(()=>new u)},78546(e,s,t){t.d(s,{b:()=>u});var r=t(15526),a=t(43751),i=t(79760),n=t(28138),d=t(15654),o=t(36580);t(69186);class u{constructor(){this.visible=a.Y.shared().get(i.A).store.rxState().pipe((0,n.T)(e=>(null==e?void 0:e.name)==="write-to-birthday-contacts-recommendation"||(null==e?void 0:e.name)==="write-to-birthday-contacts-chat"),(0,d.F)(),(0,o.t)(1))}}u.shared=(0,r.G)(()=>new u)},45898(e,s,t){t.d(s,{D:()=>G});var r=t(15526),a=t(97156),i=t(8733),n=t(17524),d=t(75841),o=t(56607),u=t(84190),l=t(65052),c=t(44383),h=t(28138),p=t(92453),v=t(15654),m=t(80914),f=t(53940),b=t(36580),g=t(30495),I=t(50846),w=t(91885),S=t(79942),y=t(64726),A=t(17951);class T extends I.Q{constructor(e){super("dialogs.recommended-birthday-contacts-to-chat",e,s=>(0,g.Yq)(g.jI.shared().users.reminders.get,e,Object.assign({},s,{type:"birthday"})).pipe((0,S.ex)(e=>{var{users:s}=e;for(var t of s)y.q.shared(t.id).setStateIfNotFilled(w.Q.success(t)).safeSubscribe()}),(0,S.vV)(e=>{var{users:s}=e;return{data:s.map(e=>{var{id:s}=e;return s}),ttl:0}}))),this.userId=e}skipRecommendedContact(e){return A._.shared(this.userId).logUserAction({type:"reminder.birthday.skipped",data:{target:e,reason:""}})}}T.shared=(0,r.G)(e=>new T(e));
3var x=t(43981),C=t(13462),F=t(58731),D=t(33702),k=t.n(D),E=t(11922),j=t(39971),R="birthday-contacts-recommendations",O="birthday-contacts-recommendations-remains-counter",M="birthday-contacts-recommendations-responded-timestamp";class G{constructor(e){this.userId=e,this.contactedUsersDuringSession=new a.t([]),this.skippedUsers=new a.t(new Set),this.recommendationsIgnoredSubject=new i.B,this.recommendationsIgnored=this.recommendationsIgnoredSubject.asObservable();var s=F.y.shared(R,e),t=s.load(O),r=s.load(M),g=(0,n.z)([C.T.shared().chatWithBirthdayContactsRecommendationsEnabled,C.T.shared().chatWithBirthdayContactsRecommendations]).pipe((0,u.n)(e=>{var[s,a]=e;return s?j.v.zip(t,r).pipe((0,S.vV)(e=>{var[s,t]=e,r=null!==t&&Date.now()-Number(t),i=!!r&&r>a.timeout;return Number(s)>0||null===s&&null===t||i})).asObservable():(0,d.of)(!1)})),I=x.e.shared(e).newMessage.pipe((0,l.Z)(null),(0,c.S)((e,s)=>s&&s.sender===this.userId?new Set([...Array.from(e),s.recipient]):e,new Set)),w=()=>C.T.shared().chatWithBirthdayContactsRecommendations.pipe((0,u.n)(r=>(0,n.z)([T.shared(e).data({select:r.loadCount}),I,this.skippedUsers]).pipe((0,u.n)(e=>{var[s,r,a]=e;return j.v.zip(t,this.contactedUsersDuringSession.toSingle()).pipe((0,S.vV)(e=>{var[t,i]=e;return[s,r,t,i,a]}))}),(0,h.T)(e=>{var[s,t,a,i,n]=e,d=null===a||Number(a)>r.countPerTime?r.countPerTime:Number(a),o=s.filter(e=>t.has(e)),u=o.length>i.length?d-1:d;return[s.filter(e=>!(t.has(e)||n.has(e))).slice(0,u),u,0===s.length,o]}),(0,p.M)(e=>{var[,,,s]=e;return this.contactedUsersDuringSession.next(s)}),(0,u.n)(e=>{var[t,r,a]=e;return j.v.zip(s.store(O,r>0?r:null),r>0?j.v.just(void 0):s.store(M,Date.now())).pipe((0,S.AB)([t,0===r||a]))}),(0,v.F)(k())))),y=w().pipe((0,m.f)(e=>{var[s,t]=e;return 0!==s.length||t?o.w:w()}),(0,f.p)(e=>{var[s,t]=e;return s.length>0||t}),(0,h.T)(e=>{var[s]=e;return s}));this.contacts=E.r.shared().focusState.pipe((0,v.F)(),(0,u.n)(e=>"focused"===e?g.pipe((0,u.n)(e=>e?y:o.w)):o.w),(0,v.F)(k()),(0,b.t)(1))}skipRecommendedContact(e){return T.shared(this.userId).skipRecommendedContact(e).pipe((0,S.ex)(()=>this.skippedUsers.next(new Set([...Array.from(this.skippedUsers.value),e]))))}ignoreRecommendations(){return(0,n.z)([F.y.shared(R,this.userId).store(M,Date.now()),F.y.shared(R,this.userId).store(O,null)]).toSingle().pipe((0,S.vV)(()=>{this.recommendationsIgnoredSubject.next()}))}}G.shared=(0,r.G)(e=>new G(e))},12275(e,s,t){t.d(s,{O:()=>u});var r=t(15526),a=t(43751),i=t(79760),n=t(28138),d=t(15654),o=t(36580);class u{constructor(){this.visible=a.Y.shared().get(i.A).store.rxState().pipe((0,n.T)(e=>(null==e?void 0:e.name)==="write-to-contacts-chat-list"||(null==e?void 0:e.name)==="write-to-contacts-skip-chat"||(null==e?void 0:e.name)==="write-to-contacts-recommendation"),(0,d.F)(),(0,o.t)(1))}}u.shared=(0,r.G)(()=>new u)},91733(e,s,t){t.d(s,{_:()=>O});var r=t(15526),a=t(97156),i=t(17524),n=t(75841),d=t(56607),o=t(84190),u=t(65052),l=t(44383),c=t(28138),h=t(92453),p=t(15654),v=t(80914),m=t(53940),f=t(36580),b=t(30495),g=t(50846),I=t(91885),w=t(64726),S=t(17951),y=t(79942);class A extends g.Q{constructor(e){super("dialogs.recommended-contacts-to-chat",e,s=>(0,b.Yq)(b.jI.shared().users.reminders.get,e,Object.assign({},s,{type:"default"})).pipe((0,y.ex)(e=>{var{users:s}=e;for(var t of s)w.q.shared(t.id).setStateIfNotFilled(I.Q.success(t)).safeSubscribe()}),(0,y.vV)(e=>{var{users:s}=e;return{data:s.map(e=>{var{id:s}=e;return s}),ttl:0}}))),this.userId=e}skipRecommendedContact(e,s){return S._.shared(this.userId).logUserAction({type:"reminder.skipped",data:{target:e,reason:s}})}}A.shared=(0,r.G)(e=>new A(e));var T=t(43981),x=t(13462),C=t(58731),F=t(33702),D=t.n(F),k=t(11922),E=t(39971),j="contacts-recommendations-remains-counter",R="contacts-recommendations-responded-timestamp";class O{constructor(e){this.userId=e,this.contactedUsersDuringSession=new a.t([]),this.skippedUsers=new a.t(new Set);var s=C.y.shared("contacts-recommendations",e),t=s.load(j),r=s.load(R),b=(0,i.z)([x.T.shared().chatWithContactsRecommendationsEnabled,x.T.shared().chatWithContactsRecommendations]).pipe((0,o.n)(e=>{var[s,a]=e;
3return s?E.v.zip(t,r).pipe((0,y.vV)(e=>{var[s,t]=e,r=t&&Date.now()-Number(t),i=!!r&&r>a.timeout;return Number(s)>0||null===s&&null===t||i})).asObservable():(0,n.of)(!1)})),g=T.e.shared(e).newMessage.pipe((0,u.Z)(null),(0,l.S)((e,s)=>s&&s.sender===this.userId?new Set([...Array.from(e),s.recipient]):e,new Set)),I=()=>x.T.shared().chatWithContactsRecommendations.pipe((0,o.n)(r=>(0,i.z)([A.shared(e).data({select:r.loadCount}),g,this.skippedUsers]).pipe((0,o.n)(e=>{var[s,r,a]=e;return E.v.zip(t,this.contactedUsersDuringSession.toSingle()).pipe((0,y.vV)(e=>{var[t,i]=e;return[s,r,t,i,a]}))}),(0,c.T)(e=>{var[s,t,a,i,n]=e,d=null===a||Number(a)>r.countPerTime?r.countPerTime:Number(a),o=s.filter(e=>t.has(e)),u=o.length>i.length?d-1:d;return[s.filter(e=>!(t.has(e)||n.has(e))).slice(0,u),u,0===s.length,o]}),(0,h.M)(e=>{var[,,,s]=e;return this.contactedUsersDuringSession.next(s)}),(0,o.n)(e=>{var[t,r,a]=e;return E.v.zip(s.store(j,r>0?r:null),r>0?E.v.just(void 0):s.store(R,Date.now())).pipe((0,y.AB)([t,0===r||a]))}),(0,p.F)(D())))),w=I().pipe((0,v.f)(e=>{var[s,t]=e;return 0!==s.length||t?d.w:I()}),(0,m.p)(e=>{var[s,t]=e;return s.length>0||t}),(0,c.T)(e=>{var[s]=e;return s}));this.contacts=k.r.shared().focusState.pipe((0,p.F)(),(0,o.n)(e=>"focused"===e?b.pipe((0,o.n)(e=>e?w:d.w)):d.w),(0,p.F)(D()),(0,f.t)(1))}skipRecommendedContact(e,s){return A.shared(this.userId).skipRecommendedContact(e,s).pipe((0,y.ex)(()=>this.skippedUsers.next(new Set([...Array.from(this.skippedUsers.value),e]))))}}O.shared=(0,r.G)(e=>new O(e))},20955(e,s,t){t.d(s,{N:()=>i});var r=t(15526),a=t(37418);class i{logPopupViewed(e){a.V.shared().logEvent("chat_with_non_contacts_recommendations","view","popup",e)}logPopupEligibilityViewed(){a.V.shared().logEvent("chat_with_non_contacts_recommendations","view","popup_eligibility",void 0)}logSayHiClicked(e){a.V.shared().logEvent("chat_with_non_contacts_recommendations","click","say_hi",e)}logSayHiToAllClicked(e){a.V.shared().logEvent("chat_with_non_contacts_recommendations","click","say_hi_to_all",e)}logProfileCardClicked(e){a.V.shared().logEvent("chat_with_non_contacts_recommendations","click","profile_card",e)}logSlideChanged(e){a.V.shared().logEvent("chat_with_non_contacts_recommendations","click","slide_change",e)}logCloseButtonClicked(e){a.V.shared().logEvent("chat_with_non_contacts_recommendations","click","close_button",e)}logOtherReasonClosed(e){a.V.shared().logEvent("chat_with_non_contacts_recommendations","click","other_reason_close",e)}}i.shared=(0,r.G)(()=>new i)},7220(e,s,t){t.d(s,{E:()=>y});var r=t(89218),a=t(15526),i=t(13462),n=t(66382),d=t(17524),o=t(75841),u=t(34578),l=t(84190),c=t(28138),h=t(65052),p=t(15654),v=t(36580),m=t(43751),f=t(49844),b=t(34677),g=t(29109),I=t(39971),w=t(91885),S=t(4938);class y extends r.D{constructor(e){super();var s=(0,d.z)([i.T.shared().voiceMessagesSettings,n.j.shared().chatAttendee]).pipe((0,l.n)(s=>{var[t,r]=s;return r&&t.messagesSeriesLimit&&t.messagesSeriesLimitTtl&&t.messagesSeriesLimitActivationTime?this.checkLastMessagesInChat(r,e,t.messagesSeriesLimit,t.messagesSeriesLimitTtl,t.messagesSeriesLimitActivationTime):(0,o.of)(!1)}));this.canOffer=(0,u.h)(s,this.offeringResult.pipe((0,c.T)(()=>!1))).pipe((0,h.Z)(!1),(0,p.F)(),(0,v.t)({bufferSize:1,refCount:!0}))}start(){return I.v.just(w.Q.success({}))}checkLastMessagesInChat(e,s,t,r,a){return g.u.shared(s).activeChats.pipe((0,l.n)(i=>i.includes(e)?(0,o.of)(!1):(m.Y.shared().get(f.Ay,(0,f.OX)(s,e)).actions.get(),m.Y.shared().get(f.Ay,(0,f.OX)(s,e)).store.rxState().pipe((0,l.n)(e=>{var s=e.messages.slice(0,t+1),i=e.messages.find(e=>!e.outgoing),n=s.every(e=>e.outgoing&&e.type===b.Go.Voice);if(s.length!==t+1||!n)return(0,o.of)(!1);var d=s[s.length-1].timestamp,u=(null==i?void 0:i.timestamp)||0;return S.E.shared().currentTime().asObservable().pipe((0,c.T)(e=>e-d<r&&(!i||e-u>a)))})))))}}y.shared=(0,a.G)(e=>new y(e))},31249(e,s,t){t.d(s,{j:()=>r.j});var r=t(10853)},27616(e,s,t){t.d(s,{zr:()=>S});var r=t(13462),a=t(91885),i=t(89218),n=t(75841),d=t(17524),o=t(79942),u=t(84190),l=t(28138),c=t(15654),h=t(36580),p=t(15526),v=t(22998),m=t(66382),f=t(94375),b=t(4938),g="text-to-speech-button-onboarding",I="first-shown",w="last-shown";class S extends i.D{constructor(e){super(),this.userId=e,this.canOffer=r.T.shared().textToSpeechEnabled.pipe((0,u.n)(e=>
3e?(0,d.z)([v.w.shared(g,this.userId).data(),m.j.shared().chatAttendee,b.E.shared().currentTime().asObservable()]).pipe((0,l.T)(e=>{var s,t,[r,a,i]=e;if(!a)return!1;var n=null==(s=r[g])?void 0:s[I],d=null==(t=r[g])?void 0:t[w];return!n||!(i-n>f.b.week||d&&b.E.shared().isSameDaySync(new Date(d),new Date(i)))})):(0,n.of)(!1))).pipe((0,c.F)(),(0,h.t)({bufferSize:1,refCount:!0}))}accept(){return b.E.shared().currentTime().pipe((0,o.Fg)(e=>v.w.shared(g,this.userId).store(w,e).pipe((0,o.AB)(a.Q.success()))))}reject(){return b.E.shared().currentTime().pipe((0,o.Fg)(e=>v.w.shared(g,this.userId).store(w,e).pipe((0,o.AB)(a.Q.success()))))}start(){return b.E.shared().currentTime().pipe((0,o.Fg)(e=>v.w.shared(g,this.userId).store(I,e).pipe((0,o.AB)(a.Q.success({})))))}}S.shared=(0,p.G)(e=>new S(e))},27680(e,s,t){t.d(s,{XN:()=>I});var r=t(13462),a=t(91885),i=t(89218),n=t(75841),d=t(79942),o=t(84190),u=t(50626),l=t(28138),c=t(15654),h=t(36580),p=t(15526),v=t(22998),m=t(66382),f=t(31249),b="text-to-speech-farewell-onboarding",g="shown";class I extends i.D{constructor(e){super(),this.userId=e,this.canOffer=r.T.shared().textToSpeechEnabled.pipe((0,o.n)(e=>e?m.j.shared().chatAttendee.pipe((0,o.n)(e=>e?v.w.shared(b,this.userId).data().pipe((0,o.n)(e=>{var s;return(null==(s=e[b])?void 0:s[g])?(0,n.of)(!1):f.j.shared().visible.pipe((0,u.J)(),(0,l.T)(e=>{var[s,t]=e;return!t&&s}))})):(0,n.of)(!1))):(0,n.of)(!1)),(0,c.F)(),(0,h.t)({bufferSize:1,refCount:!0}))}start(){return v.w.shared(b,this.userId).store(g,!0).pipe((0,d.AB)(a.Q.success({})))}}I.shared=(0,p.G)(e=>new I(e))},64608(e,s,t){t.d(s,{A:()=>n});var r=t(15526),a=t(12640),i=t(46018);class n{constructor(e){this.userId=e}logMinglePopupOpen(e,s){i.n.shared().logEvent("LM_opened",{source:(e=>{switch(e){case"feed":return"MainPage";case"registration":return"AfterRegistration";default:return"Other"}})(s)}),a._.shared(this.userId).logEvent("mingle-popup-opened",{userId:this.userId,step:e,cta:s}).safeSubscribe()}logMinglePopupClose(e,s){a._.shared(this.userId).logEvent("mingle-popup-closed",{userId:this.userId,step:e,cta:s}).safeSubscribe()}logStopMingle(e){var s;i.n.shared().logEvent("lm_completed",{COMPLETION_TYPE:(e=>{switch(e){case"canceled":return"manual_stop";case"lifetime-reached":return"timeout";case"consumers-found":return"limit_reached";default:return"other"}})(e.completionReason),MESSAGES_SENT:(null==(s=e.consumers)?void 0:s.length)||0,DURATION_SECONDS:e.lifetime}),a._.shared(this.userId).logEvent("mingle-stopped",{userId:this.userId}).safeSubscribe()}logStartMingle(e,s){i.n.shared().logEvent("lm_launched",{ACTIVATION_TYPE:e?"free":"subscription",MESSAGE_TYPE:s?"template":"custom",USER_ID:this.userId}),e&&a._.shared(this.userId).logEvent("free-mingle-after-registration-sent",{userId:this.userId}).safeSubscribe()}logMingleReceived(e){a._.shared(this.userId).logEvent("mingle-received",{userId:this.userId,reduced_delivery:e}).safeSubscribe()}logMingleModeSelectionClosed(e){a._.shared(this.userId).logEvent("mingle-mode-selection-closed",{userId:this.userId,mode:e}).safeSubscribe()}logMingleModeSelectionSubmitted(e){a._.shared(this.userId).logEvent("mingle-mode-selection-submitted",{userId:this.userId,mode:e}).safeSubscribe()}}n.shared=(0,r.G)(e=>new n(e))},92397(e,s,t){t.d(s,{K:()=>x});var r=t(89218),a=t(91885),i=t(39971),n=t(15526),d=t(48830),o=t(28138),u=t(53940),l=t(27585),c=t(84190),h=t(75841),p=t(34578),v=t(65052),m=t(15654),f=t(36580),b=t(13462),g=t(82483),I=t(56379),w=t(14321),S=t(43981),y=t(70009),A=t(74923),T=t(34677);class x extends r.D{constructor(e){super();var s=new d.c(e=>{var s=()=>{e.next(!0)},t=()=>{e.next(!1)};return g.g.shared().addListener("event.call.payment.required",s),g.g.shared().addListener("event.call.payment.fullfilled",t),()=>{g.g.shared().removeListener("event.call.payment.required",s),g.g.shared().removeListener("event.call.payment.fullfilled",t)}}),t=I.M.shared(e).callFailed.pipe((0,o.T)(e=>{var{reason:s}=e;return"attendeeIsNotContact"===s}),(0,u.p)(Boolean)),r=S.e.shared(e).newMessage.pipe((0,l.E)(y.G.shared().localize("/users/media/photo","hi-message")),(0,u.p)(s=>{var t,r,[a,i]=s;return a.status===A.n.Unpaid&&!(null!=(t=a.meta)&&t.transfer)&&!(null!=(r=a.meta)&&r.bonuses)&&(a.sender!==e||a.content!==i)&&a.type!==T.Go.Letter}),(0,o.T)(()=>!0)),a=b.T.shared().startConversationBannerEnabled.pipe((0,c.n)(a=>a?w.f.shared(e).userIsFeaturedMember.pipe((0,c.n)(e=>e?(0,p.h)((0,h.of)(!1),s,t,r):(0,h.of)(!1))):(0,h.of)(!1)));this.canOffer=(0,p.h)(a,this.offeringResult.pipe((0,o.T)(()=>!1))).pipe((0,v.Z)(!1),(0,m.F)(),(0,f.t)({bufferSize:1,refCount:!0}))}start(){return i.v.just(a.Q.success({}))}}x.shared=(0,n.G)(e=>new x(e))},66225(e,s,t){t.d(s,{fu:()=>E});var r=t(89218),a=t(91885),i=t(39971),n=t(79942),d=t(15526),o=t(94375),u=t(4938),l=t(22998),c=t(75841),h=t(34578),p=t(65052),v=t(17524),m=t(84190),f=t(28138),b=t(15654),g=t(53940),I=t(27585),w=t(36580),S=t(34677),y=t(43981
3),A=t(46282),T=t(13462),x=t(52393),C=t(77252),F="dialogs-stickers-pass-banner-offering",D="offered-at",k=48*o.b.hour;class E extends r.D{constructor(e){super(),this.userId=e;var s=T.T.shared().stickersPassEnabled.pipe((0,m.n)(s=>s?A.F.shared(e).stickersPass.pipe((0,f.T)(e=>!(null!=e&&e.active))):(0,c.of)(!1))),t=C.J.shared(e).status.pipe((0,f.T)(e=>"idle"===e),(0,b.F)()),r=y.e.shared(e).newMessage.pipe((0,g.p)(s=>(null==s?void 0:s.sender)===e&&s.type===S.Go.Sticker)),a=(0,h.h)(l.w.shared(F,this.userId).load(D),this.offer.pipe((0,g.p)(e=>!!e))).pipe((0,I.E)(x.ET.shared(e).lastOfferedAt),(0,f.T)(e=>{var[s,t]=e;return Math.max(null!=s?s:0,null!=t?t:0)})),i=r.pipe((0,m.n)(()=>a.pipe((0,I.E)(u.E.shared().currentTime()))),(0,f.T)(e=>{var[s,t]=e;return!s||t-s>k}),(0,p.Z)(!1));this.canOffer=(0,v.z)([s,t]).pipe((0,m.n)(e=>{var[s,t]=e;return s&&t?i.pipe((0,f.T)(e=>!!e&&Date.now())):(0,c.of)(!1)}),(0,b.F)(),(0,w.t)({refCount:!0,bufferSize:1}))}start(){return this.offer.toSingle().pipe((0,n.Fg)(e=>e?i.v.just(a.Q.failure("offer-not-allowed")):u.E.shared().currentTime().pipe((0,n.Fg)(e=>l.w.shared(F,this.userId).store(D,e).pipe((0,n.AB)(a.Q.success(e)))))))}}E.shared=(0,d.G)(e=>new E(e))},52393(e,s,t){t.d(s,{ET:()=>x});var r=t(15526),a=t(89218),i=t(4938),n=t(34578),d=t(17524),o=t(75841),u=t(53940),l=t(28138),c=t(84190),h=t(15654),p=t(36580),v=t(13462),m=t
3(66382),f=t(22998),b=t(79942),g=t(39971),I=t(91885),w=t(46282),S=t(77252),y="stickers-pass-offering-expired-banner",A="stickers-pass-was-active",T="last-offered-at";class x extends a.D{constructor(e){super(),this.userId=e,this.lastOfferedAt=(0,n.h)(f.w.shared(y,e).load(T),this.offer.pipe((0,u.p)(e=>!!e))),this.canOffer=(0,n.h)(this.offeringResult.pipe((0,l.T)(()=>!1)),(0,d.z)([v.T.shared().stickersPassEnabled,m.j.shared().chatAttendee]).pipe((0,c.n)(s=>{var[t,r]=s;return t&&r?w.F.shared(e).stickersPass.pipe((0,c.n)(s=>s?s.active?f.w.shared(y,e).store(A,!0).pipe((0,b.vV)(()=>!1)):S.J.shared(e).status.pipe((0,c.n)(s=>"idle"!==s?(0,o.of)(!1):f.w.shared(y,e).load(A).pipe((0,b.vV)(e=>!!e)))):(0,o.of)(!1))):(0,o.of)(!1)}))).pipe((0,h.F)(),(0,p.t)({bufferSize:1,refCount:!0}))}start(){return this.offer.toSingle().pipe((0,b.Fg)(e=>e?g.v.just(I.Q.failure("offer-not-allowed")):i.E.shared().currentTime().pipe((0,b.Fg)(e=>g.v.zip(f.w.shared(y,this.userId).store(A,!1),f.w.shared(y,this.userId).store(T,e)).pipe((0,b.vV)(()=>I.Q.success(e)))))))}}x.shared=(0,r.G)(e=>new x(e))},46282(e,s,t){t.d(s,{F:()=>d});var r=t(36580),a=t(15526),i=t(38806),n=t(72678);class d{constructor(e){this.stickersPass=i.mK.shared(e).data().pipe((0,r.t)({refCount:!0,bufferSize:1})),this.userId=e}purchase(e){return n.g.shared(this.userId).purchase("sticker-pass",e,void 0,void 0,!0)}}d.shared=(0,a.G)(e=>new d(e))},53423(e,s,t){t.d(s,{eh:()=>E});var r=t(89218),a=t(15526),i=t(17524),n=t(75841),d=t(34578),o=t(28138),u=t(15654),l=t(84190),c=t(53193),h=t(36580),p=t(39971),v=t(91885),m=t(66382),f=t(94375),b=t(29109),g=t(22998),I=t(14321),w=t(79942),S=t(5666),y=t(33979),A=t(36713),T=t(13462),x=t(10621),C=t(77252),F="stickers-generation-promo-banner-offering",D="banner-last-shown-time",k=72*f.b.hour;class E extends r.D{constructor(e){super(),this.userId=e;var s=(0,i.z)([T.T.shared().stickersPackGenerationEnabled,I.f.shared(this.userId).userIsFeaturedMember,C.J.shared(e).status.pipe((0,o.T)(e=>"idle"===e),(0,u.F)())]).pipe((0,l.n)(s=>{var[t,r,a]=s;return t&&!r&&a?m.j.shared().chatAttendee.pipe((0,l.n)(s=>s?(0,i.z)([y.v.shared(this.userId).tasks.pipe((0,o.T)(e=>e.some(e=>"create-photobased-pack"===e.taskName&&"msp"===e.payload.packName&&"0.init"!==e.state)||!1)),A.n.shared(e).stickerPacks(s).pipe((0,o.T)(e=>e.find(e=>e.generic&&"msp"===e.name)||!1))]).pipe((0,l.n)(e=>{var[t,r]=e;return t||!r?(0,n.of)(!1):(0,i.z)([S.j.shared().currentTime(),g.w.shared(F,this.userId).load(D)]).pipe((0,l.n)(e=>{var[t,a]=e;return a&&t-a<=k?(0,n.of)(!1):b.u.shared(this.userId).getActiveChatState(s).pipe((0,o.T)(e=>{if(!e||!e.isActive)return!1;var t=e.messagesStatus;return!(t.incomingMessagesCount+t.outgoingMessagesCount<14)&&{packName:r.name,attendeeId:s}}),(0,c.Q)(this.offeringResult))}))})):(0,n.of)(!1))):(0,n.of)(!1)}));this.canOffer=(0,d.h)(this.offeringResult.pipe((0,o.T)(()=>!1)),s).pipe((0,u.F)(x.L),(0,h.t)({refCount:!0,bufferSize:1}))}start(e){return this.offer.toSingle().pipe((0,w.Fg)(s=>s?p.v.just(v.Q.failure("offer-not-allowed")):S.j.shared().currentTime().pipe((0,w.Fg)(e=>g.w.shared(F,this.userId).store(D,e)),(0,w.AB)(v.Q.success(e)))))}}E.shared=(0,a.G)(e=>new E(e))},33979(e,s,t){t.d(s,{v:()=>b});var r=t(15526),a=t(22871),i=t(15654),n=t(36580),d=t(17524),o=t(33702),u=t.n(o),l=t(27585),c=t(28138),h=t(13462),p=t(39971),v=t(79942),m=t(91885),f=t(22081);class b{constructor(e){this.userId=e,this.tasks=a.S.shared(e).data().pipe((0,l.E)(h.T.shared().currencyDevaluationRatio.pipe((0,c.T)(e=>100/e))),(0,c.T)(e=>{var[s,t]=e;return s.settings.flatMap(e=>{var r=s.instances.filter(s=>s.taskName===e.taskName);return(r.length>0?r:[{state:"0.init",taskName:e.taskName,payload:{packName:e.packName}}]).map(s=>Object.assign({},s,{settings:{credits:e.credits/t}}))})}),(0,i.F)(u()),(0,n.t)({refCount:!0,bufferSize:1}))}upsertPack(e){var s="create-photobased-pack";return this.getTask(s,e.packName).toSingle().pipe((0,v.Fg)(t=>t?(0,d.z)([f.x.shared(this.userId).tags,h.T.shared().currencyDevaluationRatio.pipe((0,c.T)(e=>100/e))]).toSingle().pipe((0,v.Fg)(r=>{var[i,n]=r;return i.includes("stickers.tasks.face.check.exceeded")?p.v.just(m.Q.failure("face-check-limit-exceeded")):"0.init"===t.state?null!=e&&e.photoUrl?a.S.shared(this.userId).create({taskName:s,expectedCredits:t.settings.credits*n,photoUrl:e.photoUrl}).pipe((0,v.vV)(()=>m.Q.success())):p.v.just(m.Q.success()):a.S.shared(this.userId).updateTask(s,e.photoUrl).pipe((0,v.vV)(()=>m.Q.success()))})):p.v.just(m.Q.success())))}deleteTask(e){return a.S.shared(this.userId).deleteTask(e)}getTask(e,s){return b.shared(this.userId).tasks.pipe((0,c.T)(t=>t.find(t=>t.taskName===e&&t.payload.packName===s)),(0,i.F)(u()))}}b.shared=(0,r.G)(e=>new b(e))},34157(e,s,t){t.d(s,{v:()=>f});var r=t(15526),a=t(75841),i=t(17524),n=t(13462),d=t(84190),o=t(15654),u=t(36580),l=t(28138),c=t(3810),h=t(14321),p=t(22081),v=t(91654),m=t(87902);class f{constructor(e){this.availabilityCache={},this.userId=e}available(e){return this.availabilityCache[e]||(this.availabilityCache[e]=n.T.shared().dialogsThemesEnabled.pipe((0,d.n)(s=>s?(0,i.z)([this.attendeeDialogsThemesEnabled(e),this.rolesCombinationAllowed(e),h.f.shared(this.userId).userIsFeaturedMember,m.t.shared().model(e)]).pipe((0,d.n)(s=>{var[t,r,i,n]=s;return(!i||"services"!==n)&&t&&r?i?v.e.shared(e).hasPurchases:(0,a.of)(!0):(0,a.of)(!1)})):(0,a.of)(!1)),(0,o.F)(),(0,u.t)({refCount:!0,bufferSize:1}))),this.availabilityCache[e]}rolesCombinationAllowed(e){return(0,i.z)([h.f.shared(this.userId).userIsFeaturedMember,h.f.shared(e).userIsFeaturedMember]).pipe((0,l.T)(e=>{var[s,t]=e;return s!==t}))}attendeeDialogsThemesEnabled(e){return n.T.shared().dialogsThemes.pipe((0,c.E)("attendeeTag")).pipe((0,d.n)(s=>"*"===s?(0,a.of)(!0):p.x.shared(e).tags.pipe((0,l.T)(e=>e.includes(s)))))}}f.shared=(0,r.G)(e=>new f(e))},84115(e,s,t){t.d(s,{po:()=>b});var r=t(15526),a=t(97156),i=t(17524),n=t(28138),d=t(15654),o=t(36580),u=t(53940),l=t(84190),c=t(92453),h=t(22998),p=t(4938),v=t(81601),m="dialogs-themes-catalogue",f="last-visible-time";
3class b{constructor(e){this.sessionLastVisibleSubject=new a.t(null),this.userId=e;var s=h.w.shared(m,this.userId).load(f).asObservable();this.lastVisibleTime=(0,i.z)([s,this.sessionLastVisibleSubject]).pipe((0,n.T)(e=>{var[s,t]=e;return null!=t?t:s}),(0,d.F)(),(0,o.t)({bufferSize:1,refCount:!0}))}start(e){e.add(v.$.shared().visible.pipe((0,d.F)(),(0,u.p)(Boolean),(0,l.n)(()=>p.E.shared().currentTime()),(0,c.M)(e=>this.sessionLastVisibleSubject.next(e)),(0,l.n)(e=>h.w.shared(m,this.userId).store(f,e).asObservable())).safeSubscribe())}}b.shared=(0,r.G)(e=>new b(e))},81601(e,s,t){t.d(s,{$:()=>o});var r=t(15526),a=t(28138),i=t(15654),n=t(43751),d=t(79760);class o{constructor(){this.visible=n.Y.shared().get(d.A).store.rxState().pipe((0,a.T)(e=>(null==e?void 0:e.name)==="dialogs-themes-catalogue"),(0,i.F)())}}o.shared=(0,r.G)(()=>new o)},77118(e,s,t){t.d(s,{x:()=>f});var r=t(15526),a=t(17524),i=t(28138),n=t(15654),d=t(36580),o=t(84190),u=t(72678),l=t(33702),c=t.n(l),h=t(4328),p=t(13462),v=t(91760),m=t(79942);class f{static getLocalizedName(e){return v.o.shared().getTexts("/texts/dialogs/backgrounds/names").pipe((0,m.vV)(s=>s[e]))}constructor(e){this.userId=e}getCatalogue(e){return(0,a.z)([this.backgrounds(e),h.Q.shared(this.userId).theme(e),v.o.shared().getTexts("/texts/dialogs/backgrounds/names")]).pipe((0,i.T)(e=>{var[s,t,r]=e,a=e=>e.default?e:Object.assign({},e,{localizedName:r[e.reference]}),i=s.filter(e=>e.default||!e.cheer).map(a);if(!t||t.custom||i.some(e=>!e.default&&e.reference===t.reference))return i;var n=s.find(e=>!e.default&&e.reference===t.reference),d=a(null!=n?n:{reference:t.reference,price:0,default:!1,custom:!1,animated:!1,cheer:!0}),[o,...u]=i,l=u.find(e=>!e.default&&e.custom),c=u.filter(e=>e!==l);return[o,...l?[l]:[],d,...c]}),(0,n.F)(c()),(0,d.t)({refCount:!0,bufferSize:1}))}backgrounds(e){var s=p.T.shared().cheersFreeThemesEnabled.pipe((0,o.n)(s=>u.g.shared(this.userId).data({productType:"dialogs.backgrounds",query:Object.assign({targetUserId:e},s?{labels:"cheer.theme"}:{})})));return(0,a.z)([s,h.Q.shared(this.userId).theme(e)]).pipe((0,i.T)(e=>{var[s,t]=e;return s.map(e=>{var s,r,a,i,n=(null==(s=e.properties)?void 0:s.source)==="gallery",d=!!(null!=(r=e.properties)&&null!=(r=r.labels)&&r.includes("animated")),o=!!(null!=(a=e.properties)&&null!=(a=a.labels)&&a.includes("cheer.theme")),u=n?(null==t?void 0:t.custom)&&(null==t?void 0:t.reference)||"custom":null==(i=e.properties)?void 0:i.reference;return u?Object.assign({reference:u,price:e.price,default:!1,custom:n,animated:d},o?{cheer:!0}:{}):{default:!0}})}),(0,d.t)({refCount:!0,bufferSize:1}))}getCatalogueItem(e,s){return this.getCatalogue(s).pipe((0,i.T)(s=>s.find(s=>!s.default&&s.reference===e)))}}f.shared=(0,r.G)(e=>new f(e))},91458(e,s,t){t.d(s,{T:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logChoosePhotoButtonClicked(e){a._.shared(this.userId).logEvent("dialogs-themes-choose-photo-clicked",e).safeSubscribe()}logCustomThemeUploadingAttempt(e){a._.shared(this.userId).logEvent("dialogs-themes-photo-upload",e).safeSubscribe()}logCustomThemeUploadResult(e){a._.shared(this.userId).logEvent("dialogs-themes-photo-upload-result",e).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},44457(e,s,t){t.d(s,{S:()=>b});var r=t(91885),a=t(39971),i=t(79942),n=t(15526),d=t(61476),o=t(13462),u=t(33702),l=t.n(u),c=t(38107),h=t(15654),p=t(36580),v=t(92453),m=t(53940),f=t(28138);class b{constructor(e){this.statusSubject=new c.m(1),this.userId=e,this.status=this.statusSubject.asObservable().pipe((0,h.F)(l()),(0,p.t)({bufferSize:1,refCount:!0}))}uploadCustomTheme(e){var{attendeeId:s,file:t}=e;return this.fileIsValid(t).pipe((0,i.Fg)(t=>{if(t.error){var r="size"===t.error?"size":"unknown";return this.statusSubject.next({name:"failed",errorType:r,attendeeId:s}),a.v.just(void 0)}return this.statusSubject.next({name:"uploading",progress:0,attendeeId:s}
3),d.B.shared(this.userId).uploadUploadCustomTheme(e).pipe((0,v.M)(e=>{this.statusSubject.next("failed"===e.name?Object.assign({},e,{errorType:"unknown",attendeeId:s}):Object.assign({},e,{attendeeId:s}))}),(0,m.p)(e=>"complete"===e.name||"failed"===e.name),(0,f.T)(()=>void 0)).toSingle()}))}fileIsValid(e){return o.T.shared().dialogsThemes.toSingle().pipe((0,i.vV)(e=>e.customThemeMaxSizeMb),(0,i.vV)(s=>e.size>=1024*s*1024?r.Q.failure("size"):e.type.startsWith("image")?r.Q.success(void 0):r.Q.failure("type")))}}b.shared=(0,n.G)(e=>new b(e))},77791(e,s,t){t.d(s,{L:()=>n});var r=t(15526),a=t(12640),i=t(42618);class n{constructor(e){this.userId=e;var s=(0,i.operatingSystem)();this.platform=["ios","android"].includes(s)?"mobile":"desktop"}logChatIconShown(e){a._.shared(this.userId).logEvent("chat-themes-icon-shown",{"attendee-id":e,platform:this.platform}).safeSubscribe()}logCatalogueShown(e){a._.shared(this.userId).logEvent("chat-themes-catalogue-shown",{"attendee-id":e,platform:this.platform}).safeSubscribe()}logCatalogueCloseIconClicked(e){a._.shared(this.userId).logEvent("chat-themes-catalogue-close-button-clicked",{"attendee-id":e,platform:this.platform}).safeSubscribe()}logThemeInstalled(e){var{attendeeId:s,price:t,reference:r,custom:i,type:n}=e;a._.shared(this.userId).logEvent("chat-theme-installed",{"attendee-id":s,platform:this.platform,reference:i?"custom":r,price:t,type:n}).safeSubscribe()}logChatBannerShown(e){a._.shared(this.userId).logEvent("chat-themes-banner-shown",{"attendee-id":e,platform:this.platform}).safeSubscribe()}logChatBannerCtaClicked(e){a._.shared(this.userId).logEvent("chat-themes-banner-cta-clicked",{"attendee-id":e,platform:this.platform}).safeSubscribe()}logChatBannerCloseIconClicked(e){a._.shared(this.userId).logEvent("chat-themes-banner-close-button-clicked",{"attendee-id":e,platform:this.platform}).safeSubscribe()}logFreeThemesBannerShown(e){a._.shared(this.userId).logEvent("chat-themes-vg-promo-banner-shown",{"attendee-id":e.attendeeId,cheerName:e.cheerN
3ame,theme:e.theme}).safeSubscribe()}logFreeThemesBannerClicked(e){a._.shared(this.userId).logEvent("chat-themes-vg-promo-banner-clicked",{"attendee-id":e.attendeeId,cheerName:e.cheerName,theme:e.theme}).safeSubscribe()}logTrialMessageShown(e){a._.shared(this.userId).logEvent("chat-theme-notification-installed-shown",{"attendee-id":e,platform:this.platform}).safeSubscribe()}logTrialMessageExtendClicked(e){a._.shared(this.userId).logEvent("chat-theme-extend-clicked",{"attendee-id":e.attendeeId,reference:e.reference,platform:this.platform}).safeSubscribe()}}n.shared=(0,r.G)(e=>new n(e))},88215(e,s,t){t.d(s,{xJ:()=>R});var r=t(89218),a=t(15526),i=t(17524),n=t(75841),d=t(34578),o=t(28138),u=t(15654),l=t(84190),c=t(53193),h=t(97983),p=t(36580),v=t(39971),m=t(91885),f=t(34157),b=t(4328),g=t(66382),I=t(94375),w=t(29109),S=t(22998),y=t(14321),A=t(79942),T=t(5666),x=t(32210),C=t(32194),F=t(55857),D=t(77252),k="dialogs-themes-promo-banner-offering",E="banner-last-shown-time",j=72*I.b.hour;class R extends r.D{constructor(e){super(),this.userId=e;var s=(0,i.z)([y.f.shared(this.userId).userIsFeaturedMember,x.u.shared(e).canOffer,C.T.shared().visible,F.hw.shared(e).offer.pipe((0,o.T)(e=>e),(0,u.F)()),D.J.shared(e).status.pipe((0,o.T)(e=>"idle"===e),(0,u.F)())]).pipe((0,l.n)(e=>{var[s,t,r,a,d]=e;return s||t||r||a||!d?(0,n.of)(!1):g.j.shared().chatAttendee.pipe((0,l.n)(e=>e?(0,i.z)([f.v.shared(this.userId).available(e),b.Q.shared(this.userId).theme(e).pipe((0,o.T)(e=>!!e))]).pipe((0,l.n)(s=>{var[t,r]=s;return!t||r?(0,n.of)(!1):(0,i.z)([T.j.shared().currentTime(),S.w.shared(k,this.userId).load(E)]).pipe((0,l.n)(s=>{var[t,r]=s;return r&&t-r<=j?(0,n.of)(!1):w.u.shared(this.userId).getActiveChatState(e).pipe((0,o.T)(s=>{if(!s||!s.isActive)return!1;var t=s.messagesStatus;return!(t.incomingMessagesCount+t.outgoingMessagesCount<10)&&e}),(0,c.Q)(this.offeringResult))}))})):(0,n.of)(!1)))}));this.canOffer=(0,d.h)(this.offeringResult.pipe((0,h.u)(!1)),s).pipe((0,u.F)(),(0,p.t)({refCount:!0,bufferSize:1}))}start(e){return this.offer.toSingle().pipe((0,A.Fg)(s=>s?v.v.just(m.Q.failure("offer-not-allowed")):T.j.shared().currentTime().pipe((0,A.Fg)(e=>S.w.shared(k,this.userId).store(E,e)),(0,A.AB)(m.Q.success(e)))))}}R.shared=(0,a.G)(e=>new R(e))},8343(e,s,t){t.d(s,{lU:()=>C});var r=t(89218),a=t(15526),i=t(75841),n=t(17524),d=t(91885),o=t(79942),u=t(84190),l=t(28138),c=t(53193),h=t(15654),p=t(36580),v=t(22998),m=t(66382),f=t(34157),b=t(4328),g=t(29109),I=t(13462),w=t(6176),S=t(70416),y=t(36946),A=t(84115),T="dialog-themes-button-tooltip-offering",x="offered";class C extends r.D{constructor(e){super([new w.I,new S.q({id:"dialog-themes-button-tooltip-"+e,priority:y.k.Medium})]),this.userId=e;var s=I.T.shared().dialogsThemesEnabled.pipe((0,u.n)(e=>e?m.j.shared().chatAttendee.pipe((0,u.n)(e=>e?v.w.shared(T,this.userId).load(x).asObservable().pipe((0,u.n)(s=>s?(0,i.of)(!1):(0,n.z)([f.v.shared(this.userId).available(e),b.Q.shared(this.userId).theme(e).pipe((0,l.T)(e=>!!e))]).pipe((0,u.n)(s=>{var[t,r]=s;return!t||r?(0,i.of)(!1):g.u.shared(this.userId).getActiveChatState(e).pipe((0,l.T)(e=>{if(!e||!e.isActive)return!1;var s=e.messagesStatus;return s.incomingMessagesCount+s.outgoingMessagesCount>=5}),(0,c.Q)(this.offeringResult))})))):(0,i.of)(!1))):(0,i.of)(!1)));this.canOffer=this.applyCanOfferPolicies(A.po.shared(this.userId).lastVisibleTime.pipe((0,l.T)(e=>null!==e),(0,u.n)(e=>
3e?(0,i.of)(!1):s))).pipe((0,h.F)(),(0,p.t)({bufferSize:1,refCount:!0}))}start(){return v.w.shared(T,this.userId).store(x,!0).pipe((0,o.AB)(d.Q.success({})))}}C.shared=(0,a.G)(e=>new C(e))},93496(e,s,t){t.d(s,{x:()=>w});var r=t(17524),a=t(75841),i=t(97156),n=t(28138),d=t(84190),o=t(15654),u=t(39971),l=t(79942),c=t(15526),h=t(50846),p=t(30495);class v extends h.Q{constructor(e){super("dialogs.topics.recommendation",e,s=>(0,p.p6)(p.jI.shared().dialogs.topics.get,e,s).pipe((0,l.vV)(e=>{var{data:s,xhr:t}=e;return{data:s.topics,ttl:0}})))}}v.shared=(0,c.G)(e=>new v(e));var m=t(13462),f=t(58731),b=t(16355),g="dialogs-topics-recommendation",I="chats-with-hidding-topics";class w{constructor(e){this.topicsRecommendationsShowingSubjects={},this.userId=e}enabled(e){return(0,r.z)([m.T.shared().chatTopicsRecommendationEnabled,b.q.shared().copilotAvailable(e)]).pipe((0,n.T)(e=>{var[s,t]=e;return s&&!t}))}topics(e){return this.enabled(e).pipe((0,d.n)(s=>s?v.shared(this.userId).data(e):(0,a.of)([]))).toSingle()}topicsRecommendationCanShown(e){return(0,r.z)([this.enabled(e),m.T.shared().chatTopicsRecommendation]).pipe((0,d.n)(s=>{var[t,r]=s;return t?f.y.shared(g,this.userId).load(I).asObservable().pipe((0,d.n)(s=>{if(!this.topicsRecommendationsShowingSubjects[e]){var t=r["default-hidden-by-actions-count"],a=!s||s.length<t&&!s.includes(e);this.topicsRecommendationsShowingSubjects[e]=new i.t(a)}return this.topicsRecommendationsShowingSubjects[e].asObservable()})):(0,a.of)(!1)}),(0,o.F)())}showTopicsRecommendation(e){return this.topicsRecommendationsShowingSubjects[e]?this.topicsRecommendationsShowingSubjects[e].next(!0):this.topicsRecommendationsShowingSubjects[e]=new i.t(!0),f.y.shared(g,this.userId).load(I).pipe((0,l.Fg)(s=>s&&s.includes(e)?f.y.shared(g,this.userId).store(I,s.filter(s=>s!==e)):u.v.just(void 0)))}hideTopicsRecommendation(e){return this.topicsRecommendationsShowingSubjects[e]?this.topicsRecommendationsShowingSubjects[e].next(!1):this.topicsRecommendationsShowingSubjects[e]=new i.t(!1),f.y.shared(g,this.userId).load(I).pipe((0,l.Fg)(s=>f.y.shared(g,this.userId).store(I,[...s||[],e])))}}w.shared=(0,c.G)(e=>new w(e))},44399(e,s,t){t.d(s,{Q:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logTopicsRecommendationRatingBannerShown(e){a._.shared(this.userId).logEvent("chat-topics-recommendations-rating-banner-shown",{userId:this.userId,attendeeId:e}).safeSubscribe()}logTopicsRecommendationsRatingBannerAccepted(e,s){a._.shared(this.userId).logEvent("chat-topics-recommendations-rating-banner-accepted",{userId:this.userId,attendeeId:e,selectedTopics:s}).safeSubscribe()}logTopicsRecommendationsRatingBannerDeclined(e){a._.shared(this.userId).logEvent("chat-topics-recommendations-rating-banner-declined",{userId:this.userId,attendeeId:e}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},52140(e,s,t){t.d(s,{R:()=>D});var r=t(15526),a=t(8733),i=t(39971),n=t(45482),d=t(89218),o=t(91885),u=t(79942),l=t(58731),c=t(75841),h=t(17524),p=t(84190),v=t(56177),m=t(28138),f=t(66382),b=t(93496),g=t(13462),I=t(29109),w="dialogs-topics-hint-offering",S="offered";class y extends d.D{constructor(e){super(),this.userId=e,this.canOffer=f.j.shared().chatAttendee.pipe((0,p.n)(s=>s?I.u.shared(e).activeChats.pipe((0,v.s)(1),(0,m.T)(e=>e.includes(s)?s:null)):(0,c.of)(null)),(0,p.n)(s=>s?b.x.shared(e).topics(s).asObservable():(0,c.of)([])),(0,p.n)(s=>s.length?(0,h.z)([g.T.shared().chatTopicsRecommendation,l.y.shared(w,e).load(S).asObservable()]).pipe((0,v.s)(1),(0,m.T)(e=>{var[s,t]=e;return!t||t<s["rating-popup-max-decline-count"]})):(0,c.of)(!1)))}start(){return i.v.just(o.Q.success({}))}reject(){return l.y.shared(w,this.userId).load(S).pipe((0,u.Fg)(e=>l.y.shared(w,this.userId).store(S,e?e+1:1)),(0,u.AB)(o.Q.success()))}}y.shared=(0,r.G)(e=>new y(e));var A=t(48830),T=t(79760),x=t(43751),C=t(92453),F=t(97983);
3class D{constructor(){this.ratedSubject=new a.B,this.rated=this.ratedSubject.asObservable()}rate(e){return n.Session.shared().userId.toSingle().pipe((0,u.Fg)(s=>s?y.shared(s).canOffer.toSingle().pipe((0,u.Fg)(e=>e?y.shared(s).startOffer().pipe((0,u.AB)(!0)):i.v.just(!1)),(0,u.Fg)(t=>{var r;return t&&e?(r=()=>{x.Y.shared().get(T.A).actions.close("dialogs-topics-recommendations-rating")},new A.c(t=>{x.Y.shared().get(T.A).actions.open("dialogs-topics-recommendations-rating",[{props:{attendeeId:e,onClose:()=>y.shared(s).rejectOffer().pipe((0,u.ex)(()=>{r(),t.next(o.Q.failure({reason:"canceled",attendeeId:e})),t.complete()})),onComplete:a=>y.shared(s).acceptOffer().pipe((0,u.ex)(()=>{r(),t.next(o.Q.success({ratedTopics:a,attendeeId:e})),t.complete()}))},disableManualClose:!0}])})).pipe((0,C.M)(e=>{this.ratedSubject.next(e)}),(0,F.u)(void 0)).toSingle():i.v.just(void 0)})):i.v.just(void 0)))}}D.shared=(0,r.G)(()=>new D)},15006(e,s,t){t.d(s,{T:()=>d});var r=t(15526),a=t(30495),i=t(79942);class n{constructor(e){this.userId=e}wink(e,s){return"call"===s?(0,a.Yq)(a.jI.shared().events.post,e,{label:"event.video-call.available",payload:{sender:this.userId,"recipient-id":e}}).pipe((0,i.AB)(void 0)):(0,a.Yq)(a.jI.shared().dialogs.winks.post,e,this.userId,s)}}n.shared=(0,r.G)(e=>new n(e));class d{constructor(e){this.userId=e}wink(e,s){return n.shared(this.userId).wink(e,s)}}d.shared=(0,r.G)(e=>new d(e))},80163(e,s,t){t.d(s,{e:()=>u});var r=t(15526),a=t(12640),i=t(45482),n=t(56177),d=t(84190),o=t(56607);class u{constructor(e){this.userId=e}logInviteReceived(e){i.Session.shared().userIsUsual.pipe((0,n.s)(1),(0,d.n)(s=>s?a._.shared(this.userId).logEvent("cross-invite-received",e):o.w)).safeSubscribe()}logInviteShown(e){i.Session.shared().userIsUsual.pipe((0,n.s)(1),(0,d.n)(s=>s?a._.shared(this.userId).logEvent("cross-invite-shown",e):o.w)).safeSubscribe()}logInviteToVideochatShown(e){i.Session.shared().userIsUsual.pipe((0,n.s)(1),(0,d.n)(s=>s?a._.shared(this.userId).logEvent("cross-invite-to-videochat-shown",e):o.w)).safeSubscribe()}logInviteInteracted(e){i.Session.shared().userIsUsual.pipe((0,n.s)(1),(0,d.n)(s=>s?a._.shared(this.userId).logEvent("cross-invite-interacted",e):o.w)).safeSubscribe()}logInviteToVideochatInteracted(e){i.Session.shared().userIsUsual.pipe((0,n.s)(1),(0,d.n)(s=>s?a._.shared(this.userId).logEvent("cross-invite-to-videochat-interacted",e):o.w)).safeSubscribe()}}u.shared=(0,r.G)(e=>new u(e))},37871(e,s,t){t.d(s,{W:()=>h,Z:()=>v});var r,a=t(15526),i=t(12640),n=t(45482),d=t(17951),o=t(17524),u=t
3(37418),l=t(56177),c=t(46822),h=((r={}).InvitationToVideoChat="invitation",r.VideoInvitation="invitation.video",r.Call="call",r.AudioCall="audio-call",r),p=[h.InvitationToVideoChat];class v{constructor(e){this.logInviteReceived=(e,s,t,r,a)=>{n.Session.shared().userIsUsual.pipe((0,l.s)(1)).safeSubscribe(n=>{var d={senderId:e,type:s};t&&(d.reference=t),r&&(d.recommended=r),a&&(d.freeMinuteLabel=a),n&&i._.shared(this.userId).logEvent("invite-to-videochat-received",d).safeSubscribe()})},this.logInviteShowed=(e,s,t,r,a,o,u,c)=>{n.Session.shared().userIsUsual.pipe((0,l.s)(1)).safeSubscribe(n=>{var l={senderId:e,type:s};t&&(l.reference=t),r&&(l.recommended=r),a&&(l.freeMinuteLabel=a),u&&(l.audioCallAutoStartAvailable=u),o&&(l.zodiacCompatibility=o),"invitation.video"===s&&d._.shared(this.userId).logUserAction({type:"videoinvitation.shown",data:{sender:e,recommended:!!r}}).safeSubscribe(),(s===h.AudioCall||n)&&i._.shared(this.userId).logEvent(c?"mingle-invite-to-videochat-showed":"invite-to-videochat-showed",l).safeSubscribe()}),!p.includes(s)&&t&&this.logToRCML(e,s,t,"view")},this.logInviteClicked=(e,s,t,r,a,d,o)=>{n.Session.shared().userIsUsual.pipe((0,l.s)(1)).safeSubscribe(n=>{var u={senderId:e,type:s};t&&(u.reference=t),r&&(u.recommended=r),a&&(u.freeMinuteLabel=a),d&&(u.zodiacCompatibility=d),(s===h.AudioCall||n)&&i._.shared(this.userId).logEvent(o?"mingle-invite-to-videochat-clicked":"invite-to-videochat-clicked",u).safeSubscribe()}),!p.includes(s)&&t&&this.logToRCML(e,s,t,"click")},this.logVideoLoadTime=(e,s,t,r)=>{i._.shared(this.userId).logEvent("invite-to-videochat-video-load-time",{senderId:e,type:s,reference:t,loadTime:r}).safeSubscribe()},this.userId=e}logToRCML(e,s,t,r){(0,o.z)([u.V.getCandidateInfo(e),c.c.shared().profileId.toSingle()]).safeSubscribe(a=>{var[i,n]=a,d=s===h.VideoInvitation?"video_invitation":"video_call";u.V.shared().logEvent(n?"profile":"home",r,d,{candidate_info:i,video_chat:{candidate_id:i.candidate_id,chat_id:this.userId+":"+e,video_invitation_id:t}})})}}v.shared=(0,a.G)(e=>new v(e))},45484(e,s,t){t.d(s,{K:()=>A});var r=t(15526),a=t(78675),i=t(26578),n=t(92453),d=t(84190),o=t(15654),u=t(36580),l=t(10629),c=t(28138),h=t(97156),p=t(48830),v=t(4126),m=t(75841),f=t(17524),b=t(63984),g=t(98153),I=t(34948),w=t(58731),S="sound-notifier",y="muted";class A{constructor(e){this.volume=new h.t(1),this.userId=e,this.audio=new Audio,this.muted=w.y.shared(S).load(y).asObservable().pipe((0,n.M)(e=>{g.A.emit("command.sound.mute.set",e?"on":"off")}),(0,d.n)(e=>new p.c(s=>{s.next(!!e);var t=e=>s.next("on"===e);return g.A.sync("command.sound.mute.set",t),()=>{g.A.removeListener("command.sound.mute.set",t)}})),(0,o.F)(),(0,u.t)(1))}start(e){e.add(this.muted.pipe((0,l.i)(1),(0,d.n)(e=>w.y.shared(S).store(y,e))).safeSubscribe())}play(e){return(0,v.v)(()=>{var s;switch(e.subType){case"base":s="invite";break;case"media":s="video";break;case"users-examined-wink":case"like-profile-wink":case"dialogs-video-intentions-wink":case"dialogs-contemplated-wink":case"users-online-wink":s="wink";break;case"call-wink":s="call-wink"}return this.muted.pipe((0,d.n)(t=>t?(0,m.of)(null):(0,f.z)([this.getRule(s),I.t.shared(this.userId).settings,this.volume,w.y.shared("",this.userId).load("muted-users-list")]).pipe((0,c.T)(s=>{var[t,r,a,i]=s;return!t||A.userIsMuted(e.attendeeId)||!Object.assign({},t.enabled||{},r)[e.type]?null:(this.audio.src="object"==typeof t.src&&t?t.src[e.type]||t.src.default:t.src,this.audio.volume=a,this.audio.play(),String((0,b.A)()))}))))})}static userIsMuted(e){var s=localStorage.getItem("__appdata");return Object.keys((s&&JSON.parse(s)||{})["blocked-sound"]||{}).includes(e)}getRule(e){return(0,v.v)(()=>{var s=a.T.shared().notifications.sounds[e];return s?i.t.shared().data.pipe((0,o.F)(),(0,c.T)(e=>{var t=s.filter(s=>!s.roles||s.roles.filter(s=>"!"===s[0]?-1===e.indexOf(s.slice(1)):-1!==e.indexOf(s)).length===s.roles.length)[0];return t||null})):(0,m.of)(null)})}}A.shared=(0,r.G)(e=>new A(e))},10143(e,s,t){t.d(s,{u:()=>_});var r=t(15526),a=t(97156),i=t(17524),n=t(75841),d=t(28138),o=t(15654),u=t(36580),l=t(84190),c=t(27585),h=t(53940),p=t(56177),v=t(97983),m=t(66382),f=t(97995),b=t(33702),g=t.n(b),I=t(34677),w=t(75e3),S=t(13462),y=t(1873),A=t(72915),T=t(49844),x=t(43751),C=t(94375),F=t(42618),D=t(47646),k=t(58731),E=t(79942),j=t(4938),R=t(46660),O=t(63184),M=t(67276),G=t(55952),B=t(77194),P="app-become-gone-time";class _{constructor(e){this.userId=e,this.persistence=k.y.shared("top-chat-invites",e),this.topInvitesState=new a.t([]),this.topInvites=(0,i.z)([this.topInvitesState,B.N.shared(this.userId).blockedUsers]).pipe((0,d.T)(e=>{var[s,t]=e;return s.filter(e=>!e.hidden&&!t.includes(e.invite.attendeeId))}),(0,d.T)(e=>e.map(e=>e.invite)),(0,o.F)((e,s)=>
3g()(e,s)),(0,u.t)(1))}start(e){this.topInvitesState.next([]);var s=M.M.shared(this.userId).state.pipe((0,d.T)(e=>"speaking"===e.status?e.participants[0]:void 0),(0,o.F)(),(0,l.n)(e=>e?G.K.shared(this.userId).id(e):(0,n.of)(void 0)));e.add(w.X.shared(this.userId).newInvite.pipe((0,c.E)(m.j.shared().chatAttendee,s,S.T.shared().videoInvites.invitesBarEnabled,A.d.shared().visible,S.T.shared().invitesInboxShowProbability,S.T.shared().messagesReactionsEnabled,y.d.shared().visible,S.T.shared().videoClips.pushInvitesEnabled),(0,h.p)(e=>{var[s,t,r,a,i,n,d,o,u]=e;return!(o&&u)}),(0,h.p)(e=>{var[s,t,r]=e;return t!==s.attendeeId&&r!==s.attendeeId}),(0,h.p)(e=>{var[s,t,r,a]=e;return s.message.type!==R.m$.VideoInvitation||a}),(0,h.p)(e=>{var[s,t,r,a,i,n,d]=e;return s.message.type!==I.Go.MessageReaction||d}),(0,l.n)(e=>{var[s,t,r,a,i,n]=e;return x.Y.shared().get(T.Ay,(0,T.OX)(this.userId,s.attendeeId)).store.rxState().pipe((0,p.s)(1),(0,h.p)(e=>{var t,{messages:r}=e;return!(null!=(t=r.find(e=>e.tag===s.message.tag))&&t.read)}),(0,v.u)([s,t,i,n]))})).safeSubscribe(e=>{var[s,t,r,a]=e,i=!1;r&&Math.random()>a&&(i=!0);var n=this.topInvitesState.getValue(),d=_.addInviteWithFilterDistinctSenderId(n,{invite:s,hidden:i});this.topInvitesState.next(d)}
3)),e.add(A.d.shared().visible.pipe((0,h.p)(e=>!e)).safeSubscribe(()=>{var e=this.topInvitesState.getValue().map(e=>({invite:e.invite,hidden:!1}));this.topInvitesState.next(e)})),e.add(m.j.shared().chatAttendee.safeSubscribe(e=>{e&&this.removeInvite(e)})),e.add(s.safeSubscribe(e=>{e&&this.removeInvite(e)})),e.add(f.v.shared().viewed.safeSubscribe(e=>{this.removeInvite(e.attendeeId)})),e.add(O.C.shared().visible.safeSubscribe(e=>{e&&this.removeInvite("concierge")}));var t="mobile"===(0,F.platform)(),r=D.r.shared().focusState.pipe((0,o.F)(),(0,d.T)(e=>"gone"===e));e.add(r.pipe((0,h.p)(e=>e),(0,l.n)(()=>j.E.shared().currentTime()),(0,l.n)(e=>this.persistence.store(P,e).pipe((0,E.AB)(e)))).safeSubscribe()),e.add(r.pipe((0,h.p)(e=>!e),(0,l.n)(()=>t?(0,i.z)([j.E.shared().currentTime(),this.persistence.load(P)]).pipe((0,d.T)(e=>{var[s,t]=e;return!!t&&s-t>5*C.b.minute})):(0,n.of)(!1))).safeSubscribe(e=>{this.persistence.store(P,null),e&&this.topInvitesState.next([])}))}removeInvite(e){var s=this.topInvitesState.getValue(),t=_.removeInviteByChatAttendee(s,e);this.topInvitesState.next(t)}static addInviteWithFilterDistinctSenderId(e,s){var t=e.filter(e=>e.invite.attendeeId!==s.invite.attendeeId);return t.unshift(s),t}static removeInviteByChatAttendee(e,s){return e.filter(e=>e.invite.attendeeId!==s)}}_.shared=(0,r.G)(e=>new _(e))},68592(e,s,t){t.d(s,{W:()=>r.W});var r=t(66684)},17388(e,s,t){t.d(s,{U:()=>h});var r=t(15526),a=t(75841),i=t(17524),n=t(13462),d=t(38883),o=t(84190),u=t(28138),l=t(15654),c=t(77252);class h{constructor(e){this.available=n.T.shared().mysteryGiftsEnabled.pipe((0,o.n)(s=>s?(0,i.z)([n.T.shared().mysteryGiftsGameRestrictedCountries,d.A.shared().location]).pipe((0,o.n)(s=>{var[t,r]=s;return r.country&&t.includes(r.country)?(0,a.of)(!1):c.J.shared(e).status.pipe((0,u.T)(e=>"idle"===e),(0,l.F)())})):(0,a.of)(!1)),(0,l.F)())}}h.shared=(0,r.G)(e=>new h(e))},72548(e,s,t){t.d(s,{En:()=>F});var r=t(89218),a=t(15526),i=t(43751),n=t(17524),d=t(75841),o=t(28138),u=t(15654),l=t(65052),c=t(84190),h=t(36580),p=t(66382),v=t(91885),m=t(79942),f=t(22998),b=t(4938),g=t(94375),I=t(84835),w=t(17388),S=t(32210),y=t(13462),A=t(55857),T=t(49844),x="mystery-gifts-credit-package-banner-offering",C="banner-shown";class F extends r.D{constructor(e){super(),this.userId=e;var s=e=>i.Y.shared().get(T.Ay,(0,T.OX)(this.userId,e)).store.rxState().pipe((0,o.T)(e=>e.messages.length),(0,u.F)());this.canOffer=(0,n.z)([this.offeringResult.pipe((0,l.Z)(!1)),p.j.shared().chatAttendee,y.T.shared().mysteryGiftsCreditPackageBannerEnabled]).pipe((0,c.n)(t=>{var[r,a,i]=t;return a&&i&&!r?(0,n.z)([S.u.shared(e).canOffer,I.i.shared(e).offer(a),A.hw.shared(e).offer,w.U.shared(e).available,y.T.shared().mysteryGiftsCreditPackageBannerVariant,s(a)]).pipe((0,c.n)(s=>{var[t,r,i,n,o,u]=s;return t||r||i||!n||"default"!==o&&u<15?(0,d.of)(!1):b.E.shared().currentTime().pipe((0,m.Fg)(s=>f.w.shared(x,e).load(C).pipe((0,m.vV)(e=>(!e||s-e>2*g.b.day)&&a)))).asObservable()})):(0,d.of)(!1)}),(0,u.F)(),(0,h.t)({refCount:!0,bufferSize:1}))}start(e){return b.E.shared().currentTime().pipe((0,m.Fg)(e=>f.w.shared(x,this.userId).store(C,e)),(0,m.AB)(v.Q.success({attendeeId:e})))}}F.shared=(0,a.G)(e=>new F(e))},15621(e,s,t){t.d(s,{a:()=>o});var r=t(15526),a=t(12640),i=t(95051),n=t(56177),d=t(84190);class o{constructor(e){this.userId=e,this.priceCategory=i.xn.shared(e).priceCategory}fabClicked(e){a._.shared(this.userId).logEvent("mystery-gift-fab-clicked",{userId:this.userId,attendeeId:e}).safeSubscribe()}startGameClicked(e){this.priceCategory.pipe((0,n.s)(1),(0,d.n)(s=>a._.shared(this.userId).logEvent("mystery-gift-game-start-clicked",{userId:this.userId,attendeeId:e,priceCategory:s,sessionId:i.xn.shared(this.userId).sessionId}))).safeSubscribe()}wonItemShown(e,s,t,r,o){this.priceCategory.pipe((0,n.s)(1),(0,d.n)(n=>a._.shared(this.userId).logEvent("mystery-gift-prize-shown",{userId:this.userId,attendeeId:e,giftType:s,prizeCategory:o,cheerName:t,cheerPrice:r,priceCategory:n,sessionId:i.xn.shared(this.userId).sessionId}))).safeSubscribe()}restartGameClicked(e){this.priceCategory.pipe((0,n.s)(1),(0,d.n)(s=>a._.shared(this.userId).logEvent("mystery-gift-game-restart-clicked",{userId:this.userId,attendeeId:e,priceCategory:s,sessionId:i.xn.shared(this.userId).sessionId}))).safeSubscribe()}longPlayAnswerTooltipShown(e){this.priceCategory.pipe((0,n.s)(1),(0,d.n)(s=>a._.shared(this.userId).logEvent("mystery-gift-long-play-answer-tooltip-shown",{userId:this.userId,attendeeId:e,priceCategory:s,sessionId:i.xn.shared(this.userId).sessionId}))).safeSubscribe()}longPlayAnswerTooltipClosed(e){this.priceCategory.pipe((0,n.s)(1),(0,d.n)(s=>a._.shared(this.userId).logEvent("mystery-gift-long-play-answer-tooltip-closed",{userId:this.userId,attendeeId:e,priceCategory:s,sessionId:i.xn.shared(this.userId).sessionId}))).safeSubscribe()}logGameInterrupted(e){this.priceCategory.pipe((0,n.s)(1),(0,d.n)(s=>a._.shared(this.userId).logEvent("mystery-gift-game-interrupted",{userId:this.userId,attendeeId:e,priceCategory:s,sessionId:i.xn.shared(this.userId).sessionId}))).safeSubscribe()}logCreditPackageBannerShown(e){a._.shared(this.userId).logEvent("mystery-gift-credit-banner-shown",{userId:this.userId,attendeeId:e}).safeSubscribe()}logCreditPackageBannerPostponed(e){a._.shared(this.userId).logEvent("mystery-gift-credit-banner-postponed",{userId:this.userId,attendeeId:e}).safeSubscribe()}logCreditPackageBannerAccepted(e){a._.shared(this.userId).logEvent("mystery-gift-credit-banner-accepted",{userId:this.userId,attendeeId:e}).safeSubscribe()}logCreditPackageBannerRejected(e){a._.shared(this.userId).logEvent("mystery-gift-credit-banner-rejected",{userId:this.userId,attendeeId:e}).safeSubscribe()}logPromoBannerShown(e){a._.shared(this.userId).logEvent("mystery-gifts-promo-window-shown",{userId:this.userId,attendeeId:e}).safeSubscribe()}logPromoBannerInteracted(e,s){a._.shared(this.userId).logEvent("mystery-gifts-promo-window-interacted",{userId:this.userId,attendeeId:e,cta:s}).safeSubscribe()}}o.shared=(0,r.G)(e=>new o(e))},95051(e,s,t){t.d(s,{P5:()=>O,xn:()=>P});var r=t(30495),a=t(50846),i=t(15526),n=t(50042),d=t(79942),o=t(39971),u=t(91885),l=Number.MAX_SAFE_INTEGER;class c extends a.Q{constructor(e){super("mystery-gifts",e,()=>(0,r.p6)(r.jI.shared().mysterygifts.get,e).pipe((0,d.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t.mysterygifts,ttl:(null==(s=(0,n.a)(r))?void 0:s.maxAge)||l}}),(0,d.ZC)(()=>o.v.just({data:[],ttl:0})))),this.userId=e}play(e,s,t){return(0,r.p6)(r.jI.shared().mysterygifts.play.post,this.userId,{recipientId:e,priceCategory:s,sessionId:t},{}).pipe((0,d.vV)(e=>{var{data:s}=e;return u.Q.success(s)}),(0,d.ZC)(e=>402===e.status?o.v.just(u.Q.failure("insufficient-balance")):o.v.error(e)))}}c.shared=(0,i.G)(e=>new c(e));var h=t(8733),p=t(97156),v=t(17524),m=t(75841),f=t(34578),b=t(56823),g=t(40961),I=t(27888),w=t(15654),S=t(56177),y=t(28138),A=t(84190),T=t(92453),x=t(97983),C=t(53193),F=t(53940),D=t(16220),k=t(59562),E=t(13462),j=t(94375),R=t(52850),O=12,M=j.b.second*O,G=3*j.b.second,B="golden";
3class P{constructor(e){this.playGameFinishedSubject=new h.B,this.userId=e,this.wonItemSubject=new p.t(void 0),this.wonItem=this.wonItemSubject.asObservable(),this.carouselItemsSubject=new p.t([]),this.carouselItems=this.carouselItemsSubject.asObservable(),this.longPlayAnswerSubject=new p.t(!1),this.currentSessionId="",this.currentAttendeeId="",this.longPlayAnswer=this.longPlayAnswerSubject.asObservable(),this.priceCategorySubject=new p.t(B),this.priceCategory=this.priceCategorySubject.asObservable(),this.mysteryGiftIsPlayingSubject=new p.t(!1),this.mysteryGiftIsPlaying=this.mysteryGiftIsPlayingSubject.asObservable().pipe((0,w.F)()),this.currencyDevaluationRatio=E.T.shared().currencyDevaluationRatio.pipe((0,S.s)(1),(0,y.T)(e=>100/e))}mapPriceCategoryToPaymentReason(e){switch(e){case"golden":return I.N.GoldenMysteryGift;case"brilliant":return I.N.BrilliantMysteryGift}}convertPrice(e,s){return"credits"===e.settings.price.type?Object.assign({},e,{settings:Object.assign({},e.settings,{price:Object.assign({},e.settings.price,{value:e.settings.price.value/s})})}):e}gifts(){return(0,v.z)([c.shared(this.userId).data(),this.currencyDevaluationRatio]).pipe((0,y.T)(e=>{var[s,t]=e;return s.map(e=>{var s=[],r=this.convertPrice(e.prizes[0],t),a=this.convertPrice(e.prizes[0],t);e.prizes.forEach(e=>{var i=this.convertPrice(e,t);s.push(i);var n=i.settings.price.value;r=n<r.settings.price.value?i:r,a=n>a.settings.price.value?i:a});var i="credits"===e.price.type?{type:"credits",value:e.price.value/t}:e.price;return Object.assign({},e,{price:i,prizes:s,minPrize:r,maxPrize:a})})}))}giftPrice(){return(0,v.z)([this.gifts(),this.priceCategory]).pipe((0,y.T)(e=>{var[s,t]=e,r=s.filter(e=>e.priceCategory===t)[0];return null==r?void 0:r.price.value}))}setPriceCategory(e){this.priceCategorySubject.next(e)}initGame(e){this.priceCategorySubject.next(B),this.wonItemSubject.next(void 0),this.currentSessionId=(0,k.A)(),this.currentAttendeeId=e}get sessionId(){return this.currentSessionId}get attendeeId(){return this.currentAttendeeId}play(){return this.giftPrice().pipe((0,A.n)(e=>(this.mysteryGiftIsPlayingSubject.next(!0),g.J.shared().refillBalance({name:this.mapPriceCategoryToPaymentReason(this.priceCategorySubject.getValue()),requiredAmount:e,attendeeId:this.currentAttendeeId}))),(0,A.n)(e=>{if(!e.isSuccessful)return this.mysteryGiftIsPlayingSubject.next(!1),(0,m.of)(u.Q.failure("insufficient-balance"));var s=this.priceCategorySubject.getValue(),t=c.shared(this.userId).play(this.currentAttendeeId,s,this.currentSessionId).asObservable(),r=this.gifts().pipe((0,y.T)(e=>e.filter(e=>e.priceCategory===s)[0].prizes));return(0,f.h)((0,v.z)([r,t]).pipe((0,S.s)(1),(0,A.n)(e=>{var[s,t]=e;return t.isSuccessful?this.getCarouselItems({wonItem:t.value,availablePrizes:s}).pipe((0,T.M)(e=>{this.carouselItemsSubject.next(e),this.wonItemSubject.next(e[147]),this.startUnlockingProcess()}),(0,x.u)(u.Q.success())):(this.mysteryGiftIsPlayingSubject.next(!1),(0,m.of)(u.Q.failure("insufficient-balance")))})),(0,b.O)(G).pipe((0,T.M)(()=>this.longPlayAnswerSubject.next(!0)),(0,x.u)(void 0),(0,C.Q)(this.playGameFinishedSubject))).pipe((0,F.p)(e=>!!e))}),(0,T.M)(()=>this.playGameFinishedSubject.next()),(0,D.j)(()=>{this.longPlayAnswerSubject.next(!1)})).toSingle()}startUnlockingProcess(){this.mysteryGiftIsPlayingSubject.next(!0),(0,b.O)(M).safeSubscribe(()=>{this.mysteryGiftIsPlayingSubject.next(!1)})}getCarouselItems(e){var{wonItem:s,availablePrizes:t}=e,r=t;if(r.length)for(;r.length<150;)r=r.concat(r);return r=(0,R.Z)(r.slice(0,150),150),(0,m.of)(r).pipe((0,A.n)(e=>this.currencyDevaluationRatio.pipe((0,y.T)(t=>[...e.slice(0,147),this.convertPrice(s,t),...e.slice(147)]))),(0,y.T)(e=>e.map(e=>Object.assign({},e,{id:(0,k.A)()}))))}}P.shared=(0,i.G)(e=>new P(e))},38284(e,s,t){t.d(s,{S_:()=>k});var r=t(89218),a=t(15526),i=t(91885),n=t(17524),d=t(75841),o=t(22998),u=t(66382),l=t(65052),c=t(84190),h=t(28138),p=t(15654),v=t(36580),m=t(79942),f=t(94375),b=t(33702),g=t.n(b),I=t(84835),w=t(32210),S=t(4938),y=t(17388),A=t(13462),T=t(95051),x=t(24387),C="mystery-gifts-promo-banner-offering",F="banner-shown-stats",D=30*f.b.day;class k extends r.D{constructor(e){super(),this.userId=e,this.canOffer=(0,n.z)([this.offeringResult.pipe((0,l.Z)(!1)),u.j.shared().chatAttendee,A.T.shared().mysteryGiftsPromoBannerEnabled,x.q.shared().isFirstChatOpenedInSession]).pipe((0,c.n)(s=>{var[t,r,a,i]=s;return t||!r||!a||i?(0,d.of)(!1):y.U.shared(e).available.pipe((0,c.n)(s=>s?S.E.shared().currentTime().pipe((0,m.Fg)(e=>o.w.shared(C,this.userId).load(F).pipe((0,m.vV)(s=>!s||e-s.lastShownTime>2*f.b.day&&(e-s.periodStartTime>D||s.count<3))))).asObservable().pipe((0,c.n)(s=>s?(0,n.z)([I.i.shared(e).offer(r),w.u.shared(e).canOffer]).pipe((0,c.n)(e=>{var[s,t]=e;return s||t?(0,d.of)(!1):(0,n.z)([T.xn.shared(this.userId).giftPrice(),T.xn.shared(this.userId).priceCategory]).pipe((0,h.T)(e=>{var[s,t]=e;return{price:s,category:t,attendeeId:r}}))})):(0,d.of)(!1))):(0,d.of)(!1)))}),(0,p.F)(g()),(0,v.t)({refCount:!0,bufferSize:1}))}start(e){return S.E.shared().currentTime().pipe((0,m.Fg)(s=>this.updateBannerShownStats(D,s).pipe((0,m.AB)(i.Q.success(e)))))}updateBannerShownStats(e,s){return o.w.shared(C,this.userId).update(F,t=>!t||s-t.periodStartTime>e?{count:1,periodStartTime:s,lastShownTime:s}
3:{count:t.count+1,periodStartTime:t.periodStartTime,lastShownTime:s})}}k.shared=(0,a.G)(e=>new k(e))},91317(e,s,t){t.d(s,{P:()=>b});var r=t(15526),a=t(17524),i=t(75841),n=t(59113),d=t(14321),o=t(15654),u=t(36580),l=t(28138),c=t(56177),h=t(84190),p=t(33702),v=t.n(p),m=t(61585),f={"offline-message-fromnonfavorite":"offlineMessageFromNonFavorite","offline-message-fromfavorite":"offlineMessageFromFavorite","letter-fromnonfavorite":"letterFromNonFavorite","letter-fromfavorite":"letterFromFavorite","birthday-credits":"birthdayCredits","messages-digest":"messagesDigest","membership-confirmation":"membershipConfirmation","membership-renewal":"membershipRenewal","get-membership":"getMembership","get-membership-final":"getMembershipFinal","get-membership-medium":"getMembershipMedium","get-membership-low":"getMembershipLow"};class b{constructor(e){this.userId=e,this.data=m.y.shared(e).data("electronicmail").pipe((0,o.F)(v()),(0,u.t)(1)),this.settings=this.data.pipe((0,l.T)(e=>Object.keys(e).reduce((s,t)=>{var r=f[t];return r?Object.assign({},s,{[r]:!!e[t]}):s},{}))),this.available=(0,a.z)([n.G.shared(e).emailConfirmed,d.f.shared(e).userIsFeaturedMember]).pipe((0,l.T)(e=>{var[s,t]=e;return!t&&s}),(0,o.F)(),(0,u.t)({bufferSize:1,refCount:!0}))}update(e){return this.data.pipe((0,c.s)(1),(0,l.T)(s=>{var t=Object.values(e).every(e=>!e),r=Object.keys(s),a=Object.keys(e);return[r.reduce((s,r)=>{var i=f[r],n=e[i];return Object.assign({},s,{[r]:a.includes(i)?Number(n):Number(!t)})},{}),s]}),(0,h.n)(e=>{var[s,t]=e;return v()(s,t)?(0,i.of)(void 0):m.y.shared(this.userId).patch("electronicmail",s)}))}subscribeAll(){return m.y.shared(this.userId).patch("electronicmail",{"*":1})}unsubscribeAll(){return m.y.shared(this.userId).patch("electronicmail",{"*":0})}}b.shared=(0,r.G)(e=>new b(e))},58924(e,s,t){t.d(s,{k:()=>S});var r=t(17524),a=t(34578),i=t(82019),n=t(28138),d=t(84190),o=t(15654),u=t(36580),l=t(15526),c=t(91317),h=t(89218),p=t(39971),v=t(91885),m=t(58731),f=t(94375),b=t(79942),g="email-notifications-switch-on-offering",I="skipped-offer-counter",w="last-offer-timestamp";class S extends h.D{constructor(e){super(),this.userId=e;var s=m.y.shared(g,e),t=s.load(w),l=s.load(I),h=(0,r.z)([t.asObservable(),l.asObservable()]),p=(0,a.h)(this.offeringResult.pipe((0,i.K)(h)),h);this.canOffer=(0,r.z)([c.P.shared(e).available,c.P.shared(e).settings]).pipe((0,n.T)(e=>{var[s,t]=e;return s&&!t.offlineMessageFromNonFavorite&&!t.offlineMessageFromFavorite&&!t.letterFromNonFavorite&&!t.letterFromFavorite}),(0,d.n)(e=>p.pipe((0,n.T)(s=>{var[t,r]=s;if(!e)return!1;if(!r||!t)return e;var a=Date.now()-t;return 1===r&&!!(a>f.b.day)||2===r&&!!(a>f.b.week)||3===r&&!!(a>2*f.b.week)||!!(a>30*f.b.day)}))),(0,o.F)(),(0,u.t)({bufferSize:1,refCount:!0}))}start(){return p.v.just(v.Q.success({}))}accept(e){return p.v.just(v.Q.success())}reject(e){return p.v.just(v.Q.success())}postpone(e){var s=m.y.shared(g,this.userId);return s.load(I).pipe((0,b.Fg)(e=>p.v.zip(s.store(I,(null!=e?e:0)+1),s.store(w,Date.now()))),(0,b.AB)(v.Q.success()))}}S.shared=(0,l.G)(e=>new S(e))},42475(e,s,t){t.d(s,{Nz:()=>w});var r=t(17524),a=t(75841),i=t(84190),n=t(28138),d=t(15654),o=t(89218),u=t(15526),l=t(39971),c=t(91885),h=t(13462),p=t(22081),v=t(22998),m=t(79942),f=t(77252),b=t(9150),g="credits-mall-extra10",I="credits-mall-extra10";class w extends o.D{constructor(e){super(),this.userId=e,this.canOffer=h.T.shared().firstPurchaseBonusEnabled.pipe((0,i.n)(e=>e?(0,r.z)([f.J.shared(this.userId).status,b.s.shared().visible,this.getShowCount()]).pipe((0,n.T)(e=>{var[s,t,r]=e;return!("idle"!==s||t)&&r<2})):(0,a.of)(!1)),(0,d.F)())}getShowCount(){return v.w.shared(g,this.userId).load(I).pipe((0,m.vV)(e=>null!=e?e:0))}start(){return this.offer.toSingle().pipe((0,m.Fg)(e=>e?l.v.just(c.Q.failure("offer-not-allowed")):v.w.shared(g,this.userId).update(I,e=>(null!=e?e:0)+1).pipe((0,m.vV)(e=>c.Q.success({showCount:e})))))}accept(){return p.x.shared(this.userId).setTagEnabled("credits.mall.extra10",!1).pipe((0,m.vV)(()=>c.Q.success()))}}w.shared=(0,u.G)(e=>new w(e))},57043(e,s,t){t.d(s,{w:()=>u});var r=t(15526),a=t(39971),i=t(79942),n=t(8733),d=t(40961),o=t(14316);
3class u{constructor(){this.requestSubject=new n.B}start(e){e.add(this.requestSubject.pipe((0,o.Z)(e=>d.J.shared().refillBalance(e.reason,e.mode))).safeSubscribe())}add(e,s){return a.v.just().pipe((0,i.ex)(()=>this.requestSubject.next({reason:e,mode:s})))}}u.shared=(0,r.G)(()=>new u)},662(e,s,t){t.d(s,{q:()=>c});var r=t(15526),a=t(53940),i=t(92453),n=t(47653),d=t(13462),o=t(37306),u=t(96899),l=t(36790);class c{constructor(e){this.userId=e}start(e){e.add(d.T.shared().moto.pipe((0,a.p)(e=>"string"==typeof e.merchantId||"number"==typeof e.merchantId),(0,i.M)(e=>{var{hosts:s,merchantId:t,countryTaxIp:r}=e;o.L.shared(this.userId).setMerchantId(t),o.L.shared(this.userId).setApiScheme(s.processing),n.q.shared(this.userId).setMerchantId(t),n.q.shared(this.userId).setApiScheme(s.profiles),u.w.shared().setApiScheme(s.taxservice),u.w.shared().setHeader(r?{ipAddress:r}:{}),l.Y.shared().setApiScheme(s.taxservice)})).safeSubscribe())}}c.shared=(0,r.G)(e=>new c(e))},7071(e,s,t){t.d(s,{_:()=>n});var r=t(43751),a=t(79760),i=t(50636),n=(e,s)=>{r.Y.shared().get(a.A).actions.open("overlay-subscription-cancelling",[{props:{cancelled:s}}]),e&&i.W.shared(e).logCancellationSubscriptionStarted()}},3226(e,s,t){t.d(s,{S:()=>r});var r=e=>{var s=new Date(0),t=e.fragments.map(e=>{var t=new Date(e.created);return t.getTime()>s.getTime()&&(s=t),{basename:e.basename,mediaType:e.mediatype,creationTime:t}});return{userId:e.id,bookmark:e.bookmark,lastUpdateTime:s,fragments:t}}},25628(e,s,t){t.d(s,{x:()=>d});var r=t(28138),a=t(15526),i=t(16824),n=t(3226);class d{constructor(e){this.userId=e,this.story=i.a.shared(e).data().pipe((0,r.T)(e=>(0,n.S)(e)),(0,r.T)(e=>e&&e.fragments.length>0?e:null))}uploadFragment(e){return i.a.shared(this.userId).uploadFragment(e)}deleteFragment(e){return i.a.shared(this.userId).deleteFragment(e)}markFragmentViewed(e){return i.a.shared(this.userId).markFragmentViewed(e)}activeFragmentUploadFor(e){return i.a.shared(this.userId).activeFragmentUploadFor(e)}cancelFragmentUpload(e){return i.a.shared(this.userId).cancelFragmentUpload(e)}}d.shared=(0,a.G)(e=>new d(e))},46211(e,s,t){t.d(s,{Q:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logUserAccountDeleted(e){return a._.shared(this.userId).logEvent("user-profile-deleted",{"user-id":this.userId,reason:e.reason,type:e.type}).toSingle()}logUserAccountDeletionInitiated(){a._.shared(this.userId).logEvent("user-profile-deletion-started",{}).safeSubscribe()}deleteProfileClicked(){a._.shared(this.userId).logEvent("delete-profile-clicked",{}).safeSubscribe()}hideFromSearchClicked(){a._.shared(this.userId).logEvent("hide-from-search-clicked",{}).safeSubscribe()}pauseInvitesClicked(){a._.shared(this.userId).logEvent("pause-invites-clicked",{}).safeSubscribe()}hideProfileClicked(){a._.shared(this.userId).logEvent("hide-profile-clicked",{}).safeSubscribe()}confirmClicked(e){a._.shared(this.userId).logEvent("confirm-clicked",{option:e}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},36819(e,s,t){t.d(s,{x:()=>E});var r=t(8733),a=t(17524),i=t(75841),n=t(64733),d=t(56177),o=t(28138),u=t(15654),l=t(36580),c=t(84190),h=t(92453),p=t(97983),v=t(15526),m=t(30495);class f{constructor(e){this.userId=e}sendDeleteUserRequest(e){return(0,m.br)(m.jI.shared().notifications.remastered.support["delete-user-request"].put,this.userId,{reason:e,timestamp:Date.now()})}}f.shared=(0,v.G)(e=>new f(e));var b=t(75693),g=t(91654),I=t(42897),w=t(91885),S=t(13462),y=t(79942),A=t(39971),T=t(69948),x=t(22998),C=t(47802),F=t(22081);class D{constructor(e){this.userId=e}deleteProfile(e){return(0,m.Yq)(m.jI.shared().users["gdpr-deletion"].put,this.userId,{email:e}).pipe((0,y.vV)(()=>w.Q.success()),(0,y.W_)(w.Q.failure("failure")))}restoreProfile(e){return(0,m.Yq)(m.jI.shared().users["gdpr-deletion"].delete,this.userId,{email:e}).pipe((0,y.vV)(()=>w.Q.success()),(0,y.W_)(w.Q.failure("failure")))}}D.shared=(0,v.G)(e=>new D(e));var k=t(60308);
3class E{constructor(e){this.userId=e,this.deletedSubject=new r.B,this.deleted=this.deletedSubject.asObservable(),this.persistence=x.w.shared("user-account",e),this.deletingRequestProcessing=(0,a.z)([this.persistence.load("delete-request-time"),S.T.shared().customerSupport.maxDeletingAccountRequestProcessingTime]).pipe((0,d.s)(1),(0,o.T)(e=>{var[s,t]=e;return"number"==typeof s&&new Date().getTime()-s<t})),this.declineIsAvailable=F.x.shared(e).tags.pipe((0,o.T)(e=>e.includes("users.prepromoter")&&e.includes("unapproved")&&!e.includes("declined")),(0,u.F)(),(0,l.t)({refCount:!0,bufferSize:1})),this.deleteProfileIsAvailable=F.x.shared(e).tags.pipe((0,o.T)(e=>{var s=e.includes("users.suspended"),t=e.includes("suspended.gdpr")&&!e.includes("suspended.gdpr.graceperiod");return!s&&!t}),(0,u.F)(),(0,l.t)({refCount:!0,bufferSize:1})),this.deleteGDPRIsAvailable=F.x.shared(e).tags.pipe((0,o.T)(e=>!e.includes("suspended.gdpr")),(0,u.F)(),(0,l.t)({refCount:!0,bufferSize:1})),this.restoreIsAvailable=F.x.shared(e).tags.pipe((0,o.T)(e=>e.includes("users.suspended")&&(!e.includes("suspended.gdpr")||e.includes("suspended.gdpr.graceperiod"))),(0,u.F)(),(0,l.t)({refCount:!0,bufferSize:1}))}delete(e,s){var t,r=null!=(t=null==s?void 0:s.alreadyLogged)&&t;return g.e.shared(this.userId).hasConfirmedPurchases.pipe((0,d.s)(1),(0,c.n)(s=>{if(s)return this.deletingRequestProcessing.pipe((0,d.s)(1),(0,c.n)(s=>s?(0,i.of)(w.Q.failure("request-already-exists")):f.shared(this.userId).sendDeleteUserRequest(e).pipe((0,c.n)(()=>this.persistence.store("delete-request-time",new Date().getTime()).pipe((0,y.AB)(w.Q.success()))),(0,h.M)(()=>{(0,I.Y)(),this.deletedSubject.next({reason:e,type:"csd_request",alreadyLogged:r})}))));var t=C.a.shared().clearCredentials().pipe((0,y.W_)(void 0));return(0,n.y)(T.X.shared(this.userId).removePushToken().pipe((0,y.W_)(void 0)),T.X.shared(this.userId).removeVoipToken().pipe((0,y.W_)(void 0)),t).pipe((0,c.n)(()=>b.s.shared(this.userId).addRole("suspended").asObservable().pipe((0,h.M)(()=>this.deletedSubject.next({reason:e,type:"suspending",alreadyLogged:r})),(0,p.u)(w.Q.success()))))}))}deleteProfile(e,s){return b.s.shared(this.userId).addSuspendRole(e,s).pipe((0,y.Zl)(()=>F.x.shared(this.userId).refreshTags()))}deleteGDPR(e){return D.shared(this.userId).deleteProfile(e).pipe((0,y.Zl)(()=>F.x.shared(this.userId).refreshTags()))}restoreProfile(e){return F.x.shared(this.userId).tags.toSingle().pipe((0,y.Fg)(s=>{if(s.includes("suspended.gdpr")){var t=null==e?void 0:e.trim();return t?(0,k.td)(t)?D.shared(this.userId).restoreProfile(t):A.v.just(w.Q.failure("validation-email-format")):A.v.just(w.Q.failure("validation-email-empty"))}return b.s.shared(this.userId).deleteRole("suspended").pipe((0,y.vV)(()=>w.Q.success()),(0,y.W_)(w.Q.failure("failure")))}),(0,y.Zl)(()=>F.x.shared(this.userId).refreshTags()))}}E.shared=(0,v.G)(e=>new E(e))},38687(e,s,t){t.d(s,{W:()=>i});var r=t(39971),a=t(98153),i=e=>r.v.defer(()=>(a.A.emit("overlay","overlay-account-break-manager"),r.v.just()))},84174(e,s,t){t.d(s,{bd:()=>y});var r=t(15526),a=t(89218),i=t(39971),n=t(8733),d=t(56823),o=t(75841),u=t(34578),l=t(17524),c=t(84190),h=t(97983),p=t(53940),v=t(15654),m=t(36580),f=t(13462),b=t(91885),g=t(6367),I=t(58731),w=t(79942),S="date";class y extends a.D{constructor(e){super(),this.userId=e,this.persistence=I.y.shared("phone-number-verification-banner-offering",this.userId),this.lastRawOfferRefreshSubject=new n.B;var s=g.v.shared(e).unconfirmedPhoneNumber,t=this.persistence.load(S).asObservable().pipe((0,c.n)(e=>{var s=[this.lastRawOfferRefreshSubject.pipe((0,h.u)(!1)),this.offeringResult.pipe((0,p.p)(e=>"postponed"===e.result),(0,c.n)(()=>f.T.shared().phoneVerification.bannerReappearanceTime),(0,c.n)(e=>(0,d.O)(e)),(0,h.u)(!0))];if(e){var t=new Date().valueOf()-new Date(e).valueOf();s.push((0,o.of)(t>=0)),t<0&&s.push((0,d.O)(t).pipe((0,h.u)(!0)))}else s.push((0,o.of)(!1));return(0,u.h)(...s)}));this.canOffer=(0,l.z)([f.T.shared().phoneVerification.enabled,s]).pipe((0,c.n)(e=>{var[s,r]=e;return s&&r?t:(0,o.of)(!1)}),(0,v.F)(),(0,m.t)(1))}start(){return i.v.just(b.Q.success({}))}accept(){return this.persistence.clear(S).pipe((0,w.ex)(()=>this.lastRawOfferRefreshSubject.next()),(0,w.AB)(b.Q.success()))}reject(){return this.persistence.clear(S).pipe((0,w.ex)(()=>this.lastRawOfferRefreshSubject.next()),(0,w.AB)(b.Q.success()))}postpone(){return f.T.shared().phoneVerification.bannerReappearanceTime.toSingle().pipe((0,w.Fg)(e=>{var s=new Date().valueOf()+e;return this.persistence.store(S,new Date(s).toISOString())}),(0,w.ex)(()=>this.lastRawOfferRefreshSubject.next()),(0,w.AB)(b.Q.success()))}}y.shared=(0,r.G)(e=>new y(e))},97697(e,s,t){t.d(s,{L:()=>g});var r=t(15526),a=t(34578),i=t(75841),n=t(89218),d=t(39971),o=t(91885),u=t(6367),l=t(13462),c=t(53940),h=t(28138),p=t(97983),v=t(84190),m=t(65052),f=t(15654),b=t(36580);class g extends n.D{constructor(e){super();var s=u.v.shared(e).phoneNumberAdded.pipe((0,c.p)(e=>["settings","banner","secure-account"].includes(e.source)),(0,h.T)(e=>e.source)),t=this.offeringResult.pipe((0,c.p)(e=>!!e),(0,p.u)(!1));this.canOffer=l.T.shared().phoneVerification.enabled.pipe((0,v.n)(e=>e?(0,a.h)(s,t).pipe((0,m.Z)(!1)):(0,i.of)(!1)),(0,f.F)(),(0,b.t)(1))}start(e){return d.v.just(o.Q.success({source:e}))}}g.shared=(0,r.G)(e=>new g(e))},79755(e,s,t){t.d(s,{s:()=>u});
3var r=t(15526),a=t(17951),i=t(14321),n=t(79942),d=t(39971),o=t(13462);class u{constructor(e){this.userId=e}logAction(e){i.f.shared(this.userId).userIsFeaturedMember.toSingle().pipe((0,n.Fg)(s=>s?d.v.just():a._.shared(this.userId).logUserAction(e))).safeSubscribe()}logExaminedAction(e){this.logAction({type:"users.examined",data:e})}logInteractionAction(e){this.logAction({type:"users.interaction",data:e})}logRegistrationFinishedAction(){this.logAction({type:"registration.finished",data:{}})}logInvitesClickedAction(){o.T.shared().invitesClickCounterEnabled.toSingle().safeSubscribe(e=>{e&&this.logAction({type:"invites.clicked",data:{}})})}}u.shared=(0,r.G)(e=>new u(e))},147(e,s,t){t.d(s,{n:()=>b});var r=t(91885),a=t(39971),i=t(15526),n=t(34578),d=t(75841),o=t(53940),u=t(97983),l=t(65052),c=t(15654),h=t(84190),p=t(36580),v=t(13462),m=t(89218),f=t(86977);class b extends m.D{constructor(e){super();var s=f.I.shared(e).events("event.users.tags.set").pipe((0,o.p)(s=>s["user-id"]===e&&"credits.accounts.birthday"===s.tag),(0,u.u)(!0),(0,l.Z)(!1),(0,c.F)());this.canOffer=v.T.shared().birthdayCreditsEnabled.pipe((0,h.n)(e=>e?(0,n.h)(s,this.offeringResult.pipe((0,u.u)(!1))):(0,d.of)(!1)),(0,c.F)(),(0,p.t)(1))}start(){return a.v.just(r.Q.success({}))}}b.shared=(0,i.G)(e=>new b(e))},42044(e,s,t){t.d(s,{s:()=>i});var r=t(15526),a=t(97156);class i{constructor(){this.visibleSubject=new a.t(!1),this.visible=this.visibleSubject.asObservable()}setVisible(e){this.visibleSubject.next(e)}}i.shared=(0,r.G)(()=>new i)},91063(e,s,t){t.d(s,{Q:()=>j});var r=t(15526),a=t(89218),i=t(91885),n=t(39971),d=t(8733),o=t(17524),u=t
3(75841),l=t(34578),c=t(4126),h=t(13462),p=t(86977),v=t(86013),m=t(43751),f=t(10845),b=t(67276),g=t(66382),I=t(65052),w=t(84190),S=t(28138),y=t(15654),A=t(36580),T=t(50626),x=t(37719),C=t(56177),F=t(53193),D=t(53940),k=t(79942),E=t(55857);class j extends a.D{constructor(e){super(),this.shouldOfferCache={},this.userId=e,this.skipOfferForAttendee=new d.B;var s=(0,o.z)([this.offeringResult.pipe((0,I.Z)(!1)),g.j.shared().chatAttendee,g.j.shared().tab]).pipe((0,w.n)(e=>{var[s,t,r]=e;return!t||s||"chat"!==r?(0,u.of)(!1):this.shouldOfferToAddAttendeeToFavorites(t)}));this.canOffer=(0,l.h)(s,this.offeringResult.pipe((0,S.T)(()=>!1))).pipe((0,I.Z)(!1),(0,y.F)(),(0,A.t)({bufferSize:1,refCount:!0}))}start(){return n.v.just(i.Q.success(!0))}shouldOfferToAddAttendeeToFavorites(e){return this.shouldOfferCache[e]||(this.shouldOfferCache[e]=(0,c.v)(()=>{var s=v.H.shared(this.userId).userIsFavorite(e),t=s.pipe((0,T.J)(),(0,S.T)(e=>{var[s,t]=e;return!s&&t}),(0,x.u)()),r=m.Y.shared().get(f.A,this.userId).store.rxState().pipe((0,S.T)(e=>"idle"!==e.status),(0,y.F)()),a=b.M.shared(this.userId).state.pipe((0,S.T)(e=>"idle"!==e.status),(0,y.F)()),i=E.hw.shared(this.userId).offer.pipe((0,S.T)(e=>!!e),(0,y.F)()),n=(0,o.z)([r,a,i]).pipe((0,S.T)(e=>e.some(Boolean))),d=(0,l.h)(t.pipe((0,C.s)(1)),s.pipe((0,F.Q)(t))).pipe((0,S.T)(e=>!e)),c=h.T.shared().favoriteContactsEnabled.pipe((0,w.n)(s=>s?p.I.shared(this.userId).events("event.users.events.added").pipe((0,D.p)(s=>"recommendation.contacts.favorite"===s.type&&s["user-id"]===e),(0,w.n)(()=>d)):(0,u.of)(!1)),(0,w.n)(e=>e?n.pipe((0,S.T)(e=>!e)):(0,u.of)(!1))),g=this.skipOfferForAttendee.pipe((0,D.p)(s=>s===e),(0,S.T)(()=>!1));return(0,l.h)(c,g).pipe((0,y.F)(),(0,A.t)(1))})),this.shouldOfferCache[e]}skipOfferToAddAttendeeToFavorites(e){this.skipOfferForAttendee.next(e)}postponeOffer(){return super.postponeOffer().pipe((0,k.Fg)(()=>g.j.shared().chatAttendee.toSingle()),(0,k.ex)(e=>{e&&this.skipOfferToAddAttendeeToFavorites(e)}),(0,k.vV)(()=>i.Q.success(void 0)))}}j.shared=(0,r.G)(e=>new j(e))},86885(e,s,t){t.d(s,{s:()=>p});var r=t(15526),a=t(28138),i=t(15654),n=t(8733),d=t(60308),o=t(80661),u=t(39971),l=t(79942),c=t(74380),h=t(91885);class p{constructor(){this.email=c.o.shared().data().pipe((0,a.T)(e=>e.id&&e.email?e.demo?void 0:e.email:null),(0,i.F)()),this.passwordChangedSubject=ne
3w n.B,this.passwordChanged=this.passwordChangedSubject.asObservable()}validatePassword(e){return new u.v(s=>{e&&e.length>=6?s.success(!0):s.success(!1)})}changePassword(e){return this.validatePassword(e).pipe((0,l.Fg)(s=>s?c.o.shared().patch({password:e}).pipe((0,l.ZC)(e=>u.v.just(h.Q.failure(e))),(0,l.ex)(s=>s.isSuccessful&&this.passwordChangedSubject.next(e)),(0,l.Fg)(e=>e.isSuccessful?u.v.just("success"):u.v.error(e.error))):u.v.just("smallLength")))}changeEmail(e){return u.v.defer(()=>e&&e.trim()&&(0,d.td)(e)?o.c.shared().emailsValid(e).pipe((0,l.Fg)(s=>s?c.o.shared().patch({email:e.trim()}).pipe((0,l.ZC)(e=>u.v.just(h.Q.failure(e))),(0,l.Fg)(e=>e.isSuccessful?u.v.just("success"):"emailAlreadyTaken"===e.error?u.v.just("alreadyTaken"):u.v.error(e.error))):u.v.just("notReal"))):u.v.just("invalidFormat"))}}p.shared=(0,r.G)(()=>new p)},46053(e,s,t){t.d(s,{q:()=>A});var r=t(15526),a=t(59113),i=t(86885),n=t(17524),d=t(34578),o=t(75841),u=t(82019),l=t(84190),c=t(28138),h=t(15654),p=t(36580),v=t(39971),m=t(89218),f=t(91885),b=t(58731),g=t(94375),I=t(79942),w="email-confirmation-offering",S="skipped-offer-counter",y="last-offer-timestamp";class A extends m.D{constructor(e){super(),this.userId=e,this.emailConfirmation=a.G.shared(e);var s=b.y.shared(w,e),t=s.load(y),r=s.load(S),v=(0,n.z)([t.asObservable(),r.asObservable()]),m=(0,d.h)(this.offeringResult.pipe((0,u.K)(v)),v);this.canOffer=i.s.shared().email.pipe((0,l.n)(e=>void 0===e?(0,o.of)(!1):this.emailConfirmation.emailConfirmed.pipe((0,l.n)(e=>m.pipe((0,c.T)(s=>{var[t,r]=s;if(e)return!1;if(!r||!t)return!e;var a=Date.now()-t;return 1===r&&!!(a>g.b.day)||2===r&&!!(a>g.b.week)||3===r&&!!(a>2*g.b.week)||!!(a>30*g.b.day)}))))),(0,h.F)(),(0,p.t)({bufferSize:1,refCount:!0}))}start(){return v.v.just(f.Q.success({}))}accept(e){return v.v.just(f.Q.success())}reject(e){return v.v.just(f.Q.success())}postpone(e){var s=b.y.shared(w,this.userId);return s.load(S).pipe((0,I.Fg)(e=>v.v.zip(s.store(S,(null!=e?e:0)+1),s.store(y,Date.now()))),(0,I.AB)(f.Q.success()))}}A.shared=(0,r.G)(e=>new A(e))},80661(e,s,t){t.d(s,{c:()=>b});var r=t(15526),a=t(12154),i=t(97156),n=t(75841),d=t(94561),o=t(56823),u=t(56177),l=t(84190),c=t(97983),h=t(92453),p=t(39971),v=t(79942),m=t(30495);
3class f{constructor(){this.dataSubject=new i.t({})}validate(e){var s=a.o.encode(e);return this.dataSubject.pipe((0,u.s)(1),(0,l.n)(t=>"boolean"==typeof t[e]?(0,n.of)(t[e]):(0,d.O)((0,o.O)(3e3).pipe((0,c.u)(!0)),(0,m.Yq)(m.jI.shared().electronicmail.addresses.get,s).pipe((0,v.vV)(e=>!(e&&!1===e.valid)),(0,v.ZC)(()=>p.v.just(!0))).asObservable()).pipe((0,h.M)(s=>{this.dataSubject.next(Object.assign({},t,{[e]:s}))})))).toSingle()}}f.shared=(0,r.G)(()=>new f);class b{emailsValid(e){return f.shared().validate(e)}}b.shared=(0,r.G)(()=>new b)},46610(e,s,t){t.d(s,{p:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logBannerShown(e){a._.shared(this.userId).logEvent("feed-banner-shown",{userId:this.userId,bannerName:e}).safeSubscribe()}logBannerClicked(e){a._.shared(this.userId).logEvent("feed-banner-accepted",{userId:this.userId,bannerName:e}).safeSubscribe()}logBannerDeclined(e){a._.shared(this.userId).logEvent("feed-banner-declined",{userId:this.userId,bannerName:e}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},75434(e,s,t){t.d(s,{e:()=>p});var r=t(42618),a=t(15526),i=t(17330),n=t(58924),d=t(46053),o=t(95629),u=t(91825),l=t(78568),c=t(72646),h=t(53633);class p extends u.y{constructor(e){var s="mobile"===(0,r.platform)(),t=["ios","android"].includes((0,r.operatingSystem)());super(s?[{type:"email-confirmation-offering",offering:d.q.shared(e)},{type:"unhide-profile-offering",offering:o.L.shared(e)},{type:"email-notifications-switch-on-offering",offering:n.k.shared(e)},{type:"new-product-offering",offering:c.mg.shared(e)}]:[{type:"vr-meets-offering",offering:h.lX.shared(e)},{type:"metaverse-offering",offering:l.HT.shared(e)},{type:"email-confirmation-offering",offering:d.q.shared(e)},{type:"unhide-profile-offering",offering:o.L.shared(e)},{type:"email-notifications-switch-on-offering",offering:n.k.shared(e)},...s||t?[]:[{type:"application-offering",offering:i.e.shared(e)}],{type:"new-product-offering",offering:c.mg.shared(e)}])}}p.shared=(0,a.G)(e=>new p(e))},3643(e,s,t){t.d(s,{O:()=>u});var r=t(15526),a=t(12640),i=t(26510),n=t(37418),d=t(85752),o=t(46018);class u{constructor(e){this.userId=e}logUsersInFeedPresented(e,s,t){a._.shared(this.userId).logEvent("users-in-feed-presented",{"user-id":this.userId,filters:(0,d.rr)(e),users:[...s,...t].slice(0,u.maxLoggedUsersCount),matched:s.length}).safeSubscribe()}logFeedPageOpened(e){a._.shared(this.userId).logEvent("feed-page-opened",Object.assign({"user-id":this.userId},(0,i.UX)(e))).safeSubscribe()}logUserInFeedCtaClicked(e,s){a._.shared(this.userId).logEvent("cta-clicked",{"user-id":this.userId,"attendee-id":e,"button-name":s}).safeSubscribe()}logUserInFeedClicked(e,s){n.V.getSearchParams(this.userId).safeSubscribe(t=>{n.V.shared().logEvent("home","click","profiles",{candidate_profile:{candidate_id:e,search_form:t,suggested_candidates:{batch_candidates:s.filter(e=>!!e).map((e,s)=>({candidate_id:e,candidate_position:s}))}}})})}logUsersInFeedRendered(e){var{recommendationId:s,fullMatchedUserIds:t,partialMatchedUserIds:r,pageInfo:a,category:i="home"}=e;n.V.getSearchParams(this.userId).safeSubscribe(e=>{n.V.shared().logEvent(i,"view","profiles",Object.assign({recommendation_id:s,request_id:null==a?void 0:a.requestId,search_form:e,suggested_candidates:{batch_candidates:t.filter(e=>!!e).map(e=>({candidate_id:e})),partial_match:r.filter(e=>!!e).map(e=>({candidate_id:e}))}},a&&{meta_info:{count:a.count,free_members:a.featuredMembers,recommendations:a.recommendations,feed_mode:a.feedMode,users_feed_status:a.usersFeedStatus,personal_recommendations_status:a.personalRecommendationsStatus}}))})}logFeedPageNavigation(e){o.n.shared().logEvent("MainPage_View",{source:e})}logMatchOfTheDayCardShown(e){a._.shared(this.userId).logEvent("match-of-the-day-card-shown",{"match-user-id":e}).safeSubscribe()}logMatchOfTheDayCardClicked(e){a._.shared(this.userId).logEvent("match-of-the-day-card-clicked",{"match-user-id":e}).safeSubscribe()}logProfilesScrollViewed(e,s){n.V.shared().logEvent("home","view","profiles_scroll",Object.assign({milestone:e},s?{request_id:s}:{}))}}u.shared=(0,r.G)(e=>new u(e)),u.maxLoggedUsersCount=300},56662(e,s,t){t.d(s,{H:()=>D});var r=t(38107),a=t(75841),i=t(75900),n=t(56823),d=t(17524),o=t(56607),u=t(84190),l=t(97983),c=t(15654),h=t(36580),p=t(28138),v=t(27585),m=t(53940),f=t(14316),b=t(15526),g=t(79942),I=t(22998),w=t(4938),S=t(94375),y=t(13462),A=t(43981),T="match-of-the-day",x="interacted-at",C="completed-activations";function F(e,s){return Object.fromEntries(Object.entries(e).filter(e=>{var[,t]=e;return w.E.shared().isSameDaySync(new Date(t),new Date(s))}))}
3class D{constructor(e){this.matchUserIdSubject=new r.m(1),this.userId=e;var s=I.w.shared(T,e).data().pipe((0,u.n)(e=>{var s,t=null==(s=e[T])?void 0:s[x];return t?w.E.shared().currentTime().asObservable().pipe((0,u.n)(e=>{if(!w.E.shared().isSameDaySync(new Date(t),new Date(e)))return(0,a.of)(!1);var s=S.b.day-e%S.b.day;return(0,i.x)((0,a.of)(!0),(0,n.O)(s).pipe((0,l.u)(!1)))})):(0,a.of)(!1)}),(0,c.F)(),(0,h.t)({refCount:!0,bufferSize:1})),t=I.w.shared(T,e).data().pipe((0,u.n)(e=>{var s,t,r=null!=(s=null==(t=e[T])?void 0:t[C])?s:{};return w.E.shared().currentTime().asObservable().pipe((0,u.n)(e=>{var s=F(r,e);if(!Object.keys(s).length)return(0,a.of)({});var t=S.b.day-e%S.b.day;return(0,i.x)((0,a.of)(s),(0,n.O)(t).pipe((0,l.u)({})))}))}),(0,h.t)({refCount:!0,bufferSize:1}));this.matchUserId=(0,d.z)([y.T.shared().matchOfTheDayEnabled,y.T.shared().matchOfTheDay.limit]).pipe((0,u.n)(e=>{var[r,i]=e;return r?i>1?(0,d.z)([t,this.matchUserIdSubject]).pipe((0,p.T)(e=>{var[s,t]=e;return Object.keys(s).length>=i||t&&t in s?null:t})):s.pipe((0,u.n)(e=>e?(0,a.of)(null):this.matchUserIdSubject)):(0,a.of)(null)}),(0,c.F)(),(0,h.t)({refCount:!0,bufferSize:1}))}setUserId(e){this.matchUserIdSubject.next(e)}start(e){e.add(y.T.shared().matchOfTheDayEnabled.pipe((0,c.F)(),(0,u.n)(e=>
3e?A.e.shared(this.userId).newMessage.pipe((0,v.E)(this.matchUserId),(0,m.p)(e=>{var[s,t]=e;return!!t&&s.sender===this.userId&&s.recipient===t}),(0,p.T)(e=>{var[,s]=e;return s}),(0,f.Z)(e=>w.E.shared().currentTime().pipe((0,g.Fg)(s=>y.T.shared().matchOfTheDay.limit.toSingle().pipe((0,g.Fg)(t=>t<=1?I.w.shared(T,this.userId).store(x,s):I.w.shared(T,this.userId).update(C,t=>Object.assign({},F(null!=t?t:{},s),{[e]:s})).pipe((0,g.AB)(void 0)))))))):o.w)).safeSubscribe())}}D.shared=(0,b.G)(e=>new D(e))},78568(e,s,t){t.d(s,{HT:()=>I});var r=t(89218),a=t(15526),i=t(34578),n=t(75841),d=t(17524),o=t(91885),u=t(39971),l=t(12985),c=t(28138),h=t(84190),p=t(15654),v=t(58731),m=t(79942),f=t(13462),b="metaverse-offering",g="offer-rejected";class I extends r.D{constructor(e){super(),this.userId=e;var s=(0,i.h)(this.offeringResult.pipe((0,c.T)(e=>"rejected"===e.result)),v.y.shared(b,this.userId).load(g)),t=l.im.shared(e).preferences.pipe((0,c.T)(e=>"mal"===e.preferredGender)),r=l.im.shared(e).preferences.pipe((0,c.T)(e=>"fem"===e.gender));this.canOffer=f.T.shared().metaverseBannerEnabled.pipe((0,h.n)(e=>e?(0,d.z)([s,t,r]).pipe((0,c.T)(e=>{var[s,t,r]=e;return!s&&t&&r})):(0,n.of)(!1)),(0,p.F)())}start(){return u.v.just(o.Q.success({}))}reject(){return v.y.shared(b,this.userId).store(g,!0).pipe((0,m.AB)(o.Q.success()))}}I.shared=(0,a.G)(e=>new I(e))},72646(e,s,t){t.d(s,{mg:()=>g});var r=t(89218),a=t(15526),i=t(75841),n=t(34578),d=t(91885),o=t(39971),u=t(84190),l=t(28138),c=t(15654),h=t(36580),p=t(58731),v=t(79942),m=t(13462),f="new-product-offering",b="offer-was-shown";class g extends r.D{constructor(e){super(),this.userId=e,this.canOffer=m.T.shared().newProductBannerEnabled.pipe((0,u.n)(e=>e?(0,n.h)(p.y.shared(f,this.userId).load(b),this.offeringResult.pipe((0,l.T)(e=>"accepted"===e.result||"rejected"===e.result))).pipe((0,l.T)(e=>!e)):(0,i.of)(!1)),(0,c.F)(),(0,h.t)({bufferSize:1,refCount:!0}))}start(){return o.v.just(d.Q.success({}))}accept(){return p.y.shared(f,this.userId).store(b,!0).pipe((0,v.AB)(d.Q.success()))}reject(){return p.y.shared(f,this.userId).store(b,!0).pipe((0,v.AB)(d.Q.success()))}}g.shared=(0,a.G)(e=>new g(e))},42897(e,s,t){t.d(s,{Y:()=>r.Y});var r=t(89301)},95629(e,s,t){t.d(s,{L:()=>T});var r=t(17524),a=t(34578),i=t(75841),n=t(82019),d=t(84190),o=t(28138),u=t(15654),l=t(36580),c=t(74423),h=t(15526),p=t(45482),v=t(89218),m=t(39971),f=t(91885),b=t(58731),g=t(94375),I=t(79942),w=t(46560),S="unhide-profile-offering",y="skipped-offer-counter",A="last-offer-timestamp";class T extends v.D{constructor(e){super(),this.userId=e;var s=b.y.shared(S,e),t=s.load(A),h=s.load(y),v=(0,r.z)([t.asObservable(),h.asObservable()]),m=(0,a.h)(this.offeringResult.pipe((0,n.K)(v)),v),f=p.Session.shared().userIsUsual.pipe((0,d.n)(s=>s?c.E.shared(e).presentInFeed:(0,i.of)(!0)));this.canOffer=(0,r.z)([f,w.o.shared(e).verified]).pipe((0,d.n)(e=>{var[s,t]=e;return m.pipe((0,o.T)(e=>{var[r,a]=e;if(!t||s)return!1;if(!a||!r)return!s;var i=Date.now()-r;return 1===a&&!!(i>3*g.b.day)||2===a&&!!(i>30*g.b.day)||!!(i>60*g.b.day)}))}),(0,u.F)(),(0,l.t)({bufferSize:1,refCount:!0}))}start(){return m.v.just(f.Q.success({}))}accept(e){return m.v.just(f.Q.success())}reject(e){return m.v.just(f.Q.success())}postpone(e){var s=b.y.shared(S,this.userId);return s.load(y).pipe((0,I.Fg)(e=>m.v.zip(s.store(y,(null!=e?e:0)+1),s.store(A,Date.now()))),(0,I.AB)(f.Q.success()))}}T.shared=(0,h.G)(e=>new T(e))},5919(e,s,t){t.d(s,{X:()=>X});var r=t(15526),a=t(89218),i=t(30495),n=t(50846),d=t(79942),o=t(50042),u=t(38107),l=t(97983);class c extends n.Q{constructor(e){super("users.feed.video-invite-recommendations",e,s=>(0,i.p6)(i.jI.shared().users.recommendations["video-invitation-in-search"].get,e,s).pipe((0,d.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t,ttl:(null==(s=(0,o.a)(r))?void 0:s.maxAge)||0}}))),this.refreshSubject=new u.m(1)}shouldRefreshData(){return this.refreshSubject.pipe((0,l.u)(()=>!0))}refresh(){this.refreshSubject.next()}}c.shared=(0,r.G)(e=>new c(e));var h=t(13462),p=t(28138),v=t(15654),m=t(84190),f=t(92453),b=t(2773),g=t(75841),I=t(93648),w=t(72319),S=t(33702),y=t.n(S),A=t(15511),T=["mal","fem","both"],x=["mal","fem"];class C{constructor(e){this.userId=e,this.recommendations=I.BE.shared(e).filters.pipe((0,p.T)(e=>{var{minAge:s,gender:t,maxAge:r,preferredGender:a}=e;return{minAge:s,gender:t,maxAge:r,preferredGender:a}}),(0,v.F)(y()),(0,m.n)(s=>{var{minAge:t,gender:r,maxAge:a,preferredGender:i}=s,n=T.includes(i)?i:(0,w.R)(w.D),d=x.includes(r)?r:w.D;return h.T.shared().videoInviteFeedBanner.pipe((0,m.n)(s=>{var{count:r}=s;return c.shared(e).data({count:r,"min-age":t||18,"max-age":a||85,gender:n,"preferred-gender":d})}),(0,p.T)(e=>e.map(e=>e["user-id"])),(0,f.M)(s=>{0===s.length&&A.g.shared(e).logRecommendationsEmptyUserList()}),(0,b.W)(()=>(A.g.shared(e).logRecommendationsRequestError(),(0,g.of)([]))))}))}next(){c.shared(this.userId).refresh()}}C.shared=(0,r.G)(e=>new C(e));var F=t(17524),D=t(30131),k=t(57189),E=t(56823),j=t(56607),R=t(34578),O=t(53940),M=t(23567),G=t(40554),B=t(56177),P=t(44383),_=t(65052),z=t(36580),N=t(13230),L=t(91885),q=t(56379),V=t(77252),Q=t(94375),U=t(97928),Y=t(77194),J=t(55952),W=t(14087),H=30*Q.b.second;class X extends a.D{constructor(e){super();var s=(0,F.z)([h.T.shared().mcs.enabled.pipe((0,m.n)(s=>s?q.M.shared(e).initialized.pipe((0,O.p)(e=>e),(0,M.w)({first:H}),(0,b.W)(()=>q.M.shared(e).initialized)):(0,g.of)(!1))),h.T.shared().videoInviteFeedBannerEnabled]).pipe((0,m.n)(s=>{var[t,r]=s;return r&&t?V.J.shared(e).status.pipe((0,m.n)(s=>"idle"!==s?(0,g.of)([]):C.shared(e).recommendations),(0,m.n)(s=>0===s.length?(0,g.of)({attendeeId:!1,shouldTryRefetch:!1,reason:void 0}):(0,D.H)(s).pipe((0,G.H)(s=>
3(0,F.z)([N.N.shared(e).callIsAvailable(s).pipe((0,B.s)(1)),Y.N.shared(e).blockedUsers.pipe((0,p.T)(e=>e.includes(s)),(0,B.s)(1)),U.n.shared(e).userInContacts(s).pipe((0,B.s)(1))]).pipe((0,p.T)(e=>{var[s,t,r]=e;return s&&!t&&!r}),(0,O.p)(e=>e),(0,p.T)(()=>({attendeeId:s,shouldTryRefetch:!1,reason:void 0})))),(0,B.s)(1),(0,k.U)({attendeeId:!1,shouldTryRefetch:!0,reason:"unavailable-users"})))):(0,g.of)({attendeeId:!1,shouldTryRefetch:!1,reason:void 0})}),(0,P.S)((e,s)=>s.shouldTryRefetch?{refetchAttempts:e.refetchAttempts+1,attendeeId:s.attendeeId,shouldTryRefetch:s.shouldTryRefetch,reason:s.reason}:{attendeeId:s.attendeeId,refetchAttempts:0,shouldTryRefetch:!1,reason:s.reason},{refetchAttempts:0,attendeeId:!1}),(0,m.n)(s=>{var{attendeeId:t,refetchAttempts:r,shouldTryRefetch:a,reason:i}=s;return a?("unavailable-users"===i&&A.g.shared(e).logBannerNotShown("unavailable-users"),h.T.shared().videoInviteFeedBanner.pipe((0,B.s)(1),(0,m.n)(s=>r<=s.maxRequestFailures?(C.shared(e).next(),(0,g.of)(!1)):(0,E.O)(s.requestsCooldown).pipe((0,f.M)(()=>C.shared(e).next()),(0,m.n)(()=>j.w))))):(0,g.of)(t)}));this.canOffer=(0,R.h)(s,this.offeringResult.pipe((0,m.n)(()=>V.J.shared(e).status.pipe((0,O.p)(e=>"idle"===e),(0,B.s)(1),(0,m.n)(()=>s),(0,_.Z)(!1))))).pipe((0,m.n)(s=>s?J.K.shared(e).mcsId(s).asObservable().pipe((0,m.n)(t=>t?W.c.shared(t).profile.pipe((0,B.s)(1),(0,p.T)(e=>null!=e&&e.videoApprovedUrl?{attendeeId:s,videoSrc:e.videoApprovedUrl}:{attendeeId:s})):(A.g.shared(e).logBannerNotShown("mcs-user-id-not-resolved"),(0,g.of)(!1)))):(0,g.of)(!1)),(0,v.F)(y()),(0,z.t)({refCount:!0,bufferSize:1}))}start(e){return this.offer.toSingle().pipe((0,d.vV)(s=>s?L.Q.failure("offer-not-allowed"):L.Q.success(e)))}}X.shared=(0,r.G)(e=>new X(e))},15511(e,s,t){t.d(s,{g:()=>n});var r=t(15526),a=t(12640),i=t(17951);class n{constructor(e){this.userId=e}logBannerShown(e){a._.shared(this.userId).logEvent("video-invite-feed-banner-shown",{"attendee-id":e}).safeSubscribe(),i._.shared(this.userId).logUserAction({type:"videoinvitation.in.search.shown",data:{userId:e}}).safeSubscribe()}logBannerClicked(e){a._.shared(this.userId).logEvent("video-invite-feed-banner-clicked",{"attendee-id":e}).safeSubscribe()}logBannerHidden(e,s){a._.shared(this.userId).logEvent("video-invite-feed-banner-hidden",{"attendee-id":e,reason:s}).safeSubscribe()}logBannerNotShown(e){a._.shared(this.userId).logEvent("video-invite-feed-banner-not-shown",{reason:e}).safeSubscribe()}logRecommendationsRequestError(){a._.shared(this.userId).logEvent("video-invite-feed-recommendations-request-error",{}).safeSubscribe()}logRecommendationsEmptyUserList(){a._.shared(this.userId).logEvent("video-invite-feed-recommendations-empty-user-list",{}).safeSubscribe()}}n.shared=(0,r.G)(e=>new n(e))},53633(e,s,t){t.d(s,{lX:()=>I});var r=t(89218),a=t(15526),i=t(17524),n=t(75841),d=t(34578),o=t(91885),u=t(39971),l=t(84190),c=t(28138),h=t(15654),p=t(36580),v=t(13462),m=t
3(22998),f=t(79942),b="vr-meets-offering",g="offer-last-shown-info";class I extends r.D{constructor(e){super(),this.userId=e,this.canOffer=(0,i.z)([v.T.shared().vrMeets.banner.enabled,v.T.shared().vrMeets.banner.threshold,v.T.shared().vrMeets.banner.showLimitCount]).pipe((0,l.n)(e=>{var[s,t,r]=e;return s?(0,d.h)(m.w.shared(b,this.userId).load(g).pipe((0,f.vV)(e=>!!e&&(Date.now()-e.date<=t||e.viewCount>=r))),this.offeringResult.pipe((0,c.T)(e=>"accepted"===e.result||"rejected"===e.result))).pipe((0,c.T)(e=>!e)):(0,n.of)(!1)}),(0,h.F)(),(0,p.t)({bufferSize:1,refCount:!0}))}start(){return u.v.just(o.Q.success({}))}accept(){return this.processOffer()}reject(){return this.processOffer()}processOffer(){return m.w.shared(b,this.userId).load(g).pipe((0,f.Fg)(e=>{var s=e&&e.viewCount?++e.viewCount:1;return m.w.shared(b,this.userId).store(g,{date:Date.now(),viewCount:s}).pipe((0,f.AB)(o.Q.success()))}))}}I.shared=(0,a.G)(e=>new I(e))},27220(e,s,t){t.d(s,{C:()=>E});var r=t(56824),a=t(17524),i=t(75841),n=t(56823),d=t(48830),o=t(56607),u=t(82788),l=t(84190),c=t(56177),h=t(97983),p=t(28138),v=t(65052),m=t(50626),f=t(15526),b=t(46822),g=t(66382),I=t(45482),w=t(13462),S=t(41196),y=t(58456),A=t(9086),T=t(86977);function x(e){if(!(null!=e&&e.length))return[];for(var s=arguments.length,t=Array(s>1?s-1:0),r=1;r<s;r++)t[r-1]=arguments[r];var a=t.reduce((e,s)=>s?e.concat(s):e,[]);return a.length?e.filter(e=>!a.some(s=>e===s||"number"==typeof e&&"number"==typeof s&&isNaN(e)&&isNaN(s))):e.slice()}var C=t(5801),F=t(67276),D=t(55952),k=["event.users.tags.set","event.users.tags.unset"];class E{constructor(){this.enabled=(0,a.z)([w.T.shared().presenceActualizerEnabled,w.T.shared().presenceEventSubscriptionEnabled]).pipe((0,l.n)(e=>{var[s,t]=e;return s&&t?I.Session.shared().userId.pipe((0,C.o)(),(0,l.n)(e=>T.I.shared(e).active)):(0,i.of)(s)}))}startPolling(e){return w.T.shared().presenceActualizingInterval.pipe((0,l.n)(e=>(0,n.O)(e/4,e)),(0,l.n)(()=>r.HU.shared(e).presence.pipe((0,c.s)(1),(0,S.y)())),(0,h.u)(void 0))}startPresenceUpdater(e){return(0,a.z)([w.T.shared().presenceEventSubscriptionEnabled,A.e.shared().hasAvailableSubscriptions.pipe((0,c.s)(1))]).pipe((0,l.n)(s=>{var[t,r]=s;return t&&r?new d.c(s=>(A.e.shared().subscribe(e,k),s.next(void 0),()=>{A.e.shared().unsubscribe(e,k)})).pipe((0,l.n)(()=>A.e.shared().subscriptions),(0,p.T)(s=>!!s.find(s=>s["target-id"]===e)),(0,l.n)(s=>s?o.w:this.startPolling(e)),(0,p.T)(()=>void 0)):this.startPolling(e)}))}start(e){var s=null;e.add((0,a.z)([b.c.shared().profileId,I.Session.shared().userId]).safeSubscribe(e=>{var[t,r]=e;t&&r&&t!==r?s=this.subscribeForUpdates(t):s&&(s.unsubscribe(),s=null)}));var t=null;e.add(I.Session.shared().userId.pipe((0,l.n)(e=>e?F.M.shared(e).attendeeId.pipe((0,l.n)(s=>s?D.K.shared(e).id(s):(0,i.of)(null))):(0,i.of)(null))).safeSubscribe(e=>{e?t=this.subscribeForUpdates(e):t&&(t.unsubscribe(),t=null)}));var r=null;e.add(g.j.shared().chatAttendee.safeSubscribe(e=>{e?r=this.subscribeForUpdates(e):r&&(r.unsubscribe(),r=null)})),e.add(A.e.shared().subscriptions.pipe((0,v.Z)([]),(0,p.T)(e=>e.map(e=>e["target-id"])),(0,m.J)()).safeSubscribe(e=>{var[s,t]=e;x(s,t).forEach(e=>{y.o.shared(e).setDefaultTtl()}),x(t,s).forEach(e=>{y.o.shared(e).setTtl(Number.MAX_SAFE_INTEGER)})}))}subscribeForUpdates(e){var s=new u.yU;return s.add(this.enabled.pipe((0,l.n)(s=>s?this.startPresenceUpdater(e):o.w)).safeSubscribe()),s}}E.shared=(0,f.G)(()=>new E)},39012(e,s,t){t.d(s,{O:()=>n,q:()=>d});var r=t(8733),a=t(15526),i=t(79942);class n{constructor(e){this.presentRemovingIntentSubject=new r.B,this.presentRemovingIntent=this.presentRemovingIntentSubject.asObservable()}intercept(e,s,t){this.presentRemovingIntentSubject.next({receiverId:e,present:s,price:t})}}function d(e){return(s,t,r)=>e(s,t,r).pipe((0,i.ex)(e=>n.shared(s).intercept(t,r.group,r.price)))}n.shared=(0,a.G)(e=>new n(e))},25887(e,s,t){t.d(s,{O:()=>d,v:()=>n});var r=t(8733),a=t(15526),i=t(79942);class n{constructor(){this.presentSendingIntentSubject=new r.B,this.presentSendingIntent=this.presentSendingIntentSubject.asObservable()}intercept(e,s,t){this.presentSendingIntentSubject.next({result:e,receiverId:s,meta:t})}}function d(e){return(s,t,r,a,d)=>e(s,t,r,a,d).pipe((0,i.ex)(e=>n.shared().intercept(e,t,d)))}n.shared=(0,a.G)(()=>new n)},9990(e,s,t){t.d(s,{z:()=>R});var r=t(89218),a=t(15526),i=t(13462),n=t(28138),d=t(15654),o=t(84190),u=t(53940),l=t(65052),c=t(27585),h=t(18228),p=t(92453),v=t(36580),m=t(97156),f=t(17524),b=t(75841),g=t(56823),I=t(36094),w=t(86487),S=t(32688),y=t(39971),A=t(79942),T=t(58731),x=t(94375),C=t(91885),F=t(42618),D=t(41764),k="user-birthday-presents-offering",E="offering-timestamp",j=x.b.day;class R extends r.D{constructor(e){super(),this.offeringIsDelayedSubject=ne
3w m.t(!1),this.canOfferIsBlocked=new m.t(!1),this.userId=e,this.persistence=T.y.shared(k,this.userId),this.recommendations=S.G.shared(this.userId).recommendations.pipe((0,n.T)(e=>e.filter(e=>"birthday"===e.type)));var s=this.persistence.load(E).pipe((0,A.vV)(e=>!!e&&new Date().getTime()-e<j)),t=this.offeringIsDelayedSubject.asObservable().pipe((0,d.F)(),(0,o.n)(()=>s.pipe((0,A.ex)(e=>this.offeringIsDelayedSubject.next(e))))),r=(0,f.z)([I.w.shared().userDistractionAllowed,w.G.shared().visible]).pipe((0,u.p)(e=>e.every(e=>e))),a=this.recommendations.pipe((0,n.T)(e=>e.length>0)),y="mobile"===(0,F.platform)(),C=D.c.shared().deepLink.asObservable().pipe((0,o.n)(e=>y&&((null==e?void 0:e.source)==="push"||(null==e?void 0:e.source)==="link")?(0,b.of)(/send-present\/\d+$/.test(e.uri)):(0,b.of)(!1)));this.canOffer=t.pipe((0,o.n)(e=>(0,g.O)(x.b.day).pipe((0,o.n)(()=>t),(0,l.Z)(e))),(0,o.n)(e=>e?(0,b.of)(!1):(0,f.z)([i.T.shared().userBirthdayPresentSendingRecommendationEnabled,C]).pipe((0,o.n)(e=>{var[s,t]=e;return s&&!t?r.pipe((0,o.n)(()=>a)):(0,b.of)(!1)}))),(0,c.E)(this.canOfferIsBlocked),(0,h.j)(e=>{var[,s]=e;return s}),(0,n.T)(e=>{var[s]=e;return s}),(0,p.M)(e=>{e&&this.canOfferIsBlocked.next(!0)}),(0,d.F)(),(0,v.t)(1))}start(){return this.recommendations.toSingle().pipe((0,A.vV)(e=>e?C.Q.success(e[0]):C.Q.failure("offer-not-allowed")))}staleOffer(){return this.offer.toSingle().pipe((0,A.Fg)(e=>e?T.y.shared(k,this.userId).store(E,new Date().getTime()).pipe((0,A.Fg)(()=>S.G.shared(this.userId).readRecommendation(e.id).pipe((0,A.ex)(()=>{this.offeringIsDelayedSubject.next(!0)}),(0,A.AB)(C.Q.success())))):y.v.just(C.Q.failure("offer-not-exists"))))}unblockCanOffer(){return y.v.just().pipe((0,A.ex)(()=>this.canOfferIsBlocked.next(!1)))}accept(e){return this.unblockCanOffer().pipe((0,A.AB)(C.Q.success()))}reject(e){return this.unblockCanOffer().pipe((0,A.AB)(C.Q.success()))}}R.shared=(0,a.G)(e=>new R(e))},32061(e,s,t){t.d(s,{l:()=>i});var r=t(15526),a=t(12640);class i{constructor(e){this.userId=e}logHolidayPresentRecommendationShown(e,s){a._.shared(this.userId).logEvent("holiday-present-recommendation-shown",{userId:this.userId,attendeesIds:e,holidayType:s}).safeSubscribe()}logHolidayPresentRecommendationAccepted(e,s,t){a._.shared(this.userId).logEvent("holiday-present-recommendation-accepted",{userId:this.userId,attendeeId:e,holidayType:s,cta:t}).safeSubscribe()}logHolidayPresentSent(e,s,t,r,i){a._.shared(this.userId).logEvent("holiday-present-sent",{userId:this.userId,attendeeId:e,holidayType:s,cta:t,presentsIds:r,orderId:i}).safeSubscribe()}}i.shared=(0,r.G)(e=>new i(e))},45159(e,s,t){t.d(s,{V:()=>g});var r=t(89218),a=t(17524),i=t(75841),n=t(32688),d=t(28138),o=t(53940),u=t(84190),l=t(3810),c=t(15654),h=t(36094),p=t(86487),v=t(79942),m=t(91885),f=t(13462),b=t(41764);class g extends r.D{constructor(e,s){super(),this.userId=e,this.recommendations=n.G.shared(this.userId).recommendations.pipe((0,d.T)(e=>e.filter(e=>e.type===s.holidayType)));var t=(0,a.z)([h.w.shared().userDistractionAllowed,p.G.shared().visible]).pipe((0,o.p)(e=>e.every(e=>e))),r=this.recommendations.pipe((0,d.T)(e=>e.length>0));this.canOffer=b.c.shared().deepLink.asObservable().pipe((0,u.n)(e=>(null==e?void 0:e.type)==="send-present"?(0,i.of)(!1):f.T.shared().userHolidayPresentSendingRecommendationEnabled.pipe((0,l.E)(s.configKey),(0,u.n)(e=>e?t.pipe((0,u.n)(()=>r)):(0,i.of)(!1)),(0,c.F)())))}start(){return this.recommendations.toSingle().pipe((0,v.vV)(e=>e?m.Q.success(e[0]):m.Q.failure("offer-not-allowed")))}accept(e){return n.G.shared(this.userId).readRecommendation(e.id).pipe((0,v.AB)(m.Q.success()))}reject(e){return n.G.shared(this.userId).readRecommendation(e.id).pipe((0,v.AB)(m.Q.success()))}}},75446(e,s,t){t.d(s,{K:()=>c});var r=t(39971),a=t(28138),i=t(53940),n=t(56177),d=t(92453),o=t(97983),u=t(43751),l=t(79760);function c(e){return r.v.defer(()=>{var s=u.Y.shared().get(l.A),t="holiday-present-sending-recommendation";return s.store.rxState().pipe((0,a.T)(e=>!!e&&s.store.isLeadingToConversion()),(0,i.p)(e=>!e),(0,n.s)(1),(0,d.M)(()=>{var r,a,i,n=[{name:t,params:[{props:{recommendationId:e.id,holidayType:e.type,attendeeIds:e.data.userIds,onClose:()=>{s.actions.close(t)}}}]}];((null==(r=e.progress)?void 0:r.step)==="choosing-presents"||(null==(a=e.progress)?void 0:a.step)==="writing-letter")&&n.unshift({name:"presents-order-modal",params:[{props:{recommendationId:e.id,receiverId:e.data.userIds[0],meta:{source:e.type+"-presents-sending-recommendation",holidayType:e.type,cta:"recommendation-popup"}}}]}),(null==(i=e.progress)?void 0:i.step)==="writing-letter"&&n.unshift({name:"presents-complete-order",params:[{props:{recommendationId:e.id,receiverId:e.data.userIds[0],meta:{source:e.type+"-presents-sending-recommendation",holidayType:e.type,cta:"recommendation-popup"}},appOverlayClassName:e.type+"-presents-complete-order"}]}
3),s.actions.open(n[0].name,n[0].params),n.slice(1).forEach(e=>s.actions.addToQueue(e.name,e.params))}),(0,o.u)(void 0)).toSingle()})}},44105(e,s,t){t.d(s,{p:()=>i});var r=t(15526),a=t(45159);class i extends a.V{constructor(e){super(e,{configKey:"newYear",holidayType:"new-year"})}}i.shared=(0,r.G)(e=>new i(e))},45113(e,s,t){t.d(s,{N:()=>i});var r=t(15526),a=t(45159);class i extends a.V{constructor(e){super(e,{configKey:"saintValentine",holidayType:"saint-valentine"})}}i.shared=(0,r.G)(e=>new i(e))},14816(e,s,t){t.d(s,{Y:()=>i});var r=t(15526),a=t(45159);class i extends a.V{constructor(e){super(e,{configKey:"womenDay",holidayType:"women-day"})}}i.shared=(0,r.G)(e=>new i(e))},32295(e,s,t){t.d(s,{g:()=>u});var r=t(15526),a=t(12640),i=t(14321),n=t(17524),d=t(56177),o=t(84190);class u{constructor(e){this.userId=e,this.userIsFeaturedMember=i.f.shared(e).userIsFeaturedMember}logWishlistItemClick(e){(0,n.z)([this.userIsFeaturedMember,i.f.shared(e).userIsFeaturedMember]).pipe((0,d.s)(1),(0,o.n)(s=>{var[t,r]=s;return a._.shared(this.userId).logEvent("wishlist-item-clicked",{userId:this.userId,userIsFeaturedMember:t,receiverId:e,receiverIsFeaturedMember:r})})).safeSubscribe()}}u.shared=(0,r.G)(e=>new u(e))},84714(e,s,t){t.d(s,{W:()=>o});var r=t(56177),a=t(84190),i=t(15526),n=t(26551),d=t(12640);class o{constructor(e){this.userId=e,this.siteLocale=n._.shared().language}logBannerShown(e){this.siteLocale.pipe((0,r.s)(1),(0,a.n)(s=>d._.shared(this.userId).logEvent("language-switch-banner-shown",{userLocale:e,siteLocale:s,userId:this.userId}))).safeSubscribe()}logBannerAccepted(e){this.siteLocale.pipe((0,r.s)(1),(0,a.n)(s=>d._.shared(this.userId).logEvent("language-switch-banner-accepted",{userLocale:e,siteLocale:s,userId:this.userId}))).safeSubscribe()}logBannerDeclined(e,s){this.siteLocale.pipe((0,r.s)(1),(0,a.n)(t=>d._.shared(this.userId).logEvent("language-switch-banner-declined",{userLocale:e,siteLocale:t,userId:this.userId,reason:s}))).safeSubscribe()}}o.shared=(0,i.G)(e=>new o(e))},82610(e,s,t){t.d(s,{H:()=>D});var r=t(17524),a=t(75841),i=t(28138),n=t(15654),d=t(36580),o=t(65052),u=t(84190),l=t(41392),c=t(35834),h=t(79942),p=t(89218),v=t(15526),m=t(39971),f=t(91885),b=t(94375),g=t(58731),I=t(77684),w=t(26551),S=t(13462),y=t(18348),A="state",T={lastIgnoreTimestamp:null,startTimestamp:null},x=10*b.b.minute,C=6*b.b.second,F=b.b.week;class D extends p.D{constructor(e){super(),this.persistence=g.y.shared("user-settings-language-switch-offering",e);var s=(0,r.z)([I.o.shared().supportedLanguages,I.o.shared().language]).pipe((0,i.T)(e=>{var[s,t]=e;return s.find(e=>(0,c.M)(e)===t)})),t=m.v.defer(()=>{var e=Date.now();return this.persistence.load(A).pipe((0,h.vV)(s=>s&&null!==s.startTimestamp?s.startTimestamp:e),(0,h.vV)(s=>Math.max(s+x-e,0)),(0,h.vV)(e=>e?Math.max(C,e):0))});this.offerPayload=(0,r.z)([s,t]).pipe((0,i.T)(e=>{var[s,t]=e;return s&&t?{locale:s,ttl:t,same:t!==x}:null}),(0,n.F)(),(0,d.t)({refCount:!0,bufferSize:1}));var p=this.offeringResult.pipe((0,o.Z)(!1)),v=this.persistence.load(A).pipe((0,h.vV)(e=>!!e&&null!==e.lastIgnoreTimestamp&&e.lastIgnoreTimestamp+F-Date.now()>0));this.canOffer=(0,r.z)([I.o.shared().supportedLanguages,S.T.shared().userLanguageRedirectEnabled,p,v.asObservable()]).pipe((0,u.n)(e=>{var[s,t,n,d]=e;return n||s.length<=1||t||d?(0,a.of)(!1):(0,r.z)([w._.shared().language,this.offerPayload]).pipe((0,i.T)(e=>{var[s,t]=e;return!!t&&s!==t.locale}),(0,l.B)(b.b.second/10))}),(0,n.F)(),(0,d.t)({refCount:!0,bufferSize:1}))}start(){return this.offerPayload.toSingle().pipe((0,h.vV)(e=>e?f.Q.success(e):f.Q.failure("offer-not-allowed")),(0,h.Fg)(e=>e.isSuccessful?this.persistence.update(A,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;return e.startTimestamp=null===e.startTimestamp?Date.now():e.startTimestamp,e}).pipe((0,h.AB)(e)):m.v.just(e)))}accept(e){return this.persistence.update(A,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;return e.startTimestamp=null,e}).pipe((0,h.Fg)(()=>(0,y.p)(e.locale)),(0,h.AB)(f.Q.success()))}reject(e,s){return this.persistence.update(A,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;return e.lastIgnoreTimestamp="close"===s||"timer"===s?Date.now():null,e.startTimestamp=null,e}).pipe((0,h.AB)(f.Q.success()))}}D.shared=(0,v.G)(e=>new D(e))},26316(e,s,t){t.d(s,{M:()=>S});var r=t(15526),a=t(97156),i=t(75841),n=t(17524),d=t(28138),o=t(84190),u=t(15654),l=t(36580),c=t(39971),h=t(91885),p=t(79942),v=t(13462),m=t
3(75906),f=t(85378),b=t(12985),g=t(28280),I=t(85285);class w{constructor(e){this.translatedUserSubject=new a.t(null),this.translatedUser=this.translatedUserSubject.asObservable(),this.ownerId=e,this.config=v.T.shared().translations.pipe((0,d.T)(e=>e.profile)),this.canTranslateProperty=this.config.pipe((0,o.n)(e=>{var{enabled:s,defaultTarget:t,attendeeSupportedRealms:r}=e;if(!s||!t||!r)return(0,i.of)(!1);var a=f.F.shared(this.ownerId).profile.pipe((0,d.T)(e=>{var s;return!!(null!=(s=e.value)&&s.realm)&&r.includes(e.value.realm)}));return m.r.shared().languagesAreSupported([t]).asObservable().pipe((0,o.n)(e=>e?a:(0,i.of)(!1)))}),(0,u.F)(),(0,l.t)(1))}addTranslationContext(e,s){return"<"+s+">"+e+"</"+s+">"}removeTranslationContext(e,s){var t=RegExp("<"+s+">|</"+s+">","g");return e.replace(t,"")}reset(){this.translatedUserSubject.next(null)}canTranslate(){return this.canTranslateProperty}translate(){return(0,n.z)([this.config,this.canTranslate(),f.F.shared(this.ownerId).profile,b.im.shared(this.ownerId).preferences]).toSingle().pipe((0,p.Fg)(e=>{var s,[t,r,a,i]=e;return r&&t.defaultTarget&&a.value?m.r.shared().translate([a.value.name?this.addTranslationContext(a.value.name,"name"):"",a.value.about||"",a.value.city||"",a.value.occupation||"",(null==i||null==(s=i.about)?void 0:s.default)||""],t.defaultTarget).pipe((0,p.vV)(e=>{if(!e.isSuccessful)return e;var[s,t,r,n,d]=e.value.translations;return h.Q.success({profile:Object.assign({}
3,a.value,{name:this.removeTranslationContext(s.text,"name"),about:t.text,city:r.text,occupation:n.text}),preferences:Object.assign({},i,{about:{default:d.text}})})})):c.v.just(h.Q.failure("translation-not-available"))}),(0,p.ex)(e=>{this.translatedUserSubject.next(e.isSuccessful?e.value:null)}))}}class S{constructor(e){this.implementation=e,this.translatedUser=this.implementation.translatedUser}reset(){this.implementation.reset()}canTranslate(){return this.implementation.canTranslate()}translate(){return this.implementation.translate().pipe((0,p.ex)(e=>{e.isSuccessful||g.X.shared().notifyUser({type:I._.DefaultError},I.A.Low)}))}}S.shared=(0,r.G)(e=>new S(new w(e)))},22082(e,s,t){function r(e){class s{add(e){return e}remove(e){return e}actualize(e){return e}}return s.displayName=r.getDisplayName(e),s}t.d(s,{A:()=>a}),r.getDisplayName=e=>"roles."+e;let a=r},57384(e,s,t){t.d(s,{A:()=>n});var r=t(22082),a=t(70089);function i(e){var s;return(s=class extends a.LP{constructor(s){var t=s.getActions(r.A,e);super(t),this.state={roles:[]},this.bindAction(t.add,this.add),this.bindAction(t.remove,this.remove),this.bindAction(t.actualize,this.actualize),this.exportPublicMethods({hasUserOperator:this.hasUserOperator})}hasUserOperator(){var{roles:e}=this.state;return e.includes("users-operator")}add(e){if(e){var{roles:s}=this.state;s.includes(e)||this.setState({roles:[...s,e]})}}remove(e){if(e){var{roles:s}=this.state;this.setState({roles:s.filter(s=>s!==e)})}}actualize(e){e&&this.setState(this.state)}}).displayName=i.getDisplayName(e),s}i.getDisplayName=e=>"roles."+e;let n=i},76217(e,s,t){function r(){var e,s=Array.prototype.slice.call(arguments),t={};if(0===s.length)return null;for(;s.length;)for(var r in e=s.shift()||{})t[r]=e[r];return t}t.d(s,{U:()=>i}),t(8354);var a={video:{facingMode:"user",deepAR:!0},audio:!1};function i(e,s){var t=s||{};return e?(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():Promise.resolve([])).then((function(s){return t.audio=s.filter(function(e){return"audioinput"===e.kind}).length>0&&e,navigator.mediaDevices.getUserMedia(r(a,t))}).bind(this)):navigator.mediaDevices.getUserMedia(r(a,t))}},53748(e,s,t){t.d(s,{A:()=>r});let r=class{init(e){return null}dispose(e){return null}}},25210(e,s,t){t.d(s,{A:()=>g});var r=t(53748),a=t(26510),i=t(98153),n=t(43751),d=t(2643),o=t(86977),u=t(45482),l=t(5801),c=t(84190),h=t(56177),p=t(82788),v=t(48830),m=t(13462),f=t(29808),b=t(36214);class g extends r.A{constructor(){super(...arguments),this.videoInvitesEnabled=!0,this.videoInvitesIntensityReductionEnabled=!1,this.videoInvitesSuppressedByShare=!1,this.transmit=e=>{if(function(e,s){var t;if("x.event.dialogs.messages.added"===e.label){var{type:r}=e.payload;if("videocall.missed"===r||"videocall.finished"===r||"videocall.interactive.finished"===r)return!1}return("event.dialogs.automation.videoinvitations.matched"!==e.label||!!s.videoInvitesEnabled&&!s.videoInvitesSuppressedByShare)&&(!e.payload||"invitation.video"!==e.payload.type||!!s.videoInvitesEnabled)&&("event.users.events.added"!==e.label||(null==(t=e.payload)?void 0:t.type)!=="invitation.video"||!s.videoInvitesIntensityReductionEnabled)}(e,{videoInvitesEnabled:this.videoInvitesEnabled,videoInvitesIntensityReductionEnabled:this.videoInvitesIntensityReductionEnabled,videoInvitesSuppressedByShare:this.videoInvitesSuppressedByShare})){var s=function(e){var s,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.label?(s=e.label,t=w(e.label,e.payload)):t=w(s=e.type,(0,a.OK)(e.details)),"event.dialogs.automation.videoinvitations.matched"===s&&r.videoInvitesIntensityReductionEnabled&&(t=(0,f.x)(t)),{label:s,payload:t}}(e,{videoInvitesIntensityReductionEnabled:this.videoInvitesIntensityReductionEnabled});(function(e){var{label:s,payload:t}=e;u.Session.shared().userId.pipe((0,h.s)(1),(0,l.o)()).safeSubscribe(e=>{var r,a,i,o;"message:message:v2"===s&&t.sender!==e&&t.recipient===e&&(r=t.sender,a=t.id,i=e,o=(0,d.A)(r,i),n.Y.shared().api.dialogs.messages.patch(o.lower,o.higher,a,{delivered:!0}))})})(s),i.A.emit(s.label,s.payload)}}}init(e){this.flux=e,this.subscription=new p.yU,this.subscription.add(u.Session.shared().userId.pipe((0,l.o)(),(0,c.n)(e=>new v.c(()=>(o.I.shared(e).addEventListener(this.transmit),()=>{o.I.shared(e).removeEventListener(this.transmit)})))).safeSubscribe()),this.subscription.add(m.T.shared().videoInvites.enabled.safeSubscribe(e=>{this.videoInvitesEnabled=e})),this.subscription.add(m.T.shared().videoInvites.intensityReduction.enabled.safeSubscribe(e=>{this.videoInvitesIntensityReductionEnabled=e})),this.subscription.add(u.Session.shared().userId.pipe((0,l.o)(),(0,c.n)(e=>b.wi.shared(e).inviteSuppressedByShare)).safeSubscribe(e=>{this.videoInvitesSuppressedByShare=e}))}dispose(){this.subscription&&this.subscription.unsubscribe()}}var I={"message:message":function(e){return e.sender=e.__sender||e.sender,e},"message:message:v2":function(e){return e.sender=e.__sender||e.sender,"exo.metaverse.date"===e.type&&(e.meta["exo-metaverse-date"]={"date-time-start":e.meta.exoMetaverseDate.dateTimeStart,"date-time-end":e.meta.exoMetaverseDate.dateTimeEnd,"spacial-space":e.meta.exoMetaverseDate.spacialSpace}),"exo.metaverse.date.reminder"===e.type&&(e.meta["exo-metaverse-date-reminder"]["spacial-space"]=e.meta.exoMetaverseDate.spacialSpace),["dialogs.themes.updated","dialogs.themes.trial","dialogs.themes.gallery"].includes(e.type)&&(e.meta["dialogs-theme"]={"actor-id":e.meta.dialogsTheme.actorId,reference:e.meta.dialogsTheme.reference,"update-type":e.meta.dialogsTheme.updateType,"expires-at":e.meta.dialogsTheme.expiresAt,source:e.meta.dialogsTheme.source}),e},"event.users.events.added":function(e){return e.sender=e.__sender||e.sender,e},"ci:event.video-call.available":function(e){return{"event-id":Date.now(),"holder-id":e.recipientId,"user-id":e.sender,payload:{id:Date.now(),"sender-id":e.sender,"recipient-id":e.recipientId,timestamp:Date.now(),meta:{callWink:!0}}}}};function w(e,s){return I[e]?I[e](s):s}},87508(e,s,t){t.d(s,{A:()=>ge});var r,a,i,n,d=t(42062);class o extends d.Component{shouldComponentUpdate(){return!1}render(){return null}}var u=t(82788),l=t(98153),c=t(53748),h=t(86036),p=t(45482);class v extends c.A{constructor(){super(...arguments),this.getRolesModel=e=>{this.rolesModel=e?this.flux.get(h.A,e):void 0},this.addRole=e=>{this.rolesModel&&this.rolesModel.actions.add(e)},this.removeRole=e=>{this.rolesModel&&this.rolesModel.actions.remove(e)}}init(e){this.flux=e,this.subscription=new u.yU,this.subscription.add(p.Session.shared().userId.safeSubscribe(e=>{this.getRolesModel(e)})),l.A.on("role",this.addRole),l.A.on("role:revert",this.removeRole)}dispose(){this.subscription&&this.subscription.unsubscribe(),l.A.removeListener("role",this.addRole),l.A.removeListener("role:revert",this.removeRole)}}var m=t(25210),f=t(86977),b=t(5801),g=t(56177),I=t(84190),w=t(28138),S=t(75841),y=t(48830),A=t(56379),T=t(13462);class x extends c.A{constructor(){super(...arguments),this.onStateChanged=e=>{e?l.A.emit("event.realtime.started"):l.A.emit("event.realtime.stopped")},this.start=()=>{f.I.shared(this.userId).controlConnection(!0),T.T.shared().mcs.enabled.pipe((0,g.s)(1),(0,I.n)(e=>e?A.M.shared(this.userId).initialized.pipe((0,g.s)(1),(0,w.T)(e=>!e)):(0,S.of)(!1)),(0,I.n)(e=>e?A.M.shared(this.userId).init():(0,S.of)(void 0))).safeSubscribe()},this.stop=()=>{f.I.shared(this.userId).controlConnection(!1),A.M.shared(this.userId).initialized.pipe((0,g.s)(1),(0,I.n)(e=>e?A.M.shared(this.userId).dispose():(0,S.of)(void 0))).safeSubscribe()}}init(){this.subscription=p.Session.shared().userId.pipe((0,b.o)(),(0,I.n)(e=>new y.c(()=>(this.userId=e,l.A.states("command.realtime.start",this.start,"command.realtime.stop",this.stop),f.I.shared(e).active.subscribe(this.onStateChanged),()=>{l.A.removeStates("command.realtime.start",this.start,"command.realtime.stop",this.stop)})))).safeSubscribe()}dispose(){this.subscription&&this.subscription.unsubscribe()}}var C=t(43751),F=t(31085),D=t(17524),k=t(56607),E=t(2773),j=t(22081),R=t(85378),O=t(38602),M=t(14321),G=t(86885),B=t(30495),P=t(15526);class _{constructor(e){this.userId=e}encodeEmail(e){var s={address:e};return new y.c(e=>{B.jI.shared().electronicmail.transformations["user.csd"].put(this.userId,s,(s,t)=>{if(s)return void e.error(s);var{address:r}=t||{};r?(e.next(r),e.complete()):e.error(s)})})}}_.shared=(0,P.G)(e=>new _(e));class z{constructor(e){this.userId=e}encodeEmail(e){return _.shared(this.userId).encodeEmail(e)}}z.shared=(0,P.G)(e=>new z(e));var N=t(63984),L=t(78675),q=t(91654),V=t(87902),Q=t(45810),U=t(53748).A;let Y=class extends U{constructor(){super(...arguments),this.containers={},this.config=L.T.shared(),this.startChat=(e,s,t)=>{var r=String((0,N.A)());this.containers[r]=s;var a=Q.stringify(Object.assign({},this.getQueryParams(),{containerId:r,organisationId:this.config.supp
3ort.salesforce.organisationId,scrt2URL:this.config.support.salesforce.scrt2URL,initURL:this.config.support.salesforce.chats[e].initURL,bootstrapURL:this.config.support.salesforce.chats[e].bootstrapURL,chatButtonId:this.config.support.salesforce.chats[e].chatButtonId})),i=document.createElement("iframe");i.setAttribute("allow","autoplay"),i.src="/support-chat-v2/?"+a,s.appendChild(i),t&&t(r)},this.onChatClosed=e=>{e.data&&e.data.label&&"event.liveagent-chat.ended"===e.data.label&&this.clearContainer(e.data.containerId)},this.clearContainer=e=>{if(e&&this.containers[e]){var s=this.containers[e].querySelector("iframe");s&&s.remove(),delete this.containers[e],l.A.emit("event.liveagent-chat.closed",e)}},this.getQueryParams=()=>{if(this.state){var e=window.REVISION,s=window.location.host,{userId:t,email:r,name:a,roles:i,tags:n,userIsVip:d,totalSpent:o,monetizationModel:u}=this.state,l={cusref:t,cusemail:r,cusfirstname:a.replace(/(?:[\0-\x08\x0E-\x1F!-@\[-`\{-\x84\x86-\x9F\xA1-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u0890-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDB\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C8B-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u2FFF\u3001-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7D
3D-\uA7F0\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDBF\uDDF4-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD3F\uDD5A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDD49\uDD66-\uDD6E\uDD86-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEC1\uDEC8-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDF7F\uDF8A\uDF8C\uDF8D\uDF8F\uDFB6\uDFB8-\uDFD0\uDFD2\uDFD4-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFBF\uDFE1-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDDAF\uDDDC-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD812-\uD817\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD88E-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDC5F]|\uD810[\uDFFB-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD818[\uDC00-\uDCFF\uDD1E-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDD3F\uDD6D-\uDE3F\uDE80-\uDE9F\uDEB9\uDEBA\uDED4-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFF1\uDFF4-\uDFFF]|\uD823[\uDCD6-\uDCFE\uDD1F-\uDD7F\uDDF3-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDDCF\uDDEE\uDDEF\uDDF1-\uDEBF\uDEDF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5-\uDEFD\uDF00-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEAE\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD88D[\uDC7A-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,""),cuslastname:t,cusrealm:this.config.supp
3ort.salesforce.realm,cushaspurchase:n.includes("customer"),cusgroup:d?"vip":n.includes("customer")?"p":"np",cushasvip:d,cususertype:i.includes("promoter")?"promoter":"client",revision:e,hostname:s};return"services"!==u&&(l.custotalspent=String(o)),l}},this.initSubscription=()=>{this.subscription=p.Session.shared().userId.pipe((0,I.n)(e=>e?(0,D.z)([(0,S.of)(e),G.s.shared().email.pipe((0,I.n)(s=>s?z.shared(e).encodeEmail(s).pipe((0,E.W)(()=>(0,S.of)(""))):(0,S.of)(""))),O.f.shared(e).roles,j.x.shared(e).tags,M.f.shared(e).userIsVip,R.F.shared(e).profile.pipe((0,w.T)(e=>{var s;return null==(s=e.value)?void 0:s.name})),q.e.shared(e).totalSpentForDays(60),V.t.shared().model(e)]):k.w)).subscribe(e=>{var[s,t,{roles:r},a,i,n,d,o]=e,u=!this.state;this.state={userId:s,email:t,roles:r,tags:a,userIsVip:i,name:n,totalSpent:d,monetizationModel:o},u&&l.A.sync("command.help-center.chat.start",this.startChat)})}}init(){l.A.once("command.help-center.chat.start",this.initSubscription),l.A.sync("command.liveagent-chat.close",this.clearContainer),window.addEventListener("message",this.onChatClosed)}dispose(){window.removeEventListener("message",this.onChatClosed),l.A.removeListener("command.help-center.chat.start",this.startChat),l.A.removeListener("command.liveagent-chat.close",this.clearContainer),this.subscription&&this.subscription.unsubscribe(),this.containers={}}};var J=t(16756),W=t(12640);class H{constructor(e){this.userId=e}logPasswordChanged(){W._.shared(this.userId).logEvent("user-password-changed",{"user-id":this.userId}).safeSubscribe()}}H.shared=(0,P.G)(e=>new H(e));class X{constructor(e){this.userId=e}start(e){e.add(G.s.shared().passwordChanged.safeSubscribe(()=>{H.shared(this.userId).logPasswordChanged()}))}}X.shared=(0,P.G)(e=>new X(e));var Z=t(97156),$=t(22843),K=t(34578),ee=t(92453),es=[{on:"role:promoter",emit:"command.user.thumbnail.efficiency.enable"}];class et{start(e){e.add((0,K.h)(...es.map(this.processConfigItem)).safeSubscribe())}processConfigItem(e){return(0,$.i)(e.on).pipe((0,ee.M)(s=>{l.A.emit(e.emit,...s)}))}}et.shared=(0,P.G)(()=>new et);var er=t(82483),ea=t(53940),ei=t(45810),en=t.n(ei),ed=t(80194);class eo{constructor(){this.onCallPaymentRequired=e=>{l.A.emit("event.call.payment.required",e)},this.transformChatMediaStartToCallingModelDialAction=(e,s)=>{l.A.emit("command.user-actions.interaction.track",[{place:"video-chat-start."+s.cta,user:e}]),p.Session.shared().userId.pipe((0,ea.p)(e=>!!e),(0,w.T)(s=>en().stringify({user:s,attendee:e})),(0,g.s)(1)).subscribe(t=>{l.A.emit("command.sidebar.open","chat",e),C.Y.shared().get(ed.A,t).actions.dial({requestRemoteVideo:s.in,shareLocalVideo:s.out,channel:"call",phantom:s.phantom})})},this.onAutoResponseEnable=()=>{er.g.shared().emit("command.chat.media.response.auto.enable")},this.onAutoResponseDisable=()=>{er.g.shared().emit("command.chat.media.response.auto.disable")},this.onChatMediaAnswer=e=>{e.phantom||(l.A.emit("command.sidebar.open","chat",e.sender),l.A.emit("command.chat.media.answer",e))},this.onOverlayOpen=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];l.A.emit("overlay",...s)},this.onCameraBlockedOverlayClosed=()=>{er.g.shared().emit("event.overlay.camera-blocked.closed")},this.onChatMediaStateChanged=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];l.A.emit("event.chat.media.state.changed",...s)},this.onInviteRemove=e=>{l.A.emit("command.invite.remove",e)},this.onCameraPermissionsOverlayClosed=()=>{er.g.shared().emit("event.overlay.camera-permissions-prompt.closed")},this.onOverlayClose=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];l.A.emit("command.overlay.close",...s)},this.onUserInteractionTrack=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];l.A.emit("command.user-actions.interaction.track",...s)}}start(e){e.add(new y.c(()=>(l.A.on("command.call.response.auto.enable",this.onAutoResponseEnable),l.A.on("command.call.response.auto.disable",this.onAutoResponseDisable),l.A.on("command.chat.media.start",this.transformChatMediaStartToCallingModelDialAction),l.A.on("event.overlay.camera-blocked.closed",this.onCameraBlockedOverlayClosed),l.A.on("event.overlay.camera-permissions-prompt.closed",this.onCameraPermissionsOverlayClosed),er.g.shared().addListener("event.call.payment.required",this.onCallPaymentRequired),er.g.shared().addListener("command.chat.media.answer",this.onChatMediaAnswer),er.g.shared().addListener("overlay",this.onOverlayOpen),er.g.shared().addListener("event.chat.media.state.changed",this.onChatMediaStateChanged),er.g.shared().addListener("command.invite.remove",this.onInviteRemove),er.g.shared().addListener("command.chat.media.answer-phantom-call",this.onChatMediaAnswer),er.g.shared().addListener("command.overlay.close",this.onOverlayClose),er.g.shared().addListener("command.user-actions.interaction.track",this.onUserInteractionTrack),()=>{l.A.removeListener("command.call.response.auto.enable",this.onAutoResponseEnable),l.A.removeListener("command.call.response.auto.disable",this.onAutoResponseDisable),l.A.removeListener("command.chat.media.start",this.transformChatMediaStartToCallingModelDialAction),l.A.removeListener("event.overlay.camera-blocked.closed",this.onCameraBlockedOverlayClosed),l.A.removeListener("event.overlay.camera-permissions-prompt.closed",this.onCameraPermissionsOverlayClosed),er.g.shared().removeListener("event.call.payment.required",this.onCallPaymentRequired),er.g.shared().removeListener("command.chat.media.answer",this.onChatMediaAnswer),er.g.shared().removeListener("overlay",this.onOverlayOpen),er.g.shared().removeListener("event.chat.media.state.changed",this.onChatMediaStateChanged),er.g.shared().removeListener("command.invite.remove",this.onInviteRemove),er.g.shared().removeListener("command.chat.media.answer-phantom-call",this.onChatMediaAnswer),er.g.shared().removeListener("command.overlay.close",this.onOverlayClose),er.g.shared().removeListener("command.user-actions.interaction.track",this.onUserInteractionTrack)})).subscribe())}}eo.shared=(0,P.G)(()=>new eo);var eu=t(17713),el=t(66382),ec=t(54029);class eh{constructor(e){this.userId=e}logActivityStatusShown(e){W._.shared(this.userId).logEvent("chat-attendee-activity-status-shown",e).safeSubscribe()}logActivityStatusDisappeared(e){W._.shared(this.userId).logEvent("chat-attendee-activity-status-disappeared",e).safeSubscribe()}}eh.shared=(0,P.G)(e=>new eh(e));var ep=t(65052),ev=t(15654),em=t(33702),ef=t.n(em);class eb{constructor(e){this.shown=null,this.userId=e}start(e){e.add(el.j.shared().chatAttendee.pipe((0,b.o)(),(0,I.n)(e=>this.activityStatus(e).pipe((0,w.T)(s=>({status:s,attendeeId:e}))))).safeSubscribe(e=>{var{status:s,attendeeId:t}=e;return this.log(t,s)}))}activityStatus(e){return(0,D.z)([eu.I.shared(this.userId).visible(e).pi
3pe((0,ep.Z)(null)),ec.S.shared(this.userId).indication(e).pipe((0,ep.Z)(null))]).pipe((0,w.T)(e=>{var[s,t]=e;return t?{type:"text",trigger:t.trigger,duration:t.duration,elapsed:t.elapsed}:s?{type:s,trigger:"manual"}:null}),(0,ev.F)(ef()))}log(e,s){var t=this.shown,r=null!==t&&t.attendeeId===e;if(!t||s&&r||eh.shared(this.userId).logActivityStatusDisappeared({attendeeId:t.attendeeId,type:t.status.type,trigger:t.status.trigger,elapsed:Date.now()-t.shownAt}),!s){this.shown=null;return}eh.shared(this.userId).logActivityStatusShown(Object.assign({attendeeId:e,type:s.type,trigger:s.trigger},"auto"===s.trigger?{duration:s.duration,elapsed:s.elapsed}:{})),this.shown={attendeeId:e,status:s,shownAt:t&&r?t.shownAt:Date.now()}}}eb.shared=(0,P.G)(e=>new eb(e));var eg=t(79760),eI=t(22505);class ew{constructor(){this.fixateScroll=()=>{document.body.classList.add("scroll-fixation")},this.unFixateScroll=()=>{document.body.classList.remove("scroll-fixation")}}start(e){e.add((0,D.z)([eI.Y.shared().component,C.Y.shared().get(eg.A).store.rxState()]).pipe((0,w.T)(e=>{var[s,t]=e;return!!(s||t)}),(0,ev.F)()).subscribe(e=>{e?this.fixateScroll():this.unFixateScroll()}))}}ew.shared=(0,P.G)(()=>new ew);class eS{start(e){e.add(p.Session.shared().userIsUsual.pipe((0,g.s)(1)).subscribe(e=>{window.USER_SESSION_INFO={userIsUsual:e,authorized:!0}}))}}eS.shared=(0,P.G)(()=>new eS);var ey=t(38107),eA=t(41764),eT=t(90922),ex=t(71614),eC=t(2929),eF=t(94375);class eD extends(0,ex.yS)("app.start",60*eF.b.second){}var ek={label:eD.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},guid:e=>e.details.guid,"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"focus-state":e=>{var s;return null==(s=e.encounters.focusState)?void 0:s.details},"deep-link":e=>{var s;return(null==(s=e.details.deepLink)?void 0:s.uri)||void 0},"deep-link-type":e=>{var s;return(null==(s=e.details.deepLink)?void 0:s.type)||void 0},"letter-type":e=>{var s;return null==e||null==(s=e.encounters)||null==(s=s.letterType)?void 0:s.details},"letter-action-not-found-type":e=>{var s;return null==(s=e.encounters.letterActionNotFound)?void 0:s.details.type},"letter-action-not-found-id":e=>{var s;return null==(s=e.encounters.letterActionNotFound)?void 0:s.details.letterId},"letter-action-not-found-error":e=>{var s;return null==(s=e.encounters.letterActionNotFound)?void 0:s.details.error},"timeout-trigger":e=>{var s;return null==(s=e.encounters.timeoutTrigger)?void 0:s.details},"letter-id":e=>{var s;return null==e||null==(s=e.encounters)||null==(s=s.letterActionCompleted)?void 0:s.details.identifier},"letter-use-case-started":e=>{var s,t;return null!=e&&null!=(s=e.encounters)&&s.letterActionCompleted?!!(null!=e&&null!=(t=e.encounters)&&t.letterActionCompleted.details.encounters.useCaseStarted):void 0},"letter-interaction-started":e=>{var s,t;return null!=e&&null!=(s=e.encounters)&&s.letterActionCompleted?!!(null!=e&&null!=(t=e.encounters)&&t.letterActionCompleted.details.encounters.interactionStarted):void 0},"letter-failure-reason":e=>{var s;return null==e||null==(s=e.encounters)||null==(s=s.letterActionCompleted)||null==(s=s.details)||null==(s=s.encounters)||null==(s=s.completed)?void 0:s.details.error},"letter-text-rendered":e=>{var s;return!!(null!=(s=e.encounters.letterActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.textRendered)||void 0},"letter-cover-rendered":e=>{var s;return!!(null!=(s=e.encounters.letterActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.coverRendered)||void 0},"letter-profile-info-rendered":e=>{var s;return!!(null!=(s=e.encounters.letterActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.profileInfoRendered)||void 0},"letter-reply-button-rendered":e=>{var s;return!!(null!=(s=e.encounters.letterActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.replyButtonRendered)||void 0},"letter-attachments-rendered":e=>{var s;return!!(null!=(s=e.encounters.letterActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.attachmentsRendered)||void 0},"profile-alternative-communication-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.alternativeCommunicationRendered)||void 0},"profile-communication-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.communicationRendered)||void 0},"profile-cover-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.coverRe
3ndered)||void 0},"profile-few-words-aboutme-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.fewWordsAboutMeRendered)||void 0},"profile-gallery-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.galleryRendered)||void 0},"profile-name-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.nameRendered)||void 0},"profile-presence-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.presenceRendered)||void 0},"profile-thumbnail-rendered":e=>{var s;return!!(null!=(s=e.encounters.profileActionCompleted)&&null!=(s=s.details)&&null!=(s=s.encounters)&&s.thumbnailRendered)||void 0},"profile-editable":e=>{var s;return null==(s=e.encounters.profileActionCompleted)||null==(s=s.details)||null==(s=s.encounters)||null==(s=s.editableModeSet)?void 0:s.details},redirected:e=>{var s;return!!(null!=(s=e.encounters)&&s.redirected)}},hist:{ttresult:{from:"added",to:"completed"},ttinteract:{from:"added",to:"interactionReady"}}};eC.H.shared().registerMapping(eD.type,ek);var eE=t(91885);class ej extends(0,ex.XI)("users.profile.open",30*eF.b.second){}var eR={label:ej.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"bottle-neck-event":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?function(e){if(e)switch(e){case"coverRendered":return"cover.rendered";case"thumbnailRendered":return"thumbnail.rendered";case"nameRendered":return"name.rendered";case"fewWordsAboutMeRendered":return"few-words-about-me.rendered";case"communicationRendered":return"communication.rendered";case"galleryRendered":return"gallery.rendered";case"presenceRendered":return"presence.rendered";case"alternativeCommunicationRendered":return"alternative.communication-rendered";default:return e}}((0,ex.dj)(e)):void 0},cta:e=>e.details.cta,editable:e=>{var s;return!!(null!=(s=e.encounters.editableModeSet)&&s.details)},"design-version":e=>{var s;return(null==(s=e.encounters.designVersionSet)?void 0:s.details)||"default"},"profile-suspended":e=>{var s;return!!(null!=(s=e.encounters.profileSuspended)&&s.details)},"gallery-type":e=>{var s;return null==(s=e.encounters.galleryRendered)?void 0:s.details.type},"cover-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.coverRendered},"cover-is-default":e=>{var s;return null==(s=e.encounters.coverRendered)?void 0:s.details.coverIsDefault},"thumbnail-render-failed":e=>!e.encounters.thumbnailRendered,"name-render-failed":e=>!e.encounters.nameRendered,"few-words-about-me-render-failed":e=>!e.encounters.fewWordsAboutMeRendered,"communication-render-failed":e=>!e.encounters.communicationRendered,"gallery-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.galleryRendered},"presence-render-failed":e=>!e.encounters.presenceRendered,"alternative-communication-failed":e=>!e.encounters.alternativeCommunicationRendered,"about-me-render-failed":()=>void 0,"preferences-render-failed":()=>void 0,"interests-render-failed":()=>void 0,"profile-owner-presence":e=>{var s,t=null==(s=e.encounters.presenceRendered)?void 0:s.details;return t?t.online&&t.cameraAvailable?"online-with-cam":t.online?"online":"offline":void 0},"profile-banners-letter-showed":e=>{var s;return null==(s=e.encounters.alternativeCommunicationRendered)?void 0:s.details.sendEmailBannerVisible},"profile-banners-presents-showed":e=>{var s;return null==(s=e.encounters.alternativeCommunicationRendered)?void 0:s.details.presentsAvailable},"profile-banners-wishlist-showed":e=>{var s;return null==(s=e.encounters.alternativeCommunicationRendered)?void 0:s.details.wishlistBannerVisible},"user-profile-photos-data-prefilled":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.userPhotosFilled},"user-profile-videos-data-prefilled":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.userVideosFilled},"user-profile-data-prefilled":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.userProfileFilled},"user-cached-presence-data-prefilled":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.cachedPresenceFilled},"user-profile-thumbnail-image-preloaded":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.thumbnailImagePreloaded},"user-profile-cover-image-preloaded":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.coverImagePreloaded},"user-profile-gallery-images-preloaded":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.galleryImagesPreloaded},"user-profile-wishlist-preloaded":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.wishlistPreloaded},"user-profile-wishlist-banner-offering-preloaded":e=>{var s;return null==(s=e.details.preloadStatus)?void 0:s.wishlistBannerOfferingPreloaded},preloaded:e=>{var s,t,r,a,i,n,d,o,u,l,c,h,p,v,m,f;return(null==(s=e.encounters.designVersionSet)?void 0:s.details)==="dsgn5815"?(null==(l=e.details.preloadStatus)?void 0:l.userPhotosFilled)&&(null==(c=e.details.preloadStatus)?void 0:c.userVideosFilled)&&(null==(h=e.details.preloadStatus)?void 0:h.userProfileFilled)&&(null==(p=e.details.preloadStatus)?void 0:p.cachedPresenceFilled)&&(null==(v=e.details.preloadStatus)?void 0:v.thumbnailImagePreloaded)&&(null==(m=e.details.preloadStatus)?void 0:m.galleryImagesPreloaded)&&(null==(f=e.details.preloadStatus)?void 0:f.wishlistPreloaded):(null==(t=e.details.preloadStatus)?void 0:t.userPhotosFilled)&&(null==(r=e.details.preloadStatus)?void 0:r.userVideosFilled)&&(null==(a=e.details.preloadStatus)?void 0:a.userProfileFilled)&&(null==(i=e.details.preloadStatus)?void 0:i.cachedPresenceFilled)&&(null==(n=e.details.preloadStatus)?void 0:n.thumbnailImagePreloaded)&&(null==(d=e.details.preloadStatus)?void 0:d.coverImagePreloaded)&&(null==(o=e.details.preloadStatus)?void 0:o.galleryImagesPreloaded)&&(null==(u=e.details.preloadStatus)?void 0:u.wishlistPreloaded)}},hist:{ttresult:{from:"added",to:"completed"},ttinteract:{from:"added",to:"interactionReady"}
3,"ttcover-rendered":{from:"added",to:"coverRendered"},"ttthumbnail-rendered":{from:"added",to:"thumbnailRendered"},"ttname-rendered":{from:"added",to:"nameRendered"},"ttfew-words-about-me-rendered":{from:"added",to:"fewWordsAboutMeRendered"},"ttcommunication-rendered":{from:"added",to:"communicationRendered"},"ttgallery-rendered":{from:"added",to:"galleryRendered"},"ttpresence-rendered":{from:"added",to:"presenceRendered"},"ttalternative-communication-rendered":{from:"added",to:"alternativeCommunicationRendered"},"ttwishlist-banner-offering-data-loaded":{from:"added",to:"wishlistBannerOfferingDataLoaded"},"ttletter-sending-banner-offering-data-loaded":{from:"added",to:"letterSendingBannerOfferingDataLoaded"},"ttpresents-receiving-availability-data-loaded":{from:"added",to:"presentsReceivingAvailabilityDataLoaded"}}};eC.H.shared().registerMapping(ej.type,eR);class eO extends(0,ex.yS)("users.feed.open",30*eF.b.second){}var eM={label:eO.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},cta:e=>e.details.cta,"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"bottle-neck-event":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?(0,ex.dj)(e):void 0},"list-render-failed":e=>!e.encounters.listRendered,"email-confirmation-banner-render-failed":e=>!e.encounters.emailConfirmationBannerRendered,"unhide-profile-offer-banner-render-failed":e=>!e.encounters.unhideProfileOfferBannerRendered,"email-notifications-switch-on-offer-banner-render-failed":e=>!e.encounters.emailNotificationsSwitchOnOfferBannerRendered},hist:{ttresult:{from:"added",to:"rendered"},ttinteract:{from:"added",to:"interactionReady"},"ttlist-rendered":{from:"added",to:"listRendered"},"ttemail-confirmation-banner-rendered":{from:"added",to:"emailConfirmationBannerRendered"},"ttunhide-profile-offer-banner-rendered":{from:"added",to:"unhideProfileOfferBannerRendered"},"ttemail-notifications-switch-on-offer-banner-rendered":{from:"added",to:"emailNotificationsSwitchOnOfferBannerRendered"}}};eC.H.shared().registerMapping(eO.type,eM);class eG extends(0,ex.XI)("dialogs.letters.open",30*eF.b.second){}var eB={label:eG.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},guid:e=>e.details.guid,"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"bottle-neck-event":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?function(e){if(e&&"useCaseStarted"!==e&&"interactionStarted"!==e)switch(e){case"textRendered":return"text.rendered";case"coverRendered":return"cover.rendered";case"profileInfoRendered":return"profile-info.rendered";case"replyButtonRendered":return"reply-button.rendered";case"attachmentsRendered":return"attachments.rendered";default:return}}((0,ex.dj)(e)):void 0},cta:e=>e.details.cta,type:e=>e.details.type,"use-case-started":e=>!!e.encounters.useCaseStarted,"timeout-trigger":e=>{var s;return null==(s=e.encounters.timeoutTrigger)?void 0:s.details},"interaction-started":e=>!!e.encounters.interactionStarted,"text-render-failed":e=>!e.encounters.textRendered,"cover-render-failed":e=>!e.encounters.coverRendered,"profile-info-render-failed":e=>!e.encounters.profileInfoRendered,"reply-button-rendered":e=>!e.encounters.replyButtonRendered,"attachments-render-failed":e=>!e.encounters.attachmentsRendered,"media-attachments-count":e=>{var s;return null==(s=e.encounters.mediaAttachmentsCount)?void 0:s.details},"cheers-attachments-count":e=>{var s;return null==(s=e.encounters.cheersAttachmentsCount)?void 0:s.details},"child-failed":e=>{var s;return null==(s=e.encounters.childFailed)?void 0:s.details}},hist:{ttresult:{from:"added",to:"completed"},ttinteract:{from:"added",to:"interactionReady"},ttstarted:{from:"added",to:"started"},"tttext-rendered":{from:"added",to:"textRendered"},"ttcover-rendered":{from:"added",to:"coverRendered"},"ttprofile-info-rendered":{from:"added",to:"profileInfoRendered"},"ttreply-button-rendered":{from:"added",to:"replyButtonRendered"},"ttattachments-rendered":{from:"added",to:"attachmentsRendered"},"ttmedia-attachments-rendered":{from:"added",to:"mediaAttachmentsRendered"},"ttcheers-attachments-rendered":{from:"added",to:"cheersAttachmentsRendered"},"ttletter-complete":{from:"added",to:"letterComplete"},"tttext-complete":{from:"added",to:"textComplete"},"ttcover-complete":{from:"added",to:"coverComplete"},"ttprofile-info-complete":{from:"added",to:"profileInfoComplete"},"ttreply-button-complete":{from:"added",to:"replyButtonComplete"},"ttattachments-complete":{from:"added",to:"attachmentsComplete"},"tttext-rendering-started":{from:"added",to:"textRenderingStarted"}
3,"ttcover-rendering-started":{from:"added",to:"coverRenderingStarted"},"ttprofile-info-rendering-started":{from:"added",to:"profileInfoRenderingStarted"},"ttreply-button-rendering-started":{from:"added",to:"replyButtonRenderingStarted"},"ttmedia-attachments-rendering-started":{from:"added",to:"mediaAttachmentsRenderingStarted"},"ttcheers-attachments-rendering-started":{from:"added",to:"cheersAttachmentsRenderingStarted"},"ttmedia-attachments-waiting-children":{from:"added",to:"mediaAttachmentsWaitingChildren"},"ttcheers-attachments-waiting-children":{from:"added",to:"cheersAttachmentsWaitingChildren"},"ttprofile-info-waiting-children":{from:"added",to:"profileInfoWaitingChildren"},"ttletter-waiting-children":{from:"added",to:"letterWaitingChildren"},"ttuse-case-started":{from:"added",to:"useCaseStarted"}}};eC.H.shared().registerMapping(eG.type,eB);var eP=t(97983),e_=t(42618);class ez extends(0,ex.yS)("open.authorization",30*eF.b.second){}var eN={label:ez.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1}},hist:{ttresult:{from:"added",to:"completed"}}};eC.H.shared().registerMapping(ez.type,eN);var eL=t(68314),eq=t(40342),eV=t(10629),eQ=t(57856);class eU{constructor(){this.navigated=window?(0,K.h)((0,S.of)(window.location.hash),(0,eq.R)(window,"hashchange").pipe((0,w.T)(()=>window.location.hash))).pipe((0,ea.p)(e=>0>e.indexOf("&")&&0>e.indexOf("?")),(0,ev.F)(),(0,eV.i)(1),(0,w.T)(e=>(0,eQ.E)(window.location.pathname+window.location.search+e))):k.w}}eU.shared=(0,P.G)(()=>new eU);var eY=t(79942),eJ=t(39971),eW=t(11922),eH=t(81174);class eX{constructor(){this.trackerStarted=new ey.m(1)}start(e){var s=new Date(eA.c.shared().timestamp),t=(0,N.A)();e.add(eU.shared().navigated.pipe((0,I.n)(()=>this.trackerStarted)).safeSubscribe(()=>{eT.E.shared().encounter(eD.identifier(),{date:new Date,name:"redirected",details:null})})),e.add(eW.r.shared().focusState.pipe((0,I.n)(e=>this.trackerStarted.pipe((0,eP.u)(e)))).safeSubscribe(e=>{eT.E.shared().encounter(eD.identifier(),{date:new Date,name:"focusState",details:e},!0)})),e.add(eA.c.shared().deepLink.pipe((0,eY.Fg)(e=>{var r,a,i;return(eT.E.shared().add(new eD(s,{deepLink:e,guid:t},void 0)),this.trackerStarted.next(void 0),(null==e?void 0:e.type)==="profile")?(r=e.args.userId,eT.E.shared().add(new ej(r,s,{cta:"app-open"})),(0,K.h)(p.Session.shared().userId.pipe((0,b.o)(),(0,I.n)(()=>R.F.shared(r).canEdit),(0,g.s)(1),(0,ee.M)(e=>{eT.E.shared().encounter(ej.identifier(r),{name:"editableModeSet",details:e,date:new Date})}),(0,I.n)(()=>k.w)),"web"===(0,e_.platform)()?p.Session.shared().userId.pipe((0,b.o)(),(0,I.n)(()=>eH.u.shared().version),(0,g.s)(1),(0,ee.M)(e=>{eT.E.shared().encounter(ej.identifier(r),{name:"designVersionSet",details:e,date:new Date})}),(0,I.n)(()=>k.w)):k.w,p.Session.shared().userId.pipe((0,I.n)(e=>e?eT.E.shared().actionCompleted.pipe((0,I.n)(e=>{if(e.name===ej.type&&e.identifier===r){var s,t;return null!=e&&e.encounters&&eT.E.shared().encounter(eD.identifier(),{date:new Date,name:"profileActionCompleted",details:e}),eT.E.shared().complete(eD.identifier(),(null==e||null==(s=e.encounters)||null==(s=s.completed)?void 0:s.date)||new Date,(null==e||null==(t=e.encounters)||null==(t=t.completed)?void 0:t.details)||eE.Q.failure("failed")),(0,S.of)(void 0)}return k.w})):eT.E.shared().actionCompleted.pipe((0,I.n)(e=>{if(e.name===ez.type){var s,t,a=(null==e||null==(s=e.encounters)||null==(s=s.completed)?void 0:s.date)||new Date;return eT.E.shared().complete(ej.identifier(r),a,eE.Q.failure("cancelled-by-auth")),eT.E.shared().complete(eD.identifier(),a,(null==e||null==(t=e.encounters)||null==(t=t.completed)?void 0:t.details)||eE.Q.failure("cancelled-by-auth")),(0,S.of)(void 0)}return k.w}))))).toSingle()):(null==e?void 0:e.type)==="letter"?(a=e.args.letterId,i=e.args.letterType,eT.E.shared().add(new eG(a,s,{cta:"app-open",type:i,guid:t})),eT.E.shared().encounter(eG.identifier(a),{date:new Date,name:"started",details:null}),eT.E.shared().encounter(eD.identifier(),{date:s,name:"letterType",details:i}),p.Session.shared().userId.pipe((0,I.n)(e=>e?eT.E.shared().actionCompleted.pipe((0,I.n)(e=>{if(e.name===eL.y.type){var s,t,r=(null==(s=e.encounters.completed)?void 0:s.date)||new Date;return eT.E.shared().encounter(eD.identifier(),{date:r,name:"interactionReady",details:null}),eT.E.shared().complete(eD.identifier(),r,(null==e||null==(t=e.encounters)||null==(t=t.completed)?void 0:t.details)||eE.Q.failure("failed")),(0,S.of)(void 0)}
3if(e.name===eG.type&&e.identifier===a){e.encounters&&eT.E.shared().encounter(eD.identifier(),{date:new Date,name:"letterActionCompleted",details:e});var i=e.encounters.completed,n=null==i?void 0:i.details.error;return"no-credits"===n?k.w:(eT.E.shared().complete(eD.identifier(),(null==i?void 0:i.date)||new Date,n?eE.Q.failure(n):eE.Q.success()),(0,S.of)(void 0))}return k.w})):eT.E.shared().actionCompleted.pipe((0,I.n)(e=>{if(e.name===ez.type){var s,t,r=(null==e||null==(s=e.encounters)||null==(s=s.completed)?void 0:s.date)||new Date;return eT.E.shared().complete(eG.identifier(a),r,eE.Q.failure("cancelled-by-auth")),eT.E.shared().complete(eD.identifier(),r,(null==e||null==(t=e.encounters)||null==(t=t.completed)?void 0:t.details)||eE.Q.failure("cancelled-by-auth")),(0,S.of)(void 0)}return k.w})))).toSingle()):(null==e?void 0:e.type)==="feed"?("web"===(0,e_.platform)()&&eT.E.shared().add(new eO(s,{cta:"app-open"})),p.Session.shared().userId.pipe((0,I.n)(e=>e?eT.E.shared().actionCompleted.pipe((0,I.n)(e=>{if(e.name===eO.type){var s,t,r,a=[null==e||null==(s=e.encounters)||null==(s=s.interactionReady)?void 0:s.date].filter(e=>!!e).sort().reverse();return null!=a&&a.length&&eT.E.shared().encounter(eD.identifier(),{date:a[0],name:"interactionReady",details:null}),eT.E.shared().complete(eD.identifier(),(null==e||null==(t=e.encounters)||null==(t=t.rendered)?void 0:t.date)||new Date,null==e||null==(r=e.encounters)||null==(r=r.completed)?void 0:r.details),(0,S.of)(void 0)}return k.w})):eT.E.shared().actionCompleted.pipe((0,I.n)(e=>{if(e.name===ez.type){var s,t,r=(null==e||null==(s=e.encounters)||null==(s=s.completed)?void 0:s.date)||new Date;return eT.E.shared().complete(eO.identifier(),r,eE.Q.failure("cancelled-by-auth")),eT.E.shared().complete(eD.identifier(),r,(null==e||null==(t=e.encounters)||null==(t=t.completed)?void 0:t.details)||eE.Q.failure("cancelled-by-auth")),(0,S.of)(void 0)}return k.w})))).toSingle()):new eJ.v(e=>{setTimeout(()=>{eT.E.shared().complete(eD.identifier(),s,eE.Q.success()),e.success(void 0)},50)})})).safeSubscribe())}}eX.shared=(0,P.G)(()=>new eX);var eZ=t(85081),e$=t(95732),eK=t(38792),e0=t.n(eK);class e1{constructor(){this.onRegisterOverlayShown=()=>{var e=new Date;eT.E.shared().add(new ez(e,{cta:"app-open"})),eT.E.shared().complete(ez.identifier(),e,eE.Q.success())}}start(e){e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,ev.F)(e0()),(0,w.T)(e=>null==e?void 0:e.name),(0,ea.p)(e=>"register"===e)).safeSubscribe(this.onRegisterOverlayShown))}}e1.shared=(0,P.G)(()=>new e1);var e5=t(10845),e3=t(57043),e2=t(27888);class e8{constructor(){this.purchaseFormShown=!1,this.onCallPaymentRequired=()=>{this.purchaseFormShown||p.Session.shared().userId.pipe((0,I.n)(e=>e?M.f.shared(e).userIsFeaturedMember:k.w),(0,g.s)(1),(0,I.n)(e=>e?(0,S.of)(void 0):e3.w.shared().add({name:e2.N.Call}).asObservable().pipe((0,ee.M)(()=>{this.purchaseFormShown=!0})))).safeSubscribe()},this.onCallPaymentFullFilled=()=>{this.purchaseFormShown=!1}}start(e){e.add(p.Session.shared().userId.pipe((0,I.n)(e=>e?C.Y.shared().get(e5.A,e).store.rxState():(0,S.of)(void 0))).subscribe(e=>{(null==e?void 0:e.status)==="idle"&&(this.purchaseFormShown=!1)})),e.add(new y.c(()=>(er.g.shared().addListener("event.call.payment.required",this.onCallPaymentRequired),er.g.shared().addListener("event.call.payment.fullfilled",this.onCallPaymentFullFilled),()=>{er.g.shared().removeListener("event.call.payment.required",this.onCallPaymentRequired),er.g.shared().removeListener("event.call.payment.fullfilled",this.onCallPaymentFullFilled)})).subscribe())}}e8.shared=(0,P.G)(()=>new e8);class e4{constructor(e){this.userId=e}start(e){e.add(eW.r.shared().focusState.pipe((0,w.T)(e=>"gone"!==e),(0,ev.F)()).safeSubscribe(e=>{f.I.shared(this.userId).controlConnection(e)})),e.add(T.T.shared().webSocketConnectionEnabled.pipe((0,ea.p)(e=>!e),(0,g.s)(1)).safeSubscribe(()=>{f.I.shared(this.userId).disableWebsocketConnection()}))}}e4.shared=(0,P.G)(e=>new e4(e));var e6=t(46822),e9=t(63578);class e7{constructor(){this.onChatMessagesLoaded=e=>{el.j.shared().chatAttendee.pipe((0,g.s)(1)).safeSubscribe(s=>{s===e&&e6.c.shared().profileId.pipe((0,g.s)(1)).safeSubscribe(s=>{s&&s===e||(this.checkAbleToNavigateToProfile()?setTimeout(function(){(0,e9.L)(e,{source:"chat"}).safeSubscribe()},0):l.A.emit("command.profile.preload",e))})})},this.checkAbleToNavigateToProfile=()=>window.matchMedia("(min-width: 768px)").matches}start(e){e.add(new y.c(()=>(l.A.sync("event.chat.messages.loaded",this.onChatMessagesLoaded),()=>{l.A.removeListener("event.chat.messages.loaded",this.onChatMessagesLoaded)})).subscribe())}}e7.shared=(0,P.G)(()=>new e7);class se extends(0,ex.XI)("dialogs.media.outgoing.call"){}function ss(e){var s,t,r=(null==(s=e.encounters.completed)?void 0:s.details.error)||(null==(t=e.encounters.completed)||null==(t=t.details.value)?void 0:t.finishReason);return e.encounters.apiErrorCatch?"api":!e.encounters.incomingStreamStarted&&e.encounters.paymentRequired?"credits":r}var st={label:se.type,tags:{team:()=>"vc",cta:e=>e.details.cta,success:e=>!!e.encounters.connected,"attendee-is-featured-member":e=>{var s;return null==(s=e.encounters.attendeeProfileDetermined)?void 0:s.details.popular},"attendee-id":e=>{var s;return null==(s=e.encounters.attendeeProfileDetermined)?void 0:s.details.id},"attendee-gender":e=>{var s;return null==(s=e.encounters.attendeeProfileDetermined)?void 0:s.details.gender},"attendee-camera":e=>{var s,t=null==(s=e.encounters.attendeeDevices)?void 0:s.details;if(t){var{cam:r,mobilecam:a}=t.reduce((e,s)=>
3(("mobilecam"===s.name||"cam"===s.name)&&(e[s.name]=!0),e),{cam:!1,mobilecam:!1});return r&&a?"cam-and-mobilecam":r?"cam":a?"mobilecam":"no-cam"}},"attendee-online-status":e=>{var s;return null==(s=e.encounters.attendeeOnlineStatus)?void 0:s.details},"user-id":e=>{var s;return null==(s=e.encounters.userProfileDetermined)?void 0:s.details.id},gender:e=>{var s;return null==(s=e.encounters.userProfileDetermined)?void 0:s.details.gender},"api-reason":e=>{var s;return null!=(s=e.encounters.apiErrorCatch)&&s.details.status?""+Math.floor(e.encounters.apiErrorCatch.details.status/100):void 0},"noreply-reason":e=>["incoming-message","timeout","decline","video-call"].includes(ss(e)||"")?ss(e):void 0,"cancel-reason":e=>["stop-button","chat-closed","app-closed","cancelled-by-user","cancelled-by-action"].includes(ss(e)||"")?ss(e):void 0,"webrtc-reason":e=>["ice-failed","ice-disconnected","sdp-error"].includes(ss(e)||"")?ss(e):void 0,connection:e=>{var s;return null==(s=e.encounters.connected)?void 0:s.details.type},"request-sent":e=>!!e.encounters.requestSent,"reply-received":e=>!!e.encounters.answered,"pong-received":e=>!!e.encounters.pongReceived,"attendee-network-effective-type":e=>{if(e.encounters.pongReceived)return e.encounters.pongReceived.details.network.effectiveType||"unavailable"},"attendee-network-connection-type":e=>{if(e.encounters.pongReceived)return e.encounters.pongReceived.details.network.type||"unavailable"},"attendee-camera-enabled":e=>{var s;return null==(s=e.encounters.pongReceived)?void 0:s.details.cameraEnabled},"remote-audio-enabled":e=>{var s;return null==(s=e.encounters.audioTrackReceived)?void 0:s.details.enabled},"remote-audio-muted":e=>{var s;return null==(s=e.encounters.audioTrackReceived)?void 0:s.details.muted},"remote-audio-tracks":e=>{var s;return null==(s=e.encounters.audioTrackReceived)?void 0:s.details.numberOfTracks},"reply-platform":e=>{var s;return null==(s=e.encounters.answered)||null==(s=s.details.attendeeReplyPlatform)?void 0:s.toLowerCase()},"attendee-platform":e=>{var s;return null==(s=e.encounters.attendeeReplyPlatformInfo)||null==(s=s.details.attendeePlatform)?void 0:s.toLowerCase()},"attendee-os":e=>{var s;return null==(s=e.encounters.attendeeReplyPlatformInfo)||null==(s=s.details.attendeeOperatingSystem)?void 0:s.toLowerCase()},auto:e=>{var s;return null==(s=e.encounters.answered)?void 0:s.details.autoAccepted},"attendee-product":e=>{var s;return null==(s=e.encounters.pongReceived)?void 0:s.details.product},"webrtc-local-audio-volume-arr":e=>e.encounters.webRtcStatsCollected?JSON.stringify(e.encounters.webRtcStatsCollected.details.localVolumeArray):void 0,"webrtc-remote-audio-volume-arr":e=>e.encounters.webRtcStatsCollected?JSON.stringify(e.encounters.webRtcStatsCollected.details.remoteVolumeArray):void 0,reason:e=>{var s=ss(e);if(s)switch(s){case"timeout":case"decline":case"incoming-message":case"video-call":return"noreply";case"stop-button":case"chat-closed":case"app-closed":case"cancelled-by-action":case"cancelled-by-user":return"cancel";case"ice-failed":case"ice-disconnected":case"sdp-error":return"webrtc";default:return s}},stage:e=>e.encounters.incomingStreamStarted?"remote-stream-playing-started":e.encounters.connected?"webrtc-connected":e.encounters.answered?"reply-received":e.encounters.pongReceived?"pong-received":e.encounters.requestSent?"request-sent":e.encounters.iceGathered?"ice-gathered":e.encounters.sdpOfferCreated?"sdp-offer-created":"call-initiated","user-has-credits":e=>{var s;return null==(s=e.encounters.userHasCreditsDetermined)?void 0:s.details}},hist:{ttreply:{from:"added",to:"answered"},ttoffersent:{from:"added",to:"offerSent"},ttanswersent:{from:"offerReceived",to:"answerSent"},ttvideostartafteranswer:{from:"answerReceived",to:"incomingStreamStarted"},ttconnect:{from:"answered",to:"initializationEnded"},ttresult:{from:"added",to:"initializationEnded"},"stream-time":{from:"incomingStreamStarted",to:"completed"},ttoffer:{from:"offerSent",to:"offerReceived"},ttanswer:{from:"answerSent",to:"answerReceived"},ttend:{from:"added",to:"completed"}}};eC.H.shared().registerMapping(se.type,st);var sr=t(4938);class sa{constructor(e){this.userId=e}start(e){er.g.shared().addListener("event.call.request.sent",this.onCallRequestSend),e.add(f.I.shared(this.userId).events("event.dialogs.media.messages.added").pipe((0,ea.p)(e=>{var s,{network:t}=e;return!e.in&&!e.out&&(null==t||null==(s=t.sdp)?void 0:s.type)==="answer"})).safeSubscribe(e=>{var{network:s,"sender-id":t}=e;if(s["last-incoming-message-receive-timestamp"]){var r=s["last-incoming-message-receive-timestamp"];sr.E.shared().mapServerDateToLocal(r,e=>{eT.E.shared().encounter(se.identifier(t),{date:new Date(e),name:"offerReceived",details:null})})}if(s["send-timestamp"]){var a=s["send-timestamp"];sr.E.shared().mapServerDateToLocal(a,e=>{eT.E.shared().encounter(se.identifier(t),{date:new Date(e),name:"answerSent",details:null})}),sr.E.shared().now(e=>{sr.E.shared().mapServerDateToLocal(e,e=>{eT.E.shared().encounter(se.identifier(t),{date:new Date(e),name:"answerReceived",details:null})})})}})),e.add(()=>er.g.shared().removeListener("event.call.request.sent",this.onCallRequestSend))}
3onCallRequestSend(e,s){var t,{network:r}=s;if((null==r||null==(t=r.sdp)?void 0:t.type)==="offer"&&r["send-timestamp"]){var a=r["send-timestamp"];sr.E.shared().mapServerDateToLocal(a,s=>{eT.E.shared().encounter(se.identifier(e),{date:new Date(s),name:"offerSent",details:null})})}}}sa.shared=(0,P.G)(e=>new sa(e));class si{start(){sr.E.shared().currentTime().safeSubscribe()}}si.shared=(0,P.G)(()=>new si);var sn=t(74380),sd=t(10143),so=t(63440),su=t(50626),sl=t(27331);class sc{constructor(e){this.userId=e}start(e){e.add(so.J.shared(this.userId).queue.pipe((0,ep.Z)([]),(0,su.J)()).safeSubscribe(e=>{var[s,t]=e,r=new Set(s.map(e=>e.id));t.filter(e=>!r.has(e.id)).forEach(e=>{sl.L.shared(this.userId).logQueued(e)})})),e.add(so.J.shared(this.userId).closedInvite.safeSubscribe(e=>{var{invite:s,reason:t}=e;sl.L.shared(this.userId).logClosed(s,t)}))}}sc.shared=(0,P.G)(e=>new sc(e));class sh{constructor(e){this.userId=e}start(e){e.add(eW.r.shared().focusState.pipe((0,ev.F)(),(0,ea.p)(e=>"focused"===e),(0,I.n)(()=>M.f.shared(this.userId).userIsFeaturedMember)).safeSubscribe())}}sh.shared=(0,P.G)(e=>new sh(e));var sp=t(8733),sv=t(44383),sm=t(14316),sf=t(78321),sb=t(69989);class sg{constructor(e){this.upload=(e,s,t)=>sb.x.shared(this.userId).upload(e,s,t),this.patchFragmentData=(e,s,t,r)=>sb.x.shared(this.userId).patchFragmentData(e,s,t,r),this.userId=e}}sg.shared=(0,P.G)(e=>new sg(e));var sI=t(74423),sw=t(86013);class sS{constructor(e){this.videoChatDescriptions=new Z.t({}),this.callFragmentUploaderSubject=new sp.B,this.streamSubject=new sp.B,this.streamRecordSubject=ne
3w ey.m(1),this.streamRecord=this.streamRecordSubject.asObservable(),this.userId=e;var s="video/webm;codecs=vp9,opus";MediaRecorder&&!MediaRecorder.isTypeSupported(s)&&(s="video/webm;codecs=vp8,opus",!MediaRecorder.isTypeSupported(s)&&(s="video/webm",MediaRecorder.isTypeSupported(s)||(s=""))),this.options={mimeType:s}}recordStream(e,s,t,r,a){return new y.c(i=>{if(r.getTracks().length){var n,d=[];try{n=new MediaRecorder(r,this.options)}catch(e){i.error(e);return}n.start(),n.ondataavailable=e=>{e.data&&e.data.size>0&&d.push(e.data)};var o=setTimeout(()=>{"recording"===n.state&&n.stop()},a),u=String((0,N.A)());n.onstop=()=>{if(d.length){var t=new Blob(d,{type:"video/webm"});t.uri=u,this.callFragmentUploaderSubject.next({type:e,file:t,attendee:s})}};var l=new Date().getTime();return()=>{var e=new Date().getTime();this.videoChatDescriptions.next(Object.assign({},this.videoChatDescriptions.getValue(),{[u]:Object.assign({},this.videoChatDescriptions.getValue()[u],{duration:e-l,sessionId:t})})),"recording"===n.state&&n.stop(),o&&clearTimeout(o)}}})}uploadCallFragment(e){var{type:s,file:t,attendee:r}=e;return sg.shared(this.userId).upload(s,r,t).pipe((0,ea.p)(e=>"complete"===e.name),(0,I.n)(e=>this.videoChatDescriptions.pipe((0,ea.p)(e=>void 0!==e[t.uri]),(0,g.s)(1),(0,w.T)(s=>Object.assign({},s[t.uri],{uri:t.uri,basename:e.basename})))),(0,I.n)(e=>sw.H.shared(this.userId).userIsWellKnown(r).pipe((0,g.s)(1),(0,w.T)(s=>Object.assign({},e,{new:!s})))),(0,I.n)(e=>sg.shared(this.userId).patchFragmentData(s,r,e.basename,{description:{type:s,new:e.new,duration:e.duration,sessionId:e.sessionId}}).pipe((0,ee.M)(()=>{var s=this.videoChatDescriptions.getValue();delete s[e.uri],this.videoChatDescriptions.next(s)}))))}getCallState(){return(0,D.z)([T.T.shared().callFragmentRecording.enabled,sI.E.shared(this.userId).presentInFeed]).pipe((0,I.n)(e=>{var[s,t]=e;return s&&t?C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,ev.F)((e,s)=>"speaking"===s.status?s.status===e.status&&s.attendee===e.attendee:s.status===e.status)):k.w}))}getLocalStreamData(e){var s=new sf.I(this.userId,e.attendee).localVideo.pipe((0,b.o)()),t=T.T.shared().callFragmentRecording.duration;return(0,D.z)([(0,S.of)(e),s,t]).pipe((0,g.s)(1))}getRemoteStreamData(e){return(0,D.z)([R.F.shared(e.attendee).profile.pipe((0,w.T)(e=>{var s;return(null==(s=e.value)?void 0:s.gender)==="fem"})),M.f.shared(this.userId).userIsSuperFeaturedMember]).pipe((0,g.s)(1),(0,I.n)(s=>{var[t,r]=s;if(!t&&!r)return k.w;var a=T.T.shared().callFragmentRecording.duration,i=new sf.I(this.userId,e.attendee).remoteVideo.pipe((0,ev.F)(),(0,w.T)(e=>e&&e.active?e:null),(0,sv.S)((e,s)=>{if(!e.streamAlreadyObtained)if(s)return{stream:s,streamAlreadyObtained:!0};else return e;return{stream:null,streamAlreadyObtained:!0}},{stream:null,streamAlreadyObtained:!1}),(0,w.T)(e=>e.stream));return(0,D.z)([(0,S.of)(e),i,a])}))}start(e){MediaRecorder&&(e.add(this.getCallState().pipe((0,ee.M)(e=>{"speaking"!==e.status?this.streamSubject.next(null):this.streamSubject.next({attendee:e.attendee,sessionId:String((0,N.A)())})})).safeSubscribe()),e.add(this.streamSubject.pipe((0,I.n)(e=>e?this.getLocalStreamData(e).pipe((0,I.n)(e=>{var[{attendee:s,sessionId:t},r,a]=e;return this.recordStream("local",s,t,r,a)})):(0,S.of)(null))).subscribe({error:e=>this.streamRecordSubject.next(eE.Q.failure({message:e.message,name:e.name}))})),e.add(this.streamSubject.pipe((0,I.n)(e=>e?this.getRemoteStreamData(e).pipe((0,I.n)(e=>{var[{attendee:s,sessionId:t},r,a]=e;return r?this.recordStream("remote",s,t,r,a):(0,S.of)(null)})):(0,S.of)(null))).safeSubscribe()),e.add(this.callFragmentUploaderSubject.pipe((0,ee.M)(e=>"local"===e.type&&this.streamRecordSubject.next(eE.Q.success())),(0,sm.Z)(e=>this.uploadCallFragment(e))).safeSubscribe()))}}sS.shared=(0,P.G)(e=>new sS(e));class sy{constructor(e){this.userId=e}logFragmentRecordSuccess(){W._.shared(this.userId).logEvent("video-fragment-record-successful",{}).safeSubscribe()}logFragmentRecordError(e,s){W._.shared(this.userId).logEvent("video-fragment-record-unsuccessful",{name:e,message:s}).safeSubscribe()}}sy.shared=(0,P.G)(e=>new sy(e));class sA{constructor(e){this.userId=e}start(e){e.add(T.T.shared().callFragmentRecording.enabled.pipe((0,I.n)(e=>e?sS.shared(this.userId).streamRecord:k.w)).safeSubscribe(e=>{e&&(e.isSuccessful?sy.shared(this.userId).logFragmentRecordSuccess():sy.shared(this.userId).logFragmentRecordError(e.error.name,e.error.message))}))}}sA.shared=(0,P.G)(e=>new sA(e));var sT=()=>new URL(L.T.shared().support.salesforce.helpcenterUrl).origin;class sx{constructor(e){this.postMessage=(e,s)=>{s&&s.postMessage(JSON.stringify({label:"event.encoded.email.sent",encodedEmail:e}),sT())},this.onHelpCenterMessageSubmit=e=>{var s=sT();if(e.origin===s){var t=e.data,r=window.frames["help-center"];r&&z.shared(this.userId).encodeEmail(t).pipe((0,g.s)(1)).subscribe(e=>this.postMessage(e,r),()=>this.postMessage("",r))}},this.userId=e}start(e){window.addEventListener("message",this.onHelpCenterMessageSubmit),e.add(()=>{window.removeEventListener("message",this.onHelpCenterMessageSubmit)})}}sx.shared=(0,P.G)(e=>new sx(e));var sC=t(35492),sF=t(83114),sD=t(79960),sk=t(17624),sE=t(73628),sj=t(99185);class sR{constructor(e){this.userId=e}start(e){e.add(f.I.shared(this.userId).events("event.users.events.added").pipe((0,ea.p)(e=>e.type===sE._j.MessageFromContact),(0,w.T)(e=>{var s;return null==(s=e.payload)?void 0:s["sender-id"]}),(0,b.o)()).safeSubscribe(e=>{sj.P.shared(this.userId).tags(e).pipe((0,g.s)(1)).safeSubscribe()}))}}sR.shared=(0,P.G)(e=>new sR(e));var sO=t(36094);function sM(){C.Y.shared().get(eg.A).actions.open("write-to-contacts-recommendation",[{props:{}}])}var sG=t(91733),sB=t(82019),sP=t(75900),s_=t(45898);function sz(){C.Y.shared().get(eg.A).actions.open("write-to-birthday-contacts-recommendation",[{props:{}}])}function sN(e,s){return e.pipe((0,g.s)(1),(0,I.n)(t=>t.length>0?(s(),e.pipe((0,ea.p)(e=>0===e.length),(0,g.s)(1),(0,eP.u)(void 0))):(0,S.of)(void 0)))}class sL{constructor(e){this.userId=e}start(e){var s=sN(s_.D.shared(this.userId).contacts,sz),t=sN(sG._.shared(this.userId).contacts,sM);e.add(sO.w.shared().userDistractionAllowed.pipe((0,ep.Z)(!1),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return t&&!s}),(0,g.s)(1),(0,sB.K)((0,sP.x)(s,t))).safeSubscribe())}}sL.shared=(0,P.G)(e=>new sL(e));class sq{constructor(e){this.userId=e}logChatWithContactsRecommended(e){W._.shared(this.userId).logEvent("chat-with-contacts-recommended",{"user-id":this.userId,contacts:e}).safeSubscribe()}}sq.shared=(0,P.G)(e=>new sq(e));var sV=t(12275);class sQ{constructor(e){this.userId=e}start(e){e.add(sV.O.shared().visible.pipe((0,I.n)(e=>e?sG._.shared(this.userId).contacts:k.w),(0,ev.F)(ef())).safeSubscribe(e=>{sq.shared(this.userId).logChatWithContactsRecommended(e)}))}}sQ.shared=(0,P.G)(e=>new sQ(e));class sU{constructor(e){this.userId=e}logChatWithBirthdayContactsRecommended(e){W._.shared(this.userId).logEvent("chat-with-birthday-contacts-recommended",{"user-id":this.userId,contacts:e}).safeSubscribe()}logChatWithBirthdayContactsRecomendationIgnored(){W._.shared(this.userId).logEvent("chat-with-birthday-contacts-ignored",{"user-id":this.userId}).safeSubscribe()}}sU.shared=(0,P.G)(e=>new sU(e));var sY=t(78546);class sJ{constructor(e){this.userId=e}start(e){e.add(sY.b.shared().visible.pipe((0,I.n)(e=>e?s_.D.shared(this.userId).contacts:k.w),(0,ev.F)(ef())).safeSubscribe(e=>{sU.shared(this.userId).logChatWithBirthdayContactsRecommended(e)})),e.add(s_.D.shared(this.userId).recommendationsIgnored.safeSubscribe(()=>{sU.shared(this.userId).logChatWithBirthdayContactsRecomendationIgnored()}))}}sJ.shared=(0,P.G)(e=>new sJ(e));var sW=t(85285),sH=t(28280),sX=t(59113);class sZ{constructor(e){this.userId=e}start(e){e.add(sX.G.shared(this.userId).requested.pipe((0,I.n)(()=>G.s.shared().email.pipe((0,g.s)(1)))).safeSubscribe(e=>
3{e&&sH.X.shared().notifyUser({type:sW._.EmailConfirmationSent,payload:{email:e}},sW.A.Normal)}))}}sZ.shared=(0,P.G)(e=>new sZ(e));class s${constructor(e){this.userId=e}start(e){e.add((0,K.h)(sX.G.shared(this.userId).emailConfirmed.pipe((0,ep.Z)(null),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!!(!1===s&&t)})),sX.G.shared(this.userId).confirmIntention.pipe((0,eP.u)(!0))).pipe((0,g.s)(1)).safeSubscribe(()=>{sH.X.shared().notifyUser({type:sW._.EmailConfirmed},sW.A.Normal)}))}}s$.shared=(0,P.G)(e=>new s$(e));var sK=t(60308),s0=t(48945);class s1{start(e){e.add(new y.c(e=>{var s=()=>{e.next()};return l.A.sync("command.email.confirmed.successful",s),()=>{l.A.removeListener("command.email.confirmed.successful",s)}}).pipe((0,I.n)(()=>(0,D.z)([sn.o.shared().data().pipe((0,ea.p)(e=>!!e.id)),T.T.shared().mailProviders]).pipe((0,g.s)(1)))).safeSubscribe(e=>{var s,[t,r]=e,a=t.email?(0,sK.wj)(t.email):null,i=!!a&&Object.values(r).some(e=>e.domain===a.domain);s0.T.shared().logOnboardingEmailConfirmationCompletedViewed(i),J.R.shared().logEvent({event:"application_account_confirm_email",payload:{authorized_variable:{id:t.id,email:t.email,authorizationMethod:t.authorizationMethod,authorizationAction:t.authorizationAction,product:null!=(s=t.product)?s:L.T.shared().product}}})}))}}s1.shared=(0,P.G)(()=>new s1);class s5{start(e){e.add(new y.c(()=>{var e="public",s=()=>{s0.T.shared().logOnboardingUploadPhotoView()},t=e=>{var s;(null==(s=e.form)?void 0:s.name)==="complete-photos-form"&&("back"===e.name?s0.T.shared().logOnboardingUploadPhotoBackButtonClick():"success"===e.name&&s0.T.shared().logOnboardingUploadPhotoCompleted())},r=()=>{s0.T.shared().logOnboardingUploadPhotoNextButtonClick(e)},a=s=>{e=(null==s?void 0:s.photoVisibility)==="private"?"private":"public",s0.T.shared().logOnboardingUploadPhotoVisibilityCheckboxClick(e)};return l.A.sync("event.overlay.complete-photos.opened",s),l.A.sync("command.analytics.forms.send",t),l.A.sync("event.profile.photos.changed",r),l.A.sync("event.onboarding.photo-privacy-changed",a),()=>{l.A.removeListener("event.overlay.complete-photos.opened",s),l.A.removeListener("command.analytics.forms.send",t),l.A.removeListener("event.profile.photos.changed",r),l.A.removeListener("event.onboarding.photo-privacy-changed",a)}}).subscribe())}}s5.shared=(0,P.G)(()=>new s5);class s3{constructor(e){this.userId=e}start(e){e.add(new y.c(e=>{var s=()=>{e.next(!0)};return l.A.sync("command.email.confirmed.successful",s),()=>{l.A.removeListener("command.email.confirmed.successful",s)}}).pipe((0,I.n)(()=>sD.o.shared(this.userId).data("electronicmail")),(0,ea.p)(e=>!e.some(e=>e.confirmed)),(0,g.s)(1)).safeSubscribe(()=>{sD.o.shared(this.userId).refresh()}))}}s3.shared=(0,P.G)(e=>new s3(e));var s2=t(37871),s8=t(32248),s4=t(29808);class s6 extends(0,ex.XI)("dialogs.automation.videoinvitation.received"){}var s9={label:s6.type,tags:{team:()=>"vc"},hist:{}};eC.H.shared().registerMapping(s6.type,s9);class s7{constructor(e){this.log=e=>{var{senderId:s,type:t,reference:r,recommended:a,freeMinuteLabel:i}=e;if(t===s2.W.VideoInvitation){var n=new Date;eT.E.shared().add(new s6(s,n,{})),eT.E.shared().complete(s6.identifier(s),n,eE.Q.success())}s2.Z.shared(this.userId).logInviteReceived(s,t,r,a,i)},this.userId=e}start(e){var s=T.T.shared().videoInvites.intensityReduction.enabled.pipe((0,I.n)(e=>e?f.I.shared(this.userId).events("event.dialogs.automation.videoinvitations.matched").pipe((0,w.T)(e=>(0,s4.x)(e)),(0,w.T)(e=>(0,sE.dR)((0,s4.f)(e)))):f.I.shared(this.userId).events("event.users.events.added").pipe((0,w.T)(e=>(0,sE.dR)((0,s4.f)(e))))));e.add(s.pipe((0,ea.p)(e=>e.payload["recipient-id"]===this.userId),(0,ea.p)(e=>e.type===sE._j.VideoInvitation),(0,I.n)(e=>T.T.shared().mcs.freeMinutesPack.enabled.pipe((0,w.T)(s=>{var t,r;return{type:s2.W.VideoInvitation,senderId:e["user-id"],reference:null==(t=e.payload)||null==(t=t.meta)?void 0:t.reference,recommended:!!(null!=(r=e.payload)&&null!=(r=r.meta)&&r.recommended),freeMinuteLabel:s}})))).safeSubscribe(this.log)),e.add(f.I.shared(this.userId).events("event.users.events.added").pipe((0,w.T)(e=>(0,sE.dR)((0,s4.f)(e))),(0,ea.p)(e=>e.payload["recipient-id"]===this.userId),(0,ea.p)(e=>e.type===sE._j.ChatRequest),(0,I.n)(e=>{var s=e["user-id"];return(0,D.z)([(0,S.of)(e),s8.R.shared(s).cachedPresenceStatus.pipe((0,g.s)(1))])}),(0,ea.p)(e=>{var[,s]=e;return"onlineWithCamera"===s}),(0,w.T)(e=>{var[s]=e;return s}),(0,w.T)(e=>({type:s2.W.InvitationToVideoChat,senderId:e["user-id"]}))).safeSubscribe(this.log)),e.add(f.I.shared(this.userId).events("x.event.dialogs.media.messages.added").pipe((0,ea.p)(e=>{var s;return(null==(s=e.network.sdp)?void 0:s.type)==="offer"&&0===e.network.phase}),(0,w.T)(e=>(0,sE.XN)(e)),(0,ea.p)(e=>
3"invitation"===e.type),(0,w.T)(e=>({type:s2.W.InvitationToVideoChat,senderId:e["user-id"]}))).safeSubscribe(this.log)),e.add(f.I.shared(this.userId).events("event.dialogs.media.messages.added").pipe((0,ea.p)(e=>{var s;return(null==(s=e.network.sdp)?void 0:s.type)==="offer"&&0===e.network.phase}),(0,w.T)(e=>(0,sE.XN)(e)),(0,ea.p)(e=>"invitation"===e.type),(0,w.T)(e=>({type:s2.W.Call,senderId:e["user-id"]}))).safeSubscribe(this.log))}}s7.shared=(0,P.G)(e=>new s7(e));var te=t(17951),ts=t(91907),tt=t(79560),tr=t(27585);class ta{constructor(e){this.userId=e,this.state=new Z.t({startObservingTime:void 0,currentProfileId:void 0,blocked:!1})}start(e){var s=new y.c(()=>{var e=new u.yU;return e.add(()=>this.state.next({startObservingTime:void 0,currentProfileId:void 0,blocked:!1})),e.add(e6.c.shared().profileId.pipe((0,ea.p)(e=>e!==this.userId),(0,tr.E)(ts.l.shared().visible.pipe((0,ep.Z)(!1)),this.state),(0,ee.M)(e=>{var[s,t,r]=e;t||(s?s!==r.currentProfileId&&this.state.next({currentProfileId:s,startObservingTime:Date.now(),blocked:!1}):this.state.next({currentProfileId:void 0,startObservingTime:void 0,blocked:!1}))})).safeSubscribe()),e.add(el.j.shared().chatAttendee.pipe((0,tr.E)(this.state),(0,ee.M)(e=>{var[s,t]=e;!s&&t.currentProfileId&&t.startObservingTime||this.state.next({currentProfileId:t.currentProfileId,startObservingTime:s||!t.currentProfileId?void 0:Date.now(),blocked:!!s&&!!t.currentProfileId})})).safeSubscribe()),e.add(tt.X.shared().userIsAway.pipe((0,tr.E)(this.state),(0,ee.M)(e=>{var[s,t]=e;this.state.next({currentProfileId:t.currentProfileId,startObservingTime:s?void 0:Date.now(),blocked:t.blocked})})).safeSubscribe()),e.add(this.state.pipe((0,su.J)(),(0,I.n)(e=>{var[s,t]=e;if(s.currentProfileId&&s.startObservingTime&&!s.blocked){var r=Number(((Date.now()-s.startObservingTime)/eF.b.second).toFixed());return te._.shared(this.userId).logUserAction({type:"users.observed",data:{user:s.currentProfileId,duration:r,place:"users.user"}}).asObservable()}return k.w})).safeSubscribe()),e});e.add((0,D.z)([T.T.shared().popularMembersEnabled,T.T.shared().profileObservingTrackingEnabled]).pipe((0,ev.F)(),(0,I.n)(e=>{var[t,r]=e;return t&&r?s:k.w})).safeSubscribe())}}ta.shared=(0,P.G)(e=>new ta(e));var ti=t(51563),tn=t(33646),td=t(85186),to=t(92211),tu=t(84401);class tl{constructor(e){this.userId=e}start(e){e.add(to.N.shared().sendCheerIntent.safeSubscribe(e=>{e.status===tu.R.Delivered?td._.shared(this.userId).logCheerDeliverySuccess(e):td._.shared(this.userId).logCheerDeliveryFailed(e)}))}}tl.shared=(0,P.G)(e=>new tl(e));var tc=t(17330);class th{constructor(e){this.userId=e}logBannerWasOffered(){W._.shared(this.userId).logEvent("mobile-application-install-banner-offered",{}).safeSubscribe()}logBannerWasAccepted(){W._.shared(this.userId).logEvent("mobile-application-install-banner-accepted",{}).safeSubscribe()}logBannerWasSkipped(){W._.shared(this.userId).logEvent("mobile-application-install-banner-skipped",{}).safeSubscribe()}}th.shared=(0,P.G)(e=>new th(e));class tp{constructor(e){this.userId=e}start(e){e.add(tc.e.shared(this.userId).offeringResult.pipe((0,ea.p)(e=>"accepted"===e.result)).safeSubscribe(()=>{th.shared(this.userId).logBannerWasAccepted()})),e.add(tc.e.shared(this.userId).offeringResult.pipe((0,ea.p)(e=>"postponed"===e.result)).safeSubscribe(()=>{th.shared(this.userId).logBannerWasSkipped()})),e.add(tc.e.shared(this.userId).offer.safeSubscribe(e=>{e&&th.shared(this.userId).logBannerWasOffered()}))}}tp.shared=(0,P.G)(e=>new tp(e));var tv=t(43864);class tm{constructor(e){this.userId=e}logApplicationThrottlingStatus(e){W._.shared(this.userId).logEvent("application-throttling-status",{userId:this.userId,enabled:e.enabled,fingerprint:e.fingerprint}).safeSubscribe()}}tm.shared=(0,P.G)(e=>new tm(e));var tf=t(94278);class tb{constructor(e){this.userId=e}start(e){e.add((0,tf.T)().pipe((0,ea.p)(e=>!!e),(0,g.s)(1)).safeSubscribe(e=>{tm.shared(this.userId).logApplicationThrottlingStatus({enabled:tv.y.shared().enabled,fingerprint:e})}))}}tb.shared=(0,P.G)(e=>new tb(e));class tg{constructor(e){this.userId=e}logSecondCall(e){W._.shared(this.userId).logEvent("second-call",e).safeSubscribe()}}tg.shared=(0,P.G)(e=>new tg(e));class tI{constructor(e){this.userId=e}start(e){e.add(f.I.shared(this.userId).events("event.dialogs.media.messages.added").pipe((0,I.n)(e=>C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,g.s)(1),(0,w.T)(s=>({status:s,event:e}))))).safeSubscribe(e=>{var{status:s,event:t}=e;this.userId&&s&&"idle"!==s.status&&("ringing"!==s.status||s.invite.sender!==t["sender-id"])&&("connecting"!==s.status||s.attendee!==t["sender-id"])&&("speaking"!==s.status||s.attendee!==t["sender-id"])&&(t.in||t.out)&&tg.shared(this.userId).logSecondCall({activeCallStatus:s.status,activeCallAttendee:"ringing"===s.status?s.invite.sender:s.attendee,activeCallState:er.g.shared().getCallState("ringing"===s.status?s.invite.sender:s.attendee),secondCallInvite:t})}))}}tI.shared=(0,P.G)(e=>new tI(e));var tw=t(36580);class tS{constructor(e){this.absent=eW.r.shared().focusState.pipe((0,ev.F)(),(0,I.n)(s=>C.Y.shared().get(e5.A,e).store.rxState().pipe((0,w.T)(e=>"focused"!==s&&"speaking"===e.status&&!e.phantom))),(0,ev.F)(),(0,tw.t)(1))}}tS.shared=(0,P.G)(e=>new tS(e));var ty=t(47281);class tA{constructor(e){this.userId=e}logUserAbsentDuringCall(e){W._.shared(this.userId).logEvent("left-app-during-call",e).safeSubscribe()}}tA.shared=(0,P.G)(e=>new tA(e));class tT{constructor(e){this.userId=e}start(e){var s=new y.c(()=>{var e=new u.yU;return e.add(tS.shared(this.userId).absent.pipe((0,ea.p)(e=>e),(0,I.n)(()=>ty.y.shared().active.pipe((0,g.s)(1)))).safeSubscribe(e=>{tA.shared(this.userId).logUserAbsentDuringCall({maskIsActive:e})})),e});e.add(T.T.shared().masksEnabled.pipe((0,I.n)(e=>e?s:k.w)).safeSubscribe())}}tT.shared=(0,P.G)(e=>new tT(e));var tx=t(78213),tC=t(50006);class tF{constructor(){this.absenceInformingRequired=(0,D.z)([T.T.shared().callAbsenceInformingEnabled,T.T.shared().masksEnabled,tC.LY.shared().isLoaded]).pipe((0,w.T)(e=>{var[s,t,r]=e;return s&&t&&r}),(0,ev.F)())}}tF.shared=(0,P.G)(()=>new tF);class tD{constructor(e){this.userId=e}start(e){var s=new y.c(()=>{var e=new u.yU;return e.add(tS.shared(this.userId).absent.safeSubscribe(e=>{this.audio&&(e?(this.audio.currentTime=0,this.audio.play()):this.audio.pause())})),e.add(tS.shared(this.userId).absent.pipe((0,I.n)(e=>e?(0,tx.Y)(1e3).pipe((0,w.T)(()=>!0)):(0,S.of)(!1))).safeSubscribe(e=>{e?(this.title||(this.title=document.title),document.title="Go back to Video Chat"===document.title?this.title:"Go back to Video Chat"):(this.title&&(document.title=this.title),this.title=void 0)})),e}),t=new y.c(e=>{var s,t=L.T.shared(),r=null==t||null==(s=t.notifications)||null==(s=s.sounds)?void 0:s["left-call"],a=new Audio;a.src="https://"+(null==t?void 0:t.host)+r[0].src,a.loop=!0,a.addEventListener("canplaythrough",()=>{e.next(a),e.complete()}),a.addEventListener("error",()=>{e.error()})});e.add(p.Session.shared().userIsUsual.pipe((0,ea.p)(e=>!e),(0,I.n)(()=>t),(0,ee.M)(e=>{this.audio=e}),(0,I.n)(()=>tF.shared().absenceInformingRequired),(0,I.n)(e=>e?s:k.w)).safeSubscribe())}}tD.shared=(0,P.G)(e=>new tD(e));var tk=t(66732),tE=t(78624),tj=15*eF.b.second;class tR{constructor(e){this.userId=e}start(e){var s=new y.c(()=>{var e=new u.yU;return e.add(tS.shared(this.userId).absent.pipe((0,I.n)(e=>e?(0,tx.Y)(tj):k.w)).safeSubscribe(()=>{tk.G.shared(this.userId).interrupt("absence")})),e});e.add(p.Session.shared().userIsUsual.pipe((0,I.n)(e=>e?k.w:tF.shared().absenceInformingRequired.pipe((0,I.n)(e=>e?s:k.w)))).safeSubscribe()),this.interruptOnFocusLost(e)}interruptOnFocusLost(e){e.add((0,D.z)([eW.r.shared().focusState,C.Y.shared().get(e5.A,this.userId).store.rxState(),tE.YL.shared(this.userId).activeGame]).pipe((0,ea.p)(e=>{var[s,t,r]=e;return"gone"===s&&!r&&"channel"in t&&"idle"!==t.status&&"call"===t.channel})).safeSubscribe(()=>{tk.G.shared(this.userId).interrupt("app-closed")}))}}tR.shared=(0,P.G)(e=>new tR(e));class tO{constructor(e){this.userId=e}notify(e,s){return(0,B.br)(B.jI.shared().events.post,e,{label:"event.call.attendee.absent",payload:{sender:this.userId,absent:s}})}}tO.shared=(0,P.G)(e=>new tO(e));class tM{constructor(e){this.userId=e}start(e){var s=new y.c(()=>{var e=new u.yU;return e.add(tS.shared(this.userId).absent.pipe((0,I.n)(e=>C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,g.s)(1),(0,w.T)(e=>"speaking"===e.status?e.attendee:null),(0,b.o)(),(0,I.n)(s=>tO.shared(this.userId).notify(s,e))))).safeSubscribe()),e});e.add(tF.shared().absenceInformingRequired.pipe((0,I.n)(e=>e?s:k.w)).safeSubscribe())}}tM.shared=(0,P.G)(e=>new tM(e));var tG=t(8764),tB=t(97307),tP=t(70095),t_=t(12985),tz=t(58731),tN=t(22998),tL=t(24889),tq="onboarding-tracker",tV="profile-required-step-completed",tQ="profile-onboarding-completed";class tU{constructor(e){this.userId=e,this.persistence=tz.y.shared(tq,e),this.remotePersistence=tN.w.shared(tq,e)}validateRequiredFields(e,s){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!e&&!!e.name&&!!e.birthday&&!!e.gender&&!!e.thumbnail&&!!(null!=s&&s.minage)&&(!!(null!=s&&s.maxage)||(null==s?void 0:s.maxage)===null)&&(!!(null!=s&&s.preferredGender)||t)}start(e){e.add(this.persistence.load(tV).asObservable().pipe((0,I.n)(e=>!0===e?k.w:(0,D.z)([R.F.shared(this.userId).profile,t_.im.shared(this.userId).preferences,T.T.shared().emptyPreferredGenderEnabled]).pipe((0,ea.p)(e=>{var[s]=e;return s.isSuccessful}),(0,w.T)(e=>{var[s,t,r]=e,a=s.isSuccessful?s.value:null;return null!==a&&this.validateRequiredFields(a,t,r)}),(0,ea.p)(e=>e),(0,ee.M)(()=>s0.T.shared().logProfileRequiredStepCompleted()),(0,I.n)(()=>this.persistence.store(tV,!0).asObservable())))).safeSubscribe()),e.add(sX.G.shared(this.userId).confirmIntention.safeSubscribe(()=>s0.T.shared().logRegistrationCompleted())),"web"===(0,e_.platform)()&&e.add(this.remotePersistence.load(tQ).asObservable().pipe((0,I.n)(e=>!0===e?k.w:tL.h.shared().completed.pipe((0,ea.p)(e=>e)).toSingle().pipe((0,eY.ex)(()=>s0.T.shared().logOnboardingCompleted()),(0,eY.Fg)(()=>this.remotePersistence.store(tQ,!0))).asObservable())).safeSubscribe())}}tU.shared=(0,P.G)(e=>new tU(e));var tY=t(40753),tJ=t(68885),tW=t(99524),tH=t(50636);class tX{constructor(e){this.userId=e}start(e){e.add(tW.i.shared(this.userId).subscriptionChanged.safeSubscribe(e=>{tH.W.shared(this.userId).logSubscriptionChanged(e.oldSku,e.newSku)}))}}tX.shared=(0,P.G)(e=>new tX(e));var tZ=t(64766),t$=t(89218),tK=t(53170),t0=t(98050),t1=["prime","essentials"];class t5 extends t$.D{constructor(e){super(),this.userId=e;var s=(0,D.z)([T.T.shared().primeVipPackagesEnabled,T.T.shared().subscriptionPurchaseNotification]).pipe((0,w.T)(e=>{var[s,t]=e;return s&&"success-modal"===t}),(0,ev.F)()),t=q.e.shared(e).purchasedInApplication.pipe((0,ea.p)(e=>{var{invoice:s,meta:t}=e;if(!s.subscription)return!1;var r=t.reason;return!r||!(0,t0.D)(r)}),(0,tr.E)(T.T.shared().purchaseChooseSubscriptionPackageBadges),(0,I.n)(e=>{var[s,t]=e,r=(0,tK.I)({benefitsAmount:s.invoice.benefitsAmount},t1,t);return"prime"===r?(0,S.of)("no-subscription-to-prime"):"essentials"===r?(0,S.of)("no-subscription-to-essential"):k.w})),r=tZ.B.shared().upgradeResult.pipe((0,ea.p)(e=>{var{result:s}=e;return s.isSuccessful}),(0,w.T)(()=>"essential-to-prime"));this.canOffer=s.pipe((0,I.n)(e=>e?(0,K.h)(t.pipe((0,ep.Z)(!1)),r,this.offeringResult.pipe((0,w.T)(()=>!1))):(0,S.of)(!1)),(0,ev.F)(),(0,tw.t)({bufferSize:1,refCount:!0}))}start(e){return this.offer.toSingle().pipe((0,eY.Fg)(s=>{if(s)return eJ.v.just(eE.Q.failure("offer-not-allowed"));var t=tW.i.shared(this.userId).subscription.pipe((0,ea.p)(e=>!!e));return"essential-to-prime"===e.transition?t.pipe((0,g.s)(1),(0,w.T)(s=>eE.Q.success({transition:e.transition,subscription:s,benefitsAmount:s.recurringPackage.benefitsAmount}))).toSingle():q.e.shared(this.userId).purchasedInApplication.pipe((0,ea.p)(e=>{var{invoice:s}=e;return!!s.subscription}),(0,g.s)(1),(0,I.n)(s=>t.pipe((0,g.s)(1),(0,w.T)(t=>eE.Q.success({transition:e.transition,subscription:t,benefitsAmount:s.invoice.benefitsAmount}))))).toSingle()}))}}t5.shared=(0,P.G)(e=>new t5(e));class t3{constructor(e){this.userId=e}start(e){var s=(0,K.h)(tZ.B.shared().upgradeIntent.pipe((0,eP.u)(!0)),tZ.B.shared().upgradeResult.pipe((0,ea.p)(e=>{var{result:s}=e;return!s.isSuccessful}),(0,eP.u)(!1)),t5.shared(this.userId).offeringResult.pipe((0,eP.u)(!1))).pipe((0,ep.Z)(!1));e.add(tW.i.shared(this.userId).subscriptionChanged.pipe((0,tr.E)(T.T.shared().primeVipPackagesEnabled,T.T.shared().subscriptionPurchaseNotification,s),(0,ea.p)(e=>{var[,s,t,r]=e;return!(s&&"success-modal"===t&&r)}),(0,w.T)(e=>{var[s]=e;return s}),(0,tr.E)(V.t.shared().model(this.userId))).safeSubscribe(e=>{var[s,t]=e;"services"===t?sH.X.shared().notifyUser({type:sW._.ServicesSubscriptionChanged,payload:{upgradedSku:s.newSku}},sW.A.Normal):sH.X.shared().notifyUser({type:sW._.SubscriptionPlanChanged},sW.A.Normal)}))}}t3.shared=(0,P.G)(e=>new t3(e));var t2=t(21512),t8=t(83075);class t4{constructor(e){this.userId=e}logAutoBuySettingsChanged(e){W._.shared(this.userId).logEvent("payment-autobuy-settings-changed",{"user-id":this.userId,enabled:e.enabled,available:e.available,sku:e.sku,amount:e.amount}).safeSubscribe()}}t4.shared=(0,P.G)(e=>new t4(e));class t6{constructor(e){this.userId=e}start(e){e.add(t8.e.shared().updatedIntent.safeSubscribe(e=>{t4.shared(this.userId).logAutoBuySettingsChanged(e)}))}}t6.shared=(0,P.G)(e=>new t6(e));class t9{constructor(e){this.userId=e}start(e){e.add(q.e.shared(this.userId).balanceChanged.pipe((0,w.T)(e=>{switch(!0){case e&&e>=0:return sW._.CreditsManuallyAdded;case e&&e<0:return sW._.CreditsManuallyDeducted;default:return sW._.CreditsManuallyServiceUnavailable}})).safeSubscribe(e=>{sH.X.shared().notifyUser({type:e}
3,sW.A.Normal)}))}}t9.shared=(0,P.G)(e=>new t9(e));var t7=t(72308),re=t(34677);function rs(e,s){return Math.round(e/(100/s))}class rt{constructor(e){this.userId=e}start(e){e.add((0,D.z)([t7.l.shared(this.userId,sE._j.PromoBenefitsIssued).events.pipe((0,g.s)(1),(0,I.n)(e=>(0,S.of)(...e)),(0,ea.p)(e=>{var s,t;return(null!=(s=null==(t=e.payload)||null==(t=t.props)?void 0:t.amount)?s:-1)>0})),T.T.shared().currencyDevaluationRatio]).safeSubscribe(e=>{var s,[t,r]=e,{systemType:a}=t.payload.meta;a===re.Nd.PromoCreditsAdded&&null!=(s=t.payload.props)&&s.amount?sH.X.shared().notifyUser({type:sW._.PromoCreditsAdded,payload:{change:rs(t.payload.props.amount,r)}},sW.A.Normal):a===re.Nd.PromoBenefitsAdded&&sH.X.shared().notifyUser({type:sW._.PromoBenefitsAdded},sW.A.Normal)})),e.add((0,D.z)([f.I.shared(this.userId).events("event.users.events.added").pipe((0,ea.p)(e=>"promo.offers.benefits.issued"===e.type)),T.T.shared().currencyDevaluationRatio]).safeSubscribe(e=>{var[s,t]=e;if((null==(r=s.payload)?void 0:r.type)==="credits"&&null!=(a=s.payload.props)&&a.amount)sH.X.shared().notifyUser({type:sW._.PromoCreditsAdded,payload:{change:rs(s.payload.props.amount,t)}},sW.A.Normal);else if((null==(i=s.payload)?void 0:i.type)==="benefits"){var r,a,i,n,d=s.payload.promo,o=null==(n=s.payload.props)?void 0:n.amount;sH.X.shared().notifyUser({type:sW._.PromoBenefitsAdded,payload:d&&o?{benefitType:d,amount:o}:void 0},sW.A.Normal)}}))}}rt.shared=(0,P.G)(e=>new rt(e));var rr=t(29109),ra=t(84835),ri=t(31238),rn=t(77194),rd=t(13230),ro=t(77252),ru=t(67276),rl=t(55952),rc=t(21050);class rh{constructor(e){this.userId=e}start(e){e.add(ri.m.shared(this.userId).offer.pipe((0,I.n)(e=>e?e6.c.shared().profileId.pipe((0,I.n)(s=>s===e.attendeeId?k.w:ri.m.shared(this.userId).postponeOffer("profile-closed"))):k.w)).safeSubscribe()),e.add(ri.m.shared(this.userId).offer.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,I.n)(e=>e?ri.m.shared(this.userId).postponeOffer("chat-opened"):k.w)):k.w)).safeSubscribe()),e.add(ri.m.shared(this.userId).offer.pipe((0,I.n)(e=>e?ro.J.shared(this.userId).callExists.pipe((0,I.n)(s=>s?this.isAudioCallStartedFromOffer(e.attendeeId).pipe((0,I.n)(e=>e?k.w:ri.m.shared(this.userId).postponeOffer("another-call"))):k.w)):k.w)).safeSubscribe()),e.add(ri.m.shared(this.userId).offer.pipe((0,I.n)(e=>e?rn.N.shared(this.userId).blockedUsers.pipe((0,w.T)(s=>s.includes(e.attendeeId)),(0,I.n)(e=>e?ri.m.shared(this.userId).postponeOffer("user-blocked"):k.w)):k.w)).safeSubscribe()),e.add(ri.m.shared(this.userId).offer.pipe((0,I.n)(e=>e?rd.N.shared(this.userId).audioCallAvailable(e.attendeeId).pipe((0,I.n)(s=>s?k.w:this.isAudioCallStartedFromOffer(e.attendeeId).pipe((0,I.n)(e=>e?k.w:ri.m.shared(this.userId).postponeOffer("call-not-available"))))):k.w)).safeSubscribe()),e.add(ri.m.shared(this.userId).offer.pipe((0,w.T)(e=>!!e),(0,ev.F)()).safeSubscribe(e=>{e&&rc.J.shared("profile").notifyShown("audio")})),e.add(ri.m.shared(this.userId).offeringResult.pipe((0,ea.p)(e=>!!e)).safeSubscribe(()=>{rc.J.shared("profile").notifyClosed("audio")}))}isAudioCallStartedFromOffer(e){return ru.M.shared(this.userId).state.pipe((0,w.T)(e=>({callType:e.callType,calleeId:e.calleeId,cta:e.cta})),(0,ev.F)(ef()),(0,I.n)(s=>"voiceonly"===s.callType&&s.calleeId&&"audio-call-motivation-popup-profile"===s.cta?rl.K.shared(this.userId).id(s.calleeId).asObservable().pipe((0,I.n)(s=>s&&s===e?(0,S.of)(!0):(0,S.of)(!1))):(0,S.of)(!1)))}}rh.shared=(0,P.G)(e=>new rh(e));var rp=t(55857);class rv{constructor(e){this.userId=e}start(e){e.add(rp.hw.shared(this.userId).offer.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,I.n)(s=>s===e.attendeeId?k.w:rp.hw.shared(this.userId).postponeOffer({reason:"chat-closed",timestamp:Date.now()}))):k.w)).safeSubscribe()),e.add(rp.hw.shared(this.userId).offer.pipe((0,I.n)(e=>e?ro.J.shared(this.userId).callExists.pipe((0,I.n)(s=>s?this.isAudioCallStartedFromOffer(e.attendeeId).pipe((0,I.n)(e=>e?k.w:rp.hw.shared(this.userId).postponeOffer({reason:"another-call",timestamp:Date.now()}))):k.w)):k.w)).safeSubscribe()),e.add(rp.hw.shared(this.userId).offer.pipe((0,I.n)(e=>e?rn.N.shared(this.userId).blockedUsers.pipe((0,w.T)(s=>s.includes(e.attendeeId)),(0,I.n)(e=>e?rp.hw.shared(this.userId).postponeOffer({reason:"user-blocked",timestamp:Date.now()}):k.w)):k.w)).safeSubscribe()),e.add(rp.hw.shared(this.userId).offer.pipe((0,I.n)(e=>e?rd.N.shared(this.userId).audioCallAvailable(e.attendeeId).pipe((0,I.n)(s=>s?k.w:this.isAudioCallStartedFromOffer(e.attendeeId).pipe((0,I.n)(e=>e?k.w:rp.hw.shared(this.userId).postponeOffer({reason:"call-not-available",timestamp:Date.now()}))))):k.w)).safeSubscribe()),e.add(rp.hw.shared(this.userId).offer.pipe((0,w.T)(e=>!!e),(0,ev.F)()).safeSubscribe(e=>{e&&rc.J.shared("chat").notifyShown("audio")})),e.add(rp.hw.shared(this.userId).offeringResult.safeSubscribe(e=>{rc.J.shared("chat").notifyClosed("audio",e.options.timestamp,e.offer.attendeeId)}))}isAudioCallStartedFromOffer(e){return ru.M.shared(this.userId).state.pipe((0,w.T)(e=>({callType:e.callType,calleeId:e.calleeId,cta:e.cta})),(0,ev.F)(ef()),(0,I.n)(s=>"voiceonly"===s.callType&&s.calleeId&&"audio-call-motivation-popup-chat"===s.cta?rl.K.shared(this.userId).id(s.calleeId).asObservable().pipe((0,I.n)(s=>s&&s===e?(0,S.of)(!0):(0,S.of)(!1))):(0,S.of)(!1)))}}rv.shared=(0,P.G)(e=>new rv(e));var rm=t(23100);class rf{constructor(e){this.userId=e}start(e){e.add(ri.m.shared(this.userId).offeringResult.safeSubscribe(e=>{var{offer:s}
3=e;"accepted"===e.result?rm.f.shared(this.userId).logAccepted(s.attendeeId,s.audioSample,"profile"):"rejected"===e.result?rm.f.shared(this.userId).logRejected(s.attendeeId,s.audioSample,"profile"):"postponed"===e.result&&rm.f.shared(this.userId).logClosed(s.attendeeId,s.audioSample,"profile",e.options)})),e.add(rp.hw.shared(this.userId).offeringResult.safeSubscribe(e=>{var{offer:s}=e;"accepted"===e.result?rm.f.shared(this.userId).logAccepted(s.attendeeId,s.audioSample,"chat"):"rejected"===e.result?rm.f.shared(this.userId).logRejected(s.attendeeId,s.audioSample,"chat"):"postponed"===e.result&&rm.f.shared(this.userId).logClosed(s.attendeeId,s.audioSample,"chat",e.options.reason)})),e.add(rp.hw.shared(this.userId).blockingReason.safeSubscribe(e=>{e&&rm.f.shared(this.userId).logBlocked(e.attendeeId,e.reason)}))}}rf.shared=(0,P.G)(e=>new rf(e));var rb=t(46372);class rg{constructor(e){this.userId=e}logFavoriteUserAdded(e,s,t){W._.shared(this.userId).logEvent("user-favorited",{"user-id":this.userId,"attendee-id":e,"attendee-is-promoter":s,source:t}).safeSubscribe()}logAddToFavoritesBannerShown(e){W._.shared(this.userId).logEvent("add-to-favorites-banner-shown",{"user-id":this.userId,"attendee-id":e}).safeSubscribe()}}rg.shared=(0,P.G)(e=>new rg(e));var rI=t(42044);class rw{constructor(e){this.userId=e}start(e){e.add(rb.f.shared(this.userId).favoriteContactAdded.pipe((0,I.n)(e=>(0,D.z)([M.f.shared(e.userId).userIsFeaturedMember,(0,S.of)(e.userId),(0,S.of)(e.source)]))).safeSubscribe(e=>{var[s,t,r]=e;rg.shared(this.userId).logFavoriteUserAdded(t,s,r)})),e.add(rI.s.shared().visible.pipe((0,ea.p)(e=>e),(0,I.n)(()=>el.j.shared().chatAttendee.pipe((0,g.s)(1),(0,b.o)()))).safeSubscribe(e=>{rg.shared(this.userId).logAddToFavoritesBannerShown(e)}))}}rw.shared=(0,P.G)(e=>new rw(e));class rS{constructor(e){this.userId=e}start(e){e.add(rb.f.shared(this.userId).favoriteContactAdded.pipe((0,I.n)(e=>R.F.shared(e.userId).profile.pipe((0,g.s)(1))),(0,w.T)(e=>{var s;return null==(s=e.value)?void 0:s.name}),(0,b.o)()).safeSubscribe(e=>{sH.X.shared().notifyUser({type:sW._.FavoriteContactAdded,payload:{userName:e}},sW.A.Low)}))}}rS.shared=(0,P.G)(e=>new rS(e));var ry=t(59994),rA=t(62407),rT=t(88174);class rx{constructor(e){this.openRecorder=()=>{rT.K.shared(this.userId).checkRecordingAvailability().pipe((0,g.s)(1)).subscribe(e=>{e&&"#video-invite-recorder"!==window.location.hash&&C.Y.shared().get(eg.A).actions.open("video-invite-recorder",[{props:{}}])})},this.userId=e}start(e){e.add(new y.c(()=>(l.A.states("event.media.devices.cam.stream.enabled",this.openRecorder,"event.media.devices.cam.stream.disabled",rA.l),l.A.sync("event.camera.activation.blocked.by-videoinvite-absence",this.openRecorder),()=>{l.A.removeStates("event.media.devices.cam.stream.enabled",this.openRecorder,"event.media.devices.cam.stream.disabled",rA.l),l.A.removeListener("event.camera.activation.blocked.by-videoinvite-absence",this.openRecorder)})).safeSubscribe())}}rx.shared=(0,P.G)(e=>new rx(e));var rC=t(68518),rF=t(51234),rD=t(41196),rk=t(95364),rE=t(35920),rj=t(16893);class rR{constructor(e){this.userId=e,this.videoInviteDismissedCounter=rC.M.shared(this.userId)}start(e){e.add(T.T.shared().videoInvites.blocking.enabled.pipe((0,I.n)(e=>e?k.w:(0,D.z)([T.T.shared().videoInvites.blocking.allowedNumberOfDismisses,this.videoInviteDismissedCounter.dismissedCount])),(0,I.n)(e=>{var[s,t]=e;return t<s?k.w:this.suspend().pipe((0,ee.M)(()=>this.videoInviteDismissedCounter.reset()))})).safeSubscribe()),e.add(T.T.shared().videoInvites.blocking.enabled.pipe((0,I.n)(e=>e?rE.W.shared(this.userId).offeringResult:k.w),(0,ev.F)(),(0,I.n)(e=>"accepted"!==e.result?k.w:this.suspend())).safeSubscribe())}suspend(){return T.T.shared().videoInvites.blocking.suspensionDuration.pipe((0,I.n)(e=>{if(!e)return k.w;var s=e/eF.b.second,t=rF.N.shared(this.userId).suspend(s).pipe((0,rD.y)(),(0,g.s)(1));return(0,rk.p)([t,rj.e7.shared(this.userId).suspend().pipe((0,eY.W_)(void 0))]).pipe((0,w.T)(()=>void 0))}))}}rR.shared=(0,P.G)(e=>new rR(e));class rO{constructor(e){this.userId=e}logBlockingShown(){W._.shared(this.userId).logEvent("video-invite-blocking-shown",{}).safeSubscribe()}logBlockingAccepted(){W._.shared(this.userId).logEvent("video-invite-blocking-activated",{}).safeSubscribe()}logBlockingRejected(){W._.shared(this.userId).logEvent("video-invite-blocking-decline",{}).safeSubscribe()}}rO.shared=(0,P.G)(e=>new rO(e));class rM{constructor(e){this.userId=e}start(e){e.add(rE.W.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result?rO.shared(this.userId).logBlockingAccepted():"rejected"===e.result&&rO.shared(this.userId).logBlockingRejected()})),e.add(rE.W.shared(this.userId).offer.pipe((0,b.o)()).safeSubscribe(e=>{rO.shared(this.userId).logBlockingShown()}))}}rM.shared=(0,P.G)(e=>new rM(e));var rG=t(97928),rB=t(34948);class rP{constructor(e){this.userId=e}start(e){e.add(rG.n.shared(this.userId).chats.pipe((0,w.T)(e=>e.every(e=>0===e.unreadEventsCount)),(0,ev.F)(),(0,ea.p)(e=>e)).safeSubscribe(()=>{l.A.emit("command.invite.sound.stop",!0)})),e.add(rB.t.shared(this.userId).settings.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s.repeat&&!t.repeat}),(0,ev.F)()).safeSubscribe(()=>{l.A.emit("command.invite.sound.stop",!0)}))}}rP.shared=(0,P.G)(e=>new rP(e));class r_{constructor(e){this.userId=e}start(e){var s=el.j.shared().chatAttendee.pipe((0,b.o)(),(0,tr.E)(T.T.shared().messagesReactionsEnabled),(0,I.n)(e=>{var[s,t]=e;return t?rG.n.shared(this.userId).chats.pipe((0,g.s)(1),(0,w.T)(e=>e.find(e=>e.attendeeId===s)),(0,w.T)(e=>{var s;return(null==e||null==(s=e.content)?void 0:s.type)===re.Go.MessageReaction}),(0,I.n)(e=>e?k.w:(0,S.of)(s))):(0,S.of)(s)}),(0,I.n)(e=>rG.n.shared(this.userId).stale(e))).safeSubscribe();e.add(s)}}r_.shared=(0,P.G)(e=>new r_(e));
3var rz=t(57272),rN=t(79075),rL=t(43981);class rq{constructor(e){this.userId=e}start(e){var s=el.j.shared().chatAttendee.pipe((0,b.o)(),(0,I.n)(e=>rN.G.shared(e).shouldOffer.pipe((0,I.n)(s=>s?(0,S.of)(e):k.w)))).safeSubscribe(e=>{rN.G.shared(e).accept()});e.add(s),e.add(rL.e.shared(this.userId).newMessage.pipe((0,ea.p)(e=>!e.auto),(0,w.T)(e=>e.sender===this.userId?e.recipient:e.sender),(0,I.n)(e=>rN.G.shared(e).shouldOffer.pipe((0,g.s)(1),(0,I.n)(s=>s?(0,S.of)(e):k.w)))).safeSubscribe(e=>{rN.G.shared(e).accept()}))}}rq.shared=(0,P.G)(e=>new rq(e));var rV=t(36819);class rQ{start(e){e.add((0,D.z)([p.Session.shared().userId,p.Session.shared().userIsUsingDemoMode]).pipe((0,ea.p)(e=>{var[s,t]=e;return!t&&!!s}),(0,w.T)(e=>{var[s]=e;return s}),(0,b.o)(),(0,I.n)(e=>rV.x.shared(e).deleted.pipe((0,I.n)(s=>q.e.shared(e).hasConfirmedPurchases.pipe((0,w.T)(e=>({hasConfirmedPurchases:e,deleteInfo:s})))),(0,g.s)(1)))).safeSubscribe(e=>{var{hasConfirmedPurchases:s,deleteInfo:t}=e,r=s?sW._.CustomerSupportRequestSent:sW._.UserAccountDeleted;sH.X.shared().notifyUser({type:r,payload:{}},sW.A.Low)}))}}rQ.shared=(0,P.G)(()=>new rQ);var rU=t(46211);class rY{constructor(e){this.userId=e}start(e){e.add(rV.x.shared(this.userId).deleted.pipe((0,ea.p)(e=>!e.alreadyLogged),(0,I.n)(e=>rU.Q.shared(this.userId).logUserAccountDeleted(e).asObservable())).safeSubscribe())}}rY.shared=(0,P.G)(e=>new rY(e));var rJ=t(54181),rW=t(91060),rH=t(59373),rX=t(58456);class rZ{constructor(e){this.userId=e}start(e){e.add((0,K.h)(f.I.shared(this.userId).events("event.users.tags.set").pipe((0,w.T)(e=>({type:"set",event:e}))),f.I.shared(this.userId).events("event.users.tags.unset").pipe((0,w.T)(e=>({type:"unset",event:e})))).pipe((0,I.n)(e=>{var{type:s,event:t}=e;return!t["holder-id"]&&t["user-id"]&&t.tag&&"toggles"!==t.family?rX.o.shared(t["user-id"]).updateState([t.tag],s).asObservable():k.w})).safeSubscribe())}}rZ.shared=(0,P.G)(e=>new rZ(e));var r$=t(83718),rK=t(62561),r0=t(4509),r1=t(96089),r5=t(44168),r3=t(63893),r2=t(64716);class r8{constructor(e){this.userId=e}start(e){e.add(r2.T.shared(this.userId).setPresentInFeedIntent.safeSubscribe(()=>{sH.X.shared().notifyUser({type:sW._.UserFeedPrivacyChanged,payload:{}},sW.A.Low)}))}}r8.shared=(0,P.G)(e=>new r8(e));var r4="dialogs.automation.paused",r6="hidden.from.search";class r9{constructor(e){this.userId=e}start(e){e.add(T.T.shared().pauseInvitesEnabled.pipe((0,I.n)(e=>e?j.x.shared(this.userId).tags.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s.includes(r4)&&!t.includes(r4)})):k.w)).safeSubscribe(()=>{sH.X.shared().notifyUser({type:sW._.InvitesPauseEnded},sW.A.Low)})),e.add(j.x.shared(this.userId).tags.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s.includes(r6)&&!t.includes(r6)})).safeSubscribe(()=>{sH.X.shared().notifyUser({type:sW._.UserFeedPrivacyChanged,payload:{}},sW.A.Low)}))}}r9.shared=(0,P.G)(e=>new r9(e));var r7=t(32841),ae=[{resource:"users.USER_ID",regexp:/^\/users\/\d+$/},{resource:"users.USER_ID.photos",regexp:/^\/users\/\d+\/photos$/},{resource:"users.USER_ID.videos",regexp:/^\/users\/\d+\/videos$/},{resource:"users.USER_ID.public-tags",regexp:/^\/users\/\d+\/public-tags$/},{resource:"paidresources.USER_ID.groups.privatephotos",regexp:/^\/paidresources\/\d+\/groups\/privatephotos$/},{resource:"users.USER_ID.tags",regexp:/^\/v2\/users\/\d+\/tags$/},{resource:"users.USER_ID.events",regexp:/^\/users\/\d+\/events$/},{resource:"users.USER_ID.roles",regexp:/^\/users\/\d+\/roles$/},{resource:"credits.mall.USER_ID.packages",regexp:/^\/credits\/mall\/\d+\/packages$/},{resource:"dialogs.letters.RECIPIENT_ID.SENDER_ID.LETTER_ID",regexp:/^\/dialogs\/letters\/\d+\/\d+\/\d+$/},{resource:"dialogs.letters.presents.RECIPIENT_ID.SENDER_ID.LETTER_ID",regexp:/^\/dialogs\/letters\/presents\/\d+\/\d+\/\d+$/},{resource:"dialogs.letters.introductory.RECIPIENT_ID.SENDER_ID.LETTER_ID",regexp:/^\/dialogs\/letters\/introductory\/\d+\/\d+\/\d+$/},{resource:"exo.moto.USER_ID.identity",regexp:/^\/exo\/moto\/\d+\/identity$/},{resource:"moto.billingprofiles.api.UserPaymentMethods",regexp:/^\/api\/UserPaymentMethods$/},{resource:"moto.taxservice.api.price.decomposelist",regexp:/^\/api\/price\/decomposelist$/},{resource:"moto.processing.api.merchants.MERCHANT_ID.settings",regexp:/^\/api\/merchants\/\w+\/settings$/},{resource:"users",regexp:/^\/users$/},{resource:"users.personal.USER_ID",regexp:/^\/v2\/users\/personal\/\d+$/}];class as extends(0,ex.XI)("api.request",60*eF.b.second){}var at={label:as.type,tags:{team:()=>"core",success:e=>{if(!(null!=(s=e.encounters.completed)&&s.details.isSuccessful))return!1;var s,t=e.encounters.completed.details.value.code||200;return t>=200&&t<300}
3,code:e=>{var s,t=null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.code;return t&&(t<200||t>=300)?t:void 0},resource:e=>e.details.resource,url:e=>e.details.url,cached:e=>{var s;return null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.cached},facility:e=>{var s;return null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.facility},preload:e=>{var s;return null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.preload},"akamai-request-id":e=>{var s;return null==(s=e.encounters.akamaiInfoDetermined)?void 0:s.details.requestId},"akamai-cache":e=>{var s;return null==(s=e.encounters.akamaiInfoDetermined)?void 0:s.details.cache},"akamai-remote-cache":e=>{var s;return null==(s=e.encounters.akamaiInfoDetermined)?void 0:s.details.remoteCache}},hist:{ttresult:{from:"added",to:"completed"},"ttserver-process":e=>{var s;return null!=(s=e.encounters.completed)&&null!=(s=s.details.value)&&s.cached?void 0:{from:"serverProcessingStarted",to:"serverProcessingFinished"}},tttransportation:e=>{var s;return null!=(s=e.encounters.completed)&&null!=(s=s.details.value)&&s.cached?void 0:{from:"added",to:"transportationFinished"}}}};eC.H.shared().registerMapping(as.type,at);class ar extends(0,ex.XI)("api.slow-request",60*eF.b.second){}var aa={label:ar.type,tags:{team:()=>"core",success:e=>{if(!(null!=(s=e.encounters.completed)&&s.details.isSuccessful))return!1;var s,t=e.encounters.completed.details.value.code||200;return t>=200&&t<300}
3,code:e=>{var s,t=null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.code;return t&&(t<200||t>=300)?t:void 0},resource:e=>e.details.resource,url:e=>e.details.url,cached:e=>{var s;return null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.cached},facility:e=>{var s;return null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.facility},preload:e=>{var s;return null==(s=e.encounters.completed)||null==(s=s.details.value)?void 0:s.preload},"akamai-request-id":e=>{var s;return null==(s=e.encounters.akamaiInfoDetermined)?void 0:s.details.requestId},"akamai-cache":e=>{var s;return null==(s=e.encounters.akamaiInfoDetermined)?void 0:s.details.cache},"akamai-remote-cache":e=>{var s;return null==(s=e.encounters.akamaiInfoDetermined)?void 0:s.details.remoteCache}},hist:{ttresult:{from:"added",to:"completed"},"ttserver-process":{from:"serverProcessingStarted",to:"serverProcessingFinished"}}};eC.H.shared().registerMapping(ar.type,aa);var ai=t(67728),an=t(50042);function ad(e,s){return e[s.toLowerCase()]||null}class ao{constructor(){this.apiMetricsEnabled=!1,this.slowApiMetricsEnabled=!1}start(e){var s=new y.c(()=>{var e=new u.yU;B.jI.shared().augment("pragma","akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-true-cache-key, akamai-x-get-ssl-client-session-id, akamai-x-serial-no, akamai-x-get-request-id"),e.add(()=>{B.jI.shared().augment("pragma",void 0)});var s=B.jI.shared().onRequest(this.onRequest.bind(this)),t=B.jI.shared().onResponse(this.onResponse.bind(this)),r=ai.$.shared().onRequest(this.onRequest.bind(this)),a=ai.$.shared().onResponse(this.onResponse.bind(this));return e.add(()=>{s(),t(),r(),a()}),e});e.add((0,D.z)(T.T.shared().apiMetricsEnabled,T.T.shared().slowApiMetricsEnabled).pipe((0,ee.M)(e=>{var[s,t]=e;this.apiMetricsEnabled=s,this.slowApiMetricsEnabled=t}),(0,I.n)(e=>{var[t,r]=e;return t||r?s:k.w})).safeSubscribe())}onRequest(e,s,t){if(this.apiMetricsEnabled||this.slowApiMetricsEnabled){var r=new Date;setTimeout(()=>{var s,a,i,n=(s=e.uri,i=r7.parse(s),(null==(a=ae.find(e=>i.pathname&&e.regexp.test(i.pathname)))?void 0:a.resource)||null);if(n){var d={resource:n,url:e.uri};this.apiMetricsEnabled&&eT.E.shared().add(new as(String(t),r,d)),this.slowApiMetricsEnabled&&eT.E.shared().add(new ar(String(t),r,d))}},0)}}onResponse(e,s,t){if(this.apiMetricsEnabled||this.slowApiMetricsEnabled){var r=new Date,a=s.xhr.preload,i=s.err||null,n=(null==i?void 0:i.status)||null,d=s.xhr.getAllResponseHeaders();setTimeout(()=>{var e=(d||"").split("\r\n").filter(e=>e).reduce((e,s)=>{var[t,...r]=s.split(":");return e[t]||(e[t.toLowerCase()]=r.join(":").trim()),e},{}),o=(0,an.r)(ad(e,"Cache-Control"));if(i&&!n){var u=eE.Q.failure("failed");this.apiMetricsEnabled&&eT.E.shared().complete(as.identifier(String(t)),r,u),this.slowApiMetricsEnabled&&eT.E.shared().complete(ar.identifier(String(t)),r,u)}else{var l,c,h=ad(e,"X-Akamai-Request-Id");if(h){var p=ad(e,"X-Cache");p=p?p.trim().split(" ")[0].toLowerCase():null;var v=ad(e,"X-Cache-Remote"),m={name:"akamaiInfoDetermined",date:r,details:{requestId:h,cache:p||void 0,remoteCache:(v=v?v.trim().split(" ")[0].toLowerCase():null)||void 0}};this.apiMetricsEnabled&&eT.E.shared().encounter(as.identifier(String(t)),m),this.slowApiMetricsEnabled&&eT.E.shared().encounter(ar.identifier(String(t)),m)}var f=ad(e,"X-Processing-Start");if(f&&+f){var b={name:"serverProcessingStarted",date:new Date(+f),details:void 0};this.apiMetricsEnabled&&eT.E.shared().encounter(as.identifier(String(t)),b),this.slowApiMetricsEnabled&&eT.E.shared().encounter(ar.identifier(String(t)),b)}var g=ad(e,"X-Processing-Finish");if(g&&+g){var I={name:"serverProcessingFinished",date:new Date(+g),details:void 0};this.apiMetricsEnabled&&eT.E.shared().encounter(as.identifier(String(t)),I),this.slowApiMetricsEnabled&&eT.E.shared().encounter(ar.identifier(String(t)),I)}var w=eE.Q.success({code:null==(c=s.err)?void 0:c.status,cached:o&&(o.private?"browser":o.noStore?void 0:"cdn"),facility:(l=ad(e,"X-Stage"))?l.toUpperCase():void 0,preload:a});if(f&&+f&&g&&+g){var S={name:"transportationFinished",date:new Date(r-(g-f)),details:void 0};this.apiMetricsEnabled&&eT.E.shared().encounter(as.identifier(String(t)),S),this.slowApiMetricsEnabled&&eT.E.shared().encounter(ar.identifier(String(t)),S)}this.apiMetricsEnabled&&eT.E.shared().complete(as.identifier(String(t)),r,w),this.slowApiMetricsEnabled&&eT.E.shared().complete(ar.identifier(String(t)),r,w)}},0)}}}ao.shared=(0,P.G)(()=>new ao);class au{constructor(e){this.userId=e}start(e){e.add(q.e.shared(this.userId).balance.pipe((0,g.s)(1)).safeSubscribe())}}au.shared=(0,P.G)(e=>new au(e));var al=t(68275),ac=t(75382),ah=t(35913);class ap{constructor(e){this.userId=e}activate(e){var s,t=null!=(s=e.senderId)?s:this.userId;return e.type?(0,B.Yq)(B.jI.shared().codes[e.type].add,this.userId,{code:e.code,"sender-id":t}):(0,B.Yq)(B.jI.shared().codes.post,this.userId,{code:e.code})}}ap.shared=(0,P.G)(e=>new ap(e));
3class av{constructor(e){this.codesDataModel=ap.shared(e)}activate(e){return this.codesDataModel.activate(e)}}av.shared=(0,P.G)(e=>new av(e));var am=t(76714);class af{constructor(e){this.userId=e}start(e){var s=(0,D.z)([ac.J.shared().bootParameters.pipe((0,w.T)(e=>e.promo)),ah.T.shared().limitedCreditsEnabled,ah.T.shared().limitedCreditsOrganicTrafficExperimentEnabled,ah.T.shared().limitedCreditsCodes]).pipe((0,g.s)(1),(0,I.n)(e=>{var[s,t,r,a]=e;return s?this.tryToApplyClientPromoCode(s,t,a):this.tryToApplyOrganicTrafficExperimentPromoCode(t,r,a)}));e.add(p.Session.shared().authorizationAction(this.userId).pipe((0,ea.p)(e=>"signup"===e),(0,I.n)(()=>s)).subscribe())}tryToApplyClientPromoCode(e,s,t){var r=t.includes(e);return r&&s||!r?av.shared(this.userId).activate({code:e}):eJ.v.just(void 0)}tryToApplyOrganicTrafficExperimentPromoCode(e,s,t){return e&&s?new eJ.v(e=>{am.A.get(s=>{e.success(null==s?void 0:s.afid)})}).pipe((0,eY.Fg)(e=>e?eJ.v.just(void 0):av.shared(this.userId).activate({code:t[0]}))):eJ.v.just(void 0)}}af.shared=(0,P.G)(e=>new af(e));var ab=t(12372),ag=t(91557);class aI{start(e){var s=p.Session.shared().userId.pipe((0,b.o)(),(0,I.n)(e=>p.Session.shared().authorizationAction(e).pipe((0,ea.p)(e=>"signup"===e),(0,I.n)(()=>p.Session.shared().authenticationCredentials))));e.add(s.subscribe(e=>{var s={},t=ab.A.getItem("real-email");t&&t.emguid&&(s.emguid=t.emguid),e.facebookId&&(s.facebookId=e.facebookId),e.googleId&&(s.googleId=e.googleId),l.A.synconce("event.analytics.markers.ready",()=>{ag.S&&am.A.moveToSaved(()=>{l.A.emit("command.analytics.registration.send",s),ab.A.removeItem("real-email")})})}))}}aI.shared=(0,P.G)(()=>new aI);var aw=t(21433),aS=t(15971);class ay{constructor(e){this.userId=e}start(e){e.add(eW.r.shared().focusState.pipe((0,ea.p)(e=>"focused"!==e),(0,tr.E)(T.T.shared().registrationTermsAcceptanceEnabled,aw.r.shared().name),(0,ea.p)(e=>{var[,s,t]=e;return s&&"registration-terms-acceptance"===t})).safeSubscribe(e=>{var[s]=e;aS.F.shared(this.userId).logUserWentFromPopup(s)}))}}ay.shared=(0,P.G)(e=>new ay(e));var aA=t(35234),aT=t(90826),ax=t(34323);class aC{constructor(e){this.userId=e}start(e){e.add(ax.K.shared(this.userId).canOffer.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s&&!t})).safeSubscribe(()=>{aA.K.shared().stop(),aT.a.shared().reloadPage()}))}}aC.shared=(0,P.G)(e=>new aC(e));var aF=t(79755),aD=t(37667);class ak{constructor(e){this.userId=e}trackRegistrationFinished(){return T.T.shared().userRegistrationTrackingEnabled.pipe((0,g.s)(1),(0,I.n)(e=>e?aD.N.shared().currentStep.pipe((0,I.n)(e=>"legacy"===e?k.w:(0,S.of)(void 0)),(0,g.s)(1)):k.w))}start(e){e.add(this.trackRegistrationFinished().safeSubscribe(()=>{aF.s.shared(this.userId).logRegistrationFinishedAction()}))}}ak.shared=(0,P.G)(e=>new ak(e));var aE=t(47802);class aj{start(e){e.add(p.Session.shared().userId.pipe((0,I.n)(e=>e?p.Session.shared().authorizationDetailsFor(e).pipe((0,ev.F)((e,s)=>e.demo===s.demo),(0,I.n)(e=>e.demo?k.w:p.Session.shared().authenticationCredentials),(0,ea.p)(e=>!!e.email&&!!e.password)):k.w),(0,ev.F)(ef()),(0,I.n)(e=>aE.a.shared().setCredentials(e))).safeSubscribe()),e.add(G.s.shared().passwordChanged.pipe((0,I.n)(e=>(0,D.z)([G.s.shared().email.pipe((0,b.o)(),(0,g.s)(1)),(0,S.of)(e)]))).safeSubscribe(e=>{var[s,t]=e;p.Session.shared().setAuthenticationCredentials({email:s,password:t})})),e.add(sn.o.shared().data().pipe((0,ev.F)(ef()),(0,I.n)(e=>e.token?aE.a.shared().setToken({token:e.token,product:e.product,baseHost:e.baseHost}).asObservable().pipe((0,rD.y)()):(0,S.of)(void 0))).safeSubscribe())}}aj.shared=(0,P.G)(()=>new aj);var aR=t(42766);class aO{start(e){e.add(sn.o.shared().data().pipe((0,ea.p)(e=>0!==Object.keys(e).length),(0,ev.F)((e,s)=>e0()(e,s)),(0,I.n)(e=>aR.a.shared().setIdentity(e).asObservable().pipe((0,rD.y)()))).safeSubscribe())}}aO.shared=(0,P.G)(()=>new aO);var aM=t(78204),aG=t(30679),aB=t(77783),aP=t(37418),a_=t(75e3),az=t(22381);class aN{constructor(e){this.userId=e}getChatRequestAnalytics(e,s){return s8.R.shared(e).cachedPresence.pipe((0,g.s)(1),(0,w.T)(t=>({attendeeId:e,requestType:s,candidateOnline:t.online})))}getChatRequestEventAnalytics(e){return this.getChatRequestAnalytics(e.attendeeId,(0,aB.U)(e))}getInviteAnalytics(e){return this.getChatRequestAnalytics(e.attendeeId,(0,aB.h)(e.message,e.automatic))}start(e){e.add(aG.Qx.shared(this.userId).chatRequests.pipe((0,g.s)(1)).pipe((0,I.n)(e=>
3(e.forEach(e=>{e.realtimeRecommendationId&&aP.V.shared().setRecommendationId(e.attendeeId,e.realtimeRecommendationId)}),e.length>0?(0,D.z)(e.map(e=>this.getChatRequestEventAnalytics(e))):(0,S.of)([])))).safeSubscribe(e=>{az.F.shared().logChatRequestListShown(e)})),e.add(a_.X.shared(this.userId).newInvite.pipe((0,ea.p)(e=>"invitation"===e.type),(0,I.n)(e=>this.getInviteAnalytics(e).pipe((0,w.T)(s=>({chatRequest:s,invite:e}))))).safeSubscribe(e=>{var{chatRequest:s,invite:t}=e;t.realtimeRecommendationId&&aP.V.shared().setRecommendationId(t.attendeeId,t.realtimeRecommendationId),az.F.shared().logChatRequestShown(s)})),e.add(a_.X.shared(this.userId).newInvite.pipe((0,ea.p)(e=>{var s;return!!(null!=e&&e.automatic)&&(null==e||null==(s=e.message)?void 0:s.type)===re.Go.Letter&&!!e.message.content.introductory}),(0,tr.E)(T.T.shared().limitedMingleEnabled.pipe((0,g.s)(1)))).safeSubscribe(e=>{var[s,t]=e;az.F.shared().logIntroductoryReceived(this.userId,t)}))}}aN.shared=(0,P.G)(e=>new aN(e));class aL extends(0,ex.yS)("purchase.form.payment-apm",10*eF.b.second){}var aq={label:aL.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"google-pay-platform-available":e=>{var s;return null==(s=e.encounters.googlePayAvailabilityResolved)?void 0:s.details},"apple-pay-platform-available":e=>{var s;return null==(s=e.encounters.applePayAvailabilityResolved)?void 0:s.details},"payment-methods-count":e=>{var s;return(null==(s=e.encounters.alternativeMethodsRendered)?void 0:s.details.methods.length)||0},"payment-settings-received-count":e=>{var s;return(null==(s=e.encounters.paymentSettingsReceived)?void 0:s.details.methods.length)||0},"payment-methods-visual-difference":e=>{var s;return e.encounters.alternativeMethodsRendered?null==(s=e.encounters.paymentSettingsReceived)?void 0:s.details.methods.filter(s=>{var t;return null==(t=e.encounters.alternativeMethodsRendered)?void 0:t.details.methods.includes(s)}).join(", "):void 0},"alternative-methods-render-failed":e=>!e.encounters.alternativeMethodsRendered},hist:{ttresult:{from:"added",to:"completed"},"ttalternative-methods-rendered":{from:"added",to:"alternativeMethodsRendered"},"ttpayment-settings-received":{from:"added",to:"paymentSettingsReceived"},"ttgoogle-pay-settings-availability-resolved":{from:"added",to:"googlePayAvailabilityResolved"},"ttapple-pay-settings-availability-resolved":{from:"added",to:"applePayAvailabilityResolved"}}};eC.H.shared().registerMapping(aL.type,aq);class aV{constructor(){this.complete=(e,s)=>{eT.E.shared().complete(aL.identifier(),e,s)},this.onPurchaseFormOpenStarted=e=>{eT.E.shared().add(new aL(new Date(e),null))},this.onPurchasePaymentFlowStep=(e,s)=>{2===s.totalSteps&&eT.E.shared().discard(aL.identifier())},this.onUserInteractionTrack=(e,s)=>{for(var t of s)if("purchase"===t.place.split(".")[0]&&2===t.step){eT.E.shared().add(new aL(new Date(e),null));break}},this.onPaymentSettingsReceived=(e,s)=>{eT.E.shared().encounter(aL.identifier(),{name:"paymentSettingsReceived",date:new Date(e),details:{methods:s.map(e=>e.name)}})},this.onGooglePayAvailabilityResolved=(e,s)=>{eT.E.shared().encounter(aL.identifier(),{name:"googlePayAvailabilityResolved",date:new Date(e),details:s})},this.onApplePayAvailabilityResolved=(e,s)=>{eT.E.shared().encounter(aL.identifier(),{name:"applePayAvailabilityResolved",date:new Date(e),details:s})},this.onAlternativePaymentsRendered=(e,s)=>{eT.E.shared().encounter(aL.identifier(),{name:"alternativeMethodsRendered",date:new Date(e),details:{methods:s}}),this.complete(new Date(e),eE.Q.success())},this.onPurchaseOverlayClosed=e=>{this.complete(new Date(e),eE.Q.failure("cancelled-by-user"))},this.onMotoFormError=e=>{this.complete(new Date(e),eE.Q.failure("moto-form-has-error"))}}start(e){l.A.addMarker("event.action.purchase.form.open.started",this.onPurchaseFormOpenStarted),l.A.addMarker("event.purchase.form.total-steps",this.onPurchasePaymentFlowStep),l.A.addMarker("command.user-actions.interaction.track",this.onUserInteractionTrack),l.A.addMarker("event.payment.settings.received",this.onPaymentSettingsReceived),l.A.addMarker("event.google-pay.availability.resolved",this.onGooglePayAvailabilityResolved),l.A.addMarker("event.apple-pay.availability.resolved",this.onApplePayAvailabilityResolved),l.A.addMarker("event.payment-request.availability.checked",this.onAlternativePaymentsRendered),l.A.addMarker("event.overlay.purchase.closed",this.onPurchaseOverlayClosed),l.A.addMarker("event.purchase.moto.form.error",this.onMotoFormError),e.add(()=>
3{l.A.removeMarker("event.action.purchase.form.open.started",this.onPurchaseFormOpenStarted),l.A.removeMarker("event.purchase.form.total-steps",this.onPurchasePaymentFlowStep),l.A.removeMarker("command.user-actions.interaction.track",this.onUserInteractionTrack),l.A.removeMarker("event.payment.settings.received",this.onPaymentSettingsReceived),l.A.removeMarker("event.google-pay.availability.resolved",this.onGooglePayAvailabilityResolved),l.A.removeMarker("event.apple-pay.availability.resolved",this.onApplePayAvailabilityResolved),l.A.removeMarker("event.payment-request.availability.checked",this.onAlternativePaymentsRendered),l.A.removeMarker("event.overlay.purchase.closed",this.onPurchaseOverlayClosed),l.A.removeMarker("event.purchase.moto.form.error",this.onMotoFormError)})}}aV.shared=(0,P.G)(()=>new aV);var aQ=t(6853),aU=t(88923),aY=t(17611);class aJ{constructor(){this.userId=void 0,this.motoIsInitialized=!1,this.settingsFilled=!1,this.actionIsReady=()=>{var e,s=eT.E.shared().activeAction(eL.y.identifier());return(null==s||null==(e=s.encounters)||null==(e=e.step)?void 0:e.details)!==void 0?!!s&&(1===s.encounters.step.details?!!s.encounters.packagesRendered:!!s.encounters.cardsRendered):!!s&&!!s.encounters.packagesRendered&&!!s.encounters.cardsRendered&&!!s.encounters.paymentSettingsReceived&&!!s.encounters.defaultPackageSelected},this.onFluxActionStarted=(e,s,t,r)=>{"overlay"===t.actionsName&&"forceOpen"===t.name&&"purchase"===s[0]&&eT.E.shared().encounter(eL.y.identifier(),{name:"openOverlayActionStarted",date:new Date,details:{activeActionsCount:r.currentActiveActions}})},this.onFluxActionEnded=(e,s,t,r)=>{"overlay"===t.actionsName&&"forceOpen"===t.name&&"purchase"===s.payload.name&&eT.E.shared().encounter(eL.y.identifier(),{name:"openOverlayActionEnded",date:new Date,details:{activeActionsCount:r.currentActiveActions}})},this.onFluxActionDispatched=(e,s,t,r)=>{"overlay"===t.actionsName&&"forceOpen"===t.name&&"purchase"===s.payload.name&&eT.E.shared().encounter(eL.y.identifier(),{name:"openOverlayActionDispatched",date:new Date,details:{activeActionsCount:r.currentActiveActions}})},this.onFormOpened=(e,s)=>{this.add(e,s)},this.onInteractionDetected=(e,s)=>{s.forEach(s=>{"purchase"===s.place.split(".")[0]&&(this.add(e,"purchase-step.package.click"),void 0!==s.step&&eT.E.shared().encounter(eL.y.identifier(),{name:"step",date:new Date(e),details:s.step}),void 0!==s.design&&(1===s.step?eT.E.shared().encounter(eL.y.identifier(),{name:"choosePackageStepDesign",date:new Date(e),details:s.design}):eT.E.shared().encounter(eL.y.identifier(),{name:"carouselExperimentEnabled",date:new Date(e),details:"carousel"===s.design})))})},this.onPaymentSettingsReceived=(e,s)=>{eT.E.shared().encounter(eL.y.identifier(),{name:"paymentSettingsReceived",date:new Date(e),details:{methods:s.map(e=>e.name)}})},this.onMotoFormErrorFromBus=e=>{eT.E.shared().complete(eL.y.identifier(),new Date(e),eE.Q.failure("moto-form-has-error"))},this.onEncounter=e=>s=>{eT.E.shared().encounter(eL.y.identifier(),{name:e,date:new Date(s),details:null}),this.actionIsReady()&&eT.E.shared().complete(eL.y.identifier(),new Date(s),eE.Q.success())},this.onCardsListRendered=this.onEncounter("cardsRendered"),this.onSelectedPackageRendered=this.onEncounter("defaultPackageSelected"),this.onPackagesListRendered=e=>{eT.E.shared().encounter(eL.y.identifier(),{name:"packagesListRendered",date:new Date(e),details:null})},this.onPackagesRendered=(e,s,t,r,a)=>{eT.E.shared().encounter(eL.y.identifier(),{name:"packagesRendered",date:new Date(e),details:{packages:s,packagesType:t}}),"number"==typeof r&&eT.E.shared().encounter(eL.y.identifier(),{name:"step",date:new Date(e),details:r}),void 0!==a&&eT.E.shared().encounter(eL.y.identifier(),{name:"carouselExperimentEnabled",date:new Date(e),details:a}),this.actionIsReady()&&eT.E.shared().complete(eL.y.identifier(),new Date(e),eE.Q.success())},this.onOverlayRendered=(e,s)=>{s.find(e=>"purchase"===e)&&eT.E.shared().encounter(eL.y.identifier(),{name:"renderOverlayContainerForPurchaseForm",date:new Date,details:{overlaysLength:s.length}})},this.onReadyForRenderOverlay=(e,s)=>{"purchase"===s&&eT.E.shared().encounter(eL.y.identifier(),{name:"readyForRenderPurchaseFormOverlay",date:new Date,details:!0})},this.onFormClosed=e=>{eT.E.shared().complete(eL.y.identifier(),new Date(e),eE.Q.failure("cancelled-by-user"))}}start(e){var s=C.Y.shared();l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.addMarker("event.action.purchase.form.o
3pen.started",this.onFormOpened),l.A.addMarker("event.cards.list.loaded",this.onCardsListRendered),l.A.addMarker("event.purchase.packaged.default.selected",this.onSelectedPackageRendered),l.A.addMarker("event.purchase.form.packages.ready",this.onPackagesRendered),l.A.addMarker("event.purchase.form.packages.list.ready",this.onPackagesListRendered),l.A.addMarker("event.payment.settings.received",this.onPaymentSettingsReceived),l.A.addMarker("event.purchase.moto.form.error",this.onMotoFormErrorFromBus),l.A.addMarker("event.overlay.purchase.closed",this.onFormClosed),l.A.addMarker("event.overlay.rendered",this.onOverlayRendered),l.A.addMarker("event.overlay.ready-for-rendered",this.onReadyForRenderOverlay),s.on("event.action.started",this.onFluxActionStarted),s.on("event.action.dispatch",this.onFluxActionDispatched),s.on("event.action.ended",this.onFluxActionEnded),e.add(p.Session.shared().userId.safeSubscribe(e=>{this.userId=e})),e.add(p.Session.shared().userId.pipe((0,I.n)(e=>e?aU.c.shared(e).data():(0,S.of)(void 0))).safeSubscribe(e=>{this.settingsFilled=!!e})),e.add(r3._.initialized.safeSubscribe(e=>{!this.motoIsInitialized&&e&&this.addMotoIsInitializedEncounter(),this.motoIsInitialized=e})),e.add(()=>{s.off("event.action.started",this.onFluxActionStarted),s.off("event.action.dispatch",this.onFluxActionDispatched),s.off("event.action.ended",this.onFluxActionEnded),l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.removeMarker("event.action.purchase.form.open.started",this.onFormOpened),l.A.removeMarker("event.cards.list.loaded",this.onCardsListRendered),l.A.removeMarker("event.purchase.packaged.default.selected",this.onSelectedPackageRendered),l.A.removeMarker("event.purchase.form.packages.ready",this.onPackagesRendered),l.A.removeMarker("event.purchase.form.packages.list.ready",this.onPackagesListRendered),l.A.removeMarker("event.payment.settings.received",this.onPaymentSettingsReceived),l.A.removeMarker("event.purchase.moto.form.error",this.onMotoFormErrorFromBus),l.A.removeMarker("event.overlay.purchase.closed",this.onFormClosed)})}addMotoIsInitializedEncounter(){eT.E.shared().encounter(eL.y.identifier(),{name:"motoIsInitialized",date:new Date,details:null})}add(e,s){var t=new eL.y(new Date(e),{sourceAction:s,preloadStatus:aJ.getPreloadStatus(this.userId,this.settingsFilled),motoInitializationRequired:!0}),r=eT.E.shared().activeAction(t);r&&!r.encounters.completed&&eT.E.shared().encounter(eL.y.identifier(),{name:"cancelingAction",date:new Date(e),details:s}),eT.E.shared().add(t),this.motoIsInitialized&&this.addMotoIsInitializedEncounter()}static getPreloadStatus(e,s){if(e){var t,r=C.Y.shared().get((0,aQ.default)(e,aQ.PACKAGE_TYPES.COMMON),e+":"+aQ.PACKAGE_TYPES.COMMON).store,a=r.isFilled(),i=C.Y.shared().get((0,aQ.default)(e,aQ.PACKAGE_TYPES.ADDITIONAL),e+":"+aQ.PACKAGE_TYPES.ADDITIONAL).store.isFilled(),n=C.Y.shared().get((0,aQ.default)(e,aQ.PACKAGE_TYPES.MYSTERY_GIFT),e+":"+aQ.PACKAGE_TYPES.MYSTERY_GIFT).store.isFilled(),d=C.Y.shared().get((0,aQ.default)(e,aQ.PACKAGE_TYPES.NOSUBSCRIPTION),e+":"+aQ.PACKAGE_TYPES.NOSUBSCRIPTION).store.isFilled(),o=C.Y.shared().get((0,aQ.default)(e,aQ.PACKAGE_TYPES.NOSUBSCRIPTION_ADDITIONAL),e+":"+aQ.PACKAGE_TYPES.NOSUBSCRIPTION_ADDITIONAL).store.isFilled(),u=Object.values((null==(t=r.getState())?void 0:t.packages)||{})[0],l=u&&u.currency,c=aY.G.shared().paymentMethodsPreloaded(l),h=Object.assign({settings:c.settingsPreloaded,googlePay:c.googlePayPreloaded},void 0!==c.applePayPreloaded?{applePay:c.applePayPreloaded}:{});return{cards:aY.G.shared().cardsPreloaded(),methods:h,settings:s,packages:{common:a,additional:i,"mystery-gift":n,nosubscription:d,"nosubscription.additional":o}}}return{cards:!1,methods:{settings:!1,applePay:!1,googlePay:!1},settings:!1,packages:{common:!1,additional:!1,"mystery-gift":!1,nosubscription:!1,"nosubscription.additional":!1}}}}aJ.shared=(0,P.G)(()=>new aJ);class aW extends(0,ex.yS)("change.subscription.form.open",10*eF.b.second){}var aH={label:aW.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"closed-by-overlay":e=>{var s;return null==(s=e.encounters.closedByOverlay)?void 0:s.details}},hist:{ttresult:{from:"added",to:"completed"}}};eC.H.shared().registerMapping(aW.type,aH);var aX=t(88314),aZ=t(7036);class a${start(e){e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,ev.F)(e0()),(0,ea.p)(e=>(null==e?void 0:e.name)==="change-subscription-plan")).safeSubscribe(()=>{eT.E.shared().add(new aW(new Date,null))})),e.add(aX.$.shared().componentRendered.safeSubscribe(e=>{e.displayName===aZ.ChangeSubscriptionForm.displayName&&eT.E.shared().complete(aW.i
3dentifier(),new Date,eE.Q.success())})),e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)==="change-subscription-plan"&&!e0()(s,t)})).safeSubscribe(e=>{var[s,t]=e;t&&eT.E.shared().encounter(aW.identifier(),{name:"closedByOverlay",date:new Date,details:t.name}),eT.E.shared().complete(aW.identifier(),new Date,eE.Q.failure("cancelled-by-user"))}))}}a$.shared=(0,P.G)(()=>new a$);var aK=t(83580),a0=t(77038),a1=t(64726),a5=t(58721),a3=t(57564);class a2{constructor(){this.covers=a3.E.shared().data()}}a2.shared=(0,P.G)(()=>new a2);var a8=["userId"];class a4{constructor(){this.actionIsReady=e=>{var s,t=eT.E.shared().activeAction(ej.identifier(e));return!!t&&!!(null!=t&&t.encounters.designVersionSet)&&((null==(s=t.encounters.designVersionSet)?void 0:s.details)==="dsgn5815"?!!t.encounters.thumbnailRendered&&!!t.encounters.nameRendered&&!!t.encounters.fewWordsAboutMeRendered&&!!t.encounters.communicationRendered&&!!t.encounters.galleryRendered&&!!t.encounters.presenceRendered&&!!t.encounters.alternativeCommunicationRendered:!!t.encounters.coverRendered&&!!t.encounters.thumbnailRendered&&!!t.encounters.nameRendered&&!!t.encounters.fewWordsAboutMeRendered&&!!t.encounters.communicationRendered&&!!t.encounters.galleryRendered&&!!t.encounters.presenceRendered&&!!t.encounters.alternativeCommunicationRendered)},this.currentActionUserId=()=>{var e;return(null==(e=eT.E.shared().activeActions(ej.type)[0])?void 0:e.identifier)||null},this.addEncounter=(e,s)=>{e===this.currentActionUserId()&&eT.E.shared().encounter(ej.identifier(e),s)},this.addRequiredEncounter=(e,s)=>{this.addEncounter(e,s),this.actionIsReady(e)&&this.complete(e,s.date,eE.Q.success())},this.onProfileClosed=(e,s)=>{this.complete(s,new Date(e),eE.Q.failure("cancelled-by-user"))},this.onProfileSuspended=(e,s)=>{var t=new Date(e);this.addRequiredEncounter(s,{name:"profileSuspended",date:t,details:!0}),this.complete(s,t,eE.Q.success())},this.onGalleryRendered=(e,s,t)=>{this.addRequiredEncounter(s,{name:"galleryRendered",date:new Date(e),details:{type:t}})},this.onCoverRendered=(e,s,t)=>{var r=t=>{this.addRequiredEncounter(s,{name:"coverRendered",date:new Date(e),details:{coverIsDefault:t}})};a2.shared().covers.toSingle().subscribe(e=>{r(!!e.find(e=>null==t?void 0:t.startsWith("/covers/"+e)))},()=>{r()})},this.onThumbnailRendered=(e,s)=>{this.addRequiredEncounter(s,{name:"thumbnailRendered",date:new Date(e),details:null})},this.onNameRendered=(e,s)=>{this.addRequiredEncounter(s,{name:"nameRendered",date:new Date(e),details:null})},this.onFewWordsRendered=(e,s)=>{this.addRequiredEncounter(s,{name:"fewWordsAboutMeRendered",date:new Date(e),details:null})},this.onCommunicationRendered=(e,s)=>{this.addRequiredEncounter(s,{name:"communicationRendered",date:new Date(e),details:null})},this.onPresenceRendered=(e,s,t)=>{this.addRequiredEncounter(s,{name:"presenceRendered",date:new Date(e),details:{online:t&&t.online,cameraAvailable:t&&(t.devices||[]).filter(e=>"cam"===e.name).length>0}})},this.onProfileBannersRendered=(e,s,t)=>{this.addRequiredEncounter(s,{name:"alternativeCommunicationRendered",date:new Date(e),details:{presentsAvailable:t["presents-available"],wishlistBannerVisible:t["wishlist-banner-visible"],sendEmailBannerVisible:t["send-email-banner-visible"],sendCheerBannerVisible:t["send-cheer-banner-visible"]}})},this.onWishlistBannerOfferingDataLoaded=(e,s)=>{this.addEncounter(s,{name:"wishlistBannerOfferingDataLoaded",date:new Date(e),details:null})},this.onLetterSendingBannerOfferingDataLoaded=(e,s)=>{this.addEncounter(s,{name:"letterSendingBannerOfferingDataLoaded",date:new Date(e),details:null})},this.onPresentsReceivingAvailabilityDataLoaded=(e,s)=>{this.addEncounter(s,{name:"presentsReceivingAvailabilityDataLoaded",date:new Date(e),details:null})},this.onInteractionDetected=(e,s)=>{s.forEach(s=>{var t,r,a,i,[n,d]=s.place.split(".");if("profile"===n){var o=!1,u=!1,l=!1;aK.o.shared(s.user).isFilled().safeSubscribe(e=>{o=e}),a0.t.shared(s.user).isFilled().safeSubscribe(e=>{u=e}),a1.q.shared(s.user).isFilled().safeSubscribe(e=>{l=e});var c=s8.R.shared(s.user).isFilled(),h=e$.jq.shared().preloadedProfilesImagesMetrics,p=!!(null!=h&&null!=(t=h[s.user])&&t[e$.$N.THUMBNAIL]),v=!!(null!=h&&null!=(r=h[s.user])&&r[e$.$N.COVER]),m=!!(null!=h&&null!=(a=h[s.user])&&a[e$.$N.GALLERY]),f=!!(null!=h&&null!=(i=h[s.user])&&i[e$.$N.WISHLIST]),b=!!e$.jq.shared().preloadedWishlistBannerOffering[s.user],I=this.currentActionUserId();I&&this.complete(I,new Date(e),eE.Q.failure("cancelled-by-user")),eT.E.shared().add(new ej(s.user,new Date(e),{cta:d,preloadStatus:{userPhotosFilled:o,userVideosFilled:u,userProfileFilled:l,cachedPresenceFilled:c,thumbnailImagePreloaded:p,coverImagePreloaded:v,galleryImagesPreloaded:m,wishlistPreloaded:f,wishlistBannerOfferingPreloaded:b}})),R.F.shared(s.user).canEdit.pipe((0,g.s)(1)).safeSubscribe(e=>{this.addEncounter(s.user,{name:"editableModeSet",details:e,date:new Date})}),eH.u.shared().version.pipe((0,g.s)(1)).safeSubscribe(e=>{this.addRequiredEncounter(s.user,{name:"designVersionSet",details:e,date:new Date})})}})},this.complete=(e,s,t)=>{e===this.currentActionUserId()&&eT.E.shared().complete(ej.identifier(e),s,t)}}start(e){l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.addMarker("event.profile.cover.rendered",this.onCoverRendered),l.A.addMarker("event.profile.thumbnail.rendered",this.onThumbnailRe
3ndered),l.A.addMarker("event.profile.name.rendered",this.onNameRendered),l.A.addMarker("event.profile.few-words.rendered",this.onFewWordsRendered),l.A.addMarker("event.profile.communication.rendered",this.onCommunicationRendered),l.A.addMarker("event.presence.rendered",this.onPresenceRendered),l.A.addMarker("event.profile.gallery.rendered",this.onGalleryRendered),l.A.addMarker("event.pages.profile.closed",this.onProfileClosed),l.A.addMarker("event.profile.suspended",this.onProfileSuspended),l.A.addMarker("event.wishlist-banner-offering.data-loaded",this.onWishlistBannerOfferingDataLoaded),l.A.addMarker("event.letter-sending-banner-offering.data-loaded",this.onLetterSendingBannerOfferingDataLoaded),l.A.addMarker("event.presents-receiving-availability.data-loaded",this.onPresentsReceivingAvailabilityDataLoaded),e.add(()=>{l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.removeMarker("event.profile.cover.rendered",this.onCoverRendered),l.A.removeMarker("event.profile.thumbnail.rendered",this.onThumbnailRendered),l.A.removeMarker("event.profile.name.rendered",this.onNameRendered),l.A.removeMarker("event.profile.few-words.rendered",this.onFewWordsRendered),l.A.removeMarker("event.profile.communication.rendered",this.onCommunicationRendered),l.A.removeMarker("event.presence.rendered",this.onPresenceRendered),l.A.removeMarker("event.profile.gallery.rendered",this.onGalleryRendered),l.A.removeMarker("event.pages.profile.closed",this.onProfileClosed),l.A.removeMarker("event.profile.suspended",this.onProfileSuspended),l.A.removeMarker("event.wishlist-banner-offering.data-loaded",this.onWishlistBannerOfferingDataLoaded),l.A.removeMarker("event.letter-sending-banner-offering.data-loaded",this.onLetterSendingBannerOfferingDataLoaded),l.A.removeMarker("event.presents-receiving-availability.data-loaded",this.onPresentsReceivingAvailabilityDataLoaded)}),e.add(aX.$.shared().componentRendered.safeSubscribe(e=>{if(e.displayName===a5.P.displayName){var{result:s,renderDate:t}=e.renderInfo,r=s.value.containerRenderInfo.result.value,{userId:a}=r,i=function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}(r,a8);this.onProfileBannersRendered(t.getTime(),a,i)}}))}}a4.shared=(0,P.G)(()=>new a4);class a6{constructor(){this.addRequiredEncounter=e=>{eT.E.shared().encounter(eO.identifier(),e),this.actionIsRendered(),this.actionIsReady()&&this.complete(e.date,eE.Q.success())},this.actionIsReady=()=>{var e=eT.E.shared().activeAction(eO.identifier());return!!e&&!!e.encounters.listRendered&&!!e.encounters.interactionReady},this.actionIsRendered=()=>{var e=eT.E.shared().activeAction(eO.identifier());e&&e.encounters.listRendered&&eT.E.shared().encounter(eO.identifier(),{name:"rendered",date:e.encounters.listRendered.date,details:null})},this.complete=(e,s)=>{eT.E.shared().complete(eO.identifier(),e,s)},this.onInteractionDetected=(e,s)=>{s.forEach(s=>{var[t,r]=s.place.split(".");"search"===t&&eT.E.shared().add(new eO(new Date(e),{cta:r}))})},this.onListRendered=(e,s)=>this.addRequiredEncounter({name:"listRendered",date:new Date(s),details:null}),this.onInteractionReady=(e,s)=>this.addRequiredEncounter({name:"interactionReady",date:new Date(s),details:null}),this.onSearchClosed=e=>{this.complete(new Date(e),eE.Q.failure("cancelled-by-user"))}}start(e){l.A.addMarker("event.profile.search.list.rendered",this.onListRendered),l.A.addMarker("event.profile.search.interaction.ready",this.onInteractionReady),l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),e.add(()=>{l.A.removeMarker("event.profile.search.list.rendered",this.onListRendered),l.A.removeMarker("event.profile.search.interaction.ready",this.onInteractionReady),l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected)})}}a6.shared=(0,P.G)(()=>new a6);class a9 extends(0,ex.yS)("users.gallery.open"){}var a7={label:a9.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},cta:e=>e.details.cta,editable:e=>!!(e.encounters.editableModeSet&&e.encounters.editableModeSet.details),"media-type":e=>{var s;return null==(s=e.encounters.mediaTypeDetected)?void 0:s.details},"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error}},hist:{ttresult:{from:"added",to:"completed"},ttinteract:{from:"added",to:"interactionReady"}}};eC.H.shared().registerMapping(a9.type,a7);class ie{constructor(){this.addRequiredEncounter=e=>{eT.E.shared().encounter(a9.identifier(),e)},this.complete=(e,s)=>{eT.E.shared().complete(a9.identifier(),e,s)},this.onInteractionDetected=(e,s)=>
3{s.forEach(s=>{var[t,r,a]=s.place.split(".");"gallery"===t&&(eT.E.shared().add(new a9(new Date(e),{cta:r})),eT.E.shared().encounter(a9.identifier(),{name:"mediaTypeDetected",date:new Date(e),details:a}))})},this.onEditableMode=e=>{this.addRequiredEncounter({name:"editableModeSet",date:new Date(e),details:!0})},this.onImageLoaded=e=>{this.complete(new Date(e),eE.Q.success())},this.onGalleryClosed=e=>{this.complete(new Date(e),eE.Q.failure("cancelled-by-user"))},this.onImageLoadedFailed=e=>{this.complete(new Date(e),eE.Q.failure("media-loading-failed"))}}start(e){l.A.addMarker("event.overlay.photos.mode.editable.set",this.onEditableMode),l.A.addMarker("event.gallery.frame.loaded",this.onImageLoaded),l.A.addMarker("event.gallery.frame.load.failed",this.onImageLoadedFailed),l.A.addMarker("event.overlay.photos.closed",this.onGalleryClosed),l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),e.add(()=>{l.A.removeMarker("event.overlay.photos.mode.editable.set",this.onEditableMode),l.A.removeMarker("event.gallery.frame.loaded",this.onImageLoaded),l.A.removeMarker("event.gallery.frame.load.failed",this.onImageLoadedFailed),l.A.removeMarker("event.overlay.photos.closed",this.onGalleryClosed),l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected)})}}ie.shared=(0,P.G)(()=>new ie);class is{constructor(){this.webRTCStats={},this.onAttendeeProfileReceived=(e,s)=>{eT.E.shared().encounter(se.identifier(s.id),{date:new Date(e),name:"attendeeProfileDetermined",details:s})},this.onUserProfileReceived=(e,s,t)=>{eT.E.shared().encounter(se.identifier(t),{date:new Date(e),name:"userProfileDetermined",details:s})},this.onCallDestroyed=(e,s,t)=>{var{cta:r}=t;this.sendWebRTCStatsAndClean(s,e),eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"initializationEnded",details:null});var a=eT.E.shared().activeAction(se.identifier(s)),i=null!=a&&a.encounters.connected?eE.Q.success({finishReason:r}):eE.Q.failure(r||"other");eT.E.shared().complete(se.identifier(s),new Date(e),i)},this.sendWebRTCStatsAndClean=(e,s)=>{if(this.webRTCStats[e]){eT.E.shared().encounter(se.identifier(e),{date:new Date(s),name:"webRtcStatsCollected",details:{localVolumeArray:this.webRTCStats[e].localAudioVolumeArray,remoteVolumeArray:this.webRTCStats[e].remoteAudioVolumeArray}});var t=this.webRTCStats[e].collectWebRTCStatsInterval;t&&clearInterval(t),delete this.webRTCStats[e]}},this.initialWebRTCStats=()=>({localAudioVolumeArray:[],remoteAudioVolumeArray:[],collectWebRTCStatsInterval:null}),this.collectWebRTCStats=(e,s)=>{this.getWebRTCStats(e,s);var t=1;this.webRTCStats[s].collectWebRTCStatsInterval=setInterval(()=>{t>60||(t++,this.getWebRTCStats(e,s))},1e3)},this.getWebRTCStats=(e,s)=>{e.getStats().then(e=>{this.webRTCStats[s]&&e.forEach(e=>{"audio"===e.kind&&e.id.startsWith("RTCAudioSource_")&&this.webRTCStats[s].localAudioVolumeArray.push(e.audioLevel),"audio"===e.kind&&e.id.startsWith("RTCMediaStreamTrack_receiver_")&&this.webRTCStats[s].remoteAudioVolumeArray.push(e.audioLevel)})})},this.onCallConnected=(e,s,t)=>{var{rtcPeerConnection:r}=t;this.webRTCStats[s]=this.initialWebRTCStats(),this.collectWebRTCStats(r,s),r.getStats().then(t=>{var r;t.forEach(e=>{if("candidate-pair"===e.type&&"succeeded"===e.state){var s=t.get(e.localCandidateId).candidateType;r="relay"===t.get(e.remoteCandidateId).candidateType||"relay"===s?"turn":"p2p"}}),eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"connected",details:{type:r}})})},this.onCallAnswered=(e,s,t)=>{eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"answered",details:t})},this.onAttendeeReplyPlatformInfoReceived=(e,s,t)=>{eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"attendeeReplyPlatformInfo",details:t})},this.onApiErrorReturned=(e,s,t)=>{eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"apiErrorCatch",details:t})},this.onPurchaseRequired=(e,s)=>{eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"paymentRequired",details:null})},this.onRequestSent=(e,s,t)=>{(t.in||t.out)&&eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"requestSent",details:null})},this.onPongReceived=(e,s)=>{eT.E.shared().encounter(se.identifier(s.sender),{date:new Date(e),name:"pongReceived",details:{network:s.network||{},cameraEnabled:s.cameraEnabled||!1,product:s.product}})},this.onVideoPlaying=(e,s,t)=>{eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"initializationEnded",details:null}),eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"incomingStreamStarted",details:null}),eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"audioTrackReceived",details:{muted:null!=t&&!!t.length&&t[0].muted,enabled:null!=t&&!!t.length&&t[0].enabled,numberOfTracks:(null==t?void 0:t.length)||0}})},this.onIceGathered=(e,s)=>{eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"iceGathered",details:null})},this.onSdpOfferCreated=(e,s)=>{eT.E.shared().encounter(se.identifier(s),{date:new Date(e),name:"sdpOfferCreated",details:null})},this.onInteractionDetected=(e,s)=>
3{s.forEach(s=>{var t=s.place.split(".");"video-chat-start"===t[0]&&(eT.E.shared().add(new se(s.user,new Date(e),{cta:t[1]})),R.F.shared(s.user).profile.pipe((0,w.T)(e=>e.value||{}),(0,g.s)(1)).subscribe(e=>{er.g.shared().emit("event.call.attendee-profile.received",e)}),s8.R.shared(s.user).cachedPresence.pipe((0,g.s)(1)).safeSubscribe(e=>{var{devices:t,online:r}=e;eT.E.shared().encounter(se.identifier(s.user),{date:new Date,name:"attendeeDevices",details:t}),eT.E.shared().encounter(se.identifier(s.user),{date:new Date,name:"attendeeOnlineStatus",details:r?"online":"offline"})}),p.Session.shared().userId.pipe((0,b.o)(),(0,I.n)(e=>R.F.shared(e).profile),(0,w.T)(e=>e.value||{}),(0,g.s)(1)).subscribe(e=>{er.g.shared().emit("event.call.user-profile.received",e,s.user)}),p.Session.shared().userId.pipe((0,b.o)(),(0,I.n)(e=>q.e.shared(e).balance),(0,g.s)(1)).subscribe(e=>{eT.E.shared().encounter(se.identifier(s.user),{date:new Date,name:"userHasCreditsDetermined",details:e>0})}))})}}start(e){er.g.shared().addMarker("event.call.connected",this.onCallConnected),er.g.shared().addMarker("event.chat.media.destroyed",this.onCallDestroyed),er.g.shared().addMarker("event.call.payment.required",this.onPurchaseRequired),er.g.shared().addMarker("event.call.attendee-profile.received",this.onAttendeeProfileReceived),er.g.shared().addMarker("event.call.user-profile.received",this.onUserProfileReceived),er.g.shared().addMarker("event.call.api.error.returned",this.onApiErrorReturned),er.g.shared().addMarker("event.chat.media.answer.received",this.onCallAnswered),er.g.shared().addMarker("event.chat.media.attendee-reply-platform-info.received",this.onAttendeeReplyPlatformInfoReceived),er.g.shared().addMarker("document.call.video.incoming.playing",this.onVideoPlaying),er.g.shared().addMarker("event.call.request.sent",this.onRequestSent),er.g.shared().addMarker("event.call.presence.got",this.onPongReceived),er.g.shared().addMarker("event.call.ice.gathered",this.onIceGathered),er.g.shared().addMarker("event.call.sdp.offer.created",this.onSdpOfferCreated),l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),e.add(()=>{er.g.shared().removeMarker("event.call.connected",this.onCallConnected),er.g.shared().removeMarker("event.chat.media.destroyed",this.onCallDestroyed),er.g.shared().removeMarker("event.call.payment.required",this.onPurchaseRequired),er.g.shared().removeMarker("event.call.attendee-profile.received",this.onAttendeeProfileReceived),er.g.shared().removeMarker("event.call.user-profile.received",this.onUserProfileReceived),er.g.shared().removeMarker("event.call.api.error.returned",this.onApiErrorReturned),er.g.shared().removeMarker("event.chat.media.answer.received",this.onCallAnswered),er.g.shared().removeMarker("event.chat.media.attendee-reply-platform-info.received",this.onAttendeeReplyPlatformInfoReceived),er.g.shared().removeMarker("document.call.video.incoming.playing",this.onVideoPlaying),er.g.shared().removeMarker("event.call.request.sent",this.onRequestSent),er.g.shared().removeMarker("event.call.presence.got",this.onPongReceived),er.g.shared().removeMarker("event.call.ice.gathered",this.onIceGathered),er.g.shared().removeMarker("event.call.sdp.offer.created",this.onSdpOfferCreated),l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected)})}}is.shared=(0,P.G)(()=>new is);class it extends(0,ex.XI)("dialogs.chat.open",10*eF.b.second){}var ir={label:it.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"bottle-neck-event":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?(0,ex.dj)(e):void 0},cta:e=>e.details.cta,"messages-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.messagesRendered},"user-name-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.userNameRendered},"cheers-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.cheersRendered},"thumbnail-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.thumbnailRe
3ndered},"presence-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.presenceRendered},"user-activity-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.userActivityRendered},"popular-member-indicator-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.popularMemberIndicatorRendered},"call-button-render-failed":e=>{var s;return null!=(s=e.encounters.completed)&&s.details.isSuccessful?void 0:!e.encounters.callButtonRendered}},hist:{ttresult:{from:"added",to:"completed"},ttinteract:{from:"added",to:"interactionReady"},"ttmessages-rendered":{from:"added",to:"messagesRendered"},"ttuser-name-rendered":{from:"added",to:"userNameRendered"},"ttcheers-rendered":{from:"added",to:"cheersRendered"},"ttthumbnail-rendered":{from:"added",to:"thumbnailRendered"},"ttpresence-rendered":{from:"added",to:"presenceRendered"},"ttuser-activity-indicator-rendered":{from:"added",to:"userActivityRendered"},"ttpopular-member-indicator-rendered":{from:"added",to:"popularMemberIndicatorRendered"},"ttcall-button-rendered":{from:"added",to:"callButtonRendered"}}};eC.H.shared().registerMapping(it.type,ir);class ia{constructor(){this.onInteractionDetected=(e,s)=>{s.forEach(s=>{"chat.contacts-list"===s.place&&s.user&&this.startAction(s.user,new Date(e),"chats-list",!1),"chat.chat-requests"===s.place&&s.user&&this.startAction(s.user,new Date(e),"chats-list",!1),"messages.invitation"===s.place&&s.user&&this.startAction(s.user,new Date(e),"invite",!1),"profile"===s.cta&&"messages.text.send"===s.place&&s.recipient&&this.startAction(s.recipient,new Date(e),s.cta,!0)})},this.currentActionUserId=()=>{var e;return(null==(e=eT.E.shared().activeActions(it.type)[0])?void 0:e.identifier)||null},this.actionIsCompleted=e=>{var s=eT.E.shared().activeAction(it.identifier(e));return!!s&&!!s.encounters.userNameRendered&&!!s.encounters.thumbnailRendered&&!!s.encounters.messagesRendered&&!!s.encounters.cheersRendered},this.addEncounter=(e,s)=>{e===this.currentActionUserId()&&(eT.E.shared().encounter(it.identifier(e),s),this.actionIsCompleted(e)&&this.complete(e,s.date,eE.Q.success()))},this.startAction=(e,s,t,r)=>{var a=this.currentActionUserId();if((!r||a!==e)&&this.chatIdentifier!==e){a&&this.complete(a,s,eE.Q.failure("cancelled-by-user"));var i=new it(e,s,{cta:t});this.chatIdentifier=i.identifier,eT.E.shared().add(i)}},this.complete=(e,s,t)=>{e===this.currentActionUserId()&&eT.E.shared().complete(it.identifier(e),s,t)},this.onSidebarOpen=(e,s,t,r)=>{r||"chat"!==s||this.startAction(t,new Date(e),"chats-list",!0)},this.onSidebarClosed=()=>{this.chatIdentifier=void 0},this.onUserNameRendered=(e,s)=>{this.addEncounter(s,{name:"userNameRendered",date:new Date(e),details:null})},this.onThumbnailRendered=(e,s)=>{this.addEncounter(s,{name:"thumbnailRendered",date:new Date(e),details:null})},this.onMessagesRendered=(e,s)=>{this.addEncounter(s,{name:"messagesRendered",date:new Date(e),details:null})},this.onCheersRendered=(e,s)=>{this.addEncounter(s,{name:"cheersRendered",date:new Date(e),details:null})},this.onThumbnailRenderFailed=(e,s)=>{this.complete(s,new Date(e),eE.Q.failure("failed"))}}start(e){l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.addMarker("command.sidebar.open",this.onSidebarOpen),l.A.addMarker("command.sidebar.close",this.onSidebarClosed),l.A.addMarker("event.chat.attendee.rendered",this.onUserNameRendered),l.A.addMarker("event.chat.attendee.thumbnail.rendered",this.onThumbnailRendered),l.A.addMarker("event.chat.attendee.thumbnail.render.failed",this.onThumbnailRenderFailed),l.A.addMarker("event.chat.messages.rendered",this.onMessagesRendered),l.A.addMarker("event.chat.cheers.rendered",this.onCheersRendered),l.A.addMarker("event.chat.cheers.fab.rendered",this.onCheersRendered),l.A.addMarker("event.chat.cheers.freem.limit.rendered",this.onCheersRendered),l.A.addMarker("event.chat.cheers.onboarding.fab.rendered",this.onCheersRendered),e.add(()=>{l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.removeMarker("command.sidebar.open",this.onSidebarOpen),l.A.removeMarker("command.sidebar.close",this.onSidebarClosed),l.A.removeMarker("event.chat.attendee.rendered",this.onUserNameRendered),l.A.removeMarker("event.chat.attendee.thumbnail.rendered",this.onThumbnailRe
3ndered),l.A.removeMarker("event.chat.attendee.thumbnail.render.failed",this.onThumbnailRenderFailed),l.A.removeMarker("event.chat.messages.rendered",this.onMessagesRendered),l.A.removeMarker("event.chat.cheers.rendered",this.onCheersRendered),l.A.removeMarker("event.chat.cheers.fab.rendered",this.onCheersRendered),l.A.removeMarker("event.chat.cheers.freem.limit.rendered",this.onCheersRendered),l.A.removeMarker("event.chat.cheers.onboarding.fab.rendered",this.onCheersRendered)})}}ia.shared=(0,P.G)(()=>new ia);var ii=t(31249),id=t(27680);class io{constructor(e){this.userId=e}start(e){e.add(T.T.shared().textToSpeechEnabled.pipe((0,I.n)(e=>e?ii.j.shared().visible.pipe((0,su.J)(),(0,I.n)(e=>{var[s,t]=e;return void 0!==s&&!s&&t?id.XN.shared(this.userId).acceptOffer():(0,S.of)()})):(0,S.of)(!1))).safeSubscribe())}}io.shared=(0,P.G)(e=>new io(e));var iu=t(27616);class il{constructor(e){this.userId=e}start(e){e.add(T.T.shared().textToSpeechEnabled.pipe((0,I.n)(e=>e?ii.j.shared().visible.pipe((0,I.n)(e=>e?iu.zr.shared(this.userId).acceptOffer():(0,S.of)())):(0,S.of)(!1))).safeSubscribe())}}il.shared=(0,P.G)(e=>new il(e));var ic=t(147);class ih{constructor(e){this.userId=e}start(e){e.add(ic.n.shared(this.userId).canOffer.pipe((0,ea.p)(e=>e),(0,I.n)(()=>ic.n.shared(this.userId).startOffer())).safeSubscribe()),e.add(ic.n.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>new eJ.v(e=>{var s=C.Y.shared().get(eg.A);s.actions.open("user-birthday-credits",[{props:{onAcceptButtonClick:()=>{s.actions.close("user-birthday-credits")}}}]),e.success()}))).safeSubscribe())}}ih.shared=(0,P.G)(e=>new ih(e));var ip=t(84419);class iv{constructor(e){this.reasonsCollectedDuringActiveChat={},this.userId=e}start(e){e.add(ra.i.shared(this.userId).offerBlockingReason.safeSubscribe(e=>{var s,{reason:t,attendeeId:r}=e;if("chat-inactive"===t){null==(s=this.reasonsCollectedDuringActiveChat[r])||s.clear();return}this.reasonsCollectedDuringActiveChat[r]||(this.reasonsCollectedDuringActiveChat[r]=new Set),this.reasonsCollectedDuringActiveChat[r].has(t)||(ip.f.shared(this.userId).logOfferBlocked(r,t,"chat"),this.reasonsCollectedDuringActiveChat[r].add(t))}))}}iv.shared=(0,P.G)(e=>new iv(e));var im=t(56823),ib=t(42696),ig=t(41059),iI=t(59224);class iw{constructor(e){this.userId=e}openQuizAfterDelay(e,s){return(0,im.O)(e).pipe((0,I.n)(()=>{var e=C.Y.shared().get(eg.A).store;return e.isLeadingToConversion()?e.rxState().pipe((0,ea.p)(s=>!s||!e.isLeadingToConversion()),(0,g.s)(1),(0,I.n)(()=>ib.dA.shared(this.userId).showIntro(s)),(0,ee.M)(()=>eI.Y.shared().open(new ig.Y(this.userId,s)))):ib.dA.shared(this.userId).showIntro(s).pipe((0,eY.ex)(()=>{eI.Y.shared().open(new ig.Y(this.userId,s))}))}))}start(e){e.add(ib.dA.shared(this.userId).autoStartEnabled.pipe((0,I.n)(e=>e?(0,S.of)(window.matchMedia("(min-width: 769px)").matches).pipe((0,g.s)(1),(0,I.n)(e=>e?p.Session.shared().userIsUsual.pipe((0,b.o)(),(0,I.n)(e=>e?C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status?e.attendee:void 0),(0,ev.F)()):k.w),(0,I.n)(e=>e?ib.dA.shared(this.userId).checkAvailability(e).asObservable().pipe((0,I.n)(s=>s?T.T.shared().videoCallQuiz.startDelay.pipe((0,g.s)(1),(0,I.n)(s=>this.openQuizAfterDelay(s,e))):k.w)):k.w)):k.w)):k.w)).safeSubscribe()),e.add(f.I.shared(this.userId).events("ci:event.video-call-quiz.attendee.availability.check").pipe((0,I.n)(e=>window.matchMedia("(min-width: 769px)").matches?M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(s=>s?ib.dA.shared(this.userId).checkAvailability().asObservable().pipe((0,w.T)(s=>({available:s,attendeeId:e.sender}))):(0,S.of)({available:!1,attendeeId:e.sender}))):(0,S.of)({available:!1,attendeeId:e.sender,reason:"screen-resolution"})),(0,I.n)(e=>{var s=e.reason;return ib.dA.shared(this.userId).sendAvailability(e.attendeeId,e.available,s)})).safeSubscribe()),e.add(C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,su.J)(),(0,w.T)(e=>{var[s,t]=e;return"speaking"===s.status&&"speaking"!==t.status}),(0,ev.F)()).pipe((0,I.n)(e=>e?ib.dA.shared(this.userId).stopQuiz():k.w)).safeSubscribe()),e.add(M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(e=>e?ib.dA.shared(this.userId).status.pipe((0,w.T)(e=>"intro"===e.name||"active"===e.name)):k.w),(0,I.n)(e=>e?C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status?e.attendee:void 0),(0,ev.F)(),(0,ee.M)(e=>{e&&eI.Y.shared().open(new ig.Y(this.userId,e))})):(0,S.of)(null))).safeSubscribe()),e.add(ib.dA.shared(this.userId).status.pipe((0,su.J)(),(0,I.n)(e=>{var[s,t]=e;return"idle"!==t.name||t.name===s.name?k.w:eI.Y.shared().component.pipe((0,g.s)(1))})).safeSubscribe(e=>{(null==e?void 0:e.name)==="video-call-quiz"&&eI.Y.shared().close()})),e.add(ib.dA.shared(this.userId).visible.pipe((0,ev.F)(),(0,I.n)(e=>(0,D.z)([eI.Y.shared().component,C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status?e.attendee:void 0),(0,ev.F)())]).pipe((0,g.s)(1),(0,ee.M)(s=>{var[t,r]=s;e?(null==t?void 0:t.name)!=="video-call-quiz"&&r&&eI.Y.shared().open(new ig.Y(this.userId,r)):(null==t?void 0:t.name)==="video-call-quiz"&&eI.Y.shared().close()})))).safeSubscribe()),e.add(ib.dA.shared(this.userId).status.pipe((0,ev.F)(),(0,I.n)(e=>"finished"!==e.name?k.w:eI.Y.shared().component.pipe((0,g.s)(1),(0,ee.M)(e=>{(null==e?void 0:e.name)==="video-call-quiz"&&eI.Y.shared().close()}),(0,eP.u)(e))),(0,ee.M)(e=>{eI.Y.shared().open(new iI.Q(this.userId,e.senderId,e.recipientId,e.quizId))})).safeSubscribe())}}iw.shared=(0,P.G)(e=>new iw(e));var iS=t(32139),iy=t(3820);class iA{constructor(e){this.userId=e}start(e){var s=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status?e.attendee:void 0),(0,ev.F)()),t=p.Session.shared().userIsUsual;e.add(s.pipe((0,I.n)(e=>e?t.pipe((0,g.s)(1),(0,I.n)(s=>s?(0,D.z)([ib.dA.shared(this.userId).status,ib.dA.shared(this.userId).id]).pipe((0,ee.M)(s=>{var[t,r]=s;"active"===t.name&&void 0!==r&&iy.K.shared(this.userId).logQuizStarted(e,r)})):k.w)):k.w)).safeSubscribe()),e.add(s.pipe((0,I.n)(e=>e?t.pipe((0,g.s)(1),(0,I.n)(s=>s?ib.dA.shared(this.userId).status.pipe((0,I.n)(e=>"finished"!==e.name?k.w:(0,D.z)([ib.dA.shared(this.userId).answers,ib.dA.shared(this.userId).id])),(0,ee.M)(s=>{var[t,r]=s,a=t.filter(e=>e.userAnswer===e.attendeeAnswer).length;void 0!==r&&iy.K.shared(this.userId).logQuizFinished(e,r,a)})):k.w)):k.w)).safeSubscribe()),e.add(s.pipe((0,I.n)(e=>e?t.pipe((0,g.s)(1),(0,I.n)(s=>s?ib.dA.shared(this.userId).blockingReason.pipe((0,ee.M)(s=>{s&&iy.K.shared(this.userId).logQuizBlocked(e,s)})):k.w)):k.w)).safeSubscribe()),e.add(s.pipe((0,I.n)(e=>e?ib.dA.shared(this.userId).status.pipe((0,I.n)(e=>"active"!==e.name?k.w:ib.dA.shared(this.userId).activeQuestionIndex),(0,I.n)(s=>{var t=!1;return(0,D.z)([ib.dA.shared(this.userId).id,ib.dA.shared(this.userId).answers]).pipe((0,ee.M)(r=>{var a,[i,n]=r;void 0!==i&&null!=(a=n[s])&&a.userAnswer&&!t&&(t=!0,iy.K.shared(this.userId).logQuizQuestionAnswered(e,i,s))}))})):k.w)).safeSubscribe())}}iA.shared=(0,P.G)(e=>new iA(e));var iT=t(97995),ix=t(80163),iC=t(65428);class iF{constructor(e){this.userId=e}start(e){e.add(iT.v.shared().viewed.pipe((0,I.n)(e=>{var s=e.attendeeId;return(0,D.z)([s8.R.shared(s).cachedPresenceStatus,rG.n.shared(this.userId).userInContacts(s)]).pipe((0,g.s)(1),(0,w.T)(e=>{var[s,t]=e;return"onlineWithCamera"===s&&!t&&iC.K.shared().supportsWebRtc}),(0,w.T)(s=>({invite:e,canStartVideoChat:s})))})).safeSubscribe(e=>{var{invite:s,canStartVideoChat:t}=e,r={attendeeId:s.attendeeId,displayType:"toplist",inviteId:s.id,inviteType:"invitation",userId:s.userId,sourceProduct:s.realmData?s.realmData.realm:""};t?ix.e.shared(this.userId).logInviteToVideochatInteracted(r):ix.e.shared(this.userId).logInviteInteracted(r)})),e.add(a_.X.shared(this.userId).newInvite.pipe((0,ea.p)(e=>{var s;return!!(null!=(s=e.realmData)&&s.realm)})).safeSubscribe(e=>{var s={attendeeId:e.attendeeId,inviteId:e.id,inviteType:"invitation",userId:e.userId,sourceProduct:e.realmData?e.realmData.realm:""};return ix.e.shared(this.userId).logInviteReceived(s)}))}}function iD(e){return e.type+" "+e.message+" at "+e.filename+" "+e.lineno+":"+e.colno}iF.shared=(0,P.G)(e=>new iF(e));var ik=t(79548),iE=[/ResizeObserver/i,/^Hypertune:\s.*$/],ij=[/^Hypertune:\s.*$/];class iR{constructor(){var e=this;this.debugHandler=function(){var s="string"==typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:"";ij.some(e=>e.test(s))||e.originalConsoleDebug(...arguments)},this.originalConsoleError=window.console.error,this.originalConsoleDebug=window.console.debug}start(e){(0,ik.$)()&&L.T.shared().features["console-handler-enabled"]&&(window.console.debug=this.debugHandler,e.add(()=>{window.console.debug=this.originalConsoleDebug}),window.addEventListener("error",this.showErrorAlert),window.console.error=this.showConsoleError,e.add(()=>{window.removeEventListener("error",this.showErrorAlert),window.console.error=this.originalConsoleError}))}showErrorAlert(e){iE.some(s=>{var t;return!!(null!=(t=e.message.match(s))&&t.length)})?console.warn("ErrorHandler known error: "+iD(e)):l.A.emit("command.system-message.send","error",iD(e))}showConsoleError(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];l.A.emit("command.system-message.send","error",JSON.stringify(s,null,2))}}iR.shared=(0,P.G)(()=>new iR);var iO=t(662),iM=t(93648),iG=t(85752),iB=t(82701),iP=t(50103),i_=t(4411),iz=t(26216),iN=["maxAge","minAge"];class iL{constructor(e){this.userId=e}start(e){var s,t,r=(()=>{try{return(JSON.parse(localStorage.getItem("__appdata")||"{}")||{}).persistence[this.userId+".search.filters"]||{}}catch(e){return{}}})(),a=iM.BE.shared(this.userId).defaultFilters.pipe((0,w.T)(e=>(function(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t})(e,iN)));null!=(s=window.feedPreload)&&s.users&&e.add((0,D.z)([eJ.v.from(window.feedPreload.users),a]).toSingle().pipe((0,eY.Fg)(e=>{var[s,t]=e,a=s.map(e=>(0,iB.oV)(Object.assign({},(0,iz.A)(e,["occupation","about","city"]),e.location?(0,iz.A)(e.location,["city"]):{}))),i=Object.assign({},(0,iG.rr)(t),r);return eJ.v.zip(iB.Q7.shared(this.userId).setStateIfNotFilled(a,i,eF.b.minute).pipe((0,eY.AB)(void 0)),...a.map(e=>e.tags?rX.o.shared(e.id).setStateIfNotFilled(e.tags).pipe((0,eY.AB)(void 0)):eJ.v.just()))})).safeSubscribe()),null!=(t=window.feedPreload)&&t.personalizedUsers&&e.add((0,D.z)([eJ.v.from(window.feedPreload.personalizedUsers),a]).toSingle().pipe((0,eY.Fg)(e=>{var[s,t]=e,a=s.requestId,i=s.recommendationId,n=s.users.length?s.users.map(e=>({userPreviewDto:(0,iB.oV)(Object.assign({},(0,iz.A)(e,["occupation","about","city"]),e.location?(0,iz.A)(e.location,["city"]):{}),s.recommendationId),requestId:a,recommendationId:i})):[{userPreviewDto:void 0,requestId:a,recommendationId:i}],d=Object.assign({},(0,iG.dI)(t),r);
3return i_.T.shared(this.userId).setStateIfNotFilled(n,d,10*eF.b.minute).pipe((0,eY.AB)(void 0))})).safeSubscribe()),e.add(T.T.shared().personalRecommendationsInFeedEnabled.pipe((0,I.n)(e=>iP.y.shared("search",this.userId).store("recommendation",e).asObservable())).safeSubscribe())}}iL.shared=(0,P.G)(e=>new iL(e));var iq=t(4126),iV=t(99027),iQ=t(60116),iU=t(17250),iY=t(6801),iJ=t(85499),iW=t(59288),iH=t(46856),iX=t(64998);class iZ{constructor(e){this.preloadedLettersImages={},this.prefetchedLetter={},this.attachmentUri=(e,s,t)=>(0,iq.v)(()=>{if(e.local||"audio"===e.mediaType)return k.w;var r="photo"===e.mediaType,a="cheer"===e.mediaType,i=!!e.reference&&e.reference.includes("/free"),n=a?(0,iV.nT)(e.basename,e.reference):r?(0,iV.qW)(s,t,e.basename,!1,i):(0,iV.Bt)(s,t,e.basename,!0,i);return(r&&!i&&this.userId!==s?new iQ._l(this.userId,{type:"image",path:n,ownerId:s}).status.pipe((0,g.s)(1),(0,w.T)(r=>"available"===r?n:(0,iV.qW)(s,t,e.basename,!0,i))):(0,S.of)(n)).pipe((0,w.T)(s=>({path:this.getAttachmentPathByMediaType(s,e.mediaType)})))}),this.coverUri=e=>{var s=this.config.photos.letterCover;return(0,S.of)({path:(0,iV.Nj)(e)+"."+s.size+"."+s.options.join(".")})},this.thumbnailUri=e=>R.F.shared(e).profile.pipe((0,g.s)(1),(0,iU.K)(s=>{if(!s.isSuccessful||!s.value.thumbnail)return null;var t=this.config.photos.chatThumbnail;return{path:(0,iV.DD)(e,s.value.thumbnail)+"."+t.size+"."+t.options.join(".")}})),this.userId=e,this.config=L.T.shared()}start(e){e.add(iW.c.shared().deepLink.safeSubscribe(e=>{if((null==e?void 0:e.type)==="letter"){var s={id:e.args.letterId,recipient:e.args.recipient||this.userId,sender:e.args.sender,introductory:"introductory"===e.args.letterType,presentAnswer:"present"===e.args.letterType},t={type:"letter",path:(0,iV.io)(s.sender,s.recipient,s.id,s.introductory,s.presentAnswer),ownerId:this.userId};R.F.shared(s.sender).profile.toSingle().safeSubscribe(),(0,iH.Z)(s.sender),new iQ._l(this.userId,t).buy().pipe((0,eY.Fg)(e=>e.isSuccessful?iJ.c.shared(this.userId).get(s).toSingle():eJ.v.error(e.error)),(0,eY.ex)(e=>{e.isSuccessful&&e.value&&this.prefetchLetter(e.value)})).safeSubscribe()}}))}getAttachmentPathByMediaType(e,s){var t="";switch(s){case"photo":t=e+"."+this.config.photos.letterPhotoAttachment.size+"."+this.config.photos.letterPhotoAttachment.options.join(".");break;case"video":case"cheer":t=e+"."+this.config.photos.letterVideoAttachment.size+"."+this.config.photos.letterVideoAttachment.options.join(".")}return(0,iY.o)(t,this.config.sharding)+"?authorization="+iX.a.shared().getAAF()}prefetchLetter(e){var s=this.prefetchedLetter[e.id];if(!s||!e0()(s,e)){this.prefetchedLetter[e.id]=e;var t=e.attachments.filter(e=>e.basename&&!e.local);t.length&&(0,S.of)(...t).pipe((0,sm.Z)(s=>this.attachmentUri(s,e.sender,e.recipient)),(0,I.n)(s=>this.prefetchPhoto(e.id,s.path))).safeSubscribe(),this.coverUri(e.cover).pipe((0,I.n)(s=>this.prefetchPhoto(e.id,(0,iY.o)(s.path,this.config.sharding)))).safeSubscribe(),this.thumbnailUri(e.sender).pipe((0,I.n)(s=>this.prefetchPhoto(e.id,(0,iY.o)(s.path,this.config.sharding)))).safeSubscribe()}}prefetchPhoto(e,s){return new eJ.v(t=>{var r=new Image;return r.onload=()=>t.success(void 0),r.onerror=e=>t.error(e),r.src=s,this.saveImageReferences(e,r),()=>{r.src=""}})}saveImageReferences(e,s){var t;null!=(t=this.preloadedLettersImages[e])&&t.images&&this.preloadedLettersImages[e].images.push(s)}}iZ.shared=(0,P.G)(e=>new iZ(e));var i$=t(74003),iK=t(32948),i0=t(74143);class i1{constructor(e){this.userId=e}start(e){var s=iK.g.shared().deepLink.pipe((0,I.n)(e=>{if("send-present"!==e.type)return k.w;var{attendeeId:s,category:t,presentsIds:r}=e.args;return r?i0.U.shared(this.userId).addItems(s,r).pipe((0,eY.Fg)(()=>(0,i$.K)(s,t,void 0,{source:"deeplink"}))):(0,i$.K)(s,t,void 0,{source:"deeplink"})}));e.add(T.T.shared().presentsEnabled.pipe((0,I.n)(e=>e?s:k.w)).safeSubscribe())}}i1.shared=(0,P.G)(e=>new i1(e));var i5=t(75446),i3=t(66103),i2=t(91825),i8=t(9990),i4=t(44105),i6=t(45113),i9=t(14816);class i7 extends i2.y{constructor(e){super([{type:"user-birthday-presents-sending-offering",offering:i8.z.shared(e)},{type:"user-new-year-presents-sending-offering",offering:i4.p.shared(e)},{type:"user-saint-valentine-presents-sending-offering",offering:i6.N.shared(e)},{type:"user-women-day-sending-offering",offering:i9.Y.shared(e)}])}}i7.shared=(0,P.G)(e=>new i7(e));
3class ne extends i3.M{constructor(e){super(i7.shared(e),ne.recommendUserPresentsSending)}static recommendUserPresentsSending(e){switch(e.type){case"user-birthday-presents-sending-offering":var s;return s=e.offer,eJ.v.defer(()=>{var e=C.Y.shared().get(eg.A),t="user-birthday-present-sending-recommendation";return e.store.rxState().pipe((0,w.T)(s=>!!s&&e.store.isLeadingToConversion()),(0,ea.p)(e=>!e),(0,g.s)(1),(0,ee.M)(()=>{e.actions.open(t,[{props:{attendeeId:s.data.userId,onClose:()=>{e.actions.close(t)}}}])}),(0,eP.u)(void 0)).toSingle()});case"user-new-year-presents-sending-offering":case"user-saint-valentine-presents-sending-offering":case"user-women-day-sending-offering":return(0,i5.K)(e.offer)}}}ne.shared=(0,P.G)(e=>new ne(e));var ns=t(32061);class nt{constructor(e){this.userId=e}start(e){e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,ea.p)(e=>(null==e?void 0:e.name)==="holiday-present-sending-recommendation")).safeSubscribe(e=>{var s,t=null==e||null==(s=e.params)?void 0:s[0].props;null!=t&&t.attendeeIds&&null!=t&&t.holidayType&&ns.l.shared(this.userId).logHolidayPresentRecommendationShown(t.attendeeIds,t.holidayType)})),e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,ea.p)(e=>(null==e?void 0:e.name)==="presents-order-modal")).safeSubscribe(e=>{var s,t=null==e||null==(s=e.params)?void 0:s[0].props;null!=t&&t.userId&&null!=t&&t.holidayType&&null!=t&&t.cta&&ns.l.shared(this.userId).logHolidayPresentRecommendationAccepted(t.userId,t.holidayType,t.cta)}))}}nt.shared=(0,P.G)(e=>new nt(e));var nr=t(96650);class na{constructor(e){this.userId=e}tryCloseOverPage(){return eI.Y.shared().component.pipe((0,g.s)(1),(0,ee.M)(e=>{(null==e?void 0:e.name)==="video-call-quiz-results"&&eI.Y.shared().close()}),(0,eP.u)(void 0))}start(e){e.add(nr.j.shared().chatAttendee.pipe((0,I.n)(e=>e?k.w:this.tryCloseOverPage())).safeSubscribe()),e.add(C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>e.status),(0,ev.F)(),(0,su.J)(),(0,I.n)(e=>{var[s,t]=e;return"speaking"===s&&"idle"===t||"speaking"===t?this.tryCloseOverPage():k.w})).safeSubscribe())}}na.shared=(0,P.G)(e=>new na(e));class ni{constructor(e){this.userId=e}start(e){var s=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status?e.attendee:void 0),(0,ev.F)()),t=(0,D.z)([ib.dA.shared(this.userId).answers,ib.dA.shared(this.userId).activeQuestionIndex]).pipe((0,ea.p)(e=>{var[s,t]=e;return t===s.length-1&&!!s[t].userAnswer&&!!s[t].attendeeAnswer}),(0,w.T)(e=>{var[s]=e;return s}),(0,g.s)(1));e.add(T.T.shared().videoCallQuiz.enabled.pipe((0,I.n)(e=>e?p.Session.shared().userIsUsual:k.w),(0,I.n)(e=>e?s:k.w),(0,I.n)(e=>e?t.pipe((0,I.n)(s=>ib.dA.shared(this.userId).id.pipe((0,b.o)(),(0,I.n)(t=>ib.dA.shared(this.userId).sendQuizResults(e,t,s))))):k.w)).safeSubscribe())}}ni.shared=(0,P.G)(e=>new ni(e));var nn=t(44150),nd=t(81468),no=t(52118);class nu{start(e){e.add(iK.g.shared().deepLink.pipe((0,I.n)(e=>"send-cheer"===e.type?((0,nd.Z)(e.args.attendeeId),el.j.shared().chatAttendee.pipe((0,ea.p)(s=>s===e.args.attendeeId),(0,g.s)(1),(0,I.n)(s=>this.sendCheer(e.args.cheerName,e.args.attendeeId)))):k.w)).safeSubscribe())}sendCheer(e,s){return nn.$.shared(s).cheersSet().toSingle().pipe((0,eY.vV)(t=>{var r=t.find(s=>s.shortName===e);r&&(0,no.G)(r,s,"deep-link").safeSubscribe()}))}}nu.shared=(0,P.G)(()=>new nu);var nl=t(32389);class nc{constructor(e){this.userId=e}start(e){e.add(iK.g.shared().deepLink.pipe((0,I.n)(e=>{if("message"!==e.type)return k.w;var{attendeeId:s,action:t,text:r}=e.args;return(0,iH.Z)(s),el.j.shared().chatAttendee.pipe((0,ea.p)(e=>e===s),(0,g.s)(1),(0,I.n)(()=>"send"===t?(l.A.emit("cmd:message:send",s,{text:r}),k.w):nl.S.shared(this.userId).updateDraftMessage(s,r)))})).safeSubscribe())}}nc.shared=(0,P.G)(e=>new nc(e));var nh=t(92362);class np{constructor(e){this.userId=e}start(e){e.add(iK.g.shared().deepLink.pipe((0,I.n)(e=>{if("message"!==e.type)return k.w;var{attendeeId:s,action:t,text:r}=e.args;return"draft"===t?nl.S.shared(this.userId).getDraftMessage(s).pipe((0,ea.p)(e=>e===r),(0,g.s)(1),(0,ee.M)(()=>{nh.a.shared(this.userId).logIceBreakerDrafted(s)})):"send"===t?f.I.shared(this.userId).events("message:message:v2").pipe((0,ea.p)(e=>e.sender===this.userId&&e.recipient===s&&e.text===r),(0,g.s)(1),(0,ee.M)(()=>{nh.a.shared(this.userId).logIceBreakerSent(s)})):k.w})).safeSubscribe())}}np.shared=(0,P.G)(e=>new np(e));var nv=t(37168),nm=t(82549);class nf{constructor(){var e=this;this.onOverlayOpen=function(){for(var s=arguments.length,t=Array(s),r=0;r<s;r++)t[r]=arguments[r];e.addBreadcrumb("overlay",t)},this.onOverlayClose=function(){for(var s=arguments.length,t=Array(s),r=0;r<s;r++)t[r]=arguments[r];e.addBreadcrumb("command.overlay.close",t)},this.onOverlayCloseAll=function(){for(var s=arguments.length,t=Array(s),r=0;r<s;r++)t[r]=arguments[r];e.addBreadcrumb("command.overlay.closeall",t)},this.onPageOpen=function(){for(var s=arguments.length,t=Array(s),r=0;r<s;r++)t[r]=arguments[r];e.addBreadcrumb("command.page.open",t)},this.onPageClose=function(){for(var s=arguments.length,t=Array(s),r=0;r<s;r++)t[r]=arguments[r];e.addBreadcrumb("command.page.close",t)},this.onSidebarOpen=function(){for(var s=arguments.length,t=Array(s),r=0;r<s;r++)t[r]=arguments[r];e.addBreadcrumb("command.sidebar.open",t)},this.onSidebarClose=function(){for(var s=arguments.length,t=Array(s),r=0;r<s;r++)t[r]=arguments[r];e.addBreadcrumb("command.sidebar.close",t)}}start(e){e.add(p.Session.shared().userId.safeSubscribe(e=>{nv.gV(e?{id:e}:null)})),e.add(new y.c(()=>(l.A.on("overlay",this.onOverlayOpen),l.A.on("command.overlay.close",this.onOverlayClose),l.A.on("command.overlay.closeall",this.onOverlayCloseAll),l.A.on("command.page.open",this.onPageOpen),l.A.on("command.page.close",this.onPageClose),l.A.on("command.sidebar.open",this.onSidebarOpen),l.A.on("command.sidebar.close",this.onSidebarClose),()=>{l.A.removeListener("overlay",this.onOverlayOpen),l.A.removeListener("command.overlay.close",this.onOverlayClose),l.A.removeListener("command.overlay.closeall",this.onOverlayCloseAll),l.A.removeListener("command.page.open",this.onPageOpen),l.A.removeListener("command.page.close",this.onPageClose),l.A.removeListener("command.sidebar.open",this.onSidebarOpen),l.A.removeListener("command.sidebar.close",this.onSidebarClose)})).safeSubscribe())}addBreadcrumb(e,s){nm.Z({level:"info",category:"bus",message:"on "+e,data:{args:s}})}}nf.shared=(0,P.G)(()=>new nf);var nb=t(34756),ng=t(45484),nI=t(66113),nw=t(74113);class nS{constructor(e){this.userId=e}start(e){var s=(0,K.h)(C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status||"connecting"===e.status?e.attendee:void 0),(0,ev.F)()),ru.M.shared(this.userId).state.pipe((0,w.T)(e=>"speaking"===e.status?e.participants[0]:"connecting"===e.status?e.calleeId:void 0),(0,ev.F)(),(0,I.n)(e=>e?rl.K.shared(this.userId).id(e):(0,S.of)(void 0)))),t=T.T.shared().failedCallCallBackRequests.enabled.pipe((0,I.n)(e=>e?p.Session.shared().userIsUsual:(0,S.of)(!1)));e.add(t.pipe((0,I.n)(e=>e?f.I.shared(this.userId).events("message:message:v2").pipe((0,ea.p)(e=>("videocall.missed"===e.type||"videocall.finished"===e.type)&&e.sender===this.userId),(0,I.n)(e=>M.f.shared(e.recipient).userIsFeaturedMember.pipe((0,I.n)(s=>{var t;if(!s||(null==(t=e.meta)?void 0:t["call-type"])==="voiceonly")return k.w;if("videocall.finished"===e.type){if(!e.meta||!e.meta["call-finished-timestamp"]||!e.meta["call-started-timestamp"])return k.w;var r=new Date(e.meta["call-started-timestamp"]).getTime(),a=new Date(e.meta["call-finished-timestamp"]).getTime()-r;return T.T.shared().failedCallCallBackRequests.videoCallDurationConsideredUnsuccessful.pipe((0,I.n)(s=>a>s?k.w:(nI.O.shared(this.userId).setFailedCallCallBackRequestingIsActive(!0),nI.O.shared(this.userId).addFailedCallCallBackRequest(e.recipient))))}return"videocall.missed"===e.type&&e.meta&&e.meta["auto-call"]?k.w:(nI.O.shared(this.userId).setFailedCallCallBackRequestingIsActive(!0),nI.O.shared(this.userId).addFailedCallCallBackRequest(e.recipient))})))):k.w)).safeSubscribe()),e.add(t.pipe((0,I.n)(e=>e?s:k.w),(0,I.n)(e=>e?nI.O.shared(this.userId).requests.pipe((0,g.s)(1),(0,I.n)(s=>s.some(s=>s.attendeeId===e)?nI.O.shared(this.userId).removeRequest(e):k.w)):k.w)).safeSubscribe()),e.add(t.pipe((0,I.n)(e=>e?nI.O.shared(this.userId).requests:k.w),(0,I.n)(e=>sr.E.shared().currentTime().pipe((0,eY.Fg)(s=>{var t=e.filter(e=>e.expiresAt<s);return t.length?nI.O.shared(this.userId).removeRequest(...t.map(e=>e.attendeeId)):eJ.v.just(void 0)})))).safeSubscribe()),e.add(t.pipe((0,I.n)(e=>e?nI.O.shared(this.userId).requests.pipe((0,ea.p)(e=>e.some(e=>"failed.call.callback.request"===e.reason)),(0,g.s)(1)):k.w)).safeSubscribe(()=>{nI.O.shared(this.userId).setFailedCallCallBackRequestingIsActive(!0)})),e.add(new y.c(e=>{var s=s=>{e.next(s.sender)};return er.g.shared().addListener("command.chat.media.decline",s),()=>{er.g.shared().removeListener("command.chat.media.decline",s)}}).pipe((0,I.n)(e=>nI.O.shared(this.userId).removeRequest(e))).safeSubscribe()),e.add(nw.x.shared(this.userId).history.pipe((0,ea.p)(e=>!!e.length),(0,I.n)(e=>{var s=e[e.length-1];return"declined-by-callee"!==s.status?k.w:rl.K.shared(this.userId).id(s.attendeeId)}),(0,I.n)(e=>e?nI.O.shared(this.userId).removeRequest(e):k.w)).safeSubscribe())}}nS.shared=(0,P.G)(e=>new nS(e));var ny=t(65615),nA=t(52300);
3class nT{constructor(e){this.purchaseStarted=nA.t,this.purchaseFinished=nA.t}purchase(e,s,t){return nA.t}}nT.shared=(0,P.G)(e=>new nT(e));var nx=t(27881),nC=t(24759),nF=t(41392),nD=t(71534);class nk{constructor(){this.interacted=new y.c(e=>{var s=s=>{e.next(this.processInteract(s))},t=nD.t.shared().visible.pipe((0,ea.p)(e=>!e)).subscribe(()=>{e.next({})});return l.A.on("event.payment-form.interact",s),()=>{t.unsubscribe(),l.A.removeListener("event.payment-form.interact",s)}}).pipe((0,ep.Z)({}),(0,ev.F)(),(0,tw.t)(1))}processInteract(e){if("package-selected"===e.type)return{packageSku:e.package.sku,hasDiscount:e.package.discount}}}nk.shared=(0,P.G)(()=>new nk);var nE=t(20570),nj=t(93096),nR=t(83901),nO=t(54097),nM=t(2071),nG=["method"],nB=["method"];function nP(e,s){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(s.includes(r))continue;t[r]=e[r]}return t}var n_="tracked-receipt-exchanges";class nz{constructor(e){this.userId=e,this.persistence=tz.y.shared("payment-tracker",e)}mapSupportedMethodToMotoMethod(e){switch(e){case"google":return"googlepay";case"apple":return"applepay";case"cards":return"card";default:return e}}start(e){e.add(ny.Q.shared().balanceRefillingIntent.pipe((0,I.n)(e=>j.x.shared(this.userId).tags.pipe((0,w.T)(s=>({balanceRefillingRequest:e,hasSubscription:s.includes("subscription")})),(0,g.s)(1)))).safeSubscribe(e=>{var{hasSubscription:s,balanceRefillingRequest:t}=e;nx.ex.shared().logPurchaseFormShown(t.reason.name,s?"other":"subscription")})),e.add(nT.shared(this.userId).purchaseStarted.pipe((0,I.n)(e=>q.e.shared(this.userId).hasConfirmedPurchases.pipe((0,w.T)(s=>({purchaseStarted:e,hasConfirmedPurchases:s})),(0,g.s)(1)))).safeSubscribe(e=>{var{purchaseStarted:s,hasConfirmedPurchases:t}=e;nx.ex.shared().logPurchaseProductSelected(s.invoice.sku,s.reason,!t,s.invoice.subscription?"subscription":"other")})),e.add(nT.shared(this.userId).purchaseStarted.pipe((0,ea.p)(e=>"mobile"===(0,e_.platform)()&&!!e.invoice&&!!e.paywallSessionId&&e.invoice.method!==nO.D3.cards),(0,I.n)(e=>nM.R.shared().getState(e.paywallSessionId).pipe((0,w.T)(s=>({purchaseStarted:e,state:s})),(0,g.s)(1)))).safeSubscribe(e=>{var{purchaseStarted:s,state:t}=e,{paywallSessionId:r,invoice:a}=s,i=null==t?void 0:t.paymentMethods;if(r&&i&&a){var{method:n}=a,d=nP(a,nG);nR.z.shared(this.userId).logPurchaseStarted(r,this.mapSupportedMethodToMotoMethod(n),Object.assign({},d,{methods:i}))}})),e.add(q.e.shared(this.userId).purchasedInApplication.pipe((0,I.n)(e=>{var s,t=null==(s=e.meta)?void 0:s.transactionId;return t?this.persistence.load(n_).asObservable().pipe((0,I.n)(e=>{var s=e||[];return s.includes(t)?k.w:this.persistence.store(n_,[...s,t].slice(-50)).pipe((0,eY.ex)(()=>nx.ex.shared().logReceiptExchanged()))}),(0,rD.y)()):(nx.ex.shared().logReceiptExchanged(),k.w)})).safeSubscribe()),e.add(nE.G.shared(this.userId).purchaseIntended.safeSubscribe(()=>{nx.ex.shared().logReceiptCreated()})),e.add(nj.g.shared(this.userId).purchaseIntended.safeSubscribe(()=>{nx.ex.shared().logMotoReceiptCreated()})),e.add(nT.shared(this.userId).purchaseFinished.pipe((0,I.n)(e=>q.e.shared(this.userId).hasConfirmedPurchases.pipe((0,w.T)(s=>({purchaseResult:e,hasConfirmedPurchases:s})),(0,g.s)(1)))).safeSubscribe(e=>{var s,t,{purchaseResult:r,hasConfirmedPurchases:a}=e,{error:i,isSuccessful:n,value:d}=r;i?nx.ex.shared().logPurchaseFailed(i.reason,i.invoice.sku,i.invoice.subscription?"subscription":"other"):n&&nx.ex.shared().logPurchaseSuccess(d.sku,d.initialPrice.includingTax,d.localizedPrice?((null==(s=d.localizedPrice)?void 0:s.includingTax)||0)+" "+((null==(t=d.localizedPrice)?void 0:t.currency)||""):"",!a,r.value.subscription?"subscription":"other")})),e.add(nT.shared(this.userId).purchaseFinished.pipe((0,w.T)(e=>{var{isSuccessful:s,value:t,error:r}=e;return{paywallSessionId:s?t.paywallSessionId:null==r?void 0:r.paywallSessionId,invoice:s?t:null==r?void 0:r.invoice,isSuccessful:s}}),(0,ea.p)(e=>{var{paywallSessionId:s,invoice:t}=e;return"mobile"===(0,e_.platform)()&&!!t&&!!s}),(0,I.n)(e=>{var{paywallSessionId:s,invoice:t,isSuccessful:r}=e;return nM.R.shared().getState(s).pipe((0,w.T)(e=>({paywallSessionId:s,invoice:t,isSuccessful:r,state:e})),(0,g.s)(1))})).safeSubscribe(e=>{var{paywallSessionId:s,invoice:t,isSuccessful:r,state:a}=e,i=this.mapSupportedMethodToMotoMethod(t.method),n=r?eE.Q.success({paymentMethod:i}):eE.Q.failure({paymentMethod:i,errorCode:null,rawError:null});if(s&&null!=a&&a.paymentMethods){var d=a.paymentMethods,o=nP(t,nB);nR.z.shared(this.userId).logPurchaseFinished(s,n,Object.assign({},o,{methods:d}),!0)}})),e.add(nD.t.shared().visible.pipe((0,ea.p)(e=>e),(0,nC.c)(1.1*eF.b.minute),(0,ee.M)(()=>nx.ex.shared().logPurchaseFormOpened(this.userId))).safeSubscribe()),e.add(nD.t.shared().visible.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s&&!t}),(0,ee.M)(()=>nx.ex.shared().logPaymentPurchaseFormClosed(this.userId))).safeSubscribe()),e.add((0,D.z)([nk.shared().interacted,te._.shared(this.userId).onActionSuccess("purchase.form.o
3pened")]).pipe((0,ea.p)(e=>{var[s]=e;return!!s.packageSku}),(0,nF.B)(10.1*eF.b.second),(0,ee.M)(e=>{var[s]=e;nx.ex.shared().logPurchaseFormFilled(this.userId,s)})).safeSubscribe())}}nz.shared=(0,P.G)(e=>new nz(e));var nN=t(51830);class nL{constructor(e){this.userId=e}start(e){e.add(T.T.shared().mcs.enabled.pipe((0,ea.p)(e=>e),(0,g.s)(1),(0,I.n)(()=>sO.w.shared().userDistractionAllowed.pipe((0,I.n)(e=>e?A.M.shared(this.userId).init():A.M.shared(this.userId).dispose())))).safeSubscribe()),e.add(()=>{A.M.shared(this.userId).initialized.toSingle().pipe((0,eY.Fg)(e=>e?A.M.shared(this.userId).dispose():k.w.toSingle()),(0,eY.W_)(void 0)).safeSubscribe()})}}nL.shared=(0,P.G)(e=>new nL(e));var nq=t(54458);class nV{constructor(e){this.userId=e}start(e){e.add(M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(e=>e?k.w:A.M.shared(this.userId).paymentRequired),(0,I.n)(e=>{var s="voiceonly"===e.callType?e2.N.MCSAudioCall:e2.N.MSCCall;return e3.w.shared().add({name:s}).asObservable()})).safeSubscribe())}}nV.shared=(0,P.G)(e=>new nV(e));class nQ extends(0,ex.XI)("dialogs.cheers.popup.open",20*eF.b.second){}var nU={label:nQ.type,tags:{team:()=>"vg",success:e=>{var s;return(null==(s=e.encounters.completed)||null==(s=s.details)?void 0:s.isSuccessful)||!1},cta:e=>e.details.cta,"failure-reason":e=>{var s;return null==(s=e.encounters.completed)?void 0:s.details.error},"cheers-count":e=>{var s;return null==(s=e.encounters.cheersRendered)?void 0:s.details}},hist:{ttresult:{from:"added",to:"completed"},"tttitle-rendered":{from:"added",to:"titleRendered"},"ttcheers-rendered":{from:"added",to:"cheersRendered"}}};eC.H.shared().registerMapping(nQ.type,nU);var nY=t(8739),nJ=t(56108),nW=t(92297);class nH{constructor(){this.onPopupClose=(e,s)=>{eT.E.shared().complete(nQ.identifier(s.attendeeId),new Date(e),eE.Q.failure(s.reason))},this.onPopupOpen=(e,s)=>{eT.E.shared().add(new nQ(s.attendeeId,new Date(e),{cta:s.cta}))}}static cheersPopupInfo(e){for(var s=e;s;){if(s.displayName===nY.r.displayName)return s;s=s.getParent()}return null}start(e){l.A.addMarker("event.action.chat.cheers.list.open.started",this.onPopupOpen),l.A.addMarker("event.action.chat.cheers.list.close.started",this.onPopupClose),e.add(()=>{l.A.removeMarker("event.action.chat.cheers.list.open.started",this.onPopupOpen),l.A.removeMarker("event.action.chat.cheers.list.close.started",this.onPopupClose)}),e.add(aX.$.shared().componentRendered.safeSubscribe(e=>{var s,t=nH.cheersPopupInfo(e);if(t){var r=t.props.attendeeId;switch(e.displayName){case nY.r.displayName:eT.E.shared().complete(nQ.identifier(r),e.renderInfo.renderDate,eE.Q.success());break;case nJ.l.displayName:eT.E.shared().encounter(nQ.identifier(r),{name:"titleRendered",date:e.renderInfo.renderDate,details:null});break;case nW.X.displayName:eT.E.shared().encounter(nQ.identifier(r),{name:"cheersRendered",date:e.renderInfo.renderDate,details:null==(s=e.props.cheers)?void 0:s.length})}}})),e.add(aX.$.shared().componentRenderingFailed.safeSubscribe(e=>{var s=nH.cheersPopupInfo(e);if(s){var t=s.props.attendeeId;eT.E.shared().complete(nQ.identifier(t),e.renderInfo.renderDate,eE.Q.failure("failed"))}}))}}nH.shared=(0,P.G)(()=>new nH);var nX=t(47984),nZ=t(92724),n$=t(8788),nK=t(43523),n0=t(26233),n1=t(48195),n5=t(48148);class n3{constructor(){this.readLetterIntentSubject=new sp.B,this.readLetterIntentReplaySubject=new ey.m(1),this.readLetterResultSubject=new sp.B,this.readLetterErrorSubject=new sp.B,this.readLetterIntent=this.readLetterIntentSubject.asObservable(),this.readLetterIntentReplay=this.readLetterIntentReplaySubject.asObservable(),this.readLetterResult=this.readLetterResultSubject.asObservable(),this.readLetterError=this.readLetterErrorSubject.asObservable()}interceptIntent(e){this.readLetterIntentSubject.next(e),this.readLetterIntentReplaySubject.next(e)}interceptResult(e,s){this.readLetterResultSubject.next({letter:e,result:s})}interceptError(e,s){this.readLetterErrorSubject.next({letter:e,error:s})}}n3.shared=(0,P.G)(()=>new n3);class n2{constructor(){this.readLetterRenderId=null,this.attachmentComponentsRendered={media:!1,cheer:!1},this.onInteractionDetected=(e,s)=>
3{s.forEach(s=>{var[t,r]=s.place.split(".");if("letters"===t&&s["place-details"]&&s["place-details"]["letter-id"]){var a="default"===s["place-details"]["letter-type"]?"letter":s["place-details"]["letter-type"],i=s["place-details"]["letter-id"],n=eT.E.shared().activeAction(eG.identifier(i));(null==n||"app-open"!==n.details.cta)&&(this.attachmentComponentsRendered={media:!1,cheer:!1},this.readLetterRenderId=null,eT.E.shared().add(new eG(i,new Date(e),{cta:"list"===r?"inbox":r,type:a})))}})}}static readLetterInfo(e){for(var s=e;s;){if(s.displayName===n$.ReadLetter.displayName)return s;s=s.getParent()}return null}start(e){l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),e.add(()=>{l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected)}),e.add(n3.shared().readLetterIntentReplay.safeSubscribe(e=>{var s=new Date,t=eG.identifier(e.id);null!=eT.E.shared().activeAction(t)?eT.E.shared().encounter(t,{name:"useCaseStarted",date:s,details:null}):eT.E.shared().encounter(eD.identifier(),{name:"letterActionNotFound",date:s,details:{type:"use-case",letterId:e.id}})})),e.add(ny.Q.shared().balanceRefillingIntentReplay.safeSubscribe(()=>{var e=new Date;eT.E.shared().activeActions(eG.type).forEach(s=>{eT.E.shared().complete(s,e,eE.Q.failure("no-credits"))})})),e.add(n3.shared().readLetterResult.safeSubscribe(e=>{var{letter:s,result:t}=e,r=new Date,a=eG.identifier(s.id);null!=eT.E.shared().activeAction(a)?t.isSuccessful?eT.E.shared().encounter(a,{name:"interactionStarted",date:r,details:null}):eT.E.shared().complete(a,r,eE.Q.failure("insufficient-funds"===t.error?"no-credits":"cancelled"===t.error?"cancelled-by-user":"failed")):eT.E.shared().encounter(eD.identifier(),{name:"letterActionNotFound",date:r,details:{type:"interaction",letterId:s.id,error:t.error}})})),e.add(n3.shared().readLetterError.safeSubscribe(e=>{var{letter:s}=e,t=new Date,r=eG.identifier(s.id);null!=eT.E.shared().activeAction(r)?eT.E.shared().complete(r,t,eE.Q.failure("failed")):eT.E.shared().encounter(eD.identifier(),{name:"letterActionNotFound",date:t,details:{type:"error",letterId:s.id}})})),e.add(aX.$.shared().componentRendered.safeSubscribe(e=>{var s=n2.readLetterInfo(e);if(s&&(this.readLetterRenderId||(this.readLetterRenderId=s.id),!this.readLetterRenderId||this.readLetterRenderId===s.id)){var t=s.props.letterId,r=new Date,a=eG.identifier(t);switch(e.displayName){case nX.U.displayName:eT.E.shared().encounter(a,{name:"coverComplete",date:r,details:null}),eT.E.shared().encounter(a,{name:"coverRendered",date:e.renderInfo.renderDate,details:null});break;case nZ.d.displayName:"media"===e.props.type?(this.attachmentComponentsRendered.media=!0,eT.E.shared().encounter(a,{name:"mediaAttachmentsRendered",date:e.renderInfo.renderDate,details:null})):(this.attachmentComponentsRendered.cheer=!0,eT.E.shared().encounter(a,{name:"cheersAttachmentsRendered",date:e.renderInfo.renderDate,details:null})),this.attachmentComponentsRendered.media&&this.attachmentComponentsRendered.cheer&&(n5.L.shared().logPerformance("letterAttachmentsReady"),eT.E.shared().encounter(a,{name:"attachmentsComplete",date:r,details:null}),eT.E.shared().encounter(a,{name:"attachmentsRendered",date:e.renderInfo.renderDate,details:null}));break;case n1.l.displayName:eT.E.shared().encounter(a,{name:"replyButtonComplete",date:r,details:null}),eT.E.shared().encounter(a,{name:"replyButtonRendered",date:e.renderInfo.renderDate,details:null});break;case n0.s.displayName:eT.E.shared().encounter(a,{name:"textComplete",date:r,details:null}),eT.E.shared().encounter(a,{name:"textRendered",date:e.renderInfo.renderDate,details:null});break;case nK.Y.displayName:eT.E.shared().encounter(a,{name:"profileInfoComplete",date:r,details:null}),eT.E.shared().encounter(a,{name:"profileInfoRendered",date:e.renderInfo.renderDate,details:null});break;case n$.ReadLetter.displayName:eT.E.shared().encounter(a,{name:"letterComplete",date:r,details:null}),eT.E.shared().complete(a,e.renderInfo.renderDate,eE.Q.success())}}})),e.add(aX.$.shared().componentRenderingStarted.safeSubscribe(e=>{var s,t=n2.readLetterInfo(e);if(t){var r=t.props.letterId,a=new Date;switch(e.displayName){case nX.U.displayName:eT.E.shared().encounter(eG.identifier(r),{name:"coverRe
3nderingStarted",date:a,details:null});break;case nZ.d.displayName:var i=null==(s=e.props.letter)?void 0:s.attachments;if(i){var n=i.filter(e=>"cheer"===e.mediaType).length;eT.E.shared().encounter(eG.identifier(r),{name:"cheersAttachmentsCount",date:a,details:n}),eT.E.shared().encounter(eG.identifier(r),{name:"mediaAttachmentsCount",date:a,details:i.length-n})}"media"===e.props.type?eT.E.shared().encounter(eG.identifier(r),{name:"mediaAttachmentsRenderingStarted",date:a,details:null}):eT.E.shared().encounter(eG.identifier(r),{name:"cheersAttachmentsRenderingStarted",date:a,details:null});break;case n1.l.displayName:eT.E.shared().encounter(eG.identifier(r),{name:"replyButtonRenderingStarted",date:a,details:null});break;case n0.s.displayName:eT.E.shared().encounter(eG.identifier(r),{name:"textRenderingStarted",date:a,details:null});break;case nK.Y.displayName:eT.E.shared().encounter(eG.identifier(r),{name:"profileInfoRenderingStarted",date:a,details:null})}}})),e.add(aX.$.shared().componentWaitingChildren.safeSubscribe(e=>{var s=n2.readLetterInfo(e);if(s){var t=s.props.letterId,r=new Date;switch(e.displayName){case nZ.d.displayName:"media"===e.props.type?eT.E.shared().encounter(eG.identifier(t),{name:"mediaAttachmentsWaitingChildren",date:r,details:null}):eT.E.shared().encounter(eG.identifier(t),{name:"cheersAttachmentsWaitingChildren",date:r,details:null});break;case nK.Y.displayName:eT.E.shared().encounter(eG.identifier(t),{name:"profileInfoWaitingChildren",date:r,details:null});break;case n$.ReadLetter.displayName:eT.E.shared().encounter(eG.identifier(t),{name:"letterWaitingChildren",date:r,details:null})}}})),e.add(aX.$.shared().componentRenderingFailed.safeSubscribe(e=>{if(e.displayName!==n$.ReadLetter.displayName){var s=n2.readLetterInfo(e);if(s){if(this.readLetterRenderId||(this.readLetterRenderId=s.id),this.readLetterRenderId&&this.readLetterRenderId!==s.id)return;s.displayName===n$.ReadLetter.displayName&&eT.E.shared().encounter(eG.identifier(s.props.letterId),{name:"childFailed",date:e.renderInfo.renderDate,details:s.displayName})}return}var t=e.props.letterId;eT.E.shared().complete(eG.identifier(t),e.renderInfo.renderDate,eE.Q.failure("failed"))}))}}n2.shared=(0,P.G)(()=>new n2);var n8=t(52874);class n4{constructor(e){this.userId=e}start(e){var s=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"idle"!==e.status),(0,ev.F)());e.add(T.T.shared().mcs.enabled.pipe((0,ea.p)(e=>e),(0,I.n)(()=>M.f.shared(this.userId).userIsFeaturedMember),(0,I.n)(e=>e?(0,D.z)([s,iC.K.shared().cameraIsActive]):k.w),(0,w.T)(e=>{var[s,t]=e;return s||!t}),(0,ev.F)()).safeSubscribe(e=>{e?n8.a.shared(this.userId).disableCameraVisibility():n8.a.shared(this.userId).enableCameraVisibility()}))}}n4.shared=(0,P.G)(e=>new n4(e));var n6=t(89515);class n9{constructor(e){this.userId=e}start(e){var s=T.T.shared().mcs.roomPreInitializationEnabled.pipe((0,I.n)(e=>e?A.M.shared(this.userId).initialized:(0,S.of)(!1)));e.add((0,D.z)([C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>e.status),(0,ev.F)()),ru.M.shared(this.userId).state,iC.K.shared().cameraIsActive,s]).safeSubscribe(e=>{var[s,t,r,a]=e,i=t.roomPrepared&&("idle"!==s||!r||!a),n=a&&r&&"idle"===s&&"idle"===t.status&&!t.roomPrepared;i?ru.M.shared(this.userId).destroyRoom():n&&ru.M.shared(this.userId).createRoom()}))}}n9.shared=(0,P.G)(e=>new n9(e));var n7=t(38595);class de extends i3.M{constructor(e){super(n7.XO.shared(e),()=>C.Y.shared().get(eg.A).store.rxState().toSingle().pipe((0,eY.ex)(e=>{(null==e?void 0:e.name)!=="speech-to-text-onboarding"&&C.Y.shared().get(eg.A).actions.open("speech-to-text-onboarding",[{props:{},disableManualClose:!0}])}),(0,eY.AB)(void 0)))}}de.shared=(0,P.G)(e=>new de(e));class ds{constructor(e){this.userId=e}logS2TOnboardingShown(){W._.shared(this.userId).logEvent("s2t-onboarding-shown",{}).safeSubscribe()}logS2TOnboardingAccepted(){W._.shared(this.userId).logEvent("s2t-onboarding-accepted",{}).safeSubscribe()}logS2TOnboardingRejected(){W._.shared(this.userId).logEvent("s2t-onboarding-rejected",{}).safeSubscribe()}}ds.shared=(0,P.G)(e=>new ds(e));class dt{constructor(e){this.userId=e}start(e){e.add(n7.XO.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result?ds.shared(this.userId).logS2TOnboardingAccepted():"rejected"===e.result&&ds.shared(this.userId).logS2TOnboardingRejected()})),e.add(n7.XO.shared(this.userId).offer.pipe((0,ev.F)(),(0,b.o)()).safeSubscribe(()=>{ds.shared(this.userId).logS2TOnboardingShown()}))}}dt.shared=(0,P.G)(e=>new dt(e));var dr=t(59882),da=t(22605);
3class di{constructor(e){this.callUnavailableSubject=new sp.B,this.callUnavailable=this.callUnavailableSubject.asObservable(),this.userId=e}start(e){e.add(T.T.shared().deepLinkCall.enabled.pipe((0,I.n)(e=>e?iK.g.shared().deepLink.pipe((0,I.n)(e=>{if("outgoing-call"!==e.type&&"push-notification-outgoing-call"!==e.type)return k.w;var{args:{attendeeId:s}}=e,t="push-notification-outgoing-call"===e.type?"auto-call-offline":"link";return rd.N.shared(this.userId).callIsAvailableWithDetails(s).pipe((0,g.s)(1),(0,I.n)(r=>r.value?rl.K.shared(this.userId).mcsId(s).asObservable().pipe((0,ee.M)(e=>{e&&ru.M.shared(this.userId).start(e,t)})):(this.callUnavailableSubject.next({attendeeId:s,cta:t,reason:r.reason}),da.g.shared(this.userId).canCallTo(s).pipe((0,eV.i)(1),(0,g.s)(1),(0,I.n)(r=>r?(er.g.shared().emit("command.user-actions.interaction.track",[{place:"video-chat-start."+t,user:s}]),dr.I.shared(this.userId).dial(s,!0,t)):"outgoing-call"===e.type?k.w:(0,S.of)(s))))),(0,eP.u)(s))})):k.w)).safeSubscribe(e=>{(0,nd.Z)(e)}))}}di.shared=(0,P.G)(e=>new di(e));var dn=t(88394);class dd{constructor(e){this.userId=e}logCallOfferingBannerShown(e){W._.shared(this.userId).logEvent("call-offering-banner-shown",{userId:this.userId,attendeeId:e}).safeSubscribe()}logCallOfferingBannerAccepted(e){W._.shared(this.userId).logEvent("call-offering-banner-accepted",{userId:this.userId,attendeeId:e}).safeSubscribe()}logCallOfferingBannerRejected(e){W._.shared(this.userId).logEvent("call-offering-banner-rejected",{userId:this.userId,attendeeId:e}).safeSubscribe()}}dd.shared=(0,P.G)(e=>new dd(e));class du{constructor(e){this.userId=e}start(e){e.add(dn._.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result?dd.shared(this.userId).logCallOfferingBannerAccepted(e.offer):"rejected"===e.result&&dd.shared(this.userId).logCallOfferingBannerRejected(e.offer)})),e.add(dn._.shared(this.userId).offer.pipe((0,b.o)()).safeSubscribe(e=>{dd.shared(this.userId).logCallOfferingBannerShown(e)}))}}du.shared=(0,P.G)(e=>new du(e));var dl=t(18175),dc=t(76259),dh=t(52623);class dp{constructor(e){this.userId=e}start(e){e.add(tE.YL.shared(this.userId).gameCanBeAccepted.pipe((0,I.n)(e=>e?dh.n.shared(this.userId).events(dl.t.gameMeta):k.w),(0,I.n)(e=>"initialize"!==e.command?k.w:dl.t.shared(this.userId).joinGame(e.attribute))).safeSubscribe()),e.add(tE.YL.shared(this.userId).gameCanBeAccepted.pipe((0,I.n)(e=>e?dh.n.shared(this.userId).events(dc.Eu.gameMeta):k.w),(0,I.n)(e=>"initialize"!==e.command?k.w:dc.Eu.shared(this.userId).joinGame(e.questions))).safeSubscribe()),e.add((0,D.z)([dl.t.shared(this.userId).state,dc.Eu.shared(this.userId).state]).pipe((0,ea.p)(e=>{var[s,t]=e;return"idle"===s.step&&"idle"===t.step})).safeSubscribe(()=>{tE.YL.shared(this.userId).setActiveGame(void 0)}))}}dp.shared=(0,P.G)(e=>new dp(e));var dv=t(53193);class dm{constructor(){var e=30*eF.b.minute,s=tz.y.shared("user-session"),t=s.load("numberOfVisits").pipe((0,eY.vV)(e=>e||0)),r=s.load("appLeavesActiveStateTime"),a=eW.r.shared().focusState.pipe((0,w.T)(e=>"focused"===e),(0,tw.t)(1)),i=a.pipe((0,ea.p)(e=>!e),(0,w.T)(()=>new Date().getTime()),(0,I.n)(e=>s.store("appLeavesActiveStateTime",e).pipe((0,eY.AB)(e))),(0,tw.t)(1));this.applicationLeavesActiveStateTime=(0,sP.x)(r.asObservable().pipe((0,dv.Q)(i)),i).pipe((0,tw.t)(1));var n=a.pipe((0,ea.p)(e=>e),(0,w.T)(()=>new Date().getTime()),(0,tr.E)(this.applicationLeavesActiveStateTime),(0,ea.p)(s=>{var[t,r]=s;return!r||t-r>=e}),(0,w.T)(()=>void 0)).pipe((0,I.n)(()=>t.pipe((0,eY.vV)(e=>e+1),(0,eY.Fg)(e=>s.store("numberOfVisits",e).pipe((0,eY.AB)(e))))),(0,tw.t)(1));this.numberOfVisits=(0,sP.x)(t,n).pipe((0,tw.t)(1))}start(e){e.add(this.applicationLeavesActiveStateTime.safeSubscribe()),e.add(this.numberOfVisits.safeSubscribe())}}dm.shared=(0,P.G)(()=>new dm);var df=t(30131),db=t(64733),dg=t(40554),dI="visitWithOffer";class dw extends t$.D{constructor(e){super(),this.userId=e;var s=tz.y.shared("call-games-popup-offering",e),t=e=>(0,df.H)(e).pipe((0,dg.H)(e=>M.f.shared(e).userIsFeaturedMember.pipe((0,I.n)(s=>s?(0,db.y)(rd.N.shared(this.userId).callIsAvailable(e).toSingle(),da.g.shared(this.userId).canCallTo(e).pipe((0,eV.i)(1)).toSingle(),rn.N.shared(this.userId).blockedUsers.toSingle().pipe((0,eY.vV)(s=>s.includes(e)))).pipe((0,w.T)(s=>{var[t,r,a]=s;if(!a&&(t||r))return e})):(0,S.of)(void 0))).toSingle()),(0,ea.p)(e=>!!e),(0,g.s)(1));this.canOffer=T.T.shared().callGames.enabled.pipe((0,I.n)(e=>e?M.f.shared(this.userId).userIsFeaturedMember:k.w),(0,I.n)(e=>e?k.w:(0,db.y)(s.load(dI),dm.shared().numberOfVisits.toSingle())),(0,I.n)(e=>{var[t,r]=e;return t&&t>r?k.w:(0,D.z)([(0,S.of)(r),rG.n.shared(this.userId).chats.toSingle().pipe((0,eY.vV)(e=>e.map(e=>e.attendeeId).sort(()=>.5-Math.random())))]).pipe((0,ee.M)(()=>s.store(dI,r+1).safeSubscribe()))}),(0,I.n)(e=>{var[s,r]=e;return r.length?(0,db.y)((0,S.of)(s),t(r),T.T.shared().callGames.popup.visitsThreshold):k.w}),(0,I.n)(s=>{var[t,r,a]=s;return r?tE.YL.shared(e).checkAvailability(r).asObservable().pipe((0,I.n)(e=>e?(0,S.of)([t,r,a]):k.w)):k.w}),(0,I.n)(e=>{var[t,r,a]=e;return(0,S.of)(r).pipe((0,ee.M)(()=>{s.store(dI,t+a).safeSubscribe()}))}),(0,ev.F)(),(0,tw.t)({bufferSize:1,refCount:!0}))}start(e){return eJ.v.just(eE.Q.success(e))}accept(){return eJ.v.just(eE.Q.success())}reject(){return eJ.v.just(eE.Q.success())}}dw.shared=(0,P.G)(e=>new dw(e));class dS{constructor(e){this.userId=e}logPopupShown(){W._.shared(this.userId).logEvent("call-games-popup-shown",{}).safeSubscribe()}logPopupAccepted(){W._.shared(this.userId).logEvent("call-games-popup-accepted",{}).safeSubscribe()}logPopupRejected(){W._.shared(this.userId).logEvent("call-games-popup-rejected",{}).safeSubscribe()}}dS.shared=(0,P.G)(e=>new dS(e));class dy{constructor(e){this.userId=e}start(e){e.add(dw.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result?dS.shared(this.userId).logPopupAccepted():"rejected"===e.result&&dS.shared(this.userId).logPopupRejected()})),e.add(dw.shared(this.userId).offer.pipe((0,b.o)()).safeSubscribe(()=>dS.shared(this.userId).logPopupShown()))}}dy.shared=(0,P.G)(e=>new dy(e));class dA extends t$.D{constructor(e){super(),this.persistence=tz.y.shared("voice-messages-introduction",e);var s=this.offeringResult.pipe((0,eP.u)(!0));this.canOffer=(0,K.h)(this.persistence.load("shown").asObservable(),s).pipe((0,I.n)(e=>e?(0,S.of)(!1):el.j.shared().chatAttendee.pipe((0,w.T)(e=>!!e))),(0,ev.F)(),(0,tw.t)({bufferSize:1,refCount:!0}))}start(){return eJ.v.just(eE.Q.success({}))}accept(){return this.persistence.store("shown",!0).pipe((0,eY.AB)(eE.Q.success()))}}dA.shared=(0,P.G)(e=>new dA(e));class dT extends t$.D{constructor(e){super(),this.persistence=tz.y.shared("free-cheer-motivation",e),this.closed=this.offeringResult.pipe((0,eP.u)(!0),(0,ep.Z)(!1)),this.canOffer=nn.$.shared(e).cheersSet("common",{paidCheers:!1}).pipe((0,w.T)(e=>e.length>0),(0,I.n)(e=>e?this.persistence.load("motivated").asObservable().pipe((0,I.n)(e=>e?(0,S.of)(!1):this.closed.pipe((0,w.T)(e=>!e)))):(0,S.of)(!1)),(0,ev.F)(),(0,tw.t)({bufferSize:1,refCount:!0}))}start(){return eJ.v.just(eE.Q.success({}))}accept(){return this.persistence.store("motivated",!0).pipe((0,eY.AB)(eE.Q.success()))}}dT.shared=(0,P.G)(e=>new dT(e));var dx="tape-scrollable-tooltip",dC="offered";class dF extends t$.D{constructor(e){super(),this.userId=e,this.canOffer=(0,K.h)(this.offeringResult.pipe((0,eP.u)(!1)),tz.y.shared(dx,this.userId).load(dC).pipe((0,eY.vV)(e=>!e))).pipe((0,ev.F)(),(0,tw.t)({bufferSize:1,refCount:!0}))}start(){return eJ.v.just(eE.Q.success({}))}accept(){return tz.y.shared(dx,this.userId).store(dC,!0).pipe((0,eY.AB)(eE.Q.success()))}}dF.shared=(0,P.G)(e=>new dF(e));var dD=t(68592);class dk extends t$.D{constructor(e){super(),this.persistence=tz.y.shared("voice-messages-introduction-recording",e),this.closed=this.offeringResult.pipe((0,eP.u)(!0),(0,ep.Z)(!1)),this.canOffer=this.closed.pipe((0,I.n)(e=>e?(0,S.of)(!1):(0,D.z)([this.persistence.load("shown").asObservable(),dD.W.shared().recording,T.T.shared().voiceRecordingOnTapEnabled]).pipe((0,I.n)(e=>{var[s,t,r]=e;return!s&&t&&r?(0,S.of)(!0):(0,S.of)(!1)}),(0,ev.F)(),(0,tw.t)({bufferSize:1,refCount:!0}))))}start(){return eJ.v.just(eE.Q.success({}))}accept(){return this.persistence.store("shown",!0).pipe((0,eY.AB)(eE.Q.success()))}}dk.shared=(0,P.G)(e=>new dk(e));var dE=t(8343);class dj extends i2.y{constructor(e){super([{type:"change-chat-theme-tooltip",offering:dE.lU.shared(e)},{type:"cheer",offering:dT.shared(e)},{type:"voice-messages",offering:dA.shared(e)},{type:"voice-messages-tap-stop-recording",offering:dk.shared(e)},{type:"cheers-scrollable",offering:dF.shared(e)}])}}dj.shared=(0,P.G)(e=>new dj(e));var dR="attendees-chat-visit";class dO extends t$.D{constructor(e){super(),this.attendeesChatVisitCount=new Z.t({}),this.userId=e;var s=tz.y.shared("call-games-chat-tooltip-offering",e);this.canOffer=T.T.shared().callGames.enabled.pipe((0,I.n)(e=>e?M.f.shared(this.userId).userIsFeaturedMember:(0,S.of)(void 0)),(0,I.n)(e=>e||void 0===e?(0,S.of)(void 0):s.load(dR)),(0,I.n)(e=>void 0===e?(0,S.of)(void 0):(e&&Object.keys(e).length&&this.attendeesChatVisitCount.next(e),el.j.shared().chatAttendee)),(0,I.n)(s=>s?dj.shared(e).canOffer.pipe((0,w.T)(e=>e?void 0:s),(0,ev.F)()):(0,S.of)(void 0)),(0,I.n)(s=>s?M.f.shared(s).userIsFeaturedMember.pipe((0,I.n)(t=>t?tE.YL.shared(e).checkAvailability(s).asObservable():(0,S.of)(void 0)),(0,I.n)(e=>e?(0,db.y)(rd.N.shared(this.userId).callIsAvailable(s).toSingle(),da.g.shared(this.userId).canCallTo(s).pipe((0,eV.i)(1)).toSingle()).pipe((0,w.T)(e=>{var[t,r]=e;if(t||r)return s})):(0,S.of)(void 0))).toSingle():(0,S.of)(void 0)),(0,I.n)(e=>e?T.T.shared().callGames.tooltipInChat.chatVisitsThreshold.pipe((0,I.n)(t=>{var r=this.attendeesChatVisitCount.getValue(),a=!1;return r[e]<t?r[e]+=1:(r[e]=1,a=e),this.attendeesChatVisitCount.next(r),s.store(dR,r).safeSubscribe(),(0,S.of)(a)})):(0,S.of)(!1)),(0,ev.F)(),(0,tw.t)(1))}start(e){return T.T.shared().callGames.tooltipInChat.ttl.toSingle().pipe((0,eY.ex)(e=>{(0,im.O)(e).pipe((0,I.n)(()=>this.rejectOffer()),(0,dv.Q)(this.offeringResult)).safeSubscribe()}),(0,eY.AB)(eE.Q.success(e)))}}dO.shared=(0,P.G)(e=>new dO(e));class dM{constructor(e){this.userId=e}logTooltipShown(e){W._.shared(this.userId).logEvent("call-games-tooltip-in-chat-shown",{"attendee-id":e}).safeSubscribe()}logTooltipAccepted(e){W._.shared(this.userId).logEvent("call-games-tooltip-in-chat-accepted",{"attendee-id":e}).safeSubscribe()}logTooltipRejected(e){W._.shared(this.userId).logEvent("call-games-tooltip-in-chat-rejected",{"attendee-id":e}).safeSubscribe()}}dM.shared=(0,P.G)(e=>new dM(e));class dG{constructor(e){this.userId=e}start(e){e.add(dO.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result?dM.shared(this.userId).logTooltipAccepted(e.offer):"rejected"===e.result&&dM.shared(this.userId).logTooltipRejected(e.offer)})),e.add(dO.shared(this.userId).offer.pipe((0,b.o)()).safeSubscribe(e=>dM.shared(this.userId).logTooltipShown(e)))}}dG.shared=(0,P.G)(e=>new dG(e));class dB{constructor(e){this.userId=e}logGameStarted(e){W._.shared(this.userId).logEvent("call-games-tic-tac-toe-game-started",{"attendee-id":e}).safeSubscribe()}logImageUploaded(e){W._.shared(this.userId).logEvent("call-games-tic-tac-toe-image-uploaded",{"attendee-id":e}).safeSubscribe()}logNotificationShown(e){W._.shared(this.userId).logEvent("call-games-tic-tac-toe-notification-shown",{"attendee-id":e}).safeSubscribe()}logGameFinished(e,s){W._.shared(this.userId).logEvent("call-games-tic-tac-toe-game-finished",{"attendee-id":e,result:s}).safeSubscribe()}logGameCanceled(e){W._.shared(this.userId).logEvent("call-games-tic-tac-toe-game-canceled",{"attendee-id":e}).safeSubscribe()}}dB.shared=(0,P.G)(e=>new dB(e));var dP=t(16795);class d_{constructor(e){this.userId=e}start(e){e.add(tE.YL.shared(this.userId).attendeeId.pipe((0,b.o)(),(0,I.n)(e=>dl.t.shared(this.userId).state.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"initializing"===s.step&&"idle"!==t.step&&"initializing"!==t.step}),(0,eP.u)(e)))).safeSubscribe(e=>{dB.shared(this.userId).logGameStarted(e)})),e.add(tE.YL.shared(this.userId).attendeeId.pipe((0,b.o)(),(0,I.n)(e=>dP.y.shared(this.userId).bets.pipe((0,su.J)(),(0,ea.p)(s=>{var[t,r]=s;return!t[e]&&!!r[e]}),(0,eP.u)(e)))).safeSubscribe(e=>{dB.shared(this.userId).logImageUploaded(e)})),e.add(tE.YL.shared(this.userId).attendeeId.pipe((0,b.o)(),(0,I.n)(e=>dl.t.shared(this.userId).yourTurnNotificationAvailable.pipe((0,ea.p)(e=>e),(0,eP.u)(e)))).safeSubscribe(e=>{dB.shared(this.userId).logNotificationShown(e)})),e.add(tE.YL.shared(this.userId).attendeeId.pipe((0,b.o)(),(0,I.n)(e=>dl.t.shared(this.userId).state.pipe((0,su.J)(),(0,I.n)(s=>{var[t,r]=s;return"result"!==t.step&&"result"===r.step?(0,S.of)([e,r.result]):k.w})))).safeSubscribe(e=>{var[s,t]=e;t&&dB.shared(this.userId).logGameFinished(s,t)}))}}d_.shared=(0,P.G)(e=>new d_(e));class dz{constructor(e){this.userId=e}logGameStarted(e){W._.shared(this.userId).logEvent("call-games-never-have-i-ever-game-started",{"attendee-id":e}).safeSubscribe()}logQuestionShown(e,s){W._.shared(this.userId).logEvent("call-games-never-have-i-ever-question-shown",{"attendee-id":e,question:s}).safeSubscribe()}logQuestionAnswered(e,s,t){W._.shared(this.userId).logEvent("call-games-never-have-i-ever-question-answered",{"attendee-id":e,question:s,answer:t}).safeSubscribe()}logNextQuestionButtonShown(e){W._.shared(this.userId).logEvent("call-games-never-have-i-ever-next-question-button-shown",{"attendee-id":e}).safeSubscribe()}logNextQuestionButtonClicked(e){W._.shared(this.userId).logEvent("call-games-never-have-i-ever-next-question-button-clicked",{"attendee-id":e}).safeSubscribe()}logGameCanceled(e){W._.shared(this.userId).logEvent("call-games-never-have-i-ever-game-canceled",{"attendee-id":e}).safeSubscribe()}}dz.shared=(0,P.G)(e=>new dz(e));class dN{constructor(e){this.userId=e}start(e){e.add(tE.YL.shared(this.userId).attendeeId.pipe((0,b.o)(),(0,I.n)(e=>dc.Eu.shared(this.userId).state.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"initializing"===s.step&&"idle"!==t.step&&"initializing"!==t.step}),(0,eP.u)(e)))).safeSubscribe(e=>{dz.shared(this.userId).logGameStarted(e)})),e.add(tE.YL.shared(this.userId).attendeeId.pipe((0,b.o)(),(0,I.n)(e=>dc.Eu.shared(this.userId).state.pipe((0,I.n)(s=>{if("game"===s.step&&"question"===s.gameStep){var{questions:t,activeQuestionIndex:r}
3=s,{userAnswer:a,attendeeAnswer:i,key:n}=t[r];if(void 0===a&&void 0===i)return(0,S.of)([e,n])}return k.w})))).safeSubscribe(e=>{var[s,t]=e;dz.shared(this.userId).logQuestionShown(s,t)})),e.add(tE.YL.shared(this.userId).attendeeId.pipe((0,b.o)(),(0,I.n)(e=>dc.Eu.shared(this.userId).state.pipe((0,su.J)(),(0,I.n)(s=>{var[t,r]=s;if("game"===t.step&&"game"===r.step&&"question"===t.gameStep&&"question"===r.gameStep&&t.activeQuestionIndex===r.activeQuestionIndex){var{userAnswer:a}=t.questions[t.activeQuestionIndex],{userAnswer:i,key:n}=r.questions[r.activeQuestionIndex];if(void 0===a&&void 0!==i)return(0,S.of)([e,n,i])}return k.w})))).safeSubscribe(e=>{var[s,t,r]=e;dz.shared(this.userId).logQuestionAnswered(s,t,r)}))}}dN.shared=(0,P.G)(e=>new dN(e));class dL{constructor(e){this.userId=e}start(e){e.add(T.T.shared().callGames.enabled.pipe((0,I.n)(e=>e?new y.c(e=>{var s=new u.yU;return tE.YL.shared(this.userId).start(s),dp.shared(this.userId).start(s),dy.shared(this.userId).start(s),dG.shared(this.userId).start(s),d_.shared(this.userId).start(s),dN.shared(this.userId).start(s),e.next(),()=>s.unsubscribe()}):k.w)).safeSubscribe(()=>{tE.YL.registerGame(dc.Eu),tE.YL.registerGame(dl.t)}))}}dL.shared=(0,P.G)(e=>new dL(e));var dq=t(1919);class dV{constructor(e){this.userId=e}logWarningShown(e){W._.shared(this.userId).logEvent("call-bad-connection-warning-shown",{userId:this.userId,attendeeId:e}).safeSubscribe()}}dV.shared=(0,P.G)(e=>new dV(e));class dQ{constructor(e){this.userId=e}start(e){e.add(dq.m.shared(this.userId).offer.pipe((0,b.o)()).safeSubscribe(e=>{dV.shared(this.userId).logWarningShown(e)}))}}dQ.shared=(0,P.G)(e=>new dQ(e));var dU=t(66691),dY=t(81924),dJ=t(60144);let dW="call-games-tic-tac-toe-image-choosing__image";var dH=t(31568),dX=t(97314);let dZ=(0,d.memo)(e=>{var{userName:s,attendeeName:t,attributes:r}=e,a=(null==r?void 0:r.user)==="x"?"danger":"action-gray",i=(null==r?void 0:r.attendee)==="x"?"danger":"action-gray",n=(0,d.useMemo)(()=>{var e;return t+" ("+(null==r||null==(e=r.attendee)?void 0:e.toUpperCase())+")"},[t,r]),o=(0,d.useMemo)(()=>{var e;return s+" ("+(null==r||null==(e=r.user)?void 0:e.toUpperCase())+")"},[s,r]);return(0,F.jsxs)("div",{className:"call-games-tic-tac-toe-players-info__container",children:[(0,F.jsx)(dX.E,{color:i,content:n}),(0,F.jsx)("div",{className:"call-games-tic-tac-toe-players-info__line"}),(0,F.jsx)(dX.E,{color:a,content:o})]})});var d$=(0,d.memo)(e=>{var s,t,{userId:r,attendeeId:a}=e,i=null==(s=(0,dH.sb)(a))?void 0:s.name,n=null==(t=(0,dH.sb)(r))?void 0:t.name,d=(0,dU.J2)(()=>dl.t.shared(r).state,[r]);return n&&i&&d?(0,F.jsx)(dZ,{userName:n,attendeeName:i,attributes:d.attributes}):null});let dK=(0,d.memo)(e=>{var{userId:s,attendeeId:t,attendeeImagePath:r,userImagePath:a}=e;return(0,F.jsx)("div",{className:"call-games-tic-tac-toe-image-choosing__container",children:!!a&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"call-games-tic-tac-toe-image-choosing__images",children:[(0,F.jsx)(dJ.$,{className:dW,path:r,authorize:!0,resourceWidth:200}),(0,F.jsx)(dJ.$,{className:dW,path:a,authorize:!0,resourceWidth:200})]}),(0,F.jsx)(d$,{userId:s,attendeeId:t})]})})});var d0=t(9715),d1=(0,d.memo)(e=>{var{bets:s,attendeeId:t,userId:r}=e,a=(0,dU.J2)(()=>M.f.shared(r).userIsFeaturedMember,[r]),i=(0,dU.J2)(()=>d0.mh.shared(r).media,[r]),n=(0,dU.J2)(()=>ah.T.shared().sharding,[]),o=(0,dU.hD)(e=>dP.y.shared(r).uploadImage(t,e),[r,t],!1);(0,d.useEffect)(()=>{if(i&&!s.user&&a){var e=i.filter(e=>"photo"===e.type&&e.private);e.length||(e=i.filter(e=>"photo"===e.type));var t=Math.round(Math.random()*(e.length-1)),d=e[t];d&&"photo"===d.type&&n&&fetch((0,iY.o)((0,iV.DD)(r,d.basename,d.private),n)+"?authorization="+iX.a.shared().getAAF()).then(e=>e.blob()).then(e=>{var s=new Blob([e],{type:"image/jpeg"});s.uri=String((0,N.A)()),o(s)}).catch(e=>{console.error(e)})}},[a,r,n,i,o,s]);var u=(0,d.useMemo)(()=>s.user?(0,iV.J1)(r,t,s.user,!0):void 0,[t,r,s]),l=(0,d.useMemo)(()=>s.attendee?(0,iV.J1)(t,r,s.attendee,!0):void 0,[t,r,s]);return(0,F.jsx)(dK,{userId:r,attendeeId:t,userImagePath:u,attendeeImagePath:l})});let d5="call-games-tic-tac-toe-cell-button__icon";var d3=t(27648);let d2={id:"sprite-common-805329cf",href:"/app/sprite-common.f91c560d.svg#sprite-common-805329cf",viewBox:"0 0 66 66"},d8={id:"sprite-common-c365b541",href:"/app/sprite-common.f91c560d.svg#sprite-common-c365b541",viewBox:"0 0 66 66"};var d4=t(99870),d6=t.n(d4),d9=(0,d.memo)(e=>{var{cellValue:s,onCellClick:t,row:r,column:a,disabled:i}=e,n=(0,d.useCallback)(()=>{t(r,a)},[t,r,a]),o=(0,d.useMemo)(()=>d6()(d5,"call-games-tic-tac-toe-cell-button__crossIcon"),[]);return(0,F.jsxs)("button",{onClick:n,disabled:i,type:"button",className:"call-games-tic-tac-toe-cell-button__cell",children:["x"===s&&(0,F.jsx)(d3.A,{typeClass:o,icon:d8}),"o"===s&&(0,F.jsx)(d3.A,{typeClass:d5,icon:d2})]})}),d7=(0,d.memo)(e=>{var{userId:s,attendeeId:t,state:r}=e,a=(0,dU.uN)((e,t)=>dl.t.shared(s).makeTurn(e,t),[s],!1),i=(0,dU.J2)(()=>dl.t.shared(s).yourTurnNotificationAvailable,[s]);return(0,F.jsxs)("div",{className:"call-games-tic-tac-toe-game__container",children:[(0,F.jsx)("div",{className:"call-games-tic-tac-toe-game__board",children:r.board.map((e,s)=>(0,F.jsx)("div",{className:"call-games-tic-tac-toe-game__row",children:e.map((e,t)=>{var i=s+"-"+t,n=!r.turnAvailable||!!r.board[s][t];return(0,F.jsx)(d9,{onCellClick:a,row:s,column:t,cellValue:e,disabled:n},i)})},s))}),(0,F.jsx)(d$,{userId:s,attendeeId:t}),!!i&&(0,F.jsx)("div",{className:"call-games-tic-tac-toe-game__notification",children:(0,F.jsx)(dY.LocalizedText,{color:"light",href:"/call/games/tic-tac-toe#your-turn-notification"})})]})}),oe=t(76328);let os="call-games-tic-tac-toe-result__container",ot="call-games-tic-tac-toe-result__emoji",or="call-games-tic-tac-toe-result__text",oa="call-games-tic-tac-toe-result__buttonContainer",oi="call-games-tic-tac-toe-result__resultText";var on=t(78186),od=t(20345),oo=t(15782);let ou=(0,d.memo)(e=>{var{onOpenPhotoButtonClick:s,attendeeImagePath:t,userAttribute:r}=e,a=(0,d.useMemo)(()=>({attribute:r}),[r]),i=(0,oo.A)("call/games/tic-tac-toe","open-photo-button");return(0,F.jsxs)("div",{className:os,children:[(0,F.jsx)(dY.LocalizedText,{variant:"h2",href:"/call/games/tic-tac-toe#result-win-title",data:a}),(0,F.jsxs)("div",{className:"call-games-tic-tac-toe-result__imageContainer",children:[(0,F.jsx)(dJ.$,{onClick:s,className:"call-games-tic-tac-toe-result__image",path:t,authorize:!0,resourceWidth:100}),(0,F.jsx)("span",{className:or,children:(0,F.jsx)(on.X,{href:"/call/games/tic-tac-toe#open-photo-hint"})})]}),(0,F.jsx)("div",{className:oa,children:(0,F.jsx)(od.$,{onClick:s,variant:"secondary",title:i})})]})});var ol=(0,d.memo)(e=>{var s,{userId:t,attendeeId:r,state:a}=e,i=(0,d.useMemo)(()=>a.bets.attendee?(0,iV.J1)(r,t,a.bets.attendee):void 0,[t,r,a.bets]),n=(0,d.useCallback)(()=>
3{i&&(0,oe.u)({path:i})},[i]);return i&&null!=(s=a.attributes)&&s.user?(0,F.jsx)(ou,{onOpenPhotoButtonClick:n,attendeeImagePath:i,userAttribute:a.attributes.user}):null});let oc=(0,d.memo)(e=>{var{attendeeGender:s,onTryAgainButtonClick:t}=e,r=(0,d.useMemo)(()=>({gender:s}),[s]),a=(0,oo.A)("call/games/tic-tac-toe","try-again-button");return(0,F.jsxs)("div",{className:os,children:[(0,F.jsx)(dY.LocalizedText,{variant:"h2",href:"/call/games/tic-tac-toe#result-title"}),(0,F.jsxs)("div",{className:oi,children:[(0,F.jsx)("span",{className:ot,children:(0,F.jsx)(on.X,{href:"/call/games/tic-tac-toe#star-icon"})}),(0,F.jsx)("span",{className:or,children:(0,F.jsx)(on.X,{href:"/call/games/tic-tac-toe#draw-text",data:r})})]}),(0,F.jsx)("div",{className:oa,children:(0,F.jsx)(od.$,{onClick:t,variant:"secondary",title:a})})]})});var oh=(0,d.memo)(e=>{var s,{userId:t,attendeeId:r}=e,a=null==(s=(0,dH.sb)(r))?void 0:s.gender,i=(0,dU.uN)(()=>dl.t.shared(t).restartGame(),[t],!1);return(0,F.jsx)(oc,{onTryAgainButtonClick:i,attendeeGender:a})});let op=(0,d.memo)(e=>{var{attendeeName:s,attendeeAttribute:t,onTryAgainButtonClick:r}=e,a=(0,d.useMemo)(()=>({name:s,attribute:t}),[s,t]),i=(0,oo.A)("call/games/tic-tac-toe","try-again-button");return(0,F.jsxs)("div",{className:os,children:[(0,F.jsx)(dY.LocalizedText,{variant:"h2",href:"/call/games/tic-tac-toe#result-title"}),(0,F.jsxs)("div",{className:oi,children:[(0,F.jsx)("span",{className:ot,children:(0,F.jsx)(on.X,{href:"/call/games/tic-tac-toe#cup-icon"})}),(0,F.jsx)("span",{className:or,children:(0,F.jsx)(on.X,{href:"/call/games/tic-tac-toe#attendee-wins-text",data:a})})]}),(0,F.jsx)("div",{className:oa,children:(0,F.jsx)(od.$,{onClick:r,variant:"secondary",title:i})})]})});var ov=(0,d.memo)(e=>{var s,t,r,{userId:a,attendeeId:i,state:n}=e,d=null==(s=(0,dH.sb)(i))?void 0:s.name,o=(0,dU.uN)(()=>dl.t.shared(a).restartGame(),[a],!1);return d&&null!=(t=n.attributes)&&t.attendee?(0,F.jsx)(op,{attendeeName:d,attendeeAttribute:null==(r=n.attributes)?void 0:r.attendee,onTryAgainButtonClick:o}):null});let om=(0,d.memo)(e=>{var{state:s,attendeeId:t,userId:r}=e;return(0,F.jsxs)(F.Fragment,{children:["win"===s.result&&(0,F.jsx)(ol,{userId:r,attendeeId:t,state:s}),"draw"===s.result&&(0,F.jsx)(oh,{userId:r,attendeeId:t}),"lose"===s.result&&(0,F.jsx)(ov,{userId:r,attendeeId:t,state:s})]})}),of=(0,d.memo)(e=>{var{state:s,attendeeId:t,userId:r}=e;return(0,F.jsx)("div",{className:"call-games-tic-tac-toe__container",children:(0,F.jsxs)("div",{className:"call-games-tic-tac-toe__content",children:["result"!==s.step&&(0,F.jsx)(dY.LocalizedText,{variant:"h2",href:"/call/games/tic-tac-toe#title"}),"image-choosing"===s.step&&(0,F.jsx)(d1,{userId:r,attendeeId:t,bets:s.bets}),"game"===s.step&&(0,F.jsx)(d7,{userId:r,attendeeId:t,state:s}),"result"===s.step&&(0,F.jsx)(om,{state:s,attendeeId:t,userId:r})]})})});var ob=(0,d.memo)(e=>{var{userId:s}=e,t=(0,dU.J2)(()=>tE.YL.shared(s).attendeeId,[s]),r=(0,dU.J2)(()=>dl.t.shared(s).state,[s]);return t&&r?(0,F.jsx)(of,{userId:s,attendeeId:t,state:r}):null});class og{constructor(e){this.name="tic-tac-toe",this.userId=e}render(){return(0,F.jsx)(ob,{userId:this.userId})}}let oI="call-games-never-have-i-ever-game__buttonWrapper",ow="call-games-never-have-i-ever-game__button",oS="call-games-never-have-i-ever-game__buttonGreen",oy="call-games-never-have-i-ever-game__questionResultIcon",oA=(0,d.memo)(e=>{var{activeQuestionIndex:s,questions:t,onTrueButtonClick:r,onFalseButtonClick:a,turnButtonsDisabled:i,onBackButtonClick:n,backButtonDisabled:o}=e,u=s+1+" / "+t.length,{key:l,attendeeAnswer:c,userAnswer:h}=t[s],p=(0,d.useMemo)(()=>d6()(ow,{[oS]:!1===h}),[h]),v=(0,d.useMemo)(()=>d6()(ow,{[oS]:!!h}),[h]),m=(0,oo.A)("call/games/never-have-i-ever",h===c?"answers-match-emoji":"answers-dont-match-emoji");return(0,F.jsxs)("div",{className:"call-games-never-have-i-ever-game__container",children:[(0,F.jsx)(dY.LocalizedText,{variant:"h4",color:"action-gray",href:"/call/games/never-have-i-ever#choose-same-items"}),(0,F.jsxs)("div",{children:[(0,F.jsx)(dX.E,{content:u}),(0,F.jsx)(dY.LocalizedText,{variant:"h3",href:"/call/games/never-have-i-ever#question-"+l})]}),(0,F.jsxs)("div",{children:[(0,F.jsxs)("div",{className:"call-games-never-have-i-ever-game__buttons",children:[(0,F.jsxs)("div",{className:oI,children:[(0,F.jsx)("button",{disabled:i,className:p,onClick:a,children:(0,F.jsx)(on.X,{href:"/commons#no"})}),void 0!==h&&!1===c&&(0,F.jsx)("span",{className:oy,children:m})]}),(0,F.jsxs)("div",{className:oI,children:[(0,F.jsx)("button",{disabled:i,className:v,onClick:r,children:(0,F.jsx)(on.X,{href:"/commons#yes"})}),void 0!==h&&!!c&&(0,F.jsx)("span",{className:oy,children:m})]})]}),0!==s&&(0,F.jsx)("div",{className:"call-games-never-have-i-ever-game__backButtonContainer",children:(0,F.jsx)("button",{disabled:o,className:"call-games-never-have-i-ever-game__backButton",onClick:n,children:(0,F.jsx)(on.X,{href:"/call/games/never-have-i-ever#back-to-previous-button"})})})]})]})});var oT=(0,d.memo)(e=>{var{state:s,userId:t}=e,r=(0,dU.uN)(()=>dc.Eu.shared(t).makeTurn(!1),[t],!1),a=(0,dU.uN)(()=>dc.Eu.shared(t).makeTurn(!0),[t],!1),i="game"===s.step&&void 0!==s.questions[s.activeQuestionIndex].userAnswer,n="game"===s.step&&void 0!==s.questions[s.activeQuestionIndex].userAnswer,d=(0,dU.uN)(()=>dc.Eu.shared(t).openExtraDiscussion(),[t]);return"game"===s.step?(0,F.jsx)(oA,{activeQuestionIndex:s.activeQuestionIndex,questions:s.questions,turnButtonsDisabled:i,onFalseButtonClick:r,onTrueButtonClick:a,onBackButtonClick:d,backButtonDisabled:n}):null});let ox={container:"call-games-never-have-i-ever-discussion-progress-bar__container",filler:"call-games-never-have-i-ever-discussion-progress-bar__filler",fillerup:"call-games-never-have-i-ever-discussion-progress-bar__fillerup",red:"call-games-never-have-i-ever-discussion-progress-bar__red",green:"call-games-never-have-i-ever-discussion-progress-bar__green"};var oC=(0,d.memo)(e=>{var{variant:s}=e,t=(0,dU.J2)(()=>T.T.shared().callGames.neverHaveIEver.discussionTtl,[]),[r,a]=(0,d.useState)((t||0)/eF.b.second),i=(0,d.useMemo)(()=>({animationDuration:t+"ms"}),[t]);(0,d.useEffect)(()=>{var e=setInterval(()=>{a(e=>e-1)},eF.b.second);return()=>{clearInterval(e)}},[]);var n=(0,d.useMemo)(()=>d6()(ox.filler,ox[s]),[s]);return(0,F.jsx)("div",{className:ox.container,children:(0,F.jsx)("div",{className:n,style:i,children:(0,F.jsx)(dX.E,{color:"light",content:""+r})})})});
3let oF=(0,d.memo)(e=>{var{questionKey:s,discussionPhraseKey:t,gameStep:r,onNextQuestionButtonClick:a}=e,i=(0,oo.A)("call/games/never-have-i-ever","next-question-button");return(0,F.jsxs)("div",{className:"call-games-never-have-i-ever-discussion__container",children:[(0,F.jsx)(dY.LocalizedText,{variant:"h4",color:"action-gray",href:"/call/games/never-have-i-ever#choose-same-items"}),(0,F.jsxs)("div",{children:[(0,F.jsx)(dY.LocalizedText,{variant:"h2",href:"/call/games/never-have-i-ever#discussion-emoji"}),(0,F.jsx)(dY.LocalizedText,{variant:"h3",href:"/call/games/never-have-i-ever#question-"+s}),(0,F.jsx)(dY.LocalizedText,{variant:"h3",href:"/call/games/never-have-i-ever#discussion-"+t})]}),"userDiscussion"===r&&(0,F.jsx)(oC,{variant:"green"}),"attendeeDiscussion"===r&&(0,F.jsx)(oC,{variant:"red"}),"extraDiscussion"===r&&(0,F.jsx)("div",{className:"call-games-never-have-i-ever-discussion__nextButtonContainer",children:(0,F.jsx)(od.$,{onClick:a,variant:"secondary",title:i})})]})});var oD=(0,d.memo)(e=>{var{userId:s,attendeeId:t,gameStep:r,onNextQuestionButtonClick:a}=e,i=(0,d.useCallback)(()=>{dz.shared(s).logNextQuestionButtonClicked(t),a()},[a,s,t]);return(0,d.useEffect)(()=>{"extraDiscussion"===r&&dz.shared(s).logNextQuestionButtonShown(t)},[s,t,r]),(0,F.jsx)(oF,Object.assign({},e,{onNextQuestionButtonClick:i}))}),ok=(0,d.memo)(e=>{var{state:s,userId:t,attendeeId:r}=e,a=(0,d.useMemo)(()=>"game"===s.step?s.questions[s.activeQuestionIndex].discussionPhraseKey:void 0,[s]),i=(0,dU.uN)(()=>dc.Eu.shared(t).nextQuestion(),[t]);return"game"===s.step&&a?(0,F.jsx)(oD,{userId:t,attendeeId:r,discussionPhraseKey:a,questionKey:s.questions[s.activeQuestionIndex].key,gameStep:s.gameStep,onNextQuestionButtonClick:i}):null}),oE=(0,d.memo)(e=>{var{userId:s}=e,t=(0,oo.A)("call/games/never-have-i-ever","try-again"),r=(0,dU.uN)(()=>dc.Eu.shared(s).restartGame(),[s]);return(0,F.jsxs)("div",{className:"call-games-never-have-i-ever-result__container",children:[(0,F.jsx)("div",{}),(0,F.jsxs)("div",{className:"call-games-never-have-i-ever-result__text",children:[(0,F.jsx)("span",{className:"call-games-never-have-i-ever-result__icon",children:(0,F.jsx)(on.X,{href:"/call/games/never-have-i-ever#result-emoji"})}),(0,F.jsx)(dY.LocalizedText,{variant:"h3",href:"/call/games/never-have-i-ever#result-text-line-1"}),(0,F.jsx)(dY.LocalizedText,{variant:"h3",href:"/call/games/never-have-i-ever#result-text-line-2"})]}),(0,F.jsx)("div",{className:"call-games-never-have-i-ever-result__buttonContainer",children:(0,F.jsx)(od.$,{onClick:r,variant:"secondary",title:t})})]})});let oj=(0,d.memo)(e=>{var{state:s,userId:t,attendeeId:r}=e;return(0,F.jsx)("div",{className:"call-games-never-have-i-ever__container",children:(0,F.jsxs)("div",{className:"call-games-never-have-i-ever__content",children:[(0,F.jsx)(dY.LocalizedText,{variant:"h2",href:"/call/games/never-have-i-ever#title"}),"game"===s.step&&(0,F.jsxs)(F.Fragment,{children:["question"===s.gameStep&&(0,F.jsx)(oT,{state:s,userId:t}),"question"!==s.gameStep&&(0,F.jsx)(ok,{state:s,userId:t,attendeeId:r})]}),"result"===s.step&&(0,F.jsx)(oE,{userId:t})]})})});var oR=(0,d.memo)(e=>{var{userId:s}=e,t=(0,dU.J2)(()=>dc.Eu.shared(s).state,[s]),r=(0,dU.J2)(()=>tE.YL.shared(s).attendeeId,[s]);return t&&r?(0,F.jsx)(oj,{state:t,userId:s,attendeeId:r}):null});class oO{constructor(e){this.name="never-have-i-ever",this.userId=e}render(){return(0,F.jsx)(oR,{userId:this.userId})}}class oM{constructor(e){this.userId=e}start(e){var s=eI.Y.shared().component.pipe((0,w.T)(e=>{var s=Object.keys(tE.YL.games);return e&&s.includes(e.name)}),(0,ev.F)());e.add(tE.YL.shared(this.userId).activeGame.pipe((0,I.n)(e=>s.pipe((0,g.s)(1),(0,ee.M)(s=>{s&&!e&&eI.Y.shared().close()}),(0,eP.u)(e)))).safeSubscribe(e=>{e&&function(e,s){switch(s){case"never-have-i-ever":eI.Y.shared().open(new oO(e));break;case"tic-tac-toe":eI.Y.shared().open(new og(e))}}(this.userId,e)}))}}oM.shared=(0,P.G)(e=>new oM(e));var oG=t(52140),oB=t(44399);class oP{constructor(e){this.userId=e}start(e){e.add(oG.R.shared().rated.pipe((0,ee.M)(e=>{if(e.isSuccessful){var s=e.value;oB.Q.shared(this.userId).logTopicsRecommendationsRatingBannerAccepted(s.attendeeId,s.ratedTopics)}else oB.Q.shared(this.userId).logTopicsRecommendationsRatingBannerDeclined(e.error.attendeeId)})).safeSubscribe())}}oP.shared=(0,P.G)(e=>new oP(e));var o_=t(55976),oz=t(78363),oN=t(78477),oL=t(7027),oq=t(81731);class oV{constructor(e){this.userId=e}start(e){e.add(oN.y.shared().data.pipe((0,b.o)(),(0,I.n)(e=>{var{letterCategory:s}=e;return oq.c.shared(this.userId).lastGenerationResult.pipe((0,w.T)(e=>"generating"===e.status?{requestId:e.requestId,generationGroupId:e.requestId,letterCategory:s,mode:e.regenerated?"default":"auto"}:null))})).safeSubscribe(e=>{e&&oz.B.shared(this.userId).logGeneratedLetterStarted(e)})),e.add(oN.y.shared().data.pipe((0,b.o)(),(0,I.n)(e=>{var{letterCategory:s,attendeeId:t,replyLetterId:r}=e;return oq.c.shared(this.userId).lastGenerationResult.pipe((0,w.T)(e=>"generating"===e.status?null:{status:"unknown-error"===e.status?"unexpected-error":e.status,userId:this.userId,attendeeId:t,letterCategory:s,replyLetterId:r,requestId:e.requestId,content:"text"in e?e.text:void 0,subject:"subject"in e?e.subject:void 0,language:"language"in e?e.language:void 0,meta:"meta"in e?e.meta:void 0,letter:"letter"in e?e.letter:void 0}))})).safeSubscribe(e=>{e&&oz.B.shared(this.userId).logGeneratedLetterGenerationComplete(e)})),e.add(oN.y.shared().data.pipe((0,I.n)(e=>{if(!e)return k.w;var{attendeeId:s,replyLetterId:t,letterCategory:r}=e;return(t?oL.S.shared(this.userId).letterGenerationReplyEnabled(s):oL.S.shared(this.userId).letterGenerationNewEnabled(s)).pipe((0,w.T)(e=>({available:e,attendeeId:s,letterCategory:r})),(0,ev.F)(ef()))}),(0,b.o)()).safeSubscribe(e=>{oz.B.shared(this.userId).logGeneratedLetterAvailability(e)}))}}oV.shared=(0,P.G)(e=>new oV(e));var oQ=t(2874),oU=t(32210);class oY{constructor(e){this.userId=e}logCreditsFastBuyBannerShown(e,s,t){W._.shared(this.userId).logEvent("chat"===s?"chat-fast-buy-banner-shown":"call-fast-buy-banner-shown",Object.assign({userId:this.userId,attendeeId:e},!!t&&{sku:t})).safeSubscribe()}logCreditsFastBuyBannerAccepted(e,s,t){W._.shared(this.userId).logEvent("chat"===s?"chat-fast-buy-banner-accepted":"call-fast-buy-banner-accepted",Object.assign({userId:this.userId,attendeeId:e},!!t&&{sku:t})).safeSubscribe()}logCreditsFastBuyBannerDeclined(e,s,t){W._.shared(this.userId).logEvent("chat"===s?"chat-fast-buy-banner-declined":"call-fast-buy-banner-declined",Object.assign({userId:this.userId,attendeeId:e},!!t&&{sku:t})).safeSubscribe()}}oY.shared=(0,P.G)(e=>new oY(e));class oJ{constructor(e){this.userId=e}start(e){e.add(oU.u.shared(this.userId).offeringResult.safeSubscribe(e=>{var{offer:{attendeeId:s,reason:t,sku:r}}=e;"accepted"===e.result?oY.shared(this.userId).logCreditsFastBuyBannerAccepted(s,t,r):"rejected"===e.result&&oY.shared(this.userId).logCreditsFastBuyBannerDeclined(s,t,r)})),e.add(oU.u.shared(this.userId).offer.pipe((0,ev.F)((e,s)=>ef()(e,s)),(0,b.o)()).safeSubscribe(e=>{var{attendeeId:s,reason:t,sku:r}=e;oY.shared(this.userId).logCreditsFastBuyBannerShown(s,t,r)}))}}oJ.shared=(0,P.G)(e=>new oJ(e));var oW=t(11990),oH=t(22643),oX=t(61570),oZ=null,o$=null,oK=(r=oH.f,a=function(e,s){return p.Session.shared().userId.pipe((0,b.o)()).toSingle().pipe((0,eY.Fg)(t=>(e.introductory?oX.a.shared(t).free.toSingle():eJ.v.just(e.presentAnswer||!1)).pipe((0,eY.Fg)(a=>
3{if(t===e.sender||a||e.read)return r(e,s);var i=(0,iV.io)(e.sender,e.recipient,e.id,e.introductory,e.presentAnswer),n=new iQ.dX(t,{type:"letter",path:i,ownerId:e.sender});return n.status.toSingle().pipe((0,eY.Fg)(e=>"payment_required"===e?n.buy():eJ.v.just(eE.Q.success())),(0,eY.Fg)(t=>t.isSuccessful||"processing"===t.error?r(e,s):eJ.v.just(eE.Q.failure(t.error))))}))))},i=(e,s)=>eJ.v.defer(()=>(n3.shared().interceptIntent(e),a(e,s).pipe((0,eY.ex)(s=>{n3.shared().interceptResult(e,s)}),(0,eY.ZC)(s=>(n3.shared().interceptError(e,s),eJ.v.error(s)))))),(e,s)=>eJ.v.defer(()=>{if(oZ&&o$)if(ef()(e,oZ))return o$;else return eJ.v.just(eE.Q.failure("cancelled"));var t=i(e,s).pipe((0,eY.hr)());return oZ=e,o$=t,t.pipe((0,eY.Zl)(()=>{oZ=null,o$=null}))})),o0=t(23567);class o1{start(e){var s=function(e,s,t,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0,n=e=>{var n=i?(0,oW.x)(i,s,e):null;return oK({id:String(t),sender:s,recipient:e,introductory:!0===r||"true"===r||"introductory"===r,presentAnswer:"present"===r,read:a},{activeAttachment:n||void 0})};e?n(e).safeSubscribe():p.Session.shared().userId.pipe((0,b.o)(),(0,o0.w)(30*eF.b.second),(0,g.s)(1)).pipe((0,I.n)(e=>n(e))).safeSubscribe()},t=e=>{e3.w.shared().add({name:e||e2.N.Default}).safeSubscribe()};l.A.sync("command.communication.letter.read",s),l.A.sync("command.refill.balance",t),e.add(()=>{l.A.removeListener("command.communication.letter.read",s),l.A.removeListener("command.refill.balance",t)})}}o1.shared=(0,P.G)(()=>new o1);class o5{constructor(e){this.userId=e}logPopupShown(){W._.shared(this.userId).logEvent("old-users-email-confirmation-popup-shown",{"user-id":this.userId}).safeSubscribe()}logPopupManualClosed(){W._.shared(this.userId).logEvent("old-users-email-confirmation-popup-manual-closed",{"user-id":this.userId}).safeSubscribe()}logConfirmationSendClicked(){W._.shared(this.userId).logEvent("old-users-email-confirmation-send-clicked",{"user-id":this.userId}).safeSubscribe()}}o5.shared=(0,P.G)(e=>new o5(e));var o3=t(72737);class o2{constructor(e){this.userId=e}start(e){e.add(o3.D.shared(this.userId).offer.pipe((0,w.T)(e=>!!e),(0,ev.F)()).safeSubscribe(e=>{e&&o5.shared(this.userId).logPopupShown()})),e.add(o3.D.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result&&o5.shared(this.userId).logConfirmationSendClicked(),"postponed"===e.result&&o5.shared(this.userId).logPopupManualClosed()}))}}o2.shared=(0,P.G)(e=>new o2(e));var o8=t(89590),o4=t(60226),o6=t(46560);class o9{constructor(e){this.userId=e}start(e){e.add(j.x.shared(this.userId).tags.pipe((0,w.T)(e=>e.includes("users.verification.completed")),(0,ep.Z)(void 0),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!1===s&&!0===t}),(0,I.n)(()=>o4.A.shared(this.userId).offer),(0,ea.p)(e=>!!e),(0,I.n)(()=>o4.A.shared(this.userId).acceptOffer().asObservable())).safeSubscribe()),e.add(o4.A.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>T.T.shared().oldVerificationEnabled),(0,I.n)(e=>e?j.x.shared(this.userId).tags:k.w),(0,w.T)(e=>e.includes("users.verification.pending")),(0,ep.Z)(void 0),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!1===s&&!0===t}),(0,I.n)(()=>o4.A.shared(this.userId).acceptOffer().asObservable())).safeSubscribe()),e.add(o4.A.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>o6.o.shared(this.userId).status),(0,ea.p)(e=>"documents-submitted"===e),(0,I.n)(()=>o4.A.shared(this.userId).acceptOffer().asObservable())).safeSubscribe())}}o9.shared=(0,P.G)(e=>new o9(e));var o7=t(41604),ue=t(84174);class us{constructor(e){this.userId=e}logPhoneNumberVerificationBannerShown(){W._.shared(this.userId).logEvent("phone-verification-banner-shown",{userId:this.userId}).safeSubscribe()}logPhoneNumberVerificationBannerAccepted(){W._.shared(this.userId).logEvent("phone-verification-banner-accepted",{userId:this.userId}).safeSubscribe()}logPhoneNumberVerificationBannerDeclined(){W._.shared(this.userId).logEvent("phone-verification-banner-declined",{userId:this.userId}).safeSubscribe()}}us.shared=(0,P.G)(e=>new us(e));class ut{constructor(e){this.userId=e}start(e){e.add(ue.bd.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result?us.shared(this.userId).logPhoneNumberVerificationBannerAccepted():("rejected"===e.result||"postponed"===e.result)&&us.shared(this.userId).logPhoneNumberVerificationBannerDeclined()})),e.add(ue.bd.shared(this.userId).offer.pipe((0,ev.F)(ef()),(0,ea.p)(e=>!!e)).safeSubscribe(()=>{us.shared(this.userId).logPhoneNumberVerificationBannerShown()}))}}ut.shared=(0,P.G)(e=>new ut(e));var ur=t(6367);class ua{constructor(e){this.userId=e}start(e){e.add(ur.v.shared(this.userId).phoneNumberDeleted.safeSubscribe(()=>{sH.X.shared().notifyUser({type:sW._.PhoneNumberDeleted},sW.A.Normal)}))}}ua.shared=(0,P.G)(e=>new ua(e));var ui=t(47653),un=t(36790),ud=t(77684),uo=t(82610);class uu{constructor(e){this.userId=e}start(e){e.add(uo.H.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>ud.o.shared().language),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s!==t}),(0,g.s)(1),(0,I.n)(()=>uo.H.shared(this.userId).rejectOffer("settings"))).safeSubscribe()),e.add(uo.H.shared(this.userId).offer.pipe((0,I.n)(e=>e?(0,K.h)((0,im.O)(e.ttl).pipe((0,eP.u)(!0)),uo.H.shared(this.userId).offeringResult.pipe((0,ea.p)(e=>!!e),(0,eP.u)(!1))):k.w),(0,g.s)(1),(0,I.n)(e=>e?uo.H.shared(this.userId).rejectOffer("timer"):(0,S.of)(void 0))).safeSubscribe())}}uu.shared=(0,P.G)(e=>new uu(e));
3var ul=t(84714);class uc{constructor(e){this.userId=e}start(e){e.add(uo.H.shared(this.userId).offeringResult.pipe((0,I.n)(e=>"rejected"===e.result?(0,S.of)({userLocale:e.offer.locale,reason:e.options}):k.w)).safeSubscribe(e=>{var{userLocale:s,reason:t}=e;ul.W.shared(this.userId).logBannerDeclined(s,t)}))}}uc.shared=(0,P.G)(e=>new uc(e));var uh=t(97697);function up(){return new eJ.v(e=>{C.Y.shared().get(eg.A).actions.open("phone-number-verification",[{props:{},disableManualClose:!0}]),e.success(void 0)})}class uv extends i3.M{constructor(e){super(uh.L.shared(e),e=>e,up)}}uv.shared=(0,P.G)(e=>new uv(e));class um{constructor(){var e=C.Y.shared().get(eg.A).store;this.visible=e.rxState().pipe((0,w.T)(()=>e.isExist({name:"phone-number-verification",params:[{props:{},disableManualClose:!0}]})),(0,ev.F)(),(0,tw.t)(1))}}um.shared=(0,P.G)(()=>new um);var uf=t(7899);class ub{constructor(e){this.userId=e}start(e){e.add(um.shared().visible.pipe((0,ea.p)(e=>e),(0,I.n)(()=>uf.i.shared(this.userId).resendCode().pipe((0,eY.ZC)(()=>eJ.v.just())))).safeSubscribe())}}ub.shared=(0,P.G)(e=>new ub(e));var ug=t(36165),uI=t(42159),uw=t(54589),uS=t(84879),uy=t(51075);class uA{interceptIntent(){p.Session.shared().userId.pipe((0,b.o)()).toSingle().pipe((0,eY.Fg)(e=>te._.shared(e).logUserAction({type:"cheers.freegift.received",data:{}}))).safeSubscribe()}}uA.shared=(0,P.G)(()=>new uA);var uT=(n=uy.v,()=>eJ.v.defer(()=>(uA.shared().interceptIntent(),n()))),ux=t(20750);class uC extends i3.M{constructor(e){super(uI.C.shared(e),e=>{switch(e.type){case"free-mingle-offering":return"registration";case"purchase-onboarding-on-email-confirmation-offering":return e.canOffer;default:return}},e=>uC.openIntroductionOffer(e))}static openIntroductionOffer(e){switch(e.type){case"free-cheer-activation-offering":return eJ.v.delay(0).pipe((0,eY.Fg)(()=>uT()));case"email-confirmation-remind-offering":return eJ.v.delay(0).pipe((0,eY.Fg)(()=>(0,uw.B)("email-confirmation-remind-offering")),(0,eY.AB)(void 0));case"free-mingle-offering":return eJ.v.delay(0).pipe((0,eY.Fg)(()=>(0,uS.p)(e.offer.cta)));case"secure-account-offering":return eJ.v.delay(0).pipe((0,eY.Fg)(()=>eJ.v.delay(0).pipe((0,eY.Fg)(()=>(C.Y.shared().get(eg.A).actions.open("secure-account",[{props:{},disableManualClose:!0}]),eJ.v.just())))));case"purchase-onboarding-on-email-confirmation-offering":return eJ.v.delay(0).pipe((0,eY.Fg)(()=>(0,ux.Y)(e.offer)));default:return eJ.v.just()}}start(e){e.add(sO.w.shared().userDistractionAllowed.pipe((0,ea.p)(e=>e),(0,I.n)(()=>new y.c(()=>{var e=new u.yU;return super.start(e),e}))).safeSubscribe())}}uC.shared=(0,P.G)(e=>new uC(e));var uF=t(33079),uD=uF.L,uk=t(4440);class uE{start(e){e.add(iK.g.shared().deepLink.pipe((0,I.n)(e=>"edit-profile"!==e.type?k.w:uk.V.shared().updateCredentials(e=>e.isSuccessful?p.Session.shared().userId.toSingle().pipe((0,eY.Fg)(e=>e?uD(e):eJ.v.just())):eJ.v.just()).pipe((0,eY.W_)(void 0)))).safeSubscribe())}}uE.shared=(0,P.G)(()=>new uE);var uj=t(38687);class uR{start(e){e.add(iK.g.shared().deepLink.pipe((0,ea.p)(e=>"manage-account"===e.type),(0,ee.M)(()=>aT.a.shared().removeHashParameter("universal-deep-link")),(0,I.n)(()=>(0,im.O)(1)),(0,I.n)(()=>uk.V.shared().updateCredentials(e=>e.isSuccessful?p.Session.shared().userId.toSingle().pipe((0,eY.Fg)(e=>e?(0,uj.W)(e):eJ.v.just())):eJ.v.just()).pipe((0,eY.W_)(void 0)))).safeSubscribe())}}uR.shared=(0,P.G)(()=>new uR);var uO=t(3196);class uM{start(e){e.add((0,D.z)([iK.g.shared().deepLink,T.T.shared().extendedPriceShowEnabled]).pipe((0,I.n)(e=>{var[s,t]=e;if(t||"gallery"!==s.type)return k.w;var{userId:r,basename:a}=s.args;return e6.c.shared().profileId.toSingle().pipe((0,eY.Fg)(e=>e!==r?(0,uF.L)(r,{source:"deeplink"}):eJ.v.just()),(0,eY.Fg)(()=>((0,uO.d)(r,a),eJ.v.just())))})).safeSubscribe())}}uM.shared=(0,P.G)(()=>new uM);class uG{constructor(e){this.userId=e,this.audio=new Audio}start(e){e.add(T.T.shared().userCameraPresenceBlockedNotifying.enabled.pipe((0,I.n)(e=>e?ug.h.shared(this.userId).shouldNotify:k.w)).safeSubscribe(e=>{e&&(this.audio.volume=1,this.audio.src="/sounds/camera-blocked.mp3",this.audio.play().then())}))}}uG.shared=(0,P.G)(e=>new uG(e));class uB{constructor(e){this.userId=e}logUserCameraBlocked(){W._.shared(this.userId).logEvent("user-camera-blocked",{}).safeSubscribe()}}uB.shared=(0,P.G)(e=>new uB(e));class uP{constructor(e){this.userId=e}start(e){e.add(T.T.shared().userCameraPresenceBlockedNotifying.enabled.pipe((0,I.n)(e=>e?ug.h.shared(this.userId).shouldNotify:k.w)).safeSubscribe(e=>{e&&uB.shared(this.userId).logUserCameraBlocked()}))}}uP.shared=(0,P.G)(e=>new uP(e));var u_=t(96333);class uz{constructor(e){this.userId=e}start(e){e.add(T.T.shared().mcs.enabled.pipe((0,I.n)(e=>e?(0,D.z)([ru.M.shared(this.userId).state.pipe((0,w.T)(e=>e.status)),C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>e.status))]):k.w),(0,w.T)(e=>{var[s,t]=e;return"idle"!==t?t:s}),(0,ev.F)(),(0,su.J)(),(0,w.T)(e=>{var[s,t]=e;return"idle"!==s&&"idle"===t}),(0,I.n)(e=>e?(0,D.z)([el.j.shared().chatAttendee.pipe((0,g.s)(1)),T.T.shared().mcs.presenceActualizingDelay]):k.w),(0,I.n)(e=>{var[s,t]=e;return s?(0,im.O)(t).pipe((0,I.n)(()=>u_._.shared(this.userId).refreshPresence(s))):k.w})).safeSubscribe())}}uz.shared=(0,P.G)(e=>new uz(e));var uN=t(69176),uL=t(70009);class uq{constructor(e){this.userId=e;var s=uN.B.shared(this.userId).exists.pipe((0,ea.p)(e=>e),(0,I.n)(()=>ru.M.shared(this.userId).state.pipe((0,w.T)(e=>"speaking"===e.status?e.participants[0]:void 0),(0,b.o)(),(0,g.s)(1))),(0,I.n)(e=>rl.K.shared(this.userId).id(e))),t=new y.c(e=>{var s=()=>
3{e.next()};return er.g.shared().addListener("command.chat.media.answer",s),()=>{er.g.shared().removeListener("command.chat.media.answer",s)}}).pipe((0,I.n)(()=>C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status?e.attendee:void 0),(0,b.o)(),(0,g.s)(1)))),r=e=>{var{size:s,options:t}=e;return"."+s+"."+t.join(".")};this.notification=T.T.shared().incomingCallWebNotification.enabled.pipe((0,I.n)(e=>e?(0,K.h)(s,t):(0,S.of)(null)),(0,I.n)(e=>e?R.F.shared(e).profile.pipe((0,w.T)(e=>e.isSuccessful?e.value:null),(0,b.o)(),(0,g.s)(1)).pipe((0,I.n)(e=>{let s,t;return(0,D.z)([(0,S.of)(e.name),e.thumbnail?(s=e.id,t=e.thumbnail,(0,D.z)([ah.T.shared().sharding,ah.T.shared().photos]).toSingle().pipe((0,eY.vV)(e=>{var[a,i]=e,{incomingCallWebNotificationThumbnail:n,incomingCallWebNotificationBigThumbnail:d}=i,o=r(n),u=(0,iV.DD)(s,t)+o,l=r(d),c=(0,iV.DD)(s,t)+l;return{small:(0,iY.o)(u,a),big:(0,iY.o)(c,a)}}))):(0,S.of)(void 0),uL.G.shared().localize("call","attendee-started-video-chat")])}),(0,w.T)(s=>{var[t,r,a]=s;return{attendeeId:e,thumbnail:r,title:t+" "+a}})):(0,S.of)(null)))}}uq.shared=(0,P.G)(e=>new uq(e));
3class uV{constructor(e){this.notificationCreatedSubject=new sp.B,this.notificationCreated=this.notificationCreatedSubject.asObservable(),this.notificationShownSubject=new sp.B,this.notificationShown=this.notificationShownSubject.asObservable(),this.notificationClickedSubject=new sp.B,this.notificationClicked=this.notificationClickedSubject.asObservable(),this.userId=e}start(e){var s,t,r=e=>{var t,r=e.target;this.notificationClickedSubject.next(r.data.attendeeId),null==(t=s)||t.close(),window.focus()},a=e=>{var s=e.target;this.notificationShownSubject.next(s.data.attendeeId)},i=()=>{var e,n,d;t&&(clearTimeout(t),t=null),null==(e=s)||e.removeEventListener("click",r),null==(n=s)||n.removeEventListener("close",i),null==(d=s)||d.removeEventListener("show",a),s=null};e.add(T.T.shared().incomingCallWebNotification.enabled.safeSubscribe(e=>{e&&window.Notification&&Notification.requestPermission().then()})),e.add(T.T.shared().incomingCallWebNotification.enabled.pipe((0,I.n)(e=>e&&window.Notification?(0,D.z)([uq.shared(this.userId).notification.pipe((0,b.o)()),T.T.shared().incomingCallWebNotification.ttl]):k.w)).pipe((0,ee.M)(()=>{var e;null==(e=s)||e.close()})).safeSubscribe(e=>{var[n,d]=e,{title:o,thumbnail:u,attendeeId:l}=n;s=new Notification(o,{image:null==u?void 0:u.big,icon:null==u?void 0:u.small,requireInteraction:!0,data:{attendeeId:l}}),this.notificationCreatedSubject.next(l),t=window.setTimeout(()=>{var e;null==(e=s)||e.close()},d),s.addEventListener("click",r),s.addEventListener("close",i),s.addEventListener("show",a)}))}}uV.shared=(0,P.G)(e=>new uV(e));class uQ{constructor(e){this.userId=e}logNotificationCreated(e){W._.shared(this.userId).logEvent("incoming-call-web-notification-created",{attendeeId:e}).safeSubscribe()}logNotificationShown(e){W._.shared(this.userId).logEvent("incoming-call-web-notification-shown",{attendeeId:e}).safeSubscribe()}logNotificationClicked(e){W._.shared(this.userId).logEvent("incoming-call-web-notification-clicked",{attendeeId:e}).safeSubscribe()}}uQ.shared=(0,P.G)(e=>new uQ(e));class uU{constructor(e){this.userId=e}start(e){e.add(uV.shared(this.userId).notificationCreated.safeSubscribe(e=>{uQ.shared(this.userId).logNotificationCreated(e)})),e.add(uV.shared(this.userId).notificationShown.safeSubscribe(e=>{uQ.shared(this.userId).logNotificationShown(e)})),e.add(uV.shared(this.userId).notificationClicked.safeSubscribe(e=>{uQ.shared(this.userId).logNotificationClicked(e)}))}}uU.shared=(0,P.G)(e=>new uU(e));var uY=t(66640),uJ=t(25871),uW=t(15006);class uH{constructor(e){this.usersAvailableForSend=new Z.t({}),this.userId=e}start(e){var s=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"idle"===e.status),(0,ev.F)()),t=ru.M.shared(this.userId).state.pipe((0,w.T)(e=>"idle"===e.status),(0,ev.F)()),r=(0,D.z)([s,t]).pipe((0,w.T)(e=>{var[s,t]=e;return s&&t})),a=q.e.shared(this.userId).balance.pipe((0,w.T)(e=>e>0),(0,ev.F)()),i=e=>(0,D.z)([da.g.shared(this.userId).canCallTo(e),rd.N.shared(this.userId).callIsAvailable(e)]).pipe((0,w.T)(e=>{var[s,t]=e;return s||t}),(0,ev.F)()),n=e=>{var s=this.usersAvailableForSend.getValue(),t=e.reduce((e,s)=>(void 0===e[s]&&(e[s]=!1),e),s);Object.keys(t).forEach(s=>{e.includes(s)||delete t[s]}),this.usersAvailableForSend.next(t)},d=e=>{var s=this.usersAvailableForSend.getValue(),t=Object.keys(s).filter(e=>!s[e]).sort(()=>.5-Math.random()).slice(0,e);return t.length?(0,S.of)(t):(0,S.of)(void 0)},o=e=>{var s=this.usersAvailableForSend.getValue();s[e]=!0,this.usersAvailableForSend.next(s)},u=e=>(0,df.H)(e).pipe((0,dg.H)(e=>M.f.shared(e).userIsFeaturedMember.pipe((0,I.n)(s=>s?uJ.L.shared(this.userId).videoPromoAllowed(e,"wink"):(0,S.of)(!1)),(0,I.n)(s=>s?(0,D.z)([sw.H.shared(this.userId).userInChatList(e),i(e)]).pipe((0,w.T)(e=>{var[s,t]=e;return s&&t})):(o(e),(0,S.of)(!1))),(0,w.T)(s=>s?e:void 0),(0,uY.v)(e=>!!e,!0),(0,b.o)())));e.add(T.T.shared().winks.call.enabled.pipe((0,I.n)(e=>e?rG.n.shared(this.userId).chats.pipe((0,w.T)(e=>e.map(e=>e.attendeeId))):k.w)).safeSubscribe(e=>n(e))),e.add(T.T.shared().winks.call.enabled.pipe((0,I.n)(e=>e?(0,D.z)([r,a]):k.w),(0,I.n)(e=>{var[s,t]=e;return s&&t?(0,D.z)([T.T.shared().winks.call.sendingInterval,T.T.shared().winks.call.sendingDelay,this.usersAvailableForSend.pipe((0,w.T)(e=>{var s=Object.values(e);return s.length&&s.includes(!1)}),(0,ev.F)())]).pipe((0,I.n)(e=>{var[s,t,r]=e;return r?(0,im.O)(t,s):k.w}),(0,I.n)(()=>T.T.shared().winks.call.usersAmountToCheckInInterval),(0,I.n)(e=>d(e)),(0,I.n)(e=>e&&e.length?u(e):k.w),(0,I.n)(e=>
3uW.T.shared(this.userId).wink(e,"call").pipe((0,eY.AB)(e)))):k.w})).safeSubscribe(e=>o(e)))}}uH.shared=(0,P.G)(e=>new uH(e));var uX=t(57682);class uZ{start(e){e.add(uX.v.shared().available.safeSubscribe(e=>{l.A.emit("command.presents.state."+(e?"available":"unavailable")+".set")}))}}uZ.shared=(0,P.G)(()=>new uZ);var u$=t(97815);class uK{constructor(e){this.userId=e}start(e){e.add(eJ.v.defer(()=>{var e=u$.A.getItem("previous-credits-pack");return e?tz.y.shared("payment-account",this.userId).store("previous-credits-package-amount",e):eJ.v.just()}).safeSubscribe())}}uK.shared=(0,P.G)(e=>new uK(e));var u0=l.A.create("search");class u1{constructor(e){this.userId=e}start(e){e.add(iM.BE.shared(this.userId).defaultFilters.pipe((0,eV.i)(1)).safeSubscribe(()=>{u0.emit("event.search.resource.changed")}))}}u1.shared=(0,P.G)(e=>new u1(e));var u5=t(85644);class u3{start(e){e.add(T.T.shared().mingleEnabled.pipe((0,I.n)(e=>e?iK.g.shared().deepLink:k.w),(0,I.n)(e=>"mingle"===e.type?(0,uS.p)().asObservable():k.w)).safeSubscribe())}}u3.shared=(0,P.G)(()=>new u3);var u2=t(39870);class u8{constructor(e){this.userId=e}start(e){e.add(u2.r.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>C.Y.shared().get(eg.A).store.rxState()),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)==="mingle"&&(null==t?void 0:t.name)!=="mingle"}),(0,I.n)(()=>u2.r.shared(this.userId).postponeOffer())).safeSubscribe())}}u8.shared=(0,P.G)(e=>new u8(e));var u4=t(91832),u6=t(56205);class u9{start(e){e.add(T.T.shared().rcmlAnalyticsEnabled.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>u6.Z.shared().hasPermission),(0,ea.p)(e=>e),(0,I.n)(()=>T.T.shared().rcmlAnalyticsUrl)).safeSubscribe(e=>{u4.U.shared().setUrl(e)}))}}u9.shared=(0,P.G)(()=>new u9);var u7=t(44148),le=t(19023);class ls{constructor(e){this.userId=e}start(e){e.add(u7.Y.shared(this.userId).offer.pipe((0,ev.F)(),(0,b.o)()).safeSubscribe(e=>{le.H.shared(this.userId).logDialogsAttachmentTooltipShown(e)}))}}ls.shared=(0,P.G)(e=>new ls(e));var lt=t(25628);class lr{start(e){e.add(iK.g.shared().deepLink.pipe((0,I.n)(e=>{if("link"===e.source&&(null==e?void 0:e.type)==="story"){var{userId:s,fragment:t}=e.args;return lt.x.shared(s).story.toSingle().pipe((0,eY.ex)(e=>{e&&C.Y.shared().get(eg.A).actions.open("story",[{props:{storyUserId:s,startWithoutSound:!0,fragment:t}}])}),(0,eY.AB)(void 0)).asObservable()}return k.w})).safeSubscribe())}}lr.shared=(0,P.G)(()=>new lr);var la=t(46362),li=t(40553);class ln{constructor(e){this.userId=e,this.enabled=(0,D.z)([T.T.shared().callsSection.enabled,T.T.shared().callsSection.variant.pipe((0,w.T)(li.C))]).pipe((0,w.T)(e=>{var[s,t]=e;return s&&t}),(0,ev.F)(),(0,tw.t)({refCount:!0,bufferSize:1}))}start(e){e.add(this.enabled.pipe((0,I.n)(e=>e?la.j.shared(this.userId).state.toSingle():k.w)).safeSubscribe()),e.add(this.enabled.pipe((0,I.n)(e=>e?ru.M.shared(this.userId).state.pipe((0,w.T)(e=>e.status),(0,ev.F)(),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"idle"!==s&&"idle"===t})):k.w)).safeSubscribe(()=>{this.refreshCallsHistory()})),e.add(this.enabled.pipe((0,I.n)(e=>e?uN.B.shared(this.userId).state.pipe((0,w.T)(e=>e.incomingCallsAmount),(0,ev.F)(),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s>0&&0===t})):k.w)).safeSubscribe(()=>{this.refreshCallsHistory()}))}refreshCallsHistory(){la.j.shared(this.userId).refresh()}}ln.shared=(0,P.G)(e=>new ln(e));class ld{constructor(e){}start(e){e.add(iK.g.shared().deepLink.safeSubscribe(e=>{"send-cheers"===e.type&&(0,nd.Z)(e.args.attendeeId,"send-cheers","deep-link")}))}}ld.shared=(0,P.G)(e=>new ld(e));class lo extends(0,ex.yS)("purchase.referral.trial",30*eF.b.second){}var lu={label:lo.type,tags:{team:()=>"core",success:e=>{var s;return(null==(s=e.encounters.completed)?void 0:s.details.isSuccessful)||!1},referent:e=>e.details.referent},hist:{ttresult:{from:"added",to:"completed"}}};eC.H.shared().registerMapping(lo.type,lu);var ll=t(3711);class lc{start(e){e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,ea.p)(e=>(null==e?void 0:e.name)==="referral-purchase")).safeSubscribe(e=>{var s,t,r=null==e||null==(s=e.params)?void 0:s[0];eT.E.shared().add(new lo(new Date,{cta:null!=(t=null==r?void 0:r.props.cta)?t:"deep-link",referent:null==r?void 0:r.props.referent}))})),e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)==="referral-purchase"&&(null==t?void 0:t.name)!==(null==s?void 0:s.name)})).safeSubscribe(()=>{eT.E.shared().complete(lo.identifier(),new Date,eE.Q.failure("cancelled-by-user"))})),e.add(aX.$.shared().componentRendered.safeSubscribe(e=>{e.displayName===ll.ReferralPurchase.displayName&&eT.E.shared().complete(lo.identifier(),new Date,eE.Q.success())}))}}lc.shared=(0,P.G)(()=>new lc);var lh=t(55949);class lp{constructor(e){this.userId=e}logAutoCallPopupShown(e,s){W._.shared(this.userId).logEvent("autocall-popup-shown",{userId:this.userId,attendeeId:e,type:s}).safeSubscribe(),"prioritized-autocall"===s&&te._.shared(this.userId).logUserAction({type:"autocalls.contacts.matched",data:{"attendee-id":e}}).safeSubscribe()}logAutoCallAccepted(e,s){W._.shared(this.userId).logEvent("autocall-accepted",{userId:this.userId,attendeeId:e,type:s}).safeSubscribe()}logAutoCallRejected(e,s){W._.shared(this.userId).logEvent("autocall-rejected",{userId:this.userId,attendeeId:e,type:s}).safeSubscribe(),te._.shared(this.userId).logUserAction({type:"autocall.rejected",data:{"attendee-id":e,type:s}}).safeSubscribe()}logAutoCallRejectedByFailedCall(e,s){te._.shared(this.userId).logUserAction({type:"autocall.rejected",data:{"attendee-id":e,type:s}}).safeSubscribe()}logAutoCallRejectedByTimeout(e,s){W._.shared(this.userId).logEvent("autocall-rejected-by-timeout",{userId:this.userId,attendeeId:e,type:s}).safeSubscribe()}}lp.shared=(0,P.G)(e=>new lp(e));class lv{constructor(e){this.userId=e}start(e){e.add(lh.Y.shared(this.userId).offeringResult.safeSubscribe(e=>{var{offer:{attendeeId:s,type:t}}=e.offer;"accepted"===e.result?lp.shared(this.userId).logAutoCallAccepted(s,t):"rejected"===e.result?lp.shared(this.userId).logAutoCallRejected(s,t):"postponed"===e.result&&lp.shared(this.userId).logAutoCallRejectedByTimeout(s,t)})),e.add(lh.Y.shared(this.userId).offer.pipe((0,b.o)()).safeSubscribe(e=>{var{offer:{attendeeId:s,type:t}}=e;lp.shared(this.userId).logAutoCallPopupShown(s,t)}))}}lv.shared=(0,P.G)(e=>new lv(e));var lm=t(2952),lf=t(22973),lb=["secure-account","add-phone-number","phone-number-verification","phone-number-verification-success"];class lg{constructor(e){this.userId=e}start(e){var s=C.Y.shared().get(eg.A).store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e,r=(null==s?void 0:s.name)&&lb.includes(s.name),a=(null==t?void 0:t.name)&&lb.includes(t.name);return!!(r&&!a)}));e.add(lf.zL.shared(this.userId).offer.pipe((0,I.n)(e=>e?s:k.w),(0,I.n)(()=>uf.i.shared(this.userId).verified),(0,I.n)(e=>e?lf.zL.shared(this.userId).acceptOffer():lf.zL.shared(this.userId).postponeOffer())).safeSubscribe())}}lg.shared=(0,P.G)(e=>new lg(e));var lI=t(93701);class lw{constructor(e){this.userId=e}start(e){e.add(sX.G.shared(this.userId).emailConfirmed.pipe((0,ep.Z)(void 0),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!1===s&&!0===t}),(0,I.n)(()=>lI.c.shared(this.userId).offer.pipe((0,g.s)(1))),(0,ea.p)(e=>!!e),(0,I.n)(()=>lI.c.shared(this.userId).acceptOffer().asObservable())).safeSubscribe())}}lw.shared=(0,P.G)(e=>new lw(e));var lS=t(15135),ly=t(14678);class lA{constructor(e){this.userId=e}start(e){var s=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>e.status),(0,ev.F)()),t=ru.M.shared(this.userId).state.pipe((0,w.T)(e=>e.status),(0,ev.F)()),r=(0,D.z)([s,t]).pipe((0,g.s)(1),(0,ea.p)(e=>{var[s,t]=e;return"idle"===s&&"idle"===t})),a=q.e.shared(this.userId).balance.pipe((0,ea.p)(e=>e>0),(0,g.s)(1));e.add(lS.E.shared().paymentResult.pipe((0,I.n)(e=>e.isSuccessful&&"call"===e.value.reason?a.pipe((0,I.n)(()=>r.pipe((0,I.n)(()=>rd.N.shared(this.userId).callIsAvailable(e.value.attendeeId).pipe((0,g.s)(1))),(0,I.n)(s=>s?rl.K.shared(this.userId).mcsId(e.value.attendeeId).asObservable().pipe((0,I.n)(s=>s?(ru.M.shared(this.userId).start(s,"fast-buy"),k.w):dr.I.shared(this.userId).dial(e.value.attendeeId,!0).pipe((0,eY.ex)(()=>{er.g.shared().emit("command.user-actions.interaction.track",[{place:"video-chat-start.fast-buy",user:e.value.attendeeId}])})))):dr.I.shared(this.userId).dial(e.value.attendeeId,!0).pipe((0,eY.ex)(()=>{er.g.shared().emit("command.user-actions.interaction.track",[{place:"video-chat-start.fast-buy",user:e.value.attendeeId}])})))))):k.w)).safeSubscribe()),e.add(lS.E.shared().paymentResult.pipe((0,I.n)(e=>e.isSuccessful&&"audio-call"===e.value.reason?a.pipe((0,I.n)(()=>r.pipe((0,I.n)(()=>rd.N.shared(this.userId).audioCallAvailable(e.value.attendeeId).pipe((0,g.s)(1))),(0,I.n)(s=>s?ru.M.shared(this.userId).startAudioCall(e.value.attendeeId,"fast-buy"):k.w)))):k.w)).safeSubscribe()),e.add(T.T.shared().mcs.reCallAfterPaymentEnabled.pipe((0,I.n)(e=>e?ru.M.shared(this.userId).state.pipe((0,ev.F)((e,s)=>e.status===s.status),(0,su.J)(),(0,I.n)(e=>{var[s,t]=e;if("idle"===s.status||"call"!==s.callType||"idle"!==t.status)return(0,S.of)(null);var r=(null==s?void 0:s.calleeId)||(null==s?void 0:s.participants[0]);return ny.Q.shared().balanceRefillingIntentReplay.pipe((0,g.s)(1),(0,w.T)(e=>e.reason.name===e2.N.MSCCall?r:null),(0,o0.w)({first:1e4}),(0,E.W)(()=>(0,S.of)(null)))})):k.w),(0,I.n)(e=>e?ny.Q.shared().balanceRefillingResult.pipe((0,w.T)(s=>s.result.isSuccessful&&s.reason.name===e2.N.MSCCall?e:null),(0,I.n)(e=>e?rl.K.shared(this.userId).id(e).asObservable().pipe((0,I.n)(s=>s?rd.N.shared(this.userId).callIsAvailable(s).pipe((0,g.s)(1),(0,I.n)(t=>t?(ru.M.shared(this.userId).start(e,"recall-after-payment"),k.w):ly.w.shared(this.userId).sendNotificationAfterPayment(s))):k.w)):k.w)):k.w)).safeSubscribe())}}lA.shared=(0,P.G)(e=>new lA(e));var lT=t(6664),lx=t(53644);class lC extends i3.M{constructor(e){super(lT.A.shared(e),lx.$)}}lC.shared=(0,P.G)(e=>new lC(e));var lF=t(70964);class lD{constructor(e){this.userId=e}start(e){e.add(lT.A.shared(this.userId).offer.pipe((0,w.T)(e=>!!e),(0,ev.F)()).safeSubscribe(e=>{e&&lF.T.shared(this.userId).logRecorderTipShown()})),e.add(lT.A.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result&&lF.T.shared(this.userId).logPreviewUploadedSuccessfully(),"rejected"===e.result&&lF.T.shared(this.userId).logRecorderClosed()}))}}lD.shared=(0,P.G)(e=>new lD(e));class lk{constructor(e){this.userId=e}start(e){e.add(M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(e=>e?ru.M.shared(this.userId).callExists.pipe((0,I.n)(e=>e?ru.M.shared(this.userId).state.pipe((0,w.T)(e=>{var s,t;switch(e.status){case"speaking":return null!=(s=e.participants[0])?s:null;case"connecting":return null!=(t=e.calleeId)?t:null;default:return null}})):(0,S.of)(null)),(0,ev.F)(),(0,I.n)(e=>e?rl.K.shared(this.userId).id(e):(0,S.of)(void 0)),(0,ee.M)(e=>{window.mcs={attendeeId:e}})):k.w)).safeSubscribe())}}lk.shared=(0,P.G)(e=>new lk(e));var lE=t(36658);let lj=(0,d.memo)(e=>{var{userId:s}=e;return(0,F.jsx)("div",{className:"chat-call-mcs-vr-over-page-container__wrapper",children:(0,F.jsx)(lE.e,{userId:s,vrVie
3w:!0})})});var lR=(0,d.memo)(e=>{var{userId:s}=e;return(0,F.jsx)(lj,{userId:s})});class lO{constructor(e){this.name="vr-call",this.userId=e}render(){return(0,F.jsx)(lR,{userId:this.userId})}}class lM{constructor(e){this.userId=e}start(e){e.add(M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(e=>e?(0,D.z)([ru.M.shared(this.userId).callExists,ru.M.shared(this.userId).callIsVR,el.j.shared().chatAttendee]).pipe((0,w.T)(e=>{var[s,t,r]=e;return s&&t&&!!r})):k.w)).safeSubscribe(e=>{e&&eI.Y.shared().open(new lO(this.userId))})),e.add(M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(e=>e?(0,D.z)([ru.M.shared(this.userId).callExists,ru.M.shared(this.userId).callIsVR]).pipe((0,w.T)(e=>{var[s,t]=e;return s&&t})):k.w),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s&&!t}),(0,I.n)(()=>eI.Y.shared().component.toSingle())).safeSubscribe(e=>{(null==e?void 0:e.name)==="vr-call"&&eI.Y.shared().close()}))}}lM.shared=(0,P.G)(e=>new lM(e));var lG=t(35783),lB=t(75434),lP=t(46610),l_={"application-offering":"application","unhide-profile-offering":"unhide-profile","email-confirmation-offering":"email-confirmation","email-notifications-switch-on-offering":"email-notifications-switch-on","metaverse-offering":"metaverse","new-product-offering":"new-product","vr-meets-offering":"vr-meets"};class lz{constructor(e){this.userId=e}start(e){e.add(lB.e.shared(this.userId).offeringResult.safeSubscribe(e=>{("postponed"===e.result||"rejected"===e.result)&&lP.p.shared(this.userId).logBannerDeclined(l_[e.options.type])})),e.add(lB.e.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,ev.F)((e,s)=>ef()(e,s))).safeSubscribe(e=>{e&&lP.p.shared(this.userId).logBannerShown(l_[e.type])}))}}lz.shared=(0,P.G)(e=>new lz(e));var lN=t(3643),lL=t(66883),lq=[[700,5],[500,4],[300,3],[100,2],[50,1]];class lV{constructor(e){this.viewedProfiles=new Set,this.lastLoggedMilestone=0,this.userId=e}start(e){e.add(lL.G.shared(this.userId).pageInfo.pipe((0,I.n)(e=>new y.c(()=>{var s=s=>{this.trackScrollMilestone(s,e.requestId)};return l.A.on("event.users.search.user.examined",s),()=>{l.A.removeListener("event.users.search.user.examined",s)}}))).safeSubscribe())}trackScrollMilestone(e,s){if(e){var t=this.viewedProfiles.size;this.viewedProfiles.add(e);var r=this.viewedProfiles.size;if(r>t){var a=function(e){for(var s=0;s<lq.length;s++){var[t,r]=lq[s];if(e>=t)return r}return 0}(r);a>this.lastLoggedMilestone&&a>0&&(lN.O.shared(this.userId).logProfilesScrollViewed(a,s),this.lastLoggedMilestone=a)}}}}lV.shared=(0,P.G)(e=>new lV(e));var lQ=t(6381),lU=t(32978);class lY{constructor(e){}start(e){e.add(lQ.P.shared().deepLink.pipe((0,g.s)(1),(0,ea.p)(e=>{var s;return!!(null!=(s=e.commands)&&s.find(e=>"command.authorization.track"===e.command&&"only-email"===e.args.mode))})).safeSubscribe(()=>{lU.h.shared().logAuthorizationOverlayLogin("only-email")}))}}lY.shared=(0,P.G)(e=>new lY(e));var lJ=t(25887);class lW{constructor(e){this.userId=e}start(e){e.add(lJ.v.shared().presentSendingIntent.pipe((0,I.n)(e=>{var{result:s,receiverId:t}=e;return s.isSuccessful?i8.z.shared(this.userId).offer.pipe((0,g.s)(1),(0,I.n)(e=>e&&e.data.userId===t?i8.z.shared(this.userId).acceptOffer():(0,S.of)())):(0,S.of)()})).safeSubscribe())}}lW.shared=(0,P.G)(e=>new lW(e));var lH=t(61585);class lX{constructor(e){this.userId=e}start(e){var s=e=>{if(0===e.args.types.length)return eJ.v.just();e.args.token&&B.jI.shared().authorize.token(e.args.token);var s=e.args.types.reduce((s,t)=>(s[t]=+("command.subscriptions.subscribe"===e.command),s),{}),t=e.args.messageId?{messageId:e.args.messageId}:void 0;return lH.y.shared(this.userId).patch("electronicmail",s,t).pipe((0,eY.AB)(e))};e.add(lQ.P.shared().deepLink.pipe((0,I.n)(e=>{var t,r=null==(t=e.commands)?void 0:t.filter(e=>"command.subscriptions.subscribe"===e.command||"command.subscriptions.unsubscribe"===e.command);return null!=r&&r.length?(0,K.h)(...r.map(s)):(0,S.of)(void 0)})).safeSubscribe(e=>{e&&(sH.X.shared().notifyUser({type:sW._.EmailNotificationsSettingsChanged,payload:{types:e.args.types,subscribed:"command.subscriptions.subscribe"===e.command}},sW.A.Normal),aT.a.shared().removeHashParameter("emit",e.command))}))}}lX.shared=(0,P.G)(e=>new lX(e));var lZ=t(75693);class l${constructor(e){this.userId=e}start(e){e.add((0,D.z)([lZ.s.shared(this.userId).data().pipe((0,w.T)(e=>e.includes("suspended")),(0,ev.F)()),j.x.shared(this.userId).tags.pipe((0,w.T)(e=>e.includes("cpweb.auth.blocked")),(0,E.W)(()=>(0,S.of)(!1)),(0,ev.F)())]).pipe((0,w.T)(e=>{var[s,t]=e;return s||t}),(0,ev.F)()).safeSubscribe(e=>{e&&p.Session.shared().logout().safeSubscribe()}))}}l$.shared=(0,P.G)(e=>new l$(e));var lK=t(46053);class l0{constructor(e){this.userId=e}start(e){e.add(sX.G.shared(this.userId).emailConfirmed.pipe((0,ep.Z)(void 0),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!1===s&&!0===t}),(0,I.n)(()=>lK.q.shared(this.userId).offer.pipe((0,g.s)(1))),(0,ea.p)(e=>!!e),(0,I.n)(()=>lK.q.shared(this.userId).acceptOffer().asObservable())).safeSubscribe())}}l0.shared=(0,P.G)(e=>new l0(e));var l1=t(58924),l5=t(91317);class l3{constructor(e){this.userId=e}start(e){e.add(l5.P.shared(this.userId).settings.pipe((0,ep.Z)(void 0),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!!(s&&!s.offlineMessageFromNonFavorite&&!s.offlineMessageFromFavorite&&!s.letterFromNonFavorite&&!s.letterFromFavorite&&t&&(t.offlineMessageFromNonFavorite||t.offlineMessageFromFavorite||t.letterFromNonFavorite||t.letterFromFavorite))}),(0,I.n)(()=>l1.k.shared(this.userId).offer.pipe((0,g.s)(1))),(0,ea.p)(e=>!!e),(0,I.n)(()=>l1.k.shared(this.userId).acceptOffer().asObservable())).safeSubscribe())}}l3.shared=(0,P.G)(e=>new l3(e));var l2=t(95629);class l8{constructor(e){this.userId=e}start(e){e.add(sI.E.shared(this.userId).presentInFeed.pipe((0,ep.Z)(void 0),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!1===s&&!0===t}),(0,I.n)(()=>l2.L.shared(this.userId).offer.pipe((0,g.s)(1))),(0,ea.p)(e=>!!e),(0,I.n)(()=>l2.L.shared(this.userId).acceptOffer().asObservable())).safeSubscribe())}}l8.shared=(0,P.G)(e=>new l8(e));var l4=t(74923),l6=t(51718),l9=t(69145),l7=t(9453);class ce{constructor(e){this.userId=e}start(e){var s=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"idle"!==e.status)),t=ru.M.shared(this.userId).state.pipe((0,w.T)(e=>"idle"!==e.status)),r=(0,D.z)([s,t]).pipe((0,w.T)(e=>e.some(Boolean)),(0,ev.F)()),a=(0,D.z)([l7.l.shared().visible,rp.hw.shared(this.userId).offer.pipe((0,w.T)(e=>!!e))]).pipe((0,w.T)(e=>{var[s,t]=e;return s||t}),(0,ev.F)());e.add(rL.e.shared(this.userId).newMessage.pipe((0,ea.p)(e=>e.sender===this.userId&&e.status===l4.n.Delivered&&(e.type===re.Go.Photo||e.type===re.Go.Video)),(0,I.n)(()=>u7.Y.shared(this.userId).acceptOffer().asObservable())).safeSubscribe()),e.add(u7.Y.shared(this.userId).offer.pipe((0,I.n)(e=>e?a:(0,S.of)(!1)),(0,ea.p)(Boolean),(0,I.n)(()=>u7.Y.shared(this.userId).postponeOffer().asObservable())).safeSubscribe()),e.add(u7.Y.shared(this.userId).offer.pipe((0,I.n)(e=>e?r:(0,S.of)(!1)),(0,ea.p)(Boolean),(0,I.n)(()=>u7.Y.shared(this.userId).postponeOffer().asObservable())).safeSubscribe()),e.add(u7.Y.shared(this.userId).offer.pipe((0,I.n)(e=>(null==e?void 0:e.type)==="default"?(0,im.O)(eF.b.minute).pipe((0,I.n)(()=>el.j.shared().chatAttendee),(0,g.s)(1),(0,I.n)(s=>s===e.attendeeId?u7.Y.shared(this.userId).postponeOffer().asObservable():(0,S.of)())):(0,S.of)())).safeSubscribe()),e.add(u7.Y.shared(this.userId).offer.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,I.n)(s=>s!==e.attendeeId?u7.Y.shared(this.userId).postponeOffer().asObservable():(0,S.of)())):(0,S.of)())).safeSubscribe()),e.add(u7.Y.shared(this.userId).offer.pipe((0,I.n)(e=>e?(0,K.h)(dD.W.shared().recording,l9.o.shared().visible,l6.b.shared().visible,nl.S.shared(this.userId).getDraftMessage(e.attendeeId).pipe((0,w.T)(e=>!!e))).pipe((0,ea.p)(Boolean),(0,I.n)(()=>u7.Y.shared(this.userId).postponeOffer().asObservable())):(0,S.of)(void 0))).safeSubscribe())}}ce.shared=(0,P.G)(e=>new ce(e));class cs{constructor(e){this.userId=e}start(e){var s=j.x.shared(this.userId).tags.pipe((0,w.T)(e=>e.includes("presence.history.androidapp")||e.includes("presence.history.iosapp")),(0,ev.F)()),t=tc.e.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>s),(0,I.n)(e=>e?tc.e.shared(this.userId).acceptOffer().asObservable():k.w));e.add(s.pipe((0,g.s)(1),(0,I.n)(e=>e?k.w:t)).safeSubscribe())}}cs.shared=(0,P.G)(e=>new cs(e));class ct{constructor(e){this.userId=e}start(e){var s=sO.w.shared().userDistractionAllowed.pipe((0,ea.p)(e=>e),(0,g.s)(1),(0,I.n)(()=>a1.q.shared(this.userId).data()),(0,g.s)(1));
3e.add(p.Session.shared().authorizationDetailsFor(this.userId).pipe((0,I.n)(e=>"signup"===e.action?s:(0,S.of)(void 0))).safeSubscribe()),e.add(rn.N.shared(this.userId).blockedUsers.pipe((0,su.J)(),(0,w.T)(e=>{var[s,t]=e;return t.filter(e=>!s.includes(e))})).safeSubscribe(e=>{e.forEach(e=>{a1.q.shared(e).refresh(!0)})}))}}ct.shared=(0,P.G)(e=>new ct(e));var cr=t(86019),ca={arabiandate:"arabia",amaldate:"amal",eurodate:"euro",chinalove:"china",yourchristiandate:"christian",amolatina:"latin",datemyage:"mature",yourtravelmates:"travel",guysonly:"guys",girlsonly:"pink"};class ci{constructor(e){this.userId=e,this.initializedSubject=new Z.t(!1),this.initialized=this.initializedSubject.asObservable()}start(e){var s=(0,D.z)([sn.o.shared().data(),R.F.shared(this.userId).profile]).pipe((0,w.T)(e=>{var[s,t]=e;return s.token&&t.isSuccessful&&t.value.gender?{token:s.token,userId:this.userId,gender:t.value.gender}:null}),(0,ev.F)(e0()));e.add(T.T.shared().datingFamilyShowcaseEnabled.pipe((0,ea.p)(e=>e),(0,I.n)(()=>s),(0,b.o)(),(0,I.n)(e=>(0,D.z)([cr._.shared().language,T.T.shared().datingFamilyShowcaseVariant]).pipe((0,w.T)(s=>{var[t,r]=s,a=L.T.shared().product;return{product:ca[a]||a,identity:e,language:t,variant:r}}),(0,ev.F)(e0()))),(0,I.n)(e=>(0,df.H)(Promise.all([t.e("2755"),t.e("9988")]).then(t.bind(t,90716))).pipe((0,w.T)(s=>{var{initializeModule:t}=s;return{initializeModule:t,config:e}})))).safeSubscribe(e=>{var{initializeModule:s,config:t}=e;s(t),this.initializedSubject.next(!0)}))}}ci.shared=(0,P.G)(e=>new ci(e));var cn=t(50846),cd=t(52372);class co extends cn.Q{constructor(e){super("users.permissions",e,()=>(0,B.p6)(B.jI.shared().users.permissions.get,e).pipe((0,eY.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t,ttl:(null==(s=(0,an.a)(r))?void 0:s.maxAge)||0}}))),this.userId=e}update(e){return eJ.v.defer(()=>{var s=this.addOptimisticStateTransformation(()=>e);return(0,B.Yq)(B.jI.shared().users.permissions.put,this.userId,e).pipe((0,cd.rQ)(s))})}}co.shared=(0,P.G)(e=>new co(e));class cu{constructor(e){this.userId=e,this.permissions=co.shared(this.userId).data()}setPermissions(e){return co.shared(this.userId).update(e)}}cu.shared=(0,P.G)(e=>new cu(e));var cl=t(48448),cc=t(27793);class ch{constructor(e){var s=p.Session.shared().userIsUsingDemoMode.pipe((0,w.T)(e=>!e)),t=p.Session.shared().userIsUsual.pipe((0,I.n)(s=>s?cu.shared(e).permissions.pipe((0,w.T)(e=>{var s,t,r=null==(s=Notification)?void 0:s.permission,a=null==e||null==(t=e["web-notifications"])?void 0:t.permission;return void 0===a||"default"===r||a!==("granted"===r)})):(0,S.of)(!0))),r=uI.C.shared(e).offer.pipe((0,w.T)(e=>!e)),a=C.Y.shared().get(e5.A,e).store.rxState().pipe((0,w.T)(e=>"idle"!==e.status),(0,ev.F)()),i=ru.M.shared(e).state.pipe((0,w.T)(e=>"idle"!==e.status),(0,ev.F)()),n=(0,D.z)([a,i]).pipe((0,w.T)(e=>e.some(Boolean))),d=el.j.shared().chatAttendee.pipe((0,I.n)(s=>s?ra.i.shared(e).offer(s).pipe((0,w.T)(e=>!!e),(0,ev.F)(),(0,ep.Z)(null)):(0,S.of)(!1))),o=cl.T.shared().offerIsVisible.pipe((0,ev.F)(),(0,ep.Z)(null)),u=(0,D.z)([d,o]).pipe((0,w.T)(e=>e.some(Boolean)));this.available=ah.T.shared().webPushEnabled.pipe((0,I.n)(e=>e?(0,D.z)([tL.h.shared().completed,s,t,r,n,u,(0,cc.g)()]).pipe((0,w.T)(e=>{var[s,t,r,a,i,n,d]=e;return s&&t&&r&&a&&!i&&!n&&!d})):(0,S.of)(!1)),(0,ev.F)())}}ch.shared=(0,P.G)(e=>new ch(e));class cp extends t$.D{constructor(e){super(),this.canOffer=ch.shared(e).available.pipe((0,ev.F)())}start(){return eJ.v.just(eE.Q.success({}))}postpone(){return eJ.v.just(eE.Q.success())}}cp.shared=(0,P.G)(e=>new cp(e));class cv{constructor(){this.requestPermissionIntentSubject=new sp.B,this.requestPermissionIntent=this.requestPermissionIntentSubject.asObservable()}intercept(){this.requestPermissionIntentSubject.next()}}function cm(){return eJ.v.from(Notification.requestPermission()).pipe((0,eY.Fg)(e=>"default"===e?eJ.v.from(Notification.requestPermission()):eJ.v.just(e)))}cv.shared=(0,P.G)(()=>new cv);class cf{constructor(e){this.userId=e,this.webNotificationOffering=cp.shared(this.userId)}verifyFeatureAndBrowser(){if(!Notification)return this.webNotificationOffering.rejectOffer("not-supported");if("denied"===Notification.permission)return this.webNotificationOffering.rejectOffer("permission-denied");if("default"===Notification.permission)return(()=>(cv.shared().intercept(),cm()))().pipe((0,eY.Fg)(e=>e?"granted"===e?this.webNotificationOffering.acceptOffer("granted"):this.webNotificationOffering.rejectOffer("denied"):this.webNotificationOffering.postponeOffer()));return this.webNotificationOffering.acceptOffer()}start(e){e.add(this.webNotificationOffering.canOffer.pipe((0,ea.p)(e=>e),(0,I.n)(()=>this.webNotificationOffering.startOffer())).safeSubscribe()),e.add(this.webNotificationOffering.offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>this.verifyFeatureAndBrowser())).safeSubscribe()),e.add(this.webNotificationOffering.offeringResult.pipe((0,I.n)(()=>this.saveSelection(Notification.permission))).safeSubscribe())}saveSelection(e){var s="granted"===e,t=cu.shared(this.userId);return t.permissions.toSingle().pipe((0,eY.Fg)(e=>{var r;return e&&(null==(r=e["web-notifications"])?void 0:r.permission)===s?eJ.v.just():sr.E.shared().currentTime().pipe((0,eY.Fg)(e=>t.setPermissions({"web-notifications":{permission:s,timestamp:e}})))}))}}cf.shared=(0,P.G)(e=>new cf(e));class cb{constructor(e){this.userId=e}put(e){var s={WebPushTokens:{Endpoint:e.webPushTokens.endpoint,EncryptionKey:e.webPushTokens.encryptionKey,AuthenticationKey:e.webPushTokens.authenticationKey}};return(0,B.Yq)(B.jI.shared().retention.addresses.put,this.userId,s).pipe((0,eY.AB)(void 0))}}cb.shared=(0,P.G)(e=>new cb(e));class cg{constructor(e){this.userId=e}addWebPushSubscription(e){return cb.shared(this.userId).put(e)}}cg.shared=(0,P.G)(e=>new cg(e));var cI=t(81429);class cw{constructor(e){this.userId=e,this.webNotificationOffering=cp.shared(e)}start(e){e.add(this.webNotificationOffering.offeringResult.pipe((0,ea.p)(e=>"accepted"===e.result),(0,I.n)(()=>ah.T.shared().webNotificationsPublicKey.toSingle()),(0,I.n)(e=>this.subscribeWorker(e)),(0,w.T)(e=>({endpoint:e.endpoint,encryptionKey:this.base64Encode(e.getKey("p256dh")),authenticationKey:this.base64Encode(e.getKey("auth"))})),(0,I.n)(e=>cg.shared(this.userId).addWebPushSubscription({webPushTokens:e})),(0,rD.y)()).safeSubscribe())}subscribeWorker(e){return eJ.v.from(navigator.serviceWorker.register("/app/service-worker.js")).pipe((0,eY.Fg)(e=>
3new eJ.v(s=>{var t=e.installing||e.waiting||e.active;return t?"activated"===t.state?s.success(e):void t.addEventListener("statechange",t=>{"activated"===t.target.state&&s.success(e)}):s.error("Service worker registration does not exist")})),(0,eY.Fg)(s=>eJ.v.from(s.pushManager.getSubscription()).pipe((0,eY.Fg)(t=>t?eJ.v.just(t):eJ.v.from(s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:e}))))))}base64Encode(e){return e?cI.Buffer.from(e).toString("base64"):""}}cw.shared=(0,P.G)(e=>new cw(e));class cS{constructor(e){this.analytics=W._.shared(e),this.sessionId=eA.c.shared().sessionId}logBannerShown(){this.analytics.logEvent("show-request-permission",{sessionId:this.sessionId}).safeSubscribe()}logUserResponseToShowNotification(e){this.analytics.logEvent("user-response-to-permission-request",{sessionId:this.sessionId,permission:e}).safeSubscribe()}logNotificationUnavailabilityReason(e){this.analytics.logEvent("unavailable-web-notification",{sessionId:this.sessionId,reason:e}).safeSubscribe()}}cS.shared=(0,P.G)(e=>new cS(e));class cy{constructor(e){this.offering=cp.shared(e),this.eventLog=cS.shared(e),this.interceptor=cv.shared()}start(e){e.add(this.interceptor.requestPermissionIntent.safeSubscribe(()=>this.eventLog.logBannerShown())),e.add(this.offering.offeringResult.safeSubscribe(e=>{switch(e.options){case"not-supported":case"permission-denied":this.eventLog.logNotificationUnavailabilityReason(e.options);break;case"denied":case"granted":this.eventLog.logUserResponseToShowNotification(e.options)}}))}}cy.shared=(0,P.G)(e=>new cy(e));class cA{constructor(e){this.userId=e}start(e){e.add((0,D.z)([ch.shared(this.userId).available,cp.shared(this.userId).offer]).pipe((0,ea.p)(e=>{var[s,t]=e;return!s&&!!t}),(0,I.n)(()=>cp.shared(this.userId).postponeOffer().asObservable())).safeSubscribe())}}cA.shared=(0,P.G)(e=>new cA(e));class cT{logPWAAppLaunched(e){W._.shared(e).logEvent("pwa-launched",{"user-id":e}).safeSubscribe()}}cT.shared=(0,P.G)(()=>new cT);class cx{constructor(e){this.userId=e}start(e){e.add(L.T.shared().paramWithPath(["features","pwa-enabled"]).pipe((0,ea.p)(e=>e),(0,w.T)(()=>(function(){if("u"<typeof window)return!1;var e=window.matchMedia("(display-mode: standalone)").matches,s=!0===window.navigator.standalone;return e||s})()),(0,ea.p)(e=>e),(0,w.T)(()=>{var e=tN.w.shared("pwa-overlay-offering",this.userId);return cT.shared().logPWAAppLaunched(this.userId),e.store("pwa-installed",!0)}),(0,rD.y)()).safeSubscribe())}}cx.shared=(0,P.G)(e=>new cx(e));var cC=t(58246);class cF{getStoredPaymentMethods(){return cC.n8.shared().getStoredPaymentMethods().pipe((0,w.T)(e=>e.isSuccessful?e.value:[]))}}cF.shared=(0,P.G)(()=>new cF);class cD{constructor(){this.paymentMethods=cF.shared().getStoredPaymentMethods()}}cD.shared=(0,P.G)(()=>new cD);var ck=t(86487),cE="auto-buy-overlay",cj="interact-count",cR="last-shown-at",cO=[0,1,3,7,30];class cM extends t$.D{constructor(e){super(),this.userId=e;var s=T.T.shared().autoBuyOfferEnabled.pipe((0,I.n)(s=>{if(!s)return(0,S.of)(!1);var t=t2.n.shared(e).settings.pipe((0,w.T)(e=>e.enabled),(0,ev.F)()),r=t.pipe((0,g.s)(1)),a=t.pipe((0,w.T)(e=>!!e),(0,sv.S)((e,s)=>e||s,!1),(0,ev.F)()),i=tN.w.shared(cE,e),n=i.load(cR).asObservable(),d=i.load(cj).asObservable(),o=(0,D.z)([n,d]).pipe((0,I.n)(e=>{var[s,t]=e,r=null!=t?t:0;return r>4?(0,S.of)(!1):sr.E.shared().currentTime().pipe((0,eY.vV)(e=>{var t=cO[r];return Math.abs(e-(null!=s?s:0))/eF.b.day>=t}))}),(0,ev.F)());return(0,D.z)([q.e.shared(e).creditsPurchasesCount,t2.n.shared(e).autoBuyInPurchaseFormAvailable,r,cD.shared().paymentMethods.pipe((0,w.T)(e=>e.some(e=>!!e.rebill))),d]).pipe((0,I.n)(e=>{var[s,t,r,i,n]=e;return s<2||r||!i?(0,S.of)(!1):2===s&&t&&(null!=n?n:0)===0?(0,D.z)([a,o]).pipe((0,w.T)(e=>{var[s,t]=e;return!s&&t})):s<3?(0,S.of)(!1):ck.G.shared().visible.pipe((0,I.n)(e=>e?(0,D.z)([a,o]).pipe((0,w.T)(e=>{var[s,t]=e;return!s&&t})):(0,S.of)(!1)))}))}));this.canOffer=(0,K.h)(this.offeringResult.pipe((0,g.s)(1),(0,w.T)(()=>!1)),s.pipe((0,dv.Q)(this.offeringResult))).pipe((0,ev.F)(),(0,tw.t)({refCount:!0,bufferSize:1}))}start(){return eJ.v.defer(()=>sr.E.shared().currentTime().pipe((0,eY.Fg)(e=>tN.w.shared(cE,this.userId).store(cR,e).pipe((0,eY.AB)(eE.Q.success({}))))))}updateInteractCount(){return tN.w.shared(cE,this.userId).update(cj,e=>(null!=e?e:0)+1).pipe((0,eY.AB)(eE.Q.success()))}accept(){return this.updateInteractCount()}postpone(){return this.updateInteractCount()}}cM.shared=(0,P.G)(e=>new cM(e));var cG="auto-buy-overlay";class cB extends i3.M{constructor(e){super(cM.shared(e),()=>{var s,t,r;return(s=C.Y.shared().get(eg.A),t=new eJ.v(e=>{s.actions.addToQueue(cG,[{props:{onAutoBuyEnable:()=>
3e.success(eE.Q.success())},disableManualClose:!0}])}),r=s.store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)===cG&&(null==t?void 0:t.name)!==cG}),(0,w.T)(()=>eE.Q.failure("cancelled"))).toSingle(),(0,K.h)(t,r).toSingle()).pipe((0,eY.Fg)(s=>s.isSuccessful?cM.shared(e).acceptOffer():cM.shared(e).postponeOffer()),(0,eY.vV)(()=>void 0))})}}cB.shared=(0,P.G)(e=>new cB(e));var cP=t(7222),c_=t(22897),cz=t(85338),cN=t(47443),cL=t(83846),cq="state",cV=2*eF.b.second,cQ={expirationTime:null,showsCount:0,cooldownUntil:0,upgraded:!1,subscriptionPurchasedAt:null};function cU(e,s){if(!e||e.expirationTime!==s){var t;return Object.assign({},cQ,{expirationTime:s,subscriptionPurchasedAt:null!=(t=null==e?void 0:e.subscriptionPurchasedAt)?t:null})}return e}function cY(e){if(e){var s=(e.expiration.getTime()-e.lastRenewal.getTime())/eF.b.day;return Math.abs(s-30)<Math.abs(s-7)?cz.jB.month:cz.jB.week}}class cJ extends t$.D{constructor(e){super(),this.userId=e,this.persistence=tN.w.shared("payment-subscription-upgrade",e);var s=(0,D.z)([tW.i.shared(e).subscription.pipe((0,w.T)(cY),(0,ev.F)()),T.T.shared().subscriptionUpgrade.maxShowsWeeklySubscribers,T.T.shared().subscriptionUpgrade.maxShowsMonthlySubscribers]).pipe((0,w.T)(e=>{var[s,t,r]=e;return s===cz.jB.month?r:t})),t=q.e.shared(e).purchasedInApplication.pipe((0,ea.p)(e=>{var{invoice:s}=e;return!!s.subscription}),(0,I.n)(()=>sr.E.shared().currentTime().asObservable().pipe((0,g.s)(1),(0,I.n)(e=>this.mutateState(s=>Object.assign({},s,{subscriptionPurchasedAt:e})).asObservable()),(0,I.n)(()=>k.w)))),r=q.e.shared(e).purchasedInApplication.pipe((0,ea.p)(e=>{var s,t,{invoice:r}=e;return!r.subscription&&(null!=(s=null==(t=r.benefitsAmount)?void 0:t.messages)?s:0)>0}),(0,w.T)(()=>c_.z.SuccessTopUp)),a=ny.Q.shared().balanceRefillingResult.pipe((0,ea.p)(e=>{var s,t,r,{result:a,reason:i}=e;if(a.isSuccessful||"canceled"!==a.error.name)return!1;var n="messages"===(0,cN.dF)(i.name),d=null==(s=a.error)?void 0:s.selectedPackage,o=Object.keys((null==(t=a.error)||null==(t=t.selectedPackage)?void 0:t.benefitsAmount)||{}),u=null==d||null==(r=d.benefits)?void 0:r.some(e=>"subscription"===e.type),l=1===o.length&&"messages"===o[0]&&!u;return n||l}),(0,w.T)(()=>c_.z.TopUpClosing)),i=oU.u.shared(e).offeringResult.pipe((0,ea.p)(e=>{var{result:s,offer:t}=e;return"rejected"===s&&"chat"===t.reason}),(0,nC.c)(cV),(0,w.T)(()=>c_.z.TopUpClosing)),n=(0,K.h)(r,a,i).pipe((0,I.n)(t=>(0,D.z)([cL.H.shared(e).available,this.currentState().asObservable(),s,sr.E.shared().currentTime().asObservable(),T.T.shared().subscriptionUpgrade.delayAfterSubscriptionPurchase]).pipe((0,g.s)(1),(0,w.T)(e=>{var[s,r,a,i,n]=e;return!!(s&&!r.upgraded&&r.showsCount<a&&r.cooldownUntil<=i&&(!r.subscriptionPurchasedAt||i>=r.subscriptionPurchasedAt+n))&&t}))),(0,ea.p)(e=>!1!==e));this.canOffer=(0,K.h)(t,n,this.offeringResult.pipe((0,w.T)(()=>!1))).pipe((0,ev.F)(),(0,tw.t)({refCount:!0,bufferSize:1}))}start(e){return this.mutateState(e=>Object.assign({},e,{showsCount:e.showsCount+1})).pipe((0,eY.vV)(s=>eE.Q.success({name:e,showNumber:s.showsCount})))}accept(){return this.mutateState(e=>Object.assign({},e,{upgraded:!0,cooldownUntil:0})).pipe((0,eY.AB)(eE.Q.success()))}reject(){return(0,D.z)([sr.E.shared().currentTime().asObservable(),T.T.shared().subscriptionUpgrade.cooldown]).toSingle().pipe((0,eY.Fg)(e=>{var[s,t]=e;return this.mutateState(e=>Object.assign({},e,{cooldownUntil:s+t}))}),(0,eY.AB)(eE.Q.success()))}currentState(){return(0,D.z)([this.persistence.load(cq).asObservable(),tW.i.shared(this.userId).subscription]).toSingle().pipe((0,eY.vV)(e=>{var s,t,[r,a]=e;return cU(null!=r?r:void 0,null!=(s=null==a||null==(t=a.expiration)?void 0:t.getTime())?s:null)}))}mutateState(e){return tW.i.shared(this.userId).subscription.toSingle().pipe((0,eY.vV)(e=>{var s,t;return null!=(s=null==e||null==(t=e.expiration)?void 0:t.getTime())?s:null}),(0,eY.Fg)(s=>this.persistence.update(cq,t=>e(cU(t,s)))))}}cJ.shared=(0,P.G)(e=>new cJ(e));class cW extends i3.M{constructor(e){super(cJ.shared(e),e=>e,s=>(0,cP.e)(e,s).pipe((0,eY.Fg)(s=>s.isSuccessful?cJ.shared(e).acceptOffer():cJ.shared(e).rejectOffer()),(0,eY.vV)(()=>void 0)))}}cW.shared=(0,P.G)(e=>new cW(e));var cH=t(51773);class cX{start(e){e.add(new y.c(e=>{var s=()=>
3{e.next(void 0)};return l.A.on("command.presents-orders.open",s),()=>l.A.removeListener("command.presents-orders.open",s)}).pipe((0,I.n)(()=>(0,cH.O)())).safeSubscribe())}}cX.shared=(0,P.G)(()=>new cX);var cZ=t(93623),c$=t(99507);class cK{constructor(e){this.userId=e}start(e){var s=C.Y.shared().get(e5.A,this.userId).store.rxState(),t=ru.M.shared(this.userId).state,r=(0,D.z)([s,t]).pipe((0,w.T)(e=>e.every(e=>"idle"===e.status)),(0,ev.F)()),a=e=>rr.u.shared(this.userId).activeChats.pipe((0,w.T)(s=>0===s.length||1===s.length&&s[0]===e)),i=c$.z.shared(this.userId).balanceChanged.pipe((0,ea.p)(e=>{var s;return(null==(s=e.meta)?void 0:s.operation)==="credit"}),(0,w.T)(e=>e),(0,I.n)(e=>a(e.meta.senderId).pipe((0,g.s)(1),(0,ea.p)(e=>e),(0,w.T)(()=>({type:sW._.BonusesAccountBalanceCredited,payload:{credit:e.amount}})))));e.add((0,D.z)([T.T.shared().bonusesEnabled,p.Session.shared().userIsUsual,nD.t.shared().visible,r]).pipe((0,w.T)(e=>{var[s,t,r,a]=e;return s&&t&&!r&&a}),(0,ev.F)()).pipe((0,I.n)(e=>e?i:k.w)).safeSubscribe(e=>{sH.X.shared().notifyUser(e,sW.A.Normal)}));var n=c$.z.shared(this.userId).balanceChanged.pipe((0,ea.p)(e=>{var s;return(null==(s=e.meta)?void 0:s.operation)==="debit"}),(0,w.T)(e=>({type:sW._.BonusesAccountBalanceDebited,payload:{debit:e.amount}})));e.add((0,D.z)([T.T.shared().bonusesEnabled,M.f.shared(this.userId).userIsFeaturedMember]).pipe((0,I.n)(e=>{var[s,t]=e;return s&&t?n:k.w})).safeSubscribe(e=>{sH.X.shared().notifyUser(e,sW.A.Normal)}))}}cK.shared=(0,P.G)(e=>new cK(e));var c0=t(35327),c1=t(22508);class c5{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().bonusesEnabled,T.T.shared().cheersOnboardingBannerEnabled,el.j.shared().tab,el.j.shared().cta,M.f.shared(this.userId).userIsFeaturedMember]).pipe((0,w.T)(e=>{var[s,t,r,a,i]=e;
3return!i&&s&&!t&&"chat"===r&&("contacts-list"===a||"feed"===a||"profile"===a||"chat-menu"===a)}),(0,I.n)(e=>e?c1.T.shared(this.userId).status.pipe((0,w.T)(e=>!e.popupShown),(0,ea.p)(e=>e),(0,I.n)(()=>(0,c0.E)())):k.w)).safeSubscribe())}}c5.shared=(0,P.G)(e=>new c5(e));var c3=t(72548),c2=t(15621);class c8{constructor(e){this.userId=e}start(e){e.add(c3.En.shared(this.userId).offer.pipe((0,b.o)(),(0,ev.F)(ef())).safeSubscribe(e=>{c2.a.shared(this.userId).logCreditPackageBannerShown(e.attendeeId)})),e.add(c3.En.shared(this.userId).offeringResult.safeSubscribe(e=>{"rejected"===e.result?c2.a.shared(this.userId).logCreditPackageBannerRejected(e.offer.attendeeId):"postponed"===e.result?c2.a.shared(this.userId).logCreditPackageBannerPostponed(e.offer.attendeeId):"accepted"===e.result&&c2.a.shared(this.userId).logCreditPackageBannerAccepted(e.offer.attendeeId)}))}}c8.shared=(0,P.G)(e=>new c8(e));var c4=t(5365);class c6{start(e){e.add(ah.T.shared().googleTranslateApiKey.safeSubscribe(e=>{c4.r.shared().setApiKey(e)}))}}c6.shared=(0,P.G)(()=>new c6);var c9=t(75906),c7=t(87944);class he{constructor(e){this.userId=e}start(e){e.add(c9.r.shared().translationStatus.safeSubscribe(e=>{c7.E.shared(this.userId).logTranslationStatus(e)}))}}he.shared=(0,P.G)(e=>new he(e));var hs=t(91760);class ht{constructor(e){this.userId=e,this.localizations=hs.o.shared().getTexts("/texts/presents/names").pipe((0,eY.hr)()),this.newPresentsOrderEvent=(0,K.h)(t7.l.shared(this.userId,sE._j.Present).events.pipe((0,g.s)(1),(0,w.T)(e=>e.filter(e=>"added"===e.payload.action&&!e.stale)),(0,I.n)(e=>(0,S.of)(...e))),f.I.shared(this.userId).events("event.users.events.added").pipe((0,ea.p)(e=>{var s;return(null==(s=e.payload)?void 0:s.action)==="added"}))).pipe((0,I.n)(e=>{var s;if(!(null!=(s=e.payload)&&s["sender-id"])||!e.payload["recipient-id"])throw Error("Invalid event");return eJ.v.zip(this.localizations,this.getParticipants(e.payload["sender-id"],e.payload["recipient-id"])).pipe((0,eY.vV)(s=>{var[t,{sender:r,recipient:a}]=s;if(!e.payload||!e.payload.id||!e.payload.items||!e.payload.timestamp||!r||!a)throw Error("Invalid event");return{"event-id":e["event-id"],order:{id:e.payload.id,lastStatusUpdate:new Date(e.payload.timestamp),text:e.payload.text,presents:e.payload.items.map(e=>({title:t[e.group],iconPath:"/presents/goods/images/"+e.category+"-"+e.group,label:e.label,group:e.group,category:e.category})),recipient:a,sender:r,timestamp:e.payload.timestamp,status:"sending"}}}))}),(0,tw.t)(1)),this.canceledPresentsOrderEvent=(0,K.h)(t7.l.shared(this.userId,sE._j.Present).events.pipe((0,g.s)(1),(0,w.T)(e=>e.filter(e=>"canceled"===e.payload.action&&!e.stale)),(0,I.n)(e=>(0,S.of)(...e))),f.I.shared(this.userId).events("event.users.events.added").pipe((0,ea.p)(e=>{var s;return(null==(s=e.payload)?void 0:s.action)==="canceled"})),f.I.shared(this.userId).events("event.presents.orders.canceled").pipe((0,w.T)(e=>({"event-id":e["event-id"],payload:{"sender-id":e["sender-id"],"recipient-id":e["recipient-id"]}})))).pipe((0,I.n)(e=>{var s;if(!(null!=(s=e.payload)&&s["sender-id"])||!e.payload["recipient-id"])throw Error("Invalid event");return this.getParticipants(e.payload["sender-id"],e.payload["recipient-id"]).pipe((0,eY.vV)(s=>{var{sender:t,recipient:r}=s;return{"event-id":e["event-id"],sender:t,recipient:r}}))}),(0,tw.t)(1))}getParticipants(e,s){var t=a1.q.shared(e).data().pipe((0,w.T)(e=>e.value)).toSingle(),r=a1.q.shared(s).data().pipe((0,w.T)(e=>e.value)).toSingle();return eJ.v.zip(t,r).pipe((0,eY.vV)(e=>{var[s,t]=e;return{sender:s,recipient:t}}))}}ht.shared=(0,P.G)(e=>new ht(e));class hr{constructor(e){this.previousNewPresentDeliveryEventIsClosed=!0,this.userId=e}handleCanceledPresentsOrderEvent(e){var s,t;return sH.X.shared().notifyUser({type:sW._.PresentsOrderCanceled,payload:{senderName:(null==(s=e.sender)?void 0:s.name)||"",recipientName:(null==(t=e.recipient)?void 0:t.name)||""}},sW.A.Normal,()=>{e["event-id"]&&t7.l.shared(this.userId,sE._j.Present).read(e["event-id"]).safeSubscribe()})}handleNewPresentsOrderEvent(e){var s;return this.previousNewPresentDeliveryEventIsClosed?(this.previousNewPresentDeliveryEventIsClosed=!1,(s=e.order,new eJ.v(e=>{C.Y.shared().get(eg.A).actions.open("new-present-delivery",[{props:{orders:[s]}}]),l.A.once("event.overlay.new-present-delivery.closed",function(){e.success()})})).pipe((0,eY.ex)(()=>{this.previousNewPresentDeliveryEventIsClosed=!0}),(0,eY.Fg)(()=>t7.l.shared(this.userId,sE._j.Present).read(e["event-id"])))):t7.l.shared(this.userId,sE._j.Present).read(e["event-id"])}start(e){e.add(ht.shared(this.userId).newPresentsOrderEvent.pipe((0,I.n)(e=>this.handleNewPresentsOrderEvent(e))).safeSubscribe()),e.add(ht.shared(this.userId).canceledPresentsOrderEvent.safeSubscribe(e=>this.handleCanceledPresentsOrderEvent(e)))}}hr.shared=(0,P.G)(e=>new hr(e));var ha=t(32688),hi=t(96960);class hn{constructor(e){this.userId=e}start(e){e.add(p.Session.shared().userIsUsual.pipe((0,I.n)(e=>e?hi.q.shared().visible.pipe((0,ea.p)(e=>e),(0,g.s)(1),(0,I.n)(()=>ha.G.shared(this.userId).presentsOrdersRecommendations)):(0,S.of)(null))).safeSubscribe())}}hn.shared=(0,P.G)(e=>new hn(e));var hd=t(5190),ho=t(31424);class hu{constructor(e){this.userId=e}start(e){e.add(T.T.shared().transformChatRequestToMessageFromContactEnabled.pipe((0,I.n)(e=>e?t7.l.shared(this.userId,sE._j.ChatRequest).events:k.w)).safeSubscribe()),e.add(T.T.shared().transformChatRequestToMessageFromContactEnabled.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,b.o)(),(0,I.n)(e=>(0,D.z)([(0,S.of)(e),rG.n.shared(this.userId).userInContacts(e).toSingle()])),(0,ea.p)(e=>{var[s,t]=e;return!t}),(0,w.T)(e=>{var[s]=e;return s})):k.w),(0,I.n)(e=>this.getFakeEventForAttendee(e))).safeSubscribe(e=>{hd.m.shared(this.userId).addFakeContact(e)}
3))}generateFakeEventForAttendee(e,s){return{"event-id":Date.now(),"holder-id":this.userId,"user-id":e,type:"message",stale:!0,stack:0,timestamp:new Date().toISOString(),payload:{tag:(0,ho.w)(this.userId),text:s,meta:{},"sender-id":this.userId,"recipient-id":e}}}getFakeEventForAttendee(e){return t7.l.shared(this.userId,sE._j.ChatRequest).events.pipe((0,g.s)(1),(0,w.T)(s=>s.find(s=>s["user-id"]===e)),(0,w.T)(s=>s?Object.assign({},s,{type:"message",stack:0,stale:!0}):this.generateFakeEventForAttendee(e)))}}hu.shared=(0,P.G)(e=>new hu(e));var hl=t(18835),hc=t(9086),hh=t(54373),hp=t(58493),hv=t(47319),hm=t(67441);class hf{constructor(e){this.userId=e}start(e){e.add(T.T.shared().refreshCheerSetsAfterPurchaseEnabled.pipe((0,ea.p)(e=>e),(0,I.n)(()=>el.j.shared().chatAttendee),(0,I.n)(e=>q.e.shared(this.userId).purchasedInApplication.pipe((0,ev.F)(ef()),(0,w.T)(s=>({purchase:s,attendeeId:e}))))).safeSubscribe(e=>{var{purchase:s,attendeeId:t}=e;s&&hh.b.shared(this.userId).refreshAndInvalidate(t)})),e.add((0,K.h)(f.I.shared(this.userId).events("event.users.tags.set"),f.I.shared(this.userId).events("event.users.tags.unset")).pipe((0,ea.p)(e=>(null==e?void 0:e.tag)==="dialogs.known"||(null==e?void 0:e.tag)==="cheers.introduction"),(0,I.n)(()=>el.j.shared().chatAttendee.pipe((0,g.s)(1)))).safeSubscribe(e=>{hh.b.shared(this.userId).refreshAndInvalidate(e)})),e.add((0,K.h)(f.I.shared(this.userId).events("event.users.tags.set"),f.I.shared(this.userId).events("event.users.tags.unset")).pipe((0,ea.p)(e=>(null==e?void 0:e.tag)==="cheers.limits.exceeded"||(null==e?void 0:e.tag)==="bonuses.paid.services.enabled")).safeSubscribe(()=>{hh.b.shared(this.userId).refreshAndInvalidate(void 0)})),e.add(hm.U.shared(this.userId).status.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"vip"===t||"vip"===s}),(0,I.n)(()=>el.j.shared().chatAttendee.pipe((0,g.s)(1)))).safeSubscribe(e=>{hh.b.shared(this.userId).refreshAndInvalidate(e)})),e.add(to.N.shared().sendCheerIntent.pipe((0,I.n)(e=>{var{status:s,recipientId:t}=e;return s===tu.R.Delivered||s===tu.R.Failed?(0,S.of)(t):k.w})).safeSubscribe(e=>{hh.b.shared(this.userId).refreshAndInvalidate(e)})),e.add(T.T.shared().maskCheersEnabled.pipe((0,I.n)(e=>e?to.N.shared().sendCheerIntent.pipe((0,I.n)(e=>e.mask&&e.cheerName?(0,S.of)(e):k.w)):k.w)).safeSubscribe(e=>{nn.$.shared(e.recipientId).setFilter(s=>s.shortName!==e.cheerName)})),e.add(hp.v.shared(this.userId).admissionChanged.safeSubscribe(e=>{hh.b.shared(this.userId).refreshAndInvalidate(e.attendeeId)})),e.add(T.T.shared().maskCheersEnabled.pipe((0,I.n)(e=>{if(!e)return k.w;var s=ru.M.shared(this.userId).state.pipe((0,w.T)(e=>"speaking"===e.status)),t=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"speaking"===e.status));return(0,D.z)([t,s,el.j.shared().chatAttendee.pipe((0,b.o)(),(0,I.n)(e=>s8.R.shared(e).cachedPresenceStatus.pipe((0,I.n)(s=>(0,S.of)({attendeeId:e,presenceStatus:s})))))]).pipe((0,I.n)(e=>{var[s,t,{attendeeId:r,presenceStatus:a}]=e;return(0,S.of)({attendeeId:r,callIsActive:s||t,presenceStatus:a})}))}),(0,ev.F)(ef())).safeSubscribe(e=>{var{attendeeId:s,callIsActive:t,presenceStatus:r}=e;t&&"onlineViaMobile"!==r?nn.$.shared(s).clearFilter():nn.$.shared(s).setFilter(e=>!e.mask)}));var s=this.onLetterAdded.bind(this);hv.A.shared().addOnLetterAddedListener(s),e.add(()=>{hv.A.shared().removeOnLetterAddedListener(s)})}onLetterAdded(e){var s=e.attachments.some(e=>"cheer"===e.mediaType);this.userId===e.sender&&s&&hh.b.shared(this.userId).refreshAndInvalidate(e.recipient)}}hf.shared=(0,P.G)(e=>new hf(e));var hb=t(46120),hg=t(9684);class hI{constructor(e){this.userId=e}start(e){e.add(el.j.shared().chatAttendee.pipe((0,I.n)(e=>e?hg.B.shared(this.userId).available(e).pipe((0,I.n)(e=>e?new y.c(()=>{var e=new u.yU;return hb.U.shared(this.userId).start(e),e}):k.w)):k.w)).safeSubscribe())}}hI.shared=(0,P.G)(e=>new hI(e));var hw=t(40866),hS=()=>new eJ.v(e=>{C.Y.shared().get(eg.A).actions.open("call-feedback",[{props:{}}]),e.success()});class hy extends i3.M{constructor(e){super(hw.U3.shared(e),e=>e,hS)}}hy.shared=(0,P.G)(e=>new hy(e));var hA=t(11395);class hT{constructor(e){this.userId=e}start(e){e.add(hA.sM.shared(this.userId).offer.pipe((0,I.n)(e=>e?ro.J.shared(this.userId).callExists.pipe((0,I.n)(s=>s?this.isCallStartedFromOffer(e.recommendedId).pipe((0,I.n)(e=>e?k.w:hA.sM.shared(this.userId).postponeOffer())):k.w)):k.w)).safeSubscribe())}isCallStartedFromOffer(e){return ru.M.shared(this.userId).state.pipe((0,w.T)(e=>({callType:e.callType,calleeId:e.calleeId,cta:e.cta})),(0,ev.F)(ef()),(0,I.n)(s=>"call"===s.callType&&s.calleeId&&"post-communication-recommendation"===s.cta?rl.K.shared(this.userId).id(s.calleeId).asObservable().pipe((0,I.n)(s=>s&&s===e?(0,S.of)(!0):(0,S.of)(!1))):(0,S.of)(!1)))}}hT.shared=(0,P.G)(e=>new hT(e));class hx{constructor(e){this.userId=e}logCallFeedbackOffered(e){var s="short-call"===e.type?"short-call-feedback-offered":"long-call-feedback-offered";W._.shared(this.userId).logEvent(s,{attendeeId:e.attendeeId,source:e.source,cta:e.cta}).safeSubscribe()}
3logCallFeedbackAccepted(e,s){var t="short-call"===e.type?"short-call-feedback-accepted":"long-call-feedback-accepted";W._.shared(this.userId).logEvent(t,Object.assign({attendeeId:e.attendeeId,source:e.source,cta:e.cta},s)).safeSubscribe()}logCallFeedbackRejected(e){var s="short-call"===e.type?"short-call-feedback-rejected":"long-call-feedback-rejected";W._.shared(this.userId).logEvent(s,{attendeeId:e.attendeeId,source:e.source,cta:e.cta}).safeSubscribe()}}hx.shared=(0,P.G)(e=>new hx(e));class hC{constructor(e){this.userId=e}start(e){e.add(hw.U3.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result?hx.shared(this.userId).logCallFeedbackAccepted(e.offer,e.options):"rejected"===e.result&&hx.shared(this.userId).logCallFeedbackRejected(e.offer)})),e.add(hw.U3.shared(this.userId).offer.pipe((0,ev.F)(),(0,b.o)()).safeSubscribe(e=>{hx.shared(this.userId).logCallFeedbackOffered(e)}))}}hC.shared=(0,P.G)(e=>new hC(e));class hF{constructor(e){this.userId=e}start(e){e.add(uI.C.shared(this.userId).offer.pipe((0,I.n)(e=>e&&"purchase-onboarding-on-email-confirmation-offering"===e.type?nD.t.shared().visible.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s&&!t}),(0,I.n)(()=>uI.C.shared(this.userId).acceptOffer({type:"purchase-onboarding-on-email-confirmation-offering",options:void 0}))):k.w)).safeSubscribe())}}hF.shared=(0,P.G)(e=>new hF(e));var hD=t(27220),hk=t(99403);function hE(e,s,t,r,a,i,n){try{var d=e[i](n),o=d.value}catch(e){return void t(e)}d.done?s(o):Promise.resolve(o).then(r,a)}class hj{constructor(){this.deepARIsAvailableSubject=new Z.t(!1),this.deepARIsInitializedSubject=ne
3w Z.t(!1),this.deepARIsAvailable=this.deepARIsAvailableSubject.asObservable(),this.deepARIsInitialized=this.deepARIsInitializedSubject.asObservable()}loadDeepARWeb(){var e=this;return eJ.v.defer(()=>{var s;return eJ.v.from((s=function*(){return e.deepARWeb||(e.deepARWeb=yield t.e("3135").then(t.t.bind(t,31314,23))),e.deepARWeb},function(){var e=this,t=arguments;return new Promise(function(r,a){var i=s.apply(e,t);function n(e){hE(i,r,a,n,d,"next",e)}function d(e){hE(i,r,a,n,d,"throw",e)}n(void 0)})})())})}start(e){e.add(T.T.shared().deeparEnabled.pipe((0,I.n)(e=>e?this.loadDeepARWeb().pipe((0,eY.ex)(e=>{e.isDeepARSupported()&&(e.patchGetUserMedia(),e.patchMediaStream(),this.deepARIsAvailableSubject.next(!0))})):k.w)).safeSubscribe())}initialize(){return(0,D.z)([this.deepARIsAvailableSubject,this.deepARIsInitializedSubject]).toSingle().pipe((0,eY.Fg)(e=>{var[s,t]=e;if(!s||t)return eJ.v.just(!1);var r=L.T.shared().deepar,a=window.REVISION;return this.loadDeepARWeb().pipe((0,eY.ex)(e=>e.initDeepAR({apiKey:r["api-key"][window.location.hostname],sdkPath:"/"+a+r["sdk-path"],filtersPath:"/"+a+r["filters-path"]})),(0,eY.AB)(!0))}),(0,eY.ex)(e=>{this.deepARIsInitializedSubject.next(e)}))}deinitialize(){return this.deepARIsInitializedSubject.toSingle().pipe((0,eY.Fg)(e=>e?this.loadDeepARWeb().pipe((0,eY.ex)(e=>{e.unloadDeepAR()}),(0,eY.AB)(void 0)):eJ.v.just()),(0,eY.Zl)(()=>this.deepARIsInitializedSubject.next(!1)))}}hj.shared=(0,P.G)(()=>new hj);
3class hR{constructor(e){this.initializationCanceledSubject=new sp.B,this.userId=e,this.maskIsInitializedSubject=new Z.t(!1),this.maskIsAvailable=hj.shared().deepARIsAvailable.pipe((0,I.n)(e=>T.T.shared().masksEnabled.pipe((0,w.T)(s=>s&&e)))),this.maskIsInitialized=this.maskIsInitializedSubject.asObservable()}start(e){var s=this.maskIsAvailable.pipe((0,ev.F)(ef()),(0,I.n)(e=>e?k.w:this.deinitialize())).safeSubscribe();e.add(s),e.add(M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(e=>e?(0,D.z)([this.maskIsAvailable,ty.y.shared().active,this.maskIsInitialized]).pipe((0,w.T)(e=>{var[s,t,r]=e;return s&&t&&!r}),(0,ea.p)(e=>e),(0,I.n)(()=>this.initialize())):k.w)).safeSubscribe())}initialize(){return(0,D.z)([this.maskIsAvailable,this.maskIsInitialized]).pipe((0,g.s)(1),(0,I.n)(e=>{var[s,t]=e;return!s||t?k.w:hj.shared().initialize()}),(0,I.n)(()=>T.T.shared().masks.additionalInitialLoadingTime),(0,g.s)(1),(0,I.n)(e=>(0,im.O)(e)),(0,I.n)(()=>p.Session.shared().userId.pipe((0,I.n)(e=>e?ty.y.shared().filter.pipe((0,I.n)(e=>tC.LY.shared().load(e))):tC.LY.shared().load(tC.ji)))),(0,ee.M)(()=>this.maskIsInitializedSubject.next(!0)),(0,g.s)(1),(0,dv.Q)(this.initializationCanceledSubject))}deinitialize(){return this.maskIsInitialized.pipe((0,g.s)(1),(0,I.n)(e=>(e||this.initializationCanceledSubject.next(),tC.LY.shared().unload().pipe((0,ee.M)(()=>this.maskIsInitializedSubject.next(!1)),(0,I.n)(()=>hj.shared().deinitialize())))),(0,g.s)(1))}}hR.shared=(0,P.G)(e=>new hR(e));class hO{constructor(e){this.userId=e}start(e){e.add(hR.shared(this.userId).maskIsAvailable.pipe((0,I.n)(e=>e?p.Session.shared().userIsUsual:k.w),(0,I.n)(e=>{if(e)return k.w;var s=C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>e.status),(0,ev.F)(),(0,ep.Z)("idle"),(0,su.J)(),(0,w.T)(e=>{var[s,t]=e;return"idle"!==s&&"idle"===t})),t=ru.M.shared(this.userId).state.pipe((0,w.T)(e=>e.status),(0,ev.F)(),(0,ep.Z)("idle"),(0,su.J)(),(0,w.T)(e=>{var[s,t]=e;return"idle"!==s&&"idle"===t}));return(0,D.z)([s,t]).pipe((0,w.T)(e=>{var[s,t]=e;return s||t}),(0,I.n)(e=>e?ty.y.shared().unsetFilter().asObservable().pipe((0,I.n)(()=>hR.shared(this.userId).deinitialize())):k.w))})).safeSubscribe())}}hO.shared=(0,P.G)(e=>new hO(e));var hM=t(36713),hG=t(52850);class hB extends cn.Q{constructor(e){super("user.recommendations.videochat-beggin-stickers",e,s=>(0,B.p6)(B.jI.shared().users.recommendations["videochat-beggin-stickers"].get,e,s).pipe((0,eY.vV)(e=>{var s,{data:t,xhr:r}=e;return{data:t,ttl:(null==(s=(0,an.a)(r))?void 0:s.maxAge)||0}}))),this.userId=e}send(e,s,t){return(0,B.Yq)(B.jI.shared().users.actions["videochat.motivation.ready"].post,this.userId,{attendeeId:e,packName:s,stickerName:t}).pipe((0,eY.AB)(void 0))}}hB.shared=(0,P.G)(e=>new hB(e));class hP{constructor(e){this.getRecommended=e=>hB.shared(this.userId).data({select:e}).toSingle().pipe((0,eY.vV)(e=>e.users.map(e=>e["user-id"]))),this.userId=e}}hP.shared=(0,P.G)(e=>new hP(e));class h_{constructor(e){this.userId=e}logStickerAutoSent(e){W._.shared(this.userId).logEvent("mcs-sticker-auto-sent",{attendeeId:e}).safeSubscribe()}}h_.shared=(0,P.G)(e=>new h_(e));var hz=t(41488);class hN{constructor(e){this.userId=e}checkAttendeeAvailability(e){return uJ.L.shared(this.userId).videoPromoAllowed(e,"sticker").pipe((0,I.n)(s=>s?rd.N.shared(this.userId).callIsAvailable(e):(0,S.of)(!1)))}userIsAvailable(){return(0,D.z)([(0,hz.G)(),rr.u.shared(this.userId).activeChats]).pipe((0,w.T)(e=>{var[s,t]=e;return!s&&0===t.length}),(0,ev.F)())}start(e){e.add(T.T.shared().mcs.stickerAutoSend.enabled.pipe((0,I.n)(e=>e?A.M.shared(this.userId).initialized.pipe((0,ea.p)(Boolean)):k.w),(0,I.n)(()=>j.x.shared(this.userId).tags.pipe((0,w.T)(e=>!e.includes("videochat.beggin.stickers.automation.blocked")),(0,ea.p)(Boolean))),(0,I.n)(()=>(0,D.z)([T.T.shared().mcs.stickerAutoSend.delay.from,T.T.shared().mcs.stickerAutoSend.delay.to,T.T.shared().mcs.stickerAutoSend.recommendUsers,T.T.shared().mcs.stickerAutoSend.delayOnFail]).pipe((0,g.s)(1))),(0,I.n)(e=>{var[s,t,r,a]=e;return this.userIsAvailable().pipe((0,ep.Z)(!1),(0,su.J)(),(0,I.n)(e=>{var[i,n]=e;if(i||!n)return k.w;var d=Math.floor(Math.random()*(t-s+1))+s;return(0,im.O)(d,a).pipe((0,I.n)(()=>hP.shared(this.userId).getRecommended(r)),(0,ea.p)(e=>e.length>0),(0,I.n)(e=>(0,df.H)(e).pipe((0,dg.H)(e=>this.checkAttendeeAvailability(e).pipe((0,g.s)(1),(0,ea.p)(Boolean),(0,w.T)(()=>e))),(0,g.s)(1))),(0,I.n)(e=>hM.n.shared(this.userId).stickerPacks(e).pipe((0,I.n)(s=>{var t=s.find(e=>"videochat_beggin"===e.name);return t?(0,S.of)({attendeeId:e,pack:t}):k.w}))),(0,g.s)(1))}))}),(0,I.n)(e=>{var{attendeeId:s,pack:t}=e,r=(0,hG.w)(t.stickers);return hB.shared(this.userId).send(s,t.name,r.basename).pipe((0,eY.ex)(()=>{h_.shared(this.userId).logStickerAutoSent(s)}))})).safeSubscribe())}}hN.shared=(0,P.G)(e=>new hN(e));class hL{constructor(e){this.userId=e}start(e){e.add(rL.e.shared(this.userId).newMessage.pipe((0,I.n)(e=>{if(e.type===re.Go.Cheer&&e.recipient===this.userId){var s=e.content.basename.match(/\/cheers\/(\w+?)(_3d_ar|_ar_3d|_ar);/),t=s&&s[1];if(t&&tC.SY.includes(t))return ty.y.shared().setFilter(t)}return k.w})).safeSubscribe())}}hL.shared=(0,P.G)(e=>new hL(e));var hq=t(9224),hV=t(1873);class hQ{constructor(e){this.userId=e}start(e){e.add(hq.G.shared(this.userId).followedUser.pipe((0,tr.E)(hV.d.shared().visible),(0,ea.p)(e=>{var[,s]=e;return!s}),(0,w.T)(e=>{var[s]=e;return s}),(0,I.n)(e=>R.F.shared(e).profile.pipe((0,g.s)(1))),(0,w.T)(e=>{var s;return null==(s=e.value)?void 0:s.name}),(0,b.o)()).safeSubscribe(e=>{sH.X.shared().notifyUser({type:sW._.UserFollowed,payload:{userName:e}},sW.A.Low)}))}}hQ.shared=(0,P.G)(e=>new hQ(e));var hU=t(7862);class hY{constructor(e){this.userId=e}getStateOfActiveCallWithVideoInvite(){return ru.M.shared(this.userId).state.pipe((0,ev.F)((e,s)=>e.status===s.status),(0,ea.p)(e=>{var s;return"speaking"===e.status&&(null==(s=e.misc)?void 0:s.videoInvitation)}))}getCandidateInfo(e){return rl.K.shared(this.userId).id(e).pipe((0,eY.Fg)(e=>aP.V.getCandidateInfo(e)))}start(e){e.add(this.getStateOfActiveCallWithVideoInvite().pipe((0,I.n)(e=>eJ.v.zip(this.getCandidateInfo(e.participants[0]),e6.c.shared().profileId.toSingle()).pipe((0,eY.vV)(s=>[e,...s])))).safeSubscribe(e=>{var[s,t,r]=e;aP.V.shared().logEvent(r?"profile":"home","start","video_chat",{candidate_info:t,video_chat:{candidate_id:t.candidate_id,call_id:s.callId,chat_id:this.userId+":"+t.candidate_id,video_invitation_id:s.misc.videoInvitation}})})),e.add(this.getStateOfActiveCallWithVideoInvite().pipe((0,I.n)(e=>{var s=Date.now();return eJ.v.zip(this.getCandidateInfo(e.participants[0]),e6.c.shared().profileId.toSingle(),ru.M.shared(this.userId).events("end").toSingle()).pipe((0,eY.vV)(t=>[e,...t,Date.now()-s]))}
3)).safeSubscribe(e=>{var[s,t,r,a,i]=e,n=Math.round(i/eF.b.second);aP.V.shared().logEvent(r?"profile":"home","finish","video_chat",{candidate_info:t,video_chat:{candidate_id:t.candidate_id,call_id:s.callId,chat_id:this.userId+":"+t.candidate_id,video_invitation_id:s.misc.videoInvitation,duration:n,reason:a.reason}})})),e.add(ru.M.shared(this.userId).state.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"speaking"!==s.status&&"speaking"===t.status})).safeSubscribe(e=>{var s,t,[r,a]=e;hU.g.shared(this.userId).logCallStarted((null==(s=a.callerId)?void 0:s.toString())||"",(null==(t=a.calleeId)?void 0:t.toString())||"",a.cta)}))}}hY.shared=(0,P.G)(e=>new hY(e));class hJ{constructor(e){this.userId=e}logLocalTrackData(e){W._.shared(this.userId).logEvent(e.source+"-call-local-tracks",{data:e.data}).safeSubscribe()}}hJ.shared=(0,P.G)(e=>new hJ(e));var hW=10*eF.b.second;class hH{constructor(e){this.callLocalTracksData=null,this.userId=e,this.callEndedSubject=new sp.B}start(e){e.add(ru.M.shared(this.userId).callExists.pipe((0,I.n)(e=>e?(0,tx.Y)(hW).pipe((0,I.n)(()=>ru.M.shared(this.userId).state.pipe((0,g.s)(1),(0,ee.M)(e=>{this.callLocalTracksData||(this.callLocalTracksData={source:"mcs",data:[]}),this.callLocalTracksData.data.push({video:!!e.localTracks.video.length,audio:!!e.localTracks.audio.length,timestamp:Date.now()})}))),(0,dv.Q)(this.callEndedSubject)):k.w)).safeSubscribe()),e.add(C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,w.T)(e=>"connecting"===e.status||"speaking"===e.status?e.attendee:null),(0,ev.F)(),(0,I.n)(e=>{if(!e)return k.w;var s=new sf.I(this.userId,e);return(0,tx.Y)(hW).pipe((0,I.n)(()=>(0,D.z)([s.localVideoEnabled,s.hasLocalAudio,s.localAudioEnabled]).pipe((0,g.s)(1),(0,ee.M)(e=>{var[s,t,r]=e;this.callLocalTracksData||(this.callLocalTracksData={source:"cp",data:[]}),this.callLocalTracksData.data.push({video:s,audio:r&&t,timestamp:Date.now()})}))),(0,dv.Q)(this.callEndedSubject))})).safeSubscribe()),e.add(ru.M.shared(this.userId).state.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"idle"!==s.status&&"idle"===t.status})).safeSubscribe(()=>{this.callEndedSubject.next()})),e.add(C.Y.shared().get(e5.A,this.userId).store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"idle"!==s.status&&"idle"===t.status})).safeSubscribe(()=>{this.callEndedSubject.next()})),e.add(this.callEndedSubject.safeSubscribe(()=>{this.callLocalTracksData&&(hJ.shared(this.userId).logLocalTrackData(this.callLocalTracksData),this.callLocalTracksData=null)}))}}hH.shared=(0,P.G)(e=>new hH(e));var hX=t(81755),hZ=t(44853);class h${constructor(e){this.userId=e}start(e){e.add(hX.D.shared().data().pipe((0,g.s)(1)).safeSubscribe()),e.add(el.j.shared().chatAttendee.pipe((0,b.o)(),(0,I.n)(e=>hZ.n.shared(this.userId).data(e))).safeSubscribe()),e.add(oN.y.shared().data.pipe((0,b.o)(),(0,w.T)(e=>e.attendeeId),(0,ev.F)(),(0,I.n)(e=>hZ.n.shared(this.userId).data(e))).safeSubscribe())}}h$.shared=(0,P.G)(e=>new h$(e));class hK{constructor(e){this.userId=e}start(e){e.add(ue.bd.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>ur.v.shared(this.userId).unconfirmedPhoneNumber),(0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!!s&&!t}),(0,I.n)(()=>ue.bd.shared(this.userId).rejectOffer().asObservable())).safeSubscribe())}}hK.shared=(0,P.G)(e=>new hK(e));var h0=t(16938);class h1{constructor(e){this.userId=e}start(e){e.add(aG.Qx.shared(this.userId).chatRequests.pipe((0,w.T)(e=>e.every(e=>0===e.unreadEventsCount)),(0,ev.F)(),(0,ea.p)(e=>e)).safeSubscribe(()=>{l.A.emit("command.invite.sound.stop",!0)}))}}h1.shared=(0,P.G)(e=>new h1(e));var h5=t(95762);class h3{constructor(){this.isNavigationBackPreventingWasSet=!1,this.isNavigationBackPrevented=!1,this.popstateEventSubscription=null,this.setBackNavigationPrevented=()=>{this.isNavigationBackPrevented=!0},this.enableOneTimeBackNavigationPrevention=()=>{this.isNavigationBackPreventingWasSet||(h5.Z.shared().pushState({backNavigationPrevented:!0},document.title,window.location.href),this.isNavigationBackPreventingWasSet=!0,this.isNavigationBackPrevented=!1,this.popstateEventSubscription=h5.Z.shared().popstateEvent.pipe((0,ea.p)(e=>{var s;return null==(s=e.prevState)?void 0:s.backNavigationPrevented}),(0,ee.M)(this.setBackNavigationPrevented)).subscribe())},this.disableOneTimeBackNavigationPrevention=()=>{this.popstateEventSubscription&&(this.popstateEventSubscription.unsubscribe(),this.popstateEventSubscription=null),this.isNavigationBackPreventingWasSet&&!this.isNavigationBackPrevented&&window.history.back(),this.isNavigationBackPreventingWasSet=!1,this.isNavigationBackPrevented=!1}}start(e){e.add(p.Session.shared().userId.pipe((0,I.n)(e=>(0,D.z)([k.w])),(0,w.T)(e=>e.some(Boolean)),(0,ev.F)()).subscribe(e=>{e?this.enableOneTimeBackNavigationPrevention():this.disableOneTimeBackNavigationPrevention()}))}}h3.shared=(0,P.G)(()=>new h3);var h2=t(84805),h8=t(44999),h4=t(71079);class h6 extends t$.D{constructor(e){super(),this.offeredRateOrders=new Z.t([]),this.canOffer=p.Session.shared().userIsUsual.pipe((0,I.n)(s=>s?(0,D.z)([h8.l.shared().letterId.pipe((0,I.n)(s=>s?iJ.c.shared(e).get(s).pipe((0,w.T)(e=>e.value)):(0,S.of)(null)),(0,su.J)()),this.offeredRateOrders,aw.r.shared().name.pipe((0,w.T)(e=>!!e))]).pipe((0,I.n)(s=>{var[[t,r],a,i]=s;return!(null!=t&&t.presentAnswer)||t.sender===e||null!==r||t.presentOrderId&&a.includes(t.presentOrderId)||i?(0,S.of)(!1):oN.y.shared().data.pipe((0,w.T)(e=>{var s;return null!=(s=null==e?void 0:e.replyLetterId)?s:null}),(0,ep.Z)(null,null),(0,su.J)(),(0,w.T)(e=>{var[s,r]=e;return(null!==s||!r)&&!!t.presentOrderId&&t.presentOrderId}),(0,I.n)(s=>s?(0,D.z)([h4.B.shared(e).getItem(s),T.T.shared().presents.rateOrderDaysLimit]).pipe((0,w.T)(e=>{var[t,r]=e;return!(t.ratingScore||new Date().getTime()-t.lastStatusUpdate.getTime()>r*eF.b.day)&&{orderId:s,recipientId:t.recipientId}})):(0,S.of)(!1)))})):(0,S.of)(!1)),(0,h2.s)(()=>(0,im.O)(0)),(0,ev.F)(),(0,tw.t)(1))}start(e){return eJ.v.defer(()=>(this.offeredRateOrders.next([...this.offeredRateOrders.value,e.orderId]),eJ.v.just(eE.Q.success(e))))}}h6.shared=(0,P.G)(e=>new h6(e));var h9=t(27109);class h7 extends i3.M{constructor(e){super(h6.shared(e),e=>e,s=>{var t;let r;return t=s.orderId,(r=s.recipientId,new eJ.v(e=>{C.Y.shared().get(eg.A).actions.open("presents-order-rate-modal",[{props:{recipientId:r,onSubmit:s=>
3{s?e.success(eE.Q.success(s)):e.success(eE.Q.failure("canceled")),C.Y.shared().get(eg.A).actions.close("presents-order-rate-modal")}}}]),C.Y.shared().get(eg.A).store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)==="presents-order-rate-modal"&&(null==t?void 0:t.name)!==(null==s?void 0:s.name)})).toSingle().safeSubscribe(()=>e.success(eE.Q.failure("canceled")))})).pipe((0,eY.Fg)(s=>s.isSuccessful&&s.value?(0,h9.F)(e,t,s.value):eJ.v.just()))})}}h7.shared=(0,P.G)(e=>new h7(e));var pe=t(8456);class ps{start(e){e.add(h8.l.shared().visible.pipe((0,ea.p)(e=>e),(0,g.s)(1)).safeSubscribe(()=>{C.Y.shared().getActions(pe.A.actions).preload("letter")}))}}ps.shared=(0,P.G)(()=>new ps);var pt=t(98086),pr=t(81831),pa=t(4560),pi=3*eF.b.second;class pn{constructor(e){this.userId=e}start(e){e.add(T.T.shared().thirdPartySoftwareDetectionEnabled.pipe((0,g.s)(1),(0,pr.c)(pi),(0,I.n)(e=>e?(0,df.H)(t.e("2049").then(t.bind(t,8600))).pipe((0,I.n)(e=>ah.T.shared().product.name.pipe((0,I.n)(s=>e.ThirdPartySoftwareDetector.shared().detect(s).pipe((0,eY.vV)(e=>({thirdPartySoftwareIds:e,productDomain:s}))))))):k.w)).safeSubscribe(e=>{var{thirdPartySoftwareIds:s,productDomain:t}=e;s.length&&pa.k.shared(this.userId).logThirdPartySoftwareDetected({thirdPartySoftwareIds:s,productDomain:t})}))}}pn.shared=(0,P.G)(e=>new pn(e));var pd=t(62170),po=t(42402),pu=t(66342),pl=t(84321),pc=t(29015);class ph{constructor(e){this.userId=e}start(e){e.add(T.T.shared().mcs.callSpeechToText.buttonTooltipTtl.pipe((0,I.n)(e=>po.O.shared(this.userId).offer.pipe((0,I.n)(s=>s?(0,im.O)(e):k.w),(0,I.n)(()=>po.O.shared(this.userId).rejectOffer().asObservable())))).safeSubscribe()),e.add(po.O.shared(this.userId).offer.pipe((0,I.n)(e=>e?(0,K.h)(pu.A.shared().visible,pl.n.shared().visible).pipe((0,ea.p)(Boolean)):k.w),(0,I.n)(()=>po.O.shared(this.userId).rejectOffer().asObservable())).safeSubscribe()),e.add(po.O.shared(this.userId).offer.pipe((0,I.n)(e=>e?pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>{var{available:s,enabled:t}=e;return{available:s,enabled:t}}),(0,ev.F)(ef()),(0,I.n)(s=>s.available?(0,S.of)("welcome"===e&&s.enabled):pd.o.shared(this.userId).state.pipe((0,w.T)(s=>"info"===e?!(null!=s&&s.userEnabled):"welcome"===e&&(!s||(null==s?void 0:s.userEnabled)))))):k.w),(0,ev.F)(),(0,ea.p)(Boolean),(0,I.n)(()=>po.O.shared(this.userId).rejectOffer().asObservable())).safeSubscribe())}}ph.shared=(0,P.G)(e=>new ph(e));var pp=t(48733);class pv{constructor(e){this.userId=e}start(e){e.add(pp.T.shared(this.userId).offer.pipe((0,b.o)(),(0,I.n)(e=>{switch(e.translationType){case"speech-to-speech":return pc.xN.shared(this.userId).state.pipe((0,ea.p)(e=>e.enabled));case"speech-to-text":return pd.o.shared(this.userId).state.pipe((0,ea.p)(e=>!!(null!=e&&e.userEnabled)));default:return k.w}}),(0,I.n)(()=>pp.T.shared(this.userId).rejectOffer().asObservable())).safeSubscribe()),e.add(pp.T.shared(this.userId).offer.pipe((0,b.o)(),(0,I.n)(()=>pu.A.shared().visible),(0,ea.p)(Boolean),(0,I.n)(()=>pp.T.shared(this.userId).rejectOffer().asObservable())).safeSubscribe())}}pv.shared=(0,P.G)(e=>new pv(e));var pm=t(69386);class pf{constructor(e){this.userId=e}start(e){e.add(pm.g.shared(this.userId).offer.pipe((0,I.n)(e=>e&&"speech-to-text"===e.translationType?pd.o.shared(this.userId).state.pipe((0,ea.p)(e=>!(null!=e&&e.userEnabled))):k.w),(0,I.n)(()=>pm.g.shared(this.userId).rejectOffer().asObservable())).safeSubscribe())}}pf.shared=(0,P.G)(e=>new pf(e));class pb{constructor(e){this.userId=e}logSpeechToTextSettingsPopupShown(e){W._.shared(this.userId).logEvent("mcs-call-speech-to-text-settings-popup-shown",{callId:e}).safeSubscribe()}logSpeechToTextWelcomePopupShown(e){W._.shared(this.userId).logEvent("mcs-call-speech-to-text-welcome-popup-shown",{callId:e}).safeSubscribe()}logSpeechToTextMessage(e,s,t,r){W._.shared(this.userId).logEvent("mcs-call-speech-to-text-message",{callId:e,text:s,sender:t,recipient:r}).safeSubscribe()}logSpeechToTextLocaleChanged(e,s){W._.shared(this.userId).logEvent("mcs-call-speech-to-text-locale-changed",{callId:e,locale:s}).safeSubscribe()}logSpeechToTextStatusChanged(e,s,t){W._.shared(this.userId).logEvent("mcs-call-speech-to-text-status-changed",{callId:e,enabled:s,callType:t}).safeSubscribe()}}pb.shared=(0,P.G)(e=>new pb(e));var pg=t(43868);class pI{constructor(e){this.userId=e}start(e){e.add(T.T.shared().mcs.callSpeechToText.enabled.pipe((0,ev.F)(),(0,I.n)(e=>e?this.innerStart():k.w)).safeSubscribe())}innerStart(){return new y.c(()=>{var e=new u.yU,s=ru.M.shared(this.userId).state.pipe((0,w.T)(e=>"speaking"===e.status?e.callId:void 0)),t=pd.o.shared(this.userId).state,r=t.pipe((0,I.n)(e=>e?rl.K.shared(this.userId).id(e.attendeeId).asObservable():(0,S.of)(void 0)));return e.add(pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>e.available),(0,ev.F)(),(0,I.n)(e=>e?k.w:(0,D.z)([pu.A.shared().visible,t.pipe((0,b.o)())]).pipe((0,w.T)(e=>{var[s,t]=e;return[s,null==t?void 0:t.callId]}),(0,ev.F)(ef()),(0,ea.p)(e=>{var[s,t]=e;return s&&t})))).safeSubscribe(e=>{var[,s]=e;pb.shared(this.userId).logSpeechToTextSettingsPopupShown(s)})),e.add(pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>e.available),(0,ev.F)(),(0,I.n)(e=>e?k.w:(0,D.z)([pl.n.shared().visible,t.pipe((0,b.o)())]).pipe((0,w.T)(e=>{var[s,t]=e;return[s,null==t?void 0:t.callId]}),(0,ev.F)(ef()),(0,ea.p)(e=>{var[s,t]=e;return s&&t})))).safeSubscribe(e=>{var[,s]=e;pb.shared(this.userId).logSpeechToTextWelcomePopupShown(s)})),e.add(pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>e.available),(0,ev.F)(),(0,I.n)(e=>e?k.w:(0,D.z)([s.pipe((0,b.o)()),t.pipe((0,w.T)(e=>!!(null!=e&&e.userEnabled))),ru.M.shared(this.userId).state.pipe((0,w.T)(e=>e.callType))]).pipe((0,ev.F)(ef())))).safeSubscribe(e=>{var[s,t,r]=e;pb.shared(this.userId).logSpeechToTextStatusChanged(s,t,r)})),e.add(t.pipe((0,b.o)(),(0,w.T)(e=>[e.callId,e.userLocale]),(0,ev.F)(ef())).safeSubscribe(e=>{var[s,t]=e;pb.shared(this.userId).logSpeechToTextLocaleChanged(s,t)})),e.add(pd.o.shared(this.userId).messages.pipe((0,w.T)(e=>(0,pg.h)(e.filter(e=>e.isFinal),"id")),(0,su.J)(),(0,w.T)(e=>{var[s,t]=e;return function(e){if(!(null!=e&&e.length))return[];for(var s,t=arguments.length,r=Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];var i=r[r.length-1],n=r.length>0&&("function"==(s=typeof i)||"string"===s||"number"===s||"symbol"===s),d=n?i:void 0,o=n?r.slice(0,-1):r,u=e=>null==d?e:"function"==typeof d?d(e):e[d],l=o.reduce((e,s)=>s?e.concat(s.map(u)):e,[]);return l.length?e.filter(e=>!l.some(s=>s===u(e))):e.slice()}(t,s,e=>e.id)}),(0,ev.F)((e,s)=>{var t=e.map(e=>e.id).sort(),r=s.map(e=>e.id).sort();return ef()(t,r)}
3),(0,tr.E)(t,r)).safeSubscribe(e=>{var[s,t,r]=e;t&&r&&s.forEach(e=>{var s=e.userId===t.userId?this.userId:r,a=e.userId===t.userId?r:this.userId;pb.shared(this.userId).logSpeechToTextMessage(e.callId,e.text||"",s,a)})})),()=>{e.unsubscribe()}})}}pI.shared=(0,P.G)(e=>new pI(e));class pw{constructor(e){this.userId=e}logSpeechToSpeechStatusChanged(e,s){W._.shared(this.userId).logEvent("mcs-call-speech-to-speech-status-changed",{attendeeId:e,enabled:s}).safeSubscribe()}logSpeechToSpeechLocaleChanged(e,s){W._.shared(this.userId).logEvent("mcs-call-speech-to-speech-locale-changed",{attendeeId:e,locale:s}).safeSubscribe()}logSpeechToSpeechSettingsPopupShown(e){W._.shared(this.userId).logEvent("mcs-call-speech-to-speech-settings-popup-shown",{callId:e}).safeSubscribe()}logSpeechToSpeechWelcomePopupShown(e){W._.shared(this.userId).logEvent("mcs-call-speech-to-speech-welcome-popup-shown",{callId:e}).safeSubscribe()}}pw.shared=(0,P.G)(e=>new pw(e));class pS{constructor(e){this.userId=e}start(e){e.add(ru.M.shared(this.userId).state.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"speaking"!==s.status&&"speaking"===t.status}),(0,w.T)(e=>{var[,s]=e;return s.callId}),(0,ev.F)(),(0,I.n)(()=>pc.xN.shared(this.userId).state.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s.enabled!==t.enabled||t.enabled}),(0,w.T)(e=>{var[,s]=e;return s.enabled}),(0,ev.F)())),(0,I.n)(e=>pc.xN.shared(this.userId).participantProfiles.pipe((0,g.s)(1),(0,w.T)(s=>{var[t]=s.filter(e=>e.externalId!==this.userId).map(e=>e.externalId);return[t,e]})))).safeSubscribe(e=>{var[s,t]=e;pw.shared(this.userId).logSpeechToSpeechStatusChanged(s,t)})),e.add(pc.xN.shared(this.userId).state.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s.locale!==t.locale&&!!t.locale}),(0,w.T)(e=>{var[,s]=e;return s.locale}),(0,ev.F)(),(0,I.n)(e=>pc.xN.shared(this.userId).participantProfiles.pipe((0,g.s)(1),(0,w.T)(s=>{var[t]=s.filter(e=>e.externalId!==this.userId).map(e=>e.externalId);return[t,e]})))).safeSubscribe(e=>{var[s,t]=e;t&&pw.shared(this.userId).logSpeechToSpeechLocaleChanged(s,t)})),e.add(pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>e.available),(0,ev.F)(),(0,I.n)(e=>e?(0,D.z)([pu.A.shared().visible,pc.xN.shared(this.userId).state.pipe((0,b.o)())]).pipe((0,w.T)(e=>{var[s,t]=e;return[s,t.callId]}),(0,ev.F)(ef()),(0,ea.p)(e=>{var[s,t]=e;return s&&!!t}),(0,w.T)(e=>{var[,s]=e;return s})):k.w)).safeSubscribe(e=>{pw.shared(this.userId).logSpeechToSpeechSettingsPopupShown(e)})),e.add(pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>e.available),(0,ev.F)(),(0,I.n)(e=>e?(0,D.z)([pl.n.shared().visible,pc.xN.shared(this.userId).state.pipe((0,b.o)())]).pipe((0,w.T)(e=>{var[s,t]=e;return[s,t.callId]}),(0,ev.F)(ef()),(0,ea.p)(e=>{var[s,t]=e;return s&&!!t}),(0,w.T)(e=>{var[,s]=e;return s})):k.w)).safeSubscribe(e=>{pw.shared(this.userId).logSpeechToSpeechWelcomePopupShown(e)}))}}pS.shared=(0,P.G)(e=>new pS(e));class py{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().mcs.audioCall.enabled,T.T.shared().mcs.audioCall.techIssuesTtl,M.f.shared(this.userId).userIsFeaturedMember]).pipe((0,I.n)(e=>{var[s,t,r]=e;return!s||r?k.w:ru.M.shared(this.userId).callIsAudioOnly.pipe((0,ea.p)(Boolean),(0,I.n)(()=>pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>e.techIssues),(0,ev.F)(),(0,I.n)(e=>e?(0,im.O)(t).pipe((0,ee.M)(()=>{ru.M.shared(this.userId).leave({reason:"tech-issues"}),sH.X.shared().notifyUser({type:sW._.AudioCallError},sW.A.Normal)})):k.w))))})).safeSubscribe())}}py.shared=(0,P.G)(e=>new py(e));var pA=t(97645);class pT{constructor(e){this.userId=e}start(e){e.add((0,D.z)([pA.$.shared(this.userId).mood,T.T.shared().feelings.available,T.T.shared().defaultMoodForNewcomers]).pipe((0,I.n)(e=>{var[s,t,r]=e;return null===s||t.includes(s)?k.w:pA.$.shared(this.userId).setMood(r||"unknown")})).safeSubscribe())}}pT.shared=(0,P.G)(e=>new pT(e));var px=t(5666),pC=t(26578),pF=["supervisor","users-operator","credits-operator","agencies-operator","finance-operator","bonuses-operator","media-operator"];class pD{constructor(e){}getTimeouts(e,s,t){var r=new Date(e),a=Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0,0)+s,i=a-t;return e>a?{alert:i+eF.b.day-e,logout:a+eF.b.day-e}:e>i?{alert:0,logout:a-e}:{alert:i-e,logout:a-e}}notify(e,s){return(0,im.O)(e).pipe((0,ee.M)(()=>{sH.X.shared().notifyUser({type:sW._.ForceLogout,payload:{time:new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}},sW.A.High)}),(0,eP.u)(void 0))}logout(e){return(0,im.O)(e).pipe((0,ee.M)(()=>p.Session.shared().logout().safeSubscribe()),(0,eP.u)(void 0))}start(e){e.add(pC.t.shared().data.pipe((0,I.n)(e=>pF.every(s=>!e.includes(s))?k.w:(0,D.z)([T.T.shared().forceLogout.offset,T.T.shared().forceLogout.alertOffset,px.j.shared().currentTime()])),(0,E.W)(e=>(403===e.status&&p.Session.shared().logout().safeSubscribe(),k.w)),(0,I.n)(e=>{var[s,t,r]=e,{alert:a,logout:i}=this.getTimeouts(r,s,t);return(0,D.z)([this.notify(a,s),this.logout(i)])}),(0,g.s)(1)).safeSubscribe())}}pD.shared=(0,P.G)(e=>new pD(e));var pk=t(59307);class pE{constructor(){this.cheersAddedInLetter={}}start(e){e.add(new y.c(()=>
3{var e=this.onCheerAddedToLetter.bind(this),s=this.onCheerDeletedFromLetter.bind(this);return l.A.on("event.file.uploading.letters",e),l.A.on("event.upload.file.delete.letters",s),()=>{l.A.removeListener("event.file.uploading.letters",e),l.A.removeListener("event.upload.file.delete.letters",s)}}).safeSubscribe())}onCheerAddedToLetter(e){e.filter(e=>!!e.cheer).forEach(e=>{var{id:s,basename:t,attendee:r}=e;pk.v.shared().add(t,r),this.cheersAddedInLetter=Object.assign({},this.cheersAddedInLetter,{[s]:{basename:t,attendee:r}})})}onCheerDeletedFromLetter(e){var s=this.cheersAddedInLetter[e];s&&(pk.v.shared().delete(s.basename,s.attendee),delete this.cheersAddedInLetter[e])}}pE.shared=(0,P.G)(()=>new pE);class pj{start(e){e.add((0,eq.R)(window,"storage").pipe((0,ea.p)(e=>"logout"===e.key)).safeSubscribe(()=>{aT.a.shared().reloadPage()}))}}pj.shared=(0,P.G)(()=>new pj);var pR="free-limits-reached-unpaid-offering",pO="offered";class pM extends t$.D{constructor(e){super(),this.userId=e,this.canOffer=el.j.shared().chatAttendee.pipe((0,I.n)(e=>e?nn.$.shared(e).getLimitsForSet("common").pipe((0,I.n)(e=>!e.reached||e.paidServices?(0,S.of)(!1):sr.E.shared().currentTime().pipe((0,eY.Fg)(e=>tN.w.shared(pR,this.userId).load(pO).pipe((0,eY.vV)(s=>!s||e-s>15*eF.b.minute))))),(0,w.T)(s=>!!s&&e)):(0,S.of)(!1)),(0,ev.F)(),(0,tw.t)(1))}start(e){return eJ.v.just(eE.Q.success(e))}accept(){return sr.E.shared().currentTime().pipe((0,eY.Fg)(e=>tN.w.shared(pR,this.userId).store(pO,e).pipe((0,eY.AB)(eE.Q.success()))))}}pM.shared=(0,P.G)(e=>new pM(e));var pG="free-limits-reached-paid-offering",pB="offered";class pP extends t$.D{constructor(e){super(),this.userId=e,this.canOffer=el.j.shared().chatAttendee.pipe((0,I.n)(e=>e?nn.$.shared(e).getLimitsForSet("common").pipe((0,I.n)(e=>e.reached&&e.paidServices?sr.E.shared().currentTime().pipe((0,eY.Fg)(e=>tN.w.shared(pG,this.userId).load(pB).pipe((0,eY.vV)(s=>!s||e-s>15*eF.b.minute)))):(0,S.of)(!1)),(0,w.T)(s=>!!s&&e)):(0,S.of)(!1)),(0,ev.F)(),(0,tw.t)(1))}start(e){return eJ.v.just(eE.Q.success(e))}accept(){return sr.E.shared().currentTime().pipe((0,eY.Fg)(e=>tN.w.shared(pG,this.userId).store(pB,e).pipe((0,eY.AB)(eE.Q.success()))))}}pP.shared=(0,P.G)(e=>new pP(e));class p_ extends i2.y{constructor(e){super([{type:"cheers-limits-unpaid-reached-offering",offering:pM.shared(e)},{type:"cheers-limits-paid-reached-offering",offering:pP.shared(e)}])}}p_.shared=(0,P.G)(e=>new p_(e));var pz=t(3810);class pN extends i3.M{constructor(e){super(p_.shared(e),e=>e.canOffer,e=>this.notifyUser(e)),this.userId=e,this.cheersLimitsOffering=p_.shared(e)}notifyUser(e){return(e=>(0,D.z)([hp.v.shared(this.userId).admission(e).pipe((0,pz.E)("lockUntil")),R.F.shared(e).profile.pipe((0,w.T)(e=>{var s;return null==(s=e.value)?void 0:s.name}))]).pipe((0,w.T)(e=>{var[s,t]=e;return{date:s,name:t}})).toSingle())(e.offer).pipe((0,eY.Fg)(s=>{let t;var{date:r,name:a}=s;return r&&a?(t={date:r.toString(),name:a,offerType:e.type},new eJ.v(e=>{var s={"cheers-limits-paid-reached-offering":sW._.CheersLimitsAppliedPaid,"cheers-limits-unpaid-reached-offering":sW._.CheersLimitsAppliedUnpaid}[t.offerType];sH.X.shared().notifyUser({type:s,payload:{name:t.name,date:t.date}},sW.A.Normal),e.success(void 0)})):eJ.v.just()}),(0,eY.Fg)(()=>"cheers-limits-paid-reached-offering"===e.type?this.cheersLimitsOffering.acceptOffer({type:"cheers-limits-paid-reached-offering",options:void 0}):this.cheersLimitsOffering.acceptOffer({type:"cheers-limits-unpaid-reached-offering",options:void 0})),(0,eY.AB)(void 0))}}pN.shared=(0,P.G)(e=>new pN(e));var pL=t(4328),pq=t(81601);class pV{constructor(e){this.userId=e}start(e){e.add(dE.lU.shared(this.userId).offer.pipe((0,I.n)(e=>e?pq.$.shared().visible.pipe((0,ea.p)(Boolean),(0,g.s)(1)):k.w),(0,I.n)(()=>dE.lU.shared(this.userId).acceptOffer())).safeSubscribe())}}pV.shared=(0,P.G)(e=>new pV(e));var pQ=t(84115),pU=t(61476),pY=t(50225);class pJ{constructor(e){this.userId=e}logLimitsLifted(e){W._.shared(this.userId).logEvent("cheers-featuredmember-limits",{attendeeId:e,limits:!1}).safeSubscribe()}logLimitsReached(e){W._.shared(this.userId).logEvent("cheers-featuredmember-limits",{attendeeId:e,limits:!0}).safeSubscribe()}}pJ.shared=(0,P.G)(e=>new pJ(e));var pW=t(8924);class pH{constructor(e){this.userId=e}start(e){e.add(p_.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e),(0,I.n)(()=>el.j.shared().chatAttendee.pipe((0,b.o)(),(0,g.s)(1)))).safeSubscribe(e=>{pJ.shared(this.userId).logLimitsReached(e)})),e.add(pW.n5.shared(this.userId).offeringResult.safeSubscribe(e=>{"accepted"===e.result&&pJ.shared(this.userId).logLimitsLifted(e.options.attendeeId)}))}}pH.shared=(0,P.G)(e=>new pH(e));var pX=t(39012),pZ=t(90071);class p${constructor(e){this.userId=e}start(e){e.add(pX.O.shared(this.userId).presentRemovingIntent.safeSubscribe(e=>{var{receiverId:s,present:t,price:r}=e;pZ.x.shared(this.userId).logPresentRemoved(s,t,r)}))}}p$.shared=(0,P.G)(e=>new p$(e));var pK=t(26698),p0=t(33799),p1=t(23186),p5=t(49518),p3=t(93719),p2=t(56777);class p8{start(e){var s=(0,D.z)([p.Session.shared().userId.pipe((0,b.o)()),T.T.shared().winemback.apiHost,T.T.shared().winemback.websocketHost]).pipe((0,ea.p)(e=>{var[s,t,r]=e;return!!s&&!!t&&!!r}));e.add(s.safeSubscribe(e=>{var[s,t,r]=e;p0.V.shared().setHost(t),p1.R.shared(s).setHost(t),p2.J.shared(s).setHosts(t),p3.q.shared(s).setHosts(t,r)})),e.add(s.pipe((0,I.n)(e=>{var[s]=e;return new y.c(e=>{var t=new u.yU;return p5.L.shared(s).start(t),e.next(),()=>t.unsubscribe()})})).safeSubscribe()),e.add(s.pipe((0,I.n)(e=>{var[s]=e;return p5.L.shared(s).auth()})).safeSubscribe()),e.add((0,D.z)([T.T.shared().conciergeEnabled,T.T.shared().winembackPopupEnabled,T.T.shared().auraEnabled,s]).pipe((0,ea.p)(e=>{var[s,t,r]=e;return s||t||r}),(0,I.n)(e=>{var[s,t,r,[a]]=e;return new y.c(()=>(p3.q.shared(a).controlConnection(!0),()=>{p3.q.shared(a).controlConnection(!1)}))})).safeSubscribe()),e.add((0,D.z)([T.T.shared().conciergeEnabled,s]).pipe((0,ea.p)(e=>{var[s]=e;return s}),(0,I.n)(e=>{var[s,[t]]=e;return new y.c(()=>{var e=new u.yU;return p2.J.shared(t).start(e),()=>e.unsubscribe()})})).safeSubscribe()),e.add((0,D.z)([T.T.shared().winembackPopupEnabled,s]).pipe((0,ea.p)(e=>{var[s]=e;return s}),(0,I.n)(e=>{var[s,[t]]=e;return new y.c(()=>{var e=new u.yU;return p1.R.shared(t).start(e),()=>e.unsubscribe()})})).safeSubscribe())}}p8.shared=(0,P.G)(()=>new p8);var p4=t(10519),p6=t(58245);class p9 extends i3.M{constructor(e){super(p4.m.shared(e),()=>this.openPopup())}openPopup(){return(0,im.O)(0).toSingle().pipe((0,eY.Fg)(p6.y))}}p9.shared=(0,P.G)(e=>new p9(e));var p7=t(70444);class ve{constructor(e){this.userId=e}start(e){e.add(p7.S.shared(this.userId).offer.pipe((0,I.n)(e=>e?p7.S.shared(this.userId).canOffer.pipe((0,I.n)(e=>e?k.w:p7.S.shared(this.userId).postponeOffer())):k.w)).safeSubscribe()),e.add(p7.S.shared(this.userId).offer.pipe((0,I.n)(e=>{if(!(null!=e&&e.expiration))return k.w;var s=new Date(e.expiration).getTime()-Date.now();return s>0?(0,im.O)(s):(0,S.of)(null)}),(0,I.n)(()=>p7.S.shared(this.userId).postponeOffer())).safeSubscribe())}}ve.shared=(0,P.G)(e=>new ve(e));class vs{constructor(e){this.userId=e}start(e){e.add(p4.m.shared(this.userId).offer.pipe((0,I.n)(e=>{if(!(null!=e&&e.expiration))return k.w;var s=new Date(e.expiration).getTime()-Date.now();return s>0?(0,im.O)(s):(0,S.of)(null)}),(0,I.n)(()=>p4.m.shared(this.userId).postponeOffer())).safeSubscribe())}}vs.shared=(0,P.G)(e=>new vs(e));var vt=t(42475);class vr extends i3.M{constructor(e){super(vt.Nz.shared(e),()=>eJ.v.defer(()=>{var e=C.Y.shared().get(eg.A),s="first-purchase-bonus-popup",t=e.store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[t,r]=e;return(null==t?void 0:t.name)===s&&(null==r?void 0:r.name)!==s}),(0,eP.u)(void 0)),r=new eJ.v(t=>{e.actions.addToQueue(s,[{props:{onClose:()=>{e.actions.close(s),t.success()}},disableManualClose:!1}])});return(0,K.h)(r,t).toSingle()}).pipe((0,eY.Fg)(()=>vt.Nz.shared(e).acceptOffer()),(0,eY.AB)(void 0)))}}vr.shared=(0,P.G)(e=>new vr(e));var va="subscription-purchase-success-modal";class vi extends i3.M{constructor(e){super(t5.shared(e),e=>({transition:e}),s=>eJ.v.defer(()=>{var e=C.Y.shared().get(eg.A),t=e.store.rxState().pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return(null==s?void 0:s.name)===va&&(null==t?void 0:t.name)!==va}),(0,eP.u)(eE.Q.failure("closed"))),r=new eJ.v(t=>{e.actions.addToQueue(va,[{props:{transition:s.transition,subscription:s.subscription,benefitsAmount:s.benefitsAmount,onContinueButtonClick:()=>
3{t.success(eE.Q.success("continue")),e.actions.close(va)},onUpgradePrimeButtonClick:()=>{t.success(eE.Q.success("upgrade-prime")),e.actions.close(va)},onCloseButtonClick:()=>{t.success(eE.Q.failure("closed")),e.actions.close(va)}},disableManualClose:!0}])});return(0,K.h)(r.asObservable(),t).toSingle()}).pipe((0,eY.Fg)(s=>s.isSuccessful?t5.shared(e).acceptOffer(s.value):t5.shared(e).rejectOffer()),(0,eY.AB)(void 0)))}}vi.shared=(0,P.G)(e=>new vi(e));var vn=t(19156);class vd{logViewed(e){this.log(e,e=>{aP.V.shared().logEvent("subscription","view","purchase_success_modal",e)})}logCtaButtonClicked(e){this.log(e,e=>{aP.V.shared().logEvent("subscription","click","purchase_success_modal_cta",e)})}logCloseButtonClicked(e){this.log(e,e=>{aP.V.shared().logEvent("subscription","click","purchase_success_modal_close",e)})}logUpgradePrimeButtonClicked(e){this.log(e,e=>{aP.V.shared().logEvent("subscription","click","purchase_success_modal_upgrade_prime",e)})}log(e,s){(0,D.z)([T.T.shared().purchaseChooseSubscriptionPackageBadges,T.T.shared().primeVipPackagesEnabled]).pipe((0,g.s)(1)).safeSubscribe(t=>{var[r,a]=t;s(Object.assign({transition:e.transition},(0,vn.uv)(e.subscription.recurringPackage,r,a)))})}}vd.shared=(0,P.G)(()=>new vd);class vo{constructor(e){this.userId=e}start(e){var s=t5.shared(this.userId),t=vd.shared();e.add(s.offer.safeSubscribe(e=>{e&&t.logViewed(e)})),e.add(s.offeringResult.safeSubscribe(e=>{"accepted"===e.result?"upgrade-prime"===e.options?t.logUpgradePrimeButtonClicked(e.offer):t.logCtaButtonClicked(e.offer):"rejected"===e.result&&t.logCloseButtonClicked(e.offer)}))}}vo.shared=(0,P.G)(e=>new vo(e));class vu{constructor(e){this.userId=e}logPopupDisplayed(e){W._.shared(this.userId).logEvent("first-buy-thx-show",{showCount:e}).safeSubscribe()}logPopupClosed(){W._.shared(this.userId).logEvent("first-buy-thx-accepted",{}).safeSubscribe()}}vu.shared=(0,P.G)(e=>new vu(e));class vl{constructor(e){this.userId=e}start(e){var s=vt.Nz.shared(this.userId),t=vu.shared(this.userId);e.add(s.offer.safeSubscribe(e=>{e&&t.logPopupDisplayed(e.showCount)})),e.add(s.offeringResult.safeSubscribe(e=>{"accepted"===e.result&&t.logPopupClosed()}))}}vl.shared=(0,P.G)(e=>new vl(e));var vc=t(60954),vh=t(82082);class vp{constructor(e){this.userId=e}start(e){var s=vc.M.shared(this.userId),t=vh.L.shared();e.add(s.offeringResult.pipe((0,ee.M)(e=>{"postponed"===e.result&&e.offer.autoPostpone&&t.logPopupEligibilityViewed()})).safeSubscribe()),e.add(vc.M.shared(this.userId).offer.pipe((0,I.n)(e=>e&&!e.autoPostpone?aw.r.shared().name.pipe((0,ea.p)(e=>"string"==typeof e),(0,ea.p)(e=>"wheel-discount-popup"!==e),(0,ee.M)(e=>t.logPopupAppearedWhileOfferAvailable(e))):(0,S.of)(void 0))).safeSubscribe())}}vp.shared=(0,P.G)(e=>new vp(e));var vv=t(88263),vm=t(1346),vf="chat-with-non-contacts-recommendations";class vb extends i3.M{constructor(e){super(vv.Z.shared(e),s=>{var t,r,{autoPostpone:a}=s,i=vv.Z.shared(e);return a?i.postponeOffer().pipe((0,eY.AB)(void 0)):(t=C.Y.shared().get(eg.A),r=new eJ.v(e=>{t.actions.addToQueue(vf,[{props:{onClose:s=>{t.actions.close(vf),e.success(eE.Q.success({freeUserCards:s}))}}}])}).pipe((0,eY.Fg)(e=>{if(e.isSuccessful){var s,{freeUserCards:t}=e.value;return 0<t.filter(e=>e.optimisticMessageSent).length?eJ.v.defer(()=>{var e=t.filter(e=>e.optimisticMessageSent).reduce((e,s)=>s.matchPercentage>e.matchPercentage?s:e);return(0,nd.Z)(e.ownerId,void 0,"non-contacts-recommendations"),eJ.v.just()}).pipe((0,eY.AB)(eE.Q.success({freeUserCards:t}))):(s=t.map(e=>e.ownerId),(0,D.z)([p.Session.shared().userId.pipe((0,b.o)()),T.T.shared().chatWithNonContactsRecommendations.freeUsersCount]).toSingle().pipe((0,eY.Fg)(e=>{var[t,r]=e;return s.length<r?eJ.v.just(void 0):(0,df.H)(s).pipe((0,dg.H)(e=>uW.T.shared(t).wink(e,"users.examined").pipe((0,eY.Ow)(eF.b.second/2),(0,eY.ZC)(()=>eJ.v.just(void 0))).asObservable()),(0,vm.H)()).toSingle().pipe((0,eY.AB)(void 0),(0,eY.ZC)(()=>eJ.v.just(void 0)))}))).pipe((0,eY.AB)(eE.Q.failure("canceled")))}return eJ.v.just(eE.Q.failure("failure"))})),p.Session.shared().userId.pipe((0,b.o)()).toSingle().pipe((0,eY.Fg)(e=>q.e.shared(e).requestOnetimeBuyerOffer().pipe((0,eY.Fg)(e=>e.isSuccessful?r:eJ.v.just(eE.Q.failure("failure"))))))).pipe((0,eY.Fg)(e=>e.isSuccessful?i.acceptOffer():i.rejectOffer()),(0,eY.AB)(void 0))})}}vb.shared=(0,P.G)(e=>new vb(e));var vg=t(20955);class vI{constructor(e){this.userId=e}start(e){var s=vv.Z.shared(this.userId),t=vg.N.shared();e.add(s.offeringResult.pipe((0,ee.M)(e=>{"postponed"===e.result&&e.offer.autoPostpone&&t.logPopupEligibilityViewed()})).safeSubscribe())}}vI.shared=(0,P.G)(e=>new vI(e));var vw=t(95238),vS=t(95051),vy=["mystery-gifts-game","mystery-gifts-terms"];class vA{constructor(e){this.userId=e}start(e){e.add((0,D.z)([ro.J.shared(this.userId).status,vS.xn.shared(this.userId).mysteryGiftIsPlaying]).pipe((0,ee.M)(e=>{var[s,t]=e;
3"idle"===s||t||vy.forEach(e=>{C.Y.shared().get(eg.A).actions.close(e)})})).safeSubscribe())}}vA.shared=(0,P.G)(e=>new vA(e));var vT=t(24387),vx=t(7071);class vC{constructor(e){}start(e){e.add(lQ.P.shared().deepLink.pipe((0,g.s)(1),(0,I.n)(e=>"confirm-subscription-cancellation"===e.type&&e.args.reason?p.Session.shared().userId.pipe((0,b.o)()).toSingle().pipe((0,eY.Fg)(e=>tW.i.shared(e).confirmCancelSubscription().pipe((0,eY.ex)(s=>{s.isSuccessful?(0,vx._)(e,!0):"failure"===s.error&&sH.X.shared().notifyUser({type:sW._.SubscriptionCancellationError},sW.A.Normal)})))):k.w)).safeSubscribe())}}vC.shared=(0,P.G)(e=>new vC(e));class vF{constructor(e){this.userId=e}start(e){e.add(lQ.P.shared().deepLink.pipe((0,g.s)(1),(0,I.n)(e=>"non-recurring-subscription"===e.type?q.e.shared(this.userId).hasActiveSubscription.toSingle().pipe((0,eY.Fg)(s=>s?eJ.v.just():(0,ux.Y)({name:e2.N.NonRecurringSubscriptionOpener,previousSubscriptionAmount:e.args.previousSubscriptionAmount}))):k.w)).safeSubscribe())}}vF.shared=(0,P.G)(e=>new vF(e));class vD{constructor(e){this.userId=e}start(e){e.add(rn.N.shared(this.userId).blockedUsers.safeSubscribe(e=>{e.forEach(e=>{l.A.emit("command.invite.remove",e)})}))}}vD.shared=(0,P.G)(e=>new vD(e));class vk{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().mcs.callSpeechToText.enabled,T.T.shared().mcs.callSpeechToText.autoEnable]).pipe((0,I.n)(e=>{var[s,t]=e;return s&&t?pd.o.shared(this.userId).state.pipe((0,ea.p)(e=>!!(null!=e&&e.callId)),(0,ev.F)((e,s)=>!!(null!=s&&s.callId)&&(null==e?void 0:e.callId)===(null==s?void 0:s.callId)),(0,w.T)(e=>!(null!=e&&e.userEnabled)&&(null==e?void 0:e.userLocale)!==(null==e?void 0:e.attendeeLocale))):(0,S.of)(!1)}),(0,ea.p)(Boolean)).safeSubscribe(()=>{pd.o.shared(this.userId).setEnabled(!0)}))}}vk.shared=(0,P.G)(e=>new vk(e));class vE{start(e){e.add(T.T.shared().mcs.callSpeechToSpeech.autoEnableByAttendee.pipe((0,I.n)(e=>e?this.innerStart():k.w)).safeSubscribe()),e.add(T.T.shared().mcs.audioCall.enabled.pipe((0,ea.p)(e=>e),(0,I.n)(()=>(0,D.z)([ru.M.shared(this.userId).state.pipe((0,w.T)(e=>"voiceonly"===e.callType&&"speaking"===e.status),(0,ev.F)()),ru.M.shared(this.userId).attendeeId.pipe((0,I.n)(e=>e?rl.K.shared(this.userId).id(e).asObservable():(0,S.of)(void 0))),pc.xN.shared(this.userId).state])),(0,I.n)(e=>{var[s,t,r]=e;return s&&t?uJ.L.shared(this.userId).audioCallOldFlow(t).pipe((0,w.T)(e=>e||r.attendeeLocale&&r.locale!==r.attendeeLocale)):k.w}),(0,ev.F)(),(0,ea.p)(Boolean)).safeSubscribe(()=>{pc.xN.shared(this.userId).setEnabled(!0)}))}innerStart(){return new y.c(()=>{var e=new u.yU;return e.add(pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>[e.enabled,e.callId]),(0,ev.F)((e,s)=>e[0]&&e[1]===s[1]),(0,I.n)(e=>{var[s]=e;return s?(0,S.of)(!1):pc.xN.shared(this.userId).state.pipe((0,w.T)(e=>[e.attendeeStartTranslate,e.available,e.callId]),(0,ea.p)(e=>{var[s,t]=e;return s&&t}),(0,ev.F)(ef()),(0,eP.u)(!0))}),(0,ea.p)(Boolean)).safeSubscribe(()=>{pc.xN.shared(this.userId).setEnabled(!0)})),()=>{e.unsubscribe()}})}constructor(e){this.userId=e}}vE.shared=(0,P.G)(e=>new vE(e));var vj=t(99954);class vR{constructor(e){this.userId=e}start(e){e.add(hm.U.shared(this.userId).status.pipe((0,ea.p)(e=>null!==e&&"regular"!==e)).safeSubscribe(()=>{vj.w.shared(this.userId).refresh()})),e.add(hm.U.shared(this.userId).substatus.pipe((0,eV.i)(1)).safeSubscribe(()=>{vj.w.shared(this.userId).refresh()}))}}vR.shared=(0,P.G)(e=>new vR(e));var vO=t(90515);class vM{constructor(e){this.userId=e}start(e){e.add(hm.U.shared(this.userId).tasks.pipe((0,ea.p)(e=>null!==e),(0,I.n)(e=>{var s=Date.now(),t=new Date(e.endDate).getTime()-s;return t>eF.b.day?k.w:t>0?(0,im.O)(t):(0,S.of)(null)}),(0,I.n)(()=>vO.Z.shared(this.userId).createTasks())).safeSubscribe())}}vM.shared=(0,P.G)(e=>new vM(e));class vG{constructor(){this.visible=(0,S.of)(!1)}}vG.shared=(0,P.G)(()=>new vG);var vB=t(59562);class vP{constructor(e){this.userId=e}start(e){var s=(0,D.z)([vG.shared().visible,nD.t.shared().visible]).pipe((0,w.T)(e=>{var[s,t]=e;return!s&&!t}),(0,ev.F)()),t=f.I.shared(this.userId).events("event.users.loyalty.tasks.completed"),r=f.I.shared(this.userId).events("event.users.loyalty.tasks.completed.all");e.add(s.pipe((0,I.n)(e=>e?t:k.w)).safeSubscribe(e=>{e.tasks.map(e=>({id:(0,vB.A)(),type:e.type,current:e.current,count:e.count,interactionType:e["interaction-type"],reward:e.reward}
3)).forEach(e=>sH.X.shared().notifyUser({type:sW._.LoyaltyTaskCompleted,payload:e},sW.A.Normal))})),e.add(s.pipe((0,I.n)(e=>e?r:k.w)).safeSubscribe(e=>{sH.X.shared().notifyUser({type:sW._.LoyaltyAllTasksCompleted,payload:e.reward},sW.A.Normal)}))}}vP.shared=(0,P.G)(e=>new vP(e));var v_=t(16556);class vz extends i3.M{constructor(e){super(v_.p.shared(e),()=>vz.showAnnounce())}static showAnnounce(){return eJ.v.defer(()=>(C.Y.shared().get(eg.A).actions.open("loyalty-tasks-announce-overlay",[{props:{}}]),eJ.v.just()))}}vz.shared=(0,P.G)(e=>new vz(e));var vN="stickers.limits.exceeded";class vL{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().stickersEnabled,T.T.shared().supportedStickersPacks]).pipe((0,w.T)(e=>{var[s,t]=e;return s&&t.includes("vip")}),(0,I.n)(e=>e?hm.U.shared(this.userId).status.pipe((0,su.J)(),(0,ee.M)(e=>{var[s,t]=e;("vip-freeze"===s||"premium"===s)&&"vip"===t&&hM.n.shared(this.userId).refresh()}),(0,pr.c)(hM.p)):(0,S.of)())).safeSubscribe()),e.add(T.T.shared().stickersEnabled.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,b.o)(),(0,I.n)(e=>sj.P.shared(this.userId).tags(e).pipe((0,su.J)(),(0,ee.M)(e=>{var[s,t]=e;(null==s?void 0:s.includes(vN))!==t.includes(vN)&&hM.n.shared(this.userId).refresh()})))):(0,S.of)())).safeSubscribe()),e.add(f.I.shared(this.userId).events("stickers.tasks.updated").pipe((0,ea.p)(e=>e["user-id"]===this.userId&&"4.0.done"===e.instance.state)).safeSubscribe(()=>{hM.n.shared(this.userId).refresh()}))}}vL.shared=(0,P.G)(e=>new vL(e));var vq=t(83056);class vV{constructor(e){this.userId=e}start(e){e.add(T.T.shared().sumSubVerificationFlowEnabled.pipe((0,I.n)(e=>e?vq.q.shared(this.userId).status.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s!==t&&"confirmed"===t||"confirming"===t}),(0,ee.M)(()=>{aK.o.shared(this.userId).refresh()})):k.w)).safeSubscribe())}}vV.shared=(0,P.G)(e=>new vV(e));class vQ{constructor(e){this.userId=e}start(e){e.add(e6.c.shared().profileId.pipe((0,b.o)(),(0,I.n)(e=>this.shouldUnblockUser(e).asObservable().pipe((0,w.T)(s=>s?e:null))),(0,b.o)(),(0,I.n)(e=>rn.N.shared(this.userId).unblockUser(e))).safeSubscribe(()=>{aT.a.shared().reloadPage()}))}shouldUnblockUser(e){return sj.P.shared(this.userId).tags(e).toSingle().pipe((0,eY.Fg)(s=>s.includes("blocked")||s.includes("reported")||s.includes("suspended")?eJ.v.just(!1):rn.N.shared(this.userId).blockedUsers.toSingle().pipe((0,eY.vV)(s=>s.includes(e)))))}}vQ.shared=(0,P.G)(e=>new vQ(e));var vU=t(19983);class vY{constructor(e){this.userId=e}start(e){e.add(lQ.P.shared().deepLink.pipe((0,g.s)(1),(0,I.n)(e=>"identity-verification"===e.type?(0,D.z)([vq.q.shared(this.userId).status,M.f.shared(this.userId).userIsFeaturedMember]).pipe((0,g.s)(1),(0,I.n)(e=>{var[s,t]=e;return"limit-reached"===s?(0,vU.Zk)():t||"confirmed"!==s?(0,vU.q5)():k.w})):k.w)).safeSubscribe())}}vY.shared=(0,P.G)(e=>new vY(e));var vJ=t(6924);class vW{constructor(e){this.userId=e}logAutoAcceptOfferingRejected(){W._.shared(this.userId).logEvent("mcs-audio-call-autoaccept-blocked",{}).safeSubscribe()}logAutoAcceptOfferingAccepted(e){W._.shared(this.userId).logEvent("mcs-audio-call-autoaccept-accepted",{attendeeId:e}).safeSubscribe()}}vW.shared=(0,P.G)(e=>new vW(e));class vH{constructor(e){this.userId=e}start(e){e.add(vJ.F.shared(this.userId).offeringResult.safeSubscribe(e=>{"rejected"===e.result&&"declined"===e.options&&vW.shared(this.userId).logAutoAcceptOfferingRejected()})),e.add(vJ.F.shared(this.userId).offeringResult.safeSubscribe(e=>{if("accepted"===e.result){var s=e.options.attendeeId;vW.shared(this.userId).logAutoAcceptOfferingAccepted(s)}}))}}vH.shared=(0,P.G)(e=>new vH(e));var vX=t(98464),vZ=t(16095),v$=t(83707);class vK{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().subscriptionRenewalEnabled,T.T.shared().cancelSubscriptionOfferEnabled]).pipe((0,w.T)(e=>{var[s,t]=e;return s||t}),(0,ev.F)(),(0,I.n)(e=>e?lQ.P.shared().deepLink:k.w),(0,I.n)(e=>"subscription-renewal"!==e.type?k.w:eW.r.shared().focusState.pipe((0,ea.p)(e=>"focused"===e),(0,g.s)(1))),(0,I.n)(()=>q.e.shared(this.userId).canOfferDiscountedResubscription.pipe((0,g.s)(1),(0,I.n)(e=>e?vX.u.shared(this.userId).renewalPackage.pipe((0,g.s)(1),(0,I.n)(e=>e?(0,vZ.s)(e,"email").pipe((0,eY.Fg)(s=>"accepted"===s?vX.u.shared(this.userId).renew(e):eJ.v.just(void 0))):k.w)):(0,v$.G)(this.userId))))).safeSubscribe())}}vK.shared=(0,P.G)(e=>new vK(e));var v0=t(40961);class v1{constructor(e){this.userId=e}start(e){e.add(T.T.shared().retrySubscriptionPaymentEnabled.pipe((0,I.n)(e=>e?lQ.P.shared().deepLink:k.w),(0,ea.p)(e=>"retry-subscription-payment"===e.type),(0,I.n)(()=>tW.i.shared(this.userId).retrySubscriptionPaymentFailed),(0,g.s)(1),(0,I.n)(e=>{var s={name:e?e2.N.RetrySubscriptionPayment:e2.N.RetrySubscriptionPaymentFallback};return v0.J.shared().refillBalance(s,"subscription")})).safeSubscribe())}}v1.shared=(0,P.G)(e=>new v1(e));var v5=t(39500),v3=t(17232);class v2{constructor(e){this.userId=e}start(e){e.add(iK.g.shared().deepLink.pipe((0,ea.p)(e=>"subscription-upgrade"===e.type),(0,I.n)(()=>v5.$.shared(this.userId).status),(0,ea.p)(e=>e===v3.T.Essential||e===v3.T.PrePrime),(0,g.s)(1),(0,I.n)(()=>(0,cP.e)(this.userId,{name:c_.z.DeepLink}))).safeSubscribe())}}v2.shared=(0,P.G)(e=>new v2(e));var v8=()=>p.Session.shared().userId.pipe((0,b.o)(),(0,w.T)(e=>{l.A.emit("command.profile.more-about-me.edit",e,!0)})).toSingle(),v4=t(69725);class v6{constructor(e){this.userId=e}start(e){e.add(this.userIsPrepromoter().pipe((0,I.n)(()=>vq.q.shared(this.userId).status),(0,ea.p)((e,s)=>0===s||"confirmed"===e),(0,I.n)(e=>"confirmed"===e?T.T.shared().voiceVerificationEnabled.toSingle().pipe((0,eY.Fg)(e=>e?(0,vU.Gl)().pipe((0,eY.Fg)(()=>this.waitUntilVoiceVerificationClosed())):eJ.v.just()),(0,eY.Fg)(()=>this.notify()),(0,eY.Fg)(()=>
3v8())):"limit-reached"===e||"unsuccessful"===e?eJ.v.just():"confirming"===e?(0,vU.q5)().pipe((0,eY.Fg)(()=>this.notify()),(0,eY.Fg)(()=>v8())):(0,vU.q5)().pipe((0,eY.Fg)(()=>this.waitUntilVerificationClosed()),(0,eY.Fg)(()=>this.notify()),(0,eY.Fg)(()=>v8())))).safeSubscribe())}userIsPrepromoter(){return M.f.shared(this.userId).userIsPrepromoter.pipe((0,ea.p)(e=>!!e),(0,w.T)(()=>void 0),(0,g.s)(1))}waitUntilVoiceVerificationClosed(){return v4.v.shared().history.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s.includes(vU.vH)&&!t.includes(vU.vH)}),(0,w.T)(()=>void 0)).toSingle()}waitUntilVerificationClosed(){return v4.v.shared().history.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return s.includes(vU.Vq)&&!t.includes(vU.Vq)}),(0,w.T)(()=>void 0)).toSingle()}notify(){return eJ.v.defer(()=>(sH.X.shared().notifyUser({type:sW._.ProfileUnderReview},sW.A.High),eJ.v.just()))}}v6.shared=(0,P.G)(e=>new v6(e));var v9=t(56004);class v7{constructor(e){this.userId=e}logNotificationShown(e){W._.shared(this.userId).logEvent("call-unavailable-notification-shown",{attendeeId:e}).safeSubscribe()}}v7.shared=(0,P.G)(e=>new v7(e));class me{constructor(e){this.userId=e}start(e){e.add(v9.A.shared(this.userId).state.pipe((0,ev.F)(ef())).safeSubscribe(e=>{e.visible&&v7.shared(this.userId).logNotificationShown(e.attendeeId)}))}}me.shared=(0,P.G)(e=>new me(e));var ms=["recents","favorites","calls-section-contacts","calls-section-recommendations"];class mt{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().callsSection.enabled,T.T.shared().callsSection.variant.pipe((0,w.T)(li.C))]).pipe((0,w.T)(e=>{var[s,t]=e;return s&&t}),(0,ev.F)(),(0,I.n)(e=>e?ru.M.shared(this.userId).bothCallTypesUnavailable.pipe((0,ea.p)(e=>{var{cta:s}=e;return ms.includes(s)}),(0,I.n)(e=>{var s;return(s=e.attendeeId,R.F.shared(s).cachedProfile.pipe((0,g.s)(1),(0,w.T)(e=>{var t;return(null==(t=e.value)?void 0:t.name)||s}))).pipe((0,w.T)(s=>({attendeeId:e.attendeeId,name:s})))})):k.w)).safeSubscribe(e=>{var{name:s}=e;sH.X.shared().notifyUser({type:sW._.VideoOrAudioCallTemporaryUnavailable,payload:{name:s}},sW.A.Normal)}))}}mt.shared=(0,P.G)(e=>new mt(e));var mr=t(33668),ma=t(47606);class mi{constructor(e){this.userId=e}start(e){e.add(ma.v.shared().promotedCheerSentIntent.safeSubscribe(e=>{td._.shared(this.userId).logPromotedCheerSent({attendeeId:e.attendeeId,cheerName:e.cheerN
3ame,promotingMessageTag:e.promotingMessageTag,promotingMessageType:e.promotingMessageType,promotionTimer:e.timeout/eF.b.second})}))}}mi.shared=(0,P.G)(e=>new mi(e));var mn={event:"wb.overlay.purchase.open",invoke:function(e){for(var s=arguments.length,t=Array(s>1?s-1:0),r=1;r<s;r++)t[r-1]=arguments[r];return l.A.emit("overlay","purchase",...t)}},md={event:"wb.overlay.email-confirmation-remind.open",invoke:function(e){for(var s=arguments.length,t=Array(s>1?s-1:0),r=1;r<s;r++)t[r-1]=arguments[r];return l.A.emit("overlay","email-confirmation-remind",...t)}},mo={event:"wb.overlay.overlay-email-subscriptions.open",invoke:function(e){for(var s=arguments.length,t=Array(s>1?s-1:0),r=1;r<s;r++)t[r-1]=arguments[r];return l.A.emit("overlay","overlay-email-subscriptions",...t)}},mu={event:"wb.chat.open",invoke:function(e){for(var s=arguments.length,t=Array(s>1?s-1:0),r=1;r<s;r++)t[r-1]=arguments[r];return(0,nd.Z)(...t)}},ml={event:"wb.chat.close",invoke:e=>(0,nd.v)().safeSubscribe()},mc={event:"wb.user.profile.unhide",invoke:e=>{sI.E.shared(e).setPresentInFeed(!0).safeSubscribe()}},mh={event:"wb.overlay.close",invoke:function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return l.A.emit("command.overlay.close",...s)}},mp={event:"wb.page.search.open",invoke:function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return l.A.emit("command.page.open","search",...s)}};class mv{constructor(){this.commands=[mh,mp],this.authorizedCommands=[mn,md,mo,mu,ml,mc]}start(e){e.add((0,K.h)(...this.commands.map(e=>{var{event:s,invoke:t}=e;return(0,$.E)(s).pipe((0,ee.M)(e=>t(...e)))})).safeSubscribe()),e.add(p.Session.shared().userId.pipe((0,b.o)(),(0,I.n)(e=>(0,K.h)(...this.authorizedCommands.map(s=>{var{event:t,invoke:r}=s;return(0,$.E)(t).pipe((0,ee.M)(s=>r(e,...s)))})))).safeSubscribe())}}mv.shared=(0,P.G)(()=>new mv);var mm=t(4004),mf=t(43793),mb=t(29455);class mg{constructor(e){this.userId=e}start(e){e.add(mm.H.shared(this.userId).animations.safeSubscribe(e=>{mf.z.shared(this.userId).add(e)})),e.add(mb.k.shared(this.userId).animations.safeSubscribe(e=>{mf.z.shared(this.userId).add(e)}))}}mg.shared=(0,P.G)(e=>new mg(e));var mI=t(728),mw=t(76595),mS=t(42960);class my{constructor(e){this.userId=e}start(e){e.add(mS.k.shared(this.userId).step.pipe((0,ea.p)(e=>"result"===e),(0,I.n)(()=>el.j.shared().chatAttendee.toSingle().pipe((0,eY.Fg)(e=>e?el.j.shared().chatAttendee.pipe((0,ea.p)(e=>!e),(0,eP.u)(void 0)).toSingle():aw.r.shared().name.toSingle().pipe((0,eY.Fg)(e=>e?aw.r.shared().name.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"mingle"!==s&&!t}),(0,eP.u)(void 0)).toSingle():eJ.v.just())))))).safeSubscribe(()=>{C.Y.shared().get(eg.A).actions.open("mingle",[{props:{}}])}))}}my.shared=(0,P.G)(e=>new my(e));var mA=t(35967);class mT{constructor(e){this.userId=e}start(e){var s=uN.B.shared(this.userId).state.pipe((0,w.T)(e=>e.incomingCalls[0]),(0,w.T)(e=>(null==e?void 0:e.callType)==="voiceonly"),(0,ev.F)());e.add(M.f.shared(this.userId).userIsFeaturedMember.pipe((0,I.n)(e=>e?(0,D.z)([s,ru.M.shared(this.userId).callIsAudioOnly]).pipe((0,I.n)(e=>{var[s,t]=e;return t?uL.G.shared().localize("/call","active-audio-call-title").pipe((0,eY.vV)(e=>["\uD83D\uDD34 "+e,"⚪ "+e])):s?uL.G.shared().localize("/call","incoming-audio-call-title").pipe((0,eY.vV)(e=>["\uD83D\uDFE2 "+e,"⚪ "+e])):(0,S.of)(null)}),(0,ev.F)(e0()),(0,ee.M)(e=>{e&&!this.originalTitle&&(this.originalTitle=mA.y.shared().title),!e&&this.originalTitle&&(mA.y.shared().title=this.originalTitle,this.originalTitle=void 0)}),(0,I.n)(e=>e?(0,im.O)(0,eF.b.second).pipe((0,w.T)(s=>e[s%e.length]),(0,ee.M)(e=>{mA.y.shared().title=e})):k.w)):k.w)).safeSubscribe())}}mT.shared=(0,P.G)(e=>new mT(e));var mx=t(10621);class mC{constructor(e){this.userId=e}start(e){e.add(mS.k.shared(this.userId).step.safeSubscribe(e=>{"progress"===e&&l.A.emit("event.mingle.started"),"result"===e&&l.A.emit("event.mingle.finished")})),e.add((0,D.z)([mS.k.shared(this.userId).step,p.Session.shared().userIsUsual,C.Y.shared().get(eg.A).store.rxState().pipe((0,su.J)())]).pipe((0,ev.F)(mx.L)).safeSubscribe(e=>{var s,[t,r,[a,i]]=e,n=(null==a?void 0:a.name)==="mingle"&&(null==i?void 0:i.name)!=="mingle",d=(null==i?void 0:i.name)==="purchase"&&(null==i||null==(s=i.params)?void 0:s[0])==="mingle";
3n&&!d&&"progress"!==t&&"welcome"!==t&&"result"!==t&&(r||"search-form"===t||"mode-selection"===t)&&mS.k.shared(this.userId).setStep("welcome")})),e.add(mS.k.shared(this.userId).mingle.pipe((0,su.J)()).safeSubscribe(e=>{var[s,t]=e;s.active&&!t.active&&mS.k.shared(this.userId).setStep("result")})),e.add(mS.k.shared(this.userId).mingle.toSingle().safeSubscribe(e=>{e.active&&mS.k.shared(this.userId).setStep("progress")}))}}mC.shared=(0,P.G)(e=>new mC(e));var mF=t(65877);class mD{constructor(e){this.userId=e}handleOnChatChange(e,s){return el.j.shared().chatAttendee.pipe((0,I.n)(t=>t!==e?s():k.w))}handleOnCall(e){return ro.J.shared(this.userId).status.pipe((0,w.T)(e=>"idle"!==e),(0,ev.F)(),(0,I.n)(s=>s?e():k.w))}start(e){var s=mF.v.shared(this.userId);e.add(s.offer.pipe((0,I.n)(e=>e&&("post-call-send-cheer-banner-offering"===e.type||"milestone-send-cheer-banner-offering"===e.type||"birthday-send-cheer-banner-offering"===e.type)?this.handleOnChatChange(e.offer.attendeeId,()=>s.postponeOffer({type:e.type,options:void 0})):k.w)).safeSubscribe()),e.add(s.offer.pipe((0,I.n)(e=>e&&("post-call-send-cheer-banner-offering"===e.type||"milestone-send-cheer-banner-offering"===e.type||"birthday-send-cheer-banner-offering"===e.type)?this.handleOnCall(()=>s.postponeOffer({type:e.type,options:void 0})):k.w)).safeSubscribe())}}mD.shared=(0,P.G)(e=>new mD(e));class mk{start(e){e.add(aw.r.shared().name.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return"welcome-email"===s&&"welcome-email"!==t})).safeSubscribe(()=>{l.A.emit("command.voice-message-recorder.reset")})),e.add(new y.c(e=>{var s=()=>{e.next()};return l.A.sync("popup.state.changed.smiles-introductory",s),l.A.sync("popup.state.changed.attachment-introductory",s),l.A.sync("command.production.letter.cover.set",s),()=>{l.A.removeListener("popup.state.changed.smiles-introductory",s),l.A.removeListener("popup.state.changed.attachment-introductory",s),l.A.removeListener("command.production.letter.cover.set",s)}}).safeSubscribe(()=>{l.A.emit("command.voice-message-recorder.reset")}))}}mk.shared=(0,P.G)(()=>new mk);var mE=t(32524);class mj{start(e){e.add(lQ.P.shared().deepLink.pipe((0,ea.p)(e=>"subscription-settings"===e.type),(0,I.n)(()=>p.Session.shared().userId.pipe((0,b.o)()))).safeSubscribe(e=>{(0,mE.r)(e)}))}}mj.shared=(0,P.G)(()=>new mj);var mR=t(72678);class mO{start(e){e.add(G.s.shared().passwordChanged.safeSubscribe(()=>{sH.X.shared().notifyUser({type:sW._.UserPasswordChanged,payload:{}},sW.A.Low)}))}}mO.shared=(0,P.G)(()=>new mO);var mM=t(36264),mG=t(64608);class mB{constructor(e){this.userId=e}start(e){e.add(u2.r.shared(this.userId).offeringResult.pipe((0,ep.Z)(null),(0,I.n)(e=>{var s,t=!!e&&"accepted"===e.result&&(null==(s=e.offer)?void 0:s.cta)==="registration";return mS.k.shared(this.userId).mingle.pipe((0,ev.F)((e,s)=>e.active===s.active),(0,su.J)(),(0,I.n)(e=>{var[s,t]=e;if(t.active&&!s.active){var r=Array.from({length:10},(e,s)=>s).map(e=>uL.G.shared().localize("dialogs/mingle","message",{key:e}).asObservable());return(0,db.y)(...r).pipe((0,I.n)(e=>{var s,r=Object.values(null!=(s=t.texts)?s:{}),a=e.some(e=>r.includes(e));return(0,S.of)([!0,t,a])}))}return!1===t.active&&s.active?(0,S.of)([!1,t,!1]):(0,S.of)(null)}),(0,ee.M)(e=>{if(null!==e){var[s,r,a]=e;s?mG.A.shared(this.userId).logStartMingle(t,a):mG.A.shared(this.userId).logStopMingle(r)}}))})).safeSubscribe()),e.add(a_.X.shared(this.userId).newInvite.pipe((0,ea.p)(e=>!!(null!=e&&e.mingle)),(0,tr.E)(T.T.shared().limitedMingleEnabled),(0,ee.M)(e=>{var[s,t]=e;mG.A.shared(this.userId).logMingleReceived(t)})).safeSubscribe())}}mB.shared=(0,P.G)(e=>new mB(e));class mP{constructor(e){this.userId=e}start(e){e.add((0,D.z)([el.j.shared().tab,el.j.shared().cta,el.j.shared().chatAttendee.pipe((0,ea.p)(e=>!!e),(0,ev.F)())]).pipe((0,nF.B)(50),(0,ev.F)(mx.L)).safeSubscribe(e=>{var[s,t,r]=e;"chat"===s&&r&&nh.a.shared(this.userId).logChatOpened(r,t)}))}}mP.shared=(0,P.G)(e=>new mP(e));var m_=t(84891),mz=t(42897);class mN{tryToClose(){m_.I.shared().visible.pipe((0,g.s)(1)).subscribe(e=>{e&&(0,mz.Y)()})}start(e){e.add(new y.c(()=>(l.A.sync("event.sidebar.concierge.opened",this.tryToClose),()=>{l.A.removeListener("event.sidebar.concierge.opened",this.tryToClose)})).safeSubscribe())}}mN.shared=(0,P.G)(()=>new mN);class mL{constructor(e){this.userId=e}trackFullPageCallModeChanged(e){W._.shared(this.userId).logEvent("mcs-full-page-call-mode-changed",{minimized:e}).safeSubscribe()}}mL.shared=(0,P.G)(e=>new mL(e));var mq=t(6455);class mV{constructor(e){this.userId=e}start(e){e.add(mq.z.shared().minimized.pipe((0,eV.i)(1)).safeSubscribe(e=>mL.shared(this.userId).trackFullPageCallModeChanged(e)))}}mV.shared=(0,P.G)(e=>new mV(e));var mQ=t(72915),mU=t(99223),mY=t(78102);class mJ{normalize(e){var s;return null!=(s=({"read-unanswered":"read_and_unanswered",all:"all",unread:"unread",unanswered:"unanswered_freem"})[e])?s:"all"}getInboxPageSource(e){return"profile"===e?"profile":"search"===e?"search_results":"other"}start(e){e.add(mQ.d.shared().visible.pipe((0,ea.p)(e=>e),(0,I.n)(()=>p.Session.shared().userId.pipe((0,I.n)(e=>e?M.f.shared(e).userIsFeaturedMember:(0,S.of)(!1)))),(0,I.n)(e=>mY.D.shared().history.pipe((0,g.s)(1),(0,w.T)(s=>({isFeaturedMember:e,historyPages:s}))))).safeSubscribe(e=>{var{isFeaturedMember:s,historyPages:t}=e;mU.Y.shared().logLettersView(s?"unanswered_freem":"all");var r=(null==t?void 0:t.length)>0?t[t.length-1]:void 0,a=this.getInboxPageSource(null==r?void 0:r.hash);mU.Y.shared().logLettersInboxPageView(a)})),e.add(new y.c(e=>{var s=s=>{e.next(s)};return l.A.sync("event.inbox.tab.changed",s),()=>{l.A.removeListener("event.inbox.tab.changed",s)}}).subscribe(e=>{var s=this.normalize(e);mU.Y.shared().logLettersClick(s),mU.Y.shared().logLettersView(s)}))}}mJ.shared=(0,P.G)(()=>new mJ);class mW{constructor(e){this.userId=e}start(e){var s=tz.y.shared("dialogs-themes-notifier-timers",this.userId),t=pL.Q.shared(this.userId),r=el.j.shared().chatAttendee.pipe((0,I.n)(e=>
3e?t.theme(e).pipe((0,I.n)(t=>t?k.w:s.load(e).asObservable().pipe((0,I.n)(t=>t?s.clear(e):k.w)))):k.w));e.add(t.themeExpired.pipe((0,I.n)(e=>s.store(e,!0))).safeSubscribe()),e.add(T.T.shared().dialogsThemesEnabled.pipe((0,I.n)(e=>e?r:k.w)).safeSubscribe(()=>{sH.X.shared().notifyUser({type:sW._.DialogsThemesDefaultThemeApplied},sW.A.Normal)}))}}mW.shared=(0,P.G)(e=>new mW(e));class mH{constructor(e){this.userId=e}start(e){e.add(new y.c(e=>{var s=()=>{e.next(void 0)};return l.A.sync("popup.opened.complain-area-popup",s),()=>{l.A.removeListener("popup.opened.complain-area-popup",s)}}).safeSubscribe(()=>{nh.a.shared(this.userId).logChatClick("Actions")}))}}mH.shared=(0,P.G)(e=>new mH(e));var mX=t(13970);class mZ{constructor(e){this.userId=e}start(e){e.add(e6.c.shared().profileId.pipe((0,I.n)(e=>e&&this.userId!==e?M.f.shared(e).userIsFeaturedMember.pipe((0,g.s)(1),(0,ea.p)(e=>e),(0,I.n)(()=>(0,eq.R)(document,"scroll").pipe((0,w.T)(()=>(window.scrollY||document.documentElement.scrollTop)+window.innerHeight>=document.documentElement.scrollHeight),(0,ea.p)(e=>e),(0,g.s)(1),(0,w.T)(()=>e)))):k.w)).safeSubscribe(e=>{e&&mX.e.shared().logProfilePageEndReachedView(e)}))}}mZ.shared=(0,P.G)(e=>new mZ(e));class m${constructor(e){this.userId=e}start(e){e.add(e6.c.shared().profileId.pipe((0,I.n)(e=>{if(!e)return k.w;var s=(0,D.z)([R.F.shared(e).profile.pipe((0,g.s)(1)),rn.N.shared(this.userId).blockedUsers]).pipe((0,w.T)(s=>{var[t,r]=s;return{profileId:e,profileResult:t,blockedUsers:r}}));return e===this.userId?s:(0,S.of)(null).pipe((0,pr.c)(200),(0,I.n)(()=>s))})).safeSubscribe(e=>{var{profileId:s,profileResult:t,blockedUsers:r}=e,a=t.isSuccessful?t.value:null,i=this.profileIsSuspended(s,t,r);l.A.emit("profile:init",s,{suspended:i}),i?l.A.emit("event.profile.suspended",s):l.A.emit("event.profile.not-suspended",s),a&&l.A.emit("event.profile.ready",a),i||l.A.emit("command.profile.preferences.load",s)}))}profileIsSuspended(e,s,t){return!!t.includes(e)||!s.isSuccessful&&("suspended"===s.error||"not-found"===s.error)}}m$.shared=(0,P.G)(e=>new m$(e));class mK{constructor(e){this.userId=e}start(e){e.add(T.T.shared().cardsTokenizationEnabled.pipe((0,g.s)(1),(0,I.n)(e=>e?lQ.P.shared().deepLink.pipe((0,g.s)(1),(0,I.n)(e=>"rebill-card"===e.type&&e.args.packageSku&&e.args.cardMask?q.e.shared(this.userId).hasActiveSubscription.pipe((0,g.s)(1),(0,I.n)(s=>s?(C.Y.shared().get(eg.A).actions.open("card-rebilled-already-notification",[{props:{},disableManualClose:!1}]),k.w):eW.r.shared().focusState.pipe((0,ea.p)(e=>"focused"===e),(0,g.s)(1),(0,I.n)(()=>v0.J.shared().refillBalance({name:e2.N.RebillCard,preselectedCardMask:e.args.cardMask,preselectedPackageSku:e.args.packageSku}))))):k.w)):k.w)).safeSubscribe())}}mK.shared=(0,P.G)(e=>new mK(e));var m0=t(63623);class m1{constructor(e){this.userId=e}start(e){e.add(m0.K.shared().intent.safeSubscribe(e=>{var{receiverId:s,meta:t}=e;pZ.x.shared(this.userId).logChoosePresentClicked(s,t)}))}}m1.shared=(0,P.G)(e=>new m1(e));var m5=["t.me","wa.me","instagram.com","facebook.com","vk.com","viber.com","line.me","snapchat.com","wechat.com","weixin.qq.com","discord.com","discord.gg","discordapp.com","signal.org","onlyfans.com"],m3=["telegram","tg","whatsapp","wa","viber","wechat","discord","instagram","insta","facebook","fb","vk","vkontakte","snapchat","onlyfans"];function m2(e){var s=RegExp(m5.map(e=>e.replace(".","\\.")).join("|"),"im"),t=RegExp(m3.map(e=>"\\b"+e+"\\b").join("|"),"im"),r=sK.co.exec(e.replace(/(\r\n|\n|\r)/gm,""));if(null!=r&&r[0])return{type:"email",content:r[0]};var a=/\+\d{7,}/m.exec(e.replace(/[ ()-]/g,""));if(a)return{type:"phone",content:a[0]};var i=s.exec(e);if(null!=i&&i[0])return{type:"link",content:i[0]};var n=t.exec(e);return null!=n&&n[0]?{type:"keyword",content:n[0]}:null}var m8=t(58508),m4=t(49844);class m6{constructor(e){this.userId=e}logSafetyNotificationShown(e,s,t,r,a,i){W._.shared(this.userId).logEvent("safety-notification-shown",{"recipient-id":s,"sender-id":e,[t]:r,"message-type":a,"message-id":i}).safeSubscribe()}}m6.shared=(0,P.G)(e=>new m6(e));class m9{constructor(e){this.userId=e,this.safetyNotificationRequests=new Z.t([])}addSafetyNotification(e){var s=this.safetyNotificationRequests.getValue();s.find(s=>s.messageType===e.messageType&&s.messageId===e.messageId)||this.safetyNotificationRequests.next([...s,e])}markSafetyNotificationAsRead(e){this.safetyNotificationRequests.next(this.safetyNotificationRequests.getValue().map(s=>(s.messageType===e.messageType&&s.messageId===e.messageId&&(s.sent=!0),s)))}userHasExperimentTag(e){return j.x.shared(e).tags.pipe((0,w.T)(e=>e.includes("experiments.safety.notice.available")))}start(e){e.add(T.T.shared().safetyNotificationOutgoingEnabled.pipe((0,I.n)(e=>e?rL.e.shared(this.userId).newMessage.pipe((0,w.T)(e=>{if(e.sender!==this.userId||e.status!==l4.n.Delivered||e.type!==re.Go.Text)return null;var s=m2(e.content);return s?{attendeeId:e.recipient,unsafeType:s.type,unsafeContent:s.content,messageId:e.tag}:null}),(0,ea.p)(e=>!!e)):k.w)).safeSubscribe(e=>{this.addSafetyNotification(Object.assign({},e,{messageType:"message",direction:"outgoing"}))})),e.add(T.T.shared().safetyNotificationOutgoingEnabled.pipe((0,I.n)(e=>e?(0,D.z)([m8.G.shared(this.userId).letterSentIntent,rL.e.shared(this.userId).newMessage]).pipe((0,ea.p)(e=>{var[s,t]=e;return t.status===l4.n.Delivered&&t.tag===s.letterContent.tag.toString()}),(0,w.T)(e=>{var[s,t]=e;if(t.type!==re.Go.Letter)return null;var r=m2(s.letterContent.text)||m2(s.letterContent.subject);return r?{attendeeId:s.recipientId,unsafeType:r.type,unsafeContent:r.content,messageId:t.content.id.toString()}:null}),(0,ea.p)(e=>!!e)):k.w)).safeSubscribe(e=>{this.addSafetyNotification(Object.assign({},e,{messageType:"letter",direction:"outgoing"}))})),e.add(T.T.shared().safetyNotificationIncomingEnabled.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,I.n)(e=>
3e?this.userHasExperimentTag(e).pipe((0,I.n)(s=>s?(0,S.of)(e):k.w)):k.w),(0,I.n)(e=>C.Y.shared().get(m4.Ay,(0,m4.OX)(this.userId,e)).store.rxState().pipe((0,w.T)(s=>{var t=null;for(var r of s.messages)if(!r.read&&r.sender===e){if(r.type===re.Go.Text){var a=m2(r.content);if(a){t=Object.assign({},a,{messageId:r.tag,messageType:"message"});break}}if(r.type===re.Go.Letter){var i=m2(r.content.text);if(i){t=Object.assign({},i,{messageId:r.content.id,messageType:"letter"});break}}}return t?{attendeeId:e,unsafeType:t.type,unsafeContent:t.content,messageId:t.messageId,messageType:t.messageType}:null}),(0,ea.p)(e=>!!e)))):k.w)).safeSubscribe(e=>{this.addSafetyNotification(Object.assign({},e,{direction:"incoming"}))})),e.add(T.T.shared().safetyNotificationIncomingEnabled.pipe((0,I.n)(e=>e?h8.l.shared().letterId.pipe((0,ea.p)(e=>!!e&&e.recipient===this.userId&&"read-letter"===e.cta),(0,I.n)(e=>this.userHasExperimentTag(e.sender).pipe((0,I.n)(s=>s?(0,S.of)(e):k.w))),(0,I.n)(e=>(0,D.z)([(0,S.of)(e),iJ.c.shared(this.userId).get({id:e.id,recipient:e.recipient,sender:e.sender}).pipe((0,g.s)(1))])),(0,w.T)(e=>{var s,t,[r,a]=e;if(!a.value||r.read)return null;var i=m2((null==(s=a.value)?void 0:s.subject)||"")||m2((null==(t=a.value)?void 0:t.text)||"");return i?{attendeeId:a.value.sender,unsafeType:i.type,unsafeContent:i.content,messageId:a.value.id}:null}),(0,ea.p)(e=>!!e)):k.w)).safeSubscribe(e=>{this.addSafetyNotification(Object.assign({},e,{messageType:"letter",direction:"incoming"}))})),e.add((0,D.z)([el.j.shared().chatAttendee,this.safetyNotificationRequests]).pipe((0,I.n)(e=>{var[s,t]=e;if(!s)return k.w;var r=t.find(e=>e.attendeeId===s&&!e.sent);return r?(0,S.of)(r):k.w}),(0,pr.c)(1)).safeSubscribe(e=>{this.markSafetyNotificationAsRead(e),m6.shared(this.userId).logSafetyNotificationShown("outgoing"===e.direction?this.userId:e.attendeeId,"outgoing"===e.direction?e.attendeeId:this.userId,e.unsafeType,e.unsafeContent,e.messageType,e.messageId),l.A.emit("message:fake",{id:null,tag:(0,vB.A)(),sender:"outgoing"===e.direction?this.userId:e.attendeeId,recipient:"outgoing"===e.direction?e.attendeeId:this.userId,meta:{system:"safety-notification"}})}))}}m9.shared=(0,P.G)(e=>new m9(e));var m7=t(24044),fe=t(5919),fs=t(15511);class ft{constructor(e){this.userId=e}start(e){e.add(fe.X.shared(this.userId).offer.safeSubscribe(e=>{if(e){var{attendeeId:s}=e;fs.g.shared(this.userId).logBannerShown(s)}})),e.add(fe.X.shared(this.userId).offeringResult.safeSubscribe(e=>{var{offer:s,result:t,options:r}=e,{attendeeId:a}=s,i=void 0;"rejected"===t&&(i=r),"accepted"===t&&(i="call-started"),fs.g.shared(this.userId).logBannerHidden(a,i)}))}}ft.shared=(0,P.G)(e=>new ft(e));class fr{constructor(e){this.userId=e}start(e){e.add(fe.X.shared(this.userId).offer.pipe((0,I.n)(e=>e?rG.n.shared(this.userId).userInContacts(e.attendeeId).pipe((0,I.n)(e=>e?fe.X.shared(this.userId).rejectOffer("user-added-to-contacts").asObservable():k.w)):k.w)).safeSubscribe()),e.add(fe.X.shared(this.userId).offer.pipe((0,I.n)(e=>e?rn.N.shared(this.userId).blockedUsers.pipe((0,w.T)(s=>s.includes(e.attendeeId)),(0,I.n)(e=>e?fe.X.shared(this.userId).rejectOffer("user-blocked").asObservable():k.w)):k.w)).safeSubscribe()),e.add(fe.X.shared(this.userId).offer.pipe((0,I.n)(e=>e?rd.N.shared(this.userId).callIsAvailable(e.attendeeId).pipe((0,I.n)(e=>e?k.w:fe.X.shared(this.userId).rejectOffer("calls-unavailable").asObservable())):k.w)).safeSubscribe()),e.add(fe.X.shared(this.userId).offer.pipe((0,I.n)(e=>e?iM.BE.shared(this.userId).filters.pipe((0,w.T)(e=>{var{minAge:s,gender:t,maxAge:r,preferredGender:a}=e;return{minAge:s,gender:t,maxAge:r,preferredGender:a}}),(0,ev.F)(ef()),(0,su.J)(),(0,I.n)(()=>fe.X.shared(this.userId).rejectOffer("search-filter-changed").asObservable())):k.w)).safeSubscribe())}}fr.shared=(0,P.G)(e=>new fr(e));var fa=t(8083),fi=t(95744);class fn{constructor(e){this.userId=e}start(e){e.add(T.T.shared().aiPerfectMatchEnabled.pipe((0,I.n)(e=>e?A.M.shared(this.userId).initialized:k.w),(0,I.n)(e=>e?ru.M.shared(this.userId).events("fail").pipe((0,I.n)(e=>"ai-perfect-match"===e.cta&&e.attendeeId?fa.C.shared(this.userId).items.pipe((0,g.s)(1),(0,w.T)(s=>e.attendeeId&&s.includes(e.attendeeId)?e.attendeeId:null)):k.w)):k.w)).safeSubscribe(e=>{e&&(0,fi.q)(e)})),e.add(C.Y.shared().get(eg.A).store.rxState().pipe((0,w.T)(e=>null==e?void 0:e.name),(0,ev.F)(),(0,I.n)(e=>"ai-perfect-match"!==e?k.w:ro.J.shared(this.userId).callExists)).safeSubscribe(e=>{e&&(0,fi.D)()}))}}fn.shared=(0,P.G)(e=>new fn(e));var fd=t(63525);class fo{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().mcs.audioCall.enabledByDefault,fd.f.shared(this.userId).state.pipe((0,w.T)(e=>e.available),(0,ev.F)()),iC.K.shared().microphone.pipe((0,w.T)(e=>(null==e?void 0:e.permission)==="allowed"),(0,ev.F)())]).safeSubscribe(e=>{var[s,t,r]=e;s&&t&&fd.f.shared(this.userId).setEnabled(r)}))}}fo.shared=(0,P.G)(e=>new fo(e));var fu=t(50262),fl=t(36771);class fc{constructor(e){this.userId=e}start(e){e.add(fu.n.shared(this.userId).offer.pipe((0,b.o)()).safeSubscribe(e=>{"allowed"!==e&&fl.a.shared(this.userId).logPopupShown(e)})),e.add(fu.n.shared(this.userId).offeringResult.safeSubscribe(e=>{"allowed"!==e.offer&&fl.a.shared(this.userId).logPopupClosed("closed")}))}}fc.shared=(0,P.G)(e=>new fc(e));class fh{constructor(e){this.userId=e}start(e){var s=new y.c(e=>{var s=new MutationObserver(s=>
3{for(var t of s)t.removedNodes.forEach(s=>{s instanceof HTMLElement&&s.classList.contains("audio-call-unavailable-notification")&&e.next()})});return s.observe(document.body,{childList:!0,subtree:!0}),()=>{s.disconnect()}});e.add(T.T.shared().mcs.audioCall.enabledByDefault.pipe((0,I.n)(e=>e?(0,K.h)(s.pipe((0,w.T)(()=>!1)),fu.n.shared(this.userId).offeringResult.pipe((0,w.T)(()=>!0))):k.w)).pipe((0,g.s)(1)).safeSubscribe(e=>{e||fl.a.shared(this.userId).logPopupClosed("external-removal")}))}}fh.shared=(0,P.G)(e=>new fh(e));class fp{constructor(e){this.userId=e}start(e){e.add(fu.n.shared(this.userId).canOffer.pipe((0,I.n)(e=>e?fu.n.shared(this.userId).startOffer(e):k.w)).safeSubscribe()),e.add(fu.n.shared(this.userId).offer.pipe((0,ea.p)(e=>!!e&&"allowed"!==e)).safeSubscribe(()=>{C.Y.shared().get(eg.A).actions.open("audio-call-unavailable-notification",[{props:{},disableManualClose:!0}])})),e.add((0,D.z)([fu.n.shared(this.userId).offer.pipe((0,ea.p)(e=>"allowed"===e)),T.T.shared().mcs.audioCall.availabilityOfferingTtl]).safeSubscribe(e=>{var[,s]=e;sH.X.shared().notifyUser({type:sW._.AudioCallAvailable,payload:{ttl:s}},sW.A.Normal)}))}}fp.shared=(0,P.G)(e=>new fp(e));var fv=t(84409);class fm{constructor(e){this.userId=e}logModeChanged(e,s){W._.shared(this.userId).logEvent("mcs-audio-call-mode-changed",{"attendee-id":e,minimized:!!s}).safeSubscribe()}}fm.shared=(0,P.G)(e=>new fm(e));class ff{constructor(e){this.userId=e}start(e){e.add((0,D.z)([ru.M.shared(this.userId).callIsAudioOnly,ru.M.shared(this.userId).attendeeId]).pipe((0,ea.p)(e=>{var[s,t]=e;return s&&!!t}),(0,I.n)(e=>{var[s,t]=e;return t?rl.K.shared(this.userId).id(t):(0,S.of)(null)}),(0,I.n)(e=>e?fv.P.shared().minimized.pipe((0,eV.i)(1),(0,ee.M)(s=>{fm.shared(this.userId).logModeChanged(e,s)})):(0,S.of)(null))).safeSubscribe())}}ff.shared=(0,P.G)(e=>new ff(e));class fb{constructor(e){this.userId=e}start(e){e.add(T.T.shared().chatAttendeeActivityStatusEnabled.pipe((0,I.n)(e=>{if(!e)return k.w;var s=null;return(0,D.z)([el.j.shared().tab,el.j.shared().chatAttendee]).pipe((0,w.T)(e=>{var[s,t]=e;return"chat"===s&&t?t:null}),(0,ev.F)(),(0,I.n)(e=>{if(!e){if(s){var{attendeeId:t,type:r}=s;return s=null,eu.I.shared(this.userId).unset(t,r)}return k.w}var a=new y.c(e=>{var s=s=>{e.next(s)};return l.A.on("popup.state.changed.smiles-chat",s),()=>{l.A.removeListener("popup.state.changed.smiles-chat",s)}}).pipe((0,ep.Z)(!1),(0,ev.F)()),i=aw.r.shared().name.pipe((0,w.T)(e=>"cheers-overlay"===e),(0,ev.F)()),n=(0,D.z)([l6.b.shared().visible,i]).pipe((0,w.T)(e=>{var[s,t]=e;return s||t}),(0,ep.Z)(!1),(0,ev.F)());return(0,K.h)(a.pipe((0,eV.i)(1),(0,ev.F)(),(0,w.T)(e=>({type:"sticker",action:e?"set":"unset"}))),n.pipe((0,eV.i)(1),(0,ev.F)(),(0,w.T)(e=>({type:"virtual-gift",action:e?"set":"unset"})))).pipe((0,dg.H)(t=>{var r,{type:a,action:i}=t;return"set"===i?(s={attendeeId:e,type:a},eu.I.shared(this.userId).set(e,a)):((null==(r=s)?void 0:r.type)===a&&(s=null),eu.I.shared(this.userId).unset(e,a))}))}))})).safeSubscribe())}}fb.shared=(0,P.G)(e=>new fb(e));var fg=t(61525);class fI{start(e){e.add(ts.l.shared().ownerId.pipe((0,I.n)(e=>e?(0,K.h)((0,$.i)("event.mediaGallery.nextButton.clicked").pipe((0,ee.M)(()=>{fg.n.shared().logGalleryNextButtonClicked(e)})),(0,$.i)("event.mediaGallery.previousButton.clicked").pipe((0,ee.M)(()=>{fg.n.shared().logGalleryPreviousButtonClicked(e)})),(0,$.i)("event.overlay.closeButton.clicked").pipe((0,ee.M)(()=>{fg.n.shared().logCloseGalleryButtonClicked(e)}))):k.w)).safeSubscribe())}}fI.shared=(0,P.G)(()=>new fI);var fw="dialogs-themes-trial-activator",fS="trial-started-at",fy=48*eF.b.hour;class fA{constructor(e){this.trialTriggerSubject=new sp.B,this.trialTrigger=this.trialTriggerSubject.asObservable(),this.userId=e}pairIsThemeCovered(e){return(0,D.z)([pL.Q.shared(this.userId).theme(e),sj.P.shared(this.userId).tags(e)]).pipe((0,w.T)(e=>{var[s,t]=e;return!!s||t.includes("dialogs.themes.purchased")}))}trialCooldownIsExpired(){return(0,D.z)([sr.E.shared().currentTime(),tN.w.shared(fw,this.userId).load(fS).pipe((0,eY.vV)(e=>e||0))]).pipe((0,w.T)(e=>{var[s,t]=e;return t+fy<s}))}activeChatIsReady(e){return rr.u.shared(this.userId).getActiveChatState(e).pi
3pe((0,w.T)(e=>{if(!e||!e.isActive)return!1;var s=e.messagesStatus;return s.incomingMessagesCount+s.outgoingMessagesCount>=12}),(0,ev.F)())}start(e){var s=el.j.shared().chatAttendee.pipe((0,I.n)(e=>e?this.pairIsThemeCovered(e).pipe((0,I.n)(s=>s?(0,S.of)(!1):this.activeChatIsReady(e).pipe((0,I.n)(s=>s?this.trialCooldownIsExpired().pipe((0,I.n)(s=>s?(0,S.of)(e):(0,S.of)(!1))):(0,S.of)(!1))))):(0,S.of)(!1)));e.add(this.trialTrigger.pipe((0,I.n)(e=>pL.Q.shared(this.userId).applyTrialTheme(e).pipe((0,eY.Fg)(()=>sr.E.shared().currentTime().pipe((0,eY.Fg)(e=>tN.w.shared(fw,this.userId).store(fS,e))))))).safeSubscribe()),e.add(T.T.shared().dialogsThemesTrialEnabled.pipe((0,I.n)(e=>e?s:k.w),(0,ev.F)()).safeSubscribe(e=>{e&&this.trialTriggerSubject.next(e)}))}}fA.shared=(0,P.G)(e=>new fA(e));var fT=t(13866),fx=t(49004);class fC{constructor(e){this.userId=e}start(e){e.add(fx.h.shared().intent.pipe((0,sm.Z)(e=>{if(!e.isSuccessful||"resend"===e.value.cta)return k.w;var s=e.value.cta;return rL.e.shared(this.userId).newMessage.pipe((0,ea.p)(s=>s.type===re.Go.Sticker&&s.status===l4.n.Delivered&&s.sender===this.userId&&s.tag===e.value.tag),(0,w.T)(()=>({attendeeId:e.value.attendeeId,name:e.value.stickerName,cta:s})),(0,g.s)(1))})).safeSubscribe(e=>{fT.S.shared(this.userId).logStickerDeliveredSuccessfully(Object.assign({},e))}))}}fC.shared=(0,P.G)(e=>new fC(e));var fF=t(77118),fD=t(77791);class fk{constructor(e){this.userId=e}start(e){e.add(fA.shared(this.userId).trialTrigger.pipe((0,I.n)(e=>f.I.shared(this.userId).events("message:message:v2").pipe((0,ea.p)(e=>"dialogs.themes.trial"===e.type),(0,g.s)(1),(0,I.n)(s=>{var t,r=null==(t=s.meta)||null==(t=t["dialogs-theme"])?void 0:t.reference;return r?fF.x.shared(this.userId).getCatalogueItem(r,e).pipe((0,w.T)(s=>({catalogItem:s,attendeeId:e}))):k.w})))).safeSubscribe(e=>{var{catalogItem:s,attendeeId:t}=e;s&&!s.default&&fD.L.shared(this.userId).logThemeInstalled({attendeeId:t,reference:s.reference,price:s.price,type:"promo",custom:s.custom})}))}}fk.shared=(0,P.G)(e=>new fk(e));var fE=t(30385);class fj{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().currencyDevaluationRatio,T.T.shared().subscriptionPurchaseNotification]).pipe((0,I.n)(e=>{var[s,t]=e;return f.I.shared(this.userId).events("event.credits.mall.receipt.exchanged").pipe((0,w.T)(e=>({event:e,devaluationEnabled:1!==s,notification:t})))})).safeSubscribe(e=>{var s,t,r,a,{event:i,devaluationEnabled:n,notification:d}=e,o=(0,cN.TC)({benefits:i.benefits,credits:{amount:i.amount}}),u=(null==(s=i.meta)?void 0:s.recurring)||(null==(t=i.benefits)?void 0:t.find(e=>"subscription"===e.type)),l=null==(r=i.meta)?void 0:r["subscription-upgrade"],c="success-modal"===d&&!!u,h=null!=(a=i.amount||o.credits)?a:0;if(h>0){var p=n?sW._.CreditsPurchaseWithDevaluation:sW._.CreditsPurchase;sH.X.shared().notifyUser({type:p,payload:{credits:h}},sW.A.Normal)}!u||l||c||sH.X.shared().notifyUser({type:sW._.SubscriptionPurchase},sW.A.Normal),l||c||Object.entries(o).forEach(e=>{var[s,t]=e;"credits"!==s&&t&&t>0&&sH.X.shared().notifyUser({type:sW._.BenefitsPurchase,payload:{amount:t,benefitType:s}},sW.A.Normal)})})),e.add(T.T.shared().subscriptionPurchaseNotification.pipe((0,I.n)(e=>tW.i.shared(this.userId).subscriptionUpgraded.pipe((0,w.T)(s=>({upgrade:s,notification:e}))))).safeSubscribe(e=>{var{upgrade:s,notification:t}=e;if("success-modal"!==t){var{benefitsAmount:r,recurringPeriod:a}=s;(a===cz.jB.week||a===cz.jB.month)&&sH.X.shared().notifyUser({type:sW._.ServicesSubscriptionUpgraded,payload:{benefitsAmount:r,recurringPeriod:a}},sW.A.Normal)}}))}}fj.shared=(0,P.G)(e=>new fj(e));var fR=t(35382),fO=t(14540);class fM{constructor(e){this.userId=e}start(e){e.add((0,K.h)((0,D.z)([iK.g.shared().deepLink,fO.r.shared(this.userId).tags]).pipe((0,g.s)(1),(0,ea.p)(e=>{var[s,t]=e;return"reset-password"===s.type&&!t.includes("password.reset.required")}),(0,ee.M)(()=>(0,fR.Q)(!0))),fO.r.shared(this.userId).tags.pipe((0,g.s)(1),(0,ea.p)(e=>e.includes("password.reset.required")),(0,ee.M)(()=>(0,fR.Q)(!1)))).pipe((0,I.n)(()=>(0,D.z)([G.s.shared().email.pipe((0,b.o)()),G.s.shared().passwordChanged,fO.r.shared(this.userId).tags.pipe((0,ea.p)(e=>!e.includes("password.reset.required")))])),(0,g.s)(1),(0,I.n)(e=>{var[s,t]=e;return aE.a.shared().setCredentials({email:s,password:t}).asObservable()}),(0,ee.M)(()=>{aT.a.shared().removeHashParameter("token"),aT.a.shared().reloadPage()})).safeSubscribe())}}fM.shared=(0,P.G)(e=>new fM(e));var fG=t(18040);class fB{constructor(e){this.userId=e}start(e){e.add(fG.E.shared(this.userId).canOffer.pipe((0,I.n)(e=>e?fG.E.shared(this.userId).startOffer(e):k.w)).safeSubscribe()),e.add(fG.E.shared(this.userId).offer.safeSubscribe(e=>{e&&l.A.emit("command.invite.add",Object.assign({},e,{sender:e["user-id"],meta:{}}))}
3))}}fB.shared=(0,P.G)(e=>new fB(e));var fP=t(59697);class f_{constructor(e){this.userId=e}start(e){e.add(fG.E.shared(this.userId).offeringResult.pipe((0,ea.p)(e=>"rejected"===e.result||"postponed"===e.result)).safeSubscribe(e=>{var s=e.offer["user-id"];fP.r.shared(this.userId).logInviteClosed(s,e.options)}))}}f_.shared=(0,P.G)(e=>new f_(e));var fz=t(22871),fN=t(67130),fL=t(33979);class fq{constructor(e){this.userId=e}start(e){e.add(T.T.shared().stickersPackGenerationEnabled.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,ea.p)(e=>null!==e),(0,g.s)(1),(0,I.n)(()=>fL.v.shared(this.userId).tasks),(0,fN.p)(e=>{var s=this.findPendingTask(e);return s?v0.J.shared().refillBalance({name:e2.N.StickerPackGeneration,requiredAmount:s.settings.credits}).pipe((0,I.n)(e=>e.isSuccessful?fL.v.shared(this.userId).upsertPack({packName:s.payload.packName}):(0,S.of)())):(0,S.of)()})):k.w)).safeSubscribe())}findPendingTask(e){return e.find(e=>"2.1.insufficient.funds"===e.state)}}fq.shared=(0,P.G)(e=>new fq(e));var fV=t(6797),fQ=t(91458),fU=t(44457);class fY{constructor(e){this.userId=e}start(e){e.add(fU.S.shared(this.userId).status.pipe((0,fV.w)("name")).safeSubscribe(e=>{"uploading"===e.name?fQ.T.shared(this.userId).logCustomThemeUploadingAttempt({attendeeId:e.attendeeId}):fQ.T.shared(this.userId).logCustomThemeUploadResult({attendeeId:e.attendeeId,type:"complete"===e.name?"success":"failure"})}))}}fY.shared=(0,P.G)(e=>new fY(e));class fJ{constructor(e){this.userId=e}start(e){e.add(T.T.shared().stickersPackGenerationEnabled.pipe((0,I.n)(e=>e?el.j.shared().chatAttendee.pipe((0,ea.p)(e=>null!==e),(0,g.s)(1),(0,I.n)(()=>fL.v.shared(this.userId).tasks),(0,w.T)(e=>e.reduce((e,s)=>{var t=s.state;return t&&(e[s.taskName]=t),e},{})),(0,su.J)(),(0,I.n)(e=>{var[s,t]=e,r=Object.entries(t).filter(e=>{var[t,r]=e;return s[t]!==r}).map(e=>{var[s,t]=e;return t});return(0,df.H)(r)})):k.w)).safeSubscribe(e=>{switch(e){case"3.0.generation.inprogress":sH.X.shared().notifyUser({type:sW._.StickersGenerationStarted},sW.A.Normal);break;case"3.2.generation.failed":case"3.1.generation.attempt.failed":sH.X.shared().notifyUser({type:sW._.StickersGenerationFailed},sW.A.Normal);break;case"4.0.done":sH.X.shared().notifyUser({type:sW._.StickersGenerationSucceeded},sW.A.Normal)}}))}}fJ.shared=(0,P.G)(e=>new fJ(e));var fW=t(38806);class fH{start(e){e.add(iK.g.shared().deepLink.pipe((0,ea.p)(e=>"api-file-redirector"===e.type)).safeSubscribe(e=>{var s=new URL(e.args.redirectUri+"?authorization="+iX.a.shared().getAAF(),"https://"+B.jI.shared().getBaseHost().replace("//","")).toString();aT.a.shared().assign(s)}))}}fH.shared=(0,P.G)(()=>new fH);var fX=["purchase"];class fZ{constructor(){this.flux=C.Y.shared()}get openedEarlierOverlayName(){var e,s;return null!=(e=null==(s=this.flux.get(eg.A).store.getState())?void 0:s.name)?e:""}start(e){e.add((0,$.i)("command.sidebar.open").pipe((0,ea.p)(()=>!fX.includes(this.openedEarlierOverlayName))).safeSubscribe(()=>{this.flux.get(eg.A).actions.closeAll()}))}}fZ.shared=(0,P.G)(()=>new fZ);var f$=t(52127),fK=t(44081);class f0{constructor(e){this.showCheer=(e,s,t)=>{var{meta:{reference:{uri:r}},recipient:a,sender:i,read:n,id:d}=s;(e===a||e===i)&&l.A.emit("command.cheer.animation.show",{uri:r,sender:i,read:n,id:d,target:t})}}start(e){e.add((0,K.h)((0,$.i)("event.chat.personal.activated"),(0,$.i)("event.chat.personal.deactivated").pipe((0,w.T)(()=>[null]))).pipe((0,I.n)(e=>{var[s]=e;return s?(0,K.h)((0,$.i)("event.communication.chat.selected").pipe((0,w.T)(()=>"chat")),(0,$.i)("event.communication.read-letter.selected").pipe((0,w.T)(()=>"letter")),(0,$.i)("event.communication.letter.selected").pipe((0,w.T)(()=>null))).pipe((0,I.n)(e=>e?(0,K.h)((0,$.i)("event.communication.letter.cheer.shown"),(0,$.i)("event.communication.chat.cheer.shown")).pipe((0,w.T)(t=>{var[r]=t;return{id:s,message:r,target:e}})):k.w)):k.w})).safeSubscribe(e=>{var{id:s,message:t,target:r}=e;this.showCheer(s,t,r)}))}}f0.shared=(0,P.G)(e=>new f0(e));class f1{constructor(e){this.userId=e}start(e){e.add((0,K.h)((0,$.i)("event.credits.accounts.settings.updated"),(0,$.i)("event.credits.mall.receipt.exchanged")).pipe((0,I.n)(()=>
3aU.c.shared(this.userId).refresh())).safeSubscribe())}}f1.shared=(0,P.G)(e=>new f1(e));var f5=t(5005);class f3{constructor(e){this.userId=e}start(e){e.add((0,D.z)([T.T.shared().audioCallMotivationPopup.enabled,T.T.shared().audioCallMotivationPopup.chatLogMessage]).pipe((0,ea.p)(e=>e.every(Boolean)),(0,I.n)(()=>rp.hw.shared(this.userId).offeringResult.pipe((0,ea.p)(e=>"rejected"===e.result||"postponed"===e.result&&"expired"===e.options.reason),(0,w.T)(e=>{var s=e.offer.attendeeId;return C.Y.shared().get(m4.Ay,(0,m4.OX)(this.userId,s)).store.getState().messages.slice(0,10).some(e=>e.type===re.Go.AudioCallMotivationMessage)?null:s}),(0,b.o)(),(0,I.n)(e=>f5.g.shared(this.userId).send(e))))).safeSubscribe())}}f3.shared=(0,P.G)(e=>new f3(e));var f2=t(4088);class f8{constructor(e){this.onMessageReactionAdded=e=>{var s=this.userId===e["recipient-id"]?e["sender-id"]:e["recipient-id"],{store:t,actions:r}=C.Y.shared().get(f2.Ay,(0,f2.OX)(this.userId,s)),a=(t.getState().messages||[]).find(s=>s.id===e["message-id"]);a&&r.setMessageReaction({messageTag:a.tag,reactionName:e.reaction.name})},this.onMessageSeen=e=>{var s=e.sender===this.userId?e.recipient:e.sender,{store:t,actions:r}=C.Y.shared().get(f2.Ay,(0,f2.OX)(this.userId,s));(t.getState().messages||[]).filter(e=>!e.read).forEach(e=>{r.setReadForOutgoing(e.tag)})},this.onMessageReceived=e=>{var s=e.sender===this.userId?e.recipient:e.sender;C.Y.shared().get(f2.Ay,(0,f2.OX)(this.userId,s)).actions.patch(Object.assign({},e,{timestamp:e.timestamp*eF.b.second}))},this.userId=e}start(e){e.add(f.I.shared(this.userId).events("message:message:v2").pipe((0,ea.p)(e=>!!e)).safeSubscribe(this.onMessageReceived)),e.add(f.I.shared(this.userId).events("event.dialogs.messages.seen").pipe((0,ea.p)(e=>!!e)).safeSubscribe(this.onMessageSeen)),e.add(f.I.shared(this.userId).events("message.reaction..added").pipe((0,ea.p)(e=>(null==e?void 0:e.status)===0)).safeSubscribe(this.onMessageReactionAdded))}}f8.shared=(0,P.G)(e=>new f8(e));var f4=t(18909),f6=t(10557),f9=t(59251),f7="message:message:v2",be="event.users.events.added",bs="event.bonuses.accounts.balance.credited",bt="ci:event.user.typing.started",br="ci:event.user.typing.ended",ba={[be]:e=>{var s;return null==e||null==(s=e.payload)?void 0:s.id},[bs]:e=>null==e?void 0:e["message-id"]},bi={[f7]:e=>null==e?void 0:e.sender,[bt]:e=>null==e?void 0:e.sender,[br]:e=>null==e?void 0:e.sender,[be]:e=>{var s;return(null==e?void 0:e.type)==="message"?null==(s=e.payload)?void 0:s["sender-id"]:void 0},[bs]:e=>null==e?void 0:e["sender-id"]};class bn{constructor(e){this.queued=new sp.B,this.pending=new Set,this.flushed=new sp.B,this.messageShown=new ey.m(50),this.openedChats=new Set,this.heldMessages={},this.typingDelays={},this.typingSince={},this.releaseTimes={},this.userId=e}start(e){e.add(T.T.shared().messagesDelay.pipe((0,I.n)(e=>e.enabled?this.registeredEventsFilter(e):k.w)).safeSubscribe()),e.add(T.T.shared().messagesDelay.pipe((0,I.n)(e=>e.enabled?this.heldEvents():k.w)).safeSubscribe(e=>{this.pending.delete(e),this.emitEvent(e.label,e.payload),e.label===f7&&this.messageShown.next(e.payload.id)})),e.add(T.T.shared().messagesDelay.pipe((0,I.n)(e=>e.enabled?this.redrawnTyping(e):k.w)).safeSubscribe(e=>this.emitTyping(e,!0)))}registeredEventsFilter(e){return new y.c(()=>{var s=f.I.shared(this.userId),t=(s,t)=>this.filterEvent(e,s,t);return s.addEventsFilter(t),()=>{s.removeEventsFilter(t),this.releasePending(),this.reset()}})}heldEvents(){return this.queued.pipe((0,sm.Z)(e=>this.hold(e)))}redrawnTyping(e){return el.j.shared().chatAttendee.pipe((0,b.o)(),(0,ee.M)(e=>this.flushChatOpenedFirstTime(e)),(0,ea.p)(e=>!!this.heldMessages[e]),(0,ee.M)(e=>this.emitTyping(e,!1)),(0,I.n)(s=>(0,im.O)(e.typingRedrawDelay).pipe((0,eP.u)(s))),(0,ea.p)(e=>!!this.heldMessages[e]))}filterEvent(e,s,t){if(s&&this.actualizeContactsState(s,t),!s||!bi[s])return(0,S.of)(!0);var r=bi[s](t),a=r?(0,f9.J)(r):void 0;return a&&a!==this.userId?this.senderIsFeaturedMember(a,e).pipe((0,w.T)(r=>!r||(s===bt||s===br?this.acceptTypingEvent(s,a):(this.enqueue(e,a,s,t),!1)))):(0,S.of)(!0)}senderIsFeaturedMember(e,s){return M.f.shared(e).userIsFeaturedMember.pipe((0,o0.w)(s.roleResolutionTimeout),(0,E.W)(()=>(0,S.of)(!1)),(0,g.s)(1))}acceptTypingEvent(e,s){return e===bt?(void 0===this.typingSince[s]&&(this.t
3ypingSince[s]=Date.now()),!0):!(this.heldMessages[s]>0)&&(delete this.typingSince[s],!0)}enqueue(e,s,t,r){var a,i={settings:e,sender:s,label:t,payload:r,messageId:null==(a=ba[t])?void 0:a.call(ba,r)};this.pending.add(i),this.queued.next(i)}hold(e){return(0,K.h)(this.heldEvent(e),this.senderFlushed(e.sender)).pipe((0,g.s)(1),(0,eP.u)(e))}actualizeContactsState(e,s){if("event.users.events.staled"===e&&null!=s&&s["user-id"]){var t=(0,f9.J)(s["user-id"]);Array.from(this.pending).filter(e=>e.label===be&&e.sender===t).forEach(e=>{var s;(s=e.payload).stale=!0,s.stack=0})}}heldEvent(e){return e.label===f7?this.holdMessage(e.sender,e.payload,e.settings):e.label===be||e.label===bs?this.holdUntilMessageShown(e,e.settings):(0,S.of)(void 0)}senderFlushed(e){return this.flushed.pipe((0,ea.p)(s=>s===e),(0,eP.u)(void 0))}flushChatOpenedFirstTime(e){this.openedChats.has(e)||(this.openedChats.add(e),this.flushSender(e))}flushSender(e){this.heldMessages[e]>0&&this.emitTyping(e,!1),delete this.heldMessages[e],delete this.typingDelays[e],delete this.releaseTimes[e],delete this.typingSince[e],this.flushed.next(e)}reset(){Object.keys(this.heldMessages).forEach(e=>{this.heldMessages[e]>0&&this.emitTyping(e,!1)}),this.openedChats=new Set,this.heldMessages={},this.typingDelays={},this.typingSince={},this.releaseTimes={}}releasePending(){var e=new Set;this.pending.forEach(s=>e.add(s.sender)),e.forEach(e=>this.flushSender(e))}emitEvent(e,s){f6.g.shared(this.userId).addEvent({label:e,payload:s})}typedTime(e,s,t){var r=this.typingSince[e];if(void 0===r)return 0;var a=s-r;return a>t?0:a}holdMessage(e,s,t){var r,a=(0,re.sR)(s).type===re.Go.Text?(s.text||"").length:0,i=Date.now(),n=this.typedTime(e,i,t.typingTimeout);delete this.typingSince[e];var d=a?(r=eF.b.minute/(t.wordsPerMinute*t.charactersPerWord),Math.min(t.maximumDelay,Math.max(t.minimumDelay,a*r))):0,o=Math.max(0,d-n),u=o>0,l=this.releaseTimes[e],c=void 0!==l&&l>i,h=u?t.typingResumeGap:t.minimumDelay,p=c?l+h:i,v=p+o;if(this.releaseTimes[e]=v,!u)return(0,im.O)(v-i).pipe((0,eP.u)(void 0));this.heldMessages[e]=(this.heldMessages[e]||0)+1,this.typingDelays[e]={duration:d,elapsed:n};var m=(p<=i?(0,S.of)(0):(0,im.O)(p-i)).pipe((0,ee.M)(()=>this.emitTyping(e,!0)),(0,f4.w)()),f=(0,im.O)(v-i).pipe((0,ee.M)(()=>{this.heldMessages[e]-=1,this.heldMessages[e]||this.emitTyping(e,!1)}),(0,eP.u)(void 0));return(0,K.h)(m,f)}holdUntilMessageShown(e,s){var{messageId:t}=e;return void 0===t?(0,im.O)(s.messageArrivalGrace).pipe((0,eP.u)(void 0)):(0,K.h)(this.messageShown.pipe((0,ea.p)(e=>e===t)),(0,im.O)(s.maximumDelay+s.messageArrivalGrace)).pipe((0,g.s)(1),(0,eP.u)(void 0))}emitTyping(e,s){if(!s){delete this.typingDelays[e],this.emitEvent(br,{sender:e});return}this.emitEvent(bt,{sender:e,delay:this.typingDelays[e]})}}bn.shared=(0,P.G)(e=>new bn(e));var bd=t(93580),bo=t(56662),bu=t(51932),bl=t(77813);class bc{start(e){e.add(iK.g.shared().deepLink.pipe((0,ea.p)(e=>"profile"===e.type&&!!e.args.purchase),(0,I.n)(()=>e6.c.shared().profileId),(0,ea.p)(e=>!!e),(0,I.n)(()=>aw.r.shared().name),(0,ea.p)(e=>!e),(0,g.s)(1),(0,bl.Q)(bu.E),(0,g.s)(1),(0,I.n)(()=>v0.J.shared().refillBalance({name:e2.N.ProfileDeepLink})),(0,dv.Q)(nD.t.shared().visible.pipe((0,su.J)(),(0,ea.p)(e=>{var[s,t]=e;return!0===s&&!1===t})))).safeSubscribe())}}bc.shared=(0,P.G)(()=>new bc);var bh=t(91162),bp=t(50167);class bv{constructor(e){this.userId=e}start(e){e.add(bh.T.shared().cancelled.safeSubscribe(e=>{bp.N.shared(this.userId).logSendingCancelled(e.attendeeId,e.cheer.reference)}))}}bv.shared=(0,P.G)(e=>new bv(e));class bm{constructor(e){this.userId=e}start(e){e.add((0,D.z)([ro.J.shared(this.userId).status.pipe((0,su.J)(),(0,w.T)(e=>{var[s,t]=e;return"idle"!==t&&"ringing"!==t&&("idle"===s||"ringing"===s)}),(0,ev.F)()),hV.d.shared().visible]).pipe((0,w.T)(e=>{var[s,t]=e;return t&&s}),(0,ev.F)(),(0,ea.p)(e=>e)).safeSubscribe(()=>{this.close()})),e.add(hi.q.shared().menuItemClicked.safeSubscribe(()=>{this.close()}))}close(){C.Y.shared().get(eg.A).actions.close("video-clips-overlay")}}bm.shared=(0,P.G)(e=>new bm(e));var bf=t(1779),bb="video-clips-overlay",bg="video-clips",bI="daily-views";
3function bw(e,s){return e.userId===s.userId&&e.basename===s.basename}function bS(e){return new Date(e).toISOString().split("T")[0]}class by{constructor(e){this.viewsToStoreSubject=new sp.B,this.viewsLoaded=!1,this.storedViews=null,this.userId=e}start(e){e.add(this.viewsToStoreSubject.pipe((0,dg.H)(e=>tN.w.shared(bg,this.userId).store(bI,e).asObservable().pipe((0,rD.y)()))).safeSubscribe()),e.add(q.e.shared(this.userId).hasActiveSubscription.pipe((0,ev.F)(),(0,I.n)(e=>e?k.w:bf.y.shared(this.userId).current.pipe((0,b.o)())),(0,dg.H)(e=>this.resolve(e).asObservable().pipe((0,rD.y)()))).safeSubscribe())}resolve(e){return eJ.v.zip(T.T.shared().videoClips.dailyViewsLimit.toSingle(),sr.E.shared().currentTime()).pipe((0,eY.Fg)(s=>{var[t,r]=s;if(!Number.isFinite(r))return eJ.v.just(void 0);var a=bS(r);return this.loadViews().pipe((0,eY.Fg)(()=>{var s=this.viewsForDay(a);return s.some(s=>bw(s,e))?eJ.v.just(void 0):s.length>=t?this.present(e,a):(this.confirmView(e,a),eJ.v.just(void 0))}))}))}loadViews(){return this.viewsLoaded?eJ.v.just(void 0):tN.w.shared(bg,this.userId).load(bI).pipe((0,eY.ex)(e=>{this.viewsLoaded=!0,this.storedViews=e}),(0,eY.AB)(void 0))}viewsForDay(e){var s;return(null==(s=this.storedViews)?void 0:s.day)===e?this.storedViews.clips:[]}confirmView(e,s){var t=this.viewsForDay(s),r=t.some(s=>bw(s,e))?t:[...t,e];this.storedViews={day:s,clips:r},this.viewsToStoreSubject.next({day:s,clips:r})}present(e,s){return eJ.v.defer(()=>(this.closeOverlay(),v0.J.shared().refillBalance({name:e2.N.ViewVideoClip,attendeeId:e.userId}).toSingle().pipe((0,eY.Fg)(t=>t.isSuccessful?this.openOverlay(e.key).pipe((0,eY.Fg)(()=>sr.E.shared().currentTime()),(0,eY.ex)(t=>this.confirmView(e,Number.isFinite(t)?bS(t):s)),(0,eY.AB)(void 0)):eJ.v.just(void 0)))))}closeOverlay(){C.Y.shared().get(eg.A).actions.close(bb)}openOverlay(e){var s=C.Y.shared().get(eg.A);return s.store.rxState().pipe((0,ea.p)(e=>!e)).toSingle().pipe((0,eY.Fg)(()=>eJ.v.delay(0)),(0,eY.ex)(()=>s.actions.open(bb,[{props:{initialClipKey:e},disableManualClose:!0}])))}}by.shared=(0,P.G)(e=>new by(e));var bA=t(971);class bT{start(e){e.add(this.createFixationPipes("profile","user-profile").safeSubscribe()),e.add(this.createFixationPipes("search","search-page").safeSubscribe()),e.add(this.createFixationPipes("loyalty","loyalty-page").safeSubscribe()),e.add(this.createFixationPipes("match-feed","users-match-feed-page").safeSubscribe()),e.add(this.createFixationPipes("dating-family-showcase","dating-family-showcase-page").safeSubscribe())}createFixationPipes(e,s){return(0,iq.v)(()=>{var t,r=!1,a=0,i=document.getElementById(s),n=(0,$.E)("command.scroll."+e+".fix").pipe((0,ee.M)(()=>{r||(a=window.scrollY,t=i.style.top,i.style.top=-a+"px",window.scrollTo(0,0),r=!0)})),d=(0,$.i)("command.scroll."+e+".unfix").pipe((0,ee.M)(()=>{r&&(i.style.top=t,requestAnimationFrame(()=>{window.scrollTo(0,a),r=!1}))})),o=(0,$.i)("command.scroll."+e+".top").pipe((0,ee.M)(()=>{try{window.jQuery("html, body").animate({scrollTop:0},"slow")}catch(e){window.scrollTo({top:0,behavior:"smooth"})}}));return(0,K.h)(n,d,o).pipe((0,w.T)(()=>void 0))})}}bT.shared=(0,P.G)(()=>new bT);var bx=t(56824),bC={"users.examined":"usersExamined","users.examined..non.customer":"usersExaminedNonCustomer"};class bF{constructor(e){this.lastWinkedAt=new Map,this.userId=e}start(e){e.add((0,D.z)([e6.c.shared().profileId,el.j.shared().chatAttendee,rn.N.shared(this.userId).blockedUsers]).pipe((0,I.n)(e=>{var[s,t,r]=e;return!s||s===this.userId||t||r.includes(s)?(0,S.of)(!1):(0,S.of)(null).pipe((0,pr.c)(100),(0,I.n)(()=>(0,D.z)([(0,S.of)(s),q.e.shared(this.userId).hasPurchases])))}),(0,I.n)(e=>{if(!e)return(0,S.of)(!1);var[s,t]=e;return t?this.sendWink(s,"users.examined"):rG.n.shared(this.userId).userInContacts(s).pipe((0,I.n)(e=>e?k.w:this.sendWink(s,"users.examined..non.customer")))})).safeSubscribe())}sendWink(e,s){return(0,D.z)([T.T.shared().winks[bC[s]].trackTime,T.T.shared().winks[bC[s]].throttleTime]).toSingle().pipe((0,eY.Fg)(t=>{var[r,a]=t;return this.canWink(e,s,a)?eJ.v.just().pipe((0,eY.Ow)(r),(0,eY.Fg)(()=>bx.HU.shared(e).presence.toSingle()),(0,eY.Fg)(t=>t.online?uW.T.shared(this.userId).wink(e,s).pipe((0,eY.ex)(()=>{this.lastWinkedAt.set(e+":"+s,Date.now()),l.A.emit("command.annals.add","winks",{sender:this.userId,recipient:e,event:s})})):eJ.v.just())):eJ.v.just()}
3))}canWink(e,s,t){var r=this.lastWinkedAt.get(e+":"+s);return!r||Date.now()-r>=t}}bF.shared=(0,P.G)(e=>new bF(e));var bD=5*eF.b.second;class bk{constructor(){this.bootstrapped=new Z.t(!1).asObservable()}start(e){sH.X.shared(),J.R.shared().start(e),s1.shared().start(e),s5.shared().start(e),lm.T.shared().start(e),eT.E.shared().start(e),aM.$.shared().start(e),aV.shared().start(e),aJ.shared().start(e),a$.shared().start(e),a4.shared().start(e),a6.shared().start(e),ie.shared().start(e),nH.shared().start(e),n2.shared().start(e),is.shared().start(e),ia.shared().start(e),window&&window.self===window.top&&eX.shared().start(e),o1.shared().start(e),mv.shared().start(e),sn.o.shared().start(e),e$.jq.shared().setPreloadDelay(bD).start(e),si.shared().start(),e1.shared().start(e),eS.shared().start(e),ew.shared().start(e),et.shared().start(e),eo.shared().start(e),e8.shared().start(e),e7.shared().start(e),al.E.shared().start(e),aj.shared().start(e),hk.L.shared().start(e),aO.shared().start(e),aI.shared().start(e),ao.shared().start(e),lc.shared().start(e),uE.shared().start(e),uR.shared().start(e),uM.shared().start(e),hD.C.shared().start(e),hc.e.shared().start(e),nu.shared().start(e),nf.shared().start(e),lG.$.shared().start(e),uZ.shared().start(e),rQ.shared().start(e),iR.shared().start(e),u5.x.shared().start(e),c6.shared().start(e),cX.shared().start(e),tP.D.shared().start(e),aD.N.shared().start(e),hj.shared().start(e),h3.shared().start(e),ps.shared().start(e),pj.shared().start(e),pK.X.shared().start(e),p8.shared().start(e),vT.q.shared().start(e),mj.shared().start(e),mO.shared().start(e),mk.shared().start(e),mN.shared().start(e),fI.shared().start(e),fH.shared().start(e),fZ.shared().start(e),f$.a.shared().start(e),bT.shared().start(e),e.add(p.Session.shared().userId.pipe((0,I.n)(s=>s?new y.c(()=>{var t=new u.yU;return l$.shared(s).start(t),ct.shared(s).start(t),ub.shared(s).start(t),iL.shared(s).start(t),iZ.shared(s).start(t),f.I.shared(s).start(t),sC.s.shared(s).start(t),sD.o.shared(s).start(t),lX.shared(s).start(t),sF.v.shared(s).start(t),fE.x.shared(s).start(t),e4.shared(s).start(t),vQ.shared(s).start(t),sa.shared(s).start(t),fC.shared(s).start(t),iv.shared(s).start(t),eb.shared(s).start(t),tb.shared(s).start(t),rh.shared(s).start(t),rv.shared(s).start(t),rf.shared(s).start(t),rc.J.shared("profile").start(t),rc.J.shared("chat").start(t),nN.m.shared(s).start(t),nS.shared(s).start(t),oQ.a.shared(s).start(t),fK.B.shared(s).start(t),nz.shared(s).start(t),sh.shared(s).start(t),tn.Z.shared(s).start(t),oV.shared(s).start(t),tl.shared(s).start(t),sd.u.shared(s).start(t),so.J.shared(s).start(t),sc.shared(s).start(t),lz.shared(s).start(t),lV.shared(s).start(t),h0.Y.shared(s).start(t),rr.u.shared(s).start(t),hT.shared(s).start(t),tI.shared(s).start(t),tT.shared(s).start(t),tD.shared(s).start(t),tR.shared(s).start(t),tM.shared(s).start(t),tG.e.shared(s).start(t),mD.shared(s).start(t),eZ.V.shared(s).start(t),du.shared(s).start(t),u1.shared(s).start(t),lk.shared(s).start(t),t9.shared(s).start(t),rt.shared(s).start(t),tB.A.shared(s).start(t),aN.shared(s).start(t),iO.q.shared(s).start(t),r3._.shared(s).start(t),ui.q.shared(s).start(t),un.Y.shared().start(t),ta.shared(s).start(t),ti.p.shared(s).start(t),sL.shared(s).start(t),sQ.shared(s).start(t),sJ.shared(s).start(t),vb.shared(s).start(t),vI.shared(s).start(t),ne.shared(s).start(t),nt.shared(s).start(t),lW.shared(s).start(t),m1.shared(s).start(t),hK.shared(s).start(t),hn.shared(s).start(t),af.shared(s).start(t),tp.shared(s).start(t),c8.shared(s).start(t),sS.shared(s).start(t),sA.shared(s).start(t),v9.A.shared(s).start(t),sx.shared(s).start(t),sZ.shared(s).start(t),s$.shared(s).start(t),s3.shared(s).start(t),r8.shared(s).start(t),r9.shared(s).start(t),iS.m.shared(s).start(t),iw.shared(s).start(t),tX.shared(s).start(t),t3.shared(s).start(t),tY.h.shared(s).start(t),tJ.w.shared(s).start(t),t2.n.shared(s).start(t),t6.shared(s).start(t),hh.b.shared(s).start(t),mR.g.shared(s).start(t),ua.shared(s).start(t),sk.o.shared(s).start(t),iA.shared(s).start(t),hY.shared(s).start(t),iF.shared(s).start(t),rC.M.shared(s).start(t),rR.shared(s).start(t),rM.shared(s).start(t),s7.shared(s).start(t),ra.i.shared(s).start(t),dL.shared(s).start(t),dQ.shared(s).start(t),rS.shared(s).start(t),rw.shared(s).start(t),sR.shared(s).start(t),ry.sE.shared(s).start(t),rx.shared(s).start(t),ni.shared(s).start(t),ls.shared(s).start(t),rP.shared(s).start(t),r_.shared(s).start(t),bc.shared().start(t),rz.A.shared(s).start(t),r$.W.shared(s).start(t),rK.g.shared(s).start(t),r0.K.shared(s).start(t),vw.M.shared(s).start(t),rZ.shared(s).start(t),rJ.q.shared(s).start(t),rW.L.shared(s).start(t),rH.o.shared(s).start(t),r5.C.shared(s).start(t),r1.U.shared(s).start(t),te._.shared(s).start(t),ih.shared(s).start(t),rq.shared(s).start(t),l0.shared(s).start(t),l8.shared(s).start(t),ce.shared(s).start(t),cs.shared(s).start(t),l3.shared(s).start(t),hF.shared(s).start(t),rG.n.shared(s).start(t),vH.shared(s).start(t),au.shared(s).start(t),ng.K.shared(s).start(t),na.shared(s).start(t),nb.s.shared(s).start(t),oP.shared(s).start(t),o_.N.shared(s).start(t),oJ.shared(s).start(t),ut.shared(s).start(t),lw.shared(s).start(t),o8.O.shared(s).start(t),o9.shared(s).start(t),mB.shared(s).start(e),u8.shared(s).start(t),u3.shared().start(t),uv.shared(s).start(t),uH.shared(s).start(t),ft.shared(s).start(t),fr.shared(s).start(t),e3.w.shared().start(t),ug.h.shared(s).start(t),uG.shared(s).start(t),uP.shared(s).start(t),X.shared(s).start(t),rY.shared(s).start(t),o7.T.shared(s).start(t),lg.shared(s).start(t),uu.shared(s).start(t),uc.shared(s).start(t),uK.shared(s).start(t),uC.shared(s).start(t),o2.shared(s).start(t),ld.shared(s).start(t),hI.shared(s).start(t),lY.shared(s).start(t),cZ.q.shared(s).start(t),cK.shared(s).start(t),c5.shared(s).start(t),h$.shared(s).start(t),vF.shared(s).start(t),fp.shared(s).start(t),fB.shared(s).start(t),f_.shared(s).start(t),er.g.shared().start(t),lr.shared().start(t),fn.shared(s).start(t),tk.G.shared(s).start(t),di.shared(s).start(t),fo.shared(s).start(t),fc.shared(s).start(t),fh.shared(s).start(t),ff.shared(s).start(t),nL.shared(s).start(t),nq.Q.shared(s).start(t),nV.shared(s).start(t),n4.shared(s).start(t),mT.shared(s).start(t),n6.Y.shared(s).start(t),uV.shared(s).start(t),uU.shared(s).start(t),uz.shared(s).start(t),n9.shared(s).start(t),nw.x.shared(s).start(t),ln.shared(s).start(t),oM.shared(s).start(t),lv.shared(s).start(t),lA.shared(s).start(t),lC.shared(s).start(t),lD.shared(s).start(t),mV.shared(s).start(t),lM.shared(s).start(t),de.shared(s).start(t),hN.shared(s).start(t),dt.shared(s).start(t),i1.shared(s).start(t),ci.shared(s).start(t),cf.shared(s).start(t),cw.shared(s).start(t),cy.shared(s).start(t),cx.shared(s).start(t),cB.shared(s).start(t),cW.shared(s).start(t),he.shared(s).start(t),hr.shared(s).start(t),hu.shared(s).start(t),u9.shared().start(t),pt.d.shared(s).start(t),pn.shared(s).start(t),hl.F.shared(s).start(t),hf.shared(s).start(t),hy.shared(s).start(t),hC.shared(s).start(t),hH.shared(s).start(t),hO.
3shared(s).start(t),hR.shared(s).start(t),hL.shared(s).start(t),hQ.shared(s).start(t),h1.shared(s).start(t),cA.shared(s).start(e),pd.o.shared(s).start(t),ph.shared(s).start(t),pv.shared(s).start(t),pf.shared(s).start(t),pI.shared(s).start(e),pS.shared(s).start(t),py.shared(s).start(t),me.shared(s).start(t),mt.shared(s).start(t),pT.shared(s).start(t),h7.shared(s).start(t),pD.shared(s).start(t),pE.shared().start(t),pN.shared(s).start(t),hp.v.shared(s).start(t),pY.o.shared(s).start(t),pL.Q.shared(s).start(t),pU.B.shared(s).start(t),mW.shared(s).start(t),pQ.po.shared(s).start(t),pV.shared(s).start(t),pH.shared(s).start(t),mr.p.shared(s).start(t),mi.shared(s).start(t),vL.shared(s).start(t),p$.shared(s).start(t),vA.shared(s).start(t),vC.shared(s).start(t),vD.shared(s).start(t),vk.shared(s).start(t),vE.shared(s).start(t),p9.shared(s).start(t),vs.shared(s).start(t),ve.shared(s).start(t),vr.shared(s).start(t),vi.shared(s).start(t),vo.shared(s).start(t),vl.shared(s).start(t),vp.shared(s).start(t),vj.w.shared(s).start(t),vR.shared(s).start(t),vO.Z.shared(s).start(t),vM.shared(s).start(t),vP.shared(s).start(t),vz.shared(s).start(t),io.shared(s).start(t),il.shared(s).start(t),vV.shared(s).start(t),vY.shared(s).start(t),vK.shared(s).start(t),v1.shared(s).start(t),v2.shared(s).start(t),v6.shared(s).start(t),mg.shared(s).start(t),mI.w.shared(s).start(t),mw.H.shared(s).start(t),my.shared(s).start(e),mC.shared(s).start(e),aU.c.shared(s).start(t),mM.H.shared(s).start(t),mP.shared(s).start(t),mJ.shared().start(e),mH.shared(s).start(e),mZ.shared(s).start(e),m$.shared(s).start(t),mK.shared(s).start(t),nc.shared(s).start(t),np.shared(s).start(t),m9.shared(s).start(t),m7.P.shared(s).start(t),fb.shared(s).start(t),tU.shared(s).start(t),ay.shared(s).start(t),aA.K.shared().start(t),aC.shared(s).start(t),ak.shared(s).start(t),fA.shared(s).start(t),fk.shared(s).start(t),fY.shared(s).start(t),fj.shared(s).start(t),fM.shared(s).start(t),fz.S.shared(s).start(t),fq.shared(s).start(t),fJ.shared(s).start(t),fW.mK.shared(s).start(t),f0.shared(s).start(t),bm.shared(s).start(t),by.shared(s).start(t),bA.h.shared(s).start(t),f1.shared(s).start(t),f8.shared(s).start(t),bn.shared(s).start(t),f3.shared(s).start(t),bd.l.shared(s).start(t),bo.H.shared(s).start(t),bv.shared(s).start(t),bF.shared(s).start(t),t}):k.w)).subscribe())}}bk.shared=(0,P.G)(()=>new bk);class bE{constructor(){this.activeTabSubject=new Z.t(null),this.active=this.activeTabSubject.asObservable()}activate(e){this.activeTabSubject.next(e)}}bE.shared=(0,P.G)(()=>new bE);var bj=t(53748).A,bR=(0,d.memo)(()=>((0,d.useEffect)(()=>{var e=new u.yU;return bk.shared().start(e),()=>{e.unsubscribe()}},[]),null));let bO=(function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return e=>t=>((0,d.useEffect)(()=>(s.forEach(e=>e.init(C.Y.shared(),t)),()=>{s.forEach(e=>e.dispose(C.Y.shared()))}),[]),(0,F.jsx)(e,Object.assign({},t)))})(new v,new m.A,new x,new class extends bj{constructor(){super(...arguments),this.onPageOpen=e=>{"search"===e&&bE.shared().activate("profiles")}}init(){l.A.sync("command.page.open",this.onPageOpen)}dispose(){l.A.removeListener("command.page.open",this.onPageOpen)}},new Y)(bR),bM=function(e,s){if(e===s)return!0;if(!e||!s)return e===s;var t=Object.keys(e),r=Object.keys(s),a=t.length;if(a!==r.length)return!1;for(var i=0;i<a;i++){var n=t[i];if(e[n]!==s[n])return!1}return!0};var bG=t(25858),bB=t.n(bG);class bP extends o{constructor(e){super(e),this.onChangeOverlayState=e=>{var s=bB()(e);s?delete s.anchor:s=null,null!=this.overlayChangeTimerId&&clearTimeout(this.overlayChangeTimerId),this.overlayChangeTimerId=setTimeout(this.updateCurrentInterfaces,100,"overlay",s)},this.onChangeSidebar=e=>{this.updateCurrentInterfaces("sidebar",e)},this.onChangePage=e=>{var s;s="profile"===e.name&&null==e.params?null:e,this.updateCurrentInterfaces("page",s)},this.updateCurrentInterfaces=(e,s)=>{if(!bM(this.interfaces[e],s)){var t=Object.assign({},this.interfaces,{[e]:s});this.addAnalyticData(Object.assign({changed:e},t,{userTimestamp:new Date().getTime()})),this.interfaces=t}},this.sendAnalyticData=()=>
3{this.analyticActionsQueue.forEach(e=>{this.analyticsBus.emit("command.analytics.application.screen.send",e)}),this.analyticActionsQueue=[],this.analyticTimerId=null},this.analyticsBus=l.A.create("analytics"),this.overlayStore=C.Y.shared().get(eg.A,null).store,this.analyticActionsQueue=[],this.overlayChangeTimerId=null,this.analyticTimerId=null,this.interfaces={overlay:null,page:null,sidebar:null}}componentDidMount(){this.overlayStore.listen(this.onChangeOverlayState),l.A.sync("document.sidebar",this.onChangeSidebar),l.A.sync("document.page",this.onChangePage)}componentWillUnmount(){this.overlayStore.unlisten(this.onChangeOverlayState),l.A.removeListener("document.sidebar",this.onChangeSidebar),l.A.removeListener("document.page",this.onChangePage)}addAnalyticData(e){this.analyticActionsQueue.push(e),this.analyticTimerId&&clearTimeout(this.analyticTimerId),this.analyticTimerId=setTimeout(this.sendAnalyticData,1042)}}function b_(e){return function(s){return!!(s&&s[e])}}var bz=[{name:"delivered",encounter:"delivered",map:e=>!!e},{name:"success",encounter:"sent",map:e=>!!e&&!!e.success},{name:"failure-reason",encounter:["api.error.got","sent","completed"],map:e=>e.completed["failure-reason"]?e.completed["failure-reason"]:void 0!==e["api.error.got"]?"api":e.sent?e.sent["failure-reason"]?e.sent["failure-reason"]:null:"no-sent-confirmation"},{name:"api-reason",encounter:"api.error.got",map:e=>e?""+Math.floor(e.error.status/100):null},{name:"iosapp",encounter:"presence.devices.got",map:b_("iosapp")},{name:"androidapp",encounter:"presence.devices.got",map:b_("androidapp")},{name:"webapp",encounter:"presence.devices.got",map:b_("webapp")}],bN={label:"dialogs.messages.text.send",tags:bz.concat([{name:"cta",encounter:"added",map:e=>e.cta||"other"},{name:"team",map:()=>"core"}]),hist:[{name:"ttdeliver",from:"added",to:"delivered"},{name:"ttresult",from:"added",to:"sent"},{name:"ttresult",from:"added",to:"completed"}]},bL={label:"dialogs.messages.cheer.send",tags:bz.concat([{name:"cta",encounter:"added",map:e=>e.cta||"other"},{name:"reference-name",encounter:"added",map:e=>{if(e.reference){var[s,t]=e.reference.split(":");if("cheer"===s){var r=t.split("/");return r[r.length-1]}}return null}},{name:"team",map:()=>"vg"}]),hist:[{name:"ttdeliver",from:"added",to:"delivered"},{name:"ttresult",from:"added",to:"sent"},{name:"ttresult",from:"added",to:"completed"}]},bq={label:"dialogs.messages.sticker.send",tags:bz.concat([{name:"group",encounter:"added",map:e=>e.group||"unknown"},{name:"reference-name",encounter:"added",map:e=>{if(e.reference){var[s,t]=e.reference.split(":");if("sticker"===s)return t}return null}},{name:"team",map:()=>"core"}]),hist:[{name:"ttdeliver",from:"added",to:"delivered"},{name:"ttresult",from:"added",to:"sent"},{name:"ttresult",from:"added",to:"completed"}]},bV={label:"dialogs.messages.usermedia.send",tags:bz.concat([{name:"media-type",encounter:"added",map:e=>e["media-type"]},{name:"team",map:()=>"core"}]),hist:[{name:"ttdeliver",from:"added",to:"delivered"},{name:"ttresult",from:"added",to:"sent"},{name:"ttresult",from:"added",to:"completed"},{name:"ttupload",from:"added",to:"sent"}]};function bQ(e){return function(s){return!!(s&&s[e])}}var bU={label:"dialogs.letters.send",tags:[{name:"cta",encounter:"added",map:e=>e.cta||"other"},{name:"delivered",encounter:"delivered",map:e=>!!e},{name:"success",encounter:"sent",map:e=>!!e&&!!e.success},{name:"failure-reason",encounter:["api.error.got","sent","completed"],map:e=>e.completed["failure-reason"]?e.completed["failure-reason"]:e.sent?e.sent["failure-reason"]?e.sent["failure-reason"]:e["api.error.got"]?"api":null:"no-sent-confirmation"},{name:"api-reason",encounter:"api.error.got",map:e=>e?""+Math.floor(e.error.status/100):null},{name:"iosapp",encounter:"presence.devices.got",map:bQ("iosapp")},{name:"androidapp",encounter:"presence.devices.got",map:bQ("androidapp")},{name:"webapp",encounter:"presence.devices.got",map:bQ("webapp")},{name:"team",map:()=>"core"}],hist:[{name:"ttdeliver",from:"added",to:"delivered"},{name:"ttupload",from:"added",to:"uploaded"},{name:"ttresult",from:"added",to:"sent"},{name:"ttresult",from:"added",to:"completed"}]},bY=t(10945),bJ=t(75013),bW=t(9209),bH=t.n(bW);class bX{constructor(){this.getEncounterDetails=(e,s,t)=>{var r=this.getEncounter(s,t);return r?r[e]:void 0},this.getDescription=(0,bY.A)(this.getEncounterDetails,"description"),this.getTimestamp=(0,bY.A)(this.getEncounterDetails,"timestamp"),this.prepareAndSend=(e,s)=>{try{var t=this.config[e];if(!t)return;var r={label:t.label};t.tags&&(r.tags=this.createTags(s,t.tags)),t.hist&&(r.hist=this.createHist(s,t.hist));var a=s.reduce(function(e,s){var{label:t,description:r}=s;return"completed"===t&&(e=!!r.incomplete),e},!1),[i]=s.filter(e=>{var{label:s}=e;return"added"===s}).map(e=>{var{timestamp:s}=e;return s}),n=s.filter(e=>!!e&&e.timestamp<i).length;r.tags=bH().recursive(!0,bJ.k.shared().sharedTags(i&&new Date(i)),{incomplete:a,"negative-encounters-count":n},r.tags),n>0&&(r.label=r.label+"-negative-hist"),l.A.emit("command.metrics.send",r)}catch(t){console.error("Could not prepare metric from configs descriptor",e,s,t)}},this.config={"dialogs.messages.text.send":bN,"dialogs.messages.cheer.send":bL,"dialogs.messages.sticker.send":bq,"dialogs.messages.usermedia.send":bV,"dialogs.letters.send":bU},l.A.sync("event.actions.completed",this.prepareAndSend),bJ.k.shared()}destroy(){l.A.removeListener("event.actions.completed",this.prepareAndSend)}getEncounter(e,s){return e.find(e=>e.label===s)}mapTag(e,s){var t={};return Array.isArray(s.encounter)?s.encounter.forEach(s=>{t[s]=this.getDescription(e,s)}):s.encounter&&(t=this.getDescription(e,s.encounter)),s.map(t,e)}createHist(e,s){var t={};
3return Array.isArray(s)?s.forEach(s=>{!t[s.name]&&(t[s.name]=this.getTimestamp(e,s.to)-this.getTimestamp(e,s.from),(null===t[s.name]||void 0===t[s.name]||Number.isNaN(t[s.name])||t[s.name]<0)&&delete t[s.name])}):Object.keys(s).forEach(r=>{!t[r]&&(t[r]=this.getTimestamp(e,s[r].to)-this.getTimestamp(e,s[r].from),(null===t[r]||void 0===t[r]||Number.isNaN(t[r])||t[r]<0)&&delete t[r])}),t}createTags(e,s){var t={};if(Array.isArray(s))return s.forEach(s=>{t[s.name]=this.mapTag(e,s),(null===t[s.name]||void 0===t[s.name])&&delete t[s.name]}),t;var r={};return e.forEach(s=>{r[s.label]=this.getDescription(e,s.label)}),Object.keys(s).forEach(a=>{t[a]=s[a](r,e),(null===t[a]||void 0===t[a])&&delete t[a]}),t}}var bZ=t(95990);class b$ extends o{constructor(e){super(e),this.send=e=>{bZ.q.shared().send(e).safeSubscribe()},this.pipe=null}componentDidMount(){l.A.sync("command.metrics.send",this.send),this.pipe=new bX,this.subscription=new u.yU}componentWillUnmount(){this.subscription&&this.subscription.unsubscribe(),this.pipe.destroy(),l.A.removeListener("command.metrics.send",this.send)}}var bK=t(79208),b0=t(11427);let b1=class{constructor(e,s){var{addAction:t,addEncounter:r,completeAction:a}=s;this.onSendRequestComplete=(e,s,t)=>{var{tag:r}=t;if(!this["timeout-config-key"])throw Error("Please add timeout config key for instance");var{"ui-metrics":{[this["timeout-config-key"]]:a}}=L.T.shared();s?(this.addEncounter(r,e,{label:"api.error.got",error:{status:s.status}}),this.completeAction(r,e)):setTimeout(()=>{this.completeAction(r,Date.now())},a)},this.onSendMessageToApi=(e,s)=>{var{tag:t,status:r}=s,a=2===r;this.addEncounter(t,e,{label:"sent",success:!a,"failure-reason":a?"no-credits":null}),a&&this.completeAction(t,e)},this.onMessageDelivery=(e,s)=>{var{tag:t}=s;this.addEncounter(t,e,{label:"delivered"}),this.completeAction(t,e)},this.flux=e,this.timeouts=new Map,this.addAction=t,this.addEncounter=r,this.completeAction=a,l.A.addMarker("event.dialogs.messages.send.request.completed",this.onSendRequestComplete),l.A.addMarker("message:message:v2",this.onSendMessageToApi),l.A.addMarker("event.dialogs.messages.delivered",this.onMessageDelivery)}destroy(){l.A.removeMarker("event.dialogs.messages.send.request.completed",this.onSendRequestComplete),l.A.removeMarker("message:message:v2",this.onSendMessageToApi),l.A.removeMarker("event.dialogs.messages.delivered",this.onMessageDelivery)}sendDevices(e,s,t){bx.HU.shared(s).presence.pipe((0,g.s)(1)).subscribe(s=>{var r=(s.online?s.devices:[{name:"undefined"}]).reduce((e,s)=>(e[s.name]=!0,e),{});this.addEncounter(e,t,Object.assign({label:"presence.devices.got"},r))})}};class b5 extends b1{constructor(){super(...arguments),this.onInteractionDetected=(e,s)=>{s.forEach(s=>{var{place:t,recipient:r,tag:a,cta:i}=s;"messages.text.send"===t&&(this.addAction(a,e,{cta:i}),this.sendDevices(a,r,e))})},Object.defineProperty(this,"timeout-config-key",{value:"text-timeout",writable:!1}),l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected)}destroy(){super.destroy(),l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected)}}b5.actionName="dialogs.messages.text.send";class b3 extends b1{constructor(){super(...arguments),this.onInteractionDetected=(e,s)=>{s.forEach(s=>{var{place:t,recipient:r,tag:a,reference:i,cta:n}=s;"messages.cheer.send"===t&&(this.addAction(a,e,{reference:i,cta:n}),this.sendDevices(a,r,e))})},Object.defineProperty(this,"timeout-config-key",{value:"cheers-timeout",writable:!1}),l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected)}destroy(){super.destroy(),l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected)}}b3.actionName="dialogs.messages.cheer.send";class b2 extends b1{constructor(){super(...arguments),this.onInteractionDetected=(e,s)=>{s.forEach(s=>{var{place:t,recipient:r,tag:a,reference:i,group:n}=s;"messages.sticker.send"===t&&(this.addAction(a,e,{reference:i,group:n}),this.sendDevices(a,r,e))})},Object.defineProperty(this,"timeout-config-key",{value:"stickers-timeout",writable:!1}),l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected)}destroy(){super.destroy(),l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected)}}b2.actionName="dialogs.messages.sticker.send";class b8 extends b1{constructor(){var e;super(...arguments),e=this,this.onStartUpload=function(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;t.forEach(t=>{e.addAction(t.id,s,{"media-type":r}),e.sendDevices(t.id,t.attendee,s)})},this.onErrorUpload=function(s,t,r,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];
3i.forEach(r=>{e.addEncounter(r.id,s,{label:"api.error.got",error:{status:t}}),e.completeAction(r.id,s)})},Object.defineProperty(this,"timeout-config-key",{value:"usermedia-timeout",writable:!1}),l.A.addMarker("event.file.uploading.chat",this.onStartUpload),l.A.addMarker("event.upload.file.error.chat",this.onErrorUpload)}destroy(){super.destroy(),l.A.removeMarker("event.file.uploading.chat",this.onStartUpload),l.A.removeMarker("event.upload.file.error.chat",this.onErrorUpload)}}b8.actionName="dialogs.messages.usermedia.send";class b4{constructor(e,s){var{addAction:t,addEncounter:r,completeAction:a}=s;this.onInteractionDetected=(e,s)=>{s.forEach(s=>{var{place:t,recipient:r,tag:a,cta:i}=s;"letter.send"===t&&(this.addAction(a,e,{cta:i}),this.sendDevices(a,r,e))})},this.onFilesUploaded=(e,s)=>{var{tag:t}=s;this.addEncounter(t,e,{label:"uploaded"})},this.onSendLetterToApi=(e,s)=>{var{tag:t,status:r}=s,a=2===r;this.addEncounter(t,e,{label:"sent",success:!a,"failure-reason":a?"no-credits":null}),a&&this.completeAction(t,e)},this.onSendRequestComplete=(e,s,t)=>{var{tag:r}=t,{"ui-metrics":{"letter-timeout":a}}=L.T.shared();s&&this.addEncounter(r,e,{label:"api.error.got",error:{status:s.status}}),setTimeout(e=>{this.completeAction(e,Date.now())},a,r)},this.onLetterDelivery=(e,s)=>{var{tag:t}=s;this.addEncounter(t,e,{label:"delivered"}),this.completeAction(t,e)},this.flux=e,this.addAction=t,this.addEncounter=r,this.completeAction=a,l.A.addMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.addMarker("event.dialogs.letters.send.request.completed",this.onSendRequestComplete),l.A.addMarker("event.dialogs.letters.files.uploaded",this.onFilesUploaded),l.A.addMarker("message:message:v2",this.onSendLetterToApi),l.A.addMarker("event.dialogs.messages.delivered",this.onLetterDelivery)}destroy(){l.A.removeMarker("command.user-actions.interaction.track",this.onInteractionDetected),l.A.removeMarker("event.dialogs.letters.send.request.completed",this.onSendRequestComplete),l.A.removeMarker("event.dialogs.letters.files.uploaded",this.onFilesUploaded),l.A.removeMarker("message:message:v2",this.onSendLetterToApi),l.A.removeMarker("event.dialogs.messages.delivered",this.onLetterDelivery)}sendDevices(e,s,t){bx.HU.shared(s).presence.pipe((0,g.s)(1)).safeSubscribe(s=>{var r=(s.online?s.devices:[{name:"undefined"}]).reduce((e,s)=>(e[s.name]=!0,e),{});this.addEncounter(e,t,Object.assign({label:"presence.devices.got"},r))})}}b4.actionName="dialogs.letters.send";var b6=[b5,b3,b2,b8,b4];class b9 extends o{constructor(e){var s;super(e),s=this,this.addAction=function(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0;Array.isArray((0,b0.A)([e,t],s.actions))&&s.completeAction(e,t,Date.now(),{"failure-reason":"cancelled-by-action",success:!1}),s.actions[e]=s.actions[e]||{},s.actions[e][t]=[{label:"added",timestamp:r,description:a}],i&&(s.timers[e]=s.timers[e]||{},s.timers[e][t]=setTimeout(()=>{s.completeAction(e,t,Date.now(),{"failure-reason":"timeout",success:!1})},i))},this.addEncounter=function(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,b0.A)([e,t],s.actions);Array.isArray(i)&&i.push({label:a.label||i.length,timestamp:r,description:a})},this.completeAction=function(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,b0.A)([e,t],s.actions);Array.isArray(i)&&(i.push({label:"completed",timestamp:r,description:a}),l.A.emit("event.actions.completed",e,i),s.timers[e]&&s.timers[e][t]&&(clearTimeout(s.timers[e][t]),delete s.timers[e][t]),delete s.actions[e][t],0===Object.keys(s.actions[e]).length&&delete s.actions[e])},this.flux=C.Y.shared(),this.actions={},this.pipes=[],this.timers={}}componentDidMount(){l.A.sync("command.actions.add",this.addAction),l.A.sync("command.actions.encounters.add",this.addEncounter),l.A.sync("command.actions.complete",this.completeAction),b6.forEach(e=>{this.pipes.push(new e(this.flux,this.composeMetricsLifeCycleMethods(e.actionName)))}),this.subcribtion=new u.yU,this.subcribtion.add(bK.f.shared().terminated.subscribe(()=>
3{Object.keys(this.actions).forEach(e=>{Object.keys(this.actions[e]).forEach(s=>{this.completeAction(e,s,Date.now(),{"failure-reason":"app-closed",success:!1,incomplete:!0})})})}))}componentWillUnmount(){l.A.removeListener("command.actions.add",this.addAction),l.A.removeListener("command.actions.encounters.add",this.addEncounter),l.A.removeListener("command.actions.complete",this.completeAction),this.subcribtion&&this.subcribtion.unsubscribe(),this.pipes.forEach(e=>e.destroy())}composeMetricsLifeCycleMethods(e){var s=this;return{addAction:function(t){for(var r=arguments.length,a=Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];return t&&s.addAction(e,t.toString(),...a)},addEncounter:function(t){for(var r=arguments.length,a=Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];return t&&s.addEncounter(e,t.toString(),...a)},completeAction:function(t){for(var r=arguments.length,a=Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];return t&&s.completeAction(e,t.toString(),...a)}}}}class b7 extends d.Component{constructor(){super(...arguments),this.state={active:!1}}componentDidMount(){this.setState({active:!0})}shouldComponentUpdate(e,s){return s.active!==this.state.active}render(){return this.state.active?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bP,{}),(0,F.jsx)(b9,{}),(0,F.jsx)(b$,{})]}):null}}class ge extends o{render(){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bO,{}),(0,F.jsx)(b7,{})]})}}ge.displayName="services"}}]);
4//# sourceMappingURL=sourcemaps/6134.cb8b8a40f60fef54.js.map
5//# debugId=b1106f6d-f047-5e1b-bce6-5704e3236c41

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.