zammad/zammad

View on GitHub
public/assets/chat/chat-no-jquery.min.js

Summary

Maintainability
A
0 mins
Test Coverage
window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.agent=function(e){function t(e){return e&&e.ecoSafe?e:void 0!==e&&null!=e?s(e):""}var n=[],o=(e=e||{}).safe,s=e.escape,s=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},s||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){this.agent.avatar&&(n.push('\n<img class="zammad-chat-agent-avatar" src="'),n.push(t(this.agent.avatar)),n.push('">\n')),n.push('\n<span class="zammad-chat-agent-sentence">\n  <span class="zammad-chat-agent-name">'),n.push(t(this.agent.name)),n.push("</span>\n</span>")}.call(this)}.call(e),e.safe=o,e.escape=s,n.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.chat=function(e){function t(e){return e&&e.ecoSafe?e:void 0!==e&&null!=e?s(e):""}var n=[],o=(e=e||{}).safe,s=e.escape,s=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},s||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){n.push('<div class="zammad-chat'),this.flat&&n.push(t(" zammad-chat--flat")),n.push('"'),this.fontSize&&n.push(t(" style='font-size: "+this.fontSize+"'")),n.push('>\n  <div class="zammad-chat-header js-chat-open"'),this.background&&n.push(t(" style='background: "+this.background+"'")),n.push('>\n    <div class="zammad-chat-header-controls js-chat-toggle">\n      <span class="zammad-chat-agent-status zammad-chat-is-hidden js-chat-status" data-status="online"></span>\n      <span class="zammad-chat-header-icon">\n        <svg class="zammad-chat-header-icon-open" width="13" height="7" viewBox="0 0 13 7"><path d="M10.807 7l1.4-1.428-5-4.9L6.5-.02l-.7.7-4.9 4.9 1.414 1.413L6.5 2.886 10.807 7z" fill-rule="evenodd"/></svg>\n        <svg class="zammad-chat-header-icon-close" width="13" height="13" viewBox="0 0 13 13"><path d="m2.241.12l-2.121 2.121 4.243 4.243-4.243 4.243 2.121 2.121 4.243-4.243 4.243 4.243 2.121-2.121-4.243-4.243 4.243-4.243-2.121-2.121-4.243 4.243-4.243-4.243" fill-rule="evenodd"/></svg>\n      </span>\n    </div>\n    <div class="zammad-chat-agent zammad-chat-is-hidden">\n    </div>\n    <div class="zammad-chat-welcome">\n      <svg class="zammad-chat-icon" viewBox="0 0 24 24" width="24" height="24"><path d="M2 5C2 4 3 3 4 3h16c1 0 2 1 2 2v10C22 16 21 17 20 17H4C3 17 2 16 2 15V5zM12 17l6 4v-4h-6z"/></svg>\n      <span class="zammad-chat-welcome-text">'),n.push(this.T(this.title)),n.push('</span>\n    </div>\n  </div>\n  <div class="zammad-chat-modal"></div>\n  <div class="zammad-scroll-hint is-hidden">\n    <svg class="zammad-scroll-hint-icon" width="20" height="18" viewBox="0 0 20 18"><path d="M0,2.00585866 C0,0.898053512 0.898212381,0 1.99079514,0 L18.0092049,0 C19.1086907,0 20,0.897060126 20,2.00585866 L20,11.9941413 C20,13.1019465 19.1017876,14 18.0092049,14 L1.99079514,14 C0.891309342,14 0,13.1029399 0,11.9941413 L0,2.00585866 Z M10,14 L16,18 L16,14 L10,14 Z" fill-rule="evenodd"/></svg>\n    '),n.push(this.T(this.scrollHint)),n.push('\n  </div>\n  <div class="zammad-chat-body"></div>\n  <form class="zammad-chat-controls">\n    <div class="zammad-chat-input" rows="1" placeholder="'),n.push(this.T("Compose your message…")),n.push('" contenteditable="true"></div>\n    <button type="submit" class="zammad-chat-button zammad-chat-send"'),this.background&&n.push(t(" style='background: "+this.background+"'")),n.push(">"),n.push(this.T("Send")),n.push("</button>\n  </form>\n</div>")}.call(this)}.call(e),e.safe=o,e.escape=s,n.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.customer_timeout=function(e){var t=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},o||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){var e;t.push('<div class="zammad-chat-modal-text">\n  '),this.agent?(t.push("\n    "),t.push(this.T("Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.",this.delay,this.agent))):(t.push("\n    "),t.push(this.T("Since you didn't respond in the last %s minutes your conversation was closed.",this.delay))),t.push("\n  "),t.push('\n  <br>\n  <div class="zammad-chat-button js-restart"'),this.background&&t.push((e=" style='background: "+this.background+"'")&&e.ecoSafe?e:void 0!==e&&null!=e?o(e):""),t.push(">"),t.push(this.T("Start new conversation")),t.push("</div>\n</div>")}.call(this)}.call(e),e.safe=n,e.escape=o,t.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.loader=function(e){var t=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},o||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){t.push('<span class="zammad-chat-loading-animation">\n  <span class="zammad-chat-loading-circle"></span>\n  <span class="zammad-chat-loading-circle"></span>\n  <span class="zammad-chat-loading-circle"></span>\n</span>\n<span class="zammad-chat-modal-text">'),t.push(this.T("Connecting")),t.push("</span>")}.call(this)}.call(e),e.safe=n,e.escape=o,t.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.message=function(e){function t(e){return e&&e.ecoSafe?e:void 0!==e&&null!=e?s(e):""}var n=[],o=(e=e||{}).safe,s=e.escape,s=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},s||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){n.push('<div class="zammad-chat-message zammad-chat-message--'),n.push(t(this.from)),n.push(t(this.unreadClass)),n.push('">\n  <span class="zammad-chat-message-body"'),this.background&&"customer"===this.from&&n.push(t(" style='background: "+this.background+"'")),n.push(">"),n.push(this.message),n.push("</span>\n</div>")}.call(this)}.call(e),e.safe=o,e.escape=s,n.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.status=function(e){var t=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},o||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){t.push('<div class="zammad-chat-status">\n  <div class="zammad-chat-status-inner">\n    '),t.push(this.status),t.push("\n  </div>\n</div>")}.call(this)}.call(e),e.safe=n,e.escape=o,t.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.timestamp=function(e){function t(e){return e&&e.ecoSafe?e:void 0!==e&&null!=e?s(e):""}var n=[],o=(e=e||{}).safe,s=e.escape,s=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},s||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){n.push('<div class="zammad-chat-timestamp"><strong>'),n.push(t(this.label)),n.push("</strong> "),n.push(t(this.time)),n.push("</div>")}.call(this)}.call(e),e.safe=o,e.escape=s,n.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.typingIndicator=function(e){var t=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},o||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){t.push('<div class="zammad-chat-message zammad-chat-message--typing zammad-chat-message--agent">\n  <span class="zammad-chat-message-body">\n    <span class="zammad-chat-loading-animation">\n      <span class="zammad-chat-loading-circle"></span>\n      <span class="zammad-chat-loading-circle"></span>\n      <span class="zammad-chat-loading-circle"></span>\n    </span>\n  </span>\n</div>')}.call(this)}.call(e),e.safe=n,e.escape=o,t.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.waiting_list_timeout=function(e){var t=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},o||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){var e;t.push('<div class="zammad-chat-modal-text">\n  '),t.push(this.T("We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!")),t.push('\n  <br>\n  <div class="zammad-chat-button js-restart"'),this.background&&t.push((e=" style='background: "+this.background+"'")&&e.ecoSafe?e:void 0!==e&&null!=e?o(e):""),t.push(">"),t.push(this.T("Start new conversation")),t.push("</div>\n</div>")}.call(this)}.call(e),e.safe=n,e.escape=o,t.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.waiting=function(e){var t=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){return e&&e.ecoSafe?e:(void 0!==e&&null!=e||(e=""),(e=new String(e)).ecoSafe=!0,e)},o||(e.escape=function(e){return(""+e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){t.push('<div class="zammad-chat-modal-text">\n  <span class="zammad-chat-loading-animation">\n    <span class="zammad-chat-loading-circle"></span>\n    <span class="zammad-chat-loading-circle"></span>\n    <span class="zammad-chat-loading-circle"></span>\n  </span>\n  '),t.push(this.T("All colleagues are busy.")),t.push("<br>\n  "),t.push(this.T("You are on waiting list position <strong>%s</strong>.",this.position)),t.push("\n</div>")}.call(this)}.call(e),e.safe=n,e.escape=o,t.join("")},function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).DOMPurify=t()}(this,function(){"use strict";function je(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(o,t)}var o,s=Object.hasOwnProperty,i=Object.setPrototypeOf,a=Object.isFrozen,r=Object.getPrototypeOf,l=Object.getOwnPropertyDescriptor,Ee=Object.freeze,e=Object.seal,c=Object.create,t="undefined"!=typeof Reflect&&Reflect,d=(d=t.apply)||function(e,t,n){return e.apply(t,n)},Ee=Ee||function(e){return e},e=e||function(e){return e},u=(u=t.construct)||function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))},Ie=h(Array.prototype.forEach),_e=h(Array.prototype.pop),De=h(Array.prototype.push),Me=h(String.prototype.toLowerCase),Re=h(String.prototype.match),He=h(String.prototype.replace),Ne=h(String.prototype.indexOf),et=h(String.prototype.trim),qe=h(RegExp.prototype.test);o=TypeError;function h(s){return function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return d(s,e,n)}}function Pe(e,t){i&&i(e,null);for(var n=t.length;n--;){var o,s=t[n];"string"!=typeof s||(o=Me(s))!==s&&(a(t)||(t[n]=o),s=o),e[s]=!0}return e}function Fe(e){var t=c(null),n=void 0;for(n in e)d(s,e,[n])&&(t[n]=e[n]);return t}function Be(e,t){for(;null!==e;){var n=l(e,t);if(n){if(n.get)return h(n.get);if("function"==typeof n.value)return h(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var We=Ee(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ue=Ee(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ve=Ee(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tt=Ee(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ye=Ee(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),nt=Ee(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qe=Ee(["#text"]),Ke=Ee(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Ge=Ee(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Je=Ee(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ze=Ee(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ot=e(/\{\{[\s\S]*|[\s\S]*\}\}/gm),st=e(/<%[\s\S]*|[\s\S]*%>/gm),it=e(/^data-[\-\w.\u00B7-\uFFFF]/),at=e(/^aria-[\-\w]+$/),rt=e(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lt=e(/^(?:\w+script|data):/i),ct=e(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function $e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}return function M(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,c=function(e){return M(e)};if(c.version="2.3.1",c.removed=[],!r||!r.document||9!==r.document.nodeType)return c.isSupported=!1,c;var l=r.document,s=r.document,R=r.DocumentFragment,e=r.HTMLTemplateElement,d=r.Node,H=r.Element,t=r.NodeFilter,n=r.NamedNodeMap,N=void 0===n?r.NamedNodeMap||r.MozNamedAttrMap:n,q=r.Text,P=r.Comment,F=r.DOMParser,n=r.trustedTypes,o=H.prototype,B=Be(o,"cloneNode"),W=Be(o,"nextSibling"),U=Be(o,"childNodes"),a=Be(o,"parentNode"),u=("function"!=typeof e||(o=s.createElement("template")).content&&o.content.ownerDocument&&(s=o.content.ownerDocument),function(e,t){if("object"!==(void 0===e?"undefined":Xe(e))||"function"!=typeof e.createPolicy)return null;var n=null,o="data-tt-policy-suffix",t="dompurify"+((n=t.currentScript&&t.currentScript.hasAttribute(o)?t.currentScript.getAttribute(o):n)?"#"+n:"");try{return e.createPolicy(t,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+t+" could not be created."),null}}(n,l)),V=u&&A?u.createHTML(""):"",e=s,i=e.implementation,Y=e.createNodeIterator,Q=e.createDocumentFragment,K=e.getElementsByTagName,G=l.importNode,o={};try{o=Fe(s).documentMode?s.documentMode:{}}catch(M){}function h(e){I&&I===e||(e=Fe(e=e&&"object"===(void 0===e?"undefined":Xe(e))?e:{}),b="ALLOWED_TAGS"in e?Pe({},e.ALLOWED_TAGS):ae,w="ALLOWED_ATTR"in e?Pe({},e.ALLOWED_ATTR):re,we="ADD_URI_SAFE_ATTR"in e?Pe(Fe(Se),e.ADD_URI_SAFE_ATTR):Se,ve="ADD_DATA_URI_TAGS"in e?Pe(Fe(be),e.ADD_DATA_URI_TAGS):be,x="FORBID_CONTENTS"in e?Pe({},e.FORBID_CONTENTS):ye,S="FORBID_TAGS"in e?Pe({},e.FORBID_TAGS):{},le="FORBID_ATTR"in e?Pe({},e.FORBID_ATTR):{},O="USE_PROFILES"in e&&e.USE_PROFILES,ce=!1!==e.ALLOW_ARIA_ATTR,de=!1!==e.ALLOW_DATA_ATTR,ue=e.ALLOW_UNKNOWN_PROTOCOLS||!1,T=e.SAFE_FOR_TEMPLATES||!1,C=e.WHOLE_DOCUMENT||!1,z=e.RETURN_DOM||!1,k=e.RETURN_DOM_FRAGMENT||!1,me=!1!==e.RETURN_DOM_IMPORT,A=e.RETURN_TRUSTED_TYPE||!1,pe=e.FORCE_BODY||!1,ge=!1!==e.SANITIZE_DOM,fe=!1!==e.KEEP_CONTENT,L=e.IN_PLACE||!1,v=e.ALLOWED_URI_REGEXP||v,E=e.NAMESPACE||j,T&&(de=!1),k&&(z=!0),O&&(b=Pe({},[].concat($e(Qe))),w=[],!0===O.html&&(Pe(b,We),Pe(w,Ke)),!0===O.svg&&(Pe(b,Ue),Pe(w,Ge),Pe(w,Ze)),!0===O.svgFilters&&(Pe(b,Ve),Pe(w,Ge),Pe(w,Ze)),!0===O.mathMl&&(Pe(b,Ye),Pe(w,Je),Pe(w,Ze))),e.ADD_TAGS&&Pe(b=b===ae?Fe(b):b,e.ADD_TAGS),e.ADD_ATTR&&Pe(w=w===re?Fe(w):w,e.ADD_ATTR),e.ADD_URI_SAFE_ATTR&&Pe(we,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&Pe(x=x===ye?Fe(x):x,e.FORBID_CONTENTS),fe&&(b["#text"]=!0),C&&Pe(b,["html","head","body"]),b.table&&(Pe(b,["tbody"]),delete S.tbody),Ee&&Ee(e),I=e)}function p(t){De(c.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=V}catch(e){t.remove()}}}function J(e){var t=void 0,n=void 0,o=(pe?e="<remove></remove>"+e:n=(o=Re(e,/^[\r\n\t ]+/))&&o[0],u?u.createHTML(e):e);if(E===j)try{t=(new F).parseFromString(o,"text/html")}catch(e){}if(!t||!t.documentElement){t=i.createDocument(E,"template",null);try{t.documentElement.innerHTML=te?"":o}catch(e){}}return o=t.body||t.documentElement,e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),E===j?K.call(t,C?"html":"body")[0]:C?t.documentElement:o}function Z(e){return Y.call(e.ownerDocument||e,e,t.SHOW_ELEMENT|t.SHOW_COMMENT|t.SHOW_TEXT,null,!1)}function m(e){return"object"===(void 0===d?"undefined":Xe(d))?e instanceof d:e&&"object"===(void 0===e?"undefined":Xe(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName}function X(e){var t;if(D("beforeSanitizeElements",e,null),!((n=e)instanceof q||n instanceof P||"string"==typeof n.nodeName&&"string"==typeof n.textContent&&"function"==typeof n.removeChild&&n.attributes instanceof N&&"function"==typeof n.removeAttribute&&"function"==typeof n.setAttribute&&"string"==typeof n.namespaceURI&&"function"==typeof n.insertBefore))return p(e),1;if(Re(e.nodeName,/[\u0080-\uFFFF]/))return p(e),1;var n=Me(e.nodeName);if(D("uponSanitizeElement",e,{tagName:n,allowedTags:b}),!m(e.firstElementChild)&&(!m(e.content)||!m(e.content.firstElementChild))&&qe(/<[/\w]/g,e.innerHTML)&&qe(/<[/\w]/g,e.textContent))return p(e),1;if("select"===n&&qe(/<template/i,e.innerHTML))return p(e),1;if(b[n]&&!S[n])return(!(e instanceof H)||function(e){var t=a(e),n=(t&&t.tagName||(t={namespaceURI:j,tagName:"template"}),Me(e.tagName)),o=Me(t.tagName);if(e.namespaceURI===Ce)return t.namespaceURI===j?"svg"===n:t.namespaceURI===Te?"svg"===n&&("annotation-xml"===o||ke[o]):Boolean(_[n]);if(e.namespaceURI===Te)return t.namespaceURI===j?"math"===n:t.namespaceURI===Ce?"math"===n&&Ae[o]:Boolean(Le[n]);if(e.namespaceURI!==j)return!1;if(t.namespaceURI===Ce&&!Ae[o])return!1;if(t.namespaceURI===Te&&!ke[o])return!1;e=Pe({},["title","style","font","a","script"]);return!Le[n]&&(e[n]||!_[n])}(e))&&("noscript"!==n&&"noembed"!==n||!qe(/<\/no(script|embed)/i,e.innerHTML))?(T&&3===e.nodeType&&(t=e.textContent,t=He(t,f," "),t=He(t,y," "),e.textContent!==t&&(De(c.removed,{element:e.cloneNode()}),e.textContent=t)),D("afterSanitizeElements",e,null),!1):(p(e),!0);if(fe&&!x[n]){var o=a(e)||e.parentNode,s=U(e)||e.childNodes;if(s&&o)for(var i=s.length-1;0<=i;--i)o.insertBefore(B(s[i],!0),W(e))}return p(e),1}function $(e){var t=void 0,n=void 0,o=(D("beforeSanitizeAttributes",e,null),e.attributes);if(o){for(var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w},n=o.length;n--;){r=o[n];var i=r.name,a=r.namespaceURI,t=et(r.value),r=Me(i);if(s.attrName=r,s.attrValue=t,s.keepAttr=!0,s.forceKeepAttr=void 0,D("uponSanitizeAttribute",e,s),t=s.attrValue,!s.forceKeepAttr&&(Oe(i,e),s.keepAttr))if(qe(/\/>/i,t))Oe(i,e);else{T&&(t=He(t,f," "),t=He(t,y," "));var l=e.nodeName.toLowerCase();if(xe(l,r,t))try{a?e.setAttributeNS(a,i,t):e.setAttribute(i,t),_e(c.removed)}catch(e){}}}D("afterSanitizeAttributes",e,null)}}function ee(e){var t,n=Z(e);for(D("beforeSanitizeShadowDOM",e,null);t=n.nextNode();)D("uponSanitizeShadowNode",t,null),X(t)||(t.content instanceof R&&ee(t.content),$(t));D("afterSanitizeShadowDOM",e,null)}var te,g={},f=(c.isSupported="function"==typeof a&&i&&void 0!==i.createHTMLDocument&&9!==o,ot),y=st,ne=it,oe=at,se=lt,ie=ct,v=rt,b=null,ae=Pe({},[].concat($e(We),$e(Ue),$e(Ve),$e(Ye),$e(Qe))),w=null,re=Pe({},[].concat($e(Ke),$e(Ge),$e(Je),$e(Ze))),S=null,le=null,ce=!0,de=!0,ue=!1,T=!1,C=!1,he=!1,pe=!1,z=!1,k=!1,me=!0,A=!1,ge=!0,fe=!0,L=!1,O={},x=null,ye=Pe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ve=null,be=Pe({},["audio","video","img","source","image","track"]),we=null,Se=Pe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",Ce="http://www.w3.org/2000/svg",j="http://www.w3.org/1999/xhtml",E=j,I=null,ze=s.createElement("form"),ke=Pe({},["mi","mo","mn","ms","mtext"]),Ae=Pe({},["foreignobject","desc","title","annotation-xml"]),_=Pe({},Ue),Le=(Pe(_,Ve),Pe(_,tt),Pe({},Ye)),Oe=(Pe(Le,nt),function(e,t){try{De(c.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){De(c.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!w[e])if(z||k)try{p(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}}),D=function(e,t,n){g[e]&&Ie(g[e],function(e){e.call(c,t,n,I)})},xe=function(e,t,n){if(ge&&("id"===t||"name"===t)&&(n in s||n in ze))return!1;if((!de||le[t]||!qe(ne,t))&&(!ce||!qe(oe,t))){if(!w[t]||le[t])return!1;if(!we[t]&&!qe(v,He(n,ie,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ne(n,"data:")||!ve[e])&&(!ue||qe(se,He(n,ie,"")))&&n)return!1}return!0};return c.sanitize=function(e,t){var n,o=void 0,s=void 0,i=void 0;if("string"!=typeof(e=(te=!e)?"\x3c!--\x3e":e)&&!m(e)){if("function"!=typeof e.toString)throw je("toString is not a function");if("string"!=typeof(e=e.toString()))throw je("dirty is not a string, aborting")}if(!c.isSupported){if("object"===Xe(r.toStaticHTML)||"function"==typeof r.toStaticHTML){if("string"==typeof e)return r.toStaticHTML(e);if(m(e))return r.toStaticHTML(e.outerHTML)}return e}if(he||h(t),c.removed=[],!(L="string"==typeof e?!1:L))if(e instanceof d)1===(t=(o=J("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===t.nodeName||"HTML"===t.nodeName?o=t:o.appendChild(t);else{if(!z&&!T&&!C&&-1===e.indexOf("<"))return u&&A?u.createHTML(e):e;if(!(o=J(e)))return z?null:V}o&&pe&&p(o.firstChild);for(var a=Z(L?e:o);n=a.nextNode();)3===n.nodeType&&n===s||X(n)||(n.content instanceof R&&ee(n.content),$(n),s=n);if(s=null,L)return e;if(z){if(k)for(i=Q.call(o.ownerDocument);o.firstChild;)i.appendChild(o.firstChild);else i=o;return i=me?G.call(l,i,!0):i}t=C?o.outerHTML:o.innerHTML;return T&&(t=He(t,f," "),t=He(t,y," ")),u&&A?u.createHTML(t):t},c.setConfig=function(e){h(e),he=!0},c.clearConfig=function(){I=null,he=!1},c.isValidAttribute=function(e,t,n){I||h({});e=Me(e),t=Me(t);return xe(e,t,n)},c.addHook=function(e,t){"function"==typeof t&&(g[e]=g[e]||[],De(g[e],t))},c.removeHook=function(e){g[e]&&_e(g[e])},c.removeHooks=function(e){g[e]&&(g[e]=[])},c.removeAllHooks=function(){g={}},c}()});var extend=function(e,t){for(var n in t)hasProp.call(t,n)&&(e[n]=t[n]);function o(){this.constructor=e}return o.prototype=t.prototype,e.prototype=new o,e.__super__=t.prototype,e},hasProp={}.hasOwnProperty,bind=function(e,t){return function(){return e.apply(t,arguments)}},slice=[].slice;!function(S){var e,n,o,s,i,a,r;function l(e){var t,n,o;for(t in this.options={},n=this.defaults)o=n[t],this.options[t]=o;for(t in e)o=e[t],this.options[t]=o}function c(e){c.__super__.constructor.call(this,e),this.log=new o({debug:this.options.debug,logPrefix:this.options.logPrefix||this.logPrefix})}function d(){return this.log=bind(this.log,this),this.error=bind(this.error,this),this.notice=bind(this.notice,this),this.debug=bind(this.debug,this),d.__super__.constructor.apply(this,arguments)}function u(){return this.stop=bind(this.stop,this),this.start=bind(this.start,this),u.__super__.constructor.apply(this,arguments)}function h(){return this.ping=bind(this.ping,this),this.send=bind(this.send,this),this.reconnect=bind(this.reconnect,this),this.close=bind(this.close,this),this.connect=bind(this.connect,this),this.set=bind(this.set,this),h.__super__.constructor.apply(this,arguments)}function p(e){if(this.removeAttributes=bind(this.removeAttributes,this),this.startTimeoutObservers=bind(this.startTimeoutObservers,this),this.onCssLoaded=bind(this.onCssLoaded,this),this.setAgentOnlineState=bind(this.setAgentOnlineState,this),this.onConnectionEstablished=bind(this.onConnectionEstablished,this),this.setSessionId=bind(this.setSessionId,this),this.onConnectionReestablished=bind(this.onConnectionReestablished,this),this.reconnect=bind(this.reconnect,this),this.destroy=bind(this.destroy,this),this.onScrollHintClick=bind(this.onScrollHintClick,this),this.detectScrolledtoBottom=bind(this.detectScrolledtoBottom,this),this.onLeaveTemporary=bind(this.onLeaveTemporary,this),this.onAgentTypingEnd=bind(this.onAgentTypingEnd,this),this.onAgentTypingStart=bind(this.onAgentTypingStart,this),this.onQueue=bind(this.onQueue,this),this.onQueueScreen=bind(this.onQueueScreen,this),this.onWebSocketClose=bind(this.onWebSocketClose,this),this.onCloseAnimationEnd=bind(this.onCloseAnimationEnd,this),this.close=bind(this.close,this),this.toggle=bind(this.toggle,this),this.sessionClose=bind(this.sessionClose,this),this.onOpenAnimationEnd=bind(this.onOpenAnimationEnd,this),this.open=bind(this.open,this),this.renderMessage=bind(this.renderMessage,this),this.receiveMessage=bind(this.receiveMessage,this),this.onSubmit=bind(this.onSubmit,this),this.onInput=bind(this.onInput,this),this.onReopenSession=bind(this.onReopenSession,this),this.onError=bind(this.onError,this),this.onWebSocketMessage=bind(this.onWebSocketMessage,this),this.send=bind(this.send,this),this.onKeydown=bind(this.onKeydown,this),this.onPaste=bind(this.onPaste,this),this.onDrop=bind(this.onDrop,this),this.render=bind(this.render,this),this.view=bind(this.view,this),this.T=bind(this.T,this),p.__super__.constructor.call(this,e),"undefined"!=typeof jQuery&&this.options.target instanceof jQuery&&(this.log.notice("Chat: target option is a jQuery object. jQuery is not a requirement for the chat any more."),this.options.target=this.options.target.get(0)),this.isFullscreen=S.matchMedia&&S.matchMedia("(max-width: 768px)").matches,this.scrollRoot=this.getScrollRoot(),S.WebSocket&&sessionStorage)return this.options.chatId?(this.options.lang||(this.options.lang=document.documentElement.getAttribute("lang")),this.options.lang&&(this.translations[this.options.lang]||(this.log.debug("lang: No "+this.options.lang+" found, try first two letters"),this.options.lang=this.options.lang.replace(/-.+?$/,"")),this.log.debug("lang: "+this.options.lang)),this.options.host||this.detectHost(),this.loadCss(),this.io=new n(this.options),this.io.set({onOpen:this.render,onClose:this.onWebSocketClose,onMessage:this.onWebSocketMessage,onError:this.onError}),void this.io.connect()):(this.state="unsupported",void this.log.error("Chat: need chatId as option!"));this.state="unsupported",this.log.notice("Chat: Browser not supported!")}r=(r=document.getElementsByTagName("script"))[r.length-1],a=S.location.protocol.replace(":",""),r&&r.src&&(i=r.src.match(".*://([^:/]*).*")[1],a=r.src.match("(.*)://[^:/]*.*")[1]),l.prototype.defaults={debug:!1},extend(c,r=l),e=c,extend(d,r),d.prototype.debug=function(){var e=1<=arguments.length?slice.call(arguments,0):[];if(this.options.debug)return this.log("debug",e)},d.prototype.notice=function(){var e=1<=arguments.length?slice.call(arguments,0):[];return this.log("notice",e)},d.prototype.error=function(){var e=1<=arguments.length?slice.call(arguments,0):[];return this.log("error",e)},d.prototype.log=function(e,t){var n,o,s,i;if(t.unshift("||"),t.unshift(e),t.unshift(this.options.logPrefix),console.log.apply(console,t),this.options.debug){for(i="",o=0,s=t.length;o<s;o++)i+=" ","object"==typeof(n=t[o])?i+=JSON.stringify(n):n&&n.toString?i+=n.toString():i+=n;return(e=document.querySelector(".js-chatLogDisplay"))?e.innerHTML="<div>"+i+"</div>"+e.innerHTML:void 0}},o=d,extend(u,e),u.prototype.timeoutStartedAt=null,u.prototype.logPrefix="timeout",u.prototype.defaults={debug:!1,timeout:4,timeoutIntervallCheck:.5},u.prototype.start=function(){var e,t,n;return this.stop(),t=new Date,e=function(){var e=new Date-new Date(t.getTime()+1e3*n.options.timeout*60);if(n.log.debug("Timeout check for "+n.options.timeout+" minutes (left "+e/1e3+" sec.)"),!(e<0))return n.stop(),n.options.callback()},(n=this).log.debug("Start timeout in "+this.options.timeout+" minutes"),this.intervallId=setInterval(e,1e3*this.options.timeoutIntervallCheck*60)},u.prototype.stop=function(){if(this.intervallId)return this.log.debug("Stop timeout of "+this.options.timeout+" minutes"),clearInterval(this.intervallId)},s=u,extend(h,e),h.prototype.logPrefix="io",h.prototype.set=function(e){var t,n,o=[];for(t in e)n=e[t],o.push(this.options[t]=n);return o},h.prototype.connect=function(){var t,s,n,o;return this.log.debug("Connecting to "+this.options.host),this.ws=new S.WebSocket(""+this.options.host),this.ws.onopen=(t=this,function(e){return t.log.debug("onOpen",e),t.options.onOpen(e),t.ping()}),this.ws.onmessage=(s=this,function(e){var t,n,o=JSON.parse(e.data);for(s.log.debug("onMessage",e.data),t=0,n=o.length;t<n;t++)"pong"===o[t].event&&s.ping();if(s.options.onMessage)return s.options.onMessage(o)}),this.ws.onclose=(n=this,function(e){if(n.log.debug("close websocket connection",e),n.pingDelayId&&clearTimeout(n.pingDelayId),n.manualClose){if(n.log.debug("manual close, onClose callback"),n.manualClose=!1,n.options.onClose)return n.options.onClose(e)}else if(n.log.debug("error close, onError callback"),n.options.onError)return n.options.onError("Connection lost...")}),this.ws.onerror=(o=this,function(e){if(o.log.debug("onError",e),o.options.onError)return o.options.onError(e)})},h.prototype.close=function(){return this.log.debug("close websocket manually"),this.manualClose=!0,this.ws.close()},h.prototype.reconnect=function(){return this.log.debug("reconnect"),this.close(),this.connect()},h.prototype.send=function(e,t){return this.log.debug("send",e,t=null==t?{}:t),e=JSON.stringify({event:e,data:t}),this.ws.send(e)},h.prototype.ping=function(){var e;return(e=this).pingDelayId=setTimeout(function(){return e.send("ping")},29e3)},n=h,extend(p,e),p.prototype.defaults={chatId:void 0,show:!0,target:document.querySelector("body"),host:"",debug:!1,flat:!1,lang:void 0,cssAutoload:!0,cssUrl:void 0,fontSize:void 0,buttonClass:"open-zammad-chat",inactiveClass:"is-inactive",title:"<strong>Chat</strong> with us!",scrollHint:"Scroll down to see new messages",idleTimeout:6,idleTimeoutIntervallCheck:.5,inactiveTimeout:8,inactiveTimeoutIntervallCheck:.5,waitingListTimeout:4,waitingListTimeoutIntervallCheck:.5,onReady:void 0,onCloseAnimationEnd:void 0,onError:void 0,onOpenAnimationEnd:void 0,onConnectionReestablished:void 0,onSessionClosed:void 0,onConnectionEstablished:void 0,onCssLoaded:void 0},p.prototype.logPrefix="chat",p.prototype._messageCount=0,p.prototype.isOpen=!1,p.prototype.blinkOnlineInterval=null,p.prototype.stopBlinOnlineStateTimeout=null,p.prototype.showTimeEveryXMinutes=2,p.prototype.lastTimestamp=null,p.prototype.lastAddedType=null,p.prototype.inputDisabled=!1,p.prototype.inputTimeout=null,p.prototype.isTyping=!1,p.prototype.state="offline",p.prototype.initialQueueDelay=1e4,p.prototype.translations={cs:{"<strong>Chat</strong> with us!":"<strong>Chatujte</strong> s námi!","All colleagues are busy.":"Všichni kolegové jsou vytíženi.","Chat closed by %s":"%s ukončil konverzaci","Compose your message…":"Napište svou zprávu…",Connecting:"Připojování","Connection lost":"Připojení ztraceno","Connection re-established":"Připojení obnoveno",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Srolujte dolů pro zobrazení nových zpráv",Send:"Odeslat","Since you didn't respond in the last %s minutes your conversation was closed.":"Jelikož jste nereagovali v posledních %s minutách, vaše konverzace byla uzavřena.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Jelikož jste nereagovali v posledních %s minutách, vaše konverzace s <strong>%s</strong> byla uzavřena.","Start new conversation":"Zahájit novou konverzaci",Today:"Dnes","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Omlouváme se, že musíte čekat déle, než je vhodné pro získání slotu. Prosím, zkuste to později, případně nám napište e-mail. Děkujeme!","You are on waiting list position <strong>%s</strong>.":"Jste <strong>%s</strong>. v pořadí na čekací listině."},da:{"<strong>Chat</strong> with us!":"<strong>Chat</strong> med os!","All colleagues are busy.":"Alle medarbejdere er optaget.","Chat closed by %s":"Chat lukket af %s","Compose your message…":"Skriv din besked…",Connecting:"Forbinder","Connection lost":"Forbindelse mistet","Connection re-established":"Forbindelse genoprettet",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Scroll ned for at se nye beskeder",Send:"Afsend","Since you didn't respond in the last %s minutes your conversation was closed.":"","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"","Start new conversation":"Start en ny samtale",Today:"I dag","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"","You are on waiting list position <strong>%s</strong>.":"Du er i kø som nummer <strong>%s</strong>."},de:{"<strong>Chat</strong> with us!":"<strong>Chatte</strong> mit uns!","All colleagues are busy.":"Alle Kollegen sind beschäftigt.","Chat closed by %s":"Chat von %s geschlossen","Compose your message…":"Verfassen Sie Ihre Nachricht…",Connecting:"Verbinde","Connection lost":"Verbindung verloren","Connection re-established":"Verbindung wieder aufgebaut",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Nach unten scrollen um neue Nachrichten zu sehen",Send:"Senden","Since you didn't respond in the last %s minutes your conversation was closed.":"Da Sie innerhalb der letzten %s Minuten nicht reagiert haben, wurde Ihre Unterhaltung geschlossen.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Da Sie innerhalb der letzten %s Minuten nicht reagiert haben, wurde Ihre Unterhaltung mit <strong>%s</strong> geschlossen.","Start new conversation":"Neue Unterhaltung starten",Today:"Heute","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Entschuldigung, es dauert länger als erwartet einen freien Platz zu bekommen. Versuchen Sie es später erneut oder senden Sie uns eine E-Mail. Vielen Dank!","You are on waiting list position <strong>%s</strong>.":"Sie sind in der Warteliste auf Position <strong>%s</strong>."},es:{"<strong>Chat</strong> with us!":"<strong>Chatee</strong> con nosotros!","All colleagues are busy.":"Todos los colegas están ocupados.","Chat closed by %s":"Chat cerrado por %s","Compose your message…":"Escribe tu mensaje…",Connecting:"Conectando","Connection lost":"Conexión perdida","Connection re-established":"Conexión reestablecida",Offline:"Desconectado",Online:"En línea","Scroll down to see new messages":"Desplace hacia abajo para ver nuevos mensajes",Send:"Enviar","Since you didn't respond in the last %s minutes your conversation was closed.":"Debido a que usted no ha respondido en los últimos %s minutos, su conversación se ha cerrado.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Debido a que usted no ha respondido en los últimos %s minutos, su conversación con <strong>%s</strong> se ha cerrado.","Start new conversation":"Iniciar nueva conversación",Today:"Hoy","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Lo sentimos, estamos tardando más de lo esperado para asignar un agente. Inténtelo de nuevo más tarde o envíenos un correo electrónico. ¡Gracias!","You are on waiting list position <strong>%s</strong>.":"Usted está en la posición <strong>%s</strong> de la lista de espera."},fr:{"<strong>Chat</strong> with us!":"<strong>Chattez</strong> avec nous !","All colleagues are busy.":"Tous les agents sont occupés.","Chat closed by %s":"Chat fermé par %s","Compose your message…":"Écrivez votre message…",Connecting:"Connexion","Connection lost":"Connexion perdue","Connection re-established":"Connexion ré-établie",Offline:"Hors-ligne",Online:"En ligne","Scroll down to see new messages":"Défiler vers le bas pour voir les nouveaux messages",Send:"Envoyer","Since you didn't respond in the last %s minutes your conversation was closed.":"Sans réponse de votre part depuis %s minutes, votre conservation a été fermée.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Sans réponse de votre part depuis %s minutes, votre conversation avec <strong>%s</strong> a été fermée.","Start new conversation":"Démarrer une nouvelle conversation",Today:"Aujourd'hui","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Nous sommes désolés, trouver un agent disponible prend plus de temps que prévu. Réessayez plus tard ou envoyez-nous un mail. Merci !","You are on waiting list position <strong>%s</strong>.":"Vous êtes actuellement en position <strong>%s</strong> dans la file d'attente."},hr:{"<strong>Chat</strong> with us!":"<strong>Čavrljajte</strong> sa nama!","All colleagues are busy.":"Svi kolege su zauzeti.","Chat closed by %s":"%s zatvara chat","Compose your message…":"Sastavite poruku…",Connecting:"Povezivanje","Connection lost":"Veza prekinuta","Connection re-established":"Veza je ponovno uspostavljena",Offline:"Odsutan",Online:"Dostupan(a)","Scroll down to see new messages":"Pomaknite se prema dolje da biste vidjeli nove poruke",Send:"Šalji","Since you didn't respond in the last %s minutes your conversation was closed.":"Budući da niste odgovorili u posljednjih %s minuta, Vaš je razgovor zatvoren.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Budući da niste odgovorili u posljednjih %s minuta, Vaš je razgovor s <strong>%</strong>s zatvoren.","Start new conversation":"Započni novi razgovor",Today:"Danas","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Oprostite, proces traje duže nego što se očekivalo da biste dobili slobodan termin. Molimo, pokušajte ponovno kasnije ili nam pošaljite e-mail. Hvala!","You are on waiting list position <strong>%s</strong>.":"Nalazite se u redu čekanja na poziciji <strong>%s</strong>."},hu:{"<strong>Chat</strong> with us!":"<strong>Csevegjen</strong> velünk!","All colleagues are busy.":"Minden munkatársunk foglalt.","Chat closed by %s":"A csevegés %s által lezárva","Compose your message…":"Fogalmazza meg üzenetét…",Connecting:"Csatlakozás","Connection lost":"A kapcsolat megszakadt","Connection re-established":"A kapcsolat helyreállt",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Görgessen lefelé az új üzenetek megtekintéséhez",Send:"Küldés","Since you didn't respond in the last %s minutes your conversation was closed.":"Mivel az elmúlt %s percben nem válaszolt, a beszélgetése lezárásra került.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Mivel az elmúlt %s percben nem válaszolt, <strong>%s</strong> munkatársunkkal folytatott beszélgetését lezártuk.","Start new conversation":"Új beszélgetés indítása",Today:"Ma","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Sajnáljuk, hogy a vártnál hosszabb ideig tart a helyfoglalás. Kérjük, próbálja meg később újra, vagy küldjön nekünk egy e-mailt. Köszönjük!","You are on waiting list position <strong>%s</strong>.":"Ön a várólistán a <strong>%s</strong> helyen szerepel."},it:{"<strong>Chat</strong> with us!":"<strong>Chatta</strong> con noi!","All colleagues are busy.":"Tutti i colleghi sono occupati.","Chat closed by %s":"Chat chiusa da %s","Compose your message…":"Scrivi il tuo messaggio…",Connecting:"Connessione in corso","Connection lost":"Connessione persa","Connection re-established":"Connessione ristabilita",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Scorri verso il basso per vedere i nuovi messaggi",Send:"Invia","Since you didn't respond in the last %s minutes your conversation was closed.":"Dato che non hai risposto negli ultimi %s minuti, la conversazione è stata chiusa.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Dato che non hai risposto negli ultimi %s minuti, la conversazione con <strong>%s</strong> è stata chiusa.","Start new conversation":"Avvia una nuova chat",Today:"Oggi","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Siamo spiacenti, ci vuole più tempo del previsto per ottenere uno spazio libero. Riprova più tardi o inviaci un'e-mail. Grazie!","You are on waiting list position <strong>%s</strong>.":"Sei alla posizione <strong>%s</strong> della lista di attesa."},lt:{"<strong>Chat</strong> with us!":"<strong>Kalbėkitės</strong> su mumis!","All colleagues are busy.":"Visi kolegos užimti.","Chat closed by %s":"%s uždarė pokalbį","Compose your message…":"Rašykite žinutę…",Connecting:"Jungiamasi","Connection lost":"Dingo ryšys","Connection re-established":"Ryšys atnaujintas",Offline:"Atsijungęs",Online:"Prisijungęs","Scroll down to see new messages":"Naujos žinutės žemiau",Send:"Siųsti","Since you didn't respond in the last %s minutes your conversation was closed.":"Jūsų pokalbis buvo uždarytas, nes nieko neatsakėte per %s minučių.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Jūsų pokalbis su <strong>%s</strong> buvo uždarytas, nes nieko neatsakėte per %s minučių.","Start new conversation":"Pradėti naują pokalbį",Today:"Šiandien","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Atsiprašome, kad tenka laukti atskymo. Bandykite vėliau arba rašykite el. paštu. Ačiū!","You are on waiting list position <strong>%s</strong>.":"Esate <strong>%s</strong> eilėje."},nl:{"<strong>Chat</strong> with us!":"<strong>Chat</strong> met ons!","All colleagues are busy.":"Alle collega's zijn bezet.","Chat closed by %s":"Chat gesloten door %s","Compose your message…":"Stel je bericht op…",Connecting:"Verbinden","Connection lost":"Verbinding verbroken","Connection re-established":"Verbinding hersteld",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Scroll naar beneden om nieuwe tickets te bekijken",Send:"Verstuur","Since you didn't respond in the last %s minutes your conversation was closed.":"De chat is afgesloten omdat je de laatste %s minuten niet hebt gereageerd.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Je chat met <strong>%s</strong> is afgesloten omdat je niet hebt gereageerd in de laatste %s minuten.","Start new conversation":"Nieuw gesprek starten",Today:"Vandaag","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Het spijt ons, het duurt langer dan verwacht om een chat te starten. Probeer het later nog eens of stuur ons een e-mail. Bedankt!","You are on waiting list position <strong>%s</strong>.":"Je bevindt zich op wachtlijstpositie <strong>%s</strong>."},pl:{"<strong>Chat</strong> with us!":"<strong>Czatuj</strong> z nami!","All colleagues are busy.":"Wszyscy agenci są zajęci.","Chat closed by %s":"Chat zamknięty przez %s","Compose your message…":"Skomponuj swoją wiadomość…",Connecting:"Łączenie","Connection lost":"Utracono połączenie","Connection re-established":"Ponowne nawiązanie połączenia",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Skroluj w dół, aby zobaczyć wiadomości",Send:"Wyślij","Since you didn't respond in the last %s minutes your conversation was closed.":"Ponieważ nie odpowiedziałeś w ciągu ostatnich %s minut, Twoja rozmowa została zamknięta.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Ponieważ nie odpowiedziałeś w ciągu ostatnich %s minut, Twoja rozmowa z <strong>%s</strong> została zamknięta.","Start new conversation":"Rozpocznij nową rozmowę",Today:"Dzisiaj","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Przepraszamy, znalezienie wolnego konsultanta zajmuje więcej czasu niż oczekiwano. Spróbuj ponownie później lub wyślij nam e-mail. Dziękujemy!","You are on waiting list position <strong>%s</strong>.":"Jesteś na pozycji listy oczekujących <strong>%s</strong>."},"pt-br":{"<strong>Chat</strong> with us!":"<strong>Converse</strong> conosco!","All colleagues are busy.":"Nossos atendentes estão ocupados.","Chat closed by %s":"Chat encerrado por %s","Compose your message…":"Escreva sua mensagem…",Connecting:"Conectando","Connection lost":"Conexão perdida","Connection re-established":"Conexão restabelecida",Offline:"Desconectado",Online:"Online","Scroll down to see new messages":"Rolar para baixo para ver novas mensagems",Send:"Enviar","Since you didn't respond in the last %s minutes your conversation was closed.":"Como você não respondeu nos últimos %s minutos, sua conversa foi encerrada.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Como você não respondeu nos últimos %s minutos, sua conversa com <strong>%s</strong> foi encerrada.","Start new conversation":"Iniciar uma nova conversa",Today:"Hoje","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Lamentamos, está demorando mais do que o esperado para conseguir uma vaga. Tente novamente mais tarde ou envie-nos um e-mail. Obrigado!","You are on waiting list position <strong>%s</strong>.":"Você está na posição <strong>%s</strong> da lista de espera."},ru:{"<strong>Chat</strong> with us!":"<strong>Напишите</strong> нам!","All colleagues are busy.":"Все коллеги заняты.","Chat closed by %s":"Чат закрыт %s","Compose your message…":"Составьте сообщение…",Connecting:"Подключение","Connection lost":"Подключение потеряно","Connection re-established":"Подключение восстановлено",Offline:"Оффлайн",Online:"В сети","Scroll down to see new messages":"Прокрутите вниз, чтобы увидеть новые сообщения",Send:"Отправить","Since you didn't respond in the last %s minutes your conversation was closed.":"","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"","Start new conversation":"Начать новую беседу",Today:"Сегодня","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"","You are on waiting list position <strong>%s</strong>.":"Вы находитесь в списке ожидания <strong>%s</strong>."},sr:{"<strong>Chat</strong> with us!":"<strong>Ћаскајте</strong> са нама!","All colleagues are busy.":"Све колеге су заузете.","Chat closed by %s":"Ћаскање затворено од стране %s","Compose your message…":"Напишите поруку…",Connecting:"Повезивање","Connection lost":"Веза је изгубљена","Connection re-established":"Веза је поново успостављена",Offline:"Одсутан(а)",Online:"Доступан(а)","Scroll down to see new messages":"Скролујте на доле за нове поруке",Send:"Пошаљи","Since you didn't respond in the last %s minutes your conversation was closed.":"Пошто нисте одговорили у последњих %s минут(a), ваш разговор је завршен.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Пошто нисте одговорили у последњих %s минут(a), ваш разговор са <strong>%s</strong> је завршен.","Start new conversation":"Започни нови разговор",Today:"Данас","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Жао нам је, добијање празног термина траје дуже од очекиваног. Молимо покушајте поново касније или нам пошаљите имејл поруку. Хвала вам!","You are on waiting list position <strong>%s</strong>.":"Ви сте тренутно <strong>%s.</strong> у реду за чекање."},"sr-latn-rs":{"<strong>Chat</strong> with us!":"<strong>Ćaskajte</strong> sa nama!","All colleagues are busy.":"Sve kolege su zauzete.","Chat closed by %s":"Ćaskanje zatvoreno od strane %s","Compose your message…":"Napišite poruku…",Connecting:"Povezivanje","Connection lost":"Veza je izgubljena","Connection re-established":"Veza je ponovo uspostavljena",Offline:"Odsutan(a)",Online:"Dostupan(a)","Scroll down to see new messages":"Skrolujte na dole za nove poruke",Send:"Pošalji","Since you didn't respond in the last %s minutes your conversation was closed.":"Pošto niste odgovorili u poslednjih %s minut(a), vaš razgovor je završen.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Pošto niste odgovorili u poslednjih %s minut(a), vaš razgovor sa <strong>%s</strong> je završen.","Start new conversation":"Započni novi razgovor",Today:"Danas","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Žao nam je, dobijanje praznog termina traje duže od očekivanog. Molimo pokušajte ponovo kasnije ili nam pošaljite imejl poruku. Hvala vam!","You are on waiting list position <strong>%s</strong>.":"Vi ste trenutno <strong>%s.</strong> u redu za čekanje."},sv:{"<strong>Chat</strong> with us!":"<strong>Chatta</strong> med oss!","All colleagues are busy.":"Alla kollegor är upptagna.","Chat closed by %s":"Chatt stängd av %s","Compose your message…":"Skriv ditt meddelande …",Connecting:"Ansluter","Connection lost":"Anslutningen försvann","Connection re-established":"Anslutningen återupprättas",Offline:"Offline",Online:"Online","Scroll down to see new messages":"Bläddra ner för att se nya meddelanden",Send:"Skicka","Since you didn't respond in the last %s minutes your conversation was closed.":"Din chatt avslutades då du inte svarade inom %s minuter.","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"Chatten stängdes eftersom du inte svarat inom %s minuter i din konversation med <strong>%s</strong>.","Start new conversation":"Starta ny konversation",Today:"Idag","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"Det tar tyvärr längre tid än förväntat att få en ledig plats. Försök igen senare eller skicka ett mejl till oss. Tack!","You are on waiting list position <strong>%s</strong>.":"Du är på väntelistan som position <strong>%s</strong>."},"zh-cn":{"<strong>Chat</strong> with us!":"发起<strong>即时对话</strong>!","All colleagues are busy.":"所有同事都很忙。","Chat closed by %s":"对话被 %s 终止","Compose your message…":"编辑您的信息…",Connecting:"连接中","Connection lost":"连接丢失","Connection re-established":"正在重新建立连接",Offline:"离线",Online:"在线","Scroll down to see new messages":"向下滚动以查看新消息",Send:"发送","Since you didn't respond in the last %s minutes your conversation was closed.":"","Since you didn't respond in the last %s minutes your conversation with <strong>%s</strong> was closed.":"","Start new conversation":"开始新的会话",Today:"今天","We are sorry, it is taking longer than expected to get a slot. Please try again later or send us an email. Thank you!":"","You are on waiting list position <strong>%s</strong>.":"您目前的等候位置是第 <strong>%s</strong> 位."}},p.prototype.sessionId=void 0,p.prototype.scrolledToBottom=!0,p.prototype.scrollSnapTolerance=10,p.prototype.richTextFormatKey={66:!0,73:!0,85:!0,83:!0},p.prototype.T=function(){var e,t,n,o,s=arguments[0],i=2<=arguments.length?slice.call(arguments,1):[];if(this.options.lang&&"en"!==this.options.lang&&(this.translations[this.options.lang]?((o=this.translations[this.options.lang])[s]||this.log.notice("Translation needed for '"+s+"'"),s=o[s]||s):this.log.notice("Translation '"+this.options.lang+"' needed!")),i)for(t=0,n=i.length;t<n;t++)e=i[t],s=s.replace(/%s/,e);return s},p.prototype.view=function(t){return n=this,function(e){return(e=e||{}).T=n.T,e.background=n.options.background,e.flat=n.options.flat,e.fontSize=n.options.fontSize,S.zammadChatTemplates[t](e)};var n},p.prototype.getScrollRoot=function(){var e,t,n;return"scrollingElement"in document?document.scrollingElement:(t=document.documentElement,n=parseInt(t.pageYOffset,10),t.pageYOffset=n+1,e=parseInt(t.pageYOffset,10),(t.pageYOffset=n)<e?t:document.body)},p.prototype.render=function(){var e;return this.el&&document.querySelector(".zammad-chat")||this.renderBase(),(e=document.querySelector("."+this.options.buttonClass))&&e.classList.add(this.options.inactiveClass),this.setAgentOnlineState("online"),this.log.debug("widget rendered"),this.startTimeoutObservers(),this.idleTimeout.start(),this.sessionId=sessionStorage.getItem("sessionId"),this.send("chat_status_customer",{session_id:this.sessionId,url:S.location.href})},p.prototype.renderBase=function(){return this.el&&this.el.remove(),this.options.target.insertAdjacentHTML("beforeend",this.view("chat")({title:this.options.title,scrollHint:this.options.scrollHint})),this.el=this.options.target.querySelector(".zammad-chat"),this.input=this.el.querySelector(".zammad-chat-input"),this.body=this.el.querySelector(".zammad-chat-body"),this.el.querySelector(".js-chat-open").addEventListener("click",this.open),this.el.querySelector(".js-chat-toggle").addEventListener("click",this.toggle),this.el.querySelector(".js-chat-status").addEventListener("click",this.stopPropagation),this.el.querySelector(".zammad-chat-controls").addEventListener("submit",this.onSubmit),this.body.addEventListener("scroll",this.detectScrolledtoBottom),this.el.querySelector(".zammad-scroll-hint").addEventListener("click",this.onScrollHintClick),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("input",this.onInput),this.input.addEventListener("paste",this.onPaste),this.input.addEventListener("drop",this.onDrop),S.addEventListener("beforeunload",this.onLeaveTemporary),S.addEventListener("hashchange",(e=this,function(){if(!e.isOpen)return e.idleTimeout.start();e.sessionId&&e.send("chat_session_notice",{session_id:e.sessionId,message:S.location.href})}));var e},p.prototype.stopPropagation=function(e){return e.stopPropagation()},p.prototype.onDrop=function(e){var t,s,i,a;if(e.stopPropagation(),e.preventDefault(),S.dataTransfer)t=S.dataTransfer;else{if(!e.dataTransfer)throw"No clipboardData support";t=e.dataTransfer}if(s=e.clientX,i=e.clientY,(e=t.files[0]).type.match("image.*"))return(t=new FileReader).onload=(a=this,function(e){return a.resizeImage(e.target.result,460,"auto",2,"image/jpeg","auto",function(e,t){var n,o;return a.isRetina()&&(t/=2),e=e,(n=new Image).style.width="100%",n.style.maxWidth=t+"px",n.src=e,document.caretPositionFromPoint?(t=document.caretPositionFromPoint(s,i),(o=document.createRange()).setStart(t.offsetNode,t.offset),o.collapse(),o.insertNode(n)):document.caretRangeFromPoint?(o=document.caretRangeFromPoint(s,i)).insertNode(n):console.log("could not find carat")})}),t.readAsDataURL(e)},p.prototype.onPaste=function(t){var e,n,o,s,i,a,r,l,c,d,u,h,p,m,g,f,y,v,b,w;if(t.stopPropagation(),t.preventDefault(),t.clipboardData)u=t.clipboardData;else if(S.clipboardData)u=S.clipboardData;else{if(!t.clipboardData)throw"No clipboardData support";u=t.clipboardData}if(e=!1,u&&u.items&&u.items[0]&&("file"!==(n=u.items[0]).kind||"image/png"!==n.type&&"image/jpeg"!==n.type||(n=n.getAsFile(),(b=new FileReader).onload=(w=this,function(e){return w.resizeImage(e.target.result,460,"auto",2,"image/jpeg","auto",function(e,t){var n;return w.isRetina()&&(t/=2),(n=new Image).style.width="100%",n.style.maxWidth=t+"px",n.src=e,document.execCommand("insertHTML",!1,n)})}),b.readAsDataURL(n),e=!0)),!e){n=b=void 0;try{b=u.getData("text/html"),n="html",b&&0!==b.length||(n="text",b=u.getData("text/plain")),b&&0!==b.length||(n="text2",b=u.getData("text"))}catch(e){t=e,console.log("Sorry, can't insert markup because browser is not supporting it."),n="text3",b=u.getData("text")}if("text"!==n&&"text2"!==n&&"text3"!==n||(b=(b="<div>"+b.replace(/\n/g,"</div><div>")+"</div>").replace(/<div><\/div>/g,"<div><br></div>")),console.log("p",n,b),"html"===n){for(e=document.createElement("div"),t=DOMPurify.sanitize(b),this.log.debug("sanitized HTML clipboard",t),e.innerHTML=t,u=!1,t=b,v=new RegExp("<(/w|w):[A-Za-z]"),t.match(v)&&(u=!0,t=t.replace(v,"")),v=new RegExp("<(/o|o):[A-Za-z]"),t.match(v)&&(u=!0,t=t.replace(v,"")),o=0,a=(m=(e=u?this.wordFilter(e):e).childNodes).length;o<a;o++)8===(h=m[o]).nodeType&&h.remove();for(s=0,r=(g=e.querySelectorAll("a, font, small, time, form, label")).length;s<r;s++)(h=g[s]).outerHTML=h.innerHTML;for(i=0,l=(f=e.querySelectorAll("textarea")).length;i<l;i++)p=(h=f[i]).outerHTML,v=new RegExp("<"+h.tagName,"i"),p=p.replace(v,"<div"),v=new RegExp("</"+h.tagName,"i"),p=p.replace(v,"</div"),h.outerHTML=p;for(d=0,c=(y=e.querySelectorAll("font, img, svg, input, select, button, style, applet, embed, noframes, canvas, script, frame, iframe, meta, link, title, head, fieldset")).length;d<c;d++)(h=y[d]).remove();this.removeAttributes(e),b=e.innerHTML}return"text3"===n?this.pasteHtmlAtCaret(b):document.execCommand("insertHTML",!1,b),!0}},p.prototype.onKeydown=function(e){var t;if(this.inputDisabled||e.shiftKey||13!==e.keyCode||(e.preventDefault(),this.sendMessage()),t=!1,(t=(e.altKey||e.ctrlKey||!e.metaKey)&&(e.altKey||!e.ctrlKey||e.metaKey)?t:!0)&&this.richTextFormatKey[e.keyCode])return e.preventDefault(),66===e.keyCode?(document.execCommand("bold"),!0):73===e.keyCode?(document.execCommand("italic"),!0):85===e.keyCode?(document.execCommand("underline"),!0):83===e.keyCode?(document.execCommand("strikeThrough"),!0):void 0},p.prototype.send=function(e,t){return(t=null==t?{}:t).chat_id=this.options.chatId,this.io.send(e,t)},p.prototype.onWebSocketMessage=function(e){for(var t,n=0,o=e.length;n<o;n++)switch(t=e[n],this.log.debug("ws:onmessage",t),t.event){case"chat_error":this.log.notice(t.data),t.data&&"chat_disabled"===t.data.state&&this.destroy({remove:!0});break;case"chat_session_message":if(t.data.self_written)return;this.receiveMessage(t.data);break;case"chat_session_typing":if(t.data.self_written)return;this.onAgentTypingStart();break;case"chat_session_start":this.onConnectionEstablished(t.data);break;case"chat_session_queue":this.onQueueScreen(t.data);break;case"chat_session_closed":case"chat_session_left":this.onSessionClosed(t.data);break;case"chat_status_customer":switch(t.data.state){case"online":this.sessionId=void 0,!this.options.cssAutoload||this.cssLoaded?this.onReady():this.socketReady=!0;break;case"offline":this.onError("Zammad Chat: No agent online");break;case"chat_disabled":this.onError("Zammad Chat: Chat is disabled");break;case"no_seats_available":this.onError("Zammad Chat: Too many clients in queue. Clients in queue: "+t.data.queue);break;case"reconnect":this.onReopenSession(t.data)}}},p.prototype.onReady=function(){var e;if(this.log.debug("widget ready for use"),(e=document.querySelector("."+this.options.buttonClass))&&(e.addEventListener("click",this.open),e.classList.remove(this.options.inactiveClass)),"function"==typeof(e=this.options).onReady&&e.onReady(),this.options.show)return this.show()},p.prototype.onError=function(e){var t;return this.log.debug(e),this.addStatus(e),(t=document.querySelector("."+this.options.buttonClass))&&t.classList.add("zammad-chat-is-hidden"),this.isOpen?(this.disableInput(),this.destroy({remove:!1})):this.destroy({remove:!0}),"function"==typeof(t=this.options).onError?t.onError(e):void 0},p.prototype.onReopenSession=function(e){var t,n,o,s,i;if(this.log.debug("old messages",e.session),this.inactiveTimeout.start(),i=sessionStorage.getItem("unfinished_message"),e.agent){for(this.onConnectionEstablished(e),t=0,n=(s=e.session).length;t<n;t++)o=s[t],this.renderMessage({message:o.content,id:o.id,from:o.created_by_id?"agent":"customer"});i&&(this.input.innerHTML=i)}if(e.position&&this.onQueue(e),this.show(),this.open(),this.scrollToBottom(),i)return this.input.focus()},p.prototype.onInput=function(){for(var e=this.el.querySelectorAll(".zammad-chat-message--unread"),t=0,n=e.length;t<n;t++)e[t].classList.remove("zammad-chat-message--unread");return sessionStorage.setItem("unfinished_message",this.input.innerHTML),this.onTyping()},p.prototype.onTyping=function(){if(!(this.isTyping&&this.isTyping>new Date((new Date).getTime()-1500)))return this.isTyping=new Date,this.send("chat_session_typing",{session_id:this.sessionId}),this.inactiveTimeout.start()},p.prototype.onSubmit=function(e){return e.preventDefault(),this.sendMessage()},p.prototype.sendMessage=function(){var e,t=this.input.innerHTML;if(t)return this.inactiveTimeout.start(),sessionStorage.removeItem("unfinished_message"),e=this.view("message")({message:t,from:"customer",id:this._messageCount++,unreadClass:""}),this.maybeAddTimestamp(),this.el.querySelector(".zammad-chat-message--typing")?(this.lastAddedType="typing-placeholder",this.el.querySelector(".zammad-chat-message--typing").insertAdjacentHTML("beforebegin",e)):(this.lastAddedType="message--customer",this.body.insertAdjacentHTML("beforeend",e)),this.input.innerHTML="",this.scrollToBottom(),this.send("chat_session_message",{content:t,id:this._messageCount,session_id:this.sessionId})},p.prototype.receiveMessage=function(e){return this.inactiveTimeout.start(),this.onAgentTypingEnd(),this.maybeAddTimestamp(),this.renderMessage({message:e.message.content,id:e.id,from:"agent"}),this.scrollToBottom({showHint:!0})},p.prototype.renderMessage=function(e){return this.lastAddedType="message--"+e.from,e.unreadClass=document.hidden?" zammad-chat-message--unread":"",this.body.insertAdjacentHTML("beforeend",this.view("message")(e))},p.prototype.open=function(){var e;if(!this.isOpen)return this.isOpen=!0,this.log.debug("open widget"),this.show(),this.sessionId||this.showLoader(),this.el.classList.add("zammad-chat-is-open"),e=this.el.clientHeight-this.el.querySelector(".zammad-chat-header").offsetHeight,this.el.style.transform="translateY("+e+"px)",this.el.clientHeight,this.sessionId?(this.el.style.transform="",this.onOpenAnimationEnd()):(this.el.addEventListener("transitionend",this.onOpenAnimationEnd),this.el.classList.add("zammad-chat--animate"),this.el.clientHeight,this.el.style.transform="",this.send("chat_session_init",{url:S.location.href}));this.log.debug("widget already open, block")},p.prototype.onOpenAnimationEnd=function(){var e;return this.el.removeEventListener("transitionend",this.onOpenAnimationEnd),this.el.classList.remove("zammad-chat--animate"),this.idleTimeout.stop(),this.isFullscreen&&this.disableScrollOnRoot(),"function"==typeof(e=this.options).onOpenAnimationEnd?e.onOpenAnimationEnd():void 0},p.prototype.sessionClose=function(){return this.send("chat_session_close",{session_id:this.sessionId}),this.inactiveTimeout.stop(),this.waitingListTimeout.stop(),sessionStorage.removeItem("unfinished_message"),this.onInitialQueueDelayId&&clearTimeout(this.onInitialQueueDelayId),this.setSessionId(void 0)},p.prototype.toggle=function(e){return this.isOpen?this.close(e):this.open(e)},p.prototype.close=function(e){if(this.isOpen)return this.initDelayId&&clearTimeout(this.initDelayId),this.sessionId&&(this.log.debug("session close before widget close"),this.sessionClose()),this.log.debug("close widget"),e&&e.stopPropagation(),this.isFullscreen&&this.enableScrollOnRoot(),e=this.el.clientHeight-this.el.querySelector(".zammad-chat-header").offsetHeight,this.el.addEventListener("transitionend",this.onCloseAnimationEnd),this.el.classList.add("zammad-chat--animate"),document.offsetHeight,this.el.style.transform="translateY("+e+"px)";this.log.debug("can't close widget, it's not open")},p.prototype.onCloseAnimationEnd=function(){var e;return this.el.removeEventListener("transitionend",this.onCloseAnimationEnd),this.el.classList.remove("zammad-chat-is-open","zammad-chat--animate"),this.el.style.transform="",this.showLoader(),this.el.querySelector(".zammad-chat-welcome").classList.remove("zammad-chat-is-hidden"),this.el.querySelector(".zammad-chat-agent").classList.add("zammad-chat-is-hidden"),this.el.querySelector(".zammad-chat-agent-status").classList.add("zammad-chat-is-hidden"),this.isOpen=!1,"function"==typeof(e=this.options).onCloseAnimationEnd&&e.onCloseAnimationEnd(),this.io.reconnect()},p.prototype.onWebSocketClose=function(){if(!this.isOpen)return this.el?(this.el.classList.remove("zammad-chat-is-shown"),this.el.classList.remove("zammad-chat-is-loaded")):void 0},p.prototype.show=function(){if("offline"!==this.state)return this.el.classList.add("zammad-chat-is-loaded"),this.el.classList.add("zammad-chat-is-shown")},p.prototype.disableInput=function(){return this.inputDisabled=!0,this.input.setAttribute("contenteditable",!1),this.el.querySelector(".zammad-chat-send").disabled=!0,this.io.close()},p.prototype.enableInput=function(){return this.inputDisabled=!1,this.input.setAttribute("contenteditable",!0),this.el.querySelector(".zammad-chat-send").disabled=!1},p.prototype.hideModal=function(){return this.el.querySelector(".zammad-chat-modal").innerHTML=""},p.prototype.onQueueScreen=function(e){var t,n;if(this.setSessionId(e.session_id),t=function(){return n.onQueue(e),n.waitingListTimeout.start()},!(n=this).initialQueueDelay||this.onInitialQueueDelayId)return this.onInitialQueueDelayId&&clearTimeout(this.onInitialQueueDelayId),t();this.onInitialQueueDelayId=setTimeout(t,this.initialQueueDelay)},p.prototype.onQueue=function(e){return this.log.notice("onQueue",e.position),this.inQueue=!0,this.el.querySelector(".zammad-chat-modal").innerHTML=this.view("waiting")({position:e.position})},p.prototype.onAgentTypingStart=function(){if(this.stopTypingId&&clearTimeout(this.stopTypingId),this.stopTypingId=setTimeout(this.onAgentTypingEnd,3e3),!this.el.querySelector(".zammad-chat-message--typing")&&(this.maybeAddTimestamp(),this.body.insertAdjacentHTML("beforeend",this.view("typingIndicator")()),this.isVisible(this.el.querySelector(".zammad-chat-message--typing"),!0)))return this.scrollToBottom()},p.prototype.onAgentTypingEnd=function(){if(this.el.querySelector(".zammad-chat-message--typing"))return this.el.querySelector(".zammad-chat-message--typing").remove()},p.prototype.onLeaveTemporary=function(){if(this.sessionId)return this.send("chat_session_leave_temporary",{session_id:this.sessionId})},p.prototype.maybeAddTimestamp=function(){var e,t,n=Date.now();if(!this.lastTimestamp||n-this.lastTimestamp>6e4*this.showTimeEveryXMinutes)return e=this.T("Today"),t=(new Date).toTimeString().substr(0,5),"timestamp"===this.lastAddedType?(this.updateLastTimestamp(e,t),this.lastTimestamp=n):(this.body.insertAdjacentHTML("beforeend",this.view("timestamp")({label:e,time:t})),this.lastTimestamp=n,this.lastAddedType="timestamp",this.scrollToBottom())},p.prototype.updateLastTimestamp=function(e,t){var n;if(this.el&&(n=this.el.querySelectorAll(".zammad-chat-body .zammad-chat-timestamp")))return n[n.length-1].outerHTML=this.view("timestamp")({label:e,time:t})},p.prototype.addStatus=function(e){if(this.el)return this.maybeAddTimestamp(),this.body.insertAdjacentHTML("beforeend",this.view("status")({status:e})),this.scrollToBottom()},p.prototype.detectScrolledtoBottom=function(){var e=this.body.scrollTop+this.body.offsetHeight;if(this.scrolledToBottom=Math.abs(e-this.body.scrollHeight)<=this.scrollSnapTolerance,this.scrolledToBottom)return this.el.querySelector(".zammad-scroll-hint").classList.add("is-hidden")},p.prototype.showScrollHint=function(){return this.el.querySelector(".zammad-scroll-hint").classList.remove("is-hidden"),this.body.scrollTop=this.body.scrollTop+this.el.querySelector(".zammad-scroll-hint").offsetHeight},p.prototype.onScrollHintClick=function(){return this.body.scrollTo({top:this.body.scrollHeight,behavior:"smooth"})},p.prototype.scrollToBottom=function(e){e=(null!=e?e:{showHint:!1}).showHint;return this.scrolledToBottom?this.body.scrollTop=this.body.scrollHeight:e?this.showScrollHint():void 0},p.prototype.destroy=function(e){return this.log.debug("destroy widget",e=null==e?{}:e),this.setAgentOnlineState("offline"),e.remove&&this.el&&(this.el.remove(),(e=document.querySelector("."+this.options.buttonClass))&&(e.classList.add(this.options.inactiveClass),e.style.display="none")),this.waitingListTimeout&&this.waitingListTimeout.stop(),this.inactiveTimeout&&this.inactiveTimeout.stop(),this.idleTimeout&&this.idleTimeout.stop(),this.io.close()},p.prototype.reconnect=function(){return this.log.notice("reconnecting"),this.disableInput(),this.lastAddedType="status",this.setAgentOnlineState("connecting"),this.addStatus(this.T("Connection lost"))},p.prototype.onConnectionReestablished=function(){var e;return this.lastAddedType="status",this.setAgentOnlineState("online"),this.addStatus(this.T("Connection re-established")),"function"==typeof(e=this.options).onConnectionReestablished?e.onConnectionReestablished():void 0},p.prototype.onSessionClosed=function(e){var t;return this.addStatus(this.T("Chat closed by %s",e.realname)),this.disableInput(),this.setAgentOnlineState("offline"),this.inactiveTimeout.stop(),"function"==typeof(t=this.options).onSessionClosed?t.onSessionClosed(e):void 0},p.prototype.setSessionId=function(e){return void 0===(this.sessionId=e)?sessionStorage.removeItem("sessionId"):sessionStorage.setItem("sessionId",e)},p.prototype.onConnectionEstablished=function(e){var t;return this.onInitialQueueDelayId&&clearTimeout(this.onInitialQueueDelayId),this.inQueue=!1,e.agent&&(this.agent=e.agent),e.session_id&&this.setSessionId(e.session_id),this.body.innerHTML="",this.el.querySelector(".zammad-chat-agent").innerHTML=this.view("agent")({agent:this.agent}),this.enableInput(),this.hideModal(),this.el.querySelector(".zammad-chat-welcome").classList.add("zammad-chat-is-hidden"),this.el.querySelector(".zammad-chat-agent").classList.remove("zammad-chat-is-hidden"),this.el.querySelector(".zammad-chat-agent-status").classList.remove("zammad-chat-is-hidden"),this.isFullscreen||this.input.focus(),this.setAgentOnlineState("online"),this.waitingListTimeout.stop(),this.idleTimeout.stop(),this.inactiveTimeout.start(),"function"==typeof(t=this.options).onConnectionEstablished?t.onConnectionEstablished(e):void 0},p.prototype.showCustomerTimeout=function(){return this.el.querySelector(".zammad-chat-modal").innerHTML=this.view("customer_timeout")({agent:this.agent.name,delay:this.options.inactiveTimeout}),this.el.querySelector(".js-restart").addEventListener("click",function(){return location.reload()}),this.sessionClose()},p.prototype.showWaitingListTimeout=function(){return this.el.querySelector(".zammad-chat-modal").innerHTML=this.view("waiting_list_timeout")({delay:this.options.watingListTimeout}),this.el.querySelector(".js-restart").addEventListener("click",function(){return location.reload()}),this.sessionClose()},p.prototype.showLoader=function(){return this.el.querySelector(".zammad-chat-modal").innerHTML=this.view("loader")()},p.prototype.setAgentOnlineState=function(e){var t;if(this.state=e,this.el)return t=e.charAt(0).toUpperCase()+e.slice(1),this.el.querySelector(".zammad-chat-agent-status").dataset.status=e,this.el.querySelector(".zammad-chat-agent-status").textContent=this.T(t)},p.prototype.detectHost=function(){var e="https"===a?"wss://":"ws://";return this.options.host=""+e+i+"/ws"},p.prototype.loadCss=function(){var e,t;if(this.options.cssAutoload)return(t=this.options.cssUrl)||(t=this.options.host.replace(/^wss/i,"https").replace(/^ws/i,"http").replace(/\/ws$/i,""),t+="/assets/chat/chat.css"),this.log.debug("load css from '"+t+"'"),t="@import url('"+t+"');",(e=document.createElement("link")).onload=this.onCssLoaded,e.rel="stylesheet",e.href="data:text/css,"+escape(t),document.getElementsByTagName("head")[0].appendChild(e)},p.prototype.onCssLoaded=function(){var e;return this.cssLoaded=!0,this.socketReady&&this.onReady(),"function"==typeof(e=this.options).onCssLoaded?e.onCssLoaded():void 0},p.prototype.startTimeoutObservers=function(){var e,t,n;return this.idleTimeout=new s({logPrefix:"idleTimeout",debug:this.options.debug,timeout:this.options.idleTimeout,timeoutIntervallCheck:this.options.idleTimeoutIntervallCheck,callback:(e=this,function(){return e.log.debug("Idle timeout reached, hide widget",new Date),e.destroy({remove:!0})})}),this.inactiveTimeout=new s({logPrefix:"inactiveTimeout",debug:this.options.debug,timeout:this.options.inactiveTimeout,timeoutIntervallCheck:this.options.inactiveTimeoutIntervallCheck,callback:(t=this,function(){return t.log.debug("Inactive timeout reached, show timeout screen.",new Date),t.showCustomerTimeout(),t.destroy({remove:!1})})}),this.waitingListTimeout=new s({logPrefix:"waitingListTimeout",debug:this.options.debug,timeout:this.options.waitingListTimeout,timeoutIntervallCheck:this.options.waitingListTimeoutIntervallCheck,callback:(n=this,function(){return n.log.debug("Waiting list timeout reached, show timeout screen.",new Date),n.showWaitingListTimeout(),n.destroy({remove:!1})})})},p.prototype.disableScrollOnRoot=function(){return this.rootScrollOffset=this.scrollRoot.scrollTop,this.scrollRoot.style.overflow="hidden",this.scrollRoot.style.position="fixed"},p.prototype.enableScrollOnRoot=function(){return this.scrollRoot.scrollTop=this.rootScrollOffset,this.scrollRoot.style.overflow="",this.scrollRoot.style.position=""},p.prototype.isVisible=function(e,n,o,s){var i,a,r,l;if(!(e.length<1))return l=S.innerWidth,r=S.innerHeight,s=s||"both",o=!0!==o||t.offsetWidth*t.offsetHeight,a=0<=(e=e.getBoundingClientRect()).top&&e.top<r,r=0<e.bottom&&e.bottom<=r,i=0<=e.left&&e.left<l,e=0<e.right&&e.right<=l,l=n?a||r:a&&r,a=n?i||e:i&&e,"both"===s?o&&l&&a:"vertical"===s?o&&l:"horizontal"===s?o&&a:void 0},p.prototype.isRetina=function(){var e;return!!S.matchMedia&&((e=S.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen  and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)"))&&e.matches||1<S.devicePixelRatio)},p.prototype.resizeImage=function(e,o,s,i,a,r,l,t){var c;return null==o&&(o="auto"),null==s&&(s="auto"),null==i&&(i=1),null==t&&(t=!0),(c=new Image).onload=function(){var e,t=c.width,n=c.height;return console.log("ImageService","current size",t,n),"auto"===s&&"auto"===o&&(o=t,s=n),"auto"===s&&(s=n/(t/o)),e=!1,(o="auto"===o?n/(t/s):o)<t||s<n?(e=!0,o*=i,s*=i):(o=t,s=n),(t=document.createElement("canvas")).width=o,t.height=s,t.getContext("2d").drawImage(c,0,0,o,s),"auto"===r&&(r=o<200&&s<200?1:o<400&&s<400?.9:o<600&&s<600?.8:o<900&&s<900?.7:.6),n=t.toDataURL(a,r),e?(console.log("ImageService","resize",o/i,s/i,r,.75*n.length/1024/1024,"in mb"),void l(n,o/i,s/i,!0)):(console.log("ImageService","no resize",o,s,r,.75*n.length/1024/1024,"in mb"),l(n,o,s,!1))},c.src=e},p.prototype.pasteHtmlAtCaret=function(e){var t,n,o,s,i=void 0,a=void 0;if(S.getSelection){if((i=S.getSelection()).getRangeAt&&i.rangeCount){for((a=i.getRangeAt(0)).deleteContents(),(t=document.createElement("div")).innerHTML=e,n=document.createDocumentFragment(s,o);s=t.firstChild;)o=n.appendChild(s);if(a.insertNode(n),o)return(a=a.cloneRange()).setStartAfter(o),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}}else if(document.selection&&"Control"!==document.selection.type)return document.selection.createRange().pasteHTML(e)},p.prototype.wordFilter=function(e){var t,n,o,s,i,a,r,l,c,d,u,h,p,m,g,f,y,v,b,w,S,T,C,z,k,A,L,O,x,j,E,I,R,H,N,_,q,D,M=e.html();for(M=(M=(M=(M=M.replace(/<!--[\s\S]+?-->/gi,"")).replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,"")).replace(/<(\/?)s>/gi,"<$1strike>")).replace(/&nbsp;/gi," "),e.innerHTML=M,s=0,l=(k=e.querySelectorAll("p")).length;s<l;s++)q=(S=k[s]).getAttribute("style"),(v=/mso-list:\w+ \w+([0-9]+)/.exec(q))&&(S.dataset._listLevel=parseInt(v[1],10));for(T=null,i=r=0,c=(A=e.querySelectorAll("p")).length;i<c;i++)if(void 0!==(t=(S=A[i]).dataset._listLevel)){if(D=S.textContent,f="<ul></ul>",/^\s*\w+\./.test(D)&&(f=(v=/([0-9])\./.exec(D))?null!=(O=1<(D=parseInt(v[1],10)))?O:'<ol start="'+D+{'"></ol>':"<ol></ol>"}:"<ol></ol>"),r<t&&(0===r&&(S.insertAdjacentHTML("beforebegin",f),T=S.previousElementSibling),T.insertAdjacentHTML("beforeend",f)),t<r)for(o=a=x=o,j=r-t;x<=j?a<=j:j<=a;o=x<=j?++a:--a)T=T.parentNode;S.querySelector("span:first")&&S.querySelector("span:first").remove(),T.insertAdjacentHTML("beforeend","<li>"+S.innerHTML+"</li>"),S.remove(),r=t}else r=0;for(y=0,d=(E=e.querySelectorAll("[style]")).length;y<d;y++)(n=E[y]).removeAttribute("style");for(b=0,u=(I=e.querySelectorAll("[align]")).length;b<u;b++)(n=I[b]).removeAttribute("align");for(w=0,h=(R=e.querySelectorAll("span")).length;w<h;w++)(n=R[w]).outerHTML=n.innerHTML;for(C=0,p=(H=e.querySelectorAll("span:empty")).length;C<p;C++)(n=H[C]).remove();for(z=0,m=(N=e.querySelectorAll("[class^='Mso']")).length;z<m;z++)(n=N[z]).removeAttribute("class");for(_=0,g=(L=e.querySelectorAll("p:empty")).length;_<g;_++)(n=L[_]).remove();return e},p.prototype.removeAttribute=function(e){var t,n,o,s,i;if(e){for(i=[],n=0,o=(s=e.attributes).length;n<o;n++)t=s[n],i.push(e.removeAttribute(t.name));return i}},p.prototype.removeAttributes=function(e){for(var t,n=e.querySelectorAll("*"),o=0,s=n.length;o<s;o++)t=n[o],this.removeAttribute(t);return e},S.ZammadChat=p}(window);