!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.hopscotch=t()}(this,function(){"use strict";var y,s,p,w,h,c,a,n,e,f,b,u,t,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},l="bubble_default",k=window.Sizzle||null,r="undefined",d=!1,g=("undefined"==typeof jQuery?"undefined":i(jQuery))!==r,o=!1,v=!1,nt=/^[a-zA-Z]+[a-zA-Z0-9_-]*$/,tt={left:"right",right:"left"};try{i(window.sessionStorage)!==r&&(o=!0,sessionStorage.setItem("hopscotch.test.storage","ok"),sessionStorage.removeItem("hopscotch.test.storage"),v=!0)}catch(it){}return u={smoothScroll:!0,scrollDuration:1e3,scrollTopMargin:200,showCloseButton:!0,showPrevButton:!1,showNextButton:!0,bubbleWidth:280,bubblePadding:15,arrowWidth:20,skipIfNoElement:!0,isRtl:!1,cookieName:"hopscotch.tour.state"},Array.isArray||(Array.isArray=function(n){return"[object Array]"===Object.prototype.toString.call(n)}),b=function(){d&&t.startTour()},n={addClass:function(n,t){var r,u,i,f;if(n.className){for(u=t.split(/\s+/),r=" "+n.className+" ",i=0,f=u.length;f>i;++i)r.indexOf(" "+u[i]+" ")<0&&(r+=u[i]+" ");n.className=r.replace(/^\s+|\s+$/g,"")}else n.className=t},removeClass:function(n,t){var i,u,r,f;for(u=t.split(/\s+/),i=" "+n.className+" ",r=0,f=u.length;f>r;++r)i=i.replace(" "+u[r]+" "," ");n.className=i.replace(/^\s+|\s+$/g,"")},hasClass:function(n,t){var i;return n.className?(i=" "+n.className+" ",-1!==i.indexOf(" "+t+" ")):!1},getPixelValue:function(n){var t="undefined"==typeof n?"undefined":i(n);return"number"===t?n:"string"===t?parseInt(n,10):0},valOrDefault:function(n,t){return("undefined"==typeof n?"undefined":i(n))!==r?n:t},invokeCallbackArrayHelper:function(n){var t;if(Array.isArray(n)&&(t=f[n[0]],"function"==typeof t))return t.apply(this,n.slice(1))},invokeCallbackArray:function(t){var i,r;if(Array.isArray(t)){if("string"==typeof t[0])return n.invokeCallbackArrayHelper(t);for(i=0,r=t.length;r>i;++i)n.invokeCallback(t[i])}},invokeCallback:function(t){return"function"==typeof t?t():"string"==typeof t&&f[t]?f[t]():n.invokeCallbackArray(t)},invokeEventCallbacks:function(n,t){var i,r,u=e[n];if(t)return this.invokeCallback(t);for(i=0,r=u.length;r>i;++i)this.invokeCallback(u[i].cb)},getScrollTop:function(){return i(window.pageYOffset)!==r?window.pageYOffset:document.documentElement.scrollTop},getScrollLeft:function(){return i(window.pageXOffset)!==r?window.pageXOffset:document.documentElement.scrollLeft},getWindowHeight:function(){return window.innerHeight||document.documentElement.clientHeight},addEvtListener:function(n,t,i){if(n)return n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent("on"+t,i)},removeEvtListener:function(n,t,i){if(n)return n.removeEventListener?n.removeEventListener(t,i,!1):n.detachEvent("on"+t,i)},documentIsReady:function(){return"complete"===document.readyState},evtPreventDefault:function(n){n.preventDefault?n.preventDefault():event&&(event.returnValue=!1)},extend:function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},getStepTargetHelper:function(n){var t=document.getElementById(n);if(t)return t;if(g)return t=jQuery(n),t.length?t[0]:null;if(k)return t=new k(n),t.length?t[0]:null;if(document.querySelector)try{return document.querySelector(n)}catch(i){}return/^#[a-zA-Z][\w-_:.]*$/.test(n)?document.getElementById(n.substring(1)):null},getStepTarget:function(t){var r,i,u;if(!t||!t.target)return null;if("string"==typeof t.target)return n.getStepTargetHelper(t.target);if(Array.isArray(t.target)){for(i=0,u=t.target.length;u>i;i++)if("string"==typeof t.target[i]&&(r=n.getStepTargetHelper(t.target[i])))return r;return null}return t.target},getI18NString:function(n){return h[n]||w[n]},setState:function(n,t,i){var r,u="";if(o&&v)try{sessionStorage.setItem(n,t)}catch(f){v=!1;this.setState(n,t,i)}else o&&sessionStorage.removeItem(n),i&&(r=new Date,r.setTime(r.getTime()+864e5*i),u="; expires="+r.toGMTString()),document.cookie=n+"="+t+u+"; path=/"},getState:function(n){var i,t,r,u=n+"=",f=document.cookie.split(";");if(o&&(r=sessionStorage.getItem(n)))return r;for(i=0;i<f.length;i++){for(t=f[i];" "===t.charAt(0);)t=t.substring(1,t.length);if(0===t.indexOf(u)){r=t.substring(u.length,t.length);break}}return r},clearState:function(n){o?sessionStorage.removeItem(n):this.setState(n,"",-1)},normalizePlacement:function(n){!n.placement&&n.orientation&&(n.placement=n.orientation)},flipPlacement:function(n){if(n.isRtl&&!n._isFlipped){var t,i,r=["orientation","placement"];n.xOffset&&(n.xOffset=-1*this.getPixelValue(n.xOffset));for(i in r)t=r[i],n.hasOwnProperty(t)&&tt.hasOwnProperty(n[t])&&(n[t]=tt[n[t]]);n._isFlipped=!0}}},n.addEvtListener(window,"load",b),e={next:[],prev:[],start:[],end:[],show:[],error:[],close:[]},f={},w={stepNums:null,nextBtn:"Next",prevBtn:"Back",doneBtn:"Done",skipBtn:"Skip",closeTooltip:"Close"},h={},s=function(n){this.init(n)},s.prototype={isShowing:!1,currStep:void 0,setPosition:function(t){var h,s,i,r,u,e,c,l=n.getStepTarget(t),o=this.element,f=this.arrowEl,a=t.isRtl?"right":"left";if(n.flipPlacement(t),n.normalizePlacement(t),s=o.offsetWidth,h=o.offsetHeight,n.removeClass(o,"fade-in-down fade-in-up fade-in-left fade-in-right"),i=l.getBoundingClientRect(),c=t.isRtl?i.right-s:i.left,"top"===t.placement)r=i.top-h-this.opt.arrowWidth,u=c;else if("bottom"===t.placement)r=i.bottom+this.opt.arrowWidth,u=c;else if("left"===t.placement)r=i.top,u=i.left-s-this.opt.arrowWidth;else{if("right"!==t.placement)throw new Error("Bubble placement failed because step.placement is invalid or undefined!");r=i.top;u=i.right+this.opt.arrowWidth}e="center"!==t.arrowOffset?n.getPixelValue(t.arrowOffset):t.arrowOffset;e?"top"===t.placement||"bottom"===t.placement?(f.style.top="",f.style[a]="center"===e?Math.floor(s/2-f.offsetWidth/2)+"px":e+"px"):("left"===t.placement||"right"===t.placement)&&(f.style[a]="",f.style.top="center"===e?Math.floor(h/2-f.offsetHeight/2)+"px":e+"px"):(f.style.top="",f.style[a]="");"center"===t.xOffset?u=i.left+l.offsetWidth/2-s/2:u+=n.getPixelValue(t.xOffset);"center"===t.yOffset?r=i.top+l.offsetHeight/2-h/2:r+=n.getPixelValue(t.yOffset);t.fixedElement||(r+=n.getScrollTop(),u+=n.getScrollLeft());o.style.position=t.fixedElement?"fixed":"absolute";o.style.top=r+"px";o.style.left=u+"px"},render:function(i,r,u){var e,v,y,f,h,k,d,p,a,s,o=this.element,w,b,g;if(i?this.currStep=i:this.currStep&&(i=this.currStep),this.opt.isTourBubble?(f=t.getCurrTour(),f&&(v=f.customData,e=f.customRenderer,i.isRtl=i.hasOwnProperty("isRtl")?i.isRtl:f.hasOwnProperty("isRtl")?f.isRtl:this.opt.isRtl,y=f.unsafe,Array.isArray(f.steps)&&(h=f.steps.length,k=this._getStepI18nNum(this._getStepNum(h-1)),p=this._getStepNum(r)===this._getStepNum(h-1)))):(v=i.customData,e=i.customRenderer,y=i.unsafe,i.isRtl=i.hasOwnProperty("isRtl")?i.isRtl:this.opt.isRtl),d=p?n.getI18NString("doneBtn"):i.showSkip?n.getI18NString("skipBtn"):n.getI18NString("nextBtn"),n.flipPlacement(i),n.normalizePlacement(i),this.placement=i.placement,s={i18n:{prevBtn:n.getI18NString("prevBtn"),nextBtn:d,closeTooltip:n.getI18NString("closeTooltip"),stepNum:this._getStepI18nNum(this._getStepNum(r)),numSteps:k},buttons:{showPrev:n.valOrDefault(i.showPrevButton,this.opt.showPrevButton)&&this._getStepNum(r)>0,showNext:n.valOrDefault(i.showNextButton,this.opt.showNextButton),showCTA:n.valOrDefault(i.showCTAButton&&i.ctaLabel,!1),ctaLabel:i.ctaLabel,showClose:n.valOrDefault(this.opt.showCloseButton,!0)},step:{num:r,isLast:n.valOrDefault(p,!1),title:i.title||"",content:i.content||"",isRtl:i.isRtl,placement:i.placement,padding:n.valOrDefault(i.padding,this.opt.bubblePadding),width:n.getPixelValue(i.width)||this.opt.bubbleWidth,customData:i.customData||{}},tour:{isTour:this.opt.isTourBubble,numSteps:h,unsafe:n.valOrDefault(y,!1),customData:v||{}}},"function"==typeof e)o.innerHTML=e(s);else if("string"==typeof e){if(!t.templates||"function"!=typeof t.templates[e])throw new Error('Bubble rendering failed - template "'+e+'" is not a function.');o.innerHTML=t.templates[e](s)}else if(c)o.innerHTML=c(s);else{if(!t.templates||"function"!=typeof t.templates[l])throw new Error('Bubble rendering failed - template "'+l+'" is not a function.');o.innerHTML=t.templates[l](s)}for(b=o.children,g=b.length,a=0;g>a;a++)w=b[a],n.hasClass(w,"hopscotch-arrow")&&(this.arrowEl=w);return o.style.zIndex="number"==typeof i.zindex?i.zindex:"",this._setArrow(i.placement),this.hide(!1),this.setPosition(i),u&&u(!i.fixedElement),this},_getStepNum:function(n){for(var r,u=0,f=t.getSkippedStepsIndexes(),e=f.length,i=0;e>i;i++)r=f[i],n>r&&u++;return n-u},_getStepI18nNum:function(t){var i=n.getI18NString("stepNums");return i&&t<i.length?t=i[t]:t+=1,t},_setArrow:function(t){n.removeClass(this.arrowEl,"down up right left");"top"===t?n.addClass(this.arrowEl,"down"):"bottom"===t?n.addClass(this.arrowEl,"up"):"left"===t?n.addClass(this.arrowEl,"right"):"right"===t&&n.addClass(this.arrowEl,"left")},_getArrowDirection:function(){return"top"===this.placement?"down":"bottom"===this.placement?"up":"left"===this.placement?"right":"right"===this.placement?"left":void 0},show:function(){var t=this,i="fade-in-"+this._getArrowDirection();return n.removeClass(this.element,"hide"),n.addClass(this.element,i),setTimeout(function(){n.removeClass(t.element,"invisible")},50),setTimeout(function(){n.removeClass(t.element,i)},1e3),this.isShowing=!0,this},hide:function(t){var i=this.element;return t=n.valOrDefault(t,!0),i.style.top="",i.style.left="",t?(n.addClass(i,"hide"),n.removeClass(i,"invisible")):(n.removeClass(i,"hide"),n.addClass(i,"invisible")),n.removeClass(i,"animate fade-in-up fade-in-down fade-in-right fade-in-left"),this.isShowing=!1,this},destroy:function(){var t=this.element;t&&t.parentNode.removeChild(t);n.removeEvtListener(t,"click",this.clickCb)},_handleBubbleClick:function(i){function u(t){return t===i.currentTarget?null:n.hasClass(t,"hopscotch-cta")?"cta":n.hasClass(t,"hopscotch-next")?"next":n.hasClass(t,"hopscotch-prev")?"prev":n.hasClass(t,"hopscotch-close")?"close":u(t.parentElement)}var r,f;if(i=i||window.event,f=i.target||i.srcElement,r=u(f),"cta"===r)this.opt.isTourBubble||t.getCalloutManager().removeCallout(this.currStep.id),this.currStep.onCTA&&n.invokeCallback(this.currStep.onCTA);else if("next"===r)t.nextStep(!0);else if("prev"===r)t.prevStep(!0);else if("close"===r){if(this.opt.isTourBubble){var e=t.getCurrStepNum(),o=t.getCurrTour(),s=e===o.steps.length-1;n.invokeEventCallbacks("close");t.endTour(!0,s)}else this.opt.onClose&&n.invokeCallback(this.opt.onClose),this.opt.id&&!this.opt.isTourBubble?t.getCalloutManager().removeCallout(this.opt.id):this.destroy();n.evtPreventDefault(i)}},init:function(f){var a,e,c,s,o=document.createElement("div"),h=this,l=!1;this.element=o;s={showPrevButton:u.showPrevButton,showNextButton:u.showNextButton,bubbleWidth:u.bubbleWidth,bubblePadding:u.bubblePadding,arrowWidth:u.arrowWidth,isRtl:u.isRtl,showNumber:!0,isTourBubble:!0};f=("undefined"==typeof f?"undefined":i(f))===r?{}:f;n.extend(s,f);this.opt=s;o.className="hopscotch-bubble animated";s.isTourBubble?(c=t.getCurrTour(),c&&n.addClass(o,"tour-"+c.id)):n.addClass(o,"hopscotch-callout no-number");a=function(){!l&&h.isShowing&&(l=!0,setTimeout(function(){h.setPosition(h.currStep);l=!1},100))};n.addEvtListener(window,"resize",a);this.clickCb=function(n){h._handleBubbleClick(n)};n.addEvtListener(o,"click",this.clickCb);this.hide();n.documentIsReady()?document.body.appendChild(o):(document.addEventListener?(e=function(){document.removeEventListener("DOMContentLoaded",e);window.removeEventListener("load",e);document.body.appendChild(o)},document.addEventListener("DOMContentLoaded",e,!1)):(e=function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",e),window.detachEvent("onload",e),document.body.appendChild(o))},document.attachEvent("onreadystatechange",e)),n.addEvtListener(window,"load",e))}},p=function(){var t={},i={};this.createCallout=function(r){var u;if(!r.id)throw new Error("Must specify a callout id.");if(!nt.test(r.id))throw new Error("Callout ID is using an invalid format. Use alphanumeric, underscores, and/or hyphens only. First character must be a letter.");if(t[r.id])throw new Error("Callout by that id already exists. Please choose a unique id.");if(!n.getStepTarget(r))throw new Error("Must specify existing target element via 'target' option.");return r.showNextButton=r.showPrevButton=!1,r.isTourBubble=!1,u=new s(r),t[r.id]=u,i[r.id]=r,u.render(r,null,function(){u.show();r.onShow&&n.invokeCallback(r.onShow)}),u};this.getCallout=function(n){return t[n]};this.removeAllCallouts=function(){for(var n in t)t.hasOwnProperty(n)&&this.removeCallout(n)};this.removeCallout=function(n){var r=t[n];t[n]=null;i[n]=null;r&&r.destroy()};this.refreshCalloutPositions=function(){var n,r,u;for(n in t)t.hasOwnProperty(n)&&i.hasOwnProperty(n)&&(r=t[n],u=i[n],r&&u&&r.setPosition(u))}},y=function(o){var k,ft,tt,w,v,ht,it,st,yt=this,ut={},et=[],rt=function(t){return k&&k.element&&k.element.parentNode||(k=new s(tt)),t&&n.extend(k.opt,{bubblePadding:y("bubblePadding"),bubbleWidth:y("bubbleWidth"),showNextButton:y("showNextButton"),showPrevButton:y("showPrevButton"),showCloseButton:y("showCloseButton"),arrowWidth:y("arrowWidth"),isRtl:y("isRtl")}),k},pt=function(){k&&(k.destroy(),k=null)},y=function(t){return"undefined"==typeof tt?u[t]:n.valOrDefault(tt[t],u[t])},b=function(){return!w||0>v||v>=w.steps.length?null:w.steps[v]},ot=function(){yt.nextStep()},wt=function(t){var c,s,l,e,a,v,tt=rt(),p=tt.element,h=n.getPixelValue(p.style.top),w=h+n.getPixelValue(p.offsetHeight),it=n.getStepTarget(b()),k=it.getBoundingClientRect(),d=k.top+n.getScrollTop(),nt=k.bottom+n.getScrollTop(),o=d>h?h:d,ut=w>nt?w:nt,f=n.getScrollTop(),ft=f+n.getWindowHeight(),u=o-y("scrollTopMargin");o>=f&&(o<=f+y("scrollTopMargin")||ft>=ut)?t&&t():y("smoothScroll")?("undefined"==typeof YAHOO?"undefined":i(YAHOO))!==r&&i(YAHOO.env)!==r&&i(YAHOO.env.ua)!==r&&i(YAHOO.util)!==r&&i(YAHOO.util.Scroll)!==r?(c=YAHOO.env.ua.webkit?document.body:document.documentElement,l=YAHOO.util.Easing?YAHOO.util.Easing.easeOut:void 0,s=new YAHOO.util.Scroll(c,{scroll:{to:[0,u]}},y("scrollDuration")/1e3,l),s.onComplete.subscribe(t),s.animate()):g?jQuery("body, html").animate({scrollTop:u},y("scrollDuration"),t):(0>u&&(u=0),e=f>o?-1:1,a=Math.abs(f-u)/(y("scrollDuration")/10),(v=function(){var r=n.getScrollTop(),i=r+e*a;return e>0&&i>=u||0>e&&u>=i?(i=u,t&&t(),void window.scrollTo(0,i)):(window.scrollTo(0,i),n.getScrollTop()===r?void(t&&t()):void setTimeout(v,10))})()):(window.scrollTo(0,u),t&&t())},ct=function bt(t,i){var f,r,u;v+t>=0&&v+t<w.steps.length?(v+=t,r=b(),u=function(){f=n.getStepTarget(r);f?(ut[v]&&delete ut[v],i(v)):(ut[v]=!0,n.invokeEventCallbacks("error"),bt(t,i))},r.delay?setTimeout(u,r.delay):u()):i(-1)},lt=function(t,i){var r,u,f,e,o=rt(),s=this;if(o.hide(),t=n.valOrDefault(t,!0),r=b(),r.nextOnTargetClick&&n.removeEvtListener(n.getStepTarget(r),"click",ot),u=r,f=i>0?u.multipage:v>0&&w.steps[v-1].multipage,e=function(r){var e;if(-1===r)return this.endTour(!0);if(t&&(e=i>0?n.invokeEventCallbacks("next",u.onNext):n.invokeEventCallbacks("prev",u.onPrev)),r===v){if(f)return void vt();e=n.valOrDefault(e,!0);e?this.showStep(r):this.endTour(!1)}},!f&&y("skipIfNoElement"))ct(i,function(n){e.call(s,n)});else if(v+i>=0&&v+i<w.steps.length){if(v+=i,r=b(),!n.getStepTarget(r)&&!f)return n.invokeEventCallbacks("error"),this.endTour(!0,!1);e.call(this,v)}else if(v+i===w.steps.length)return this.endTour();return this},kt=function(t){var i,u,r,f={};for(i in t)t.hasOwnProperty(i)&&"id"!==i&&"steps"!==i&&(f[i]=t[i]);return st.call(this,f,!0),u=n.getState(y("cookieName")),u&&(r=u.split(":"),ht=r[0],it=r[1],r.length>2&&(et=r[2].split(",")),it=parseInt(it,10)),this},dt=function(t,i,r){var u,f;if(v=t||0,ut=i||{},u=b(),f=n.getStepTarget(u))return void r(v);if(!f){if(n.invokeEventCallbacks("error"),ut[v]=!0,y("skipIfNoElement"))return void ct(1,r);v=-1;r(v)}},at=function(t){function u(){r.show();n.invokeEventCallbacks("show",i.onShow)}var i=w.steps[t],r=rt(),f=n.getStepTarget(i);v!==t&&b().nextOnTargetClick&&n.removeEvtListener(n.getStepTarget(b()),"click",ot);v=t;r.hide(!1);r.render(i,t,function(t){t?wt(u):u();i.nextOnTargetClick&&n.addEvtListener(f,"click",ot)});vt()},vt=function(){var r=w.id+":"+v,i=t.getSkippedStepsIndexes();i&&i.length>0&&(r+=":"+i.join(","));n.setState(y("cookieName"),r,1)},gt=function(n){n&&this.configure(n)};this.getCalloutManager=function(){return("undefined"==typeof ft?"undefined":i(ft))===r&&(ft=new p),ft};this.startTour=function(t,u){var s,f,h={},e=this,o,c;if(!w){if(!t)throw new Error("Tour data is required for startTour.");if(!t.id||!nt.test(t.id))throw new Error("Tour ID is using an invalid format. Use alphanumeric, underscores, and/or hyphens only. First character must be a letter.");w=t;kt.call(this,t)}if(("undefined"==typeof u?"undefined":i(u))!==r){if(u>=w.steps.length)throw new Error("Specified step number out of bounds.");f=u}if(!n.documentIsReady())return d=!0,this;if("undefined"==typeof f&&w.id===ht&&("undefined"==typeof it?"undefined":i(it))!==r){if(f=it,et.length>0)for(o=0,c=et.length;c>o;o++)h[et[o]]=!0}else f||(f=0);return dt(f,h,function(t){var i=-1!==t&&n.getStepTarget(w.steps[t]);return i?(n.invokeEventCallbacks("start"),s=rt(),s.hide(!1),e.isActive=!0,void(n.getStepTarget(b())?e.showStep(t):(n.invokeEventCallbacks("error"),y("skipIfNoElement")&&e.nextStep(!1)))):void e.endTour(!1,!1)}),this};this.showStep=function(t){var i=w.steps[t],r=v;return n.getStepTarget(i)?(i.delay?setTimeout(function(){at(t)},i.delay):at(t),this):(v=t,n.invokeEventCallbacks("error"),void(v=r))};this.prevStep=function(n){return lt.call(this,n,-1),this};this.nextStep=function(n){return lt.call(this,n,1),this};this.endTour=function(t,i){var r,u=rt();return t=n.valOrDefault(t,!0),i=n.valOrDefault(i,!0),w&&(r=b(),r&&r.nextOnTargetClick&&n.removeEvtListener(n.getStepTarget(r),"click",ot)),v=0,it=void 0,u.hide(),t&&n.clearState(y("cookieName")),this.isActive&&(this.isActive=!1,w&&i&&n.invokeEventCallbacks("end")),this.removeCallbacks(null,!0),this.resetDefaultOptions(),pt(),w=null,this};this.getCurrTour=function(){return w};this.getCurrTarget=function(){return n.getStepTarget(b())};this.getCurrStepNum=function(){return v};this.getSkippedStepsIndexes=function(){var n,t=[];for(n in ut)t.push(n);return t};this.refreshBubblePosition=function(){var n=b();return n&&rt().setPosition(n),this.getCalloutManager().refreshCalloutPositions(),this};this.listen=function(n,t,i){return n&&e[n].push({cb:t,fromTour:i}),this};this.unlisten=function(n,t){for(var r=e[n],i=0,u=r.length;u>i;++i)r[i].cb===t&&r.splice(i,1);return this};this.removeCallbacks=function(n,t){var r,i,u;for(var f in e)if(!n||n===f)if(t)for(r=e[f],i=0,u=r.length;u>i;++i)r[i].fromTour&&(r.splice(i--,1),--u);else e[f]=[];return this};this.registerHelper=function(n,t){"string"==typeof n&&"function"==typeof t&&(f[n]=t)};this.unregisterHelper=function(n){f[n]=null};this.invokeHelper=function(n){for(var r=[],t=1,i=arguments.length;i>t;++t)r.push(arguments[t]);f[n]&&f[n].call(null,r)};this.setCookieName=function(n){return tt.cookieName=n,this};this.resetDefaultOptions=function(){return tt={},this};this.resetDefaultI18N=function(){return h={},this};this.getState=function(){return n.getState(y("cookieName"))};st=function(t,i){var o,f,r,e,u=["next","prev","start","end","show","error","close"];for(tt||this.resetDefaultOptions(),n.extend(tt,t),t&&n.extend(h,t.i18n),r=0,e=u.length;e>r;++r)f="on"+u[r].charAt(0).toUpperCase()+u[r].substring(1),t[f]&&this.listen(u[r],t[f],i);return o=rt(!0),this};this.configure=function(n){return st.call(this,n,!1)};this.setRenderer=function(n){var t="undefined"==typeof n?"undefined":i(n);return"string"===t?(l=n,c=void 0):"function"===t&&(c=n),this};this.setEscaper=function(n){return"function"==typeof n&&(a=n),this};gt.call(this,o)},t=new y,function(){var n={};n.escape=function(n){return a?a(n):null==n?"":(""+n).replace(new RegExp("[&<>\"']","g"),function(n){return"&"==n?"&amp;":"<"==n?"&lt;":">"==n?"&gt;":'"'==n?"&quot;":"'"==n?"&#x27;":void 0})};this.templates=this.templates||{};this.templates.bubble_default=function(t){function s(t,i){return i?n.escape(t):t}var i,r="";n.escape;Array.prototype.join;r+="\n";var e=t.i18n,f=t.buttons,u=t.step,o=t.tour;return r+='\n<div class="hopscotch-bubble-container" style="width: '+(null==(i=u.width)?"":i)+"px; padding: "+(null==(i=u.padding)?"":i)+'px;">\n  ',o.isTour&&(r+='<span class="hopscotch-bubble-number">'+(null==(i=e.stepNum)?"":i)+"<\/span>"),r+='\n  <div class="hopscotch-bubble-content">\n    ',""!==u.title&&(r+='<h3 class="hopscotch-title">'+(null==(i=s(u.title,o.unsafe))?"":i)+"<\/h3>"),r+="\n    ",""!==u.content&&(r+='<div class="hopscotch-content">'+(null==(i=s(u.content,o.unsafe))?"":i)+"<\/div>"),r+='\n  <\/div>\n  <div class="hopscotch-actions">\n    ',f.showPrev&&(r+='<button class="hopscotch-nav-button prev hopscotch-prev">'+(null==(i=e.prevBtn)?"":i)+"<\/button>"),r+="\n    ",f.showCTA&&(r+='<button class="hopscotch-nav-button next hopscotch-cta">'+(null==(i=f.ctaLabel)?"":i)+"<\/button>"),r+="\n    ",f.showNext&&(r+='<button class="hopscotch-nav-button next hopscotch-next">'+(null==(i=e.nextBtn)?"":i)+"<\/button>"),r+="\n  <\/div>\n  ",f.showClose&&(r+='<button class="hopscotch-bubble-close hopscotch-close">'+(null==(i=e.closeTooltip)?"":i)+"<\/button>"),r+'\n<\/div>\n<div class="hopscotch-bubble-arrow-container hopscotch-arrow">\n  <div class="hopscotch-bubble-arrow-border"><\/div>\n  <div class="hopscotch-bubble-arrow"><\/div>\n<\/div>\n'}}.call(t),t})