/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import{r as e,c as n,g as t,j as o,F as a}from"./index-BM3Om9WE.js";import{h as r}from"./renderer-DpNDfhNy.js";const i=class{constructor(t){e(this,t),this.nanoStepActive=n(this,"nanoStepActive",7)}get host(){return t(this)}nanoDetails;gridWorking=!0;activeStep=0;handleActiveStepChange(e,n){this.steps[e]?.enabled?this.nanoStepActive.emit({index:e,step:this.steps[e]}).defaultPrevented&&(this.activeStep=n):this.activeStep=n}_steps=[];stepProxyHandler={set:(e,n,t)=>(e[n]=t,o(this.host),!0)};get steps(){return this._steps}set steps(e){this._steps=[],e.forEach((e=>{const n=new Proxy(e,this.stepProxyHandler);this._steps.push(n)}))}nanoStepActive;handleToggle(e){e.detail.index!==this.activeStep&&(this.activeStep=e.detail.index)}isDetailsGridWorking(e){const n=document.createElement("div");n.style.gridColumn="2",n.style.height="1px",n.style.width="1px",n.style.visibility="hidden",e.appendChild(n);const t=e.getBoundingClientRect().x,o=n.getBoundingClientRect().x;return e.removeChild(n),Math.abs(o-t)>1}componentDidLoad(){if(!this.nanoDetails)return;const e=this.nanoDetails.shadowRoot.querySelector("details");e&&(this.gridWorking=this.isDetailsGridWorking(e))}render(){return r("nano-accordion",{key:"1a977444388da596ff3fbf0559ac77a274efce11",alwaysOpen:!0,onNanoToggle:e=>this.handleToggle(e)},this.steps.map(((e,n)=>r("nano-details",{open:n===this.activeStep,disabled:!e.enabled,class:{step:!0,"step--active":n===this.activeStep,"step--complete":e.complete,"step--grid-working":this.gridWorking,"step--grid-not-working":!this.gridWorking,"step--disabled":!e.enabled},ref:e=>this.nanoDetails=e},r("span",{class:"step-icon",slot:"icon-start"},n+1),r("div",{class:"step-header",slot:"label"},r("span",{class:"step-title "+(e.complete?"complete":"")},e.title),e.complete&&r(a,null,r("span",null," - "),r("span",{class:"step-change"},"Change"))),r("span",{slot:"icon-end"}),r("div",{class:"step-content"},r("slot",{name:`step-${n}`}))))))}static get watchers(){return{activeStep:["handleActiveStepChange"]}}};i.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block}.nano-details{--padding:0;--btn-bg-color--hover:transparent;--btn-bg-color--active:transparent;border:none;margin-block-end:var(--nano-spacing-sm)}.nano-details::part(base){display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:var(--nano-spacing-sm) 1.625rem}.nano-details.step--grid-working::part(base)::before{content:"";display:block;grid-column:1;grid-row:2;inline-size:1rem;min-block-size:1rem;border-inline-end:2px solid var(--nano-color-neutral-300)}.nano-details.step--grid-working::part(base)::after{content:"";grid-column:1;grid-row:2;inline-size:0.4rem;block-size:0.4rem;place-self:end end;translate:-50% 0;inset-inline-start:calc(50% - 2.5px);position:relative;border-inline-end:2px solid var(--nano-color-neutral-300);border-block-end:2px solid var(--nano-color-neutral-300);rotate:45deg}.nano-details:last-of-type::part(base)::before{min-block-size:0}.nano-details:last-of-type::part(base)::after{display:none}.nano-details::part(header){grid-column:1/-1;grid-row:1;display:inline-flex;gap:var(--nano-spacing-sm)}.nano-details::part(body){grid-column:2;grid-row:2}.nano-details::part(content-wrapper){padding:1px}.nano-details.step--grid-not-working::part(header){padding-block-end:var(--nano-spacing-sm)}.nano-details.step--grid-not-working::part(body){padding:0 0 0 2.5625rem}.step .step-header{display:inline-flex;gap:var(--nano-spacing-sm);align-items:center}.step .step-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:2rem;block-size:2rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step.step--complete .step-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step[open] .step-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step .step-change{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);text-decoration:underline;color:var(--nano-color-primary-1200)}';export{i as nano_step_accordion}