/*! * widgets * @version: 9.0.018.10 * @copyright: Copyright © 2024 Genesys. All rights reserved. * @license: Genesys Telecom Labs */ widgetsJsonpFunction([0],{"./node_modules/css-loader/index.js!./node_modules/less-loader/dist/cjs.js!./webapp/plugins/cx-webchat/less/cx-webchat.less":function(e,t,a){t=e.exports=a("./node_modules/css-loader/lib/css-base.js")(!1),t.push([e.i,".cx-webchat{position:fixed;bottom:0;width:320px;z-index:999997}.cx-webchat .cx-body{padding:0;overflow:visible;position:relative}.cx-webchat .cx-parentDisable{opacity:.2}.cx-webchat .cx-spinner{display:none;z-index:2;position:relative;top:100%;left:45%}.cx-webchat .cx-history-loading{padding:16px}.cx-webchat .cx-history-loading .cx-loading-icon{width:26px;height:26px;top:14px;left:-16px}.cx-webchat i.fonticon.icon-alert-triangle{color:#f8a740;display:inline}.cx-webchat p.cx-reason{display:inline}.cx-webchat .cx-hidden-message{display:none}.cx-webchat.cx-minimized .cx-body,.cx-webchat.cx-minimized .cx-footer{display:none!important}.cx-webchat.cx-mobile.cx-minimized{height:auto!important}.cx-webchat.cx-mobile{top:inherit!important;right:inherit!important;bottom:0!important;left:0!important;height:100%!important;width:100%!important}.cx-webchat.cx-mobile .cx-form{border-width:0;border-style:none;padding:24px;overflow:hidden;-webkit-overflow-scrolling:touch}.cx-webchat.cx-mobile .cx-footer{display:none}@media screen and (min-device-width:360px) and (max-device-height:640px) and (-webkit-min-device-pixel-ratio:2) and (orientation:landscape),screen and (min-device-width:1200px){.cx-webchat.cx-mobile .cx-tooltip-menu{right:40px}}@-moz-document url-prefix(){@media screen and (min--moz-device-pixel-ratio:2) and (orientation:landscape){.cx-webchat.cx-mobile .cx-tooltip-menu{right:40px}}}.cx-webchat.cx-mobile .ie10up .cx-tooltip-menu,.cx-webchat.cx-mobile _:-ms-lang(x) .cx-tooltip-menu{right:40px}.cx-webchat.cx-mobile.cx-transcript-view .cx-footer{display:none!important}.cx-webchat.cx-theme-light .cx-message.cx-you .cx-bubble{background-color:#f2f4f7}.cx-webchat.cx-theme-light .cx-message.cx-them .cx-bubble{background-color:#ffc7b9}.cx-webchat.cx-theme-light .cx-message.cx-you .cx-bubble-arrow svg *{fill:#f2f4f7}.cx-webchat.cx-theme-light .cx-message.cx-them .cx-bubble-arrow svg *{fill:#ffc7b9}.cx-webchat.cx-theme-light .cx-time{color:#5c5c5b}.cx-webchat.cx-theme-light .cx-bubble-arrow svg{fill:#f2f4f7}.cx-webchat.cx-theme-light .cx-menu .cx-branding-icon svg *{fill:#8794ac}.cx-webchat.cx-theme-light .cx-input-container .cx-menu li .cx-char-count:focus,.cx-webchat.cx-theme-light .cx-input-container .cx-menu li .cx-icon:focus svg{border:1px solid #5292fc;border-width:2px}.cx-webchat.cx-theme-light .cx-input-container .cx-emoji-menu li,.cx-webchat.cx-theme-light .cx-input-container .cx-menu li{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cx-webchat.cx-theme-light .cx-carousel .cx-next,.cx-webchat.cx-theme-light .cx-carousel .cx-previous{border-color:#8795a6}.cx-webchat.cx-theme-light .cx-carousel .cx-next:focus,.cx-webchat.cx-theme-light .cx-carousel .cx-previous:focus{border-color:#5292fc}.cx-webchat.cx-theme-light .cx-menu li .cx-char-count{color:#75757b}.cx-webchat.cx-theme-light .cx-char-count.cx-warning{color:#ea0b2e!important}.cx-webchat.cx-theme-light .cx-emoji-item:hover{background-color:#dfdfdf}.cx-webchat.cx-theme-light .cx-emoji-item:active{background-color:#ccc}.cx-webchat.cx-theme-dark .cx-menu .cx-branding-icon svg *{fill:#98a7b8}.cx-webchat.cx-theme-dark .cx-char-count.cx-warning{color:#f9768c!important}.cx-webchat.cx-theme-dark .cx-transcript .cx-filename,.cx-webchat.cx-theme-dark .cx-transcript .cx-filesize,.cx-webchat.cx-theme-dark .cx-transcript .cx-message-text,.cx-webchat.cx-theme-dark .cx-transcript .cx-name{color:#fdfdfd!important}.cx-webchat.cx-theme-dark .cx-transcript .cx-message{border-color:#222529}.cx-webchat.cx-theme-dark .cx-transcript .cx-message.cx-you .cx-bubble{background-color:#4a525b}.cx-webchat.cx-theme-dark .cx-transcript .cx-message.cx-them .cx-bubble{background-color:#3168d2}.cx-webchat.cx-theme-dark .cx-transcript .cx-message.cx-you .cx-bubble-arrow svg *{fill:#4a525b}.cx-webchat.cx-theme-dark .cx-transcript .cx-message.cx-them .cx-bubble-arrow svg *{fill:#3168d2}.cx-webchat.cx-theme-dark .cx-transcript .cx-time{color:#fff}.cx-webchat.cx-theme-dark .cx-alert>.cx-wrapper{background-color:#33383d;border-color:#222529;color:#fdfdfd}.cx-webchat.cx-theme-dark .cx-alert b.cx-link{color:#3963b8;word-break:break-all}.cx-webchat.cx-theme-dark .cx-webchat-smokescreen{background-color:#33383d}.cx-webchat.cx-theme-dark .cx-webchat .cx-tooltip-menu.cx-emoji .cx-option{color:#33383d}.cx-webchat.cx-theme-dark .cx-input-container .cx-menu li .cx-char-count:focus,.cx-webchat.cx-theme-dark .cx-input-container .cx-menu li .cx-icon:focus svg{border:1px solid #75a8ff;border-width:2px}.cx-webchat.cx-theme-dark .cx-input-container .cx-emoji-menu li,.cx-webchat.cx-theme-dark .cx-input-container .cx-menu li{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cx-webchat.cx-theme-dark .cx-carousel .cx-next:focus,.cx-webchat.cx-theme-dark .cx-carousel .cx-previous:focus{border-color:#75a8ff}.cx-webchat.cx-theme-dark .cx-emoji-item:hover{background-color:#444a52}.cx-webchat.cx-theme-dark .cx-emoji-item:active{background-color:#666f7a}.cx-webchat *{box-sizing:border-box}.cx-webchat .cx-alert{display:none;z-index:999999;position:absolute;top:0;left:0;width:100%}.cx-webchat .cx-alert.cx-normal-alert .cx-buttons-binary{display:none}.cx-webchat .cx-alert.cx-normal-alert .cx-button-single{display:block;text-align:center}.cx-webchat .cx-alert.cx-binary-alert .cx-binary-button{display:block}.cx-webchat .cx-alert.cx-binary-alert .cx-button-single{display:none}.cx-webchat .cx-alert>.cx-wrapper{margin:0 16px;background-color:#fff;padding:0 24px 24px;border:1px solid #eee}.cx-webchat .cx-alert>.cx-wrapper .cx-warning{padding-top:12px}.cx-webchat .cx-alert>.cx-wrapper .cx-warning .cx-icon{display:inline-block;vertical-align:bottom;height:24px;width:24px}.cx-webchat .cx-alert.cx-async-chat-end{position:relative}.cx-webchat .cx-webchat-smokescreen{background-color:#fff;opacity:.8;z-index:999998}.cx-webchat .cx-overlay,.cx-webchat .cx-webchat-smokescreen{display:none;height:100%;position:absolute;top:0;left:0;width:100%}.cx-webchat .cx-overlay{background-color:inherit;padding:20px;z-index:999999;-webkit-box-shadow:0 8px 11px -4px rgba(0,0,0,.3);box-shadow:0 8px 11px -4px rgba(0,0,0,.3)}.cx-webchat .cx-form{padding:24px 24px 0;border-width:0}.cx-webchat .cx-form table{width:100%;margin-bottom:16px}.cx-webchat .cx-form table td{width:100%;padding:4px 0}.cx-webchat .cx-form table th{padding-right:8px}.cx-webchat .cx-form .cx-button-group{padding-bottom:0}.cx-webchat .cx-form .cx-form-group{margin-bottom:8px}.cx-webchat .cx-form th .cx-control-label{white-space:nowrap!important}.cx-webchat .cx-form-wrapper{overflow:auto;position:relative;-webkit-overflow-scrolling:touch}.cx-webchat .cx-transcript{overflow-y:auto;overflow-x:hidden;height:312px;font-size:.75em;line-height:18px;display:none;-webkit-overflow-scrolling:touch;overscroll-behavior:none;position:relative;font-weight:300;padding:0 24px}.cx-webchat .cx-transcript .cx-push-url a{color:#75a8ff!important}.cx-webchat .cx-transcript .cx-message{min-height:48px;margin:0;box-sizing:border-box;position:relative}.cx-webchat .cx-transcript .cx-message .cx-bubble{padding:10px 15px;padding:16px}.cx-webchat .cx-transcript .cx-message .cx-bubble-arrow{position:absolute;top:12px}.cx-webchat .cx-transcript .cx-message .cx-name{font-weight:bolder;color:#222;padding-right:5px;display:inline-block;width:100%;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}.cx-webchat .cx-transcript .cx-message .cx-time{display:block;font-size:.92em}.cx-webchat .cx-transcript .cx-message.cx-date{text-align:center;min-height:18px;line-height:12px;padding:3px 12px;border:1px solid #dae1e8;border-radius:14px;max-width:fit-content;margin:12px auto;display:table}.cx-webchat .cx-transcript .cx-message .cx-message-text{word-wrap:break-word;display:block}.cx-webchat .cx-transcript .cx-message .cx-message-text>p{margin:0;white-space:pre-line}@-moz-document url-prefix(){.cx-webchat .cx-transcript .cx-message .cx-message-text>p{white-space:pre-wrap}}.cx-webchat .cx-transcript .cx-message .cx-message-text>p img{width:100%}.cx-webchat .cx-transcript .cx-message .cx-avatar-wrapper{width:24px;position:absolute;top:2px}.cx-webchat .cx-transcript .cx-message .cx-avatar img{width:auto;height:100%}.cx-webchat .cx-transcript .cx-message>div.cx-NewTextBubble{-webkit-animation:NewTextBubble .5s 1;animation:NewTextBubble .5s 1}.cx-webchat .cx-transcript .cx-avatar{height:24px;width:24px}.cx-webchat .cx-transcript .cx-name{font-weight:bolder;color:#222;white-space:nowrap;text-overflow:ellipsis}.cx-webchat .cx-transcript .cx-time{font-size:11px;display:block;margin-bottom:5px}.cx-webchat .cx-transcript .cx-rich-message .cx-avatar{float:left}.cx-webchat .cx-transcript .cx-rich-message .cx-name{display:inline-block;margin:5px 0 0 10px}.cx-webchat .cx-transcript .cx-message.cx-system{background:none;padding:0;margin:13px 0}.cx-webchat .cx-transcript .cx-message.cx-system .cx-message-text,.cx-webchat .cx-transcript .cx-message.cx-system .cx-time{min-height:18px}.cx-webchat .cx-transcript .cx-message.cx-system .cx-bubble{padding:0;background-color:transparent}.cx-webchat .cx-transcript .cx-message.cx-system .cx-avatar-wrapper,.cx-webchat .cx-transcript .cx-message.cx-system .cx-bubble-arrow,.cx-webchat .cx-transcript .cx-message.cx-system .cx-name{display:none}.cx-webchat .cx-transcript .cx-message.cx-them{border:0;color:#000;padding:6px 0;text-align:left}.cx-webchat .cx-transcript .cx-message.cx-them .cx-bubble{margin-left:40px;text-align:left;margin-top:0;border-radius:0 14px 14px 14px}.cx-webchat .cx-transcript .cx-message.cx-them .cx-bubble-arrow{left:33px}.cx-webchat .cx-transcript .cx-message.cx-them .cx-bubble-arrow .cx-right{display:none}.cx-webchat .cx-transcript .cx-message.cx-them .cx-avatar-wrapper{left:0}.cx-webchat .cx-transcript .cx-message.cx-you{border:0;color:#000;padding:6px 0;text-align:right}.cx-webchat .cx-transcript .cx-message.cx-you .cx-name{display:none}.cx-webchat .cx-transcript .cx-message.cx-you .cx-bubble{margin-top:0;margin-right:7px;text-align:left;border-radius:14px 0 14px 14px}.cx-webchat .cx-transcript .cx-message.cx-you .cx-bubble-arrow{right:-7px}.cx-webchat .cx-transcript .cx-message.cx-you .cx-avatar-wrapper,.cx-webchat .cx-transcript .cx-message.cx-you .cx-bubble-arrow .cx-left{display:none}.cx-webchat .cx-transcript .cx-message.cx-injected{border:0;padding:6px 0}.cx-webchat .cx-transcript .cx-message-group>.cx-message{padding:0!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant{margin-bottom:6px!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant .cx-avatar-wrapper,.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant .cx-bubble-arrow,.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant .cx-name,.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant .cx-time{display:none!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant .cx-bubble{border-radius:10px;margin:0 0 0 40px}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant.cx-them:first-child .cx-avatar-wrapper{display:block!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant.cx-you .cx-bubble{margin:0!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:first-child .cx-bubble-arrow,.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:first-child .cx-name{display:block!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:first-child .cx-bubble{border-top-left-radius:14px!important;border-top-right-radius:14px!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:last-child .cx-time{display:block!important}.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:last-child .cx-bubble{border-bottom-left-radius:14px!important;border-bottom-right-radius:14px!important}.cx-webchat .cx-isTyping{color:#222;font-size:.6875em;font-style:italic}.cx-webchat div.cx-input-container{display:none;width:100%;padding:14px 16px 14px 24px;border-width:1px;border-style:solid}.cx-webchat div.cx-input-container .cx-textarea-cell{position:relative}.cx-webchat div.cx-input-container .cx-message-input{width:100%;resize:none;height:20px;line-height:20px;font-size:.75em;margin-bottom:14px;padding:0;font-weight:400;overflow:hidden;border:0;background-color:transparent;padding-right:40px}.cx-webchat div.cx-input-container .cx-input.cx-disabled{opacity:.5}.cx-webchat .cx-settings-group{display:none}.cx-webchat .cx-end{color:#fff;line-height:2.5625em;text-align:right;height:40px;position:absolute;top:13px;right:24px;-webkit-transition:opacity .22s ease-in-out;-moz-transition:opacity .22s ease-in-out;-o-transition:opacity .22s ease-in-out;transition:opacity .22s ease-in-out;display:none;display:none!important}.cx-webchat .cx-end:hover{cursor:pointer;opacity:.8;opacity:1}.cx-webchat .cx-send{height:20px;width:24px;top:0}.cx-webchat .cx-send,.cx-webchat .cx-start-cobrowse{display:none;position:absolute;right:0;cursor:pointer}.cx-webchat .cx-start-cobrowse{bottom:114px;background-color:#e3b33b;padding:3px 3px 3px 4px;border-radius:5px 0 0 0;color:#fff;font-size:.8125em}.cx-webchat .cx-a-disabled{color:currentColor;display:inline-block;pointer-events:none;text-decoration:none;cursor:not-allowed;opacity:.5;outline:none}.cx-webchat .cx-scroll-disabled{overflow:hidden}.cx-webchat .cx-countdown{font-size:2em}.cx-webchat-counter{display:none}.cx-webchat.cx-minimized .cx-webchat-counter{display:inline-block;border-radius:5px;background-color:#e3264f;color:#fff;font-size:.625em;padding:4px;text-align:center;margin-left:12px;cursor:pointer;min-width:25px;float:right}.cx-widget p .cx-file-transfer-block{display:block;height:110px}.cx-widget .cx-parentDisable{opacity:.2}.cx-widget span.cx-user-detail.cx-name{vertical-align:middle}.cx-widget .cx-user-detail .cx-filesentmsg,.cx-widget span.cx-user-detail.cx-name{width:auto!important;display:inline-block!important}.cx-widget .cx-filename{display:block}.cx-widget .cx-warning .cx-reason>strong>p.filename{margin-left:26px;margin-bottom:10px;margin-top:10px}.cx-widget .cx-warning .cx-reason .cx-advice{margin-left:28px}.cx-widget .cx-lastrow{display:inline-block;clear:both}.cx-widget .cx-lastrow>span{display:inline-block}.cx-widget .cx-download-btn{margin-top:4px!important;padding:5px!important;max-height:30px;width:80px;font-size:1em}.cx-widget .cx-filesize{margin-left:20px}.cx-widget.cx-webchat-chat-button{right:0;top:40%;font-weight:700;padding:10px 10px 4px!important;cursor:pointer}.cx-widget.cx-webchat-chat-button .cx-icon{height:23px;width:23px;margin-right:2px;display:inline-block}.cx-widget.cx-webchat-chat-button>span{white-space:nowrap;margin-bottom:-6px}.cx-widget.cx-webchat-chat-button .cx-chat-button-label{vertical-align:super}.cx-webchat.cx-mobile .cx-message-input{margin-top:10px!important;margin-bottom:16px!important;padding-right:51px!important;font-size:1em!important;line-height:1.125em!important;overflow:auto!important}.cx-webchat.cx-mobile .cx-send{right:16px}.cx-webchat.cx-mobile .cx-menu>li>.cx-menu-item{height:24px;width:24px;margin-right:20px}.cx-webchat.cx-mobile .cx-input-container{padding-top:6px!important;padding:14px 0 14px 24px!important}.cx-webchat.cx-mobile.cx-landscape .cx-message-input{margin-bottom:10px!important;padding-right:60px!important}.cx-webchat.cx-mobile.cx-landscape .cx-textarea-cell{width:100%}.cx-webchat.cx-mobile.cx-landscape .cx-branding-icon{position:relative!important;right:auto!important}.cx-webchat.cx-mobile.cx-landscape .cx-input-container{display:flex!important;padding-bottom:6px!important}.cx-webchat.cx-mobile.cx-landscape .cx-send{top:9px;right:24px}.cx-webchat.cx-mobile.cx-landscape .cx-menu-cell{margin-top:7px}.cx-webchat .cx-menu{display:flex;list-style:none;margin:0;padding:0;width:100%;min-height:16px}.cx-webchat .cx-menu>li>.cx-menu-item{display:inline-block;list-style:none;height:20px;width:20px;padding:2px;margin-right:18px;cursor:pointer;outline-style:none}.cx-webchat .cx-menu>li>.cx-menu-item:focus{padding:1px}.cx-webchat .cx-menu li:last-child{margin-right:0}.cx-webchat .cx-menu li .cx-inert{cursor:default}.cx-webchat .cx-menu li .cx-char-count{width:auto;font-style:italic;font-size:.6875em;line-height:18px;color:#aaa}.cx-webchat .cx-menu li .cx-branding-icon{position:absolute;right:10px}.cx-webchat .cx-menu li .cx-icon.cx-disabled:not(.cx-branding-icon){pointer-events:none;opacity:.5}.cx-webchat.cx-disabled .cx-char-count,.cx-webchat.cx-disabled .cx-message-input,.cx-webchat.cx-disabled .cx-send{visibility:hidden}.cx-webchat.cx-disabled .cx-input-container .cx-icon{opacity:.5}.cx-webchat.cx-disabled .cx-menu{pointer-events:none}.cx-webchat.cx-disabled.cx-theme-dark .cx-input-container{background:#4a525b;pointer-events:none}.cx-webchat.cx-disabled.cx-theme-light .cx-input-container{background:#f2f4f7;pointer-events:none}.cx-webchat .cx-emoji-menu{white-space:nowrap;border:1px solid;padding:0;margin:0 0 14px}.cx-webchat .cx-emoji-menu li,.cx-webchat .cx-emoji-menu span{padding:15px 5px;display:inline-block}.cx-webchat .cx-emoji-menu li:first-child,.cx-webchat .cx-emoji-menu span:first-child{padding-left:10px}.cx-webchat .cx-emoji-menu li:last-child,.cx-webchat .cx-emoji-menu span:last-child{padding-right:10px}.cx-emoji-selection-menu,.cx-tooltip-menu{display:inline-block;position:relative;outline-style:none}.cx-emoji-selection-menu{bottom:0;left:0;max-height:128px;overflow:auto;border-top:1px solid}.cx-webchat .cx-emoji-table{overflow-y:auto;overflow-x:hidden;padding:0;margin:0}.cx-webchat .cx-emoji-table .cx-emoji-item{padding:6px 6px 3px;display:inline-block;cursor:pointer;font-size:25px;width:12.5%;text-align:center}.cx-webchat .cx-overlay .cx-idle-alert{font-size:.75em;text-align:center}.cx-webchat.cx-mobile .cx-overlay .cx-idle-alert{font-size:.875em}.cx-webchat .cx-overlay .cx-idle-countdown{text-align:center;padding:10px}@keyframes NewMessage{to{background-color:#2293f9!important}}@-webkit-keyframes NewMessage{to{background-color:#2293f9!important}}@keyframes NewTextBubble{0%{opacity:0}to{opacity:1}}@-webkit-keyframes NewTextBubble{0%{opacity:0}to{opacity:1}}.cx-emoji-hasmenu{height:20px}.cx-emoji-wrapper{width:20px}",""])},"./node_modules/marked/lib/marked.js":function(e,t,a){(function(t){!function(t){"use strict";function a(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||f.defaults,this.rules=w.normal,this.options.pedantic?this.rules=w.pedantic:this.options.gfm&&(this.options.tables?this.rules=w.tables:this.rules=w.gfm)}function n(e,t){if(this.options=t||f.defaults,this.links=e,this.rules=v.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=v.pedantic:this.options.gfm&&(this.options.breaks?this.rules=v.breaks:this.rules=v.gfm)}function i(e){this.options=e||f.defaults}function r(){}function c(e){this.tokens=[],this.token=null,this.options=e||f.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new o}function o(){this.seen={}}function s(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,function(e){return s.replacements[e]})}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,function(e){return s.replacements[e]});return e}function l(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function d(e,t){return e=e.source||e,t=t||"",{replace:function(t,a){return a=a.source||a,a=a.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,a),this},getRegex:function(){return new RegExp(e,t)}}}function p(e,t,a){if(e){try{var n=decodeURIComponent(l(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!k.test(a)&&(a=x(t,a));try{a=encodeURI(a).replace(/%25/g,"%")}catch(e){return null}return a}function x(e,t){return y[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?y[" "+e]=e+"/":y[" "+e]=b(e,"/",!0)),e=y[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function u(){}function m(e){for(var t,a,n=1;n=0&&"\\"===a[i];)n=!n;return n?"|":" |"}),n=a.split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.lengthAn error occurred:

"+s(e.message+"",!0)+"
";throw e}}var w={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:u,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:u,lheading:/^([^\n]+)\n {0,3}(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};w._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,w._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,w.def=d(w.def).replace("label",w._label).replace("title",w._title).getRegex(),w.bullet=/(?:[*+-]|\d{1,9}\.)/,w.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,w.item=d(w.item,"gm").replace(/bull/g,w.bullet).getRegex(),w.list=d(w.list).replace(/bull/g,w.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+w.def.source+")").getRegex(),w._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",w._comment=//,w.html=d(w.html,"i").replace("comment",w._comment).replace("tag",w._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),w.paragraph=d(w.paragraph).replace("hr",w.hr).replace("heading",w.heading).replace("lheading",w.lheading).replace("tag",w._tag).getRegex(),w.blockquote=d(w.blockquote).replace("paragraph",w.paragraph).getRegex(),w.normal=m({},w),w.gfm=m({},w.normal,{fences:/^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),w.gfm.paragraph=d(w.paragraph).replace("(?!","(?!"+w.gfm.fences.source.replace("\\1","\\2")+"|"+w.list.source.replace("\\1","\\3")+"|").getRegex(),w.tables=m({},w.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),w.pedantic=m({},w.normal,{html:d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",w._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),a.rules=w,a.lex=function(e,t){return new a(t).lex(e)},a.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},a.prototype.token=function(e,t){e=e.replace(/^ +$/gm,"");for(var a,n,i,r,c,o,s,l,d,p,x,u,m,g,f,v;e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e)){var y=this.tokens[this.tokens.length-1];e=e.substring(i[0].length),y&&"paragraph"===y.type?y.text+="\n"+i[0].trimRight():(i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?i:b(i,"\n")}))}else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2]?i[2].trim():i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if((i=this.rules.nptable.exec(e))&&(o={type:"table",header:h(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]},o.header.length===o.align.length)){for(e=e.substring(i[0].length),x=0;x ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),r=i[2],g=r.length>1,s={type:"list_start",ordered:g,start:g?+r:"",loose:!1},this.tokens.push(s),i=i[0].match(this.rules.item),l=[],a=!1,m=i.length,x=0;x1?1===c.length:c.length>1||this.options.smartLists&&c!==r)&&(e=i.slice(x+1).join("\n")+e,x=m-1)),n=a||/\n\n(?!\s*$)/.test(o),x!==m-1&&(a="\n"===o.charAt(o.length-1),n||(n=a)),n&&(s.loose=!0),f=/^\[[ xX]\] /.test(o),v=void 0,f&&(v=" "!==o[1],o=o.replace(/^\[[ xX]\] +/,"")),d={type:"list_item_start",task:f,checked:v,loose:n},l.push(d),this.tokens.push(d),this.token(o,!1),this.tokens.push({type:"list_item_end"});if(s.loose)for(m=l.length,x=0;x?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:u,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:u,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~",v.em=d(v.em).replace(/punctuation/g,v._punctuation).getRegex(),v._escapes=/\\([!"#$%&'()*+,\-.\/:;<=>?@\[\]\\^_`{|}~])/g,v._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,v._email=/[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,v.autolink=d(v.autolink).replace("scheme",v._scheme).replace("email",v._email).getRegex(),v._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,v.tag=d(v.tag).replace("comment",w._comment).replace("attribute",v._attribute).getRegex(),v._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/,v._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/,v._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,v.link=d(v.link).replace("label",v._label).replace("href",v._href).replace("title",v._title).getRegex(),v.reflink=d(v.reflink).replace("label",v._label).getRegex(),v.normal=m({},v),v.pedantic=m({},v.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",v._label).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",v._label).getRegex()}),v.gfm=m({},v.normal,{escape:d(v.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\/i.test(c[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(c[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(c[0])&&(this.inRawBlock=!1),e=e.substring(c[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(c[0]):s(c[0]):c[0];else if(c=this.rules.link.exec(e)){var d=g(c[2],"()");if(d>-1){var p=c[0].length-(c[2].length-d)-(c[3]||"").length;c[2]=c[2].substring(0,d),c[0]=c[0].substring(0,p).trim(),c[3]=""}e=e.substring(c[0].length),this.inLink=!0,i=c[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i),t?(i=t[1],r=t[3]):r=""):r=c[3]?c[3].slice(1,-1):"",i=i.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=this.outputLink(c,{href:n.escapes(i),title:n.escapes(r)}),this.inLink=!1}else if((c=this.rules.reflink.exec(e))||(c=this.rules.nolink.exec(e))){if(e=e.substring(c[0].length),t=(c[2]||c[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){l+=c[0].charAt(0),e=c[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(c,t),this.inLink=!1}else if(c=this.rules.strong.exec(e))e=e.substring(c[0].length),l+=this.renderer.strong(this.output(c[4]||c[3]||c[2]||c[1]));else if(c=this.rules.em.exec(e))e=e.substring(c[0].length),l+=this.renderer.em(this.output(c[6]||c[5]||c[4]||c[3]||c[2]||c[1]));else if(c=this.rules.code.exec(e))e=e.substring(c[0].length),l+=this.renderer.codespan(s(c[2].trim(),!0));else if(c=this.rules.br.exec(e))e=e.substring(c[0].length),l+=this.renderer.br();else if(c=this.rules.del.exec(e))e=e.substring(c[0].length),l+=this.renderer.del(this.output(c[1]));else if(c=this.rules.autolink.exec(e))e=e.substring(c[0].length),"@"===c[2]?(a=s(this.mangle(c[1])),i="mailto:"+a):(a=s(c[1]),i=a),l+=this.renderer.link(i,null,a);else if(this.inLink||!(c=this.rules.url.exec(e))){if(c=this.rules.text.exec(e))e=e.substring(c[0].length),this.inRawBlock?l+=this.renderer.text(c[0]):l+=this.renderer.text(s(this.smartypants(c[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===c[2])a=s(c[0]),i="mailto:"+a;else{do{o=c[0],c[0]=this.rules._backpedal.exec(c[0])[0]}while(o!==c[0]);a=s(c[0]),i="www."===c[1]?"http://"+a:a}e=e.substring(c[0].length),l+=this.renderer.link(i,null,a)}return l},n.escapes=function(e){return e?e.replace(n.rules._escapes,"$1"):e},n.prototype.outputLink=function(e,t){var a=t.href,n=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(a,n,this.output(e[1])):this.renderer.image(a,n,s(e[1]))},n.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},n.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,a="",n=e.length,i=0;i.5&&(t="x"+t.toString(16)),a+="&#"+t+";";return a},i.prototype.code=function(e,t,a){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,n);null!=i&&i!==e&&(a=!0,e=i)}return n?'
'+(a?e:s(e,!0))+"
\n":"
"+(a?e:s(e,!0))+"
"},i.prototype.blockquote=function(e){return"
\n"+e+"
\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,a,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},i.prototype.list=function(e,t,a){var n=t?"ol":"ul";return"<"+n+(t&&1!==a?' start="'+a+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.checkbox=function(e){return" "},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var a=t.header?"th":"td";return(t.align?"<"+a+' align="'+t.align+'">':"<"+a+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,a){if(null===(e=p(this.options.sanitize,this.options.baseUrl,e)))return a;var n='"},i.prototype.image=function(e,t,a){if(null===(e=p(this.options.sanitize,this.options.baseUrl,e)))return a;var n=''+a+'":">"},i.prototype.text=function(e){return e},r.prototype.strong=r.prototype.em=r.prototype.codespan=r.prototype.del=r.prototype.text=function(e){return e},r.prototype.link=r.prototype.image=function(e,t,a){return""+a},r.prototype.br=function(){return""},c.parse=function(e,t){return new c(t).parse(e)},c.prototype.parse=function(e){this.inline=new n(e.links,this.options),this.inlineText=new n(e.links,m({},this.options,{renderer:new r})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},c.prototype.next=function(){return this.token=this.tokens.pop(),this.token},c.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},c.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},c.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,l(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,a,n,i="",r="";for(a="",e=0;e?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var a=t;do{this.seen[a]++,t=a+"-"+this.seen[a]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},s.escapeTest=/[&<>"']/,s.escapeReplace=/[&<>"']/g,s.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},s.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,s.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var y={},k=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;u.exec=u,f.options=f.setOptions=function(e){return m(f.defaults,e),f},f.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},f.defaults=f.getDefaults(),f.Parser=c,f.parser=c.parse,f.Renderer=i,f.TextRenderer=r,f.Lexer=a,f.lexer=a.lex,f.InlineLexer=n,f.inlineLexer=n.output,f.Slugger=o,f.parse=f,e.exports=f}(this||"undefined"!=typeof window&&window)}).call(t,a("./node_modules/webpack/buildin/global.js"))},"./webapp/plugins/cx-webchat/cx-webchat.js":function(e,t,a){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t1){var i=t.emojiStringToArray(e);i.forEach(function(e){""!=e.trim()&&n.push({unicode:e})})}else{var r={};r.unicode=a[0],2==a.length&&(r.name=a[1]),n.push(r)}}}),n},C=function(){var e=Rt(".cx-emoji-selection-menu"),t=Rt(".cx-transcript");e.is(":visible")||(e.show(),le.empty().html(v.AriaEmojiStatusOpen),e.find(".cx-emoji-table .cx-emoji-item").eq(0).trigger("focus"),t.height(t.height()-e.height()-1),ft=e.height(),t[0].scrollTop=t[0].scrollTop+ft,e[0].scrollTop=0)},A=function(){var e=Rt(".cx-emoji-selection-menu"),t=Rt(".cx-transcript");e.is(":visible")&&(e.hide(),le.empty().html(v.AriaEmojiStatusClose),t.height(t.height()+ft+1))},S=function(){var a=T.emojiListConfig||T.emojiListI18n||[],n="";if(a.length>0){n=e(f);var i=n.find(".cx-emoji-table");a.forEach(function(t,n){i.append(e('
  • '+t.unicode+"
  • "))}),Rt(".cx-transcript").after(n),n.hide(),Rt(".cx-menu .cx-emoji").on("keydown click",function(a){if(t.validInput(a)&&(je?(n.is(":visible")?(le.empty().html(v.AriaEmojiStatusClose),n.hide()):(le.empty().html(v.AriaEmojiStatusOpen),n.show()),Gt()):n.is(":visible")?A():C()),!a.ctrlKey&&a.which&&(37===a.which||39===a.which||38===a.which||40===a.which)&&document.activeElement===a.currentTarget)if(a.preventDefault(),37===a.which||38===a.which)e(".cx-send").is(":visible")?e(".cx-send").trigger("focus"):e(".cx-message-input").trigger("focus");else if(39===a.which||40===a.which){var i=e(".cx-menu .cx-menu-item[tabindex=0]:visible:not(.cx-emoji)");i.length&&e(i[0]).trigger("focus")}})}else{n=e(g);var r=Rt(".cx-input-container .cx-menu-cell"),c=r.find(".cx-menu .cx-emoji-list-item");Rt(".cx-menu .cx-emoji").tooltipMenu({content:n,ndMenu:c,beforeOpen:function(){return me},onOpen:function(){le.empty().html(v.AriaEmojiStatusOpen),Rt(".cx-emoji-menu [tabindex=-1]").attr("tabindex",0)},onClose:function(){le.empty().html(v.AriaEmojiStatusClose)}}),Ie||r.addClass("cx-emoji-hasmenu")}n&&n.find(".cx-option, .cx-emoji-item").on("keydown click",function(i){if(t.validInput(i)){var r=Rt(".cx-message-input");dt-(r[0].value.length+e(this).text().length)>=0&&r.insertAtCaret(e(this).data("unicode")),r.trigger("focus"),lt&&$a()}if(37===i.which||39===i.which||a.length>0&&(38===i.which||40===i.which||27===i.which)){i.preventDefault();var c=n.find(".cx-option").length?n.find(".cx-option"):n.find(".cx-emoji-item"),o=c.length,s=e(this).index(),l=void 0;37!==i.which&&39!==i.which||(l=39==i.which?s>=o-1?0:s+1:s<=0?o-1:s-1,c.eq(l).trigger("focus")),o>8&&(38===i.which||40===i.which)&&(40==i.which?s+8=o-1&&(l=Math.ceil(o/8)==Math.ceil((s+1)/8)?Math.abs(8*Math.ceil(o/8)-8-s):a.length-1):s-8>=0?l=s-8:s-8<0&&(l=Math.abs(8*Math.ceil(o/8)-8+s))>o-1&&(l=o-1),c.eq(l).trigger("focus")),27==i.which&&(A(),le.empty().html(v.AriaEmojiStatusClose),Y.find(".cx-menu .cx-emoji").focus())}})};y.registerEvents(["ready","opened","closed","minimized","unminimized","cancelled","completed","messageAdded","submitted"]);var T={chatButton:{enabled:!1,template:p,openDelay:1e3,effect:"fade",effectDuration:300,hideDuringInvite:!0},proactive:{enabled:!1,idleTimer:5,cancelTimer:30},avatars:{bot:"bot",agent:"agent",customer:"user"},actionsMenu:!0,emojis:!1,emojiListConfig:!1,emojiListI18n:!1,inviteOnRestoreTimeout:!0,groupMessages:!1,userData:{},interactionData:{},i18n_messages:v,template:i,async:{enabled:!1,newMessageRestoreState:"full"},minimizeOnMobileRestore:!1,markdown:!1,unminimizeOnAlert:!0,promptEndChatOnError:6e4,endChatOnErrorThreshold:3e5,metaDataEnabled:!0},_={wrapper:"",inputs:[{id:"cx_webchat_form_firstname",name:"firstname",maxlength:"100",placeholder:"@i18n:webchat.ChatFormPlaceholderFirstName",label:"@i18n:webchat.ChatFormFirstName",autofocus:!0},{id:"cx_webchat_form_lastname",name:"lastname",maxlength:"100",placeholder:"@i18n:webchat.ChatFormPlaceholderLastName",label:"@i18n:webchat.ChatFormLastName"},{id:"cx_webchat_form_email",name:"email",maxlength:"100",placeholder:"@i18n:webchat.ChatFormPlaceholderEmail",label:"@i18n:webchat.ChatFormEmail"},{id:"cx_webchat_form_subject",name:"subject",maxlength:"100",placeholder:"@i18n:webchat.ChatFormPlaceholderSubject",label:"@i18n:webchat.ChatFormSubject"}]},j=!1,I=!1,E=!1,z=!1,F=!1,D={},B=0,R=0,O=0,M=0,L=0,N=[],P=!1,$=!1,W=!1,q=!1,H=!1,U=!1,Z=!1,J=!1,G=!1,V=null,Y=e(),K=!1,X=!1,Q=!1,ee=!1,te=e(T.chatButton.template),ae=e(),ne=!1,ie=e(),re=!1,ce=!1,oe=["cx-close-confirm","cx-end-confirm"],se=["cx-close-confirm","cx-end-confirm","cx-close-cancel","cx-end-cancel"],le=e(),de=0,pe=!1,xe=!1,ue=!1,me=!1,he=!1,be=!1,ge=!1,fe=!1,we=!1,ve=!1,ye=!1,ke=!1,Ce=!1,Ae=!1,Se=!1,Te=!1,_e=!1,je=!1,Ie=!1,Ee=!1,ze=!1,Fe=!1,De=!1,Be=!0,Re=!1,Oe=!1,Me=!1,Le=!1,Ne=!1,Pe=!1,$e=!1,We=!1,qe=!1,He=!1,Ue=!1,Ze=!1,Je=!1,Ge=!1,Ve=!1,Ye=!1,Ke=T.iMessageGroupingThreshold||1e5,Xe=0,Qe={},et={},tt="",at="",nt="",it=CXBus.data("App.timeFormat")||12,rt="WebChatService",ct=!1,ot=[46,8,37,38,39,40,9,16],st=[0,1,38,33,void 0],lt=0,dt=500,pt=[100,75,50,25,10],xt=[50,25,10],ut=[],mt=0,ht=0,bt=0,gt=["Alt","AltGraph","CapsLock","Control","Fn","FnLock","Hyper","Meta","NumLock","ScrollLock","Shift","Super","Symbol","SymbolLock","Enter","Tab"],ft=0,wt="_genesys.widgets.webchat.state",vt=wt+".minimized",yt=wt+".open",kt=wt+".lastMessageCountRead",Ct=wt+".asyncUnreadMessageCount",At="_genesys.widgets.webchat.metaData",St={proactiveIdle:null},Tt=(e(),e(),e(),!1),_t=!1,jt={},It="",Et="",zt=!1,Ft=!1,Dt=!1,Bt=!1,Rt=function(e){return Y.find(e)},Ot=new a.Renderer;Ot.link=function(e,t,n){var i=e.match(/{{target=".*"}}/),r=!1;i&&(r=i[0].replace(/{{|}}/g,"").split("=")[1].replace(/"/g,"").replace(/'/g,""),e=e.replace(/{{.*}}/,""));var c=a.Renderer.prototype.link.apply(this,[e,t,n]);return r&&c&&-1!==c.indexOf(r)?c:c.replace("=a){var n=t.getCookie(Ct);ee.css({display:""}).text(n)[0].title=n+" "+v.UnreadMessagesTitle,ee.attr({"aria-label":n+" "+v.UnreadMessagesTitle,tabindex:0}),_t.empty().text(n+" "+v.UnreadMessagesTitle)}else a>0?(ee.css({display:""}).text(a)[0].title=a+" "+v.UnreadMessagesTitle,ee.attr({"aria-label":a+" "+v.UnreadMessagesTitle,tabindex:0}),_t.empty().text(a+" "+v.UnreadMessagesTitle),t.setCookie(Ct,a)):(ee.removeAttr("aria-label"),ee.css({display:"none"}))}},Jt=function(){if(!Ie){Y.removeClass("cx-portrait cx-landscape"),Re?Rt(".cx-transcript").css("height","312px"):(Rt(".cx-form-wrapper").css("height","auto"),Rt(".cx-footer").show()),Rt(".cx-overlay.cx-dynamic").css("height","auto");var a=e(Y.find("[role=alertdialog]"))||e(Y.find("[role=alert]"));t.removeFocusTrap(a),t.removeFocusTrap(Y)}},Gt=function(){if(je||Ie){var a=window.screen.availHeight||e(window).height(),n=window.screen.availWidth||e(window).width();Y.removeClass("cx-portrait cx-landscape"),Y.addClass(n"),ee.on("keydown click",function(e){t.validInput(e)&&(e.stopImmediatePropagation(),Ce&&(y.command("minimize"),ee.removeAttr("tabindex title").empty(),_t.empty()))}),Rt(".cx-title").text(v.ChatTitle).attr("role","none").append(ee),_t=e("
    "),Rt(".cx-title").append(_t),Rt(".cx-titlebar").on("keydown click",function(e){t.validInput(e)&&Y.hasClass("minimized")&&y.command("minimize")}),Rt(".cx-button-close").on("keydown click",function(e){t.validInput(e)&&(me?(Ce&&y.command("minimize"),Me?jt&&jt.asyncClose&&"endChat"==jt.asyncClose?ja():Ea():ja()):(y.command("close"),e.preventDefault(),e.stopPropagation()))}),Rt(".cx-button-minimize").on("keydown click",function(e){t.validInput(e)&&y.command("minimize")}),Y.find(".cx-button-minimize").on("focusin",function(e){Y.find(".cx-form table").attr("aria-hidden","true")}),Y.find(".cx-button-close").on("focusin",function(e){Y.find(".cx-form table").attr("aria-hidden","true")}),Y.find(".cx-button-minimize").on("focusout",function(e){var t=document.activeElement;t!==Y.find(".cx-button-minimize")[0]&&t!==Y.find(".cx-button-close")[0]&&Y.find(".cx-form table").removeAttr("aria-hidden")}),Y.find(".cx-button-close").on("focusout",function(e){var t=document.activeElement;t!==Y.find(".cx-button-minimize")[0]&&t!==Y.find(".cx-button-close")[0]&&Y.find(".cx-form table").removeAttr("aria-hidden")}),Rt(".cx-body").append(e(i)),Vt(),Rt(".cx-input-container .cx-send").attr("aria-label",v.AriaChatInputSend),Rt(".cx-input-container .cx-emoji").attr("aria-label",v.ActionsEmoji),Rt(".cx-input-container .cx-upload").attr("aria-label",v.ActionsSendFile),Rt(".cx-input-container .cx-cobrowse").attr("aria-label",v.ActionsCobrowseStart),Rt(".cx-form .cx-input").on("keydown",function(e){if(13==e.which)return Sa(e),!0}),Rt(".cx-browseFile").on("change",function(){if(this.value)if(fa(),this.files[0].size>parseInt(tt)){Ge=!0;var e={},n=v.Errors.FileTransferSizeError,i=Ua(this.files[0].name);a=t.bytesToSize(parseInt(tt)),n=n.replace("<%FilenameFull%>",this.files[0].name).replace("<%FilenameTruncated%>",i),n=n.replace("<%MaxSizePerFile%>",a),e.sErrors=n,va(e),Qt(),wa()}else y.command(rt+".sendFile",{files:this}).done(function(e){Qt()}).fail(function(e){Qt()}).always(function(){wa()})}),S(),K=Rt(".cx-menu .cx-cobrowse"),X=Rt(".cx-menu .cx-upload");var r=Rt(".cx-menu .cx-cobrowse").attr("aria-label");Rt(".cx-menu .cx-cobrowse").attr("aria-label",r+" "+v.AriaActionsCobrowseStartTitle),K.on("keydown click",function(e){t.validInput(e)&&!Te&&me&&(Se?y.command("CoBrowse.stop"):ve&&y.command("CoBrowse.start"))});var c=Rt(".cx-upload").attr("aria-label");return Rt(".cx-upload").attr("aria-label",c+" "+v.AriaActionsSendFileTitle),Rt(".cx-upload").on("keydown click",function(e){t.validInput(e)&&me&&Rt(".cx-browseFile").trigger("click")}),Rt(".cx-message-input").textAreaAutoHeight({lineLimit:je?8:11,callback:function(t){var a=e(".cx-transcript").height();e(".cx-transcript").height(a+t.delta),Gt()}}),Rt(".cx-message-input").on("blur click keydown focus cut copy paste change",function(e){"blur"==e.type?Rt(".cx-input-container").removeClass("cx-input-focus"):Rt(".cx-input-container").addClass("cx-input-focus")}),Rt(".cx-message-input").on("blur keydown keyup focus cut copy paste change",function(t){var a=this,n=t.char;setTimeout(function(){var i=Rt(".cx-char-count"),r=!!ut.length,c=r?ut[ut.length-1]:0;0==a.value.length?Rt(".cx-send").fadeOut():Rt(".cx-send").fadeIn();var o=dt-a.value.length;if(o<0&&(o=0),a.value.length>0)Oe&&(o>c&&(r?i.removeAttr("aria-live"):i.attr("aria-live","polite")),e(a).attr({"aria-label":v.ChatInputPlaceholder}));else if(Oe){var s=Rt(".cx-message-input").attr("placeholder")||v.AriaMessageInput,l=e(".cx-char-count").text();"blur"!==t.type&&e(a).attr({"aria-label":s+" "+l+" "+v.AriaCharRemaining}),i.removeAttr("aria-live")}o>10?(r&&Oe&&(ut.length&&-1!=ut.indexOf(o)||o<=c)&&i.attr("aria-live","polite"),i.removeClass("cx-warning")):(i.attr("aria-live","polite"),i.addClass("cx-warning")),i.html(o),i.attr({"aria-label":o+" "+v.AriaCharRemaining,title:o+" "+v.AriaCharRemaining}),n&&0==o&&(a.value=a.value.substr(0,dt))},0)}),Rt(".cx-form .cx-btn-default").on("keydown click",function(e){t.validInput(e)&&y.command("close")}),Rt(".cx-form .cx-btn-primary").on("keydown click",function(e){t.validInput(e)&&Sa(e)}),Rt(".cx-alert.cx-chat-end button.cx-end-confirm").on("keydown click",function(e){t.validInput(e)&&(Ia(),Ja())}),Rt(".cx-alert.cx-chat-end button.cx-end-cancel").on("keydown click",function(e){t.validInput(e)&&Ia()}),Rt(".cx-alert.cx-chat-error button.cx-error-button").on("keydown click",function(e){t.validInput(e)&&(ma(),ka())}),Rt(".cx-close-confirm").on("keydown click",function(a){t.validInput(a)&&ct&&(qt(ct),Ba(),e(Y.find("[role=alert] button")).is(":visible")||e(Y.find("[role=alertdialog]")).is(":visible")||Y.find(".cx-button-group .cx-button-close").focus())}),Rt(".cx-close-cancel").on("keydown click",function(e){t.validInput(e)&&Ba()}),je||Rt(".cx-message-input").on("blur cut copy paste change keyup",function(){Wt(e(this))}),Rt(".cx-message-input").on("keydown",function(e){return 13!=e.which||e.ctrlKey||e.shiftKey?!(dt&&-1===ot.indexOf(e.which)&&[].concat(n(e.currentTarget.value)).length>=dt)&&void(-1==gt.indexOf(e.key)&&(y.command(rt+".sendTyping",{isTyping:!0}),lt&&$a())):(La(),e.preventDefault(),e.stopPropagation(),Rt(".cx-message-input").trigger("keyup"),!0)}),Rt(".cx-send").on("keyup click",function(e){(e.type&&"click"==e.type||e.which&&!e.ctrlKey&&(32===e.which||13===e.which))&&(La(),Rt(".cx-message-input").focus())}),Y.on("click keyup",function(e){!0===y.data(rt+".sleeping")&&y.command(rt+".wake"),lt&&($a(),y.command(rt+".wake",{resetIdleState:!0}))}),Y.focusin(function(){var a=e(document.activeElement),n=[],i=t.getBrowserandOS();ce||(ce=document.activeElement),re=ce,n=i.browser&&"Internet Explorer"===i.browser?se.filter(function(e){return a.hasClass(e)}):oe.filter(function(e){return a.hasClass(e)}),re==document.activeElement||n.length||(ce=document.activeElement)}),Me&&(ie=e(b),ie.find(".i18n").each(function(){e(this).data("message")&&e(this).html(v[e(this).data("message")])}),ie.find(".cx-btn-primary").on("keydown click",function(e){t.validInput(e)&&(za(),Xt())}),ie.find(".cx-btn-default").on("keydown click",function(e){t.validInput(e)&&(za(),Ja())}),Rt(".cx-overlay.cx-async").append(ie)),Ht(),Oe||Rt(".cx-message-input").attr("aria-label",v.ChatInputPlaceholder),t.populateAllPlaceholders(Y,v),Y},Xt=function(){pe=!1,y.data("open",pe),t.setCookie(yt,pe),Y.hide(),y.command("showChatButton"),Pe=!0},Qt=function(){Ge=!1,Rt(".cx-browseFile")[0].value=null,Y.find(".cx-menu .cx-upload").focus()},ea=function(){$e=!1,We=!1,ue=!0,Ne=!1,bt=0,clearInterval(Ft),Ft=!1},ta=function(){Rt("form[data-async]").addClass("cx-parentDisable"),Rt(".cx-form .cx-input, .cx-form .cx-submit, .cx-form .cx-btn-default").attr("tabindex",-1),Rt(".cx-form .cx-input, .cx-form .cx-option").addClass("cx-disabled"),Rt(".cx-emoji").hide(),Rt(".cx-menu > .cx-icon[role='button']").addClass("cx-disabled")},aa=function(){Rt("form[data-async]").removeClass("cx-parentDisable"),Rt(".cx-form .cx-input, .cx-form .cx-submit, .cx-form .cx-btn-default").removeAttr("tabindex"),Rt(".cx-form .cx-input, .cx-form .cx-option").removeClass("cx-disabled"),!T.emojis||je&&(T.emojiListConfig||T.emojiListI18n)||Rt(".cx-emoji").show(),Rt(".cx-menu > .cx-icon[role='button']").removeClass("cx-disabled")},na=function(){var e={},a={},n={firstname:1,lastname:1,email:1,subject:1,nickname:1},i={};return Rt(".cx-form .cx-input").each(function(){n[this.name]?e[this.name]=t.getInputValue(this):a[this.name]=t.getInputValue(this),i[this.name]=t.getInputValue(this)}),{reserved:e,userData:a,form:i}},ia=function(){Rt(".cx-form-wrapper").show(),Rt(".cx-transcript").hide(),Rt(".cx-input-container").hide(),Rt(".cx-footer").show(),Re=!1},ra=function(){Rt(".cx-form-wrapper").hide(),Rt(".cx-transcript").show(),Rt(".cx-input-container").show(),Rt(".cx-footer").hide(),Y.addClass("cx-transcript-view"),Re=!0,Ht(),Rt(".cx-message-input").trigger("keyup").trigger("focus"),jt=y.data(rt+".capabilities"),jt&&!jt.fileUpload&&(De=!1,X.hide()),Ft=setInterval(function(){he||Dt||Rt(".cx-screen-reader-transcript").empty()},12e3)},ca=function(e,t,a){var e=e||Rt(".cx-overlay.cx-dynamic");if("fill"==a){var n=t?0:Rt(".cx-footer").outerHeight();e.outerHeight(Y.outerHeight()-n-Rt(".cx-titlebar").outerHeight())}else"fit"==a&&e.css("height","auto")},oa=function(e,a,n){var i=e||Rt(".cx-overlay.cx-dynamic");ca(i,a,n),i.show(),t.focusOverlay(i)},sa=function(e){(e||Rt(".cx-overlay.cx-dynamic")).hide()},la=function(e,t){var a=v.Errors[e+""];return void 0!==a||me||(a=v.Errors.Generic),a||t||""},da=function(a){if(a=a.data||a,pe){switch(N||(N=[]),a.status+""){case"400":if(a.status+""=="400"&&a.responseJSON&&a.responseJSON.error)ga(v.Errors.StartFailed);else if(a.responseJSON&&a.responseJSON.errors){var n="";e.each(a.responseJSON.errors||[],function(e){N.push(this.code+""),e>0&&(n+="

    "),n+=la(this.code),Ca(this.code),t.log(this)}),n&&ga(n)}else{var n="";a.responseText&&"string"==typeof a.responseText&&(a.responseText=JSON.parse(a.responseText)||[]),e.each(a.responseText.errors||[],function(e){Ge=!0,e>0&&(n+="

    ");var a=Ua(this.filename),i={};switch(n+=la(this.code),n=n.replace("<%FilenameFull%>",this.filename).replace("<%FilenameTruncated%>",a),i={sErrors:n},N.push(this.code+""),this.code+""){case"201":n=n.replace("<%MaxFilesAllowed%>",this.advice),i.sErrors=n,va(i);break;case"202":var r=t.bytesToSize(parseInt(this.advice));n=n.replace("<%MaxAttachmentsSize%>",r),i.sErrors=n,va(i);break;case"203":va(i)}t.log(this)})}break;case"0":if(me){if("FileUploadError"==a.errorReason){Ge=!0;var i=Ua(a.filename),n=v.Errors.FileSendFailed,r={},c=[];n=n.replace("<%FilenameFull%>",a.filename).replace("<%FilenameTruncated%>",i),c[0]=a.file,r.files=c,va({sErrors:n,isRetryAllowed:!0,file:r})}}else ga(v.Errors.StartFailed)}if(a.errors){var o="",s=!1;N||(N=[]),e.each(a.errors||[],function(e){var a=this.response||{},n=a.status;N.push(this.code+""),e>0&&(o+="

    "),o+=la(this.code,this.text),Ca(this.code),!me||It||!n||401!==n&&403!==n&&"5"!=n.toString().charAt(0)||(s=!0,o=la(n,this.text)),t.log(this)}),o&&(s?ba(o):ga(o))}"InvalidService"==a.errorReason&&ga(v.Errors[500]),a.errors&&a.errors[0]&&"InvalidService"==a.errors[0].errorReason&&ga(v.Errors.Generic)}},pa=function(e){var a=e||{},n=a.data;ln(),N||(N=[]),N.push("restoreFailed"),H=an(),y.publish("closed",on()),cn(),dn(),T.chatButton.enabled&&y.command("showChatButton"),y.command("reInvite",{statusCode:n&&n.status||""}),t.deleteCookie(vt),t.deleteCookie("_genesys.widgets.webchat.state.unreadMessages")},xa=function(){Y.removeAttr("aria-modal"),ta(),Rt(".cx-button-minimize, .cx-button-maximize, .cx-button-close").attr("tabindex",-1),e(".cx-transcript").is(":visible")&&(Rt(".cx-transcript").find("button").attr("tabindex",-1),Rt(".cx-transcript > * [tabindex=0], .cx-input-container * [tabindex=0]:not(.cx-disabled), .cx-input-container li .cx-menu-item [tabindex=0],.cx-message-input").attr("tabindex",-1),Rt(".cx-transcript *").attr("focusable",!1),Rt(".cx-transcript a").addClass("cx-a-disabled").attr("tabindex",-1),Rt(".cx-transcript").addClass("cx-scroll-disabled"),e(".cx-emoji-selection-menu").is(":visible")&&Rt(".cx-emoji-selection-menu > * [tabindex=0]").attr("tabindex",-1))},ua=function(){e(".cx-input-container").is(":visible")&&Rt(".cx-input-container, .cx-input-container *").attr({tabindex:"-1","aria-hidden":!0})},ma=function(t){Y.attr("aria-modal",!0),aa(),Rt(".cx-button-minimize, .cx-button-maximize, .cx-button-close").removeAttr("tabindex"),e(".cx-transcript").is(":visible")&&(Rt(".cx-transcript").find("button").removeAttr("tabindex"),Rt(".cx-message-input").removeAttr("tabindex"),Rt(".cx-transcript > * [tabindex=-1]:not(.cx-space), .cx-input-container * [tabindex=-1]:not(.cx-disabled),.cx-input-container li .cx-menu-item [tabindex=-1]").attr("tabindex",0),Rt(".cx-transcript a").removeClass("cx-a-disabled").removeAttr("tabindex"),Rt(".cx-transcript *").removeAttr("focusable"),Rt(".cx-transcript").removeClass("cx-scroll-disabled"),e(".cx-emoji-selection-menu").is(":visible")&&Rt(".cx-emoji-selection-menu > * [tabindex=-1]").attr("tabindex",0))},ha=function(){var a=e(h);return xa(),Rt(".cx-alert.cx-general").remove(),a.addClass("cx-binary-alert").find("p.i18n").html(v.Errors[404]||""),a.find(".i18n.cx-error-button.cx-btn-primary").html(v.ChatErrorPrimaryButton||"").on("keydown click",function(e){t.validInput(e)&&y.command("close").done(function(e){me=!1,y.command("open")})}),a.find(".i18n.cx-error-button.cx-btn-default").html(v.ChatErrorDefaultButton||"").on("keydown click",function(e){t.validInput(e)&&y.command("close")}),a.show(),t.populateLanguageStrings(a,v),a.insertBefore(Rt(".cx-webchat-smokescreen")),Rt(".cx-smokescreen").show(),(je||Ie)&&t.overlayFocusCycle(a),a.find(".cx-btn-primary").trigger("focus"),t.focusOverlay(a,".cx-error-button"),a},ba=function(a){xa(),It=setTimeout(function(){var n=e(h);return Rt(".cx-alert.cx-general").remove(),n.addClass("cx-binary-alert").find("p.i18n").html(a||v.Errors[500]||""),n.find(".i18n.cx-error-button.cx-btn-primary").html(v.ChatErrorPrimaryButton||"").on("keydown click",function(e){t.validInput(e)&&y.command(rt+".endChat").always(function(){y.command("close").always(function(e){y.command("open")})})}),n.find(".i18n.cx-error-button.cx-btn-default").html(v.ChatErrorDefaultButton||"").on("keydown click",function(e){t.validInput(e)&&(ma(),ka(n),Et||(Et=setTimeout(function(){y.command(rt+".endChat").always(function(){ga(v.Errors.CriticalFault)})},T.endChatOnErrorThreshold-T.promptEndChatOnError)))}),n.show(),t.populateLanguageStrings(n,v),n.insertBefore(Rt(".cx-webchat-smokescreen")),Rt(".cx-smokescreen").show(),(je||Ie)&&t.overlayFocusCycle(n),n.find(".cx-btn-primary").trigger("focus"),zt=!0,n},T.promptEndChatOnError)},ga=function(a,n){if(!zt){var i=e(h);return xa(),Rt(".cx-alert.cx-general").remove(),i.addClass("cx-normal-alert").find("p.i18n").html(a||v.ChatError||""),i.find(".i18n.cx-error-button").html(n||v.ChatErrorButton||"").on("keydown click",function(a){t.validInput(a)&&(ma(),ka(i),re&&e(re).focus())}),i.show(),t.populateLanguageStrings(i,v),i.insertBefore(Rt(".cx-webchat-smokescreen")),Rt(".cx-smokescreen").show(),(je||Ie)&&t.overlayFocusCycle(i),i.find(".cx-btn-primary").trigger("focus"),i}},fa=function(){t.showWaiting(Y),ta()},wa=function(){t.hideWaiting(Y),aa(),re&&e(re).focus()},va=function(a){xa();var n=e(m);return Rt(".cx-alert.general").remove(),n.find(".cx-buttons-binary").hide(),a.isRetryAllowed&&(n.find(".cx-buttons-binary").show(),n.find(".cx-buttons-single").hide()),t.populateAllPlaceholders(n,v),n.find(".cx-reason").html(a.sErrors||""),n.find(".cx-upload-cancel").html(v.FileTransferError||"").on("keydown click",function(e){t.validInput(e)&&(ka(n),Rt("div.cx-spinner").remove(),aa(),ma(),Qt(),(je||Ie)&&t.overlayFocusCycle(Y))}),n.find(".cx-upload-confirm").html(v.FileTransferRetry||"").on("keydown click",function(e){t.validInput(e)&&(ma(),ka(n),fa(),y.command(rt+".sendFile",{files:a.file}).done(function(e){Qt()}).fail(function(e){Qt(),Rt("div.cx-spinner").remove(),aa()}).always(function(){wa()}))}).focus(),a.isRetryAllowed&&(n.find(".cx-buttons-single").hide(),n.find(".cx-buttons-double").show(),n.find(".cx-upload-cancel").html(v.FileTransferCancel||""),n.find(".cx-buttons-binary .cx-upload-cancel").attr("aria-label",v.AriaFileTransferCancel)),n.show(),Rt(".cx-smokescreen").show(),n.insertBefore(Rt(".cx-webchat-smokescreen")),n.find(".cx-btn-primary").trigger("focus"),t.focusOverlay(n),(je||Ie)&&t.overlayFocusCycle(n),n},ya=function(){var a=Rt(".cx-survey-offer");Ra(),a.find(".cx-survey-question-body").html(v.SurveyOfferQuestion),a.find(".cx-survey-confirm").html(v.ShowSurveyAccept).on("keydown click",function(e){t.validInput(e)&&(window.open(at),Oa())}),a.find(".cx-survey-cancel").html(v.ShowSurveyReject).on("keydown click",function(a){t.validInput(a)&&(e.ajax({url:nt,type:"POST",crossDomain:!0}),Oa())}),ke=!1},ka=function(a){zt&&(zt=!1),a?a.remove():Rt(".cx-alert.cx-general").remove(),Rt(".cx-smokescreen").hide(),(je||Ie)&&t.overlayFocusCycle(Y),Rt(".cx-form-wrapper").is(":visible")&&Rt("input.cx-error").length?Rt("input.cx-error:first").trigger("focus"):re&&e(re).focus()},Ca=function(t){var a=Rt(".cx-form");switch(t+""){case"102":a.find("input[name=firstname]").addClass("cx-error").attr("aria-invalid",!0);break;case"103":a.find("input[name=lastname]").addClass("cx-error").attr("aria-invalid",!0);break;case"161":a.find("input[name=firstname], input[name=lastname]").addClass("cx-error").attr("aria-invalid",!0);break;case"364":a.find("input[name=email]").addClass("cx-error").attr("aria-invalid",!0)}Rt("input.cx-error").one("input",function(t){t.target.value&&void 0!=t.target.value&&""!=t.target.value&&e(this).removeClass("cx-error").attr("aria-invalid","false")})},Aa=function(){Rt(".cx-form input").removeClass("cx-error").removeAttr("aria-invalid")},Sa=function a(n){y.command("WebChatService.restore").fail(function(){var i=e(this).data("userData")||n.userData||{},r=na();i=e.extend(i,Qe,r.userData),Aa(),t.validateForm(Rt(".cx-form"))&&(t.showLoading(Y),xa(),Rt(".cx-smokescreen").show(),D=r.form,y.publish("submitted",on()),y.command(rt+".startChat",e.extend(r.reserved,{userData:i,async:Me,form:r.form,interactionData:et})).fail(function(e){G=an(),y.publish("rejected",on()),1==e.statusCode?ga(v.Errors.ChatUnavailable):"retry"==e.statusCode&&a(n)}).always(function(){t.hideLoading(Y),ma()}))})},Ta=function(){me=!0,fe=!1,ge=!1,we=!1,xe=!1,ue=!1,y.command("App.registerAutoLoad"),je&&Rt(".cx-footer").hide(),ra(),Nt(),$||($=an(),y.publish("started",on())),Y.removeClass("cx-disabled"),Rt(".cx-smokescreen").hide(),A(),Rt(".cx-transcript").is(":visible")&&Rt(".cx-input-container .cx-menu li .cx-menu-item:not(.cx-branding-icon)").attr("tabindex",0)},_a=function(){Rt(".cx-form input").val("")},ja=function(){Rt(".cx-alert.cx-chat-end").show(),xa(),Rt(".cx-smokescreen").show(),(je||Ie)&&t.overlayFocusCycle(Rt(".cx-alert.cx-chat-end")),t.focusOverlay(e(".cx-alert.cx-chat-end"),".cx-end-cancel")},Ia=function(){Rt(".cx-alert.cx-chat-end").hide(),Rt(".cx-smokescreen").hide(),ma(),re&&e(re).focus(),e(Y.find("[role=alert] button")).is(":visible")||e(Y.find("[role=alertdialog]")).is(":visible")||Y.find(".cx-button-group .cx-button-close").focus(),(je||Ie)&&t.overlayFocusCycle(Y)},Ea=function(){Rt(".cx-alert.cx-async-chat-end").show(),xa(),Rt(".cx-smokescreen").show(),oa(Rt(".cx-overlay.cx-async"),!1,"fit"),(je||Ie)&&t.overlayFocusCycle(Rt(".cx-overlay.cx-async")),t.focusOverlay(e(".cx-alert.cx-async-chat-end"),".cx-async-chat-close")},za=function(){Rt(".cx-alert.cx-async-chat-end").hide(),Rt(".cx-smokescreen").hide(),sa(Rt(".cx-overlay.cx-async")),ma(),re&&e(re).focus(),(je||Ie)&&t.overlayFocusCycle(Y)},Fa=function(){Rt(".cx-history-loading").hide(),He=!1},Da=function(a){ct=a,Rt(".cx-alert.cx-chat-close"),Rt(".cx-alert.cx-chat-close").show(),xa(),Rt(".cx-smokescreen").show(),(je||Ie)&&t.overlayFocusCycle(Rt(".cx-alert.cx-chat-close")),t.focusOverlay(e(".cx-alert.cx-chat-close"),".cx-close-cancel")},Ba=function(){Rt(".cx-alert.cx-chat-close").hide(),Rt(".cx-smokescreen").hide(),ma(),(je||Ie)&&t.overlayFocusCycle(Y),re&&e(re).focus()},Ra=function(){Rt(".cx-alert.cx-survey-offer").show(),Rt(".cx-survey-confirm").trigger("focus"),xa(),Rt(".cx-smokescreen").show(),t.focusOverlay(e(".cx-alert.cx-survey-offer"),".cx-survey-confirm")},Oa=function(){Rt(".cx-alert.cx-survey-offer").hide(),Rt(".cx-smokescreen").hide(),ma(),re&&e(re).focus(),(je||Ie)&&t.overlayFocusCycle(Y)},Ma=function(a,n){var i=t.getDateString(new Date);return e(i===n?"
    "+v.todayLabel+"
    ":"
    "+a.dayName+", "+a.monthName+" "+a.dayNumber+"
    ")},La=function(e){if(me){var t=e||Rt(".cx-message-input").val()||"";t=t.substr(0,dt),""!=(t=t.trim())&&(y.command(rt+".sendMessage",{message:t,type:"text"}).done(function(e){e&&1==e.statusCode&&(ga(v.Errors.MessageFailed),Rt(".cx-message-input").val(t)),Rt(".cx-send").fadeOut()}),e||Rt(".cx-message-input").val("").trigger("change"))}},Na=function(){T.unminimizeOnAlert?y.command("minimize"):(Xe++,t.getCookie(Ct)&&!he&&Ut(),Zt()),re&&e(re).focus()},Pa=function(a,n){var i="",r=Rt(".cx-overlay.cx-static"),c=!1;r.addClass("cx-idle-dialog"),"IdleAlert"==a.type?(r.attr("role","alert"),lt++,Ce&&Na(),i=v["IdleMessage"+lt]||a.text,a.userData&&"CLOSE"==a.userData["next-idle-timer-type"]&&(c=1e3*parseInt(n||a.userData["next-idle-timer-secs"]))):"IdleClose"==a.type&&(r.attr("role","alert"),lt=-1,Ce&&Na(),i=v.IdleMessageClose||a.text),Tt&&(Tt.remove(),sa(r)),Tt=e("
    "+i+"
    "),r.empty().append(Tt),c&&(r.removeAttr("role"),Tt.append("
    "),t.populateAllPlaceholders(Tt),Tt.find(".cx-idle-countdown").append(t.Generate.Countdown({time:c,showIcon:!0,sIdleMessageId:"cx_idle_message",aCountdownIntervals:pt}))),oa(r,!1,"fit"),Tt.addClass("cx-idle-alert"),-1==lt&&(lt=0)},$a=function(){lt=0,Tt&&(Tt.remove(),sa(Rt(".cx-overlay.cx-static"))),Tt=!1},Wa=function(t,a){var n="";return a||(a=v.AgentNameDefault),t&&(n=e("+a+"),n[0].src=t),n},qa=function(a){var n=ae,i=ae,r="",c=a.type||"",p="",m=a.action,h=a.bHTML,b=a.index,g="",f=!1,w=a.timestamp&&nn(a.timestamp),k=w&&t.getDateString(w.date),C=w&&Ma(w,k),A=!1,S="",_=a.avatar,j=jt&&jt.pagination,I=t.linkify(t.sanitizeHTML(a.text)),E=!1,z=a.isUnreadMessage||!1;if(h?a.text=a.text:e("

    "+I+"

    ").find("a").length&&(a.text=I,h=!0),a.originalMessage&&a.originalMessage.index&&(g=a.originalMessage.index),$e&&ne&&(n=ne,i=ne,ne=!1),a.timestamp&&i.data("time")&&(S=$e?new Date(i.data("time")).getTime()-new Date(a.timestamp).getTime():new Date(a.timestamp).getTime()-new Date(i.data("time")).getTime()),i&&a.name==i.data("name")&&S<=Ke&&"External"!=c&&(i.hasClass("cx-them")&&Za(c)||i.hasClass("cx-you")&&"Client"===c)?A=i.parent():f=!0,"injected"==c&&!0===a.bCustom||"injected"!=c&&!1===a.bubble?n=e("
    "):"object"==o(a.bubble)?(n=e(d),a.bubble.fill&&(n.find(".cx-bubble").css({"background-color":a.bubble.fill}),n.find(".cx-bubble-arrow svg").css({fill:a.bubble.fill})),a.bubble.radius&&n.find(".cx-bubble").css({"border-radius":a.bubble.radius}),!1===a.bubble.time&&n.find(".cx-time").hide(),!1===a.bubble.name&&n.find(".cx-name").hide(),!1===a.bubble.avatar&&(n.find(".cx-avatar-wrapper, .cx-bubble-arrow").hide(),n.find(".cx-bubble").css({"margin-left":0,"margin-right":0}))):"Agent"==c||"External"==c||"Supervisor"==c||"Bot"===c?(n=e(l),"External"==c||"Bot"==c?L++:M++,"Agent"!=c&&"Supervisor"!=c&&"Bot"!=c||"FileTransfer"!=m||(n=e(u),Ha(n,a),h=!1),lt&&$a()):"Client"==c?(n=e(d),O++,"FileTransfer"!=m||a.loading||(Rt("div.cx-spinner").remove(),n=e(x),Ha(n,a),h=!1),$a()):n=e("
    "),!Me&&!j||ue||!w||$e||bt===w.dayNumber||(Rt(".cx-transcript").append(C),bt=w.dayNumber),"injected"==c)n.addClass("cx-injected");else if("External"==c){var F=t.getI18nString(a.text,v);F&&(r=a.text,a.text=F),n.addClass("cx-system"),n.attr({"data-message":r,"data-message-type":"transcript"}),n.find(".aria-name").attr("aria-label",v.AriaSystemSaid),n.addClass("i18n")}else n.addClass("cx-participant"),Za(c)?(n.addClass("cx-them").addClass("cx-"+c).addClass("cx-"+c.toLowerCase()),n.find(".aria-name").attr("aria-label",c+" "+(a.name?a.name:"")+" "+v.AriaSaid)):(n.addClass("cx-you"),n.find(".aria-name").attr("aria-label",v.AriaYouSaid)),T.avatars&&(Za(c)&&T.avatars.agent&&T.avatars.bot?"Bot"==c?n.find(".cx-avatar").html(t.Generate.Icon(T.avatars.bot)).addClass(T.avatars.bot):n.find(".cx-avatar").html(t.Generate.Icon(T.avatars.agent)).addClass(T.avatars.agent):"Client"==c&&T.avatars.customer&&n.find(".cx-avatar").html(t.Generate.Icon(T.avatars.customer)).addClass(T.avatars.customer));if(_){var D=Wa(_,c);"Client"==c?n.find(".cx-avatar.user").html(D):"Bot"==c?n.find(".cx-avatar.bot").html(D):n.find(".cx-avatar.agent").html(D)}"object"==o(a.bubble)&&("object"==o(a.bubble.avatar)&&(a.bubble.avatar.custom&&n.find(".cx-avatar-wrapper").html(a.bubble.avatar.custom),a.bubble.avatar.icon&&(n.find(".cx-avatar").removeClass(T.avatars.agent+" "+T.avatars.customer+" "+T.avatars.bot),n.find(".cx-avatar").html(t.Generate.Icon(a.bubble.avatar.icon)).addClass(a.bubble.avatar.icon))),"left"==a.bubble.direction?n.removeClass("cx-them cx-you cx-system").addClass("cx-them"):"right"==a.bubble.direction?n.removeClass("cx-them cx-you cx-system").addClass("cx-you"):"none"==a.bubble.direction&&n.removeClass("cx-them cx-you cx-system")),n.find(".cx-name").text(a.name);var B=n.find(".cx-message-text");!0===a.bCustom||!1===a.bubble?n.html(a.text):h?B.html(a.text):B.text(a.text),!Ue&&B&&B[0]&&(B[0].innerHTML=B[0].innerHTML.replace(/\n|\r/g,"
    ")),!Ue||"Client"!=c&&"External"!=c||(B[0].innerHTML=B[0].innerHTML.replace(/\n|\r/g,"
    ")),Rt(".cx-transcript .cx-NewTextBubble").removeClass("cx-NewTextBubble"),n.addClass("cx-NewTextBubble"),"FileTransfer"==m&&(a.loading?n=e(s):a.transferFailed&&(n=e("
    "))),A||(A=e("
    ")),n&&(g||b)&&(n[0].id="cx-chat-index-"+(g||b)),$e?b<=mt?(A.prepend(n),Rt(".cx-transcript .cx-loading-container").after(A),f&&bt!==w.dayNumber?(Rt(".cx-transcript .cx-loading-container").after(C),bt=w.dayNumber):(Rt('.cx-transcript div[data-date="'+k+'"]').remove(),Rt(".cx-transcript .cx-loading-container").after(C)),mt=b):b>ht&&A.append(n):(A.append(n),Rt(".cx-transcript").append(A)),$e||"Agent"!=c&&"External"!=c&&"Supervisor"!=c&&"Bot"!==c||!z||n.attr("data-unread-message",!0),ae=n,Me&&0===a.key&&(ne=n),e.when(function(){return n.hide().fadeIn()}()).done(function(){Ka()}),Ce&&Y.addClass("cx-NewMessage"),a.timestamp&&(p=t.getFormattedTime(a.timestamp,it),n.find(".cx-time").text(p),n.data("time",a.timestamp)),n.data("name",a.name),n&&(Ya(),"Client"!=a.type&&Xe++,Ce&&(t.getCookie(Ct)&&!he&&Ut(),(a.restoring||he)&&t.setCookie(kt,Xe),Zt()));var R=function(e){var a,n=["generic","list-vertical","single-selection-list"];if(a=t.checkPath(e,"eventAttributes.structured-content.genesys-chat.content")){if("string"==typeof a)try{a=JSON.parse(a)}catch(e){}if(a)return"string"==typeof a.contentType&&"object"==o(a.content)&&-1!==n.indexOf(a.contentType)}else if(e)return"string"==typeof e.contentType&&"object"==o(e.content)&&-1!==n.indexOf(e.contentType);return!1}(a.originalMessage);if($e||(E=n.clone(),E.removeAttr("id"),R&&(E.attr("data-rm-ndgenerictext-sr","true"),E.find(".cx-message-text").remove(),E.find(".cx-time").remove()),Rt(".cx-screen-reader-transcript").append(E),"Firefox"!==t.getBrowserandOS().browser&&n.find(".cx-space").attr("aria-hidden",!0)),$e&&We&&a.key&&a.length){var N=a.key,P=a.length-1;N!==P&&N!==P-1||tn()}else Ka();return a.text&&""!=a.text.replace(" ","")||n.addClass("cx-hidden-message"),y.publish("messageAdded",{data:a,message:a,originalMessage:a.originalMessage,html:n||void 0,transcript:Rt(".cx-transcript")[0]||void 0,index:b,id:"cx-chat-index-"+(g||b),prevMessageHTML:i}),n},Ha=function(e,a){if(!a.transferFailed){a.size||(a.size=t.checkPath(a,"originalMessage.userData.file-size")||0);var n=t.bytesToSize(parseInt(a.size))||"",i=e.find(".cx-download-btn");e.find(".cx-name").text(a.name),e.find(".cx-filesentmsg").text(v.FileSent),e.find(".cx-filename").text(Ua(a.filename)),e.find(".cx-filename").attr("title",a.filename),e.find(".cx-filesize").text(n),i.html(v.DownloadButton),i.attr({"aria-label":v.AriaDownloadButton+" "+a.filename}),i.attr("fileId",a.fileId),i.on("keydown click",function(e){t.validInput(e)&&y.command(rt+".downloadFile",{fileId:this.getAttribute("fileId"),fileName:a.filename||""})}),aa()}},Ua=function(e){return e=e||"",(Ge&&e.length>=25||e.length>36)&&(e=e.substr(0,16)+"..."+e.substr(e.length-5,e.length)),e},Za=function(e){return"Agent"==e||"Supervisor"==e||"Bot"==e},Ja=function(e){y.command(rt+".endChat"),t.hideWaiting(Y),t.hideLoading(Y),ua()},Ga=function(e,t,n,i,r){var c="",e=(e+"").toLowerCase()||"text",s=!1;switch(e){case"text":if("object"===(void 0===n?"undefined":o(n))&&n[0]&&n[0].outerHTML)c=n[0].outerHTML;else{if("string"!=typeof n)return!1;c=n}break;case"html":c=n;break;default:return!1}return s=qa({name:t,text:"text"==e&&Ue?a(c,{sanitize:!0}):c,type:"injected",timestamp:(new Date).getTime(),bHTML:!("html"!=e&&!Ue),bCustom:!!i,bubble:r||{direction:"none",radius:10,avatar:!1},restoring:!1}),Ka(),s},Va=function(e){if(Y){var t=e&&e.data||"";t&&t.from?(Rt(".cx-transcript .cx-agent-typing[data-id="+t.from.id+"]").remove(),Ka()):(Rt(".cx-transcript .cx-agent-typing").remove(),Ka()),Y.removeClass("cx-agent-typing")}},Ya=function(){Y&&Rt(".cx-transcript").append(Rt(".cx-transcript .cx-agent-typing").detach())},Ka=function(){var e=Rt(".cx-transcript")[0];!e||We||He||(e.scrollTop=e.scrollHeight,de=e.scrollHeight)},Xa=function(){Y.length&&Y.find(".cx-transcript").find("[data-unread-message='true']").each(function(){e(this).removeAttr("data-unread-message")})},Qa=function(t,a){var n=null;return function(){var i=this,r=arguments,c=arguments[0]||!1,o=c&&-1!==st.indexOf(c.which);me&&e(i).scrollTop()<=0&&o&&Rt(".cx-history-loading").show(),clearTimeout(n),n=setTimeout(function(){t.apply(i,r)},a)}},en=function(){Y&&Y.find(".cx-transcript").on("mousewheel touchend keyup scroll",Qa(function(t){if(!qe&&me){var a=t&&-1!==st.indexOf(t.which);e(this).scrollTop()<=0&&!He&&a&&!Pe&&(He=!0,e(this).scrollTop(0),y.command(rt+".fetchHistory").always(function(){Fa()}))}},150))},tn=function(){var e=Rt(".cx-transcript")[0],t=parseInt(parseInt(e.scrollHeight)-parseInt(de));Rt(".cx-transcript").animate({scrollTop:t},500,"swing"),de+=t,We=!1},an=function(){return(new Date).getTime()},nn=function(e){var a=!1,n=new Date(e);return n&&(a={monthName:v.MonthLabels[n.getMonth()],dayName:v.DayLabels[n.getDay()],dayNumber:n.getDate(),date:t.getDateString(n)}),a},rn=function(){It&&(clearTimeout(It),It=""),Et&&(clearTimeout(Et),Et="")},cn=function(){j=!1,E=!1,z=!1,F=!1,D={},I=!1,B=0,R=0,O=0,M=0,L=0,N=[],P=!1,$=!1,W=!1,q=!1,H=!1,G=!1,U=!1,Z=!1,J=!1,V=null},on=function(e){var t=e||{},a=t.initialState,n=T.metaDataEnabled?{proactive:j,proactiveData:I,prefilled:E,autoSubmitted:z,coBrowseInitiated:F,filesUploaded:B,numAgents:R,userMessages:O,agentMessages:M,systemMessages:L,errors:N.length>0&&N,opened:P,started:$,cancelled:W,rejected:G,completed:q,closed:H,elapsed:(H||an())-P,waitingForAgent:!!U&&U-$,agentReached:U,botReached:Z,supervisorReached:J,form:D,id:V}:{};return!a&&T.metaDataEnabled&&sn(n),y.data("metadata",n),n},sn=function(e){var a=c({},e);a.form={},t.setCookie(At,JSON.stringify(a))},ln=function(){var e=JSON.parse(t.getCookie(At)||!1)||!1;e&&(j=e.proactive,I=e.proactiveData,E=e.prefilled,z=e.autoSubmitted,F=e.coBrowseInitiated,B=e.filesUploaded,R=e.numAgents,O=e.userMessages,M=e.agentMessages,L=e.systemMessages,N=e.errors,P=e.opened,$=e.started,W=e.cancelled,q=e.completed,H=e.closed,U=e.agentReached,Z=e.botReached,J=e.supervisorReached,V=e.id)},dn=function(){t.deleteCookie(At)},pn=function(){"minimized"===T.async.newMessageRestoreState?(Ce=!0,t.setCookie(kt,Xe),Xe++,y.command("open",{minimized:!0})):y.command("open")},xn=function(a){Je=!0;var n=a.data||{},i=n.proactive,r=n.proactiveData,c=n.id;a.data&&"boolean"==typeof a.data.async&&Le&&(Me=a.data.async),Ue=a.data&&"boolean"==typeof a.data.markdown?a.data.markdown:T.markdown,a.data.restoring||Ne||(t.deleteCookie("_genesys.widgets.webchat.state.unreadMessages"),me=!1,xe=!1,ue=!1,he=!1,cn()),y.command("Toaster.close"),V=c||V||t.guid(),Y&&Y[0]||(Y=Kt()),"object"!=o(a.data.formJSON)||Array.isArray(a.data.formJSON)||Vt(a.data.formJSON),Rt(".cx-message-input").attr("maxlength",dt),Rt(".cx-char-count").html(dt).attr("aria-label",dt+" "+v.AriaCharRemaining),Array.isArray(xt)&&xt.length&&xt.forEach(function(e){ut.push(e/100*dt)}),!1===a.data.form||Ne?ra():ia(),Rt(".cx-emoji").hide(),!0!==T.emojis||je&&(T.emojiListConfig||T.emojiListI18n)||Rt(".cx-emoji").show(),!1===De?X.hide():!0===De&&X.show(),!1===Oe?Rt(".cx-char-count").hide():!0===Oe&&Rt(".cx-char-count").show(),y.command("WindowManager.registerDockView",{html:Y,draggable:!0}).done(function(n){if(!0===a.data.minimized&&y.command("minimize",{minimized:!0}),pe=!0,y.data("open",pe),Qe=e.extend(!0,a.data.attachedData,a.data.userData),et=a.data.interactionData||{},y.command("hideChatButton"),je||Ie?Y.addClass("cx-mobile"):Y.addClass("cx-desktop"),t.populateAllPlaceholders(Y,v),Ht(),y.command(rt+".registerTypingPreviewInput",{input:Rt(".cx-message-input")}),a.data&&"object"===o(a.data.form)){var c=a.data.form;Rt("#cx_webchat_form_firstname").val(c.firstname||""),Rt("#cx_webchat_form_lastname").val(c.lastname||""),Rt("#cx_webchat_form_email").val(c.email||""),Rt("#cx_webchat_form_subject").val(c.subject||""),E=!0,!0===c.autoSubmit&&(z=!0,Sa({userData:Qe||{},interactionData:et||{}}))}if(a.data.userData&&void 0!=o(a.data.userData.webengagement)&&(j=!0),!0!==i&&void 0===r||(j=!0,I=!!(r&&Object.keys(r).length>0)&&r),P||(P=an()),y.publish("opened",on()),Gt(),Rt(".cx-message-input").trigger("keyup"),(Me||jt&&jt.pagination)&&(Y.find(".cx-transcript").prepend(e(w)),t.populateIcons(Y),en()),Ka(),e(".cx-form-wrapper").is(":visible")){var s=Y.find(".cx-form-wrapper .cx-input:visible").eq(0);s&&e(s).focus()}le=Y.parents(".cx-window-manager").find(".cx-widget-status"),a.data.restoring&&Y.find(".cx-input-container .cx-message-input ").focus(),a.deferred.resolve()}).fail(function(){a.deferred.reject("WindowManager.registerDockView failed")})};y.subscribe(rt+".error",da),y.subscribe(rt+".started",Ta),y.subscribe("Survey.onSubmit",function(e){}),y.subscribe("CoBrowse.online",function(e){Ae=!0,Ht()}),y.subscribe("CoBrowse.started",function(e){!e.data.widgetOrigin||"WebChat"==e.data.widgetOrigin&&e.data&&e.data.token?(F=!0,"WebChat"==e.data.widgetOrigin&&(Ve=e.data.token,y.command(rt+".sendMessage",{message:"{start:"+Ve+"}"}))):"WebChat"!=e.data.widgetOrigin&&(Te=!0),Se=!0,Ht()}),y.subscribe("CoBrowse.stopped",function(){Ve=!1,Se=!1,Te=!1,Ht(),K&&e(K).focus()}),y.subscribe(rt+".messageReceived",function(t){if(Fa(),rn(),Dt=!1,t.data&&t.data.messages&&t.data.messages.length){var n=t.data.messages,i=t.data.originalMessages,r=t.data.idleTimeCountDown||"",c=!1,o=n[n.length-1];t.data.oldMessages?($e=!0,We=!0):($e=!1,We=!1),mt=n[0].index,ht=n[n.length-1].index;var s=o&&o.type&&"idlealert"===o.type.toLowerCase()||!1;!lt||r||s||$a(),Xa();var l=!t.data.restoring&&!he&&n.length>1;e.each(n||[],function(e){var t=this,o=i[e],s=t.from?t.from.type:"",d=t.from?t.from.name:"",p=(t.type||"").toLowerCase(),x=!1,u=t.html||!1;Ue&&"message"==p&&"External"!==s&&"Client"!==s&&!u&&t.text&&(t.text=a(t.text,{sanitize:!0}),t.html=!0);var m=l&&0===e;if("message"==p||"pushurl"==p||"structured"==p||"text"==p)qa({restoring:t.restoring,index:t.index,name:d,avatar:t.avatar,text:t.text,type:s,timestamp:t.timestamp,originalMessage:o,bHTML:t.html||!1,bCustom:t.custom||!1,bubble:t.bubble||!0,key:e,length:n.length,isUnreadMessage:m}),c=!0;else if("participantjoined"==p||"participantleft"==p){if("participantjoined"==p)switch(s){case"Client":xe||(x="ChatStarted",xe=!0,ue=!1,_a());break;case"Agent":x="AgentConnected";break;case"Supervisor":x="SupervisorConnected",we=!0,J=an();break;case"Bot":x="BotConnected"}else if("participantleft"==p){switch(s){case"Agent":x="AgentDisconnected";break;case"Supervisor":x="SupervisorDisconnected";break;case"Bot":x="BotDisconnected"}"Agent"==s&&(x="AgentDisconnected"),"Supervisor"==s&&(x="SupervisorDisconnected"),"Bot"==s&&(x="BotDisconnected")}x&&(qa({restoring:t.restoring,index:t.index,name:d,text:"Bot"==s?v[x].replace("<%Bot%>",d||v.BotNameDefault):v[x].replace("<%Agent%>",d||v.AgentNameDefault),type:"External",timestamp:t.timestamp,bHTML:t.html||!1,originalMessage:o,isUnreadMessage:m}),c=!0)}else"nicknameupdated"==p||("idlealert"==p||"idleclose"==p?Pa(t,r):"fileuploaded"==p?(qa({type:s,timestamp:(new Date).getTime(),filename:t.fileDetails["file-name"],name:d,size:t.fileDetails["file-size"],fileId:t.fileDetails["file-id"],text:v.FileSent,action:"FileTransfer",bHTML:t.html||!1,originalMessage:o,restoring:!1}),B++,c=!0):"filedeleted"==p||"customnotice"==p&&"_GCTI_GSS"==d&&(at=JSON.parse(t.text).Survey_URL||"",nt=JSON.parse(t.text).Cancel_URL||"",(ve||ye)&&(ke=!0)));"Client"==s&<&&$a()}),he&&(he=!1),Pe&&c&&pn()}}),y.subscribe(rt+".restoreTimeout",pa),y.subscribe(rt+".restoreFailed",pa),y.subscribe(rt+".sessionLost",ha),y.subscribe(rt+".agentConnected",function(e){rn(),U=an(),R=Object.keys(e.data.agents).length,on(),ve=!0,""!=at&&(ke=!0),Ht(),he||Nt()}),y.subscribe(rt+".agentDisconnected",function(e){ve=0!==e.data.numAgentsConnected,Ht()}),y.subscribe(rt+".botConnected",function(e){rn(),Z=an(),on(),ye=!0,""!=at&&(ke=!0)}),y.subscribe(rt+".botDisconnected",function(e){ye=!1}),y.subscribe(rt+".restored",function(e){me=!0,he=!0,Dt=!0,y.command("App.registerAutoLoad");var a=t.getCookie(vt);(Ce||"true"==a)&&(qe=!0),Me=!(!e.data||!e.data.async),Ue="boolean"==typeof T.markdown&&T.markdown;var n=JSON.parse(t.getCookie(yt)||!1)||!1;Y=Kt(),ln(),je&&Rt(".cx-footer").hide(),Zt(),e.pending&&(_e=!0),Y.removeClass("cx-disabled"),Me&&!n?Ne=!0:pe?ra():y.command("open",{restoring:!0,form:!1,minimized:!!("true"==a||je&&T.minimizeOnMobileRestore)}),Ka(),Ht(),Nt(),Rt(".cx-input-container .cx-menu li .cx-menu-item:not(.cx-branding-icon)").attr("tabindex",0)}),y.subscribe(rt+".ended",function(t){me=!1,ea(),A(),y.command("App.deregisterAutoLoad"),qa({index:(new Date).getTime(),name:"",text:v.ChatEnded,type:"External",timestamp:0}),lt&&$a(),ke&&ya(),U||Z?(q=an(),y.publish("completed",on())):0==q&&(W=an(),y.publish("cancelled",on())),Rt(".cx-transcript .cx-agent-typing").length&&Va(),Y.addClass("cx-disabled"),Ht(),dn(),e(Y.find("[role=alert] button")).is(":visible")||e(Y.find("[role=alertdialog]")).is(":visible")||Y.find(".cx-button-group .cx-button-close").focus(),Rt(".cx-screen-reader-transcript").empty()}),y.subscribe(rt+".agentTypingStarted",function(a){if(0==Rt(".cx-transcript .cx-agent-typing").length){var n=e(l),i=a.data.from.avatar||!1,r=i?Wa(i,v.AgentNameDefault):t.Generate.Icon(T.avatars.agent),c=y.data(rt+".agentTyping"),o="";n.addClass("cx-agent-typing cx-them"),n.attr("data-id",a.data.from.id||"test"),n.find(".cx-name").text(a.data.from.name||v.AgentNameDefault),n.find(".cx-message-text").text(v.AgentTyping.replace("<%Agent%>",a.data.from.name||v.AgentNameDefault)),n.find(".cx-avatar").html(r),v.AriaAgentTyping&&(n.find(".cx-message-text").attr("aria-hidden",!0),n.find(".cx-bubble").append('
    '+v.AriaAgentTyping.replace("<%Agent%>",a.data.from.name||v.AgentNameDefault)+"
    ")),o=n.clone(),Rt(".cx-transcript").append(n),Rt(".cx-screen-reader-transcript").append(o),"boolean"==typeof c&&(Bt&&(clearInterval(Bt),Bt=!1),Bt=setInterval(function(){var e=Rt(".cx-transcript .cx-agent-typing").length;(c=y.data(rt+".agentTyping"))||(e&&Va(),clearInterval(Bt),Bt=!1)},1e3)),e.when(function(){var e=n.find(".cx-avatar"),t=n.find(".cx-bubble");return e.hide(),t.hide(),e.fadeIn()&&t.slideDown()}()).done(function(){Ka()})}}),y.subscribe(rt+".agentTypingTimeout",Va),y.subscribe(rt+".agentTypingStopped",Va),y.subscribe(rt+".restoredOffline",function(a){ga(v.Errors.RestoredOffline).find(".cx-btn-primary").on("keydown click",function(a){t.validInput(a)&&(re&&e(re).focus(),y.command(rt+".resetPollExceptions"))})}),y.subscribe(rt+".chatServerWentOffline",function(a){ga(v.Errors.ChatServerWentOffline).find(".cx-btn-primary").on("keydown click",function(a){t.validInput(a)&&(re&&e(re).focus(),y.command(rt+".resetPollExceptions"))})}),y.subscribe(rt+".chatServerBackOnline",function(e){ka()}),y.subscribe(rt+".disconnected",function(e){Fe||(ga(v.Errors.Disconnected),Fe=!0,t.showWaiting(Y),ta())}),y.subscribe(rt+".reconnected",function(e){if(Fe){var a=ga(v.Errors.Reconnected);Fe=!1,setTimeout(function(){ka(a)},2e3),rn(),t.hideWaiting(Y),aa(),ma(),(je||Ie)&&t.overlayFocusCycle(Y)}}),y.subscribe(rt+".capabilitiesChanged",function(){var e=y.data(rt+".capabilities");X&&T.uploadsEnabled&&e&&"boolean"==typeof e.fileUpload&&(e.fileUpload?X.show():X.hide())}),y.registerCommand("open",function(e){t.setCookie(yt,!0),jt=y.data(rt+".capabilities"),Pe?(y.command("hideChatButton"),pe=!0,y.data("open",pe),Pe=!1,Y.show(),Ka(),!0===e.data.minimized?y.command("minimize",{minimized:!0}):Gt(),Y.find(".cx-input-container .cx-message-input").focus()):pe?e.deferred.reject("already opened"):!e.data.restoring&&!Ne&&jt&&jt.async?y.command(rt+".asyncRestore").done(function(){e.deferred.resolve()}).fail(function(){xn(e)}):e.data.restoring?xn(e):y.command(rt+".restore").fail(function(){xn(e)})}),y.registerCommand("close",function(e){Be&&!xe&&!ue&&$t()?(Ce&&y.command("minimize"),Da(e)):qt(e)}),y.registerCommand("configure",function(a){if(a.data&&Object.keys(a.data).length){var n=a.data,i=T;if("boolean"==typeof n.inviteOnRestoreTimeout&&(i.inviteOnRestoreTimeout=n.inviteOnRestoreTimeout),"boolean"==typeof n.metaDataEnabled&&(i.metaDataEnabled=n.metaDataEnabled),"boolean"==typeof n.markdown&&(i.markdown=n.markdown),"object"==o(n.chatButton)){var r=n.chatButton;"boolean"==typeof r.enabled&&(i.chatButton.enabled=r.enabled),"number"==typeof r.openDelay&&(i.chatButton.openDelay=parseInt(r.openDelay)),"string"==typeof r.template&&(i.chatButton.template=r.template),"string"==typeof r.effect&&(i.chatButton.effect=r.effect),"number"==typeof r.effectDuration&&(i.chatButton.effectDuration=parseInt(r.effectDuration)),"boolean"==typeof r.hideDuringInvite&&(i.chatButton.hideDuringInvite=r.hideDuringInvite),"string"==typeof r.servicePlugin&&(rt=r.servicePlugin),te=e(i.chatButton.template),te.on("keydown click",function(e){t.validInput(e)&&y.command("open")}),te.attr("aria-label",v.ChatButton),t.populateAllPlaceholders(te,v),i.chatButton.enabled&&y.command("showChatButton")}if("object"==o(n.proactive)){var c=n.proactive;"boolean"==typeof c.enabled&&(i.proactive.enabled=c.enabled),"number"==typeof c.idleTimer&&(i.proactive.idleTimer=c.idleTimer),"number"==typeof c.cancelTimer&&(i.proactive.cancelTimer=c.cancelTimer),Mt()}if("boolean"==typeof n.emojis&&(i.emojis=n.emojis),"string"==typeof n.emojiList&&(i.emojiListConfig=k(n.emojiList)),"boolean"==typeof n.uploadsEnabled&&(De=n.uploadsEnabled,i.uploadsEnabled=n.uploadsEnabled),"boolean"==typeof n.confirmFormCloseEnabled&&(Be=n.confirmFormCloseEnabled),"boolean"==typeof n.charCountEnabled&&(Oe=n.charCountEnabled),"number"==typeof n.maxMessageLength&&(dt=parseInt(n.maxMessageLength)),"boolean"==typeof n.unminimizeOnAlert&&(i.unminimizeOnAlert=n.unminimizeOnAlert),("object"==o(n.ariaCharRemainingIntervals)&&Array.isArray(n.ariaCharRemainingIntervals)||"boolean"==typeof n.ariaCharRemainingIntervals)&&!0!==n.ariaCharRemainingIntervals&&(xt=n.ariaCharRemainingIntervals),("object"==o(n.ariaIdleAlertIntervals)&&Array.isArray(n.ariaIdleAlertIntervals)||"boolean"==typeof n.ariaIdleAlertIntervals)&&!0!==n.ariaIdleAlertIntervals&&(pt=n.ariaIdleAlertIntervals),"object"==o(n.async)){var s=n.async;"boolean"==typeof s.enabled&&(i.async.enabled=s.enabled),"string"==typeof s.newMessageRestoreState&&(i.async.newMessageRestoreState=s.newMessageRestoreState),"function"==typeof s.setSessionData&&"function"==typeof s.getSessionData&&(Le=!0),Me=n.cometD&&n.cometD.enabled&&i.async.enabled}if("object"==o(n.transport)&&"object"==o(n.transport.async)){var l=n.transport.async;"boolean"==typeof l.enabled&&(i.async.enabled=l.enabled),"string"==typeof l.newMessageRestoreState&&(i.async.newMessageRestoreState=l.newMessageRestoreState),"function"==typeof l.setSessionData&&"function"==typeof l.getSessionData&&(Le=!0),Me=l.enabled}if("object"==o(n.autoInvite)){var d=n.autoInvite;"boolean"==typeof d.enabled&&(i.proactive.enabled=d.enabled),"number"==typeof d.timeToInviteSeconds&&(i.proactive.idleTimer=d.timeToInviteSeconds),"number"==typeof d.inviteTimeoutSeconds&&(i.proactive.cancelTimer=d.inviteTimeoutSeconds),Mt()}if("object"!=o(n.form)||Array.isArray(n.form)||(_=n.form),"string"==typeof n.transferLink&&(Ee=!0),"string"==typeof n.inviteLink&&(ze=!0),"string"==typeof n.timeFormat||"number"==typeof n.timeFormat){var p=parseInt(n.timeFormat);12!=p&&24!=p||(it=p)}else it=CXBus.data("App.timeFormat");"boolean"==typeof n.minimizeOnMobileRestore&&(i.minimizeOnMobileRestore=n.minimizeOnMobileRestore),"number"==typeof n.promptEndChatOnError&&(i.promptEndChatOnError=n.promptEndChatOnError),"number"==typeof n.endChatOnErrorThreshold&&(i.endChatOnErrorThreshold=n.endChatOnErrorThreshold),a.deferred.resolve()}else a.deferred.reject("Invalid configuration")}),y.registerCommand("minimize",function(a){var n=a.data.minimized,i=function(){A(),(je||Ie)&&Y.removeAttr("aria-modal"),Y.addClass("cx-minimized").find(".cx-button-minimize.cx-icon").removeClass("cx-button-minimize").addClass("cx-button-maximize").attr("aria-label",v.AriaMaximize),Ce=!0,t.getCookie(kt)||t.setCookie(kt,Xe),y.publish("minimized")},r=function(){(je||Ie)&&Y.attr("aria-modal",!0),Y.hasClass("cx-minimized")&&Y.removeClass("cx-minimized").find(".cx-button-maximize.cx-icon").removeClass("cx-button-maximize").addClass("cx-button-minimize").attr("aria-label",v.AriaMinimize),Ce=!1,t.deleteCookie(kt),t.deleteCookie(Ct),qe=!1,y.publish("unminimized"),Rt("[role=alertdialog]").is(":visible")&&(xa(),Rt(".cx-alert.cx-chat-close").is(":visible")?((je||Ie)&&t.overlayFocusCycle(Rt(".cx-alert.cx-chat-close")),e(".cx-alert.cx-chat-close .cx-btn-default")[0].focus()):Rt(".cx-alert.cx-chat-end").is(":visible")?((je||Ie)&&t.overlayFocusCycle(Rt(".cx-alert.cx-chat-end")),e(".cx-alert.cx-chat-end .cx-btn-default")[0].focus()):((je||Ie)&&t.overlayFocusCycle(Rt("[role=alertdialog]:visible")),Rt("[role=alertdialog] .cx-btn-primary").is(":visible")&&Rt("[role=alertdialog] .cx-btn-primary")[0].focus())),me&&Ka(),Gt(),Rt(".cx-idle-dialog").is(":hidden")&&Rt(".cx-message-input").trigger("keyup"),Ka()};Y.hasClass("cx-dragged-off")?(Y.attr("style",""),y.command("WindowManager.registerDockView",{html:Y,draggable:!0})):!0===n?Ce&&!Ce||i():!1===n?!Ce&&Ce||r():void 0!==n&&""!==n||(Ce?r():Ce||i()),Zt(),me&&t.setCookie(vt,Ce),a.deferred.resolve()}),y.registerCommand("endChat",function(e){me?(Ja(),e.deferred.resolve()):e.deferred.reject("there is no active chat session to end")}),y.registerCommand("invite",function(a){pe?a.deferred.reject("Chat is already open. Ignoring invite command."):(Yt(),T.chatButton.hideDuringInvite&&y.command("hideChatButton"),y.command("Toaster.open",{type:"generic",title:v.InviteTitle,body:v.InviteBody,icon:"chat",controls:"",buttons:{type:"binary",primary:v.InviteAccept,secondary:v.InviteReject}}).done(function(n){if(n.html){a.deferred.resolve(),Q=e(n.html);var i=t.guid(),r="cx-toaster-title"+i,c="cx-toaster-body"+i;Q.find(".cx-title").attr("id",r),Q.find(".cx-body").attr("id",c),Q.attr({"aria-labelledby":r,"aria-describedby":c}),Q.find(".cx-btn.cx-btn-primary").attr("aria-label",v.AriaInviteAccept),Q.find(".cx-btn.cx-btn-primary").on("keydown click",function(e){t.validInput(e)&&(t.setCookie("_genesys.widgets.webchat.autoInvite.disabled",!0),y.command("Toaster.close").done(function(){y.command("open")}))}).trigger("focus"),Q.find(".cx-btn.cx-btn-default").attr("aria-label",v.AriaInviteReject),Q.find(".cx-btn.cx-btn-default").on("keydown click",function(e){t.validInput(e)&&(t.setCookie("_genesys.widgets.webchat.autoInvite.disabled",!0),y.command("Toaster.close"),T.chatButton.enabled&&y.command("showChatButton"))})}}).fail(function(e){}))}),y.registerCommand("reInvite",function(a){if(Je||pe||!T.inviteOnRestoreTimeout)a.deferred.reject("Chat is already open. Ignoring invite command.");else{Yt();var n=a.data&&a.data.statusCode?v.Errors[a.data.statusCode]:v.RestoreTimeoutBody;T.chatButton.hideDuringInvite&&y.command("hideChatButton"),y.command("Toaster.open",{type:"generic",title:v.RestoreTimeoutTitle,body:n,icon:"chat",controls:"close",buttons:{type:"binary",primary:v.RestoreTimeoutAccept,secondary:v.RestoreTimeoutReject}}).done(function(n){if(n.html){a.deferred.resolve();var i=e(n.html),r=t.guid(),c="cx-toaster-title"+r,o="cx-toaster-body"+r;i.find(".cx-title").attr("id",c),i.find(".cx-body").attr("id",o),i.attr({"aria-labelledby":c,"aria-describedby":o}),i.find(".cx-btn.cx-btn-primary").attr("aria-label",v.AriaRestoreTimeoutAccept),i.find(".cx-btn.cx-btn-default").attr("aria-label",v.AriaRestoreTimeoutReject),i.find(".cx-btn.cx-btn-primary").on("keydown click",function(e){t.validInput(e)&&y.command("Toaster.close").done(function(){y.command("open")})}).trigger("focus"),i.find(".cx-btn.cx-btn-default").on("keydown click",function(e){t.validInput(e)&&(y.command("Toaster.close"),T.chatButton.enabled&&y.command("showChatButton"))})}}).fail(function(e){})}}),y.registerCommand("injectMessage",function(e){pe&&(xe||ue)?e.deferred.resolve(Ga(e.data.type,e.data.name,e.data.text,e.data.custom,e.data.bubble)):e.deferred.reject("No chat session to inject into.")}),y.registerCommand("showOverlay",function(t){if(pe){var a=e();a=Rt(!0===t.data.static?".cx-overlay.cx-static":".cx-overlay.cx-dynamic"),a.html(t.data.html||""),oa(a,t.data.hideFooter||!1,t.data.mode||"fill"),t.deferred.resolve()}else t.deferred.reject("WebChat is not currently open. Ignoring command.")}),y.registerCommand("hideOverlay",function(t){if(pe){var a=e();a=Rt(!0===t.data.static?".cx-overlay.cx-static":".cx-overlay.cx-dynamic"),a.html(t.data.html),sa(a),t.deferred.resolve()}else t.deferred.reject("WebChat is not currently open. Ignoring command.")}),y.registerCommand("showChatButton",function(t){if(Yt(),T.chatButton.enabled&&!be){var a=t.data&&"number"==typeof t.data.openDelay?parseInt(t.data.openDelay):T.chatButton.openDelay,n=t.data&&"number"==typeof t.data.duration?parseInt(t.data.duration):T.chatButton.effectDuration;te.find(".i18n").each(function(){e(this).data("message")&&e(this).html(v[e(this).data("message")])}),Ye=setTimeout(function(){Ye=!1,y.command("WindowManager.registerSideButton",{template:te.hide()}).done(function(e){if(0==n)te.css({display:"inline-block"});else switch(T.chatButton.effect){case"slide":te.css({display:"inline-block",width:""});var a=te.outerWidth()+"px";te.css({width:0}),te.animate({width:a},n,function(){be=!0,t.deferred.resolve()});break;case"fade":te.fadeIn(n,function(){be=!0,t.deferred.resolve()});break;default:te.css({display:"inline-block"}),be=!0,t.deferred.resolve()}y.publish("chatButtonDisplayed")})},a)}else t.deferred.reject("Chat button is not enabled in the configuration, or already visible. Ignoring command.")}),y.registerCommand("hideChatButton",function(e){if(be||Ye||T.chatButton.enabled&&pe&&te.length>0){Ye&&clearTimeout(Ye);var t=e.data&&"number"==typeof e.data.duration?parseInt(e.data.duration):T.chatButton.effectDuration;if(0==t)te.css({display:"none"}),te.detach();else switch(T.chatButton.effect){case"slide":te.animate({width:0},t,function(){be=!1,te.detach(),e.deferred.resolve()});break;case"fade":te.fadeOut(t,function(){te.detach(),be=!1,e.deferred.resolve()});break;default:te.css({display:"none"}),be=!1,te.detach(),e.deferred.resolve()}}else e.deferred.reject("Chat button is already hidden. Ignoring command.")}),y.subscribe("App.closeAll",function(e){y.command("close")}),y.subscribe("App.theme",function(e){y.command("App.reTheme",{html:Y})}),y.subscribe("App.timeFormat",function(e){it=e.data.timeFormat}),y.subscribe("App.i18n",function(e){"object"==o(e.data.webchat)&&(Yt(),Y&&(Rt(".cx-title").text(v.ChatTitle),Rt(".cx-button-minimize").attr("aria-label",v.AriaMinimize),Rt(".cx-button-close").attr("aria-label",v.AriaClose)))}),y.subscribe("App.zoom",function(e){"mobile"==e.data.layout?(Ie=!0,Y.removeClass("cx-desktop").addClass("cx-mobile"),Gt()):(Ie=!1,Y.removeClass("cx-mobile").addClass("cx-desktop"),Jt())}),y.subscribe("App.mobileMode",function(){e(window).on("orientationchange",Gt),e(window).on("resize",Gt),Gt(),je=!0}),y.subscribe("App.ready",function(){CXBus.command("RichMediaBridge.LOAD"),y.command(rt+".LOAD"),y.command("App.registerI18n",{i18n:v,namespace:"webchat",lang:"en"}).always(function(){y.command("configure",_genesys.widgets.webchat),y.ready(),y.republish("ready")})}),y.registerCommand("hide",function(e){pe&&!Ze&&Y?(Ze=!0,Y.hide(),e.deferred.resolve()):e.deferred.reject("WebChat is not open or is already hidden.")}),y.registerCommand("show",function(e){pe&&Ze&&Y?(Ze=!1,Y.show(),e.deferred.resolve()):e.deferred.reject("WebChat is not open or is already showing.")}),y.subscribe("App.data.pageFocus",function(e){me||!pe||Re||y.command("WebChatService.restore")}),y.data("metadata",on({initialState:!0}))}}.apply(t,i))&&(e.exports=r)},"./webapp/plugins/cx-webchat/html/cx-loading.html":function(e,t){e.exports='
    \n \n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-alert.html":function(e,t){e.exports='
    \n\t
    \n\t\t

    \n\t\t
    \n\t\t\t\n\t\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-async-close.html":function(e,t){e.exports='
    \n
    \n \n \n
    \n
    \n'},"./webapp/plugins/cx-webchat/html/cx-webchat-chat-button.html":function(e,t){e.exports='
    \n\t\n\t\n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-emoji-menu-custom.html":function(e,t){e.exports='
    \n\t
      \n\t\t\n\t
    \n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-emoji-menu.html":function(e,t){e.exports='
    \n\t
      \n\t\t
    • 😃
    • \n\t\t
    • 👍
    • \n\t\t
    • 😞
    • \n\t
    \n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-file-transfer-agent.html":function(e,t){e.exports='
    \r\n\r\n\t
    \r\n\t\t
    \r\n\t
    \r\n\t\r\n\t
    \r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t
    \r\n\r\n\t

    \r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t \r\n\t

    \r\n\t\r\n
    \r\n\r\n'},"./webapp/plugins/cx-webchat/html/cx-webchat-file-transfer-customer.html":function(e,t){e.exports='
    \r\n\r\n\t

    \r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t \r\n\t

    \r\n\r\n\t
    \r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t
    \r\n\r\n\t
    \r\n\t\t
    \r\n\t
    \r\n\r\n
    \r\n'},"./webapp/plugins/cx-webchat/html/cx-webchat-message-agent.html":function(e,t){e.exports='
    \n\t\n\t
    \n\t\t
    \n\t
    \t\n\n\t
    \n\t\t\n\t\t \n\t\t \n\t\t\n\t
    \n\n\t
    \n\t\t\n\t\t\n\t\t
    \n\t\t
       
    \n\t\t\n\t
    \n\n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-message-customer.html":function(e,t){e.exports='
    \n\t\n\t
    \n\t\t\n\t\t\n\t\t
    \n\t\t
       
    \n\t\t\n\t
    \n\n\t
    \n\t\t\n\t\t \n\t\t \n\t\t\n\t
    \n\n\t
    \n\t\t
    \n\t
    \n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-spinner.html":function(e,t){e.exports=''},"./webapp/plugins/cx-webchat/html/cx-webchat-toaster.html":function(e,t){e.exports='
    \n\t
    <%= message %>
    \n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat-upload-failed-alert.html":function(e,t){e.exports='
    \r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t\r\n\t\t\t\t

    \r\n\t\t\t
    \r\n\t\t\t\r\n\t\t\t
    \r\n\t\t\t\t\r\n\t\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
    \r\n\t\t
    \r\n
    '},"./webapp/plugins/cx-webchat/html/cx-webchat.html":function(e,t){e.exports='
    \n\n\t\n\n\t
    \n\n\t
    \n\n\t
    \n\t\t
    \n\t\t\t

    \n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t
    \n\n\t
    \n\t\t
    \n\t\t\t

    \n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t
    \n\n\t
    \n\n\t
    \n\t\t
    \n\t\t\n\t\t\t
    \n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\n\t\t
    \n\t
    \n\n\t
    \n\t\n\t
    \n\n\t\t\t
    \n\n\t\t\t\t\n\n\t\t\t\t
    \n\n\t\t\t
    \n\n\t\t\t
    \n\t\t\t\t
      \n\n\t\t\t\t\t
    • \n\n\t\t\t\t\t
    • \n\t\t\t\t\t
    • \n\t\t\t\t\t
    • \n\n\t\t\t\t\t
    • \n\t\t\t\t
    \n\n\t\t\t
    \n\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\x3c!-- --\x3e\n\t
    \n\t
    \n\n
    '},"./webapp/plugins/cx-webchat/less/cx-webchat.less":function(e,t,a){var n=a("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/cjs.js!./webapp/plugins/cx-webchat/less/cx-webchat.less");"string"==typeof n&&(n=[[e.i,n,""]]);var i={};i.transform=void 0;var r=a("./node_modules/style-loader/lib/addStyles.js")(n,i);n.locals&&(e.exports=n.locals),n.locals||e.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/cjs.js!./webapp/plugins/cx-webchat/less/cx-webchat.less",function(){var t=a("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/cjs.js!./webapp/plugins/cx-webchat/less/cx-webchat.less");"string"==typeof t&&(t=[[e.i,t,""]]),r(t)}),e.hot.dispose(function(){r()})},"./webapp/plugins/cx-webchat/nls/string.json":function(e,t){e.exports={ChatButton:"Chat",ChatStarted:"Chat Started",ChatEnded:"Chat Ended",AgentNameDefault:"Agent",AgentConnected:"<%Agent%> Connected",AgentDisconnected:"<%Agent%> Disconnected",BotNameDefault:"Bot",BotConnected:"<%Bot%> Connected",BotDisconnected:"<%Bot%> Disconnected",SupervisorNameDefault:"Supervisor",SupervisorConnected:"<%Agent%> Connected",SupervisorDisconnected:"<%Agent%> Disconnected",AgentTyping:"...",AriaAgentTyping:"Agent is typing",AgentUnavailable:"Sorry. There are no agents available. Please try later.",ChatTitle:"Live Chat",ChatEnd:"X",ChatClose:"X",ChatMinimize:"Min",ChatFormFirstName:"First Name",ChatFormLastName:"Last Name",ChatFormNickname:"Nickname",ChatFormEmail:"Email",ChatFormSubject:"Subject",ChatFormPlaceholderFirstName:"Required",ChatFormPlaceholderLastName:"Required",ChatFormPlaceholderNickname:"Optional",ChatFormPlaceholderEmail:"Optional",ChatFormPlaceholderSubject:"Optional",ChatFormSubmit:"Start Chat",AriaChatFormSubmit:"Start Chat",ChatFormCancel:"Cancel",AriaChatFormCancel:"Cancel",ChatFormClose:"Close",ChatInputPlaceholder:"Type your message here",ChatInputSend:"Send",AriaChatInputSend:"Send",ChatEndQuestion:"Are you sure you want to end this chat session?",ChatEndCancel:"Cancel",ChatEndConfirm:"End chat",AriaChatEndCancel:"Cancel",AriaChatEndConfirm:"End chat",ConfirmCloseWindow:"Are you sure you want to close chat?",ConfirmCloseCancel:"Cancel",ConfirmCloseConfirm:"Close",AriaConfirmCloseCancel:"Cancel",AriaConfirmCloseConfirm:"Close",ActionsDownload:"Download transcript",ActionsEmail:"Email transcript",ActionsPrint:"Print transcript",ActionsCobrowseStart:"Start Co-browse",AriaActionsCobrowseStartTitle:"Opens the Co-browse session",ActionsSendFile:"Attach Files",AriaActionsSendFileTitle:"Opens a file upload dialog",ActionsEmoji:"Send Emoji",ActionsCobrowseStop:"Exit Co-browse",ActionsVideo:"Invite to Video Chat",ActionsTransfer:"Transfer",ActionsInvite:"Invite",InstructionsTransfer:"Open this link on another device to transfer your chat session

    <%link%>",InstructionsInvite:"Share this link with another person to add them to this chat session

    <%link%>",InviteTitle:"Need help?",InviteBody:"Let us know if we can help out.",InviteReject:"No thanks",InviteAccept:"Start chat",AriaInviteAccept:"Start chat",AriaInviteReject:"No thanks",ChatError:"There was a problem starting the chat session. Please retry.",ChatErrorButton:"OK",AriaChatErrorButton:"OK",ChatErrorPrimaryButton:"Yes",ChatErrorDefaultButton:"No",AriaChatErrorPrimaryButton:"Yes",AriaChatErrorDefaultButton:"No",DownloadButton:"Download",AriaDownloadButton:"Download",FileSent:"has sent:",FileTransferRetry:"Retry",AriaFileTransferRetry:"Retry",FileTransferError:"OK",AriaFileTransferError:"OK",FileTransferCancel:"Cancel",AriaFileTransferCancel:"Cancel",RestoreTimeoutTitle:"Chat ended",RestoreTimeoutBody:"Your previous chat session has timed out. Would you like to start a new one?",RestoreTimeoutReject:"No thanks",RestoreTimeoutAccept:"Start chat",AriaRestoreTimeoutAccept:"Start chat",AriaRestoreTimeoutReject:"No thanks",EndConfirmBody:"Would you really like to end your chat session?",EndConfirmAccept:"End chat",EndConfirmReject:"Cancel",AriaEndConfirmAccept:"End chat",AriaEndConfirmReject:"Cancel",SurveyOfferQuestion:"Would you like to participate in a survey?",ShowSurveyAccept:"Yes",ShowSurveyReject:"No",AriaShowSurveyAccept:"Yes",AriaShowSurveyReject:"No",UnreadMessagesTitle:"unread messages",AriaYouSaid:"You said",AriaSaid:"said",AriaSystemSaid:"System said",AriaWindowLabel:"Live Chat Window",AriaMinimize:"Live Chat Minimize",AriaMaximize:"Live Chat Maximize",AriaClose:"Live Chat Close",AriaEmojiStatusOpen:"Emoji picker dialog is opened",AriaEmojiStatusClose:"Emoji picker dialog is closed",AriaEmoji:"emoji",AriaCharRemaining:"Characters remaining",AriaMessageInput:"Message box",AsyncChatEnd:"End Chat",AsyncChatClose:"Close Window",AriaAsyncChatEnd:"End Chat",AriaAsyncChatClose:"Close Window",DayLabels:["Sun","Mon","Tue","Wed","Thur","Fri","Sat"],MonthLabels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],todayLabel:"Today",Errors:{102:"First name is required.",103:"Last name is required.",161:"Please enter your name.",201:"The file could not be sent.

    '<%FilenameTruncated%>'

    The maximum number of attached files would be exceeded (<%MaxFilesAllowed%>).

    ",202:"The file could not be sent.

    '<%FilenameTruncated%>'

    Upload limit and/or maximum number of attachments would be exceeded (<%MaxAttachmentsSize%>).

    ",203:"The file could not be sent.

    '<%FilenameTruncated%>'

    File type is not allowed.

    ",204:"We're sorry but your message is too long. Please write a shorter message.",240:"We're sorry but we cannot start a new chat at this time. Please try again later.",364:"Invalid email address.",401:"We're sorry but we are not able to authorize the chat session. Would you like to start a new chat?",404:"We're sorry but we cannot find your previous chat session. Would you like to start a new chat?",500:"We're sorry, an unexpected error occurred with the service. Would you like to close and start a new Chat?",503:"We're sorry, the service is currently unavailable or busy. Would you like to close and start a new Chat again?",ChatUnavailable:"We're sorry but we cannot start a new chat at this time. Please try again later.",CriticalFault:"Your chat session has ended unexpectedly due to an unknown issue. We apologize for the inconvenience.",StartFailed:"There was an issue starting your chat session. Please verify your connection and that you submitted all required information properly, then try again.",MessageFailed:"Your message was not received successfully. Please try again.",RestoreFailed:"We're sorry but we were unable to restore your chat session due to an unknown error.",TransferFailed:"Unable to transfer chat at this time. Please try again later.",FileTransferSizeError:"The file could not be sent.

    '<%FilenameTruncated%>'

    File size is larger than the allowed size (<%MaxSizePerFile%>).

    ",InviteFailed:"Unable to generate invite at this time. Please try again later.",ChatServerWentOffline:"Messages are currently taking longer than normal to get through. We're sorry for the delay.",RestoredOffline:"Messages are currently taking longer than normal to get through. We're sorry for the delay.",Disconnected:"
    Connection lost
    ",Reconnected:"
    Connection restored
    ",FileSendFailed:"The file could not be sent.

    <%FilenameTruncated%>

    There was an unexpected disconnection. Try again?

    ",Generic:"
    An unexpected error occurred.
    ","pureengage-v3-rest-INVALID_FILE_TYPE":"Invalid file type. Only Images are allowed.","pureengage-v3-rest-LIMIT_FILE_SIZE":"File size is larger than the allowed size.","pureengage-v3-rest-LIMIT_FILE_COUNT":"The maximum number of attached files exceeded the limit.","pureengage-v3-rest-INVALID_CONTACT_CENTER":"Invalid x-api-key transport configuration.","pureengage-v3-rest-INVALID_ENDPOINT":"Invalid endpoint transport configuration.","pureengage-v3-rest-INVALID_NICKNAME":"First Name is required.","pureengage-v3-rest-AUTHENTICATION_REQUIRED":"We're sorry but we are not able to authorize the chat session.","purecloud-v2-sockets-400":"Sorry, something went wrong. Please verify your connection and that you submitted all required information properly, then try again.","purecloud-v2-sockets-500":"We're are sorry, an unexpected error occurred with the service.","purecloud-v2-sockets-503":"We're sorry, the service is currently unavailable.","pureconnect-v4-rest-400":"Sorry, something went wrong. Please verify your connection and that you submitted all required information properly, then try again.","pureconnect-v4-rest-500":"We're sorry, an unexpected error occurred with the service.","pureconnect-v4-rest-503":"We're sorry, the service is currently unavailable."}}}},["./webapp/plugins/cx-webchat/cx-webchat.js"]);