/**
@license Sideshow - An incredible Javascript interactive help Library Version: 0.4.2 Date: 2015-03-10 Author: Alcides Queiroz [alcidesqueiroz(at)gmail(dot)com] Available under Apache License 2.0 (https://raw2.github.com/fortesinformatica/sideshow/master/LICENSE) **/
!function(t,e,i,s){!function(e,i){var s=i();“function”==typeof define&&define.amd?define(i):t=s}(“sideshow”,function(){function n(t,e){this.name=“SSException”,this.message=“ ”+e}function o(t,e){console.warn(“ ”+e)}function r(t){console.warn(“ ”+t)}function a(t){if(t.constructor!==String)return t;var e=“”===t?“0”:t;return+e.replace(“px”,“”)}function h(t){return S.config.language in t?t:(o(“2001”,“String not found for the selected language, getting the first available.”),t[Object.keys(t)])}function d(){m.keyup(u)}function l(){m.unbind(“keyup”,u)}function u(t){(27==t.keyCode||112==t.keyCode)&&S.close()}function c(){m.keyup(function(t){113==t.keyCode&&(t.shiftKey?S.start({listAll:!0}):S.start())})}function f(){e(‘’).not(“.sideshow-mask-part, .sideshow-mask-corner-part, .sideshow-subject-mask”).remove()}if(void 0===e)throw new n(“2”,“jQuery is required for Sideshow to work.”);if(void 0===i)throw new n(“3”,“Jazz is required for Sideshow to work.”);if(void 0===s)throw new n(“4”,“Pagedown (the Markdown parser used by Sideshow) is required for Sideshow to work.”);var p,g,m,w,b=“Sideshow”,v=150,C=600,S={get VERSION(){return“0.4.2”}},x=[],k={lockMaskUpdate:!1,changingStep:!1,skippingStep:!1,running:!1},I=,y=i.Enum(“VISIBLE”,“FADING_IN”,“FADING_OUT”,“NOT_DISPLAYED”,“NOT_RENDERED”,“TRANSPARENT”);n.prototype=new Error,n.prototype.constructor=n;var T={availableWizards:{en:“Available Tutorials”,“pt-br”:“Tutoriais Disponíveis”,es:“Tutoriales Disponibles”},relatedWizards:{en:“Related Wizards”,“pt-br”:“Tutoriais Relacionados”,es:“Tutoriales Relacionados”},noAvailableWizards:{en:“There’s no tutorials available.”,“pt-br”:“Não há tutoriais disponíveis para esta tela.”,es:“No hay tutoriales disponibles.”},close:{en:“Close”,“pt-br”:“Fechar”,es:“Cerrar”},estimatedTime:{en:“Estimated Time”,“pt-br”:“Tempo Estimado”,es:“Tiempo Estimado”},next:{en:“Next”,“pt-br”:“Continuar”,es:“Continuar”},finishWizard:{en:“Finish Wizard”,“pt-br”:“Concluir Tutorial”,es:“Concluir Tutorial”}};S.config={},S.config.userPreferencesRoute=null,S.config.loggedInUser=null,S.config.language=“en”,S.config.autoSkipIntro=!1,S.ControlVariables={},S.ControlVariables.set=function(t,e){var i={};return this.isDefined(t)?i=this.getNameValuePair(t):x.push(i),i.name=t,i.value=e,t+“=”+e},S.ControlVariables.setIfUndefined=function(t,e){return this.isDefined(t)?void 0:this.set(t,e)},S.ControlVariables.isDefined=function(t){return void 0!==this.getNameValuePair(t)},S.ControlVariables.get=function(t){var e=this.getNameValuePair(t);return e?e.value:void 0},S.ControlVariables.getNameValuePair=function(t){for(var e=0;e<x.length;e++){var i=x;if(i.name===t)return i}},S.ControlVariables.remove=function(t){return x.splice(x.indexOf(this.getNameValuePair(t)),1)},S.ControlVariables.clear=function(){x=[]};var $=i.Class();$.field(“$el”),$.field(“status”,y.NOT_RENDERED),$.method(“render”,function(t){(t||g).append(this.$el),this.status=y.NOT_DISPLAYED}),$.method(“destroy”,function(){this.$el.remove()});var j=i.Class().extending($);j.method(“show”,function(t){this.$el||this.render(),t||this.$el.removeClass(“sideshow-invisible”),this.$el.removeClass(“sideshow-hidden”),this.status=y.VISIBLE}),j.method(“hide”,function(t){t||this.$el.addClass(“sideshow-hidden”),this.$el.addClass(“sideshow-invisible”),this.status=y.NOT_DISPLAYED});var E=i.Class().extending(j);E.method(“fadeIn”,function(t,e){var i=this;i.status=y.FADING_IN,i.$el||this.render(),e&&i.$el.css(“animation-timing-function”,“linear”),i.$el.removeClass(“sideshow-hidden”),setTimeout(function(){i.$el.removeClass(“sideshow-invisible”),setTimeout(function(){i.status=y.VISIBLE,e&&i.$el.css(“animation-timing-function”,“ease”),t&&t()},C)},20)}),E.method(“fadeOut”,function(t,e){var i=this;i.status!=y.NOT_RENDERED&&(i.status=y.FADING_OUT,e&&i.$el.css(“animation-timing-function”,“linear”),i.$el.addClass(“sideshow-invisible”),setTimeout(function(){i.$el.addClass(“sideshow-hidden”),i.status=y.NOT_DISPLAYED,e&&i.$el.css(“animation-timing-function”,“ease”),t&&t()},C))});var M=i.Class(function(t){this.name=t.name,this.title=t.title,this.description=t.description,this.estimatedTime=t.estimatedTime,this.affects=t.affects,this.preparation=t.preparation,this.listeners=t.listeners,this.showStepPosition=t.showStepPosition,this.relatedWizards=t.relatedWizards});M.field(“preparation”),M.field(“listeners”),M.field(“showStepPosition”),M.field(“relatedWizards”),M.field(“name”),M.field(“title”),M.field(“description”),M.field(“estimatedTime”),M.field(“affects”),M.field(“_storyline”),M.field(“currentStep”),M.method(“storyLine”,function(t){this._storyline=t}),M.method(“play”,function(){var t=this;if(V.enqueue(“check_composite_mask_subject_changes”,function(){O.CompositeMask.singleInstance.pollForSubjectChanges()}),V.enqueue(“check_arrow_changes”,function(){z.pollForArrowsChanges(!0)}),!this._storyline)throw new n(“201”,“A wizard needs to have a storyline.”);var e=this._storyline.steps;if(0===e.length)throw new n(“202”,“A storyline must have at least one step.”);P.singleInstance.render(),B.singleInstance.render();var i=this.listeners;i&&i.beforeWizardStarts&&i.beforeWizardStarts(),k.changingStep=!0,this.showStep(e,function(){V.enqueue(“check_completed_step”,function(){t.pollForCheckCompletedStep()})}),O.CompositeMask.singleInstance.fadeIn()}),M.method(“showStep”,function(t,e){function i(){k.skippingStep=!0,n.next()}var n=this;if(k.skippingStep=!1,z.clear(),this.currentStep&&this.currentStep.listeners&&this.currentStep.listeners.afterStep&&this.currentStep.listeners.afterStep(),t&&t.listeners&&t.listeners.beforeStep&&t.listeners.beforeStep(),this.currentStep=t,t.skipIf&&t.skipIf()&&i(this),k.changingStep&&!k.skippingStep){t.subject?S.setSubject(t.subject):S.setEmptySubject(),O.CompositeMask.singleInstance.update(W.position,W.dimension,W.borderRadius);var o=O.SubjectMask.singleInstance;o.fadeOut(function(){t.lockSubject&&o.show(!0)}),P.singleInstance.show(),P.singleInstance.positionate();var r=B.singleInstance,a=t.text;if(a=a instanceof Function?S.heredoc(a):a,“markdown”==t.format?r.setHTML((new s.Converter).makeHtml(a)):r.setText(a),r.setTitle(t.title),r.setStepPosition(this.getStepPosition()1
“/”+this._storyline.steps.length),t.showNextButton||t.autoContinue===!1||!(t.completingConditions&&t.completingConditions.length>0)){var d=this._storyline.steps;r.nextButton.setText(d?h(T.next)+“: ”+this._storyline.steps.title:h(T.finishWizard)),r.nextButton.show(),t.autoContinue===!1&&r.nextButton.disable()}else r.nextButton.hide();t.targets&&t.targets.length>0&&(z.setTargets(t.targets),z.render(),z.positionate(),z.fadeIn()),r.show(!0),O.CompositeMask.singleInstance.scrollIfNecessary(W.position,W.dimension)||(r.positionate(),r.fadeIn()),e&&e(),k.changingStep=!1}}),M.method(“next”,function(t,e){if(!k.changingStep||k.skippingStep){k.changingStep=!0;var i=this.currentStep;e=e||this._storyline.steps;var s=this;this.hideStep(function(){if(e)s.showStep(e,function(){t&&t()});else{i&&i.listeners&&i.listeners.afterStep&&i.listeners.afterStep();var n=w;w=null;var o=s.listeners;o&&o.afterWizardEnds&&o.afterWizardEnds(),S.showRelatedWizardsList(n)||S.close()}})}}),M.method(“hideStep”,function(t){B.singleInstance.fadeOut(function(){P.singleInstance.hide()}),z.fadeOut(),O.SubjectMask.singleInstance.update(W.position,W.dimension,W.borderRadius),O.SubjectMask.singleInstance.fadeIn(t)}),M.method(“getStepPosition”,function(t){return this._storyline.steps.indexOf(t||this.currentStep)}),M.method(“isEligible”,function(){function e(t,e,i){return i?t===e:t.toLowerCase()===e.toLowerCase()}for(var i=t.location,s=0;s<this.affects.length;s++){var n=this.affects;if(n instanceof Function){if(n())return!0}else if(n instanceof Object){if(“route”in n){var o=i.pathname+i.search+i.hash;if(e(o,n.route,n.caseSensitive))return!0}if(“hash”in n&&e(location.hash,n.hash,n.caseSensitive))return!0;if(“url”in n&&e(location.href,n.url,n.caseSensitive))return!0}}return!1}),M.method(“isAlreadyWatched”,function(){return!1}),M.method(“pollForCheckCompletedStep”,function(){var t=this.currentStep.completingConditions;if(t&&t.length>0&&!k.skippingStep){for(var e=!0,i=0;i<t.length;i++){var s=t;s()||(e=!1)}e&&(this.currentStep.autoContinue===!1?B.singleInstance.nextButton.enable():w.next())}}),M.method(“prepareAndPlay”,function(){if(w=this,this.isEligible())this.play();else{if(!this.preparation)throw new n(“203”,“This wizard is not eligible neither has a preparation function.”);this.preparation(function(){w.play()})}});var P=i.Class().extending(E).singleton;P.field(“dimension”,{}),P.field(“position”,{}),P.method(“render”,function(){this.$el=e(“<div>”).addClass(“sideshow-details-panel”).addClass(“sideshow-hidden”),this.callSuper(“render”)}),P.method(“positionate”,function(){for(var t=O.CompositeMask.singleInstance.parts,e=[,[t.right,“width”],,[t.left,“width”]].sort(function(t,e){return t.dimension[t]-e.dimension[e]}),i=e.slice(-1),s=2;s>0;s–){var n=e,o=n.dimension;o.width>250&&o.height>250&&o.width+o.height>2*(i.dimension.width+i.dimension.height)&&(i=n)}“width”==i?this.$el.css(“left”,i.position.x).css(“top”,0).css(“height”,N.dimension.height).css(“width”,i.dimension.width):this.$el.css(“left”,0).css(“top”,i.position.y).css(“height”,i.dimension.height).css(“width”,N.dimension.width),this.dimension={width:a(this.$el.css(“width”)),height:a(this.$el.css(“height”))},this.position={x:a(this.$el.css(“left”)),y:a(this.$el.css(“top”))}});var z={};z.arrows=[],z.clear=function(){this.arrows=},z.setTargets=function(t,i){if(t.constructor===String&&(t=e(t)),t instanceof e&&t.length>0)t.each(function(){var t=R.build();t.target.$el=e(this),t.target.$el.is(“:visible”)&&(z.arrows.push(t),t.onceVisible=!0)});else if(!i)throw new n(“150”,“Invalid targets.”)},z.recreateDOMReferences=function(){for(var t=0;t<this.arrows.length;t++){var e=this.arrows;e.$el.remove()}z.clear(),z.setTargets(w.currentStep.targets,!0),z.render(),z.positionate(),z.show()},z.show=function(){for(var t=0;t<this.arrows.length;t++){var e=this.arrows;e.show()}},z.hide=function(){for(var t=0;t<this.arrows.length;t++){var e=this.arrows;e.hide()}},z.fadeIn=function(){for(var t=0;t<this.arrows.length;t++){var e=this.arrows;e.fadeIn()}},z.fadeOut=function(){function t(t){t.fadeOut(function(){t.destroy()})}for(var e=0;e<this.arrows.length;e++){var i=this.arrows;t(i)}},z.positionate=function(){for(var t=0;t<this.arrows.length;t++){var e=this.arrows;e.positionate()}},z.render=function(){for(var t=0;t<this.arrows.length;t++){var e=this.arrows;e.render()}},z.pollForArrowsChanges=function(){for(var t=!1,e=0;e<this.arrows.length;e++){var i=this.arrows;i.hasChanged()&&i.positionate(),i.onceVisible&&!i.target.$el.is(“:visible”)&&(t=!0)}t&&this.recreateDOMReferences()};var R=i.Class().extending(E);R.field(“target”,{}),R.field(“onceVisible”,!1),R.method(“render”,function(){this.$el=e(“<div>”).addClass(“sideshow-subject-arrow”).addClass(“sideshow-hidden”).addClass(“sideshow-invisible”),this.callSuper(“render”)}),R.method(“positionate”,function(){var t=this.target;t.position={x:t.$el.offset().left-p.scrollLeft(),y:t.$el.offset().top-p.scrollTop()},t.dimension={width:t.$el.outerWidth(),height:t.$el.outerHeight()},this.$el.css(“top”,t.position.y-30+“px”).css(“left”,t.position.x+a(t.dimension.width)/2-12+“px”)}),R.method(“show”,function(){this.callSuper(“show”),this.positionate()}),R.method(“fadeIn”,function(){this.callSuper(“fadeIn”),this.positionate()}),R.method(“hasChanged”,function(){return this.target.dimension.width!==this.target.$el.outerWidth()||this.target.dimension.height!==this.target.$el.outerHeight()||this.target.position.y!==this.target.$el.offset().top-p.scrollTop()||this.target.position.x!==this.target.$el.offset().left-p.scrollLeft()});var B=i.Class(function(){this.nextButton=_.build()}).extending(E).singleton;B.field(“text”,“”),B.field(“title”,“”),B.field(“dimension”,{}),B.field(“position”,{}),B.field(“nextButton”),B.method(“setText”,function(t){this.text=t,this.$el.find(“.sideshow-step-text”).text(t)}),B.method(“setHTML”,function(t){this.text=t,this.$el.find(“.sideshow-step-text”).html(t)}),B.method(“setTitle”,function(t){this.title=t,this.$el.find(“h2:first”).text(t)}),B.method(“setStepPosition”,function(t){this.stepPosition=t,this.$el.find(“.sideshow-step-position”).text(t)}),B.method(“render”,function(){this.$el=e(“<div>”).addClass(“sideshow-step-description”).addClass(“sideshow-hidden”).addClass(“sideshow-invisible”);var t=e(“<span>”).addClass(“sideshow-step-position”);this.$el.append(t),w.showStepPosition===!1&&t.hide(),this.$el.append(e(“<h2>”)),this.$el.append(e(“<div>”).addClass(“sideshow-step-text”)),this.nextButton.render(this.$el),this.nextButton.$el.click(function(){w.next()}),P.singleInstance.$el.append(this.$el)}),B.method(“show”,function(t){this.callSuper(“show”,t)}),B.method(“positionate”,function(){var t=P.singleInstance;this.dimension.width=t.dimension.width>=900?900:.9*t.dimension.width,this.$el.css(“width”,this.dimension.width);var e=(a(this.$el.css(“padding-left”))+a(this.$el.css(“padding-right”)))/2,i=(a(this.$el.css(“padding-top”))+a(this.$el.css(“padding-bottom”)))/2;this.dimension.height=a(this.$el.outerHeight()),this.dimension.height>t.dimension.height||this.dimension.width<400?(this.dimension.width=.9*p.width(),this.$el.css(“width”,this.dimension.width),this.dimension.height=a(this.$el.outerHeight()),this.position.x=(p.width()-this.dimension.width)/2,this.position.y=(p.height()-this.dimension.height)/2):(this.position.x=(t.dimension.width-this.dimension.width)/2,this.position.y=(t.dimension.height-this.dimension.height)/2),this.$el.css(“left”,this.position.x-e),this.$el.css(“top”,this.position.y-i)});var _=i.Class().extending(j);_.field(“_text”),_.method(“disable”,function(){this.$el.attr(“disabled”,“disabled”)}),_.method(“enable”,function(){this.$el.attr(“disabled”,null)}),_.method(“setText”,function(t){this._text=t,this.$el.text(t)}),_.method(“render”,function(t){this.$el=e(“<button>”).addClass(“sideshow-next-step-button”),this.callSuper(“render”,t)});var N={};N.dimension={},N.hasChanged=function(){return p.width()!==this.dimension.width||p.height()!==this.dimension.height},N.updateInfo=function(){this.dimension.width=p.width(),this.dimension.height=p.height()};var W={};W.obj=null,W.dimension={},W.position={},W.borderRadius={},W.hasChanged=function(){return this.obj?this.obj.offset().left-p.scrollLeft()!==this.position.x||this.obj.offset().top-p.scrollTop()!==this.position.y||this.obj.outerWidth()!==this.dimension.width||this.obj.outerHeight()!==this.dimension.height||a(this.obj.css(“border-top-left-radius”))!==this.borderRadius.leftTop||a(this.obj.css(“border-top-right-radius”))!==this.borderRadius.rightTop||a(this.obj.css(“border-bottom-left-radius”))!==this.borderRadius.leftBottom||a(this.obj.css(“border-bottom-right-radius”))!==this.borderRadius.rightBottom||N.hasChanged():!1},W.updateInfo=function(t){void 0===t?(this.position.x=this.obj.offset().left-p.scrollLeft(),this.position.y=this.obj.offset().top-p.scrollTop(),this.dimension.width=this.obj.outerWidth(),this.dimension.height=this.obj.outerHeight(),this.borderRadius.leftTop=a(this.obj.css(“border-top-left-radius”)),this.borderRadius.rightTop=a(this.obj.css(“border-top-right-radius”)),this.borderRadius.leftBottom=a(this.obj.css(“border-bottom-left-radius”)),this.borderRadius.rightBottom=a(this.obj.css(“border-bottom-right-radius”))):(this.position.x=t.position.x,this.position.y=t.position.y,this.dimension.width=t.dimension.width,this.dimension.height=t.dimension.height,this.borderRadius.leftTop=t.borderRadius.leftTop,this.borderRadius.rightTop=t.borderRadius.rightTop,this.borderRadius.leftBottom=t.borderRadius.leftBottom,this.borderRadius.rightBottom=t.borderRadius.rightBottom),N.updateInfo()},W.isSubjectVisible=function(t,e){return t.y+e.height>p.height()||t.y<0?!1:!0};var O={};O.SubjectMask=i.Class().extending(E).singleton,O.SubjectMask.method(“render”,function(){this.$el=e(“<div>”).addClass(“sideshow-subject-mask”),this.callSuper(“render”)}),O.SubjectMask.method(“update”,function(t,e,i){this.$el.css(“left”,t.x).css(“top”,t.y).css(“width”,e.width).css(“height”,e.height).css(“border-radius”,i.leftTop+“px ”i.rightTop
“px ”i.leftBottom
“px ”i.rightBottom
“px ”)}),O.CompositeMask=i.Class().extending(E).singleton,O.CompositeMask.method(“init”,function(){var t=this;.forEach(function(e){t.parts=O.CompositeMask.Part.build()}),[“leftTop”,“rightTop”,“leftBottom”,“rightBottom”].forEach(function(e){t.parts=O.CompositeMask.CornerPart.build()})}),O.CompositeMask.field(“parts”,{}),O.CompositeMask.method(“render”,function(){var t=this;for(var i in this.parts){var s=this.parts;s.render&&s.render()}this.$el=e(“.sideshow-mask-part, .sideshow-mask-corner-part”),O.SubjectMask.singleInstance.render(),.forEach(function(e){t.parts.$el.addClass(e)}),this.status=y.NOT_DISPLAYED}),O.CompositeMask.method(“scrollIfNecessary”,function(t,i){function s(t,i){e(“body,html”).animate({scrollTop:t},300,i)}if(!W.isSubjectVisible(t,i)){var n=B.singleInstance,o=i.height>p.height()-50?t.y:t.y-25;return o+=p.scrollTop(),s(o,function(){setTimeout(function(){P.singleInstance.positionate(),n.positionate(),n.fadeIn()},300)}),!0}return!1}),O.CompositeMask.method(“update”,function(t,e,i){O.SubjectMask.singleInstance.update(t,e,i);var s=t.x,n=t.y,o=e.width,r=e.height,a=i;this.parts.top.update({x:0,y:0},{width:p.width(),height:n}),this.parts.left.update({x:0,y:n},{width:s,height:r}),this.parts.right.update({x:s+o,y:n},{width:p.width()-(s+o),height:r}),this.parts.bottom.update({x:0,y:n+r},{width:p.width(),height:p.height()-(n+r)}),this.parts.leftTop.update({x:s,y:n},a.leftTop),this.parts.rightTop.update({x:s+o-a.rightTop,y:n},a.rightTop),this.parts.leftBottom.update({x:s,y:n+r-a.leftBottom},a.leftBottom),this.parts.rightBottom.update({x:s+o-a.rightBottom,y:n+r-a.rightBottom},a.rightBottom)}),O.CompositeMask.method(“pollForSubjectChanges”,function(){if(!k.lockMaskUpdate){if(w&&w.currentStep.subject){var t=e(w.currentStep.subject);W.obj!==t&&S.setSubject(t,!0)}W.hasChanged()&&(W.updateInfo(),this.update(W.position,W.dimension,W.borderRadius))}}),O.CompositeMask.method(“pollForScreenChanges”,function(){N.hasChanged()&&(N.updateInfo(),this.update(W.position,W.dimension,W.borderRadius))}),O.CompositeMask.Part=i.Class(function(t,e){this.position=t,this.dimension=e}).extending($);var A=O.CompositeMask.Part;A.field(“position”,{}),A.field(“dimension”,{}),A.method(“render”,function(){this.$el=e(“<div>”).addClass(“sideshow-mask-part”).addClass(“sideshow-hidden”).addClass(“sideshow-invisible”),this.callSuper(“render”)}),A.method(“update”,function(t,e){this.position=t,this.dimension=e,this.$el.css(“left”,t.x).css(“top”,t.y).css(“width”,e.width).css(“height”,e.height)}),O.CompositeMask.CornerPart=i.Class().extending($);var D=O.CompositeMask.CornerPart;D.field(“position”,{}),D.field(“dimension”,{}),D.field(“borderRadius”,0),D.SVGPathPointsTemplate=function(t){return“m 0,0 0,”t
“ C 0,”+.46*t+“ ”+.46*t+“,0 ”t
“,0”},D.buildSVG=function(t){function i(t){return document.createElementNS(“www.w3.org/2000/svg”,t)}var s=this.SVGPathPointsTemplate(t),n=e(i(“svg”)),o=e(i(“path”));return o.attr(“d”,s),n.append(o),n},D.prototype.render=function(){return this.$el=e(“<div>”).addClass(“sideshow-mask-corner-part”).addClass(“sideshow-hidden”).addClass(“sideshow-invisible”),this.$el.append(D.buildSVG(this.borderRadius)),g.append(this.$el),this.$el},D.prototype.update=function(t,i){this.$el.css(“left”,t.x).css(“top”,t.y).css(“width”,i).css(“height”,i),e(this.$el).find(“path”).attr(“d”,D.SVGPathPointsTemplate(i))};var V={};V.queue=[],V.lock=!1,V.enqueue=function(){var t,e=arguments,i=“”;if(“function”==typeof e?t=e:(i=arguments,t=arguments),!(this.getFunctionIndex(t)<0&&(“”===i||this.getFunctionIndex(i)<0)))throw new n(“301”,“The function is already in the polling queue.”);this.queue.push({name:i,fn:t,enabled:!0})},V.dequeue=function(){this.queue.splice(this.getFunctionIndex(arguments),1)},V.enable=function(){this.queue[this.getFunctionIndex(arguments)].enabled=!0},V.disable=function(){this.queue[this.getFunctionIndex(arguments)].enabled=!1},V.getFunctionIndex=function(){var t=arguments;if(“function”==typeof t)return this.queue.map(function(t){return t.fn}).indexOf(t);if(“string”==typeof t)return this.queue.map(function(t){return t.name}).indexOf(t);throw new n(“302”,“Invalid argument for getFunctionIndex method. Expected a string (the polling function name) or a function (the polling function itself).”)},V.start=function(){this.lock=!1,this.doPolling()},V.stop=function(){this.lock=!0},V.clear=function(){var t=this.lock;this.lock=!0,this.queue=[],this.lock=t},V.doPolling=function(){this.lock||setTimeout(function(){for(var t=0;t<V.queue.length;t++){var e=V.queue;e.enabled&&e.fn()}V.doPolling()},v)};var F={};if(F.render=function(t){function i(t,e){t.click(function(){F.hide(function(){e.prepareAndPlay()})})}var s=e(“<div>”).addClass(“sideshow-wizard-menu”);this.$el=s;var n=e(“<h1>”).addClass(“sideshow-wizard-menu-title”);if(s.append(n),t.length>0){for(var o=e(“<ul>”),r=0;r<t.length;r++){var a=t,d=e(“<li>”),l=e(“<h2>”).text(a.title),u=a.description;u.length>100&&(u=u.substr(0,100)+“…”);var c=e(“<span>”).addClass(“sideshow-wizard-menu-item-description”).text(u),f=e(“<span>”).addClass(“sideshow-wizard-menu-item-estimated-time”).text(a.estimatedTime);d.append(f,l,c),o.append(d),i(d,a)}s.append(o)}else e(“<div>”).addClass(“sideshow-no-wizards-available”).text(h(T.noAvailableWizards)).appendTo(s);g.append(s)},F.show=function(t,e){1==t.length&&S.config.autoSkipIntro?t.prepareAndPlay():(S.setEmptySubject(),O.CompositeMask.singleInstance.update(W.position,W.dimension,W.borderRadius),O.CompositeMask.singleInstance.fadeIn(),F.render(t),this.setTitle(e?e:h(T.availableWizards)))},F.hide=function(t){var e=this,i=e.$el;i&&i.addClass(“sideshow-menu-closed”),setTimeout(function(){i&&i.hide(),t&&t()},C)},F.setTitle=function(t){this.$el.find(“.sideshow-wizard-menu-title”).text(t)},S.init=function(){p=e(t),m=e(t.document),g=e(“body”,t.document),c(),V.start(),O.CompositeMask.singleInstance.init(),k.lockMaskUpdate=!0,O.CompositeMask.singleInstance.render()},S.heredoc=function(t){return t.toString().match(//([^]*)*/}$/)[1]},S.close=function(){w||F.hide(),P.singleInstance.fadeOut(),this.CloseButton.singleInstance.fadeOut(),z.fadeOut(),setTimeout(function(){(O.CompositeMask.singleInstance.status===y.VISIBLE||O.CompositeMask.singleInstance.status===y.FADING_IN)&&O.CompositeMask.singleInstance.fadeOut(),O.SubjectMask.singleInstance.fadeOut()},C),f(),V.clear(),S.ControlVariables.clear(),l(),w=null,k.running=!1},S.runWizard=function(t){r(“This method is deprecated and will be removed until the next major version of Sideshow.”);var e=I.filter(function(e){return e.name===t})[0];if(w=e,!e)throw new n(“205”,“There’s no wizard with name ”t
“.”);if(e.isEligible())e.play();else{if(!e.preparation)throw new n(“204”,“This wizard hasn’t preparation.”);e.preparation(function(){setTimeout(function(){e.play()},1e3)})}},S.gotoStep=function(){var t,e=arguments,i=w._storyline.steps;if(k.skippingStep=!0,“number”==typeof e){if(!(e<=i.length))throw new n(“401”,“There’s no step in the storyline with position ”e
“.”);t=i}else if(“string”==typeof e&&(t=i.filter(function(t){return t.name===e})[0],!t))throw new n(“401”,“There’s no step in the storyline with name ”e
“.”);setTimeout(function(){w.next(null,t)},100)},S.setEmptySubject=function(){k.lockMaskUpdate=!0,W.obj=null,W.updateInfo({dimension:{width:0,height:0},position:{x:0,y:0},borderRadius:{leftTop:0,rightTop:0,leftBottom:0,rightBottom:0}})},S.setSubject=function(t,i){if(t.constructor===String&&(t=e(t)),t instanceof e&&t.length>0){if(1!==t.length)throw new n(“101”,“A subject must have only one element. Multiple elements by step will be supported in future versions of Sideshow.”);W.obj=t,W.updateInfo(),k.lockMaskUpdate=!1}else{if(!i)throw new n(“100”,“Invalid subject.”);S.setEmptySubject()}},S.registerWizard=function(t){var e=M.build(t);return I.push(e),e},S.getElegibleWizards=function(t){for(var e=[],i=!1,s=0;s<I.length;s++){var n=I;n.isEligible()&&(n.isAlreadyWatched()||(i=!0),e.push(n))}return!t||i?e:[]},S.showWizardsList=function(){var t=arguments,e=arguments,i=“boolean”==typeof t?!1:t,s=t instanceof Array?t:this.getElegibleWizards(i);return F.show(s,e),s.length>0},S.showRelatedWizardsList=function(t){var e=t.relatedWizards;if(!e)return!1;var i=I.filter(function(t){return e.indexOf(t.name)>-1&&(t.isEligible()||t.preparation)});return 0==i.length?!1:(V.clear(),S.ControlVariables.clear(),S.showWizardsList(i,h(T.relatedWizards)),!0)},S.CloseButton=i.Class().extending(E).singleton,S.CloseButton.method(“render”,function(){this.$el=e(“<button>”).addClass(“sideshow-close-button”).text(h(T.close)),this.$el.click(function(){S.close()}),this.callSuper(“render”)}),S.start=function(t){if(t=t||{},!k.running){var e=“onlyNew”in t&&!!t.onlyNew,i=“listAll”in t&&!!t.listAll,s=t.wizardName;if(i)S.showWizardsList(I.filter(function(t){return t.isEligible()||t.preparation}));else if(s){var o=I.filter(function(t){return t.name===s})[0];if(!o)throw new n(“205”,“There’s no wizard with name ‘”s
“’.”);o.prepareAndPlay()}else S.showWizardsList(e);this.CloseButton.singleInstance.render(),this.CloseButton.singleInstance.fadeIn(),d(),k.running=!0,V.enqueue(“check_composite_mask_screen_changes”,function(){O.CompositeMask.singleInstance.pollForScreenChanges()})}},void 0!==t)throw new n(“1”,‘The global access point “Sideshow” is already being used.’);t=S})}(this,jQuery,Jazz,Markdown);