const a=(t=[])=>{if(t.length!==6)return!1;const e=t[5];if(e?.action!=="setTime"||Number(e?.time)!==2)return!1;let n=!1;const i=new Set(["A","B","C","D"]);for(let s=0;s<5;s+=1){const r=t[s];if(!r||r.action!=="setLED")return!1;if(r.type==="led"){if(r.material==="A"&&r.state===!0){if(n)return!1;n=!0;continue}return!1}if(r.type==="led_rgb_abcd"){if(!i.has(r.material)||r.state!==!0||r.color!=="random")return!1;i.delete(r.material);continue}return!1}return n&&i.size===0},f=t=>(Array.isArray(t)?t:[]).filter(e=>e&&typeof e=="object"&&e.action!=="switchOn"&&e.action!=="switchOff"),o={skipAnimationDelay:!0,customDelay:2e3,checkWinCondition:(t,e)=>{if(!Array.isArray(t))return!1;const n=t.some(i=>i?.action==="switchOff");return!!e&&n},allowDeferredWin:t=>{const e=f(t);if(e.length!==30)return!1;for(let n=0;n<5;n+=1){const i=n*6,s=e.slice(i,i+6);if(!a(s))return!1}return!0}};export{o as winConfig};
