(function(){/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var n,ba=function(a){var b=0;return function(){return b/g,Ha=/"/g,Ia=/'/g,Ja=/\x00/g,Ka=/[\x00&<>"']/,B=function(a){return-1!=La.indexOf(a)};var La;a:{var Ma=Ca.navigator;if(Ma){var Na=Ma.userAgent;if(Na){La=Na;break a}}La=""};var Oa=function(){return B("iPad")||B("Android")&&!B("Mobile")||B("Silk")};var Pa=function(a){a||(a={});var b=(new Date).getTimezoneOffset();0!=b&&(b=-b/60);var c=window.innerWidth,d=window.innerHeight;this.c={userDevice:Oa()?"TABLET":!Oa()&&(B("iPod")||B("iPhone")||B("Android")||B("IEMobile"))?"MOBILE":"COMPUTER",creativeSize:c&&d?c+"x"+d:"",userTimezone:b,language:navigator.language,customParameters:a};"undefined"!==typeof Enabler&&(Enabler.isInitialized()?this.f():Enabler.addEventListener(studio.events.StudioEvent.INIT,this.f.bind(this)))}; Pa.prototype.f=function(){this.c.creativeId=Enabler.getDartCreativeId();this.c.userZipCode=Enabler.getUserZipCode();this.c.userState=Enabler.getUserState();this.c.userCountry=Enabler.getUserCountry();var a=this.c,b=!1,c=Enabler.getParameter("adSiteUrl");if(null==c||/google.com/i.test(c)||/demos.adlingo.com/i.test(c)||/googleplex.com/i.test(c)||/googleapis.com/i.test(c)||/googleusercontent.com/i.test(c))b=!0;a.isAdLingoPreview=b;this.c.insertionOrderId=Enabler.getParameter("insertion_order_id");this.c.lineItemId= Enabler.getParameter("line_item_id");this.c.placementId=Enabler.getDartPageId()};var Ra=function(a,b){var c=this;this.f=new Set;this.h=b;this.c=a.botName?a.botName:"";this.g=function(){if("undefined"===typeof Enabler)return!0;var e=Enabler.getParameter("adSiteUrl");return!e||e.match(/google.com/i)||e.match(/googleplex.com/i)||e.match(/googleusercontent.com/i)||e.match(/googleapis.com/i)||e.match(/localhost/i)||e.match(/127.0.0.1/i)}();var d=window.onerror||function(){};window.onerror=function(e,k,g,f,h){h&&Qa(c,h);d(e,k,g,f,h);return!1}},Qa=function(a,b){var c=b.message;if(!a.g&& !a.f.has(c)){console.log("Reporting error: "+c);a.f.add(c);var d={serviceContext:{service:"web"},context:{httpRequest:{userAgent:window.navigator.userAgent,url:window.location.href}}};b.stack?d.message=a.c+": "+c+"\n"+b.stack:(d.context.reportLocation={filePath:"unknown",lineNumber:0,functionName:"unknown"},d.message=a.c+": "+c);b=new XMLHttpRequest;b.open("POST",a.h,!0);b.setRequestHeader("Content-Type","application/json; charset=UTF-8");b.send(JSON.stringify(d))}},Sa=function(a,b){b=Error(b);Qa(a, b);throw b;},Ta=function(a,b){var c=b;"string"===typeof b&&(c={message:b,stack:null});Qa(a,c);console.error(c.message,c.stack)};var Ua=function(){this.c=Date.now()};var Va=function(a,b){var c=void 0;return new (c||(c=Promise))(function(d,e){function k(h){try{f(b.next(h))}catch(l){e(l)}}function g(h){try{f(b["throw"](h))}catch(l){e(l)}}function f(h){h.done?d(h.value):(new c(function(l){l(h.value)})).then(k,g)}f((b=b.apply(a,void 0)).next())})};/* Copyright (c) 2019 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ /* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ var Wa=new WeakMap,Xa=function(a){return"function"===typeof a&&Wa.has(a)};var Ya="undefined"!==typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,Za=function(a,b,c){for(c=void 0===c?null:c;b!==c;){var d=b.nextSibling;a.removeChild(b);b=d}};var $a=function(a){var b=0,c=function(){b=0};return function(d){b||(b=Ca.setTimeout(c,500),a.apply(void 0,arguments))}};var cb=function(a,b){this.f=a===ab&&b||"";this.g=bb};cb.prototype.aa=!0;cb.prototype.c=function(){return this.f};var bb={},ab={};var eb=function(){this.f=db};eb.prototype.aa=!0;var db={};eb.prototype.c=function(){return"".toString()};var ib=function(a,b){this.f=a===fb&&b||"";this.g=hb};ib.prototype.aa=!0;ib.prototype.c=function(){return this.f.toString()};var hb={},fb={};var D=function(a,b){this.f=a===jb&&b||"";this.g=kb};D.prototype.aa=!0;D.prototype.c=function(){return this.f.toString()};var E=function(a){var b=String(a.substr(0,4)).toLowerCase();0==("tel:"b&&(a=a.substring(0,b-3)+"...");return a},rb=function(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};/* Copyright (c) 2018 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ function sb(a){return a&&a.aa?a.c():a} var tb={CONSTANT:{ba:cb,ca:function(a){return a instanceof cb&&a.constructor===cb&&a.g===bb?a.f:"type_error:Const"}},JAVASCRIPT:{ba:eb,ca:function(a){return(a instanceof eb&&a.constructor===eb&&a.f===db?"":"type_error:SafeScript").toString()}},HTML:{ba:qb,ca:function(a){return(a instanceof qb&&a.constructor===qb&&a.f===pb?"":"type_error:SafeHtml").toString()}},RESOURCE_URL:{ba:ib,ca:function(a){return(a instanceof ib&&a.constructor===ib&&a.g===hb?a.f:"type_error:TrustedResourceUrl").toString()}},STRING:{ba:Object, ca:sb},STYLE:{ba:ob,ca:function(a){return a instanceof ob&&a.constructor===ob&&a.f===nb?"":"type_error:SafeStyle"}},URL:{ba:D,ca:function(a){return a instanceof D&&a.constructor===D&&a.g===kb?a.f:"type_error:SafeUrl"}}};function ub(a,b){return b} var vb={CONSTANT:ub,JAVASCRIPT:ub,HTML:function(a){Ka.test(a)&&(-1!=a.indexOf("&")&&(a=a.replace(Ea,"&")),-1!=a.indexOf("<")&&(a=a.replace(Fa,"<")),-1!=a.indexOf(">")&&(a=a.replace(Ga,">")),-1!=a.indexOf('"')&&(a=a.replace(Ha,""")),-1!=a.indexOf("'")&&(a=a.replace(Ia,"'")),-1!=a.indexOf("\x00")&&(a=a.replace(Ja,"�")));return a},RESOURCE_URL:ub,STRING:String,STYLE:ub,URL:function(a,b){a instanceof D||(a="object"==typeof a&&a.aa?a.c():String(a),a=lb.test(a)?new D(jb,a):null);a= (a||mb).c();return"about:invalid#zClosurez"===a?b:a}};function wb(a,b){throw Error(void 0===b?"unexpected value "+a+"!":b);};var zb=function(a,b,c){if(Object.hasOwnProperty.call(xb,a)&&(a=xb[a],Object.hasOwnProperty.call(a,b)&&(a=a[b],a instanceof Array))){for(var d=null,e=!1,k=0,g=a.length;k: <"+d+" "+e+'="'+k+'">: '+h,g);return l===G?"about:invalid#zClosurez":l},L:void 0,O:void 0,P:void 0}]};var Yb=function(a){function b(l){var m=l.localName;if(!l.getAttribute("is")&&2===Nb(m,l.constructor))return h;(l=f[m])||(l=f[m]=document.createElement(m));return l}var c=a.reportHandler||void 0,d=a.safeTypesBridge||Wb,e=/^$/;if(a=a.allowedIdentifierPrefixes){a=u(a);for(var k=a.next();!k.done;k=a.next())e=new RegExp(e.source+"|^"+String(k.value).replace(/([-()\[\]{}+?*.$\^|,:#: <"+v+" "+aa+'="'+w+'">',l));return C}}}({allowedIdentifierPrefixes:[""],reportHandler:function(){},safeTypesBridge:function(a,b,c){var d=tb[b];return a instanceof d.ba&&(d=d.ca(a,c),d!==c)?d:(0,vb[b])(String(sb(a)), c)}});var H={},Zb={};var J="{{lit-"+String(Math.random()).slice(2)+"}}",$b="\x3c!--"+J+"--\x3e",bc=new RegExp(J+"|"+$b),ec=function(a,b){this.c=[];this.f=b;var c=[],d=[];b=document.createTreeWalker(b.content,133,null,!1);var e=0,k=-1,g=0,f=a.G;for(a=a.values.length;g=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;var fc=function(a,b){this.c=[];this.f=a;this.options=b};fc.prototype.update=function(a){for(var b=0,c=u(this.c),d=c.next();!d.done;d=c.next())d=d.value,void 0!==d&&d.fa(a[b]),b++;a=u(this.c);for(d=a.next();!d.done;d=a.next())b=d.value,void 0!==b&&b.ea()}; fc.prototype.g=function(){for(var a=Ya?this.f.f.content.cloneNode(!0):document.importNode(this.f.f.content,!0),b=[],c=this.f.c,d=document.createTreeWalker(a,133,null,!1),e=0,k=0,g,f=d.nextNode();e\n ']),Fc=function(a,b,c,d){var e=this;this.c=[];this.m=b.botName?b.botName:"";this.platform=b.platform||"volley";this.creativeId=a.creativeId||"";this.l=d;(this.A=c||null)||console.warn("MetricsLogger: Pass in instance of ErrorReporter for more thorough error reporting.");a=/\w+\.sfo\.corp\.google\.com$/;this.v="localhost"===location.hostname||"127.0.0.1"===location.hostname||""===location.hostname||null!=location.hostname.match(a); this.sessionId=Date.now().toString(36)+Math.random().toString(36);this.h=this.g=0;this.f={};b.disableEngagedClick||window.addEventListener("engaged",function(){if("undefined"!==typeof Enabler){var k=Enabler.getParameter("click");if(k){var g=document.getElementById("engaged-chat-activity-container");g&&Cc(L(Dc,k),g)}}});setInterval(function(){e.c.length&&Ec(e)},7E3);window.addEventListener("beforeunload",function(){e.c.length&&Ec(e)})},M=function(a,b){b.bot_name=a.m;b.platform=a.platform;b.creative_id= a.creativeId;b.session_id=a.sessionId;a.c.push(b);5f?(f+=1,e.open("POST",d,!0),e.setRequestHeader("Content-type","application/json"),e.onload=function(){k(e.response)},e.onerror=function(){setTimeout(function(){h()},1E3)},e.send(JSON.stringify(c))):(Sa(a.A,"AdLingo API v2 - Error in\n sendXhr_(): endpoint: "+ d+";\n bot: "+a.c.botName+"; statusText: "+e.statusText+",\n status: "+e.status+", readyState: "+e.readyState+",\n response: "+e.response),g())};h()})},Nc=function(a,b){a.o.stopTimer("il");a.o.stopTimer("ul");return new Promise(function(c){if(b.messages)return Tc(a,b.messages).then(function(){c()});c()})},Tc=function(a,b){var c=0,d=[];b&&b.length&&b.forEach(function(e){null!=e&&("delay"===e.type?(c+=e.durationMS,e.showTypingIndicator&&d.push(new Promise(function(k){setTimeout(function(){var g= new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:null}});document.dispatchEvent(g);k()},1)})),d.push(new Promise(function(k){setTimeout(k,c)}))):d.push(new Promise(function(k){setTimeout(function(){switch(e.type){case "text":var g=new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:e.text}});document.dispatchEvent(g);break;case "image":g=Object.assign({},e);delete g.type;g=new CustomEvent("adlingo:receive-new-bot-response", {detail:{messageType:e.type,messageData:g}});document.dispatchEvent(g);break;case "button":g=Object.assign({},e);delete g.type;g=new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:g}});document.dispatchEvent(g);break;case "buttonList":g=Object.assign({},e);delete g.type;g=new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:g}});document.dispatchEvent(g);break;case "card":g=Object.assign({},e);delete g.type;g=new CustomEvent("adlingo:receive-new-bot-response", {detail:{messageType:e.type,messageData:g}});document.dispatchEvent(g);break;case "cardCarousel":g=Object.assign({},e);delete g.type;g=new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:g}});document.dispatchEvent(g);break;case "galleryCardCarousel":g=Object.assign({},e);delete g.type;document.dispatchEvent(new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:g}}));break;case "quickReplies":g=Object.assign({},e);delete g.type; g=new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:g}});document.dispatchEvent(g);break;case "errorMessage":g=Object.assign({},e);delete g.type;g=new CustomEvent("adlingo:receive-new-bot-response",{detail:{messageType:e.type,messageData:g}});document.dispatchEvent(g);break;default:Ta(a.A,"AdLingo API v2 - Error in triggerMessageRender_(): Unknown\n message type: "+e.type)}k()},c)})))});return Promise.all(d)},Jc=function(a){document.addEventListener("adlingo:send-user-message", function(b){b=b.detail;var c=b.messageValue;"freeText"===b.messageType?Uc(a,c):Vc(a,c)})},Uc=function(a,b){b={type:"freeText",value:b};Lc(a.c.backend)&&a.c.enableSyncEndpoint?Rc(a,"v2/sessions/"+a.sessionId+"/messages",{botName:a.c.botName,backend:a.c.backend,options:a.c.options,channelData:a.c.channelData,message:b,context:a.f}).then(function(c){return Sc(a,c)}).then(function(c){a.f=c.context;Nc(a,c)}):Rc(a,"sessions/"+a.sessionId+"/messages",b)},Vc=function(a,b){b={type:"postback",value:b};Lc(a.c.backend)&& a.c.enableSyncEndpoint?Rc(a,"v2/sessions/"+a.sessionId+"/messages",{botName:a.c.botName,backend:a.c.backend,options:a.c.options,channelData:a.c.channelData,message:b,context:a.f}).then(function(c){return Sc(a,c)}).then(function(c){a.f=c.context;Nc(a,c)}):Rc(a,"sessions/"+a.sessionId+"/messages",b)};function Wc(a){return{wa:a.asset_server,A:a.error_reporter,gateway:a.gateway,o:a.metrics_logger,name:a.name}}function Xc(a){var b=a.reduce(function(e,k){return e+k.weight},0);b=Math.random()*b;for(var c=0;c=b)return Wc(d)}return Wc(a[a.length-1])} function Yc(a,b){return a&&a.length?Xc(a):b?{wa:"https://assets-dot-chitchat-test.appspot.com/img/",A:"https://clouderrorreporting.googleapis.com/v1beta1/projects/chitchat-test/events:report?key=AIzaSyAIzuZPMfGLcDeNwkEugI59H4RtOTBDWSc",o:"https://logging-dot-chitchat-test.appspot.com",name:"staging",gateway:"https://gateway-dev.adlingo.com"}:{wa:"https://assets-dot-dapio-prod.appspot.com/img/",A:"https://clouderrorreporting.googleapis.com/v1beta1/projects/dapio-prod/events:report?key=AIzaSyB_Rkwxp23aTSnKt6E4-I1WqWv0qlJVr3U", o:"https://logging-dot-dapio-prod.appspot.com",name:"production",gateway:"https://gateway.adlingo.com"}};var Zc=t(['\n \n \n \n \n \n\n
\n ', "\n
\n
\n "]),$c=t(['\n
\n \n \n \n \n\n
\n ', "\n
\n
\n "]),ad=t(['\n \n \n \n \n \n\n
\n ', "\n
\n
\n "]),bd=t([""]);function cd(a){var b=a.action.type;if("openUrl"===b)return L(Zc,a.action.url,a.label);if("postback"===b)return L($c,a.action.text,a.action.data&&a.action.data.length?a.action.data:"",a.label);if("call"===b)return L(ad,E(a.action.url||""),a.label);console.error("Button response: unsupported action type!");return L(bd)};var dd=t(['\n
  • \n \n \n \n \n \n\n
    \n ', "\n
    \n
    \n
  • \n "]),ed=t(['\n
  • \n
    \n \n \n \n \n\n
    \n ', "\n
    \n
    \n
  • \n "]),fd=t(['\n
  • \n \n \n \n \n \n\n
    \n ', "\n
    \n
    \n
  • \n "]),gd=t(['\n
  • \n
    \n \n \n \n \n\n
    \n ', "\n
    \n
    \n
  • \n "]),hd=t([""]),id=t(['\n
    \n
      \n ',"\n
    \n
    \n "]),jd=t(['\n
    \n
    \n ',"\n
    \n\n ","\n
    \n "]); function kd(a){var b=function(d){var e=d.action.type;if("openUrl"===e)return L(dd,d.action.url,d.label);if("postback"===e)return L(ed,d.action.text,d.action.data&&d.action.data.length?d.action.data:"",d.label);if("call"===e)return L(fd,E(d.action.url||""),d.label);if("formOpen"===e)return L(gd,"adlingo-api-js-button-list-response__form-button",d.label);console.error("Button List response: unsupported action type!");return L(hd)},c=F(a.title,53);return L(jd,c,function(){if(a.buttons&&a.buttons.length)return L(id, "adlingo-api-js-button-list-response",a.buttons.map(function(d){return b(d)}))}())};var ld=new WeakMap,N=function(a){return function(b){for(var c=[],d=0;d\n \n \n \n \n \n ']),nd=t(['\n
    \n \n \n \n \n
    \n ']), od=t(['\n
    \n \n \n \n \n
    \n ']), pd=t('\n \n ;\n\n \n \n '.split(";")),qd=t('\n
    \n ;\n\n \n
    \n '.split(";")), rd=t('\n \n ;\n\n \n \n '.split(";")),sd=t(['\n \n ']),td=t(['\n
    \n ',"\n
    \n "]),ud=t(['\n
    \n ',"\n
    \n "]),vd=t(['\n
    \n ',"\n
    \n "]),wd=t(['\n
    \n ',"\n ","\n ","\n
    \n "]), xd=t(['\n
  • \n \n \n \n \n \n\n \n ', "\n \n \n
  • \n "]),yd=t(['\n
  • \n
    \n \n \n \n \n\n \n ', "\n \n
    \n
  • \n "]),zd=t(['\n
  • \n \n \n \n \n \n\n \n ', "\n \n \n
  • \n "]),Ad=t([""]),Bd=t(['\n
    \n
      \n ',"\n
    \n
    \n "]),Cd=t('\n
    \n \n ;\n\n ;\n ;\n \n\n ;\n
    \n '.split(";")), Dd=t('\n
    \n
    \n ;\n\n ;\n ;\n
    \n\n ;\n
    \n '.split(";")),Ed=t('\n
    \n \n ;\n\n ;\n ;\n \n\n ;\n
    \n '.split(";")), Fd=t(['\n
    \n ',"\n ","\n ","\n
    \n "]); function Gd(a){var b=function(f){return"openUrl"===f?"openUrl":"postback"===f?"postback":"call"===f?"call":!1},c=function(){return a.image.options&&"square"===a.image.options.options.aspectRatio?"adlingo-api-c-card-response__img--square":"adlingo-api-c-card-response__img--landscape"},d=function(){if(a.image){var f={backgroundImage:'url("'+a.image.url+'")'};return!a.action&&a.image.action&&"openUrl"===b(a.image.action.type)?L(pd,a.image.action.url,L(md),c(),N(f),a.image.altText):!a.action&&a.image.action&& "postback"===b(a.image.action.type)?L(qd,a.image.action.text,a.image.action.data&&a.image.action.data.length?a.image.action.data:"",L(nd),c(),N(f),a.image.altText):!a.action&&a.image.action&&"call"===b(a.image.action.type)?L(rd,E(a.image.action.url||""),L(od),c(),N(f),a.image.altText):L(sd,c(),N(f),a.image.altText)}},e=function(){return L(wd,function(){if(a.title){var f=F(a.title,83);return L(td,f)}}(),function(){if(a.subtitle){var f=F(a.subtitle,83);return L(ud,f)}}(),function(){if(a.body){var f= F(a.body,243);return L(vd,f)}}())},k=function(f){var h=F(f.label,23);if("openUrl"===b(f.action.type))return L(xd,f.action.url,h);if("postback"===b(f.action.type))return L(yd,f.action.text,f.action.data&&f.action.data.length?f.action.data:"",h);if("call"===b(f.action.type))return L(zd,E(f.action.url||""),h);console.error("Card response button: unsupported action type!");return L(Ad)},g=function(){if(a.buttons&&a.buttons.length)return L(Bd,a.buttons.map(function(f){return k(f)}))};return a.action&& "openUrl"===b(a.action.type)?L(Cd,a.action.url,L(md),d(),e(),g()):a.action&&"postback"===b(a.action.type)?L(Dd,a.action.text,a.action.data&&a.action.data.length?a.action.data:"",L(nd),d(),e(),g()):a.action&&"call"===b(a.action.type)?L(Ed,E(a.action.url||""),L(od),d(),e(),g()):L(Fd,d(),e(),g())};var Hd=t(['\n \n ']), Id=t(['\n \n ']),Jd=t(['\n \n ']), Kd=t('\n \n ;\n\n \n \n '.split(";")),Ld=t('\n \n '.split(";")), Md=t('\n \n ;\n\n \n \n '.split(";")),Nd=t(['\n \n ']),Od=t(['\n \n "]),Pd=t(['\n \n "]),Qd=t(['\n \n "]),Rd=t(['\n \n "]),Sd=t(['\n
  • \n \n \n \n \n \n\n \n ', "\n \n \n
  • \n "]),Td=t(['\n
  • \n \n
  • \n "]),Ud=t(['\n
  • \n \n \n \n \n \n\n \n ', "\n \n \n
  • \n "]),Vd=t([""]),Wd=t(['\n \n "]),Xd=t('\n
  • \n \n
  • \n '.split(";")), Yd=t('\n
  • \n \n
  • \n '.split(";")),Zd=t('\n
  • \n \n
  • \n '.split(";")), $d=t(['\n
  • \n \n
  • \n "]),ae=t(['\n \n ']),be=t(['\n \n "]); function ce(a){var b=function(f){return"openUrl"===f?"openUrl":"postback"===f?"postback":"call"===f?"call":!1},c=function(f){return f.options&&"square"===f.options.options.aspectRatio?"adlingo-api-c-card-carousel-response__card-img--square":"adlingo-api-c-card-carousel-response__card-img--landscape"},d=function(f){if(f.image){var h={backgroundImage:'url("'+f.image.url+'")'};return!f.action&&f.image.action&&"openUrl"===b(f.image.action.type)?L(Kd,f.image.action.url,L(Hd),c(f.image),N(h),f.image.altText): !f.action&&f.image.action&&"postback"===b(f.image.action.type)?L(Ld,f.image.action.text,f.image.action.data&&f.image.action.data.length?f.image.action.data:"",L(Id),c(f.image),N(h),f.image.altText):!f.action&&f.image.action&&"call"===b(f.image.action.type)?L(Md,E(f.image.action.url||""),L(Jd),c(f.image),N(h),f.image.altText):L(Nd,c(f.image),N(h),f.image.altText)}},e=function(f){return L(Rd,function(){if(f.title){var h=F(f.title,83);return L(Od,h)}}(),function(){if(f.subtitle){var h=F(f.subtitle,83); return L(Pd,h)}}(),function(){if(f.body){var h=F(f.body,243);return L(Qd,h)}}())},k=function(f){var h=F(f.label,23);if("openUrl"===b(f.action.type))return L(Sd,f.action.url,h);if("postback"===b(f.action.type))return L(Td,f.action.text,f.action.data&&f.action.data.length?f.action.data:"",h);if("call"===b(f.action.type))return L(Ud,E(f.action.url||""),h);console.error("Card Carousel response button: unsupported action type!");return L(Vd)},g=function(f){if(f.buttons&&f.buttons.length)return L(Wd,f.buttons.map(function(h){return k(h)}))}; return L(be,function(){if(a.cards&&a.cards.length&&1=f?!0:432f-32?!0:!1}return!1}()?"":"is-hidden",function(){if(a.cards&&a.cards.length)return L(ae,a.cards.map(function(f){return f.action&&"openUrl"===b(f.action.type)?L(Xd,f.action.url,L(Hd),d(f),e(f),g(f)):f.action&&"postback"===b(f.action.type)?L(Yd,f.action.text,f.action.data&&f.action.data.length?f.action.data:"",L(Id),d(f),e(f), g(f)):f.action&&"call"===b(f.action.type)?L(Zd,E(f.action.url||""),L(Jd),d(f),e(f),g(f)):L($d,d(f),e(f),g(f))}))}())};var de=t(['\n
    \n Sorry, something went wrong. You can try typing again or click the "Learn more" link in the menu.\n
    \n ']);var ee=t(['\n \n ']),fe=t(['\n \n
    \n \n \n \n \n
    \n\n ', "\n
    \n "]),ge=t(['\n
    \n
    \n \n \n \n \n
    \n\n ', "\n
    \n "]),he=t(['\n \n
    \n \n \n \n \n
    \n\n ', "\n
    \n "]),ie=t(['\n
    \n ',"\n
    \n "]); function je(a){var b=function(){return"openUrl"===a.action.type?"openUrl":"postback"===a.action.type?"postback":"call"===a.action.type?"call":!1},c=function(){return L(ee,a.options&&"square"===a.options.options.aspectRatio?"adlingo-api-c-image-response__img--square":"adlingo-api-c-image-response__img--landscape",N({backgroundImage:'url("'+a.url+'")'}),a.altText)};return"openUrl"===b()?L(fe,a.action.url,c()):"postback"===b()?L(ge,a.action.text,a.action.data&&a.action.data.length?a.action.data:"",c()): "call"===b()?L(he,E(a.action.url||""),c()):L(ie,c())};/* Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ var ke=!0,O={set M(a){a?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):ke&&console.log("RxJS: Back to a better error behavior. Thank you. <3");ke=a},get M(){return ke}};var le="function"===typeof Symbol&&Symbol.observable||"@@observable";function me(a){setTimeout(function(){throw a;},0)};var ne={closed:!0,next:function(){},error:function(a){if(O.M)throw a;me(a)},complete:function(){}};var oe=function(){function a(b){this.message=b?b.length+" errors occurred during unsubscription:\n"+b.map(function(c,d){return d+1+") "+c.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.xa=b;return this}a.prototype=Object.create(Error.prototype);return a}();var pe=Array.isArray||function(a){return a&&"number"===typeof a.length};function qe(a){return"function"===typeof a};var P=function(a){this.closed=!1;this.da=this.V=null;a&&(this.va=a)}; P.prototype.unsubscribe=function(){if(!this.closed){var a=this.V,b=this.va,c=this.da;this.closed=!0;this.da=this.V=null;if(a instanceof P)a.remove(this);else if(null!==a)for(var d=0;da)a=0;b&&"function"===typeof b.F||(b=Ye);return new R(function(c){c.add(b.F(af,a,{Ja:c,counter:0,Ha:a}));return c})}function af(a){var b=a.Ja,c=a.counter;a=a.Ha;b.next(c);this.F({Ja:b,counter:c+1,Ha:a},a)};(function(){function a(){this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}a.prototype=Object.create(Error.prototype);return a})();(function(){function a(b){this.message=b;this.name="NotFoundError";return this}a.prototype=Object.create(Error.prototype);return a})();(function(){function a(b){this.message=b;this.name="SequenceError";return this}a.prototype=Object.create(Error.prototype);return a})();(function(){function a(){this.message="Timeout has occurred";this.name="TimeoutError";return this}a.prototype=Object.create(Error.prototype);return a})();function X(a){var b=void 0===b?Ye:b;var c=a instanceof Date&&!isNaN(+a)?+a-b.now():Math.abs(a);return function(d){return xe(d,new bf(c,b))}}var bf=function(a,b){this.delay=a;this.S=b};bf.prototype.call=function(a,b){return b.subscribe(new Y(a,this.delay,this.S))};var Y=function(a,b,c){Q.call(this,a);this.delay=b;this.S=c;this.c=[];this.f=this.active=!1};y(Y,Q);Y.EMPTY=Q.EMPTY;Y.create=Q.create; var cf=function(a){for(var b=a.source,c=b.c,d=a.S,e=a.destination;0=c[0].time-d.now();){var k=c.shift().c;e.next&&e.next(k.value)}0\n \n\n \n\n
    \n
    \n ']), uf=t(['\n
  • \n \n
  • \n "]),vf=t(['\n
      \n ',"\n
    \n "]),wf=function(a){return a.quickReplies&&a.quickReplies.length?L(vf, a.quickReplies.map(function(b){return L(uf,b.action.text,b.action.metadata,b.action.data&&b.action.data.length?b.action.data:"",b.label)})):""},pf=function(a){a.c&&a.c.addEventListener("mouseenter",function(){document.dispatchEvent(new CustomEvent("cda:mouseenter-quickreplies"))})},qf=function(a){if(a.c){var b=!1;a.c.addEventListener("scroll",function(){if(!b){b=!0;var c=new CustomEvent("cda:quick-reply-scrolled");document.dispatchEvent(c)}})}},of=function(a){document.addEventListener("adlingo:reset-quick-replies", function(){a.quickReplies=[];a.c&&(Cc(wf(a),a.c),xf(a))})},mf=function(a){var b=function(c){switch(c.type){case "renderQuickReplies":a.quickReplies=c.Qa.quickReplies,a.c&&(Cc(wf(a),a.c),setTimeout(function(){var d=a.g,e=d.querySelector('[data-scroll-button="next"]');d.querySelector("[data-scroll-container]").scrollWidth>d.offsetWidth&&e.classList.remove("is-hidden")},500))}};Te(document,"cda:receive-new-quick-replies").c(Pe(function(c){c=S({type:"renderQuickReplies",Qa:c.detail}).c(X(50));return Se(c).c(X(100))}, 1)).subscribe(function(c){b(c)})},yf=function(a,b){if(b=b.target.closest(".adlingo-api-js-quick-replies-response__qr"))a.f=b,b=a.c.querySelectorAll(".adlingo-api-js-quick-replies-response__qr"),b=[].concat(ia(b)),a.h=b.filter(function(c){return a.f!==c})},zf=function(a){a.h.forEach(function(b){b.classList.add("fade-out")});a.f.classList.add("fade-out")},nf=function(a){Te(a.c,"click").c(ff(function(){return $e()})).c(Pe(function(b){b.preventDefault();a.f=null;a.h=[];yf(a,b);if(a.f){b=S({type:"blurAdUnitBackground"}); var c=S({type:"changeQuickReplyColor"}),d=S({type:"fadeQuickReplies"}),e=S({type:"sendChosenQuickReply"});b=Se(b,c,d,e).c(X(50))}else b=S();return b},1)).subscribe(function(b){switch(b.type){case "blurAdUnitBackground":b=new CustomEvent("adlingo:blur-ad-unit-background");document.dispatchEvent(b);break;case "changeQuickReplyColor":a.f.classList.add("clicked");break;case "fadeQuickReplies":zf(a);break;case "sendChosenQuickReply":b=a.f.getAttribute("data-say");var c=a.f.getAttribute("data-value"),d= a.f.getAttribute("data-metadata"),e=new CustomEvent("cda:click-quick-reply");document.dispatchEvent(e);b=c?new CustomEvent("adlingo:begin-new-message-rendering-flow",{detail:{U:b,oa:c,metadata:d,messageSender:"user",ha:"postback"}}):new CustomEvent("adlingo:begin-new-message-rendering-flow",{detail:{U:b,metadata:d,messageSender:"user",ha:"postback"}});document.dispatchEvent(b)}})},xf=function(a){a.g.querySelectorAll("[data-scroll-button]").forEach(function(b){b.classList.add("is-hidden")})},rf=function(a){a.g.addEventListener("click", function(b){var c=b.target.closest("[data-scroll-button]");if(c){var d=c.getAttribute("data-scroll-button"),e="previous"===d?c.nextElementSibling:c.previousElementSibling,k=b.target.closest("[data-scrollable-component]"),g=k.querySelector("[data-scroll-container]");g.scrollLeft="next"===d?g.scrollLeft+150:g.scrollLeft-150;setTimeout(function(){g.scrollLeft+k.offsetWidth>=g.scrollWidth?c.classList.add("is-hidden"):0>=g.scrollLeft&&c.classList.add("is-hidden")},500);e.classList.remove("is-hidden")}})};var Af=t(['\n
    ',"
    \n "]);var Bf=t(['\n
    ',"
    \n "]);var Cf=function(a){a=void 0===a?{}:a;this.c=this.f=null;this.showBigAvatar=a.showBigAvatar},Df=t(['\n
  • \n
    \n
    \n
  • ']),Ef=t(['\n
      \n ',"\n
    \n "]),Ff=t(['\n
    \n ',"\n
    "]),Jf=function(a){Gf(a);Hf(a); If(a)},Gf=function(a){a.c.addEventListener("click",$a(function(b){var c=b.target.closest("[data-say]");if(c){b=c.getAttribute("data-say");c=c.getAttribute("data-value");var d=new CustomEvent("volley-ui-v2:blur-ad-unit-background");document.dispatchEvent(d);d=new CustomEvent("cda:click-sayable");document.dispatchEvent(d);c?(d=new CustomEvent("volley-ui-v2:handle-new-message",{detail:{U:b,oa:c,messageSender:"user"}}),b=new CustomEvent("adlingo:begin-new-message-rendering-flow",{detail:{U:b,oa:c,messageSender:"user", ha:"postback"}})):(d=new CustomEvent("volley-ui-v2:handle-new-message",{detail:{U:b,messageSender:"user"}}),b=new CustomEvent("adlingo:begin-new-message-rendering-flow",{detail:{U:b,messageSender:"user",ha:"postback"}}));document.dispatchEvent(d);document.dispatchEvent(b)}}))},Hf=function(a){a.c.addEventListener("click",function(b){var c=b.target.closest("[data-external]");c&&(c=c.getAttribute("href"),0==c.lastIndexOf("tel:",0)||b.preventDefault(),b=new CustomEvent("volley-ui-v2-body:click-external-link", {detail:{Sa:c}}),document.dispatchEvent(b))})},If=function(a){a.c.addEventListener("click",function(b){var c=b.target.closest("[data-scroll-button]");if(c){var d=c.getAttribute("data-scroll-button"),e="previous"===d?c.nextElementSibling:c.previousElementSibling,k=b.target.closest("[data-scrollable-component]"),g=k.querySelector("[data-scroll-container]");b=k.querySelector("[data-scroll-list]").querySelector("li").offsetWidth+8;g.scrollLeft="next"===d?g.scrollLeft+b:g.scrollLeft-b;setTimeout(function(){g.scrollLeft+ k.offsetWidth>=g.scrollWidth?c.classList.add("is-hidden"):0>=g.scrollLeft&&c.classList.add("is-hidden")},500);e.classList.remove("is-hidden")}})};var Kf=function(a,b){this.h=this.g=this.c=this.f=null;this.v=b?b.engagementMaskText:"Tap to chat";this.m=a;this.l=!0},Lf=t(['\n\n\n\n\n']),Of=function(a){document.addEventListener("cda:receive-new-quick-replies", function(){setTimeout(function(){a.l&&(Mf(a),setTimeout(function(){Nf(a)},29E3),a.m||document.addEventListener("cda:mouseenter-root",function(){Nf(a)}))},1500)});document.addEventListener("cda:click-quick-reply",function(){Nf(a)});document.addEventListener("cda:submit-message",function(){Nf(a)});document.addEventListener("cda:click-sayable",function(){Nf(a)});document.addEventListener("cda:quick-reply-scrolled",function(){Nf(a)});document.addEventListener("cda:input-form-focus",function(){Nf(a)})}, Pf=function(a,b){b=b.getBoundingClientRect();var c=document.getElementById("cdav2-c-ui");c&&(a.f.style.top="0px",a.f.style.height=b.top+"px",a.c&&(a.c.style.top=b.bottom+"px",a.c.style.height=c.getBoundingClientRect().height-b.bottom+"px"),a.g.style.top=b.top-6-52+"px",a.h.style.top=b.top-16-52+"px")},Mf=function(a){a.f||(a.f=document.getElementById("engagement-mask-top"));a.c||(a.c=document.getElementById("engagement-mask-bottom"));a.g||(a.g=document.getElementById("engagement-mask-arrow"));a.h|| (a.h=document.getElementById("engagement-mask-text"));var b=document.getElementsByClassName("adlingo-api-c-quick-replies-response__qr-list");b&&(Pf(a,b[0]),a.f.classList.remove("hidden"),a.f.classList.add("mask-animating"),a.c&&(a.c.classList.remove("hidden"),a.c.classList.add("mask-animating")),a.g.classList.remove("hidden"),a.g.classList.add("mask-prompt-animating"),a.l=!1,a.h.classList.remove("hidden"),a.h.classList.add("mask-prompt-animating"),window.addEventListener("resize",function(){window.requestAnimationFrame(function(){Pf(a, b[0])})}))},Nf=function(a){a.l=!1;a.f||(a.f=document.getElementById("engagement-mask-top"));a.c||(a.c=document.getElementById("engagement-mask-bottom"));a.g||(a.g=document.getElementById("engagement-mask-arrow"));a.h||(a.h=document.getElementById("engagement-mask-text"));a.f.classList.remove("mask-animating");a.c&&a.c.classList.remove("mask-animating");a.g.classList.remove("mask-prompt-animating");a.h.classList.remove("mask-prompt-animating");a.f.classList.add("hidden");a.c&&a.c.classList.add("hidden"); a.g.classList.add("hidden");a.h.classList.add("hidden")};var Qf=function(a){this.config=a;this.c=this.g=this.f=null},Rf=t(['\n \n ']), Sf=t(['\n "]),Xf=function(a){Tf(a);Uf(a);Vf(a);Wf(a)},Tf=function(a){a.f&&a.f.addEventListener("mouseenter",function(){document.dispatchEvent(new CustomEvent("cda:mouseenter-footer"))})},Wf=function(a){document.addEventListener("initiate-conversation-flow",function(){a.f.classList.remove("slide-down")})},Uf=function(a){a.c.addEventListener("focus",function(){document.dispatchEvent(new CustomEvent("cda:input-form-focus"))})}, Vf=function(a){a.g.addEventListener("submit",function(b){var c=a.c.value;b.preventDefault();c&&c.length&&(b=new CustomEvent("volley-ui-v2:blur-ad-unit-background"),document.dispatchEvent(b),b=new CustomEvent("cda:submit-message"),document.dispatchEvent(b),b=new CustomEvent("volley-ui-v2:handle-new-message",{detail:{U:c,messageSender:"user"}}),document.dispatchEvent(b),c=new CustomEvent("adlingo:begin-new-message-rendering-flow",{detail:{U:c,messageSender:"user",ha:"freeText"}}),document.dispatchEvent(c), a.c.value="",a.c.focus())})};var Yf=function(a){this.config=a;this.c=this.g=this.f=this.h=this.v=this.m=this.l=null},Zf=t(['\n
  • \n \n ',"\n \n
  • \n "]),$f=t(['\n
  • \n \n ',"\n \n
  • \n "]),ag=t(['\n \n \n \n \n \n \n ']), bg=t(['\n
    \n \n
    \n\n
    \n
    \n \n \n \n \n \n \n\n
    \n
      \n ', "\n ","\n
    \n
    \n
    \n\n ","\n\n
    \n "]),cg=t(['\n
    \n ',"\n
    "]),jg=function(a){dg(a);eg(a);fg(a);gg(a);hg(a);ig(a)},fg=function(a){a.f.addEventListener("click",function(b){var c=a.f.getAttribute("href");Enabler&&b.preventDefault();b=new CustomEvent("volley-ui-v2-header:click-landing-page-link",{detail:{landingPageUrl:c}});document.dispatchEvent(b)})}, gg=function(a){a.g.addEventListener("click",function(b){var c=a.g.getAttribute("href");Enabler&&b.preventDefault();b=new CustomEvent("volley-ui-v2-header:click-privacy-policy-link",{detail:{privacyPolicyUrl:c}});document.dispatchEvent(b)})},hg=function(a){document.addEventListener("volley-ui-v2-header:first-response-sent",function(){a.l.classList.remove("slid-up")})},ig=function(a){a.c&&a.c.addEventListener("click",function(){var b=new CustomEvent("volley-ui-v2-header:click-close-button");document.dispatchEvent(b)})}, dg=function(a){a.v.addEventListener("click",function(b){b.preventDefault();a.h.classList.toggle("is-shown")})},eg=function(a){document.addEventListener("click",function(b){b.target.closest("#"+a.m.id)||a.h.classList.remove("is-shown")})};function _rewriteImageUrl$$module$area120$chitchat$cwa$volley$v2$js$src$util_imageproxy(a,b){if(b){b=unescape(encodeURIComponent(b.trim()));for(var c="",d=0;d\n ;\n ;\n ;\n ;\n ;\n '.split(";")), mg=function(a){document.getElementById("cdav2-c-ui").addEventListener("mouseenter",function(){document.dispatchEvent(new CustomEvent("cda:mouseenter-root"))});jg(a.c.header);Jf(a.c.body);a.c.W&&Xf(a.c.W);a.l&&Of(a.l);a.f&&a.f.addEventListener("click",function(){a.f.classList.add("is-hidden")});"desktop"===a.platform&&document.addEventListener("volley-ui-v2-header:click-close-button",function(){a.f.classList.remove("is-hidden")});document.addEventListener("initiate-conversation-flow",function(){"desktop"=== a.platform&&a.f.classList.add("is-hidden");a.h.classList.add("appear")});"desktop"!==a.platform&&["adlingo:blur-ad-unit-background","cda:click-sayable","cda:submit-message"].forEach(function(b){return document.addEventListener(b,function(){a.m.classList.add("blur")})})};qg.prototype.showTypingIndicator=function(){this.N.classList.add("is-shown")}; var ng=function(a){var b=function(c){if("quickReplies"===c.messageType)return S({type:"renderQuickReplies",messageData:c});if("delay"===c.messageType){var d=S({type:"showAvatar",messageData:c}).c(X(50));c=S({type:"showTypingIndicator",messageData:c}).c(X(150));return Se(d,c).c(X(150))}if("user"===a.Da){d=S({type:"hideTypingIndicator",messageData:c});var e=S({type:"showAvatar",messageData:c}).c(X(50));c=S({type:"renderMessage",messageData:c}).c(X(50));return Se(d,e,c).c(X(150))}d=S({type:"hideTypingIndicator", messageData:c});c=S({type:"renderMessage",messageData:c}).c(X(50));return Se(d,c).c(X(150))};Te(document,"adlingo:begin-new-message-rendering-flow").c(Pe(function(c){var d=c.detail;"bot"===d.messageSender?c=b(d):(c=S({type:"resetQuickReplies",messageData:d}),d=S({type:"renderMessage",messageData:d}),c=Se(c,d));return c},1)).subscribe(function(c){if("bot"===c.messageData.messageSender)switch(c.type){case "showAvatar":c=rg(a,Z(L(sg)));a.N=c.querySelector("#cdav2-js-ui__typing-indicator");break;case "showTypingIndicator":a.showTypingIndicator(); break;case "hideTypingIndicator":a.N&&a.N.classList.remove("is-shown");break;case "renderMessage":c=c.messageData;var d=c.messageData,e=null;switch(c.messageType){case "text":c=F(d,243);e=Z(L(Af,c));break;case "image":kg(a.T,d);c=je(d);e=Z(c);break;case "button":c=cd(d);e=Z(c);break;case "buttonList":c=kd(d);e=Z(c);break;case "card":kg(a.T,d);c=Gd(d);e=Z(c);break;case "cardCarousel":kg(a.T,d);c=ce(d);e=Z(c,"bot",!1);break;case "errorMessage":e=Z(L(de));break;default:console.error("renderBotMessage(): Unknown message type.")}rg(a, e);a.o&&(c=a.o,"undefined"!==typeof Enabler&&Enabler.counter("bot-message",!0),c.g+=1,M(c,{event_id:2,event_name:"bot_messages_count",event_value:c.g,timestamp:Date.now()/1E3}));break;case "renderQuickReplies":c=new CustomEvent("cda:receive-new-quick-replies",{detail:{quickReplies:c.messageData.messageData.quickReplies}});document.dispatchEvent(c);break;default:console.error("handleBotResponseFinish(): Unknown event type.")}else switch(c.type){case "resetQuickReplies":c=new CustomEvent("adlingo:reset-quick-replies"); document.dispatchEvent(c);break;case "renderMessage":c=c.messageData;rg(a,Z(L(Bf,c.U),"user"),"user");c=new CustomEvent("adlingo:send-user-message",{detail:{messageType:c.ha,messageValue:c.oa?c.oa:c.U}});document.dispatchEvent(c);a.o&&(c=a.o,c.h+=1,M(c,{event_id:3,event_name:"user_messages_count",event_value:c.h,timestamp:Date.now()/1E3}),a.o.startTimer("ul"));break;default:console.error("handleUserResponseFinish(): Unknown event type.")}})},og=function(){document.addEventListener("adlingo:receive-new-bot-response", function(a){pg(a.detail)})},pg=function(a){a=new CustomEvent("adlingo:begin-new-message-rendering-flow",{detail:{messageType:a.messageType,messageData:a.messageData,messageSender:"bot"}});document.dispatchEvent(a)},sg=t(['\n
    \n
    \n\n
    \n \n \n \n
    ']),tg=t(['\n
  • \n ',"\n
  • \n "]),Z=function(a,b,c){return L(tg,"bot"===(void 0===b?"bot":b)?"cdav2-c-response--bot":"cdav2-c-response--user",void 0===c||c?"cdav2-c-response--side-padded":"",a)},rg=function(a,b,c){c=void 0===c?"bot":c;var d=a.c.body.c,e=document.createDocumentFragment();Cc(b,e);d.appendChild(e);a.c.body.f.scrollTop=a.c.body.f.scrollHeight;a.Da=c;return d.lastElementChild};Da("Volley",function(a,b,c){var d=this;c=Yc(c,b.isStaging);var e=c.wa,k=c.A,g=c.o;this.na=c.gateway;this.h=e;this.A=new Ra(b,k);a.creativeId=a.creativeId||Enabler.getDartCreativeId();this.o=new Fc(a,b,this.A,g);this.f=a;this.c=b;a.creativeId||console.warn("Please supply Doubleclick Creative ID to Volley config for additional metrics reporting.");this.g=null;document.addEventListener("LM_ChatRenderStart",function(){d.c.disableChannelData||(d.c.channelData=(new Pa(d.c.channelCustomParams)).c);d.g=new Kc(d.c, d.A,d.o,d.na);new qg(d.f,d.o,d.h)});document.addEventListener("initiate-conversation-flow",function(){Qc(d.g)});new DoubleclickCreative(this.A,this.o,this.f,this.c)});var vg=function(a,b,c){var d=this;this.A=a;this.o=b;this.c=this.v.bind(this);this.m=c;this.f=this.h=this.l=!1;this.g=document.getElementById("cdav2-container");Enabler.isInitialized()?ug(this):Enabler.addEventListener(studio.events.StudioEvent.INIT,function(){ug(d)})},ug=function(a){if(!a.l){a.l=!0;var b=a.m.autochatTimerDelay||0;a.g.addEventListener("click",a.c);wg(a,a.g,b);document.dispatchEvent(new CustomEvent("LM_ChatRenderStart"))}},wg=function(a,b,c){if("IntersectionObserver"in window){var d= null;(new IntersectionObserver(function(e,k){a.h?k.unobserve(b):e.forEach(function(g){g.isIntersecting&&.4<=g.intersectionRatio?d||(d=setTimeout(function(){a.c()},c)):!g.isIntersecting&&.5>=g.intersectionRatio&&d&&(clearTimeout(d),d=null)})},{threshold:[0,.5]})).observe(b)}else setTimeout(function(){a.c()},c)}; vg.prototype.v=function(){if(!this.h){this.h=!0;Enabler.registerChargeableEventName("open-chat");Enabler.registerChargeableEventName("submit-chat-form");Enabler.registerChargeableEventName("click-sayable-item");Enabler.registerChargeableEventName("engaged-chat");Enabler.registerChargeableEventName("exit-to-landing-page");Enabler.registerChargeableEventName("exit-to-external-link");Enabler.registerChargeableEventName("bot-message");Enabler.counter("open-chat");Enabler.startTimer("chat-time");this.g.removeEventListener("click", this.c);var a=new CustomEvent("volley-ui-v2-header:first-response-sent");document.dispatchEvent(a);document.dispatchEvent(new CustomEvent("initiate-conversation-flow"));xg(this);yg(this);zg(this);Ag(this);Bg(this);M(this.o,{event_id:9,event_name:"open_chat",event_value:1,timestamp:Date.now()/1E3});a=Enabler.getParameter("auction_id");M(this.o,{event_id:12,event_name:"auction_id",event_value:a,timestamp:Date.now()/1E3});a||Ta(this.A,"Check auctionId configuration in the Campaign Manager Settings")}}; var xg=function(a){document.addEventListener("volley-ui-v2-header:click-landing-page-link",function(b){var c=b.detail.landingPageUrl;b.preventDefault();Enabler.stopTimer("chat-time");Hc(a.o,"exit-to-landing-page",c);Enabler.exit("exit-to-landing-page",c)})},yg=function(a){document.addEventListener("volley-ui-v2-header:click-privacy-policy-link",function(b){var c=b.detail.privacyPolicyUrl;b.preventDefault();Enabler.stopTimer("chat-time");Hc(a.o,"exit-to-privacy-policy",c);Enabler.exit("exit-to-privacy-policy", c)})},Cg=function(a){a.f=!0;M(a.o,{event_id:10,event_name:"engaged_chat",event_value:1,timestamp:Date.now()/1E3});Enabler.counter("engaged-chat");a=new Event("engaged");window.dispatchEvent(a)},zg=function(a){document.addEventListener("cda:submit-message",function(){Enabler.counter("submit-chat-form",!0);a.f||Cg(a)})},Ag=function(a){document.addEventListener("cda:click-sayable",function(){Enabler.counter("click-sayable-item",!0);a.f||Cg(a)});document.addEventListener("cda:click-quick-reply",function(){Enabler.counter("click-sayable-item", !0);a.f||Cg(a)})},Bg=function(a){document.addEventListener("volley-ui-v2-body:click-external-link",function(b){var c=b.detail.Sa;Enabler.stopTimer("chat-time");Hc(a.o,"exit-to-external-link",c);0==c.lastIndexOf("tel:",0)?Enabler.exitOverride("exit-to-external-link",c,studio.sdk.ExitFlag.LOG_ONLY):(b.preventDefault(),Enabler.exitOverride("exit-to-external-link",c))})};Da("DoubleclickCreative",vg);}).call(this);