window.onerror = function g(e,t,n,o,r){r&&r.error&&(r=r.error),r&&r instanceof Error||(r={}),r.stack=r.stack||"empty",r.message="Bundle init error: "+e+" error.message: "+r.message,r.columnNumber=o,r.lineNumber=n,r.url=t,window.parent.__jivoOnError(r)};window.base_langpack = {"botListPickerBlock":"Use one of the buttons in chat to answer","botTransferChat":"Agent was invited to the chat","botTyping":"Reply in progress","businessCopyright":"Business Messenger by {0}","byYandex":"by Yandex","callback_delayed_button_submit":"Sсhedule a сall","callback_delayed_period_as_possible":"As soon as possible","callback_delayed_period_delimiter":"at","callback_delayed_period_today":"Today","callback_delayed_period_tomorrow":"Tomorrow","callback_delayed_submit_fail":"Unable to schedule a call for the specified time. Please try again.","callback_delayed_submit_success":"Thank you! We'll give you a call at the specified time","callback_delayed_title":"When should we call you back?","campaign_popup_tim_days":"days","campaign_popup_timer_hours":"hours","campaign_popup_timer_minutes":"minutes","campaign_popup_timer_seconds":"seconds","cancel":"Cancel","captchaPlaceholder":"Enter text from image","captchaPlaceholderAgain":"Enter text again","cb_loading":"Loading...","chat_agent_join":"_AGENT_ has been invited to the chat","chat_agent_left":"_AGENT_ has left the chat","chat_on_site":"Chat with","cobrowseError":"Error - the link is out of date or the element is not found","continue":"Сontinue","conversation_with":"Talking to agent","cwPopupPutPhone":"Leave a phone number","cwPopupTime":"Call you back at your convenience","cw_callAfter":"Receive a callback in","cw_callButtonText":"Call me","cw_callHeader":"Instant Callback","cw_call_forward":"Thank you for ordering a callback! Our staff will call you back as soon as possible.","cw_call_to":"Calling","cw_code_restrict":"We can't call this number","cw_connecting":"Connecting...","cw_enterPhonePlaceholder":"Enter your phone number","cw_errInfoText":"Please try calling again or contact us via live chat","cw_form_second":"second","cw_form_secondd":"seconds","cw_form_seconds":"seconds","cw_pickUpPhone":"Please pick up the phone","cw_rate_limit":"The call to the specified number is not possible","cw_reason_all_busy":"All agents are busy","cw_reason_is_busy":"All agents are busy","cw_reason_not_picked_up":"The number is not available","cw_reason_unavailable":"Service is unavailable","cw_repeatCall":"call again","cw_repeatCallAgain":"Call again","cw_thxForCall":"Thank you for your call!","cw_typeInChat":"Chat with us","cw_unableToConnect":"Failed connection?","cw_weCalling":"We're calling you","cw_weRecallAfter":"We'll call you in","c_callDisconnected":"Call ended","defCallformTitle":"Leave your number and we'll give you a call in _SEC_ seconds","defOfflineFormText":"Hi. \nHave any questions? Ask away!","defOfflineFormText2":"Hi. \nHave any questions? Ask away!","defOfflineFormText_old":"Please leave your message in the form below and we'll reply by e-mail","defOfflineWidgetLabel":"Send us a message","defOfflineWidgetLabelMobile":"Message","defOnlineWidgetLabel":"Chat with us, we're online!","defOnlineWidgetLabelMobile":"Chat","defRuleInvitationText":"Hello! How may I help you?","defRuleRetaining":"Please wait. All agents are busy right now, but soon someone should be free to help you!","defRuleRetainingEmail":"No need to wait on the site, get notified by e-mail!","disconnect_msg":"No internet connection...","downloadChatText":"Download the chat log","enterEmailPlaceholder":"Enter your email address","error_message_sending":"Sending","error_resend":"retry sending?","error_send":"Not delivered","eula_checkbox_text":"I {link} to terms and conditions of personal data processing","eula_custom_agreement":"I agree that my personal data, provided via chat, will be processed for the purpose of receiving online support and consultation.","eula_custom_title":"I agree to provide my personal data","eula_link":"User Agreement","eula_phone":"Call to number ","file_upl_cancel":"Upload was cancelled","file_upl_download":"Download","file_upl_error":"Upload error","file_upl_error_max_size":"Error – maximum file size is _FILESIZE_","file_upl_error_no_ext":"Error – please choose a file with an extension","file_upl_expired":"The link is out of date","introduce_in_chat":"Introduce yourself in chat","introduce_or":"or","introduce_social":"Log in with","introduce_text":"Hello, while the agent is typing an answer, please introduce yourself","invalid_email":"Invalid email. Please, try again. ","invoiceEmail":"Email address to receive the purchase receipt","label_fb_text":"Messаge us on Facebook","label_vk_text":"Message in VK.com","lbAbcText":"Apple Messages","lblCallMe":"Call","lblCaptcha":"Type text here","lblCaptchaError":"Error, please try again","lblConnectedToAgent":"Please enter your message","lblDeclineFile":"Reject","lblDefaultCobrowseComment":"Please note","lblEnterMessageHere":"Enter your message","lblEnterMessageOrPhoneHere":"Start chat or enter phone number (we'll call you back instantly)","lblEvaluateCancel":"Cancel","lblEvaluatePlease":"Please rate the service quality","lblEvaluateThanks":"Thank you!","lblHangUp":"Hang up","lblIntroduceName":"Your name","lblIntroduceRequest":"Please introduce yourself in chat","lblIntroduceRequestBefore":"Introduce yourself and chat!","lblLeaveMessage":"Send us a message","lblMessageHere":"Type here","lblMessagesApp":"Chat with us in Messages app","lblNewMessage":"New message!","lblOfflineMessageSend":"Message was sent","lblOperatorsOnline":"Agents are online!","lblPencilHint":"Agent is typing a message","lblPhoto":"Photo","lblPwrBy":"Powered by JivoChat","lblReceiveFile":"Accept","lblReply":"Reply","lblSelectDep":"Select Department","lblSend":"Send","lblSendBefore":"Start Chat","lblSendingFile":"_AGENT_ is sending you file: _FILE_","lblThanks":"Thank you! 🎉","lblThankYouMessage":"Thank you for your message! We'll contact you as soon as possible","lblTransferred":"Chat was transferred to agent _AGENT_","lblView":"View","lblYou":"You","lblYourEmail":"Your email","lblYourMessage":"Your message","lblYourPhone":"Your phone","lnkCloseThisWindow":"Close","mailing_checkbox_text":"I {link} to receive newsletters. For further information consult the privacy policy","maintenanceBlockedPlaceholder":"Chat is unavailable","maintenanceSystemText":"The chat is temporarily unavailable while we perform scheduled maintenance on our servers. \nIt will be available again soon. Thank you for your patience.","messageDeleted":"Message was deleted","messageEdit":"edited","offlineAgentConnected":"The agent has joined the chat","offlineBlockedInputPlaceholder":"Fill the contact form above","offlineForceOfflineMessage":"Oops, it seems that our agents are not available now. You can leave your message here in chat and they will contact you soon.","offlineIntroductionText":"Please fill in your contact information to send this message.","offlineSuccessContactsSubmit":"Your message is being sent over to the team. They'll be in touch soon. ","omni_sb_link":"Salute","onlineChat":"Online Chat","paymentsInvoice":"Invoice #","paymentsPay":"Pay","paymentsSuccess":"payment successful","phone_mask_search_placeholder":"Country name or number code","popupLogoText":"Works via","powerBtnMenuTitle":"How would you like to contact us?","prechatText":"Hello!","prechatText2":"Hey, I need some assistance.","prechatText3":"Hi, can you guide me?","proactiveReplyTitle":"Chat reply time","rateFormCommentTitle":"Your comment","rateFormFinishText":"We are glad that you liked it","rateFormFinishTextNegative":"We strive to do the best service for you. We have something to work on.","rateFormFinishTitle":"Thanks for the feedback","rateFormText":"How satisfied are you with the operator's answers?","rateFormTitle":"Leave your feedback","rate_default_condition_name":"chat_finished","rate_default_condition_value":null,"rate_default_rate_type":"two","reconnect_msg":"Internet connection has been restored","searchNotFound":"Not found","seo_copyrightTextNew":"Live Chat Powered by {0}","service_from":"Powered by","social_fb":"in Facebook","social_get_access":"No need to wait on our site, \nreceive a reply on VK.com!","social_get_access_fb":"No need to wait on our site, receive a reply on Facebook Messenger!","social_get_access_sb":"Point the phone's camera on QR-code to continue this chat in Salute App","social_im":"Message us","social_online_text":"Agents are online and will reply soon","social_process_in":"Continue on","social_process_in_fb":"Continue on","social_process_in_sb":"Continue the chat on","social_process_vk":"Continue on ​_ICON_​vk.com","social_success_email":"Thanks! We'll reply to _EMAIL_ and in this chat","social_success_fb":"Messenger is now connected! 👍 \nFrom now on, we'll reply on Messenger and on this chat, even if you leave the site","social_success_sb":"Salute connected! 👍\nYou can continue in the Salute app. Dialog is saving in both chats","social_success_vk":"VK connected! 👍 If you leave the site, we'll reply on VK and in this chat","social_text_1":"Typically replies instantly","social_text_2":"Typically replies in minutes","social_text_3":"Typically replies within an hour","social_text_4":"Typically replies in a few hours","social_text_5":"Typically replies within a day","social_vk":"VK","today":"Today","tryAgain":"Try again","webrtc_accept_text":"Take a call through the website and ask a question over your microphone or headset. Your camera is not needed.","webrtc_call":"Call","webrtc_callfinished":"Completed","webrtc_call_end":"Call completed","webrtc_call_inprogress":"Call in progress","webrtc_choose_mic":"Choose a microphone","webrtc_error":"Сonnection error","webrtc_from_site":"Website call","webrtc_mic":"Microphone","webrtc_mic_blocked":"Allow access to the microphone in your browser settings","webrtc_need_mic_access":"Allow access to the microphone to talk","webrtc_not_now":"Not now","webrtc_rejected":"Rejected by user","webrtc_start_call":"Start a call","webrtc_try_again":"Try again","webrtc_video_text_message":"I would like to get a video consultation","webrtc_video_text_popup":"Request video consultation","webrtc_wrong":"Something went wrong","word_consent":"consent","yesterday":"Yesterday"};!function(){var e,t,n,r,i={29829:function(e,t,n){"use strict";n.r(t),n.d(t,{EnhancerArray:function(){return w},MiddlewareArray:function(){return D},SHOULD_AUTOBATCH:function(){return Fe},TaskAbortError:function(){return ve},__DO_NOT_USE__ActionTypes:function(){return o.Kf},addListener:function(){return Me},applyMiddleware:function(){return o.md},autoBatchEnhancer:function(){return He},bindActionCreators:function(){return o.DE},clearAllListeners:function(){return xe},combineReducers:function(){return o.UY},compose:function(){return o.qC},configureStore:function(){return R},createAction:function(){return N},createAsyncThunk:function(){return ee},createDraftSafeSelector:function(){return E},createEntityAdapter:function(){return q},createImmutableStateInvariantMiddleware:function(){return A},createListenerMiddleware:function(){return Ne},createNextState:function(){return i.ZP},createReducer:function(){return W},createSelector:function(){return a.P1},createSerializableStateInvariantMiddleware:function(){return x},createSlice:function(){return H},createStore:function(){return o.MT},current:function(){return i.Vk},findNonSerializableValue:function(){return k},freeze:function(){return i.vV},getDefaultMiddleware:function(){return P},getType:function(){return B},isAction:function(){return L},isAllOf:function(){return ie},isAnyOf:function(){return re},isAsyncThunkAction:function(){return de},isDraft:function(){return i.mv},isFluxStandardAction:function(){return F},isFulfilled:function(){return ce},isImmutableDefault:function(){return O},isPending:function(){return se},isPlain:function(){return I},isPlainObject:function(){return T},isRejected:function(){return le},isRejectedWithValue:function(){return ue},legacy_createStore:function(){return o.jB},miniSerializeError:function(){return Q},nanoid:function(){return K},original:function(){return i.Js},prepareAutoBatched:function(){return je},removeListener:function(){return Pe},unwrapResult:function(){return te}});var r,i=n(12902),o=n(83105),a=n(20573),s=n(53894),l=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]",value:e};if("object"!=typeof e||null===e)return!1;if(null==o?void 0:o.has(e))return!1;for(var s=null!=r?r(e):Object.entries(e),l=i.length>0,u=function(e,s){var u=t?t+"."+e:e;if(l&&i.some((function(e){return e instanceof RegExp?e.test(u):u===e})))return"continue";return n(s)?"object"==typeof s&&(a=k(s,u,n,r,i,o))?{value:a}:void 0:{value:{keyPath:u,value:s}}},c=0,d=s;c-1}function B(e){return""+e}function U(e){var t,n={},r=[],i={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=t,i},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[n,r,t]}function W(e,t,n,r){void 0===n&&(n=[]);var o,a="function"==typeof t?U(t):[t,n,r],s=a[0],l=a[1],u=a[2];if("function"==typeof e)o=function(){return S(e())};else{var d=S(e);o=function(){return d}}function f(e,t){void 0===e&&(e=o());var n=c([s[t.type]],l.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[u]),n.reduce((function(e,n){if(n){var r;if((0,i.mv)(e))return void 0===(r=n(e,t))?e:r;if((0,i.o$)(e))return(0,i.ZP)(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return f.getInitialState=o,f}function H(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:S(e.initialState),i=e.reducers||{},o=Object.keys(i),a={},s={},l={};function u(){var t="function"==typeof e.extraReducers?U(e.extraReducers):[e.extraReducers],n=t[0],i=void 0===n?{}:n,o=t[1],a=void 0===o?[]:o,l=t[2],u=void 0===l?void 0:l,c=v(v({},i),s);return W(r,(function(e){for(var t in c)e.addCase(t,c[t]);for(var n=0,r=a;n0){var o=t.filter((function(t){return function(t,n,r){var i=r.entities[n.id],o=Object.assign({},i,n.changes),a=V(o,e),s=a!==n.id;return s&&(t[n.id]=a,delete r.entities[n.id]),r.entities[a]=o,s}(r,t,n)})).length>0;o&&(n.ids=Object.keys(n.entities))}}function a(t,r){var i=$(t,e,r),a=i[0];o(i[1],r),n(a,r)}return{removeAll:(s=function(e){Object.assign(e,{ids:[],entities:{}})},l=G((function(e,t){return s(t)})),function(e){return l(e,void 0)}),addOne:G(t),addMany:G(n),setOne:G(r),setMany:G((function(e,t){for(var n=0,i=e=z(e);n-1;return n&&r}function ae(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function se(){for(var e=[],t=0;t0)for(var f=e.getState(),p=Array.from(n.values()),h=0,g=p;h{t[r]={};var i="";n[1]&&(t[r].style=n[1]),(0,c.each)(n[0],((t,n)=>{i+=t?(e.style?e.style[n]:n)+" ":""}))," "===i.charAt(i.length-1)&&(i=i.substr(0,i.length-1)),t[r].className=i})),t}},{key:"getRenderData",value:function(){}},{key:"renderData",value:function(){}},{key:"render",value:function(){var e=this.getRenderData(),t=this.getClasses(e);return this.renderData(e.data||{},t)}},{key:"componentWillUnmount",value:function(){this.off(),this.emitter.removeAllListeners()}}]),n}(u.default.Component);t.default=g},50789:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.ApiProvider=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(96394)),s=n(97615),l=n(44145),u=n(95911),c=n(31343),d=n(23267);const f=new(function(){function e(){(0,i.default)(this,e)}return(0,o.default)(e,[{key:"getCustomerIoInvites",value:function(e,t){let n=s.EnvironmentManager.isDevelopment()&&a.default.mockRequests&&a.default.mockRequests.customerIO?"/app/configs/development/customerIO.json":this.getApiHost()+`/api/1/sites/${a.default.site_id}/widgets/${a.default.widget_id}/invitation/`;a.default.customerIOurl&&s.EnvironmentManager.isTesting()&&(n=a.default.customerIOurl),this.sendApiRequest(n,{user_token:e},t)}},{key:"acceptWebRTCCall",value:function(e,t){const n=(0,l.getClient)(),r=this.getTelephonyHost()+`/api/1/sites/${a.default.site_id}/widgets/${a.default.widget_id}/clients/${n.clientId.split(".")[0]}/telephony/widget-call/accept`;this.sendPostApiRequest(r,{call_id:e},t)}},{key:"declineWebRTCCall",value:function(e,t){const n=(0,l.getClient)(),r=this.getTelephonyHost()+`/api/1/sites/${a.default.site_id}/widgets/${a.default.widget_id}/clients/${n.clientId.split(".")[0]}/telephony/widget-call/decline`;this.sendPostApiRequest(r,{call_id:e},t)}},{key:"sendClientAttributes",value:function(e,t,n){const r=this.getApiHost()+`/api/1/sites/${a.default.site_id}/widgets/${a.default.widget_id}/clients/${t.split(".")[0]}/attributes`;u.xhrRequest.post(r,n,{headers:{"Content-Type":c.CONTENT_TYPE.X_WWW_FORM,authorization:t.split(".")[1]},body:e})}},{key:"sendApiRequest",value:function(e,t,n){u.xhrRequest.get(e,n,{params:t})}},{key:"sendPostApiRequest",value:function(e,t,n){u.xhrRequest.post(e,n,{headers:{"Content-Type":c.CONTENT_TYPE.X_WWW_FORM},body:t})}},{key:"getApiHost",value:function(){return(0,d.getProtocol)()+"//"+a.default.api_host}},{key:"getTelephonyHost",value:function(){return(0,d.getProtocol)()+"//"+a.default.tel_host}}]),e}());t.ApiProvider=f},86961:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(96394)),s=n(97615),l=n(44145),u=n(95911),c=n(31343),d=n(45683);let f=function(){function e(){(0,i.default)(this,e)}return(0,o.default)(e,null,[{key:"getHeaders",value:function(){const e=(0,l.getClient)();return{"x-jv-client-id":e.clientId,"x-visitor-id":e.visitorId}}},{key:"getStatus",value:function(e){this.getChatServerData("status",{},e)}},{key:"getVisitorNumber",value:function(e){this.getChatServerData("visitor_number",{},e)}},{key:"getMessages",value:function(e,t){this.getChatServerData("messages",e,t)}},{key:"getChatServerData",value:function(e,t,n){const r=(0,l.getClient)(),i=r.visitorId?`/${r.visitorId}`:"",o=this.shouldMockRequest(e)?`/app/configs/development/${e}.json`:(0,d.getChatServerHost)()+`/widget/${e}/${a.default.site_id}/${a.default.widget_id}${i}`;this.sendChatServerRequest(o,t,n)}},{key:"getHistoryMessages",value:function(e,t,n){const r=this.shouldMockRequest("new_messages")?"/app/configs/development/new_messages.json":(0,d.getChatServerHost)()+`/client/${a.default.site_id}/${a.default.widget_id}/${e}`;this.sendChatServerRequest(r,t,n,this.getHeaders())}},{key:"sendChatServerRequest",value:function(e,t,n,r){u.xhrRequest.get(e,n,{headers:r,params:t})}},{key:"postClientTags",value:function(e,t){const n=(0,d.getChatServerHost)()+`/client/${a.default.site_id}/${a.default.widget_id}/attach_tags`,r=this.getHeaders(),i={tag_id:e};r["Content-Type"]=c.CONTENT_TYPE.APP_JSON,u.xhrRequest.post(n,t,{headers:r,body:i})}},{key:"postCampaignData",value:function(e,t){var n,r,i,o;const s=(0,d.getChatServerHost)()+`/client/${a.default.site_id}/${a.default.widget_id}/campaign`,l=this.getHeaders(),f={campaign_id:e.campaignId,type:e.type,answer_data:JSON.stringify(null!==(n=e.answerData)&&void 0!==n?n:{}),rate:null!==(r=e.rate)&&void 0!==r?r:0,comment:null!==(i=e.comment)&&void 0!==i?i:"",client_answer_id:null!==(o=e.clientAnswerId)&&void 0!==o?o:null};l["Content-Type"]=c.CONTENT_TYPE.APP_JSON,u.xhrRequest.post(s,t,{headers:l,body:f})}},{key:"shouldMockRequest",value:function(e){return s.EnvironmentManager.isDevelopment()&&a.default.mockRequests&&a.default.mockRequests[e]}}]),e}();t.default=f},44733:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isJvKeyForStoreToGet=t.StorageProvider=void 0;var i=r(n(67375)),o=r(n(96394)),a=n(38632),s=n(10895),l=n(39731),u=n(38392),c=n(53401);const d=o.default.widget_id,f=e=>(e=>/^jv_/.test(e))((0,i.default)(e,1)[0]),p=e=>/^jv_store/.test(e);t.isJvKeyForStoreToGet=p;const h=(e,t)=>{const n=`jv_${e}_${d}`;return t?`${n}_${t}`:n},g=e=>{if((e=>/^store_[a-z]*$/.test(e))(e)){const t=(0,l.splitString)(e,"_"),n=(0,i.default)(t,2),r=n[0],o=n[1];return h(r,o)}return h(e)},_={get:e=>a.parentLS.get(g(e)),set:(e,t)=>a.parentLS.set(g(e),t),remove:e=>a.parentLS.remove(g(e)),migrate:(0,s.compose)((e=>e.forEach((e=>{let t=(0,i.default)(e,2),n=t[0],r=t[1];const o=p(n)?(0,l.splitString)(n,"_")[0]:n;a.parentLS.set(o,r),(0,c.deleteCookie)(n)}))),(e=>e.filter(f)),c.splitCookieOnEntries),createKeyForStore:e=>`store_${e}`,duplicateClientStateInCookie:e=>{const t=h("store",`client_${d}`),n=(0,u.pick)(e,"client_id","jv_sess_id","user_token","visitorId");return(0,c.setCookie)(t,n)}};t.StorageProvider=_},20758:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(96394)),s=n(16016),l=n(21951),u=n(44733),c=n(69882),d=n(9393),f=n(90991),p=n(52028),h=n(23267);const g=n(89766).EventEmitter,_=1500;var m=new(function(){function e(){if((0,i.default)(this,e),this.readMessages={},this.lastBufferUpdatedTime=(new Date).getTime(),this.initBufferFn=(0,f.debounce)(this.initBuffer.bind(this),500),this.initBuffer(),this.emitter=new g,(0,c.isWixEditor)()||p.isDesignerEditor)return;const t=(0,h.getPageWindow)();(0,l.addListener)(t,"storage",(e=>{(e||t.event).key==="jv_eBuffer_"+a.default.widget_id&&this.parseNewEvents()}))}return(0,o.default)(e,[{key:"initBuffer",value:function(){const e=u.StorageProvider.get("eBuffer")||[],t=this.filterOldEvents(e);(0,d.each)(t,(e=>{this.readMessages[e.id]})),e.length!==t.length&&u.StorageProvider.set("eBuffer",t)}},{key:"sendEvent",value:function(e,t){const n={time:(new Date).getTime(),id:(0,s.generateGUIDCount)(2),name:e,data:t||{}},r=this.filterOldEvents(u.StorageProvider.get("eBuffer")||[]);r.push(n),this.readMessages[n.id]=!0,u.StorageProvider.set("eBuffer",r),setTimeout((()=>{this.initBufferFn()}),1505)}},{key:"filterOldEvents",value:function(e){var t=[];return(0,d.each)(e,(e=>{(new Date).getTime()-e.time>_?delete this.readMessages[e.id]:t.push(e)})),t}},{key:"parseNewEvents",value:function(){const e=u.StorageProvider.get("eBuffer");e&&(0,d.each)(e,(e=>{!this.readMessages[e.id]&&(new Date).getTime()-e.time<_&&this.triggerEvent(e)}))}},{key:"triggerEvent",value:function(e){this.readMessages[e.id]=!0,this.emitter.emit("tabsEvent_"+e.name,e.data)}},{key:"on",value:function(e,t){return this.emitter.addListener("tabsEvent_"+e,t)}}]),e}());t.default=m},34973:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(6131)),s=n(16016),l=n(44733),u=n(92560),c=n(90991),d=n(9393),f=r(n(20758)),p=n(52028),h=n(97615);const g=r(n(4855)).default.name("ArrayStore"),_=n(89766).EventEmitter;let m=function(){function e(t){(0,i.default)(this,e),this.settings=t,this.emitter=new _,this.store=[],this.initArrayStore(),this.protectOthersTabs(),this.triggerFn=(0,c.debounce)(this.trigger,100)}return(0,o.default)(e,[{key:"initArrayStore",value:function(){const e=l.StorageProvider.get(this.settings.name+"_items")||[];(0,d.each)(e,(e=>{if(!l.StorageProvider.get(e))return;const t=new(this.settings.itemClass||a.default)({type:this.settings.type,name:e,keys:this.settings.keys});this.addTriggers(t),this.store.push(t),this.sort()}))}},{key:"addTriggers",value:function(e){e.on("all",(()=>{this.trigger("update",e)})),e.on("destroy",this.onRemoveItem.bind(this,e))}},{key:"push",value:function(e){const t=this.createInst(e);return this.addTriggers(t),t.set(e),this.store.push(t),this.sort(),this.backup(t),this.triggerFn("create",t),t.unStorage&&t.unStorage()||f.default.sendEvent(`${this.settings.name}_addArrayItem`,{name:t.getName()}),t}},{key:"createInst",value:function(e){let t=this.settings.type;(e.body&&e.body.unsave||p.isDesignerEditor)&&(t="memory");let n={};const r=this.settings.itemClass||a.default;for(let e=0;e<3&&(n=new r({type:t,name:(0,s.generateGUIDCount)(2),keys:this.settings.keys}),!(n instanceof r));e++);return n}},{key:"sort",value:function(){}},{key:"pushAll",value:function(e){var t=[];return(0,d.each)(e,(e=>{t.push(this.push(e))})),t}},{key:"getAll",value:function(){return this.store}},{key:"toJSON",value:function(){var e=[];return(0,d.each)(this.store,(t=>{e.push(t.toJSON())})),e}},{key:"each",value:function(e){(0,d.each)(this.store,(t=>{e(t.toJSON(),t)}))}},{key:"onRemoveItem",value:function(e){const t=this.store.findIndex((t=>t===e));this.store.splice(t,1),this.trigger("remove"),this.backup(),f.default.sendEvent(`${this.settings.name}_removeArrayItem`,{name:e.getName()})}},{key:"backup",value:function(){const e=[];(0,d.each)(this.store,(t=>{t.unStorage&&t.unStorage()||e.push(t.getName())})),l.StorageProvider.set(this.settings.name+"_items",e.length?e:[])}},{key:"protectOthersTabs",value:function(){f.default.on(`${this.settings.name}_addArrayItem`,(e=>{const t=new(this.settings.itemClass||a.default)({type:this.settings.type,name:e.name,keys:this.settings.keys});(0,u.isEmpty)(t)?g.warn(`${this.settings.name}_addArrayItem inst is empty!`,e,t):(this.addTriggers(t),this.store.push(t),this.sort(),this.trigger("create",t,!0))})),f.default.on(`${this.settings.name}_removeArrayItem`,(e=>{const t=this.store.findIndex((t=>t.getName()===e.name));t>=0&&(this.store.splice(t,1),this.sort(),this.trigger("remove"))}))}},{key:"trigger",value:function(e,t,n){setTimeout((()=>{this.emitter.emit(e,t,n)}),0)}},{key:"itemTrigger",value:function(){}},{key:"on",value:function(e,t){return this.emitter.addListener(e,t)}},{key:"onItem",value:function(e){return this.emitter.addListener(`${this.settings.name}_update`,cb)}},{key:"destroy",value:function(){const e=this.store;this.store=[],e.forEach((e=>{e.destroy()})),this.backup(),this.trigger("remove")}}]),e}();t.default=m,h.EnvironmentManager.isDevelopment()&&(window.parent.ArrayStore=m)},66547:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(9393),s=r(n(73687));const l=r(n(4855)).default.name("SessionStore","color: grey"),u="sess_";var c=new(function(){function e(){(0,i.default)(this,e),l.log("init session store"),this.sessionKeysList=this.initSessionKeysList(),this.startTimer()}return(0,o.default)(e,[{key:"initSessionKeysList",value:function(){return s.default.getKeysByPrefix(s.default.getPrefix()+u)}},{key:"set",value:function(e,t){-1===this.sessionKeysList.indexOf(e)&&this.sessionKeysList.push(e),s.default.set(u+e,t,43200)}},{key:"get",value:function(e){return s.default.get(u+e)}},{key:"startTimer",value:function(){setInterval((()=>{l.log("startTimer",this.sessionKeysList),(0,a.each)(this.sessionKeysList,(e=>{const t=this.get(e);t&&(l.log("update session",e,t),this.set(e,t))}))}),6e4)}}]),e}());t.default=c},6131:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(4855)),s=n(16016),l=r(n(20758)),u=n(44733),c=n(97615),d=n(60277),f=n(9393),p=n(73422),h=n(47361);const g=a.default.name("Store"),_=n(89766).EventEmitter,m=[];let v=function(){function e(t){(0,i.default)(this,e);if(this.registrName(t.name))return g.warn("Dublicate name for Store keyName"),{};this.settings=t,this.store=this.getDefaultKeys(),this.emitter=new _,"session"===t.type?this.initSessionStore():"default"===t.type?this.initDefaultStore():"memory"===t.type&&this.initMemoryStore(),this.protectOthersTabs(),this.allKeysUpdateDebounce=(0,h.debounce)(this.allKeysUpdate,150)}return(0,o.default)(e,[{key:"registrName",value:function(e){return m.indexOf(e)>-1||(m.push(e),!1)}},{key:"initDefaultStore",value:function(){var e=u.StorageProvider.get(this.settings.name)||{};this.store=(0,d.extend)(this.store,e)}},{key:"initMemoryStore",value:function(){}},{key:"initSessionStore",value:function(){let e=u.StorageProvider.get(this.settings.name)||{};if(e){g.log("resetSession store");var t=(0,s.generateGUIDCount)(2);e=this.store,e._id=t,e._clearTime=(new Date).getTime()+5e3,u.StorageProvider.set(this.settings.name,e),l.default.sendEvent(`${this.settings.name}_resetSessionStore`)}this.store=e}},{key:"getDefaultKeys",value:function(){var e={};return(0,f.each)(this.settings.keys,((t,n)=>{"function"==typeof t?e[n]=t():null!==t&&"{}"!==JSON.stringify(t)&&(e[n]=t)})),e}},{key:"isDeepName",value:function(e){return"string"==typeof e&&e.split(".").length>1}},{key:"getDeepName",value:function(e){const t=e.split(".");return this.isDeepName(e)?t:[e]}},{key:"set",value:function(e,t){if(!(0,p.isObject)(e))return this.setKey(e,t);(0,f.each)(e,((e,t)=>{this.set(t,e)}))}},{key:"setDeepKey",value:function(e,t,n){if("string"==typeof n&&(n=n.split(".")),!(n.length>1))return null===t?delete e[n[0]]:e[n[0]]=t,t;{const r=n.shift();(0,p.isObject)(e[r])||(e[r]={}),this.setDeepKey(e[r],t,n)}}},{key:"setKey",value:function(e,t,n){return void 0===this.settings.keys[this.getDeepName(e)[0]]?(g.error("Error: set not initialized key "+e),null):(this.get(e)===t||(this.isDeepName(e)?this.setDeepKey(this.store,t,e):null===t?delete this.store[e]:this.store[e]=t,this.trigger(e,t),n||this.triggerAndBackup(e)),t)}},{key:"get",value:function(e){return this.isDeepName(e)?void 0===this.settings.keys[this.getDeepName(e)[0]]?(g.error("Error: get not initialized key "+e),null):this.findObj(this.store,e):void 0===this.settings.keys[e]?(g.error("Error: get not initialized key "+e),null):this.store[e]||null}},{key:"findObj",value:function(e,t){const n=t.split(".");let r,i=e;for(r=0;r{e.name===this.settings.name&&this.setKey(e.keyName,e.val,!0)})),l.default.on(`${this.settings.name}_resetSessionStore`,(()=>{this.store={}}))}},{key:"getName",value:function(){return this.settings.name}}]),e}();var y=v;t.default=y,c.EnvironmentManager.isDevelopment()&&(window.parent.Store=v)},73687:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(9393),s=r(n(96394)),l=n(44733),u=n(38632);const c=r(n(4855)).default.name("TempStore","color: grey"),d="temp_";var f=new(function(){function e(){(0,i.default)(this,e),this.cleanExpiredKeys()}return(0,o.default)(e,[{key:"set",value:function(e,t,n){if(c.log("set",e,t,n),!n)throw new Error("cant set in TempStore without seconds");if(null===t)return c.log("remove key on data",e),void l.StorageProvider.remove(d+e);t={val:t,expire:(new Date).setTime((new Date).getTime()+1e3*n)},l.StorageProvider.set(d+e,t)}},{key:"get",value:function(e){const t=l.StorageProvider.get(d+e);return t&&t.expire?t.expire<(new Date).getTime()?null:t.val:t}},{key:"cleanExpiredKeys",value:function(){const e=this.getKeysByPrefix(d);(0,a.each)(e,(e=>{const t=d+e,n=l.StorageProvider.get(t);n&&n.expire&&n.expire<(new Date).getTime()&&(c.log("delete key on init expire:",t),l.StorageProvider.remove(t))}))}},{key:"getKeysByPrefix",value:function(e){const t=[],n=u.parentLS;if(n)for(const r in n)if(r&&0==r.search(new RegExp("^jv_"+e))){const n=r.replace(`jv_${e}`,"").replace(`_${s.default.widget_id}`,"");t.push(n)}return t}},{key:"getPrefix",value:function(){return d}}]),e}());t.default=f},97939:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BotType=void 0;t.BotType={DEFAULT:"default",ASSISTANT:"assistant"}},34445:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatStatus=void 0;t.ChatStatus={STARTUP:"startup",STARTUP_OK:"startup_ok",STARTUP_ERROR:"startup_error",RESUME_OK:"resume_ok"}},4425:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatMode=void 0;t.ChatMode={OFFLINE:"offline",ONLINE:"online"}},18073:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emojiList=void 0;t.emojiList={angel:"1f607",unicorn_face:"1f984",confused:"1f615",rage:"1f621",imp:"1f608",disappointed:"1f61e",kissing_heart:"1f618",yum:"1f60b",disappointed_relieved:"1f625",weary:"1f629",grin:"1f601",laughing:"1f606",wink:"1f609",sunglasses:"1f60e",neutral_face:"1f610",winking_eye:"1f61c",hushed:"1f62e",thumbsup:"1f44d",thumbsdown:"1f44e",smile:"1f603"}},87884:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;t.Environment={PRODUCTION:"production",DEVELOPMENT:"development",TESTING:"testing"}},12494:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileUploadError=void 0;t.FileUploadError={FILE_SIZE_EXCEEDED:"FILE_SIZE_EXCEEDED",RESTRICTED_FILE_TYPE:"RESTRICTED_FILE_TYPE",NO_EXTENSION:"NO_EXTENSION",REQUEST_FAILED:"REQUEST_FAILED",UPLOAD_CANCELED:"UPLOAD_CANCELED"}},6211:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Limits=void 0;t.Limits={STATS_CHUNK_LIMIT:40}},57930:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Locator=void 0;t.Locator={LABEL_COPYRIGHT_POPUP:"LABEL_COPYRIGHT_POPUP",HEADER:"HEADER",HEADER_TEXT:"HEADER_TEXT",HEADER_LEAF:"HEADER_LEAF",HEADER_AGENT_NAME:"HEADER_AGENT_NAME",HEADER_AGENT_POSITION:"HEADER_AGENT_POSITION",HEADER_AVATAR:"HEADER_AVATAR",HEADER_AVATAR_ANON:"HEADER_AVATAR_ANON",CHAT_AVATAR:"CHAT_AVATAR",CHAT_AVATAR_ANON:"CHAT_AVATAR_ANON",HEADER_CALLBACK_BUTTON:"HEADER_CALLBACK_BUTTON",CHAT_COPYRIGHT:"CHAT_COPYRIGHT",INPUT:"INPUT",INPUT_SUBMIT:"INPUT_SUBMIT",FILE_UPLOAD:"FILE_UPLOAD",CONTACTS_FORM:"CONTACTS_FORM",CONTACTS_FORM_NAME:"CONTACTS_FORM_NAME",CONTACTS_FORM_PHONE:"CONTACTS_FORM_PHONE",CONTACTS_FORM_EMAIL:"CONTACTS_FORM_EMAIL",CONTACTS_FORM_SUBMIT:"CONTACTS_FORM_SUBMIT",CONTACTS_FORM_INPUT:"CONTACTS_FORM_INPUT",CALLBACK_BUTTON:"CALLBACK_BUTTON",CALLBACK_VIDEO_BUTTON:"CALLBACK_VIDEO_BUTTON",WA_BUTTON:"WA_BUTTON",CLOSE_BUTTON:"CLOSE_BUTTON",POWER_BUTTON:"POWER_BUTTON",MOBILE_POPUP_CLOSE_BUTTON:"MOBILE_POPUP_CLOSE_BUTTON",INPUT_MORE_BTN:"INPUT_MORE_BTN",INPUT_EMOJI_PANEL:"INPUT_EMOJI_PANEL",INPUT_UPLOAD_ICON:"INPUT_UPLOAD_ICON",RATE_TITLE:"RATE_TITLE",RATE_FORM_TEXT:"RATE_FORM_TEXT",RATE_COMMENT_TITLE:"RATE_COMMENT_TITLE",RATE_FORM_INPUT:"RATE_FORM_INPUT",RATE_SUBMIT_BUTTON:"RATE_SUBMIT_BUTTON",RATE_POSITIVE_SUBMIT_TEXT:"RATE_POSITIVE_SUBMIT_TEXT",RATE_NEGATIVE_SUBMIT_TEXT:"RATE_NEGATIVE_SUBMIT_TEXT",RATE_FORM_CLOSE_ICON:"RATE_FORM_CLOSE_ICON",RATE_GOOD:"RATE_GOOD",RATE_GOODNORMAL:"RATE_GOODNORMAL",RATE_NORMAL:"RATE_NORMAL",RATE_BADNORMAL:"RATE_BADNORMAL",RATE_BAD:"RATE_BAD",PRECHAT_BUTTON:"PRECHAT_BUTTON_",LABEL_TEXT:"LABEL_TEXT_"}},81152:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageType=t.MessageStatus=t.MessageName=t.MessageInitiator=t.MediaType=t.MediaStatus=void 0;t.MessageType={MESSAGE:"message",PROACTIVE:"proactive",MEDIA:"media",COBROWSE:"cobrowse",INVOICE:"invoice",SYSTEM:"system",PREFORM:"botsystem",FORM:"form",TEMPORARY:"temporary",SOCIAL:"social",EMAIL:"email",SEPARATOR:"separator",FOR_TEST:"fortest",PRECHAT:"prechat",BOT:"bot",INVITE:"invite",EMPTY:null,LISTPICKER:"keyboard",WEB_RTC_CALL:"webrtccall",RATE_FORM:"rateform",CALL:"call"};t.MessageStatus={SENT:"sent",SENDED:"sended",DELIVERED:"delivered",READ:"read",SEEN:"seen",NOT_DELIVERED:"notDelivered",FAILED:"failed",DELETED:"deleted",EMPTY:null};t.MessageInitiator={AGENT:"agent",AGENT_BOT:"bot",CLIENT:"client",SYSTEM:"system",FORM:"bot",BOT:"bot_agent",EMPTY:null};t.MediaStatus={UPLOADING:"uploading",COMPLETE:"complete",ERROR:"error",EXPIRED:"expired"};t.MediaType={VIDEO:"video",PHOTO:"photo",LOCATION:"location",VOICE:"voice",STICKER:"sticker",RICH_LINK:"rich_link"};t.MessageName={DELAYED_CALL_SUCCESS:"delayedCallSuccess",CALL_END:"callEnd",CALL_MESSAGE_START:"callMessageStart"}},31343:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timeouts=t.REQUEST_OPTIONS=t.METHODS=t.CONTENT_TYPE=t.ACCEPT=void 0;t.METHODS={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH",HEAD:"HEAD"};t.ACCEPT="application/json, text/plain, */*";t.CONTENT_TYPE={X_WWW_FORM:"application/x-www-form-urlencoded",APP_JSON:"application/json"};t.REQUEST_OPTIONS={body:null,headers:{},responseType:"json",timeout:1e4,withCredentials:!1,validateStatus:e=>e>=200&&e<300,onTimeout:null,onUpload:null,onDownload:null};t.Timeouts={MESSAGE_SEND_ERROR_TIMEOUT:6e3}},62168:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionStatus=t.Permission=void 0;t.PermissionStatus={UNKNOWN:0,ALLOWED:1,BLOCKED:2};t.Permission={AUDIO:"audio",VIDEO:"video"}},22271:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Regexp=void 0;t.Regexp={SERVICEZONE_DOMAIN:/^https:\/\/servicezone+\S+jivosite.com/}},83907:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UtmSource=t.RuleTypes=t.RuleType=t.RuleConditions=t.DeviceType=void 0;t.RuleTypes={PROACTIVE:"proactive",OPEN_OFFLINE:"open_offline",HIDE:"hide",SYSTEM_MESSAGE:"system_message",SYSTEM_EMAIL:"system_message_email",SHOW_CALLFORM:"show_callform",SHOW_POPUP:"show_popup"};t.RuleConditions={ONLINE:"online",PAGE_URL:"page_url",PAGE_TITLE:"page_title",HOUR:"hour",WEEK_DAY:"week_day",TIME_AFTER_CLOSE:"time_after_close",TIME_AFTER_FIRST_MSG:"time_after_first_message",TIME_AFTER_INVITAION:"time_after_invitation",TIME_ON_PAGE:"time_on_page",TIME_ON_SITE:"time_on_site",NUMBER_OF_VISITS:"number_of_visits",GOAL_CLOSE:"goal_close",GOAL_SCROLL:"goal_scroll",GOAL_CLICK:"goal_click",GOAL_CUSTOM_ATTR:"goal_custom_attr",PAGES_COUNT:"pages_count",COUNTRY:"country",CITY:"city",ONCE_A_DAY:"once_a_day",UTM_SOURCE:"utm_source",DEVICE:"device"};t.DeviceType={MOBILE:"mobile",DESKTOP:"desktop"};t.UtmSource={BING:"bing",YANDEX:"yandex",GOOGLE:"google",YAHOO:"yahoo",DIRECT:"direct"};t.RuleType={ALL:"all",ANY:"any"}},51542:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Shards=void 0;t.Shards={SBER:"sber1"}},47138:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebRTCCallStatus=t.DelayedCallStatus=t.ChatState=t.CallStatus=t.CallPopupStatus=void 0;t.ChatState={NOT_STARTED_OR_CLOSED:"NOT_STARTED_OR_CLOSED",STARTED:"STARTED",ACCEPTED:"ACCEPTED"};t.CallStatus={WAIT:"cw_wait",CONNECTING:"cw_connecting",CONNECTED:"cw_connected",ENDED:"cw_call_end",ERROR:"cw_error"};t.DelayedCallStatus={WAIT:0,SUCCESS:1,MAX_REQUESTS_LIMIT:2,NOT_WORK_TIME:3,BAD_CALLBACK_TIME:4,BLOCKED:5,BAD_DIRECTION:6};t.WebRTCCallStatus={INITIAL:0,ACCEPTED:1,DECLINED:2,ERROR:3,ENDED:4};t.CallPopupStatus={ENABLED:"enabled",DISABLED:"disabled",ONLY_TRIGGERS:"only_triggers",ONLY_BUTTON_CLICK:"only_button_click"}},71047:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TempKey=t.STORAGE_TYPE=t.STORAGE_STATUS=t.STORAGED_ID=t.CampaignsKeys=void 0;t.STORAGED_ID={APP:"app",CALLBACK:"callback",CLIENT:"client",POSITION:"position"};t.STORAGE_STATUS={AVAILABLE:"available",UNAVAILABLE:"unavailable",EXCEED:"exceed"};t.STORAGE_TYPE={LOCAL:"localStorage",SESSION:"sessionStorage"};t.CampaignsKeys={POPUP_DELAY:"popup_delay"};t.TempKey={SENDED_TAGS:"sended_tags"}},83170:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TelemetryName=t.RateLimit=void 0;t.TelemetryName={STARTUP_OK:"startup_ok",RESUME_OK:"resume_ok",OFFLINE_FIRST_MESSAGE:"offline_first_message",OFFLINE_FORM_SUBMIT:"offline_form_submit",OFFLINE_AGENT_ACCEPT:"offline_agent_accept",FORCE_OFFLINE:"force_offline",CHAT_ACCEPTED:"chat_accepted",CHAT_ACCEPTED_CONTACTS:"chat_accepted_contacts",CHAT_BOT_ACCEPTED:"chat_bot_accepted",STARTUP_ERROR:"startup_error",CALL_END:"cw_call_end",CALL_ERROR:"cw_call_error",SOCIAL_HAS_INTEGRATION:"social_receive_has_integration_",CHAT_INTRODUCE_SOCIAL:"chat_introduce_social",CALL_START:"cw_start_call",API_CALL_OPEN:"cw_api_call_open",INTRODUCE:"introduce",EULA_SHOWN:"eula_shown",EULA_ACCEPTED:"eula_accepted",OFFLINE_SENT:"offline_sent",CLIENT_MESSAGE_SEND_ERROR:"client_message_send_error",CHAT_INTRODUCE:"chat_introduce",CHAT_INVITE:"chat_invite",INVITE_ACCEPTED:"invite_accepted",COBROWSE_SUCCESS:"cobrowse_success",COBROWSE_FAILED:"cobrowse_failed",CLIENT_MESSAGE_FLUSH_BUFFER:"client_message_flush_buffer",CLIENT_MESSAGE_SPAM:"client_message_spam",CDN_LOAD_TIME:"cdn_load_time",IN_IFRAME_STARTED:"in_iframe_started",API_GET_MESSAGES_ERROR:"api_get_messages_error",API_GET_MESSAGES_ERROR_TIMEOUT:"api_get_messages_error_timeout",API_GET_MESSAGES_RECEIVED:"api_get_messages_received",FILE_UPLOAD_ERROR:"file_upload_error",CW_BUTTON_CLICK:"cw_button_click",WA_BUTTON_CLICK:"wa_button_click",WIDGET_CLOSE_CLICK:"widget_close_click",SITE_CUSTOM_COPYRIGHT:"site_custom_copyright",EULA_CANCEL_BTN:"eula_cancel_btn",EULA_LINK_CLICKED:"eula_link_clicked",FILE_UPLOAD_SUCCESS:"file_upload_success",FILE_UPLOAD_CANCELED:"file_upload_canceled",FILE_UPLOAD_NO_LOCATION:"file_upload_no_location",MOBILE_CHAT_CLOSE:"mobile_chat_close",MOBILE_CLOSE_CALLBACK:"mobile_close_callback",EMOJI_OPEN_SMILE_LIST:"emoji_open_smile_list",EMOJI_INSERT_SMILE:"emoji_insert_smile",WIDGET_CLICK:"widget_click",LABEL_BUTTONS_SHOW:"label_buttons_show",LABEL_BUTTONS_CHAT:"label_buttons_chat",LABEL_BUTTONS_CALL:"label_buttons_call",LABEL_BUTTONS:"label_buttons_",LABEL_BUTTONS_WA:"label_buttons_wa",LABEL_BUTTONS_SB:"label_buttons_sb",LABEL_BUTTONS_TG:"label_buttons_tg",COBROWSE_CLICK_BUTTON:"cobrowse_click_button",EMAIL_MESSAGE_SUBMITTED:"Introduce_message_email_submitted",POWERBUTTON_OPEN:"powerbtn_open_",POWERBUTTON_OPEN_CHAT:"powerbtn_open_chat",POWERBUTTON_OPEN_CALLBACK:"powerbtn_open_callback",POWERBUTTON_CLOSE_MENU:"powerbtn_close_menu",POWERBUTTON_OPEN_MENU:"powerbtn_open_menu",CONTINUE_IN_VK:"Continue_in_VK",CONTINUE_IN_FB:"Continue_in_FB",ZOOM_OVERLAY_SHOW:"zoom_overlay_show",ZOOM_OVERLAY_HIDE:"zoom_overlay_hide",WIDGET_STATUS:"widget_status",CW_ONLINE_HEADER_BUTTON:"cw_online_header_button",CW_OFFLINE_HEADER_BUTTON:"cw_offline_header_button",SOCIAL_SHOW_FACEBOOK:"social_show_facebook",SOCIAL_SHOW_VK:"social_show_vk",SOCIAL_CONFIGURED_NOT_LOGGED:"social_configured_not_logged",VISITORS_FAIL:"visitors_fail",VISITORS_INVITE:"visitors_invite",OFFLINE_INVITE:"offline_invite",VISITOR_MSG_SENT:"visitor_msg_sent",AGENT_MESSAGE:"agent_message",API_OPEN:"api_open",API_CLOSE:"api_close",API_GET_CONTACT_INFO:"api_getcontactinfo",API_GET_VISITOR_NUMBER:"api_getvisitornumber_async",API_SET_USER_TOKEN:"api_setusertoken",API_SET_CUSTOM_DATA:"api_setcustomdata",API_SEND_MESSAGE:"api_sendmessage",API_SET_CONTACT_INFO:"api_setcontactinfo",API_SET_CONTACT_INFO_BAD_DATA:"api_setcontantactinfo_bad_data",API_SHOW_PROACTIVE:"api_showproactiveinvitation",API_SEND_OFFLINE_MESSAGE:"api_sendofflinemessage",API_SEND_OFFLINE_MESSAGE_BAD_DATA:"api_sendofflinemessage_bad_data",API_SET_RULES:"api_setrules",API_CHAT_MODE:"api_chatmode",API_SET_WIDGET_COLOR:"api_setwidgetcolor",API_SEND_PAGE_TITLE:"api_sendpagetitle",API_IS_CALLBACK_ENABLED:"api_iscallbackenabled",SEND_ATTRIBUTES_FAILED:"send_attributes_failed",SEND_ATTRIBUTES_SUCCESS:"send_attributes_success",API_GET_UTM:"api_getutm",OFFLINE_SENT_FAIL:"offline_sent_fail",DEBUG_PANEL_OPENED:"debug_panel_opened",MORE_CLICK:"more_click",DOWNLOAD_CHAT_LOG_CLICK:"download_chat_log_click",ERROR_DOWNLOADING_CHAT_LOG:"error_downloading_chat_log",WIDGET_DELETED:"widget_deleted",INVITE_CLOSE:"invite_close",PRECHAT:"prechat",RECEIVE_API_INVITATION:"receive_api_invitation",READ_API_INVITATION:"read_api_invitation",ANSWER_API_INVITATION:"answer_api_invitation",API_INVITATION_OPEN_CHAT:"api_invitation_open_chat",CLICK_LINK_API_INVITAION:"click_link_api_invitation",BOT_BUTTON_CLICK:"bot_button_click",CLIENT_MESSAGE_BOT:"client_message_bot",CLIENT_MESSAGE_ASSISTANT:"client_message_assistant",CONFIG_LIMIT:"config_limit",VI_STATUS_FAIL:"vi_status_fail",MARKDOWN_LINK_CLICK:"markdown_link_click",MORE_BTN_CLICK:"more_btn_click",BOT_TRANSFER_CHAT:"bot_transfer_chat",DELAYED_ERR:"delayed_query_error",RECAPTCHA_SUCCESS:"recaptcha_success",RECAPTCHA_FAILURE:"recaptcha_failure",RECAPTCHA_ERROR:"recaptcha_error",BUNDLE_LOADED:"bundle_loaded",CWP_SHOW_ON_PROACTIVE:"cwp_show_on_proactive",CWP_SUBMIT:"cwp_submit",CWP_DISABLED_SUBMIT_CLICK:"cwp_disabled_submit_click",CWP_CLOSE_CLICK:"cwp_close_click",CW_TO_CHAT_CLICK:"cw_to_chat_click",CW_ERROR_SUBMIT_PHONE:"cw_error_submit_phone",CW_SELECT_COUNTRY_CLICK:"cw_select_country_click",RESEND_CLICK:"resend_click",CHAT_VIEW:"chat_view",MEDIA_SIGN:"media_get_sign_success",MEDIA_SIGN_ERROR:"media_get_sign_error",WEBRTC_ACCEPT_CALL:"webrtc_accept_call",WEBRTC_DENY_CALL:"webrtc_deny_all",QR_ERROR:"qr_error",PAGE_HIDE:"page_hide",RATE_FORM_ADD:"rate_form_add",RATE_FORM_CLOSE:"rate_form_close",RATE_FORM_SUBMIT:"rate_form_submit",RATE_FORM_SELECT:"rate_form_select",RECONNECTION:"reconnection",STORAGE_ERROR:"storage_error",LOGO_CLICK:"logo_click",ASSET_ERROR:"asset_error",SET_UTM_ERROR:"set_utm_error",CLIENT_MESSAGE_ERROR:"client_message_error",SET_TAGS_SUCCESS:"set_tags_success",SET_TAGS_ERROR:"set_tags_error",CAMPAIGN_POPUP_SHOW:"campaign_popup_show",CAMPAIGN_POPUP_CLOSE:"campaign_popup_close",CAMPAIGN_POPUP_CTA_LINK:"campaign_popup_cta_link",CAMPAIGN_POPUP_POLL_RATE_CLICK:"campaign_popup_poll_rate_click",CAMPAIGN_POPUP_SUBMIT:"campaign_popup_submit",SEND_CAMPAIGN_DATA:"send_campaign_data",SEND_CAMPAIGN_DATA_SUCCESS:"send_campaign_data_success",SEND_CAMPAIGN_DATA_ERROR:"send_campaign_data_error",RETRY_CLICK:"retry_button_click",REPLY_MESSAGE_CLICK_SCROLL:"visitor_reply_message_click_scroll",REPLY_BUTTON_DELETED:"visitor_reply_button_deleted",REPLY_BUTTON_SEND:"visitor_reply_button_send",REPLY_BUTTON_CLICK:"visitor_reply_button_click",DOWNLOAD_MEDIA_CLICK:"donwload_media_click",AGENT_CHAT_CLOSE:"agent_chat_close",UPDATE_CLIENT_ID:"update_client_id",API_SET_TELEGRAM_LINK:"api_set_telegram_link",API_SET_WA_LINK:"api_set_wa_link",API_SET_VK_LINK:"api_set_vk_link"};t.RateLimit={Low:1,High:10}},26022:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientStatus=void 0;t.ClientStatus={ON_CHAT:"on_chat",INVITE_SENT:"invite_sent",ON_SITE:"on_site",PROACTIVE_SHOW:"proactive_show",ON_CALL:"on_call"}},40228:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(98661)),o=n(36113),a=r(n(45697)),s=r(n(21135)),l=r(n(14945)),u=r(n(21651)),c=n(58663),d=n(47138),f=r(n(19955)),p=n(83549),h=n(69726);const g=e=>{let t=e.route,n=e.isOnline,r=e.color,a=e.bubbleColor,g=e.button,_=e.baseUrl,m=e.widgetId,v=e.eula,y=e.callTime,b=e.isDelayedCallback,E=e.callbackAvailable,C=e.delayedCallStatus,T=e.separateForm,D=e.enableRequestVideocall,w=e.videoCall,S=e.callbackStatus,O=e.callbackError,A=e.clientPhone,I=e.isMobileDesigner;(0,p.useErrorCatcher)("CallWidgetContainer");const k=(0,h.useEnhanced)({button:g,callbackAvailable:E}),M=k.hiddenByRules,x=k.isCallButtonEnabled,P=(0,o.useSelector)((e=>e.callback.delayedPeriods),o.shallowEqual);return i.default.createElement(i.default.Fragment,null,!x||I||M?null:i.default.createElement(s.default,{allowedRoutes:(0,c.getCallbackButtonAllowedRoutes)(),currentRoute:t},i.default.createElement(l.default,{isCallButtonEnabled:!0,videoButton:!1,color:(0,c.getCallbackButtonColor)(r),onClick:()=>{(0,c.onButtonClick)(!1)}})),(0,c.isVideoButton)(D,w,n)?i.default.createElement(s.default,{allowedRoutes:(0,c.getCallbackButtonAllowedRoutes)(),currentRoute:t},i.default.createElement(l.default,{videoButton:!0,color:(0,c.getCallbackButtonColor)(r),onClick:()=>{(0,c.onButtonClick)(!0)},isCallButtonEnabled:x})):null,!E&&T==d.CallPopupStatus.DISABLED||!T||f.default.mobileOrTablet()?null:i.default.createElement(s.default,{allowedRoutes:(0,c.getCallbackPopupAllowedRoutes)(),currentRoute:t},i.default.createElement(u.default,{callTime:y,checkEula:!!v,eulaLink:(0,c.getEulaLink)(_,m),onSubmit:c.onPopupSubmitClick,onClose:c.onPopupCloseClick,isDelayed:!(!b||!P),delayedCallPeriods:(0,c.getDelayedCallPeriods)(P,{month:"long",day:"numeric"}),delayedCallError:(0,c.getDelayedCallError)(C),onDisabledSubmitClick:c.onDisabledSubmitClick,color:a,status:S,error:O,phone:A})))};g.propTypes={route:a.default.string,isOnline:a.default.bool,callbackAvailable:a.default.bool,isDelayedCallback:a.default.bool,callTime:a.default.number,color:a.default.string,bubbleColor:a.default.string,button:a.default.bool,baseUrl:a.default.string,widgetId:a.default.string,eula:a.default.any,delayedCallStatus:a.default.any,separateForm:a.default.string,enableRequestVideocall:a.default.bool,videoCall:a.default.number,callbackStatus:a.default.oneOfType([a.default.string,()=>null]),callbackError:a.default.oneOfType([a.default.string,()=>null]),clientPhone:a.default.string,isMobileDesigner:a.default.bool};var _=(0,o.connect)(((e,t)=>({route:e.app.route,isOnline:e.app.isOnline,callbackAvailable:e.callback.available,isDelayedCallback:e.callback.isDelayed,callbackStatus:e.callback.status,callbackError:e.callback.error,clientPhone:e.client.phone,callTime:e.settings.user.callback.time,color:e.settings.user.callbackButtonColor,bubbleColor:e.settings.user.bubbleColor,button:e.settings.user.callback.button,baseUrl:e.settings.system.baseUrl,widgetId:e.settings.system.widgetId,eula:e.settings.features.eula&&!e.client.eulaAccepted,delayedCallStatus:e.callback.delayedStatus,separateForm:e.callback.separateForm,enableRequestVideocall:e.settings.features.enableRequestVideocall,videoCall:e.settings.features.modules?e.settings.features.modules.videoCall:null,isMobileDesigner:e.settings.designer.isMobileView})),{})(g);t.default=_},58663:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.onPopupSubmitClick=t.onPopupCloseClick=t.onDisabledSubmitClick=t.onButtonClick=t.isVideoButton=t.getShowButton=t.getEulaLink=t.getDelayedCallPeriods=t.getDelayedCallError=t.getCallbackPopupAllowedRoutes=t.getCallbackButtonColor=t.getCallbackButtonAllowedRoutes=void 0;var i=n(52028),o=n(26932),a=n(21476),s=n(97490),l=n(54415),u=n(83170),c=n(50402),d=n(69882),f=r(n(91275)),p=n(33069),h=r(n(71323)),g=r(n(138)),_=n(44145),m=n(47138),v=n(36874),y=n(20676),b=n(21115);t.getCallbackButtonAllowedRoutes=()=>[s.Route.LABEL];t.onButtonClick=e=>{i.isDesignerEditor||(o.userDispatchers.setCallHeaderText(null),o.appDispatchers.setChatOpenByClient(!0),e?(0,b.sendVideoCallChatMessage)():[m.CallPopupStatus.ENABLED,m.CallPopupStatus.ONLY_BUTTON_CLICK].includes((0,_.getCallback)().separateForm)?a.Router.next(s.RouterEvent.ToCallPopup):(o.transitionDispatchers.startTransition(c.ScriptName.OPEN_WIDGET),a.Router.next(s.RouterEvent.ToCall),g.default.trackCallClick()),l.Monitoring.telemetry(u.TelemetryName.CW_BUTTON_CLICK,{param1:e?"isVideo":null}))};t.getShowButton=(e,t)=>e&&t&&!y.platform.isMobileOrTablet&&!y.platform.isChatPage&&!(0,d.isAppCobrowse)()||i.isDesignerEditor;t.isVideoButton=(e,t,n)=>e&&t&&n&&!i.isDesignerEditor&&!y.platform.isMobileOrTablet&&!y.platform.isChatPage&&!(0,d.isAppCobrowse)();t.getCallbackButtonColor=e=>e||v.colorsFromFigma.GREEN_80;t.getCallbackPopupAllowedRoutes=()=>[s.Route.CALL_POPUP];t.getEulaLink=(e,t)=>window.parent.location.protocol+e+"/script/eula/"+t;t.onPopupCloseClick=()=>{l.Monitoring.telemetry(u.TelemetryName.CWP_CLOSE_CLICK),a.Router.next(s.RouterEvent.CloseWindow)};t.onPopupSubmitClick=(e,t)=>{h.default.acceptEula(),t?((0,b.requestDelayedCallback)({phone:e,dateTime:t}),o.transitionDispatchers.startTransition(c.ScriptName.OPEN_WIDGET),a.Router.next(s.RouterEvent.Submit),l.Monitoring.telemetry(u.TelemetryName.CWP_SUBMIT,{param1:"delayed"})):(f.default.startCall(e),setTimeout((()=>{o.transitionDispatchers.startTransition(c.ScriptName.OPEN_WIDGET),a.Router.next(s.RouterEvent.Submit)}),1e3),l.Monitoring.telemetry(u.TelemetryName.CWP_SUBMIT,{param1:"direct"}))};t.getDelayedCallPeriods=(e,t)=>(0,p.formatPeriodsToSelectModel)(e,t);t.getDelayedCallError=e=>(0,p.isErrorStatusCode)(e);t.onDisabledSubmitClick=()=>{l.Monitoring.telemetry(u.TelemetryName.CWP_DISABLED_SUBMIT_CLICK)}},69726:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhanced=function(e){let t=e.button,n=e.callbackAvailable;const r=(0,o.useSelector)(s.selectHiddenByRules),u=(0,a.useState)(!1),c=(0,i.default)(u,2),d=c[0],f=c[1];return(0,a.useEffect)((()=>{f((0,l.getShowButton)(t,n))}),[t,n]),{hiddenByRules:r,isCallButtonEnabled:d}};var i=r(n(67375)),o=n(36113),a=n(98661),s=n(65138),l=n(58663)},48639:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(7819)),s=r(n(84827)),l=r(n(85299)),u=r(n(55536)),c=n(36113),d=r(n(54720)),f=n(21951),p=n(92560),h=n(938),g=r(n(96394)),_=r(n(19955)),m=n(20344),v=n(31984),y=n(21476);function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}let E=function(e){(0,s.default)(n,e);var t=b(n);function n(e){var r;return(0,i.default)(this,n),r=t.call(this,e),(0,p.isEmpty)(g.default.callback_settings)?(console.log("Callwidget not configured yet."),(0,l.default)(r)):(r.parseCurrentPhone(),r.initState(),r.documentOnClicked=r.documentOnClicked.bind((0,a.default)(r)),r.documentOnKeyPress=r.documentOnKeyPress.bind((0,a.default)(r)),r._input=null,r.linkRefs={},r)}return(0,o.default)(n,[{key:"componentDidUpdate",value:function(e){(0,c.shallowEqual)(this.props,e)||("cw_error"!==this.props.status||this.props.error!==(0,m.l10n)("cw_call_forward")?this.props.phone!==e.phone&&(this.parseCurrentPhone(),this.initState()):this.setState({number:""}))}},{key:"componentDidMount",value:function(){this.state.currentCountry.phone_format&&this.setNumber(),y.Router.on("route_change",(()=>{this.props.clientPhone&&!this.state.number&&this.initState()})),this.triggerOnChangeProp()}},{key:"initState",value:function(){this.state={number:this.getCurrentNumber(),showList:!1,errorPhone:!1,countries:this.getAllowCountries(),currentCountry:this.getCurrentCountry(),placeholder:this.getCurrentCountry().phone_format,color:g.default.bubble_color||"green"}}},{key:"parseCurrentPhone",value:function(){this.props.clientPhone&&(this.clientPhoneInfo=(0,v.getPhoneNumberInfo)(this.props.clientPhone))}},{key:"getCurrentNumber",value:function(){return this.clientPhoneInfo?this.clientPhoneInfo.innerNumber:""}},{key:"getAllowCountries",value:function(){return this.countries=this.countries||(0,h.sortBy)(g.default.callback_settings.countries,"name")}},{key:"getCurrentCountry",value:function(){let e;this.clientPhoneInfo?e=this.clientPhoneInfo.countryCode:g.default.geoip&&(e=g.default.geoip.split(";")[0]);return this.getAllowCountries().find((t=>t.code===e))||this.getAllowCountries()[0]}},{key:"toggleCountriesList",value:function(e){this.state.countries.length<2||(this.state.showList?this.hideCountriesList():this.showCountriesList(),e.stopPropagation())}},{key:"showCountriesList",value:function(){this.setState({showList:!0,isFocusedInput:!0}),(0,f.addListener)(window.parent.document,"keypress",this.documentOnKeyPress),(0,f.addListener)(window.parent.document,"click",this.documentOnClicked)}},{key:"hideCountriesList",value:function(){this.setState({showList:!1,isFocusedInput:!1}),(0,f.removeEvent)(window.parent.document,"click",this.documentOnClicked),(0,f.removeEvent)(window.parent.document,"keypress",this.documentOnKeyPress)}},{key:"validPhoneNumber",value:function(){if(this._input&&this.state.currentCountry.phone_format){const e=this.state.currentCountry.phone_format,t=this._input&&this._input.value.toString();return(0,v.checkPhoneLength)(t,e,this.state.currentCountry.code)}return this.getFullPhoneNumber().length>9&&this.getFullPhoneNumber().length<16}},{key:"getFullPhoneNumber",value:function(){return this.state.currentCountry.phone_code+this.state.number.replace(/\D+/g,"")}},{key:"getCurrentCode",value:function(){return this.state.currentCountry.phone_code}},{key:"isShowErrorState",value:function(){let e;return e=!this.state.number||0===this.state.number.length||!this.validPhoneNumber(),e}},{key:"inputOnBlur",value:function(){this.setState({isFocusedInput:!1,invalidPhone:this.isShowErrorState()})}},{key:"inputOnFocus",value:function(){this.setState({isFocusedInput:!0,showList:!1})}},{key:"triggerOnChangeProp",value:function(){const e=this.props.onChange;if(void 0!==e){e({value:this.getFullPhoneNumber(),invalidPhone:this.isShowErrorState(),code:this.getCurrentCode()})}}},{key:"triggerOnEnterProp",value:function(){const e=this.props.onEnter;void 0!==e&&e()}},{key:"inputOnInput",value:function(){this.setNumber((()=>{this.setState({invalidPhone:this.isShowErrorState()}),this.trigger("onChange",this._input&&this._input.value.toString().replace(/\D+/g,"")),this.triggerOnChangeProp()}))}},{key:"inputPhoneKeyUp",value:function(e){this.setNumber((()=>{if("keyup"===e.type&&(13===e.keyCode||13===e.which)){this.validPhoneNumber()?(this.trigger("onEnter",this.getFullPhoneNumber(),this.state.currentCountry),this.triggerOnEnterProp()):this.setState({invalidPhone:!0})}}))}},{key:"codeOnClick",value:function(){_.default.desktop()&&this._input&&this._input.focus()}},{key:"documentOnKeyPress",value:function(e){const t=this.getChar(e),n=Object.keys(this.linkRefs).filter((e=>"link_"===e.substr(0,5))).find((e=>e.substr(5,1).toUpperCase()===t.toUpperCase()));n&&this.linkRefs[n].scrollIntoView(!0)}},{key:"documentOnClicked",value:function(e){e.target.closest("#countryList")||this.hideCountriesList()}},{key:"getChar",value:function(e){return null==e.which?e.keyCode<32?null:String.fromCharCode(e.keyCode):0!=e.which&&0!=e.charCode?e.which<32?null:String.fromCharCode(e.which):null}},{key:"countrySelect",value:function(e){const t=e.delegateTarget&&e.delegateTarget.getAttribute("data-code")||e.target.value;this.setNumber((()=>{const e=this.state.countries.find((e=>e.code===t));this.setState({currentCountry:e,showList:!1,placeholder:e.phone_format,invalidPhone:this.isShowErrorState()}),_.default.desktop()&&this._input&&this._input.focus(),this.triggerOnChangeProp()}))}},{key:"setNumber",value:function(e){const t=this._input&&this._input.value.toString();this.setState({number:this.getMaskedNumber(t)},(()=>{e&&e()}))}},{key:"getMaskedNumber",value:function(e){return(0,v.getMaskedValue)(e,this.state.currentCountry.phone_format)}},{key:"focus",value:function(){_.default.desktop()&&this._input&&this._input.focus()}},{key:"isValid",value:function(){const e=this.validPhoneNumber();return this.setState({invalidPhone:!e}),e}},{key:"numberMaxLength",value:function(){return this.state.currentCountry.phone_format?this.state.currentCountry.phone_format.length:15-this.state.currentCountry.phone_code.length}}]),n}(d.default);t.default=E},51313:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(33119)),a=r(n(92664)),s=r(n(84827)),l=r(n(85299)),u=r(n(55536)),c=r(n(61125)),d=r(n(98661)),f=r(n(88155)),p=r(n(94184)),h=r(n(40704)),g=n(45683),_=r(n(72953));function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}let v=function(e){(0,s.default)(n,e);var t=m(n);function n(){return(0,o.default)(this,n),t.apply(this,arguments)}return(0,a.default)(n,[{key:"getRenderData",value:function(){return{styles:{container:[{container:!0,__singleMod:"single"===this.props.type,__inFormMod:"inForm"===this.props.type}],inputWrap:[{inputWrap:!0,__focused:this.state.isFocusedInput,__error:!this.state.isFocusedInput&&this.state.invalidPhone,__alone:1===this.state.countries.length,["_"+this.state.color]:!(!this.state.color||"green"===this.state.color)}],input:[{phoneInput:!0}],countryWrap:[{countryWrap:!0,_isScroll:this.state.countries.length>4},{display:this.state.showList?"block":"none"}]},style:_.default}}},{key:"renderCountryList",value:function(e,t){return d.default.createElement("jdiv",{className:_.default.countryList,onPointerDown:this.delegate("listItem",this.countrySelect.bind(this))},this.state.countries.map(((e,t)=>d.default.createElement("jdiv",{className:_.default.listItem,key:t,dgName:"listItem","data-code":e.code,ref:t=>{this.linkRefs["link_"+e.name]=t}},d.default.createElement("jdiv",{className:_.default.flagIcon+" "+_.default.list,style:{backgroundImage:`url(${(0,g.getFlagIconURL)(e.code)})`}}),d.default.createElement("jdiv",{className:_.default.countryName},e.name),d.default.createElement("jdiv",{className:_.default.countryCode},"+"+e.phone_code)))))}},{key:"renderData",value:function(e,t){const n=(0,p.default)(_.default.flagIcon,this.props.classNameIcon),r=(0,p.default)(t.container.className,this.props.classNameContainer,{});return d.default.createElement("jdiv",(0,i.default)({},t.container,{className:r}),d.default.createElement("jdiv",t.inputWrap,d.default.createElement("jdiv",{className:_.default.flagWrap,onClick:this.toggleCountriesList.bind(this)},d.default.createElement("jdiv",{className:n,style:{backgroundImage:`url(${(0,g.getFlagIconURL)(this.state.currentCountry.code)})`}}),d.default.createElement("jdiv",{className:_.default.flagArrow,style:{display:this.state.countries.length<2?"none":null}},d.default.createElement(h.default,{iconName:"icon-v",color:"#959BA0",hoverColor:"#222D38",className:_.default.iconSelect}))),d.default.createElement("jdiv",{className:_.default.phoneCodeWrap,onClick:this.codeOnClick.bind(this)},"+"+this.state.currentCountry.phone_code),d.default.createElement("input",(0,i.default)({},t.input,{onBlur:this.inputOnBlur.bind(this),placeholder:this.state.placeholder,onFocus:this.inputOnFocus.bind(this),type:"text",maxLength:this.numberMaxLength(),value:this.getMaskedNumber(this.state.number),onInput:this.inputOnInput.bind(this),onKeyUp:this.inputPhoneKeyUp.bind(this),"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false",ref:e=>{this._input=e}})),d.default.createElement("jdiv",t.countryWrap,this.state.countries.length>4?d.default.createElement(f.default,{railClass:_.default.rail,position:"relative"},this.renderCountryList(e,t)):this.renderCountryList(e,t))))}}]),n}(r(n(48639)).default);t.default=v,(0,c.default)(v,"defaultProps",{fillBorderAround:!0})},14945:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(98661)),a=r(n(90146)),s=r(n(45697)),l=r(n(94184)),u=n(90361),c=n(57930),d=r(n(40704)),f=n(20344),p=n(94019);const h=e=>{let t=e.videoButton,n=e.color,r=e.onClick,s=e.isCallButtonEnabled;const h=(0,p.useEnhanced)(),g=h.labelBubble,_=h.callbackPosition;return o.default.createElement("jdiv",{className:(0,l.default)({[a.default.wrap]:!0,[a.default._show]:!0,[a.default._powerBtn]:g,[a.default._powerBtnPositionLeft]:"left"===_,__jivoCallbackBtn:s,__jivoVideoBtn:t}),style:{backgroundColor:n},onClick:r},o.default.createElement("jdiv",(0,i.default)({className:a.default.button,style:{backgroundColor:n}},(0,u.withLocator)(t?c.Locator.CALLBACK_VIDEO_BUTTON:c.Locator.CALLBACK_BUTTON))),o.default.createElement("jdiv",{className:a.default.iconWrap},o.default.createElement(d.default,{iconName:t?"icon-video":"icon-tube",color:"#fff",className:a.default.logoCallback}),t?o.default.createElement("jdiv",{className:a.default.popup},(0,f.l10n)("webrtc_video_text_popup")):null))};h.propTypes={videoButton:s.default.bool,color:s.default.string,onClick:s.default.func,isCallButtonEnabled:s.default.bool};var g=o.default.memo(h);t.default=g},94019:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhanced=function(){const e=(0,l.useSelector)(a.selectLabelBubble),t=(0,l.useSelector)(a.selectWidgetOrientation),n=(0,l.useSelector)(a.selectWidgetPadding),r=(0,s.useState)(e?(0,o.getPowerButtonDesktopPosition)(t,n):"right"),u=(0,i.default)(r,2),c=u[0],d=u[1];return(0,s.useEffect)((()=>{e&&d((0,o.getPowerButtonDesktopPosition)(t,n))}),[t,n]),{labelBubble:e,callbackPosition:c}};var i=r(n(67375)),o=n(80598),a=n(87692),s=n(98661),l=n(36113)},21651:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(67375)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),s=r(n(13279)),l=r(n(45697)),u=n(90361),c=n(57930),d=r(n(40704)),f=r(n(51313)),p=r(n(66400)),h=r(n(87316)),g=r(n(82656)),_=n(53285),m=n(20344),v=n(70010),y=n(44145),b=n(16217);function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}const C=e=>{let t=e.checkEula,n=e.callTime,r=e.onSubmit,l=e.onClose,E=(e.eulaLink,e.color),C=e.status,T=e.error,D=e.phone,w=e.isDelayed,S=e.delayedCallError,O=e.delayedCallPeriods,A=e.onDisabledSubmitClick;const I=(0,a.useState)(!1),k=(0,o.default)(I,2),M=k[0],x=k[1],P=(0,a.useState)(!1),R=(0,o.default)(P,2),N=R[0],L=R[1],F=(0,a.useState)(null),j=(0,o.default)(F,2),B=j[0],U=j[1],W=(0,a.useState)(null),H=(0,o.default)(W,2),G=H[0],V=H[1],z=(0,a.useState)(null),$=(0,o.default)(z,2),Z=$[0],q=$[1],K=(0,a.useState)(null),Y=(0,o.default)(K,2),J=Y[0],X=Y[1],Q=(0,a.useRef)(null),ee=(0,a.useRef)(null),te=(0,a.useRef)(null),ne=(0,_.getDelayedDays)(O),re=(0,_.getSelectedDay)(Q),ie=(0,_.getDelayedTimes)(O,G||(re?re.value:null));(0,a.useEffect)((()=>{te&&te.current&&te.current._input&&te.current._input.focus(),w&&(V(ne[0].value),q(ie[0].value))}),[]);const oe=()=>a.default.createElement("jdiv",{className:s.default.input},a.default.createElement(f.default,{type:"inForm",status:C,error:T,phone:D,onChange:e=>{let t=e.value,n=e.invalidPhone;n||U("+"+t),X(!n)},onEnter:e=>{ae&&ae()},ref:te})),ae=()=>{if(t&&!M)L(!0);else if(w){if(!G||!Z){const e=(0,_.getSelectedDateTime)(Q,ee);if(!e)return;return void(r&&r(B,e))}r&&r(B,`${G}|${Z}`)}else r&&r(B)},se=(0,y.getUserSettings)().callHeaderText||(0,m.l10n)("cwPopupPutPhone");return a.default.createElement("jdiv",{className:s.default.wrap},a.default.createElement("jdiv",{className:s.default.popup},a.default.createElement("jdiv",{className:s.default.hand}),a.default.createElement("jdiv",{onClick:()=>{l&&l()}},a.default.createElement(d.default,(0,i.default)({iconName:"icon-close-chat",color:"#7D8999",hoverColor:"#7D8999",className:s.default.closeIcon},(0,u.withLocator)(c.Locator.CLOSE_BUTTON)))),a.default.createElement("jdiv",{className:s.default.contentWrap},a.default.createElement("jdiv",{className:s.default.title},se),w?a.default.createElement("jdiv",{className:s.default.subtitle},(0,m.l10n)("cwPopupTime")):a.default.createElement("jdiv",{className:s.default.subtitle},(0,m.l10n)("cw_callAfter")," ",a.default.createElement("b",null,n)," "+(0,m.l10n)((0,b.getSeconds)(n))),w&&O?a.default.createElement("jdiv",{className:s.default.delayedWrap},a.default.createElement("jdiv",{className:s.default.periodsWrap},a.default.createElement("jdiv",null,(0,m.l10n)("lblCallMe")),a.default.createElement(h.default,{disabled:!1,classNameWrap:s.default.periodSelectWrap,invalid:S,options:ne,theme:"inset",onChange:e=>{let t=e.option;V(t.value)},ref:Q,color:E,isCallbackPopup:!0}),a.default.createElement("jdiv",null,(0,m.l10n)("callback_delayed_period_delimiter")),a.default.createElement(h.default,{disabled:!1,classNameWrap:s.default.periodSelectWrap,invalid:S,options:ie,theme:"inset",onChange:e=>{let t=e.option;q(t.value)},ref:ee,color:E})),oe()):oe(),a.default.createElement(p.default,{height:"md",widthFluid:!0,disabled:w&&(!G||!Z)||!J||t&&!M||N||S,onDisabledClick:()=>{A&&A()},onClick:ae},w?(0,m.l10n)("callback_delayed_button_submit"):(0,m.l10n)("cw_callButtonText")),(()=>{if(!t)return null;const e=(0,v.getEulaState)();return a.default.createElement("jdiv",{className:s.default.eula},a.default.createElement(g.default,{checked:M,error:N,onClick:()=>{x(!M),L(!1)}}),a.default.createElement("jdiv",{className:s.default.eulaText},(0,v.getAgreementText)(e.agreementBasis),(0,v.getEulaLink)((()=>{(0,v.trackClick)()}))))})())))};C.propTypes={checkEula:l.default.bool,callTime:l.default.number,onSubmit:l.default.func,onClose:l.default.func,eulaLink:l.default.string,color:l.default.string,isDelayed:l.default.bool,delayedCallError:l.default.bool,delayedCallPeriods:l.default.any,status:l.default.oneOfType([l.default.string,l.default.bool]),error:l.default.string,phone:l.default.string,onDisabledSubmitClick:l.default.func};var T=a.default.memo(C);t.default=T},53285:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedTime=t.getSelectedDay=t.getSelectedDateTime=t.getDelayedTimes=t.getDelayedDays=void 0;const n=e=>{if(!e)return[];const t=[],n=new Set;for(let r=0;r{if(!e)return[];if(!t){const r=n(e);if(!r.length)return[];t=r[0].value}const r=[];for(let n=0;n{if(e&&e.current){return e.current.props.options[e.current.state.activeOptionIndex]}return{label:null,value:null}};t.getSelectedTime=e=>{if(e&&e.current){return e.current.props.options[e.current.state.activeOptionIndex]}return{label:null,value:null}};t.getSelectedDateTime=(e,t)=>{if(e.current&&t.current){const n=e.current.props.options[e.current.state.activeOptionIndex],r=t.current.props.options[t.current.state.activeOptionIndex];if(n&&n.value&&r&&r.value)return`${n.value}|${r.value}`}}},82656:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(98661)),o=r(n(35595)),a=r(n(94184)),s=r(n(45697));const l=e=>{let t=e.checked,n=e.error,r=e.onClick;return i.default.createElement("jdiv",{className:(0,a.default)({[o.default.checkbox]:!0,[o.default._checked]:t,[o.default._error]:n}),onClick:()=>{r&&r()}})};l.propTypes={checked:s.default.bool,error:s.default.bool,onClick:s.default.func,color:s.default.string};var u=i.default.memo(l);t.default=u},47548:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(98661)),a=r(n(94184)),s=r(n(45697)),l=n(57930),u=n(90361),c=r(n(4244)),d=r(n(5243)),f=r(n(40704));const p=e=>{let t=e.onClick,n=e.drag,r=e.callEnabled,s=e.inCall,p=e.show,h=e.ignoreDragHeight;return o.default.createElement(o.default.Fragment,null,o.default.createElement("jdiv",{className:(0,a.default)({[d.default.wrap]:!0,[d.default.__show]:p,[d.default.__call]:s}),dir:"ltr",id:"jivo_action"},o.default.createElement("jdiv",{className:d.default.closeButton,onClick:t,id:"jivo_close_button"},o.default.createElement(f.default,(0,i.default)({iconName:"icon-close-chat",color:"#7D8999",hoverColor:"#7D8999",className:d.default.closeIcon},(0,u.withLocator)(l.Locator.CLOSE_BUTTON))))),n?o.default.createElement(c.default,{isNarrow:r,IsIgnoreHeight:h}):null)};p.propTypes={onClick:s.default.func.isRequired,drag:s.default.bool,callEnabled:s.default.bool,inCall:s.default.bool,show:s.default.bool,ignoreDragHeight:s.default.bool};var h=o.default.memo(p);t.default=h},32083:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(88436)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),s=r(n(45697)),l=r(n(94184)),u=r(n(2903));const c=["children","color","compact","component","disabled","fullWidth","leftIcon","radius","rightIcon","size","type","uppercase","variant","isIos"];function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const f=(0,a.forwardRef)(((e,t)=>{let n=e.children,r=e.color,s=e.compact,d=e.component,f=e.disabled,p=e.fullWidth,h=e.leftIcon,g=e.radius,_=e.rightIcon,m=e.size,v=e.type,y=e.uppercase,b=e.variant,E=e.isIos,C=(0,o.default)(e,c);const T=d||"button",D=(0,l.default)({[u.default.root]:!0,[u.default[b]]:!0,[u.default.__compact]:s,[u.default.__disabled]:f&&"button"!==d,[u.default.__fullWidth]:p,[u.default.__uppercase]:y,[u.default.__ios]:E,[u.default["__"+r]]:!0,[u.default["__"+m+"Size"]]:!0,[u.default["__"+g+"Radius"]]:!0}),w=(0,l.default)({[u.default.icon]:!0,[u.default.__left]:h}),S=(0,l.default)({[u.default.icon]:!0,[u.default.__right]:_});return a.default.createElement(T,(0,i.default)({ref:t,type:v,disabled:f,className:D},C),a.default.createElement("span",{className:u.default.content},h&&a.default.createElement("span",{className:w},h),n,_&&a.default.createElement("span",{className:S},_)))}));f.displayName="Button",f.defaultProps={color:"green",size:"sm",radius:"sm",type:"button",variant:"filled"},f.propTypes={children:s.default.node.isRequired,color:s.default.string,compact:s.default.bool,component:s.default.any,disabled:s.default.bool,fullWidth:s.default.bool,leftIcon:s.default.node,rightIcon:s.default.node,uppercase:s.default.bool,radius:s.default.oneOf(["xs","sm","md","lg","xl"]),size:s.default.oneOf(["xs","sm","md","lg","xl"]),type:s.default.oneOf(["button","reset","submit"]),variant:s.default.oneOf(["light","outline","subtle","filled","default","white"]),isIos:s.default.bool};var p=f;t.default=p},61744:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorPage=void 0;var i=r(n(23101)),o=r(n(98661)),a=r(n(45697)),s=r(n(94184)),l=n(43417),u=n(20344),c=r(n(57147)),d=r(n(47548)),f=r(n(40704)),p=n(81351),h=r(n(32083)),g=r(n(6139)),_=n(26932),m=n(50402),v=n(21476),y=n(97490),b=n(55921),E=n(83549),C=n(54415),T=n(83170),D=n(20676),w=r(n(308));const S=e=>{let t=e.onRetry;(0,E.useErrorCatcher)(S.displayName);const n=D.platform.isMobileOrTablet||D.platform.isChatPage,r=()=>{n?v.Router.next(y.RouterEvent.CloseWindow):_.transitionDispatchers.startTransition(m.ScriptName.CLOSE_WIDGET)},a=(0,b.useGetHeaderColors)(),O=a.background,A=a.leafBackground,I=a.isDarkText,k=a.patternUrl,M=(0,s.default)({[w.default.errorWrap]:!0,[w.default.__mobile]:n,[w.default.__dark]:I});return o.default.createElement("jdiv",{className:M},o.default.createElement("jdiv",{className:w.default.header,style:{background:O}},o.default.createElement("jdiv",{className:w.default.pattern,style:{backgroundImage:k?`url(${k})`:null}},n?o.default.createElement("jdiv",(0,i.default)({className:w.default.backWrapper},(0,l.onClickHandler)(r,!0,!0)),o.default.createElement(f.default,{iconName:"icon-close",color:I?"#272433":"#fff",className:w.default.backButton})):o.default.createElement(d.default,{drag:!1,callEnabled:!1,inCall:!1,show:!0,onClick:()=>{r()},ignoreDragHeight:!1}),o.default.createElement("jdiv",{className:w.default.headerText},(0,u.l10n)("cb_loading")),o.default.createElement(c.default,{onClick:()=>{},orientation:"bottom",backgroundColor:A,online:!0}))),o.default.createElement("jdiv",{className:w.default.errorContent},o.default.createElement("jdiv",{className:w.default.connectContainer},o.default.createElement(p.DisconnectAlert,{onReconnect:t})),o.default.createElement(f.default,{iconName:"iconErrorLoad",className:w.default.iconError}),o.default.createElement("jdiv",{className:w.default.errorText},(0,u.l10n)("maintenanceSystemText"),o.default.createElement(g.default,{h:12}),o.default.createElement(h.default,(0,i.default)({component:"jdiv",variant:"default"},(0,l.onClickHandler)((()=>{t(),C.Monitoring.telemetry(T.TelemetryName.RETRY_CLICK)}),!0,!0)),(0,u.l10n)("tryAgain")))))};t.ErrorPage=S,S.propTypes={onRetry:a.default.func},S.displayName="ErrorPage"},88155:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(7819)),s=r(n(84827)),l=r(n(85299)),u=r(n(55536)),c=r(n(61125)),d=r(n(88436)),f=r(n(23101)),p=A(n(98661)),h=r(n(53879)),g=A(n(54087)),_=n(21951),m=n(32183),v=n(23267),y=n(21733),b=n(20676),E=n(61699);const C=["style"],T=["style"],D=["style"],w=["style"],S=["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","onlyY","universal","autoHeight","autoHeightMin","autoHeightMax","scrollMarginTop","railClass","scrollWrapClass","position","style","children"];function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(O=function(e){return e?n:t})(e)}function A(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=O(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t!1;let P,R;Math.easeInOutQuad=function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t};let N=function(e){(0,s.default)(n,e);var t=I(n);function n(e){var r;(0,i.default)(this,n);for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;lthis.getClientHeight()}},{key:"getClientWidth",value:function(){return this.view.clientWidth}},{key:"getClientHeight",value:function(){return this.view.clientHeight}},{key:"getValues",value:function(){const e=this.view,t=e.scrollLeft,n=e.scrollTop,r=e.scrollWidth,i=e.scrollHeight,o=e.clientWidth,a=e.clientHeight;return{left:t/(r-o)||0,top:n/(i-a)||0,scrollLeft:t,scrollTop:n,scrollWidth:r,scrollHeight:i,clientWidth:o,clientHeight:a}}},{key:"getThumbHorizontalWidth",value:function(){const e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,i=r.scrollWidth,o=r.clientWidth,a=(0,m.getInnerWidth)(this.trackHorizontal),s=Math.ceil(o/i*a);return a===s?0:t||Math.max(s,n)}},{key:"getThumbVerticalHeight",value:function(){const e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,i=r.scrollHeight,o=r.clientHeight,a=(0,m.getInnerHeight)(this.trackVertical),s=Math.ceil(o/i*a);return a===s?0:t||Math.max(s,n)}},{key:"getScrollLeftForOffset",value:function(e){const t=this.view,n=t.scrollWidth,r=t.clientWidth;return e/((0,m.getInnerWidth)(this.trackHorizontal)-this.getThumbHorizontalWidth())*(n-r)}},{key:"getScrollTopForOffset",value:function(e){const t=this.view,n=t.scrollHeight,r=t.clientHeight;return e/((0,m.getInnerHeight)(this.trackVertical)-this.getThumbVerticalHeight())*(n-r)}},{key:"scrollLeft",value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view.scrollLeft=e}},{key:"scrollTop",value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view.scrollTop=e}},{key:"scrollToLeft",value:function(){this.view.scrollLeft=0}},{key:"scrollToTop",value:function(){this.view.scrollTop=0}},{key:"scrollToRight",value:function(){this.view.scrollLeft=this.view.scrollWidth}},{key:"scrollToBottom",value:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.hasScroll())return;const t=this.getScrollHeight();0!==t?e?this.view.scrollTo({top:t,behavior:"smooth"}):this.view.scrollTop=this.view.scrollHeight:this.view.scrollTop=t}},{key:"addListeners",value:function(){if("undefined"==typeof document)return;const e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,i=this.thumbVertical,o=this.container;(0,_.addListener)(e,"scroll",this.handleScroll,!0),(0,_.addListener)(e,"mousewheel",this.handleMouseWheel),(0,m.getScrollBarWidth)()&&(t&&(t.addEventListener("mouseenter",this.handleTrackMouseEnter),t.addEventListener("mouseleave",this.handleTrackMouseLeave),t.addEventListener("mousedown",this.handleHorizontalTrackMouseDown)),o&&o.addEventListener("mouseenter",this.handleTrackCheckHide.bind(this)),n&&(n.addEventListener("mouseenter",this.handleTrackMouseEnter),n.addEventListener("mouseleave",this.handleTrackMouseLeave),n.addEventListener("mousedown",this.handleVerticalTrackMouseDown)),r&&r.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),i&&i.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}},{key:"removeListeners",value:function(){if("undefined"==typeof document)return;const e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,i=this.thumbVertical;e.removeEventListener("scroll",this.handleScroll),e.removeEventListener("mousewheel",this.handleMouseWheel),(0,m.getScrollBarWidth)()&&(t&&(t.removeEventListener("mouseenter",this.handleTrackMouseEnter),t.removeEventListener("mouseleave",this.handleTrackMouseLeave),t.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown)),n&&(n.removeEventListener("mouseenter",this.handleTrackMouseEnter),n.removeEventListener("mouseleave",this.handleTrackMouseLeave),n.removeEventListener("mousedown",this.handleVerticalTrackMouseDown)),r&&r.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),i&&i.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}},{key:"handleScroll",value:function(e){const t=this.props,n=t.onScroll,r=t.onScrollFrame;n&&n(e),this.update((e=>{const t=e.scrollLeft,n=e.scrollTop;this.viewScrollLeft=t,this.viewScrollTop=n,r&&r(e)})),this.detectScrolling()}},{key:"handleTouchMove",value:function(e){if((0,m.isInput)(e.target.tagName)){e.stopPropagation(),e.preventDefault();const t=this.view.childNodes[0].clientHeight-this.container.parentNode.clientHeight,n=P-(e.touches[0].pageY+R);t>n&&0=0,r=this.view.scrollTop<=0;(t<0&&n||t>0&&r)&&e.preventDefault()}},{key:"handleScrollStart",value:function(){const e=this.props.onScrollStart;e&&e(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){this.props.autoHide&&this.showTracks()}},{key:"handleScrollStop",value:function(){const e=this.props.onScrollStop;e&&e(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"handleWindowResize",value:function(){this.update()}},{key:"handleHorizontalTrackMouseDown",value:function(e){e.preventDefault();const t=e.target,n=e.clientX,r=t.getBoundingClientRect().left,i=this.getThumbHorizontalWidth(),o=Math.abs(r-n)-i/2;this.view.scrollLeft=this.getScrollLeftForOffset(o)}},{key:"handleVerticalTrackMouseDown",value:function(e){e.preventDefault();const t=e.target,n=e.clientY,r=t.getBoundingClientRect().top,i=this.getThumbVerticalHeight(),o=Math.abs(r-n)-i/2;this.view.scrollTop=this.getScrollTopForOffset(o)}},{key:"handleHorizontalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);const t=e.target,n=e.clientX,r=t.offsetWidth,i=t.getBoundingClientRect().left;this.prevPageX=r-(n-i)}},{key:"handleVerticalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);const t=e.target,n=e.clientY,r=t.offsetHeight,i=t.getBoundingClientRect().top;this.prevPageY=r-(n-i)}},{key:"setupDragging",value:function(){const e=(0,v.getPageWindow)().document;(0,h.default)(e.body,E.disableSelectStyle),e.addEventListener("mousemove",this.handleDrag),e.addEventListener("mouseup",this.handleDragEnd),e.onselectstart=x}},{key:"teardownDragging",value:function(){const e=(0,v.getPageWindow)().document;(0,h.default)(e.body,E.disableSelectStyleReset),e.removeEventListener("mousemove",this.handleDrag),e.removeEventListener("mouseup",this.handleDragEnd),e.onselectstart=void 0}},{key:"handleDragStart",value:function(e){this.dragging=!0,e.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(e){if(this.prevPageX){const t=e.clientX,n=this.trackHorizontal.getBoundingClientRect().left,r=this.getThumbHorizontalWidth()-this.prevPageX,i=-n+t-r;this.view.scrollLeft=this.getScrollLeftForOffset(i)}if(this.prevPageY){const t=e.clientY,n=this.trackVertical.getBoundingClientRect().top,r=this.getThumbVerticalHeight()-this.prevPageY,i=-n+t-r;this.view.scrollTop=this.getScrollTopForOffset(i)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"handleTrackCheckHide",value:function(){this.props.autoHide&&this.view&&this.trackVertical&&(this.hasScroll()?this.showTracks():(0,h.default)(this.trackVertical,{opacity:0}))}},{key:"handleTrackMouseEnter",value:function(){this.hasScroll()&&(this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide())}},{key:"handleTrackMouseEnterAutoHide",value:function(){this.props.autoHide&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.dragging||(this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide())}},{key:"handleTrackMouseLeaveAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"showTracks",value:function(){clearTimeout(this.hideTracksTimeout),this.trackHorizontal&&(0,h.default)(this.trackHorizontal,{opacity:1}),(0,h.default)(this.trackVertical,{opacity:1})}},{key:"hideTracks",value:function(){if(this.dragging)return;if(this.scrolling)return;if(this.trackMouseOver)return;const e=this.props.autoHideTimeout;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout((()=>{this.trackHorizontal&&(0,h.default)(this.trackHorizontal,{opacity:0}),(0,h.default)(this.trackVertical,{opacity:0})}),e)}},{key:"detectScrolling",value:function(){this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval((()=>{this.lastViewScrollLeft===this.viewScrollLeft&&this.lastViewScrollTop===this.viewScrollTop&&(clearInterval(this.detectScrollingInterval),this.scrolling=!1,this.handleScrollStop()),this.lastViewScrollLeft=this.viewScrollLeft,this.lastViewScrollTop=this.viewScrollTop}),100))}},{key:"raf",value:function(e){this.requestFrame&&(0,g.cancel)(this.requestFrame);const t=this.enableFallback?(0,v.getPageWindow)().requestAnimationFrame:g.default;this.requestFrame=t((()=>{this.requestFrame=void 0,this.callbackCounter++,e()}))}},{key:"update",value:function(e){this.raf((()=>this._update(e))),setTimeout((()=>{const e=(0,v.getPageWindow)();!this.callbackCounter&&e.requestAnimationFrame&&(this.enableFallback=!0)}),1e3)}},{key:"_update",value:function(e){const t=this.props,n=t.onUpdate,r=t.hideTracksWhenNotNeeded;if(!this.view)return;const i=this.getValues();if((0,m.getScrollBarWidth)()){const e=i.scrollTop,t=i.clientHeight,n=i.scrollHeight,o=(0,m.getInnerHeight)(this.trackVertical),a=this.getThumbVerticalHeight(),s={height:a,transform:`translateY(${e/(n-t)*(o-a)}px)`};if(r){if(this.trackHorizontal){const e={visibility:scrollWidth>clientWidth?"visible":"hidden"};(0,h.default)(this.trackHorizontal,e)}const e={visibility:n>t?"visible":"hidden"};(0,h.default)(this.trackVertical,e)}this.thumbHorizontal&&(0,h.default)(this.thumbHorizontal,thumbHorizontalStyle),(0,h.default)(this.thumbVertical,s)}n&&n(i),"function"==typeof e&&e(i)}},{key:"render",value:function(){const e=(0,m.getScrollBarWidth)(),t=this.props,n=(t.onScroll,t.onScrollFrame,t.onScrollStart,t.onScrollStop,t.onUpdate,t.renderView),r=t.renderTrackHorizontal,i=t.renderTrackVertical,o=t.renderThumbHorizontal,a=t.renderThumbVertical,s=t.tagName,l=(t.hideTracksWhenNotNeeded,t.autoHide),u=(t.autoHideTimeout,t.autoHideDuration),c=(t.thumbSize,t.thumbMinSize,t.onlyY),f=t.universal,h=t.autoHeight,g=t.autoHeightMin,_=t.autoHeightMax,v=(t.scrollMarginTop,t.railClass,t.scrollWrapClass),C=t.position,T=t.style,D=t.children,w=(0,d.default)(t,S),O=this.state.didMountUniversal,A=M(M(M({},E.containerStyleDefault),h&&M(M({},E.containerStyleAutoHeight),{},{minHeight:g,maxHeight:_})),T),I=M(M(M(M({},E.viewStyleDefault),{},{display:"block",marginRight:e?-e:0,marginBottom:!c&&e?-e:0},h&&M(M({},E.viewStyleAutoHeight),{},{minHeight:(0,y.isString)(g)?`calc(${g} + ${e}px)`:g+e,maxHeight:(0,y.isString)(_)?`calc(${_} + ${e}px)`:_+e})),h&&f&&!O&&{minHeight:g,maxHeight:_}),f&&!O&&E.viewStyleUniversalInitial);C&&(I.position=C),c&&(I.overflowX="hidden",b.platform.isMobileOrTablet||(I.overflowY="scroll"));const k={transition:`opacity ${u}ms`,opacity:0},x=M(M(M({},E.trackHorizontalStyleDefault),l&&k),(!e||f&&!O)&&{display:"none"}),P=M(M(M({},E.trackVerticalStyleDefault),l&&k),(!e||f&&!O)&&{display:"none"}),R=[(0,p.cloneElement)(n({style:I},v),{key:"view",ref:e=>{this.view=e}},D)];return c||R.push((0,p.cloneElement)(r({style:x}),{key:"trackHorizontal",ref:e=>{this.trackHorizontal=e}},(0,p.cloneElement)(o({style:E.thumbHorizontalStyleDefault}),{ref:e=>{this.thumbHorizontal=e}}))),R.push((0,p.cloneElement)(i({style:P},this.props.scrollMarginTop,this.props.railClass),{key:"trackVertical",ref:e=>{this.trackVertical=e}},(0,p.cloneElement)(a({style:E.thumbVerticalStyleDefault}),{ref:e=>{this.thumbVertical=e}}))),(0,p.createElement)(s,M(M({},w),{},{style:A,ref:e=>{this.container=e}}),R)}}]),n}(p.Component);t.default=N,N.defaultProps={renderView:function(e,t){return p.default.createElement("jdiv",(0,f.default)({className:t},e))},renderTrackHorizontal:function(e){let t=e.style,n=(0,d.default)(e,C);const r=M(M({},t),{},{right:2,bottom:2,left:2,borderRadius:3});return p.default.createElement("jdiv",(0,f.default)({style:r},n))},renderTrackVertical:function(e,t,n){let r=e.style,i=(0,d.default)(e,T);const o=M(M({},r),{},{right:3,bottom:2,top:t||2,borderRadius:4,width:8});return p.default.createElement("jdiv",(0,f.default)({className:n,style:o},i))},renderThumbHorizontal:function(e){let t=e.style,n=(0,d.default)(e,D);const r=M(M({},t),{},{cursor:"pointer",borderRadius:"inherit",backgroundColor:"#d6dce4"});return p.default.createElement("jdiv",(0,f.default)({style:r},n))},renderThumbVertical:function(e){let t=e.style,n=(0,d.default)(e,w);const r=M(M({},t),{},{cursor:"pointer",borderRadius:"inherit",backgroundColor:"#d6d4d4"});return p.default.createElement("jdiv",(0,f.default)({style:r},n))},tagName:"jdiv",thumbMinSize:30,hideTracksWhenNotNeeded:!0,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,onlyY:!0,universal:!1,railClass:"null",scrollWrapClass:null}},61699:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.viewStyleUniversalInitial=t.viewStyleDefault=t.viewStyleAutoHeight=t.trackVerticalStyleDefault=t.trackHorizontalStyleDefault=t.thumbVerticalStyleDefault=t.thumbHorizontalStyleDefault=t.disableSelectStyleReset=t.disableSelectStyle=t.containerStyleDefault=t.containerStyleAutoHeight=void 0;t.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%",display:"block",WebkitOverflowScrolling:"touch"};t.containerStyleAutoHeight={height:"auto"};t.viewStyleDefault={position:"absolute",maxHeight:"100%",top:"auto",left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"};const n={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0};t.viewStyleAutoHeight=n;t.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0};t.trackHorizontalStyleDefault={position:"absolute",height:0};t.trackVerticalStyleDefault={position:"absolute",width:8};t.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"};t.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"};t.disableSelectStyle={userSelect:"none"};t.disableSelectStyleReset={userSelect:""}},6139:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=r(n(98661)),a=r(n(45697)),s=r(n(94184)),l=r(n(42217)),u=n(21733),c=n(79641);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t{let t=e.h,n=e.w,r=e.component,i=e.addClassname;const a=r||"div",d=(0,s.default)({[l.default.spacer]:!0,[l.default["__"+t+"H"]]:(0,u.isString)(t),[l.default["__"+n+"W"]]:(0,u.isString)(n),[i]:i}),p=f(f({},(0,c.isNumber)(t)&&{height:t,minHeight:t}),(0,c.isNumber)(n)&&{width:n,minWidth:n});return o.default.createElement(a,{style:p,className:d})};p.propTypes={h:a.default.oneOfType([a.default.number,a.default.oneOf(["xs","sm","md","lg","xl"])]),w:a.default.oneOfType([a.default.number,a.default.oneOf(["xs","sm","md","lg","xl"])]),addClassname:a.default.string,component:a.default.any};var h=p;t.default=h},4244:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(98661)),o=n(36113),a=r(n(45697)),s=n(42932),l=n(87692),u=n(24111),c=n(75998),d=r(n(95554));const f=e=>{let t=e.isNarrow,n=e.IsIgnoreHeight;const r=(0,o.useSelector)(l.selectWidgetOrientation),a=(0,o.useSelector)(l.selectWidgetPadding),f=(0,u.useAppDispatch)();return i.default.createElement(d.default,{orientation:r,padding:a,isNarrow:t,IsIgnoreHeight:n,onSetIsInDrag:e=>f((0,s.setIsInDrag)(e)),onSetPosition:e=>c.positionDispatch.initPositionStore(e)})};f.propTypes={isNarrow:a.default.bool,IsIgnoreHeight:a.default.bool};var p=f;t.default=p},95554:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67375)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),a=r(n(94184)),s=r(n(45697)),l=r(n(10611)),u=n(9709);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}const d=e=>{let t=e.orientation,n=e.padding,r=e.isNarrow,s=e.IsIgnoreHeight,c=e.onSetIsInDrag,d=e.onSetPosition;const f=(0,o.useRef)(null),p=(0,o.useState)({dragStarted:!1}),h=(0,i.default)(p,2),g=h[0],_=h[1],m=(0,u.dragEvents)({orientation:t,padding:n,onSetIsInDrag:c,IsIgnoreHeight:s,onSetPosition:d}),v=m.startDrag,y=m.drag,b=m.stopDrag;return o.default.createElement("jdiv",{className:(0,a.default)({[l.default.wrap]:!0,[l.default.__short]:r,[l.default.__active]:g.dragStarted}),ref:f,onMouseDown:e=>{g.dragStarted||(_({dragStarted:!0}),v(e))},onMouseMove:e=>{g.dragStarted&&y(e)},onMouseUp:()=>{g.dragStarted&&(b(),_({dragStarted:!1}))},onMouseOut:()=>{g.dragStarted&&(_({dragStarted:!1}),b())}})};d.propTypes={orientation:s.default.string,padding:s.default.number,isNarrow:s.default.bool,IsIgnoreHeight:s.default.bool,onSetIsInDrag:s.default.func,onSetPosition:s.default.func};var f=o.default.memo(d);t.default=f},9709:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.dragEvents=void 0;var i=n(43914),o=n(52274),a=n(70859),s=n(32183),l=n(23267),u=r(n(19955)),c=r(n(75686)),d=n(2982),f=n(97490),p=n(44145);let h,g,_,m,v,y=null;const b=e=>{y=c.default.get(a.Component.SCROLL_CONTAINER),y&&y.style&&(y.style.display=e?"block":"none")},E=e=>{let t=e.e,n=e.onSetIsInDrag,r=e.mainSide;n(!0),m=t.screenX,v=t.screenY,b(!1);const i=c.default.get(a.Component.WIDGET_CONTAINER),u=r;var f;if("right"===u&&null===(0,d.getProperty)("right",i)&&((0,d.setProperty)("right",(f=i,(0,l.getPageWindow)().document.body.clientWidth-(f.offsetLeft||40)-f.offsetWidth+"px"),i),(0,d.setProperty)("left",null,i)),"left"===u&&null!==(0,d.getProperty)("right",i)){const e=i.offsetLeft+"px";(0,d.setProperty)("left",e,i),(0,d.setProperty)("right",null,i)}if("left"===u&&""===(0,d.getProperty)("left",i)){const e=i.offsetLeft||"40px";(0,d.setProperty)("left",e,i),(0,d.setProperty)("right",null,i)}const p=(0,s.getElementPosition)(i),y=i.offsetHeight;h=parseInt((0,d.getProperty)(u,i)),g=parseInt(y),p.minLeft="left"===u?40:30,p.maxLeft=p.windowWidth-p.width-p.minLeft,p.maxLeft-=30,p.minHeight=o.MINIMAL_WIDGET_HEIGHT,p.height=y{let t=e.onSetIsInDrag,n=e.onSetPosition;b(!0);const r=(()=>{const e=c.default.get(a.Component.WIDGET_CONTAINER);let t=parseInt((0,d.getProperty)("height",e));t&&t{let t=e.e,n=e.ignoreHeight,r=e.mainSide,i=m-t.screenX;const o=v-t.screenY,s=r;"left"==s&&(i=-i);const l=_,y=h?h+i:l.minLeft+i,b=c.default.get(a.Component.WIDGET_CONTAINER);yl.maxLeft?(0,d.setProperty)(s,l.maxLeft+"px",b):(0,d.setProperty)(s,y+"px",b);let E=g+o;if(E!==l.height&&(E>l.minHeight||E>l.height)&&((()=>{const e=(0,p.getApp)().route;return-1!==[f.Route.CALL,f.Route.INTRODUCE,f.Route.CALL_EULA].indexOf(e)})()&&(E="auto"),E>_.maxHeight&&(E=_.maxHeight),_.height=E,n||(0,d.setProperty)("height",E+"px",b)),u.default.safari()&&!u.default.mobileOrTablet()){const e=(0,d.getSavedLabelPosition)();e&&((0,d.setProperty)("labelright",e.right,b),(0,d.setProperty)("labelleft",e.left,b),(0,d.setProperty)("labelwidth",e.offsetWidth,b)),(0,d.updateKeyframes)(b,!0)}};t.dragEvents=e=>{let t=e.orientation,n=e.padding,r=e.IsIgnoreHeight,i=e.onSetIsInDrag,o=e.onSetPosition;const a="left"===t||0===n&&"bottom"===t?"left":"right";return{startDrag:e=>E({e:e,onSetIsInDrag:i,mainSide:a}),drag:e=>T({e:e,IsIgnoreHeight:r,mainSide:a}),stopDrag:()=>C({onSetIsInDrag:i,onSetPosition:o})}}},66488:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromCodePoint=l,t.replace=function(e,t){return String(e).replace(i.EMOJI_REGEX,t)},t.replaceEmoji=function(e){return e.replace(/:\w+:/g,(e=>{const t=e.replace(/:/g,"");return r.emojiList[t]?l(r.emojiList[t]):e}))},t.toCodePoint=void 0;var r=n(18073),i=n(30633);const o=String.fromCharCode,a=/\uFE0F/g,s=String.fromCharCode(8205);function l(e){let t="string"==typeof e?parseInt(e,16):e;return t<65536?o(t):(t-=65536,o(55296+(t>>10),56320+(1023&t)))}t.toCodePoint=(e,t)=>function(e,t){const n=[];let r=0,i=0,o=0;for(;o{const e=(0,a.getSystemSettings)();return`${window.parent.location.protocol+e.baseUrl}/script/eula/${e.widgetId}`};t.getEulaUrl=u;const c=()=>{const e=(0,a.getFeatures)().eula,t={show:!1,checked:!1,text:!1,url:e&&e.externalLink?e.externalLink:u(),agreementBasis:e&&e.customAgreement?e.customAgreement:"законом №152-ФЗ «О персональных данных» от 27.07.2006",textSize:null,customTitle:"Согласен на обработку персональных данных",customLink:"Пользовательского соглашения"};return e&&e.useGdpr&&(t.customTitle=e.customTitle||(0,o.l10n)("eula_custom_title"),t.customLink=e.titleExternalLink||!1,t.agreementBasis=e.customAgreement||(0,o.l10n)("eula_custom_agreement")),t};t.getEulaState=c;t.getAgreementText=e=>{const t=(0,a.getFeatures)().eula;return t&&!t.useGdpr?`Ставя отметку, я даю свое согласие на обработку моих персональных данных в соответствии с\n ${e} и принимаю условия `:`${e} `};t.getEulaLink=e=>{const t=(0,a.getFeatures)().eula,n=c();return!t.useGdpr||t.useGdpr&&t.externalLink?i.default.createElement("a",{href:t.externalLink||u(),onClick:e,target:"_blank",rel:"noopener noreferrer"},n.customLink):null};t.trackClick=()=>{s.Monitoring.telemetry(l.TelemetryName.EULA_LINK_CLICKED,{param1:"call_popup"})}},25466:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentUploadProgress=void 0;const r=(0,n(6400).createContext)({loadedSize:0,setLoadedSize:()=>{}});t.CurrentUploadProgress=r},66934:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.startUploadMedia=t.sendMedia=t.openIntroduce=t.getUrlEmoji=t.getTextMediaEmoji=t.getMediaDataFormatted=t.getMediaData=void 0;var i=r(n(61125)),o=r(n(14264)),a=n(21476),s=n(97490),l=n(69625),u=n(81152),c=n(53489),d=r(n(71277)),f=n(26932),p=r(n(4855)),h=n(83170),g=n(54415),_=n(52274),m=n(65465),v=n(55329),y=n(13077),b=n(54346),E=n(44145),C=n(16016),T=n(49963),D=n(75141),w=n(8717),S=n(77294);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t{T.connectionAdapter.checkConnection((()=>T.connectionAdapter.sendEvent(e)))};t.sendMedia=k;t.openIntroduce=e=>{(0,w.shouldRedirectToIntroduce)()&&(e.preventDefault(),e.stopPropagation(),a.Router.next(s.RouterEvent.ToIntroduce))};const M=e=>{let t="";return t=e.indexOf("image")>=0?"📸":e.indexOf("video")>=0?"📽️":e.indexOf("audio")>=0?"🔉":"📄",t};t.getTextMediaEmoji=M;const x=e=>{const t={},n=e.get("body");if(n&&!n.error&&(n.file_url||n.file)){const e=!!n.status,r=n.file_url||n.file,i=`${M(e?n.mime_type:n.type)} ${r}`,o=A({},n);I.warn("getMediaData",e,o,i),o.file=r,delete o.file_url,e?(delete o.loadedSize,delete o.status):o.type=(0,D.detectType)(n.type),t.message=i,t.media=o,I.warn("data to send:",t)}return t};t.getMediaDataFormatted=x;const P=(e,t)=>{let n="";return n=e.indexOf("image")>=0?"📸":e.indexOf("video")>=0?"📽️":e.indexOf("audio")>=0?"🔉":"📄",n+" "+t};t.getUrlEmoji=P;t.getMediaData=e=>{try{return x(e)}catch(e){return g.Monitoring.reportException(e),!1}};t.startUploadMedia=(e,t)=>{let n=t.privateId,r=t.repliedMsgId,i=t.onUploadProgress,a=t.onCancel;n||(n=(0,C.generateGUID)()),r&&f.appDispatchers.setQuoteMsgId(null),(0,b.markInvitationAnswered)(),f.messagesDispatchers.addMessage({type:u.MessageType.MEDIA,from:u.MessageInitiator.CLIENT,private_id:n,replied_message:r?o.default.getMessageById(r).toJSON():null,body:{type:(0,D.detectType)(e.type),file_name:(0,c.sanitize)(e.name),file_size:e.size,mime_type:e.type,loadedSize:0,status:u.MediaStatus.UPLOADING}});const s=(0,E.getMessageByPrivateId)(n);l.mediaUploader.startUpload(s,e,(t=>{I.warn("file url:",s,e,t);const o=(0,D.detectType)(e.type),a={file:t.fullUrl,file_name:e.name,file_size:e.size,type:o,mime_type:e.type},l=A({},s.body),c=(0,S.isVideo)(e.type);if("photo"===o||c){c||(l.width=e.width,l.height=e.height,a.width=e.width,a.height=e.height);const n=(0,S.getSize)(a);a.thumb=`${t.fullUrl}?width=${n.width||_.MAX_IMAGE_WIDTH}&thumb`,l.thumb=a.thumb}l.status=u.MediaStatus.COMPLETE,l.file=t.fullUrl,l.file_size=e.size;const p=P(e.type,t.fullUrl);null==i||i(0),f.messagesDispatchers.updateMessage({privateId:n},{text:p,body:A(A({},s.body),l)});const b={name:"client_message",message:p,replied_msg_id:r,private_id:n,media:a};f.appDispatchers.setChatStarted(!0),k(b),m.messageActions.checkMessageStatus(n),(0,v.prechatEnabled)()&&m.messageActions.deletePrechatMsg(),(0,y.getRuleLocal)("firstMessageTime")||(0,y.setRuleLocal)("firstMessageTime",new Date),m.messageActions.startContactFormIfNeed(),d.default.play("outgoing_message"),g.Monitoring.telemetry(h.TelemetryName.FILE_UPLOAD_SUCCESS,{param1:e.type}),r&&g.Monitoring.telemetry(h.TelemetryName.REPLY_BUTTON_SEND)}),i,a)}},63121:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useInitSwipe=t.moveMobileContainer=t.getTexts=t.getShowMenu=t.getInCall=t.getDarkText=t.getClickable=t.getCallButton=t.getAvatars=t.checkIsIntroduce=void 0;var i=n(69882),o=n(21476),a=n(97490),s=r(n(79868)),l=r(n(4855)),u=n(20344),c=r(n(50754)),d=r(n(75686)),f=n(70859),p=n(68403),h=n(23267),g=n(16217),_=n(20676),m=n(45683),v=n(44145),y=n(40287);const b=l.default.name("HeaderHelpers");t.getAvatars=(e,t,n,r,i)=>{const o=(0,p.getJoinedAgents)(t,n),a=(0,p.getJoinedAgents)(r,i,!0);if(o.length||a.length){if(o.length){return o.map((t=>({url:t.avatarUrl?(0,m.getAvatarApiURL)(e,t.avatarUrl):null})))}return a.map((t=>({url:t.avatarUrl?(0,m.getAvatarApiURL)(e,t.avatarUrl):null})))}return[]};t.getCallButton=e=>{const t=-1!==[a.Route.DEPARTMENTS,a.Route.CHAT_EULA,a.Route.INTRODUCE].indexOf(o.Router.getCurrentRoute()),n=_.platform.isMobileOrTablet&&e;return((0,g.isCallbackEnabled)()||n)&&!(0,g.isCallActive)()&&!t};t.getDarkText=e=>"dark"===e;t.getInCall=()=>(0,g.isCallActive)();t.getTexts=(e,t,n,r,s,l,c,d,f)=>{if(!e)return{mainText:s||r,subText:""};const h=(0,v.getApp)().route||o.Router.getCurrentRoute();if(h===a.Route.DEPARTMENTS)return{mainText:(0,u.l10n)("lblSelectDep"),subText:""};if(h===a.Route.INTRODUCE&&!(0,g.isCallActive)()||h===a.Route.CHAT_EULA&&o.Router.getPrevRoute()===a.Route.INTRODUCE)return{mainText:(0,u.l10n)("lblIntroduceRequestBefore"),subText:""};if((0,i.isWixEditor)()&&(t||n))return{mainText:t||(0,u.l10n)("lblConnectedToAgent"),subText:n||(0,u.l10n)("lblOperatorsOnline")};const _=(0,p.getJoinedAgents)(l,c,!1),m=(0,p.getJoinedAgents)(d,f,!0);if(1===_.length)return{mainText:_[0].name,subText:_[0].title};if(_.length>3)return{mainText:E(),subText:""};if(_.length>1){const e=[];return _.forEach((t=>{e.push(t.name.replace(/ /g," "))})),{mainText:e.join(", "),subText:""}}return m.length?{mainText:m[0].name,subText:m[0].title}:{mainText:(0,u.l10n)("lblConnectedToAgent"),subText:(0,u.l10n)("lblOperatorsOnline")}};const E=()=>{const e=(0,h.getPageWindow)().location.hostname.replace("www.","");if(""===e)return(0,u.l10n)("lblOperatorsOnline");try{return c.default.toUnicode(e)}catch(t){return e}};t.getClickable=e=>e===a.Route.CHAT_MIN;t.getShowMenu=(e,t,n)=>{const r=!!(s.default.getJoints().count||t||n),i=[a.Route.INTRODUCE,a.Route.CHAT_CALL].includes(e);return!(!_.platform.isChatPage||i||!r)};t.checkIsIntroduce=(e,t,n)=>e==a.Route.INTRODUCE||e==a.Route.CHAT_EULA&&1==t&&!n;const C=e=>{const t=d.default.get(f.Component.MOBILE_CONTAINER);t&&t.style&&t.style.setProperty("transform",e?`translateY(${Math.abs(e)}px)`:null,"important")};t.moveMobileContainer=C;t.useInitSwipe=(e,t)=>{(0,y.useSwipe)({element:!_.platform.isChatPage&&_.platform.isMobileOrTablet?e:null,horizontalSwipeThreshold:120,onDownSwipe:()=>{t&&t(!0)},onLeftSwipe:()=>{},onDownCount:e=>{b.warn("onDownCount"),o.Router.debugClicks=0,C(e)},onTouchEnd:()=>{b.warn("onTouchEnd"),C(0),o.Router.next(a.RouterEvent.ToDebug)}})}},55921:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useGetHeaderColors=function(){const e=(0,r.useSelector)(o.selectWidgetColor),t=(0,r.useSelector)(o.selectWidgetColor2),n=(0,r.useSelector)(o.selectPowerButtonColor),l=(0,r.useSelector)(o.selectPowerGradient),u=(0,r.useSelector)(o.selectPattern),c=u?(0,a.getPatternURL)(u):null,d=(0,i.getBackground)(e,t,l,n,s.platform.isMobileOrTablet||s.platform.isChatPage),f=t||e,p="dark"===(0,r.useSelector)(o.selectWidgetFontColor);return{background:d,leafBackground:f,isDarkText:p,patternUrl:c}};var r=n(36113),i=n(80598),o=n(87692),a=n(45683),s=n(20676)},89177:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.afterEmojiInserted=function(e){e&&e.check();const t=d.default.get(f.Component.INPUT);t&&(t.focus(),M(t,t.value))},t.checkOfflineForm=function(){s.messageActions.handleContactsForm()},t.getColorTheme=function(e){switch(e?"disabled":(0,m.getUserSettings)().bubbleColor||"green"){case"disabled":return{color:"#c9cdd3",hoverColor:"#c9cdd3"};case"blue":return{color:v.colorsFromFigma.BLUE_80,hoverColor:v.colorsFromFigma.BLUE_90};case"grey":return{color:v.colorsFromFigma.STEEL_80,hoverColor:v.colorsFromFigma.STEEL_90};default:return{color:v.colorsFromFigma.GREEN_80,hoverColor:v.colorsFromFigma.GREEN_90}}},t.getDisabled=function(e){if(e)return!0;return(0,o.isOfflineCanSend)()},t.getIsMobile=void 0,t.getPlaceholder=function(e,t){let n="";if(e){if(n=(0,h.l10n)("offlineBlockedInputPlaceholder"),C.EnvironmentManager.isWidgetConstructor()&&(n=(0,h.l10n)("lblMessageHere")),(0,m.getApp)().maintenance&&(n=(0,h.l10n)("maintenanceBlockedPlaceholder")),(0,m.getFeatures)().recaptcha){const e=y.default.getInstance();e&&e.isBlocked()&&(n=(0,h.l10n)("maintenanceBlockedPlaceholder"))}}else n=(O.platform.isMobileOrTablet,(0,h.l10n)("lblMessageHere"));t&&(n=(0,h.l10n)("botListPickerBlock"));return n},t.getText=k,t.isActiveElementFocused=void 0,t.isFileUploadDisabled=function(){if(i.default.bots&&!(0,m.getFeatures)().botMedia&&!a.default.agent_id)return!0;return!x()},t.isFileUploadEnabled=x,t.isSocialButtonEnabled=function(){return i.default.joint&&(i.default.joint.vk||i.default.joint.fb)&&!O.platform.isMobileOrTablet&&!(0,g.isChatContactForm)()&&!O.platform.isChatPage},t.onFocus=function(){I.log("onFocus");const e=d.default.getComponent(f.Component.SCROLL_CONTAINER);e&&e.setIgnore(!1)},t.onInputSubmit=function(e){let t=e.value,n=e.repliedMsgId;s.messageActions.sendClientMessage({text:t,repliedMsgId:n}),(0,b.connectionTypingInsight)(""),(0,b.connectionClientTyping)(!1),l.default.play("outgoing_message")},t.onPaste=function(e,t,n){if(x()&&!(0,A.shouldRedirectToIntroduce)()){const r=(0,m.getMessages)().some((e=>{var t;return(null==e||null===(t=e.body)||void 0===t?void 0:t.status)===T.MediaStatus.UPLOADING})),i=e.clipboardData;if(!r.length&&i&&i.files&&i.files.length){e.preventDefault();const r=i.files[0];(0,D.startUploadMedia)(r,{privateId:null,repliedMsgId:t,onUploadProgress:n,onCancel:()=>{n(0)}})}}},t.replaceEmojiValue=function(e){return e.replace(E.EMOJI_REGEX," $& ")},t.setCursorEnd=M,t.setPaddingForFocus=void 0,t.setPlaceholder=function(e){if(e=e.replace(/"/g,'"').replace(/'/g,"'"),u.Router.getCurrentRoute()!==c.Route.LABEL){const t=d.default.get(f.Component.INPUT);t&&t.setAttribute("placeholder",e);const n=d.default.get(f.Component.AUTORESIZER);n&&n.check()}},t.startTyping=function(e){if(e){const t=k(e);I.log("startTyping",t),(0,b.connectionClientTyping)(t),(0,b.connectionTypingInsight)(t)}},t.stopTyping=function(){I.log("stopTyping"),(0,b.connectionClientTyping)(!1)};var i=r(n(96394)),o=n(81722),a=r(n(26754)),s=n(65465),l=r(n(71277)),u=n(21476),c=n(97490),d=r(n(75686)),f=n(70859),p=n(32183),h=n(20344),g=n(68403),_=r(n(4855)),m=n(44145),v=n(36874),y=r(n(50216)),b=n(15787),E=n(30633),C=n(97615),T=n(81152),D=n(66934),w=n(66488),S=n(23267),O=n(20676),A=n(8717);const I=_.default.name("InputHelpers");function k(e){return i.default.disable_emoji?e:(0,w.replaceEmoji)(e)}function M(e,t){e.setSelectionRange&&e.setSelectionRange(t.length+2,t.length+2)}function x(){const e=!i.default.disable_filetransfer&&0!==i.default.options;return(0,m.getApp)().isOnline?((0,m.getFeatures)().botMedia||!a.default.bot_id)&&e:e&&(0,m.getClient)().isIntroduced}t.getIsMobile=()=>O.platform.isMobileOrTablet||O.platform.isChatPage;t.isActiveElementFocused=()=>{const e=(0,S.getPageWindow)().document.activeElement;return!!e&&(0,p.isInput)(e.tagName)};t.setPaddingForFocus=e=>{const t=d.default.getComponent(f.Component.MESSAGES_CONTAINER);t&&t.style&&(t.style.paddingBottom=e?"44px":"0px")}},57147:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(98661)),a=r(n(19383)),s=r(n(40704)),l=r(n(19955)),u=r(n(45697)),c=r(n(94184)),d=n(90361),f=n(36874);const p=e=>{let t=e.backgroundColor,n=e.onClick,r=e.online,u=e.orientation,p=e["data-qa-id"];return l.default.mobileOrTablet()?null:o.default.createElement("jdiv",(0,i.default)({className:(0,c.default)({[a.default.leaf]:!0,[a.default["_"+u]]:!0}),onClick:n||null},(0,d.withLocator)(p)),o.default.createElement(s.default,{color:t,color2:r?f.colorsFromFigma.GREEN_80:"#5e5f61",iconName:r?"leafBottom":"leafBottomOffline",className:a.default.cssLeaf}))};p.propTypes={backgroundColor:u.default.string.isRequired,onClick:u.default.func,online:u.default.bool.isRequired,orientation:u.default.string.isRequired,"data-qa-id":u.default.string};var h=o.default.memo(p);t.default=h},77294:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setSvgProgress=t.isVideo=t.isPreviewImage=t.isNewMedia=t.isFileGif=t.isAgentMessage=t.getUrl=t.getSize=t.getIconName=t.getIconColor=t.getCircleColor=t.getApiHost=t.formatOldMedia=t.calculateAspectRatio=void 0;var i=n(44145),o=n(52274),a=n(81152),s=r(n(19955)),l=n(36874),u=n(23267);const c=(e,t,n,r)=>{const i=Math.min(n/e,r/t);return{width:(e*i).toFixed(),height:(t*i).toFixed()}};t.calculateAspectRatio=c;t.getIconColor=e=>{switch(e){case"blue":return l.colorsFromFigma.BLUE_80;case"grey":return l.colorsFromFigma.STEEL_80;default:return l.colorsFromFigma.GREEN_80}};t.getIconName=e=>{switch(e){case a.MediaType.VOICE:return"icon-audio";case a.MediaType.STICKER:return"icon-document";default:return`icon-${e}`}};t.getCircleColor=e=>{switch(e){case"blue":return l.colorsFromFigma.BLUE_90;case"grey":return l.colorsFromFigma.STEEL_90;default:return l.colorsFromFigma.GREEN_90}};t.getSize=e=>{const t={width:null,height:null};if(e.width&&e.width>o.MAX_IMAGE_WIDTH){const n=c(e.width,e.height,o.MAX_IMAGE_WIDTH,500);return t.width=n.width,t.height=n.height,t}return t.width=e.width,t.height=e.height,t};t.isAgentMessage=e=>e.from===a.MessageInitiator.AGENT||e.from===a.MessageInitiator.FORM||e.type===a.MessageType.PROACTIVE;t.isNewMedia=e=>!!e&&(e.includes("https://media")&&e.includes("jivosite.com"));t.getUrl=e=>s.default.mobileOrTablet()&&s.default.chromeIOS()?null==e?void 0:e.replace(/^https?:\/\//i,"googlechrome://"):e;t.isPreviewImage=e=>{if(!e)return!1;const t=e.toLowerCase();return/\.(gif|jpg|jpeg|png|webp)$/i.test(t)};t.isVideo=e=>!!e&&/(video\/)/i.test(e.toLowerCase());t.isFileGif=e=>{if(!e)return!1;const t=e.toLowerCase();return/\.(gif)|\/(gif)$/i.test(t)};t.getApiHost=()=>{const e=(0,i.getSystemSettings)().apiHost;return(0,u.getProtocol)()+"//"+e||"https://api.jivosite.com"};t.formatOldMedia=e=>(e.name&&(e.file_name=e.name),e.icon_type&&(e.mime_type=e.type,e.type=e.icon_type),e.status||(e.status=e.error?a.MediaStatus.ERROR:a.MediaStatus.COMPLETE),e);t.setSvgProgress=(e,t,n,r)=>{if(n&&t&&t.current){let i=(r/n*100).toFixed(0);const o=t.current.getElementsByTagName("circle")[1];if(e&&(i=100),isNaN(i))o.style.strokeDashoffset=1;else if(o){const e=o.getAttribute("r"),t=(100-i)/100*(Math.PI*(2*e));o.style.strokeDashoffset=t}}}},55329:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.updatePrechatTime=t.prechatUsed=t.prechatSetUsed=t.prechatEnabled=t.getPrechatUseTime=void 0;var i=n(13077),o=r(n(14264)),a=n(81152),s=n(44145),l=n(68403);let u=!1;t.prechatUsed=()=>u;t.prechatSetUsed=e=>{e&&(0,i.setRuleLocal)("prechatUseTime",(new Date).getTime()),u=e};const c=()=>{const e=(0,s.getProactive)(),t=e.campaignId,n=e.name,r=e.prechats,i=(0,l.isPaidCustomer)();return!(t&&n&&!r)&&((i||r&&t)&&((0,s.getFeatures)().prechat||r)&&!(0,s.getApp)().maintenance&&!(0,s.getSystemSettings)().botmode)};t.prechatEnabled=c;t.getPrechatUseTime=()=>{const e=(0,i.getRuleLocal)("prechatUseTime");if(!e)return null;const t=((new Date).getTime()-e)/1e3;return(0,i.setRuleLocal)("prechatUseTime",null),parseInt(t)};t.updatePrechatTime=e=>{if(c()){const t=o.default.getMessagesByType(a.MessageType.PRECHAT);t.length&&t[0].set("created_ts",e+1)}}},31694:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.PrechatEmitter=void 0,t.useEnhanced=function(){const e=(0,o.useState)([]),t=(0,i.default)(e,2),n=t[0],r=t[1],s=(0,o.useState)((()=>w.platform.isMobileOrTablet&&!w.platform.isChatPage)),A=(0,i.default)(s,2),I=A[0],k=A[1],M=(0,a.useDispatch)(),x=(0,o.useRef)(),P=(0,a.useSelector)(b.selectPrechat),R=(0,a.useSelector)(b.selectEnablePrechat),N=(0,a.useSelector)(b.selectBubbleColor),L=(0,a.useSelector)(b.selectLocale),F=(0,a.useSelector)(b.selectDisableEmoji),j=w.platform.isMobileOrTablet,B=w.platform.isIos,U=(0,a.useSelector)(T.selectProactive,a.shallowEqual),W=(0,a.useSelector)(D.selectCampaigns),H=(0,o.useCallback)((e=>{if(Array.isArray(P)&&!P.length)return[];if(W&&U.prechats&&Array.isArray(U.prechats))return U.prechats;const t=(0,c.sortBy)(null!=e?e:P,"id"),n=t.length||3,r=[];for(let e=0;e{r(H(e))}))}),[H]),(0,o.useEffect)((function(){v.default.set(u.Component.PRECHAT,x.current)}),[]),(0,o.useEffect)((function(){const e=setTimeout((()=>k(!1)),500);return()=>{clearTimeout(e)}}),[]),{componentRef:x,bubbleColor:N,phrases:n,isHidden:I,isDisabledEmoji:F,isMobile:j,isIos:B,enablePrechat:R,sendPhrase:(e,t)=>{(0,C.prechatSetUsed)(!0),(0,S.shouldRedirectToIntroduce)()?(M((0,g.setLastMessage)(e)),p.Router.next(h.RouterEvent.ToIntroduce)):(d.messageActions.sendClientMessage({text:e}),y.default.play("outgoing_message"),w.platform.isMobileOrTablet||(0,l.afterEmojiInserted)());k(!0),f.Monitoring.telemetryOnce(_.TelemetryName.PRECHAT,{param1:t,param2:L}),m.default.trackPrechatClick(t)}}};var i=r(n(67375)),o=n(98661),a=n(36113),s=n(89766),l=n(89177),u=n(70859),c=n(938),d=n(65465),f=n(54415),p=n(21476),h=n(97490),g=n(92056),_=n(83170),m=r(n(138)),v=r(n(75686)),y=r(n(71277)),b=n(87692),E=n(20344),C=n(55329),T=n(7193),D=n(95448),w=n(20676),S=n(8717);const O=new s.EventEmitter;t.PrechatEmitter=O},93254:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(84827)),s=r(n(85299)),l=r(n(55536)),u=r(n(98661)),c=n(36113),d=r(n(45697)),f=r(n(74379)),p=r(n(2167)),h=r(n(53517)),g=r(n(21135)),_=n(21476),m=n(97490),v=r(n(94184)),y=n(47138),b=r(n(75686)),E=n(70859),C=n(34930),T=n(625),D=r(n(96394)),w=n(72665),S=n(29312),O=n(16217),A=n(20676),I=r(n(47860)),k=n(46658);function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}let x=function(e){(0,a.default)(n,e);var t=M(n);function n(e){var r;return(0,i.default)(this,n),(r=t.call(this,e)).showState=!1,r}return(0,o.default)(n,[{key:"componentDidUpdate",value:function(){this.props.route===m.Route.LABEL||this.props.route===m.Route.CAMPAIGN_POPUP||A.platform.isTablet&&this.props.route===m.Route.MOBILE_MENU||this.props.route===m.Route.HIDDEN?f.default.unblockSite():f.default.blockSite(),this.props.route!=m.Route.HIDDEN?this.props.route!==m.Route.LABEL&&this.props.route!==m.Route.HIDDEN?f.default.setZoomChangeIterval(500):f.default.setZoomChangeIterval(1e3):clearInterval(f.default.intervalId)}},{key:"renderMenuContainer",value:function(){return A.platform.isTablet?null:u.default.createElement(g.default,{allowedRoutes:[m.Route.MOBILE_MENU],currentRoute:this.props.route,name:"OmniMenuContainer"},u.default.createElement(h.default,{show:!0,onCancelClick:()=>_.Router.next(m.RouterEvent.CloseWindow)}))}},{key:"renderWidgetContainer",value:function(){return u.default.createElement(g.default,{allowedRoutes:(0,k.getAllowedRoutes)(),currentRoute:this.props.route,name:"MobileWidgetContent"},u.default.createElement("jdiv",{className:(0,v.default)({[I.default.mobileContainer]:!0,[I.default.__tablet]:A.platform.isTablet||A.platform.isDesktop&&A.platform.isChatPage,[I.default.__cpFull]:A.platform.isChatPage&&D.default.enable_full_cp}),style:{zoom:(0,T.getZoom)(this.props.zoom),zIndex:2147483647,"-webkit-text-size-adjust":A.platform.isIos?f.default.getTextSize():"none"},ref:e=>{b.default.set(E.Component.MOBILE_CONTAINER,e)}},u.default.createElement(p.default,{needRenderCloseBtn:!1,needRenderCallContainer:(0,O.isCallbackEnabled)(),needRenderDrag:!1,showCloseButton:!0,showHeaderText:!0,showBody:!0,callbackEnabled:this.props.callbackEnabled,route:this.props.route,onCloseButtonClick:()=>{(0,C.closeWidget)(),this.props.callbackStatus===y.CallStatus.CONNECTED&&_.Router.next(m.RouterEvent.CloseWindow)}})))}},{key:"render",value:function(){return u.default.createElement(u.default.Fragment,null,this.renderWidgetContainer(),u.default.createElement(w.LandscapeOverlay,null),u.default.createElement(S.ZoomOverlay,null),this.renderMenuContainer())}}]),n}(u.default.PureComponent);x.propTypes={chat:d.default.bool,tabletMenu:d.default.bool,callbackEnabled:d.default.bool,route:d.default.string,position:d.default.any,padding:d.default.number,callbackStatus:d.default.oneOfType([d.default.string,d.default.bool]),mobileOrientation:d.default.string,zoom:d.default.number};var P=(0,c.connect)((e=>({padding:e.settings.user.widgetPadding,mobileOrientation:e.settings.user.widgetMobileOrientation,route:e.app.route,callbackEnabled:e.callback.available,position:e.position,callbackStatus:e.callback.status,zoom:e.zoom.app})),{})(x);t.default=P},46658:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAllowedRoutes=void 0;var r=n(97490);t.getAllowedRoutes=()=>[r.Route.CHAT,r.Route.CHAT_CALL,r.Route.CHAT_EULA,r.Route.CHAT_SOCIAL,r.Route.CHAT_MIN,r.Route.DEPARTMENTS,r.Route.INTRODUCE,r.Route.CALL,r.Route.CALL_EULA,r.Route.DEPARTMENTS,r.Route.INTRODUCE,r.Route.DEBUG,r.Route.CHAT_SETUP_CALL]},23095:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(67375)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=w(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),s=n(36113),l=r(n(45697)),u=r(n(94184)),c=n(57930),d=n(90361),f=n(52274),p=r(n(40704)),h=n(56443),g=r(n(19955)),_=n(87869),m=n(23267),v=n(77389),y=n(89334),b=n(42601),E=n(43417),C=n(50339),T=r(n(29384)),D=n(14045);function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(w=function(e){return e?n:t})(e)}let S=!1;const O=e=>{let t=e.show,n=e.text,r=void 0===n?"":n,l=e.link,w=e.campaign,O=e.isLeftOrientation,A=e.onClick,I=e.onClose,k=e.onLink,M=e.isMarkdown,x=e.isWidgetConstructor;const P=(0,a.useRef)(null),R=(0,a.useRef)(null),N=(0,a.useState)(!0),L=(0,o.default)(N,2),F=L[0],j=L[1],B=(0,a.useState)(0),U=(0,o.default)(B,2),W=U[0],H=U[1],G=Math.round(W)>=f.CAMPAIGN_TEXT_HEIGHT,V=r.length{x||(j(!0),setTimeout((()=>{null==A||A(e)}),200))};(0,y.useEffectOnce)((function(){if(P.current){const e=P.current.offsetHeight;e&&H(e),j(!1)}}));const $=(0,v.useListenedStyle)("textSize"),Z=g.default.ios()?{"-webkit-text-size-adjust":$}:null,q=(0,s.useSelector)(b.selectZoom).page*(0,m.getPageWindow)().innerWidth-38,K=q?{maxWidth:q.toFixed()+"px",minWidth:G?q.toFixed()+"px":null}:null,Y=(0,u.default)({[T.default.popup]:!0,[T.default.__show]:t,[T.default.__left]:O,[T.default.__widgetConstructor]:x}),J=(0,u.default)({[T.default.popupBlock]:!0,[T.default.__show]:!0,[T.default.__short]:V,[T.default.__left]:O,[T.default.__isCampaign]:!0}),X=(0,u.default)({[T.default.popupAnim]:!0,[T.default.__show]:!F&&t,[T.default.__longText]:G,[T.default.__noImage]:!(null!=w&&w.img_src)}),Q=e=>{x||(S=!0,j(!0),setTimeout((()=>{null==I||I(e),S=!1}),200))};if((0,_.useClickListener)(R,(e=>Q(e))),!r)return null;const ee=g.default.mobileOrTablet()&&g.default.isTouchEnabled();return a.default.createElement("jdiv",{className:Y},a.default.createElement("jdiv",{className:J,style:K},x||F?null:a.default.createElement("jdiv",(0,i.default)({className:T.default.closeBlock,ref:R},(0,d.withLocator)(c.Locator.MOBILE_POPUP_CLOSE_BUTTON)),a.default.createElement(p.default,{iconName:"icon-popup-close",color:"rgba(0, 0, 0, 0.6)",hoverColor:"#7D8999",className:T.default.closePopupIcon})),a.default.createElement("jdiv",{className:X,onClick:ee?null:e=>{e.preventDefault(),z(e)},onTouchStart:()=>{S=!1},onTouchMove:()=>{S=!0},onTouchEnd:e=>{S||z(e)},style:{"--jv-mobile-badge-color":null!=w&&w.text_color?w.text_color:null,"--jv-mobile-badge-background":null!=w&&w.background?(0,C.buildBackground)(w.background):null}},l&&a.default.createElement("a",(0,i.default)({className:T.default.imOverlay,href:l,target:"_blank",rel:"nofollow noopener noreferrer"},(0,E.onClickHandler)((e=>{setTimeout((()=>Q(e)),200),null==k||k()}),!0,!1))),null!=w&&w.img_src?a.default.createElement("jdiv",{className:T.default.badgeImage,style:{backgroundImage:`url(${w.img_src})`}}):null,a.default.createElement("jdiv",{className:(0,u.default)({[T.default.text]:!0,[T.default.__isMarkdown]:M,[T.default.__noImage]:!(null!=w&&w.img_src)}),style:Z},M||x?a.default.createElement("jdiv",{className:T.default.textBox,ref:P},a.default.createElement(h.Markdown,{onLinkClick:k,theme:{text:null!=w&&w.text_color?T.default.campaignTextColor:void 0}},null!=w&&w.message?w.message:r)):a.default.createElement("jdiv",{ref:P,className:T.default.textBox},a.default.createElement(D.Text,null,r)),G&&!(null!=w&&w.background)&&a.default.createElement("jdiv",{className:T.default.whiteMore})))))};O.propTypes={isLeftOrientation:l.default.bool.isRequired,link:l.default.string,show:l.default.bool.isRequired,text:l.default.string.isRequired,onClick:l.default.func.isRequired,onClose:l.default.func.isRequired,onLink:l.default.func.isRequired,isMarkdown:l.default.bool};var A=O;t.default=A},11297:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=r(n(98661)),a=n(36113),s=r(n(45697)),l=r(n(79868)),u=n(54415),c=n(83170),d=n(45683),f=n(7193),p=n(48999),h=n(63664),g=n(44145),_=n(80797),m=r(n(89348)),v=r(n(23095));function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t{var t;let n=e.show,r=e.popup,i=e.campaignWidgetMobileProactive,s=e.orientation,y=e.avatarHost,C=e.onClick,T=e.onClose;(0,h.useErrorCatcher)(E.displayName);const D=(0,_.useWidgetConstructorContext)().isWidgetConstructor,w="left"===s,S=l.default.ifIMessageEnabled()?l.default.getJoints().links.imUrl:null,O=()=>{u.Monitoring.telemetry(c.TelemetryName.POWERBUTTON_OPEN+"im")},A=(0,a.useSelector)(f.selectProactive).campaignId,I=(0,p.getCampaignContentSettigns)(A);var k;if(D||I)return D||(r.text=(0,p.formatProactiveContent)(b(b({},I),{},{img_src:!1}))),o.default.createElement(v.default,{show:n,text:null!==(k=null==r?void 0:r.text)&&void 0!==k?k:null==i?void 0:i.message,link:S,isMarkdown:null==r?void 0:r.isMarkdown,campaign:null!=i?i:I,isLeftOrientation:w,onClick:e=>null==C?void 0:C(e,"popup"),onClose:T,onLink:D?void 0:O,isWidgetConstructor:D});if(!r.agent)return u.Monitoring.telemetryOnce("agent_popup_error",{param1:(0,g.getProactive)().agentId,param2:JSON.stringify((0,g.getAgents)())}),null;const M=null!==(t=r.agent)&&void 0!==t&&t.avatarUrl?(0,d.getAvatarURL)(y,r.agent.avatarUrl):"";return o.default.createElement(m.default,{show:n,text:r.text,agentName:r.agent.name,isMarkdown:r.isMarkdown,isCampaign:!!I,badgeImage:null==I?void 0:I.img_src,agentAvatar:M,link:S,isLeftOrientation:w,isBot:r.agent.isBot,onClick:e=>C(e,"popup"),onClose:T,onLink:O})};E.propTypes={show:s.default.bool.isRequired,popup:s.default.shape({text:s.default.string,agent:s.default.object,isMarkdown:s.default.bool}),orientation:s.default.string,avatarHost:s.default.string.isRequired,onClick:s.default.func.isRequired,onClose:s.default.func.isRequired},E.displayName="MobilePopupContainer";var C=E;t.default=C},89348:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23101)),o=r(n(67375)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),s=r(n(45697)),l=r(n(94184)),u=n(57930),c=n(52274),d=n(90361),f=r(n(40704)),p=n(56443),h=r(n(19955)),g=n(87869),_=n(89334),m=n(43417),v=n(14045),y=r(n(29384));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}let E=!1;const C=e=>{let t=e.show,n=e.text,r=void 0===n?"":n,s=e.link,b=e.agentName,C=e.agentAvatar,T=e.isLeftOrientation,D=e.onClick,w=e.onClose,S=e.onLink,O=e.isMarkdown;const A=(0,a.useRef)(null),I=(0,a.useRef)(null),k=(0,a.useState)(!0),M=(0,o.default)(k,2),x=M[0],P=M[1],R=(0,a.useState)(0),N=(0,o.default)(R,2),L=N[0],F=N[1],j=r.lengthc.PROACTIVE_MAX_HEIGHT,U=e=>{P(!0),setTimeout((()=>{D(e)}),200)};(0,_.useEffectOnce)((function(){if(A.current){const e=A.current.offsetHeight;e>0&&F(e)}P(!1)}));const W=(0,l.default)({[y.default.popup]:!0,[y.default.__show]:t,[y.default.__left]:T}),H=(0,l.default)({[y.default.popupBlock]:!0,[y.default.__show]:!0,[y.default.__short]:j,[y.default.__left]:T}),G=(0,l.default)({[y.default.popupAnim]:!0,[y.default.__show]:!x&&t,[y.default.__longText]:B});if((0,g.useClickListener)(I,w),!r)return null;const V=h.default.mobileOrTablet()&&h.default.isTouchEnabled();return a.default.createElement("jdiv",{className:W},a.default.createElement("jdiv",{className:H},a.default.createElement("jdiv",(0,i.default)({className:y.default.closeBlock,ref:I},(0,d.withLocator)(u.Locator.MOBILE_POPUP_CLOSE_BUTTON)),a.default.createElement(f.default,{iconName:"icon-popup-close",color:"#959BA0",hoverColor:"#7D8999",className:y.default.closePopupIcon})),a.default.createElement("jdiv",{className:G,onClick:V?null:e=>{e.preventDefault(),!s&&U(e)},onTouchStart:()=>{E=!1},onTouchMove:()=>{E=!0},onTouchEnd:e=>{E||!s&&U(e)}},s&&a.default.createElement("a",(0,i.default)({className:y.default.imOverlay,href:s,target:"_blank",rel:"nofollow noopener noreferrer"},(0,m.onClickHandler)((e=>{setTimeout((()=>(e=>{E=!0,P(!0),setTimeout((()=>{w(e),E=!1}),300)})(e)),300),S()}),!0,!1))),b&&a.default.createElement("jdiv",{className:y.default.avatar},a.default.createElement("jdiv",{className:y.default.avatarImg,style:C&&{backgroundImage:`url(${C})`}}),a.default.createElement("jdiv",{className:y.default.agentName},b)),a.default.createElement("jdiv",{className:(0,l.default)({[y.default.text]:!0,[y.default.__isMarkdown]:O,[y.default.__noImage]:!0})},O?a.default.createElement("jdiv",{className:y.default.textBox,ref:A},a.default.createElement(p.Markdown,{onLinkClick:S},r)):a.default.createElement("jdiv",{ref:A,className:y.default.textBox},a.default.createElement(v.Text,null,r)),B&&a.default.createElement("jdiv",{className:y.default.whiteMore})))))};C.propTypes={agentAvatar:s.default.string,agentName:s.default.string,isLeftOrientation:s.default.bool.isRequired,link:s.default.string,show:s.default.bool.isRequired,text:s.default.string,onClick:s.default.func.isRequired,onClose:s.default.func.isRequired,onLink:s.default.func.isRequired,isMarkdown:s.default.bool};var T=C;t.default=T},53517:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),o=n(36113),a=r(n(45697)),s=n(26932),l=n(65465),u=n(35233),c=n(65210),d=n(45959),f=n(87692),p=n(63664),h=r(n(91275)),g=n(85074),_=n(52947),m=n(97277),v=n(20279);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}const b=(0,_.getDevice)(),E=(0,i.lazy)((()=>n.e(963).then(n.bind(n,13032)))),C=e=>{let t=e.show,n=e.referenceElement,r=e.onCancelClick,a=e.onOverlayClick;(0,p.useErrorCatcher)(C.displayName);const y=(0,o.useSelector)(u.selectApp),T=(0,o.useSelector)(f.selectBillRu),D=(0,o.useSelector)(c.selectCallback),w=(0,o.useSelector)(d.selectClient),S=(0,o.useSelector)(f.selectSettings),O=(0,o.useSelector)(f.selectWidgetOrientation),A={app:y,callback:D,client:w,settings:S,onApp:s.appDispatchers,onMessage:l.messageActions,onUser:s.userDispatchers,onChat:_.isMobileOrTablet?h.default.openChatCallbacks:g.showChat};return i.default.createElement(i.Suspense,{fallback:null},i.default.createElement(E,{show:t,copyright:(0,m.getCopyright)(T),device:b,orientation:O,referenceElement:n,onCancelClick:()=>(0,v.onCancelClick)(r),menuProps:A,onOverlayClick:a}))};C.displayName="OmnichannelMenu",C.propTypes={show:a.default.bool,referenceElement:a.default.oneOfType([a.default.element,()=>null]),onCancelClick:a.default.func,onOverlayClick:a.default.func};var T=C;t.default=T},97277:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCopyright=void 0;var r=n(68403),i=n(45683);t.getCopyright=e=>({show:(0,r.showAd)(),link:(0,i.getUTMLink)("mobile_menu"),icon:e?"logo-jivosite-white":"logo-jivochat-white"})},52947:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isMobileOrTablet=t.getDevice=t.DEVICE=void 0;var i=r(n(19955));const o={IOS:"ios",ANDROID:"android",TABLET:"tablet",DESKTOP:"desktop"};t.DEVICE=o;t.getDevice=()=>i.default.tablet()?o.TABLET:i.default.ios()?o.IOS:i.default.mobile()?o.ANDROID:o.DESKTOP;const a=i.default.mobileOrTablet();t.isMobileOrTablet=a},20279:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onCancelClick=void 0;var r=n(21476),i=n(97490),o=n(73422),a=n(20676);t.onCancelClick=e=>a.platform.isChatPage?(0,o.isFunction)(e)&&e():r.Router.next(i.RouterEvent.CloseWindow)},21135:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(98661)),o=r(n(45697));const a=e=>{let t=e.children,n=e.allowedRoutes,r=e.currentRoute;return n.includes(r)?i.default.createElement(i.default.Fragment,null,t):null};a.propTypes={children:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node,o.default.func]).isRequired,allowedRoutes:o.default.arrayOf(o.default.string).isRequired,currentRoute:o.default.string.isRequired};var s=i.default.memo(a);t.default=s},83502:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.componentProps=void 0;var i=r(n(23101)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),a=r(n(45697)),s=r(n(94184)),l=n(57930),u=n(97490),c=n(90361),d=r(n(19955)),f=r(n(11297)),p=r(n(53517)),h=r(n(21135)),g=r(n(56145)),_=r(n(40704)),m=r(n(40977)),v=n(42413);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}let b=!1;const E=e=>{let t=e.isCallEnabled,n=e.showLogo,r=e.top,a=e.left,y=e.unReadMessages,E=e.popup,C=e.iconColor,T=e.widgetMobileOrientation,D=e.mobileOffsetBottom,w=e.powerButtonColor,S=e.zoom,O=e.linkOverlay,A=e.onOverlayClick,I=e.isOnline,k=e.route,M=e.onClick,x=e.onPopupClick,P=e.onClosePopupClick,R=e.hidden,N=e.isCustomLabel,L=e.isDesktop,F=e.isPopupShow,j=e.isMobileOrTablet,B=e.isWidgetTarget,U=e.desktopPosition,W=e.avatarHost,H=e.isOmnichannelMenu,G=e.toggleOmnichannelMenu,V=e.designerOptions;const z=(0,o.useRef)(null),$=S.user>1.1,Z=Boolean(j&&D),q={[m.default.wrap]:!0,[m.default._orientationRight]:L?"right"===U:"right"===T,[m.default._orientationLeft]:L?"left"===U:"left"===T,[m.default._popupShow]:F,[m.default._show]:!R,[m.default._hoverMenu]:L,[m.default._mobileDesigner]:V&&V.isMobileView,[m.default._mobileOffsetBottom]:Z,[m.default._extensionsTarget]:B,__jivoMobileButton:!(!j||$),__jivoDesktopButton:L},K={};return $?K.transform=`translate(${a}px,${r}px) scale(${S.app})`:1!==S.app&&(K.zoom=S.app),Z&&(K["--jivoMobileOffsetBottom"]=`${null!=D?D:0}px`),o.default.createElement("jdiv",(0,i.default)({className:(0,s.default)(q),style:K},(0,c.withLocator)(l.Locator.POWER_BUTTON)),E?o.default.createElement(f.default,{show:!0,popup:E,orientation:T,avatarHost:W,onClick:x,onClose:P}):null,O?o.default.createElement("a",{className:m.default.overlay,href:O,target:d.default.chromeIOS()?"_self":"_blank",rel:"nofollow noopener noreferrer",onPointerDown:A}):null,o.default.createElement("jdiv",{ref:z,className:(0,s.default)({[m.default.button]:!0,[m.default.__hide]:N,[m.default.__inzoom]:$}),style:{background:w},onClick:e=>{!L&&G(),!d.default.isTouchEnabled()&&M(e)},onTouchStart:()=>{b=!1},onTouchMove:()=>{b=!0},onTouchEnd:e=>{b||(e.preventDefault(),G(),M(e))}},y?o.default.createElement(v.Badge,{show:!0,text:y,size:"large",top:-2,right:0}):null,(()=>{const e=L?[u.Route.LABEL,u.Route.MOBILE_MENU]:[u.Route.LABEL];return o.default.createElement(h.default,{allowedRoutes:e,currentRoute:k,name:"Icons"},o.default.createElement(g.default,{showLogo:n,isCallEnabled:t,iconColor:C,isOnline:I}))})(),L?null:o.default.createElement(h.default,{allowedRoutes:[u.Route.MOBILE_MENU],currentRoute:k,name:"CloseIcon"},o.default.createElement("jdiv",{className:m.default.closeIconWrap},o.default.createElement(_.default,{iconName:"icon-close",color:C,className:m.default.closeIcon})))),(()=>{const e=L?[u.Route.LABEL]:[u.Route.MOBILE_MENU];return o.default.createElement(h.default,{allowedRoutes:e,currentRoute:k,name:"OmniMenu"},o.default.createElement("jdiv",{className:(0,s.default)({[m.default.menuWrap]:!0,[m.default.__hover]:L})},o.default.createElement(p.default,{show:H,referenceElement:z})))})())},C=E.propTypes={isCallEnabled:a.default.bool,showLogo:a.default.bool,top:a.default.number,left:a.default.number,unReadMessages:a.default.number,popup:a.default.any,iconColor:a.default.string,iconTopColor:a.default.string,widgetMobileOrientation:a.default.string,mobileOffsetBottom:a.default.number,powerButtonColor:a.default.string,zoom:a.default.any,linkOverlay:a.default.any,onOverlayClick:a.default.func,isOnline:a.default.bool,route:a.default.string,onClick:a.default.func,onPopupClick:a.default.func,onClosePopupClick:a.default.func,hidden:a.default.bool,isCustomLabel:a.default.bool,isDesktop:a.default.bool,desktopPosition:a.default.string,avatarHost:a.default.string,designerOptions:a.default.shape({isMobileView:a.default.bool,mobileRenderTarget:a.default.string})};t.componentProps=C;var T=o.default.memo(E);t.default=T},9004:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var i=r(n(98661)),o=n(98661),a=n(63664),s=r(n(21135)),l=n(97490),u=n(20676),c=n(23119),d=r(n(83502));function f(){(0,a.useErrorCatcher)(f.displayName);const e=(0,c.useEnhanced)(),t=e._window,n=e.position,r=e.isHidden,p=e.route,h=e.userZoom,g=e.isCallEnabled,_=e.isTopEnabled,m=e.isLogoShow,v=e.unreadMessages,y=e.popup,b=e.iconColor,E=e.iconTopColor,C=e.widgetMobileOrientation,T=e.mobileOffsetBottom,D=e.powerButtonColorComputed,w=e.powerButtonDesktopPosition,S=e.zoom,O=e.isOnline,A=e.linkOverlay,I=e.isCustomLabel,k=e.avatarUrl,M=e.isOmniMenuShow,x=e.allowedRoutes,P=e.isMobileOrTablet,R=e.isWidgetTarget,N=e.isDesktop,L=e.isPopupShow,F=e.designerOptions,j=e.labelBubble,B=e.hiddenByRules,U=e.onToggleOmniMenu,W=e.onClickHandler,H=e.onOverlayClick,G=e.onClosePopupClick,V=n.top,z=n.left;return F.isMobileView&&F.mobileRenderTarget?(0,o.createPortal)(i.default.createElement(d.default,{hidden:r,isCallEnabled:g,isTopEnabled:_,showMenu:!1,showLogo:m,top:V,left:z,unReadMessages:v,popup:y,iconColor:b,iconTopColor:E,widgetMobileOrientation:C,mobileOffsetBottom:Number(T),powerButtonColor:D,zoom:S,isOnline:O,route:p,onClick:W,linkOverlay:A,onOverlayClick:H,onPopupClick:e=>W(e,!0),onClosePopupClick:G,isCustomLabel:I,isDesktop:N,isMobileOrTablet:P,isPopupShow:L,desktopPosition:w,avatarHost:k,isOmnichannelMenu:M,toggleOmnichannelMenu:U,designerOptions:F}),t.document.getElementById(F.mobileRenderTarget)):p===l.Route.HIDDEN||h>2||u.platform.isChatPage||N&&!j||B?null:i.default.createElement(s.default,{allowedRoutes:x,currentRoute:p,name:"PowerButtonNew"},i.default.createElement(d.default,{hidden:r,isCallEnabled:g,isTopEnabled:_,showMenu:!1,showLogo:m,top:V,left:z,unReadMessages:v,popup:y,iconColor:b,iconTopColor:E,widgetMobileOrientation:C,mobileOffsetBottom:T,powerButtonColor:D,zoom:S,isOnline:O,route:p,onClick:W,linkOverlay:A,onOverlayClick:H,onPopupClick:e=>W(e,!0),onClosePopupClick:G,isCustomLabel:I,isDesktop:N,isMobileOrTablet:P,isWidgetTarget:R,isPopupShow:L,desktopPosition:w,avatarHost:k,isOmnichannelMenu:M,toggleOmnichannelMenu:U}))}f.displayName="PowerButtonContainer",f.propTypes={}},933:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.reportOpenTelemetry=t.openMenuClick=t.onOverlayClick=t.onClosePopupClick=t.handleUnreadClick=t.handleOpenMenuClick=t.handleButtonClick=t.getUnreadMessagesWithProactive=t.getPowerButtonColor=t.getPosition=t.getPopup=t.getOverlay=t.getIsCallEnabled=t.getIconColor=void 0;var i=r(n(27104)),o=n(65465),a=r(n(74379)),s=r(n(19955)),l=n(21476),u=n(97490),c=n(26932),d=r(n(91275)),f=n(54415),p=n(83170),h=r(n(79868)),g=r(n(66547)),_=n(81152),m=n(44145),v=n(62162),y=r(n(4855)),b=n(84998),E=n(23267),C=n(16217),T=n(20676),D=n(45683),w=n(44145);const S=y.default.name("PowerBtnHelpers");t.getPowerButtonColor=e=>{let t=e.isDesktop,n=e.powerButtonColor,r=e.powerGradient,o=e.color,a=e.color2;return r||t?i.default.getGradientBg(o,a):n};t.getIconColor=e=>{let t,n=e.isDesktop,r=e.powerButtonColor,o=e.powerGradient,a=e.color;return t=o||n?i.default.isLightColor(a):i.default.isLightColor(r),t?"#3e414f":"#fff"};t.getIsCallEnabled=()=>(0,C.isCallbackEnabled)();t.getUnreadMessagesWithProactive=(e,t)=>{const n=(0,m.getProactive)();let r=!!n.text&&n.status!==_.MessageStatus.READ;return t&&!r&&(r=!0),t||!(e=>{if(!e)return 0;let t=0;return e.forEach((e=>{e.from===_.MessageInitiator.AGENT&&e.status!==_.MessageStatus.READ&&e.type==_.MessageType.FOR_TEST&&t++})),t})(e)||(0,m.getApp)().isOnline||(r=!0),(0,w.getUnreadMessages)().length+(r?1:0)};t.getPosition=(e,t)=>{const n=(0,E.getPageWindow)().visualViewport,r="left"===t,i=a.default.isSiteOptimizedForMobile?-15:15;if(T.platform.isMobileOrTablet&&n&&e>=1.1){const t=a.default.getPseudo(),o=t&&t.getBoundingClientRect().height||0,s=t&&t.getBoundingClientRect().width||0,l=n.width-s+n.offsetLeft,u=n.offsetLeft+i*e,c=r?u:l;return{top:n.height-o+n.offsetTop-i,left:c-i}}return{left:null,top:null}};const O=()=>{c.appDispatchers.setAppIsFocused(!0),l.Router.next(u.RouterEvent.Navigate),o.messageActions.deleteUnansweredOfflineSystemInvite(),o.messageActions.offlineSystemInvite(),o.messageActions.addPrechatMessage(),d.default.openChatCallbacks(),I("from_pwr")};t.handleButtonClick=O;const A=()=>{c.appDispatchers.setChatOpenByClient(!1),l.Router.next(u.RouterEvent.ToMobileMenu),f.Monitoring.telemetry(p.TelemetryName.POWERBUTTON_OPEN_MENU,{param1:"menu",param2:T.platform.isPointerEnabled?1:0})};t.handleOpenMenuClick=A;const I=e=>{const t={};e&&(t.param1=e,t.param2=T.platform.isPointerEnabled?1:0),(0,m.getSystemSettings)().botmode&&(t.param4=1),f.Monitoring.telemetry(p.TelemetryName.WIDGET_CLICK,t)};t.reportOpenTelemetry=I;const k=(e,t)=>{c.appDispatchers.setAppIsFocused(!0),e?l.Router.next(u.RouterEvent.ToCall):(l.Router.next(u.RouterEvent.ToChat),c.userDispatchers.setCallHeaderText(null)),d.default.openChatCallbacks(),(0,v.readProactive)(),I(t?"from_popup":null)};t.handleUnreadClick=k;t.openMenuClick=(e,t,n,r,i)=>{S.log("onMenuClick helper");const o=h.default.getJoints();t!==u.Route.MOBILE_MENU?(c.appDispatchers.setChatOpenByClient(!0),(0,w.getUnreadMessages)(i,n).length?k(n,r):o.count>0||(0,C.isVideoCallAvailable)()?A():O()):T.platform.isTablet&&(T.platform.isChatPage||l.Router.next(u.RouterEvent.CloseWindow)),(0,b.addHistory)()};t.getOverlay=e=>!!(s.default.supportsIMessage()&&e&&e.joint_id)&&(0,D.getIMessageLink)(e.joint_id);t.onOverlayClick=e=>{e.stopPropagation(),f.Monitoring.telemetry(p.TelemetryName.POWERBUTTON_OPEN+"im")};t.getPopup=(e,t)=>{if(!e)return null;if(t&&t.text&&t.status!==_.MessageStatus.READ){const e=(0,v.getProactiveAgent)(t);return{text:t.text,agent:e,isMarkdown:t.isMarkdown}}};t.onClosePopupClick=()=>{(0,v.readProactive)(),(0,v.rejectProactive)(),g.default.set("close_time",(new Date).getTime()),f.Monitoring.telemetry(p.TelemetryName.INVITE_CLOSE)}},23119:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhanced=function(){const e=(0,a.useSelector)(u.selectPowerButtonColor),t=(0,a.useSelector)(u.selectWidgetColor),n=(0,a.useSelector)(u.selectWidgetColor2),r=(0,a.useSelector)(u.selectPowerGradient),M=(0,a.useSelector)(u.selectWidgetOrientation),x=(0,a.useSelector)(u.selectWidgetPadding),P=(0,a.useSelector)(u.selectWidgetMobileOrientation),R=(0,a.useSelector)(u.selectMobileOffsetBottom),N=(0,a.useSelector)(T.selectRoute),L=(0,a.useSelector)(u.selectCallHeaderText),F=(0,a.useSelector)(c.selectMessages),j=(0,a.useSelector)(T.selectIsOnline),B=(0,a.useSelector)(l.selectZoom),U=B.user,W=(0,a.useSelector)(d.selectProactive),H=(0,a.useSelector)(u.selectMobileProactive),G=(0,a.useSelector)(u.selectAvatarUrl),V=(0,a.useSelector)(u.selectJoint),z=(0,a.useSelector)(u.selectLabelBubble),$=(0,a.useSelector)(w.selectCampaignPopupSettings).display,Z=(0,a.useSelector)(u.selectDesigner),q=Z.isMobileView||O.platform.isMobileOrTablet,K=!Z.isMobileView&&O.platform.isDesktop,Y=(0,a.useSelector)(T.selectHiddenByRules),J=(0,a.useSelector)(w.selectFeaturesSettings).disableMobileBack,X=(0,S.useWidgetExtensionsContext)().isWidgetTarget,Q=(0,o.useState)(!1),ee=(0,i.default)(Q,2),te=ee[0],ne=ee[1],re=(0,o.useState)(K),ie=(0,i.default)(re,2),oe=ie[0],ae=ie[1],se=(0,o.useState)((0,k.getPosition)(U,P)),le=(0,i.default)(se,2),ue=le[0],ce=le[1],de=(0,o.useState)(K?(0,E.getPowerButtonDesktopPosition)(M,x):null),fe=(0,i.default)(de,2),pe=fe[0],he=fe[1],ge=V?V.im:null,_e=(0,k.getUnreadMessagesWithProactive)(F,L),me=(0,k.getPopup)(H,W),ve=(0,k.getIconColor)({isDesktop:K,powerButtonColor:e,powerGradient:r,color:t}),ye=e||t,be=(0,k.getPowerButtonColor)({isDesktop:K,powerButtonColor:e,powerGradient:r,color:t,color2:n}),Ee=(0,D.getPageWindow)(),Ce=(0,k.getOverlay)(ge),Te=O.platform.isTablet?[_.Route.LABEL,_.Route.MOBILE_MENU]:[_.Route.LABEL];let De=null;const we=()=>{clearTimeout(De),ne(U>=1.1),ce((0,k.getPosition)(U,P)),De=setTimeout((()=>{ne(!1)}),200)},Se=e=>{ae((t=>null!=e?e:!t))};return(0,y.useDidUpdate)((()=>{O.platform.isTablet&&oe&&(Se(),(0,C.closeWidget)(),v.appDispatchers.setAppRoute(_.Route.LABEL))}),[U]),(0,o.useEffect)((()=>{O.platform.isTablet&&N===_.Route.LABEL&&oe&&Se(!1)}),[N,oe]),(0,o.useEffect)((()=>{K&&he((0,E.getPowerButtonDesktopPosition)(M,x))}),[K,M,x]),(0,o.useEffect)((()=>{const e=new g.HistoryManager,t=Ee.document,n=(0,f.throttle)(we,200),r=()=>{e.checkPopState()},i=e=>{"BODY"===e.target.tagName&&N!==_.Route.LABEL&&(0,m.hasClass)(t.documentElement,"jivo-tablet-overlay")&&(e.preventDefault(),(0,C.closeWidget)(),v.appDispatchers.setAppRoute(_.Route.LABEL))};return p.messageActions.deleteUnansweredOfflineSystemInvite(),(0,h.addListener)(Ee,"scroll",n,!0),(0,h.addListener)(Ee,"resize",n,!0),Ee.visualViewport&&Ee.addEventListener&&O.platform.isIos&&((0,h.addListener)(Ee.visualViewport,"scroll",n,!0),(0,h.addListener)(Ee.visualViewport,"resize",n,!0)),J||(0,h.addListener)(Ee,"popstate",r),ne(!1),ce((0,k.getPosition)(U)),O.platform.tablet&&(0,h.addListener)(t.body,"touchstart",i),()=>{(0,h.removeEvent)(Ee,"scroll",n),(0,h.removeEvent)(Ee,"resize",n),(0,h.removeEvent)(Ee,"popstate",r),(0,h.removeEvent)(Ee.visualViewport,"scroll",n),(0,h.removeEvent)(Ee.visualViewport,"scroll",n),(0,h.removeEvent)(t.body,"touchstart",i)}}),[]),{_window:Ee,isHidden:te,powerButtonColor:e,powerGradient:r,color:t,color2:n,isOnline:j,widgetMobileOrientation:P,mobileOffsetBottom:R,route:N,callHeaderText:L,zoom:B,userZoom:U,mobileProactive:H,iMessageSettings:ge,messages:F,avatarUrl:G,position:ue,unreadMessages:_e,popup:me,iconColor:ve,iconTopColor:ye,powerButtonColorComputed:be,powerButtonDesktopPosition:pe,linkOverlay:Ce,isOmniMenuShow:oe,allowedRoutes:Te,isCustomLabel:(0,I.hasCustomLabel)(),isCallEnabled:(0,A.isCallbackEnabled)(),isLogoShow:(0,b.showAd)(),isPopupShow:$,designerOptions:Z,isMobileOrTablet:q,isWidgetTarget:X,isDesktop:K,labelBubble:z,hiddenByRules:Y,onViewportChanged:we,onToggleOmniMenu:Se,onClickHandler:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Z.isMobileView)return;K?(0,s.showChat)(j,_.RouterEvent.Navigate,{param1:"from_pwr_desktop"}):(0,k.openMenuClick)(e,N,L,t,F)},onOverlayClick:k.onOverlayClick,onClosePopupClick:k.onClosePopupClick}};var i=r(n(67375)),o=n(98661),a=n(36113),s=n(85074),l=n(42601),u=n(87692),c=n(66311),d=n(7193),f=n(73262),p=n(65465),h=n(21951),g=n(92790),_=n(97490),m=n(32183),v=n(26932),y=n(49862),b=n(68403),E=n(80598),C=n(34930),T=n(65138),D=n(23267),w=n(79105),S=n(13551),O=n(20676),A=n(16217),I=n(91920),k=n(933)},56145:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.componentProps=void 0;var i=r(n(61125)),o=r(n(98661)),a=r(n(45697)),s=r(n(94184)),l=r(n(28843)),u=n(24785),c=r(n(40704)),d=n(16217),f=r(n(64734));function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t{let t=e.showLogo,n=e.isCallEnabled,r=e.iconColor,i=e.isOnline;const a=!(n&&!(0,d.isCallbackButtonEnabled)()),p={[f.default.iconWrap]:!0,[f.default._isCallEnabled]:!a,[f.default._showLogo]:t},g=e=>{const t=i?"mobile-cloud":"envelope",n=i?f.default.logoIconCloud:f.default.envelopeIcon;return o.default.createElement(c.default,{iconName:t,color:e,className:(0,s.default)(n,f.default.icons)})},_=()=>a?null:o.default.createElement("jdiv",{className:(0,s.default)(h(h({},p),{},{[f.default.iconWrap2]:!0}))},g(r));return o.default.createElement(o.default.Fragment,null,o.default.createElement(o.default.Fragment,null,o.default.createElement("jdiv",{className:(0,s.default)(h({},p))},t?o.default.createElement(c.default,{iconName:"logo-j-white",className:(0,s.default)(f.default.jivoIcon,f.default.icons),color:r}):null,a?g(r):null),_()),a?null:o.default.createElement("jdiv",{className:(0,s.default)(h(h({},p),{},{[f.default.iconWrap3]:!0}))},o.default.createElement(u.SvgIcon,{icon:l.default,color:r,className:(0,s.default)(f.default.callbackIcon,f.default.icons)})))},_=g.propTypes={showLogo:a.default.bool,isCallEnabled:a.default.bool,isOnline:a.default.bool,iconColor:a.default.string};t.componentProps=_;var m=o.default.memo(g);t.default=m},34137:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(84827)),s=r(n(85299)),l=r(n(55536)),u=r(n(98661)),c=n(36113),d=n(62096),f=r(n(75686)),p=r(n(251)),h=r(n(93254)),g=r(n(40228)),_=n(38869),m=n(70859),v=r(n(5700)),y=n(71277),b=n(94990),E=n(20676),C=n(81510),T=n(54162),D=r(n(9004));function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}let S=function(e){(0,a.default)(n,e);var t=w(n);function n(e){return(0,i.default)(this,n),t.call(this,e)}return(0,o.default)(n,[{key:"renderLabel",value:function(){return E.platform.isDesktop&&!E.platform.isChatPage?u.default.createElement(C.Label,null):null}},{key:"renderWidgetContainer",value:function(){return E.platform.isMobileOrTablet||E.platform.isChatPage?null:u.default.createElement(p.default,{ref:e=>{e&&f.default.set(m.Component.WIDGET_CONTAINER,e)}})}},{key:"renderSoundPlayer",value:function(){if(!y.isSoundDisabled&&y.WebAudioDisabled)return u.default.createElement(v.default,{sounds:y.Sounds})}},{key:"renderCallWidget",value:function(){return u.default.createElement(g.default,null)}},{key:"renderPowerButton",value:function(){return u.default.createElement(D.default,null)}},{key:"renderMouseTrack",value:function(){return E.platform.isMobileOrTablet?null:u.default.createElement("jdiv",{className:"jv-mouse-track",ref:e=>{e&&f.default.set(m.Component.MOUSE_TRACK,e)}})}},{key:"renderMobileContainer",value:function(){return E.platform.isMobileOrTablet||E.platform.isChatPage?u.default.createElement(h.default,null):null}},{key:"renderCampaignPopup",value:function(){return u.default.createElement(_.CampaignPopupContainer,null)}},{key:"render",value:function(){return u.default.createElement(c.Provider,{store:d.reduxStore},u.default.createElement(T.RootSwitch,null,u.default.createElement(b.RootContainer,null,this.renderCallWidget(),this.renderPowerButton(),this.renderMobileContainer(),E.platform.isDesktop&&!E.platform.isChatPage&&u.default.createElement(C.Label,null),this.renderSoundPlayer(),this.renderWidgetContainer(),this.renderCampaignPopup(),u.default.createElement("jdiv",{className:"jv-pseudo-height"}),this.renderMouseTrack())))}}]),n}(u.default.Component);t.default=S},5700:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Sound=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(84827)),s=r(n(85299)),l=r(n(55536)),u=r(n(98661)),c=n(97615),d=r(n(75686)),f=n(45683),p=r(n(68988));function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}const g=e=>{let t=e.src;const n=(c.EnvironmentManager.isDevelopment()?"/public":"")+`/sounds/${t}.`,r=(0,f.getStaticURL)(n+"mp3"),i=(0,f.getStaticURL)(n+"ogg"),o=(0,f.getStaticURL)(n+"wav");return u.default.createElement("audio",{preload:"auto",id:`jivo-sound-${t}`},u.default.createElement("source",{src:r,type:"audio/mpeg"}),u.default.createElement("source",{src:i,type:"audio/ogg; codecs=vorbis"}),u.default.createElement("source",{src:o,type:"audio/wav"}))};t.Sound=g;let _=function(e){(0,a.default)(n,e);var t=h(n);function n(e){return(0,i.default)(this,n),t.call(this,e)}return(0,o.default)(n,[{key:"render",value:function(){return u.default.createElement("jdiv",{id:"jivo-player",className:p.default.player},this.props.sounds.map(((e,t)=>u.default.createElement(g,{src:e,ref:t=>{d.default.set(`sound_${e}`.toUpperCase(),t)},key:t}))))}}]),n}(u.default.PureComponent);t.default=_},40704:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.getIcons=function(){return te},t.getSvgBgIcon=function(e,t){if(!e)return null;let n=te[e];t&&(n=n.replace(/_COLOR1_/gi,t));return n?`"data:image/svg+xml,${encodeURIComponent(n)}"`:null};var i=r(n(61125)),o=r(n(67375)),a=r(n(98661)),s=r(n(45697)),l=r(n(12298)),u=r(n(38353)),c=r(n(28336)),d=r(n(81483)),f=r(n(15504)),p=r(n(22722)),h=r(n(30349)),g=r(n(54446)),_=r(n(34948)),m=r(n(18317)),v=r(n(22764)),y=r(n(99652)),b=r(n(34886)),E=r(n(18079)),C=r(n(85972)),T=r(n(2482)),D=r(n(2427)),w=r(n(87409)),S=r(n(92809)),O=r(n(99350)),A=r(n(69357)),I=r(n(43055)),k=r(n(39581)),M=r(n(28149)),x=r(n(54304)),P=r(n(28372)),R=r(n(31617)),N=r(n(75630)),L=r(n(36972)),F=r(n(39186)),j=r(n(1900)),B=r(n(80441)),U=r(n(88921)),W=r(n(42899)),H=r(n(28122)),G=r(n(62842)),V=r(n(93759)),z=r(n(66574)),$=r(n(799)),Z=r(n(54983)),q=r(n(86693)),K=r(n(38867)),Y=r(n(21525)),J=r(n(60783));function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t{let t=e.title,n=e.iconName,r=e.className,i=e.color,s=e.color2,l=e.hoverColor,u=e.style,c=e["data-qa-id"];const d=a.default.useState(!1),f=(0,o.default)(d,2),p=f[0],h=f[1],g=J.default[n+"Icon"],_=r?r+(g?" "+g:""):void 0,m=e=>{l&&h(e)};return a.default.createElement("jdiv",{onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),style:Q({backgroundImage:(()=>{const e=n+p?l:i;if(ee[e])return ee[e];let t=encodeURIComponent(te[n]);const r=p?l:i;i&&!p&&(t=t.replace(new RegExp("_COLOR1_","ig"),r.replace("#","%23"))),l&&p&&(t=t.replace(new RegExp("_COLOR1_","ig"),r.replace("#","%23"))),s&&(t=t.replace(new RegExp("_COLOR2_","ig"),s.replace("#","%23")));const o=`url("data:image/svg+xml,${t}")`;return ee[n+i+s]=o,o})()},u),className:_,"data-qa-id":c,title:t})};ne.propTypes={iconName:s.default.string.isRequired,className:s.default.string,color:s.default.string,color2:s.default.string,hoverColor:s.default.string,style:s.default.any,"data-qa-id":s.default.string,title:s.default.string};var re=a.default.memo(ne);t.default=re},66400:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Button=void 0;var i=r(n(23101)),o=r(n(88436)),a=r(n(98661)),s=r(n(94184)),l=r(n(43437)),u=r(n(96394));const c=["children","className","widthFluid","height","isNative","disabled","onClick","onDisabledClick"],d=e=>{let t=e.children,n=e.className,r=e.widthFluid,d=void 0!==r&&r,f=e.height,p=void 0===f?"md":f,h=e.isNative,g=void 0!==h&&h,_=e.disabled,m=void 0!==_&&_,v=e.onClick,y=e.onDisabledClick,b=(0,o.default)(e,c);const E=g?"button":"jdiv",C=m?y||null:v,T=(0,s.default)(n,{[l.default.button]:!g,[l.default.nativeButton]:g,[l.default.widthFixed]:!d,[l.default.widthFluid]:d,[l.default.heightSmall]:"sm"===p,[l.default.heightMiddle]:"md"===p,[l.default.disabled]:m,[l.default["__"+(u.default.bubble_color||"green")]]:!0});return a.default.createElement(E,(0,i.default)({},b,{onClick:C,className:T}),t)};t.Button=d;var f=d;t.default=f},7131:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.NativeSelect=l;var i=r(n(98661)),o=r(n(45697)),a=r(n(40704)),s=r(n(56534));function l(e){let t=e.options,n=e.disabled,r=e.onChange;return i.default.createElement("jdiv",null,i.default.createElement("select",{className:s.default.nativeSelect,disabled:n,onChange:e=>{r(e.target.value)}},t.map(((e,t)=>{let n=e.label;return i.default.createElement("option",{key:n,value:t},n)}))),i.default.createElement(a.default,{iconName:"icon-v",color:"#959BA0",hoverColor:"#222D38",className:s.default.iconSelect}))}l.propTypes={options:o.default.arrayOf(o.default.shape({value:o.default.oneOfType([o.default.number,o.default.string]),label:o.default.string}).isRequired),disabled:o.default.bool,onChange:o.default.func}},66683:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.StyledSelect=c;var i=r(n(98661)),o=r(n(45697)),a=r(n(40704)),s=r(n(56534)),l=r(n(88155));const u=(e,t)=>e.length>t?e:void 0;function c(e){let t=e.options,n=e.label,r=e.hasScroll,o=e.onSelect,c=e.onChange;const d=e=>{c(e.target.getAttribute("jv-sval"))},f=t.map(((e,t)=>{let n=e.label;return i.default.createElement("jdiv",{className:s.default.item,key:n,"jv-sval":t,title:u(n,35),onClick:d},n)}));return i.default.createElement("jdiv",null,i.default.createElement("jdiv",{className:s.default.label,title:u(n,24),onClick:o},n,i.default.createElement("jdiv",{className:s.default.labelArrow},i.default.createElement(a.default,{iconName:"icon-v",color:"#959BA0",hoverColor:"#222D38",className:s.default.iconSelect}))),i.default.createElement("jdiv",{className:s.default.items},r?i.default.createElement(l.default,{railClass:s.default.rail,position:"relative"},f):f))}c.propTypes={options:o.default.arrayOf(o.default.shape({value:o.default.oneOfType([o.default.number,o.default.string]),label:o.default.string}).isRequired),label:o.default.string,hasScroll:o.default.bool,color:o.default.string,onSelect:o.default.func,onChange:o.default.func}},87316:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var i=r(n(67375)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),a=r(n(94184)),s=r(n(45697)),l=n(73422),u=n(92560),c=n(7131),d=n(66683),f=n(9335),p=n(57985),h=r(n(56534));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function _(e){let t=e.options,n=e.activeOptionIndex,r=void 0===n?0:n,s=e.isNative,g=e.disabled,_=e.invalid,m=e.classNameWrap,v=e.theme,y=void 0===v?"flat":v,b=e.height,E=void 0===b?"md":b,C=e.color,T=void 0===C?"green":C,D=e.onChange,w=e.isCallbackPopup;const S=(0,o.useRef)(null),O=(0,f.useToggle)(!1),A=(0,i.default)(O,2),I=A[0],k=A[1],M=(0,o.useState)(r),x=(0,i.default)(M,2),P=x[0],R=x[1];function N(e){R(e),k(),(0,l.isFunction)(D)&&D({option:t[e],activeOptionIndex:e})}if((0,p.useClickOutside)(S,(()=>{I&&k()})),(0,u.isEmpty)(t))return null;const L=t.length>3,F=(0,a.default)(m,h.default.selectWrap,{[h.default["__"+T]]:!0,[h.default.invalid]:_,[h.default.styledSelectWrap]:!s,[h.default.nativeSelectWrap]:s,[h.default.selectIsOpen]:I,[h.default.heightSmall]:"sm"===E,[h.default.heightMiddle]:"md"===E,[h.default.themeFlat]:"flat"===y,[h.default.themeInset]:"inset"===y,[h.default.disabled]:g,[h.default.isCallbackPopup]:w,[h.default.scroll]:L});return o.default.createElement("jdiv",{ref:S,className:F},s?o.default.createElement(c.NativeSelect,{disabled:g,options:t,onChange:N}):o.default.createElement(d.StyledSelect,{label:t[P].label,hasScroll:L,options:t,onSelect:g?void 0:k,onChange:N}))}_.defaultProps={activeOptionIndex:0,theme:"flat",height:"md",color:"green"},_.propTypes={options:s.default.arrayOf(s.default.shape({value:s.default.oneOfType([s.default.number,s.default.string]),label:s.default.string}).isRequired),activeOptionIndex:s.default.oneOfType([s.default.number,s.default.string]).isRequired,isNative:s.default.bool,disabled:s.default.bool,classNameWrap:s.default.string,theme:s.default.oneOf(["flat","inset"]),height:s.default.oneOf(["sm","md"]),invalid:s.default.bool,color:s.default.string,onChange:s.default.func,isCallbackPopup:s.default.bool}},3579:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),a=n(36113),s=r(n(94184)),l=r(n(45697)),u=n(2982),c=r(n(4855)),d=n(13551),f=n(80797),p=r(n(75598)),h=r(n(86735));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t{let t=e.name,n=e.scriptName,r=e.children,i=e.onClick,a=e.endCallbacks,l=void 0===a?{}:a,c=e.startCallbacks,g=void 0===c?{}:c,_=e.duration,y=void 0===_?"300ms":_,b=e.timingFunction,E=void 0===b?"cubic-bezier(0.39, 0.24, 0.21, 0.99)":b,C=e.delay,T=void 0===C?"0s":C,D=e.iterationCount,w=void 0===D?1:D,S=e.direction,O=void 0===S?"normal":S,A=e.fillMode,I=void 0===A?"both":A,k=e.playState,M=void 0===k?"running":k,x=e.customVars,P=e.style,R=e.animationPostfix,N=e.id;const L=(0,o.useRef)(null),F=(0,u.isFallbackNeeded)()?h.default.fallback:h.default[R],j=`${t}_${n}`,B=(0,d.useWidgetExtensionsContext)().isWidgetTarget,U=(0,f.useWidgetConstructorContext)().isWidgetConstructor;v.warn("render",j,R);const W=e=>e&&L.current&&e.target===L.current&&e.animationName===F[j]&&n;return(0,o.useEffect)((()=>{B&&L.current&&"jcont"===N&&L.current.style.setProperty("position","absolute","important")}),[]),o.default.createElement("jdiv",{ref:L,style:m(m({},(()=>{const e={animationDuration:U?null:y,animationTimingFunction:E,animationDelay:T,animationIterationCount:w,animationDirection:O,animationFillMode:I,animationPlayState:M,animationName:n?F[j]:null};return(e=>{if(x)for(const t in x)({}).hasOwnProperty.call(x,t)&&((0,u.isFallbackNeeded)()?e[t]=x[t]:e[(0,u.jivoCustomCSSProperty)(t)]=x[t])})(e),e})()),P),onAnimationEnd:e=>{W(e)&&l[n]&&l[n]()},onAnimationStart:e=>{W(e)&&g[n]&&g[n]()},onClick:i,id:N,translate:!1,className:(0,s.default)("notranslate",{[p.default.__widgetConstructor]:U&&B})},r)};y.propTypes={scriptName:l.default.string.isRequired,children:l.default.oneOfType([l.default.arrayOf(l.default.node),l.default.node]).isRequired,name:l.default.string.isRequired,onClick:l.default.func,endCallbacks:l.default.any,startCallbacks:l.default.any,duration:l.default.string,timingFunction:l.default.string,delay:l.default.string,iterationCount:l.default.number,direction:l.default.string,fillMode:l.default.string,playState:l.default.string,customVars:l.default.any,style:l.default.any,animationPostfix:l.default.string,id:l.default.string};var b=(0,a.connect)((e=>({scriptName:e.transition.currentScript})),{})(y);t.default=b},86735:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7949)),o=r(n(37871)),a=r(n(86052)),s=r(n(8741)),l=r(n(10193)),u=r(n(5446)),c={bottom:i.default,bottom_0:o.default,left:a.default,right:s.default,custom:l.default,fallback:u.default};t.default=c},28302:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.onDeclineButtonClick=t.onAcceptButtonClick=t.getMessageId=t.getActiveMessage=t.getAcceptLink=void 0;var i=n(21476),o=n(97490),a=n(26932),s=n(47138),l=r(n(35802)),u=n(62168),c=n(97615),d=n(50789),f=n(44145),p=n(81152),h=n(83170),g=r(n(4855)),_=n(54415);const m=g.default.name("WebrtcHelpers");t.onAcceptButtonClick=(e,t,n,r)=>{const c=l.default.getInstance().managers.permission;if(r)m.warn("onAcceptButtonClick",t.private_id),a.messagesDispatchers.updateWebRTCCallStatus(t.private_id,s.WebRTCCallStatus.ACCEPTED);else if(n!==u.PermissionStatus.ALLOWED||c.allMics.length>1)i.Router.next(o.RouterEvent.ToCallSetup);else{a.messagesDispatchers.updateWebRTCCallStatus(t.private_id,s.WebRTCCallStatus.ACCEPTED);const e=l.default.getInstance().managers.webRTCCall;e&&e.connectSdk()}_.Monitoring.telemetry(h.TelemetryName.WEBRTC_ACCEPT_CALL)};t.onDeclineButtonClick=(e,t,n)=>{const r=l.default.getInstance().managers.webRTCCall;m.log("onDeclineButtonClick",r),r&&(d.ApiProvider.declineWebRTCCall(r.callId,(e=>{m.warn("CALL DECLINE REQUEST SUCCESS",e)})),r.stopCall());const i=n?s.WebRTCCallStatus.ENDED:s.WebRTCCallStatus.DECLINED;a.messagesDispatchers.updateWebRTCCallStatus(t.private_id,i),a.callbackDispatchers.setActiveWebRTCCallMessageId(null),_.Monitoring.telemetry(h.TelemetryName.WEBRTC_DENY_CALL)};t.getMessageId=e=>e.get("private_id");t.getAcceptLink=e=>{if(!e)return null;const t=l.default.getInstance().managers.webRTCCall;if(!t)return null;const n=t.callId,r=t.voxUserLogin,i=t.voxUserPassword,o=t.voxNode,a=l.default.getInstance().config,s=c.EnvironmentManager.isDevelopment()?"//localhost:8080":a.base_url,u=(0,f.getClient)(),d=a.tel_host;let p=`cid=${n}&vl=${r}&vp=${i}&vn=${o}&si=${a.site_id}&wi=${a.widget_id}&ci=${u.clientId}&th=${d}&bu=${a.base_url}&shard=${a.shard_id}&lang=${a.locale}&hash=4815a6a`;a.enable_webrtc_start_call&&(p+=`&sc=${a.enable_webrtc_start_call}`),a.err_host&&(p+=`&errorHost=${a.err_host}`),a.telemetry_host&&(p+=`&telemetryHost=${a.telemetry_host}`);return`https:${s}/webrtc/?${window.btoa(p)}`};t.getActiveMessage=e=>{const t=(0,f.getMessages)().filter((t=>t.type===p.MessageType.WEB_RTC_CALL&&t.body&&t.body.webRTCCallStatus===e));return t.length?t[0]:null}},251:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67375)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=N(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),a=n(36113),s=r(n(45697)),l=r(n(3579)),u=n(50402),c=n(97490),d=n(70859),f=r(n(2167)),p=r(n(19955)),h=n(21476),g=n(80161),_=r(n(75686)),m=r(n(91275)),v=n(47138),y=n(54415),b=n(83170),E=n(97615),C=n(34930),T=n(43914),D=n(69882),w=n(26932),S=n(81722),O=n(44145),A=n(92400),I=n(75998),k=n(80797),M=n(23267),x=n(16217),P=n(42634),R=n(33813);function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(N=function(e){return e?n:t})(e)}const L=e=>{let t=e.callbackEnabled,n=e.route,r=e.position,s=e.padding,N=e.orientation,L=e.callbackStatus,F=e.isInDrag;const j=(0,k.useWidgetConstructorContext)().isPreview,B=(0,o.useState)(!1),U=(0,i.default)(B,2),W=U[0],H=U[1],G=(0,o.useState)(!0),V=(0,i.default)(G,2),z=V[0],$=V[1],Z=(0,o.useState)(!0),q=(0,i.default)(Z,2),K=q[0],Y=q[1],J=_.default.get(d.Component.LABEL),X=-1!==[c.Route.CALL,c.Route.CALL_EULA,c.Route.INTRODUCE].indexOf(n),Q=n===c.Route.CALL_POPUP,ee=n!==c.Route.CALL||-1===[v.CallStatus.WAIT,v.CallStatus.CONNECTING,v.CallStatus.CONNECTED].indexOf(L),te=!p.default.mobileOrTablet()&&!(0,D.isWixIframe)()&&n!==c.Route.CHAT_MIN,ne=W&&te,re=(0,a.useSelector)(A.selectTransitionCurrentScript),ie=(0,a.useSelector)(O.getProactive),oe=ie.campaignId,ae=ie.name;if(n===c.Route.HIDDEN)return null;if(oe&&ae&&re===u.ScriptName.OPEN_WIDGET){const e=(0,S.getMaxWidgetHeightForProactive)();e&&I.positionDispatch.setWidgetHeight(e)}const se=(0,R.getCustomVars)(N,s,r,J,X),le=e=>{(0,T._callUserFunction)("onResizeCallback",(0,R.getSize)(e,N,r.height?r.height:se.height,h.Router.getCurrentRoute()))};return o.default.createElement(l.default,{id:"jcont",name:d.Component.WIDGET_CONTAINER,startCallbacks:{[u.ScriptName.OPEN_WIDGET]:()=>{F||(H(!1),$(!0),Y(!1),m.default.initSocial(),(0,P.addMessagesOnOpen)(),(0,T._callUserFunction)("onOpen"),le(!0))},[u.ScriptName.CLOSE_WIDGET]:()=>{H(!1),$(!1),Y(!1),le(!1)},[u.ScriptName.MINIMIZE_WIDGET]:()=>{H(!1),$(!0),Y(!0),h.Router.next(c.RouterEvent.CloseWindow),le(!1)}},endCallbacks:{[u.ScriptName.OPEN_WIDGET]:()=>{F||(H(!0),Y(!0),(0,R.fixSafariKeyframes)())},[u.ScriptName.CLOSE_WIDGET]:()=>{Q||h.Router.next(c.RouterEvent.CloseWindow)},[u.ScriptName.MAXIMIZE_WIDGET]:()=>{F||(H(!0),$(!0),Y(!0),(0,T._callUserFunction)("onOpen"),le(!0))},[u.ScriptName.MIN_WIDGET]:()=>{}},customVars:se,style:(()=>{const e={display:"block",position:"fixed"};return p.default.safari()&&E.EnvironmentManager.isRegPage()&&(e.width="336px",e.height="496px",e.animation="none"),e})(),animationPostfix:(0,R.getAnimationPostfix)(N,s)},o.default.createElement(f.default,{needRenderCloseBtn:ee,needRenderCallContainer:(0,x.isCallbackEnabled)(),needRenderDrag:ne,showCloseButton:W,showHeaderText:z,showBody:K,callbackEnabled:t,route:n,onCloseButtonClick:()=>{if(j){(0,M.getPageWindow)()._widgetCampaignConstructorAPI.reset()}else(0,C.closeWidget)(),setTimeout((()=>{(0,R.fixSafariKeyframes)(!0)}),0),g.RouterUtils.isChatMinAvailable()?w.transitionDispatchers.startTransition(u.ScriptName.MINIMIZE_WIDGET):L===v.CallStatus.CONNECTED?h.Router.next(c.RouterEvent.CloseWindow):w.transitionDispatchers.startTransition(u.ScriptName.CLOSE_WIDGET),y.Monitoring.telemetry(b.TelemetryName.WIDGET_CLOSE_CLICK)},isStatic:X}))};L.propTypes={callbackEnabled:s.default.bool,route:s.default.string,position:s.default.any,padding:s.default.number,orientation:s.default.string,callbackStatus:s.default.oneOfType([s.default.string,s.default.bool]),isInDrag:s.default.bool};var F=(0,a.connect)((e=>({padding:e.settings.user.widgetPadding,orientation:e.settings.user.widgetOrientation,route:e.app.route,callbackEnabled:e.callback.available,position:e.position,callbackStatus:e.callback.status,isInDrag:e.app.isInDrag})),{})(o.default.memo(L));t.default=F},33813:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.getSize=t.getCustomVars=t.getContainerStyle=t.getChatPosition=t.getAnimationPostfix=t.fixSafariKeyframes=t.callResize=t.addCustomVarsToStyle=void 0;var i=r(n(61125)),o=n(52028),a=n(2982),s=r(n(75686)),l=n(70859),u=n(52274),c=n(97490),d=r(n(19955)),f=n(62096),p=n(44145),h=n(97615),g=n(43914),_=n(91920);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const v=(e,t,n,r,i)=>{let o={};const a=r&&r.offsetWidth,s=r&&r.offsetHeight;return"bottom"===e&&(o=y(t,a,s)),"left"===e&&(o=b(t,a,s)),"right"===e&&(o=E(t,a,s)),o=C(o,n),!n.height>>0&&(o.height="496px"),i&&(o.height="auto"),o};t.getChatPosition=v;const y=e=>{const t={};return 100===e||50===e?(t.right="30px",50===e&&(t.translate50="50%")):t.left="40px",t},b=(e,t)=>{const n={left:"40px",bottom:`calc(50% - ${t/2}px)`};return 100===e&&(n.bottom="20px"),n},E=(e,t)=>({right:"39px",bottom:t?50===e?`calc(50% - ${t/2}px)`:0:"50%"}),C=(e,t)=>{const n=e;return t.right&&(n.right=t.right),t.height&&(n.height=t.height),t.left&&(n.left=t.left),n};t.getAnimationPostfix=(e,t)=>{const n=f.reduxStore.getState().settings.user.labelBubble;return(0,_.hasCustomLabel)()||o.isDesignerEditor||h.EnvironmentManager.isExtensionsEnable()||d.default.desktop()&&n?"custom":"bottom"===e&&0===t?`${e}_0`:e};t.getCustomVars=(e,t,n,r,o)=>{const s=(0,a.getSavedLabelPosition)(),l=function(e){for(var t=1;t{if(r==c.Route.CHAT_MIN)return{width:u.CHAT_WIDTH+"px",height:u.HEADER_HEIGHT+"px"};if(r==c.Route.CALL)return{width:u.CHAT_WIDTH+"px",height:u.DEFAULT_WIDGET_HEIGHT+"px"};const i=(0,a.getSavedLabelPosition)().offsetWidth,o=e?u.CHAT_WIDTH+"px":i;return"bottom"===t||e?{width:o,height:e?n:u.LABEL_HEIGHT+"px"}:{width:u.LABEL_HEIGHT+"px",height:i}};t.getSize=T;t.fixSafariKeyframes=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(d.default.safari()&&!d.default.mobileOrTablet()){const t=s.default.get(l.Component.WIDGET_CONTAINER);(0,a.updateKeyframes)(t,e)}};t.getContainerStyle=()=>{const e={display:"block",position:"fixed"};return d.default.safari()&&h.EnvironmentManager.isRegPage()&&(e.width="336px",e.height="496px",e.animation="none"),e};t.callResize=e=>{const t=(0,p.getPosition)(),n=(0,p.getUserSettings)().widgetOrientation,r=(0,p.getApp)().route;(0,g._callUserFunction)("onResizeCallback",T(e,n,t.height,r))};t.addCustomVarsToStyle=(e,t)=>{if(t)for(const n in t)({}).hasOwnProperty.call(t,n)&&((0,a.isFallbackNeeded)()?e[n]=t[n]:e[(0,a.jivoCustomCSSProperty)(n)]=t[n]);return e}},2167:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67375)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661)),a=r(n(45697)),s=r(n(21135)),l=r(n(47548)),u=r(n(94184)),c=n(20344),d=n(97490),f=n(91763),p=n(80797),h=n(13551),g=n(20676),_=n(1160),m=r(n(72066)),v=n(61744),y=n(90883),b=n(25466);function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}const C=(0,f.lazyLoaderFactory)((()=>n.e(535).then(n.bind(n,79601))),y.LoaderWrap,v.ErrorPage),T=[d.Route.CHAT,d.Route.CHAT_CALL,d.Route.CHAT_EULA,d.Route.CHAT_SOCIAL,d.Route.CHAT_MIN,d.Route.CHAT_SETUP_CALL,d.Route.DEPARTMENTS,d.Route.INTRODUCE,d.Route.DEBUG],D=[d.Route.CALL,d.Route.CALL_EULA],w=e=>{let t=e.needRenderCloseBtn,n=e.needRenderCallContainer,r=e.needRenderDrag,a=e.showCloseButton,f=e.showHeaderText,v=e.showBody,y=e.callbackEnabled,E=e.route,w=e.onCloseButtonClick,S=e.isStatic;const O=(0,p.useWidgetConstructorContext)(),A=O.isWidgetConstructor,I=O.isPreview,k=(0,h.useWidgetExtensionsContext)().isWidgetTarget,M=(0,o.useState)(0),x=(0,i.default)(M,2),P=x[0],R=x[1],N=(0,o.useMemo)((()=>({loadedSize:P,setLoadedSize:R})),[P,R]);return o.default.createElement(o.default.Fragment,null,(()=>{const e=!(A&&k||!t)&&(I||a);return o.default.createElement(l.default,{drag:r,callEnabled:y,inCall:E===d.Route.CALL,show:e,onClick:w,ignoreDragHeight:S})})(),o.default.createElement(s.default,{allowedRoutes:T,currentRoute:E,name:"ChatContainer"},o.default.createElement(b.CurrentUploadProgress.Provider,{value:N},o.default.createElement(C,{showHeaderText:f,showBody:v,canRenderCall:n}))),(()=>{if(!n)return null;const e=(0,u.default)({[m.default.loadingWrap]:!0,[m.default.__mobile]:g.platform.isMobile||g.platform.isChatPage});return o.default.createElement(s.default,{allowedRoutes:D,currentRoute:E,name:"CallContainer"},o.default.createElement(o.default.Suspense,{fallback:o.default.createElement("jdiv",{className:e},(0,c.l10n)("cb_loading"))},o.default.createElement(_.Callback,{type:"call"})))})())};w.propTypes={needRenderCloseBtn:a.default.bool.isRequired,needRenderCallContainer:a.default.bool.isRequired,needRenderDrag:a.default.bool.isRequired,showCloseButton:a.default.bool.isRequired,showHeaderText:a.default.bool.isRequired,showBody:a.default.bool.isRequired,route:a.default.string.isRequired,onCloseButtonClick:a.default.func.isRequired,callbackEnabled:a.default.bool,isStatic:a.default.bool};var S=o.default.memo(w);t.default=S},19270:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.DataProvider=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(4855)),s=n(50789),l=n(56348),u=r(n(4867)),c=n(87252);const d=a.default.name("ApiInvitations.DataProvider");let f=function(){function e(t,n){(0,i.default)(this,e),this.userToken=t,this.manager=n,this.timer=new c.Timer(this.update.bind(this)),this.store=new l.InvitationsStore({type:"default",name:"api_invites",itemClass:u.default,keys:{id:null,text:null,ruleName:null,read:null,isPopup:null,isMarkdown:null,prechat:null}}),this.update()}return(0,o.default)(e,[{key:"update",value:function(){d.log("Update invitations"),this.getInvitationsFromApi();const e=Math.floor(120*Math.random()+90);this.timer.start(60*e*1e3)}},{key:"getInvitationsFromApi",value:function(){d.log("Getting invitations from Api"),s.ApiProvider.getCustomerIoInvites(this.userToken,((e,t)=>{e?d.error("Bad request",e.status,e.statusText):t.data?t.data&&t.data.ok&&(this.store.save(t.data.invitations),d.log("Invitations are up to date"),this.manager.addInvitationsToChat()):d.warn("No response data")}))}},{key:"hasInvitations",value:function(){return this.store.length()||!1}},{key:"getInvitations",value:function(){return this.store.getAll()}},{key:"markInvitationsRead",value:function(){this.store.markInvitationsRead()}}]),e}();t.DataProvider=f},56348:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.InvitationsStore=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(84827)),s=r(n(85299)),l=r(n(55536)),u=r(n(34973)),c=n(54415),d=n(83170),f=n(44145);function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}const h=r(n(4855)).default.name("ApiInvitations.InvitationsStore");let g=function(e){(0,a.default)(n,e);var t=p(n);function n(e){return(0,i.default)(this,n),t.call(this,e)}return(0,o.default)(n,[{key:"save",value:function(e){h.log("Storing invitations",e),this.store.length?this.merge(e):e.forEach((e=>{this.add(e)}))}},{key:"merge",value:function(e){h.log("Merging invitations",e),this.deleteUnreads(),e.forEach((e=>{this.findById(e.invitation_id)||this.add(e)}))}},{key:"deleteUnreads",value:function(){h.log("Deleting unread invitations");this.store.filter((e=>!e.get("read"))).forEach((e=>{e.destroy()}))}},{key:"add",value:function(e){h.log("Adding invitation",e);const t=e.text,n=e.rule_name,r=e.invitation_id,i=e.is_popup,o=e.prechat,a=(0,f.getClient)();this.push({text:t,ruleName:n,id:r,read:!1,isPopup:i||null,prechat:o||null}),c.Monitoring.telemetry(d.TelemetryName.RECEIVE_API_INVITATION,{param1:n,param2:r,param3:a.email})}},{key:"findById",value:function(e){return this.store.find((t=>t.get("id")===e))}},{key:"length",value:function(){return this.store.length}},{key:"markInvitationsRead",value:function(){this.store.filter((e=>!e.get("read"))).forEach((e=>{e.set("read",!0)}))}}]),n}(u.default);t.InvitationsStore=g},78692:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.ApiInvitationsManager=void 0;var i=r(n(61125)),o=r(n(33119)),a=r(n(92664)),s=n(96394),l=n(40694),u=r(n(71277)),c=r(n(14264)),d=r(n(2833)),f=r(n(26754)),p=n(81152),h=n(54415),g=n(83170),_=n(26932),m=n(65465),v=n(21476),y=n(97490),b=n(50402),E=n(44145),C=n(44145),T=n(43914),D=r(n(4855)),w=n(91225),S=n(19270);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t{(0,w.isChatInputRoute)(e)&&this.markInvitationsRead()})))}},{key:"isInitialized",value:function(){return this.initialized}},{key:"hasInvitations",value:function(){return this.initialized&&this.dataProvider&&this.dataProvider.hasInvitations()}},{key:"saveUnreadInvitations",value:function(){if(!this.initialized)return;c.default.getUnreadApiInvitations().forEach((e=>{delete e.get("body").unsave;const t=Object.assign({},e.toJSON());t.status=p.MessageStatus.READ,_.messagesDispatchers.addMessage(t),e.destroy()})),this.dataProvider.markInvitationsRead()}},{key:"sendUrlClickTelemetry",value:function(){this.initialized&&this._sendInvitationsTelemetry(g.TelemetryName.CLICK_LINK_API_INVITAION)}},{key:"markInvitationsAnswered",value:function(){this.initialized&&(this.saveUnreadInvitations(),this._sendInvitationsTelemetry(g.TelemetryName.ANSWER_API_INVITATION))}},{key:"markInvitationsRead",value:function(){if(!this.initialized)return;this.dataProvider.markInvitationsRead();c.default.getUnreadApiInvitations().forEach((e=>e.set("status",p.MessageStatus.READ))),this._sendInvitationsTelemetry(g.TelemetryName.READ_API_INVITATION)}},{key:"_sendInvitationsTelemetry",value:function(e){if(!this.initialized)return;const t=this.getCurrentInvitations(),n=(0,C.getClient)();t&&this.needToSendTelemetry[e]&&(t.forEach((t=>{h.Monitoring.telemetry(e,{param1:t.get("ruleName"),param2:t.get("id"),param3:n.email})})),this.needToSendTelemetry[e]=!1)}},{key:"addInvitationsToChat",value:function(){if(!this.initialized)return;I.log("addRulesToChat",this.store);const e=this.dataProvider.getInvitations(),t=(0,C.getClient)();let n,r;d.default.getActiveAgent((i=>{const o=c.default.getUnreadApiInvitations(),a=o.length;if(o.forEach((e=>{e.destroy()})),this.invitationsCount=0,e.forEach((e=>{if(!e.get("read")&&!(0,E.getApp)().chatStarted){I.log("Active agent:",i),i&&(Object.assign(f.default,i),_.agentsDispatchers.addAgent((0,l.agentToReduxFormat)(i)),i.bot_id||t.priorityAgentId&&t.priorityAgentId===i.agent_id||_.clientDispatchers.setPaId(i.agent_id),_.chatsDispatchers.setJoinedAgents([i]));const o=e.get("text");n=e.get("ruleName"),r=e.get("id");const a=A(A({},i||null),{},{customerIO:!0,is_markdown:!0,unsave:!0,invitationId:r}),s={type:p.MessageType.MESSAGE,from:p.MessageInitiator.AGENT,from_id:i&&i.agent_id,text:o,body:a};_.messagesDispatchers.addMessage(s),this.invitationsCount++,this.needToShowPopup=e.get("isPopup")||!1,this.needToShowPrechat=e.get("prechat")||!1}})),this.invitationsCount!==a){if(u.default.play("notification"),this.needToOpenChat&&this.needToShowPopup?(v.Router.next(y.RouterEvent.ToLabelInvitation),h.Monitoring.telemetry(g.TelemetryName.API_INVITATION_OPEN_CHAT,{param1:n,param2:r,param3:t.email}),this.needToOpenChat=!1):(v.Router.next(y.RouterEvent.ToChat),_.transitionDispatchers.startTransition(b.ScriptName.OPEN_WIDGET),(0,T._callUserFunction)("onMessageReceived")),this.needToShowPrechat&&this.needToShowPrechat.length){const e=this._formatInvitationPrechats(this.needToShowPrechat);m.messageActions.deletePrechatMsg(),(0,s.setConfigParam)("prechat",e),(0,s.setConfigParam)("enable_prechat",1),_.featuresDispatchers.enablePrechat(!0),_.userDispatchers.setPrechat(e),m.messageActions.pushPrechat(e)}k.markInvitationsRead()}}))}},{key:"_formatInvitationPrechats",value:function(e){return e.map(((e,t)=>({id:t,text:e})))}},{key:"getCurrentInvitations",value:function(){return this.initialized?this.dataProvider.getInvitations():null}}]),e}());t.ApiInvitationsManager=k},87252:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var i=r(n(33119)),o=r(n(92664));let a=function(){function e(t){(0,i.default)(this,e),this.timerId=null,this.cb=t||null}return(0,o.default)(e,[{key:"setCallback",value:function(e){this.cb=e}},{key:"start",value:function(e){clearTimeout(this.timerId),this.timerId=setTimeout(this.cb,e)}},{key:"stop",value:function(){clearTimeout(this.timerId)}}]),e}();t.Timer=a},35802:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(98661)),s=r(n(98661)),l=r(n(4855)),u=n(62096),c=r(n(96394)),d=n(26932),f=n(21951),p=n(69882),h=n(97490),g=n(23267),_=n(23336),m=r(n(91275)),v=r(n(45430)),y=n(99012),b=n(22618),E=n(74603),C=n(97615),T=r(n(75686)),D=n(70859),w=n(43914),S=r(n(34137)),O=n(53182),A=n(15688),I=n(58164),k=n(68848);const M=l.default.name("Jivo Widget");let x=null;var P=function(){function e(){if((0,i.default)(this,e),x)return x;x=this,this.config=c.default,this.managers={sound:null,connection:null,environment:null,eula:null,history:null,loaderContext:null,pageVisibility:null,position:null,ref:null,rule:null,title:null,transition:null,windowResize:null},this.stores={app:null,client:null,agent:null,agents:null,history:null,local:null,proactive:null,session:null,messages:null,temp:null},this.integrations={},this.utils={},this.rootContainer=null,this.devTools=null,this.reduxStore=u.reduxStore,this.initialize(),this.sendInitialTelemetry()}return(0,o.default)(e,[{key:"initialize",value:function(){(0,_.initPolyfills)(),this.initStories(),this.initManagers(),this.initIntegrations(),this.initPublicApi(),(0,_.subscribeToPageVisibilityChanges)(this)}},{key:"initStories",value:function(){M.log("Initializing stories"),(0,_.generateVisitorId)(),(0,_.initSession)(),m.default.initReduxStores(),(0,_.initDeprecatedStores)(this)}},{key:"initManagers",value:function(){M.log("Initializing managers"),this.managers.ref=T.default,(0,_.initLoaderContextManager)(this),(0,_.initDebugDataCollector)(),(0,_.initAbTestManager)(this),(0,_.initMonitoring)(),(0,_.initiWindowResizeManager)(this),(0,_.initConnection)(this),v.default.run(),(0,_.initDevTools)()}},{key:"initIntegrations",value:function(){M.log("Initializing integrations"),(0,_.initRecaptcha)(this),(0,y.initCallTouch)(),(0,b.initVideoForce)(),(0,_.initCobrowse)(),(0,_.initAnalytics)(),m.default.requestCWAvailable(),(0,p.deleteNonce)()}},{key:"initPublicApi",value:function(){M.log("Initializing public api"),(0,_.exposeJivoVersion)(),(0,_.exposeApi)(),(0,E.designerApiInit)(),(0,O.initPopupAPI)(),(0,A.initExtensionsAPI)(),(0,I.initCampaignWidgetConstructorAPI)(),(0,k.initContactFormPreviewAPI)()}},{key:"sendInitialTelemetry",value:function(){(0,_.sendLoadTimeTelemetry)(),(0,_.sendLoadedInIframeTelemetry)()}},{key:"start",value:function(){M.warn("start"),(0,p.isAppCobrowse)()||((0,_.resetAgents)(),this.renderApp())}},{key:"renderApp",value:function(){this.render(),d.appDispatchers.setAppStarted(!0),(0,_.initRuleManager)(this),(0,_.sendBundleLoadedTelemetry)(),(0,_.handleChatPageStart)()}},{key:"stop",value:function(){M.warn("stop"),(0,_.stop)()}},{key:"render",value:function(){if(M.log("Rendering"),(0,w._callUserFunction)("onInitCallback"),C.EnvironmentManager.isDevelopment()){n(14369),n(67665);const e=n(6400),t=e.options,r=e.Fragment,i=e.Component;window.parent.__PREACT_DEVTOOLS__&&window.parent.__PREACT_DEVTOOLS__.attachPreact("10.11.2",t,{Fragment:r,PreactComponent:i})}const e=(0,g.getPageWindow)(),t=e.document.body;this.rootContainer=e.document.createElement("jdiv"),(0,f.addListener)(e,"jBeforeunload",this.unmount.bind(this)),t.appendChild(this.rootContainer);const r=this.stores.app,i=r.is_online,o=r.chat_started,l=!(!i&&this.config.hide_offline&&o);M.log("RENDER",l),l&&!this.isBot&&(s.default.render(a.default.createElement(S.default,{ref:e=>{T.default.set(D.Component.ROOT_COMPONENT,e)}}),this.rootContainer),(0,_.initSoundManager)(this)),this.stores.app.route===h.Route.HIDDEN&&M.warn("Widget is hidden."),(0,w._callUserFunction)("onLoadCallback")}},{key:"unmount",value:function(){M.log("Unmounting");const e=(0,g.getPageWindow)(),t=e.document.body;this.rootContainer&&(s.default.unmountComponentAtNode(this.rootContainer),this.rootContainer=null);const n=e.document.querySelectorAll("body > jdiv");n.length>0&&n.forEach((e=>t.removeChild(e))),(0,f.removeEvent)(e,"jBeforeunload",this.unmount.bind(this)),(0,w._callUserFunction)("onWidgetDestroy")}}],[{key:"getInstance",value:function(){return x}}]),e}();t.default=P},23336:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToPageVisibilityChanges=t.stop=t.setOfflineIntroduced=t.sendLoadedInIframeTelemetry=t.sendLoadTimeTelemetry=t.sendBundleLoadedTelemetry=t.resetAgents=t.reportCampaignContactsStat=t.needIntroduceInOffline=t.initializePermissionManager=t.initiWindowResizeManager=t.initSoundManager=t.initSession=t.initRuleManager=t.initRecaptcha=t.initPolyfills=t.initMonitoring=t.initLoaderContextManager=t.initDevTools=t.initDeprecatedStores=t.initDebugDataCollector=t.initConnection=t.initCobrowse=t.initAnalytics=t.initAbTestManager=t.handleChatPageStart=t.generateVisitorId=t.exposeJivoVersion=t.exposeApi=void 0;var i=r(n(96394)),o=r(n(26754)),a=n(44145),s=r(n(55908)),l=r(n(22866)),u=r(n(66547)),c=r(n(73687)),d=r(n(91275)),f=r(n(95003)),p=r(n(14762)),h=r(n(19955)),g=r(n(138)),_=r(n(14264)),m=n(28723),v=n(21476),y=n(97490),b=r(n(71277)),E=r(n(5735)),C=r(n(50216)),T=r(n(74890)),D=r(n(16500)),w=r(n(22541)),S=r(n(3415)),O=r(n(8117)),A=r(n(51094)),I=n(43914),k=n(42908),M=n(62096),x=n(26932),P=n(69882),R=n(16016),N=n(83170),L=n(54415),F=r(n(45493)),j=n(97615),B=r(n(4855)),U=n(25528),W=n(49963),H=r(n(73439)),G=r(n(40426)),V=r(n(34783)),z=n(43902),$=n(23267),Z=n(42634),q=n(20676),K=r(n(61811)),Y=n(68403),J=n(44145),X=n(74619);const Q=B.default.name("App Utils");t.resetAgents=()=>{Q.log("resetting agents"),(0,a.getApp)().chatStarted||x.chatsDispatchers.setNoJoinedAgents()};t.exposeJivoVersion=()=>{Q.log("exposeJivoVersion"),(0,$.getPageWindow)().jivo_version=j.EnvironmentManager.getVersion()};t.exposeApi=()=>{Q.log("exposeApi"),(0,$.getPageWindow)().jivo_api=k.api};t.subscribeToPageVisibilityChanges=e=>{Q.log("subscribeToPageVisibilityChanges"),D.default.subscribe((t=>{t&&(w.default.stopBlinking(),te(e)),(0,P.isAppCobrowse)()||(d.default.reloadStories(),d.default.initReduxStores())}))};t.generateVisitorId=()=>{const e=(0,a.getClient)();e.visitorId?Q.log("Visitor id already exists:",e.visitorId):(e.visitorId=(0,R.generateGUIDCount)(4),Q.log("New visitor id:",e.visitorId))};const ee=()=>{const e=(0,a.getApp)(),t=(0,a.getClient)();return!e.isOnline&&!(t.email||t.phone||t.name||t.displayName)};t.needIntroduceInOffline=ee;t.setOfflineIntroduced=()=>{ee()&&x.clientDispatchers.setIsIntroduced(!1)};t.sendBundleLoadedTelemetry=()=>{Q.log("sendBundleLoadedTelemetry"),setTimeout((()=>{var e;L.Monitoring.telemetryWithProbability(N.TelemetryName.BUNDLE_LOADED,{param1:j.EnvironmentManager.getVersion(),param2:window.loaderContext.store.isNewCode?"newCode":"oldCode",param3:window.navigator.language,param4:(e=window.loaderContext.scriptSrc,(null==e?void 0:e.replace(/\/([A-Za-z0-9]{10})$/,""))||"")},15)}),1e3)};t.sendLoadedInIframeTelemetry=()=>{Q.log("sendLoadedInIframeTelemetry"),window.parent.window!=window.top&&(0,a.getApp)().route!==y.Route.HIDDEN&&L.Monitoring.telemetryWithProbability(N.TelemetryName.IN_IFRAME_STARTED,{},10)};t.sendLoadTimeTelemetry=()=>{Q.log("sendLoadTimeTelemetry");const e=F.default.getInstance();if(e&&h.default.supportsLocalStorage()){const t=e.store.loadTime;t&&(L.Monitoring.telemetry(N.TelemetryName.CDN_LOAD_TIME,{param1:parseInt(t)}),e.setInStore("loadTime",null))}};t.initDebugDataCollector=()=>{Q.log("initDebugDataCollector");const e=(0,a.getApp)(),t=(0,a.getClient)();new l.default(e,i.default,t,o.default,M.reduxStore,_.default)};t.initSoundManager=e=>{Q.log("initSoundManager"),e.managers.sound=b.default,(0,U.isSoundPlayerDisabled)()||b.default.initSoundPlayer()};t.initRuleManager=e=>{e.managers.rule=E.default,i.default.campaigns||(0,Y.isPaidCustomer)()?(E.default.init(),Q.log("initRuleManager success")):Q.log("initRuleManager failure")};t.initAnalytics=()=>{(0,Y.isPaidCustomer)()?(Q.log("initAnalytics success"),g.default.init()):Q.log("initAnalytics failure")};t.initLoaderContextManager=e=>{Q.log("initLoaderContextManager"),e.managers.loaderContext=new F.default(i.default.widget_id,f.default)};t.initRecaptcha=()=>{if((0,J.getFeatures)().recaptcha){Q.log("initRecaptcha");new C.default(i.default.recaptcha).addRecaptchaToPage()}};t.initiWindowResizeManager=e=>{Q.log("initiWindowResizeManager");e.managers.windowResize=new K.default((e=>{(0,I._callUserFunction)("onResizeCallback",e)})),e.managers.windowResize.checkHeight()};t.initMonitoring=()=>{Q.log("initMonitoring"),L.Monitoring.init()};t.initPolyfills=()=>{Q.log("initPolyfills"),T.default.init()};t.initCobrowse=()=>{(0,$.getPageWindow)()==window.top||(0,P.isWixIframe)()||(Q.log("initCobrowse"),S.default.init());const e=(0,$.getPageWindow)().location.hash.split("jvhs_")[1];if(void 0!==e){const t=_.default.getCobrowseByHash(e);let n=null,r=null;if(Q.log("cobrowse from init",t),t){const e=p.default.getAgentById(t.get("from_id"));e&&(n=e.toJSON()),r=t.get("body.text"),Q.log("cobrowse agentData",n)}setTimeout((()=>{S.default.getCobrowseData(e,null,r,n)}),1e3)}};t.initSession=()=>{Q.log("initSession");const e=u.default.get("enter_ts"),t=(0,a.getClient)();if(!e){u.default.set("enter_ts",(new Date).getTime());const e=c.default.get("visits_count");c.default.set("visits_count",e?e+1:1,31556952);try{O.default.setUTM({href:(0,$.getPageWindow)().location.href,refer:(0,$.getPageWindow)().document.referrer,setterFn:x.clientDispatchers.setUTM})}catch(e){e.message+=" setUTM",L.Monitoring.reportException(e),L.Monitoring.telemetry(N.TelemetryName.SET_UTM_ERROR,{param1:JSON.stringify({href:(0,$.getPageWindow)().location.href,refer:(0,$.getPageWindow)().document.referrer}),param2:e.message})}}if(i.default.campaigns&&i.default.campaigns.length){if(f.default.route===y.Route.HIDDEN)return;const e=i.default.campaigns.reduce(((e,t)=>{const n=z.StatsManager.get(t.campaign_id);return n||(z.StatsManager.create(t),e.push(t.campaign_id)),n&&!n.isSubmitted&&e.push(t.campaign_id),e}),[]);e.length&&z.StatsManager.send({campaignIds:e},"visit")}const n=()=>{Q.log("pushHistory"),m.HistoryStore.push({url:(0,P.getCurrentPage)().url,title:(0,P.getCurrentPage)().title})};t.sessionId||(n(),(0,J.getFeatures)().enableSpaNavigate&&new X.Observer({onUrlChange:n}))};t.initDevTools=()=>{j.EnvironmentManager.isProduction()||j.EnvironmentManager.isPartnerApp()||(async()=>{(new(0,(await n.e(308).then(n.bind(n,10517))).default)).installOnPage(),(0,I._callUserFunction)("onDevToolsInit")})()};t.stop=()=>{x.appDispatchers.setAppRoute(y.Route.HIDDEN),b.default.disableSoundPlayer()};const te=()=>{const e=(0,a.getClient)(),t=(0,J.getFeatures)().recaptcha;if(Q.warn("initConnection"),W.connectionAdapter.getInstance()||W.connectionAdapter.setConnectionInstance(new H.default(G.default,V.default)),t&&!e.captchaToken)return void Q.warn("Wait for captcha to connect");const n=!!_.default.getClientSendedMessages().length,r=(0,a.getApp)(),i=!r.maintenance&&(r.isOnline&&n||e.sessionId||!r.isOnline&&r.chatStarted);Q.warn("needToConnect",i),i&&!W.connectionAdapter.isConnected()&&W.connectionAdapter.openConnect()};t.initConnection=te;t.initDeprecatedStores=e=>{e.stores.app=f.default,e.stores.agent=o.default,e.stores.agents=p.default,e.stores.history=m.HistoryStore,e.stores.messages=_.default,e.stores.session=u.default,e.stores.temp=c.default};t.initAbTestManager=()=>{new s.default};t.handleChatPageStart=()=>{q.platform.isChatPage&&(x.appDispatchers.setAppIsFocused(!0),v.Router.next(y.RouterEvent.Navigate),setTimeout((()=>{(0,Z.addMessagesOnOpen)()}),50))};t.initializePermissionManager=e=>{i.default.enable_webrtc_calls&&(e.managers.permission=new A.default)};t.reportCampaignContactsStat=()=>{const e=(0,a.getProactive)().campaignId,t=(0,a.getClient)(),n=t.isIntroduced,r=t.eulaAccepted;if(e&&!n){if(i.default.eula&&!r)return;z.StatsManager.send({campaignId:e},"contacts_fill")}}},48553:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664));var a=function(){function e(t,n){(0,i.default)(this,e),this.doc=t,this.cssURL=n,this.loaded=!1,this.failed=!1,this.loadCss()}return(0,o.default)(e,[{key:"loadCss",value:function(){const e=this.doc.head||this.doc.getElementsByTagName("head")[0];if(e&&e.querySelector(`link[href="${this.cssURL}"]`))return this.loaded=!0,void(this.onLoadCallback&&this.onLoadCallback());const t=this.doc.createElement("link");t.rel="stylesheet",t.href=this.cssURL,t.className="jv-css",window.parent.jivo_cspNonce&&t.setAttribute("nonce",window.jivo_cspNonce),t.addEventListener("load",(e=>{this.loaded=!0,this.onLoadCallback&&this.onLoadCallback()})),t.addEventListener("error",(e=>{this.failed=!0,this.onFailedCallback&&this.onFailedCallback()})),e.appendChild(t)}},{key:"setOnLoadedCallback",value:function(e){this.loaded?e&&e():this.onLoadCallback=e}},{key:"setOnFailedCallback",value:function(e){this.failed?e&&e():this.onFailedCallback=e}},{key:"subscribe",value:function(e,t){this.setOnLoadedCallback(e),this.setOnFailedCallback(t)}}]),e}();t.default=a},31984:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.callWidgetPing=function(e,t){if(T.warn("callWidgetPing",t),(0,u.isEmpty)(o.default.callback_settings)||(0,v.isAppCobrowse)()||l.isDesignerEditor)return void T.log("callback disabled");const n=c.default.get("callback_ping_response");if(n)e(n);else{const n=(0,d.getClient)(),r=t&&n.clientId?n.clientId.split(".")[0]:"0";m.xhrRequest.get(D("/sites/"+o.default.site_id+"/widgets/"+o.default.widget_id+"/clients/"+r+"/telephony/callback"),((t,n)=>{if(t)return T.error("in request"),e({});let r=n.data;r||(r={ok:!1});const i=r.work_time;let o;i?("cw_connected"!==(0,d.getCallback)().status&&(0,E.initDelayedCall)(i),r.ok=!0):r.ok&&(0,E.resetDelayedCall)(),o=r.ok||r.error_list&&"time_not_in_range"===r.error_list[0]?60:20,c.default.set("callback_ping_response",r,o),e(r)}))}},t.checkPhoneLength=function(e,t,n){const r=e.length,i=t.length;if(["EG"].indexOf(n)>=0)return r>=i-5&&r<=i+1;if(["BG"].indexOf(n)>=0)return r>=i-4&&r<=i+3;if(["NZ","RS"].indexOf(n)>=0)return r>=i-2&&r<=i+1;return["BR","MX","DE","AT","KH","CH","IL","NZ"].indexOf(n)>=0?r>=i-1&&r<=i+1:r===i},t.checkStartCall=async function(e,t){T.warn("checkStartCall",e);const n=e.phone,r=e.invitationText,a=e.clientToken,s=e.requestGRecaptchaToken?await b.default.getInstance().getGRecaptchaToken({action:"callback"}):null;if(!a)return T.warn("checkStartcall",`client_id is ${a}`),p.callbackDispatchers.setCallbackAvailable(!0),p.callbackDispatchers.setCallbackStatus(h.CallStatus.ERROR),p.callbackDispatchers.setCallbackError((0,y.getCallDefaultError)()),void _.Monitoring.telemetry(g.TelemetryName.CALL_ERROR,{param1:"startup_error_client_id"});const l=a.split(".")[0],u=function(e){for(var t=1;t=0)return T.log("codeFound",n),{code:n}}return null}function S(e,t){const n="+"===t[0]?e.phone_code.length+1:e.phone_code.length,r=t.slice(n);return{countryCode:e.code,countryName:e.name,phoneCode:e.phone_code,phoneFormat:e.phone_format,innerNumber:r,number:t}}function O(e){T.log("getPhoneNumberInfo",e);let t=e.replace(/\D+/g,"");const n=o.default.callback_settings.countries;let r,i="",a="";if(o.default.geoip&&(a=o.default.geoip.split(";")[0]),t.length<9||t.length>15)return null;for(let e=0;ee.phone_code===i.toString())),r.length>0){const e=w(t);if(e)r=r.filter((t=>t.code===e.code));else{const e=r.filter((e=>e.code===a));e.length&&(r=e)}}else r=null;return r||(r=n.filter((e=>e.code===a)),r&&"RU"==a&&(13==t.length&&(t=t.replace("8","+7")),10==t.length&&(t="+7"+t))),r&&r.length?(r=r[0],S(r,t)):null}function A(e,t){return a.default.toPattern(e,t)}},53182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initPopupAPI=void 0;var r=n(75998),i=n(45948);const o=window.parent||window;let a=!1;const s={updateConfig(e){r.campaignPopupDispatch.updateCampaignPopup(e)},setActiveScreen(e){r.campaignPopupDispatch.updateCampaignPopup({activeScreen:e})},setRenderTarget(e){r.campaignPopupDispatch.updateCampaignPopup({target:e,previewTargetDesktop:"",previewTargetMobile:"",isGalleryView:!1})},setRenderPreviewTarget(e,t){r.campaignPopupDispatch.updateCampaignPopup({previewTargetDesktop:e,previewTargetMobile:t,target:"",isGalleryView:!1})},setMobileView(e){r.campaignPopupDispatch.updateCampaignPopup({isMobileView:e})},showPopupGalleryPreview(e){if(a)return;a=!0,r.campaignPopupDispatch.setDisplay(!1);const t=setTimeout((()=>{Object.assign(e,{target:"",previewTargetDesktop:"",previewTargetMobile:"",isGalleryView:!0}),r.campaignPopupDispatch.updateCampaignPopup(e),r.campaignPopupDispatch.setDisplay(!0),clearTimeout(t)}),300),n=setTimeout((()=>{a=!1,clearTimeout(n)}),550)}};t.initPopupAPI=()=>{i.isPopupConstructor&&(o._popupAPI=s)}},45948:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPopupConstructor=void 0;const r=n(97615).EnvironmentManager.isPopupConstructor();t.isPopupConstructor=r},48999:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.formatProactiveContent=function(e){var t;const n=["top","top_width"].includes(null==e?void 0:e.img_position),r=!(null==e||!e.img_src)&&(i=e.img_src,`\n\n![](${i})\n\n`);var i;let o="";r&&n&&(o+=r);null!=e&&e.title&&""!==e.title.trim()&&(o+=`# ${e.title}\n`);o+=null!==(t=null==e?void 0:e.text)&&void 0!==t?t:null==e?void 0:e.message,r&&!n&&(o+=r);return o},t.sendCampaignData=t.getCampaignContentSettigns=t.getCampaignById=void 0;var i=r(n(96394)),o=n(83170),a=r(n(86961)),s=n(54415);const l=e=>{var t;return null===(t=i.default.campaigns)||void 0===t?void 0:t.filter((t=>t.campaign_id===e))[0]};t.getCampaignById=l;t.getCampaignContentSettigns=e=>{var t,n,r;const i=l(e);return i&&(null!==(t=null===(n=i.content)||void 0===n?void 0:n.widget_settings)&&void 0!==t?t:null===(r=i.rules)||void 0===r?void 0:r.commands[0].params)};t.sendCampaignData=(e,t)=>{a.default.postCampaignData(e,((n,r)=>{var i,a;r&&(null==t||t(null===(i=r.data)||void 0===i||null===(a=i.result)||void 0===a?void 0:a.client_answer_id),s.Monitoring.telemetry(o.TelemetryName.SEND_CAMPAIGN_DATA_SUCCESS,{param1:JSON.stringify(null==r?void 0:r.data)}));n&&(null==t||t(null),s.Monitoring.telemetry(o.TelemetryName.SEND_CAMPAIGN_DATA_ERROR,{param1:JSON.stringify(e),param2:n.status}))}))}},81722:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.getLastAgent=function(){const e=a.default.getLastMessage();if(!e||e.get("from")!==l.MessageInitiator.AGENT&&"bot"!==e.get("from")||e.get("type")!==l.MessageType.MESSAGE)return!1;{const t=e.get("from_id");let n=u.default.getAgentById(t);return"bot"===e.get("from")&&(n=u.default.getBotById(t)),!!n&&n.toJSON()}},t.getLastMessageHeight=E,t.getMaxWidgetHeightForProactive=function(){if(!y.platform.isDesktop||y.platform.isChatPage)return;if(a.default.getClientMessages().length)return;const e=(0,_.getProactive)(),t=m.default.get(h.Component.MESSAGES_CONTAINER),n=null==t?void 0:t.clientHeight,r=e.text.includes("[]("),i=!!e.prechats&&e.prechats>=3,o=r&&i?g.DEFAULT_WIDGET_HEIGHT+300:g.DEFAULT_WIDGET_HEIGHT;if(n){const e=(0,v.getPageWindow)().innerHeight-s.HEADER_HEIGHT,t=n+s.HEADER_HEIGHT+s.INPUT_HEIGHT,r=t>e?e:t;return t2)return!1;const n=a.default.getFirstMessage(),r=a.default.getLastMessage();return a.default.getMessagesByType(l.MessageType.PRECHAT)&&r&&r.get("type")==l.MessageType.PRECHAT&&n&&n.get("type")==l.MessageType.PROACTIVE},t.isValidEmail=function(){const e=(0,d.getClient)();return e.email&&o.default.email(e.email)},t.setLastAgentScroll=function(e){if(!e)return!1;const t=C(),n=e.base;if(!n)return!1;const r=(0,_.getProactive)().text,i=E(n),o=n.offsetHeight;b.log("setLastAgentScroll",t,i,o);const s=r?1:0,u=a.default.getLastMessage(),c=a.default.getFirstMessage();if(n&&i&&s&&c&&!c.get("msg_id")&&u&&u.get("type")==l.MessageType.PRECHAT)return e.scrollToTop(),!1;if(t&&i&&o&&i>o){e.setIgnore(!0);const t=y.platform.isMobileOrTablet?80:50,n=e.getScrollHeight()-i-t;return s&&1==a.default.getAgentMessages().length?e.scrollToTop():e.scrollTop(n),!0}return!1};var i=r(n(96394)),o=r(n(98960)),a=r(n(14264)),s=n(52274),l=n(81152),u=r(n(14762)),c=r(n(32138)),d=n(44145),f=r(n(4855)),p=n(54346),h=n(70859),g=n(52274),_=n(44145),m=r(n(75686)),v=n(23267),y=n(20676);const b=f.default.name("ChatUtils");function E(e){if(!e)return 0;const t=e.querySelectorAll("."+c.default.text);if(t.length){const e=t[t.length-1].clientHeight;return e?e+s.HEADER_HEIGHT+10:0}return 0}function C(){const e=a.default.getLastMessage();return!!e&&(e.isAgentMessage()&&-1==[l.MessageType.FORM,l.MessageType.PREFORM].indexOf(e.get("type")))}},22866:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(96394)),s=n(97615),l=r(n(4855)),u=n(87144),c=n(7547);let d=null,f=function(){function e(t,n,r,o,a,s){(0,i.default)(this,e),this.webSocketEventsStore=null,this.viSocketEventsStore=null,this.exceptionsStore=null,this.initialized=!1,this.messagesFormatter=new c.MessagesFormatter(s),this.messageHistory={},this.appStore=t,this.widgetConfig=n,this.clientStore=r,this.agentStore=o,this.reduxStore=a,this.webSocketEventsStore=new u.EventStore,this.viSocketEventsStore=new u.EventStore,this.exceptionsStore=new u.EventStore,this.actionsStore=new u.EventStore,this.initialized=!0,d=this}return(0,o.default)(e,[{key:"isInitialized",value:function(){return this.initialized}},{key:"saveSocketEvent",value:function(e){this.webSocketEventsStore.save(e)}},{key:"saveViEvent",value:function(e){this.viSocketEventsStore.save(e)}},{key:"saveException",value:function(e){this.exceptionsStore.save(e)}},{key:"saveReduxAction",value:function(e){this.actionsStore.save(e)}},{key:"saveMessageHistory",value:function(e,t){this.messageHistory[e]=t}},{key:"pageHasErrors",value:function(){return this.exceptionsStore.length()>0}},{key:"exportData",value:function(){return JSON.stringify({agentStore:this.agentStore,appStore:this.appStore,clientStore:this.clientStore,config:this.widgetConfig,exceptionsStore:this.exceptionsStore.getAll(),messagesStore:this.messagesFormatter.toDebugLog(),messageHistory:this.messageHistory,reduxStore:this.reduxStore.getState(),userAgent:navigator.userAgent,version:s.EnvironmentManager.getVersion(),visitorsInsightEventsStore:this.viSocketEventsStore.getAll(),webSocketEventsStore:this.webSocketEventsStore.getAll(),actionsStore:this.actionsStore.getAll(),lastLog:l.default.lastLog.join("\r\n"),configLogs:{lastStatus:a.default.lastStatus}})}}],[{key:"getInstance",value:function(){return d}}]),e}();t.default=f},87144:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.EventStore=void 0;var i=r(n(33119)),o=r(n(92664));let a=function(){function e(){(0,i.default)(this,e),this.events=[]}return(0,o.default)(e,[{key:"save",value:function(e){this.events.push(e)}},{key:"getAll",value:function(){return this.events||null}},{key:"length",value:function(){return this.events.length}}]),e}();t.EventStore=a},7547:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.MessagesFormatter=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(23267),s=n(52161),l=n(44145),u=r(n(4855)),c=n(36874);const d=u.default.name("MessagesFormatter");let f=function(){function e(t){(0,i.default)(this,e),this.messagesStore=t}return(0,o.default)(e,[{key:"toTxt",value:function(){d.log("toTxt")}},{key:"getMessagesAsHTML",value:function(){try{const e=this.toHTML(),t=new Blob([e],{type:"text/html"}),n=window.parent.URL.createObjectURL(t);return{url:n,fileName:`${(new Date).toISOString()}_${(0,a.getPageWindow)().location.host}_chat_log.html`}}catch(e){return{url:null,fileName:null}}}},{key:"toHTML",value:function(){d.log("toHTML");let e="";this.messagesStore.store.forEach((t=>{const n=t.store;let r;if("client"===n.from)r="you";else{if("agent"!==n.from&&"bot"!==n.from)return;{let e=n.from_id&&(0,l.getAgentById)(+n.from_id);"bot"===n.from&&(e=n.from_id&&(0,l.getBotById)(+n.from_id)),r=e?`${e.name} (${e.title})`:"agent"}}let i=n.text;if(!i||"form"===n.type||"botsystem"===n.type)return;if("media"===n.type&&n.body&&n.body.file_url){const e=n.body.name||n.body.file_name,t=n.body.file_url||n.body.file;i=`${e}`}const o="cobrowse"===n.type&&n.body&&n.body.address;if(o){const e=n.body.text||"",t=`${n.body.url}#jvhs_${n.body.address}`;i=`${(0,s.escape)(e).trim()}`}let a=i?(0,s.escape)(i).trim():"";o&&(a=i);const u=new Date(n.created_ts),c=u.toLocaleDateString(),d=u.toLocaleTimeString();e+=`
\n ${c} ${d}, ${r}\n
\n ${a}\n
\n
`}));return`\n \n \n \n \n \n Chat log from ${(0,a.getPageWindow)().location.host}\n \n \n \n

Chat log from ${(0,a.getPageWindow)().location.host}

\n \n
\n ${e}\n
\n \n `}},{key:"toDebugLog",value:function(){return d.log("toDebugLog"),this.messagesStore.store}}]),e}();t.MessagesFormatter=f},33069:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatPeriodsToSelectModel=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.map(((n,r)=>{const i=e[r+1],a=(0,o.formatPeriodLabel)(n,i,t);return a?{label:a,value:n}:a})).filter((e=>(0,i.isObject)(e)))},t.isErrorStatusCode=function(e){return[r.DelayedCallStatus.MAX_REQUESTS_LIMIT,r.DelayedCallStatus.NOT_WORK_TIME,r.DelayedCallStatus.BAD_CALLBACK_TIME,r.DelayedCallStatus.BLOCKED,r.DelayedCallStatus.BAD_DIRECTION].some((t=>e===t))};var r=n(47138),i=n(46322),o=n(1858)},74603:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.designerApiInit=function(){v.isDesignerEditor&&(C._dAPI=w)};var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(96394)),o=n(42908),a=r(n(14264)),s=r(n(14762)),l=r(n(27104)),u=r(n(26754)),c=r(n(75686)),d=n(70859),f=n(26932),p=n(65465),h=n(31694),g=r(n(4855)),_=n(81152),m=n(44145),v=n(52028),y=n(23267);function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}const E=g.default.name("DesignerApi"),C=(0,y.getPageWindow)(),T=(e,t)=>{window.parent._desingerConfig[e]=t},D=()=>{const e=c.default.getComponent(d.Component.ROOT_COMPONENT);e&&e.forceUpdate()},w={showChat(){E.log("showChat"),o.api.open()},showLabel(){E.log("closeChat"),o.api.close()},setAgent(e){E.log("setAgent",{params:e}),s.default.destroy(),s.default.push({agent_id:1,display_name:e.name,title:e.title,avatar_url:e.avatarUrl,body:{state:"join",unsave:!0}}),Object.assign(u.default,{agent_id:1,display_name:e.name,title:e.title,avatar_url:e.avatarUrl}),f.agentsDispatchers.addAgent({id:1,name:e.name,title:e.title,avatarUrl:e.avatarUrl,isBot:!1}),f.chatsDispatchers.setJoinedAgents([{agent_id:1,display_name:e.name,title:e.title,avatar_url:e.avatarUrl}]),f.chatsDispatchers.addJoinedAgent(1),D()},addMessages(e){E.log("addMessages",{messages:e});const t=[];e.forEach((e=>{t.push({from:e.from,from_id:"agent"===e.from?1:null,text:e.text,type:"message",status:"read",created_ts:(new Date).getTime(),body:{unsave:!0}})})),f.messagesDispatchers.addMessages(t)},updateAgent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;E.log("updateAgent",{params:e,id:t}),Object.assign(u.default,{agent_id:t,display_name:e.name,title:e.title,avatar_url:e.avatarUrl});const n=s.default.getAgentById(t);n&&(n.set("display_name",e.name),n.set("title",e.title),n.set("avatar_url",e.avatar_url)),f.agentsDispatchers.updateAgent({id:t,name:e.name,title:e.title,avatarUrl:e.avatarUrl})},editLastMessage(e){E.log("editLastMessage",{text:e});const t=a.default.getAgentMessages();if(t.length){t[t.length-1].set("text",e);const n=c.default.getComponent(d.Component.SCROLL_CONTAINER);n&&n.forceUpdate()}},cleanMessages(){E.log("cleanMessages"),a.default.destroy(),a.default.trigger("update")},setWidgetColor(e,t){E.log("setWidgetColor",{color:e,color2:t}),f.userDispatchers.setWidgetColor(e),f.userDispatchers.setWidgetColor2(t),D()},setDesktopSettings(e){E.log("setDesktopSettings",e),f.userDispatchers.setPowerGradient(e)},setMobileWidgetColor(e){E.log("setMobileWidgetColor",e),f.userDispatchers.setPowerButtonColor(e)},setCallbackColor(e){E.log("setCallbackColor",{color:e}),(0,i.setConfigParam)("callback_btn_color",e),f.userDispatchers.setCallbackButtonColor(e),D()},setBubbleColor(e){E.log("setBubbleColor",{color:e}),f.userDispatchers.setBubbleColor(e),(0,i.setConfigParam)("bubble_color",e),(0,v.runBind)("setBubbleColor"),D()},setPattern(e){E.log("setPattern",{pattern:e}),f.userDispatchers.setPattern(e),(0,i.setConfigParam)("pattern",e),D()},setWidgetPosition(e,t){E.log("setWidgetPosition",{orientation:e,padding:t});const n=+t;f.userDispatchers.setWidgetOrientation(e),f.userDispatchers.setWidgetPadding(n),(0,i.setConfigParam)("widget_orientation",e),(0,i.setConfigParam)("widget_padding",n),(0,v.runBind)("setWidgetPosition",{orientation:e,padding:n}),D()},setMobileWidgetOrientation(e){E.log("setMobileWidgetOrientation",e),f.userDispatchers.setWidgetMobileOrientation(e)},setMobileBottomOffset(e){E.log("setMobileBottomOffset",e);const t=e||null;f.userDispatchers.setMobileOffsetBottom(t)},setFontColor(e){E.log("setFontColor",{type:e}),"auto"===e&&(e=l.default.isLightColor(i.default.widget_color)?"dark":"light"),(0,i.setConfigParam)("widget_font_color",e),f.userDispatchers.setWidgetFontColor(e),D()},setFontSize(e){E.log("setFontSize",{size:e}),f.userDispatchers.setWidgetFontSize(e),(0,i.setConfigParam)("font_size",e),D()},setFontFamily(e){E.log("setFontFamily",{family:e}),f.userDispatchers.setWidgetFontFamily(e),(0,i.setConfigParam)("font_family",e),D()},setFontType(e){E.log("setFontType",{type:e}),f.userDispatchers.setWidgetFontType(e),(0,i.setConfigParam)("font_type",e),D()},setLabelBubble(e){E.log("setLabelBubble",{bool:e});const t=e?1:0;f.userDispatchers.setWidgetLabelBubble(t),(0,i.setConfigParam)("label_bubble",t)},setOnlineText(e){E.log("setOnlineText",{text:e}),f.userDispatchers.setOnlineLabel(e),(0,i.setConfigParam)("online_widget_label",e),(0,v.runBind)("setOnlineText",e)},setLabelText(e){E.log("setLabelText",{text:e}),"online"===i.default.chat_mode?(f.userDispatchers.setOnlineLabel(e),(0,i.setConfigParam)("online_widget_label",e)):(f.userDispatchers.setOfflineLabel(e),(0,i.setConfigParam)("offline_widget_label",e)),(0,v.runBind)("setLabelText",e)},setOfflineFormText(e){E.log("setOfflineFormText",{text:e});const t=(0,m.getLastMessageByType)(_.MessageType.FOR_TEST);t&&(f.messagesDispatchers.updateMessage({privateId:t.private_id},{text:e}),f.userDispatchers.setOfflineFormText(e),(0,i.setConfigParam)("offline_form_text",e),(0,v.runBind)("setOfflineFormText",e))},setChatOnline(){E.log("setChatOnline"),T("chat_mode","online"),(0,i.setConfigParam)("chat_mode","online"),(0,v.runBind)("setChatOnline"),D()},setChatOffline(){E.log("setChatOffline"),T("chat_mode","offline"),(0,i.setConfigParam)("chat_mode","offline"),(0,v.runBind)("setChatOffline"),D()},addPrechat(e){w.cleanPrechat(),E.log("addPrechat",{prechats:e}),(0,i.setConfigParam)("prechat",e),(0,i.setConfigParam)("enable_prechat",1),p.messageActions.pushPrechat(),f.featuresDispatchers.enablePrechat(!0),f.userDispatchers.setPrechat(e)},updatePrechats(e){if(E.log("updatePrechats",{prechats:e}),!e)return;c.default.getComponent(d.Component.PRECHAT)&&h.PrechatEmitter.emit("updatePrechatText",e)},cleanPrechat(){E.log("cleanPrechat"),p.messageActions.deletePrechatMsg(),a.default.trigger("update")},setMobileView(e){let t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).target;e?f.designerDispatchers.updateDesignerSettings({isMobileView:e,mobileRenderTarget:t}):f.designerDispatchers.updateDesignerSettings({isMobileView:!1,mobileRenderTarget:""})}}},52028:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.designerBind=function(e,t){if(!o)return;void 0!==i[e]||(i[e]=[]),i[e].push(t)},t.isDesignerEditor=void 0,t.runBind=function(e,t){void 0!==i[e]&&i[e].forEach((e=>{e(t)}))};var r=n(97615);const i={},o=r.EnvironmentManager.isDesignerEditor();t.isDesignerEditor=o},19955:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664));let a=function(){function e(t){(0,i.default)(this,e),this.userAgent=t,this._find=function(e){const t={};return function(){const n=arguments.length<=0?void 0:arguments[0];if(n in t)return t[n];{const r=e(n);return t[n]=r,r}}}(this._find.bind(this)),this.initialize(),this.initializeSupportedFeatures()}return(0,o.default)(e,[{key:"initialize",value:function(){this.isWindows=this._find("windows"),this.isOpera=this._find("opera")||this._find("opr")||this._find("presto"),this.isOperaMini=this.isOpera&&(this._find("mini")||this._find("opios")),this.isFirefox=this._find("firefox"),this.isChrome=this._find("chrome"),this.isChromeIOS=this._find("crios"),this.isHeyTap=this._find("heytapbrowser"),this.isSafari=this._find("safari")&&!this.isChrome&&!this.isChromeIOS&&!this.isHeyTap,this.isEdge=this._find("edge"),this.isIe=this._find("msie")||this._find("trident")||this.isEdge,this.isIeOrEdge=this.isIe||this._find("lumia"),this.isIpod=this._find("ipod"),this.isIpad=this._find("ipad")||this._find("macintosh")&&"ontouchend"in window,this.isIphone=!this.isWindows&&this._find("iphone"),this.isIos=this.isIphone||this.isIpod||this.isIpad,this.isAndroid=!this.isWindows&&this._find("android"),this.isAndroidPhone=this.isAndroid&&this._find("mobile"),this.isAndroidTablet=this.isAndroid&&!this._find("mobile"),this.isBlackberry=this._find("blackberry")||this._find("bb10")||this._find("rim"),this.isBlackberryPhone=this.isBlackberry&&!this._find("tablet"),this.isBlackberryTablet=this.isBlackberry&&this._find("tablet"),this.isWindowsPhone=this.isWindows&&this._find("phone"),this.isWindowsTablet=this.isWindows&&this._find("touch")&&!this.isWindowsPhone&&!this._find("trident"),this.isMobile=this.isAndroidPhone||this.isIphone||this.isIpod||this.isWindowsPhone||this.isBlackberryPhone,this.isTablet=this.isIpad||this.isAndroidTablet||this.isBlackberryTablet||this.isWindowsTablet,this.isMobileOrTablet=this.isMobile||this.isTablet,this.isDesktop=!this.isMobile&&!this.isTablet,this.isYandexBot=-1!==this.userAgent.search(/\+http:\/\/yandex\.com\/bots/gi),this.isGoogleBot=-1!==this.userAgent.search(/google/gi),this.isOperaMobile=this.isOperaMini||this.isOpera&&this.isMobileOrTablet;let e=/OS (\d+)_(\d+)_?(\d+)?/.exec(window.navigator.appVersion);e||(e=/version\/(\d+).(\d+)?/.exec(this.userAgent)),this.iosVer=e?parseFloat(e[1]+"."+e[2]):null,this.isMac=window.navigator.platform.includes("Mac");let t=/OS X (\d+)_(\d+)_?(\d+)?/.exec(window.navigator.appVersion);window.navigator.oscpu&&(t=/OS X (\d+)[._](\d+)([._])?(\d+)?/.exec(window.navigator.oscpu)),this.macVer=t?parseFloat(t[1]+"."+t[2]):null,this.device=null,this.isDesktop?this.device="desktop":this.isMobile?this.device="mobile":this.isTablet&&(this.device="tablet")}},{key:"initializeSupportedFeatures",value:function(){try{localStorage.setItem("testLocalStorage","ok"),localStorage.removeItem("testLocalStorage"),this.isLocalStorageSupported=!0}catch(e){this.isLocalStorageSupported=!1}try{new File([],""),this.isImageResizeSupported="FileReader"in window&&"File"in window&&"Blob"in window}catch(e){this.isImageResizeSupported=!1}this.isCssVariablesSupported=window.CSS&&CSS.supports&&CSS.supports("color","var(--fake-var)")||!1,this.isWebAnimationApiSupported=!!window.KeyframeEffect,this.isPassiveListenersSupported=!1;try{var e=Object.defineProperty({},"passive",{get:()=>(this.isPassiveListenersSupported=!0,this.isPassiveListenersSupported)});window.addEventListener("test",null,e)}catch(e){this.isPassiveListenersSupported=!1}}},{key:"operaMini",value:function(){return this.isOperaMini}},{key:"firefox",value:function(){return this.isFirefox}},{key:"safari",value:function(){return this.isSafari}},{key:"chrome",value:function(){return this.isChrome}},{key:"ieOrEdge",value:function(){return this.isIeOrEdge}},{key:"ie",value:function(){return this.isIe}},{key:"edge",value:function(){return this.isEdge}},{key:"ios",value:function(){return this.isIos}},{key:"ipad",value:function(){return this.isIpad}},{key:"chromeIOS",value:function(){return this.isChromeIOS}},{key:"android",value:function(){return this.isAndroid}},{key:"windowsPhone",value:function(){return this.isWindowsPhone}},{key:"mobile",value:function(){return this.isMobile}},{key:"tablet",value:function(){return this.isTablet}},{key:"mobileOrTablet",value:function(){return this.isMobileOrTablet}},{key:"desktop",value:function(){return this.isDesktop}},{key:"iosVersion",value:function(){return this.iosVer}},{key:"macVersion",value:function(){return this.macVer}},{key:"getDevice",value:function(){return this.device}},{key:"supportsPassiveListeners",value:function(){return this.isPassiveListenersSupported}},{key:"supportsCssVariables",value:function(){return this.isCssVariablesSupported}},{key:"supportsWebAnimationApi",value:function(){return this.isWebAnimationApiSupported}},{key:"supportsImageResize",value:function(){return this.isImageResizeSupported}},{key:"supportsLocalStorage",value:function(){return this.isLocalStorageSupported}},{key:"supportsIMessage",value:function(){return(this.ios()||this.ipad())&&this.iosVersion()>=11.3}},{key:"isMacintosh",value:function(){return this.isMac}},{key:"supportsAbc",value:function(){return this.isMacintosh()&&this.macVersion()>=10.15}},{key:"yandexBot",value:function(){return this.isYandexBot}},{key:"googleBot",value:function(){return this.isGoogleBot}},{key:"isPointerEnabled",value:function(){return"PointerEvent"in window}},{key:"isTouchEnabled",value:function(){return"ontouchstart"in window}},{key:"_find",value:function(e){return-1!==this.userAgent.indexOf(e)}}]),e}();var s=new a(window.navigator.userAgent.toLowerCase());t.default=s},26411:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const r=n(97615).EnvironmentManager.getAllowedFileTypes();var i=r&&r.length?r:[{extension:"rar",mimeType:"application/vnd.rar"},{extension:"tar",mimeType:"application/x-tar"},{extension:"7z",mimeType:"application/x-7z-compressed"},{extension:"djvu",mimeType:"image/vnd.djvu"},{extension:"json",mimeType:"application/json"},{extension:"log",mimeType:"text/plain"},{extension:"ppt",mimeType:"application/vnd.ms-powerpoint"},{extension:"xls",mimeType:"application/vnd.ms-excel"},{extension:"doc",mimeType:"application/msword"},{extension:"docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{extension:"rtf",mimeType:"application/rtf"},{extension:"ttf",mimeType:"font/ttf"},{extension:"psd",mimeType:"image/vnd.adobe.photoshop"},{extension:"odt",mimeType:"application/vnd.oasis.opendocument.text"},{extension:"pdf",mimeType:"application/pdf"},{extension:"aac",mimeType:"audio/aac"},{extension:"avi",mimeType:"video/x-msvideo"},{extension:"csv",mimeType:"text/csv"},{extension:"epub",mimeType:"application/epub+zip"},{extension:"gz",mimeType:"application/gzip"},{extension:"gif",mimeType:"image/gif"},{extension:"ics",mimeType:"text/calendar"},{extension:"jpeg",mimeType:"image/jpeg"},{extension:"jpg",mimeType:"image/jpeg"},{extension:"mp3",mimeType:"audio/mpeg"},{extension:"mpeg",mimeType:"video/mpeg"},{extension:"oga",mimeType:"audio/ogg"},{extension:"ogv",mimeType:"video/ogg"},{extension:"png",mimeType:"image/png"},{extension:"svg",mimeType:"image/svg+xml"},{extension:"txt",mimeType:"text/plain"},{extension:"vsd",mimeType:"application/vnd.visio"},{extension:"wav",mimeType:"audio/wav"},{extension:"weba",mimeType:"audio/webm"},{extension:"webm",mimeType:"video/webm"},{extension:"webp",mimeType:"image/webp"},{extension:"zip",mimeType:"application/zip"},{extension:"zip",mimeType:"application/x-zip-compressed"},{extension:"mp4",mimeType:"application/mp4"},{extension:"mp4",mimeType:"video/mp4"},{extension:"mp4a",mimeType:"audio/mp4"},{extension:"mov",mimeType:"video/quicktime"},{extension:"html",mimeType:"text/html"},{extension:"htm",mimeType:"text/html"},{extension:"css",mimeType:"text/css"},{extension:"ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{extension:"odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{extension:"pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{extension:"xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}];t.default=i},2439:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(96394)),s=n(12494),l=n(52274),u=n(21434),c=r(n(26411));let d=function(){function e(t){(0,i.default)(this,e),this.file=t,this.fileExtension=(0,u.fileName)(t.name).ext,this.fileMimeType=t.type,this.fileSize=t.size,this.reason=null,this.isExtendedEnabled=Boolean(a.default.enable_extended_file_transfer)}return(0,o.default)(e,[{key:"isValid",value:function(){return this.isAllowedFileSize()&&this.isAllowedExtensionAndMime()}},{key:"getReason",value:function(){return this.reason}},{key:"isAllowedExtensionAndMime",value:function(){if(!this.fileExtension)return this.reason=s.FileUploadError.NO_EXTENSION,!1;for(let e=0;e(this.isExtendedEnabled?l.MAX_EXTENDED_FILE_SIZE:l.MAX_FILE_SIZE))||(this.reason=s.FileUploadError.FILE_SIZE_EXCEEDED,!1)}}]),e}();t.default=d},69625:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.mediaUploader=void 0;var i=r(n(61125)),o=r(n(33119)),a=r(n(92664)),s=r(n(96394)),l=n(54415),u=n(83170),c=n(52274),d=n(44145),f=r(n(2439)),p=n(12494),h=n(75141),g=n(58271),_=n(53489),m=n(21434),v=n(20344),y=n(77294),b=n(81152),E=n(26932),C=n(95911);function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t{const t=e.data;return this.metadata=t.metadata,this.sign=t.sign,this.ts=t.ts,this.media_server_url=t.url,l.Monitoring.telemetry(u.TelemetryName.MEDIA_SIGN,{param1:JSON.stringify(D(D({},t),{},{sign:t.sign[0]})),param2:this.file_name||"none"}),t})).catch((e=>{w.error("Upload file error",e),l.Monitoring.telemetry(u.TelemetryName.MEDIA_SIGN_ERROR),this.setMessageError(p.FileUploadError.REQUEST_FAILED)}))}},{key:"onUploadProgress",value:function(){const e=this.mediaMessage;var t;e&&(e.body.status===b.MediaStatus.ERROR&&(null===(t=this.currentQuery)||void 0===t||t.call(this)))}},{key:"uploadFile",value:async function(e,t){var n;w.warn("uploadFile");const r=(0,g.bytesToMB)(null!==(n=this.file.size)&&void 0!==n?n:5),i=3e4*Math.ceil(r),o=C.xhrRequest.put(`${this.media_server_url}/${this.file_name}?ts=${this.ts}&sign=${this.sign}&public`,((t,n)=>{if(w.warn("onLoad",t,n),t)return void this.setMessageError(p.FileUploadError.REQUEST_FAILED);const r=n.headers.location||n.headers.Location,i=this.mediaMessage;if(E.messagesDispatchers.updateMessage({privateId:i.private_id},{body:D(D({},i.body),{},{unsave:null})}),!r)return e(0),E.messagesDispatchers.updateMessage({privateId:i.private_id},{body:D(D({},i.body),{},{status:b.MediaStatus.ERROR,error:(0,v.l10n)("file_upl_error")})}),void l.Monitoring.telemetry(u.TelemetryName.FILE_UPLOAD_NO_LOCATION,{param1:this.file_name,param2:JSON.stringify(n.headers),param3:n.status});this.onSuccess({fullUrl:this.media_server_url+n.headers.location})}),{timeout:i,headers:{"Content-Type":this.file.type,"X-Metadata":this.metadata},body:this.file,onUpload:t=>{w.warn("onUpload",t.loaded),e&&e(t.loaded),this.onUploadProgress()}});this.currentQuery=()=>{null==o||o.abort(),null==t||t()}}},{key:"getError",value:function(e){if(e){let t=(0,v.l10n)("file_upl_error"),n=null;switch(e){case p.FileUploadError.FILE_SIZE_EXCEEDED:t=(0,v.l10n)("file_upl_error_max_size").replace("_FILESIZE_",(0,g.fileSize)(s.default.enable_extended_file_transfer?c.MAX_EXTENDED_FILE_SIZE:c.MAX_FILE_SIZE)),n={param1:p.FileUploadError.FILE_SIZE_EXCEEDED};break;case p.FileUploadError.UPLOAD_CANCELED:t=(0,v.l10n)("file_upl_cancel"),n={param1:p.FileUploadError.UPLOAD_CANCELED};break;case p.FileUploadError.NO_EXTENSION:t=(0,v.l10n)("file_upl_error_no_ext"),n={param1:p.FileUploadError.NO_EXTENSION};break;case p.FileUploadError.RESTRICTED_FILE_TYPE:t=(0,v.l10n)("file_upl_error"),n={param1:(0,m.fileName)(this.file.name).ext,param2:p.FileUploadError.RESTRICTED_FILE_TYPE};break;case p.FileUploadError.REQUEST_FAILED:n={param1:p.FileUploadError.REQUEST_FAILED}}return n&&l.Monitoring.telemetry(u.TelemetryName.FILE_UPLOAD_ERROR,n),t}}},{key:"setMessageError",value:function(e){const t=this.getError(e),n=this.mediaMessage;n&&E.messagesDispatchers.updateMessage({privateId:n.private_id},{body:D(D({},n.body),{},{status:b.MediaStatus.ERROR},t&&{error:t}),status:b.MessageStatus.DELIVERED})}},{key:"checkIfFileReadIsNeeded",value:function(e){if(w.warn("checkIfFileReadIsNeeded",e.type),"photo"===(0,h.detectType)(e.type)&&"FileReader"in window)try{return this.readFileContent(e),!0}catch(e){return this.setMessageError(),!1}}},{key:"checkFileInfo",value:function(e){const t=new f.default(e);if(t.isValid())return this.checkIfFileReadIsNeeded(e),!0;{const e=t.getReason();return this.setMessageError(e),!1}}},{key:"readFileContent",value:function(e){const t=new FileReader;t.onload=function(){const n=new Image;n.onload=function(){e.width=n.width,e.height=n.height,w.warn("readFileContent",e)},n.onerror=e=>{w.log("FileReader error",e),l.Monitoring.telemetry(u.TelemetryName.FILE_UPLOAD_ERROR,{param1:"image_generate_failed"})},n.src=t.result},t.onprogress=function(){},t.readAsDataURL(e)}},{key:"startUpload",value:async function(e,t,n,r,i){if(!t)return!1;if(this.file=t,this.file_name=(0,_.sanitize)(t.name),this.onSuccess=n,this.mediaMessage=e,this.checkFileInfo(t)){await this.getSign()&&await this.uploadFile(r,i)}}}]),e}());t.mediaUploader=S},99012:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.initCallTouch=function(){if(i.default.enable_calltouch){const e=(0,o.getPageWindow)(),t=(0,a.getClient)();if("function"==typeof e.ct){s.log("init");try{const n=e.ct("calltracking_params");n&&n.length&&n.forEach((n=>{const r=`{"site_id": ${i.default.site_id}, "widget_id": "${i.default.widget_id}", "visitor_id": "${t.visitorId}"}`;s.log("set attr:",r),e.ct(n.modId,"set_attrs",r)}))}catch(e){s.error("Fail to sync with calltouch",e)}}}};var i=r(n(96394)),o=n(23267),a=n(44145);const s=r(n(4855)).default.name("CallTouch","color: grey")},22618:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.initVideoForce=function(){const e=i.default.integrations;if(e&&e.videoforce){const t="https://widget.videoforce.io/";try{const n=document.createElement("script");n.src=t+e.videoforce,n.crossorigin="anonymous",n.async="true";const r=(0,o.getPageWindow)().jivo_cspNonce;r&&n.setAttribute("nonce",r);const i=(0,o.getPageWindow)().document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i)}catch(e){a.Monitoring.reportException(e)}}};var i=r(n(96394)),o=n(23267),a=n(54415)},55908:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(44733),s=n(99040);const l=r(n(4855)).default.name("AbTestManager");let u=null,c=function(){function e(){if((0,i.default)(this,e),u)return u;this.activeTest=null,this.storeName="abTests",this._initialize(),this._cleanUp(),u=this}return(0,o.default)(e,[{key:"testIsActive",value:function(e){return this.activeTest&&this.activeTest.name===e}},{key:"getActiveTest",value:function(){return this.activeTest?this.activeTest:null}},{key:"getGroup",value:function(e){return this.testIsActive(e)?this.activeTest.chosenGroup:null}},{key:"getNumberOfGroupsInTest",value:function(e){return this.testIsActive(e)?this.activeTest.numberOfGroups:null}},{key:"isInTestGroup",value:function(e,t){return this.getGroup(e)===t}},{key:"getActiveTestAsString",value:function(){return this.activeTest?`${this.activeTest.name},${this.activeTest.chosenGroup}`:null}},{key:"getActiveTestName",value:function(){return this.activeTest?this.activeTest.name:null}},{key:"getActiveTestGroup",value:function(){return this.activeTest?this.activeTest.chosenGroup:null}},{key:"_initialize",value:function(){if(s.ACTIVE_TEST){const e=this._getSavedTestGroup(s.ACTIVE_TEST.name);this.activeTest={name:s.ACTIVE_TEST.name,numberOfGroups:s.ACTIVE_TEST.groups,chosenGroup:e||this._getRandomGroupNumber(s.ACTIVE_TEST.groups)},a.StorageProvider.set(this.storeName,this.activeTest),l.log("Ab-testing is ebabled.",`TestName: ${this.getActiveTestName()}.`,`Group: ${this.getActiveTestGroup()}.`)}}},{key:"_getRandomGroupNumber",value:function(e){return Math.floor(Math.random()*e)+1}},{key:"_getSavedTestGroup",value:function(e){const t=a.StorageProvider.get(this.storeName);return t&&t.name===e?t.chosenGroup:null}},{key:"_cleanUp",value:function(){this.activeTest||a.StorageProvider.remove(this.storeName)}}],[{key:"getInstance",value:function(){return u}}]),e}();t.default=c},97615:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentManager=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(87884),s=n(68403);const l=new(function(){function e(){(0,i.default)(this,e),this.env="production",this.version="145.11.0",this.loaderVersion="0.1",this.branch="HEAD_4815a6a",this.allowedFiles=JSON.parse('[{"extension":"7z","mimeType":"application/x-7z-compressed"},{"extension":"aac","mimeType":"audio/aac"},{"extension":"aiff","mimeType":"audio/aiff"},{"extension":"amr","mimeType":"audio/amr"},{"extension":"avi","mimeType":"video/avi"},{"extension":"avi","mimeType":"video/x-msvideo"},{"extension":"css","mimeType":"text/css"},{"extension":"csv","mimeType":"text/csv"},{"extension":"djvu","mimeType":"image/vnd.djvu"},{"extension":"doc","mimeType":"application/msword"},{"extension":"docx","mimeType":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{"extension":"epub","mimeType":"application/epub+zip"},{"extension":"gif","mimeType":"image/gif"},{"extension":"gz","mimeType":"application/gzip"},{"extension":"heic","mimeType":"image/heic"},{"extension":"heif","mimeType":"image/heif"},{"extension":"htm","mimeType":"text/html"},{"extension":"html","mimeType":"text/html"},{"extension":"ics","mimeType":"text/calendar"},{"extension":"ico","mimeType":"image/x-icon"},{"extension":"jpeg","mimeType":"image/jpeg"},{"extension":"jpg","mimeType":"image/jpeg"},{"extension":"json","mimeType":"application/json"},{"extension":"log","mimeType":"text/plain"},{"extension":"mid","mimeType":"audio/midi"},{"extension":"mov","mimeType":"video/quicktime"},{"extension":"mp3","mimeType":"audio/mpeg"},{"extension":"mp4","mimeType":"application/mp4"},{"extension":"mp4","mimeType":"video/mp4"},{"extension":"mp4a","mimeType":"audio/mp4"},{"extension":"mpeg","mimeType":"video/mpeg"},{"extension":"odp","mimeType":"application/vnd.oasis.opendocument.presentation"},{"extension":"ods","mimeType":"application/vnd.oasis.opendocument.spreadsheet"},{"extension":"odt","mimeType":"application/vnd.oasis.opendocument.text"},{"extension":"oga","mimeType":"audio/ogg"},{"extension":"ogg","mimeType":"audio/ogg"},{"extension":"ogv","mimeType":"video/ogg"},{"extension":"ogg","mimeType":"video/ogg"},{"extension":"ogg","mimeType":"application/ogg"},{"extension":"opus","mimeType":"audio/ogg"},{"extension":"pdf","mimeType":"application/pdf"},{"extension":"ai","mimeType":"application/pdf"},{"extension":"png","mimeType":"image/png"},{"extension":"pkpass","mimeType":"application/vnd.apple.pkpass"},{"extension":"ppt","mimeType":"application/vnd.ms-powerpoint"},{"extension":"pptx","mimeType":"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{"extension":"psd","mimeType":"image/vnd.adobe.photoshop"},{"extension":"rar","mimeType":"application/vnd.rar"},{"extension":"rar","mimeType":"application/x-rar-compressed"},{"extension":"rtf","mimeType":"application/rtf"},{"extension":"stl","mimeType":"application/vnd.ms-pki.stl"},{"extension":"stl","mimeType":"application/x-navistyle"},{"extension":"svg","mimeType":"image/svg+xml"},{"extension":"tar","mimeType":"application/x-tar"},{"extension":"ttf","mimeType":"font/ttf"},{"extension":"tgs","mimeType":"application/x-gzip"},{"extension":"txt","mimeType":"text/plain"},{"extension":"usdz","mimeType":"model/vnd.usdz+zip"},{"extension":"vsd","mimeType":"application/vnd.visio"},{"extension":"wav","mimeType":"audio/wav"},{"extension":"wav","mimeType":"audio/wave"},{"extension":"weba","mimeType":"audio/webm"},{"extension":"webm","mimeType":"video/webm"},{"extension":"webp","mimeType":"image/webp"},{"extension":"wmv","mimeType":"video/x-ms-wmv"},{"extension":"xls","mimeType":"application/vnd.ms-excel"},{"extension":"xlsx","mimeType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{"extension":"xml","mimeType":"text/xml"},{"extension":"zip","mimeType":"application/x-zip-compressed"},{"extension":"zip","mimeType":"application/zip"},{"extension":"yml","mimeType":"application/x-yaml"},{"extension":"yaml","mimeType":"application/x-yaml"},{"extension":"tiff","mimeType":"image/tiff"},{"extension":"tif","mimeType":"image/tiff"},{"extension":"cdr","mimeType":"image/cdr"},{"extension":"eps","mimeType":"image/x-eps"}]')||null,this.isDesigner=this._checkIfDesignerEditor(),this.isCampaignPopupConstructor=this._checkIfCampaignPopupConstructor(),this.isCampaignWidgetConstructor=this._checkIfCampaignWidgetConstructor(),this.isContactFormPreviewEnable=this._checkIfContactFormPreview(),this.isExtensions=this._checkIfWidgetExtensions()}return(0,o.default)(e,[{key:"isProduction",value:function(){return this.env===a.Environment.PRODUCTION}},{key:"isTesting",value:function(){return this.env===a.Environment.TESTING}},{key:"isDevelopment",value:function(){return this.env===a.Environment.DEVELOPMENT}},{key:"isSelfhosted",value:function(){return Boolean(!1)}},{key:"getVersion",value:function(){return this.version}},{key:"getLoaderVersion",value:function(){return this.loaderVersion}},{key:"getBranch",value:function(){return this.branch}},{key:"getAllowedFileTypes",value:function(){return this.allowedFiles}},{key:"getWindow",value:function(){return window.parent||window}},{key:"isPartnerApp",value:function(){return this.getWindow().jivo_partner||!1}},{key:"isDesignerEditor",value:function(){return this.isDesigner}},{key:"isPopupConstructor",value:function(){return this.isCampaignPopupConstructor}},{key:"isWidgetConstructor",value:function(){return this.isCampaignWidgetConstructor}},{key:"isContactFormPreview",value:function(){return this.isContactFormPreviewEnable}},{key:"isExtensionsEnable",value:function(){return this.isExtensions}},{key:"isApp",value:function(){return new RegExp(/^(app|app3|app3alpha|app3beta)\.(jivosite\.com|jivo\.ru)$/i).test(this.getPageHost())}},{key:"getPageHost",value:function(){return this.getWindow().location.host}},{key:"isSignUpPage",value:function(){return new RegExp(/.*\/signup\.html/i).test(this.getWindow().location.pathname)}},{key:"isRegPage",value:function(){return this.isProduction()?this.isApp()&&this.isSignUpPage():this.isSignUpPage()}},{key:"isDesignerPage",value:function(){return this.getWindow()._jivoDesigner}},{key:"isCampaignPopupConstructorPage",value:function(){return this.getWindow()._jivoCampaignPopupConstructor}},{key:"isCampaignWidgetConstructorPage",value:function(){return this.getWindow()._jivoCampaignWidgetConstructor}},{key:"isContactFormPreviewPage",value:function(){return this.getWindow()._jivoContactFormPreview}},{key:"isExtensionsPage",value:function(){return this.getWindow()._jivoWidgetExtensions}},{key:"isJsApiAvaiable",value:function(){return!!(0,s.isPaidCustomer)()||(this.isApp()||this.isRegPage()||this.isSignUpPage()||this.isDesignerEditor()||this.isPopupConstructor()||this.isPartnerApp())}},{key:"_checkIfCampaignPopupConstructor",value:function(){const e=this.isProduction(),t=e&&this.isApp();return Boolean(this.isCampaignPopupConstructorPage())&&(t||!e)}},{key:"_checkIfCampaignWidgetConstructor",value:function(){const e=this.isProduction(),t=e&&this.isApp();return Boolean(this.isCampaignWidgetConstructorPage())&&(t||!e)}},{key:"_checkIfWidgetExtensions",value:function(){const e=this.isProduction(),t=e&&this.isApp();return Boolean(this.isExtensionsPage())&&(t||!e)}},{key:"_checkIfContactFormPreview",value:function(){const e=this.isProduction(),t=e&&this.isApp();return Boolean(this.isContactFormPreviewPage())&&(t||!e)}},{key:"_checkIfDesignerEditor",value:function(){const e=this.isProduction(),t=e&&this.isApp();return!(!this.isDesignerPage()||!t&&e&&!this.isSelfhosted())}}]),e}());t.EnvironmentManager=l},71323:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(19955)),s=n(54415),l=n(83170),u=n(26932),c=n(41504),d=r(n(96394)),f=n(49963);var p=new(function(){function e(){(0,i.default)(this,e),this.context=null,this.eulaLink=null}return(0,o.default)(e,[{key:"showEula",value:function(e,t,n){d.default.eula&&(u.appDispatchers.setShowEula(e),t&&(this.eulaLink=t),a.default.desktop()&&document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),n&&(this.context=n,s.Monitoring.telemetry(l.TelemetryName.EULA_SHOWN,{param1:n})))}},{key:"acceptEula",value:function(){if(u.clientDispatchers.setEulaAccepted(!0),"cb"===this.context){const e=new c.AcceptEula;f.connectionAdapter.isConnected()&&f.connectionAdapter.sendEvent(e)}s.Monitoring.telemetry(l.TelemetryName.EULA_ACCEPTED,{param1:this.context})}}]),e}());t.default=p},45493:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(19955));let s=null;var l=function(){function e(t,n){if((0,i.default)(this,e),s)return s;this.appStore=n,this.appStore.addListener((()=>{this.updateChatStarted()})),this.storeName="jv_loader_info_"+t,this.store={},a.default.supportsLocalStorage()&&(this.store=JSON.parse(localStorage.getItem(this.storeName))||{}),s=this}return(0,o.default)(e,[{key:"setInStore",value:function(e,t){this.store[e]=t,this.saveStore()}},{key:"saveStore",value:function(){a.default.supportsLocalStorage()&&localStorage.setItem(this.storeName,JSON.stringify(this.store))}},{key:"updateChatStarted",value:function(){this.store.isChatStarted!==this.appStore.chat_started&&(this.store.isChatStarted=this.appStore.chat_started,this.saveStore())}}],[{key:"getInstance",value:function(){return s}}]),e}();t.default=l},74619:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.Observer=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(23267),s=r(n(4855)),l=n(21951);const u=s.default.name("ObserverManager");let c=function(){function e(t){(0,i.default)(this,e),"function"==typeof MutationObserver&&(this.currentTitle=this.getTitle(),this.currentHref=this.getHref(),this.currentPath=this.getPathName(),this.observer=new MutationObserver((()=>{var e,n;this.getTitle()!==this.currentTitle&&(this.currentTitle=this.getTitle(),u.log("title changed",this.currentTitle),null===(e=t.onTitleChange)||void 0===e||e.call(t));this.getPathName()!==this.currentPath&&(this.currentHref=this.getHref(),this.currentPath=this.getPathName(),u.log("location also changed",this.currentHref,this.currentPath),null===(n=t.onUrlChange)||void 0===n||n.call(t))})),this.observer.observe((0,a.getPageWindow)().document,{subtree:!0,childList:!0}),(0,l.addListener)(window,"beforeunload",this.disconnect),(0,l.addListener)(window,"jBeforeunload",this.disconnect))}return(0,o.default)(e,[{key:"getTitle",value:function(){return(0,a.getPageWindow)().document.title}},{key:"getHref",value:function(){return(0,a.getPageWindow)().location.href}},{key:"getPathName",value:function(){return(0,a.getPageWindow)().location.pathname}},{key:"disconnect",value:function(){var e;null===(e=this.observer)||void 0===e||e.disconnect()}}]),e}();t.Observer=c},16500:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(21951),s=n(32183);const l=r(n(4855)).default.name("PageVisibilityManager");var u=new(function(){function e(){(0,i.default)(this,e),this.pageVisible=(0,s.pageVisible)(),this.subscribers=[],(0,a.listenVisibility)((()=>{this.pageVisible=(0,s.pageVisible)(),l.log("Page visibility changed to:",this.pageVisible),this.fireSubscriptions(this.pageVisible)}))}return(0,o.default)(e,[{key:"fireSubscriptions",value:function(e){this.subscribers.forEach((t=>{t(e)}))}},{key:"subscribe",value:function(e){this.subscribers.push(e)}},{key:"unsubscribe",value:function(e){this.subscribers=this.subscribers.filter((t=>{if(t!==e)return t}))}}]),e}());t.default=u},51094:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(26932),s=n(62168);const l=r(n(4855)).default.name("PermissionManager");var u=function(){function e(){(0,i.default)(this,e),this.allowedMics=[],this.allMics=[],this.allSpeakers=[],this.getAllDevices()}return(0,o.default)(e,[{key:"checkAudio",value:async function(){if(!navigator.mediaDevices)return l.warn("can't check mic access - old browser"),a.permissionsDispatchers.updatePermission(s.Permission.AUDIO,s.PermissionStatus.BLOCKED),s.PermissionStatus.BLOCKED;{await this.getAllDevices(),l.log("start check mic access");let e=null;try{e=await navigator.mediaDevices.getUserMedia({audio:!0}),l.log("mic is allowed");const t=e.getTracks();return t.forEach((e=>e.stop())),this.allowedMics=t,a.permissionsDispatchers.updatePermission(s.Permission.AUDIO,s.PermissionStatus.ALLOWED),s.PermissionStatus.ALLOWED}catch(e){return l.warn("mic is not allowed",e),a.permissionsDispatchers.updatePermission(s.Permission.AUDIO,s.PermissionStatus.BLOCKED),s.PermissionStatus.BLOCKED}}}},{key:"getAllDevices",value:async function(){if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices){const e=await navigator.mediaDevices.enumerateDevices();this.allMics=e.filter((e=>"audioinput"===e.kind)),this.allSpeakers=e.filter((e=>"audiooutput"===e.kind))}}}]),e}();t.default=u},50216:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(96394),s=n(83170),l=r(n(4855)),u=n(26932),c=n(64123),d=n(95911),f=n(23267),p=n(62096),h=n(54415),g=n(49963);const _=l.default.name("RecaptchaManager");let m=null,v=function(){function e(t){(0,i.default)(this,e),this.token=t,this.recaptchaWidgetIndex=null,this.grecaptcha=null,this.blocked=null,m=this}return(0,o.default)(e,[{key:"isBlocked",value:function(){return this.blocked}},{key:"addRecaptchaToPage",value:function(){_.log("Insertion of reCaptcha code",this.token);const e=(0,f.getPageWindow)(),t=e.document.head,n=e.document.createElement("script");n.async=!0,n.src="//google.com/recaptcha/api.js?render=explicit&onload=jivo_onRecaptchaLoadCallback",e.jivo_onRecaptchaLoadCallback=this.onLoadCallback.bind(this),t.appendChild(n)}},{key:"onLoadCallback",value:function(){_.log("onLoadCallback"),this.grecaptcha=(0,f.getPageWindow)().grecaptcha,this.recaptchaWidgetIndex=this.grecaptcha.render({sitekey:this.token,badge:"bottomleft"}),g.connectionAdapter.openConnect()}},{key:"getGRecaptchaToken",value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.action;return _.log("getGRecaptchaToken: request token"),this.grecaptcha.execute(this.recaptchaWidgetIndex,{action:t})}},{key:"getJivoAntispamToken",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"startup";_.log("getJivoAntispamToken",n),this.grecaptcha.ready((()=>{_.log("GRECAPTCHA READY: Request token"),this.getGRecaptchaToken({action:n}).catch((e=>{this.onTokenFailure(e,t)})).then((n=>{this.onTokenSuccess(n,e,t)}))}))}},{key:"getRecaptchaHandleUrl",value:function(e){const t=p.reduxStore.getState(),n=(0,a.getConfig)(),r=n.base_url,i=n.widget_id;return(0,f.getProtocol)()+r+`/script/recaptcha-token/${encodeURIComponent(i)}?visitor_id=${encodeURIComponent(t.client.visitorId)}&token=${encodeURIComponent(e)}`}},{key:"onTokenSuccess",value:function(e,t,n){e&&(_.log("JivoAntispamToken REQUEST SUCCESS: GRecaptcha token received",e),d.xhrRequest.get(this.getRecaptchaHandleUrl(e),((e,r)=>{if(e)return h.Monitoring.telemetry(s.TelemetryName.RECAPTCHA_ERROR,{param1:"Server error: "+JSON.stringify(e)});const i=r.data;return i.ok&&i.token?(u.clientDispatchers.setCaptchaToken(i.token),h.Monitoring.telemetry(s.TelemetryName.RECAPTCHA_SUCCESS,{param1:i.score}),_.log("Recaptcha request is successful"),t&&t()):i.ok?void 0:(h.Monitoring.telemetry(s.TelemetryName.RECAPTCHA_FAILURE,{param1:i.score,param2:null===(o=i.reason)||void 0===o?void 0:o.join(",")}),_.log("Recaptcha request is unsuccessful"),this.block(),setTimeout((()=>{(0,c.enableRecaptchaAntispam)()}),1500),n&&n());var o})))}},{key:"onTokenFailure",value:function(e,t){_.log("Execution error",e),h.Monitoring.telemetry(s.TelemetryName.RECAPTCHA_ERROR,{param1:"Client error: "+JSON.stringify(e)}),t&&t(e)}},{key:"block",value:function(){this.blocked=!0}}],[{key:"getInstance",value:function(){return m}}]),e}();var y=v;t.default=y},75686:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664));var a=new(function(){function e(){(0,i.default)(this,e),this.refs={},this.observers={}}return(0,o.default)(e,[{key:"set",value:function(e,t){e&&t&&(this.refs[e]=t,this._fire(e))}},{key:"get",value:function(e){if(e&&this.refs[e])return this.refs[e].base?this.refs[e].base:this.refs[e]}},{key:"getComponent",value:function(e){return this.refs[e]}},{key:"subscribe",value:function(e,t){this.observers[e]||(this.observers[e]=[]),this.observers[e].push(t)}},{key:"unsubscribe",value:function(e,t){this.observers[e]=this.observers[e].filter((e=>{if(e!==t)return e}))}},{key:"_fire",value:function(e){this.observers[e]||(this.observers[e]=[]),this.observers[e].forEach((e=>{e()}))}}]),e}());t.default=a},46902:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.AudioBufferStore=void 0;var i=r(n(33119)),o=r(n(92664));const a=new(function(){function e(){(0,i.default)(this,e),this.audioBuffers={},this.mp3BuffersLengths={notification:5808,agent_message:3760,outgoing_message:5014},this.oggBufferLengths={notification:6140,agent_message:6464,outgoing_message:7165}}return(0,o.default)(e,[{key:"set",value:function(e,t){this.audioBuffers[e]=t}},{key:"get",value:function(e){return this.audioBuffers[e]||null}},{key:"getReadyAudioBuffersCount",value:function(){return Object.keys(this.audioBuffers).length}},{key:"getReferenceBufferLength",value:function(e,t){switch(t){case"mp3":return this.mp3BuffersLengths[e];case"ogg":return this.oggBufferLengths[e]}}}]),e}());t.AudioBufferStore=a},39933:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLAudioSoundManager=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(7819)),s=r(n(84827)),l=r(n(85299)),u=r(n(55536)),c=n(14433),d=n(21951),f=n(54415),p=r(n(19955)),h=r(n(75686)),g=n(70859);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}const m=r(n(4855)).default.name("HTMLAudioSoundManager");let v=function(e){(0,s.default)(n,e);var t=_(n);function n(e){var r;let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.default)(this,n),(r=t.call(this,e,o)).touchListenerTimeout=null,r.soundNodes={},r._windowOnClicked,r._mobileHackHandler=r._mobileHackHandler.bind((0,a.default)(r)),r}return(0,o.default)(n,[{key:"initSoundPlayer",value:function(){m.log("Initialization started"),this.disabled||(this.soundNodes={agent_message:h.default.get(g.Component.SOUND_AGENT_MESSAGE),notification:h.default.get(g.Component.SOUND_NOTIFICATION),outgoing_message:h.default.get(g.Component.SOUND_OUTGOING_MESSAGE)},p.default.mobileOrTablet()&&this._addHackListeners([window.parent,window],"click",this._mobileHackHandler))}},{key:"play",value:function(e,t){if(this.disabled)return void m.log(`Cannot play sound "${e}". SoundManager is disabled.`);const n=this.soundNodes[e];if(n&&void 0!==n.play)try{(p.default.ios()||p.default.safari())&&n.load();const r=n.play();this._promisesSupported(r)?t?r.then((()=>{this._pause(e)})):r.catch((t=>{this.touchListenerTimeout||(this._windowOnClicked=this._windowOnClicked.bind(this,e),p.default.mobileOrTablet()&&this._removeHackListeners([window.parent,window],"click",this._mobileHackHandler),this._addHackListeners([window.parent,window],"click",this._windowOnClicked),this.touchListenerTimeout=setTimeout((()=>{this._removeHackListeners([window.parent,window],"click",this._windowOnClicked)}),3e3))})).then():t&&this._pause(e)}catch(e){f.Monitoring.reportException(e)}}},{key:"_pause",value:function(e){if(this.disabled)return;const t=this.soundNodes[e];void 0!==t.pause&&t.pause()}},{key:"_promisesSupported",value:function(e){return("object"==typeof e||"function"==typeof e)&&e.then&&"function"==typeof e.then}},{key:"_windowOnClicked",value:function(e){this.play(e),clearTimeout(this.touchListenerTimeout),this._removeHackListeners([window.parent,window],"click",this._windowOnClicked),this.touchListenerTimeout=null}},{key:"_mobileHackHandler",value:function(){this._mobileHack(),this._removeHackListeners([window.parent,window],"click",this._mobileHackHandler)}},{key:"_mobileHack",value:function(){this.play(this.sounds[1],!0)}},{key:"_addHackListeners",value:function(e,t,n){e.forEach((e=>(0,d.addListener)(e,t,n)))}},{key:"_removeHackListeners",value:function(e,t,n){e.forEach((e=>(0,d.removeEvent)(e,t,n)))}}]),n}(c.SoundManagerBase);t.HTMLAudioSoundManager=v},21201:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.SoundDownloader=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(54415),s=n(97615),l=n(95911),u=n(69479),c=n(46902),d=r(n(4855)),f=n(45683);const p=d.default.name("SoundDownloader");let h=function(){function e(t){(0,i.default)(this,e),this.audioContext=t,this.soundValidator=new u.SoundValidator,this.exceptionReported=!1}return(0,o.default)(e,[{key:"downloadSounds",value:function(e,t){e.forEach((e=>{this.download(e,t)}))}},{key:"download",value:function(e,t){l.xhrRequest.get(this._getUrl(e,t),((n,r)=>{if(n)return this._handleDownloadError(n,e,t);const i=this.soundValidator.validate(e,t,r.data);if(i.success)this._decodeBuffer(r.data,e,t);else if(i.error){this._fallback(e,t)||(a.Monitoring.telemetryWithProbability("sound_fallback",{param1:e,param2:t,param3:"validation"},5),p.warn(i.error))}}),{responseType:"arraybuffer"})}},{key:"_getUrl",value:function(e,t){const n=(s.EnvironmentManager.isDevelopment()?"/public":"")+`/sounds/${e}.`;return(0,f.getStaticURL)(n+t)}},{key:"_decodeBuffer",value:function(e,t,n){this.audioContext.decodeAudioData(e,(e=>{c.AudioBufferStore.set(t,e)}),(e=>{this._handleDecodeBufferError(e,t,n)}))}},{key:"_handleDownloadError",value:function(e,t,n){this._fallback(t,n)||(a.Monitoring.telemetryWithProbability("sound_fallback",{param1:t,param2:n,param3:"download"},5),p.warn(`Error downloading arrayBuffer for sound "${t}.${n}". Reason: ${e.code} ${e.text}`))}},{key:"_handleDecodeBufferError",value:function(e,t,n){this._fallback(t,n)||(a.Monitoring.telemetryWithProbability("sound_fallback",{param1:t,param2:n,param3:"decode"},5),p.warn(`Error decoding arrayBuffer for sound "${t}.${n}". Reason: ${e}`))}},{key:"_fallback",value:function(e,t){const n=this._getFallbackExtension(t);return!!n&&(a.Monitoring.telemetryWithProbability("sound_fallback",{param1:e,param2:t,param3:"fallback"},5),this.download(e,n),!0)}},{key:"_getFallbackExtension",value:function(e){return"mp3"===e?"ogg":null}},{key:"_reportErrorMessageOnce",value:function(e){this.exceptionReported||(a.Monitoring.reportException(e),this.exceptionReported=!0)}}]),e}();t.SoundDownloader=h},14433:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.SoundManagerBase=void 0;var i=r(n(33119)),o=r(n(92664));const a=r(n(4855)).default.name("SoundManagerBase");let s=function(){function e(t,n){(0,i.default)(this,e),this.disabled=n,this.sounds=t}return(0,o.default)(e,[{key:"initSoundPlayer",value:function(){a.log("initSoundPlayer method is NOT implemented!")}},{key:"enableSoundPlayer",value:function(){this.disabled=!1}},{key:"disableSoundPlayer",value:function(){this.disabled=!0}},{key:"play",value:function(e){a.log("play method is NOT implemented!")}}]),e}();t.SoundManagerBase=s},69479:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.SoundValidator=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(46902);let s=function(){function e(){(0,i.default)(this,e)}return(0,o.default)(e,[{key:"validate",value:function(e,t,n){let r;return n?n instanceof ArrayBuffer?this._isValidBufferLength(e,t,n)?{success:!0,error:null}:(r=new Error(`ArrayBuffer byteLength for sound "${e}.${t}" is ${n.byteLength}, should be ${a.AudioBufferStore.getReferenceBufferLength(e,t)}.`),{success:!1,error:r}):(r=new Error(`ArrayBuffer for sound "${e}.${t}" is not an instance of ArrayBuffer.`),{success:!1,error:r}):(r=new Error(`No arrayBuffer for sound "${e}.${t}"`),{success:!1,error:r})}},{key:"_isValidBufferLength",value:function(e,t,n){return n.byteLength===a.AudioBufferStore.getReferenceBufferLength(e,t)}}]),e}();t.SoundValidator=s},50725:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.WebAudioSoundManager=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(84827)),s=r(n(85299)),l=r(n(55536)),u=n(14433),c=n(54415),d=r(n(19955)),f=r(n(4855)),p=n(21201),h=n(46902);function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}const _=f.default.name("WebAudioSoundManager");let m=function(e){(0,a.default)(n,e);var t=g(n);function n(e){var r;let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.default)(this,n),(r=t.call(this,e,o)).audioContext=null,r.soundDownloader=null,r}return(0,o.default)(n,[{key:"initSoundPlayer",value:function(){if(_.log("Initialization started"),this.disabled||this._checkIfIsInitialized())return;const e=d.default.firefox()?"ogg":"mp3";this.audioContext=this._createAudioContext(),this.soundDownloader=new p.SoundDownloader(this.audioContext),this.soundDownloader.downloadSounds(this.sounds,e)}},{key:"play",value:function(e){!this.disabled&&this._checkIfIsInitialized()?(this.audioContext||(_.log("AudioContext was created on play"),this.audioContext=this._createAudioContext()),"suspended"===this.audioContext.state?this.audioContext.resume().then((()=>{_.log("AudioContext was resumed"),this._startBufferAudio(e)})):this._startBufferAudio(e)):_.log(`Cannot play sound "${e}". SoundManager is either disabled or is not initialized.`)}},{key:"_createAudioContext",value:function(){_.log("Creating AudioContext");try{let e=window.AudioContext||window.webkitAudioContext;if(e){return new e}}catch(e){let t=new Error(`Exception during the creation of audio context. ${e.message}`);return c.Monitoring.reportException(t),this.disableSoundPlayer(),null}}},{key:"_startBufferAudio",value:function(e){let t=h.AudioBufferStore.get(e);if(t){let n=this.audioContext.createBufferSource();if(n)n.buffer=t,n.connect(this.audioContext.destination),n.start();else{let t=new Error(`Error creating buffer source for sound "${e}".`);c.Monitoring.reportException(t),this.disableSoundPlayer()}}else{let t=new Error(`Error there is no audiobuffer for sound "${e}".`);c.Monitoring.reportException(t),this.disableSoundPlayer()}}},{key:"_checkIfIsInitialized",value:function(){return this.sounds.length===h.AudioBufferStore.getReadyAudioBuffersCount()&&(this.soundDownloader=null,!0)}}]),n}(u.SoundManagerBase);t.WebAudioSoundManager=m},25528:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isSoundPlayerDisabled=void 0;var i=r(n(73687)),o=n(97490),a=r(n(19955)),s=n(44145),l=n(97615);t.isSoundPlayerDisabled=()=>a.default.operaMini()||(0,s.getApp)().route===o.Route.HIDDEN||i.default.get("is_blacklisted")||l.EnvironmentManager.isWidgetConstructor()||(0,s.getFeatures)().disableSounds},71277:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isSoundDisabled=t.default=t.WebAudioDisabled=t.Sounds=void 0;var i=r(n(19955)),o=n(50725),a=n(39933),s=n(25528);const l=["agent_message","notification","outgoing_message"];t.Sounds=l;const u=!function(){if(!i.default.mobileOrTablet()||!window.AudioContext&&!window.webkitAudioContext||i.default.ieOrEdge())return!1;{const e=window.AudioContext||window.webkitAudioContext;try{return(new e).close(),!0}catch(e){return!1}}}();t.WebAudioDisabled=u;const c=(0,s.isSoundPlayerDisabled)();t.isSoundDisabled=c;var d=u?new a.HTMLAudioSoundManager(l,c):new o.WebAudioSoundManager(l,c);t.default=d},22541:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(23267),s=n(20344);const l=r(n(4855)).default.name("TitleManager");var u=new(function(){function e(t,n){(0,i.default)(this,e),this.originalTitle=t,this.jivoTitle=n,this.titleShown=!1,this.timer=null}return(0,o.default)(e,[{key:"getTitle",value:function(){return(0,a.getPageWindow)().document.title}},{key:"startBlinking",value:function(){clearInterval(this.timer),this.timer=setInterval((()=>{let e;this.titleShown?e=this.originalTitle:(this.originalTitle=this.getTitle(),e=this.jivoTitle),this.changeTitle(e),this.titleShown=!this.titleShown}),1e3)}},{key:"stopBlinking",value:function(){clearInterval(this.timer);const e=this.getTitle();e!==this.originalTitle&&e!==this.jivoTitle&&(this.originalTitle=e),this.changeTitle(this.originalTitle),this.titleShown=!1}},{key:"changeTitle",value:function(e){(0,a.getPageWindow)().document.title=e,l.log("Title changed to:",e)}}]),e}())((0,a.getPageWindow)().document.title,(0,s.l10n)("lblNewMessage"));t.default=u},49594:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteMessagesFromHistory=E,t.updateEditedMessages=C,t.updateHistory=function(e){const t=(0,m.getApp)(),n=t.lastMsgId,r=t.started,o=!!e.jv_client_id,T=e.last_msg_id&&n!==e.last_msg_id;b.log("updateHistory",e),o&&T&&function(e,t){b.log("getMsgHistory",e);const n=(new Date).getTime();l.default.getHistoryMessages("messages",{},((r,i)=>{if(r)return function(e,t,n){b.log("handleError",e),t();const r=Math.round(((new Date).getTime()-n)/1e3);c.Monitoring.telemetry(h.TelemetryName.API_GET_MESSAGES_ERROR,{param1:r,param2:(0,m.getSystemSettings)().chatHost}),r>=3&&c.Monitoring.telemetry(h.TelemetryName.API_GET_MESSAGES_ERROR_TIMEOUT,{param1:r,param2:(0,m.getSystemSettings)().chatHost})}(r,t,n);const o=i.data;if(b.log("receive new history",o),v.default.getInstance().saveMessageHistory("lastMessageHistoryRequest",i),o.result){const n=o.result;!function(e){b.log("setWidgetStatus",e);const t=(0,m.getUserSettings)().departments;d.appDispatchers.setChatStarted(e||!1),e||(s.default.closeChat(),d.appDispatchers.setChatAccepted(!1),d.clientDispatchers.updateClient({departmentId:null}),t&&(y.Router.setNext(_.Route.DEPARTMENTS),d.appDispatchers.setAppRoute(_.Route.DEPARTMENTS)))}(n.chat_opened),function(e,t,n){if(b.log("handleMessages",e),e&&e.length){const r=function(){b.log("getLastMessage");const e=s.default.filter((e=>{const t=e.get("from");return(t===u.MessageInitiator.CLIENT||t===u.MessageInitiator.AGENT)&&e.get("msg_id")}));return e[e.length-1]}(),i=function(e){b.log("getLastMessageId",e);let t=e?e.get("msg_id"):null;e||(e=s.default.getLastProactive())&&(t=e.get("msg_id"));return t}(r),o=e.filter((e=>{const t=(0,a.filterMessage)(e);return e.type===u.MessageType.PROACTIVE&&r&&r.get("type")===u.MessageType.PROACTIVE&&r.destroy(),t&&i!==e.msg_id}));if(o.forEach((e=>{if(e.deleted)e.status=u.MessageStatus.DELETED;else{b.log("add item from history",e);const t=1e3*e.created_ts,n=1e3*e.updated_ts;e.created_ts=t,e.updated_ts&&(e.updated_ts=n),e.status=e.status?e.status:u.MessageStatus.DELIVERED,e.status===u.MessageStatus.SEEN&&(e.status=u.MessageStatus.READ),e.type===u.MessageType.EMAIL&&(e.type=u.MessageType.MESSAGE),e.media&&(e.media.status=u.MediaStatus.COMPLETE)}})),"resume_ok"===n&&!p.default.mobileOrTablet()&&o.length&&(0,g.openChatOnMessage)({fromHistory:!0}),d.messagesDispatchers.addMessages(o),t){const t=!!o.length;let n=(t?o:e).slice(-1)[0],r=n.chat_id,i=n.created_ts;t||(i*=1e3),(0,g.needToRateForm)(r,i)}c.Monitoring.telemetry(h.TelemetryName.API_GET_MESSAGES_RECEIVED,{param1:(0,m.getSystemSettings)().chatHost})}}(n.messages,n.chat_rate_requested,e.name),E(n.messages),C(n.messages),e&&d.appDispatchers.setLastMsgId(e.last_msg_id),t(n)}else b.error("Empty history data"),t()}))}(e,(()=>{}));r||i.cssLoader.subscribe((()=>{f.default.getInstance().start()}),(()=>{f.default.getInstance().stop()}))};var i=n(33180),o=r(n(4855)),a=n(96879),s=r(n(14264)),l=r(n(86961)),u=n(81152),c=n(54415),d=n(26932),f=r(n(35802)),p=r(n(19955)),h=n(83170),g=n(15787),_=n(97490),m=n(44145),v=r(n(22866)),y=n(21476);const b=o.default.name("MessageHistory");function E(e){const t=e.filter((e=>e.deleted));t.length&&t.forEach((e=>{const t=s.default.getMessageById(e.msg_id);t&&t.set({status:u.MessageStatus.DELETED,type:u.MessageType.MESSAGE,body:null})}))}function C(e){const t=e.filter((e=>!e.deleted));t.length&&t.forEach((e=>{const t=s.default.getMessageById(e.msg_id);t&&e.updated_ts&&(b.warn("message edited: ",t.toJSON()),t.set({updated_ts:1e3*e.updated_ts,text:e.text}))}))}},54415:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.Monitoring=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(75048),s=n(97615),l=n(67597),u=n(83170),c=n(44733);let d=function(){function e(){(0,i.default)(this,e),this.reportedTelemetry={},this.provider=new a.MonitoringProvider}return(0,o.default)(e,[{key:"init",value:function(){window.onerror=(e,t,n,r,i)=>{!i&&(i={}),(window||arguments||"function"==typeof this.reportException)&&this.reportException({message:e,lineNumber:n,fileName:(0,l.getBundleSrc)()+"&v="+s.EnvironmentManager.getVersion(),columnNumber:r,stack:JSON.stringify(i.stack||i.stacktrace||i)})};const e=t=>{const n=this.reportedTelemetry[u.TelemetryName.CHAT_INVITE]||this.reportedTelemetry[u.TelemetryName.OFFLINE_INVITE];t.persisted||!n||c.StorageProvider.get("hide_reported")||(c.StorageProvider.set("hide_reported",!0),this.telemetryOnce(u.TelemetryName.PAGE_HIDE,{param1:"has_proactive"})),window.removeEventListener("pagehide",e)};window.addEventListener("pagehide",e,!1)}},{key:"reportException",value:function(e){this.provider.reportException(e)}},{key:"telemetry",value:function(e,t){this.provider.telemetry(e,t),!0!==this.reportedTelemetry[e]&&(this.reportedTelemetry[e]=!0)}},{key:"telemetryOnce",value:function(e,t){!0!==this.reportedTelemetry[e]&&this.telemetry(e,t)}},{key:"telemetryWithProbability",value:function(e,t,n){this._invokeWithProbability((()=>{this.telemetry(e,t)}),n)}},{key:"_invokeWithProbability",value:function(e,t){Math.random()<=.01*t&&e()}},{key:"isTelemetryReported",value:function(e){return!0===this.reportedTelemetry[e]}},{key:"getTelemetryNames",value:function(){return u.TelemetryName}},{key:"reportStats",value:function(e,t){this.provider.reportStats(e,t)}}]),e}();const f=new d;t.Monitoring=f},75048:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.MonitoringProvider=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(4855)),s=r(n(19955)),l=r(n(22866)),u=n(97615),c=n(44145),d=n(31343),f=n(95911),p=n(23267),h=r(n(96394)),g=r(n(55908)),_=n(21733),m=n(79225),v=r(n(138)),y=n(58345),b=n(6211);const E=a.default.name("MonitoringProvider");let C=function(){function e(){(0,i.default)(this,e),this.lastTelemetry=[],this.errorSentCnt=0}return(0,o.default)(e,[{key:"isNotSearchSpider",value:function(){const e=navigator.userAgent.toLowerCase();return-1==e.search(/google/gi)&&-1==e.search(/\+http:\/\/yandex\.com\/bots/gi)&&-1==e.search(/\+http:\/\/www\.cloudflare\.com\/always-online/gi)&&-1==e.search(/linespider\//gi)}},{key:"reportException",value:function(e){if(l.default.getInstance()&&l.default.getInstance().saveException(e),!h.default.disable_error_reporting&&this.isNotSearchSpider()){if(++this.errorSentCnt>3)return;try{this.reportError(e)}catch(e){E.error(e.message)}}else E.warn("REPORT",e)}},{key:"reportError",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=`${(0,p.getProtocol)()}//${h.default.err_host}/widget`,r=(0,c.getClient)(),i=r.clientId,o={body:{widget:"true",widget_id:h.default.widget_id,widget_version:u.EnvironmentManager.getVersion(),level:t,url:this.getUrl(),client_id:i?i.split(".")[0]:null,lineNumber:e.lineNumber,fileName:e.fileName,column:e.columnNumber,full_message:this.getStack(e.message,e.stack),short_message:e.message,device:s.default.getDevice(),shard:this.getShard()},headers:{"Content-Type":d.CONTENT_TYPE.APP_JSON},responseType:"json",monitoring:!0};this.ignoreMessage(o.body.full_message,["chrome://internal","chrome-extension://"])||f.xhrRequest.post(n,((e,t)=>{E.warn("Error reported:",e,t)}),o)}},{key:"ignoreMessage",value:function(e,t){return Boolean(t.filter((t=>e.includes(t))).length)}},{key:"getUrl",value:function(){const e=(0,p.getPageWindow)().location;return e.protocol+"//"+e.host+e.pathname}},{key:"telemetry",value:function(e,t){if(!e||!(0,_.isString)(e))return void E.warn("EventName is empty");if(e=(0,m.replaceAll)(e," ","_"),this.saveTelemetry(e),h.default.disable_telemetry||!this.isNotSearchSpider())return;"object"==typeof t&&t||(t={});const n=(0,c.getClient)();t.event=e,t.widget_id=h.default.widget_id,t.chat_mode=h.default.chat_mode,t.site_id=h.default.site_id,t.device=s.default.getDevice(),t.visitor_id=n.visitorId,t.widget_version=u.EnvironmentManager.getVersion(),t.shard=this.getShard();const r=g.default.getInstance();r&&r.getActiveTest()&&(t.abtest_name=r.getActiveTestName(),t.abtest_group=r.getActiveTestGroup()),n.clientId&&(t.client_id=parseInt(n.clientId.split(".")[0])||0);for(let e=1;e<5;e++){const n=t[`param${e}`];null!=n&&n.toString&&(t[`param${e}`]=n.toString())}E.log("TELEMETRY",t);try{let e=(0,p.getProtocol)();h.default.telemetry_host&&(e+="//"+h.default.telemetry_host+"/w"),window.navigator.sendBeacon&&navigator.sendBeacon(e,JSON.stringify(t))}catch(e){E.warn(e)}}},{key:"saveTelemetry",value:function(e){5===this.lastTelemetry.length&&this.lastTelemetry.shift(),this.lastTelemetry.push(e.substr(0,60))}},{key:"getStack",value:function(e,t){if("Script error."==e)return t;const n=a.default.lastLog.join("\r\n");return"{}"!=t&&""!=t&&t?"Uncaught TypeError: undefined is not a function"==e||"t.set is not a function"==e||"Uncaught TypeError: Cannot read property 'set' of undefined"==e?`${t} \r\n ${n}`:t.replace(/(?:\\[n])+/,"\r\n"):`Custom stack: \r\n${n}\r\n\r\n${this.lastTelemetry.join("\r\n")}`}},{key:"getShard",value:function(){return h.default.shard_id||"main"}},{key:"getStatsUrl",value:function(e,t,n){const r=(0,c.getSystemSettings)(),i=r.siteId,o=r.widgetId,a=r.baseUrl,s=n?"":`${t}/`;return`${(0,p.getProtocol)()}${a}/script/stat/campaign/${e}/${i}/${s}${o}`}},{key:"reportStats",value:function(e,t){if(e&&(0,_.isString)(e)){if(this.isNotSearchSpider()){E.log("stats",e,t);try{const n=["visit"].includes(e),r=this.getStatsUrl(e,t,n);if(n&&Array.isArray(t)){const n=t;(0,y.chunkArray)(n,b.Limits.STATS_CHUNK_LIMIT).forEach((e=>{this.postCampaignStats(r,e)})),"visit"===e&&n.forEach((t=>{v.default.reportCampaign(e,t)}))}else this.postCampaignStats(r,t),v.default.reportCampaign(e,t)}catch(e){E.warn(e)}}}else E.warn("EventName is empty")}},{key:"postCampaignStats",value:function(e,t){Array.isArray(t)&&(e+="?",t.forEach(((n,r)=>{e+=`ids[]=${n}`,t.length!==r+1&&(e+="&")}))),f.xhrRequest.get(e,(()=>{}),{responseType:"json"})}}]),e}();t.MonitoringProvider=C},74890:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={init:function(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(window.document||window.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1}),Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}return null})}};t.default=n},2833:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(4855)),s=n(54415),l=r(n(86961)),u=n(44145),c=n(83170),d=n(35967),f=n(73422);const p=a.default.name("Proactive");var h=new(function(){function e(){(0,i.default)(this,e),this.agents=null,this.departments=null,this.proactiveDepartmentId=null}return(0,o.default)(e,[{key:"getActiveAgent",value:function(e,t){p.log("getActiveAgent"),t&&(this.proactiveDepartmentId=t),l.default.getStatus(((t,n)=>{this.parseStatus(t,n,e)}))}},{key:"parseStatus",value:function(e,t,n){if(e)return s.Monitoring.telemetry(c.TelemetryName.WIDGET_STATUS,{param1:e.code}),this.agents=null,this.departments=null,n(!1);const r=(0,u.getClient)(),i=r.assignedAgentId||r.priorityAgentId;n(this.getAgent(t.data,i,this.proactiveDepartmentId))}},{key:"getAgent",value:function(e,t,n){const r=e.departments;if(p.log("parseStatus",e,t,n),e.bots)return e.bots[0];if(this.agents=e.bots||e.agents,this.departments=r,this.agents.length){if(n&&(0,f.isObject)(r)&&n in r){const e=this.departments[n],r=this.getOnlineAgentInDep(t,e.agents);if(r)return r;const i=this.getRandomOnlineAgentFromDep(e.agents);return i||(p.log("no online agents from proactive department."),!1)}const e=this.getAgentById(t);if(e)return e;const i=this.getRandomAgent(this.agents.length-1);return i||!1}return!1}},{key:"getRandomAgent",value:function(e){return this.agents[this.randomInt(0,e)]}},{key:"randomInt",value:function(e,t){const n=e+Math.random()*(t+1-e);return Math.floor(n)}},{key:"getAgentById",value:function(e){return this.agents.find((t=>t.agent_id===e))}},{key:"getRandomAgentIdByArray",value:function(e){return e[1===e.length?0:this.randomInt(0,e.length-1)]}},{key:"getOnlineIds",value:function(){return this.agents.map((e=>e.agent_id))}},{key:"getOnlineInDep",value:function(e){const t=this.getOnlineIds();return(0,d.intersection)(t,e)}},{key:"getOnlineAgentInDep",value:function(e,t){const n=this.getOnlineInDep(t);if(n.length&&-1!==n.indexOf(e))return this.getAgentById(e)}},{key:"getRandomOnlineAgentFromDep",value:function(e){const t=this.getOnlineInDep(e);if(t.length){const e=this.getRandomAgentIdByArray(t);return this.getAgentById(e)}return!1}}]),e}());t.default=h},90361:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withLocator=void 0;var r=n(97615);t.withLocator=e=>e&&!r.EnvironmentManager.isProduction()?{"data-qa-id":e}:{}},21476:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.Router=void 0;var i=r(n(84633)),o=r(n(95003)),a=r(n(14264)),s=n(97490),l=n(80161),u=n(54415),c=n(83170),d=n(26932),f=r(n(75686)),p=n(2982),h=n(70859),g=r(n(71323)),_=n(47138),m=r(n(4855)),v=n(44145),y=n(43914),b=n(20676),E=r(n(61811)),C=n(8717);const T=m.default.name("Router"),D=new i.default({namespace:"ROUTER",initialState:(0,v.getApp)().route||o.default.route||s.Route.LABEL,eulaContext:{},debugClicks:0,clickTimer:null,getCurrentRoute:function(){return this.state},getPrevRoute:function(){return this.priorState},setNext:function(e){T.warn("setNext route:",e),this.transition(e)},getPrevEvent:function(){return this._priorAction},next:function(e,t){T.warn("next",e,"from",this.state),e&&this.handle(e,t)},_navToChat:function(){if((0,v.getCallback)().status==_.CallStatus.WAIT)return void this.transition(s.Route.CHAT_CALL);l.RouterUtils.showDepartmentsIfPossible()?this.transition(s.Route.DEPARTMENTS):this.transition(s.Route.CHAT)},_navToChatFromChatMin:function(){this.priorState===s.Route.CHAT_EULA&&!(0,v.getClient)().eulaAccepted?this.transition(s.Route.CHAT_EULA):this.transition(s.Route.CHAT)},_debugClicked:function(){clearTimeout(this.clickTimer),this.debugClicks++,this.debugClicks>7&&(this.debugClicks=0,this.transition(s.Route.DEBUG),u.Monitoring.telemetryOnce(c.TelemetryName.DEBUG_PANEL_OPENED)),this.clickTimer=setTimeout((()=>{this.debugClicks=0}),1e3)},states:{[s.Route.HIDDEN]:{_onEnter:function(){this.trigger("route_change",s.Route.HIDDEN);const e=E.default.getInstance();e&&e.destroy()}},[s.Route.LABEL]:{_onEnter:function(){this.trigger("route_change",s.Route.LABEL)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToCall]:function(){this.transition(s.Route.CALL)},[s.RouterEvent.ToChat]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.ApiOpen]:function(){this._navToChat()},[s.RouterEvent.Navigate]:function(){this._navToChat()},[s.RouterEvent.ToLabelInvitation]:function(){this.transition(s.Route.LABEL_INVITATION)},[s.RouterEvent.ToMobileMenu]:function(){this.transition(s.Route.MOBILE_MENU)},[s.RouterEvent.ToCallPopup]:function(){this.transition(s.Route.CALL_POPUP)},[s.RouterEvent.ToSocial]:function(){this.transition(s.Route.CHAT_SOCIAL)}},[s.Route.LABEL_INVITATION]:{_onEnter:function(){this.trigger("route_change",s.Route.LABEL_INVITATION)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToCall]:function(){this.transition(s.Route.CALL)},[s.RouterEvent.ApiOpen]:function(){this._navToChat()},[s.RouterEvent.Navigate]:function(){this._navToChat()},[s.RouterEvent.CloseWindow]:function(){this.transition(s.Route.LABEL)}},[s.Route.DEPARTMENTS]:{_onEnter:function(){this.trigger("route_change",s.Route.DEPARTMENTS)},[s.RouterEvent.CloseWindow]:function(){this.transition(s.Route.LABEL)},[s.RouterEvent.ToCall]:function(){b.platform.isMobileOrTablet?this.transition(s.Route.CALL):this.transition(s.Route.CHAT_CALL),u.Monitoring.telemetry(c.TelemetryName.CW_ONLINE_HEADER_BUTTON)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.Navigate]:function(){(0,C.shouldRedirectToIntroduce)()&&0===a.default.store.length?this.transition(s.Route.INTRODUCE):this._navToChat()},[s.RouterEvent.ToDebug]:function(){this._debugClicked()}},[s.Route.INTRODUCE]:{_onEnter:function(){this.trigger("route_change",s.Route.INTRODUCE)},[s.RouterEvent.Submit]:function(){l.RouterUtils.needToShowEula()?this.transition(s.Route.CHAT_EULA):(this.transition(s.Route.CHAT),this.trigger("submit_eula_success",s.Route.INTRODUCE))},[s.RouterEvent.ToCall]:function(){b.platform.isChatPage?this.transition(s.Route.CHAT_CALL):this.transition(s.Route.CALL)},[s.RouterEvent.CloseWindow]:function(){this.transition(l.RouterUtils.getRouteChatMin())},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToDebug]:function(){this._debugClicked()}},[s.Route.MOBILE_MENU]:{_onEnter:function(){this.trigger("route_change",s.Route.MOBILE_MENU)},[s.RouterEvent.ToCall]:function(){this.transition(s.Route.CALL)},[s.RouterEvent.CloseWindow]:function(){this.transition(s.Route.LABEL)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToChat]:function(){this._navToChat()},[s.RouterEvent.Navigate]:function(){(0,C.shouldRedirectToIntroduce)()?this.transition(s.Route.INTRODUCE):l.RouterUtils.showDepartmentsIfPossible()?this.transition(s.Route.DEPARTMENTS):this.transition(s.Route.CHAT)}},[s.Route.CHAT]:{_onEnter:function(){this.trigger("route_change",s.Route.CHAT)},[s.RouterEvent.Submit]:function(e){e&&e.from&&e.from!==this.state||(l.RouterUtils.needToShowEula()?(e&&(this.eulaContext={link:e.link,context:e.context}),this.transition(s.Route.CHAT_EULA)):this.trigger("submit_success"))},[s.RouterEvent.ToCall]:function(){b.platform.isMobileOrTablet?this.transition(s.Route.CALL):this.transition(s.Route.CHAT_CALL),u.Monitoring.telemetry(c.TelemetryName.CW_ONLINE_HEADER_BUTTON)},[s.RouterEvent.ToIntroduce]:function(){(0,C.shouldRedirectToIntroduce)()?this.transition(s.Route.INTRODUCE):this._navToChat()},[s.RouterEvent.ToSocial]:function(){this.transition(s.Route.CHAT_SOCIAL)},[s.RouterEvent.CloseWindow]:function(){this.transition(l.RouterUtils.getRouteChatMin())},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToEula]:function(e){e&&l.RouterUtils.needToShowEula()&&(this.eulaContext={link:e.link,context:e.context},this.transition(s.Route.CHAT_EULA))},[s.RouterEvent.ToDebug]:function(){this._debugClicked()},[s.RouterEvent.ToCallSetup]:function(){this.transition(s.Route.CHAT_SETUP_CALL)}},[s.Route.CHAT_MIN]:{_onEnter:function(){this.trigger("route_change",s.Route.CHAT_MIN)},[s.RouterEvent.ToChat]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.ToCall]:function(){this.transition(s.Route.CHAT_CALL)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ApiOpen]:function(){this._navToChatFromChatMin()},[s.RouterEvent.Navigate]:function(){this._navToChat()}},[s.Route.CHAT_EULA]:{_onEnter:function(){const e=this.eulaContext&&this.eulaContext.link?this.eulaContext.link:null,t=this.eulaContext&&this.eulaContext.context?this.eulaContext.context:"introduce";"cb"!==t&&D.getPrevRoute()!==s.Route.CHAT_CALL&&g.default.showEula(!0,e,t),this.eulaContext={},this.trigger("route_change",s.Route.CHAT_EULA)},[s.RouterEvent.Submit]:function(){const e=this.priorState;e?(this.trigger("submit_eula_success",D.getPrevRoute()),-1===[s.Route.INTRODUCE,s.Route.CHAT_MIN].indexOf(e)?this.transition(e):this.transition(s.Route.CHAT)):this.transition(s.Route.CHAT)},[s.RouterEvent.ToCall]:function(){b.platform.isMobileOrTablet?this.transition(s.Route.CALL):this.transition(s.Route.CHAT_CALL)},[s.RouterEvent.Cancel]:function(){this.priorState&&this.priorState!==s.Route.CHAT_MIN?this.transition(this.priorState):this.transition(s.Route.CHAT)},[s.RouterEvent.CloseWindow]:function(){!b.platform.isMobileOrTablet&&(0,v.getApp)().chatStarted&&(0,v.getApp)().isOnline?this.transition(s.Route.CHAT_MIN):this.transition(s.Route.LABEL)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToDebug]:function(){this._debugClicked()}},[s.Route.CHAT_SOCIAL]:{_onEnter:function(){this.trigger("route_change",s.Route.CHAT_SOCIAL)},[s.RouterEvent.Submit]:function(){this.transition(s.Route.LABEL)},[s.RouterEvent.ToChat]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.ToCall]:function(){this.transition(s.Route.CALL)},[s.RouterEvent.Cancel]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.CloseWindow]:function(){this.transition(l.RouterUtils.getRouteChatMin())},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToEula]:function(e){e&&l.RouterUtils.needToShowEula()&&(this.eulaContext={link:e.link,context:e.context},this.transition(s.Route.CHAT_EULA))},[s.RouterEvent.ToDebug]:function(){this._debugClicked()}},[s.Route.CHAT_CALL]:{_onEnter:function(){this.trigger("route_change",s.Route.CHAT_CALL)},[s.RouterEvent.Submit]:function(){l.RouterUtils.needToShowEula()?this.transition(s.Route.CHAT_EULA):this.trigger("submit_success")},[s.RouterEvent.ToCall]:function(){const e=D.getPrevRoute();e&&this.transition(-1===[s.Route.CHAT_MIN,s.Route.CHAT_EULA].indexOf(e)?e:s.Route.CHAT)},[s.RouterEvent.ToSocial]:function(){this.transition(s.Route.CHAT_SOCIAL)},[s.RouterEvent.Cancel]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.CloseWindow]:function(){this.transition(l.RouterUtils.getRouteChatMin())},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToChat]:function(){this._navToChat()},[s.RouterEvent.ToEula]:function(e){e&&l.RouterUtils.needToShowEula()&&(this.eulaContext={link:e.link,context:e.context},this.transition(s.Route.CHAT_EULA))},[s.RouterEvent.ToIntroduce]:function(){(0,C.shouldRedirectToIntroduce)()&&this.transition(s.Route.INTRODUCE)},[s.RouterEvent.ToDebug]:function(){this._debugClicked()}},[s.Route.CHAT_SETUP_CALL]:{_onEnter:function(){this.trigger("route_change",s.Route.CHAT_SETUP_CALL)},[s.RouterEvent.Cancel]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.Submit]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToDebug]:function(){this._debugClicked()},[s.RouterEvent.CloseWindow]:function(){l.RouterUtils.isChatMinAvailable()?this.transition(s.Route.CHAT_MIN):this.transition(s.Route.LABEL)}},[s.Route.CALL]:{_onEnter:function(){this.trigger("route_change",s.Route.CALL)},[s.RouterEvent.Submit]:function(){l.RouterUtils.needToShowEula()?this.transition(s.Route.CALL_EULA):this.trigger("submit_success")},[s.RouterEvent.ToEula]:function(){this.transition(s.Route.CALL_EULA)},[s.RouterEvent.CloseWindow]:function(){l.RouterUtils.isChatMinAvailable()?this.transition(s.Route.CHAT_MIN):this.transition(s.Route.LABEL)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToChat]:function(){this._navToChat()},[s.RouterEvent.ToDebug]:function(){this._debugClicked()}},[s.Route.CALL_EULA]:{_onEnter:function(){this.trigger("route_change",s.Route.CALL_EULA)},[s.RouterEvent.Submit]:function(){if(D.getPrevRoute()===s.Route.CALL)return this.transition(s.Route.CALL),void this.trigger("submit_eula_success",D.getPrevRoute());this.trigger("submit_success")},[s.RouterEvent.Cancel]:function(){d.appDispatchers.setShowEula(!1),this.transition(s.Route.CALL)},[s.RouterEvent.ToChat]:function(){this.transition(s.Route.CHAT)},[s.RouterEvent.CloseWindow]:function(){d.appDispatchers.setShowEula(!1),this.transition(s.Route.LABEL)},[s.RouterEvent.Hide]:function(){this.transition(s.Route.HIDDEN)},[s.RouterEvent.ToDebug]:function(){this._debugClicked()}},[s.Route.CALL_POPUP]:{_onEnter:function(){this.trigger("route_change",s.Route.CALL_POPUP)},[s.RouterEvent.Submit]:function(){this.transition(s.Route.CALL)},[s.RouterEvent.CloseWindow]:function(){l.RouterUtils.isChatMinAvailable()?this.transition(s.Route.CHAT_MIN):this.transition(s.Route.LABEL)}},[s.Route.DEBUG]:{_onEnter:function(){this.trigger("route_change",s.Route.DEBUG)},[s.RouterEvent.CloseWindow]:function(){this.transition(l.RouterUtils.getRouteChatMin())},[s.RouterEvent.ToChat]:function(){this._navToChat()},[s.RouterEvent.ToCall]:function(){b.platform.isMobileOrTablet?this.transition(s.Route.CALL):this.transition(s.Route.CHAT_CALL),u.Monitoring.telemetry(c.TelemetryName.CW_ONLINE_HEADER_BUTTON)}}}});t.Router=D,D.on("route_change",(e=>{if(d.appDispatchers.setAppRoute(e),(0,y._callUserFunction)("onChangeState",e),b.platform.isSafari&&!b.platform.isMobileOrTablet){const t=D.getPrevRoute();(e===s.Route.DEBUG&&t===s.Route.INTRODUCE||e===s.Route.INTRODUCE&&t===s.Route.DEBUG||e==s.Route.INTRODUCE&&t===s.Route.CHAT||t===s.Route.CHAT_EULA||e===s.Route.CHAT_EULA)&&setTimeout((()=>{const e=f.default.get(h.Component.WIDGET_CONTAINER);(0,p.updateKeyframes)(e,!0)}),50)}}))},80161:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.RouterUtils=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(26754)),s=r(n(19955)),l=n(97490),u=r(n(96394)),c=n(47138),d=n(73422),f=n(44145);const p=new(function(){function e(){(0,i.default)(this,e)}return(0,o.default)(e,[{key:"showDepartmentsIfPossible",value:function(){const e=(0,f.getApp)(),t=(0,f.getClient)(),n=(0,f.getUserSettings)(),r=n.contactsAsk,i=n.departments;return 1===r?i&&(0,d.isNil)(t.departmentId)&&t.isIntroduced&&!a.default.agent_id&&!e.chatStarted&&e.isOnline:i&&(0,d.isNil)(t.departmentId)&&!a.default.agent_id&&!e.chatStarted&&e.isOnline}},{key:"needToShowEula",value:function(){return u.default.eula&&!(0,f.getClient)().eulaAccepted}},{key:"getRouteChatMin",value:function(){return this.isChatMinAvailable()?l.Route.CHAT_MIN:(0,f.getCallback)().status===c.CallStatus.CONNECTED?l.Route.CALL:l.Route.LABEL}},{key:"callbackEnabled",value:function(){const e=u.default.callback_settings;return!!(e.time&&e.countries&&e.countries.length)}},{key:"isChatMinAvailable",value:function(){const e=(0,f.getUserSettings)().labelBubble,t=a.default.agent_id||a.default.bot_id,n="join"==a.default.state;return(0,f.getApp)().chatAccepted&&(0,f.getApp)().isOnline&&t&&n&&!s.default.mobileOrTablet()&&(0,f.getCallback)().status!==c.CallStatus.CONNECTED&&!e}}]),e}());t.RouterUtils=p},13077:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.addPageView=function(){const e=o.default.get("pages_count");e?o.default.set("pages_count",parseInt(e)+1):o.default.set("pages_count",1)},t.checkCondition=A,t.checkTimeConditions=function(e,t,n){let r=!1;for(let i=0;i{const t=E("goalElementClick");y.warn("onGoalClick",t),t[window.btoa(e)]=e,C("goalElementClick",t)},i=s.default.mobileOrTablet()&&s.default.isTouchEnabled()?"touchstart":"click";n?(0,v.addListener)(n,i,r,!0):y.info(`Element with selector: "${e}" is not found on page.`)}catch(e){y.info("Error click element",e)}},t.isAllStaticChecked=function(e,t){const n=e.filter((e=>e.isChecked)),r=e.filter((e=>e.isStatic));return t===d.RuleType.ALL?r.length===n.length:Boolean(n.length)},t.isDefaultProactive=function(){if(!u.default.rules)return;const e=JSON.stringify([{value:!0,condition:d.RuleConditions.ONLINE},{value:10,condition:d.RuleConditions.TIME_ON_PAGE,comparator:"greater"},{value:120,condition:d.RuleConditions.TIME_AFTER_CLOSE,comparator:"greater"},{value:60,condition:d.RuleConditions.TIME_AFTER_INVITAION,comparator:"greater"}]);return u.default.rules.filter((t=>{if(t.conditions&&JSON.stringify(t.conditions)===e)return!0})).length>0},t.isGoalCondition=S,t.isPopupCommand=function(e){return-1!==[d.RuleTypes.PROACTIVE,d.RuleTypes.OPEN_OFFLINE,d.RuleTypes.SHOW_CALLFORM].indexOf(e)},t.isTimeCondition=function(e){return null==e?void 0:e.includes("time")},t.isYandexMarketClient=function(e){const t=1==a.default.get("visits_count"),n=o.default.get("pages_count")<10;return!s.default.mobileOrTablet()&&t&&n&&-1!==["market","YM"].indexOf(e.source)&&"cpc"==e.medium},t.setInvitationTime=function(){o.default.set("invitation_time",(new Date).getTime())},t.setRuleLocal=C,t.timeDiff=T;var i=n(4425),o=r(n(66547)),a=r(n(73687)),s=r(n(19955)),l=r(n(4855)),u=r(n(96394)),c=n(69882),d=n(83907),f=n(23267),p=n(73422),h=n(82024),g=n(26683),_=n(66139),m=n(44145),v=n(21951);const y=l.default.name("RuleManagerUtils"),b={scrollPosition:!1,movedToCloseButton:!1,firstMessageTime:null,pageEnterTime:(new Date).getTime(),prechatUseTime:null,lastUpdateProactiveEvent:null,lastContactApiData:null,sendStartupTime:null,isVisitorInvite:null,goalElementClick:{}};function E(e){if(e in b)return b[e]}function C(e,t){e in b&&(b[e]=t)}function T(e){return Math.round(((new Date).getTime()-e)/1e3)}function D(e){var t,n;const r=(0,c.getCurrentPage)().url,l=(new Date).getDay(),u=o.default.get("close_time"),f=o.default.get("invitation_time"),p=(0,m.getUserSettings)().chatMode,h=(0,m.getSystemSettings)().geoIp;switch(e){case d.RuleConditions.ONLINE:return p===i.ChatMode.ONLINE;case d.RuleConditions.PAGE_URL:return r.replace(/^http(s?):\/\//i,"");case d.RuleConditions.PAGE_TITLE:return(0,c.getCurrentPage)().title;case d.RuleConditions.HOUR:return(new Date).getHours();case d.RuleConditions.WEEK_DAY:return 0===l?7:l;case d.RuleConditions.TIME_AFTER_CLOSE:return u?T(u):Number.MAX_VALUE;case d.RuleConditions.TIME_AFTER_FIRST_MSG:return b.firstMessageTime?T(b.firstMessageTime.getTime()):NaN;case d.RuleConditions.TIME_AFTER_INVITAION:return null===f||""===f?Number.MAX_VALUE:T(f);case d.RuleConditions.TIME_ON_PAGE:return T(b.pageEnterTime);case d.RuleConditions.TIME_ON_SITE:return T(o.default.get("enter_ts"));case d.RuleConditions.NUMBER_OF_VISITS:return a.default.get("visits_count");case d.RuleConditions.PAGES_COUNT:return parseInt(o.default.get("pages_count"));case d.RuleConditions.COUNTRY:return null==h?void 0:h.split(";")[0];case d.RuleConditions.CITY:return(null==h?void 0:h.split(";")[2])||null;case d.RuleConditions.ONCE_A_DAY:return!0;case d.RuleConditions.UTM_SOURCE:return(null===(t=(0,m.getClient)().utm)||void 0===t||null===(n=t.source)||void 0===n?void 0:n.toLowerCase().trim().replace("/(|)/i",""))||d.UtmSource.DIRECT;case d.RuleConditions.DEVICE:return s.default.mobileOrTablet()?d.DeviceType.MOBILE:d.DeviceType.DESKTOP;default:return o.default.get(e)}}function w(e){const t=e.condition,n=e.value,r=e.attr;switch(t){case d.RuleConditions.GOAL_CLOSE:return b.movedToCloseButton;case d.RuleConditions.GOAL_SCROLL:return b.scrollPosition;case d.RuleConditions.GOAL_CLICK:return!!n&&b.goalElementClick[window.btoa(n)];case d.RuleConditions.GOAL_CUSTOM_ATTR:return!!n&&I(r)}}function S(e){return null==e?void 0:e.includes("goal")}function O(e){const t=e.match(/^(?:https?:)?(?:\/\/)?([^\/\?]+)/gi);if(t&&t.length){const n={href:e,hostname:t[0]};e=(0,c.getUnicodeHref)(n).replace(/http(|s):\/\//,"")}else e=e.replace(/http(|s):\/\//,"");return e}function A(e,t){const n=S(e.condition)?w(e):(0,h.isExternalDataCondition)(e)?(0,g.getExternalDataValue)(e):D(e.condition);e.condition===d.RuleConditions.PAGE_URL&&(e.value=O(e.value)),e.condition===d.RuleConditions.PAGES_COUNT&&(e.value=parseInt(e.value));const r=(0,_.compareCondition)(n,e.value,e.comparator);let i=`${t||""}; ${r?"success":"failed"}`;return i+=` condition ${e.condition}; comparator=${e.comparator}`,y.info(`${i}; expected=${e.value}; actual=${n}`),"once_a_day"==e.condition||r}const I=e=>{const t=(0,m.getClient)().customData;if(!t)return;const n=t.find((t=>t.key===e));return null==n?void 0:n.content};t.getCustomValue=I;t.getCondNames=e=>(0,p.isArray)(e)?e.map((e=>e.condition)).join(","):e},79868:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(96394)),o=r(n(4855)),a=n(83170),s=n(26932),l=r(n(73687)),u=r(n(19955)),c=n(97615),d=n(54415),f=n(44145),p=n(67597),h=n(21951),g=n(16217),_=n(45683);const m=o.default.name("Social"),v=new(0,n(89766).EventEmitter);let y={vk:!1,fb:!1,mode:!1},b=null,E=!1;const C={getSocial(){return b||y},setPopupMode(e){b=e,y.mode=b,s.socialDispatchers.initializeSocialStore(y),v.emit("update",y)},getPopupMode(){return b},setSocial(e){return y=e,y},isLoginned(){return y.vk||y.fb},getJoints(){let e=0;const t={};return(0,g.isCallbackEnabled)()?(t.callback=!0,e++):i.default.power_button_phone&&(t.cbUrl=i.default.power_button_phone,e++),i.default.joint?(i.default.joint.sb&&e++,i.default.joint.ig&&e++,i.default.joint.fb&&i.default.joint.fb.joint_id&&(t.fbUrl="https://m.me/"+i.default.joint.fb.joint_id,e++),i.default.joint.wa&&(t.waUrl=i.default.joint.wa.customUrl||"https://wa.me/"+i.default.joint.wa,e++),i.default.joint.vk&&(i.default.joint.vk.joint_id||i.default.joint.vk.customUrl)&&(t.vkUrl=i.default.joint.vk.customUrl?i.default.joint.vk.customUrl:"https://vk.me/club"+i.default.joint.vk.joint_id,e++),i.default.joint.vb&&i.default.joint.vb.botname&&(t.vbUrl="viber://pa?chatURI="+i.default.joint.vb.botname,e++),i.default.joint.tg&&(i.default.joint.tg.customUrl||i.default.joint.tg.botname)&&(t.tgUrl=i.default.joint.tg.customUrl?i.default.joint.tg.customUrl:(0,p.getTgLink)(i.default.geoip)+i.default.joint.tg.botname,e++),this.isImVersion()&&i.default.joint.im&&i.default.joint.im.joint_id&&(t.imUrl=`sms://open?service=iMessage&recipient=urn:biz:${i.default.joint.im.joint_id}&biz-intent-id=click_in_jivo`,e++),{links:t,count:e}):{links:t,count:e}},startSocials(){m.log("startSocials"),E||u.default.mobileOrTablet()||!i.default.joint||!i.default.joint.vk&&!i.default.joint.fb||l.default.get("is_blacklisted")||(E=!0,this.initSocial(),(0,h.addListener)(window,"message",this.checkLogin.bind(this),!1))},initSocial(){const e=this.checkSocial();if(m.log("initSocial",e),e){const t=this.genSocialIframeUrl(e)+"#rand="+(new Date).getMilliseconds()+",lang="+i.default.locale,n=document.createElement("iframe");n.src=t,n.className="iframe-social",n.title="JivoSocial",document.body.appendChild(n)}},checkSocial(){if(!i.default.joint)return;let e="check";i.default.joint.vk&&!i.default.joint.fb&&(e="checkvk"),i.default.joint.fb&&!i.default.joint.vk&&(e="checkfb");const t=document.getElementsByClassName("check-iframe");return!(t&&t.length>0)&&(!(!i.default.joint.vk&&!i.default.joint.fb)&&e)},genSocialIframeUrl(e){m.log("getnSocialIframeUrl",e);const t=["mode="+e],n=(0,f.getClient)();i.default.joint.vk&&(t.push("vk_app_id="+i.default.joint.vk.app_id),t.push("vk_joint_id="+i.default.joint.vk.joint_id),t.push("vk_key="+this.genVkRandomKey())),i.default.joint.fb&&(t.push("fb_app_id="+i.default.joint.fb.app_id),t.push("fb_joint_id="+i.default.joint.fb.joint_id),t.push("fb_key="+n.clientId+"_"+i.default.widget_id)),t.push("logs="+(i.default.logs||0));const r=c.EnvironmentManager.isDevelopment()?"/public/social.html?":"/social.min.html?";return(0,_.getStaticURL)(r+t.join("&"))},genVkRandomKey(){return((0,f.getClient)().clientId+"="+i.default.widget_id).replace(/./g,(function(e){return e.charCodeAt(0).toString(16)}))},getIframeUrl(e){return this.genSocialIframeUrl(e)+"#rand="+(new Date).getMilliseconds()+",lang="+i.default.locale},checkLogin(e,t){if(m.log("checkLogin",e,t),e&&"object"==typeof e){if(t&&(e={data:{social:t}}),e.data&&e.data.social){const t={},n=e.data.social;return n.fb&&(t.fb=!0,t.vk=!1,t.mode="fb",d.Monitoring.telemetryOnce(a.TelemetryName.SOCIAL_SHOW_FACEBOOK)),n.vk&&(t.vk=!0,t.fb=!1,t.mode="vk",d.Monitoring.telemetryOnce(a.TelemetryName.SOCIAL_SHOW_VK)),n.fb||n.vk||(t.vk=!1,t.fb=!1,t.mode="email"),y={vk:t.vk,fb:t.fb,mode:t.mode},v.emit("update",y),s.socialDispatchers.initializeSocialStore(y),t}}else m.log("postMessage from social failed: ",e)},isImVersion(){return(u.default.ios()||u.default.ipad())&&u.default.iosVersion()>=11.3},ifIMessageEnabled(){const e=this.getJoints();return!!(this.isImVersion()&&e.links&&e.links.imUrl)}};var T=Object.assign(v,C);t.default=T},44145:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAgentById=l,t.getAgentIdsByStatus=function(e){return a().reduce(((t,n)=>(n.state===e&&t.push(n.id),t)),[])},t.getAgentMessages=f,t.getAgents=a,t.getApp=function(){return r.reduxStore.getState().app},t.getBotById=function(e){return s().find((t=>t.id===e&&t.isBot))},t.getBotIdsByStatus=function(e){return s().reduce(((t,n)=>(n.state===e&&t.push(n.id),t)),[])},t.getBots=s,t.getCallback=function(){return r.reduxStore.getState().callback},t.getCallbackSettings=function(){return r.reduxStore.getState().settings.user.callback},t.getCampaignWidgetSettings=function(){return r.reduxStore.getState().settings.campaignWidget},t.getChatById=function(e){return u().find((t=>t.id===e))},t.getChats=u,t.getClient=function(){return r.reduxStore.getState().client},t.getClientMessages=d,t.getFeatures=function(){return r.reduxStore.getState().settings.features},t.getFormIntroduceText=function(){return c().filter((e=>e.type===i.MessageType.PREFORM&&e.from===i.MessageInitiator.FORM))[0]},t.getFormMessage=function(){return p(c(),i.MessageType.FORM)[0]},t.getJoinedAgents=function(){const e=[],t=u();if(t&&t.length>0){const n=t[t.length-1];n.joinedAgents.forEach((t=>{e.push(l(t))}))}return e},t.getLastChatId=function(){const e=f(c()),t=d(c()),n=e.length?e[e.length-1].chat_id:null,r=t.length?t[t.length-1].chat_id:null;return r>n?r:n},t.getLastClientMessage=function(){const e=d(c());return e[e.length-1]},t.getLastMessageByName=function(e){const t=g(c(),e);return t[t.length-1]},t.getLastMessageByStatus=function(e){const t=h(c(),e);return t[t.length-1]},t.getLastMessageByType=function(e){const t=p(c(),e);return t[t.length-1]},t.getMessageById=function(e){return c().find((t=>t.msg_id===e))},t.getMessageByPrivateId=function(e){return c().find((t=>t.private_id===e))},t.getMessages=c,t.getMessagesByName=g,t.getMessagesByStatus=h,t.getMessagesByType=p,t.getPosition=function(){return r.reduxStore.getState().position},t.getProactive=function(){return r.reduxStore.getState().proactive},t.getRateFormMessage=function(){return p(c(),i.MessageType.RATE_FORM)[0]},t.getSettings=function(){return r.reduxStore.getState().settings},t.getState=function(){return r.reduxStore.getState()},t.getSystemSettings=function(){return r.reduxStore.getState().settings.system},t.getSystemUnread=function(){return c().filter((e=>e.from===i.MessageInitiator.AGENT&&e.status!==i.MessageStatus.READ&&(0,o.isAgentSystemMessage)(e.type)))},t.getTemporaryMessages=void 0,t.getTransition=function(){return r.reduxStore.getState().transition},t.getUnreadMessages=function(){return c().filter((e=>[i.MessageInitiator.AGENT,i.MessageInitiator.AGENT_BOT].includes(e.from)&&![i.MessageStatus.READ,i.MessageStatus.SEEN,i.MessageStatus.DELETED].includes(e.status)&&e.type!==i.MessageType.FOR_TEST&&!(0,o.isAgentSystemMessage)(e.type)))},t.getUserSettings=function(){return r.reduxStore.getState().settings.user},t.getZoom=function(){return r.reduxStore.getState().zoom};var r=n(62096),i=n(81152),o=n(79814);function a(){return r.reduxStore.getState().agents}function s(){return r.reduxStore.getState().bots}function l(e){return a().find((t=>t.id===e))}function u(){return r.reduxStore.getState().chats}function c(){return r.reduxStore.getState().messages}function d(e){return e.filter((e=>e.from===i.MessageInitiator.CLIENT))}function f(e){return e.filter((e=>e.from===i.MessageInitiator.AGENT))}function p(e,t){return e.filter((e=>e.type===t))}function h(e,t){return e.filter((e=>e.status===t))}function g(e,t){return e.filter((e=>{var n;return(null===(n=e.body)||void 0===n?void 0:n.name)===t}))}t.getTemporaryMessages=()=>c().filter((e=>e.type===i.MessageType.TEMPORARY&&e.from===i.MessageInitiator.CLIENT))},2982:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.updateKeyframes=t.setProperty=t.saveLabelPosition=t.jivoCustomCSSProperty=t.isFallbackNeeded=t.getSavedLabelPosition=t.getProperty=void 0;var i=r(n(61125)),o=r(n(4855)),a=r(n(19955)),s=n(21733);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const u=o.default.name("TransitionUtils"),c=e=>`--j${e}`;t.jivoCustomCSSProperty=c;const d=(e,t)=>t&&t.style?f()?t.style[e]:t.style.getPropertyValue(c(e)):null;t.getProperty=d;t.setProperty=(e,t,n)=>{f()?n.style[e]=t:n.style.setProperty(c(e),t)};t.updateKeyframes=(e,t)=>{if(a.default.supportsWebAnimationApi()){const n=d("height",e),r=d("left",e),i=d("right",e),o=e&&e.getAnimations()[0];if(a.default.safari()&&a.default.iosVersion()>="15.4"&&!o.effect.composite&&!t)return;const s=o&&o.effect.getKeyframes(),l=s&&s[s.length-1];u.log("updateKeyframes",o),l&&(l.height=n,l.left=r,l.right=i,o.effect.setKeyframes(s),o.currentTime=300)}};const f=()=>!a.default.supportsCssVariables()||a.default.ieOrEdge()||a.default.safari()&&(!a.default.supportsWebAnimationApi()||a.default.iosVersion()<15&&!a.default.mobileOrTablet());t.isFallbackNeeded=f;let p={};t.saveLabelPosition=e=>{p={right:e.right?e.right+"px":null,left:e.left?e.left+"px":null,offsetWidth:e.offsetWidth?e.offsetWidth+"px":null},(0,s.isString)(e.right)&&e.right.includes("%")&&(p.right=e.right)};t.getSavedLabelPosition=()=>function(e){for(var t=1;tt;case"greater_equal":return e>=t;case"lower":return e!(!e||!t)&&-1!==(null==e?void 0:e.toLowerCase().indexOf(null==t?void 0:t.toLowerCase()))},625:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getZoom=void 0;var r=n(20676),i=n(69882);t.getZoom=e=>r.platform.isChatPage?"none":(0,i.isWixContext)()?1:e},43914:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t._callUserFunction=function(e,t){if(l.log("_callUserFunction",e,t),e="jivo_"+e,"function"==typeof(0,s.getPageWindow)().window[e])try{l.log("JIVO: calling user function "+e),(0,s.getPageWindow)().window[e](t),l.log("JIVO: user function "+e+" returned"),a.Monitoring.telemetryWithProbability(e,{},i.RateLimit.Low)}catch(e){l.log("ERROR: _callUserFunction",e)}};var i=n(83170),o=r(n(4855)),a=n(54415),s=n(23267);const l=o.default.name("callParent")},41168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCallDefaultError=void 0;var r=n(20344);t.getCallDefaultError=()=>`${(0,r.l10n)("cw_unableToConnect")}\n${(0,r.l10n)("cw_errInfoText")}`},91763:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.lazyLoaderFactory=void 0,t.lazyRetry=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;return new Promise(((i,o)=>{t().then(i).catch((a=>{setTimeout((()=>{1!==n?e(t,n-1,r).then(i,o):o(a)}),r)}))}))};var i=r(n(67375)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(98661));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}const s=r(n(4855)).default.name("Lazy loader");t.lazyLoaderFactory=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};function r(r){const a=(0,o.useState)(!0),l=(0,i.default)(a,2),u=l[0],c=l[1],d=(0,o.useCallback)((()=>c(!0)),[]),f=(0,o.useMemo)((()=>o.default.lazy((()=>e().catch((e=>(s.error("Lazy error:",e),c(!1),()=>o.default.createElement(n,{onRetry:d}))))))),[u,d]);return f.displayName="LazyLoader",o.default.createElement(o.Suspense,{fallback:o.default.createElement(t,null)},o.default.createElement(f,r))}return r.displayName="LazyLoader",r}},21951:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.addListener=void 0,t.listenVisibility=function(e){const t=(0,o.debounce)(e,50);let n,r;void 0!==document.hidden?(r="visibilitychange",n="visibilityState"):void 0!==document.mozHidden?(r="mozvisibilitychange",n="mozVisibilityState"):void 0!==document.msHidden?(r="msvisibilitychange",n="msVisibilityState"):void 0!==document.webkitHidden&&(r="webkitvisibilitychange",n="webkitVisibilityState");"addEventListener"in document&&void 0!==r&&(document.addEventListener(r,(0,i.bind)(t,this,n),!1),parent.document.addEventListener(r,(0,i.bind)(t,this,n),!1),parent.document.addEventListener("focus",(0,i.bind)(t,this,n),!1),parent.document.addEventListener("blur",(0,i.bind)(t,this,n),!1),parent.window.addEventListener("focus",(0,i.bind)(t,this,n),!1),parent.window.addEventListener("blur",(0,i.bind)(t,this,n),!1))},t.removeEvent=void 0;var i=n(32710),o=n(90991),a=r(n(19955));t.addListener=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var i;e.addEventListener?e.addEventListener(t,n,!!a.default.supportsPassiveListeners()&&{passive:r}):e.attachEvent&&(e.attachEvent("on"+t,(i=e,function(){n.call(i,window.event)})),e=null)};t.removeEvent=(e,t,n)=>{if(window.removeEventListener)e.removeEventListener(t,n,!1);else{if(!window.detachEvent)return!1;{const r=function(){n.call(e)};e.detachEvent("on"+t,r)}}}},91225:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMinRoute=t.isIntroduceRoute=t.isContainerRoute=t.isChatRoute=t.isChatInputRoute=t.isChatClosedRoute=void 0;var r=n(97490);t.isContainerRoute=e=>![r.Route.LABEL,r.Route.LABEL_INVITATION,r.Route.HIDDEN].includes(e);t.isChatClosedRoute=e=>[r.Route.LABEL,r.Route.CHAT_MIN].includes(e);t.isMinRoute=e=>e===r.Route.CHAT_MIN;t.isIntroduceRoute=e=>e===r.Route.INTRODUCE;t.isChatRoute=e=>-1!==[r.Route.CHAT,r.Route.INTRODUCE,r.Route.DEPARTMENTS].indexOf(e);t.isChatInputRoute=e=>[r.Route.CHAT,r.Route.CHAT_CALL].includes(e)},68403:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.showAd=t.isPaidCustomer=t.isJivoSite=t.isChatContactForm=t.isAnalyticsDisabled=t.hasIntegration=t.getJoinedAgents=void 0;var i=r(n(96394)),o=n(9550);t.showAd=()=>!(i.default.unverified||i.default.options&&i.default.hide_ad);t.isPaidCustomer=()=>16&i.default.options;t.hasIntegration=e=>-1!==["vk","fb","sb"].indexOf(e);t.isChatContactForm=()=>-1!==[o.ContactsType.DURING_CHAT,o.ContactsType.DURING_CHAT_NO_CLOSE].indexOf(i.default.contacts_ask);t.getJoinedAgents=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.length>t.length)return[];const r=[];return t.forEach((t=>{e.includes(t.id)&&t.isBot===n&&r.push(t)})),r};t.isAnalyticsDisabled=()=>!!i.default.disable_analytics;t.isJivoSite=()=>1===i.default.site_id},16016:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSubstrTitle=t.getRandomString=t.generateGUIDCount=t.generateGUID=t.formatTextLen=void 0;const n=()=>{const e=Math.floor(65536*Math.random()).toString(16);return 4===e.length?e:n()};t.getRandomString=n;t.generateGUID=()=>{const e=n;return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};t.generateGUIDCount=e=>{let t="";for(;e--;)t+=n();return t};t.setSubstrTitle=e=>e.substring(0,255);t.formatTextLen=(e,t)=>e.length>t?e.substr(0,t)+"...":e},80598:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.getThemeColor=t.getTextSize=t.getTextColor=t.getPowerButtonDesktopPosition=t.getMobileBackgroundColor=t.getLineHeight=t.getBackground=void 0;var i=r(n(19955)),o=n(69882),a=r(n(27104)),s=n(36874);t.getTextSize=e=>{if(i.default.ios()&&(0,o.isWixContext)())return"normal";let t=null;return i.default.ios()?(1!==e&&(t=100*e+"%"),t||"none"):t};t.getLineHeight=(e,t)=>{let n=null;return 1!==t&&(n=(e||1.25)/t+"em"),n};t.getTextColor=e=>"dark"==e?"#222222":"#F0F1F1";t.getThemeColor=e=>{switch(e){case"grey":return s.colorsFromFigma.STEEL_80;case"blue":return s.colorsFromFigma.BLUE_90;default:return s.colorsFromFigma.GREEN_90}};t.getBackground=(e,t,n,r,i)=>{let o=a.default.getGradientBg(e,t);return i&&(o=l(n,r,o)),o};const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#44BB6E",n=arguments.length>2?arguments[2]:void 0;return e?n:t};t.getMobileBackgroundColor=l;t.getPowerButtonDesktopPosition=(e,t)=>{const n=+t;return"right"!==e&&"bottom"!==e||50!==n&&100!==n?"left":"right"}},67597:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.validateCustomDataLink=t.replaceServicezoneURL=t.replaceServicezoneTitle=t.isServicezoneURL=t.getTgLink=t.getEulaLink=t.getBundleSrc=t.fixUrl=t.fixTitle=void 0;var i=n(97615),o=r(n(96394)),a=n(22271),s=n(51542),l=n(2491),u=n(68403);t.validateCustomDataLink=(e,t)=>(0,l.isValidHttpURL)(e,(e=>{const n=(0,l.getURL)(t);return n&&e.origin.includes(n.origin)}));t.getBundleSrc=()=>(i.EnvironmentManager.isDevelopment()?"/public/js/bundle_":o.default.base_url+"/js/bundle_")+o.default.locale+".js?rand="+o.default.build_number;t.getEulaLink=(e,t)=>window.parent.location.protocol+e+"/script/eula/"+t;t.fixUrl=e=>{const t=o.default.shard_id;return(0,u.isJivoSite)()||!c(e)?e:t===s.Shards.SBER?d(e,"https://jivo.ru"):d(e,"https://jivochat.com")};t.fixTitle=(e,t)=>{const n=o.default.shard_id;return(0,u.isJivoSite)()||!c(t)?e:n===s.Shards.SBER?f(e,"Jivo"):f(e,"JivoChat")};const c=e=>a.Regexp.SERVICEZONE_DOMAIN.test(e);t.isServicezoneURL=c;const d=(e,t)=>e.replace(e,t);t.replaceServicezoneURL=d;const f=(e,t)=>e.replace(e,t);t.replaceServicezoneTitle=f;t.getTgLink=e=>{if(e){if("RU"===e.split(";")[0])return"tg://resolve/?domain="}return"https://t.me/"}},84727:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.validateCustomData=t.validateClientAnswer=void 0;var i=r(n(15687)),o=r(n(4855)),a=n(2491),s=r(n(98960)),l=n(67597);const u=o.default.name("validators:","color: grey");t.validateCustomData=(e,t)=>{if(!Array.isArray(e))return"Data must be array.";if(0===e.length)return"Data limit error, data length must be 1 to 10.";e.length>10&&(e.splice(10),u.warnParent("Data limit warning, data length must be 1 to 10."));const n=(e,t)=>{u.warnParent(`Item ${t} in setCustomData: ${e}.`)};return e.reduce(((e,r,o)=>{if("string"!=typeof r.content)return n("Property content must be string",o),e;r.link&&(t&&(0,a.isValidHttpURL)(r.link)?(0,l.validateCustomDataLink)(r.link,t)||(n("Such link is not allowed",o),delete r.link):(n("Safe url is not indicated",o),delete r.link));const s=((e,t)=>(r,i)=>{const o=e[r];return"string"==typeof o&&o.length>i?(n(`Max length for ${r} property is ${i}`,t),o.slice(0,i)):o})(r,o);return r.content=s("content",255),r.title=s("title",255),r.key=s("key",1e3),[].concat((0,i.default)(e),[r])}),[])};t.validateClientAnswer=(e,t)=>{if(!t||!e)return!1;const n=String(t).trim();return"email"==e?s.default.emailBot(n):"phone"==e?s.default.phone(n):"name"==e?s.default.name(n):void 0}},69882:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isWixIframe=t.isWixEditor=t.isWixContext=t.isTextEmojiDisabled=t.isAppCobrowse=t.getUnicodeHref=t.getCurrentPage=t.getChatPageToken=t.deleteNonce=void 0;var i=n(23267),o=r(n(50754)),a=n(20676),s=n(67597);t.isAppCobrowse=()=>"cobrowser-iframe"===(0,i.getPageWindow)().name;t.deleteNonce=()=>{(0,i.getPageWindow)().jivo_cspNonce&&delete(0,i.getPageWindow)().jivo_cspNonce};t.isWixIframe=()=>void 0!==(0,i.getPageWindow)().jivo_in_wix_iframe;const l=()=>{const e=(0,i.getPageWindow)().wix_context;return e&&e.Utils&&e.Utils.getViewMode()};t.isWixContext=l;t.isWixEditor=()=>{const e=l();return!!e&&-1!==["preview","editor"].indexOf(e)};const u=e=>{try{const t=e.hostname;return e.href.replace(t,o.default.toUnicode(t))}catch(t){return e.href}};t.getUnicodeHref=u;t.getCurrentPage=()=>{const e=(0,i.getPageWindow)();let t=e.location.href,n=e.document.title;const r=-1!==t.indexOf("about:");return""==n&&r&&(n=e.parent.document.title),t=u(r?e.parent.location:e.location),l()&&(t=e.wix_url||t,n=e.wix_title||n),{url:(0,s.fixUrl)(t),title:(0,s.fixTitle)(n.substring(0,255),t)}};t.isTextEmojiDisabled=()=>{const e=(0,i.getPageWindow)();return e._wpemojiSettings||e.twemoji};t.getChatPageToken=()=>{if(a.platform.isChatPage){let e=null;try{const t=new URLSearchParams((0,i.getPageWindow)().location.search).get("token");t&&(e=decodeURIComponent(t))}catch(e){console.error(e)}return e}return null}},45430:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=r(n(33119)),a=r(n(92664));n(95020);var s=n(52274),l=r(n(95003)),u=n(20344),c=r(n(14264)),d=r(n(23116)),f=n(21951),p=n(69882),h=n(9393),g=n(90991),_=r(n(56026)),m=n(32183),v=n(52028),y=n(97490),b=n(54415),E=n(83170),C=n(26022),T=r(n(22866)),D=n(13077),w=r(n(66547)),S=r(n(73687)),O=n(26932),A=n(50402),I=n(44145),k=n(97615),M=r(n(35802)),x=r(n(4855)),P=n(41504),R=n(91225),N=n(49963),L=n(23267),F=n(74619),j=r(n(19955)),B=n(83425);function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;tr)}},{key:"init",value:function(){if(this.openConnection()){if(H.log("start init"),this.net.onopen=this.connectionOnOpen.bind(this),this.net.onget=this.onget.bind(this),this.net.onset=this.onset.bind(this),this.net.onclose=this.connectionOnClosed.bind(this),this.net.onerror=this.connectionOnError.bind(this),this.net.onfail=this.connectionOnFail.bind(this),this.net.ondrop=this.connectionOnDrop.bind(this),this.cacheCurrentKeys=this.getAllCurrentKeys(),l.default.addListener(this.changeCurrentKeysFn),M.default.getInstance().reduxStore.subscribe((()=>{(0,I.getApp)().route===y.Route.HIDDEN&&this.closeConnection(),this.changeCurrentKeysFn()})),c.default.on("create",this.changeCurrentKeysFn),d.default.addListener("update",(0,g.debounce)(this.checkClientAway.bind(this),s.AWAY_CLIENT_TIMEOUT)),(0,p.isWixContext)()){const e=(0,L.getPageWindow)().wix_context;e.addEventListener(e.Events.PAGE_NAVIGATION,this.changeCurrentKeysFn)}(0,f.listenVisibility)((()=>{this.changeCurrentKeysFn(),(0,m.pageVisible)()&&this.openConnection()})),(0,I.getFeatures)().enableSpaNavigate&&new F.Observer({onTitleChange:this.changeCurrentKeysFn,onUrlChange:this.changeCurrentKeysFn})}}},{key:"checkClientAway",value:function(){d.default.isActive||(0,m.pageVisible)()||!this.isConnected||this.net.close()}},{key:"getURL",value:function(){const e=(0,I.getClient)(),t=(0,I.getSystemSettings)(),n=t.widgetId,r=t.viHost;return`${k.EnvironmentManager.isProduction()||"https:"===(0,L.getProtocol)()?"wss":"ws"}://${r}/${n}?${e.visitorId}`}},{key:"openConnection",value:function(){return this.isConnected||!this.ifNeedConnect()?(H.log("cant open connection"),!1):(this.net||(this.net=new ClientSocket),this.net.open(this.getURL()),!0)}},{key:"closeConnection",value:function(){H.log("close connection"),this.isConnected&&this.net&&this.net.close()}},{key:"connectionOnOpen",value:function(){H.log("connection open"),this.isConnected=!0,this.sendDynamicKeys(),this.changeCurrentKeysFn()}},{key:"connectionOnClosed",value:function(e){this.isConnected=!1,H.log("connection close: ",e)}},{key:"connectionOnError",value:function(e){H.error("connection error: ",e)}},{key:"connectionOnFail",value:function(e){b.Monitoring.telemetry(E.TelemetryName.VISITORS_FAIL,{param1:e})}},{key:"connectionOnDrop",value:function(e){0!==e&&(O.appDispatchers.setVIReconnectTime((new Date).getTime()+e),H.log("connection drop: ",e/1e3+"s"),setTimeout((()=>{B.ConfigUtils.reloadConfig(this.openConnection.bind(this))}),e))}},{key:"getKeys",value:function(e){const t=(0,L.getPageWindow)(),n=(0,I.getApp)(),r=(0,I.getClient)(),i={name:()=>r.name,phone:()=>r.phone,email:()=>r.email,desc:()=>r.description,purl:()=>(0,p.isWixContext)()?t.wix_url:(new _.default).decode((0,p.getCurrentPage)().url),ptitle:()=>{let e=(0,p.getCurrentPage)().title;return e===(0,u.l10n)("lblNewMessage")&&(e=this.cacheCurrentKeys&&this.cacheCurrentKeys.ptitle),(0,p.isWixContext)()?t.wix_title:e},cid:()=>r.clientId?r.clientId.split(".")[0]:null,utm:()=>{const e=W(W(W(W(W(W({},r.utm.campaign&&{campaign:r.utm.campaign}),r.utm.source&&{source:r.utm.source}),r.utm.medium&&{medium:r.utm.medium}),r.utm.keyword&&{keyword:r.utm.keyword}),r.utm.term&&{keyword:r.utm.term}),r.utm.content&&{content:r.utm.content});return JSON.stringify(e)},status:()=>{let e;const t=!c.default.getCurrentChatAgentMessages().length&&c.default.getCurrentClientMessages().length;e=n.chatStarted?n.chatAccepted?C.ClientStatus.ON_CHAT:n.isOnline?N.connectionAdapter.isConnected()&&t?C.ClientStatus.INVITE_SENT:C.ClientStatus.ON_SITE:N.connectionAdapter.isConnected()&&t&&n.lastChatOpened?C.ClientStatus.INVITE_SENT:C.ClientStatus.ON_SITE:(0,I.getProactive)().text?C.ClientStatus.PROACTIVE_SHOW:C.ClientStatus.ON_SITE;const r=(0,I.getCallback)().status;return r&&-1!==["cw_wait","cw_connecting","cw_connected"].indexOf(r)&&(e=C.ClientStatus.ON_CALL),e==C.ClientStatus.INVITE_SENT&&N.connectionAdapter.isConnected()&&!t&&b.Monitoring.telemetryOnce(E.TelemetryName.VI_STATUS_FAIL,{param1:"no_client_message",param2:n.chatAccepted?"1":"0"}),e},navcount:()=>w.default.get("pages_count"),visits:()=>S.default.get("visits_count"),chats:()=>c.default.getChatCounts(),visible:()=>(0,m.pageVisible)(),opened:()=>{const e=n.route;return!(0,R.isChatClosedRoute)(e)},agentids:()=>{const e=n.chatAccepted;return JSON.stringify(e?(0,I.getAgentIdsByStatus)("join"):[])},botids:()=>{const e=n.chatAccepted;return JSON.stringify(e?(0,I.getBotIdsByStatus)("join"):[])},pa_id:()=>r.priorityAgentId,avatar:()=>r.avatarUrl,wversion:()=>k.EnvironmentManager.getVersion(),cdata:()=>{const e=r.customData;return e?JSON.stringify(e):null}};return e?i[e]&&i[e]():Object.keys(i)}},{key:"getAllCurrentKeys",value:function(){const e={};return(0,h.each)(this.getKeys(),(t=>{e[t]=this.getKeys(t)})),e}},{key:"changeCurrentKeys",value:function(){const e=this.getAllCurrentKeys();this.isConnected&&JSON.stringify(this.cacheCurrentKeys)!==JSON.stringify(e)&&(0,h.each)(this.getKeys(),(t=>{const n=e[t];this.cacheCurrentKeys[t]!==n&&this.set(t,n)}))}},{key:"sendAllKeys",value:function(e,t){(0,h.each)(this.getKeys(),(n=>{this.cacheCurrentKeys[n]||(this.cacheCurrentKeys[n]=this.getKeys(n));const r=this.cacheCurrentKeys[n];r&&this.net.set({room:t,to:e,key:n,value:r})}))}},{key:"sendDynamicKeys",value:function(){(0,h.each)(G,(e=>{this.set(e,this.getKeys(e))}))}},{key:"set",value:function(e,t,n,r){if(this.isConnected&&null!=t){this.cacheCurrentKeys[e]=t;const i={key:e,value:t};r&&(i.room=r),n&&(i.to=n),T.default.getInstance().saveViEvent(i),this.net.set(i)}}},{key:"onget",value:function(e){T.default.getInstance().saveViEvent(e),"*"===e.key||"all"===e.key?(this.sendAllKeys(e.from,e.room),(0,h.each)({startsec:()=>{const e=w.default.get("enter_ts");return e&&(0,D.timeDiff)(e)}},((t,n)=>{t()&&this.set(n,t(),e.from,e.room)}))):this.getKeys(e.key)&&this.set(e.key,this.getKeys(e.key),e.from,e.room)}},{key:"onset",value:function(e){const t=(0,I.getApp)(),n=t.isOnline,r=t.route;T.default.getInstance().saveViEvent(e),"invite"!==e.key||this.isInvited||(n||(0,R.isChatClosedRoute)(r)&&(O.transitionDispatchers.startTransition(A.ScriptName.OPEN_WIDGET),O.appDispatchers.setAppRoute(y.Route.CHAT)),N.connectionAdapter.checkConnection((()=>N.connectionAdapter.sendEvent(new P.StartChat(e.value)))),this.isInvited=!0,setTimeout((()=>{this.isInvited=!1}),s.APP_INVITE_TIME),b.Monitoring.telemetry(E.TelemetryName.VISITORS_INVITE,{param1:parseInt(e.value)}),(0,D.setRuleLocal)("isVisitorInvite"))}}]),e}();var z={run:function(){const e=(0,I.getClient)();H.log("run",e.visitorId),0!=e.visitorId?new V:b.Monitoring.telemetry(E.TelemetryName.VISITORS_FAIL,{param1:"visitorId = 0"})}};t.default=z},95911:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xhrRequest=t.promisedRequest=void 0;var r=n(31343),i=n(54415),o=n(80210),a=n(82956),s=n(73422);const l=(e,t)=>t&&(0,s.isObject)(t.params)?e+=`?${o.querystring.create(t.params)}`:e,u=e=>((e=Object.assign({},r.REQUEST_OPTIONS,e)).body&&(e.headers["Content-Type"]===r.CONTENT_TYPE.X_WWW_FORM?e.body=(0,s.isObject)(e.body)?o.querystring.create(e.body):JSON.stringify(e.body):e.headers["Content-Type"]===r.CONTENT_TYPE.APP_JSON&&(e.body=JSON.stringify(e.body))),e),c=(e,t,n)=>(r,o)=>{!r||"SyntaxError"!==r.name||null!=t&&t.monitoring||i.Monitoring.reportException(`Error parsing response from ${e}. ${r.message}`),n(r,o)},d=(e,t,n)=>({url:l(e,t),options:u(t),callback:n&&c(e,t,n)}),f=e=>(t,n,r)=>{const i=d(t,r,n);return(0,a.xhr)(i.url,e,i.options,i.callback)},p=e=>(t,n)=>{const r=d(t,n);return(0,a.xhrPromised)(r.url,e,r.options)},h={get:f(r.METHODS.GET),post:f(r.METHODS.POST),head:f(r.METHODS.HEAD),put:f(r.METHODS.PUT)};t.xhrRequest=h;const g={get:p(r.METHODS.GET),put:p(r.METHODS.PUT),head:p(r.METHODS.HEAD)};t.promisedRequest=g},98960:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={phone:e=>e.length>0&&e.trim().replace(/\D+/g,"").length>=5&&/^\+?[0-9() -]+$/i.test(e),client_name:e=>{const t=e.trim();return t.length>0&&t.length<100},name:e=>{const t=e.trim();return t.length>0&&t.length<100},email:e=>e.length>=4&&new RegExp(/^([a-zA-Z\d-_]+([+.][a-zA-Z\d-_]+)*)@(([a-zA-Z\d][a-zA-Z\d-_.]*[a-zA-Z\d])|([a-zA-Z\d]))\.([a-zA-Z\d]{2,})$/i).test(e),emailBot:e=>e.length>=4&&new RegExp(/^([a-zA-Z\d\-_+!]+(\.[a-zA-Z\d\-_+!]+)*)@(([a-zA-Z\d-]+\.)+[a-zA-Z\d]{2,})$/i).test(e),message:e=>e.trim().length>0,description:e=>e.trim().length>0,textarea:e=>e.trim().length>0};t.default=n},74379:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=n(9393),s=n(32183),l=n(52274),u=r(n(4855)),c=n(73262),d=n(21951),f=n(69882),p=n(75998),h=n(20676),g=n(23267);const _=u.default.name("SiteConnector");var m=new(function(){function e(){(0,i.default)(this,e),this.window=(0,g.getPageWindow)(),this.screen=this.window.screen?this.window.screen:window.screen,this.document=this.window.document,this.bodyEl=this.document.body,this.documentEl=this.document.documentElement,this.scrollEl=this.document.scrollingElement||this.documentEl,this.pageZoom=null,this.userZoom=null,this.appZoom=null,this.isSiteOptimizedForMobile=!1,this.isWidgetOnWix=!1,this.changeZoomSubscription=[],this.checkZoomsFn=(0,c.throttle)((()=>{this.checkZooms()}),200,{trailing:!0}),!h.platform.isMobileOrTablet||(0,f.isWixContext)()&&!h.platform.isAndroid||(this.checkViewport(),this.initListenChangeZooms())}return(0,o.default)(e,[{key:"initListenChangeZooms",value:function(){(0,d.addListener)(this.window,"scroll",this.checkZoomsFn,!0),(0,d.addListener)(this.window,"resize",this.checkZoomsFn,!0),(0,d.addListener)(this.window,"orientationchange",this.checkZoomsFn),this.window.visualViewport&&this.window.visualViewport.addEventListener&&((0,d.addListener)(this.window.visualViewport,"scroll",this.checkZoomsFn,!0),(0,d.addListener)(this.window.visualViewport,"resize",this.checkZoomsFn,!0))}},{key:"setZoomChangeIterval",value:function(e){e!==this.intervalTime&&(clearInterval(this.intervalId),this.intervalTime=e,this.intervalId=setInterval(this.checkZoomsFn,e))}},{key:"checkZooms",value:function(){const e=this.getUserZoom(),t=this.getPageZoom(),n=this.getAppZoom();e===this.userZoom&&t===this.pageZoom&&n===this.appZoom||(_.log("zoom:",e,t,n),this.userZoom=e,this.pageZoom=t,this.appZoom=n,p.zoomDispatch.setZoomSettings({user:this.userZoom,page:this.pageZoom,app:this.appZoom}),this.triggerChangeZoom())}},{key:"checkViewport",value:function(){const e=this.document.querySelector("meta[name=viewport]");if(e&&e.content){const t=e.getAttribute("content").toLowerCase().split(","),n=e.getAttribute("id");for(let e=0;e{e({userZoom:this.userZoom,pageZoom:this.pageZoom,appZoom:this.appZoom})}))}},{key:"blockScroll",value:function(){(0,s.addClass)(this.bodyEl,"jivo-block-scroll"),(0,d.addListener)(this.window,"scroll",this.preventDefault),(0,d.addListener)(this.document,"touchmove",this.preventDefault),this.window.visualViewport&&this.window.visualViewport.addEventListener&&(this.window.visualViewport.addEventListener("scroll",this.preventDefault),this.window.visualViewport.addEventListener("resize",this.preventDefault))}},{key:"unblockScroll",value:function(){(0,s.removeClass)(this.bodyEl,"jivo-block-scroll"),(0,d.removeEvent)(this.window,"scroll",this.preventDefault),(0,d.removeEvent)(this.document,"touchmove",this.preventDefault),this.window.visualViewport&&this.window.visualViewport.removeEventListener&&(this.window.visualViewport.removeEventListener("scroll",this.preventDefault),this.window.visualViewport.removeEventListener("resize",this.preventDefault))}},{key:"addOverlay",value:function(){(0,s.addClass)(this.documentEl,"jivo-mobile-overlay")}},{key:"removeOverlay",value:function(){(0,s.removeClass)(this.documentEl,"jivo-mobile-overlay")}},{key:"blockSite",value:function(){if(void 0!==this.blockState)return;const e=this.scrollEl.scrollTop;this.resetScrollPositions(),(0,s.addClass)(this.documentEl,"jivo-site-full-block"),this.scrollEl.scrollTop=e,h.platform.isTablet&&setTimeout((()=>{(0,s.addClass)(this.documentEl,"jivo-tablet-overlay")}),300),this.blockState=!0}},{key:"unblockSite",value:function(){(0,s.removeClass)(this.documentEl,"jivo-site-full-block"),(0,s.removeClass)(this.documentEl,"jivo-tablet-overlay"),this.restoreScrollPositions(),delete this.blockState}},{key:"resetScrollPositions",value:function(){this.scrollEl&&(this.originalScrollTop=this.scrollEl.scrollTop,this.originalScrollLeft=this.scrollEl.scrollLeft,this.scrollEl.scrollTop=0,this.scrollEl.scrollLeft=0)}},{key:"restoreScrollPositions",value:function(){this.scrollEl&&(this.originalScrollTop&&(this.scrollEl.scrollTop=this.originalScrollTop),this.originalScrollLeft&&(this.scrollEl.scrollLeft=this.originalScrollLeft),delete this.originalScrollTop,delete this.originalScrollLeft)}},{key:"preventDefault",value:function(e){return e.preventDefault(),e.stopPropagation(),!1}},{key:"getUserZoom",value:function(){let e=this.documentEl.clientWidth/this.window.innerWidth;const t=this.window.visualViewport;if(t&&1!==t.scale){const n=this.getPseudo().clientWidth;e=this.documentEl.clientWidth=.97&&e<=l.MAX_ALLOWED_USER_ZOOM&&(e=1),e}},{key:"getPageZoom",value:function(){return this.screen?this.window.visualViewport?"landscape"===this.getOrientation()?this.screen.height/this.window.visualViewport.width:this.screen.width/this.window.visualViewport.width:"landscape"===this.getOrientation()?this.screen.height/this.window.innerWidth:this.screen.width/this.window.innerWidth:1}},{key:"getAppZoom",value:function(){return this.screen?this.window.visualViewport?"landscape"===this.getOrientation()&&h.platform.isIos?this.window.visualViewport.width/this.screen.height:this.window.visualViewport.width/this.screen.width:"landscape"===this.getOrientation()?this.window.innerWidth/this.screen.height:this.window.innerWidth/this.screen.width:1}},{key:"getTextSize",value:function(){if(h.platform.isIos&&(0,f.isWixContext)())return"normal";let e=null;if(!h.platform.isIos)return e;const t=this.getAppZoom();return 1!==t&&(e=100*t+"%"),e||"none"}},{key:"getLineHeight",value:function(e){let t=null;const n=this.getAppZoom();return 1!==n&&(t=(e||1.25)/n+"em"),t}},{key:"getOrientation",value:function(){let e,t=0;switch("number"==typeof this.window.orientation?t=this.window.orientation:this.window.screen&&this.window.screen.orientation&&(t=this.window.screen.orientation.angle),t){case-90:case 90:e="landscape";break;default:e="portrait"}return e}},{key:"getBodyOffset",value:function(){const e=this.getBodyPosition(),t=this.bodyEl.getBoundingClientRect(),n=this.documentEl.getBoundingClientRect();return{top:"static"===e?0:t.top-n.top,left:"static"===e?0:t.left-n.left}}},{key:"getBodyPosition",value:function(){return this.window.getComputedStyle(this.bodyEl).position}},{key:"getPseudo",value:function(){if(this.documentEl.querySelector){const e=this.documentEl.querySelector(".jv-pseudo-height");return e||0}return 0}},{key:"listenChangeZoom",value:function(e){this.changeZoomSubscription.push(e)}}]),e}());t.default=m},14762:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(44775)),s=r(n(84827)),l=r(n(85299)),u=r(n(55536)),c=n(9393),d=n(42687);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}let p=function(e){(0,s.default)(n,e);var t=f(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,o.default)(n,[{key:"getAgentById",value:function(e){return e?this.store.find((t=>t.get("agent_id")===parseInt(e))):null}},{key:"getBotById",value:function(e){return e?this.store.find((t=>t.get("bot_id")===parseInt(e))):null}},{key:"getAgentsByStatus",value:function(e){return e?this.store.filter((t=>t.get("body.state")===e)):null}},{key:"cleanBotsUpdate",value:function(){const e="body.is_update_from_bot";return this.store.forEach((t=>{t.get("bot_id")&&t.get(e)&&(t.set(e,!1),t.set("body.state","left"))}))}},{key:"getAgentIdsByStatus",value:function(e){return e?this.store.reduce(((t,n)=>(n.get("body.state")===e&&t.push(n.get("agent_id")||n.get("bot_id")),t)),[]):null}},{key:"getOnlyAgentIdsByStatus",value:function(e){return e?this.store.reduce(((t,n)=>(n.get("body.state")===e&&n.get("agent_id")&&t.push(n.get("agent_id")),t)),[]):null}},{key:"getBotIdsByStatus",value:function(e){return e?this.store.reduce(((t,n)=>(n.get("body.state")===e&&n.get("bot_id")&&t.push(n.get("bot_id")),t)),[]):null}},{key:"closeChat",value:function(){(0,c.each)(this.store,(e=>{e.set("body.state","left")}))}},{key:"updateAgentList",value:function(e,t){e&&e.length&&(1==e.length&&this.closeChat(),(0,c.each)(e,(e=>{let r;r=e.bot_id?this.getBotById(e.bot_id):this.getAgentById(e.agent_id),e.body={state:"join"},e=(0,d.omit)(e,["state","vox_name"]),null!=t&&t.is_update_from_bot&&(e.body.is_update_from_bot=!0),e.avatar_url||(e.avatar_url=null),r?r.set(e):(0,a.default)((0,u.default)(n.prototype),"push",this).call(this,e)})))}},{key:"toReduxFormat",value:function(){const e=[];return(0,c.each)(this.store,(t=>{var n,r;const i=t.toJSON(),o={avatarUrl:i.avatar_url||null,id:i.agent_id||i.bot_id,name:i.display_name||null,title:i.title||null,isBot:!!i.bot_id,state:(null==i||null===(n=i.body)||void 0===n?void 0:n.state)||null,type:i.type||null,isUpdateFromBot:(null===(r=i.body)||void 0===r?void 0:r.is_update_from_bot)||null};e.push(o)})),e}}]),n}(r(n(34973)).default);var h=new p({type:"default",name:"agents",keys:{type:null,agent_id:null,bot_id:null,display_name:null,title:null,avatar_url:null,body:{state:"join",is_update_from_bot:null}}});t.default=h},4867:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(84827)),s=r(n(85299)),l=r(n(55536)),u=r(n(6131)),c=n(81152);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var i=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}let f=function(e){(0,a.default)(n,e);var t=d(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,o.default)(n,[{key:"isAgentMessage",value:function(){const e=this.store;return e.from===c.MessageInitiator.AGENT||"bot"===e.from}},{key:"unStorage",value:function(){var e,t,n,r,i;if(null!==(e=window)&&void 0!==e&&null!==(t=e.parent)&&void 0!==t&&t.window&&null!==(n=window)&&void 0!==n&&null!==(r=n.parent)&&void 0!==r&&null!==(i=r.window)&&void 0!==i&&i.isWixPreview)return!0;const o=this.store;return-1!==[c.MessageType.EMAIL,c.MessageType.SOCIAL,c.MessageType.PRECHAT].indexOf(o.type)||o.body&&o.body.unsave||!1}}]),n}(u.default);t.default=f},14264:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(15687)),o=r(n(33119)),a=r(n(92664)),s=r(n(44775)),l=r(n(84827)),u=r(n(85299)),c=r(n(55536)),d=r(n(4855)),f=n(44145),p=n(16016),h=n(9393),g=n(38392),_=n(938),m=r(n(34973)),v=n(81152),y=r(n(4867));function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}const E=d.default.name("MessagesStore");var C=new(function(e){(0,l.default)(n,e);var t=b(n);function n(e){var r;return(0,o.default)(this,n),(r=t.call(this,e)).destroyDeletedMessages(),r.destroyErrorMediaMessages(),r.setTempMessagesForInit(),r}return(0,a.default)(n,[{key:"push",value:function(e){const t=this.formatMessage(e);return(0,s.default)((0,c.default)(n.prototype),"push",this).call(this,t)}},{key:"pushAll",value:function(e){(0,s.default)((0,c.default)(n.prototype),"pushAll",this).call(this,e)}},{key:"sort",value:function(){this.store=(0,_.sortBy)(this.store,(e=>e.get("created_ts")))}},{key:"formatMessage",value:function(e){var t=g.pick.apply(void 0,[e].concat(["private_id","msg_id","chat_id","created_ts","updated_ts","from","from_id","text","type","status","body","replied_message"]));const n=e.meta||e.body;if(void 0!==n&&"tinkoffInvoice"===n.type&&"SUCCESS"===n.status){const e=this.store.filter((function(e){return(e.get("body")?e.get("body").invoice_id:e.invoice_id)===n.invoice_id}));if(e.length){const t=e[0].get("body");t&&(t.status="SUCCESS",e[0].set("body",t))}}return e.type==v.MessageType.MESSAGE&&e.media&&(t.type=v.MessageType.MEDIA,t.body=e.media),t}},{key:"getLastMessage",value:function(){return this.store[this.store.length-1]||null}},{key:"getFirstMessage",value:function(){return this.store.length?this.store[0]:null}},{key:"getClientMessages",value:function(){return this.store.filter((e=>e.get("from")===v.MessageInitiator.CLIENT))}},{key:"getAgentMessages",value:function(){return this.store.filter((e=>e.get("from")===v.MessageInitiator.AGENT))}},{key:"getAgentTextMessages",value:function(){const e=this.getChatId();return e?this.store.filter((t=>t.get("chat_id")===e&&t.get("from")===v.MessageInitiator.AGENT&&t.get("type")===v.MessageType.MESSAGE)):[]}},{key:"getMessagesByType",value:function(e){return this.store.filter((t=>t.get("type")===e))}},{key:"getMessageById",value:function(e){return e?this.store.find((t=>t.get("msg_id")===e)):null}},{key:"getMessageByPrivateId",value:function(e){return e?this.store.find((t=>t.get("private_id")===e)):null}},{key:"closeChat",value:function(){const e=this.getLastMessage(),t=this.getLastProactive();t&&t.set("chat_id",e.get("chat_id"))}},{key:"getCurrentProactive",value:function(){const e=this.getLastProactive();let t=null;return(0,f.getApp)().chatStarted&&e&&!e.get("chat_id")&&(t=e),E.log("getCurrentProactive",t),t}},{key:"getLastProactive",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.PROACTIVE));return E.log("getLastProactive",e),e.length?e[e.length-1]:null}},{key:"getTmpProactive",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.PROACTIVE&&e.get("body")&&e.get("body").unsave));return E.log("getTmpProactive",e),e.length?e[e.length-1]:null}},{key:"destroyDeletedMessages",value:function(){const e=this.getDeletedMessages();(0,h.each)(e,(e=>{e.destroy()}))}},{key:"getDeletedMessages",value:function(){return this.store.filter((e=>e.get("status")==v.MessageStatus.DELETED))}},{key:"destroyErrorMediaMessages",value:function(){const e=this.getMediaErrors();(0,h.each)(e,(e=>{e.destroy()}))}},{key:"getMediaErrors",value:function(){return this.store.filter((e=>{if(!e)return!1;const t=e.toJSON();return t.type==v.MessageType.MEDIA&&t.body&&t.body.status&&t.body.status!==v.MediaStatus.COMPLETE&&t.body.status!==v.MediaStatus.EXPIRED}))}},{key:"getChatCounts",value:function(){let e,t=0;return(0,h.each)(this.store,(n=>{const r=n.get("chat_id");null!==r&&r!==e&&(e=r,t+=1)})),t}},{key:"getAllChatIds",value:function(){const e=[];return(0,h.each)(this.store,(t=>{t.get("chat_id")&&e.push(t.get("chat_id"))})),(0,i.default)(new Set(e))}},{key:"getChatId",value:function(){const e=this.getAgentMessages(),t=this.filter((e=>e.get("chat_id")&&e.get("from")===v.MessageInitiator.CLIENT));let n=e.length?e[e.length-1].get("chat_id"):null;const r=t.length?t[t.length-1].get("chat_id"):null;return r>n&&(n=r),n}},{key:"getChatMessages",value:function(e){return this.store.filter((t=>t.get("chat_id")===e&&t.get("type")!==v.MessageType.SYSTEM&&"bot"!==t.get("from")))}},{key:"getChatMessagesAfterId",value:function(e,t){return this.store.filter((n=>n.get("chat_id")===e&&n.get("type")!==v.MessageType.SYSTEM&&"bot"!==n.get("from")&&n.get("msg_id")>t))}},{key:"getCurrentChatMessages",value:function(){const e=this.getChatId();return e?this.getChatMessages(e):[]}},{key:"getAgentChatMessages",value:function(e){return this.store.filter((t=>{const n=[v.MessageInitiator.AGENT,v.MessageInitiator.AGENT_BOT],r=[v.MessageType.PROACTIVE,v.MessageType.FOR_TEST,v.MessageType.FORM,v.MessageType.PRECHAT];return t.get("chat_id")===e&&n.includes(t.get("from"))&&!r.includes(t.get("type"))}))}},{key:"getCurrentChatAgentMessages",value:function(){const e=this.getChatId();return this.getAgentChatMessages(e)}},{key:"getCurrentClientMessages",value:function(){return this.getChatMessages(this.getChatId()).filter((e=>e.get("from")===v.MessageInitiator.CLIENT))}},{key:"find",value:function(e){return this.store.find((t=>e(t)))}},{key:"filter",value:function(e){return this.store.filter((t=>e(t)))}},{key:"setTempMessagesForInit",value:function(){return(0,h.each)(this.store,(e=>{if(e&&e.get("from")===v.MessageInitiator.CLIENT&&e.get("status")===v.MessageStatus.SENT&&!e.get("chat_id")){((new Date).getTime()-e.get("created_ts"))/1e3>604800&&e.get("type")===v.MessageType.TEMPORARY&&(e.set("status",v.MessageStatus.NOT_DELIVERED),e.set("type",v.MessageType.MESSAGE)),e.get("type")===v.MessageType.MESSAGE&&e.set("status",v.MessageStatus.NOT_DELIVERED)}}))}},{key:"getClientSendedMessages",value:function(){return this.store.filter((e=>e.get("from")===v.MessageInitiator.CLIENT&&e.get("status")===v.MessageStatus.SENT&&!e.get("msg_id")&&e.get("type")===v.MessageType.MESSAGE))}},{key:"getFormMessage",value:function(){return this.store.filter((e=>e.get("type")===v.MessageType.FORM))}},{key:"getFormIntroduceText",value:function(){return this.store.filter((e=>e.get("type")===v.MessageType.PREFORM&&e.get("from")===v.MessageInitiator.FORM))}},{key:"getBotMessages",value:function(e){return this.store.filter((t=>t.get("chat_id")===e&&t.get("type")===v.MessageType.MESSAGE&&"bot"===t.get("from")))}},{key:"getTemporaryMessageWithText",value:function(e){const t=this.store.filter((t=>t.get("type")===v.MessageType.TEMPORARY&&t.get("text")===e));return t.length?t[t.length-1]:null}},{key:"getOfflineTmpMessage",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.TEMPORARY&&e.get("from")===v.MessageInitiator.CLIENT));return e.length?e[e.length-1]:null}},{key:"getLastUnreadApiInvitation",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.MESSAGE&&e.get("body")&&e.get("body").customerIO));return e.length?e[e.length-1]:null}},{key:"getUnreadApiInvitations",value:function(){return this.store.filter((e=>e.get("type")===v.MessageType.MESSAGE&&e.get("body")&&e.get("body").customerIO&&e.get("body").unsave))}},{key:"getSystemMessageByText",value:function(e){return this.store.filter((t=>t.get("type")===v.MessageType.SYSTEM&&t.get("text")===e))}},{key:"hasMessages",value:function(){return this.store.length>0}},{key:"getCobrowseByHash",value:function(e){if(e)return this.store.find((t=>{const n=t.toJSON();return n.type===v.MessageType.COBROWSE&&n.body&&n.body.type===v.MessageType.COBROWSE&&n.body.address===e}))}}]),n}(m.default))({type:"default",name:"messages",itemClass:y.default,keys:{private_id:function(){return(0,p.generateGUID)()},msg_id:null,chat_id:null,created_ts:function(){return(new Date).getTime()},updated_ts:null,from:v.MessageInitiator.EMPTY,from_id:null,text:null,type:v.MessageType.EMPTY,status:v.MessageStatus.SENT,body:{},replied_message:null}});t.default=C},23116:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(62096),o=r(n(4855)),a=r(n(19955)),s=n(21951),l=n(73262),u=n(32183),c=n(91225),d=n(35233);const f=n(89766).EventEmitter;let p=(new Date).getTime();const h=o.default.name("TabActiveManager"),g=Object.assign(new f,{isActive:null});let _;const m=(0,l.throttle)((()=>{p=(new Date).getTime(),(0,c.isChatRoute)(_)&&(0,u.pageVisible)()&&!0!==g.isActive&&(h.log("setActive"),g.isActive=!0,g.emit("update"))}),500),v=()=>{h.log("setNotActive"),g.isActive=!1,g.emit("update")};setInterval((()=>{!1!==g.isActive&&(new Date).getTime()-p>3e4&&v()}),15e3),a.default.desktop()?((0,s.addListener)(window.parent,"scroll",m,!0),(0,s.addListener)(window.parent,"mousemove",m,!0)):((0,s.addListener)(window.parent,"touchmove",m,!0),(0,s.addListener)(window.parent,"touchend",m,!0)),(0,s.listenVisibility)((()=>{(0,u.pageVisible)()?m():v()})),i.reduxStore.subscribe((()=>{const e=_;_=(0,d.selectRoute)(i.reduxStore.getState()),e!==_&&((0,c.isChatRoute)(_)?m():v())}));var y=g;t.default=y},11281:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=r(n(96394)),a=n(16016),s=r(n(26754)),l=r(n(14264)),u=r(n(14762)),c=n(28723),d=n(68403),f=r(n(35802)),p=n(20344),h=r(n(91275)),g=n(96879),_=n(81152),m=n(65465),v=n(43914),y=r(n(4855)),b=n(47138),E=r(n(22541)),C=r(n(73687)),T=n(28302),D=n(44145),w=r(n(71277)),S=r(n(138)),O=n(21476),A=n(97490),I=n(54415),k=n(83170),M=n(49594),x=n(26932),P=n(23336),R=n(9550),N=n(97939),L=n(41168),F=n(64123),j=n(13077),B=n(34445),U=n(91442),W=n(49963),H=n(54346),G=n(12398),V=n(12822),z=n(73422),$=n(20676),Z=n(90865),q=n(499),K=n(8717),Y=n(15787),J=n(62162),X=n(54346),Q=n(95856),ee=n(3296);function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ne(e){for(var t=1;t{const n=e.agent_info.bot_id,r=(0,D.getApp)(),i=(0,D.getClient)(),o=(0,D.getChats)(),a=o[o.length?o.length-1:0],c=(0,D.getUserSettings)();if(x.appDispatchers.setChatStarted(!0),x.appDispatchers.setChatAccepted(!0),x.appDispatchers.setLastChatOpened(!0),x.appDispatchers.setHiddenByRules(!1),x.chatsDispatchers.setChatEvaluated(!1),!r.isOnline){if(n||(t.default.setOnline(),m.messageActions.systemMessageOnce((0,p.l10n)("offlineAgentConnected"))),m.messageActions.deleteUnansweredOfflineSystemInvite(),(0,K.shouldRedirectToIntroduce)()){const e=l.default.getOfflineTmpMessage();e&&e.destroy(),O.Router.next(A.RouterEvent.ToIntroduce)}I.Monitoring.telemetry(k.TelemetryName.OFFLINE_AGENT_ACCEPT)}var d;n?(s.default.agent_id=0,s.default.type=e.agent_info.type||null,s.default.isUpdateFromBot=!(null===(d=e.state)||void 0===d||!d.is_update_from_bot)):(s.default.bot_id&&t.default.setOnline(),s.default.bot_id=0);x.chatsDispatchers.setNoJoinedAgents(),s.default.agent_id=e.agent_info.agent_id||null,s.default.bot_id=e.agent_info.bot_id||null,s.default.display_name=e.agent_info.display_name||null,s.default.title=e.agent_info.title||null,s.default.avatar_url=e.agent_info.avatar_url||null,s.default.typing=e.agent_info.typing||null,s.default.state="join";const f=s.default.toReduxFormat();n?(x.botsDispatchers.addBot(f),x.chatsDispatchers.setJoinedBots([s.default.bot_id]),u.default.updateAgentList([e.agent_info],e.state)):(x.agentsDispatchers.addAgent(f),x.chatsDispatchers.setJoinedAgents([e.agent_info]),x.chatsDispatchers.setJoinedBots([]),x.appDispatchers.setIsInputDisabled(!1)),n?x.messagesDispatchers.destroyByType(_.MessageType.RATE_FORM):(!i.isIntroduced&&r.isOnline&&m.messageActions.checkContactsForm(),x.clientDispatchers.setPaId(s.default.agent_id)),S.default.trackChatConnected(),(0,v._callUserFunction)("onAccept"),(0,J.saveLastProactive)(),(0,Y.openChatOnMessage)({isNoMessage:!0});const h=n?_.MessageType.BOT:_.MessageInitiator.AGENT;var g;(c.contactsAsk===R.ContactsType.BEFORE_CHAT&&I.Monitoring.telemetry(k.TelemetryName.CHAT_ACCEPTED_CONTACTS,{param1:h,param2:JSON.stringify({chat_id:a.id,department_id:i.departmentId,display_name:Boolean(i.displayName),name:Boolean(i.name),email:Boolean(i.email),is_introduced:i.isIntroduced,phone:Boolean(i.phone)})}),n)?I.Monitoring.telemetry(k.TelemetryName.CHAT_BOT_ACCEPTED,{param1:(0,X.isAssistantBot)()?N.BotType.ASSISTANT:N.BotType.DEFAULT,param2:null!==(g=e.state)&&void 0!==g&&g.is_update_from_bot?"is_update_from_bot":"is_accept"}):I.Monitoring.telemetry(k.TelemetryName.CHAT_ACCEPTED,ne({param1:h},S.default.getCountersTelemetry()))},transferred:e=>{(0,D.getApp)().isOnline||t.default.setOnline(),Object.assign(s.default,e.agent_info);const n=e.agent_info.bot_id,r=s.default.toReduxFormat();n?(x.botsDispatchers.addBot(r),x.chatsDispatchers.setJoinedBots([n])):(x.agentsDispatchers.addAgent(r),x.chatsDispatchers.setJoinedAgents([e.agent_info]),x.chatsDispatchers.setJoinedBots([])),x.messagesDispatchers.addMessage({text:(0,p.l10n)("lblTransferred").replace("_AGENT_",e.agent_info.display_name),type:_.MessageType.SYSTEM,from:_.MessageType.SYSTEM}),x.clientDispatchers.setPaId(s.default.agent_id)},startup_ok:e=>{const t=(0,D.getApp)(),n=(0,D.getClient)();re.log("startup_ok",e),h.default.reloadStories(),u.default.closeChat(),x.appDispatchers.setMaintenance(!1),x.appDispatchers.setIsInputDisabled(!1),x.appDispatchers.setLastChatStatus(B.ChatStatus.STARTUP_OK),x.callbackDispatchers.setCallbackStatus(!1),t.route===A.Route.CHAT_MIN&&O.Router.setNext(A.Route.LABEL),o.default.enable_client_attributes&&!n.clientId&&n.attributes&&(0,U.sendClientAttributes)(n.attributes,e.jv_client_id),x.clientDispatchers.updateClient({clientId:e.jv_client_id,sessionId:e.jv_sess_id}),(0,q.syncCSClientInfo)(e.client_info),m.messageActions.deleteMaintenanceMessage(),(0,M.updateHistory)(e),(n.isIntroduced&&!t.isOnline||t.isOnline)&&W.connectionAdapter.flushBuffer(),(0,G.sendTagsIfNeed)(),I.Monitoring.telemetry(k.TelemetryName.STARTUP_OK,{param1:(0,F.getStarupTime)(),param2:(0,D.getSystemSettings)().chatHost,param3:n.userToken?"has_user_token":null}),(0,j.setRuleLocal)("sendStartupTime",null)},startup_error:e=>{switch(re.log("startup_error: ",null==e?void 0:e.err_code),x.appDispatchers.setLastChatStatus(B.ChatStatus.STARTUP_ERROR),e.err_code){case"deleted":x.clientDispatchers.resetClient(),x.appDispatchers.setLastChatStatus(null),l.default.destroy();break;case"blacklisted":x.appDispatchers.setChatStarted(!1),x.appDispatchers.setChatAccepted(!1),C.default.set("is_blacklisted",!0,86400),O.Router.next(A.RouterEvent.Hide),w.default.disableSoundPlayer();break;case"moved":(0,V.getNewConfig)();break;case"maintenance":(0,V.enableMaintenance)()}I.Monitoring.telemetry(k.TelemetryName.STARTUP_ERROR,{param1:(0,F.getStarupTime)(),param2:e.err_code||"no_err_code",param3:(0,D.getSystemSettings)().chatHost}),(0,j.setRuleLocal)("isVisitorInvite",!1),(0,j.setRuleLocal)("sendStartupTime",null)},maintenance:()=>{re.log("maintenance: save maintenance_time"),C.default.set("maintenance_time",Date.now(),86400)},resume_ok:e=>{re.log("resume_ok",e);const n=(0,D.getApp)(),r=(0,D.getClient)(),i=(0,D.getCallback)(),o=(0,D.getUserSettings)(),a=ne({clientId:e.jv_client_id},e.jv_sess_id?{sessionId:e.jv_sess_id}:null);if(x.clientDispatchers.updateClient(a),x.appDispatchers.setMaintenance(!1),x.appDispatchers.setIsInputDisabled(!1),x.appDispatchers.setLastChatStatus(B.ChatStatus.RESUME_OK),h.default.reloadStories(),c.HistoryStore.destroy(),(r.isIntroduced&&!n.isOnline||n.isOnline)&&((0,K.shouldRedirectToIntroduce)()||W.connectionAdapter.flushBuffer()),e.agents&&e.agents.length>0){let n=!1;if(e.agents.forEach((e=>{e.bot_id&&(n=e)})),n){const t=u.default.getBotById(n.bot_id);null!=t&&t.get("body.is_update_from_bot")?(x.appDispatchers.setChatAccepted(!0),x.appDispatchers.setAppIsOnline(!0)):(u.default.updateAgentList([n],e.state),x.botsDispatchers.addBot({avatarUrl:n.avatar_url||null,id:n.bot_id,name:n.display_name||null,title:n.title||null,type:n.type,isBot:!0})),x.chatsDispatchers.setJoinedBots([n.bot_id])}else x.chatsDispatchers.setJoinedAgents(e.agents);t.default.updateAgentInfo(e.agents),u.default.getAgentsByStatus("join").length&&(x.appDispatchers.setChatAccepted(!0),x.appDispatchers.setAppIsOnline(!0),x.appDispatchers.setLastChatOpened(!0))}else x.chatsDispatchers.setNoJoinedAgents(),x.appDispatchers.setLastChatOpened(!1),x.appDispatchers.setChatAccepted(!1),u.default.cleanBotsUpdate();const s=n.route;$.platform.isMobileOrTablet||$.platform.isChatPage||n.chatStarted||l.default.getCurrentChatMessages().length||!n.isOnline||s===A.Route.CALL||s===A.Route.CHAT_CALL||s===A.Route.LABEL||(0,D.getProactive)().text||O.Router.next(A.RouterEvent.CloseWindow);const d=e.client_info.cw_call;(0,F.setCallbackStatus)(d),d===b.CallStatus.WAIT&&h.default.startCallTimeout(),d&&(Object.assign(i,d),s===A.Route.CHAT_CALL||$.platform.isMobileOrTablet||O.Router.next(A.RouterEvent.ToCall),d.status!=b.CallStatus.CONNECTED&&d.status!=b.CallStatus.CONNECTING||(0,ee.resetDelayedCall)()),e.client_info.has_integration&&x.clientDispatchers.setHasIntegration(e.client_info.has_integration),e.assigned_agent_id&&x.clientDispatchers.setAssignedAgentId(e.assigned_agent_id),h.default.checkChatStarted(e.chat_started),(0,q.syncCSClientInfo)(e.client_info),m.messageActions.checkContactsForm(),m.messageActions.deleteMaintenanceMessage(),(0,M.updateHistory)(e),!(0,z.isNumber)(r.departmentId)||n.chatStarted||n.chatAccepted||(x.clientDispatchers.updateClient({departmentId:null}),o.departments&&(O.Router.setNext(A.Route.DEPARTMENTS),x.appDispatchers.setAppRoute(A.Route.DEPARTMENTS))),I.Monitoring.telemetry(k.TelemetryName.RESUME_OK,{param1:(0,F.getStarupTime)(),param2:e.chat_started,param3:r.userToken?"has_user_token":null,param4:e.last_msg_id}),(0,j.setRuleLocal)("sendStartupTime",null)},cw_wait:()=>{},cw_call_end:()=>{const e=(0,D.getCallback)();if(re.warn("cw_call_end",e),e.webRTCCallStatus){const e=(0,T.getActiveMessage)(b.WebRTCCallStatus.ACCEPTED);e&&x.messagesDispatchers.updateWebRTCCallStatus(e.private_id,b.WebRTCCallStatus.ENDED),x.callbackDispatchers.setActiveWebRTCCallMessageId(null),x.callbackDispatchers.setWebRTCCallStatus(null),x.callbackDispatchers.setCallbackStatus(b.CallStatus.ENDED),x.callbackDispatchers.setCallbackAvailable(!0),(0,v._callUserFunction)("onCallEnd",{result:"ok"}),I.Monitoring.telemetry(k.TelemetryName.CALL_END,{param1:"webrtc"})}else h.default.clearCallTimeout(),m.messageActions.systemCallMessage((0,p.l10n)("c_callDisconnected"),_.MessageName.CALL_END),x.callbackDispatchers.setCallbackStatus(b.CallStatus.ENDED),x.callbackDispatchers.setCallbackAvailable(!0),x.appDispatchers.setAppRoute(A.Route.CHAT),(0,v._callUserFunction)("onCallEnd",{result:"ok"}),I.Monitoring.telemetry(k.TelemetryName.CALL_END)},cw_connecting:()=>{(0,D.getCallback)().webRTCCallStatus?x.callbackDispatchers.setWebRTCCallStatus(b.CallStatus.CONNECTING):x.callbackDispatchers.setCallbackStatus(b.CallStatus.CONNECTING),(0,ee.resetDelayedCall)()},cw_connected:()=>{const e=(0,D.getCallback)();if(re.warn("cw_connected",e.webRTCCallStatus,e.activeWebRTCCallMessageId),!e.activeWebRTCCallMessageId){const e=(0,T.getActiveMessage)(b.WebRTCCallStatus.INITIAL);e&&x.messagesDispatchers.updateWebRTCCallStatus(e.private_id,b.WebRTCCallStatus.ACCEPTED)}e.webRTCCallStatus?(x.callbackDispatchers.setWebRTCCallStatus(b.CallStatus.CONNECTED),x.messagesDispatchers.updateWebRTCCallStatus(e.activeWebRTCCallMessageId,b.WebRTCCallStatus.ACCEPTED)):(x.callbackDispatchers.setCallbackStatus(b.CallStatus.CONNECTED),x.callbackDispatchers.setCallbackAvailable(!1)),(0,ee.resetDelayedCall)()},cw_error:e=>{const t=(0,p.l10n)(`cw_reason_${e.reason}`);let n=t;n&&n!=t||(n=(0,L.getCallDefaultError)());const r=(0,D.getCallback)();if(r.webRTCCallStatus){if(r.webRTCCallStatus!==b.CallStatus.ENDED){x.callbackDispatchers.setWebRTCCallStatus(b.CallStatus.ERROR);let e=r.activeWebRTCCallMessageId;if(!e){const t=(0,T.getActiveMessage)(b.WebRTCCallStatus.INITIAL);e=t&&t.private_id}x.messagesDispatchers.updateWebRTCCallStatus(e,b.WebRTCCallStatus.ERROR)}x.callbackDispatchers.setCallbackAvailable(!0),x.callbackDispatchers.setCallbackStatus(b.CallStatus.ERROR),x.callbackDispatchers.setActiveWebRTCCallMessageId(null),x.callbackDispatchers.setWebRTCCallStatus(null),O.Router.getCurrentRoute()===A.Route.CHAT_SETUP_CALL&&O.Router.next(A.RouterEvent.Cancel)}else h.default.clearCallTimeout(),x.messagesDispatchers.addMessage({text:n,type:_.MessageType.SYSTEM,from:_.MessageInitiator.SYSTEM,body:{type:_.MessageType.CALL,name:_.MessageName.CALL_END}}),x.callbackDispatchers.setCallbackAvailable(!0),x.callbackDispatchers.setCallbackStatus(b.CallStatus.ERROR),x.callbackDispatchers.setCallbackError(n),$.platform.isMobileOrTablet||O.Router.next(A.RouterEvent.ToCall);(0,v._callUserFunction)("onCallEnd",{result:"fail",reason:n}),I.Monitoring.telemetry(k.TelemetryName.CALL_ERROR,{param1:e.reason})},cw_call_requested:async e=>{if(!o.default.enable_webrtc_calls)return;const t=e.call_id,r=e.vox_user_login,i=e.vox_user_password,a=e.vox_node;x.callbackDispatchers.setCallbackAvailable(!1),x.callbackDispatchers.setWebRTCCallStatus(b.CallStatus.WAIT);const s=(await n.e(772).then(n.bind(n,51961))).default;f.default.getInstance().managers.webRTCCall=new s(f.default.getInstance(),t,r,i,a),o.default.enable_webrtc_separate_window||f.default.getInstance().managers.webRTCCall.setupSdk(),(0,H.addWebRTCCallMessage)(),(0,Y.openChatOnMessage)()},agentMessage:(e,n)=>{var r;re.log("agentMessage",e),(0,D.getApp)().isOnline||t.default.setOnline(),m.messageActions.saveLastSystemMessage(),e.media&&(e.media.status=_.MediaStatus.COMPLETE);const i={text:e.message||e.text,type:e.media?_.MessageType.MEDIA:_.MessageType.MESSAGE,from:e.from,from_id:e.from_id,private_id:e.private_id||(0,a.generateGUID)(),msg_id:e.msg_id,chat_id:e.chat_id,meta:e.meta,body:e.media||{},replied_message:e.replied_message};var s;n&&(0,X.isAssistantBot)()&&(i.body.bot_message_type=null===(s=e.body)||void 0===s?void 0:s.type);const l=e.type==_.MessageType.LISTPICKER;if(n){var c;if(l)i.text=(e.body.text||e.body.title).trim(),null!==(c=e.body)&&void 0!==c&&c.is_markdown&&(i.body.is_markdown=!0);e.is_markdown&&(i.body.is_markdown=!0);const t=u.default.getBotById(e.from_id);if(null!=t&&t.get("body.is_update_from_bot")&&(i.body.agent_info=t.toJSON()),e.type==_.MessageType.INVITE){if((0,X.isAssistantBot)())return;if(i.type=_.MessageType.SYSTEM,i.text=(0,p.l10n)("botTransferChat"),I.Monitoring.telemetry(k.TelemetryName.BOT_TRANSFER_CHAT),(0,Y.isNeedShowBotForm)(o.default))return void m.messageActions.handleBotContactsForm()}else I.Monitoring.telemetry(k.TelemetryName.CLIENT_MESSAGE_BOT)}x.messagesDispatchers.addMessage(i),l&&(i.type=_.MessageType.LISTPICKER,i.body=e.body,i.msg_id=e.msg_id+.1,i.body&&i.body.force_reply&&x.appDispatchers.setIsInputDisabled(!0),x.messagesDispatchers.addMessage(i)),(0,Y.agentMessageAck)([e.msg_id],e.chat_id),x.clientDispatchers.updateClient({lastMessage:null}),h.default.agentTyping(0),x.appDispatchers.setLastMsgTime((new Date).getTime()),(0,Y.openChatOnMessage)(),(0,Y.sendAgentMessageTelemetry)((0,X.isAssistantBot)()?null===(r=i.body)||void 0===r?void 0:r.bot_message_type:null)},update_agent_info:e=>{(0,D.getApp)().isOnline||t.default.setOnline();const n=e.agent_info,r=u.default.getAgentsByStatus("join").map((e=>{const t=e.store;return t.agent_id===n.agent_id?n:t}));t.default.updateAgentInfo([n]),x.chatsDispatchers.setJoinedAgents(r)},invoice:e=>{re.log("invoice",e),x.messagesDispatchers.addMessage({type:"invoice",msg_id:e.invoice.msg_id,from:"agent",body:{type:e.invoice.gateway_system+"Invoice",comment:e.invoice.comment,amount:e.invoice.amount,invoice_id:e.invoice.invoice_id,payment_url:e.invoice.payment_url,status:e.status,currency:e.invoice.currency}})},agent_chat_close:()=>{x.appDispatchers.setChatStarted(!1),x.appDispatchers.setChatAccepted(!1),x.appDispatchers.setIsInputDisabled(!1),l.default.closeChat(),x.chatsDispatchers.setNoJoinedAgents(),x.appDispatchers.setLastChatOpened(!1),x.chatsDispatchers.setChatEvaluated(!1),x.clientDispatchers.updateClient({departmentId:null}),s.default.reset(),u.default.cleanBotsUpdate(),(0,D.getApp)().route===A.Route.CHAT_MIN&&(O.Router.setNext(A.Route.LABEL),(0,Q.reloadTransitionStore)()),I.Monitoring.telemetry(k.TelemetryName.AGENT_CHAT_CLOSE)},agent_service_message:e=>{re.warn("unhandled agent_service_message",e)},agent_typing:e=>{(0,D.getApp)().isOnline||t.default.setOnline(),h.default.agentTyping(e.typing)},update_client_info:e=>{re.warn("update_client_info",e);const t={};e.avatar_url&&(t.avatarUrl=e.avatar_url),e.display_name&&(t.displayName=e.display_name),e.assigned_agent_id&&(t.assignedAgentId=e.assigned_agent_id),e.email&&(t.email=e.email),e.phone&&(t.phone=e.phone),o.default.bots&&(e.email||e.phone)&&(t.isIntroduced=!0),e.custom_data&&e.custom_data.length>0&&x.clientDispatchers.setCustomData(e.custom_data),x.clientDispatchers.setClientContacts(t)},update_client_id:e=>{re.log("update_client_id",e);(0,D.getClient)().clientId!==e.jv_client_id&&(x.clientDispatchers.setClientId(e.jv_client_id),(0,M.updateHistory)(e),I.Monitoring.telemetry(k.TelemetryName.UPDATE_CLIENT_ID))},message_state:e=>{(0,Z.messageState)(e)},blacklist:()=>{C.default.set("is_blacklisted",!0,86400),x.appDispatchers.setChatStarted(!1),x.appDispatchers.setChatAccepted(!1),O.Router.next(A.RouterEvent.Hide),w.default.disableSoundPlayer()},disconnecting:()=>{E.default.stopBlinking()},offline:()=>{const e=W.connectionAdapter.findInBuffer("name","client_message_campaign");if(e)return W.connectionAdapter.removeFromBuffer(e),void re.log("Skip offline action after campaign reaction");(0,D.getApp)().isOnline&&m.messageActions.sendNoAgentsOnline(),(0,P.setOfflineIntroduced)(),!(0,D.getClient)().isIntroduced||(0,P.needIntroduceInOffline)()?(o.default.bots||o.default.enable_bot_offline||(0,X.isAssistantBot)()||(x.appDispatchers.setAppIsOnline(!1),x.appDispatchers.setIsInputDisabled(!0),m.messageActions.handleContactsForm(!0)),I.Monitoring.telemetryOnce(k.TelemetryName.FORCE_OFFLINE)):((0,D.getApp)().isOnline&&x.appDispatchers.setAppIsOnline(!1),S.default.trackOfflineMessageSent())},update_client:e=>{e.has_integration&&(0,d.hasIntegration)(e.has_integration)&&(x.clientDispatchers.setHasIntegration(e.has_integration),x.messagesDispatchers.addMessage({text:(0,p.l10n)("social_success_"+e.has_integration),type:_.MessageType.SYSTEM,body:{type:_.MessageType.SOCIAL}}),(0,Y.openChatOnMessage)(),I.Monitoring.telemetry(k.TelemetryName.SOCIAL_HAS_INTEGRATION+e.has_integration),(0,d.isChatContactForm)()&&I.Monitoring.telemetry(k.TelemetryName.CHAT_INTRODUCE_SOCIAL,{param1:"connect_"+e.has_integration}))},connect_failed:()=>{re.log("connect_failed")},offline_ack:e=>{m.messageActions.offlineAck(e)},agent_message:e=>{(0,D.getApp)().isOnline||t.default.setOnline(),e.meta&&t.default.agentMessage(e)},chat_message:e=>{var n;re.log("chat_message",e);const r=(0,D.getApp)(),i=e.params;if(r.isOnline||t.default.setOnline(),i.from!==_.MessageInitiator.CLIENT||null===(n=i.media)||void 0===n||!n.address)if(-1!==["join","left"].indexOf(i.type))h.default.updateChatAgent(e);else{const e=i.from===_.MessageType.BOT;if((i.from===_.MessageInitiator.AGENT||e)&&t.default.agentMessage(i,e),i.from===_.MessageInitiator.CLIENT){const e=(0,g.filterMessage)(i),t=(0,D.getMessageByPrivateId)(i.private_id);if(i.private_id&&t&&x.messagesDispatchers.updateMessage({privateId:t.private_id},{chat_id:i.chat_id,msg_id:i.msg_id}),e&&!t){const e=i.private_id?i.private_id:(0,a.generateGUID)();x.messagesDispatchers.addMessage(ne(ne(ne({from:_.MessageInitiator.CLIENT,text:i.text,type:_.MessageType.MESSAGE,private_id:e,status:_.MessageStatus.DELIVERED},i.chat_id?{chat_id:i.chat_id}:null),i.msg_id?{msg_id:i.msg_id}:null),i.media?{media:i.media}:null))}e&&(0,Y.openChatOnMessage)()}}},chat_message_update:e=>{const t=e.params,n=t.msg_id,r=(0,D.getMessageById)(n);if(re.log("chat_message_update",e,n,r),r)if(t.deleted){x.messagesDispatchers.updateMessage({messageId:r.msg_id},{status:_.MessageStatus.DELETED,type:_.MessageType.MESSAGE,body:null});n===(0,D.getApp)().quoteMsgId&&x.appDispatchers.setQuoteMsgId(null)}else t.updated_ts&&x.messagesDispatchers.updateMessage({messageId:r.msg_id},{updated_ts:1e3*t.updated_ts,text:t.text})},agents_list_updated:e=>{if(re.log("agents_list_updated"),(0,D.getApp)().isOnline||t.default.setOnline(),e.params.length){if(1===e.params.length){const t=e.params[0];Object.assign(s.default,t),t.bot_id||x.clientDispatchers.setPaId(t.agent_id)}t.default.updateAgentInfo(e.params),x.chatsDispatchers.setJoinedAgents(e.params),x.agentsDispatchers.initAgentStore(u.default.toReduxFormat())}},rate:e=>{const t=e.chat_id;(0,Y.needToRateForm)(t)},updateAgentInfo:e=>{if(re.log("updateAgentInfo",e),1===e.length){const t=e[0];Object.assign(s.default,{agent_id:t.agent_id||0,bot_id:t.bot_id||0,display_name:t.display_name,title:t.title||null,avatar_url:t.avatar_url||null,state:(0,D.getApp)().chatAccepted?"join":"left"}),t.bot_id||(x.agentsDispatchers.updateAgent({id:t.agent_id||t.bot_id,name:t.display_name,title:t.title,avatarUrl:t.avatar_url||null,isBot:!!t.bot_id}),x.clientDispatchers.setPaId(t.agent_id))}},setOnline(){x.appDispatchers.setAppIsOnline(!0)},client_message_error:e=>{I.Monitoring.telemetry(k.TelemetryName.CLIENT_MESSAGE_ERROR,{param1:(null==e?void 0:e.error)||"empty"})},client_message_ack:()=>{}};t.default=ie},15787:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.sendIntroduceAndMessage=t.sendClientAnswerTelemetry=t.sendApiIntroduce=t.sendAgentMessageTelemetry=t.openChatOnMessage=t.needToRateForm=t.isNeedShowBotForm=t.connectionTypingInsight=t.connectionReadyForMessages=t.connectionClientTyping=t.checkCustomData=t.agentMessageRead=t.agentMessageAck=void 0;var i=r(n(61125)),o=n(36113),a=r(n(96394)),s=n(50402),l=r(n(19955)),u=n(21476),c=n(97490),d=r(n(22541)),f=r(n(71277)),p=n(54415),h=n(83170),g=r(n(35802)),_=n(65465),m=r(n(23116)),v=r(n(4855)),y=r(n(14264)),b=n(26932),E=n(55329),C=n(43914),T=n(44145),D=n(33813),w=n(41504),S=n(13077),O=n(81152),A=n(84727),I=n(34445),k=n(91225),M=n(49963),x=n(79523),P=n(32183),R=n(23267),N=n(42634),L=n(91920);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.fromHistory,n=e.isNoMessage,r=void 0!==n&&n;if(r||(0,C._callUserFunction)("onMessageReceived"),!t)if((0,P.pageVisible)()||d.default.startBlinking(),f.default.play("agent_message"),(0,T.getUserSettings)().labelBubble&&a.default.enable_spa_navigate)B.warn("Ignore openChatOnMessage show counter.");else if(l.default.desktop()&&(!(0,L.hasCustomLabel)()||"function"!=typeof(0,R.getPageWindow)().jivo_onMessageReceived)){(0,k.isChatInputRoute)((0,T.getApp)().route)||u.Router.next(c.RouterEvent.ToChat),u.Router.getPrevRoute()===c.Route.CHAT_MIN?b.transitionDispatchers.startTransition(s.ScriptName.MAXIMIZE_WIDGET):b.transitionDispatchers.startTransition(s.ScriptName.OPEN_WIDGET);const e=setInterval((()=>{(0,D.fixSafariKeyframes)()}),50);setTimeout((()=>{clearInterval(e)}),300)}};t.sendAgentMessageTelemetry=e=>{p.Monitoring.telemetry(h.TelemetryName.AGENT_MESSAGE,{param1:(0,E.getPrechatUseTime)(),param2:m.default.isActive&&(0,k.isChatInputRoute)((0,T.getApp)().route)?"visible":"hide",param3:e||O.MessageType.MESSAGE})};t.sendClientAnswerTelemetry=e=>{B.warn("sendClientAnswerTelemetry",e);const t=y.default.getLastMessage();if(t){const n=t.get("body.bot_message_type"),r=(0,A.validateClientAnswer)(n,e.text);p.Monitoring.telemetry(h.TelemetryName.CLIENT_MESSAGE_ASSISTANT,{param1:n,param2:r?"valid":"not_valid",param3:e.text})}};t.isNeedShowBotForm=e=>{const t=e.lastStatus;return!((t&&t.agents?t.agents.length:0)>0&&2==e.contacts_ask)&&(e.bots&&e.enable_bot_offline)};t.checkCustomData=e=>{g.default.getInstance()&&e&&(M.connectionAdapter.sendEventIfConnected(new w.UpdateCustomData(e)),e&&b.clientDispatchers.setCustomData(e))};t.sendApiIntroduce=e=>{const t=(0,S.getRuleLocal)("lastContactApiData"),n={client_name:e.name||e.client_name,phone:e.phone,email:e.email,description:e.description};return(0,o.shallowEqual)(j(j({},n),{},{message:e.message}),t)?(B.error("setContactInfo same client contacts",t),!1):(e.message&&_.messageActions.sendClientMessage({text:e.message}),x.introduceActions.setClientContactInfo(n,!0),e.message&&(n.message=e.message),(0,S.setRuleLocal)("lastContactApiData",n),!0)};t.sendIntroduceAndMessage=(e,t)=>{t&&_.messageActions.sendClientMessage({text:t}),b.clientDispatchers.updateClient({lastMessage:null}),x.introduceActions.setClientContactInfo(e,!1,!0)};t.needToRateForm=(e,t)=>{B.warn("needToRateForm",e,t);const n=y.default.getMessagesByType(O.MessageType.RATE_FORM);if(n.length&&n[0]&&n[0].get("chat_id")==e)return;const r=(0,T.getUserSettings)().rateSettings;e&&r&&(0,N.pushRateForm)(e,r.conditionName,t)};t.agentMessageRead=(e,t)=>{d.default.stopBlinking(),M.connectionAdapter.sendEvent(new w.AgentMessagesRead(e,t))};t.agentMessageAck=(e,t)=>{M.connectionAdapter.sendEvent(new w.AgentMessagesAck(e,t))};const U=()=>M.connectionAdapter.isConnected()&&[I.ChatStatus.STARTUP_OK,I.ChatStatus.RESUME_OK].includes((0,T.getApp)().lastChatStatus);t.connectionReadyForMessages=U;let W="";t.connectionTypingInsight=e=>{(0,T.getFeatures)().typingInsight&&W!==e&&(W=e,U()&&M.connectionAdapter.sendEvent(new w.ClientServiceMessage(e)))};let H=0;t.connectionClientTyping=e=>{const t=e?1:0;H!==t&&(H=t,U()&&M.connectionAdapter.sendEvent(new w.ClientTyping(t)))}},91275:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(96394)),o=r(n(95003)),a=n(69882),s=n(16016),l=r(n(19955)),u=r(n(138)),c=r(n(14264)),d=r(n(14762)),f=n(20344),p=r(n(4855)),h=n(21476),g=n(97490),_=n(81152),m=n(65465),v=n(80161),y=n(54415),b=n(83170),E=n(43914),C=n(62096),T=n(26932),D=n(31984),w=n(47138),S=n(50402),O=r(n(79868)),A=r(n(71323)),I=r(n(74379)),k=n(44145),M=r(n(73687)),x=n(23336),P=n(91225),R=n(41504),N=n(41168),L=n(62162),F=n(15787),j=n(49963),B=n(79523),U=n(25516),W=n(44145),H=n(95856),G=n(3296);const V=p.default.name("Actions");let z=null,$=null,Z=!1;const q={startCallDebounce:function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(V.warn("startCallDebounce",e,n),t.default.startCallTimeout(),["cw_wait","cw_connecting","cw_connected"].indexOf((0,k.getCallback)().status)>=0)return void V.log("already calling");const i=(0,D.getPhoneNumberInfo)(e);i?T.clientDispatchers.setClientPhone("+"+i.phoneCode+i.innerNumber):T.clientDispatchers.setClientPhone(e);const o=(0,k.getClient)(),a=(0,k.getApp)(),s=(0,W.getFeatures)();B.introduceActions.sendIntroduction({name:o.name,phone:o.phone,email:o.email,description:o.description}),(0,D.checkStartCall)({phone:e,invitationText:r,clientToken:o.clientId,requestGRecaptchaToken:Boolean(s.recaptcha)},((r,i)=>r?(t.default.setCallError(),y.Monitoring.telemetry(b.TelemetryName.CALL_ERROR,{param1:"in request"})):((i=i.data)||(V.log("Wrong response from telephony"),i={ok:!1,error_list:["wrong_response"]}),i.only_forward?(T.callbackDispatchers.setCallbackStatus(w.CallStatus.ERROR),void T.callbackDispatchers.setCallbackError((0,f.l10n)("cw_call_forward"))):void(i.ok?(T.appDispatchers.setChatStarted(!0),T.appDispatchers.setChatAccepted(!0),T.callbackDispatchers.setCallbackStatus(w.CallStatus.WAIT),m.messageActions.handleContactsForm(),m.messageActions.systemCallMessage(`${(0,f.l10n)("cw_call_to")} ${(0,D.getMaskedPhone)(e)}`,_.MessageName.CALL_MESSAGE_START),(0,E._callUserFunction)("onCallStart"),u.default.trackCallWidgetRequested(),y.Monitoring.telemetry(b.TelemetryName.CALL_START,{param1:n}),(0,H.reloadTransitionStore)()):(t.default.setCallError(),y.Monitoring.telemetry(b.TelemetryName.CALL_ERROR,{param1:i.error_list.join(" ")}),i.work_time&&i.work_time.schedule&&((0,G.initDelayedCall)(i.work_time),h.Router.next(g.RouterEvent.ToCall),y.Monitoring.telemetry(b.TelemetryName.CALL_START,{param1:n})),l.default.mobileOrTablet()||a.route!==g.Route.LABEL||h.Router.next(g.RouterEvent.Navigate))))))},requestCWAvailable:e=>{const t=(0,k.getApp)();M.default.get("is_blacklisted")||t.route==g.Route.HIDDEN||(t.maintenance?T.callbackDispatchers.setCallbackAvailable(!1):(V.warn("requestCWAvailable"),(0,D.callWidgetPing)((t=>{T.callbackDispatchers.setCallbackAvailable(t.ok),t.work_time&&(0,G.initDelayedCall)(t.work_time),(0,k.getCallback)().available&&"function"==typeof e&&e()}),t.chatStarted)))},requestApiCWAvailable:e=>{(0,D.callWidgetPing)((t=>{if(T.callbackDispatchers.setCallbackAvailable(t.ok),(0,k.getCallback)().available&&"function"==typeof e)e({result:"ok"});else{const n=t.error_list?t.error_list.join(" "):"Call request error";e({result:"fail",reason:n})}}),(0,k.getApp)().chatStarted)},pingAndOpenCall:()=>{V.info("pingAndOpenCall"),j.connectionAdapter.checkConnection((()=>{const e=(0,k.getApp)();(0,D.callWidgetPing)((e=>{T.callbackDispatchers.setCallbackAvailable(e.ok),e.ok&&(0,k.getApp)().route===g.Route.LABEL&&(T.userDispatchers.setCallHeaderText(null),[w.CallPopupStatus.ENABLED,w.CallPopupStatus.ONLY_BUTTON_CLICK].includes((0,k.getCallback)().separateForm)&&l.default.desktop()?h.Router.next(g.RouterEvent.ToCallPopup):(h.Router.next(g.RouterEvent.ToCall),l.default.desktop()&&T.transitionDispatchers.startTransition(S.ScriptName.OPEN_WIDGET)),y.Monitoring.telemetryOnce(b.TelemetryName.API_CALL_OPEN))}),e.chatStarted)}))},openChatCallbacks(){V.log("openChatCallbacks"),(0,k.getApp)().isOnline?u.default.trackChatOpenedByClick():u.default.trackOfflineFormOpenedByClick(),(0,E._callUserFunction)("onOpen")},startCall:(e,n,r)=>{V.log("startCall from chat",e),j.connectionAdapter.checkConnection((()=>{t.default.startCallDebounce(e.replace(/\D+/g,""),n,r)}))},markEvaluated:()=>{T.chatsDispatchers.setChatEvaluated(!0)},updateTitle:(e,t)=>{if(V.log("updateTitle",e),!window||!window.location)return void V.log("no window");if(l.default.mobileOrTablet()&&(0,k.getApp)().route!==g.Route.LABEL)return;const n=t||(0,a.getCurrentPage)().url;V.log("updateTitle url",n),(0,F.connectionReadyForMessages)()&&j.connectionAdapter.sendEvent(new R.UrlChange(n,(0,s.setSubstrTitle)(e)))},submitShowEula:e=>{if(v.RouterUtils.needToShowEula()){const t=(0,D.getMaskedPhone)(e);return A.default.showEula(`${(0,f.l10n)("eula_phone")}\n${t}`,null,"cb"),h.Router.next(g.RouterEvent.Submit,{context:"cb"}),!0}return!1},reloadStories:()=>{o.default.reload(),(0,H.syncRouter)()},agentTyping(e){0==e?clearTimeout(z):z=setTimeout((()=>{t.default.agentTyping(0)}),3e3),T.chatsDispatchers.setAgentTyping(e)},updateChatAgent:e=>{const t=e.params,n=d.default.getAgentById(t.from_id);n?(n.set("body.state",t.type),T.messagesDispatchers.addMessage({type:"system",body:{from_id:t.from_id,action:t.type,type:"chat"},msg_id:t.msg_id,chat_id:t.chat_id})):V.error("updateChatAgent: No agent info in agents store.")},clearCallTimeout:()=>{$&&clearTimeout($)},startCallTimeout:()=>{t.default.clearCallTimeout();const e=(0,k.getCallback)();$=setTimeout((()=>{["cw_wait","cw_connecting"].indexOf(e.status)>=0&&t.default.setCallError()}),24e4)},setCallError:()=>{const e=(0,N.getCallDefaultError)();T.callbackDispatchers.setCallbackStatus(w.CallStatus.ERROR),T.callbackDispatchers.setCallbackError(e),T.messagesDispatchers.addMessage({text:e,type:_.MessageType.SYSTEM,from:_.MessageInitiator.SYSTEM,body:{type:_.MessageType.CALL,name:_.MessageName.CALL_END}})},initReduxStores(){var e,t;const n=(0,a.getChatPageToken)(),r=(0,k.getApp)().isInputDisabled;if(n&&T.clientDispatchers.setUserToken(n),i.default.joint||T.clientDispatchers.setHasIntegration(!1),T.callbackDispatchers.setSeparateForm(null===(e=i.default.callback_settings)||void 0===e?void 0:e.separate_form),null!==(t=i.default.callback_settings)&&void 0!==t&&t.time||T.callbackDispatchers.setCallbackAvailable(!1),V.log("initReduxStores",o.default),T.appDispatchers.initAppStore({isFocused:o.default.is_focused,isOnline:o.default.is_online,route:o.default.route,tabRoute:null,lastChatOpened:o.default.lastChatOpened,isInputDisabled:r,maintenance:i.default.maintenance,chatOpenByClient:!1,chatStarted:o.default.chat_started,chatAccepted:o.default.chat_accepted,lastMsgId:o.default.lastMsgId,lastMsgTime:o.default.lastMsgTime,started:o.default.started,showEula:o.default.show_eula,viReconnectTime:o.default.viReconnectTime,didFreezeData:o.default.didFreezeData,lastChatStatus:o.default.lastChatStatus,quoteMsgId:o.default.quoteMsgId,hiddenByRules:o.default.hiddenByRules}),(0,x.setOfflineIntroduced)(),l.default.mobileOrTablet()){if(o.default.route==g.Route.HIDDEN)return;I.default.checkZooms()}else{const e=(0,W.getUserSettings)(),t=e.widgetOrientation,n=e.widgetPadding;(0,U.fixPositionDragData)(t,n)}if(i.default.bots&&i.default.bots.length){const e=i.default.bots[0];T.botsDispatchers.addBot({avatarUrl:e.avatar_url||null,id:e.bot_id,name:e.display_name||null,title:e.title||null,isBot:!0,type:e.type})}d.default.toReduxFormat().length&&(T.agentsDispatchers.initAgentStore(d.default.toReduxFormat()),T.botsDispatchers.initBotsStore(d.default.toReduxFormat())),T.messagesDispatchers.initMessagesStore(),T.chatsDispatchers.initChatsStore(),(0,H.reloadTransitionStore)();const s=(0,k.getProactive)();if(s.text){const e=(0,L.getProactiveAgent)(s);V.warn("restore agent proactiveData",e),e&&(0,L.addProactiveAgent)(e)}},reloadTransitionStore(){const e=(0,k.getApp)().route;let t=(0,P.isContainerRoute)(e)?S.ScriptName.OPEN_WIDGET:S.ScriptName.CLOSE_WIDGET;e===g.Route.CALL_POPUP&&(t=S.ScriptName.CLOSE_WIDGET),(0,P.isMinRoute)(e)&&(t=S.ScriptName.MIN_WIDGET),t==S.ScriptName.OPEN_WIDGET&&C.reduxStore.getState().transition.currentScript==S.ScriptName.MAXIMIZE_WIDGET||T.transitionDispatchers.initTransitionStore({currentScript:t})},getCurrentChatStatus(){return(0,k.getApp)().chatAccepted?w.ChatState.ACCEPTED:(0,k.getApp)().chatStarted?w.ChatState.STARTED:w.ChatState.NOT_STARTED_OR_CLOSED},checkChatStarted(e){(0,k.getApp)().isOnline||(V.log("checkChatStarted for offline."),T.appDispatchers.setLastChatOpened(e),c.default.store.length||e||T.appDispatchers.setChatStarted(!1))},initSocial(){Z||(O.default.startSocials(),Z=!0)}};var K=q;t.default=K},54346:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.reportVisitorSentTelemetry=t.markInvitationAnswered=t.isAssistantBot=t.checkTrackClientAnswer=t.callInitiateChat=t.addWebRTCCallMessage=void 0;var i=r(n(138)),o=r(n(14264)),a=n(78692),s=n(26932),l=n(55329),u=n(54415),c=n(83170),d=n(44145),f=n(97939),p=n(43914),h=n(48999),g=n(62162),_=n(16016),m=n(81152),v=n(47138),y=n(26932),b=n(43902),E=n(12398);const C=()=>{const e=(0,d.getApp)().isOnline,t=(0,d.getClient)().isIntroduced;(e||t)&&(i.default.trackClientInitChat(),(0,p._callUserFunction)("onClientStartChat"))};t.callInitiateChat=C;const T=()=>{(0,d.getApp)().chatStarted||C();const e=o.default.getCurrentChatAgentMessages(),t=o.default.getCurrentClientMessages();t&&!t.length&&e&&e.length&&i.default.trackClientAnswerAgentChatRequest()};t.checkTrackClientAnswer=T;t.markInvitationAnswered=()=>{const e=(0,d.getProactive)(),t=e.name,n=e.campaignId;if(s.proactiveDispatchers.setPrechats(null),t){if(n){b.StatsManager.send({campaignId:n},"chat_init");const e=(0,h.getCampaignById)(n);null!=e&&e.tag_id&&((0,E.addClientTag)(e.tag_id),(0,E.sendTagsIfNeed)())}(0,g.acceptProactive)(),s.proactiveDispatchers.setName(null),u.Monitoring.telemetry(c.TelemetryName.INVITE_ACCEPTED)}T(),a.ApiInvitationsManager.isInitialized()&&a.ApiInvitationsManager.hasInvitations()&&a.ApiInvitationsManager.markInvitationsAnswered()};t.reportVisitorSentTelemetry=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=o.default.getChatCounts(),n=(0,l.prechatUsed)()?"prechat_used":"from_input",r={param1:t>0?"old":"new",param2:n,param3:(0,d.getUserSettings)().locale,param4:e?"media":"text"};u.Monitoring.telemetry(c.TelemetryName.VISITOR_MSG_SENT,r)};t.isAssistantBot=()=>{const e=(0,d.getBots)();return e.length&&e[0].type===f.BotType.ASSISTANT};t.addWebRTCCallMessage=()=>{const e=(0,d.getChats)(),t=e[e.length?e.length-1:0],n=t&&t.joinedAgents[0],r=(0,_.generateGUID)(),i={from:m.MessageInitiator.AGENT,type:m.MessageType.WEB_RTC_CALL,status:m.MessageStatus.DELIVERED,from_id:n,private_id:r,body:{webRTCCallStatus:v.WebRTCCallStatus.INITIAL}};y.messagesDispatchers.addMessage(i),y.callbackDispatchers.setActiveWebRTCCallMessageId(r),y.messagesDispatchers.updateWebRTCCallStatus(r,v.WebRTCCallStatus.INITIAL)}},65465:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.messageActions=void 0;var i=r(n(33119)),o=r(n(92664)),a=r(n(26754)),s=n(44145),l=n(92560),u=r(n(19955)),c=r(n(14264)),d=r(n(79868)),f=r(n(4855)),p=n(21476),h=n(52028),g=n(13077),_=n(81722),m=r(n(35802)),v=n(20344),y=n(26932),b=n(83170),E=n(54415),C=r(n(96394)),T=n(69882),D=n(16016),w=n(43914),S=n(81152),O=n(97490),A=n(55329),I=n(97615),k=n(9550),M=n(62162),x=n(15787),P=n(54346),R=n(80161),N=n(49963),L=n(31343),F=n(50188),j=n(73422),B=n(44145),U=n(5895),W=n(8717),H=n(54346);const G=f.default.name("MessageActions");let V=function(){function e(){(0,i.default)(this,e),this.cacheOfflineMsg={},this.formTimeout=null,this.clientSendingFirstMessage=!1}return(0,o.default)(e,[{key:"systemMessage",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];G.log("systemMessage",e,t);const r={type:"text"!==t?"call":t,name:t};n||(r.unsave=!0),y.messagesDispatchers.addMessage({text:e,type:S.MessageType.SYSTEM,body:r})}},{key:"testMessage",value:function(e){y.messagesDispatchers.addMessage({text:e,type:S.MessageType.FOR_TEST,from:S.MessageInitiator.AGENT})}},{key:"botMessage",value:function(e){G.log("botMessage",e),y.messagesDispatchers.addMessage({type:S.MessageType.PREFORM,text:e,from:S.MessageInitiator.FORM})}},{key:"messageOnce",value:function(e,t,n,r){const i=this.checkIfMessageExists(e,t);if(G.log("messageOnce",i),!i)switch(e){case S.MessageType.SYSTEM:this.systemMessage(t,n,r);break;case S.MessageType.PREFORM:this.botMessage(t);break;case S.MessageType.FOR_TEST:this.testMessage(t)}}},{key:"systemMessageOnce",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.messageOnce(S.MessageType.SYSTEM,e,t,n)}},{key:"botMessageOnce",value:function(e){this.messageOnce(S.MessageType.PREFORM,e)}},{key:"checkIfMessageExists",value:function(e,t){const n=(0,s.getMessages)();if(!n.length)return!1;const r=n.find((n=>{const r=n.type===e,i=!t||n.text===t;return r&&i}));return r||!1}},{key:"_sendClientMessageBase",value:async function(e){let t=e.text,n=e.privateId,r=e.repliedMsgId,i=e.buttonId;G.warn("_sendClientMessageBase",t,n);const o=n||(0,D.generateGUID)();R.RouterUtils.showDepartmentsIfPossible()&&y.clientDispatchers.setDepartmentId(0),(0,H.markInvitationAnswered)(),(0,M.saveLastProactive)(),this.saveLastSystemMessage();const a={name:"client_message",message:t,private_id:o},l=(0,s.getApp)(),u=(0,s.getClient)();(0,j.isNumber)(u.departmentId)&&0!==u.departmentId&&(a.widget_department_id=u.departmentId),r&&(a.replied_msg_id=r),i&&(a.button_id=i);const f=!(0,H.isAssistantBot)()&&!u.isIntroduced&&!l.isOnline;if((0,W.shouldRedirectToIntroduce)())return void p.Router.next(O.RouterEvent.ToIntroduce);let _=null;if(!n){const e={from:S.MessageInitiator.CLIENT,text:t,type:f?S.MessageType.TEMPORARY:S.MessageType.MESSAGE,private_id:o,status:S.MessageStatus.SENT};(0,A.prechatUsed)()&&(e.body={is_prechat:!0}),r&&(e.replied_message=c.default.getMessageById(r).toJSON()),(0,H.isAssistantBot)()&&(0,x.sendClientAnswerTelemetry)(e),_=c.default.push(e),y.messagesDispatchers.addMessage(e,!0)}if(1!==c.default.getClientMessages().length||this.clientSendingFirstMessage||(this.clientSendingFirstMessage=!0,(0,w._callUserFunction)("onMessageSent")),(0,T.isWixEditor)()||h.isDesignerEditor)G.warn("send message disabled.");else if(!_&&n&&(_=c.default.getMessageByPrivateId(n)),(0,A.prechatEnabled)()&&((0,A.prechatUsed)()&&(a.is_prechat_btn=!0),this.deletePrechatMsg()),3==C.default.contacts_ask&&d.default.isLoginned()&&this.initSocial(),this.startContactFormIfNeed(),(0,W.shouldRedirectToIntroduce)())p.Router.next(O.RouterEvent.ToIntroduce);else{if((0,g.getRuleLocal)("firstMessageTime")||(0,g.setRuleLocal)("firstMessageTime",new Date),_){if(f)return;setTimeout((()=>{(0,U.checkForDelivered)(_.get("private_id"))}),L.Timeouts.MESSAGE_SEND_ERROR_TIMEOUT)}y.appDispatchers.setChatStarted(!0),y.appDispatchers.setLastMsgTime((new Date).getTime()),N.connectionAdapter.isConnected()||await N.connectionAdapter.openConnect(null,!0),(0,x.connectionReadyForMessages)()&&N.connectionAdapter.sendEvent(a),(0,P.reportVisitorSentTelemetry)(),r&&E.Monitoring.telemetry(b.TelemetryName.REPLY_BUTTON_SEND)}}},{key:"startContactFormIfNeed",value:function(){this.needToShowContactsForm()&&!C.default.bots&&this.startFormSequence((0,s.getApp)().isOnline?(0,v.l10n)("lblIntroduceRequest"):(0,v.l10n)("offlineIntroductionText"))}},{key:"needToShowContactsForm",value:function(){if(G.warn("needToShowContactsForm"),(0,H.isAssistantBot)())return!1;const e=(0,s.getApp)(),t=(0,s.getClient)(),n=(0,s.getUserSettings)();return!t.isIntroduced&&!a.default.bot_id&&(-1!==[k.ContactsType.DURING_CHAT,k.ContactsType.DURING_CHAT_NO_CLOSE].indexOf(n.contactsAsk)||!e.isOnline)&&!c.default.getFormMessage().length&&c.default.getClientMessages().length}},{key:"checkContactsForm",value:function(){if(this.needToShowContactsForm()){const e=(0,v.l10n)("lblIntroduceRequest"),t=this.checkIfMessageExists(S.MessageType.PREFORM,e);if(t||this.botMessage(e),t){const e=c.default.getMessageByPrivateId(t.private_id);e&&e.set("created_ts",(new Date).getTime())}this.addContactsForm()}}},{key:"addContactsForm",value:function(){G.warn("addContactsForm");const e=this.checkIfMessageExists(S.MessageType.FORM);if(e){const t=c.default.getMessageByPrivateId(e.private_id);t&&t.set("created_ts",(new Date).getTime()+1)}else y.messagesDispatchers.addMessage({type:S.MessageType.FORM,from:S.MessageInitiator.FORM}),this.addSocialTelemetry()}},{key:"saveLastSystemMessage",value:function(){const e=c.default.getLastMessage();e&&"system"==e.get("type")&&e.get("body")&&e.get("body").unsave&&e.set("body",null)}},{key:"addSocialTelemetry",value:function(){const e=d.default.getJoints().links;let t="";e.vkUrl&&e.fbUrl&&(t="show_vkfb"),e.vkUrl&&!e.fbUrl&&(t="show_vk"),!e.vkUrl&&e.fbUrl&&(t="show_fb"),(e.vkUrl||e.fbUrl)&&E.Monitoring.telemetry(b.TelemetryName.CHAT_INTRODUCE_SOCIAL,{param1:t})}},{key:"initSocial",value:function(){if(G.log("initSocial",d.default.isLoginned()),!c.default.getMessagesByType(S.MessageType.SOCIAL).length&&!u.default.mobileOrTablet()){const e=(0,s.getClient)();setTimeout((()=>{1!==c.default.getCurrentClientMessages().length||e.hasIntegration||(a.default.bot_id||y.messagesDispatchers.addMessage({text:(0,v.l10n)("social_online_text"),type:S.MessageType.SYSTEM,body:{type:S.MessageType.SOCIAL}}),setTimeout((()=>{this.addSocialMessage()}),2e3))}),2e3)}}},{key:"addSocialMessage",value:function(){const e=(0,s.getClient)();G.log("addSocialMessage"),C.default.joint&&!e.email&&!e.hasIntegration&&!u.default.mobileOrTablet()&&!c.default.getMessagesByType(S.MessageType.SOCIAL).length&&c.default.getCurrentClientMessages().length>0&&y.messagesDispatchers.addMessage({text:"",type:S.MessageType.SOCIAL})}},{key:"getOfflineSuccessText",value:function(){return(0,v.l10n)("offlineSuccessContactsSubmit")}},{key:"offlineSystemInvite",value:function(){if(!(0,s.getApp)().maintenance&&!(0,s.getApp)().isOnline&&!(0,s.getApp)().chatStarted){const e=(0,s.getUserSettings)().offlineFormText;G.log("offlineSystemInvite",e),this.messageOnce(S.MessageType.FOR_TEST,e)}}},{key:"startFormSequence",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:700;G.log("startFormSequence",e,t),(0,s.getApp)().isOnline&&a.default.bot_id&&!C.default.enable_bot_offline||((0,H.isAssistantBot)()?G.log("Disable form for assistant bot."):(this.formTimeout&&clearTimeout(this.formTimeout),(0,s.getApp)().isOnline||this.setInputDisabled(!0),t?this.formTimeout=setTimeout((()=>{0===c.default.getFormMessage().length&&(e&&this.botMessageOnce(e),setTimeout((()=>{this.addContactsForm()}),t),E.Monitoring.telemetry(b.TelemetryName.CHAT_INTRODUCE,{param1:"show"}))}),t):0===c.default.getFormMessage().length&&(e&&this.botMessageOnce(e),this.addContactsForm(),E.Monitoring.telemetry(b.TelemetryName.CHAT_INTRODUCE,{param1:"show"}))))}},{key:"deleteUnansweredOfflineSystemInvite",value:function(){if(G.warn("deleteUnansweredOfflineSystemInvite"),!(0,B.getTemporaryMessages)().length){this.deleteOfflineSystemInvites();const e=(0,s.getClient)();(0,_.isValidEmail)()||e.isIntroduced||this.deleteOfflineTmpMessage(),y.messagesDispatchers.initMessagesStore()}}},{key:"deleteOfflineTmpMessage",value:function(){G.warn("deleteOfflineTmpMessage"),this.destroyByType(S.MessageType.FOR_TEST),this.destroyByType(S.MessageType.TEMPORARY),(0,s.getApp)().isOnline&&0==C.default.contacts_ask||(this.destroyByType(S.MessageType.PREFORM),this.destroyByType(S.MessageType.FORM))}},{key:"addPrechatMessage",value:function(e){if(!(0,A.prechatEnabled)())return;const t=c.default.getMessagesByType(S.MessageType.PRECHAT),n=Boolean((0,B.getLastClientMessage)()),r=(0,s.getApp)();!r.isOnline||n&&r.chatStarted||t.length?t.length&&(t[0].set("created_ts",(new Date).getTime()),c.default.sort(),c.default.trigger("update")):this.pushPrechat(e)}},{key:"pushPrechat",value:function(e){y.messagesDispatchers.addMessage({body:{unsave:!0,prechats:e||C.default.prechat||null},type:S.MessageType.PRECHAT,from:S.MessageInitiator.FORM})}},{key:"deletePrechatMsg",value:function(){const e=c.default.getMessagesByType(S.MessageType.PRECHAT);e&&e.forEach((e=>{e&&e.destroy()}))}},{key:"deleteOfflineSystemInvites",value:function(){const e=c.default.getMessagesByType(S.MessageType.FOR_TEST);G.log("deleteOfflineSystemInvites",e),e.forEach((e=>{e&&e.destroy()}))}},{key:"addMaintenanceMessage",value:function(){this.systemMessageOnce((0,v.l10n)("maintenanceSystemText"),"text",!1)}},{key:"deleteMaintenanceMessage",value:function(){G.log("deleteMaintenanceMessage");c.default.getSystemMessageByText((0,v.l10n)("maintenanceSystemText")).forEach((e=>{e&&e.destroy()})),c.default.trigger("update")}},{key:"destroyByType",value:function(e){c.default.getMessagesByType(e).forEach((e=>{e&&e.destroy()}))}},{key:"markdownMessage",value:function(e){G.log("markdownMessage",e),y.messagesDispatchers.addMessage({type:S.MessageType.MESSAGE,text:e,from:S.MessageInitiator.AGENT,body:{customerIO:!0,unsave:!0}})}},{key:"systemCallMessage",value:function(e,t){const n=c.default.getLastMessage();(!n||n&&n.get("text")!==e)&&this.systemMessage(e.replace("
","\n"),t)}},{key:"sendClientMessage",value:function(e){let t=e.text,n=e.privateId,r=e.repliedMsgId,i=e.buttonId;0!==c.default.getClientMessages().length||I.EnvironmentManager.isDesignerEditor()||I.EnvironmentManager.isRegPage()?this.sendClientMessageCheck({text:t,privateId:n,repliedMsgId:r,buttonId:i}):F.WidgetStatus.getStatus((()=>{this.sendClientMessageCheck({text:t,privateId:n,repliedMsgId:r,buttonId:i})}))}},{key:"sendClientMessageCheck",value:function(e){let t=e.text,n=e.privateId,r=e.repliedMsgId,i=e.buttonId;if(n){m.default.getInstance()&&N.connectionAdapter.setLastError(null)}if(C.default.bots)return this._sendClientMessageBase({text:t,privateId:n,repliedMsgId:r,buttonId:i}),void(C.default.enable_bot_offline||this.handleContactsForm());(0,s.getApp)().isOnline||this.handleContactsForm(),this._sendClientMessageBase({text:t,privateId:n,repliedMsgId:r})}},{key:"offlineAck",value:function(e){G.log("offlineAck"),(0,l.isEmpty)(this.cacheOfflineMsg)&&!e||(p.Router.getCurrentRoute()===O.Route.CHAT||u.default.mobileOrTablet()||p.Router.next(O.RouterEvent.ToChat),this.cacheOfflineMsg=e)}},{key:"sendNoAgentsOnline",value:function(){C.default.bots||C.default.enable_bot_offline||(0,H.isAssistantBot)()||this.systemMessageOnce((0,v.l10n)("offlineForceOfflineMessage"))}},{key:"handleContactsForm",value:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,s.getClient)();if(!(0,s.getApp)().isOnline&&!t.isIntroduced&&c.default.getClientMessages().length&&(c.default.getOfflineTmpMessage()||e)){G.warn("handleContactsForm");const e=c.default.getFormMessage();if(0===e.length)this.startFormSequence((0,v.l10n)("offlineIntroductionText")),E.Monitoring.telemetryOnce(b.TelemetryName.OFFLINE_FIRST_MESSAGE);else{const t=c.default.getFormIntroduceText();t.length&&t[0].set({text:(0,v.l10n)("offlineIntroductionText"),created_ts:(new Date).getTime()}),e[0].set("created_ts",(new Date).getTime()+1),c.default.sort(),setTimeout((()=>{c.default.trigger("update")}),200),this.setInputDisabled(!0)}}}},{key:"handleBotContactsForm",value:function(){const e=(0,s.getClient)();G.log("handleBotContactsForm"),!e.isIntroduced&&C.default.bots&&C.default.enable_bot_offline&&0===c.default.getFormMessage().length&&(this.startFormSequence(),E.Monitoring.telemetryOnce(b.TelemetryName.OFFLINE_FIRST_MESSAGE))}},{key:"setInputDisabled",value:function(e){G.log("setInputDisabled",e),y.appDispatchers.setIsInputDisabled(e)}},{key:"checkMessageStatus",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.Timeouts.MESSAGE_SEND_ERROR_TIMEOUT;return G.log("checkMessageStatus"),new Promise((n=>{setTimeout((()=>{const t=(0,s.getMessageByPrivateId)(e);let r=!1;t?(t.msg_id||(y.messagesDispatchers.updateMessage({privateId:t.private_id},{status:S.MessageStatus.NOT_DELIVERED}),r=!0,n({isNotDelivered:r,isDeleted:t.status===S.MessageStatus.DELETED})),n({isNotDelivered:r,isDeleted:t.status===S.MessageStatus.DELETED})):(r=!0,n({isNotDelivered:r,isDeleted:!1}))}),t)}))}},{key:"setListpickerAnswer",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=c.default.getMessageById(e);if(r){if(G.log("setListpickerAnswer",e,t,r),r.get("body.force_reply")&&r.set("body.force_reply",!1),!n){r.set("body.answer_id",parseInt(t));const e=r.get("body.keyboard")[t];r.set("body.keyboard",[e]),r.destroy()}this.setInputDisabled(!1)}}},{key:"hideEmailForm",value:function(){const e=c.default.getMessagesByType("email");e.length&&e[e.length-1].destroy()}},{key:"addMessagesOnOpen",value:function(e){this.deleteUnansweredOfflineSystemInvite(),e?this.addPrechatMessage():this.offlineSystemInvite()}}]),e}();const z=new V;t.messageActions=z},62162:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.sendUpdateProactive=t.saveLastProactive=t.rejectProactive=t.readProactive=t.getProactiveAgent=t.getCurrentProactiveData=t.addProactiveAgentToChat=t.addProactiveAgent=t.acceptProactive=void 0;var i=r(n(61125)),o=r(n(26754)),a=n(81152),s=n(16016),l=n(26932),u=n(44145),c=r(n(35802)),d=n(13077),f=r(n(14264)),p=r(n(4855)),h=r(n(138)),g=r(n(14762)),_=n(49963),m=n(40694);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;te.text?e.botId?(0,u.getBotById)(e.botId):e.agentId?(0,u.getAgentById)(e.agentId):null:null;const E=(e,t)=>{e.isBot?l.botsDispatchers.addBot({avatarUrl:e.avatarUrl,id:e.id,name:e.name,title:e.title,isBot:!0}):l.agentsDispatchers.addAgent(e),t&&C(e)};t.addProactiveAgent=E;const C=e=>{e.isBot?l.chatsDispatchers.setJoinedBots([e.id]):l.chatsDispatchers.addJoinedAgent(e.id)};t.addProactiveAgentToChat=C;t.getCurrentProactiveData=(e,t,n,r,i,o)=>{const l=(0,m.agentToReduxFormat)(o);return E(l,!1),g.default.updateAgentList([o]),{text:e,name:t,createdTs:(new Date).getTime(),privateId:(0,s.generateGUID)(),status:a.MessageStatus.EMPTY,agentId:l.isBot?null:l.id,botId:l.isBot?l.id:null,isMarkdown:!!n,prechats:r,campaignId:i}};t.sendUpdateProactive=e=>{const t=(0,u.getClient)().sessionId;if(!t)return void b.log("updateProactive no session.");const n={name:"update_client",jv_sess_id:t};e&&(n.proactive_rule={invitation_text:e.text,private_id:e.privateId,created_ts:Math.floor(e.createdTs/1e3)},e.isMarkdown&&(n.proactive_rule.is_markdown=!0),e.agentId&&(n.proactive_rule.agent_id=e.agentId),e.botId&&(n.proactive_rule.bot_id=e.botId));const r=JSON.stringify(n);if((0,d.getRuleLocal)("lastUpdateProactiveEvent")!=r&&((0,d.setRuleLocal)("lastUpdateProactiveEvent",r),b.log("sendUpdateProactive",n),n.proactive_rule)){c.default.getInstance()&&_.connectionAdapter.sendEventIfConnected(n)}};t.saveLastProactive=()=>{const e=f.default.getLastProactive();if(e){var t,n;const r=e.toJSON(),i=r.body.is_markdown,a=null===(t=r.body)||void 0===t?void 0:t.agent_info,s=null===(n=r.body)||void 0===n?void 0:n.extra,u=a||o.default;r.body=y(y({},a?null:u),{},{agent_info:u,is_markdown:i||null,extra:s||null}),e.destroy(),l.messagesDispatchers.addMessage(r)}};t.readProactive=()=>{const e=(0,u.getProactive)();e.text&&e.status!==a.MessageStatus.READ&&l.proactiveDispatchers.setStatus(a.MessageStatus.READ)};t.rejectProactive=()=>{const e=(0,u.getProactive)(),t=e.campaignId,n=e.name;n&&(t?h.default.trackCampaignRejected(n):h.default.trackProactiveInvitationRejected(n))};t.acceptProactive=()=>{const e=(0,u.getProactive)(),t=e.campaignId,n=e.name;n&&(t?h.default.trackCampaignAccepted(n):h.default.trackProactiveInvitationAccepted(n))}},92443:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(26754)),o=r(n(14264)),a=r(n(91275)),s=r(n(19955)),l=n(21476),u=n(97490),c=n(65465),d=n(54415),f=n(83170),p=n(81152),h=n(26932),g=n(50402),_=n(44145),m=n(47138),v=n(44733),y=n(13077),b=r(n(4855)),E=r(n(138)),C=n(55329),T=n(43902),D=n(75998),w=n(91920),S=n(62162);const O=b.default.name("ruleActions"),A=()=>{(0,_.getApp)().isOnline&&c.messageActions.deleteUnansweredOfflineSystemInvite(),l.Router.getCurrentRoute()!==u.Route.LABEL||s.default.mobileOrTablet()||(l.Router.next(u.RouterEvent.ToChat),h.transitionDispatchers.startTransition(g.ScriptName.OPEN_WIDGET),(0,S.readProactive)())},I=e=>{v.StorageProvider.set("hide_reported",e)};var k={proactive:e=>{let t=e.message,n=e.agentInfo,r=e.name,o=e.isMarkdown,a=e.prechats,s=e.campaignId,l=e.conditionList,u=e.extra;Object.assign(i.default,n);const c=(0,S.getCurrentProactiveData)(t,r,o,a,s,n);h.proactiveDispatchers.addProactive(c);const g={is_markdown:o,unsave:!0,agent_info:n};s&&(g.campaign_id=s),u&&(g.extra=u);const _={from:p.MessageInitiator.AGENT,from_id:n.agent_id,status:p.MessageStatus.READ,private_id:c.privateId,text:c.text,created_ts:c.createdTs,type:p.MessageType.PROACTIVE,body:g};n.bot_id&&(_.from_id=n.bot_id,_.from=p.MessageType.BOT),h.messagesDispatchers.addMessage(_),h.userDispatchers.setCallHeaderText(null),A(),(0,S.sendUpdateProactive)(c),(0,C.updatePrechatTime)(c.createdTs),I(!1),s&&T.StatsManager.send({campaignId:s},"shown");const m=s?"campaign"+s:(0,y.isDefaultProactive)()?"default":"custom";d.Monitoring.telemetry(f.TelemetryName.CHAT_INVITE,{param1:m,param2:(0,y.timeDiff)((0,y.getRuleLocal)("pageEnterTime")),param3:(0,w.hasCustomLabel)()?"customlabel":"label",param4:l})},showCallForm:(e,t)=>{a.default.requestCWAvailable((()=>{if(O.log("requestCWAvailable: ",(0,_.getCallback)().available),d.Monitoring.telemetry(f.TelemetryName.CWP_SHOW_ON_PROACTIVE),!s.default.mobileOrTablet()&&[m.CallPopupStatus.ENABLED,m.CallPopupStatus.ONLY_TRIGGERS].includes((0,_.getCallback)().separateForm))return h.userDispatchers.setCallHeaderText(e),l.Router.next(u.RouterEvent.ToCallPopup),"function"==typeof t&&t(),void I(!1);(0,_.getCallback)().available&&(0,_.getApp)().route==u.Route.LABEL&&(h.userDispatchers.setCallHeaderText(e),!s.default.mobileOrTablet()&&l.Router.next(u.RouterEvent.ToCall),h.transitionDispatchers.startTransition(g.ScriptName.OPEN_WIDGET),"function"==typeof t&&t(),I(!1))}))},systemMessage:e=>{if(i.default.bot_id)return;const t=o.default.getLastMessage();t&&t.get("type")===p.MessageType.SYSTEM&&t.get("text")===e&&t.destroy();const n={type:p.MessageType.SYSTEM,text:e};(0,_.getApp)().chatStarted||(n.body={unsave:!0}),h.messagesDispatchers.addMessage(n),A(),I(!1)},systemMessageEmail:e=>{h.messagesDispatchers.addMessage({type:"email",text:e,body:{unsave:!0}}),A(),E.default.trackSystemMessageEmailShown(),I(!1)},openOffline:()=>{c.messageActions.offlineSystemInvite(!0),A(),I(!1),d.Monitoring.telemetry(f.TelemetryName.OFFLINE_INVITE)},showPopup:e=>{O.log("ruleActions: showCampaignPopup",e),D.campaignPopupDispatch.updateCampaignPopup(e),D.campaignPopupDispatch.setDisplay(!0)}};t.default=k},50350:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.sendUrlChange=void 0;var i=n(97490),o=r(n(19955)),a=n(44145),s=n(69882),l=n(41504),u=n(16016),c=n(49963),d=r(n(4855)),f=n(15787);const p=d.default.name("sendUrlChange");t.sendUrlChange=(e,t)=>{if(!window||!window.location)return void p.log("no window");if(o.default.mobileOrTablet()&&(0,a.getApp)().route!==i.Route.LABEL)return;const n=t||(0,s.getCurrentPage)().url;p.log("updateTitle url",n),(0,f.connectionReadyForMessages)()&&c.connectionAdapter.sendEvent(new l.UrlChange(n,(0,u.setSubstrTitle)(e)))}},95856:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.syncRouter=t.reloadTransitionStore=void 0;var i=n(97490),o=n(44145),a=n(68403),s=n(21476),l=r(n(79868)),u=r(n(4855)),c=n(91225),d=n(50402),f=n(26932);const p=u.default.name("syncRouter"),h=()=>{const e=(0,o.getApp)().route;let t=(0,c.isContainerRoute)(e)?d.ScriptName.OPEN_WIDGET:d.ScriptName.CLOSE_WIDGET;e===i.Route.CALL_POPUP&&(t=d.ScriptName.CLOSE_WIDGET),(0,c.isMinRoute)(e)&&(t=d.ScriptName.MIN_WIDGET);const n=(0,o.getTransition)().currentScript;t==d.ScriptName.OPEN_WIDGET&&n==d.ScriptName.MAXIMIZE_WIDGET||f.transitionDispatchers.initTransitionStore({currentScript:t})};t.reloadTransitionStore=h;t.syncRouter=()=>{const e=(0,o.getApp)(),t=(0,o.getClient)();if(p.warn("syncRouter",e.route,s.Router.getCurrentRoute()),e.route!==s.Router.getCurrentRoute()){const n=s.Router.getPrevEvent(),r=e.route===i.Route.INTRODUCE;if(t.isIntroduced&&r)return;if(!e.isOnline&&r)return;if((0,a.isChatContactForm)()&&r)return;if(!(e.route!==i.Route.CHAT_SOCIAL||n&&l.default.getPopupMode()))return void p.warn("prevent to show Social without user click.");if(-1!=[i.Route.CHAT_EULA,i.Route.CALL_EULA].indexOf(e.route)&&(!n||n&&-1==n.indexOf("submit"))&&e.showEula)return void p.warn("prevent to show Eula without user click.");if(e.route===i.Route.CHAT_MIN&&!e.chatAccepted)return void s.Router.setNext(i.RouterEvent.CloseWindow);s.Router.setNext(e.route),h()}}},64123:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setCallbackStatus=t.getStarupTime=t.enableRecaptchaAntispam=void 0;var i=r(n(4855)),o=n(26932),a=n(65465),s=n(13077),l=n(20344),u=r(n(5735));const c=i.default.name("Action utils","color: grey;");t.setCallbackStatus=e=>{c.log("setCallbackStatus",e),o.callbackDispatchers.setCallbackStatus(!!e&&e.status)};t.getStarupTime=()=>(((new Date).getTime()-(0,s.getRuleLocal)("sendStartupTime")||0)/1e3).toFixed(1);t.enableRecaptchaAntispam=()=>{c.log("Enable antispam"),o.callbackDispatchers.setCallbackAvailable(!1),a.messageActions.systemMessageOnce((0,l.l10n)("maintenanceSystemText"),"text",!1),o.appDispatchers.setIsInputDisabled(!0),u.default.allRulesCancel()}},138:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=r(n(4855)),a=n(68403),s=n(23267),l=n(79225),u=n(73422),c=n(48999);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const f=o.default.name("analytics"),p={counters:{ya:0,fb:0,ga:0},_yaCounter:[],_trackedEvents:[],getCountersTelemetry:function(){return{param2:this.counters.ya,param3:this.counters.fb,param4:this.counters.ga}},getAnalyticsClientId:function(){const e=(0,s.getPageWindow)(),t={};return"function"==typeof e.ga&&("function"==typeof e.ga.getAll&&e.ga.getAll().forEach((e=>{t.ga||(t.ga=e.get("clientId"))})),this.counters.ga=1),!t.ga&&e.gaGlobal&&(t.ga=e.gaGlobal.vid,this.counters.ga=1),this._yaCounter.forEach((n=>{e[n]&&"function"==typeof e[n].getClientID&&(t.ym||(t.ym=e[n].getClientID()))})),t},isAnalyticsIdAvaiable:function(){if(!this.isEnabled())return!1;const e=this.getAnalyticsClientId();return f.log("Counters userId",e),!(!(0,a.isPaidCustomer)()||!e.ga&&!e.ym)&&e},init:function(){if(this.isEnabled()){this._yaCounter=[];try{const e=(0,s.getPageWindow)();for(const t in e)0===t.indexOf("yaCounter")&&"function"==typeof e[t].reachGoal&&(this._yaCounter.push(t),this.counters.ya=1);!this.counters.ya&&e.Ya&&e.Ya._metrika&&e.Ya._metrika.getCounters&&e.Ya._metrika.getCounters().forEach((t=>{const n=e["yaCounter"+t.id];n&&this._yaCounter.push(n)})),f.log("Active Yandex counters: ",this._yaCounter.length)}catch(e){f.log(e.toString())}}},isEnabled:function(){if(!(0,a.isAnalyticsDisabled)()&&(0,a.isPaidCustomer)())return!0},_trackEvent:function(e,t,n){if(!this.isEnabled())return;if(!n&&this._trackedEvents.includes(e))return;this.counters.ga&&this.counters.ya||this.init(),this._trackedEvents.push(e),f.info(`trackEvent action: ${e}, label: ${t}`);const r=(0,s.getPageWindow)();void 0!==r._gaq&&"function"==typeof r._gaq.push&&r._gaq.push(["_trackEvent","JivoSite",e,t,void 0,!0]),"function"==typeof r.ga&&"function"==typeof r.ga.getAll&&(r.ga.getAll().forEach((function(n){const r=n.get("name");f.log("track ga:",n.get("name"),e,t),r&&0!==r.search(/^gtag_/i)&&n.send("event","JivoSite",e,t,{nonInteraction:1})})),this.counters.ga=1);const o="function"==typeof r.gtag,a={event_category:"JivoSite",event_action:e,event_label:t};if(o&&(f.log("track gtag:",a),r.gtag("event","JivoSite",a),this.counters.ga=1),!o&&r.dataLayer&&"function"==typeof r.dataLayer.push&&(f.log("track dataLayer:",a),r.dataLayer.push(function(e){for(var t=1;t0&&n[1]&&"function"==typeof n[1].send&&(n[1].send("event","JivoSite",e,t,{nonInteraction:1}),f.log("Track event to custom tiu client counter",n[1].get("trackingId"),e,t)),this.counters.ga=1}if(this._yaCounter.length>0){e=["Jivo"].concat(e.split(" ")).join("_");var l=(0,s.getPageWindow)();this._yaCounter.forEach((function(t){l&&l[t]&&"function"==typeof l[t].reachGoal&&l[t].reachGoal(e)})),this.counters.ya=1}this.trackFBEvents(e)},_setCustomVar:function(e,t){f.log("_setCustomVar: "+e+"/"+t);const n=(0,s.getPageWindow)();if(void 0!==n._gaq&&n._gaq.push(["_setCustomVar",1,e,t,1]),"function"==typeof n.ga&&n.ga("set",e,t),this._yaCounter.length>0){const r={};r[e]=t,this._yaCounter.forEach((function(e){n[e].params(r)}))}},trackFBEvents:function(e){const t=(0,s.getPageWindow)().fbq;t&&!(0,a.isJivoSite)()&&(e=e.replace(/ /gi,"_").replace("Jivo_",""),f.log("trackFBEvents",e),(0,u.isFunction)(t)&&(t("trackCustom","Jivo",{content_name:e}),this.counters.fb=1))},trackChatOpenedByClick:function(){this._trackEvent("Chat requested","User clicked chat widget")},trackOfflineFormOpenedByClick:function(){this._trackEvent("Offline form shown","User offline form")},trackOfflineMessageSent:function(){this._trackEvent("Offline message sent","User sent message via offline form")},trackProactiveInvitationShown:function(e){this._trackEvent("Proactive invitation shown",e)},trackProactiveInvitationAccepted:function(e){this._trackEvent("Proactive invitation accepted",e)},trackProactiveInvitationRejected:function(e){this._trackEvent("Proactive invitation rejected",e)},trackCampaignShown:function(e){this._trackEvent("jivo_chat_campaign_shown",e,!0)},trackCampaignAccepted:function(e){this._trackEvent("jivo_chat_campaign_answered",e,!0)},trackCampaignRejected:function(e){this._trackEvent("jivo_chat_campaign_closed",e,!0)},trackPopupClosed:function(e){this._trackEvent("jivo_popup_closed",e,!0)},trackChatConnected:function(){this._trackEvent("Chat established","User connected to agent")},trackGaveContacts:function(){const e="User gave contacts during chat";this._trackEvent(e,e)},trackCallWidgetInvitationShown:function(e){this._trackEvent("Callback invitation shown",e)},trackCallWidgetRequested:function(){this._trackEvent("Callback requested","User request callback.")},setABTestGroupContacts:function(e,t){this._setCustomVar(e,t)},trackSystemMessageEmailShown:function(){const e="In-chat email form shown";this._trackEvent(e,e)},trackSystemMessageEmailSubmitted:function(){const e="In-chat email form submitted";this._trackEvent(e,e)},trackContinueInSocial:function(e){this._trackEvent("Continue in social",`User clicked ${e} button`)},trackMobileSocial:function(e){const t=this.getSocialName(e);this._trackEvent(`Jivo_${t}`,`User tap ${t} mobile link`)},trackSocial:function(e){const t=this.getSocialName(e);this._trackEvent(`Jivo_${t}`,`User click ${t} label link`)},trackClientInitChat:function(){this._trackEvent("Client initiate chat","Client initiate chat")},trackClientAnswerAgentChatRequest:function(){const e="Client answer on agent request";this._trackEvent(e,e)},trackMobileCallClick:function(){this._trackEvent("Mobile call","Mobile call")},trackCallClick:function(){this._trackEvent("Callback button","User requested callback form")},trackPrechatClick:function(e){this._trackEvent("Prechat phrase clicked",e)},trackBotButtonClick:function(e){this._trackEvent("Client press bot button",e)},getSocialName(e){switch(e){case"vk":return"Vkontakte";case"fb":return"Facebook";case"ig":return"Instagram";case"wa":return"WhatsApp";case"tg":return"Telegram";case"vb":return"Viber";default:return e}},reportCampaign:function(e,t){const n=(0,c.getCampaignById)(t);if(!n)return;const r="popup"===n.type;this._trackEvent("jivo_"+this.getCampaignText(e,r),"name_"+(0,l.replaceAll)(n.title," ","_"),!0)},getCampaignText:function(e,t){return`${t?"popup":"chat_campaign"}_${e}`}};var h=p;t.default=h},42908:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.api=void 0;var i=r(n(61125)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=z(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(96394)),a=r(n(95003)),s=n(92560),l=r(n(27104)),u=r(n(138)),c=r(n(3415)),d=r(n(91275)),f=n(21476),p=n(65465),h=r(n(86961)),g=n(54415),_=r(n(14264)),m=r(n(98960)),v=r(n(79868)),y=n(31984),b=n(26932),E=n(50402),C=n(13077),T=r(n(73687)),D=r(n(35802)),w=n(97490),S=n(83170),O=n(78692),A=r(n(5735)),I=n(41504),k=n(84727),M=n(97615),x=n(44145),P=r(n(4855)),R=n(49963),N=n(90970),L=n(91920),F=n(73422),j=n(32915),B=n(34930),U=n(20676),W=n(21733),H=n(15787),G=n(83907),V=n(50350);function z(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(z=function(e){return e?n:t})(e)}function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t{const t=(0,x.getApp)();if(g.Monitoring.telemetryWithProbability(S.TelemetryName.API_OPEN,{param1:e},S.RateLimit.High),T.default.get("is_blacklisted"))return{result:"fail"};U.platform.isMobileOrTablet&&(0,L.showCustomLabel)(!0);const n=(0,F.isObject)(e);return n&&"call"===e.start?o.default.callback_settings.time?(t.route===w.Route.CALL||(A.default.allRulesCancel(),d.default.pingAndOpenCall()),{result:"ok"}):(q.info("Callback is disabled."),{result:"fail",reason:"Callback is disabled"}):t.route===w.Route.CHAT?{result:"ok",opened:!0}:(b.appDispatchers.setAppIsFocused(!0),n&&"menu"===e.start?U.platform.isMobile&&v.default.getJoints().count>0?(b.appDispatchers.setChatOpenByClient(!1),f.Router.next(w.RouterEvent.ToMobileMenu)):(b.transitionDispatchers.startTransition(E.ScriptName.OPEN_WIDGET),f.Router.next(w.RouterEvent.ApiOpen)):(U.platform.isDesktop&&b.transitionDispatchers.startTransition(E.ScriptName.OPEN_WIDGET),f.Router.next(w.RouterEvent.ApiOpen)),p.messageActions.offlineSystemInvite(),p.messageActions.addPrechatMessage(),(0,L.hasCustomLabel)()&&U.platform.isMobileOrTablet&&((0,x.getApp)().isOnline?u.default.trackChatOpenedByClick():u.default.trackOfflineFormOpenedByClick()),{result:"ok"})},close:()=>{if(g.Monitoring.telemetryWithProbability(S.TelemetryName.API_CLOSE,{},S.RateLimit.High),T.default.get("is_blacklisted"))return{result:"fail"};if([w.Route.LABEL,w.Route.CHAT_MIN].indexOf((0,x.getApp)().route)>=0)return{result:"ok",closed:!0};if((0,B.closeWidget)(),U.platform.isMobileOrTablet)f.Router.next(w.RouterEvent.CloseWindow);else{const e=(0,x.getApp)().chatAccepted?E.ScriptName.MINIMIZE_WIDGET:E.ScriptName.CLOSE_WIDGET;b.transitionDispatchers.startTransition(e)}return{result:"ok"}},getContactInfo:()=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;g.Monitoring.telemetryWithProbability(S.TelemetryName.API_GET_CONTACT_INFO,{},S.RateLimit.Low);const e=(0,x.getClient)();return{client_name:e.name,email:e.email,phone:e.phone,description:e.description}},getVisitorNumber:e=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;q.log("getVisitorNumber",e);const t=(0,x.getClient)().clientId;if(t&&t.indexOf(".")>0&&(0,F.isFunction)(e))return e(null,t.split(".")[0]);(0,F.isFunction)(e)?(g.Monitoring.telemetryWithProbability(S.TelemetryName.API_GET_VISITOR_NUMBER,{},S.RateLimit.Low),h.default.getVisitorNumber(((n,r)=>{if(q.log(n,r),n)q.log("Error fetch visitor number.");else if((0,F.isObject)(r.data)&&r.data.client_id&&r.data.result){const n=r.data.client_id;t||b.clientDispatchers.updateClient({clientId:n}),(0,F.isFunction)(e)&&(0,W.isString)(n)&&e(null,n.split(".")[0])}else q.error("Error fetching visitor number")}))):q.error("Please provide callback function in jivo_api.getVisitorNumber(callback)")},setUserToken:e=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;if(q.log("setUserToken",e),g.Monitoring.telemetryWithProbability(S.TelemetryName.API_SET_USER_TOKEN,{},S.RateLimit.High),"string"==typeof e||e instanceof String){const t=(0,x.getClient)();let n;const r=e!==t.userToken;r&&b.clientDispatchers.setUserToken(e);if(D.default.getInstance()){if(r&&R.connectionAdapter.isConnected())R.connectionAdapter.sendEvent(new I.UpdateUserToken(e)),q.log(`WIDGET: Token updated, token: ${e}`);else{q.log("WIDGET: Token set, but was not sent to the server");const n=(0,x.getFeatures)().userToken&&e&&(!t.clientId||!t.sessionId);!R.connectionAdapter.isConnected()&&n&&R.connectionAdapter.openConnect(!1,!0)}n={result:"ok",token:e||!1}}return!o.default.enable_api_invitation&&M.EnvironmentManager.isProduction()||(0,x.getApp)().chatStarted||O.ApiInvitationsManager.initialize(e),n}return q.error("WIDGET: Bad token. The token must be type of string"),{result:"fail",token:e||!1}},setCustomData:e=>{var t;if(!(M.EnvironmentManager.isJsApiAvaiable()||null!==(t=o.default.modules)&&void 0!==t&&t.jivo_marketing))return j.paidRequired;g.Monitoring.telemetryWithProbability(S.TelemetryName.API_SET_CUSTOM_DATA,{},S.RateLimit.Low);const n=(0,x.getSystemSettings)().apiDomain,r=(0,k.validateCustomData)(e,n),i=(0,x.getClient)().customData;return(0,F.isArray)(r)?i&&(0,N.isArrayEqual)(r,(0,x.getClient)().customData)?{result:"fail",reason:"Cannot send the same data"}:((0,H.checkCustomData)(r),{result:"ok"}):(q.error("Invalid custom data.",r),{result:"fail",reason:r})},sendMessage:e=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;if("string"!=typeof e||"[object Object]"===Object.prototype.toString.call(e))return{result:"fail",error:"First argument must be text to send message."};const t=_.default.getClientMessages();return t.length&&e==t[t.length-1].get("text")?{result:"fail",error:"You cannot send 2 messages in a row"}:(p.messageActions.sendClientMessage({text:e}),g.Monitoring.telemetryOnce(S.TelemetryName.API_SEND_MESSAGE),{result:"ok"})},setContactInfo:e=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;if(g.Monitoring.telemetryWithProbability(S.TelemetryName.API_SET_CONTACT_INFO,{},S.RateLimit.Low),e&&(0,F.isObject)(e)){q.log("setContactInfo",e);const t={};let n=!1,r="";for(const i in e)if({}.hasOwnProperty.call(e,i)){const o=e[i];let a=i;"name"==a&&(a="client_name"),o&&m.default[a]&&m.default[a](o)?(t[i]=o,n=!0):(q.error(a+" not valid."),r+=a+" not valid.")}if(n){return(0,H.sendApiIntroduce)(t)?{result:"ok",data:t}:{result:"false",data:t,error:"Cant send same client contacts twice."}}return g.Monitoring.telemetryWithProbability(S.TelemetryName.API_SET_CONTACT_INFO_BAD_DATA,{},S.RateLimit.High),q.error("setContactInfo bad data",e),{result:"fail",error:r}}},showProactiveInvitation:(e,t,n)=>{const r=(0,x.getClient)();(0,C.isYandexMarketClient)(r.utm)?q.log("Disabled for YM clients"):M.EnvironmentManager.isJsApiAvaiable()?(g.Monitoring.telemetryOnce(S.TelemetryName.API_SHOW_PROACTIVE),A.default.showProactive(e,t?+t:void 0,"jivo_api.showProactiveInvitation",n),A.default.cancelRule(G.RuleTypes.PROACTIVE)):q.log("Proactive disabled for free users.")},highlightCobrowse:(e,t,n)=>{if(!e)return!1;c.default.getCobrowseData(e,t,n)},sendOfflineMessage:e=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;if(g.Monitoring.telemetryOnce(S.TelemetryName.API_SEND_OFFLINE_MESSAGE),q.log("sendOfflineMessage",e),(0,x.getApp)().isOnline)return{result:"fail",error:"Error send offline message when chat is online."};if((0,F.isObject)(e)){q.log("sendOfflineMessage",e);let t="";for(const n in e)if({}.hasOwnProperty.call(e,n)){const r=e[n];let i=n;"name"==i&&(i="client_name"),r&&m.default[i]&&m.default[i](r)||(q.error(i+" not valid."),t+=i+" not valid. ")}if(""==t){return(0,H.sendApiIntroduce)(e)?{result:"ok"}:{result:"fail",error:"Cant send same message and contacts twice."}}return q.warn("sendOfflineMessage bad data",e),g.Monitoring.telemetryOnce(S.TelemetryName.API_SEND_OFFLINE_MESSAGE_BAD_DATA),{result:"fail",error:t}}return{result:"fail",error:"Invalid params for offline message"}},setRules:e=>M.EnvironmentManager.isJsApiAvaiable()?(g.Monitoring.telemetryOnce(S.TelemetryName.API_SET_RULES),(0,F.isArray)(e)?(A.default.allRulesCancel(),A.default.rules=[],(0,o.setConfigParam)("rules",e),A.default.init(),{result:"ok"}):(q.error("Invalid type of rules, must be object."),{result:"fail"})):j.paidRequired,chatMode:()=>M.EnvironmentManager.isJsApiAvaiable()?(g.Monitoring.telemetryWithProbability(S.TelemetryName.API_CHAT_MODE,{},S.RateLimit.Low),o.default.chat_mode):j.paidRequired,setWidgetColor:(e,t)=>{g.Monitoring.telemetryOnce(S.TelemetryName.API_SET_WIDGET_COLOR);const n=l.default.isLightColor(e)?"dark":"light";b.userDispatchers.setWidgetColor(e),b.userDispatchers.setWidgetColor2(t||null),b.userDispatchers.setWidgetFontColor(n)},sendPageTitle:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return M.EnvironmentManager.isJsApiAvaiable()?e&&"string"==typeof e?((0,V.sendUrlChange)(e,n),t&&g.Monitoring.telemetryOnce(S.TelemetryName.API_SEND_PAGE_TITLE),{result:"ok"}):{result:"fail",reason:"Invalid title"}:j.paidRequired},isCallbackEnabled:e=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;"function"==typeof e&&(g.Monitoring.telemetryWithProbability(S.TelemetryName.API_IS_CALLBACK_ENABLED,{},S.RateLimit.High),(0,s.isEmpty)(o.default.callback_settings)?e({result:"fail",reason:"Callback disabled"}):d.default.requestApiCWAvailable(e))},startCall:e=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;const t=(0,x.getCallback)();if(q.log("api startCall",e),!t.available||(0,s.isEmpty)(o.default.callback_settings))return{result:"fail",reason:"Callback disabled"};if(e){const t=(0,y.getPhoneNumberInfo)(e);return t?(e="+"+t.number,f.Router.next(w.RouterEvent.ToCall),d.default.startCall(e,"from_api"),{result:"ok"}):{result:"fail",reason:"Invalid phone"}}return{result:"fail",reason:"Invalid phone"}},getUtm:()=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;g.Monitoring.telemetryWithProbability(S.TelemetryName.API_GET_UTM,{},S.RateLimit.High);const e=(0,x.getClient)().utm;return{term:e.term||e.keyword||null,campaign:e.campaign||null,content:e.content||null,medium:e.medium||null,source:e.source||null}},getUnreadMessagesCount:()=>{const e=(0,x.getUnreadMessages)();q.log("getUnreadMessagesCount",e);const t=(0,x.getLastChatId)();return e.filter((e=>e.chat_id===t)).length},clearHistory:()=>{if(!M.EnvironmentManager.isJsApiAvaiable())return j.paidRequired;b.clientDispatchers.resetClient(),a.default.reset(),_.default.destroy(),q.log("Client info deleted, history cleared.")},showCampaignPopup:(e,t,n,r)=>{if(!M.EnvironmentManager.isTesting()&&!M.EnvironmentManager.isApp())return;const i=o.default.campaigns.find((t=>t.campaign_id===e));i&&A.default.showCampaignPopup(Z(Z({},i.content.popup_settings),{},{campaignId:e,answerData:t,onSubmitActionCallback:n}),r)},setTelegramLink:e=>(0,j.setJointLink)(e,"tg"),setWhatsAppLink:e=>(0,j.setJointLink)(e,"wa"),setVKLink:e=>(0,j.setJointLink)(e,"vk")};t.api=K,o.default.enable_client_attributes&&!M.EnvironmentManager.isProduction()&&(K.setClientAttributes=e=>{b.clientDispatchers.setClientAttributes(e)}),M.EnvironmentManager.isProduction()&&1!==o.default.site_id||(K.setExternalData=e=>{b.clientDispatchers.setExternalData(e)})},3415:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(98661)),o=r(n(98661)),a=r(n(96394)),s=n(20344),l=n(32183),u=r(n(19955)),c=r(n(90842)),d=r(n(93867)),f=n(54415),p=n(83170),h=n(97615),g=r(n(22541)),_=r(n(4855)),m=n(9393),v=n(10904),y=n(38632),b=n(52161),E=n(21951),C=n(73422),T=n(95911),D=n(69882),w=n(23267),S=n(45683);const O=_.default.name("cobrowse"),A=window.parent.document,I=function(e,t){const n=window.top;"function"==typeof n.history.replaceState?n.history.replaceState({},t,e):"function"==typeof n.history.pushState&&n.history.pushState({},t,e)},k={init:function(){this.source=null,this.origin=null;var e,t,n=!1,r={};c.default.install(window.parent),this._process=t=function(t,i){n?(O.log("controller of childSandboxBridge set as for NodeWebkit"),(e=P).setLangpack(r),e.init(),"in_node_webkit"===t&&window.parent.jivo_cobrowse.source.postMessage({name:"widget_ready"},window.parent.jivo_cobrowse.origin)):e=x,e[t]&&"is_node_webkit"!==t&&e[t](i)},(0,E.addListener)(window.parent,"message",(e=>{if(e&&e.data&&"object"==typeof e.data){var i=e.data;-1!==["startSelection","stopSelection","in_node_webkit"].indexOf(i.name)&&e.source&&e.origin&&(this.source=e.source,this.origin=e.origin,n=!0,i.langpack&&(r=i.langpack),t(i.name,i))}}),!1)},process:function(e,t){this._process||this.init(),this._process(e,t)},create:function(e,t){k.process("highlight",e),k.process("renderTooltip",e),I(t,A.title)},postMessage:function(e){setTimeout((function(){window.parent.jivo_cobrowse.source.postMessage(e,window.parent.jivo_cobrowse.origin)}),0)},isNodeWebkit:function(){return isNodeWebkit},isOldCobrowse:e=>{if(10==e.length)return!0;let t=null;try{t=window.atob(e),(0,w.getPageWindow)().document.querySelector(t)}catch(e){t=!1}return!t},getCobrowseData:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(O.log("getCobrowseData",e,t,n,r),!k.isOldCobrowse(e)){const o=(0,w.getPageWindow)().location.href.replace((0,w.getPageWindow)().location.hash,"");if(t&&t!==o)(0,w.getPageWindow)().document.location.href=`${t}#jvhs_${e}`;else{t=(0,w.getPageWindow)().document.location.href;const o=`${t.split("#")[0]}#jvhs_${e}`;let a=null;try{a=window.atob(e)}catch(t){return O.error(t),void f.Monitoring.telemetry(p.TelemetryName.COBROWSE_FAILED,{param1:e,param2:t})}k.create({comment:n?(0,b.escape)(n):(0,s.l10n)("lblDefaultCobrowseComment"),element:a,hash:e,page:o,show:!0,agentId:r&&r.agentId,agent:r,cb:i},o)}return}const o=a.default.base_url+`/script/cobrowsing?hash=${e}`;T.xhrRequest.get(o,((n,r)=>{if(n)return(0,C.isFunction)(i)&&i(!1),f.Monitoring.telemetry(p.TelemetryName.COBROWSE_FAILED);const o=r.data;if((0,C.isObject)(o)){if(o.isDeleted)return(0,C.isFunction)(i)&&i(!1),f.Monitoring.telemetry(p.TelemetryName.COBROWSE_FAILED);0===o.comment.length&&(o.comment=(0,s.l10n)("lblDefaultCobrowseComment")),o.comment=(0,b.escape)(o.comment),g.default.stopBlinking();const n=(0,w.getPageWindow)().document.location.href.split("#")[0],r=t&&t+"#jvhs_"+e;t&&n!==t&&n!==encodeURI(t)?(0,w.getPageWindow)().document.location.href=r:(i&&(o.cb=i),k.create(o,r))}}))}};function M(e){var t=function(e){var t="",n=e.split(" > ");return(0,m.each)(n,(function(e){t+="/*",-1!==e.indexOf(":")&&(t+="["+e.substr(e.indexOf("(")+1,e.indexOf(")")-e.indexOf("(")-1)+"]")})),t}(e),n=A.querySelector(e);return n||A.evaluate(t,A,null,c.default.XPathResultType.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}var x={is_inited:!1,isCobrowseVisible:function(e){return(0,l.isVisible)(e)&&"HTML"!=e.tagName&&"hidden"!=e.style.visibility&&"jivo-iframe-container"!=e.id&&"jivo_container"!=e.id},highlight:function(e){if(O.log("highlight"),"cobrowser-iframe"===window.parent.name&&!this.is_inited&&!P.is_inited){var t=A.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",(0,S.getStaticURL)((h.EnvironmentManager.isDevelopment()?"/public":"")+"/css/for_app.css")),A.body.appendChild(t),this.is_inited=!0}var n;if(R(n="string"==typeof e.element?M(e.element):e.element)){if(e.hash&&null!==A.getElementById("#jivo_cobrowsing_element_id_"+e.hash))return this.animateScroll(e);(0,m.each)(["jivo_cobrowsing_element","jivo_cobrowsing_tooltip"],(function(e){(0,m.each)(A.getElementsByClassName(e),(function(e){e.parentNode.removeChild(e)}))}));var r,i=R(n),o=i.width,a=i.height;if(O.log(n,e),!this.isCobrowseVisible(n))return"cobrowser-iframe"!==window.parent.name&&f.Monitoring.telemetry(p.TelemetryName.COBROWSE_FAILED),void(e.cb&&e.cb(!1));O.log("overlayCreate"),u(),O.log("overlayCss"),l(i,o,a),O.log("overlayAppend"),c(),window.parent&&"cobrowser-iframe"!==window.parent.name&&f.Monitoring.telemetry(p.TelemetryName.COBROWSE_SUCCESS,{param1:e.hash?e.hash.length:0});var s=function(){var t;if(t="string"==typeof e.element?M(e.element):e.element,r||(u(),c()),t){var n=R(t);l(n,n.width,n.height)}if(r)return r};return setTimeout((function(){s()}),50),(0,E.addListener)(window.parent,"resize",s),r||void 0}function l(e,t,i){r.style.width=t+"px",r.style.height=i+"px",r.style.left=e.left-8+"px",r.style.top=e.top-8+"px",N(n)&&(r.style.position="fixed")}function u(){r||((r=A.createElement("jdiv")).className="jivo_cobrowsing_element",r.id="jivo_cobrowsing_element_id_"+e.hash,A.body.appendChild(r))}function c(){if(!r){var e=A.createElement("jdiv");r.className="jivo_cobrowsing_element_inner",r.appendChild(e)}}O.log("cobrowse element position failed.")},renderTooltip:function(e){O.log("renderTooltip",e);var t,n=null!==A.getElementById("#jivo_cobrowsing_element_id_"+e.hash);if(!1!==n)return this.animateScroll(e),n;if(t="string"==typeof e.element?M(e.element):e.element,!this.isCobrowseVisible(t))return O.log("Error render tooltip, element not visible"),void(e.cb&&e.cb(!1));var r=A.createElement("jdiv");r.className="",r.id="jivo_content_cobrowsing_tooltip",r.style.width="100%",r.style.height="auto";var i=A.createElement("jdiv");return i.className="jivo_cobrowsing_tooltip",u.default.mobile()&&(i.style.width="200px"),i.id="jivo_cobrowsing_tooltip_"+e.hash,N(t)&&(i.style.position="fixed"),i.appendChild(r),e.show&&(i=this.addTooltipContent(i,e,t),e.cb&&e.cb(!0)),i},appendTooltip:function(e,t){var n=e.childNodes[0];A.body.appendChild(e);var r=function(){if((0,l.addClass)(n,"jivo-bottom"),(0,l.removeClass)(n,"jivo-top jivo-left jivo-right"),t){var r=R(t),i=(0,w.getPageWindow)(),o=r.width,a=r.height,s=r.left+o/2,c=r.top-30+15,d=R(e),f=R(n),p=i.innerWidth||i.outerWidth,h=d.width/2*-1;cp&&(h=0,s=p-d.width):s+d.width>p&&(h=-1*d.width,s=r.left+o-30,n.className+=" jivo-right"),e.style.left=(0!==s?s:35)+"px",e.style.top=c+"px",e.style.marginLeft=h+"px"}};r(),e.style.opacity=0,this.animateScroll(null,t,n),setTimeout((function(){r(),e.style.opacity=1}),300),(0,E.addListener)(window.parent,"resize",r)},addTooltipContent:function(e,t,n){O.log("addTooltipContent",t);const r=e.childNodes[0],s=32&a.default.options&&t.agent,l=A.createElement("jdiv");l.dir="ltr",l.id="jivo_action",l.className="jivo-desktop";const u=window.parent.document.createElement("jdiv");if(u.id="jivo_close_button",u.innerHTML=d.default,l.appendChild(u),r.appendChild(l),u.addEventListener("click",(function(n){n.preventDefault();var r=A.getElementsByClassName("jivo_cobrowsing_element")[0];r.parentNode.removeChild(r),function(e){const t=window.top;t.location.href.indexOf("#jvhs_"+e)>0&&I(t.location.href.replace("#jvhs_"+e,""),(0,D.getCurrentPage)().title)}(t.hash),e.parentNode.removeChild(e)})),s&&t.agent){if(t.agent.avatar_url){const e=A.createElement("jdiv");e.className="jivo_cobrowsing_tooltip_avatar",r.appendChild(e),o.default.render(i.default.createElement(v.Avatar,{dark:!1,inChat:!0,url:(0,S.getAvatarURL)(a.default.avatar_url,t.agent.avatar_url)}),e)}const e=A.createElement("jdiv");e.innerText=t.agent.display_name,e.className="jivo_cobrowsing_tooltip_agent",r.appendChild(e)}const c=A.createElement("jdiv");return c.innerHTML=t.comment.split("\n").join("
"),c.className="jivo_cobrowsing_tooltip_text",r.appendChild(c),this.appendTooltip(e,n),e},animateScroll:function(e,t,n){if(e&&(t=A.getElementById("#jivo_cobrowsing_element_id_"+e.hash),n=A.getElementById("#jivo_cobrowsing_tooltip_"+e.hash).childNodes[0]),N(t))O.log("Ignore scroll for fixed element");else{var r={top:(n&&(0,l.hasClass)(n,"jivo-top")?R(t).top:R(n.parentNode).top)-300};A.documentElement&&"scrollBehavior"in A.documentElement.style&&(r.behavior="smooth"),O.log("scrollTo",r),window.parent.scrollTo(r)}}},P={is_selecting:!1,is_tooltip_open:!1,is_inited:!1,langpack:{},init:function(){if(!this.is_inited){var e=A.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",(0,S.getStaticURL)((h.EnvironmentManager.isDevelopment()?"/public":"")+"/css/for_app.css")),A.body.appendChild(e),(0,E.removeEvent)(window.parent,"keydown",this.keydownListener),(0,E.addListener)(window.parent,"keydown",this.keydownListener),this.is_inited=!0}},keydownListener:function(e){27===e.keyCode&&P.onEsc()},setLangpack:function(e){this.langpack=e},i18n:function(e){return this.langpack[e]?this.langpack[e]:e},startSelection:function(){var e=P;(0,l.addClass)(A.body,"jivo_selecting"),e.is_selecting=!0,(0,m.each)(["input","textarea","select","button"],(function(e){(0,m.each)(A.getElementsByTagName(e),(function(e){const t=A.createElement("jdiv"),n=R(e);t.style.width=n.width+"px",t.style.height=n.height+"px",t.style.left=n.left+"px",t.style.top=n.top+"px",t.style.position="absolute",t.realNode=e,e.disabled=!0,A.body.appendChild(t)}))})),(0,m.each)(A.getElementsByTagName("*"),(function(t){(0,E.addListener)(t,"mouseover",e.mouseoverListener),(0,E.addListener)(t,"mouseout",e.clearSelection)}))},stopTagsA:function(){(0,m.each)(A.getElementsByTagName("a"),(function(e){(0,E.addListener)(e,"click",(function(e){return e.preventDefault(),e.stopPropagation(),!1}))}))},mouseoverListener:function(e){var t=P;if("OPTION"===this.tagName)return!1;t.clearSelection(),x.highlight({element:e.target}),t.stopTagsA(),(0,E.removeEvent)(e.currentTarget,"click",t.clickListener),(0,E.addListener)(e.currentTarget,"click",t.clickListener)},clickListener:function(e){var t=P;e.preventDefault(),e.stopPropagation();var n=this.realNode?this.realNode:this;t.stopSelection(),t.toolTip(n)},stopSelection:function(){var e=P;(0,l.removeClass)(A.body,"jivo_selecting"),(0,m.each)(["input","textarea","select","button"],(function(e){(0,m.each)(A.getElementsByTagName(e),(function(e){e.disabled=!1}))})),(0,m.each)(A.getElementsByClassName("fake_cb_element"),(function(e){e.parentNode.removeChild(e)})),(0,m.each)(A.getElementsByTagName("*"),(function(t){(0,E.removeEvent)(t,"mouseover",e.mouseoverListener),(0,E.removeEvent)(t,"mouseout",e.clearSelection),(0,E.removeEvent)(t,"click",e.clickListener)})),e.is_selecting=!1},clearSelection:function(){(0,m.each)(["jivo_cobrowsing_element","jivo_cobrowsing_tooltip"],(function(e){(0,m.each)(A.getElementsByClassName(e),(function(e){e.parentNode.removeChild(e)}))}))},toolTip:function(e){var t=P,n=x.renderTooltip({element:e}),r=n.childNodes[0];n.className+=" air",n.style.width="auto",r.style.padding="8px",r.style.width="auto",r.style.backgroundColor="";var i=A.createElement("textarea");i.id="cobrowsing_textarea_comment",i.maxLength=200,i.placeholder=t.i18n("cb_enterComment"),i.value="",i.onkeypress=function(n){13===n.keyCode&&(n.preventDefault(),n.stopPropagation(),t.send(e))},t.textInput=i;var o=A.createElement("button");o.className="btn btn-mimi blue on_dark large",o.innerText=t.i18n("cb_send"),o.style.float="right",o.style.position="relative",o.style.marginRight="8px",o.onclick=function(){t.send(e)};var a=A.createElement("button");a.className="btn btn-mimi grey on_dark large",a.innerText=t.i18n("cb_cancel"),a.style.float="right",a.style.position="relative",a.style.marginRight="5px",a.onclick=function(){t.closeTooltip()};var s=A.createElement("jdiv");s.style.clear="both",r.appendChild(i),r.appendChild(a),r.appendChild(o),r.appendChild(s),x.appendTooltip(n,e),i.focus(),t.is_tooltip_open=!0},send:function(e){var t=this.textInput.value;t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");var n={name:"on_send",page_element:function(e){for(var t=[];e.parentNode;){if(e.id){t.unshift("#"+e.id);break}if(e==e.ownerDocument.documentElement)t.unshift(e.tagName);else{for(var n=1,r=e;r.previousElementSibling;r=r.previousElementSibling,n++);t.unshift(e.tagName+":nth-child("+n+")")}e=e.parentNode}return t.join(" > ")}(e),page_url:window.parent.location.href,comment:t};O.log("postMessage",n),k.postMessage(n),u.default.supportsLocalStorage()&&y.parentLS.remove(`jv_${a.default.widget_id}_tmp_app`)},closeTooltip:function(){var e=P;e.stopSelection(),e.is_tooltip_open=!1,e.startSelection(),k.postMessage({name:"on_cancel"})},onEsc:function(){this.is_tooltip_open?this.closeTooltip():this.is_selecting?(this.stopSelection(),k.postMessage({name:"reset"})):k.postMessage({name:"close"})}};function R(e){var t,n,r=0,i=0,o=0,a=0,s={top:0,left:0},l=A,u=l.body;return t=l.documentElement,e&&void 0!==e.getBoundingClientRect?(s=e.getBoundingClientRect(),e&&!N(e)&&(n=(0,w.getPageWindow)(),r=t.clientTop||u.clientTop||0,i=t.clientLeft||u.clientLeft||0,o=n.pageYOffset||t.scrollTop,a=n.pageXOffset||t.scrollLeft),{top:s.top+o-r,left:s.left+a-i,right:s.right,width:e.offsetWidth,height:e.offsetHeight,windowWidth:u.innerWidth,windowHeight:u.innerHeight}):(f.Monitoring.telemetry(p.TelemetryName.COBROWSE_FAILED),!1)}function N(e){var t=!1;if(e)for(var n=e,r=[];n&&"HTML"!==n.tagName;){if(r.unshift(n),window.parent.window.Polymer&&!window.parent.jivo_cobrowse&&n.treeScope_){var i=n[Object.keys(n)[0]];"fixed"===getComputedStyle(i).position&&(t=!0)}else"fixed"===getComputedStyle(n).position&&(t=!0);n=n.parentNode}return t}var L=k;t.default=L},99040:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ACTIVE_TEST=void 0;t.ACTIVE_TEST=!1},52274:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROACTIVE_TEXT_LIMIT=t.PROACTIVE_MAX_HEIGHT=t.MP_LINE_HEIGHT=t.MP_AGENT_HEIGHT=t.MINIMAL_WIDGET_HEIGHT=t.MAX_IMAGE_WIDTH=t.MAX_FILE_SIZE=t.MAX_EXTENDED_FILE_SIZE=t.MAX_ATTRIBUTE_STRING_LENGTH=t.MAX_ATTRIBUTE_NUMBER_LENGTH=t.MAX_ALLOWED_USER_ZOOM=t.MAINT_RECONNECT_TIMEOUT=t.LABEL_HEIGHT=t.INPUT_MOBILE_HEIGHT=t.INPUT_HEIGHT=t.HEADER_HEIGHT=t.DEFAULT_WIDGET_HEIGHT=t.CHAT_WIDTH=t.CAMPAIGN_TEXT_HEIGHT=t.CACHE_KEY=t.AWAY_CLIENT_TIMEOUT=t.APP_INVITE_TIME=t.API_INVITES_CACHE_TIME=void 0;t.AWAY_CLIENT_TIMEOUT=144e5;t.APP_INVITE_TIME=8e3;t.PROACTIVE_TEXT_LIMIT=50;t.PROACTIVE_MAX_HEIGHT=74;t.CAMPAIGN_TEXT_HEIGHT=90;t.MP_LINE_HEIGHT=19;t.MP_AGENT_HEIGHT=28;t.API_INVITES_CACHE_TIME=18e5;t.CACHE_KEY="api_invites";t.HEADER_HEIGHT=70;t.INPUT_HEIGHT=106;t.INPUT_MOBILE_HEIGHT=56;t.MAINT_RECONNECT_TIMEOUT=3e5;const n=10485760;t.MAX_FILE_SIZE=n;t.MAX_EXTENDED_FILE_SIZE=52428800;t.MINIMAL_WIDGET_HEIGHT=402;t.CHAT_WIDTH=336;t.LABEL_HEIGHT=40;t.DEFAULT_WIDGET_HEIGHT=496;t.MAX_IMAGE_WIDTH=234;t.MAX_ALLOWED_USER_ZOOM=1.03;t.MAX_ATTRIBUTE_STRING_LENGTH=100;t.MAX_ATTRIBUTE_NUMBER_LENGTH=9},85948:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.addSyncExclude=void 0;var i=r(n(61125)),o=r(n(19955)),a=n(44733),s=n(9393),l=n(90991),u=r(n(4855)),c=n(73422),d=n(32183);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t{_.push(e),m.push(e)};var y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("JivoStore"==e.__type)return e;var n=JSON.stringify(e),r=o.default.supportsLocalStorage(),i=new h,u=(0,l.debounce)((()=>{i.emit("update",e)}),10),f=()=>{if(r){const n=(t=>{let n=p({},t);return t?v(n,e):n=e,n})(a.StorageProvider.get(t));a.StorageProvider.set(t,n)}},y=(e,n)=>{var r=e[n];Object.defineProperty(e,n,{set:e=>{if(r!=e&&(r=e,u(),t)){if(!(0,d.pageVisible)()&&_.indexOf(n)>-1)return;if(m.indexOf(n)>-1)return;if(window.parent&&"cobrowser-iframe"===window.parent.name)return;f()}},get:()=>r})},b=e=>{(0,s.each)(e,((t,n)=>{"function"!=typeof t&&(t&&(0,c.isObject)(t)?b(t):y(e,n))}))},E=()=>{if(t)try{const n=a.StorageProvider.get(t);v(e,n)}catch(e){g.error(e)}},C=()=>{e=JSON.parse(n),b(e),f(),u()};return b(e),E(),Object.defineProperty(e,"__type",{enumerable:!1,configurable:!1,writable:!1,value:"JivoStore"}),Object.defineProperty(e,"addListener",{enumerable:!1,configurable:!1,writable:!1,value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",t=arguments.length>1?arguments[1]:void 0;return"function"==typeof e&&(t=e,e="update"),i.addListener(e,t)}}),Object.defineProperty(e,"dispatch",{enumerable:!1,configurable:!1,writable:!1,value:()=>{u()}}),Object.defineProperty(e,"reload",{enumerable:!1,configurable:!1,writable:!1,value:()=>{E()}}),Object.defineProperty(e,"reset",{enumerable:!1,configurable:!1,writable:!1,value:()=>{C()}}),e};t.default=y},33180:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.cssLoader=void 0;var i=r(n(96394)),o=r(n(48553));window.parent.__jivoBundleInit&&window.parent.__jivoBundleInit(window);const a=(()=>{let e=window.parent.location.protocol;return-1===["http","https","http:","https:"].indexOf(e)&&(e="https:"),e})()+i.default.base_url+"/css/4815a6a/widget.css",s=new o.default(window.parent.document,a);t.cssLoader=s},87869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useClickListener=function(e,t){(0,r.useEffect)((()=>{if((0,i.isFunction)(t)&&e.current){const n=n=>{e.current&&(n.preventDefault(),t(n))},r=e.current;return r.addEventListener("mousedown",n),r.addEventListener("touchstart",n),()=>{r.removeEventListener("mousedown",n),r.removeEventListener("touchstart",n)}}}),[e,t])};var r=n(98661),i=n(73422)},57985:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useClickOutside=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.parent.document;(0,r.useEffect)((()=>{if((0,i.isFunction)(t)){const r=n=>{e.current&&!e.current.contains(n.target)&&t(n)};return n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),()=>{n.removeEventListener("mousedown",r),n.removeEventListener("touchstart",r)}}}),[e,t,n])};var r=n(98661),i=n(73422)},49862:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDidUpdate=function(e,t){const n=(0,r.useRef)(!1);(0,r.useEffect)((()=>{n.current?e():n.current=!0}),t)};var r=n(98661)},63664:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useErrorCatcher=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,o.useErrorBoundary)((t=>{t.message+=` (in ${e} component)`,a.Monitoring.reportException(t)})),r=(0,i.default)(n,2),l=r[0],u=r[1];if(l)return(0,s.isFunction)(t)?t({error:l,resetError:u}):t};var i=r(n(67375)),o=n(30396),a=n(54415),s=n(73422)},77389:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useListenedStyle=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=(0,i.useRef)(l(e,t));return(0,i.useEffect)((function(){a.default.listenChangeZoom((()=>{n.current=l(e,t)}))}),[t,e]),n.current};var i=n(98661),o=n(73422),a=r(n(74379));function s(e,t){return{textSize:a.default.getTextSize(),lineHeight:a.default.getLineHeight(t),zoom:a.default.getAppZoom()}[e]}function l(e,t){return t?(0,o.isArray)(e)?e.map((e=>(0,o.isObject)(e)?s(e.name,e.repass):s(e))):(0,o.isObject)(e)?s(e.name,e.repass):s(e):[]}},9335:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useToggle=void 0;var r=n(98661);const i=(e,t)=>"boolean"==typeof t?t:!e;t.useToggle=e=>(0,r.useReducer)(i,e)},88319:function(e,t){"use strict";t.Z=void 0,function(e){var t={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},n={1e3:"Normal Closure",1001:"Going away",1002:"Protocol error",1003:"Unsupported data",1004:"reserved",1005:null,1006:null,1007:"Invalid frame payload data",1008:"Policy violation",1009:"Message Too Big",1010:"Mandatory Ext.",1011:"Internal Error",1012:"Service Restart",1013:"Try Again Later",1014:"Unassigned",1015:"TLS handshake",3001:"Attempts have Ended",3333:"Spam detected",4e3:"Application Closure",4999:"Last Code"},r=function(){},i=function(){throw new Error("Not implemented")},o=Date,a=function(e,t){this.name="NetworkError",this.code=t<<0,this.message=String(e)};a.prototype.toString=function(){return this.name+":"+(this.code<<0||"")+" "+this.message};var s,l=function(e,t,n){if(e&&"function"==typeof e[t])try{e[t](n)}catch(n){if("onerror"===String(t))throw n;try{l(e,"onerror",n)}catch(e){}}},u={};if(window&&("function"==typeof window.WebSocket||"object"==typeof window.WebSocket)){var c=window.WebSocket;for(var d in s=function(e,r){var i,o,a,s,u=this;this.url=e,this.readyState=t.CONNECTING;var d=function(){if(i){i.onclose=null,i.onerror=null,i.onmessage=null,i.onopen=null;try{i.close()}catch(e){}}u.readyState=t.CLOSED,l(u,"onclose",{wasClean:!1,code:1006,reason:"Timeout"})},f=function(){try{this.send(".")}catch(e){}s=setTimeout(d,1e4)}.bind(this);this.close=function(e,n){if(clearTimeout(a),this.readyState===t.CONNECTING)this.readyState=t.CLOSING,clearTimeout(o),o=setTimeout((function(){u.readyState=t.CLOSED,l(u,"onclose",{wasClean:!1,code:1006,reason:""})}),20);else if(this.readyState===t.OPEN){this.readyState=t.CLOSING;try{n?i.close(e,n):e?i.close(e):i.close(1e3)}catch(e){l(u,"onerror",e),l(u,"onclose",{wasClean:!1,code:1006,reason:""})}}},this.send=function(e){if(!i||i.OPEN!==i.readyState)throw new Error("Socket is not open");clearTimeout(a),clearTimeout(s),i.send(e),a=setTimeout(f,2e4)},o=setTimeout((function(){try{(i=r?new c(e,r):new c(e)).onclose=function(e){if(clearTimeout(a),clearTimeout(o),u.readyState=t.CLOSED,/MSIE|Trident|Edge|Lumia/.test(window.navigator.userAgent)&&e.wasClean&&(1e3===e.code||1005===e.code)&&e.reason)for(var r in n)if(e.reason===n[r])return void l(u,"onclose",{wasClean:!0,code:r<<0,reason:e.reason});l(u,"onclose",e)},i.onerror=function(e){e.name||e.message||(e.name="WebSocketError",e.message="Unknown"),l(u,"onerror",e)},i.onmessage=function(e){clearTimeout(s),e&&e.data&&1f[1]&&(s=i);if(/apple/i.test(window.navigator.vendor))(f=/\bVersion\/(\d+)\./.exec(window.navigator.userAgent))&&6>f[1]&&(s=i)}u.ws=u.wss=s;var p=function(){var e,t,n,i,o=window.document.getElementsByTagName("head")[0],a=this;this.withCredentials=!1,this.readyState=0,this.responseText="",this.status=0,this.statusText="",this.timeout=void 0;var s=function(){if(e){clearTimeout(i),e.onreadystatechange=r,e.onload=r,e.onerror=r,e.parentNode.removeChild(e),e=null,t=null,n=null,a.responseText="",a.status=0,a.statusText="",a.timeout=void 0,a.withCredentials=!1;try{delete window[n]}catch(e){window[n]=void 0}l(a,"onloadend")}},u=function(){e&&(l(a,"onerror"),s())};this.open=function(e,r){!t&&r&&(a.readyState=1,t=String(r).replace(/#.*$/,""),n="_jivo"+p._count++,t+=(-1===t.indexOf("?")?"?":"&")+"cb="+n)},this.send=function(r){t&&(r=r?"&msg="+encodeURIComponent(r):"",window[n]=function(e){a.readyState=4,p._statusBody.test(e)?(a.status=p._statusBody.exec(e)[1]<<0,a.statusText="",a.responseText="",l(a,"onerror"),s()):(a.status=200,a.statusText="OK",a.responseText=e,l(a,"onload"),s())},(e=document.createElement("script")).charset="utf-8",e.type="text/javascript",e.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||setTimeout(u,0)},e.readyState||(e.onload=e.onerror=u),e.src=t+r,o.appendChild(e),a.timeout<<=0,0e.code?h(e):w()},m=function(e){try{s.error(e)}catch(e){throw e}},v=function(e){if(t.OPEN===l())try{s.message(e.data)}catch(e){m(e)}},T=function(){var e,n,r,o,u;f(),l(t.OPEN),e=i[i.index],n=d,o=1e3,u=function(){e&&0<=e.health&&(n(++e.health),o<<=1,r=setTimeout(u,o))},r=setTimeout(u,o),a=function(){clearTimeout(r)};try{s.open()}catch(e){m(e)}},D=function(){var e=i[i.index];try{o=function(e){if("string"!=typeof e)throw new TypeError("Bad URL type");var t=y.exec(e);if(null===t)throw new Error("Bad URL");if(!u[t[1]])throw new Error("Not supported URL scheme: "+t[1]);return new u[t[1]](e)}(e.value)}catch(t){return e.health=-1,++i.index,m(t),w()}o.onclose=_,o.onerror=m,o.onmessage=v,o.onopen=T},w=function(e){if(f(),i.index>=i.length)c(void 0),d(void 0),h({wasClean:!1,code:3001,reason:n[3001]});else if(0>i[i.index].health)m(new Error("Sick URL")),++i.index,w();else{p(),l(t.CONNECTING);var r=i[i.index];c()!==r.value&&(c(r.value),d(r.health));try{s.connecting(r.health)}catch(e){}e||0===i[i.index].health?D():f(D,3e3)}};this.open=function(e){if(g())return h({wasClean:!1,code:3333,reason:n[3333]});if(t.CONNECTING!==l()&&t.OPEN!==l()){if(e){e=String(e);for(var r=0;r(e<<=0)||5e3<=e?o.close():r?o.close(e,String(r)):o.close(e),o.onclose=h,l(t.CLOSING)))},this.send=function(e){if(t.OPEN!==l())return new Error("Connection is not open");if(g())return h({wasClean:!1,code:3333,reason:n[3333]}),new Error("Spam detected");try{o.send(e)}catch(e){return e}return null};var S=function(e,t){return function(){t.apply(e,arguments)}};this.on=function(e,t){if(e&&"object"==typeof e)for(var n in e)this.on(n,S(e,e[n]));else s[e]&&"function"==typeof t&&(s[e]=t)},this.off=function(){for(var e in s)s[e]=r},this.getHealthyURLs=function(){for(var e=[],t=0;t0?d.v=d.v*t:d.v=100*(t-1),d.s=d.s*o;var p,h,g,_=f.toRGB(d);return"#"+(p=_.r,h=_.g,g=_.b,a(p)+a(h)+a(g))}function l(e){return(299*n(e)+587*r(e)+114*i(e))/1e3}function u(e,t,n){e<=0&&(e=0),t<=0&&(t=0),n<=0&&(n=0),e>360&&(e=360),t>100&&(t=100),n>100&&(n=100),this.h=e,this.s=t,this.v=n}function c(e,t,n){e<=0&&(e=0),t<=0&&(t=0),n<=0&&(n=0),e>255&&(e=255),t>255&&(t=255),n>255&&(n=255),this.r=e,this.g=t,this.b=n}function d(e,t,n,r){e<=0&&(e=0),t<=0&&(t=0),n<=0&&(n=0),r<=0&&(r=0),e>100&&(e=100),t>100&&(t=100),n>100&&(n=100),r>100&&(r=100),this.c=e,this.m=t,this.y=n,this.k=r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f={isLightColor:function(e){return function(e){var t=n(e),o=r(e),a=i(e),s=f.toHSV(new c(t,o,a));return s.v+-.5*s.s}(e)>58},getContrast:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:128;const n=l(e);return n>=t?"black":"white"},_RGBtoHSV:function(e){var t=new u(0,0,0),n=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(n,r,i),a=Math.max(n,r,i),s=a-o;if(t.v=a,0==s)t.h=0,t.s=0;else{t.s=s/a;var l=((a-n)/6+s/2)/s,c=((a-r)/6+s/2)/s,d=((a-i)/6+s/2)/s;n==a?t.h=d-c:r==a?t.h=1/3+l-d:i==a&&(t.h=2/3+c-l),t.h<0&&(t.h+=1),t.h>1&&(t.h-=1)}return t.h=Math.round(360*t.h),t.s=Math.round(100*t.s),t.v=Math.round(100*t.v),t},_HSVtoRGB:function(e){var t=new c(0,0,0),n=e.h/360,r=e.s/100,i=e.v/100;if(0==r)t.r=255*i,t.g=255*i,t.b=255*i;else{var o,a,s,l=6*n,u=Math.floor(l),d=i*(1-r),f=i*(1-r*(l-u)),p=i*(1-r*(1-(l-u)));0==u?(o=i,a=p,s=d):1==u?(o=f,a=i,s=d):2==u?(o=d,a=i,s=p):3==u?(o=d,a=f,s=i):4==u?(o=p,a=d,s=i):(o=i,a=d,s=f),t.r=255*o,t.g=255*a,t.b=255*s,t.r=Math.round(t.r),t.g=Math.round(t.g),t.b=Math.round(t.b)}return t},_CMYKtoRGB:function(e){var t=new c(0,0,0),n=e.c/100,r=e.m/100,i=e.y/100,o=e.k/100;return t.r=1-Math.min(1,n*(1-o)+o),t.g=1-Math.min(1,r*(1-o)+o),t.b=1-Math.min(1,i*(1-o)+o),t.r=Math.round(255*t.r),t.g=Math.round(255*t.g),t.b=Math.round(255*t.b),t},_RGBtoCMYK:function(e){var t=new d(0,0,0,0),n=e.r/255,r=e.g/255,i=e.b/255;return t.k=Math.min(1-n,1-r,1-i),t.c=(1-n-t.k)/(1-t.k),t.m=(1-r-t.k)/(1-t.k),t.y=(1-i-t.k)/(1-t.k),t.c=Math.round(100*t.c),t.m=Math.round(100*t.m),t.y=Math.round(100*t.y),t.k=Math.round(100*t.k),t},toRGB:function(e){return e instanceof c?e:e instanceof u?this._HSVtoRGB(e):e instanceof d?this._CMYKtoRGB(e):void 0},toHSV:function(e){return e instanceof u?e:e instanceof c?this._RGBtoHSV(e):e instanceof d?this._RGBtoHSV(this._CMYKtoRGB(e)):void 0},toCMYK:function(e){return e instanceof d?e:e instanceof c?this._RGBtoCMYK(e):e instanceof u?this._RGBtoCMYK(this._HSVtoRGB(e)):void 0},genGradientBg:function(e){return"linear-gradient(95deg, "+e+" 20%, "+this.getRightColor(e)+" 80%)"},getRightColor:function(e){return s(e,.9,.9)},getGradientBg:function(e,t){return"linear-gradient(95deg, "+e+" 20%, "+(t||e)+" 80%)"}},p=f;t.default=p},96879:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.filterMessage=void 0;var i=n(81152),o=n(73422),a=r(n(14264));t.filterMessage=e=>{var t;const n=/^\/service/.test(e.text),r=(0,o.isObject)(e.media),s=r&&(null===(t=e.media)||void 0===t?void 0:t.address),l=e.msg_id;let u=!n&&!s;if("number"==typeof l){const e=!!a.default.getMessageById(l);u=u&&!e}if(r){const t=e.from===i.MessageInitiator.CLIENT&&e.type!==i.MessageType.MEDIA&&r&&"error"===e.media.type;u=u&&!t}return e.deleted&&(u=!1),e.type==i.MessageType.INVOICE&&(u=!1),u}},17987:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(60277),i=n(9393),o=n(64249),a=n(82138),s=n(21733),l=n(34548),u=n(15201),c=n(31484),d=n(54415),f=n(97615),p=n(73422),h=function(){var e,t=[].slice,n="transition",h="handler",g="handling",_="handled",m="nohandler",v="deferred",y="newfsm",b={makeFsmNamespace:(e=0,function(){return"fsm."+e++}),getDefaultOptions:function(){return{initialState:"uninitialized",eventListeners:{"*":[]},states:{},eventQueue:[],namespace:b.makeFsmNamespace(),targetReplayState:"",state:void 0,priorState:void 0,_priorAction:"",_currentAction:""}}},E={"*":function(e,t,n){e[t]=n},object:function(e,t,n){e[t]=T({},e[t]||{},n)},array:function(e,t,n){e[t]=[],(0,i.each)(n,(function(n,r){E[C(n)](e[t],r,n)}),this)}},C=function(e){var t=function(e){return(0,p.isArray)(e)?"array":(0,o.isDate)(e)?"date":(0,a.isRegExp)(e)?"regex":typeof e}(e);return E[t]?t:"*"},T=function(e){return(0,i.each)(t.call(arguments,1),(function(t){(0,i.each)(t,(function(t,n){E[C(t)](e,n,t)}))})),e},D=function(e){(0,r.extend)(this,e),(0,c.defaults)(this,b.getDefaultOptions()),this.initialize.apply(this,arguments),S.emit(y,this),this.initialState&&this.transition(this.initialState)};(0,r.extend)(D.prototype,{initialize:function(){},emit:function(e){var n=arguments;this.eventListeners["*"]&&(0,i.each)(this.eventListeners["*"],(function(r){if(f.EnvironmentManager.isProduction())try{r.apply(this,t.call(n,0))}catch(t){t.message+=` machina.js * [${this.namespace}] ${e}`,d.Monitoring.reportException(t)}else r.apply(this,t.call(n,0))}),this),this.eventListeners[e]&&(0,i.each)(this.eventListeners[e],(function(r){if(f.EnvironmentManager.isProduction())try{r.apply(this,t.call(n,1))}catch(t){t.message+=` machina.js ev [${this.namespace}] ${e}`,d.Monitoring.reportException(t)}else r.apply(this,t.call(n,1))}),this)},handle:function(e){if(!this.inExitHandler){var n,r,i,o,a=this.states,l=this.state,u=t.call(arguments,0);this.currentActionArgs=u,a[l][e]||a[l]["*"]||this["*"]?(i="*"===(n=a[l][e]?e:"*"),a[l][n]?(r=a[l][n],o=l+"."+n):(r=this["*"],o="*"),this._currentAction||(this._currentAction=o),this.emit.call(this,g,{inputType:e,args:u.slice(1)}),(0,p.isFunction)(r)&&(r=r.apply(this,i?u:u.slice(1))),(0,s.isString)(r)&&this.transition(r),this.emit.call(this,_,{inputType:e,args:u.slice(1)}),this._priorAction=this._currentAction,this._currentAction="",this.processQueue(h)):this.emit.call(this,m,{inputType:e,args:u.slice(1)}),this.currentActionArgs=void 0}},transition:function(e){if(!this.inExitHandler&&e!==this.state){var t;if(this.states[e]){if(this.targetReplayState=e,this.priorState=this.state,this.state=e,t=this.priorState,this.states[t]&&this.states[t]._onExit&&(this.inExitHandler=!0,this.states[t]._onExit.call(this),this.inExitHandler=!1),this.emit.call(this,"transition",{fromState:t,action:this._currentAction,toState:e}),this.states[e]._onEnter)if(f.EnvironmentManager.isProduction())try{this.states[e]._onEnter.call(this)}catch(t){t.message+=` machina.js [${this.namespace}] ${e}`,d.Monitoring.reportException(t)}else this.states[e]._onEnter.call(this);return void(this.targetReplayState===e&&this.processQueue(n))}this.emit.call(this,"invalidstate",{state:this.state,attemptedState:e})}},processQueue:function(e){var t=e===n?function(e){return e.type===n&&(!e.untilState||e.untilState===this.state)}:function(e){return e.type===h},r=this.eventQueue.filter(t);this.eventQueue=(0,l.difference)(this.eventQueue,r),(0,i.each)(r,(function(e){this.handle.apply(this,e.args)}),this)},clearQueue:function(e,t){var r;e?(e===n?r=function(e){return e.type===n&&(!t||e.untilState===t)}:e===h&&(r=function(e){return e.type===h}),this.eventQueue=this.eventQueue.filter(r)):this.eventQueue=[]},deferUntilTransition:function(e){if(this.currentActionArgs){var t={type:n,untilState:e,args:this.currentActionArgs};this.eventQueue.push(t),this.emit.call(this,v,{state:this.state,queuedArgs:t})}},deferUntilNextHandler:function(){if(this.currentActionArgs){var e={type:n,args:this.currentActionArgs};this.eventQueue.push(e),this.emit.call(this,v,{state:this.state,queuedArgs:e})}},on:function(e,t){var n=this;return n.eventListeners[e]||(n.eventListeners[e]=[]),n.eventListeners[e].push(t),{eventName:e,callback:t,off:function(){n.off(e,t)}}},off:function(e,t){e?this.eventListeners[e]&&(this.eventListeners[e]=t?(0,u.without)(this.eventListeners[e],t):[]):this.eventListeners={}}}),D.prototype.trigger=D.prototype.emit;var w=function(){};D.extend=function(e,t){var n=function(e,t,n){var r;return r=t&&t.hasOwnProperty("constructor")?t.constructor:function(){e.apply(this,arguments)},T(r,e),w.prototype=e.prototype,r.prototype=new w,t&&T(r.prototype,t),n&&T(r,n),r.prototype.constructor=r,r.__super__=e.prototype,r}(this,e,t);return n.extend=this.extend,n};var S={Fsm:D,utils:b,on:function(e,t){return this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t),t},off:function(e,t){this.eventListeners[e]&&(this.eventListeners[e]=(0,u.without)(this.eventListeners[e],t))},trigger:function(e){var n=arguments,r=this.eventListeners[e]||[];r&&r.length&&(0,i.each)(r,(function(e){e.apply(null,t.call(n,1))}))},eventListeners:{newFsm:[]}};return S.emit=S.trigger,S}(),g=h;t.default=g},5798:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n=function(e,t,n){for(;t=s.length){if(o.length===l.length)return a.join("");if(void 0!==f&&o.length>l.length)return n(a,u,f).join("");break}if(a[u]&&r(a[u])&&s[c].match(/[0-9]/))a[u]=s[c++];else if(a[u]&&r(a[u]))return void 0!==f?n(a,u,f).join(""):a.slice(0,u).join("")}return a.join("").substr(0,u)}};t.default=i},50754:function(e,t,n){"use strict";var r=n(17907)(n(15687));const i=2147483647,o=36,a=/^xn--/,s=/[^\0-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,u={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,d=String.fromCharCode;function f(e){throw new RangeError(u[e])}function p(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]);const i=function(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}((e=e.replace(l,".")).split("."),t).join(".");return r+i}function h(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&n>1,e+=c(e/t);e>455;r+=o)e=c(e/35);return c(r+36*e/(e+38))},m=function(e){const t=[],n=e.length;let r=0,a=128,s=72,l=e.lastIndexOf("-");l<0&&(l=0);for(let n=0;n=128&&f("not-basic"),t.push(e.charCodeAt(n));for(let d=l>0?l+1:0;d=n&&f("invalid-input");const l=(u=e.charCodeAt(d++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:o;(l>=o||l>c((i-r)/t))&&f("overflow"),r+=l*t;const p=a<=s?1:a>=s+26?26:a-s;if(lc(i/h)&&f("overflow"),t*=h}const p=t.length+1;s=_(r-l,p,0==l),c(r/p)>i-a&&f("overflow"),a+=c(r/p),r%=p,t.splice(r++,0,a)}var u;return String.fromCodePoint.apply(String,t)},v=function(e){const t=[];let n=(e=h(e)).length,r=128,a=0,s=72;for(const n of e)n<128&&t.push(d(n));let l=t.length,u=l;for(l&&t.push("-");u=r&&tc((i-a)/p)&&f("overflow"),a+=(n-r)*p,r=n;for(const n of e)if(ni&&f("overflow"),n==r){let e=a;for(let n=o;;n+=o){const r=n<=s?1:n>=s+26?26:n-s;if(eString.fromCodePoint.apply(String,(0,r.default)(e))},decode:m,encode:v,toASCII:function(e){return p(e,(function(e){return s.test(e)?"xn--"+v(e):e}))},toUnicode:function(e){return p(e,(function(e){return a.test(e)?m(e.slice(4).toLowerCase()):e}))}};e.exports=y},69759:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(60277),i=n(80210);const o=function(e){const t=[];for(const r in e){const i=e[r];for(const e in i){const r=i[e];for(const i in r){var n=r[i];n[0].forEach((function(r){var o={domain:r,medium:e,name:i};n[1]&&(o.params=n[1]),t.push(o)}))}}}return t}(n(61691)),a=function(e,t,n){this.known=!1,this.referer=null,this.medium="unknown",this.search_parameter=null,this.search_term=null,this.referers=n||o;const a=new URL(e),s=a.hostname;if(this.known=Boolean(~["http:","https:"].indexOf(a.protocol)),this.uri=a,!this.known)return;if(t){if(new URL(t).hostname===s)return void(this.medium="internal")}let l=this._lookup_referer(s,a.pathname,!0);if(l||(l=this._lookup_referer(s,a.pathname,!1),l)){if(this.referer=l.name,this.medium=l.medium,"search"===l.medium){if(!l.params)return;const e=(0,r.extend)(i.querystring.parse(a.hash),i.querystring.parse(a.search));for(const t in e){const n=e[t];-1!==l.params.indexOf(t.toLowerCase())&&(this.search_parameter=t,this.search_term=n)}}}else this.medium="unknown"};a.prototype.searchReferer=function(e){return this.referers.find((t=>t.domain instanceof RegExp&&e.search(t.domain)>-1||(t.domain===e||void 0)))},a.prototype._lookup_referer=function(e,t,n){let r=null;if(r=n?this.searchReferer(e+t):this.searchReferer(e),!r&&n){const n=t.split("/");if(n.length>1)try{r=this.searchReferer(e+"/"+n[1])}catch(e){}}if(r)return r;try{const r=e.indexOf(".");if(-1===r)return null;const i=e.slice(r+1);return this._lookup_referer(i,t,n)}catch(e){return null}};var s=a;t.default=s},61691:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={unknown:{Google:[["support.google.com","developers.google.com","maps.google.com","accounts.google.com","drive.google.com","sites.google.com","groups.google.com","groups.google.co.uk","news.google.co.uk"]],"Yahoo!":[["finance.yahoo.com","news.yahoo.com","eurosport.yahoo.com","sports.yahoo.com","astrology.yahoo.com","travel.yahoo.com","answers.yahoo.com","screen.yahoo.com","weather.yahoo.com","messenger.yahoo.com","games.yahoo.com","shopping.yahoo.net","movies.yahoo.com","cars.yahoo.com","lifestyle.yahoo.com","omg.yahoo.com","match.yahoo.net"]]},search:{"360.cn":[[/so.(com|360.cn)$/gi],["q"]],AOL:[[/\.aol.\w{2,4}(\w{2,4})?/gi,"aolsearch.com"],["q","query"]],Yandex:[["yandex.ru","yandex.ua","yandex.com","www.yandex.ru","www.yandex.ua","www.yandex.com","yandex.by","yandex.kz","www.yandex.by","www.yandex.kz"],["text"]],DuckDuckGoL:[["duckduckgo.com"],["q"]],Picsearch:[["www.picsearch.com"],["q"]],"Mail.ru":[["go.mail.ru"],["q"]],Rambler:[["nova.rambler.ru"],["query","words"]],MySearch:[[/(.mysearch)|(.myway).com$/gi,"search.mywebsearch.com"],["searchfor","searchFor"]],Baidu:[[/.baidu.com$/gi,"web.gougou.com"],["wd","word","kw","k"]],Ecosia:[["ecosia.org"],["q"]],Bing:[["bing.com","www.bing.com","msnbc.msn.com","dizionario.it.msn.com","cc.bingj.com","m.bing.com"],["q"]],Seznam:[["search.seznam.cz"],["q"]],"Yahoo!":[[/.?yahoo./gi,"www.cercato.it","search.offerbox.com","ys.mirostart.com"],["q","p"]],Ask:[[/.ask.com$/gi,"ask.reference.com","www.askkids.com","www.ask.co.uk","search-results.com","uk.search-results.com","www.search-results.com","int.search-results.com"]],"uol.com.br":[["busca.uol.com.br"],["q"]],Google:[[/^(www.)?google.\w{2,4}(.\w{2,4})?$/gi,/^.incredimail.com$/gi,/.googleearth./gi,"isearch.avg.com","www.cnn.com","darkoogle.com","search.darkoogle.com","search.foxtab.com","www.gooofullsearch.com","search.hiyo.com","search.sweetim.com","www.fastweb.it","search.juno.com","find.tdc.dk","searchresults.verizon.com","search.walla.co.il","search.alot.com","webcache.googleusercontent.com","encrypted.google.com","googlesyndicatedsearch.com"],["q","query","keywords"]],"2GIS":[["link.2gis.ru"]]},email:{Gmail:[["mail.google.com"]],Rambler:[["mail.rambler.ru"]]},social:{Odnoklassniki:[["odnoklassniki.ru","ok.ru"]],GitHub:[["github.com"]],Instagram:[["instagram.com"]],Vkontakte:[["vk.com","vkontakte.ru"]],Twitter:[["twitter.com","t.co"]],"Mail.ru":[["my.mail.ru"]],Pinterest:[["pinterest.com"]],LinkedIn:[["linkedin.com"]],Facebook:[["facebook.com","fb.me"]],Youtube:[["youtube.com","youtu.be"]]}}},8117:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=r(n(69759)),a=r(n(4855)),s=r(n(50754)),l=n(92560),u=n(37578),c=n(80210);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const f=a.default.name("utm"),p={utmccn:"campaign",utmcsr:"source",utmcmd:"medium",utmctr:"keyword",utmcct:"content"},h={parseUtmz:function(e){const t={};if(e){const n=decodeURI(e).replace(/^[0-9\.]*/g,"");let r;if(n){const e=n.split("|");for(let n=0;n=0?(r[t[0]]=t[1],a=!0):"term"===t[0]&&(r.keyword=t[1],r.term=t[1]))}if(h=function(e){for(var t=1;t!(0,l.isEmpty)(e)))},isLid(e,t){return["yclid=","gclid=","fbclid="].some((t=>e.includes(t)))&&["yandex","google","facebook"].some((e=>t.includes(e)))},decodeString(e){try{e=decodeURIComponent(e)}catch(t){return f.log(t),this.decode(e)}return e},decode(e){return(e=(e=(e=e.replace(/%([EF][0-9A-F])%([89AB][0-9A-F])%([89AB][0-9A-F])/gi,(function(e,t,n,r){const i=parseInt(t,16)-224,o=parseInt(n,16)-128;if(0==i&&o<32)return e;const a=(i<<12)+(o<<6)+(parseInt(r,16)-128);return a>65535?e:String.fromCharCode(a)}))).replace(/%([CD][0-9A-F])%([89AB][0-9A-F])/gi,(function(e,t,n){const r=parseInt(t,16)-192;if(r<2)return e;const i=parseInt(n,16)-128;return String.fromCharCode((r<<6)+i)}))).replace(/%([0-7][0-9A-F])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))).replace(/%[A-Z0-9]{2}/gi,"")},getUTMParamsFromUrl:function(e){let t=e.indexOf("?"),n=null;for(;-1!=n;)n=e.indexOf("?",t+1),n>0&&(t=n);const r=e.substr(t+1).split("&");let i,o,a="";for(o=r.length;o--;)if(i=r[o].split("="),i[0].indexOf("utm_")>=0){i=r[o],i=i.replace(/\|/gi,"%7C");const e=i.split("=");e.length>1&&(i=e[0]+"="+e.slice(1).join("%3D")),a+=(a.length>0?"|":"")+i.substr(i.indexOf("utm_")+4)}return a},setUTM:function(e){let t=e.href,n=e.refer,r=e.setterFn;const i=h.getUTMParamsFromUrl(t),o=h.parseUTM(t,n,i);return r({campaign:o&&o.campaign||null,source:o&&o.source||null,medium:o&&o.medium||null,keyword:o&&o.keyword||null,term:o&&o.term||null,content:o&&o.content||null})}};var g=h;t.default=g},95020:function(e,t,n){"use strict";!function(){"undefined"==typeof window&&(window=n.g);var e,t=2e4,r=2e3,i=32e3,o=3e4,a=function(t,n){if("function"==typeof e[t])try{return e[t](n)}catch(n){if("onerror"!==t)try{e.onerror(n)}catch(e){}}},s=function(e){return void 0===e?"":("string"!=typeof e&&(e=String(e)),e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/[\x00-\x19]/g," "))},l=function(e){return Math.random()*e<<0},u=/^-?[a-zA-Z0-9]{1,16}$/,c=/^[_a-zA-Z][_a-zA-Z0-9]{0,7}$/,d=/^[a-zA-Z0-9]{10}$/;window.ClientSocket=function(){if(e)return e;e=this;var n,f,p,h,g=r,_=0,m=function(){try{f.send(".")}catch(e){}p=setTimeout(m,t)},v=function(){f.onclose=null,f.onerror=null,f.onmessage=null,f.onopen=null,f.CLOSING>f.readyState&&f.close()},y=function(){f&&(v(),i<(g<<=1)&&(g=i)),f=new WebSocket(n),e.readyState=f.readyState,f.onclose=function(t){if(e.readyState=f.readyState,a("onclose",t.reason),p){if(clearTimeout(p),clearTimeout(h),t.reason){var n=-1;switch(t.reason){case"Protocol Error":case"Unsupported Data":case"Invalid Data":case"Message Too Big":case"Mandatory Ext.":case"Invalid Response":case"Normal Closure":case"Void Time":n=0;break;case"Service Restart":n=6e4+l(6e5);break;case"Try Again Later":n=6e5+l(6e5);break;case"Internal Error":n=18e5+l(6e5);break;case"Going Away":n=36e5+l(6e5);break;case"Policy Violation":n=72e5;break;case"Blacklisted":n=864e5}if(-1!==n)return v(),p=null,void a("ondrop",n)}else a("onerror",new Error("close-is-not-clean"));if(3<=++_)return v(),p=null,a("ondrop",6e5+l(6e5)),void a("onfail","Network Unreachable");p=setTimeout(y,g+l(r)),i<(g<<=1)&&(g=i)}},f.onerror=function(e){},f.onmessage=function(e){if(_=0,clearTimeout(h),h=setTimeout(y,o),!(1>=e.data.length)){for(var t,n="",r={},i=e.data.split("\n"),l=0;lu.length)i[l]&&a("onerror","uncomplete-message: "+JSON.stringify(i[l]));else switch(u[3]){case"+":u[0]&&(r.from=u[0]),u[1]&&(r.room=u[1]),u[4]&&(r.ip=u[4]),u[5]&&(r.port=u[5]),r.geoip={},u[6]&&(r.geoip.region=u[6]),u[7]&&(r.geoip.city_country_code=u[7]),u[8]&&(r.geoip.city_country_name=u[8]),u[9]&&(r.geoip.region_name=u[9]),u[10]&&(r.geoip.city=u[10]),u[11]&&(r.geoip.latitude=u[11]),u[12]&&(r.geoip.longitude=u[12]),u[13]&&(r.geoip.org=u[13]),a("onadd",r);break;case"-":u[0]&&(r.from=u[0]),u[1]&&(r.room=u[1]),u[4]&&(r.code=u[4]),a("ondel",r);break;default:if(4=n))throw new RangeError("message-too-big");clearTimeout(h),h=setTimeout(y,o),clearTimeout(p),p=setTimeout(m,t),f.send(e)}},E=function(e,t){var n="";if(e.to){if(!u.test(e.to))throw new Error("invalid-TO");if(!e.room||!d.test(e.room))throw new Error("invalid-ROOM");n+="\t"+e.room+"\t"+e.to}else{if("get"===t)throw new Error("get-require-TO-and-ROOM");n+="\t\t"}if("*"===e.key)e.key="";else if(!c.test(e.key))throw new Error("invalid-KEY");return n+="\t"+e.key};this.get=function(e){if(e)try{b(E(e,"get")+"\n")}catch(e){return e}},this.set=function(e){if(e)try{var t=E(e,"set");if(e.value instanceof Array){if(0===e.value.length)return;for(var n=0;n{l=!!e},lastLog:u,name:(e,t)=>new s(e,t)};t.default=c},53139:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.updateAgent=t.setAllAgentsLeft=t.initAgentStore=t.dispatchers=t.addAgent=void 0;var i=n(2036),o=n(62096),a=n(14890),s=r(n(14762));const l=r(n(4855)).default.name("AgentsActions"),u=e=>({type:i.ActionType.INIT_AGENTS_STORE,payload:e});t.initAgentStore=u;const c=e=>({type:i.ActionType.ADD_AGENT,payload:e});t.addAgent=c;const d=e=>{const t=s.default.getAgentById(e.id);return l.log("redux_try_to_update_agent",e,t),t&&(t.set("display_name",e.name),t.set("title",e.title),t.set("avatar_url",e.avatarUrl),l.log("redux_update_agent",s.default)),{type:i.ActionType.UPDATE_AGENT,payload:e}};t.updateAgent=d;const f=()=>({type:i.ActionType.SET_ALL_AGENTS_LEFT});t.setAllAgentsLeft=f;const p=(0,a.bindActionCreators)({initAgentStore:u,addAgent:c,updateAgent:d,setAllAgentsLeft:f},o.reduxStore.dispatch);t.dispatchers=p},42932:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setVIReconnectTime=t.setShowEula=t.setQuoteMsgId=t.setMaintenance=t.setLastMsgTime=t.setLastMsgId=t.setLastChatStatus=t.setLastChatOpened=t.setIsInputDisabled=t.setIsInDrag=t.setIsContactFormFocused=t.setHiddenByRules=t.setDidFreezeData=t.setChatStarted=t.setChatOpenByClient=t.setChatAccepted=t.setAppStarted=t.setAppRoute=t.setAppIsOnline=t.setAppIsFocused=t.initAppStore=t.dispatchers=void 0;var i=n(2036),o=n(62096),a=n(14890),s=r(n(95003)),l=n(96394);const u=e=>{let t=e.isFocused,n=e.isOnline,r=e.route,o=e.tabRoute,a=e.lastChatOpened,s=e.isInputDisabled,l=e.maintenance,u=e.chatStarted,c=e.chatAccepted,d=e.lastMsgId,f=e.lastMsgTime,p=e.started,h=e.showEula,g=e.chatOpenByClient,_=e.viReconnectTime,m=e.didFreezeData,v=e.lastChatStatus,y=e.quoteMsgId,b=e.hiddenByRules;return{type:i.ActionType.INIT_APP_STORE,payload:{isFocused:t,isOnline:n,route:r,tabRoute:o,lastChatOpened:a,isInputDisabled:s,maintenance:l,chatOpenByClient:g,chatStarted:u,chatAccepted:c,lastMsgId:d,lastMsgTime:f,started:p,showEula:h,viReconnectTime:_,didFreezeData:m,lastChatStatus:v,quoteMsgId:y,hiddenByRules:b}}};t.initAppStore=u;const c=e=>(s.default.is_online=e?1:0,{type:i.ActionType.SET_APP_IS_ONLINE,payload:{isOnline:e}});t.setAppIsOnline=c;const d=e=>(s.default.is_focused=e,{type:i.ActionType.SET_APP_IS_FOCUSED,payload:{isFocused:e}});t.setAppIsFocused=d;const f=e=>({type:i.ActionType.SET_CHAT_OPEN_BY_CLIENT,payload:{chatOpenByClient:e}});t.setChatOpenByClient=f;const p=e=>(s.default.route=e,{type:i.ActionType.SET_APP_ROUTE,payload:{route:e}});t.setAppRoute=p;const h=e=>(s.default.lastChatOpened=e,{type:i.ActionType.SET_LAST_CHAT_OPENED,payload:{lastChatOpened:e}});t.setLastChatOpened=h;const g=e=>({type:i.ActionType.SET_IS_IN_DRAG,payload:{isInDrag:e}});t.setIsInDrag=g;const _=e=>({type:i.ActionType.SET_IS_CONTACT_FORM_FOCUSED,payload:{isContactFormFocused:e}});t.setIsContactFormFocused=_;const m=e=>({type:i.ActionType.SET_IS_INPUT_DISABLED,payload:{isInputDisabled:e}});t.setIsInputDisabled=m;const v=e=>(s.default.maintenance=e,(0,l.setConfigParam)("maintenance",e),{type:i.ActionType.SET_MAINTENANCE,payload:{maintenance:e}});t.setMaintenance=v;const y=e=>(s.default.chat_started=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{chatStarted:e}});t.setChatStarted=y;const b=e=>(s.default.chat_accepted=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{chatAccepted:e}});t.setChatAccepted=b;const E=e=>(s.default.lastMsgTime=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{lastMsgTime:e}});t.setLastMsgTime=E;const C=e=>(s.default.lastMsgId=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{lastMsgId:e}});t.setLastMsgId=C;const T=e=>(s.default.started=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{started:e}});t.setAppStarted=T;const D=e=>(s.default.show_eula=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{showEula:e}});t.setShowEula=D;const w=e=>(s.default.viReconnectTime=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{viReconnectTime:e}});t.setVIReconnectTime=w;const S=e=>(s.default.didFreezeData=e,{type:i.ActionType.UPDATE_APP_STORE,payload:{didFreezeData:e}});t.setDidFreezeData=S;const O=e=>(s.default.lastChatStatus=e,{type:i.ActionType.SET_LAST_CHAT_STATUS,payload:{lastChatStatus:e}});t.setLastChatStatus=O;const A=e=>(s.default.quoteMsgId=e,{type:i.ActionType.SET_QUOTE_MSG_ID,payload:{quoteMsgId:e}});t.setQuoteMsgId=A;const I=e=>(s.default.hiddenByRules=e,{type:i.ActionType.SET_HIDDEN_BY_RULES,payload:{hiddenByRules:e}});t.setHiddenByRules=I;const k=(0,a.bindActionCreators)({initAppStore:u,setAppIsOnline:c,setAppIsFocused:d,setAppRoute:p,setLastChatOpened:h,setIsInDrag:g,setIsContactFormFocused:_,setIsInputDisabled:m,setMaintenance:v,setChatOpenByClient:f,setChatAccepted:b,setChatStarted:y,setLastMsgTime:E,setAppStarted:T,setShowEula:D,setLastMsgId:C,setVIReconnectTime:w,setDidFreezeData:S,setLastChatStatus:O,setQuoteMsgId:A,setHiddenByRules:I},o.reduxStore.dispatch);t.dispatchers=k},13532:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initBotsStore=t.dispatchers=t.addBot=void 0;var r=n(2036),i=n(62096),o=n(14890);const a=e=>({type:r.ActionType.INIT_BOTS_STORE,payload:e});t.initBotsStore=a;const s=e=>({type:r.ActionType.ADD_BOT,payload:e});t.addBot=s;const l={initBotsStore:(0,o.bindActionCreators)(a,i.reduxStore.dispatch),addBot:(0,o.bindActionCreators)(s,i.reduxStore.dispatch)};t.dispatchers=l},45689:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setWebRTCCallStatus=t.setSeparateForm=t.setDelayedTimezone=t.setDelayedPeriods=t.setDelayedCallbackStatus=t.setCallbackStatus=t.setCallbackIsDelayed=t.setCallbackError=t.setCallbackAvailable=t.setActiveWebRTCCallMessageId=t.initializeCallbackStore=t.dispatchers=void 0;var r=n(2036),i=n(62096),o=n(14890);const a=e=>({type:r.ActionType.INIT_CALLBACK_STORE,payload:e});t.initializeCallbackStore=a;const s=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{available:e}});t.setCallbackAvailable=s;const l=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{delayedStatus:e}});t.setDelayedCallbackStatus=l;const u=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{isDelayed:e}});t.setCallbackIsDelayed=u;const c=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{status:e}});t.setCallbackStatus=c;const d=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{error:e}});t.setCallbackError=d;const f=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{delayedTimezone:e}});t.setDelayedTimezone=f;const p=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{delayedPeriods:e}});t.setDelayedPeriods=p;const h=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{activeWebRTCCallMessageId:e}});t.setActiveWebRTCCallMessageId=h;const g=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{webRTCCallStatus:e}});t.setWebRTCCallStatus=g;const _=e=>({type:r.ActionType.UPDATE_CALLBACK_STORE,payload:{separateForm:e}});t.setSeparateForm=_;const m={initializeCallbackStore:(0,o.bindActionCreators)(a,i.reduxStore.dispatch),setCallbackAvailable:(0,o.bindActionCreators)(s,i.reduxStore.dispatch),setDelayedCallbackStatus:(0,o.bindActionCreators)(l,i.reduxStore.dispatch),setCallbackIsDelayed:(0,o.bindActionCreators)(u,i.reduxStore.dispatch),setCallbackStatus:(0,o.bindActionCreators)(c,i.reduxStore.dispatch),setCallbackError:(0,o.bindActionCreators)(d,i.reduxStore.dispatch),setDelayedTimezone:(0,o.bindActionCreators)(f,i.reduxStore.dispatch),setDelayedPeriods:(0,o.bindActionCreators)(p,i.reduxStore.dispatch),setActiveWebRTCCallMessageId:(0,o.bindActionCreators)(h,i.reduxStore.dispatch),setWebRTCCallStatus:(0,o.bindActionCreators)(g,i.reduxStore.dispatch),setSeparateForm:(0,o.bindActionCreators)(_,i.reduxStore.dispatch)};t.dispatchers=m},93141:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setNoJoinedAgents=t.setJoinedBots=t.setJoinedAgents=t.setChatEvaluated=t.setAgentTyping=t.initChatsStore=t.dispatchers=t.createChats=t.addJoinedAgent=void 0;var i=r(n(61125)),o=n(36113),a=n(14890),s=n(2036),l=n(99131),u=n(62096),c=n(55623),d=n(45959),f=n(53139),p=r(n(26754)),h=r(n(14762)),g=n(92056),_=n(90189);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t{const t=(0,c.selectChatsIds)(e),n=(0,_.selectAgentJoinedIds)(e),r=(0,_.selectBotJoinedIds)(e),i=(0,d.selectClientEvaluate)(e),o=(0,d.selectDepartmentId)(e);return t.length?t.reduce(((e,t,a,s)=>(e.push(v(v(v({},l.chatTemplate),a===s.length-1&&{joinedAgents:n,joinedBots:r}),{},{departmentId:o,evaluated:i,id:t})),e)),[]):[v(v({},l.chatTemplate),{},{departmentId:o,evaluated:i,joinedAgents:n,joinedBots:r})]};t.createChats=y;const b=()=>(e,t)=>{const n=y(t());return e({type:s.ActionType.INIT_CHATS_STORE,payload:n})};t.initChatsStore=b;const E=e=>(p.default.typing=e,{type:s.ActionType.SET_AGENT_TYPING,payload:{agentTyping:!!e}});t.setAgentTyping=E;const C=e=>t=>(0,o.batch)((()=>{t({type:s.ActionType.SET_CURRENT_CHAT_EVALUATED,payload:{evaluated:e}}),t((0,g.setEvaluate)(e))}));t.setChatEvaluated=C;const T=e=>{h.default.updateAgentList(e);const t=h.default.getAgentIdsByStatus("join");return{type:s.ActionType.SET_JOINED_AGENTS_IN_CURRENT_CHAT,payload:{joinedAgents:t}}};t.setJoinedAgents=T;const D=()=>e=>{h.default.closeChat(),p.default.agent_id=0,p.default.state="left",(0,o.batch)((()=>{e({type:s.ActionType.CLOSE_CHAT,payload:{joinedAgents:[],joinedBots:[]}}),e((0,f.setAllAgentsLeft)())}))};t.setNoJoinedAgents=D;const w=e=>({type:s.ActionType.ADD_JOINED_AGENT_TO_CURRENT_CHAT,payload:{agentId:e}});t.addJoinedAgent=w;const S=e=>({type:s.ActionType.SET_JOINED_BOTS,payload:{joinedBots:null!=e?e:[]}});t.setJoinedBots=S;const O=(0,a.bindActionCreators)({initChatsStore:b,setAgentTyping:E,setChatEvaluated:C,setJoinedAgents:T,setNoJoinedAgents:D,addJoinedAgent:w,setJoinedBots:S},u.reduxStore.dispatch);t.dispatchers=O},92056:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateClient=t.setVisitorId=t.setUserToken=t.setUTM=t.setPaId=t.setMailing=t.setLastMessage=t.setIsIntroduced=t.setInputText=t.setHasIntegration=t.setExternalData=t.setEvaluate=t.setEulaAccepted=t.setDepartmentId=t.setCustomData=t.setClientTags=t.setClientSessionId=t.setClientPhone=t.setClientName=t.setClientId=t.setClientEmail=t.setClientDescription=t.setClientContacts=t.setClientAttributes=t.setCaptchaToken=t.setAssignedAgentId=t.resetClient=t.dispatchers=void 0;var r=n(14890),i=n(2036),o=n(62096);const a=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{hasIntegration:e}});t.setHasIntegration=a;const s=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{lastMessage:e}});t.setLastMessage=s;const l=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{isIntroduced:e}});t.setIsIntroduced=l;const u=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{inputText:e}});t.setInputText=u;const c=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{userToken:e}});t.setUserToken=c;const d=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{customData:e}});t.setCustomData=d;const f=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{captchaToken:e}});t.setCaptchaToken=f;const p=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{priorityAgentId:e}});t.setPaId=p;const h=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{email:e}});t.setClientEmail=h;const g=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{eulaAccepted:e}});t.setEulaAccepted=g;const _=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{mailing:e}});t.setMailing=_;const m=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{phone:e}});t.setClientPhone=m;const v=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{name:e}});t.setClientName=v;const y=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{description:e}});t.setClientDescription=y;const b=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{clientId:e}});t.setClientId=b;const E=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{sessionId:e}});t.setClientSessionId=E;const C=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{assignedAgentId:e}});t.setAssignedAgentId=C;const T=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{departmentId:e}});t.setDepartmentId=T;t.setEvaluate=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{evaluate:e}});const D=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{utm:e}});t.setUTM=D;const w=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:e});t.setClientContacts=w;const S=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{visitorId:e}});t.setVisitorId=S;const O=e=>({type:i.ActionType.UPDATE_CLIENT_STORE_MANUALLY,payload:e});t.updateClient=O;const A=()=>({type:i.ActionType.RESET_CLIENT_STORE});t.resetClient=A;const I=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{tags:e}});t.setClientTags=I;const k=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{attributes:e}});t.setClientAttributes=k;const M=e=>({type:i.ActionType.UPDATE_CLIENT_STORE,payload:{externalData:e}});t.setExternalData=M;const x=(0,r.bindActionCreators)({setHasIntegration:a,setLastMessage:s,setIsIntroduced:l,setInputText:u,setUserToken:c,setCustomData:d,setCaptchaToken:f,setPaId:p,setEulaAccepted:g,setMailing:_,setClientEmail:h,setClientPhone:m,setClientName:v,setClientDescription:y,setClientId:b,setClientSessionId:E,setClientContacts:w,setAssignedAgentId:C,setDepartmentId:T,setVisitorId:S,setUTM:D,updateClient:O,resetClient:A,setClientTags:I,setClientAttributes:k,setExternalData:M},o.reduxStore.dispatch);t.dispatchers=x},84219:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateDesignerSettings=t.dispatchers=void 0;var r=n(14890),i=n(2036),o=n(62096);const a=e=>({type:i.ActionType.UPDATE_DESIGNER_SETTINGS,payload:e});t.updateDesignerSettings=a;const s=(0,r.bindActionCreators)({updateDesignerSettings:a},o.reduxStore.dispatch);t.dispatchers=s},66031:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setJoint=t.enablePrechat=t.dispatchers=t.disableFiletransfer=void 0;var i=n(14890),o=n(2036),a=n(62096),s=r(n(96394));const l=e=>(s.default.disable_filetranser=e,{type:o.ActionType.SET_DISABLE_FILETRANSFER,payload:{disableFiletransfer:e?1:0}});t.disableFiletransfer=l;const u=e=>(s.default.enable_prechat=e?1:0,{type:o.ActionType.SET_ENABLE_PRECHAT,payload:{prechat:e?1:0}});t.enablePrechat=u;const c=e=>(s.default.joint=e,{type:o.ActionType.SET_JOINT,payload:{joint:e}});t.setJoint=c;const d=(0,i.bindActionCreators)({disableFiletransfer:l,enablePrechat:u,setJoint:c},a.reduxStore.dispatch);t.dispatchers=d},26932:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userDispatchers=t.user=t.transitionDispatchers=t.transition=t.socialDispatchers=t.social=t.proactiveDispatchers=t.proactive=t.permissionsDispatchers=t.permissions=t.messagesDispatchers=t.messages=t.featuresDispatchers=t.features=t.designerDispatchers=t.designer=t.clientDispatchers=t.client=t.chatsDispatchers=t.chats=t.callbackDispatchers=t.callback=t.botsDispatchers=t.bots=t.appDispatchers=t.app=t.agentsDispatchers=t.agents=void 0;var r=v(n(42932));t.app=r;var i=v(n(45689));t.callback=i;var o=v(n(27591));t.social=o;var a=v(n(50307));t.user=a;var s=v(n(53139));t.agents=s;var l=v(n(93141));t.chats=l;var u=v(n(5452));t.transition=u;var c=v(n(40099));t.messages=c;var d=v(n(92056));t.client=d;var f=v(n(66031));t.features=f;var p=v(n(13532));t.bots=p;var h=v(n(25925));t.proactive=h;var g=v(n(94539));t.permissions=g;var _=v(n(84219));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}t.designer=_;const y=r.dispatchers;t.appDispatchers=y;const b=i.dispatchers;t.callbackDispatchers=b;const E=o.dispatchers;t.socialDispatchers=E;const C=a.dispatchers;t.userDispatchers=C;const T=s.dispatchers;t.agentsDispatchers=T;const D=l.dispatchers;t.chatsDispatchers=D;const w=u.dispatchers;t.transitionDispatchers=w;const S=c.dispatchers;t.messagesDispatchers=S;const O=d.dispatchers;t.clientDispatchers=O;const A=f.dispatchers;t.featuresDispatchers=A;const I=p.dispatchers;t.botsDispatchers=I;const k=h.dispatchers;t.proactiveDispatchers=k;const M=g.dispatchers;t.permissionsDispatchers=M;const x=_.dispatchers;t.designerDispatchers=x},40099:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.updateWebRTCCallStatus=t.updateMessages=t.updateMessageBody=t.updateMessage=t.initMessagesStore=t.editMessage=t.dispatchers=t.destroyByType=t.deleteMessageByPrivateId=t.addMessages=t.addMessage=void 0;var i=n(2036),o=n(62096),a=n(14890),s=r(n(14264));const l=()=>{const e=s.default.getAll().map((e=>e.store));return s.default.trigger("update"),{type:i.ActionType.INIT_MESSAGES_STORE,payload:{messages:e}}};t.initMessagesStore=l;const u=(e,t)=>{let n=e;return t||(n=s.default.push(n).store),{type:i.ActionType.ADD_MESSAGE,payload:{message:n}}};t.addMessage=u;const c=e=>(s.default.pushAll(e),{type:i.ActionType.ADD_MESSAGES,payload:{messages:e}});t.addMessages=c;const d=e=>({type:i.ActionType.EDIT_MESSAGE,payload:e});t.editMessage=d;const f=(e,t)=>{const n=s.default.getMessageByPrivateId(e);return n&&n.set("body",t),{type:i.ActionType.UPDATE_MESSAGE_BODY,payload:{privateId:e,body:t}}};t.updateMessageBody=f;const p=(e,t)=>{let n=e.privateId,r=e.messageId;const o=n?s.default.getMessageByPrivateId(n):s.default.getMessageById(r);return o&&o.set(t),{type:i.ActionType.UPDATE_MESSAGE,payload:{privateId:n,messageId:r,newMessage:t}}};t.updateMessage=p;const h=(e,t)=>{let n=e.privateIds,r=e.messageIds;return s.default.getAll().forEach((e=>{const i=e.toJSON(),o=i.msg_id,a=i.private_id;n&&n.includes(a)&&e.set(t),r&&r.includes(o)&&e.set(t)})),{type:i.ActionType.UPDATE_MESSAGES,payload:{privateIds:n,messageIds:r,update:t}}};t.updateMessages=h;const g=e=>{const t=s.default.getMessageByPrivateId(e);return t&&t.destroy(),{type:i.ActionType.DELETE_MESSAGE,payload:{privateId:e}}};t.deleteMessageByPrivateId=g;const _=e=>{const t=s.default.getMessagesByType(e);return t.length&&t.forEach((e=>{e&&e.destroy()})),{type:i.ActionType.DELETE_MESSAGE,payload:{type:e}}};t.destroyByType=_;const m=(e,t)=>{const n=s.default.getMessageByPrivateId(e);return n&&n.set("body",{webRTCCallStatus:t}),{type:i.ActionType.UPDATE_WEBRTCCALL_STATUS,payload:{privateId:e||null,webRTCCallStatus:t}}};t.updateWebRTCCallStatus=m;const v={initMessagesStore:(0,a.bindActionCreators)(l,o.reduxStore.dispatch),addMessage:(0,a.bindActionCreators)(u,o.reduxStore.dispatch),addMessages:(0,a.bindActionCreators)(c,o.reduxStore.dispatch),editMessage:(0,a.bindActionCreators)(d,o.reduxStore.dispatch),updateMessageBody:(0,a.bindActionCreators)(f,o.reduxStore.dispatch),deleteMessageByPrivateId:(0,a.bindActionCreators)(g,o.reduxStore.dispatch),destroyByType:(0,a.bindActionCreators)(_,o.reduxStore.dispatch),updateWebRTCCallStatus:(0,a.bindActionCreators)(m,o.reduxStore.dispatch),updateMessage:(0,a.bindActionCreators)(p,o.reduxStore.dispatch),updateMessages:(0,a.bindActionCreators)(h,o.reduxStore.dispatch)};t.dispatchers=v},94539:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updatePermission=t.dispatchers=void 0;var r=n(2036),i=n(62096),o=n(14890);const a=(e,t)=>({type:r.ActionType.UPDATE_PERMISSION,payload:{permission:e,value:t}});t.updatePermission=a;const s={updatePermission:(0,o.bindActionCreators)(a,i.reduxStore.dispatch)};t.dispatchers=s},25925:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setStatus=t.setPrechats=t.setName=t.resetProactive=t.dispatchers=t.addProactive=void 0;var r=n(2036),i=n(62096),o=n(14890);const a=e=>{let t=e.createdTs,n=e.name,i=e.privateId,o=e.status,a=e.text,s=e.agentId,l=e.botId,u=e.isMarkdown,c=e.prechats,d=e.campaignId;return{type:r.ActionType.ADD_PROACTIVE,payload:{createdTs:t,name:n,privateId:i,status:o,text:a,agentId:s,botId:l,isMarkdown:u,prechats:c,campaignId:d}}};t.addProactive=a;const s=e=>({type:r.ActionType.SET_PROACTIVE_STATUS,payload:{status:e}});t.setStatus=s;const l=e=>({type:r.ActionType.SET_PROACTIVE_NAME,payload:{name:e}});t.setName=l;const u=e=>({type:r.ActionType.SET_PROACTIVE_PRECHATS,payload:{prechats:e}});t.setPrechats=u;const c=()=>({type:r.ActionType.RESET_PROACTIVE});t.resetProactive=c;const d={addProactive:(0,o.bindActionCreators)(a,i.reduxStore.dispatch),setStatus:(0,o.bindActionCreators)(s,i.reduxStore.dispatch),setName:(0,o.bindActionCreators)(l,i.reduxStore.dispatch),setPrechats:(0,o.bindActionCreators)(u,i.reduxStore.dispatch),resetProactive:(0,o.bindActionCreators)(c,i.reduxStore.dispatch)};t.dispatchers=d},27591:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeSocialStore=t.dispatchers=void 0;var r=n(2036),i=n(62096),o=n(14890);const a=e=>{let t=e.vk,n=e.fb,i=e.mode;return{type:r.ActionType.INIT_SOCIAL_STORE,payload:{vk:t,fb:n,mode:i}}};t.initializeSocialStore=a;const s={initializeSocialStore:(0,o.bindActionCreators)(a,i.reduxStore.dispatch)};t.dispatchers=s},5452:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startTransition=t.initTransitionStore=t.dispatchers=void 0;var r=n(2036),i=n(62096),o=n(14890);const a=e=>({type:r.ActionType.INIT_TRANSITION_STORE,payload:e});t.initTransitionStore=a;const s=e=>({type:r.ActionType.START_TRANSITION_SCRIPT,payload:{script:e}});t.startTransition=s;const l={initTransitionStore:(0,o.bindActionCreators)(a,i.reduxStore.dispatch),startTransition:(0,o.bindActionCreators)(s,i.reduxStore.dispatch)};t.dispatchers=l},50307:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setWidgetPadding=t.setWidgetOrientation=t.setWidgetMobileOrientation=t.setWidgetLabelBubble=t.setWidgetFontType=t.setWidgetFontSize=t.setWidgetFontFamily=t.setWidgetFontColor=t.setWidgetColor2=t.setWidgetColor=t.setPrechat=t.setPowerGradient=t.setPowerButtonColor=t.setPattern=t.setOnlineLabel=t.setOfflineLabel=t.setOfflineFormTitle=t.setOfflineFormText=t.setMobileOffsetBottom=t.setCallbackButtonColor=t.setCallHeaderText=t.setBubbleColor=t.dispatchers=void 0;var i=n(2036),o=n(62096),a=n(14890),s=r(n(95003)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(96394));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const c=e=>(l.default.widget_color=e,s.default.widget_color=e,{type:i.ActionType.SET_WIDGET_COLOR,payload:{widgetColor:e}});t.setWidgetColor=c;const d=e=>(l.default.widget_color2=e,s.default.widget_color2=e,{type:i.ActionType.SET_WIDGET_COLOR2,payload:{widgetColor2:e}});t.setWidgetColor2=d;const f=e=>(l.default.widget_font_color=e,s.default.widget_font_color=e,{type:i.ActionType.SET_WIDGET_FONT_COLOR,payload:{widgetFontColor:e}});t.setWidgetFontColor=f;const p=e=>(l.default.widget_orientation=e,{type:i.ActionType.SET_WIDGET_ORIENTATION,payload:{widgetOrientation:e}});t.setWidgetOrientation=p;const h=e=>((0,l.setConfigParam)("widget_mobile_orientation",e),{type:i.ActionType.SET_MOBILE_WIDGET_ORIENTATION,payload:{widgetMobileOrientation:e}});t.setWidgetMobileOrientation=h;const g=e=>((0,l.setConfigParam)("mobile_offset_bottom",e),{type:i.ActionType.SET_MOBILE_OFFSET_BOTTOM,payload:{mobileOffsetBottom:e}});t.setMobileOffsetBottom=g;const _=e=>((0,l.setConfigParam)("power_gradient",e?1:0),{type:i.ActionType.SET_POWER_GRADIENT,payload:{powerGradient:!!e||null}});t.setPowerGradient=_;const m=e=>((0,l.setConfigParam)("power_button_color",e),{type:i.ActionType.SET_MOBILE_WIDGET_COLOR,payload:{powerButtonColor:e}});t.setPowerButtonColor=m;const v=e=>{const t=+e;return l.default.widget_padding=t,{type:i.ActionType.SET_WIDGET_PADDING,payload:{widgetPadding:t}}};t.setWidgetPadding=v;const y=e=>(l.default.online_widget_label=e,{type:i.ActionType.SET_ONLINE_WIDGET_LABEL,payload:{onlineWidgetLabel:e}});t.setOnlineLabel=y;const b=e=>(l.default.offline_widget_label=e,{type:i.ActionType.SET_OFFLINE_WIDGET_LABEL,payload:{offlineWidgetLabel:e}});t.setOfflineLabel=b;const E=e=>(l.default.font_size=e,{type:i.ActionType.SET_WIDGET_FONT_SIZE,payload:{fontSize:e}});t.setWidgetFontSize=E;const C=e=>(l.default.font_family=e,{type:i.ActionType.SET_WIDGET_FONT_FAMILY,payload:{fontFamily:e}});t.setWidgetFontFamily=C;const T=e=>(l.default.font_type=e,{type:i.ActionType.SET_WIDGET_FONT_TYPE,payload:{fontType:e}});t.setWidgetFontType=T;const D=e=>({type:i.ActionType.SET_WIDGET_LABEL_BUBBLE,payload:{labelBubble:e}});t.setWidgetLabelBubble=D;const w=e=>(s.default.callText=e,{type:i.ActionType.SET_CALL_HEADER_TEXT,payload:{callHeaderText:e}});t.setCallHeaderText=w;const S=e=>(l.default.pattern=e,{type:i.ActionType.SET_PATTERN,payload:{pattern:e}});t.setPattern=S;const O=e=>(l.default.callback_btn_color=e,{type:i.ActionType.SET_CALLBACK_BUTTON_COLOR,payload:{callbackButtonColor:e}});t.setCallbackButtonColor=O;const A=e=>(l.default.bubble_color=e,{type:i.ActionType.SET_BUBBLE_COLOR,payload:{bubbleColor:e}});t.setBubbleColor=A;const I=e=>(l.default.offline_form_title=e,{type:i.ActionType.SET_OFFLINE_FORM_TITLE,payload:{offlineFormTitle:e}});t.setOfflineFormTitle=I;const k=e=>(l.default.offline_form_text=e,{type:i.ActionType.SET_OFFLINE_FORM_TEXT,payload:{offlineFormText:e}});t.setOfflineFormText=k;const M=e=>(l.default.prechat=e,{type:i.ActionType.SET_PRECHAT,payload:{prechat:e}});t.setPrechat=M;const x={setWidgetColor:(0,a.bindActionCreators)(c,o.reduxStore.dispatch),setWidgetColor2:(0,a.bindActionCreators)(d,o.reduxStore.dispatch),setWidgetFontColor:(0,a.bindActionCreators)(f,o.reduxStore.dispatch),setWidgetOrientation:(0,a.bindActionCreators)(p,o.reduxStore.dispatch),setWidgetMobileOrientation:(0,a.bindActionCreators)(h,o.reduxStore.dispatch),setMobileOffsetBottom:(0,a.bindActionCreators)(g,o.reduxStore.dispatch),setPowerGradient:(0,a.bindActionCreators)(_,o.reduxStore.dispatch),setPowerButtonColor:(0,a.bindActionCreators)(m,o.reduxStore.dispatch),setWidgetPadding:(0,a.bindActionCreators)(v,o.reduxStore.dispatch),setOnlineLabel:(0,a.bindActionCreators)(y,o.reduxStore.dispatch),setOfflineLabel:(0,a.bindActionCreators)(b,o.reduxStore.dispatch),setWidgetFontSize:(0,a.bindActionCreators)(E,o.reduxStore.dispatch),setWidgetFontFamily:(0,a.bindActionCreators)(C,o.reduxStore.dispatch),setWidgetFontType:(0,a.bindActionCreators)(T,o.reduxStore.dispatch),setWidgetLabelBubble:(0,a.bindActionCreators)(D,o.reduxStore.dispatch),setCallHeaderText:(0,a.bindActionCreators)(w,o.reduxStore.dispatch),setPattern:(0,a.bindActionCreators)(S,o.reduxStore.dispatch),setCallbackButtonColor:(0,a.bindActionCreators)(O,o.reduxStore.dispatch),setBubbleColor:(0,a.bindActionCreators)(A,o.reduxStore.dispatch),setOfflineFormTitle:(0,a.bindActionCreators)(I,o.reduxStore.dispatch),setOfflineFormText:(0,a.bindActionCreators)(k,o.reduxStore.dispatch),setPrechat:(0,a.bindActionCreators)(M,o.reduxStore.dispatch)};t.dispatchers=x},2036:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionType=void 0;t.ActionType={DO_NOTHING:"DO_NOTHING",INIT_CALLBACK_STORE:"INIT_CALLBACK_STORE",SET_CALL_AVAILABLE:"SET_CALL_AVAILABLE",SET_DELAYED_CALL_STATUS:"SET_DELAYED_CALL_STATUS",SET_CALL_IS_DELAYED:"SET_CALL_IS_DELAYED",SET_CALL_STATUS:"SET_CALL_STATUS",SET_CALL_ERROR:"SET_CALL_ERROR",SET_DELAYED_TIMEZONE:"SET_DELAYED_TIMEZONE",SET_DELAYED_PERIODS:"SET_DELAYED_PERIODS",SET_ACTIVE_WEBRTC_MESSAGE_ID:"SET_ACTIVE_WEBRTC_MESSAGE_ID",SET_WEBRTC_CALL_STATUS:"SET_WEBRTC_CALL_STATUS",UPDATE_CALLBACK_STORE:"UPDATE_CALLBACK_STORE",INIT_SOCIAL_STORE:"INIT_SOCIAL_STORE",INIT_APP_STORE:"INIT_APP_STORE",SET_APP_IS_ONLINE:"SET_APP_IS_ONLINE",SET_APP_IS_FOCUSED:"SET_APP_IS_FOCUSED",SET_APP_ROUTE:"SET_APP_ROUTE",SET_LAST_CHAT_OPENED:"SET_LAST_CHAT_OPENED",SET_IS_IN_DRAG:"SET_IS_IN_DRAG",SET_IS_CONTACT_FORM_FOCUSED:"SET_IS_CONTACT_FORM_FOCUSED",SET_IS_INPUT_DISABLED:"SET_IS_INPUT_DISABLED",SET_MAINTENANCE:"SET_MAINTENANCE",SET_CHAT_OPEN_BY_CLIENT:"SET_CHAT_OPEN_BY_CLIENT",UPDATE_APP_STORE:"UPDATE_APP_STORE",SET_LAST_CHAT_STATUS:"SET_LAST_CHAT_STATUS",SET_QUOTE_MSG_ID:"SET_QUOTE_MSG_ID",SET_HIDDEN_BY_RULES:"SET_HIDDEN_BY_RULES",SET_WIDGET_COLOR:"SET_WIDGET_COLOR",SET_WIDGET_COLOR2:"SET_WIDGET_COLOR2",SET_WIDGET_FONT_COLOR:"SET_WIDGET_FONT_COLOR",SET_WIDGET_ORIENTATION:"SET_WIDGET_ORIENTATION",SET_WIDGET_PADDING:"SET_WIDGET_PADDING",SET_ONLINE_WIDGET_LABEL:"SET_ONLINE_WIDGET_LABEL",SET_OFFLINE_WIDGET_LABEL:"SET_OFFLINE_WIDGET_LABEL",SET_WIDGET_FONT_SIZE:"SET_WIDGET_FONT_SIZE",SET_WIDGET_FONT_FAMILY:"SET_WIDGET_FONT_FAMILY",SET_WIDGET_FONT_TYPE:"SET_WIDGET_FONT_TYPE",SET_CALL_HEADER_TEXT:"SET_CALL_HEADER_TEXT",SET_PATTERN:"SET_PATTERN",SET_CALLBACK_BUTTON_COLOR:"SET_CALLBACK_BUTTON_COLOR",SET_BUBBLE_COLOR:"SET_BUBBLE_COLOR",SET_WIDGET_LABEL_BUBBLE:"SET_WIDGET_LABEL_BUBBLE",SET_PRECHAT:"SET_PRECHAT",SET_POWER_GRADIENT:"SET_POWER_GRADIENT",SET_MOBILE_OFFSET_BOTTOM:"SET_MOBILE_OFFSET_BOTTOM",SET_MOBILE_WIDGET_ORIENTATION:"SET_MOBILE_WIDGET_ORIENTATION",SET_MOBILE_WIDGET_COLOR:"SET_MOBILE_WIDGET_COLOR",INIT_AGENTS_STORE:"INIT_AGENTS_STORE",ADD_AGENT:"ADD_AGENT",UPDATE_AGENT:"UPDATE_AGENT",SET_ALL_AGENTS_LEFT:"SET_ALL_AGENTS_LEFT",INIT_BOTS_STORE:"INIT_BOTS_STORE",ADD_BOT:"ADD_BOT",INIT_CHATS_STORE:"INIT_CHATS_STORE",START_CHAT:"START_CHAT",CLOSE_CHAT:"CLOSE_CHAT",SET_JOINED_AGENTS_IN_CURRENT_CHAT:"SET_JOINED_AGENTS_IN_CURRENT_CHAT",ADD_JOINED_AGENT_TO_CURRENT_CHAT:"ADD_JOINED_AGENT_TO_CURRENT_CHAT",REMOVE_AGENT_FROM_CURRENT_CHAT:"REMOVE_AGENT_FROM_CHAT",SET_CURRENT_CHAT_EVALUATED:"SET_CHAT_EVALUATED",SET_AGENT_TYPING:"SET_AGENT_TYPING",SET_CURRENT_CHAT_DEPARTMENT_ID:"SET_CHAT_DEPARTMENT_ID",SET_JOINED_BOTS:"SET_JOINED_BOTS",UPDATE_CHATS_STORE:"UPDATE_CHATS_STORE",INIT_TRANSITION_STORE:"INIT_TRANSITION_STORE",START_TRANSITION_SCRIPT:"START_TRANSITION_SCRIPT",CONTINUE_TRANSITION_SCRIPT:"CONTINUE_TRANSITION_SCRIPT",STOP_TRANSITION_SCRIPT:"STOP_TRANSITION_SCRIPT",RESET_TRANSITON_SCRIPT:"RESET_TRANSITON_SCRIPT",INIT_MESSAGES_STORE:"INIT_MESSAGES_STORE",ADD_MESSAGE:"ADD_MESSAGE",ADD_MESSAGES:"ADD_MESSAGES",EDIT_MESSAGE:"EDIT_MESSAGE",DELETE_MESSAGE:"DELETE_MESSAGE",UPDATE_MESSAGE_BODY:"UPDATE_MESSAGE_BODY",UPDATE_MESSAGE_STATUS:"UPDATE_MESSAGE_STATUS",UPDATE_MESSAGE:"UPDATE_MESSAGE",UPDATE_MESSAGES:"UPDATE_MESSAGES",SET_OFFLINE_FORM_TITLE:"SET_OFFLINE_FORM_TITLE",SET_OFFLINE_FORM_TEXT:"SET_OFFLINE_FORM_TEXT",UPDATE_CLIENT_STORE:"UPDATE_CLIENT_STORE",UPDATE_CLIENT_STORE_MANUALLY:"UPDATE_CLIENT_STORE_MANUALLY",RESET_CLIENT_STORE:"RESET_CLIENT_STORE",SET_DISABLE_FILETRANSFER:"SET_DISABLE_FILETRANSFER",SET_ENABLE_PRECHAT:"SET_ENABLE_PRECHAT",ADD_PROACTIVE:"ADD_PROACTIVE",RESET_PROACTIVE:"RESET_PROACTIVE",SET_PROACTIVE_STATUS:"SET_PROACTIVE_STATUS",SET_PROACTIVE_NAME:"SET_PROACTIVE_NAME",SET_PROACTIVE_PRECHATS:"SET_PROACTIVE_PRECHATS",UPDATE_WEBRTCCALL_STATUS:"UPDATE_WEBRTCCALL_STATUS",UPDATE_PERMISSION:"UPDATE_PERMISSION",UPDATE_DESIGNER_SETTINGS:"UPDATE_DESIGNER_SETTINGS",SET_JOINT:"SET_JOINT"}},79156:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.storesMap=t.readoptReduxToClientStorage=t.adoptClientStorageToRedux=void 0;var i=r(n(61125)),o=r(n(4855)),a=n(28650),s=n(71047),l=n(42344),u=n(34014),c=n(73422);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t{p.warn("ADOPT_CLIENT_STORAGE_TO_REDUX",{data:e,keysSet:t});const n=g[t],r=n.keys,i=n.initialState;if(!e)return i;const o={};for(const t in r){const n=r[t];var s;if((0,c.isObject)(n))for(const r in n)e[t]&&(0,a.hasOwn)(e[t],r)?o[n[r]]=e[t][r]:o[n[r]]=null;else o[n]=null!==(s=e[t])&&void 0!==s?s:i[n]}return o};t.readoptReduxToClientStorage=(e,t)=>{p.warn("READOPT_CLIENT_STORAGE_TO_REDUX",{data:e,keysSet:t});const n=f({},e),r=g[t].keys;for(const t in r){const i=r[t];if((0,c.isObject)(i))for(const r in i)n[t]=f(f({},n[t]),{},{[r]:e[i[r]]}),delete n[i[r]];else n[t]=e[i],t!==i&&delete n[i]}return n}},91133:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.mergeSafety=void 0;var i=r(n(61125)),o=n(98986);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.mergeSafety=(e,t)=>Object.keys(t).reduce(((e,n)=>{const r=t[n];return(0,o.isNull)(r)||(e[n]=r),e}),function(e){for(var t=1;tt=>n=>{u.warn("DISPATCHING",n);const r=t(n);return a.default.getInstance()&&a.default.getInstance().saveReduxAction(l(l({},n),{},{ts:(new Date).getTime()})),u.warn("NEXT_STATE",e.getState()),r}},68031:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOnStorage=t.statesToPersist=t.persistMiddleware=void 0;var i=r(n(96394)),o=n(16016),a=n(2036),s=n(79156),l=n(39715),u=n(71047),c=n(44733),d=n(73422);const f=c.StorageProvider.createKeyForStore(u.STORAGED_ID.POSITION),p=c.StorageProvider.createKeyForStore(u.STORAGED_ID.CLIENT),h={[u.STORAGED_ID.POSITION]:{storageKey:f,path:"position",onAdapter:null,onReadapter:null,onUpdate:null},[u.STORAGED_ID.CLIENT]:{storageKey:p,path:"client",onAdapter:e=>(0,s.adoptClientStorageToRedux)(e,u.STORAGED_ID.CLIENT),onReadapter:e=>(0,s.readoptReduxToClientStorage)(e,u.STORAGED_ID.CLIENT),onUpdate:e=>{i.default.cookie_domain&&c.StorageProvider.duplicateClientStateInCookie(e)}},[u.STORAGED_ID.CALLBACK]:{storageKey:p,path:"callback",onAdapter:e=>(0,s.adoptClientStorageToRedux)(e,u.STORAGED_ID.CALLBACK),onReadapter:e=>(0,s.readoptReduxToClientStorage)(e,u.STORAGED_ID.CALLBACK),onUpdate:null}};t.statesToPersist=h;const g={"position/initPositionStore":h[u.STORAGED_ID.POSITION],[a.ActionType.UPDATE_CLIENT_STORE]:h[u.STORAGED_ID.CLIENT],[a.ActionType.RESET_CLIENT_STORE]:h[u.STORAGED_ID.CLIENT],[a.ActionType.UPDATE_CALLBACK_STORE]:h[u.STORAGED_ID.CALLBACK]};t.persistMiddleware=e=>t=>n=>{if(t(n),n.type===a.ActionType.SET_DID_FREEZE_DATA&&!0===n.payload.didFreezeData)return Object.values(h).forEach((e=>{let t=e.storageKey;return c.StorageProvider.remove(t)}));n.type===a.ActionType.RESET_CLIENT_STORE&&c.StorageProvider.remove(h[u.STORAGED_ID.CLIENT].storageKey);const r=e.getState();if(n.type in g&&!r.app.didFreezeData){const e=g[n.type],t=e.storageKey,i=e.path,o=e.onReadapter,a=e.onUpdate,s=(0,l.get)(r,i),u=c.StorageProvider.get(t),d=Object.assign({},u,o?o(s):s);c.StorageProvider.set(t,d),null==a||a(d);const f=v(n.type);c.StorageProvider.set(_,f)}};const _="sync",m=(0,o.generateGUID)(),v=e=>({actionType:e,sourceId:m,time:Date.now()});t.subscribeOnStorage=e=>{window.addEventListener("storage",(e=>t=>{let n=t.key;if((0,c.isJvKeyForStoreToGet)(n)){const t=c.StorageProvider.get(_);if(t&&t.sourceId!==m){const n=g[t.actionType],r=n.storageKey,i=n.onAdapter,o=c.StorageProvider.get(r);e.dispatch({type:t.actionType,payload:(0,d.isFunction)(i)?i(o):o})}}})(e))}},57157:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case a.ActionType.INIT_AGENTS_STORE:if(r&&r.length){const e=r.filter((e=>!e.isBot));return(0,o.default)(e)}return(0,o.default)(e);case a.ActionType.ADD_AGENT:if(r){return e.find((e=>e.id===r.id))?e.map((e=>e.id===r.id?l(l({},e),r):e)):[].concat((0,o.default)(e),[l({},r)])}return(0,o.default)(e);case a.ActionType.UPDATE_AGENT:return r?e.map((e=>e.id===r.id?l(l({},e),r):e)):(0,o.default)(e);case a.ActionType.SET_ALL_AGENTS_LEFT:return e.map((e=>l(l({},e),{},{state:"left"})));default:return e}};var i=r(n(61125)),o=r(n(15687)),a=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case o.ActionType.INIT_APP_STORE:return{isFocused:r.isFocused,isOnline:!!r.isOnline,route:r.route,tabRoute:r.tabRoute,lastChatOpened:r.lastChatOpened,isInDrag:r.isInDrag,isContactFormFocused:r.isContactFormFocused,isInputDisabled:r.isInputDisabled,maintenance:r.maintenance,chatOpenByClient:r.chatOpenByClient,chatStarted:r.chatStarted,chatAccepted:r.chatAccepted,lastMsgId:r.lastMsgId,lastMsgTime:r.lastMsgTime,started:r.started,showEula:r.showEula,viReconnectTime:r.viReconnectTime,didFreezeData:r.didFreezeData,lastChatStatus:r.lastChatStatus,quoteMsgId:r.quoteMsgId,hiddenByRules:r.hiddenByRules};case o.ActionType.SET_APP_IS_ONLINE:return s(s({},e),{},{isOnline:r.isOnline});case o.ActionType.SET_APP_IS_FOCUSED:return s(s({},e),{},{isFocused:r.isFocused});case o.ActionType.SET_CHAT_OPEN_BY_CLIENT:return s(s({},e),{},{chatOpenByClient:r.chatOpenByClient});case o.ActionType.SET_APP_ROUTE:return s(s({},e),{},{route:r.route});case o.ActionType.SET_LAST_CHAT_OPENED:return s(s({},e),{},{lastChatOpened:r.lastChatOpened});case o.ActionType.SET_IS_IN_DRAG:return s(s({},e),{},{isInDrag:r.isInDrag});case o.ActionType.SET_IS_CONTACT_FORM_FOCUSED:return s(s({},e),{},{isContactFormFocused:r.isContactFormFocused});case o.ActionType.SET_IS_INPUT_DISABLED:return s(s({},e),{},{isInputDisabled:r.isInputDisabled});case o.ActionType.SET_MAINTENANCE:return s(s({},e),{},{maintenance:r.maintenance});case o.ActionType.SET_LAST_CHAT_STATUS:return s(s({},e),{},{lastChatStatus:r.lastChatStatus});case o.ActionType.SET_QUOTE_MSG_ID:return s(s({},e),{},{quoteMsgId:r.quoteMsgId});case o.ActionType.SET_HIDDEN_BY_RULES:return s(s({},e),{},{hiddenByRules:r.hiddenByRules});case o.ActionType.UPDATE_APP_STORE:return s(s({},e),r);default:return e}};var i=r(n(61125)),o=n(2036);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case a.ActionType.INIT_BOTS_STORE:if(r&&r.length){const e=r.filter((e=>e.isBot));return(0,o.default)(e)}return(0,o.default)(e);case a.ActionType.ADD_BOT:if(r){return e.find((e=>e.id===r.id))?e.map((e=>e.id===r.id?l(l({},e),r):e)):[].concat((0,o.default)(e),[l({},r)])}return(0,o.default)(e);default:return e}};var i=r(n(61125)),o=r(n(15687)),a=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;if(n===o.ActionType.UPDATE_CALLBACK_STORE)return s(s({},e),r);return e},t.initialState=void 0;var i=r(n(61125)),o=n(2036);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case a.ActionType.INIT_CHATS_STORE:return r;case a.ActionType.SET_JOINED_AGENTS_IN_CURRENT_CHAT:return e.map(u((e=>{var t;return l(l({},e),{},{joinedAgents:null!==(t=r.joinedAgents)&&void 0!==t?t:[]})})));case a.ActionType.SET_JOINED_BOTS:return e.map(u((e=>{var t;return l(l({},e),{},{joinedBots:null!==(t=r.joinedBots)&&void 0!==t?t:[]})})));case a.ActionType.ADD_JOINED_AGENT_TO_CURRENT_CHAT:return r.agentId<0?e:e.map(u((e=>e.joinedAgents.includes(r.agentId)?e:l(l({},e),{},{joinedAgents:[].concat((0,i.default)(e.joinedAgents),[r.agentId])}))));case a.ActionType.SET_AGENT_TYPING:return e.map(u((e=>l(l({},e),{},{agentTyping:r.agentTyping}))));case a.ActionType.SET_CURRENT_CHAT_EVALUATED:return e.map(u((e=>l(l({},e),{},{evaluated:r.evaluated}))));case a.ActionType.CLOSE_CHAT:return e.map(u((e=>l(l({},e),{},{joinedAgents:[]}))));default:return e}};var i=r(n(15687)),o=r(n(61125)),a=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t(t,n,r)=>n!==r.length-1?t:e(t),c=[]},34014:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case o.ActionType.UPDATE_CLIENT_STORE:return(0,a.mergeSafety)(e,r);case o.ActionType.UPDATE_CLIENT_STORE_MANUALLY:return l(l({},e),r);case o.ActionType.RESET_CLIENT_STORE:return u;default:return e}},t.initialState=void 0;var i=r(n(61125)),o=n(2036),a=n(91133);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case a.ActionType.INIT_MESSAGES_STORE:return r.messages?(0,o.default)(r.messages):(0,o.default)(e);case a.ActionType.ADD_MESSAGE:return r.message?[].concat((0,o.default)(e),[r.message]):(0,o.default)(e);case a.ActionType.ADD_MESSAGES:return r.messages&&r.messages.length?[].concat((0,o.default)(e),(0,o.default)(r.messages)):(0,o.default)(e);case a.ActionType.UPDATE_MESSAGE_BODY:return r.privateId&&r.body?(0,o.default)(e.map((e=>e.private_id===r.privateId?l(l({},e),{},{body:r.body}):e))):(0,o.default)(e);case a.ActionType.UPDATE_MESSAGE:return e.map((e=>r.messageId&&e.msg_id===r.messageId||r.privateId&&e.private_id===r.privateId?l(l({},e),r.newMessage):e));case a.ActionType.UPDATE_MESSAGES:return e.map((e=>r.messageIds&&r.messageIds.includes(e.msg_id)||r.privateIds&&r.privateIds.includes(e.private_id)?l(l({},e),r.update):e));case a.ActionType.EDIT_MESSAGE:case a.ActionType.DELETE_MESSAGE:return(0,o.default)(e);case a.ActionType.UPDATE_WEBRTCCALL_STATUS:return r.privateId&&r.webRTCCallStatus?(0,o.default)(e.map((e=>e.private_id===r.privateId?l(l({},e),{},{body:l(l({},e.body),{},{webRTCCallStatus:r.webRTCCallStatus})}):e))):(0,o.default)(e);default:return e}};var i=r(n(61125)),o=r(n(15687)),a=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case o.ActionType.ADD_PROACTIVE:return r?{text:r.text||null,name:r.name||null,createdTs:r.createdTs||null,privateId:r.privateId||null,status:r.status||null,agentId:r.agentId||null,botId:r.botId||null,isMarkdown:r.isMarkdown||null,prechats:r.prechats||null,campaignId:r.campaignId||null}:e;case o.ActionType.SET_PROACTIVE_STATUS:return s(s({},e),{},{status:r.status});case o.ActionType.SET_PROACTIVE_NAME:return s(s({},e),{},{name:r.name});case o.ActionType.SET_PROACTIVE_PRECHATS:return s(s({},e),{},{prechats:r.prechats});case o.ActionType.RESET_PROACTIVE:return l;default:return e}},t.initialState=void 0;var i=r(n(61125)),o=n(2036);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;return n===o.ActionType.UPDATE_DESIGNER_SETTINGS?s(s({},e),r):e}},37480:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.features=void 0;var i,o=r(n(61125)),a=n(2036),s=r(n(96394));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case a.ActionType.SET_DISABLE_FILETRANSFER:return u(u({},e),{},{disableFiletransfer:r.disableFiletransfer});case a.ActionType.SET_ENABLE_PRECHAT:return u(u({},e),{},{prechat:r.prechat});case a.ActionType.SET_JOINT:return u(u({},e),{},{joint:r.joint});default:return e}}},77620:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(29829),i=n(61547),o=n(84348),a=n(6727),s=n(62241),l=n(37480),u=n(78634),c=n(6511),d=n(49437),f=(0,r.combineReducers)({features:l.features,system:s.system,user:u.user,permissions:c.permissions,campaignPopup:i.campaignPopup,campaignWidget:o.campaignWidget,contactFormPreview:a.contactFormPreview,designer:d.designer});t.default=f},6511:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.permissions=void 0;var i=r(n(61125)),o=n(2036),a=n(62168);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;return n===o.ActionType.UPDATE_PERMISSION?l(l({},e),{},{[r.permission]:r.value}):l({},e)}},78634:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.user=void 0;var i,o=r(n(61125)),a=n(2036),s=r(n(96394)),l=n(20344);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case a.ActionType.SET_WIDGET_COLOR:return c(c({},e),{},{widgetColor:r.widgetColor});case a.ActionType.SET_WIDGET_COLOR2:return c(c({},e),{},{widgetColor2:r.widgetColor2});case a.ActionType.SET_WIDGET_FONT_COLOR:return c(c({},e),{},{widgetFontColor:r.widgetFontColor});case a.ActionType.SET_WIDGET_ORIENTATION:return c(c({},e),{},{widgetOrientation:r.widgetOrientation});case a.ActionType.SET_MOBILE_WIDGET_ORIENTATION:return c(c({},e),{},{widgetMobileOrientation:r.widgetMobileOrientation});case a.ActionType.SET_MOBILE_OFFSET_BOTTOM:return c(c({},e),{},{mobileOffsetBottom:r.mobileOffsetBottom});case a.ActionType.SET_POWER_GRADIENT:return c(c({},e),{},{powerGradient:r.powerGradient});case a.ActionType.SET_MOBILE_WIDGET_COLOR:return c(c({},e),{},{powerButtonColor:r.powerButtonColor});case a.ActionType.SET_WIDGET_PADDING:return c(c({},e),{},{widgetPadding:r.widgetPadding});case a.ActionType.SET_ONLINE_WIDGET_LABEL:return c(c({},e),{},{onlineWidgetLabel:r.onlineWidgetLabel});case a.ActionType.SET_OFFLINE_WIDGET_LABEL:return c(c({},e),{},{offlineWidgetLabel:r.offlineWidgetLabel});case a.ActionType.SET_WIDGET_FONT_FAMILY:return c(c({},e),{},{fontFamily:r.fontFamily});case a.ActionType.SET_WIDGET_FONT_SIZE:return c(c({},e),{},{fontSize:r.fontSize});case a.ActionType.SET_WIDGET_FONT_TYPE:return c(c({},e),{},{fontType:r.fontType});case a.ActionType.SET_CALL_HEADER_TEXT:return c(c({},e),{},{callHeaderText:r.callHeaderText});case a.ActionType.SET_PATTERN:return c(c({},e),{},{pattern:r.pattern});case a.ActionType.SET_CALLBACK_BUTTON_COLOR:return c(c({},e),{},{callbackButtonColor:r.callbackButtonColor});case a.ActionType.SET_BUBBLE_COLOR:return c(c({},e),{},{bubbleColor:r.bubbleColor});case a.ActionType.SET_WIDGET_LABEL_BUBBLE:return c(c({},e),{},{labelBubble:r.labelBubble});case a.ActionType.SET_OFFLINE_FORM_TITLE:return c(c({},e),{},{offlineFormTitle:r.offlineFormTitle});case a.ActionType.SET_OFFLINE_FORM_TEXT:return c(c({},e),{},{offlineFormText:r.offlineFormText});case a.ActionType.SET_PRECHAT:return c(c({},e),{},{prechat:r.prechat});default:return e}}},78135:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1?arguments[1]:void 0;const n=t.type,o=t.payload;if(n===r.ActionType.INIT_SOCIAL_STORE)return o?{vk:o.vk||null,fb:o.fb||null,mode:o.mode||null}:e;return e};var r=n(2036);const i={vk:null,fb:null,mode:null}},31147:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1?arguments[1]:void 0;const n=t.type,o=t.payload;switch(n){case r.ActionType.INIT_TRANSITION_STORE:return{currentScript:o&&o.currentScript||null};case r.ActionType.START_TRANSITION_SCRIPT:return{currentScript:o&&o.script||e.currentScript};default:return e}},t.initialState=void 0;var r=n(2036);const i={currentScript:null};t.initialState=i},35233:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectShowEula=t.selectRoute=t.selectQuoteMsgId=t.selectLastChatOpened=t.selectIsOnline=t.selectIsInDrag=t.selectIsFocused=t.selectChatStarted=t.selectApp=void 0;const n=e=>e.app;t.selectApp=n;t.selectIsOnline=e=>n(e).isOnline;t.selectIsFocused=e=>n(e).isFocused;t.selectRoute=e=>n(e).route;t.selectShowEula=e=>n(e).showEula;t.selectChatStarted=e=>n(e).chatStarted;t.selectLastChatOpened=e=>n(e).lastChatOpened;t.selectIsInDrag=e=>n(e).isInDrag;t.selectQuoteMsgId=e=>n(e).quoteMsgId},65210:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectIsCallbackDelayed=t.selectIsCallbackAvailable=t.selectCallback=void 0;const n=e=>e.callback;t.selectCallback=n;t.selectIsCallbackAvailable=e=>n(e).available;t.selectIsCallbackDelayed=e=>n(e).isDelayed},55623:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.selectIsChatNotStarted=t.selectIsChatEvaluated=t.selectCurrentChat=t.selectChatsIds=t.selectChats=void 0;var i=r(n(15687)),o=n(79257),a=n(66311);const s=e=>e.chats;t.selectChats=s;const l=e=>{const t=s(e);return(0,o.last)(t)};t.selectCurrentChat=l;t.selectIsChatEvaluated=e=>{var t;const n=l(e);return null!==(t=null==n?void 0:n.evaluated)&&void 0!==t&&t};t.selectIsChatNotStarted=e=>{const t=l(e);return!(null!=t&&t.joinedAgents.length||null!=t&&t.joinedBots.length)};t.selectChatsIds=e=>{const t=(0,a.selectMessages)(e);return(0,i.default)(t.reduce(((e,t)=>(null!=t&&t.chat_id&&(e.has(t.chat_id)||e.add(t.chat_id)),e)),new Set))}},45959:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectLastMessage=t.selectIsIntroduced=t.selectInputText=t.selectEulaAccepted=t.selectDescription=t.selectDepartmentId=t.selectClientPhone=t.selectClientName=t.selectClientId=t.selectClientEvaluate=t.selectClientEmail=t.selectClient=void 0;const n=e=>e.client;t.selectClient=n;t.selectClientId=e=>n(e).clientId;t.selectEulaAccepted=e=>n(e).eulaAccepted;t.selectClientEvaluate=e=>n(e).evaluate;t.selectDepartmentId=e=>n(e).departmentId;t.selectClientName=e=>n(e).name||"";t.selectClientPhone=e=>n(e).phone||"";t.selectClientEmail=e=>n(e).email||"";t.selectInputText=e=>n(e).inputText||"";t.selectDescription=e=>n(e).description;t.selectLastMessage=e=>n(e).lastMessage||"";t.selectIsIntroduced=e=>n(e).isIntroduced},95448:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectFeatures=t.selectCampaigns=void 0;const n=e=>e.settings.features;t.selectFeatures=n;t.selectCampaigns=e=>n(e).campaigns},66311:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectSendedMessages=t.selectMessages=t.selectLastMessage=t.selectLastClientMessage=t.selectClientMessages=t.selectBotBlockedMessages=t.selectAgentMessagesCount=t.selectAgentMessages=void 0;var r=n(81152),i=n(73422);const o=e=>e.messages;t.selectMessages=o;t.selectSendedMessages=e=>o(e).filter((e=>e.status===r.MessageStatus.SENT));const a=e=>o(e).filter((e=>e.from===r.MessageInitiator.CLIENT));t.selectClientMessages=a;const s=e=>o(e).filter((e=>e.from===r.MessageInitiator.AGENT));t.selectAgentMessages=s;t.selectAgentMessagesCount=e=>s(e).length;t.selectLastClientMessage=e=>{const t=a(e);if(t.length>0)return t[t.length-1]};t.selectLastMessage=e=>{const t=o(e);if(t.length>0)return t[t.length-1]};t.selectBotBlockedMessages=e=>(o(e)||[]).filter((e=>{var t,n;return e.type==r.MessageType.LISTPICKER&&e.body&&(null===(t=e.body)||void 0===t?void 0:t.force_reply)&&!(0,i.isNumber)(null===(n=e.body)||void 0===n?void 0:n.answer_id)}))},7193:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectProactive=void 0;t.selectProactive=e=>e.proactive},87692:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectWixAgentTitle=t.selectWixAgentDisplayName=t.selectWidgetPadding=t.selectWidgetOrientation=t.selectWidgetMobileOrientation=t.selectWidgetId=t.selectWidgetFontColor=t.selectWidgetColor2=t.selectWidgetColor=t.selectUserCallbackTime=t.selectSettings=t.selectPrechat=t.selectPowerGradient=t.selectPowerButtonPhone=t.selectPowerButtonColor=t.selectPattern=t.selectOfflineWidgetLabel=t.selectOfflineFormTitle=t.selectMobileProactive=t.selectMobileOffsetBottom=t.selectLocale=t.selectLabelBubble=t.selectJoint=t.selectIsPremium=t.selectGeoIp=t.selectEulaEnabled=t.selectEula=t.selectEnablePrechat=t.selectDisableEmoji=t.selectDisableBotLabel=t.selectDesigner=t.selectDepartments=t.selectContactsSettings=t.selectContactsAsk=t.selectCallHeaderText=t.selectBubbleColor=t.selectBillRu=t.selectBaseUrl=t.selectAvatarUrl=void 0;const n=e=>e.settings;t.selectSettings=n;const r=e=>n(e).features,i=e=>n(e).system,o=e=>n(e).user;t.selectEnablePrechat=e=>r(e).prechat;t.selectDisableEmoji=e=>r(e).disableEmoji;t.selectDisableBotLabel=e=>r(e).disableBotLabel;t.selectEula=e=>r(e).eula;t.selectJoint=e=>r(e).joint;t.selectMobileProactive=e=>r(e).mobileProactive;t.selectDesigner=e=>n(e).designer;t.selectAvatarUrl=e=>i(e).avatarUrl;t.selectIsPremium=e=>i(e).premium;t.selectBillRu=e=>i(e).billRu;t.selectBaseUrl=e=>i(e).baseUrl;t.selectWidgetId=e=>i(e).widgetId;t.selectGeoIp=e=>i(e).geoIp;t.selectEulaEnabled=e=>i(e).eula;t.selectBubbleColor=e=>o(e).bubbleColor||"green";t.selectPrechat=e=>o(e).prechat;t.selectLocale=e=>o(e).locale;t.selectDepartments=e=>o(e).departments||[];t.selectContactsSettings=e=>o(e).contactsSettings;t.selectWidgetOrientation=e=>o(e).widgetOrientation;t.selectWidgetMobileOrientation=e=>o(e).widgetMobileOrientation;t.selectMobileOffsetBottom=e=>o(e).mobileOffsetBottom;t.selectCallHeaderText=e=>o(e).callHeaderText;t.selectWidgetPadding=e=>o(e).widgetPadding;t.selectWidgetFontColor=e=>o(e).widgetFontColor||null;t.selectWidgetColor=e=>o(e).widgetColor||null;t.selectWidgetColor2=e=>o(e).widgetColor2||null;t.selectUserCallbackTime=e=>o(e).callback.time;t.selectPowerButtonPhone=e=>o(e).powerButtonPhone;t.selectPattern=e=>o(e).pattern;t.selectPowerButtonColor=e=>o(e).powerButtonColor;t.selectPowerGradient=e=>o(e).powerGradient;t.selectWixAgentDisplayName=e=>o(e).wixAgentDisplayName;t.selectWixAgentTitle=e=>o(e).wixAgentTitle;t.selectOfflineWidgetLabel=e=>o(e).offlineWidgetLabel;t.selectOfflineFormTitle=e=>o(e).offlineFormTitle;t.selectContactsAsk=e=>o(e).contactsAsk;t.selectLabelBubble=e=>o(e).labelBubble},92400:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectTransitionCurrentScript=void 0;t.selectTransitionCurrentScript=e=>e.transition.currentScript},62096:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.reduxStore=void 0;var i=n(29829),o=r(n(53894)),a=n(9393),s=n(75291),l=n(44733),u=n(28240),c=n(68031),d=r(n(94514));const f=(0,i.configureStore)({reducer:d.default,preloadedState:function(){const e={};return(0,a.each)(c.statesToPersist,(function(t){let n=t.storageKey,r=t.path,i=t.onAdapter;const o=l.StorageProvider.get(n);o&&(0,s.set)(e,r,i?i(o):o)})),e}(),middleware:[o.default,u.loggerMiddleware,c.persistMiddleware]});t.reduxStore=f,(0,c.subscribeOnStorage)(f)},5735:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(61125)),o=n(9393),a=n(31484),s=r(n(26754)),l=r(n(138)),u=r(n(14264)),c=r(n(71277)),d=r(n(2833)),f=n(81152),p=n(21476),h=n(97490),g=n(65465),_=n(4425),m=r(n(66547)),v=r(n(73687)),y=r(n(4855)),b=r(n(92443)),E=r(n(96394)),C=n(73262),T=n(21951),D=n(68403),w=n(13077),S=n(43902),O=n(6222),A=n(20676),I=n(73422),k=n(26932),M=n(44145),x=n(69882),P=n(83907),R=n(9550),N=n(48999),L=n(74619),F=n(50350),j=n(85948),B=n(45948),U=n(97615);function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t{var t,n,r,i;const o=S.StatsManager.get(e.campaign_id);return"widget"===e.type&&e.rules.commands[0].command===P.RuleTypes.PROACTIVE&&(this.hasWidgetCampaign=!0),(null==o||!o.isSubmitted||"call_to_action"===(null===(t=e.content)||void 0===t||null===(n=t.popup_settings)||void 0===n||null===(r=n.screens)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.action))&&(!e.end_ts||l<1e3*e.end_ts)})),this.isCampaignsEnable=this.campaigns&&this.campaigns.length>0,(0,w.setRuleLocal)("pageEnterTime",l),(0,w.addPageView)(),s.default.agent_id&&i&&o||this.ready()},ready:function(){const e=this.rules.slice();G.log("RULE MANAGER READY: initialRules",e),this.rules=[],e.forEach(((e,t)=>{e.conditions?this.isCampaignsEnable&&this.hasWidgetCampaign&&e.commands[0].command===P.RuleTypes.PROACTIVE?G.warn("Remove proactive rule, because it handled by campaigns."):this.rules.push(new K(e,t)):G.warn("Remove rule without conditions.")}));const t=this.rules.length;this.isCampaignsEnable&&this.campaigns.forEach(((e,n)=>{var r,i,o,a;const s=e.campaign_id,l=e.title,u=e.content,c=e.rules;c.conditions?this.rules.push(new K(H(H({},c),{},{campaign_id:s,name:l||`Campaign ${s}`,widget_settings:null!==(r=null==u?void 0:u.widget_settings)&&void 0!==r?r:null,popup_settings:null!==(i=null==u?void 0:u.popup_settings)&&void 0!==i?i:null,prechats:null!==(o=null==u||null===(a=u.widget_settings)||void 0===a?void 0:a.prechat_buttons)&&void 0!==o?o:null==u?void 0:u.prechat_buttons}),t+n)):G.warn("Remove campaign without conditions.")})),G.warn("final rules",this.rules)},moveCloseButton:function(){(0,o.each)(this.rules,(function(e){(0,w.setRuleLocal)("movedToCloseButton",!0),e.tick()}),this)},mouseScroll:function(e){(0,o.each)(this.rules,(function(t){(0,w.setRuleLocal)("scrollPosition",e),t.tick()}),this)},cancelRule:function(e){G.log("canceling rule",e);for(var t=0;t7&&void 0!==arguments[7]?arguments[7]:null;if(this.isCampaignsEnable&&o){const e=(0,M.getProactive)().campaignId;if(e)return void G.warn(`Proactive message disabled. Proactive message already have options from campaign #${e}.`);k.proactiveDispatchers.addProactive({campaignId:o})}(n&&"string"==typeof n&&n.includes("markdown")||r)&&(r=!0);const _=u.default.getCurrentChatMessages(),m="Cant show proactive:";if(!this.canInvite||(0,M.getProactive)().text||u.default.getCurrentProactive()||p.Router.getCurrentRoute()==h.Route.CHAT&&(0,M.getApp)().chatOpenByClient||(0,M.getApp)().chatStarted&&_&&_.length)return void G.info(`${m} by logic`);const v=(0,M.getUserSettings)().departments;if((0,I.isNumber)(t)&&0!==t&&(null==v||!v.find((e=>+e.id===t))))return void G.info(`${m} department id ${t} is not found.`);const y=u=>{G.log("widget status",u);const d=(0,M.getClient)();(0,M.getApp)().isOnline||(0,M.getAgents)().length?(0,M.getProactive)().text||!u||p.Router.getCurrentRoute()!==h.Route.LABEL&&!A.platform.isChatPage?G.log('invitation failed, no agent OR route != "label" OR proactive already shown'):(u.bot_id||d.priorityAgentId&&d.priorityAgentId===u.agent_id||k.clientDispatchers.setPaId(u.agent_id),v&&(0,I.isNumber)(t)&&k.clientDispatchers.setDepartmentId(t),i&&k.featuresDispatchers.enablePrechat(!0),b.default.proactive({message:e,agentInfo:u,name:n,isMarkdown:r,prechats:i,campaignId:o,conditionList:(0,w.getCondNames)(a),extra:s}),(0,w.setInvitationTime)(),z.emit("show_proactive"),c.default.play("notification"),g.messageActions.destroyByType(f.MessageType.LISTPICKER),g.messageActions.addPrechatMessage(i,o),o?l.default.trackCampaignShown(n):l.default.trackProactiveInvitationShown(n)):G.info(`${m} for offline`)};d.default.getActiveAgent(y,t)},showCallForm:function(e,t){const n=(0,M.getProactive)();(0,M.getApp)().route!=h.Route.LABEL||n.text&&n.status!=f.MessageStatus.READ?G.warn("ignore showCallForm due to proactive"):b.default.showCallForm(e,(()=>{z.emit("show_proactive"),c.default.play("notification"),(0,w.setInvitationTime)(),l.default.trackCallWidgetInvitationShown(t)}))},showCampaignPopup:function(e,t){var n;const r=e.campaignId,i=(0,M.getApp)().chatAccepted,o=(0,M.getSettings)().campaignPopup,a=o.campaignId,s=o.display,l=null==e||null===(n=e.screens[0])||void 0===n?void 0:n.action,u=(0,O.isFrequencyDelay)(r),c=S.StatsManager.get(r);if(!t){if(i)return void G.warn("Chat accepted by agent. CampaignPopup disabled.");if(u)return void G.warn(`CampaignPopup #${r} is delayed.`);if(s)return void G.warn(`CampaignPopup already have config from campaign #${a}.`);if(null!=c&&c.isSubmitted){if("call_to_action"!==l)return void G.warn(`CampaignPopup #${r} no longer shown. It was accepted by client.`);e.frequency="once_1d"}}b.default.showPopup(e)}});let $,Z;const q=Object.assign(V,{inited:!1,initialize:function(){this.inited||(this.initScroll(),this.initClose(),this.inited=!0)},initScroll:function(){$=(0,C.throttle)(this._scroll.bind(this),150),(0,T.addListener)(window.parent,"scroll",$)},initClose:function(){this.last_position={},Z=(0,C.throttle)(this._mouse.bind(this),100),(0,T.addListener)(window.parent,"mousemove",Z)},_mouse:function(e){if(this.timerId&&clearTimeout(this.timerId),void 0!==this.last_position.x){var t=this.last_position.x-e.clientX,n=this.last_position.y-e.clientY,r=Math.abs(n)>Math.abs(t)&&n>0,i=e.clientY>>0==0,o=e.clientY<=30,a=e.clientY<=this.last_position.dY+30&&n>e.clientY&&n>25;r&&(i||o&&a)&&(this.timerId=setTimeout((()=>{z.moveCloseButton()}),200))}this.last_position={x:e.clientX,y:e.clientY,dY:this.last_position.y-e.clientY}},_scroll:function(){const e=window.parent.document;let t=e.documentElement.clientHeight;t===e.documentElement.scrollHeight&&(t=e.body.clientHeight),z.mouseScroll(Math.round((e.documentElement.scrollTop+e.body.scrollTop)/(e.documentElement.scrollHeight-t)*100))},removeEvents:function(){$&&(0,T.removeEvent)(window.parent,"scroll",$),Z&&(0,T.removeEvent)(window.parent,"scroll",Z)}}),K=function(e,t){const n={initialize:function(){(0,a.defaults)(this,e),this.index=t,this.isCampaign=Boolean(e.campaign_id),this.isTriggered=!1;const n=(0,M.getApp)(),r=n.route,i=n.hiddenByRules;if(r===h.Route.HIDDEN||i)return void G.log("Ignore rule, widget is hidden.");(0,o.each)(this.conditions,(function(e){e.condition===P.RuleConditions.WEEK_DAY&&"0"===e.value&&(e.value="7")})),this.timeConditions=[];const s=this.commands[0];let u=!1;const c=this.id?"id"+this.id:"i"+this.index,d=s.command+"_onceADay_"+c,f=v.default.get(d),p=(0,w.hasOnceCondition)(this.conditions);if(p&&f){if(!1!==p.value)return G.log(`Ignore "${this.name}" rule, already triggered today.`),void this.cancel();v.default.set(d,null,1)}if(!p&&s.params&&(s.params.once_aday||s.params.onceADay)&&f)G.log("is once a day rule",this.name);else{if(this.conditions)for(let e=0;e0?(0,w.checkTimeConditions)(this.timeConditions,this.type,this.name)?this.triggered():this.timeWait():u&&this.triggered()}},timeWait:function(){var e=this;clearTimeout(this.timeWaitTimeout),this.timeWaitTimeout=setTimeout((function(){e.tick()}),1e3)},tick:function(){!this.isTriggered&&(0,w.checkTimeConditions)(this.conditions,this.type,this.name)?this.triggered():this.timeWait()},cancel:function(){clearTimeout(this.timeWaitTimeout),this.isTriggered=!0},triggered:function(){var e,t,n,r,i,o;G.log("triggered",this.name);const a=this.commands[0];clearTimeout(this.timeWaitTimeout),this.isTriggered=!0;let s={};(0,I.isObject)(a.params)&&(s={name:a.command+"_onceADay",value:a.params.once_aday||a.params.onceADay?1:null});const d=(0,w.hasOnceCondition)(this.conditions);G.log("onceCondition",d,this.conditions),d&&(s={name:a.command+"_onceADay",value:d.value});const p=(0,w.isPopupCommand)(a.command),m=(0,M.getApp)().route,v=(0,M.getApp)().isOnline;if(m!==h.Route.LABEL&&p&&(0,M.getApp)().chatOpenByClient||A.platform.isChatPage&&[h.Route.DEPARTMENTS,h.Route.INTRODUCE].includes(m))return void G.log("cant show proactive",m);const y=(0,M.getClient)();if(p&&(0,w.isYandexMarketClient)(y.utm))return void G.log("ignore proactive for YMarket");const E=null!==(e=this.widget_settings)&&void 0!==e?e:a.params,C=this.campaign_id&&E?(0,N.formatProactiveContent)(E):null===(t=a.params)||void 0===t?void 0:t.message,T=(0,M.getUserSettings)(),S=T.contactsAsk,O=T.chatMode,x=this.campaign_id,L=this.popup_settings,F=this.frequency;switch(a.command){case P.RuleTypes.PROACTIVE:z.showProactive(C,null!==(n=a.params)&&void 0!==n&&n.department?+(null===(r=a.params)||void 0===r?void 0:r.department):void 0,this.name,!!this.campaign_id||this.isMarkdown,this.prechats,this.campaign_id,this.conditions,this.campaign_id?{img_src:E.img_src,img_position:E.img_position,background:E.background,text_color:E.text_color}:null);break;case P.RuleTypes.OPEN_OFFLINE:if((0,M.getClient)().isIntroduced)return G.warn("Client introduced earlier, OPEN_OFFLINE canceled."),void z.cancelRule(P.RuleTypes.OPEN_OFFLINE);if(O===_.ChatMode.ONLINE||m!==h.Route.LABEL)return;(0,w.setInvitationTime)(),a.params&&(a.params.title&&k.userDispatchers.setOfflineFormTitle(a.params.title),a.params.message&&(g.messageActions.deleteOfflineSystemInvites(),k.userDispatchers.setOfflineFormText(a.params.message))),b.default.openOffline(),z.emit("show_proactive"),c.default.play("notification"),l.default.trackProactiveInvitationShown(this.name),z.cancelRule(P.RuleTypes.OPEN_OFFLINE);break;case P.RuleTypes.HIDE:(0,M.getFeatures)().enableSpaNavigate?k.appDispatchers.setHiddenByRules(!0):((0,j.addSyncExclude)("route"),k.appDispatchers.setAppRoute(h.Route.HIDDEN)),z.allRulesCancel(),c.default.disableSoundPlayer();break;case P.RuleTypes.SYSTEM_MESSAGE:if(v){var B,U;const e=u.default.getLastMessage();e&&e.get("type")===f.MessageType.SYSTEM&&e.get("text")===(null===(B=a.params)||void 0===B?void 0:B.message)&&e.destroy(),(0,w.setInvitationTime)(),b.default.systemMessage(null===(U=a.params)||void 0===U?void 0:U.message),g.messageActions.addPrechatMessage()}break;case P.RuleTypes.SYSTEM_EMAIL:if(!v)return;if(v&&S===R.ContactsType.SOCIAL)return void G.log("systemMessageEmail failed, contact settings is social");if(y.email)return void G.log("Client already has email. Rule ignored.");if((0,D.hasIntegration)(y.hasIntegration))return void G.log("systemMessageEmail failed, client has integration");(0,w.setInvitationTime)(),b.default.systemMessageEmail(null===(i=a.params)||void 0===i?void 0:i.message),g.messageActions.addPrechatMessage();break;case P.RuleTypes.SHOW_CALLFORM:z.showCallForm((null===(o=a.params)||void 0===o?void 0:o.title).replace("
","").replace("","").replace("","").replace("",""),this.name);break;case P.RuleTypes.SHOW_POPUP:z.showCampaignPopup(H(H({},L),{},{frequency:F,campaignId:x}))}z.handleOnceADay(s,this)}};return n.initialize(),n};(0,M.getFeatures)().enableSpaNavigate&&new L.Observer({onUrlChange:()=>{const e=(0,x.getCurrentPage)(),t=e.title,n=e.url;(0,F.sendUrlChange)(t,n),(0,w.setRuleLocal)("firstMessageTime",null),B.isPopupConstructor||U.EnvironmentManager.isWidgetConstructor()||k.appDispatchers.setHiddenByRules(!1),z.allRulesCancel(),z.initCampaignIds=[],z.campaigns=[],z.rules=[],z.init()}}),s.default.addListener((function(){s.default.agent_id&&(0,M.getApp)().chatStarted&&(0,M.getApp)().isOnline&&z.allRulesCancel()})),u.default.on("create",(()=>{u.default.getCurrentClientMessages().length&&!(0,w.getRuleLocal)("firstMessageTime")&&(G.log("cancelRules, we have client messsages."),z.cancelRule(P.RuleTypes.PROACTIVE),z.cancelRule(P.RuleTypes.SHOW_CALLFORM));const e=u.default.getLastMessage();e&&e.get("type")===P.RuleTypes.PROACTIVE&&z.cancelRule(P.RuleTypes.PROACTIVE),u.default.getAgentTextMessages().length&&e.get("from")!==f.MessageInitiator.CLIENT&&(G.log("cancel system_message, we have agentMessage"),z.cancelRule(P.RuleTypes.SYSTEM_MESSAGE))})),(0,T.addListener)(window.parent,"jBeforeunload",q.removeEvents);var Y=z;t.default=Y},26754:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(40694);const o=(0,r(n(85948)).default)({agent_id:0,bot_id:0,display_name:null,title:null,avatar_url:null,typing:0,state:null,isUpdateFromBot:null});o.toReduxFormat=()=>(0,i.agentToReduxFormat)(o);var a=o;t.default=a},95003:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(85948)),o=r(n(96394)),a=n(69882),s=n(31484),l=n(97490),u=n(4425),c=r(n(73687)),d=n(44733),f=n(71047),p=n(9550),h=n(44145),g=n(97615),_=n(45948),m=n(20676);function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}const y={route:l.Route.LABEL,is_online:0,is_focused:!1,chat_started:!1,chat_accepted:!1,widget_color:o.default.widget_color,widget_color2:o.default.widget_color2,widget_font_color:o.default.widget_font_color,cap_id:null,forcedOffline:!1,callText:null,maintenance:null,eula_accepted:!1,show_eula:!1,width:!1,height:!1,viReconnectTime:null,lastMsgId:null,lastChatOpened:null,started:!1,lastMsgTime:null,didFreezeData:!1,lastChatStatus:null,quoteMsgId:null,hiddenByRules:!1},b=g.EnvironmentManager.isDesignerEditor()?null:d.StorageProvider.createKeyForStore(f.STORAGED_ID.APP),E=(0,i.default)(y,b),C=(0,h.getClient)();E.widget_color=o.default.widget_color,E.widget_color2=o.default.widget_color2,E.widget_font_color=o.default.widget_font_color,E.is_online=o.default.chat_mode===u.ChatMode.ONLINE?1:0,E.is_online||null!==C.sessionId||(E.chat_started=!1),(0,a.isWixEditor)()&&(E.chat_started=!1),m.platform.isMobileOrTablet&&(E.route=l.Route.LABEL),(0,s.defaults)(o.default,{contacts_settings:{name:{show:!1,required:!1},phone:{show:!1,required:!1},email:{show:!1,required:!1}}}),1!==o.default.hide_offline||512&o.default.options||(o.default.hide_offline=0),1!=o.default.show_rate_form||64&o.default.options||(o.default.show_rate_form=0),(0,i.addSyncExclude)("hiddenByRules"),E.hiddenByRules&&(0,i.addSyncExclude)("route"),E.route==l.Route.HIDDEN&&(E.route=l.Route.LABEL),E.chat_started&&E.chat_accepted&&!m.platform.isMobileOrTablet?(o.default.label_bubble?E.route=E.route===l.Route.LABEL?l.Route.LABEL:l.Route.CHAT:E.route=E.route===l.Route.CHAT_MIN?l.Route.CHAT_MIN:l.Route.CHAT,o.default.hide_offline=0):E.route=l.Route.LABEL,E.route==l.Route.INTRODUCE&&o.default.contacts_ask!==p.ContactsType.BEFORE_CHAT&&(E.route=l.Route.CHAT),E.route==l.Route.INTRODUCE&&C.isIntroduced&&(E.route=l.Route.CHAT),E.route!=l.Route.INTRODUCE||E.is_online||(E.route=l.Route.CHAT),E.route==l.Route.CHAT_SOCIAL&&(E.route=l.Route.CHAT),E.route==l.Route.CHAT_EULA&&(E.route=l.Route.CHAT),E.route==l.Route.CALL_EULA&&(E.route=l.Route.CALL),E.route!=l.Route.CHAT_EVAL&&E.route!=l.Route.CHAT_INTRODUCE||(E.route=l.Route.CHAT),!m.platform.isMobile&&E.zoom&&(E.zoom=null),E.show_eula=!1,g.EnvironmentManager.isRegPage()&&(E.route=l.Route.CHAT);const T=o.default.contacts_ask===p.ContactsType.BEFORE_CHAT&&!C.isIntroduced&&E.is_online;m.platform.isChatPage?T?E.route=l.Route.INTRODUCE:o.default.departments&&!E.chat_started&&E.is_online?E.route=l.Route.DEPARTMENTS:E.route=l.Route.CHAT:T&&E.route==l.Route.CHAT&&(E.route=l.Route.INTRODUCE),(!E.is_online&&o.default.hide_offline&&!E.chat_started||c.default.get("is_blacklisted")||m.platform.isMobileOrTablet&&o.default.disable_mobile||(0,a.isAppCobrowse)())&&(E.route=l.Route.HIDDEN),_.isPopupConstructor&&(E.route=l.Route.HIDDEN),E.hiddenByRules=!1,o.default.cookie_domain&&d.StorageProvider.migrate();var D=E;t.default=D},32710:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=function(e,t,n){if(!(0,r.isFunction)(e))throw new TypeError("Bind must be called on a function.");return e.bind(t,n)};var r=n(73422)},10895:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compose=function(){for(var e=arguments.length,t=new Array(e),n=0;n0;)e=n.pop()(e);return e}}},53401:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.splitCookieOnEntries=t.setCookie=t.parseCookies=t.getCookie=t.deleteCookie=void 0;var i=r(n(67375)),o=n(80210),a=n(64249),s=n(79641),l=n(21733),u=n(82138),c=n(10895);const d=e=>e.toUTCString(),f=e=>e.map((e=>e.trim())),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:432e5;const t=(new Date).getTime()+e;return d(new Date(t))},h=e=>{const t=new Date;return t.setDate(t.getDate()+e),d(t)};t.getCookie=e=>{const t=(0,u.isRegExp)(e)?e:new RegExp(e+"=([^;]*)"),n=document.cookie.match(t),r=(0,c.compose)(JSON.parse,decodeURIComponent);return n?r(n[1]):null};const g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Object.assign({path:"/",expires:p()},n);(0,a.isDate)(r.expires)&&(r.expires=d(r.expires)),(0,s.isNumber)(r.expires)&&(r.expires=h(r.expires));const u=Object.entries(r),c=(0,l.isString)(t)?t:JSON.stringify(t),f=(0,o.encodeAndJoinPair)([e,c]),g=u.reduceRight(((e,t)=>{let n=(0,i.default)(t,2);return e+`; ${n[0]}=${n[1]}`}),f);return document.cookie=g};t.setCookie=g;t.deleteCookie=e=>g(e,"",{"max-age":-1});t.parseCookies=()=>document.cookie.split(";").reduce(((e,t)=>{var n;const r=(0,o.splitAndDecodePair)(t),i=r[0].trim(),a=null!==(n=r[1])&&void 0!==n?n:"";return e[i]=a.trim(),e}),{});t.splitCookieOnEntries=()=>{const e=document.cookie.split(";"),t=(0,c.compose)(f,o.splitAndDecodePair);return e.map(t)}},90991:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=function(e,t,n){let r,i,o,a,s;const l=function(){const u=Date.now()-i;t>u?r=setTimeout(l,t-u):(r=null,n||(a=e.apply(s,o)),r||(o=s=null))},u=function(){return s=this,o=arguments,i=Date.now(),r||(r=setTimeout(l,t),n&&(a=e.apply(s,o))),a};return u.cancel=function(){clearTimeout(r),r=o=s=null},u}},31484:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=function(){for(var e=arguments.length,t=new Array(e),n=0;n{if((0,r.isUndefined)(t))return e;const n=new Set(t);return e.filter((e=>!n.has(e)))}},9393:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.each=function(e,t,n){const r=n?function(e,r,i){return t.call(n,e,r,i)}:t;Array.isArray(e)&&e.forEach(r);(0,s.isObject)(e)&&Object.entries(e).forEach(((e,t,n)=>{let o=(0,i.default)(e,2),a=o[0],s=o[1];return r(s,a,n)}));((0,o.isNodeList)(e)||(0,a.isHTMLCollection)(e))&&Array.from(e).forEach(r);return e};var i=r(n(67375)),o=n(82384),a=n(2423),s=n(46322)},60277:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extend=void 0;t.extend=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const t=(0,o.splitString)(e,"."),n=(0,i.default)(t,2);return{name:n[0],ext:n[1]}}},58271:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileSize=t.bytesToMB=void 0;const n=["B","KB","MB","gB","tB"];t.fileSize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(0===e)return"0";const r=Math.floor(Math.log(e)/Math.log(1024)),i=e/1024**r,o=t?Math.round(i):i.toFixed(2),a=n[r];return o+a};t.bytesToMB=e=>e/1048576},37578:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterObj=void 0;var r=n(28650);t.filterObj=(e,t)=>Object.keys(e).reduce(((n,i)=>((0,r.hasOwn)(e,i)&&t(e[i],i)&&(n[i]=e[i]),n)),{})},39715:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e,t,n){return(0,i.isString)(t)?o(t.match(/([^[.\]])+/g)):(0,r.isArray)(t)?o(t):void 0;function o(t){return t.reduce(((e,t)=>{try{e=e[t]}catch(e){return n}return e}),e)}};var r=n(73422),i=n(21733)},28650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},35967:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.intersection=void 0;var i=r(n(55067));t.intersection=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;ro.has(e)))}},64249:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(e)}},92560:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var r=n(73422),i=n(98986),o=n(28008);t.isEmpty=e=>""===e||(0,i.isNull)(e)||(0,o.isUndefined)(e)||((0,r.isObject)(e)||(0,r.isArray)(e))&&0===Object.keys(e).length},2423:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHTMLCollection=void 0;t.isHTMLCollection=e=>!!e&&"HTMLCollection"===e.constructor.name},82384:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeList=void 0;t.isNodeList=e=>!!e&&"NodeList"===e.constructor.name},98986:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNull=void 0;t.isNull=e=>null===e},79641:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=function(e){return"number"==typeof e}},46322:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=void 0;t.isObject=e=>!!e&&"Object"===e.constructor.name},82138:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRegExp=function(e){return e instanceof RegExp}},21733:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=function(e){return"string"==typeof e}},28008:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUndefined=function(e){return void 0===e}},79257:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;t.last=e=>e.length?e[e.length-1]:void 0},82956:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.xhrPromised=t.xhr=t.createCancelablePromise=t.CancelError=void 0;var i=r(n(92664)),o=r(n(33119)),a=r(n(7819)),s=r(n(84827)),l=r(n(85299)),u=r(n(55536)),c=r(n(51398)),d=r(n(61125)),f=r(n(67375));function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}const h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.trim().split(/[\r\n]+/).reduce(((e,t)=>{const n=t.split(": "),r=(0,f.default)(n,2),i=r[0],o=r[1];return e[i]=o,e}),{})},g=(e,t,n,r)=>{const i=new XMLHttpRequest;return i.open(t,e,!0),n.headers&&Object.keys(n.headers).forEach((e=>{i.setRequestHeader(e,n.headers[e])})),i.timeout=n.timeout,i.responseType=n.responseType,i.withCredentials=n.withCredentials,i.onload=()=>n.validateStatus(i.status)?r(null,{data:i.response,status:i.status,statusText:i.statusText,headers:h(i.getAllResponseHeaders())}):r({data:i.response,status:i.status,statusText:i.statusText}),i.onerror=e=>r({data:i.response,status:i.status,statusText:i.statusText}),i.upload.onprogress=n.onUpload,i.onprogress=n.onDownload,i.ontimeout=n.onTimeout||r,i.send(n.body),i};t.xhr=g;t.xhrPromised=(e,t,n)=>new Promise(((r,i)=>g(e,t,n,((e,t)=>e?i(e):r(t)))));let _=function(e){(0,s.default)(n,e);var t=p(n);function n(){var e;(0,o.default)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s{let t=!1;const n=new _;return{promise:new Promise(((r,i)=>{e.then((e=>t?i(n):r(e))).catch((e=>i(t?n:e)))})),cancel:()=>t=!0,isCanceled:t}}},42687:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0;var i=r(n(61125));function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t1?t-1:0),r=1;rdelete e[t])),e):e}},38392:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pick=void 0;var r=n(28008);t.pick=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i(n in e&&(t[n]=e[n]),t)),{})}},80210:function(e,t,n){"use strict";var r=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAndJoinPair=a,t.querystring=void 0,t.splitAndDecodePair=s;var i=r(n(67375)),o=n(39731);function a(e){return e.map(encodeURIComponent).join("=")}function s(e){return e.split("=").map(decodeURIComponent)}function l(e){return function(e){if(!e||!e[Symbol.iterator])throw new Error("Object.fromEntries() requires a single iterable argument");let t={};for(let r of e){var n=(0,i.default)(r,2);let e=n[0],o=n[1];t[e]=o}return t}(e.split("&").map(s))}const u={create:e=>e?function(e){return Object.entries(e).map(a).join("&")}(e):"",parse:e=>{if(e){const t=(0,o.splitString)(e,"?");return l((0,i.default)(t,2)[1])}}};t.querystring=u},53489:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitize=function(e){if(!1===(0,r.isString)(e))throw new TypeError("Filename must be string.");const t=(0,i.fileName)(e),n=t.name,s=t.ext,l=n.replace(o,"").replace(a,"_");return(l.length?l:"Untitled")+"."+s};var r=n(21733),i=n(21434);const o=/[/?<>\\:*|"%#]/g,a=/\s+/g},75291:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.set=function(e,t,n){if((0,i.isString)(t))return a(t.match(/([^[.\]])+/g));if((0,r.isArray)(t))return a(t);function a(t){t.reduce(((e,t,r,i)=>((0,o.isUndefined)(e[t])&&(e[t]={}),r===i.length-1&&(e[t]=n),e[t])),e)}};var r=n(73422),i=n(21733),o=n(28008)},39731:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitString=void 0;t.splitString=(e,t,n)=>{const r=e[n?"indexOf":"lastIndexOf"](t),i=e.substring(0,r);return[i,e.substring(r+(i?t.length:1))]}},38632:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parentSS=t.parentLS=void 0;var r=n(23267),i=n(71047),o=n(21733),a=n(4623);const s=u(i.STORAGE_TYPE.LOCAL);t.parentLS=s;const l=u(i.STORAGE_TYPE.SESSION);function u(e,t){(0,a.tryCatch)((()=>e=(0,r.getPageWindow)()[e]));const n=e=>(0,a.tryCatch)(e,t);return{get(t){return n((()=>{const n=e.getItem(t);return JSON.parse(n)}))},set(t,r){return n((()=>{const n=(0,o.isString)(r)?r:JSON.stringify(r);return e.setItem(t,n),r}))},remove(t){return n((()=>e.removeItem(t)))},keys(){return n((()=>Object.keys(e)))},values(){return n((()=>Object.values(e).map(JSON.parse)))},all(){return n((()=>Object.assign({},e)))},clear(){return n((()=>e.clear()))},status(){return function(e){return(0,a.tryCatch)((()=>{const t="__storage_test__";return e.setItem(t,t),e.removeItem(t),i.STORAGE_STATUS.AVAILABLE}),(t=>{return t instanceof DOMException&&function(e){return e&&0!==e.length}(e)&&(22===(n=t).code||1014===n.code||"QuotaExceededError"===n.name||"NS_ERROR_DOM_QUATA_REACHED"===n.name)?i.STORAGE_STATUS.EXCEED:i.STORAGE_STATUS.UNAVAILABLE;var n}))}(e)}}}t.parentSS=l},4623:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryCatch=function(e,t){try{return e()}catch(e){return(0,r.isFunction)(t)?t(e):t}};var r=n(73422)},76784:function(e,t,n){"use strict";t.G=void 0;var r=n(58345);t.G=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),r=1;r!i.has(e)))}},94184:function(e,t){var n; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t1?arguments[1]:void 0,_=void 0!==g;_&&(g=r(g,h>2?arguments[2]:void 0));var m,v,y,b,E,C,T=f(t),D=0;if(!T||this===p&&s(T))for(m=u(t),v=n?new this(m):p(m);m>D;D++)C=_?g(t[D],D):t[D],c(v,D,C);else for(E=(b=d(t,T)).next,v=n?new this:[];!(y=i(E,b)).done;D++)C=_?a(b,g,[y.value,D],!0):y.value,c(v,D,C);return v.length=D,v}},31692:function(e,t,n){var r=n(74529),i=n(59413),o=n(10623),a=function(e){return function(t,n,a){var s,l=r(t),u=o(l),c=i(a,u);if(e&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},3610:function(e,t,n){var r=n(86843),i=n(95329),o=n(37026),a=n(89678),s=n(10623),l=n(64692),u=i([].push),c=function(e){var t=1==e,n=2==e,i=3==e,c=4==e,d=6==e,f=7==e,p=5==e||d;return function(h,g,_,m){for(var v,y,b=a(h),E=o(b),C=r(g,_),T=s(E),D=0,w=m||l,S=t?w(h,T):n||f?w(h,0):void 0;T>D;D++)if((p||D in E)&&(y=C(v=E[D],D,b),e))if(t)S[D]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return D;case 2:u(S,v)}else switch(e){case 4:return!1;case 7:u(S,v)}return d?-1:i||c?c:S}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},50568:function(e,t,n){var r=n(95981),i=n(99813),o=n(53385),a=i("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},34194:function(e,t,n){"use strict";var r=n(95981);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},15790:function(e,t,n){var r=n(59413),i=n(10623),o=n(55449),a=Array,s=Math.max;e.exports=function(e,t,n){for(var l=i(e),u=r(t,l),c=r(void 0===n?l:n,l),d=a(s(c-u,0)),f=0;u1?arguments[1]:void 0;return a(this),(t=void 0!==p)&&o(p),s(e)?new this:(n=[],t?(c=0,d=r(p,f>2?arguments[2]:void 0),l(e,(function(e){i(u,n,d(e,c++))}))):l(e,u,{that:n}),new this(n))}},45226:function(e,t,n){"use strict";var r=n(93765);e.exports=function(){return new this(r(arguments))}},85616:function(e,t,n){"use strict";var r=n(65988).f,i=n(29290),o=n(94380),a=n(86843),s=n(5743),l=n(82119),u=n(93091),c=n(75105),d=n(23538),f=n(94431),p=n(55746),h=n(21647).fastKey,g=n(45402),_=g.set,m=g.getterFor;e.exports={getConstructor:function(e,t,n,c){var d=e((function(e,r){s(e,f),_(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),p||(e.size=0),l(r)||u(r,e[c],{that:e,AS_ENTRIES:n})})),f=d.prototype,g=m(t),v=function(e,t,n){var r,i,o=g(e),a=y(e,t);return a?a.value=n:(o.last=a={index:i=h(t,!0),key:t,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=a),r&&(r.next=a),p?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},y=function(e,t){var n,r=g(e),i=h(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return o(f,{clear:function(){for(var e=g(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,p?e.size=0:this.size=0},delete:function(e){var t=this,n=g(t),r=y(t,e);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first==r&&(n.first=i),n.last==r&&(n.last=o),p?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=g(this),r=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),o(f,n?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return v(this,0===e?0:e,t)}}:{add:function(e){return v(this,e=0===e?0:e,e)}}),p&&r(f,"size",{get:function(){return g(this).size}}),d},setStrong:function(e,t,n){var r=t+" Iterator",i=m(t),o=m(r);c(e,t,(function(e,t){_(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?d("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,d(void 0,!0))}),n?"entries":"values",!n,!0),f(t)}}},24683:function(e,t,n){"use strict";var r=n(76887),i=n(21899),o=n(21647),a=n(95981),s=n(32029),l=n(93091),u=n(5743),c=n(57475),d=n(10941),f=n(90904),p=n(65988).f,h=n(3610).forEach,g=n(55746),_=n(45402),m=_.set,v=_.getterFor;e.exports=function(e,t,n){var _,y=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),E=y?"set":"add",C=i[e],T=C&&C.prototype,D={};if(g&&c(C)&&(b||T.forEach&&!a((function(){(new C).entries().next()})))){var w=(_=t((function(t,n){m(u(t,w),{type:e,collection:new C}),null!=n&&l(n,t[E],{that:t,AS_ENTRIES:y})}))).prototype,S=v(e);h(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in T)||b&&"clear"==e||s(w,e,(function(n,r){var i=S(this).collection;if(!t&&b&&!d(n))return"get"==e&&void 0;var o=i[e](0===n?0:n,r);return t?this:o}))})),b||p(w,"size",{configurable:!0,get:function(){return S(this).collection.size}})}else _=n.getConstructor(t,e,y,E),o.enable();return f(_,e,!1,!0),D[e]=_,r({global:!0,forced:!0},D),b||n.setStrong(_,e,y),_}},64160:function(e,t,n){var r=n(95981);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},23538:function(e){e.exports=function(e,t){return{value:e,done:t}}},32029:function(e,t,n){var r=n(55746),i=n(65988),o=n(31887);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},31887:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},55449:function(e,t,n){"use strict";var r=n(83894),i=n(65988),o=n(31887);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n}},95929:function(e,t,n){var r=n(32029);e.exports=function(e,t,n,i){return i&&i.enumerable?e[t]=n:r(e,t,n),e}},94380:function(e,t,n){var r=n(95929);e.exports=function(e,t,n){for(var i in t)n&&n.unsafe&&e[i]?e[i]=t[i]:r(e,i,t[i],n);return e}},75609:function(e,t,n){var r=n(21899),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},55746:function(e,t,n){var r=n(95981);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},76616:function(e){var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},61333:function(e,t,n){var r=n(21899),i=n(10941),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},66796:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},63281:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},2861:function(e,t,n){var r=n(626);e.exports=r("navigator","userAgent")||""},53385:function(e,t,n){var r,i,o=n(21899),a=n(2861),s=o.process,l=o.Deno,u=s&&s.versions||l&&l.version,c=u&&u.v8;c&&(i=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},35703:function(e,t,n){var r=n(54058);e.exports=function(e){return r[e+"Prototype"]}},56759:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},76887:function(e,t,n){"use strict";var r=n(21899),i=n(79730),o=n(97484),a=n(57475),s=n(49677).f,l=n(37252),u=n(54058),c=n(86843),d=n(32029),f=n(90953),p=function(e){var t=function(n,r,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,o)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,i,h,g,_,m,v,y,b=e.target,E=e.global,C=e.stat,T=e.proto,D=E?r:C?r[b]:(r[b]||{}).prototype,w=E?u:u[b]||d(u,b,{})[b],S=w.prototype;for(h in t)n=!l(E?h:b+(C?".":"#")+h,e.forced)&&D&&f(D,h),_=w[h],n&&(m=e.dontCallGetSet?(y=s(D,h))&&y.value:D[h]),g=n&&m?m:t[h],n&&typeof _==typeof g||(v=e.bind&&n?c(g,r):e.wrap&&n?p(g):T&&a(g)?o(g):g,(e.sham||g&&g.sham||_&&_.sham)&&d(v,"sham",!0),d(w,h,v),T&&(f(u,i=b+"Prototype")||d(u,i,{}),d(u[i],h,g),e.real&&S&&!S[h]&&d(S,h,g)))}},95981:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},45602:function(e,t,n){var r=n(95981);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},79730:function(e,t,n){var r=n(18285),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},86843:function(e,t,n){var r=n(97484),i=n(24883),o=n(18285),a=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},18285:function(e,t,n){var r=n(95981);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},98308:function(e,t,n){"use strict";var r=n(95329),i=n(24883),o=n(10941),a=n(90953),s=n(93765),l=n(18285),u=Function,c=r([].concat),d=r([].join),f={},p=function(e,t,n){if(!a(f,t)){for(var r=[],i=0;iv;v++)if((b=k(e[v]))&&u(g,b))return b;return new h(!1)}_=c(e,m)}for(E=w?e.next:_.next;!(C=i(E,_)).done;){try{b=k(C.value)}catch(e){f(_,"throw",e)}if("object"==typeof b&&b&&u(g,b))return b}return new h(!1)}},7609:function(e,t,n){var r=n(78834),i=n(96059),o=n(14229);e.exports=function(e,t,n){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw n;if(s)throw a;return i(a),n}},53847:function(e,t,n){"use strict";var r=n(35143).IteratorPrototype,i=n(29290),o=n(31887),a=n(90904),s=n(12077),l=function(){return this};e.exports=function(e,t,n,u){var c=t+" Iterator";return e.prototype=i(r,{next:o(+!u,n)}),a(e,c,!1,!0),s[c]=l,e}},75105:function(e,t,n){"use strict";var r=n(76887),i=n(78834),o=n(82529),a=n(79417),s=n(57475),l=n(53847),u=n(249),c=n(88929),d=n(90904),f=n(32029),p=n(95929),h=n(99813),g=n(12077),_=n(35143),m=a.PROPER,v=a.CONFIGURABLE,y=_.IteratorPrototype,b=_.BUGGY_SAFARI_ITERATORS,E=h("iterator"),C="keys",T="values",D="entries",w=function(){return this};e.exports=function(e,t,n,a,h,_,S){l(n,t,a);var O,A,I,k=function(e){if(e===h&&N)return N;if(!b&&e in P)return P[e];switch(e){case C:case T:case D:return function(){return new n(this,e)}}return function(){return new n(this)}},M=t+" Iterator",x=!1,P=e.prototype,R=P[E]||P["@@iterator"]||h&&P[h],N=!b&&R||k(h),L="Array"==t&&P.entries||R;if(L&&(O=u(L.call(new e)))!==Object.prototype&&O.next&&(o||u(O)===y||(c?c(O,y):s(O[E])||p(O,E,w)),d(O,M,!0,!0),o&&(g[M]=w)),m&&h==T&&R&&R.name!==T&&(!o&&v?f(P,"name",T):(x=!0,N=function(){return i(R,this)})),h)if(A={values:k(T),keys:_?N:k(C),entries:k(D)},S)for(I in A)(b||x||!(I in P))&&p(P,I,A[I]);else r({target:t,proto:!0,forced:b||x},A);return o&&!S||P[E]===N||p(P,E,N,{name:h}),g[t]=N,A}},35143:function(e,t,n){"use strict";var r,i,o,a=n(95981),s=n(57475),l=n(10941),u=n(29290),c=n(249),d=n(95929),f=n(99813),p=n(82529),h=f("iterator"),g=!1;[].keys&&("next"in(o=[].keys())?(i=c(c(o)))!==Object.prototype&&(r=i):g=!0),!l(r)||a((function(){var e={};return r[h].call(e)!==e}))?r={}:p&&(r=u(r)),s(r[h])||d(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:g}},12077:function(e){e.exports={}},10623:function(e,t,n){var r=n(43057);e.exports=function(e){return r(e.length)}},48721:function(e,t,n){"use strict";var r=n(78834),i=n(24883),o=n(96059);e.exports=function(e,t){var n,a,s=o(this),l=i(s.get),u=i(s.has),c=i(s.set);return r(u,s,e)?(n=r(l,s,e),"update"in t&&(n=t.update(n,e,s),r(c,s,e,n)),n):(a=t.insert(e,s),r(c,s,e,a),a)}},20716:function(e,t,n){"use strict";var r=n(78834),i=n(24883),o=n(57475),a=n(96059),s=TypeError;e.exports=function(e,t){var n,l=a(this),u=i(l.get),c=i(l.has),d=i(l.set),f=arguments.length>2?arguments[2]:void 0;if(!o(t)&&!o(f))throw s("At least one callback required");return r(c,l,e)?(n=r(u,l,e),o(t)&&(n=t(n),r(d,l,e,n))):o(f)&&(n=f(),r(d,l,e,n)),n}},35331:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},24420:function(e,t,n){"use strict";var r=n(55746),i=n(95329),o=n(78834),a=n(95981),s=n(14771),l=n(87857),u=n(36760),c=n(89678),d=n(37026),f=Object.assign,p=Object.defineProperty,h=i([].concat);e.exports=!f||a((function(){if(r&&1!==f({b:1},f(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=f({},e)[n]||s(f({},t)).join("")!=i}))?function(e,t){for(var n=c(e),i=arguments.length,a=1,f=l.f,p=u.f;i>a;)for(var g,_=d(arguments[a++]),m=f?h(s(_),f(_)):s(_),v=m.length,y=0;v>y;)g=m[y++],r&&!o(p,_,g)||(n[g]=_[g]);return n}:f},29290:function(e,t,n){var r,i=n(96059),o=n(59938),a=n(56759),s=n(27748),l=n(15463),u=n(61333),c=n(44262),d=c("IE_PROTO"),f=function(){},p=function(e){return"