import{appendStyle}from"./append-style.js";import{focusChanged}from"./focus-changed.js";import{injectCoreStyles}from"./inject-core-styles.js";export function createShadowRootWithCoreStyles(e,t={delegatesFocus:void 0,cssFile:void 0,enableLegacyPatching:!1}){const{cssFile:o,delegatesFocus:s,enableLegacyPatching:a}=t,c=e.attachShadow({mode:"open",delegatesFocus:s});return injectCoreStyles(c),o&&appendStyle(c,o,{enableLegacyPatching:a}),c.addEventListener("focus",focusChanged,!0),c}