(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[31],{930:function(t,s,e){"use strict";e.r(s),e.d(s,"AuWidgetHelp",function(){return l}),e.d(s,"widget",function(){return l});var a=e(0),n=e(160),i=e(2),p=e(14);let l=class extends n.a{async connectedCallback(){super.connectedCallback(),this.stepSubscription=this.observe(p.a.STEP_CHANGED).subscribe(t=>this._stepChangeCallback(t)),await this._getHelpButton()}async _stepChangeCallback(t){this.currentStep=t.data.step,this._handleParams()}updateParams(t){this._handleParams()}_handleParams(){if(this.params&&this.currentStep)if(this.params.steps){const t=this.params.steps[this.currentStep.index]||this.params.steps[this.currentStep.title];t?(this.helpButton.style.display="block",this._applyConfig(t)):this.helpButton.style.display="none"}else this.params.base&&(this.helpButton.style.display="block",this._applyConfig(this.params.base))}_applyConfig(t){const s=async()=>{switch(t.type){case"modal":await this.auWizard.showModal(t.content);break;case"page":this._openTab(t.content);break;default:console.warn(`Type ${t.type} is not supported.`)}};this.helpButton.onclick=(()=>s())}_openTab(t){window.open(t,"_blank")}async _getHelpButton(){this.helpButton=await this.publishData({selector:"paper-button#helpTopBtn"},p.a.GET_ELEMENT_FROM_AU_WIZARD)}disconnectedCallback(){super.disconnectedCallback(),this.stepSubscription.unsubscribe()}};l=Object(a.a)([Object(i.a)("au-widget-help")],l)}}]);