import{r as s,h as t,g as e}from"./p-0d5a2e05.js";const i=class{constructor(t){s(this,t);this.currentStep=1;this.title="";this.description="";this.activeStep=0;this.nextStep=true;this.showStepName=true;this.showStepDescription=true;this.internalActiveStep=1;this.isActive=false;this.labelState="upcoming";this.labelStyle="circle";this.handleFocus=()=>{this.stepContentRef.classList.add("focus")};this.handleFocusOut=()=>{this.stepContentRef.classList.remove("focus")};this.handleEscape=s=>{if(s.key==="Escape"){this.handleFocusOut();const s=this.el.querySelector("input");if(s){s.blur()}}}}componentWillLoad(){this.updateState();window.addEventListener("keydown",this.handleEscape)}disconnectedCallback(){window.removeEventListener("keydown",this.handleEscape)}stepChangeHandler(s){this.internalActiveStep=s.detail;console.log("stepChangeHandler",s.detail);this.isActive=s.detail>this.currentStep;if(s.detail>this.currentStep){this.labelState="completed"}else if(s.detail<this.currentStep){this.labelState="upcoming"}else{this.labelState="current"}}updateState(){this.isActive=this.internalActiveStep>this.currentStep;if(this.internalActiveStep>this.currentStep){this.labelState="completed"}else if(this.internalActiveStep<this.currentStep){this.labelState="upcoming"}else{this.labelState="current"}}labelChildren(s){if(this.labelState==="completed"){return t("i",{class:"hgi-stroke hgi-tick-02",style:{fontSize:"16px"}})}return s.toString()}render(){return t("div",{key:"9793f6500ca598d097c815aa051f5ca81506dd89",class:"progress-indicator__step",onMouseDown:this.handleFocus,onMouseUp:this.handleFocusOut},t("div",{key:"a13bb8ae0b5c824b1a6f27dec55d538d083712d6",class:"progress-indicator__step-content dga-flex-column",ref:s=>this.stepContentRef=s},t("div",{key:"2f794b8ceb09295397688efedc6c70296c359ef5",class:"step-label","data-state":this.labelState},t("span",{key:"471dd863a8c18ee3264c9ee94dcddef1052273d6",class:`step-label--${this.labelStyle}`},this.labelStyle==="circle"&&this.labelChildren(this.currentStep))),t("div",{key:"30e1ec6029a08c9f31907511b71697a09a53db92",class:"step-text dga-flex-column"},this.showStepName&&t("span",{key:"cd581e2e70b58bdc89b1b65ccc4641834fc4f4d9",class:this.isActive?"text-md-medium":"text-md-regular"},this.title),this.showStepDescription&&t("p",{key:"652bd2b978f800a85929ae06497c9fe5d7f3814a",class:"text-sm-regular"},this.description))),this.nextStep&&t("span",{key:"7418e832f54b831057d2eb27a4df44353cec49bc",class:`progress-indicator__step-connector ${this.isActive?"progress-indicator__step-connector--active":""}`}))}get el(){return e(this)}};export{i as dga_progress_indicator_step};
//# sourceMappingURL=p-9101e080.entry.js.map