var EnjoyHint=function(a){var b,c=this,d={onStart:function(){},onEnd:function(){},onSkip:function(){},onNext:function(){}},e=$.extend(d,a),f=[],g=0;$body=$("body");var h=function(){$(".enjoyhint")&&$(".enjoyhint").remove(),$body.css({overflow:"hidden"}),$(document).on("touchmove",i),$body.enjoyhint({onNextClick:function(){l()},onSkipClick:function(){e.onSkip(),m()}})},i=function(a){a.preventDefault()},j=function(){$(".enjoyhint").remove(),$body.css({overflow:"auto"}),$(document).off("touchmove",i)};c.clear=function(){var a=$(".enjoyhint_next_btn"),b=$(".enjoyhint_skip_btn");a.removeClass(c.nextUserClass),a.text("Next"),b.removeClass(c.skipUserClass),b.text("Skip")};var k=function(){if(!f||!f[g])return $body.enjoyhint("hide"),e.onEnd(),void j();e.onNext();var a=$(".enjoyhint");a.removeClass("enjoyhint-step-"+g),a.removeClass("enjoyhint-step-"+(g+1)),a.addClass("enjoyhint-step-"+(g+1));var d=f[g];d.onBeforeStart&&"function"==typeof d.onBeforeStart&&d.onBeforeStart();var h=d.timeout||0;setTimeout(function(){if(!d.selector)for(var a in d)d.hasOwnProperty(a)&&a.split(" ")[1]&&(d.selector=a.split(" ")[1],d.event=a.split(" ")[0],"next"!=a.split(" ")[0]&&"auto"!=a.split(" ")[0]&&"custom"!=a.split(" ")[0]||(d.event_type=a.split(" ")[0]),d.description=d[a]);setTimeout(function(){c.clear()},250),$(document.body).scrollTo(d.selector,d.scrollAnimationSpeed||250,{offset:-100}),setTimeout(function(){var a=$(d.selector),e=n(d.event);if($body.enjoyhint("show"),$body.enjoyhint("hide_next"),b=a,d.event_selector&&(b=$(d.event_selector)),d.event_type||"key"!=d.event||a.keydown(function(a){a.which==d.keyCode&&(g++,k())}),1==d.showNext&&$body.enjoyhint("show_next"),0==d.showSkip?$body.enjoyhint("hide_skip"):$body.enjoyhint("show_skip"),1==d.showSkip,d.nextButton){var f=$(".enjoyhint_next_btn");f.addClass(d.nextButton.className||""),f.text(d.nextButton.text||"Next"),c.nextUserClass=d.nextButton.className}if(d.skipButton){var h=$(".enjoyhint_skip_btn");h.addClass(d.skipButton.className||""),h.text(d.skipButton.text||"Skip"),c.skipUserClass=d.skipButton.className}if(d.event_type)switch(d.event_type){case"auto":switch(a[d.event](),d.event){case"click":}return g++,void k();case"custom":o(d.event,function(){g++,p(d.event),k()});break;case"next":$body.enjoyhint("show_next")}else b.on(e,function(a){d.keyCode&&a.keyCode!=d.keyCode||(g++,$(this).off(e),k())});var i=Math.max(a.outerWidth(),a.outerHeight()),j=d.radius||Math.round(i/2)+5,l=a.offset(),m=a.outerWidth(),q=a.outerHeight(),r=void 0!==d.margin?d.margin:10,s={x:l.left+Math.round(m/2),y:l.top+Math.round(q/2)-$(document).scrollTop()},t={enjoyHintElementSelector:d.selector,center_x:s.x,center_y:s.y,text:d.description,top:d.top,bottom:d.bottom,left:d.left,right:d.right,margin:d.margin,scroll:d.scroll};d.shape&&"circle"==d.shape?(t.shape="circle",t.radius=j):(t.radius=0,t.width=m+r,t.height=q+r),$body.enjoyhint("render_label_with_shape",t,c.stop)},d.scrollAnimationSpeed+20||270)},h)},l=function(){g++,k()},m=function(){var a=f[g],b=$(a.selector);p(a.event),b.off(n(a.event)),j()},n=function(a,b){return a+(b?"custom":"")+".enjoy_hint"},o=function(a,b){$body.on(n(a,!0),b)},p=function(a){$body.off(n(a,!0))};window.addEventListener("resize",function(){null!=b&&$body.enjoyhint("redo_events_near_rect",b[0].getBoundingClientRect())}),c.stop=function(){m()},c.reRunScript=function(a){g=a,k()},c.runScript=function(){g=0,e.onStart(),k()},c.resumeScript=function(){k()},c.setCurrentStep=function(a){g=a},c.getCurrentStep=function(){return g},c.trigger=function(a){switch(a){case"next":l();break;case"skip":m()}},c.setScript=function(a){a&&(f=a)},c.set=function(a){c.setScript(a)},c.setSteps=function(a){c.setScript(a)},c.run=function(){c.runScript()},c.resume=function(){c.resumeScript()},h()};CanvasRenderingContext2D.prototype.roundRect=function(a,b,c,d,e){return c<2*e&&(e=c/2),d<2*e&&(e=d/2),this.beginPath(),this.moveTo(a+e,b),this.arcTo(a+c,b,a+c,b+d,e),this.arcTo(a+c,b+d,a,b+d,e),this.arcTo(a,b+d,a,b,e),this.arcTo(a,b,a+c,b,e),this.closePath(),this},function(a){var b,c,d,e,f,g,h,i,j,k,l,m=window.innerWidth,n=window.innerHeight,o={init:function(o){return this.each(function(){function p(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)c.setAttribute(d,b[d]);return c}var q={onNextClick:function(){},onSkipClick:function(){},animation_time:800};this.enjoyhint_obj={},b=this.enjoyhint_obj,b.resetComponentStuff=function(){c=null,d=null,e=null,f=null,g=null,h=null,i=null,j=null,k=null,l=null,m=window.innerWidth,n=window.innerHeight};var r=a(this);b.options=jQuery.extend(q,o),b.gcl={chooser:"enjoyhint"},b.cl={enjoy_hint:"enjoyhint",hide:"enjoyhint_hide",disable_events_element:"enjoyhint_disable_events",btn:"enjoyhint_btn",skip_btn:"enjoyhint_skip_btn",close_btn:"enjoyhint_close_btn",next_btn:"enjoyhint_next_btn",main_canvas:"enjoyhint_canvas",main_svg:"enjoyhint_svg",svg_wrapper:"enjoyhint_svg_wrapper",svg_transparent:"enjoyhint_svg_transparent",kinetic_container:"kinetic_container"},b.canvas_size={w:1.4*a(window).width(),h:1.4*a(window).height()};var s="enj_canvas";b.enjoyhint=a("
",{class:b.cl.enjoy_hint+" "+b.cl.svg_transparent}).appendTo(r),b.enjoyhint_svg_wrapper=a("
",{class:b.cl.svg_wrapper+" "+b.cl.svg_transparent}).appendTo(b.enjoyhint),b.$stage_container=a('
').appendTo(b.enjoyhint),b.$canvas=a('