function p(){const i=document.querySelectorAll("[data-engine]"),r=document.querySelectorAll("[data-engine-pane]"),u=document.querySelectorAll("[data-guide]"),s=document.querySelector("[data-guide-title]"),g={twilio:"Twilio service","wa-api":"WhatsApp API","business-api":"Business API"};function o(t){i.forEach(e=>{const a=e.dataset.engine===t;a?e.dataset.active="true":delete e.dataset.active;const n=e.querySelector("span.w-2.h-2");n&&(n.classList.toggle("bg-wa-deep",a),n.classList.toggle("bg-paper-300",!a));const d=e.querySelector("div.flex.items-center.gap-2");if(d){const l=Array.from(i).indexOf(e)+1;d.lastChild.textContent=a?`option ${l} · active`:`option ${l}`}e.classList.toggle("border-wa-deep/40",a),e.classList.toggle("border-paper-200",!a)}),r.forEach(e=>e.hidden=e.dataset.enginePane!==t),u.forEach(e=>e.hidden=e.dataset.guide!==t),s&&(s.textContent=g[t]||"")}i.forEach(t=>t.addEventListener("click",()=>o(t.dataset.engine)));const c=document.querySelector('[data-engine][data-active="true"]');c&&o(c.dataset.engine)}export{p as default};
