@aceshooting/lyra-ui 32.1.0 → 33.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/CHANGELOG.md +247 -1576
  2. package/README.md +15 -2
  3. package/custom-elements.slim.json +1 -0
  4. package/dist/accent-roles.css +1 -0
  5. package/dist/cli/migrate-wa.mjs +50 -48
  6. package/dist/cli/migration-contract.json.gz +0 -0
  7. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +1 -1
  8. package/dist/components/conversation/chat-composer/chat-composer.class.d.ts +10 -0
  9. package/dist/components/conversation/code-block/code-block-base.class.d.ts +3 -1
  10. package/dist/components/conversation/code-block/code-block-base.class.js +1 -1
  11. package/dist/components/conversation/code-block/code-block-core.class.d.ts +1 -1
  12. package/dist/components/conversation/code-block/code-block-core.class.js +1 -1
  13. package/dist/components/conversation/code-block/code-block.class.d.ts +3 -2
  14. package/dist/components/conversation/code-block/code-block.class.js +1 -1
  15. package/dist/components/conversation/code-block/code-grammar-registry.d.ts +35 -0
  16. package/dist/components/conversation/code-block/code-grammar-registry.js +1 -0
  17. package/dist/components/conversation/model-select/model-select.class.d.ts +8 -7
  18. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.d.ts +1 -1
  19. package/dist/components/conversation/usage-badge/usage-badge.class.d.ts +1 -1
  20. package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +8 -7
  21. package/dist/components/data/table/table-support.d.ts +2 -3
  22. package/dist/components/data/table/table.class.d.ts +2 -1
  23. package/dist/components/data/timeline/timeline.class.d.ts +17 -6
  24. package/dist/components/data/timeline/timeline.class.js +2 -2
  25. package/dist/components/data/timeline/timeline.styles.js +1 -1
  26. package/dist/components/forms/catalog-picker-base.d.ts +14 -1
  27. package/dist/components/forms/checkbox/checkbox.class.js +1 -1
  28. package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +4 -5
  29. package/dist/components/forms/checkbox-group/checkbox-group.styles.js +1 -1
  30. package/dist/components/forms/code-editor/code-editor.class.d.ts +14 -5
  31. package/dist/components/forms/code-editor/code-editor.styles.js +1 -1
  32. package/dist/components/forms/color-picker/color-picker.class.d.ts +18 -7
  33. package/dist/components/forms/color-picker/color-picker.styles.js +1 -1
  34. package/dist/components/forms/combobox/combobox-option-html.js +1 -0
  35. package/dist/components/forms/combobox/combobox.class.d.ts +30 -9
  36. package/dist/components/forms/combobox/combobox.class.js +110 -21
  37. package/dist/components/forms/combobox/combobox.styles.js +1 -1
  38. package/dist/components/forms/country-picker/country-picker.class.d.ts +4 -5
  39. package/dist/components/forms/currency-picker/currency-picker.class.d.ts +4 -5
  40. package/dist/components/forms/date-picker/date-input.class.d.ts +14 -5
  41. package/dist/components/forms/date-picker/date-input.class.js +1 -1
  42. package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +10 -0
  43. package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
  44. package/dist/components/forms/icon-button/icon-button.class.d.ts +2 -1
  45. package/dist/components/forms/input/input-shared.d.ts +14 -5
  46. package/dist/components/forms/input/time-input.class.d.ts +15 -6
  47. package/dist/components/forms/input/time-input.styles.js +1 -1
  48. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +8 -7
  49. package/dist/components/forms/otp-input/otp-input.class.d.ts +4 -5
  50. package/dist/components/forms/otp-input/otp-input.styles.js +1 -1
  51. package/dist/components/forms/phone-input/phone-input.class.d.ts +14 -5
  52. package/dist/components/forms/phone-input/phone-input.styles.js +1 -1
  53. package/dist/components/forms/radio/radio-group.class.d.ts +4 -5
  54. package/dist/components/forms/radio/radio-group.styles.js +1 -1
  55. package/dist/components/forms/radio/radio.class.js +2 -2
  56. package/dist/components/forms/select/select.class.d.ts +5 -6
  57. package/dist/components/forms/signature-pad/signature-pad.class.d.ts +4 -5
  58. package/dist/components/forms/signature-pad/signature-pad.styles.js +1 -1
  59. package/dist/components/forms/slider/slider.class.d.ts +6 -5
  60. package/dist/components/forms/slider/slider.styles.js +1 -1
  61. package/dist/components/forms/textarea/textarea.class.d.ts +14 -5
  62. package/dist/components/forms/time-zone-picker/time-zone-picker.class.d.ts +4 -5
  63. package/dist/components/forms/token-input/token-input.class.d.ts +10 -10
  64. package/dist/components/forms/token-input/token-input.class.js +1 -1
  65. package/dist/components/forms/token-input/token-input.styles.js +1 -1
  66. package/dist/components/forms/unit-picker/unit-picker.class.d.ts +4 -5
  67. package/dist/components/layout/command-palette/command-palette.class.d.ts +1 -1
  68. package/dist/components/layout/menu/menu.class.d.ts +1 -1
  69. package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.d.ts +1 -1
  70. package/dist/components/layout/segmented/segmented.class.d.ts +2 -2
  71. package/dist/components/layout/stepper/step.class.d.ts +14 -1
  72. package/dist/components/layout/stepper/step.class.js +2 -2
  73. package/dist/components/lr-map-anchor.d.ts +1 -1
  74. package/dist/components/media/file-input/file-input.class.d.ts +2 -1
  75. package/dist/components/media/file-input/file-input.class.js +1 -1
  76. package/dist/components/media/file-input/file-input.styles.js +1 -1
  77. package/dist/components/media/lightbox/lightbox-item.class.d.ts +10 -0
  78. package/dist/components/media/lightbox/lightbox-item.class.js +1 -1
  79. package/dist/components/media/lightbox/lightbox-source.js +1 -1
  80. package/dist/components/media/lightbox/lightbox-types.d.ts +4 -1
  81. package/dist/components/media/lightbox/lightbox.class.d.ts +42 -19
  82. package/dist/components/media/lightbox/lightbox.class.js +4 -3
  83. package/dist/components/media/lightbox/lightbox.styles.js +1 -1
  84. package/dist/components/media/map/map-anchor-avoid.js +1 -1
  85. package/dist/components/media/map/map-anchor-options.d.ts +9 -0
  86. package/dist/components/media/map/map.class.d.ts +19 -5
  87. package/dist/components/media/map/map.class.js +3 -3
  88. package/dist/components/overlays/context-menu/context-menu.class.d.ts +1 -1
  89. package/dist/components/overlays/dialog/dialog.class.d.ts +19 -3
  90. package/dist/components/overlays/dialog/dialog.class.js +1 -1
  91. package/dist/components/overlays/dialog/dialog.styles.js +1 -1
  92. package/dist/components/overlays/drawer/drawer.class.d.ts +8 -2
  93. package/dist/components/overlays/drawer/drawer.class.js +1 -1
  94. package/dist/components/overlays/overlay/dropdown.class.d.ts +1 -1
  95. package/dist/components/overlays/overlay/overlay.styles.js +1 -1
  96. package/dist/components/overlays/overlay/popover.class.d.ts +1 -1
  97. package/dist/components/overlays/overlay/popover.class.js +1 -1
  98. package/dist/components/overlays/overlay/tooltip.class.d.ts +5 -0
  99. package/dist/components/overlays/overlay/tooltip.class.js +2 -2
  100. package/dist/components/overlays/toast/toast-item.class.d.ts +2 -2
  101. package/dist/components/overlays/toast/toast-item.styles.js +1 -1
  102. package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +1 -1
  103. package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +1 -1
  104. package/dist/components/utility/copy-button/copy-button.class.d.ts +2 -1
  105. package/dist/components/utility/copy-button/copy-button.class.js +1 -1
  106. package/dist/components/utility/export-button/export-button.class.d.ts +1 -1
  107. package/dist/components/utility/icon/icon-library-bootstrap.d.ts +50 -0
  108. package/dist/components/utility/icon/icon-library-bootstrap.js +1 -0
  109. package/dist/components/utility/icon/icon-library-font-awesome.d.ts +68 -0
  110. package/dist/components/utility/icon/icon-library-font-awesome.js +1 -0
  111. package/dist/components/utility/known-date/known-date.class.d.ts +10 -0
  112. package/dist/components/utility/mention-popover/mention-popover.class.d.ts +1 -1
  113. package/dist/components/utility/number-ticker/number-ticker.class.d.ts +10 -2
  114. package/dist/components/utility/number-ticker/number-ticker.class.js +1 -1
  115. package/dist/components/utility/tour/tour.class.d.ts +1 -1
  116. package/dist/framework-types.d.ts +1 -1
  117. package/dist/internal/accessibility-visibility.js +1 -1
  118. package/dist/internal/autoloader-manifest.js +1 -1
  119. package/dist/internal/declarative-overlay-action.js +1 -0
  120. package/dist/internal/default-strings/forms.generated.js +1 -1
  121. package/dist/internal/document-token-css.generated.js +10 -0
  122. package/dist/internal/document-tokens.generated.js +2 -11
  123. package/dist/internal/document-tokens.js +2 -2
  124. package/dist/internal/dom-guards.js +1 -1
  125. package/dist/internal/external-label-association.js +1 -0
  126. package/dist/internal/focus-navigation.js +1 -1
  127. package/dist/internal/form-control/chrome.styles.js +1 -1
  128. package/dist/internal/form-control-labels.js +1 -1
  129. package/dist/internal/localization-runtime.js +1 -1
  130. package/dist/internal/localization-types.d.ts +1 -1
  131. package/dist/internal/localization.js +1 -1
  132. package/dist/internal/lyra-element.d.ts +12 -3
  133. package/dist/internal/lyra-element.js +2 -2
  134. package/dist/internal/package-metadata.js +1 -1
  135. package/dist/internal/theme-observation.js +1 -1
  136. package/dist/lyra.d.ts +1 -1
  137. package/dist/lyra.js +1 -1
  138. package/dist/ssr.d.ts +1 -1
  139. package/dist/styles/tokens-root.css +1 -1
  140. package/dist/styles/utilities.css +1 -1
  141. package/dist/theme-core.css +1 -1
  142. package/dist/theme.css +1 -1
  143. package/llms/components/lr-button.md +4 -0
  144. package/llms/components/lr-card.md +2 -0
  145. package/llms/components/lr-checkbox-group.md +2 -2
  146. package/llms/components/lr-citation-badge.md +1 -1
  147. package/llms/components/lr-code-block-core.md +3 -1
  148. package/llms/components/lr-code-block.md +14 -0
  149. package/llms/components/lr-code-editor.md +2 -2
  150. package/llms/components/lr-color-picker.md +4 -4
  151. package/llms/components/lr-combobox.md +21 -5
  152. package/llms/components/lr-context-menu.md +1 -1
  153. package/llms/components/lr-copy-button.md +4 -3
  154. package/llms/components/lr-country-picker.md +2 -2
  155. package/llms/components/lr-currency-picker.md +2 -2
  156. package/llms/components/lr-date-input.md +1 -1
  157. package/llms/components/lr-date-picker.md +1 -1
  158. package/llms/components/lr-dialog.md +30 -2
  159. package/llms/components/lr-drawer.md +7 -1
  160. package/llms/components/lr-entity-chip.md +1 -1
  161. package/llms/components/lr-export-button.md +1 -1
  162. package/llms/components/lr-file-input.md +1 -1
  163. package/llms/components/lr-icon.md +96 -0
  164. package/llms/components/lr-input.md +2 -2
  165. package/llms/components/lr-lightbox.md +43 -17
  166. package/llms/components/lr-locale-picker.md +2 -2
  167. package/llms/components/lr-map.md +16 -1
  168. package/llms/components/lr-mention-popover.md +1 -1
  169. package/llms/components/lr-menu.md +1 -1
  170. package/llms/components/lr-model-select.md +4 -4
  171. package/llms/components/lr-native-time-input.md +2 -2
  172. package/llms/components/lr-number-input.md +2 -2
  173. package/llms/components/lr-number-ticker.md +7 -2
  174. package/llms/components/lr-otp-input.md +2 -2
  175. package/llms/components/lr-phone-input.md +2 -2
  176. package/llms/components/lr-popover.md +1 -1
  177. package/llms/components/lr-radio-group.md +2 -2
  178. package/llms/components/lr-segmented.md +1 -1
  179. package/llms/components/lr-select.md +3 -3
  180. package/llms/components/lr-selection-toolbar.md +1 -1
  181. package/llms/components/lr-signature-pad.md +2 -2
  182. package/llms/components/lr-slider.md +1 -1
  183. package/llms/components/lr-step.md +7 -1
  184. package/llms/components/lr-textarea.md +2 -2
  185. package/llms/components/lr-time-input.md +3 -3
  186. package/llms/components/lr-time-zone-picker.md +2 -2
  187. package/llms/components/lr-timeline.md +12 -5
  188. package/llms/components/lr-toast.md +1 -1
  189. package/llms/components/lr-token-input.md +10 -9
  190. package/llms/components/lr-tool-call-chip.md +1 -1
  191. package/llms/components/lr-tooltip.md +5 -0
  192. package/llms/components/lr-unit-picker.md +2 -2
  193. package/llms/components/lr-usage-badge.md +1 -1
  194. package/llms/components/lr-voice-picker.md +4 -3
  195. package/llms/index.md +128 -128
  196. package/llms/migration.md +87 -8
  197. package/llms/peers.md +2 -2
  198. package/llms/shared/events-and-types.md +1 -1
  199. package/llms/shared/forms-and-accessibility.md +4 -1
  200. package/llms/shared/frameworks-and-ssr.md +47 -1
  201. package/llms/shared/imports-and-registration.md +8 -1
  202. package/llms/shared/localization-and-rtl.md +5 -0
  203. package/llms/shared/native-styles-and-utilities.md +85 -8
  204. package/llms/shared/styles-and-tokens.md +58 -4
  205. package/llms/shared/testing-and-utilities.md +9 -0
  206. package/llms/shared.md +217 -16
  207. package/locales.json +1 -1
  208. package/package.json +15 -6
  209. package/registrations.json +1 -1
  210. package/skills/compose-lyra-interfaces/SKILL.md +1 -1
  211. package/skills/lyra-ui/SKILL.md +1 -1
  212. package/skills/lyra-ui/commands/migrate.md +1 -1
@@ -1,57 +1,56 @@
1
1
  #!/usr/bin/env node
2
- var Ho=Object.defineProperty;var c=(e,t)=>Ho(e,"name",{value:t,configurable:!0});var _e=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Jo=(e,t)=>{for(var n in t)Ho(e,n,{get:t[n],enumerable:!0})};function Xe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ke(e,t){return Object.keys(e).filter(n=>!t.includes(n))}function dt(e,t){return e<t?-1:e>t?1:0}function Ze(e){let t=xl.exec(String(e??""));return t?t.slice(1,4).map(Number):null}function mt(e,t){let n=Ze(e),s=Ze(t);if(!n||!s)return null;for(let r=0;r<3;r+=1)if(n[r]!==s[r])return n[r]-s[r];return 0}function cr(e){return Ze(e)?.[0]??null}function Nl(){return{schemaVersion:1,profiles:ir.map(e=>({...e,...Object.fromEntries(us.filter(t=>!["detailFields","globals"].includes(t)).map(t=>[t,[]]))}))}}function na(){return{schemaVersion:1,profiles:Nl().profiles.map(e=>({...e,exposure:Object.fromEntries(cn.map(t=>[t,{}]))}))}}function We(e,t,n){return t==="globals"?`${e}: global ${n?.kind} ${n?.from}`:t==="moduleReviews"?`${e}: module review ${n?.kind} ${n?.module??""} ${n?.name}`:t==="renames"?`${e}: rename ${n?.tag} ${n?.kind} ${n?.from}`:t==="defaults"?`${e}: default ${n?.tag} ${n?.attribute}`:t==="retiredEvents"?`${e}: retired event ${n?.tag} ${n?.event}`:t==="detailChanges"?`${e}: detail change ${n?.tag} ${n?.event}`:t==="detailFields"?`${e}: detail field ${n?.tag} ${n?.event} ${n?.detailType}.${n?.field}`:t==="propertyChanges"?`${e}: property change ${n?.tag} ${n?.property}`:t==="slotContent"?`${e}: slot content ${n?.tag} ${JSON.stringify(n?.slot??null)}`:`${e}: review ${n?.tag} ${n?.kind} ${JSON.stringify(n?.name??null)}`}function Cl(e,t){return e==="moduleReviews"?on(t):e==="globals"?[t.kind,t.from,t.tag??""].join("\0"):e==="renames"?[t.tag,t.kind,t.from].join("\0"):e==="defaults"?[t.tag,t.attribute].join("\0"):e==="detailChanges"||e==="retiredEvents"?[t.tag,t.event].join("\0"):e==="detailFields"?[t.tag,t.event,t.module,t.detailType,t.field].join("\0"):e==="propertyChanges"?[t.tag,t.property].join("\0"):e==="slotContent"?[t.tag,t.slot].join("\0"):[t.tag,t.kind,t.name].join("\0")}function Ue(e,t,n,s,r){return typeof r!="string"||!ea[n]?.test(r)?(e.push(`${t}: ${s} must be a valid ${n} name, got ${JSON.stringify(r)}`),!1):!0}function Ct(e,t,n,s){s&&n.since!==an&&!Ze(n.since)&&e.push(`${t}: since must be a version or ${JSON.stringify(an)}`)}function sa(e,t,n){Object.hasOwn(n,"removedIn")&&(!Ze(n.removedIn)||mt(n.removedIn,n.removalNotBefore)<0)&&e.push(`${t}: removedIn must be a version at or after removalNotBefore`)}function _l(e,t,n,s){let r=Ke(n,["kind","module","name",...s?["replacement","since","removalNotBefore","removedIn"]:[]]);if(r.length&&e.push(`${t}: unknown key(s) ${r.join(", ")}`),Sl.includes(n.kind)||e.push(`${t}: unsupported module review kind ${n.kind}`),n.kind==="entry-point"||n.kind==="stylesheet")Object.hasOwn(n,"module")&&e.push(`${t}: path reviews use name, not module`),typeof n.name!="string"||!Zo.test(n.name)||n.name.includes("..")?e.push(`${t}: name must be a package subpath`):n.name.endsWith(".css")!==(n.kind==="stylesheet")&&e.push(`${t}: stylesheet reviews must name CSS; entry-point reviews must name JavaScript`);else{n.module!=="."&&(typeof n.module!="string"||!Zo.test(n.module)||!n.module.endsWith(".js")||n.module.includes(".."))&&e.push(`${t}: module must be a JavaScript package subpath`);let i=n.kind==="window-event"?ea.event:n.kind==="root-attribute"?/^data-lr-[a-z0-9-]+$/:Kt;(typeof n.name!="string"||!i.test(n.name))&&e.push(`${t}: invalid module review name`)}s&&((typeof n.replacement!="string"||!n.replacement.trim())&&e.push(`${t}: replacement text missing`),Ze(n.removalNotBefore)||e.push(`${t}: removalNotBefore must be a version`),sa(e,t,n)),Ct(e,t,n,s)}function Il(e,t,n){let s=Ke(n,["kind","from","to","module","prefix","except","tag","summary","since"]);if(s.length&&e.push(`${t}: unknown key(s) ${s.join(", ")}`),!Xo.includes(n.kind)){e.push(`${t}: kind must be one of ${Xo.join(", ")}`);return}(typeof n.summary!="string"||!n.summary.trim())&&e.push(`${t}: summary text missing`),Ze(n.since)||e.push(`${t}: since must be a version`);let r=n.kind==="locale-key";if(n.kind==="module"){let o=c(i=>typeof i=="string"&&Al.test(i)&&!i.includes(".."),"valid");if(o(n.from)||e.push(`${t}: from must be an @aceshooting package specifier`),o(n.to)||e.push(`${t}: to must be an @aceshooting package specifier`),o(n.from)&&n.from===n.to&&e.push(`${t}: from and to must differ`),Object.hasOwn(n,"module")&&e.push(`${t}: module entries do not take a module`),Object.hasOwn(n,"prefix")&&n.prefix!==!0&&e.push(`${t}: prefix may only be true`),n.prefix===!0&&!(n.from?.endsWith("/")&&n.to?.endsWith("/"))&&e.push(`${t}: a prefix entry's from and to must end with a slash`),Object.hasOwn(n,"except")){let i=n.except;n.prefix!==!0||!Array.isArray(i)||!i.length||!i.every(a=>typeof a=="string"&&a.startsWith(n.from)&&a.endsWith("/"))?e.push(`${t}: except needs prefix and a list of slash-terminated prefixes below from`):JSON.stringify(i)!==JSON.stringify([...i].sort(dt))&&e.push(`${t}: except must be sorted`)}return}if(n.kind==="css-property"||n.kind==="part"){(typeof n.to!="string"||!n.to.trim())&&e.push(`${t}: to must name the replacement`),(Object.hasOwn(n,"module")||Object.hasOwn(n,"except"))&&e.push(`${t}: ${n.kind} entries take no module or except`),n.kind==="part"?((typeof n.tag!="string"||!xn.test(n.tag))&&e.push(`${t}: tag must be an lr-* element name`),Object.hasOwn(n,"prefix")&&e.push(`${t}: prefix applies to custom properties only`),Ue(e,t,"part","from",n.from)):(Object.hasOwn(n,"tag")&&e.push(`${t}: custom properties are not tag-owned`),Ue(e,t,"css-property","from",n.from),Object.hasOwn(n,"prefix")&&(n.prefix!==!0||!n.from.endsWith("-"))&&e.push(`${t}: a prefix needs prefix: true and a name ending in a hyphen`));return}for(let o of r?["prefix","except"]:["prefix","except","tag"])Object.hasOwn(n,o)&&e.push(`${t}: ${o} applies to module, part and custom property entries only`);r&&Object.hasOwn(n,"tag")&&(typeof n.tag!="string"||!xn.test(n.tag))&&e.push(`${t}: tag must be an lr-* element name`),(typeof n.from!="string"||!Kt.test(n.from))&&e.push(`${t}: from must be an identifier`),!(r&&!Object.hasOwn(n,"to"))&&(typeof n.to!="string"||!Kt.test(n.to))&&e.push(`${t}: to must be an identifier`),n.from===n.to&&e.push(`${t}: from and to must differ`),n.kind==="export"&&n.module!=="."&&!(typeof n.module=="string"&&Tl.test(n.module))&&e.push(`${t}: an export entry needs module "." (the package root) or a ./components/<family> barrel`),r&&Object.hasOwn(n,"module")&&e.push(`${t}: locale keys do not take a module`)}function Ml(e,t,n){if(!Array.isArray(n)){e.push(`${t}: rules must be an array`);return}for(let s of n)Rl.includes(s)||e.push(`${t}: unknown rule ${JSON.stringify(s)}`);JSON.stringify(n)!==JSON.stringify([...new Set(n)].sort(dt))&&e.push(`${t}: rules must be sorted and unique`)}function jl(e,t,n,s){let r=["tag","kind","from","to","polarity",...s?["since","reflects"]:[]],o=Ke(n,r);if(o.length&&e.push(`${t}: unknown key(s) ${o.join(", ")}`),!Go.includes(n.kind)){e.push(`${t}: kind must be one of ${Go.join(", ")}`);return}let i=Ue(e,t,n.kind,"from",n.from),a=Ue(e,t,n.kind,"to",n.to);i&&a&&n.from===n.to&&e.push(`${t}: from and to must differ`),n.kind==="slot"&&(n.from===""||n.to==="")&&e.push(`${t}: the default slot can be reviewed but not renamed`),Object.hasOwn(n,"polarity")&&(n.polarity!=="inverted"&&e.push(`${t}: polarity may only be "inverted"`),n.kind!=="attribute"&&n.kind!=="property"&&e.push(`${t}: only attribute and property renames can invert polarity`)),Ct(e,t,n,s),s&&Object.hasOwn(n,"reflects")!==(n.kind==="attribute")&&e.push(`${t}: reflects is recorded for attribute renames only`),s&&n.kind==="attribute"&&typeof n.reflects!="boolean"&&e.push(`${t}: reflects must be a boolean`)}function Pl(e,t,n,s){let r=Ke(n,["tag","attribute","value",...s?["since"]:[]]);r.length&&e.push(`${t}: unknown key(s) ${r.join(", ")}`),Ue(e,t,"attribute","attribute",n.attribute),Object.hasOwn(n,"value")?typeof n.value!="string"&&n.value!==!0&&!(typeof n.value=="number"&&Number.isFinite(n.value))&&e.push(`${t}: value must be a string, a finite number, or true (presence)`):e.push(`${t}: needs a value`),Ct(e,t,n,s)}function ps(e,t,n){(typeof n!="string"||n.trim().length<16||/\n/.test(n))&&e.push(`${t}: summary must be a single-line description of the change`)}function zl(e,t,n,s){let r=Ke(n,["tag","event","summary",...s?["since"]:[]]);r.length&&e.push(`${t}: unknown key(s) ${r.join(", ")}`),Ue(e,t,"event","event",n.event),ps(e,t,n.summary),Ct(e,t,n,s)}function Dl(e,t,n,s){let o=Ke(n,["tag","event","module","detailType","field","relation","replacement","role","notice","removalNotBefore","observedIn","removedIn"]);if(o.length&&e.push(`${t}: unknown key(s) ${o.join(", ")}`),Ue(e,t,"event","event",n.event),(typeof n.module!="string"||!/^(?:layout|conversation)\/[a-z0-9-]+\/[a-z0-9-]+(?:\.class|-shared)\.ts$/u.test(n.module))&&e.push(`${t}: module must be a canonical layout or conversation detail source path`),(typeof n.detailType!="string"||!Kt.test(n.detailType))&&e.push(`${t}: detailType must be an exported type name`),(typeof n.field!="string"||!Kt.test(n.field))&&e.push(`${t}: field must be a property name`),["equal","inverse"].includes(n.relation)||e.push(`${t}: relation must be equal or inverse`),n.replacement!=="expanded"&&e.push(`${t}: replacement must be expanded`),(!["request","settled"].includes(n.role)||typeof n.event!="string"||n.role==="request"!==n.event.endsWith("-request"))&&e.push(`${t}: role must match whether the event is a request event`),(typeof n.notice!="string"||!/^\/\*\*[\s\S]*@deprecated\b[\s\S]*\*\/$/u.test(n.notice))&&e.push(`${t}: notice must preserve the exact deprecation JSDoc`),n.removalNotBefore!=="23.0.0"&&e.push(`${t}: removalNotBefore must preserve the declared 23.0.0 floor`),n.observedIn!=="22.0.0"&&e.push(`${t}: observedIn must name the earliest verified packed observation, 22.0.0`),s&&typeof n.observedIn=="string"&&!Ze(n.observedIn)&&e.push(`${t}: observedIn must be a semantic version`),n.removedIn!==void 0&&n.removedIn!=="24.0.0"&&e.push(`${t}: removedIn requires the separately authorized actual 24.0.0 retirement`),n.removedIn!==void 0){let i=Ze(n.removedIn),a=Ze(n.removalNotBefore),l=Ze(n.observedIn);(!i||!a||!l||i[0]<a[0]+1||i[0]<l[0]+2)&&e.push(`${t}: removedIn must clear the declared floor and a full intervening published major`)}}function Ll(e,t,n,s){let r=Ke(n,["tag","event","replacement","summary","direct",...s?["since"]:[]]);r.length&&e.push(`${t}: unknown key(s) ${r.join(", ")}`),Object.hasOwn(n,"direct")&&n.direct!==!0&&e.push(`${t}: direct must be true when present`),Ue(e,t,"event","event",n.event),Ue(e,t,"event","replacement",n.replacement),n.event===n.replacement&&e.push(`${t}: replacement must differ from the retired event`),ps(e,t,n.summary),Ct(e,t,n,s)}function Fl(e,t,n,s){let r=Ke(n,["tag","property","former","summary",...s?["since"]:[]]);r.length&&e.push(`${t}: unknown key(s) ${r.join(", ")}`),Ue(e,t,"property","property",n.property),Object.hasOwn(n,"former")&&Ue(e,t,"property","former",n.former)&&n.former===n.property&&e.push(`${t}: former must differ from property`),ps(e,t,n.summary),Ct(e,t,n,s)}function Bl(e,t,n,s){let r=Ke(n,["tag","slot","report","allow","summary",...s?["since"]:[]]);r.length&&e.push(`${t}: unknown key(s) ${r.join(", ")}`),Ue(e,t,"slot","slot",n.slot);let o=["report","allow"].filter(i=>Object.hasOwn(n,i));if(o.length!==1)e.push(`${t}: needs exactly one of report (elements to report) or allow (the only elements kept)`);else{let i=n[o[0]];(!Array.isArray(i)||!i.length||!i.every(a=>typeof a=="string"&&El.test(a))||JSON.stringify(i)!==JSON.stringify([...new Set(i)].sort(dt)))&&e.push(`${t}: ${o[0]} must be a sorted, unique list of lowercase element names`)}ps(e,t,n.summary),Ct(e,t,n,s)}function Vl(e,t,n,s){let o=Ke(n,s?["tag","kind","name","replacement","removalNotBefore","since","removedIn"]:["tag","kind","name"]);if(o.length&&e.push(`${t}: unknown key(s) ${o.join(", ")}`),!Yo.includes(n.kind)){e.push(`${t}: kind must be one of ${Yo.join(", ")}`);return}Ue(e,t,n.kind,"name",n.name)&&n.kind==="component"&&n.name!==n.tag&&e.push(`${t}: a component review must name its own tag`),s&&((typeof n.replacement!="string"||!n.replacement)&&e.push(`${t}: replacement text missing`),cr(n.removalNotBefore)===null&&e.push(`${t}: removalNotBefore must be a version`),sa(e,t,n)),Ct(e,t,n,s)}function ra(e){let t=new Map(cn.map(s=>[s,new Map])),n=c((s,r,o)=>{if(!t.has(s))return;let i=t.get(s).get(r)??new Set;o&&i.add(o),t.get(s).set(r,i)},"need");for(let s of e.renames??[])n(s.kind,s.from,s.tag),n(s.kind,s.to,s.tag);for(let s of e.reviews??[])n(s.kind,s.name,s.tag);for(let s of e.detailChanges??[])n("event",s.event,s.tag);for(let s of e.retiredEvents??[])n("event",s.event,null),n("event",s.replacement,s.tag);for(let s of e.propertyChanges??[])n("property",s.property,s.tag);return t}function ql(e,t){let n=t.origin;if(!Xe(t.exposure)){e.push(`${n}: exposure must be an object`);return}let s=Ke(t.exposure,cn);s.length&&e.push(`${n}: exposure has unknown kind(s) ${s.join(", ")}`);let r=ra(t);for(let o of cn){let i=t.exposure[o];if(!Xe(i)){e.push(`${n}: exposure.${o} must be an object`);continue}for(let[a,l]of Object.entries(i))r.get(o).has(a)||e.push(`${n}: exposure.${o} records unreferenced name ${a}`),(!Array.isArray(l)||!l.every(u=>typeof u=="string"&&xn.test(u))||JSON.stringify(l)!==JSON.stringify([...new Set(l)].sort(dt)))&&e.push(`${n}: exposure.${o}.${a} must be a sorted, unique tag list`);for(let[a,l]of r.get(o)){if(!Object.hasOwn(i,a)){e.push(`${n}: exposure.${o}.${a} is missing`);continue}let u=new Set(i[a]??[]);for(let m of l)u.has(m)||e.push(`${n}: exposure.${o}.${a} must include ${m}`)}}}function Sn(e,{projected:t=!1,historicalReleaseMajor:n=null}={}){let s=[];if(!Xe(e))return["rename ledger must be an object"];let o=Ke(e,t?["schemaVersion","profiles"]:["$comment","schemaVersion","profiles"]);if(o.length&&s.push(`rename ledger has unknown key(s) ${o.join(", ")}`),e.schemaVersion!==1&&s.push("rename ledger schemaVersion must be 1"),!Array.isArray(e.profiles))return[...s,"rename ledger profiles must be an array"];let i=e.profiles.map(u=>u?.origin),a=!Number.isInteger(n)||n<22?0:n<26?2:n<27?3:n<32?4:0,l=a&&JSON.stringify(i)===JSON.stringify(Wt.slice(0,a))?Wt.slice(0,a):Wt;JSON.stringify(i)!==JSON.stringify(l)&&s.push(`rename ledger profiles must be exactly ${l.join(", ")} in that order`);for(let u of e.profiles){if(!Xe(u)){s.push("rename ledger profiles must be objects");continue}let m=String(u.origin),h=Ke(u,t?Ol:ta);h.length&&s.push(`${m}: unknown key(s) ${h.join(", ")}`);let g=ir.find(w=>w.origin===u.origin);if(g)for(let w of["fromMajor","toMajor","aliasRemovalMajor"])u[w]!==g[w]&&s.push(`${m}: ${w} must be ${g[w]}`);for(let w of us){if(kl.includes(w)&&u[w]===void 0)continue;if(!Array.isArray(u[w])){s.push(`${m}: ${w} must be an array`);continue}let f=new Set,E=[];for(let p of u[w]){let A=We(m,w,p);if(!Xe(p)){s.push(`${m}: ${w} entries must be objects`);continue}w!=="moduleReviews"&&w!=="globals"&&(typeof p.tag!="string"||!xn.test(p.tag))&&s.push(`${A}: tag must be an lr-* element name`),w==="globals"?Il(s,A,p):w==="moduleReviews"?(_l(s,A,p,t),t&&cr(p.removalNotBefore)!==u.aliasRemovalMajor&&s.push(`${A}: removalNotBefore must match the profile's aliasRemovalMajor`)):w==="renames"?jl(s,A,p,t):w==="defaults"?Pl(s,A,p,t):w==="detailChanges"?zl(s,A,p,t):w==="detailFields"?Dl(s,A,p,t):w==="retiredEvents"?(Ll(s,A,p,t),t&&p.since!==`${u.toMajor}.0.0`&&s.push(`${A}: since must match the target major release`)):w==="propertyChanges"?Fl(s,A,p,t):w==="slotContent"?Bl(s,A,p,t):Vl(s,A,p,t);let k=Cl(w,p);f.has(k)&&s.push(`${A}: duplicate entry`),f.add(k),E.push(k)}JSON.stringify(E)!==JSON.stringify([...E].sort(dt))&&s.push(`${m}: ${w} must be sorted by ${w==="moduleReviews"?"kind, module and name":w==="globals"?"kind and name":"tag and name"}`)}if(u.rules!==void 0&&Ml(s,m,u.rules),!Array.isArray(u.renames)||!Array.isArray(u.reviews))continue;let y=new Map;for(let w of u.renames){let f=y.get(w.kind)??new Set;f.add(w.from),y.set(w.kind,f)}for(let w of u.renames)y.get(w.kind)?.has(w.to)&&s.push(`${We(m,"renames",w)}: target ${w.to} is itself renamed; rename directly to the final name`);let $=new Set(u.renames.map(w=>`${w.tag}\0${w.kind}\0${w.from}`));for(let w of u.reviews)$.has(`${w.tag}\0${w.kind}\0${w.name}`)&&s.push(`${We(m,"reviews",w)}: a member is either renamed or reviewed, not both`);t&&ql(s,u)}if(e.profiles.length>=2){let u=e.profiles[0]?.detailFields,m=e.profiles[1]?.detailFields;(Array.isArray(u)||Array.isArray(m))&&JSON.stringify(u??[])!==JSON.stringify(m??[])&&s.push("lyra-v21 and lyra-v22 detailFields must preserve the same verified field exposures")}return s}function oa(e){return new Map((e?.components??[]).map(t=>[t.tag,t]))}function je(e,t,n){return(e?.surface?.[Qo[t]]??[]).find(s=>s.name===n)??null}function Wl(e,t,n){let s=new Set;for(;;){let r=`${t}\0${n}`;if(s.has(r))return!1;s.add(r);let o=je(e,t,n);if(!o)return!1;if(!o.deprecated)return!0;let i=lr(e,t,n)?.replacement;if(!i||i.kind==="component"||i.kind==="host-css-property")return!1;t=i.kind,n=i.name}}function aa(e){let t=[...e?.maturity?.deprecations??[]],n=e?.maturity?.deprecated;return Xe(n)&&!t.some(s=>s.kind==="component")&&t.push(n),t}function lr(e,t,n){let s=aa(e);if(t==="component")return s.find(o=>o.kind==="component")??null;let r=s.find(o=>o.kind===t&&o.name===n);return r||t!=="attribute"?r??null:s.find(o=>o.kind==="property"&&o.attribute===n)??null}function $t(e,t,n,s){let r=JSON.stringify(["member",t,n,s]);return e?.records?.[r]??e?.records?.[e?.aliases?.[r]]??null}function Kl(e,t,n){let s=n;for(let r=0;r<8&&Xe(s);r++){let o=(e?.successors??[]).find(l=>l.key.tag===t&&l.key.kind===s.kind&&l.key.name===s.name);if(o){s=o.replacement;continue}let i=$t(e,t,s.kind,s.name),a=i?.state==="retired"?i.policy?.replacement:null;if(!Xe(a)||["host-css-property","component"].includes(a.kind))break;s=a}return s}function Ul(e,t,n){let s=[],r=n;for(let o=0;o<9&&Xe(r);o++){s.push(r);let i=(e?.successors??[]).find(u=>u.key.tag===t&&u.key.kind===r.kind&&u.key.name===r.name),a=$t(e,t,r.kind,r.name),l=i?.replacement??(a?.state==="retired"?a.policy?.replacement:null);if(!Xe(l)||["host-css-property","component"].includes(l.kind))break;r=l}return s}function ar(e,t,n=null){let s=n??$t(e,t,"component",t);return s?.state!=="retired"?null:s.sourceComponent??e?.sourceComponents?.[t]??null}function ia(e,t){return e?.records?.[JSON.stringify(["export",t.kind,t.module??null,t.name])]??null}function pt(e,t,n){let s=e.get(n);return s||ar(t,n)}function ls(e,t,n,s,r){return lr(e,s,r)??$t(t,n,s,r)?.policy??null}function ca(e,t,n,s,r){let o=$t(t,n,s,r);return e.get(o?.state==="retired"?o.replacementOwner:n)}function Hl(e,t,n,s){let r=n?.replacement;return Xe(r)?r.kind===t&&r.name===s?!0:t==="attribute"&&r.kind==="property"?je(e,"property",r.name)?.attribute===s:!1:!1}function or(e){return String(e?.type??"").split("|").map(t=>t.trim()).includes("boolean")}function Jl(e,t,n){return(e?.components??[]).filter(s=>je(s,t,n)).map(s=>s.tag).sort(dt)}function ms(e){let t=new Map;for(let s of Object.values(e?.upstreams??{}))for(let r of s?.components??[])t.set(r.tag,r);let n=new Map;for(let s of e?.mappings??[]){if(!s?.targetTag||Gl.has(s.classification))continue;let r=t.get(s.upstreamTag);for(let[o,i]of Object.entries(Qo)){let a=s.rewrites?.[i]??[],l=new Set(a.map(m=>m?.from)),u=[...a.map(m=>m?.to).filter(m=>typeof m=="string"),...(r?.surface?.[i]??[]).map(m=>m.name).filter(m=>!l.has(m))];for(let m of u){let h=`${s.targetTag}\0${o}\0${m}`;n.has(h)||n.set(h,s.upstreamTag)}}}return n}function Yl(e,{inventory:t,exportDeprecations:n=[],requireCoverage:s=!1,sharedTokens:r=null,compatibilityContext:o=null,historicalReleaseMajor:i=null}){let a=Sn(e,{historicalReleaseMajor:i});if(a.length)return a;let l=oa(t);if(!Array.isArray(n))return["exportDeprecations must be an array"];if(!n.every(Xe))return["exportDeprecations entries must be objects"];let u=new Map(n.map(g=>[on(g),g]));u.size!==n.length&&a.push("exportDeprecations contains duplicate module records");let m=ms(t),h=c((g,y,$)=>m.get(`${g}\0${y}\0${$}`)??null,"mirrorOf");for(let g of e.profiles){let y=g.origin,$=new Set,w=`${g.toMajor}.0.0`,f=c(b=>cr(b?.removalNotBefore)===g.aliasRemovalMajor,"removalMajorMatches"),E=c((b,j)=>{if(f(j)||a.push(`${b}: its deprecation record must set removalNotBefore to ${g.aliasRemovalMajor}.0.0`),j?.since===an)return;let d=mt(j?.since,w);(d===null||d>0)&&a.push(`${b}: its deprecation record must start no later than ${w} (since ${JSON.stringify(j?.since)})`)},"checkRecordWindow"),p=c((b,j,d,x)=>{let I=h(j,d,x);I&&a.push(`${b}: ${x} mirrors ${I}; mirrored names never change`)},"checkLyraOnly"),A=c((b,j,d)=>{j==="css-property"&&r?.has(d)&&a.push(`${b}: ${d} is a canonical design token, not a component-owned custom property`)},"checkSharedToken"),k=new Set(e.profiles.filter(b=>b.toMajor<=g.toMajor).flatMap(b=>b.defaults).filter(b=>b.value===!0).map(b=>`${b.tag}\0${b.attribute}`)),N=new Set;for(let b of g.detailFields??[]){let j=We(y,"detailFields",b),d=pt(l,o,b.tag);d?!je(d,"event",b.event)&&$t(o,b.tag,"event",b.event)?.state!=="retired"&&a.push(`${j}: the event is not dispatched by ${b.tag}`):a.push(`${j}: component is not in the inventory`)}for(let b of g.renames){let j=We(y,"renames",b),d=pt(l,o,b.tag);if(!d){a.push(`${j}: component is not in the inventory`);continue}$.add(`${b.tag}\0${b.kind}\0${b.from}`),p(j,b.tag,b.kind,b.from),A(j,b.kind,b.from),A(j,b.kind,b.to);let x=$t(o,b.tag,b.kind,b.from),I=x?.state==="retired",C=je(I?ar(o,b.tag,x):d,b.kind,b.from),P=ca(l,o,b.tag,b.kind,b.from),M=je(P,b.kind,b.to);C?C.deprecated||a.push(`${j}: the alias ${b.from} is not marked deprecated in the manifest`):a.push(`${j}: the deprecated alias ${b.from} is not on the public surface`);let R=ls(d,o,b.tag,b.kind,b.from),_=I&&R?Ul(o,b.tag,R.replacement):[],W=_.some(de=>de.kind===b.kind&&de.name===b.to),ee=_.at(-1),ae=ee?je(P,ee.kind,ee.name):null,pe=!M&&W&&!!ae&&!ae.deprecated;if(!M&&!pe?a.push(`${j}: the canonical name ${b.to} is not on the public surface`):M?.deprecated&&!(I&&Wl(P,b.kind,b.to))&&a.push(`${j}: the canonical name ${b.to} is itself deprecated`),!R)a.push(`${j}: no deprecation record retires ${b.from}`);else{E(j,R);let de=Kl(o,b.tag,R.replacement);!Hl(P,b.kind,R,b.to)&&!(de?.kind===b.kind&&de.name===b.to)&&!W&&a.push(`${j}: its deprecation record names a different replacement than ${b.to}`)}if((b.kind==="attribute"||b.kind==="property")&&C&&M&&or(C)&&or(M)){let de=b.kind==="attribute"?b.to:M.attribute,he=!!de&&k.has(`${b.tag}\0${de}`);b.polarity==="inverted"?(M.default===!0&&a.push(`${j}: an inverted rename must target a boolean that defaults to false`),C.default!==!0&&de&&N.add(`${b.tag}\0${de}`),C.default!==!0&&!he&&a.push(`${j}: ${b.from} defaults to false, so the inverted rename needs a defaults entry inserting ${de??b.to} where both are absent`)):C.default===!0&&M.default!==!0&&!he&&a.push(`${j}: ${b.from} defaults to true and ${b.to} to false; declare "polarity": "inverted" or preserve the default with a defaults entry`)}else b.polarity==="inverted"&&C&&M&&a.push(`${j}: an inverted rename must retire a boolean for a boolean`)}for(let b of g.reviews){let j=We(y,"reviews",b),d=pt(l,o,b.tag);if(!d){a.push(`${j}: component is not in the inventory`);continue}$.add(`${b.tag}\0${b.kind}\0${b.name}`),b.kind!=="component"&&p(j,b.tag,b.kind,b.name),A(j,b.kind,b.name);let x=ls(d,o,b.tag,b.kind,b.name);x?E(j,x):a.push(`${j}: no deprecation record retires ${JSON.stringify(b.name)}`)}for(let b of g.detailChanges){let j=We(y,"detailChanges",b),d=pt(l,o,b.tag);d?je(d,"event",b.event)?p(j,b.tag,"event",b.event):a.push(`${j}: the event is not dispatched by ${b.tag}`):a.push(`${j}: component is not in the inventory`)}for(let b of g.retiredEvents??[]){let j=We(y,"retiredEvents",b),d=pt(l,o,b.tag);if(!d)a.push(`${j}: component is not in the inventory`);else{je(d,"event",b.event)&&a.push(`${j}: retired event is still dispatched by ${b.tag}`),lr(d,"event",b.event)&&a.push(`${j}: a retired event must not keep a current deprecation record`);let x=je(d,"event",b.replacement);(!x||x.deprecated)&&a.push(`${j}: replacement is not a current event on ${b.tag}`),p(j,b.tag,"event",b.event)}}for(let b of g.propertyChanges??[]){let j=We(y,"propertyChanges",b),d=pt(l,o,b.tag);if(!d)a.push(`${j}: component is not in the inventory`);else{let x=$t(o,b.tag,"property",b.property),I=x?.state==="retired"?x.sourceComponent??ar(o,b.tag,x):d;je(I,"property",b.property)?p(j,b.tag,"property",b.property):a.push(`${j}: the property is not on the public surface`),b.former&&je(I,"property",b.former)&&a.push(`${j}: the former property name is still on the public surface`)}}for(let b of g.slotContent){let j=We(y,"slotContent",b),d=pt(l,o,b.tag);if(!d){a.push(`${j}: component is not in the inventory`);continue}je(d,"slot",b.slot)||a.push(`${j}: the slot is not on the public surface`);let x=ls(d,o,b.tag,"slot-content",b.slot);x&&($.add(`${b.tag}\0slot-content\0${b.slot}`),Array.isArray(x.permittedContent)&&JSON.stringify(b.allow??null)!==JSON.stringify(x.permittedContent)&&a.push(`${j}: its deprecation record permits ${x.permittedContent.join(", ")}; allow must list exactly those elements`))}for(let b of g.defaults){let j=We(y,"defaults",b),d=pt(l,o,b.tag);if(!d){a.push(`${j}: component is not in the inventory`);continue}let x=je(d,"attribute",b.attribute);if(!x){a.push(`${j}: the attribute is not on the public surface`);continue}N.has(`${b.tag}\0${b.attribute}`)||p(j,b.tag,"attribute",b.attribute),b.value===!0&&!or(x)&&a.push(`${j}: presence insertion requires a boolean attribute`),x.hasDefault&&String(x.default)===String(b.value)&&a.push(`${j}: the value equals the current default, so there is nothing to preserve`)}for(let b of g.globals??[]){let j=We(y,"globals",b);if(b.kind==="part"){let d=pt(l,o,b.tag),x=o?.sourceComponents?.[b.tag]??null;d?!je(d,"part",b.from)&&!je(x,"part",b.from)&&a.push(`${j}: the part is not on the public surface`):a.push(`${j}: component is not in the inventory`)}else b.kind==="locale-key"&&b.tag?pt(l,o,b.tag)||a.push(`${j}: component is not in the inventory`):b.kind==="css-property"&&[...l.values()].some(x=>(x.surface?.cssProperties??[]).some(I=>b.prefix?I.name.startsWith(b.from):I.name===b.from))&&a.push(`${j}: a component still exposes the custom property`)}let O=new Set;for(let b of g.moduleReviews){let j=We(y,"moduleReviews",b),d=on(b);O.add(d);let x=u.get(d)??ia(o,b)?.policy;x?(E(j,x),!x.replacement?.usage&&!x.replacement?.name&&a.push(`${j}: canonical replacement is missing`)):a.push(`${j}: no canonical exportDeprecations record`)}if(!s)continue;for(let b of[...n,...Object.values(o?.records??{}).filter(j=>j.state==="retired"&&j.key.scope==="export").map(j=>j.policy)])f(b)&&!O.has(on(b))&&a.push(`${y}: ${b.kind} ${b.module??""} ${b.name} is removed in ${g.aliasRemovalMajor}.0.0 but has no moduleReviews entry`);let q=new Map((t?.components??[]).map(b=>[b.tag,aa(b)]));for(let b of Object.values(o?.records??{}))b.state!=="retired"||b.key.scope!=="member"||q.set(b.key.tag,[...q.get(b.key.tag)??[],b.policy]);for(let[b,j]of q){let d={tag:b};for(let x of j){if(!f(x))continue;let I=[[x.kind,x.kind==="component"?d.tag:x.name]];x.kind==="property"&&x.attribute&&I.push(["attribute",x.attribute]);for(let[C,P]of I)C!=="component"&&h(d.tag,C,P)||$.has(`${d.tag}\0${C}\0${P}`)||a.push(`${y}: ${d.tag} ${C} ${JSON.stringify(P)} is removed in ${g.aliasRemovalMajor}.0.0 but has no ${C==="slot-content"?"slotContent":"rename or review"} entry`)}}}return[...new Set(a)]}function kn(e,t,{exportDeprecations:n=[],compatibilityContext:s=null,historicalReleaseMajor:r=null}={}){let o=Yl(e,{inventory:t,exportDeprecations:n,compatibilityContext:s,historicalReleaseMajor:r});if(o.length)throw new Error(`Invalid Lyra rename ledger: ${o.join("; ")}`);let i=oa(t),a=new Map(n.map(m=>[on(m),m])),l={schemaVersion:1,profiles:e.profiles.map(m=>{let h=`${m.toMajor}.0.0`,g=Object.fromEntries(cn.map($=>[$,{}]));for(let[$,w]of ra(m))for(let f of[...w.keys()].sort(dt))g[$][f]=[...new Set([...Jl(t,$,f),...s?.exposure?.[$]?.[f]??[]])].sort(dt);for(let $ of m.renames){let w=g[$.kind]?.[$.to];w&&!w.includes($.tag)&&(g[$.kind][$.to]=[...w,$.tag].sort(dt))}let y=c(($,w,f)=>ls(i.get($.tag),s,$.tag,w,f),"recordFor");return{origin:m.origin,fromMajor:m.fromMajor,toMajor:m.toMajor,aliasRemovalMajor:m.aliasRemovalMajor,renames:m.renames.map($=>{let w=je(ca(i,s,$.tag,$.kind,$.from),$.kind,$.to),f=$.kind==="attribute"?$.to:w?.attribute,E=$.polarity==="inverted"&&m.defaults.some(k=>k.tag===$.tag&&k.attribute===f),p=y($,$.kind,$.from).since,A=p===an||mt(p,h)<0;return{...structuredClone($),since:E&&A?h:p,...$.kind==="attribute"?{reflects:!!w?.reflects}:{}}}),defaults:m.defaults.map($=>({...structuredClone($),since:h})),retiredEvents:(m.retiredEvents??[]).map($=>({...structuredClone($),since:h})),detailChanges:m.detailChanges.map($=>({...structuredClone($),since:h})),...Array.isArray(m.detailFields)?{detailFields:m.detailFields.map($=>structuredClone($))}:{},propertyChanges:(m.propertyChanges??[]).map($=>({...structuredClone($),since:h})),...Array.isArray(m.globals)?{globals:m.globals.map($=>structuredClone($))}:{},...Array.isArray(m.rules)?{rules:[...m.rules]}:{},reviews:m.reviews.map($=>{let w=y($,$.kind,$.name),f=$t(s,$.tag,$.kind,$.name);return{...structuredClone($),replacement:String(w.replacement?.usage||w.replacement?.name),...f?.state==="retired"?{removedIn:f.removedIn}:{},removalNotBefore:w.removalNotBefore,since:w.since}}),slotContent:m.slotContent.map($=>({...structuredClone($),since:h})),moduleReviews:m.moduleReviews.map($=>{let w=ia(s,$),f=a.get(on($))??w?.policy;return{...structuredClone($),replacement:String(f.replacement.usage||f.replacement.name),...w?.state==="retired"?{removedIn:w.removedIn}:{},since:f.since,removalNotBefore:f.removalNotBefore}}),exposure:g}})},u=Sn(l,{projected:!0,historicalReleaseMajor:r});if(u.length)throw new Error(`Invalid Lyra rename projection: ${u.join("; ")}`);return l}function Nt(e,t){let n=new Map;for(let s of e){let r=t(s),o=n.get(r)??[];o.push(s),n.set(r,o)}return n}function la(e,{lyraVersion:t=null}={}){let n=Sn(e,{projected:!0});if(n.length)throw new Error(`Invalid Lyra rename projection: ${n.join("; ")}`);if(t!==null&&!Ze(t))throw new Error(`Invalid Lyra version: ${t}`);let s=new Map,r=c(a=>t===null||a.since!==an&&mt(a.since,t)<=0,"availableAcrossProfiles"),o=e.profiles.flatMap(a=>a.renames).filter(r),i=e.profiles.flatMap(a=>a.defaults).filter(r);for(let a of e.profiles){let l=[],u=c(R=>(a[R]??[]).filter(_=>{if(t===null)return!0;let W=R==="detailFields"?_.observedIn:_.since;return W!==an&&mt(W,t)<=0?!0:(l.push({list:R,..._}),!1)}).map(_=>{if(!_.removedIn||t===null||mt(t,_.removedIn)>=0)return _;let{removedIn:W,...ee}=_;return ee}),"available"),m=t===null||mt(t,`${a.toMajor}.0.0`)>=0;m||l.push(...(a.rules??[]).map(R=>({list:"rules",rule:R})));let h={...a,...Object.fromEntries(us.map(R=>[R,u(R)])),rules:m?[...a.rules??[]]:[]},g=new Map(h.renames.map(R=>[Ye(R.tag,R.kind,R.from),R])),y=Nt(h.renames,R=>qt(R.kind,R.from)),$=Nt(h.renames,R=>qt(R.kind,R.to)),w=new Map(h.reviews.map(R=>[Ye(R.tag,R.kind,R.name),R])),f=Nt(h.reviews,R=>qt(R.kind,R.name)),E=new Map(h.detailChanges.map(R=>[Ye(R.tag,"event",R.event),R])),p=Nt(h.detailChanges,R=>R.event),A=new Map((h.detailFields??[]).map(R=>[Ye(R.tag,"event",R.event),R])),k=Nt(h.detailFields??[],R=>R.event),N=new Map(h.retiredEvents.map(R=>[Ye(R.tag,"event",R.event),R])),O=Nt(h.retiredEvents,R=>R.event),q=new Map(h.propertyChanges.flatMap(R=>[R.property,...R.former?[R.former]:[]].map(_=>[Ye(R.tag,"property",_),R]))),b=new Map(cn.map(R=>[R,new Map(Object.entries(h.exposure[R]).map(([_,W])=>[_,new Set(W)]))])),j=Nt(h.defaults,R=>R.tag),d=Nt(h.slotContent,R=>R.tag),x=new Set([...h.renames,...h.reviews,...h.detailChanges,...h.detailFields??[],...h.retiredEvents,...h.propertyChanges,...h.defaults,...h.slotContent].map(R=>R.tag)),I=c((R,_)=>y.get(qt(R,_))??[],"renamesNamed"),C=c((R,_)=>b.get(R)?.get(_)??new Set,"exposersOf"),P=c((R,_,W)=>new Set(I(R,_).filter(ee=>ee.to===W&&!ee.polarity).map(ee=>ee.tag)),"movers"),M=c((R,_)=>[...R].every(W=>_.has(W)),"subset");s.set(h.origin,{origin:h.origin,fromMajor:h.fromMajor,toMajor:h.toMajor,aliasRemovalMajor:h.aliasRemovalMajor,data:h,skipped:l,tags:x,isEmpty:x.size===0&&h.moduleReviews.length===0&&h.globals.length===0&&h.rules.length===0,renameFor:c((R,_,W)=>g.get(Ye(R,_,W))??null,"renameFor"),renamesNamed:I,renamesOnto:c((R,_)=>$.get(qt(R,_))??[],"renamesOnto"),reviewFor:c((R,_,W)=>w.get(Ye(R,_,W))??null,"reviewFor"),reviewsNamed:c((R,_)=>f.get(qt(R,_))??[],"reviewsNamed"),detailFor:c((R,_)=>E.get(Ye(R,"event",_))??null,"detailFor"),detailsNamed:c(R=>p.get(R)??[],"detailsNamed"),detailFieldFor:c((R,_)=>A.get(Ye(R,"event",_))??null,"detailFieldFor"),detailFieldsNamed:c(R=>k.get(R)??[],"detailFieldsNamed"),retiredEventFor:c((R,_)=>N.get(Ye(R,"event",_))??null,"retiredEventFor"),retiredEventsNamed:c(R=>O.get(R)??[],"retiredEventsNamed"),propertyChangeFor:c((R,_)=>q.get(Ye(R,"property",_))??null,"propertyChangeFor"),defaultsFor:c(R=>j.get(R)??[],"defaultsFor"),preservedDefaultsFor:c(R=>i.filter(_=>_.tag===R),"preservedDefaultsFor"),defaultAliasesFor:c((R,_)=>{let W=new Set([_]);for(let ee of o)ee.tag!==R||ee.kind!=="attribute"||(ee.from===_&&W.add(ee.to),ee.to===_&&W.add(ee.from));return[...W]},"defaultAliasesFor"),slotContentFor:c(R=>d.get(R)??[],"slotContentFor"),exposes:c((R,_,W)=>!!W&&C(R,_).has(W),"exposes"),exposers:c((R,_)=>[...C(R,_)],"exposers"),targetKeepers(R,_,W){let ee=P(R,_,W);return[...C(R,W)].filter(ae=>!ee.has(ae))},sourceKeepers(R,_,W){let ee=P(R,_,W);return[...C(R,_)].filter(ae=>!ee.has(ae))},isGlobal(R,_){let W=I(R,_);if(!W.length||W.some(de=>de.polarity))return!1;let ee=new Set(W.map(de=>de.to));if(ee.size!==1)return!1;let[ae]=ee,pe=P(R,_,ae);return C(R,_).size>0&&M(C(R,_),pe)&&M(C(R,ae),pe)},gainedOwners(R,_){let W=($.get(qt(R,_))??[]).filter(pe=>!pe.polarity);if(!W.length)return[];let ee=new Set(W.map(pe=>pe.tag));return[...C(R,_)].filter(pe=>!ee.has(pe)).length?[...ee].sort(dt):[]}})}return s}var an,ir,Wt,Go,Yo,cn,Qo,xn,El,Kt,xl,ea,Sl,Zo,on,us,kl,ta,Xo,Tl,Rl,Al,Ol,Gl,Ye,qt,Tn=_e(()=>{"use strict";an="unreleased",ir=Object.freeze([Object.freeze({origin:"lyra-v21",fromMajor:21,toMajor:22,aliasRemovalMajor:23}),Object.freeze({origin:"lyra-v22",fromMajor:22,toMajor:23,aliasRemovalMajor:24}),Object.freeze({origin:"lyra-v25",fromMajor:25,toMajor:26,aliasRemovalMajor:28}),Object.freeze({origin:"lyra-v26",fromMajor:26,toMajor:27,aliasRemovalMajor:29}),Object.freeze({origin:"lyra-v31",fromMajor:31,toMajor:32,aliasRemovalMajor:33})]),Wt=Object.freeze(ir.map(e=>e.origin)),Go=Object.freeze(["attribute","property","event","part","css-property","slot"]),Yo=Object.freeze(["component","attribute","property","event","slot","part","css-property","css-state","method"]),cn=Object.freeze(["event","part","css-property"]),Qo=Object.freeze({attribute:"attributes",property:"properties",event:"events",part:"parts","css-property":"cssProperties",slot:"slots","css-state":"cssStates",method:"methods"}),xn=/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/,El=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Kt=/^[A-Za-z_$][\w$]*$/,xl=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/,ea=Object.freeze({component:xn,attribute:/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,property:Kt,method:Kt,event:/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/,part:/^[A-Za-z0-9_-]+$/,slot:/^(?:[A-Za-z0-9_-]+)?$/,"css-property":/^--[A-Za-z0-9_-]+$/,"css-state":/^[a-z][a-z0-9-]*$/}),Sl=["entry-point","stylesheet","function","type","constant","class","window-event","root-attribute"],Zo=/^\.\/[A-Za-z0-9_./-]+\.(?:js|css)$/,on=c(e=>[e.kind,e.module??"",e.name].join("\0"),"moduleReviewKey"),us=["renames","defaults","detailChanges","detailFields","propertyChanges","retiredEvents","reviews","slotContent","moduleReviews","globals"],kl=["propertyChanges","retiredEvents","detailFields","globals"],ta=["origin","fromMajor","toMajor","aliasRemovalMajor",...us,"rules"],Xo=Object.freeze(["module","export","locale-key","css-property","part"]),Tl=/^\.\/components\/[a-z][a-z0-9-]*$/,Rl=Object.freeze(["theme-scopes"]),Al=/^@aceshooting\/lyra-[a-z]+(?:\/[A-Za-z0-9_./-]*)?$/,Ol=[...ta,"exposure"];c(Xe,"isPlainObject");c(Ke,"unknownKeys");c(dt,"compareText");c(Ze,"parseVersion");c(mt,"compareVersions");c(cr,"majorOf");c(Nl,"emptyRenameLedger");c(na,"emptyRenameProjection");c(We,"entryLabel");c(Cl,"sortKey");c(Ue,"validateName");c(Ct,"validateProjectedSince");c(sa,"validateRemovedIn");c(_l,"validateModuleReviewEntry");c(Il,"validateGlobalEntry");c(Ml,"validateRulesList");c(jl,"validateRenameEntry");c(Pl,"validateDefaultEntry");c(ps,"validateSummary");c(zl,"validateDetailEntry");c(Dl,"validateDetailFieldEntry");c(Ll,"validateRetiredEventEntry");c(Fl,"validatePropertyChangeEntry");c(Bl,"validateSlotContentEntry");c(Vl,"validateReviewEntry");c(ra,"requiredExposure");c(ql,"validateExposure");c(Sn,"validateRenameLedgerShape");c(oa,"componentMap");c(je,"surfaceEntry");c(Wl,"hasCurrentSuccessor");c(aa,"deprecationRecords");c(lr,"deprecationRecordFor");c($t,"historicalMember");c(Kl,"followReplacement");c(Ul,"replacementChain");c(ar,"historicalSourceComponent");c(ia,"historicalExport");c(pt,"ownerFor");c(ls,"policyFor");c(ca,"replacementOwner");c(Hl,"replacementMatches");c(or,"isBooleanMember");c(Jl,"exposingTags");Gl=new Set(["conceptual-only","unsupported"]);c(ms,"mirroredMembers");c(Yl,"validateRenameLedger");c(kn,"projectRenameLedger");c(Nt,"indexBy");Ye=c((e,t,n)=>`${e}\0${t}\0${n}`,"ownerKey"),qt=c((e,t)=>`${e}\0${t}`,"nameKey");c(la,"createRenameProfiles")});import{gunzipSync as Zl,gzipSync as df}from"node:zlib";function fs(e){if(e.length>ua)throw new Error("Compressed migration contract exceeds size limit");return Zl(e,{maxOutputLength:ua})}var ds,ua,ur=_e(()=>{"use strict";ds="migration-contract.json.gz",ua=32*1024*1024;c(fs,"decodeMigrationContract")});import{createRequire as ym}from"module";function qi(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{let e=J(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);return Zn=e&&typeof e.__napiBindingTarget=="string"?e.__napiBindingTarget:"native",e}catch(e){te.push(e)}else if(process.platform==="android")if(process.arch==="arm64"){try{return J("./parser.android-arm64.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-android-arm64"),t=J("@oxc-parser/binding-android-arm64/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="arm"){try{return J("./parser.android-arm-eabi.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-android-arm-eabi"),t=J("@oxc-parser/binding-android-arm-eabi/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else te.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64")if(process.config&&process.config.variables&&process.config.variables.shlib_suffix==="dll.a"||process.config&&process.config.variables&&process.config.variables.node_target_type==="shared_library"){try{return J("./parser.win32-x64-gnu.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-win32-x64-gnu"),t=J("@oxc-parser/binding-win32-x64-gnu/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else{try{return J("./parser.win32-x64-msvc.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-win32-x64-msvc"),t=J("@oxc-parser/binding-win32-x64-msvc/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="ia32"){try{return J("./parser.win32-ia32-msvc.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-win32-ia32-msvc"),t=J("@oxc-parser/binding-win32-ia32-msvc/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="arm64"){try{return J("./parser.win32-arm64-msvc.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-win32-arm64-msvc"),t=J("@oxc-parser/binding-win32-arm64-msvc/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else te.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return J("./parser.darwin-universal.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-darwin-universal"),t=J("@oxc-parser/binding-darwin-universal/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}if(process.arch==="x64"){try{return J("./parser.darwin-x64.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-darwin-x64"),t=J("@oxc-parser/binding-darwin-x64/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="arm64"){try{return J("./parser.darwin-arm64.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-darwin-arm64"),t=J("@oxc-parser/binding-darwin-arm64/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else te.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return J("./parser.freebsd-x64.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-freebsd-x64"),t=J("@oxc-parser/binding-freebsd-x64/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="arm64"){try{return J("./parser.freebsd-arm64.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-freebsd-arm64"),t=J("@oxc-parser/binding-freebsd-arm64/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else te.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(Yn()){try{return J("./parser.linux-x64-musl.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-x64-musl"),t=J("@oxc-parser/binding-linux-x64-musl/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else{try{return J("./parser.linux-x64-gnu.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-x64-gnu"),t=J("@oxc-parser/binding-linux-x64-gnu/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="arm64")if(Yn()){try{return J("./parser.linux-arm64-musl.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-arm64-musl"),t=J("@oxc-parser/binding-linux-arm64-musl/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else{try{return J("./parser.linux-arm64-gnu.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-arm64-gnu"),t=J("@oxc-parser/binding-linux-arm64-gnu/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="arm")if(Yn()){try{return J("./parser.linux-arm-musleabihf.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-arm-musleabihf"),t=J("@oxc-parser/binding-linux-arm-musleabihf/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else{try{return J("./parser.linux-arm-gnueabihf.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-arm-gnueabihf"),t=J("@oxc-parser/binding-linux-arm-gnueabihf/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="loong64")if(Yn()){try{return J("./parser.linux-loong64-musl.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-loong64-musl"),t=J("@oxc-parser/binding-linux-loong64-musl/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else{try{return J("./parser.linux-loong64-gnu.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-loong64-gnu"),t=J("@oxc-parser/binding-linux-loong64-gnu/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="riscv64")if(Yn()){try{return J("./parser.linux-riscv64-musl.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-riscv64-musl"),t=J("@oxc-parser/binding-linux-riscv64-musl/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else{try{return J("./parser.linux-riscv64-gnu.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-riscv64-gnu"),t=J("@oxc-parser/binding-linux-riscv64-gnu/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="ppc64"){try{return J("./parser.linux-ppc64-gnu.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-ppc64-gnu"),t=J("@oxc-parser/binding-linux-ppc64-gnu/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="s390x"){try{return J("./parser.linux-s390x-gnu.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-linux-s390x-gnu"),t=J("@oxc-parser/binding-linux-s390x-gnu/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else te.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return J("./parser.openharmony-arm64.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-openharmony-arm64"),t=J("@oxc-parser/binding-openharmony-arm64/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="x64"){try{return J("./parser.openharmony-x64.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-openharmony-x64"),t=J("@oxc-parser/binding-openharmony-x64/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else if(process.arch==="arm"){try{return J("./parser.openharmony-arm.node")}catch(e){te.push(e)}try{let e=J("@oxc-parser/binding-openharmony-arm"),t=J("@oxc-parser/binding-openharmony-arm/package.json").version;if(t!=="0.159.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.159.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){te.push(e)}}else te.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else te.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}function Wi(e){return e.reduce((t,n)=>{let s;try{s=n&&typeof n.message=="string"?n.message:String(n)}catch{s="Unknown error"}let r=new Error(s);return r.cause=t,r},null)}var J,bm,tt,Zn,te,Yn,$m,wm,vm,Em,Vi,kt,St,co,lo,xm,Sm,km,Tm,Rm,Am,Om,Ki,Nm,rh,oh,ah,Ds=_e(()=>{J=ym(import.meta.url),{readFileSync:bm}=J("fs"),tt=null,Zn="native",te=[],Yn=c(()=>{let e=!1;return process.platform==="linux"&&(e=wm(),e===null&&(e=vm()),e===null&&(e=Em())),e},"isMusl"),$m=c(e=>e.includes("libc.musl-")||e.includes("ld-musl-"),"isFileMusl"),wm=c(()=>{try{return bm("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},"isMuslFromFilesystem"),vm=c(()=>{let e=null;return process.report&&typeof process.report.getReport=="function"&&(process.report.excludeNetwork=!0,e=process.report.getReport()),e?e.header&&e.header.glibcVersionRuntime?!1:!!(Array.isArray(e.sharedObjects)&&e.sharedObjects.some($m)):null},"isMuslFromReport"),Em=c(()=>{try{return J("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}},"isMuslFromChildProcess");c(qi,"requireNative");c(Wi,"createLoadErrorChain");Vi=["wasm32-wasi","wasm32-wasip1"],kt=process.env.NAPI_RS_WASI_FLAVOR,St=typeof kt=="string"&&kt.length>0;if(St&&Vi.indexOf(kt)===-1)throw new Error('Unsupported WASI flavor "'+kt+'". Available flavors: '+Vi.join(", "));co=process.env.NAPI_RS_FORCE_WASI==="error",lo=process.env.NAPI_RS_FORCE_WASI==="true"||co||St;lo||(tt=qi());if(!tt||lo){let e=null,t=!1,n=[],s=c((r,o,i)=>{try{J.resolve(r)}catch(a){if(!a||a.code!=="MODULE_NOT_FOUND")throw a;if(o){try{J.resolve(r+"/package.json")}catch(l){if(l&&l.code==="MODULE_NOT_FOUND")return a;throw a}throw a}return a}if(i){let a=null;for(let l=0;l<i.length;l++)try{return J.resolve(i[l]),null}catch(u){if(!u||u.code!=="MODULE_NOT_FOUND")throw u;a=u}return a}return null},"__napiWasiResolveCandidate");if(!t&&(!St||kt==="wasm32-wasi")){let r=null,o=!1;try{r=s("./parser.wasi.cjs",!1,["./parser.wasm32-wasi.debug.wasm","./parser.wasm32-wasi.wasm"]),o=r!==null,o||(e=J("./parser.wasi.cjs"),tt=e,Zn="wasm32-wasi",t=!0)}catch(i){r=i,o=!0}o&&(n.push(r),te.push(r))}if(!t&&(!St||kt==="wasm32-wasip1")){let r=null,o=!1;try{r=s("./parser.wasip1.cjs",!1,["./parser.wasm32-wasip1.debug.wasm","./parser.wasm32-wasip1.wasm"]),o=r!==null,o||(e=J("./parser.wasip1.cjs"),tt=e,Zn="wasm32-wasip1",t=!0)}catch(i){r=i,o=!0}o&&(n.push(r),te.push(r))}if(!t&&(!St||kt==="wasm32-wasi")){let r=null,o=!1;try{if(r=s("@oxc-parser/binding-wasm32-wasi",!0,void 0),o=r!==null,!o){if(process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0"){let i=J("@oxc-parser/binding-wasm32-wasi/package.json").version;if(i!=="0.159.0")throw new Error(`WASI binding package version mismatch, expected 0.159.0 but got ${i}. You can reinstall dependencies to fix this issue.`)}e=J("@oxc-parser/binding-wasm32-wasi"),tt=e,Zn="wasm32-wasi",t=!0}}catch(i){r=i,o=!0}o&&(n.push(r),te.push(r))}if(!t&&(!St||kt==="wasm32-wasip1")){let r=null,o=!1;try{if(r=s("@oxc-parser/binding-wasm32-wasip1",!0,void 0),o=r!==null,!o){if(process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0"){let i=J("@oxc-parser/binding-wasm32-wasip1/package.json").version;if(i!=="0.159.0")throw new Error(`WASI binding package version mismatch, expected 0.159.0 but got ${i}. You can reinstall dependencies to fix this issue.`)}e=J("@oxc-parser/binding-wasm32-wasip1"),tt=e,Zn="wasm32-wasip1",t=!0}}catch(i){r=i,o=!0}o&&(n.push(r),te.push(r))}if(!t&&lo&&!co&&!St&&(tt=qi()),(co||St)&&!t){let r=new Error(St?'WASI binding for flavor "'+kt+'" not found':"WASI binding not found and NAPI_RS_FORCE_WASI is set to error");throw r.cause=Wi(n),r}}if(!tt&&globalThis.process?.versions?.webcontainer)try{tt=J("./webcontainer-fallback.cjs")}catch(e){te.push(e)}if(!tt){if(te.length>0){let e=new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.");throw e.cause=Wi(te),e}throw new Error("Failed to load native binding")}({Severity:xm,ParseResult:Sm,ExportExportNameKind:km,ExportImportNameKind:Tm,ExportLocalNameKind:Rm,ImportNameKind:Am,parse:Om,parseSync:Ki,rawTransferSupported:Nm}=tt),{getBufferOffset:rh,parseRaw:oh,parseRawSync:ah}=tt});function Ui(e){let{module:t,comments:n,errors:s}=e,r=e.program,o;return{get program(){return o||(o=Cm(r),r=null),o},module:t,comments:n,errors:s}}function Cm(e){let{node:t,fixes:n}=JSON.parse(e);for(let s of n)_m(t,s);return t}function _m(e,t){let n=e;for(let s of t)n=n[s];if(n.bigint)n.value=BigInt(n.bigint);else try{n.value=RegExp(n.regex.pattern,n.regex.flags)}catch{}}var Hi=_e(()=>{c(Ui,"wrap");c(Cm,"jsonParseAst");c(_m,"applyFix")});var G,ve,Ji,Ls,zt,gn,Gi,Yi,Tt,Zi,Xi,Qi,uo,po,ec,tc,nc,sc,Fs,mo,rc,oc,ac,Zt,ic,Im,cc=_e(()=>{({freeze:G}=Object),ve=G([]),Ji=G(["decorators","key","typeAnnotation","value"]),Ls=G(["left","right"]),zt=G(["argument"]),gn=G(["body"]),Gi=G(["label"]),Yi=G(["callee","typeArguments","arguments"]),Tt=G(["expression"]),Zi=G(["decorators","id","typeParameters","superClass","superTypeArguments","implements","body"]),Xi=G(["test","consequent","alternate"]),Qi=G(["left","right","body"]),uo=G(["id","typeParameters","params","returnType","body"]),po=G(["key","value"]),ec=G(["local"]),tc=G(["object","property"]),nc=G(["decorators","key","typeAnnotation"]),sc=G(["expression","typeAnnotation"]),Fs=G(["typeParameters","params","returnType"]),mo=G(["expression","typeArguments"]),rc=G(["members"]),oc=G(["id","body"]),ac=G(["types"]),Zt=G(["typeAnnotation"]),ic=G(["params"]),Im=G({DebuggerStatement:ve,EmptyStatement:ve,Literal:ve,PrivateIdentifier:ve,Super:ve,TemplateElement:ve,ThisExpression:ve,JSXClosingFragment:ve,JSXEmptyExpression:ve,JSXIdentifier:ve,JSXOpeningFragment:ve,JSXText:ve,TSAnyKeyword:ve,TSBigIntKeyword:ve,TSBooleanKeyword:ve,TSIntrinsicKeyword:ve,TSJSDocUnknownType:ve,TSNeverKeyword:ve,TSNullKeyword:ve,TSNumberKeyword:ve,TSObjectKeyword:ve,TSStringKeyword:ve,TSSymbolKeyword:ve,TSThisType:ve,TSUndefinedKeyword:ve,TSUnknownKeyword:ve,TSVoidKeyword:ve,AccessorProperty:Ji,ArrayExpression:G(["elements"]),ArrayPattern:G(["decorators","elements","typeAnnotation"]),ArrowFunctionExpression:G(["typeParameters","params","returnType","body"]),AssignmentExpression:Ls,AssignmentPattern:G(["decorators","left","right","typeAnnotation"]),AwaitExpression:zt,BinaryExpression:Ls,BlockStatement:gn,BreakStatement:Gi,CallExpression:Yi,CatchClause:G(["param","body"]),ChainExpression:Tt,ClassBody:gn,ClassDeclaration:Zi,ClassExpression:Zi,ConditionalExpression:Xi,ContinueStatement:Gi,Decorator:Tt,DoWhileStatement:G(["body","test"]),ExportAllDeclaration:G(["exported","source","attributes"]),ExportDefaultDeclaration:G(["declaration"]),ExportNamedDeclaration:G(["declaration","specifiers","source","attributes"]),ExportSpecifier:G(["local","exported"]),ExpressionStatement:Tt,ForInStatement:Qi,ForOfStatement:Qi,ForStatement:G(["init","test","update","body"]),FunctionDeclaration:uo,FunctionExpression:uo,Identifier:G(["decorators","typeAnnotation"]),IfStatement:Xi,ImportAttribute:po,ImportDeclaration:G(["specifiers","source","attributes"]),ImportDefaultSpecifier:ec,ImportExpression:G(["source","options"]),ImportNamespaceSpecifier:ec,ImportSpecifier:G(["imported","local"]),LabeledStatement:G(["label","body"]),LogicalExpression:Ls,MemberExpression:tc,MetaProperty:G(["meta","property"]),MethodDefinition:G(["decorators","key","value"]),NewExpression:Yi,ObjectExpression:G(["properties"]),ObjectPattern:G(["decorators","properties","typeAnnotation"]),ParenthesizedExpression:Tt,Program:gn,Property:po,PropertyDefinition:Ji,RestElement:G(["decorators","argument","typeAnnotation"]),ReturnStatement:zt,SequenceExpression:G(["expressions"]),SpreadElement:zt,StaticBlock:gn,SwitchCase:G(["test","consequent"]),SwitchStatement:G(["discriminant","cases"]),TaggedTemplateExpression:G(["tag","typeArguments","quasi"]),TemplateLiteral:G(["quasis","expressions"]),ThrowStatement:zt,TryStatement:G(["block","handler","finalizer"]),UnaryExpression:zt,UpdateExpression:zt,V8IntrinsicExpression:G(["name","arguments"]),VariableDeclaration:G(["declarations"]),VariableDeclarator:G(["id","init"]),WhileStatement:G(["test","body"]),WithStatement:G(["object","body"]),YieldExpression:zt,JSXAttribute:G(["name","value"]),JSXClosingElement:G(["name"]),JSXElement:G(["openingElement","children","closingElement"]),JSXExpressionContainer:Tt,JSXFragment:G(["openingFragment","children","closingFragment"]),JSXMemberExpression:tc,JSXNamespacedName:G(["namespace","name"]),JSXOpeningElement:G(["name","typeArguments","attributes"]),JSXSpreadAttribute:zt,JSXSpreadChild:Tt,TSAbstractAccessorProperty:nc,TSAbstractMethodDefinition:po,TSAbstractPropertyDefinition:nc,TSArrayType:G(["elementType"]),TSAsExpression:sc,TSCallSignatureDeclaration:Fs,TSClassImplements:mo,TSConditionalType:G(["checkType","extendsType","trueType","falseType"]),TSConstructSignatureDeclaration:Fs,TSConstructorType:Fs,TSDeclareFunction:uo,TSEmptyBodyFunctionExpression:G(["id","typeParameters","params","returnType"]),TSEnumBody:rc,TSEnumDeclaration:oc,TSEnumMember:G(["id","initializer"]),TSExportAssignment:Tt,TSExternalModuleReference:Tt,TSFunctionType:Fs,TSImportEqualsDeclaration:G(["id","moduleReference"]),TSImportType:G(["source","options","qualifier","typeArguments"]),TSIndexSignature:G(["parameters","typeAnnotation"]),TSIndexedAccessType:G(["objectType","indexType"]),TSInferType:G(["typeParameter"]),TSInstantiationExpression:mo,TSInterfaceBody:gn,TSInterfaceDeclaration:G(["id","typeParameters","extends","body"]),TSInterfaceHeritage:mo,TSIntersectionType:ac,TSJSDocNonNullableType:Zt,TSJSDocNullableType:Zt,TSLiteralType:G(["literal"]),TSMappedType:G(["key","constraint","nameType","typeAnnotation"]),TSMethodSignature:G(["key","typeParameters","params","returnType"]),TSModuleBlock:gn,TSModuleDeclaration:oc,TSNamedTupleMember:G(["label","elementType"]),TSNamespaceExportDeclaration:G(["id"]),TSNonNullExpression:Tt,TSOptionalType:Zt,TSParameterProperty:G(["decorators","parameter"]),TSParenthesizedType:Zt,TSPropertySignature:G(["key","typeAnnotation"]),TSQualifiedName:Ls,TSRestType:Zt,TSSatisfiesExpression:sc,TSTemplateLiteralType:G(["quasis","types"]),TSTupleType:G(["elementTypes"]),TSTypeAliasDeclaration:G(["id","typeParameters","typeAnnotation"]),TSTypeAnnotation:Zt,TSTypeAssertion:G(["typeAnnotation","expression"]),TSTypeLiteral:rc,TSTypeOperator:Zt,TSTypeParameter:G(["name","constraint","default"]),TSTypeParameterDeclaration:ic,TSTypeParameterInstantiation:ic,TSTypePredicate:G(["parameterName","typeAnnotation"]),TSTypeQuery:G(["exprName","typeArguments"]),TSTypeReference:G(["typeName","typeArguments"]),TSUnionType:ac})});var lc=_e(()=>{});var uc=_e(()=>{Ds()});import{createRequire as Mm}from"node:module";function Dm(){fo===null&&({parseSyncRaw:fo,parse:jm}=pc("./raw-transfer/eager.js"))}function Lm(){ho===null&&({parseSyncLazy:ho,parse:Pm,Visitor:zm}=pc("./raw-transfer/lazy.js"))}function go(e,t,n){return n?.experimentalRawTransfer?(Dm(),fo(e,t,n)):n?.experimentalLazy?(Lm(),ho(e,t,n)):Ui(Ki(e,t,n))}var pc,fo,jm,ho,Pm,zm,mc=_e(()=>{Ds();Hi();cc();lc();Ds();uc();pc=Mm(import.meta.url),fo=null,ho=null;c(Dm,"loadRawTransfer");c(Lm,"loadRawTransferLazy");c(go,"parseSync")});import Fm from"node:fs";import yo from"node:path";import{fileURLToPath as Bm}from"node:url";function Km(e,t){return String(e).localeCompare(String(t))}function dc(e){let t=Wm.exec(e);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]??null}:null}function gc(e,t){let n=dc(e),s=dc(t);if(!n||!s)throw new TypeError(`Cannot compare invalid versions ${String(e)} and ${String(t)}`);for(let r of["major","minor","patch"])if(n[r]!==s[r])return n[r]-s[r];return n.prerelease===s.prerelease?0:n.prerelease===null?1:s.prerelease===null?-1:Km(n.prerelease,s.prerelease)}function Um(e){try{return Fm.readFileSync(yo.join(qm,e),"utf8")}catch(t){if(t?.code==="ENOENT")return null;throw t}}function Hm(e){return[...hc,...$o].includes(e?.kind)?`exportDeprecations ${e.kind} ${e?.module}#${e?.name}`:`exportDeprecations ${e?.kind} ${e?.name}`}function bo(e){if(e===null)return null;if(typeof e=="string")return e;if(e&&typeof e=="object"&&!Array.isArray(e)){if(Object.hasOwn(e,"import"))return bo(e.import);if(Object.hasOwn(e,"default"))return bo(e.default)}}function yc(e,t){if(Object.hasOwn(e,t))return{value:e[t],capture:null};let n=Object.keys(e).filter(s=>s.includes("*")).sort((s,r)=>r.indexOf("*")-s.indexOf("*")||r.length-s.length);for(let s of n){let[r,o]=s.split("*");if(!t.startsWith(r)||!t.endsWith(o)||t.length<r.length+o.length)continue;let i=t.slice(r.length,o?-o.length:void 0);return{value:e[s],capture:i}}return null}function bc(e,t){let n=yc(e,t),s=n&&bo(n.value);return s&&n.capture!==null?s.replaceAll("*",n.capture):s}function Jm(e,t,n,{exportsMap:s,readSource:r},o,i=!1){if(typeof t!="string"||t!=="."&&!t.startsWith("./")||t.split("/").some(h=>h===".."))return o.push(`${e}: ${n} is not a package export`),null;if(t.includes("*"))return o.push(`${e}: ${n} must name one exact export, not a pattern`),null;let a=bc(s,t);if(!a)return o.push(`${e}: ${n} is not a package export`),null;let l=(i?/^\.\/dist\/(.+)\.css$/:/^\.\/dist\/(.+)\.js$/).exec(a);if(!l)return o.push(`${e}: ${n} does not resolve to a built ${i?"CSS stylesheet":"JavaScript module"}`),null;let u=`src/${l[1]}.${i?"css":"ts"}`,m=r(u);return typeof m!="string"?(o.push(`${e}: ${n} has no ${i?"CSS":"TypeScript"} source at ${u}`),null):{sourcePath:u,source:m}}function fc(e,t,n){let s=e.findLast(r=>r.end<=n);return!s||!/^\s*$/.test(t.slice(s.end,n))?null:s.value}function Gm({sourcePath:e,source:t}){let n=go(e,t);if(n.errors.length)return null;let s=n.comments.filter(o=>o.type==="Block"&&o.value.startsWith("*")),r=new Map;for(let o of n.module.staticExports)for(let i of o.entries){let a=i.exportName?.name;if(!a)continue;let l=fc(s,t,i.start)??fc(s,t,o.start)??"";r.set(a,{isType:i.isType===!0,deprecated:/@deprecated\b/.test(l)})}return r}function Ym(e,t,n,s){let r=Gm(t);return r||s.push(`${e}: ${n} source ${t.sourcePath} does not parse`),r}function Zm(e,t){let n=go(e.sourcePath,e.source);if(n.errors.length)return null;let s=!1,r=c(o=>{if(!(!o||typeof o!="object"||s))if((o.type==="Literal"||o.type==="StringLiteral")&&o.value===t)s=!0;else for(let[i,a]of Object.entries(o))i!=="comments"&&(Array.isArray(a)?a.forEach(r):a&&typeof a=="object"&&r(a))},"visit");return r(n.program),s}function yn(e,{packageJson:t,readSource:n=Um,exportDeprecations:s=[]}){let r={status:"invalid",sourcePath:null,isType:null,deprecated:null,findings:[]},o=Hm(e);if(!Vm.includes(e?.kind))return r.findings.push(`${o}: unsupported export kind`),r;let i=e.kind==="entry-point"||e.kind==="stylesheet",a=i?e.name:e.module;if(typeof a!="string"||a!=="."&&!a.startsWith("./")||a.includes("*")||a.split("/").some(f=>f===".."))return r.findings.push(`${o}: must name one exact package export`),r;if(typeof e.name!="string"||!e.name)return r.findings.push(`${o}: contract name is required`),r;let l=$o.includes(e.kind);if(l&&!(e.kind==="window-event"?/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/:/^data-lr-[a-z0-9]+(?:-[a-z0-9]+)*$/).test(e.name))return r.findings.push(`${o}: invalid ${e.kind} name`),r;let u=t?.exports;if(!u||typeof u!="object"||Array.isArray(u))return r.findings.push(`${o}: a current package exports map is required`),r;let m=yc(u,a),h=m&&bc(u,a);if(!m||h===null)return{...r,status:"absent"};if(typeof h!="string"||!h)return r.findings.push(`${o}: package export conditions cannot be resolved`),r;let g=Jm(o,a,a,{exportsMap:u,readSource:n},r.findings,e.kind==="stylesheet");if(!g)return r;r.sourcePath=g.sourcePath;let y=s.some(f=>f.kind===e.kind&&f.name===e.name&&(f.module??null)===(e.module??null));if(e.kind==="stylesheet")return{...r,status:"present",deprecated:y};if(l){let f=Zm(g,e.name);if(f===null)r.findings.push(`${o}: source ${g.sourcePath} does not parse`);else return{...r,status:f?"present":"absent",deprecated:f?y:null};return r}let $=Ym(o,g,a,r.findings);if(!$)return r;if(i)return{...r,status:"present",deprecated:y};let w=$.get(e.name);return w?{...r,status:"present",isType:w.isType,deprecated:w.deprecated||y}:{...r,status:"absent"}}var _h,Ih,hc,$o,Vm,qm,Wm,Bs=_e(()=>{"use strict";mc();_h=Object.freeze(["stable","experimental"]),Ih=Object.freeze(["background","color","inline-size"]),hc=Object.freeze(["type","function","constant","class"]),$o=Object.freeze(["window-event","root-attribute"]),Vm=Object.freeze(["entry-point","stylesheet",...hc,...$o]),qm=yo.resolve(yo.dirname(Bm(import.meta.url)),".."),Wm=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?$/;c(Km,"compareText");c(dc,"parseVersion");c(gc,"compareVersions");c(Um,"defaultReadSource");c(Hm,"exportDeprecationLabel");c(bo,"exportTarget");c(yc,"resolveExportMapping");c(bc,"resolveExportTarget");c(Jm,"exportSource");c(fc,"leadingJsDoc");c(Gm,"moduleExportsByName");c(Ym,"moduleExportsOrFinding");c(Zm,"moduleContainsContract");c(yn,"inspectExportContract")});function le(e,t){if(!e)throw new Error(t)}function Re(e){let t=typeof e=="string"&&Qm.exec(e);return le(t,`Expected a stable published version, received ${String(e)}`),t.slice(1).map(Number)}function it(e,t){let n=Re(e),s=Re(t);for(let r=0;r<3;r++)if(n[r]!==s[r])return n[r]-s[r];return 0}function wc(e){if(e&&typeof e=="object"){for(let t of Object.values(e))wc(t);Object.freeze(e)}return e}function we(e){le(Vs(e),"Invalid compatibility identity");let t=c(n=>typeof n=="string"&&!/[\u0000-\u001f]/u.test(n),"text");return e.scope==="member"?(le(/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(e.tag)&&$c.has(e.kind)&&t(e.name)&&(e.name.length>0||["slot","slot-content"].includes(e.kind)),"Invalid member identity"),JSON.stringify(["member",e.tag,e.kind,e.name])):(le(e.scope==="export"&&Xm.has(e.kind)&&t(e.name)&&e.name.length>0&&(e.module==null||t(e.module)&&e.module.length>0),"Invalid export identity"),JSON.stringify(["export",e.kind,e.module??null,e.name]))}function Pe(e,t="member"){return t==="member"?{scope:t,tag:e.tag,kind:e.kind,name:e.name}:{scope:t,kind:e.kind,module:e.module??null,name:e.name}}function Ws(e,t){let n=new Map,s=c(o=>n.set(we(Pe(o,"export")),o),"add"),r=new Set(e.exportDeprecations.map(o=>we(Pe(o,"export"))));for(let o of e.exportDeprecations)s(o);for(let o of t)for(let i of o.records)i.key.scope!=="export"||r.has(we(i.key))||(s(i.policy),s({...i.policy.replacement,module:i.policy.replacement.module??i.policy.module}));return[...n.values()]}function Rt(e,t,n){return t==="component"?e?{name:e.tag,deprecated:!!e.maturity?.deprecated}:null:e?.surface?.[Qn[t==="slot-content"?"slot":t]]?.find(s=>s.name===n)??null}function vc(e){let t=[...e.maturity?.deprecations??[]];return e.maturity?.deprecated&&!t.some(n=>n.kind==="component")&&t.push(e.maturity.deprecated),t}function bn(e,t,n){let s=Object.create(null);for(let r of e){let o=t(r);le(!Object.hasOwn(s,o),`Duplicate ${n}: ${o}`),s[o]=r}return s}function ed({metadata:e,packageJson:t,readSource:n}){let s=new Map;for(let r of e.exportDeprecations){if(Re(r.removalNotBefore)[0]>Re(t.version)[0]+1)continue;let o={...r.replacement,module:r.replacement.module??r.module},i=Pe(o,"export"),a=yn(o,{packageJson:t,readSource:n,exportDeprecations:e.exportDeprecations});le(a.status==="present"&&!a.deprecated,`Published replacement export is unavailable: ${we(i)}`),s.set(we(i),{key:i,sourcePath:a.sourcePath,isType:a.isType,deprecated:a.deprecated})}return[...s.values()]}function Ec({metadata:e,inventory:t,packageJson:n,renameLedger:s,manifest:r,exportSources:o={}},i=1){le(i===1,`Unsupported compatibility reader ${i}`),le(e?.schemaVersion===2&&t?.schemaVersion===1&&s?.schemaVersion===1&&r?.schemaVersion==="1.0.0","Unsupported published input schema");let a=n?.version;Re(a),le(n.name==="@aceshooting/lyra-ui"&&t.pins?.lyraVersion===a&&e.history?.current?.version===a,"Published input versions disagree");let l=t.components.map(p=>({tag:p.tag,maturity:{deprecated:Xt(p.maturity?.deprecated??null),deprecations:Xt(p.maturity?.deprecations??[])},surface:Object.fromEntries(Object.values(Qn).map(A=>[A,(p.surface?.[A]??[]).map(k=>Object.fromEntries(["name","type","attribute","property","reflects","hasDefault","default","deprecated"].filter(N=>Object.hasOwn(k,N)).map(N=>[N,N==="deprecated"?!!k[N]:Xt(k[N])])))]))})),u=bn(l,p=>p.tag,"published owner"),m=[...e.deprecations.map(p=>({key:Pe(p),policy:Xt(p)})),...e.exportDeprecations.map(p=>({key:Pe(p,"export"),policy:Xt(p)}))];bn(m,p=>we(p.key),"published policy");for(let{key:p,policy:A}of m)if(Re(A.since),Re(A.removalNotBefore),le(it(A.since,a)<=0,"Published notice predates its release incorrectly"),p.scope==="member"){let k=vc(u[p.tag]??{}).find(N=>we(Pe(N))===we(p));le(k&&qs(k,A),`Published inventory policy disagrees: ${we(p)}`),le(Rt(u[p.tag],p.kind,p.name),`Published source member missing: ${we(p)}`)}let h=Object.fromEntries(Xn.map(p=>[p,Object.create(null)]));for(let p of l)for(let A of Xn)for(let k of p.surface[Qn[A]])(h[A][k.name]??=[]).push(p.tag);for(let p of Object.values(h))for(let A of Object.values(p))A.sort();let g=new Set(m.filter(p=>p.key.scope==="member").flatMap(({key:p,policy:A})=>[we(p),...A.attribute?[we({...p,kind:"attribute",name:A.attribute})]:[]])),y=[...ms(t)].map(([p,A])=>{let[k,N,O]=p.split("\0");return{tag:k,kind:N,name:O,upstreamTag:A}}).filter(p=>g.has(we(Pe(p)))),$=l.map(({tag:p,surface:A})=>({tag:p,surface:A})),f=m.filter(p=>Re(p.policy.removalNotBefore)[0]===Re(a)[0]+1&&Re(p.policy.since)[0]<Re(a)[0]).map(p=>p.policy.since).sort(it)[0],E=f?(e.history.releases??[]).filter(p=>it(p.version,f)>=0&&it(p.version,a)<0).map(({tag:p,version:A,sourceCommit:k})=>({tag:p,version:A,sourceCommit:k})):[];return{schemaVersion:1,sourceRelease:`lyra-ui@${a}`,sourceVersion:a,records:m,components:$,mirrors:y,exposure:h,renameLedger:Xt(s),policyReleaseHistory:E,publishedExports:ed({metadata:e,packageJson:n,readSource:c(p=>(le(Object.hasOwn(o,p),`Missing published export source ${p}`),o[p]),"readSource")})}}function Ks({packageVersion:e,releaseVersion:t=e,successors:n=[],currentInventory:s,currentExportDeprecations:r=[],currentExportSurface:o=null,componentRegistrationRoutes:i={},captures:a=[],retirementIndex:l=[]}){Re(e),Re(t),le(Array.isArray(a)&&Array.isArray(l),"Compatibility captures and retirements must be arrays");let u=bn(s.components,x=>x.tag,"current owner");le(Vs(i),"Current component registration routes must be an object");for(let[x,I]of Object.entries(i))le(u[x],`Registration route references an unknown current component: ${x}`),le(I===`./components/${x}.js`,`Registration route is not the stable tag-shaped route for ${x}`);let m=bn([...s.components.flatMap(x=>vc(x).map(I=>({key:Pe(I),policy:I}))),...r.map(x=>({key:Pe(x,"export"),policy:x}))],x=>we(x.key),"current policy"),h=bn(o??[],x=>we(x.key),"current export surface"),g=bn(l,x=>we(x.key),"retirement"),y=new Set([...ms(s)].map(([x])=>{let[I,C,P]=x.split("\0");return we(Pe({tag:I,kind:C,name:P}))})),$=c(x=>p.has(x)&&y.has(x),"protectedMirror"),w=Object.create(null),f=Object.create(null),E=new Map,p=new Set,A=Object.fromEntries(Xn.map(x=>[x,Object.create(null)])),k=c((x,I,C)=>{A[x][I]=[...new Set([...A[x][I]??[],...C])].sort()},"addExposure");for(let x of a){Re(x.sourceVersion),le(x.sourceRelease===`lyra-ui@${x.sourceVersion}`&&it(x.sourceVersion,e)<=0,"Invalid published capture version"),le(!E.has(x.sourceRelease),`Duplicate published capture: ${x.sourceRelease}`),E.set(x.sourceRelease,x);for(let I of x.components){let C=f[I.tag];(!C||it(x.sourceVersion,C.version)>0)&&(f[I.tag]={version:x.sourceVersion,component:I})}for(let I of x.mirrors)p.add(we(Pe(I)));for(let I of Xn)for(let[C,P]of Object.entries(x.exposure[I]))k(I,C,P);for(let I of x.records){let C=we(I.key);Re(I.policy.since),Re(I.policy.removalNotBefore),le(it(I.policy.since,x.sourceVersion)<=0,`Unpublished policy: ${C}`),le(!w[C]||qs(w[C].policy,I.policy),`Conflicting published policy: ${C}`),w[C]??={...I,sources:[]},w[C].sources.push(x.sourceRelease)}}for(let x of s.components)for(let I of Xn)for(let C of x.surface?.[Qn[I]]??[])k(I,C.name,[x.tag]);let N=Object.create(null),O=Object.create(null),q=c(x=>{if(u[x])return x;let I=we({scope:"member",tag:x,kind:"component",name:x}),C=w[I]?.policy,P=g[I];return le(C?.replacement?.kind==="component"&&P&&it(t,P.removedIn)>=0&&u[C.replacement.name],`Historical owner ${x} has no current supported replacement`),C.replacement.name},"effectiveOwner"),b=c((x,I,C)=>{if(typeof x!="string"||!$c.has(I)||typeof C!="string")return null;let P=we({scope:"member",tag:x,kind:I,name:C}),M=n.find(_=>we({scope:"member",..._.key})===P);if(M&&!Rt(u[x],I,C))return M.replacement;let R=w[P];return R&&g[P]&&!Rt(u[x],I,C)&&Vs(R.policy.replacement)&&R.policy.replacement.kind!=="host-css-property"?R.policy.replacement:null},"retiredSuccessor"),j=c((x,I,C)=>{for(let P=0;P<8;P++){let M=Rt(u[x],I,C);if(M)return M;let R=b(x,I,C);if(!R)return;R.kind==="component"&&(x=R.name),I=R.kind,C=R.name}},"resolveMember"),d=c((x,I,C)=>{let P=new Set;for(;;){let M=we({scope:"member",tag:x,kind:I,name:C});if(P.has(M))return!1;P.add(M);let R=Rt(u[x],I,C);if(!R){let W=b(x,I,C);if(!W)return!1;W.kind==="component"&&(x=W.name),I=W.kind,C=W.name;continue}if(!R.deprecated)return!0;let _=m[M]?.policy?.replacement;if(!_||_.kind==="host-css-property")return!1;_.kind==="component"&&(x=_.name),I=_.kind,C=_.name}},"hasSupportedMemberSuccessor");for(let[x,I]of Object.entries(w)){let{key:C,policy:P,sources:M}=I,R=m[x],_=g[x],W=C.scope==="member"?Rt(u[C.tag],C.kind,C.name):h[x];if(R)le(qs(R.policy,P),`The published policy has changed: ${x}`),(C.scope==="member"||o!==null)&&le(W,`Current notice references a missing source member or export: ${x}`),N[x]={state:"current",key:C,policy:P,sourceMember:W,sourceOwner:C.tag??null};else{C.scope==="member"&&C.kind==="property"&&P.attribute&&le(!Rt(u[C.tag],"attribute",P.attribute),`Current notice is missing for surviving paired attribute: ${x}`),le(!W||C.kind==="slot-content",`Current notice is missing for surviving source: ${x}`),le(_,`Missing retirement record: ${x}`),le(M.includes(_.sourceRelease),`Retirement has no exact published source: ${x}`);let ee=E.get(_.sourceRelease),ae=C.scope==="member"?ee?.components.find(ze=>ze.tag===C.tag)??null:null,pe=C.scope==="member"&&ae?Rt(ae,C.kind,C.name):null;C.scope==="member"&&(le(ae,`Retirement has no exact published source component: ${x}`),le(pe,`Retirement has no exact published source member: ${x}`)),le(it(t,_.removedIn)>=0,`Cannot remove ${x} before ${_.removedIn}`),le(it(_.removedIn,P.removalNotBefore)>=0&&Re(P.removalNotBefore)[0]>=Re(P.since)[0]+2,`Retirement violates published floor: ${x}`);let de=C.scope==="member"&&C.kind==="property"&&P.attribute?we({...C,kind:"attribute",name:P.attribute}):null;le(!$(x)&&(!de||!$(de)),`Protected upstream mirrored member cannot retire: ${x}`),C.kind==="slot-content"&&le(W,`Retired slot content requires its surviving public slot: ${x}`);let he=P.replacement;le(Vs(he),`Missing replacement: ${x}`);let Ne,Se=null;if(C.scope==="member")Se=he.kind==="component"?he.name:q(C.tag),Ne=j(Se,he.kind,he.name),he.kind==="host-css-property"&&["background","color","inline-size"].includes(he.name)&&(Ne={name:he.name});else{let ze=Pe({...he,module:he.module??P.module},"export");Ne=h[we(ze)]}let ke=a.some(ze=>{if(!M.includes(ze.sourceRelease)||Re(ze.sourceVersion)[0]<Re(P.removalNotBefore)[0]-1)return!1;if(C.scope==="export"){let qe=we(Pe({...he,module:he.module??P.module},"export"));return ze.publishedExports?.some(T=>we(T.key)===qe&&!T.deprecated)}if(he.kind==="host-css-property")return["background","color","inline-size"].includes(he.name);let Vt=ze.components.find(qe=>qe.tag===Se),Ot=Rt(Vt,he.kind,he.name);return he.kind==="component"&&ze.records.some(qe=>qe.key.scope==="member"&&qe.key.kind==="component"&&qe.key.tag===Vt?.tag)?!1:Ot&&!Ot.deprecated});le(ke,`Replacement was not available in the published compatibility window: ${x}`);let ut=C.scope==="member"&&he.kind!=="host-css-property"?d(Se,he.kind,he.name):Ne&&!Ne.deprecated;le(Ne&&ut,`Missing current supported replacement: ${x}`),N[x]={state:"retired",key:C,policy:P,removedIn:_.removedIn,sourceComponent:ae,sourceMember:pe,sourceOwner:C.tag??null,replacementOwner:Se,replacementMember:Ne}}if(C.scope==="member"&&C.kind==="property"&&P.attribute){let ee=we({...C,kind:"attribute",name:P.attribute});le(!w[ee]||qs(w[ee].policy,P),`Paired attribute policy collision: ${ee}`),le(!O[ee]||O[ee]===x,`Paired attribute identity collision: ${ee}`),O[ee]=x}}for(let[x,I]of Object.entries(g)){le(w[x],`Retirement has no published record: ${x}`),Re(I.removedIn);let C=w[x];le(C.sources.includes(I.sourceRelease),`Retirement has no exact published source: ${x}`),le(it(I.removedIn,C.policy.removalNotBefore)>=0&&Re(C.policy.removalNotBefore)[0]>=Re(C.policy.since)[0]+2,`Retirement violates published floor: ${x}`);let P=C.key.scope==="member"&&C.key.kind==="property"&&C.policy.attribute?we({...C.key,kind:"attribute",name:C.policy.attribute}):null;le(!$(x)&&(!P||!$(P)),`Protected upstream mirrored member cannot retire: ${x}`)}return wc(Xt({schemaVersion:1,packageVersion:e,componentRegistrationRoutes:i,records:N,aliases:O,exposure:A,successors:n,sourceComponents:Object.fromEntries(Object.entries(f).map(([x,I])=>[x,I.component]))}))}var Qn,Xn,$c,Xm,Qm,Vs,qs,Xt,wo=_e(()=>{"use strict";Bs();Tn();Qn=Object.freeze({attribute:"attributes",property:"properties",event:"events",part:"parts","css-property":"cssProperties",slot:"slots","css-state":"cssStates",method:"methods"}),Xn=["event","part","css-property"],$c=new Set([...Object.keys(Qn),"component","slot-content"]),Xm=new Set(["entry-point","stylesheet","function","type","constant","class","window-event","root-attribute"]),Qm=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u,Vs=c(e=>e!==null&&typeof e=="object"&&!Array.isArray(e),"plain"),qs=c((e,t)=>JSON.stringify(e)===JSON.stringify(t),"same"),Xt=c(e=>structuredClone(e),"clone");c(le,"requireThat");c(Re,"version");c(it,"compare");c(wc,"freeze");c(we,"compatibilityKey");c(Pe,"policyKey");c(Ws,"compatibilityExportCandidates");c(Rt,"member");c(vc,"policies");c(bn,"index");c(ed,"publishedExportSurface");c(Ec,"extractPublishedCompatibility");c(Ks,"assembleCompatibilityContext")});import Oe from"node:fs";import At from"node:path";function ht(e,t){if(!e)throw new Error(t)}function xc(e,t){let n=JSON.parse(e),s=e.match(/"(?:\\.|[^"\\])*"|[{}[\]:,]|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/g),r=0;function o(){let i=s[r++];if(i==="{"){let a=new Set;for(;s[r]!=="}";){let l=JSON.parse(s[r++]);ht(!a.has(l),`${t}: duplicate JSON key ${l}`),a.add(l),r++,o(),s[r]===","&&r++}r++}else if(i==="["){for(;s[r]!=="]";)o(),s[r]===","&&r++;r++}}return c(o,"value"),o(),n}function Qt(e,t,{missing:n=!1,directory:s=!1}={}){ht(At.isAbsolute(e)&&Oe.realpathSync(e)===e,"Source root must be an absolute directory without symlinks");let r=At.relative(e,t);ht(r&&!r.startsWith(`..${At.sep}`)&&r!==".."&&!At.isAbsolute(r),`Path escapes package: ${t}`);let o=e,i=r.split(At.sep);for(let a=0;a<i.length;a++){o=At.join(o,i[a]);let l=a===i.length-1;if(l&&n&&!Oe.existsSync(o))try{Oe.lstatSync(o)}catch(m){if(m.code==="ENOENT")return;throw m}let u=Oe.lstatSync(o);ht(!u.isSymbolicLink()&&(l&&!s?u.isFile():u.isDirectory()),`Not a regular ${l&&!s?"file":"directory"} (symlinks forbidden): ${o}`)}}function ct(e,t,{missing:n=!1,binary:s=!1}={}){let r=At.join(e,t);Qt(e,r,{missing:n});let o;try{o=Oe.openSync(r,Oe.constants.O_RDONLY|Oe.constants.O_NOFOLLOW)}catch(i){if(n&&i.code==="ENOENT")return Qt(e,r,{missing:!0}),{file:r,original:null};throw i}try{return ht(Oe.fstatSync(o).isFile(),`Not a regular source file: ${r}`),{file:r,original:Oe.readFileSync(o,s?void 0:"utf8")}}finally{Oe.closeSync(o)}}function Sc(e){ht(new Set(e.entries.map(i=>i.file)).size===e.entries.length,"Duplicate source write path");for(let i of e.entries){if(Buffer.isBuffer(i.original)||Buffer.isBuffer(i.expected)){ht(Buffer.isBuffer(i.original)&&i.expected===i.original,`Binary source guards must be read-only: ${i.file}`);continue}ht((typeof i.original=="string"||i.original===null)&&(typeof i.expected=="string"||i.expected===null),`Invalid source write bytes: ${i.file}`),ht(i.expected!==null||i.original===null,`Source write plans cannot delete files: ${i.file}`)}let t=c(i=>{let a=Buffer.isBuffer(i.original),l=ct(e.root,At.relative(e.root,i.file),{missing:i.original===null,binary:a}).original;ht(a?l.equals(i.original):l===i.original,`${i.file}: changed while source fixtures were being prepared`)},"check");e.entries.forEach(t);let n=[],s=[],r,o=[];try{for(let i of e.entries.filter(a=>a.original!==a.expected)){let a=`${i.file}.source-${process.pid}-${n.length}`,l=Oe.openSync(a,"wx",i.original===null?420:Oe.statSync(i.file).mode);n.push({...i,temporary:a});try{Oe.writeFileSync(l,i.expected)}finally{Oe.closeSync(l)}}e.entries.forEach(t);for(let i of n)t(i),Oe.renameSync(i.temporary,i.file),s.push(i)}catch(i){r=i;for(let a of s.reverse())try{if(ct(e.root,At.relative(e.root,a.file),{missing:!0}).original!==a.expected)continue;if(a.original===null)Oe.unlinkSync(a.file);else{let u=Oe.openSync(a.temporary,"wx",Oe.statSync(a.file).mode);try{Oe.writeFileSync(u,a.original)}finally{Oe.closeSync(u)}Qt(e.root,a.file),Oe.renameSync(a.temporary,a.file)}}catch(l){o.push(l)}}finally{for(let i of n)try{Qt(e.root,i.temporary,{missing:!0}),Oe.rmSync(i.temporary,{force:!0})}catch(a){o.push(a)}}if(o.length)throw new AggregateError([...r?[r]:[],...o],`${r?.message??"Source cleanup failed"}; some concurrent paths could not be restored or cleaned`);if(r)throw r}var Us=_e(()=>{"use strict";c(ht,"invariant");c(xc,"parseSourceJson");c(Qt,"assertRegularSourcePath");c(ct,"readSourceSnapshot");c(Sc,"commitSourceWritePlan")});var Ac={};Jo(Ac,{assembleComponentMetadata:()=>$n,commitComponentMetadataWritePlan:()=>od,componentMetadataSourceFindings:()=>sd,createComponentMetadataWritePlan:()=>rd,partitionComponentMetadata:()=>Rc,readComponentMetadataSources:()=>xo});import es from"node:fs";import gt from"node:path";import{fileURLToPath as td}from"node:url";function Ee(e,t){if(!e)throw new Error(t)}function Dt(e,t,n){Ee(e&&typeof e=="object"&&!Array.isArray(e),`${n}: expected an object`);for(let s of Object.keys(e))Ee(t.includes(s),`${n}: unexpected key ${s}`);for(let s of t)Ee(Object.hasOwn(e,s),`${n}: missing key ${s}`)}function xo(e=nd){e=gt.resolve(e),Ee(es.realpathSync(e)===e,"Metadata package root must not traverse symlinks");let t=[],n=c(w=>{let f=ct(e,w);return t.push(f),xc(f.original,w)},"read"),s=n("scripts/component-families.json"),r=n("scripts/fixtures/component-inventory.json"),o=s.families.map(w=>w.key);Ee(o.every(w=>/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(w))&&new Set(o).size===o.length,"Invalid or duplicate family names");let i=Object.fromEntries((r.components??[]).map(w=>[w.tag,w.family]));for(let[w,f]of Object.entries(s.directories??{})){let E=`lr-${w}`;Object.hasOwn(i,E)?Ee(i[E]===f,`${E}: catalog and inventory family differ`):i[E]=f}let a=["policy.json","profiles.json","exports.json","history.json","families"],l=gt.join(e,en);Qt(e,l,{directory:!0}),Ee(JSON.stringify(es.readdirSync(l).sort())===JSON.stringify(a.sort()),"Unexpected or missing metadata source files"),Qt(e,gt.join(l,"families"),{directory:!0}),Ee(JSON.stringify(es.readdirSync(gt.join(l,"families")).sort())===JSON.stringify(o.map(w=>`${w}.json`).sort()),"Unexpected or missing metadata family files");let u=n(`${en}/policy.json`),m=n(`${en}/profiles.json`),h=n(`${en}/exports.json`),g=n(`${en}/history.json`);Dt(u,["schemaVersion","metadataSchemaVersion","policy"],"policy.json"),Dt(m,["profiles"],"profiles.json"),Dt(h,["exportDeprecations"],"exports.json"),Dt(g,["history"],"history.json"),Ee(u.schemaVersion===1&&u.metadataSchemaVersion===2,"Unsupported metadata source schema");let y=o.map(w=>n(`${en}/families/${w}.json`));y.forEach((w,f)=>Ee(w.family===o[f],`${o[f]}: family file owner differs`));for(let w of y)for(let f of Object.values(w.assignments??{}).flat()){if(typeof f!="string"||Object.hasOwn(i,f)||!/^lr-[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(f))continue;let E=[];for(let[p,A]of Object.entries(s.directories??{})){let k=`src/components/${A}/${p}/${f.slice(3)}.class.ts`,N=`src/components/${f}.ts`;if(!es.existsSync(gt.join(e,k))||!es.existsSync(gt.join(e,N)))continue;let O=ct(e,k),q=ct(e,N);if(!O.original.split(`
3
- `).some(d=>d.trim()===`* @customElement ${f}`))continue;let b=O.original.match(/^export class ([A-Za-z_$][\w$]*)\b/m)?.[1],j=q.original.split(`
4
- `).map(d=>d.trim());!b||!j.includes(`import { ${b} } from './${A}/${p}/${f.slice(3)}.class.js';`)||!j.includes(`defineElement('${f.slice(3)}', ${b});`)||(t.push(O,q),E.push(A))}Ee(E.length<=1,`${f}: ambiguous source family owner`),E.length===1&&(i[f]=E[0])}t.push(ct(e,vo,{missing:!0}));let $={packageDir:e,schemaVersion:u.metadataSchemaVersion,policy:u.policy,profiles:m.profiles,exportDeprecations:h.exportDeprecations,history:g.history,familyNames:o,familyByTag:i,families:y,snapshots:t};return $n($),$}function $n(e){let t=Object.fromEntries(Object.keys(e.profiles).map(a=>[a,[]])),n=[],s=new Set,r=new Set,o=new Set;for(let a of e.families){Dt(a,["family","assignments","deprecations"],"family metadata"),Ee(e.familyNames.includes(a.family)&&!o.has(a.family),`Invalid or duplicate family ${a.family}`),o.add(a.family);let l=c(u=>Ee(e.familyByTag[u]===a.family,`${u}: expected family ${String(e.familyByTag[u])}, found ${a.family}`),"own");Dt(a.assignments,Object.keys(e.profiles),`${a.family} assignment profiles`);for(let[u,m]of Object.entries(a.assignments)){Ee(Array.isArray(m),`${u}: assignments must be an array`);for(let h of m)l(h),Ee(!s.has(h),`${h}: duplicate maturity assignment`),s.add(h),t[u].push(h)}Ee(Array.isArray(a.deprecations),`${a.family}: deprecations must be an array`);for(let u of a.deprecations){l(u.tag);let m=JSON.stringify([u.tag,u.kind,u.name]);Ee(!r.has(m),`${m}: duplicate member notice`),r.add(m),n.push(u)}}Ee(o.size===e.familyNames.length,"Missing metadata family");for(let a of Object.values(t))a.sort(kc);n.sort((a,l)=>kc(Tc(a),Tc(l))),Ee(Array.isArray(e.exportDeprecations),"exportDeprecations must be an array");let i=new Set;for(let a of e.exportDeprecations){let l=JSON.stringify([a.kind,a.module??null,a.name]);Ee(!i.has(l),`${l}: duplicate export notice`),i.add(l)}return Ee(e.history&&typeof e.history=="object"&&!Array.isArray(e.history),"history must be an object"),structuredClone({schemaVersion:e.schemaVersion,policy:e.policy,profiles:e.profiles,assignments:t,deprecations:n,exportDeprecations:e.exportDeprecations,history:e.history})}function Rc(e,{familyNames:t,familyByTag:n}){Dt(e,["schemaVersion","policy","profiles","assignments","deprecations","exportDeprecations","history"],"metadata"),Ee(e.schemaVersion===2,"Unsupported metadata aggregate schema"),Dt(e.assignments,Object.keys(e.profiles),"metadata assignments");let s=t.map(i=>({family:i,assignments:Object.fromEntries(Object.keys(e.profiles).map(a=>[a,[]])),deprecations:[]})),r=c(i=>{let a=s.find(l=>l.family===n[i]);return Ee(a,`${i}: missing metadata family owner`),a},"owner");for(let[i,a]of Object.entries(e.assignments))for(let l of a)r(l).assignments[i].push(l);for(let i of e.deprecations)r(i.tag).deprecations.push(i);let o=$n({...e,families:s,familyNames:t,familyByTag:n});return Ee(JSON.stringify(o)===JSON.stringify(e),"Metadata aggregate is not in canonical source order"),Object.fromEntries([["policy.json",{schemaVersion:1,metadataSchemaVersion:e.schemaVersion,policy:e.policy}],["profiles.json",{profiles:e.profiles}],["exports.json",{exportDeprecations:e.exportDeprecations}],["history.json",{history:e.history}],...s.map(i=>[`families/${i.family}.json`,i])].map(([i,a])=>[`${en}/${i}`,Eo(a)]))}function sd(e){return e.snapshots.find(n=>n.file===gt.join(e.packageDir,vo))?.original===Eo($n(e))?[]:["component-metadata.json differs from its authored sources"]}function rd(e,t,{extraWrites:n=[],guards:s=[],includeAggregate:r=!0,familyByTag:o=e.familyByTag}={}){let i=Rc(t,{...e,familyByTag:o});r&&(i[vo]=Eo(t));let a=new Map(e.snapshots.map(l=>[l.file,{...l,expected:l.original}]));for(let l of s)Ee(!a.has(l.file)||a.get(l.file).original===l.original,`Conflicting snapshot: ${l.file}`),a.set(l.file,{...l,expected:l.original});for(let[l,u]of Object.entries(i)){let m=gt.join(e.packageDir,l);Ee(a.has(m),`Missing source snapshot: ${m}`),a.get(m).expected=u}for(let l of n)Ee(!a.has(l.file)||a.get(l.file).original===l.original,`Conflicting snapshot: ${l.file}`),a.set(l.file,{...l});return{packageDir:e.packageDir,entries:[...a.values()]}}function od(e){Sc({root:e.packageDir,entries:e.entries})}var nd,en,vo,Eo,kc,Tc,So=_e(()=>{"use strict";Us();nd=gt.resolve(gt.dirname(td(import.meta.url)),".."),en="scripts/fixtures/component-metadata",vo="scripts/fixtures/component-metadata.json",Eo=c(e=>`${JSON.stringify(e,null,2)}
5
- `,"render"),kc=c((e,t)=>String(e).localeCompare(String(t)),"compare"),Tc=c(e=>`${e.tag}:${e.kind}:${e.name}`,"memberKey");c(Ee,"invariant");c(Dt,"keys");c(xo,"readComponentMetadataSources");c($n,"assembleComponentMetadata");c(Rc,"partitionComponentMetadata");c(sd,"componentMetadataSourceFindings");c(rd,"createComponentMetadataWritePlan");c(od,"commitComponentMetadataWritePlan")});import{createHash as Cc}from"node:crypto";import{gzipSync as ad,gunzipSync as id}from"node:zlib";import{readFileSync as cd}from"node:fs";import{join as ko}from"node:path";function ud(e){let t=e.filter(n=>n===Oc.migrationContract||n===_c);if(t.length!==1)throw new Error("Missing or duplicate packed input for the migration contract");return{...Oc,migrationContract:t[0]}}function ne(e,t){if(!e)throw new Error(t)}function tn(e){ne(typeof e=="string"&&e.length<=To,"Invalid evidence base64");let t=Buffer.from(e,"base64");return ne(t.toString("base64")===e,"Noncanonical evidence base64"),t}function Ic(e){return ad(De(e),{level:9})}function wn(e,t=To){return ne(e.length<=To,"Compressed evidence exceeds size limit"),JSON.parse(id(e,{maxOutputLength:t}).toString("utf8"))}function Mc(e,t){return ne(me(t)===e?.evidenceArchiveSha256,"Evidence archive hash mismatch"),wn(t)}function ts(e,t){return ne(["blob","tree","commit","tag"].includes(e),"Unsupported Git object type"),Cc("sha1").update(`${e} ${t.length}\0`).update(t).digest("hex")}function Ro(e){let t=new Map,n=0;for(;n<e.length;){let s=e.indexOf(32,n),r=e.indexOf(0,s+1);ne(s>n&&r>s&&r+21<=e.length,"Malformed Git tree");let o=e.subarray(n,s).toString("ascii"),i=e.subarray(s+1,r).toString("utf8");ne(!t.has(i)&&i!=="."&&i!==".."&&!i.includes("/"),"Invalid Git tree entry"),t.set(i,{mode:o,oid:e.subarray(r+1,r+21).toString("hex")}),n=r+21}return t}function Hs({pin:e,objects:t,inputs:n}){ne(Nc.test(e?.commit)&&Nc.test(e?.tagObject),"Invalid pinned Git identity");let s=new Map,r=new Set;for(let u of t){let m=tn(u.data);ne(!s.has(u.oid)&&ts(u.type,m)===u.oid,"Duplicate or corrupt Git object"),s.set(u.oid,{type:u.type,bytes:m})}let o=c((u,m)=>{let h=s.get(u);return ne(h?.type===m,`Missing ${m} Git object ${u}`),r.add(u),h.bytes},"get"),i=o(e.tagObject,"tag").toString("utf8").split(`
2
+ var na=Object.defineProperty;var c=(e,t)=>na(e,"name",{value:t,configurable:!0});var ke=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var ra=(e,t)=>{for(var n in t)na(e,n,{get:t[n],enumerable:!0})};function Ke(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Le(e,t){return Object.keys(e).filter(n=>!t.includes(n))}function it(e,t){return e<t?-1:e>t?1:0}function We(e){let t=zl.exec(String(e??""));return t?t.slice(1,4).map(Number):null}function at(e,t){let n=We(e),r=We(t);if(!n||!r)return null;for(let s=0;s<3;s+=1)if(n[s]!==r[s])return n[s]-r[s];return 0}function fs(e){return We(e)?.[0]??null}function ql(){return{schemaVersion:1,profiles:ms.map(e=>({...e,...Object.fromEntries(mr.filter(t=>!["detailFields","globals"].includes(t)).map(t=>[t,[]]))}))}}function pa(){return{schemaVersion:1,profiles:ql().profiles.map(e=>({...e,exposure:Object.fromEntries(sn.map(t=>[t,{}]))}))}}function Pe(e,t,n){return t==="globals"?`${e}: global ${n?.kind} ${n?.from}`:t==="moduleReviews"?`${e}: module review ${n?.kind} ${n?.module??""} ${n?.name}`:t==="renames"?`${e}: rename ${n?.tag} ${n?.kind} ${n?.from}`:t==="defaults"?`${e}: default ${n?.tag} ${n?.attribute}`:t==="retiredEvents"?`${e}: retired event ${n?.tag} ${n?.event}`:t==="detailChanges"?`${e}: detail change ${n?.tag} ${n?.event}`:t==="detailFields"?`${e}: detail field ${n?.tag} ${n?.event} ${n?.detailType}.${n?.field}`:t==="propertyChanges"?`${e}: property change ${n?.tag} ${n?.property}`:t==="slotContent"?`${e}: slot content ${n?.tag} ${JSON.stringify(n?.slot??null)}`:`${e}: review ${n?.tag} ${n?.kind} ${JSON.stringify(n?.name??null)}`}function Wl(e,t){return e==="moduleReviews"?nn(t):e==="globals"?[t.kind,t.from,t.tag??""].join("\0"):e==="renames"?[t.tag,t.kind,t.from].join("\0"):e==="defaults"?[t.tag,t.attribute].join("\0"):e==="detailChanges"||e==="retiredEvents"?[t.tag,t.event].join("\0"):e==="detailFields"?[t.tag,t.event,t.module,t.detailType,t.field].join("\0"):e==="propertyChanges"?[t.tag,t.property].join("\0"):e==="slotContent"?[t.tag,t.slot].join("\0"):[t.tag,t.kind,t.name].join("\0")}function De(e,t,n,r,s){return typeof s!="string"||!la[n]?.test(s)?(e.push(`${t}: ${r} must be a valid ${n} name, got ${JSON.stringify(s)}`),!1):!0}function kt(e,t,n,r){r&&n.since!==rn&&!We(n.since)&&e.push(`${t}: since must be a version or ${JSON.stringify(rn)}`)}function da(e,t,n){Object.hasOwn(n,"removedIn")&&(!We(n.removedIn)||at(n.removedIn,n.removalNotBefore)<0)&&e.push(`${t}: removedIn must be a version at or after removalNotBefore`)}function Kl(e,t,n,r){let s=Le(n,["kind","module","name",...r?["replacement","since","removalNotBefore","removedIn"]:[]]);if(s.length&&e.push(`${t}: unknown key(s) ${s.join(", ")}`),Pl.includes(n.kind)||e.push(`${t}: unsupported module review kind ${n.kind}`),n.kind==="entry-point"||n.kind==="stylesheet")Object.hasOwn(n,"module")&&e.push(`${t}: path reviews use name, not module`),typeof n.name!="string"||!aa.test(n.name)||n.name.includes("..")?e.push(`${t}: name must be a package subpath`):n.name.endsWith(".css")!==(n.kind==="stylesheet")&&e.push(`${t}: stylesheet reviews must name CSS; entry-point reviews must name JavaScript`);else{n.module!=="."&&(typeof n.module!="string"||!aa.test(n.module)||!n.module.endsWith(".js")||n.module.includes(".."))&&e.push(`${t}: module must be a JavaScript package subpath`);let i=n.kind==="window-event"?la.event:n.kind==="root-attribute"?/^data-lr-[a-z0-9-]+$/:Bt;(typeof n.name!="string"||!i.test(n.name))&&e.push(`${t}: invalid module review name`)}r&&((typeof n.replacement!="string"||!n.replacement.trim())&&e.push(`${t}: replacement text missing`),We(n.removalNotBefore)||e.push(`${t}: removalNotBefore must be a version`),da(e,t,n)),kt(e,t,n,r)}function Ul(e,t,n){let r=Le(n,["kind","from","to","module","prefix","except","tag","summary","since"]);if(r.length&&e.push(`${t}: unknown key(s) ${r.join(", ")}`),!ia.includes(n.kind)){e.push(`${t}: kind must be one of ${ia.join(", ")}`);return}(typeof n.summary!="string"||!n.summary.trim())&&e.push(`${t}: summary text missing`),We(n.since)||e.push(`${t}: since must be a version`);let s=n.kind==="locale-key";if(n.kind==="module"){let o=c(i=>typeof i=="string"&&Bl.test(i)&&!i.includes(".."),"valid");if(o(n.from)||e.push(`${t}: from must be an @aceshooting package specifier`),o(n.to)||e.push(`${t}: to must be an @aceshooting package specifier`),o(n.from)&&n.from===n.to&&e.push(`${t}: from and to must differ`),Object.hasOwn(n,"module")&&e.push(`${t}: module entries do not take a module`),Object.hasOwn(n,"prefix")&&n.prefix!==!0&&e.push(`${t}: prefix may only be true`),n.prefix===!0&&!(n.from?.endsWith("/")&&n.to?.endsWith("/"))&&e.push(`${t}: a prefix entry's from and to must end with a slash`),Object.hasOwn(n,"except")){let i=n.except;n.prefix!==!0||!Array.isArray(i)||!i.length||!i.every(a=>typeof a=="string"&&a.startsWith(n.from)&&a.endsWith("/"))?e.push(`${t}: except needs prefix and a list of slash-terminated prefixes below from`):JSON.stringify(i)!==JSON.stringify([...i].sort(it))&&e.push(`${t}: except must be sorted`)}return}if(n.kind==="css-property"||n.kind==="part"){(typeof n.to!="string"||!n.to.trim())&&e.push(`${t}: to must name the replacement`),(Object.hasOwn(n,"module")||Object.hasOwn(n,"except"))&&e.push(`${t}: ${n.kind} entries take no module or except`),n.kind==="part"?((typeof n.tag!="string"||!$n.test(n.tag))&&e.push(`${t}: tag must be an lr-* element name`),Object.hasOwn(n,"prefix")&&e.push(`${t}: prefix applies to custom properties only`),De(e,t,"part","from",n.from)):(Object.hasOwn(n,"tag")&&e.push(`${t}: custom properties are not tag-owned`),De(e,t,"css-property","from",n.from),Object.hasOwn(n,"prefix")&&(n.prefix!==!0||!n.from.endsWith("-"))&&e.push(`${t}: a prefix needs prefix: true and a name ending in a hyphen`));return}for(let o of s?["prefix","except"]:["prefix","except","tag"])Object.hasOwn(n,o)&&e.push(`${t}: ${o} applies to module, part and custom property entries only`);s&&Object.hasOwn(n,"tag")&&(typeof n.tag!="string"||!$n.test(n.tag))&&e.push(`${t}: tag must be an lr-* element name`),(typeof n.from!="string"||!Bt.test(n.from))&&e.push(`${t}: from must be an identifier`),!(s&&!Object.hasOwn(n,"to"))&&(typeof n.to!="string"||!Bt.test(n.to))&&e.push(`${t}: to must be an identifier`),n.from===n.to&&e.push(`${t}: from and to must differ`),n.kind==="export"&&n.module!=="."&&!(typeof n.module=="string"&&Dl.test(n.module))&&e.push(`${t}: an export entry needs module "." (the package root) or a ./components/<family> barrel`),s&&Object.hasOwn(n,"module")&&e.push(`${t}: locale keys do not take a module`)}function Hl(e,t,n){if(!Array.isArray(n)){e.push(`${t}: rules must be an array`);return}for(let r of n)Fl.includes(r)||e.push(`${t}: unknown rule ${JSON.stringify(r)}`);JSON.stringify(n)!==JSON.stringify([...new Set(n)].sort(it))&&e.push(`${t}: rules must be sorted and unique`)}function Jl(e,t,n,r){let s=["tag","kind","from","to","polarity",...r?["since","reflects"]:[]],o=Le(n,s);if(o.length&&e.push(`${t}: unknown key(s) ${o.join(", ")}`),!sa.includes(n.kind)){e.push(`${t}: kind must be one of ${sa.join(", ")}`);return}let i=De(e,t,n.kind,"from",n.from),a=De(e,t,n.kind,"to",n.to);i&&a&&n.from===n.to&&e.push(`${t}: from and to must differ`),n.kind==="slot"&&(n.from===""||n.to==="")&&e.push(`${t}: the default slot can be reviewed but not renamed`),Object.hasOwn(n,"polarity")&&(n.polarity!=="inverted"&&e.push(`${t}: polarity may only be "inverted"`),n.kind!=="attribute"&&n.kind!=="property"&&e.push(`${t}: only attribute and property renames can invert polarity`)),kt(e,t,n,r),r&&Object.hasOwn(n,"reflects")!==(n.kind==="attribute")&&e.push(`${t}: reflects is recorded for attribute renames only`),r&&n.kind==="attribute"&&typeof n.reflects!="boolean"&&e.push(`${t}: reflects must be a boolean`)}function Gl(e,t,n,r){let s=Le(n,["tag","attribute","value",...r?["since"]:[]]);s.length&&e.push(`${t}: unknown key(s) ${s.join(", ")}`),De(e,t,"attribute","attribute",n.attribute),Object.hasOwn(n,"value")?typeof n.value!="string"&&n.value!==!0&&!(typeof n.value=="number"&&Number.isFinite(n.value))&&e.push(`${t}: value must be a string, a finite number, or true (presence)`):e.push(`${t}: needs a value`),kt(e,t,n,r)}function fr(e,t,n){(typeof n!="string"||n.trim().length<16||/\n/.test(n))&&e.push(`${t}: summary must be a single-line description of the change`)}function Yl(e,t,n,r){let s=Le(n,["tag","event","summary",...r?["since"]:[]]);s.length&&e.push(`${t}: unknown key(s) ${s.join(", ")}`),De(e,t,"event","event",n.event),fr(e,t,n.summary),kt(e,t,n,r)}function Zl(e,t,n,r){let o=Le(n,["tag","event","module","detailType","field","relation","replacement","role","notice","removalNotBefore","observedIn","removedIn"]);if(o.length&&e.push(`${t}: unknown key(s) ${o.join(", ")}`),De(e,t,"event","event",n.event),(typeof n.module!="string"||!/^(?:layout|conversation)\/[a-z0-9-]+\/[a-z0-9-]+(?:\.class|-shared)\.ts$/u.test(n.module))&&e.push(`${t}: module must be a canonical layout or conversation detail source path`),(typeof n.detailType!="string"||!Bt.test(n.detailType))&&e.push(`${t}: detailType must be an exported type name`),(typeof n.field!="string"||!Bt.test(n.field))&&e.push(`${t}: field must be a property name`),["equal","inverse"].includes(n.relation)||e.push(`${t}: relation must be equal or inverse`),n.replacement!=="expanded"&&e.push(`${t}: replacement must be expanded`),(!["request","settled"].includes(n.role)||typeof n.event!="string"||n.role==="request"!==n.event.endsWith("-request"))&&e.push(`${t}: role must match whether the event is a request event`),(typeof n.notice!="string"||!/^\/\*\*[\s\S]*@deprecated\b[\s\S]*\*\/$/u.test(n.notice))&&e.push(`${t}: notice must preserve the exact deprecation JSDoc`),n.removalNotBefore!=="23.0.0"&&e.push(`${t}: removalNotBefore must preserve the declared 23.0.0 floor`),n.observedIn!=="22.0.0"&&e.push(`${t}: observedIn must name the earliest verified packed observation, 22.0.0`),r&&typeof n.observedIn=="string"&&!We(n.observedIn)&&e.push(`${t}: observedIn must be a semantic version`),n.removedIn!==void 0&&n.removedIn!=="24.0.0"&&e.push(`${t}: removedIn requires the separately authorized actual 24.0.0 retirement`),n.removedIn!==void 0){let i=We(n.removedIn),a=We(n.removalNotBefore),l=We(n.observedIn);(!i||!a||!l||i[0]<a[0]+1||i[0]<l[0]+2)&&e.push(`${t}: removedIn must clear the declared floor and a full intervening published major`)}}function Xl(e,t,n,r){let s=Le(n,["tag","event","replacement","summary","direct",...r?["since"]:[]]);s.length&&e.push(`${t}: unknown key(s) ${s.join(", ")}`),Object.hasOwn(n,"direct")&&n.direct!==!0&&e.push(`${t}: direct must be true when present`),De(e,t,"event","event",n.event),De(e,t,"event","replacement",n.replacement),n.event===n.replacement&&e.push(`${t}: replacement must differ from the retired event`),fr(e,t,n.summary),kt(e,t,n,r)}function Ql(e,t,n,r){let s=Le(n,["tag","property","former","summary",...r?["since"]:[]]);s.length&&e.push(`${t}: unknown key(s) ${s.join(", ")}`),De(e,t,"property","property",n.property),Object.hasOwn(n,"former")&&De(e,t,"property","former",n.former)&&n.former===n.property&&e.push(`${t}: former must differ from property`),fr(e,t,n.summary),kt(e,t,n,r)}function eu(e,t,n,r){let s=Le(n,["tag","slot","report","allow","summary",...r?["since"]:[]]);s.length&&e.push(`${t}: unknown key(s) ${s.join(", ")}`),De(e,t,"slot","slot",n.slot);let o=["report","allow"].filter(i=>Object.hasOwn(n,i));if(o.length!==1)e.push(`${t}: needs exactly one of report (elements to report) or allow (the only elements kept)`);else{let i=n[o[0]];(!Array.isArray(i)||!i.length||!i.every(a=>typeof a=="string"&&jl.test(a))||JSON.stringify(i)!==JSON.stringify([...new Set(i)].sort(it)))&&e.push(`${t}: ${o[0]} must be a sorted, unique list of lowercase element names`)}fr(e,t,n.summary),kt(e,t,n,r)}function tu(e,t,n,r){let o=Le(n,r?["tag","kind","name","replacement","removalNotBefore","since","removedIn"]:["tag","kind","name"]);if(o.length&&e.push(`${t}: unknown key(s) ${o.join(", ")}`),!oa.includes(n.kind)){e.push(`${t}: kind must be one of ${oa.join(", ")}`);return}De(e,t,n.kind,"name",n.name)&&n.kind==="component"&&n.name!==n.tag&&e.push(`${t}: a component review must name its own tag`),r&&((typeof n.replacement!="string"||!n.replacement)&&e.push(`${t}: replacement text missing`),fs(n.removalNotBefore)===null&&e.push(`${t}: removalNotBefore must be a version`),da(e,t,n)),kt(e,t,n,r)}function ma(e){let t=new Map(sn.map(r=>[r,new Map])),n=c((r,s,o)=>{if(!t.has(r))return;let i=t.get(r).get(s)??new Set;o&&i.add(o),t.get(r).set(s,i)},"need");for(let r of e.renames??[])n(r.kind,r.from,r.tag),n(r.kind,r.to,r.tag);for(let r of e.reviews??[])n(r.kind,r.name,r.tag);for(let r of e.detailChanges??[])n("event",r.event,r.tag);for(let r of e.retiredEvents??[])n("event",r.event,null),n("event",r.replacement,r.tag);for(let r of e.propertyChanges??[])n("property",r.property,r.tag);return t}function nu(e,t){let n=t.origin;if(!Ke(t.exposure)){e.push(`${n}: exposure must be an object`);return}let r=Le(t.exposure,sn);r.length&&e.push(`${n}: exposure has unknown kind(s) ${r.join(", ")}`);let s=ma(t);for(let o of sn){let i=t.exposure[o];if(!Ke(i)){e.push(`${n}: exposure.${o} must be an object`);continue}for(let[a,l]of Object.entries(i))s.get(o).has(a)||e.push(`${n}: exposure.${o} records unreferenced name ${a}`),(!Array.isArray(l)||!l.every(u=>typeof u=="string"&&$n.test(u))||JSON.stringify(l)!==JSON.stringify([...new Set(l)].sort(it)))&&e.push(`${n}: exposure.${o}.${a} must be a sorted, unique tag list`);for(let[a,l]of s.get(o)){if(!Object.hasOwn(i,a)){e.push(`${n}: exposure.${o}.${a} is missing`);continue}let u=new Set(i[a]??[]);for(let m of l)u.has(m)||e.push(`${n}: exposure.${o}.${a} must include ${m}`)}}}function vn(e,{projected:t=!1,historicalReleaseMajor:n=null}={}){let r=[];if(!Ke(e))return["rename ledger must be an object"];let o=Le(e,t?["schemaVersion","profiles"]:["$comment","schemaVersion","profiles"]);if(o.length&&r.push(`rename ledger has unknown key(s) ${o.join(", ")}`),e.schemaVersion!==1&&r.push("rename ledger schemaVersion must be 1"),!Array.isArray(e.profiles))return[...r,"rename ledger profiles must be an array"];let i=e.profiles.map(u=>u?.origin),a=!Number.isInteger(n)||n<22?0:n<26?2:n<27?3:n<32?4:0,l=a&&JSON.stringify(i)===JSON.stringify(Ft.slice(0,a))?Ft.slice(0,a):Ft;JSON.stringify(i)!==JSON.stringify(l)&&r.push(`rename ledger profiles must be exactly ${l.join(", ")} in that order`);for(let u of e.profiles){if(!Ke(u)){r.push("rename ledger profiles must be objects");continue}let m=String(u.origin),h=Le(u,t?Vl:ua);h.length&&r.push(`${m}: unknown key(s) ${h.join(", ")}`);let y=ms.find(x=>x.origin===u.origin);if(y)for(let x of["fromMajor","toMajor","aliasRemovalMajor"])u[x]!==y[x]&&r.push(`${m}: ${x} must be ${y[x]}`);for(let x of mr){if(Ll.includes(x)&&u[x]===void 0)continue;if(!Array.isArray(u[x])){r.push(`${m}: ${x} must be an array`);continue}let f=new Set,S=[];for(let p of u[x]){let N=Pe(m,x,p);if(!Ke(p)){r.push(`${m}: ${x} entries must be objects`);continue}x!=="moduleReviews"&&x!=="globals"&&(typeof p.tag!="string"||!$n.test(p.tag))&&r.push(`${N}: tag must be an lr-* element name`),x==="globals"?Ul(r,N,p):x==="moduleReviews"?(Kl(r,N,p,t),t&&fs(p.removalNotBefore)!==u.aliasRemovalMajor&&r.push(`${N}: removalNotBefore must match the profile's aliasRemovalMajor`)):x==="renames"?Jl(r,N,p,t):x==="defaults"?Gl(r,N,p,t):x==="detailChanges"?Yl(r,N,p,t):x==="detailFields"?Zl(r,N,p,t):x==="retiredEvents"?(Xl(r,N,p,t),t&&p.since!==`${u.toMajor}.0.0`&&r.push(`${N}: since must match the target major release`)):x==="propertyChanges"?Ql(r,N,p,t):x==="slotContent"?eu(r,N,p,t):tu(r,N,p,t);let T=Wl(x,p);f.has(T)&&r.push(`${N}: duplicate entry`),f.add(T),S.push(T)}JSON.stringify(S)!==JSON.stringify([...S].sort(it))&&r.push(`${m}: ${x} must be sorted by ${x==="moduleReviews"?"kind, module and name":x==="globals"?"kind and name":"tag and name"}`)}if(u.rules!==void 0&&Hl(r,m,u.rules),!Array.isArray(u.renames)||!Array.isArray(u.reviews))continue;let w=new Map;for(let x of u.renames){let f=w.get(x.kind)??new Set;f.add(x.from),w.set(x.kind,f)}for(let x of u.renames)w.get(x.kind)?.has(x.to)&&r.push(`${Pe(m,"renames",x)}: target ${x.to} is itself renamed; rename directly to the final name`);let E=new Set(u.renames.map(x=>`${x.tag}\0${x.kind}\0${x.from}`));for(let x of u.reviews)E.has(`${x.tag}\0${x.kind}\0${x.name}`)&&r.push(`${Pe(m,"reviews",x)}: a member is either renamed or reviewed, not both`);t&&nu(r,u)}if(e.profiles.length>=2){let u=e.profiles[0]?.detailFields,m=e.profiles[1]?.detailFields;(Array.isArray(u)||Array.isArray(m))&&JSON.stringify(u??[])!==JSON.stringify(m??[])&&r.push("lyra-v21 and lyra-v22 detailFields must preserve the same verified field exposures")}return r}function fa(e){return new Map((e?.components??[]).map(t=>[t.tag,t]))}function Re(e,t,n){return(e?.surface?.[ca[t]]??[]).find(r=>r.name===n)??null}function ru(e,t,n){let r=new Set;for(;;){let s=`${t}\0${n}`;if(r.has(s))return!1;r.add(s);let o=Re(e,t,n);if(!o)return!1;if(!o.deprecated)return!0;let i=hs(e,t,n)?.replacement;if(!i||i.kind==="component"||i.kind==="host-css-property")return!1;t=i.kind,n=i.name}}function ha(e){let t=[...e?.maturity?.deprecations??[]],n=e?.maturity?.deprecated;return Ke(n)&&!t.some(r=>r.kind==="component")&&t.push(n),t}function hs(e,t,n){let r=ha(e);if(t==="component")return r.find(o=>o.kind==="component")??null;let s=r.find(o=>o.kind===t&&o.name===n);return s||t!=="attribute"?s??null:r.find(o=>o.kind==="property"&&o.attribute===n)??null}function mt(e,t,n,r){let s=JSON.stringify(["member",t,n,r]);return e?.records?.[s]??e?.records?.[e?.aliases?.[s]]??null}function su(e,t,n){let r=n;for(let s=0;s<8&&Ke(r);s++){let o=(e?.successors??[]).find(l=>l.key.tag===t&&l.key.kind===r.kind&&l.key.name===r.name);if(o){r=o.replacement;continue}let i=mt(e,t,r.kind,r.name),a=i?.state==="retired"?i.policy?.replacement:null;if(!Ke(a)||["host-css-property","component"].includes(a.kind))break;r=a}return r}function ou(e,t,n){let r=[],s=n;for(let o=0;o<9&&Ke(s);o++){r.push(s);let i=(e?.successors??[]).find(u=>u.key.tag===t&&u.key.kind===s.kind&&u.key.name===s.name),a=mt(e,t,s.kind,s.name),l=i?.replacement??(a?.state==="retired"?a.policy?.replacement:null);if(!Ke(l)||["host-css-property","component"].includes(l.kind))break;s=l}return r}function ds(e,t,n=null){let r=n??mt(e,t,"component",t);return r?.state!=="retired"?null:r.sourceComponent??e?.sourceComponents?.[t]??null}function ga(e,t){return e?.records?.[JSON.stringify(["export",t.kind,t.module??null,t.name])]??null}function ot(e,t,n){let r=e.get(n);return r||ds(t,n)}function dr(e,t,n,r,s){return hs(e,r,s)??mt(t,n,r,s)?.policy??null}function ya(e,t,n,r,s){let o=mt(t,n,r,s);return e.get(o?.state==="retired"?o.replacementOwner:n)}function au(e,t,n,r){let s=n?.replacement;return Ke(s)?s.kind===t&&s.name===r?!0:t==="attribute"&&s.kind==="property"?Re(e,"property",s.name)?.attribute===r:!1:!1}function ps(e){return String(e?.type??"").split("|").map(t=>t.trim()).includes("boolean")}function iu(e,t,n){return(e?.components??[]).filter(r=>Re(r,t,n)).map(r=>r.tag).sort(it)}function hr(e){let t=new Map;for(let r of Object.values(e?.upstreams??{}))for(let s of r?.components??[])t.set(s.tag,s);let n=new Map;for(let r of e?.mappings??[]){if(!r?.targetTag||cu.has(r.classification))continue;let s=t.get(r.upstreamTag);for(let[o,i]of Object.entries(ca)){let a=r.rewrites?.[i]??[],l=new Set(a.map(m=>m?.from)),u=[...a.map(m=>m?.to).filter(m=>typeof m=="string"),...(s?.surface?.[i]??[]).map(m=>m.name).filter(m=>!l.has(m))];for(let m of u){let h=`${r.targetTag}\0${o}\0${m}`;n.has(h)||n.set(h,r.upstreamTag)}}}return n}function lu(e,{inventory:t,exportDeprecations:n=[],requireCoverage:r=!1,sharedTokens:s=null,compatibilityContext:o=null,historicalReleaseMajor:i=null}){let a=vn(e,{historicalReleaseMajor:i});if(a.length)return a;let l=fa(t);if(!Array.isArray(n))return["exportDeprecations must be an array"];if(!n.every(Ke))return["exportDeprecations entries must be objects"];let u=new Map(n.map(y=>[nn(y),y]));u.size!==n.length&&a.push("exportDeprecations contains duplicate module records");let m=hr(t),h=c((y,w,E)=>m.get(`${y}\0${w}\0${E}`)??null,"mirrorOf");for(let y of e.profiles){let w=y.origin,E=new Set,x=`${y.toMajor}.0.0`,f=c($=>fs($?.removalNotBefore)===y.aliasRemovalMajor,"removalMajorMatches"),S=c(($,L)=>{if(f(L)||a.push(`${$}: its deprecation record must set removalNotBefore to ${y.aliasRemovalMajor}.0.0`),L?.since===rn)return;let d=at(L?.since,x);(d===null||d>0)&&a.push(`${$}: its deprecation record must start no later than ${x} (since ${JSON.stringify(L?.since)})`)},"checkRecordWindow"),p=c(($,L,d,k)=>{let j=h(L,d,k);j&&a.push(`${$}: ${k} mirrors ${j}; mirrored names never change`)},"checkLyraOnly"),N=c(($,L,d)=>{L==="css-property"&&s?.has(d)&&a.push(`${$}: ${d} is a canonical design token, not a component-owned custom property`)},"checkSharedToken"),T=new Set(e.profiles.filter($=>$.toMajor<=y.toMajor).flatMap($=>$.defaults).filter($=>$.value===!0).map($=>`${$.tag}\0${$.attribute}`)),C=new Set;for(let $ of y.detailFields??[]){let L=Pe(w,"detailFields",$),d=ot(l,o,$.tag);d?!Re(d,"event",$.event)&&mt(o,$.tag,"event",$.event)?.state!=="retired"&&a.push(`${L}: the event is not dispatched by ${$.tag}`):a.push(`${L}: component is not in the inventory`)}for(let $ of y.renames){let L=Pe(w,"renames",$),d=ot(l,o,$.tag);if(!d){a.push(`${L}: component is not in the inventory`);continue}E.add(`${$.tag}\0${$.kind}\0${$.from}`),p(L,$.tag,$.kind,$.from),N(L,$.kind,$.from),N(L,$.kind,$.to);let k=mt(o,$.tag,$.kind,$.from),j=k?.state==="retired",M=Re(j?ds(o,$.tag,k):d,$.kind,$.from),F=ya(l,o,$.tag,$.kind,$.from),D=Re(F,$.kind,$.to);M?M.deprecated||a.push(`${L}: the alias ${$.from} is not marked deprecated in the manifest`):a.push(`${L}: the deprecated alias ${$.from} is not on the public surface`);let O=dr(d,o,$.tag,$.kind,$.from),_=j&&O?ou(o,$.tag,O.replacement):[],K=_.some(se=>se.kind===$.kind&&se.name===$.to),Z=_.at(-1),te=Z?Re(F,Z.kind,Z.name):null,ce=!D&&K&&!!te&&!te.deprecated;if(!D&&!ce?a.push(`${L}: the canonical name ${$.to} is not on the public surface`):D?.deprecated&&!(j&&ru(F,$.kind,$.to))&&a.push(`${L}: the canonical name ${$.to} is itself deprecated`),!O)a.push(`${L}: no deprecation record retires ${$.from}`);else{S(L,O);let se=su(o,$.tag,O.replacement);!au(F,$.kind,O,$.to)&&!(se?.kind===$.kind&&se.name===$.to)&&!K&&a.push(`${L}: its deprecation record names a different replacement than ${$.to}`)}if(($.kind==="attribute"||$.kind==="property")&&M&&D&&ps(M)&&ps(D)){let se=$.kind==="attribute"?$.to:D.attribute,le=!!se&&T.has(`${$.tag}\0${se}`);$.polarity==="inverted"?(D.default===!0&&a.push(`${L}: an inverted rename must target a boolean that defaults to false`),M.default!==!0&&se&&C.add(`${$.tag}\0${se}`),M.default!==!0&&!le&&a.push(`${L}: ${$.from} defaults to false, so the inverted rename needs a defaults entry inserting ${se??$.to} where both are absent`)):M.default===!0&&D.default!==!0&&!le&&a.push(`${L}: ${$.from} defaults to true and ${$.to} to false; declare "polarity": "inverted" or preserve the default with a defaults entry`)}else $.polarity==="inverted"&&M&&D&&a.push(`${L}: an inverted rename must retire a boolean for a boolean`)}for(let $ of y.reviews){let L=Pe(w,"reviews",$),d=ot(l,o,$.tag);if(!d){a.push(`${L}: component is not in the inventory`);continue}E.add(`${$.tag}\0${$.kind}\0${$.name}`),$.kind!=="component"&&p(L,$.tag,$.kind,$.name),N(L,$.kind,$.name);let k=dr(d,o,$.tag,$.kind,$.name);k?S(L,k):a.push(`${L}: no deprecation record retires ${JSON.stringify($.name)}`)}for(let $ of y.detailChanges){let L=Pe(w,"detailChanges",$),d=ot(l,o,$.tag);d?Re(d,"event",$.event)?p(L,$.tag,"event",$.event):a.push(`${L}: the event is not dispatched by ${$.tag}`):a.push(`${L}: component is not in the inventory`)}for(let $ of y.retiredEvents??[]){let L=Pe(w,"retiredEvents",$),d=ot(l,o,$.tag);if(!d)a.push(`${L}: component is not in the inventory`);else{Re(d,"event",$.event)&&a.push(`${L}: retired event is still dispatched by ${$.tag}`),hs(d,"event",$.event)&&a.push(`${L}: a retired event must not keep a current deprecation record`);let k=Re(d,"event",$.replacement);(!k||k.deprecated)&&a.push(`${L}: replacement is not a current event on ${$.tag}`),p(L,$.tag,"event",$.event)}}for(let $ of y.propertyChanges??[]){let L=Pe(w,"propertyChanges",$),d=ot(l,o,$.tag);if(!d)a.push(`${L}: component is not in the inventory`);else{let k=mt(o,$.tag,"property",$.property),j=k?.state==="retired"?k.sourceComponent??ds(o,$.tag,k):d;Re(j,"property",$.property)||a.push(`${L}: the property is not on the public surface`),$.former&&Re(j,"property",$.former)&&a.push(`${L}: the former property name is still on the public surface`)}}for(let $ of y.slotContent){let L=Pe(w,"slotContent",$),d=ot(l,o,$.tag);if(!d){a.push(`${L}: component is not in the inventory`);continue}Re(d,"slot",$.slot)||a.push(`${L}: the slot is not on the public surface`);let k=dr(d,o,$.tag,"slot-content",$.slot);k&&(E.add(`${$.tag}\0slot-content\0${$.slot}`),Array.isArray(k.permittedContent)&&JSON.stringify($.allow??null)!==JSON.stringify(k.permittedContent)&&a.push(`${L}: its deprecation record permits ${k.permittedContent.join(", ")}; allow must list exactly those elements`))}for(let $ of y.defaults){let L=Pe(w,"defaults",$),d=ot(l,o,$.tag);if(!d){a.push(`${L}: component is not in the inventory`);continue}let k=Re(d,"attribute",$.attribute);if(!k){a.push(`${L}: the attribute is not on the public surface`);continue}C.has(`${$.tag}\0${$.attribute}`)||p(L,$.tag,"attribute",$.attribute),$.value===!0&&!ps(k)&&a.push(`${L}: presence insertion requires a boolean attribute`),k.hasDefault&&String(k.default)===String($.value)&&a.push(`${L}: the value equals the current default, so there is nothing to preserve`)}for(let $ of y.globals??[]){let L=Pe(w,"globals",$);if($.kind==="part"){let d=ot(l,o,$.tag),k=o?.sourceComponents?.[$.tag]??null;d?!Re(d,"part",$.from)&&!Re(k,"part",$.from)&&a.push(`${L}: the part is not on the public surface`):a.push(`${L}: component is not in the inventory`)}else $.kind==="locale-key"&&$.tag?ot(l,o,$.tag)||a.push(`${L}: component is not in the inventory`):$.kind==="css-property"&&[...l.values()].some(k=>(k.surface?.cssProperties??[]).some(j=>$.prefix?j.name.startsWith($.from):j.name===$.from))&&a.push(`${L}: a component still exposes the custom property`)}let I=new Set;for(let $ of y.moduleReviews){let L=Pe(w,"moduleReviews",$),d=nn($);I.add(d);let k=u.get(d)??ga(o,$)?.policy;k?(S(L,k),!k.replacement?.usage&&!k.replacement?.name&&a.push(`${L}: canonical replacement is missing`)):a.push(`${L}: no canonical exportDeprecations record`)}if(!r)continue;for(let $ of[...n,...Object.values(o?.records??{}).filter(L=>L.state==="retired"&&L.key.scope==="export").map(L=>L.policy)])f($)&&!I.has(nn($))&&a.push(`${w}: ${$.kind} ${$.module??""} ${$.name} is removed in ${y.aliasRemovalMajor}.0.0 but has no moduleReviews entry`);let W=new Map((t?.components??[]).map($=>[$.tag,ha($)]));for(let $ of Object.values(o?.records??{}))$.state!=="retired"||$.key.scope!=="member"||W.set($.key.tag,[...W.get($.key.tag)??[],$.policy]);for(let[$,L]of W){let d={tag:$};for(let k of L){if(!f(k))continue;let j=[[k.kind,k.kind==="component"?d.tag:k.name]];k.kind==="property"&&k.attribute&&j.push(["attribute",k.attribute]);for(let[M,F]of j)M!=="component"&&h(d.tag,M,F)||E.has(`${d.tag}\0${M}\0${F}`)||a.push(`${w}: ${d.tag} ${M} ${JSON.stringify(F)} is removed in ${y.aliasRemovalMajor}.0.0 but has no ${M==="slot-content"?"slotContent":"rename or review"} entry`)}}}return[...new Set(a)]}function En(e,t,{exportDeprecations:n=[],compatibilityContext:r=null,historicalReleaseMajor:s=null}={}){let o=lu(e,{inventory:t,exportDeprecations:n,compatibilityContext:r,historicalReleaseMajor:s});if(o.length)throw new Error(`Invalid Lyra rename ledger: ${o.join("; ")}`);let i=fa(t),a=new Map(n.map(m=>[nn(m),m])),l={schemaVersion:1,profiles:e.profiles.map(m=>{let h=`${m.toMajor}.0.0`,y=Object.fromEntries(sn.map(E=>[E,{}]));for(let[E,x]of ma(m))for(let f of[...x.keys()].sort(it))y[E][f]=[...new Set([...iu(t,E,f),...r?.exposure?.[E]?.[f]??[]])].sort(it);for(let E of m.renames){let x=y[E.kind]?.[E.to];x&&!x.includes(E.tag)&&(y[E.kind][E.to]=[...x,E.tag].sort(it))}let w=c((E,x,f)=>dr(i.get(E.tag),r,E.tag,x,f),"recordFor");return{origin:m.origin,fromMajor:m.fromMajor,toMajor:m.toMajor,aliasRemovalMajor:m.aliasRemovalMajor,renames:m.renames.map(E=>{let x=Re(ya(i,r,E.tag,E.kind,E.from),E.kind,E.to),f=E.kind==="attribute"?E.to:x?.attribute,S=E.polarity==="inverted"&&m.defaults.some(T=>T.tag===E.tag&&T.attribute===f),p=w(E,E.kind,E.from).since,N=p===rn||at(p,h)<0;return{...structuredClone(E),since:S&&N?h:p,...E.kind==="attribute"?{reflects:!!x?.reflects}:{}}}),defaults:m.defaults.map(E=>({...structuredClone(E),since:h})),retiredEvents:(m.retiredEvents??[]).map(E=>({...structuredClone(E),since:h})),detailChanges:m.detailChanges.map(E=>({...structuredClone(E),since:h})),...Array.isArray(m.detailFields)?{detailFields:m.detailFields.map(E=>structuredClone(E))}:{},propertyChanges:(m.propertyChanges??[]).map(E=>({...structuredClone(E),since:h})),...Array.isArray(m.globals)?{globals:m.globals.map(E=>structuredClone(E))}:{},...Array.isArray(m.rules)?{rules:[...m.rules]}:{},reviews:m.reviews.map(E=>{let x=w(E,E.kind,E.name),f=mt(r,E.tag,E.kind,E.name);return{...structuredClone(E),replacement:String(x.replacement?.usage||x.replacement?.name),...f?.state==="retired"?{removedIn:f.removedIn}:{},removalNotBefore:x.removalNotBefore,since:x.since}}),slotContent:m.slotContent.map(E=>({...structuredClone(E),since:h})),moduleReviews:m.moduleReviews.map(E=>{let x=ga(r,E),f=a.get(nn(E))??x?.policy;return{...structuredClone(E),replacement:String(f.replacement.usage||f.replacement.name),...x?.state==="retired"?{removedIn:x.removedIn}:{},since:f.since,removalNotBefore:f.removalNotBefore}}),exposure:y}})},u=vn(l,{projected:!0,historicalReleaseMajor:s});if(u.length)throw new Error(`Invalid Lyra rename projection: ${u.join("; ")}`);return l}function St(e,t){let n=new Map;for(let r of e){let s=t(r),o=n.get(s)??[];o.push(r),n.set(s,o)}return n}function ba(e,{lyraVersion:t=null}={}){let n=vn(e,{projected:!0});if(n.length)throw new Error(`Invalid Lyra rename projection: ${n.join("; ")}`);if(t!==null&&!We(t))throw new Error(`Invalid Lyra version: ${t}`);let r=new Map,s=c(a=>t===null||a.since!==rn&&at(a.since,t)<=0,"availableAcrossProfiles"),o=e.profiles.flatMap(a=>a.renames).filter(s),i=e.profiles.flatMap(a=>a.defaults).filter(s);for(let a of e.profiles){let l=[],u=c(O=>(a[O]??[]).filter(_=>{if(t===null)return!0;let K=O==="detailFields"?_.observedIn:_.since;return K!==rn&&at(K,t)<=0?!0:(l.push({list:O,..._}),!1)}).map(_=>{if(!_.removedIn||t===null||at(t,_.removedIn)>=0)return _;let{removedIn:K,...Z}=_;return Z}),"available"),m=t===null||at(t,`${a.toMajor}.0.0`)>=0;m||l.push(...(a.rules??[]).map(O=>({list:"rules",rule:O})));let h={...a,...Object.fromEntries(mr.map(O=>[O,u(O)])),rules:m?[...a.rules??[]]:[]},y=new Map(h.renames.map(O=>[qe(O.tag,O.kind,O.from),O])),w=St(h.renames,O=>Dt(O.kind,O.from)),E=St(h.renames,O=>Dt(O.kind,O.to)),x=new Map(h.reviews.map(O=>[qe(O.tag,O.kind,O.name),O])),f=St(h.reviews,O=>Dt(O.kind,O.name)),S=new Map(h.detailChanges.map(O=>[qe(O.tag,"event",O.event),O])),p=St(h.detailChanges,O=>O.event),N=new Map((h.detailFields??[]).map(O=>[qe(O.tag,"event",O.event),O])),T=St(h.detailFields??[],O=>O.event),C=new Map(h.retiredEvents.map(O=>[qe(O.tag,"event",O.event),O])),I=St(h.retiredEvents,O=>O.event),W=new Map(h.propertyChanges.flatMap(O=>[O.property,...O.former?[O.former]:[]].map(_=>[qe(O.tag,"property",_),O]))),$=new Map(sn.map(O=>[O,new Map(Object.entries(h.exposure[O]).map(([_,K])=>[_,new Set(K)]))])),L=St(h.defaults,O=>O.tag),d=St(h.slotContent,O=>O.tag),k=new Set([...h.renames,...h.reviews,...h.detailChanges,...h.detailFields??[],...h.retiredEvents,...h.propertyChanges,...h.defaults,...h.slotContent].map(O=>O.tag)),j=c((O,_)=>w.get(Dt(O,_))??[],"renamesNamed"),M=c((O,_)=>$.get(O)?.get(_)??new Set,"exposersOf"),F=c((O,_,K)=>new Set(j(O,_).filter(Z=>Z.to===K&&!Z.polarity).map(Z=>Z.tag)),"movers"),D=c((O,_)=>[...O].every(K=>_.has(K)),"subset");r.set(h.origin,{origin:h.origin,fromMajor:h.fromMajor,toMajor:h.toMajor,aliasRemovalMajor:h.aliasRemovalMajor,data:h,skipped:l,tags:k,isEmpty:k.size===0&&h.moduleReviews.length===0&&h.globals.length===0&&h.rules.length===0,renameFor:c((O,_,K)=>y.get(qe(O,_,K))??null,"renameFor"),renamesNamed:j,renamesOnto:c((O,_)=>E.get(Dt(O,_))??[],"renamesOnto"),reviewFor:c((O,_,K)=>x.get(qe(O,_,K))??null,"reviewFor"),reviewsNamed:c((O,_)=>f.get(Dt(O,_))??[],"reviewsNamed"),detailFor:c((O,_)=>S.get(qe(O,"event",_))??null,"detailFor"),detailsNamed:c(O=>p.get(O)??[],"detailsNamed"),detailFieldFor:c((O,_)=>N.get(qe(O,"event",_))??null,"detailFieldFor"),detailFieldsNamed:c(O=>T.get(O)??[],"detailFieldsNamed"),retiredEventFor:c((O,_)=>C.get(qe(O,"event",_))??null,"retiredEventFor"),retiredEventsNamed:c(O=>I.get(O)??[],"retiredEventsNamed"),propertyChangeFor:c((O,_)=>W.get(qe(O,"property",_))??null,"propertyChangeFor"),defaultsFor:c(O=>L.get(O)??[],"defaultsFor"),preservedDefaultsFor:c(O=>i.filter(_=>_.tag===O),"preservedDefaultsFor"),defaultAliasesFor:c((O,_)=>{let K=new Set([_]);for(let Z of o)Z.tag!==O||Z.kind!=="attribute"||(Z.from===_&&K.add(Z.to),Z.to===_&&K.add(Z.from));return[...K]},"defaultAliasesFor"),slotContentFor:c(O=>d.get(O)??[],"slotContentFor"),exposes:c((O,_,K)=>!!K&&M(O,_).has(K),"exposes"),exposers:c((O,_)=>[...M(O,_)],"exposers"),targetKeepers(O,_,K){let Z=F(O,_,K);return[...M(O,K)].filter(te=>!Z.has(te))},sourceKeepers(O,_,K){let Z=F(O,_,K);return[...M(O,_)].filter(te=>!Z.has(te))},isGlobal(O,_){let K=j(O,_);if(!K.length||K.some(se=>se.polarity))return!1;let Z=new Set(K.map(se=>se.to));if(Z.size!==1)return!1;let[te]=Z,ce=F(O,_,te);return M(O,_).size>0&&D(M(O,_),ce)&&D(M(O,te),ce)},gainedOwners(O,_){let K=(E.get(Dt(O,_))??[]).filter(ce=>!ce.polarity);if(!K.length)return[];let Z=new Set(K.map(ce=>ce.tag));return[...M(O,_)].filter(ce=>!Z.has(ce)).length?[...Z].sort(it):[]}})}return r}var rn,ms,Ft,sa,oa,sn,ca,$n,jl,Bt,zl,la,Pl,aa,nn,mr,Ll,ua,ia,Dl,Fl,Bl,Vl,cu,qe,Dt,xn=ke(()=>{"use strict";rn="unreleased",ms=Object.freeze([Object.freeze({origin:"lyra-v21",fromMajor:21,toMajor:22,aliasRemovalMajor:23}),Object.freeze({origin:"lyra-v22",fromMajor:22,toMajor:23,aliasRemovalMajor:24}),Object.freeze({origin:"lyra-v25",fromMajor:25,toMajor:26,aliasRemovalMajor:28}),Object.freeze({origin:"lyra-v26",fromMajor:26,toMajor:27,aliasRemovalMajor:29}),Object.freeze({origin:"lyra-v31",fromMajor:31,toMajor:32,aliasRemovalMajor:33}),Object.freeze({origin:"lyra-v32",fromMajor:32,toMajor:33,aliasRemovalMajor:34})]),Ft=Object.freeze(ms.map(e=>e.origin)),sa=Object.freeze(["attribute","property","event","part","css-property","slot"]),oa=Object.freeze(["component","attribute","property","event","slot","part","css-property","css-state","method"]),sn=Object.freeze(["event","part","css-property"]),ca=Object.freeze({attribute:"attributes",property:"properties",event:"events",part:"parts","css-property":"cssProperties",slot:"slots","css-state":"cssStates",method:"methods"}),$n=/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/,jl=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Bt=/^[A-Za-z_$][\w$]*$/,zl=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/,la=Object.freeze({component:$n,attribute:/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,property:Bt,method:Bt,event:/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/,part:/^[A-Za-z0-9_-]+$/,slot:/^(?:[A-Za-z0-9_-]+)?$/,"css-property":/^--[A-Za-z0-9_-]+$/,"css-state":/^[a-z][a-z0-9-]*$/}),Pl=["entry-point","stylesheet","function","type","constant","class","window-event","root-attribute"],aa=/^\.\/[A-Za-z0-9_./-]+\.(?:js|css)$/,nn=c(e=>[e.kind,e.module??"",e.name].join("\0"),"moduleReviewKey"),mr=["renames","defaults","detailChanges","detailFields","propertyChanges","retiredEvents","reviews","slotContent","moduleReviews","globals"],Ll=["propertyChanges","retiredEvents","detailFields","globals"],ua=["origin","fromMajor","toMajor","aliasRemovalMajor",...mr,"rules"],ia=Object.freeze(["module","export","locale-key","css-property","part"]),Dl=/^\.\/components\/[a-z][a-z0-9-]*$/,Fl=Object.freeze(["theme-scopes"]),Bl=/^@aceshooting\/lyra-[a-z]+(?:\/[A-Za-z0-9_./-]*)?$/,Vl=[...ua,"exposure"];c(Ke,"isPlainObject");c(Le,"unknownKeys");c(it,"compareText");c(We,"parseVersion");c(at,"compareVersions");c(fs,"majorOf");c(ql,"emptyRenameLedger");c(pa,"emptyRenameProjection");c(Pe,"entryLabel");c(Wl,"sortKey");c(De,"validateName");c(kt,"validateProjectedSince");c(da,"validateRemovedIn");c(Kl,"validateModuleReviewEntry");c(Ul,"validateGlobalEntry");c(Hl,"validateRulesList");c(Jl,"validateRenameEntry");c(Gl,"validateDefaultEntry");c(fr,"validateSummary");c(Yl,"validateDetailEntry");c(Zl,"validateDetailFieldEntry");c(Xl,"validateRetiredEventEntry");c(Ql,"validatePropertyChangeEntry");c(eu,"validateSlotContentEntry");c(tu,"validateReviewEntry");c(ma,"requiredExposure");c(nu,"validateExposure");c(vn,"validateRenameLedgerShape");c(fa,"componentMap");c(Re,"surfaceEntry");c(ru,"hasCurrentSuccessor");c(ha,"deprecationRecords");c(hs,"deprecationRecordFor");c(mt,"historicalMember");c(su,"followReplacement");c(ou,"replacementChain");c(ds,"historicalSourceComponent");c(ga,"historicalExport");c(ot,"ownerFor");c(dr,"policyFor");c(ya,"replacementOwner");c(au,"replacementMatches");c(ps,"isBooleanMember");c(iu,"exposingTags");cu=new Set(["conceptual-only","unsupported"]);c(hr,"mirroredMembers");c(lu,"validateRenameLedger");c(En,"projectRenameLedger");c(St,"indexBy");qe=c((e,t,n)=>`${e}\0${t}\0${n}`,"ownerKey"),Dt=c((e,t)=>`${e}\0${t}`,"nameKey");c(ba,"createRenameProfiles")});import{gunzipSync as uu,gzipSync as qf}from"node:zlib";function yr(e){if(e.length>wa)throw new Error("Compressed migration contract exceeds size limit");return uu(e,{maxOutputLength:wa})}var gr,wa,gs=ke(()=>{"use strict";gr="migration-contract.json.gz",wa=32*1024*1024;c(yr,"decodeMigrationContract")});import{createRequire as Hd}from"module";function nc(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{let e=J(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);return er=e&&typeof e.__napiBindingTarget=="string"?e.__napiBindingTarget:"native",e}catch(e){Q.push(e)}else if(process.platform==="android")if(process.arch==="arm64"){try{return J("./parser.android-arm64.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-android-arm64"),t=J("@oxc-parser/binding-android-arm64/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="arm"){try{return J("./parser.android-arm-eabi.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-android-arm-eabi"),t=J("@oxc-parser/binding-android-arm-eabi/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else Q.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64")if(process.config&&process.config.variables&&process.config.variables.shlib_suffix==="dll.a"||process.config&&process.config.variables&&process.config.variables.node_target_type==="shared_library"){try{return J("./parser.win32-x64-gnu.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-win32-x64-gnu"),t=J("@oxc-parser/binding-win32-x64-gnu/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else{try{return J("./parser.win32-x64-msvc.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-win32-x64-msvc"),t=J("@oxc-parser/binding-win32-x64-msvc/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="ia32"){try{return J("./parser.win32-ia32-msvc.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-win32-ia32-msvc"),t=J("@oxc-parser/binding-win32-ia32-msvc/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="arm64"){try{return J("./parser.win32-arm64-msvc.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-win32-arm64-msvc"),t=J("@oxc-parser/binding-win32-arm64-msvc/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else Q.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return J("./parser.darwin-universal.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-darwin-universal"),t=J("@oxc-parser/binding-darwin-universal/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}if(process.arch==="x64"){try{return J("./parser.darwin-x64.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-darwin-x64"),t=J("@oxc-parser/binding-darwin-x64/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="arm64"){try{return J("./parser.darwin-arm64.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-darwin-arm64"),t=J("@oxc-parser/binding-darwin-arm64/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else Q.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return J("./parser.freebsd-x64.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-freebsd-x64"),t=J("@oxc-parser/binding-freebsd-x64/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="arm64"){try{return J("./parser.freebsd-arm64.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-freebsd-arm64"),t=J("@oxc-parser/binding-freebsd-arm64/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else Q.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(Qn()){try{return J("./parser.linux-x64-musl.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-x64-musl"),t=J("@oxc-parser/binding-linux-x64-musl/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else{try{return J("./parser.linux-x64-gnu.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-x64-gnu"),t=J("@oxc-parser/binding-linux-x64-gnu/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="arm64")if(Qn()){try{return J("./parser.linux-arm64-musl.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-arm64-musl"),t=J("@oxc-parser/binding-linux-arm64-musl/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else{try{return J("./parser.linux-arm64-gnu.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-arm64-gnu"),t=J("@oxc-parser/binding-linux-arm64-gnu/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="arm")if(Qn()){try{return J("./parser.linux-arm-musleabihf.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-arm-musleabihf"),t=J("@oxc-parser/binding-linux-arm-musleabihf/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else{try{return J("./parser.linux-arm-gnueabihf.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-arm-gnueabihf"),t=J("@oxc-parser/binding-linux-arm-gnueabihf/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="loong64")if(Qn()){try{return J("./parser.linux-loong64-musl.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-loong64-musl"),t=J("@oxc-parser/binding-linux-loong64-musl/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else{try{return J("./parser.linux-loong64-gnu.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-loong64-gnu"),t=J("@oxc-parser/binding-linux-loong64-gnu/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="riscv64")if(Qn()){try{return J("./parser.linux-riscv64-musl.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-riscv64-musl"),t=J("@oxc-parser/binding-linux-riscv64-musl/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else{try{return J("./parser.linux-riscv64-gnu.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-riscv64-gnu"),t=J("@oxc-parser/binding-linux-riscv64-gnu/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="ppc64"){try{return J("./parser.linux-ppc64-gnu.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-ppc64-gnu"),t=J("@oxc-parser/binding-linux-ppc64-gnu/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="s390x"){try{return J("./parser.linux-s390x-gnu.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-linux-s390x-gnu"),t=J("@oxc-parser/binding-linux-s390x-gnu/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else Q.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return J("./parser.openharmony-arm64.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-openharmony-arm64"),t=J("@oxc-parser/binding-openharmony-arm64/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="x64"){try{return J("./parser.openharmony-x64.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-openharmony-x64"),t=J("@oxc-parser/binding-openharmony-x64/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else if(process.arch==="arm"){try{return J("./parser.openharmony-arm.node")}catch(e){Q.push(e)}try{let e=J("@oxc-parser/binding-openharmony-arm"),t=J("@oxc-parser/binding-openharmony-arm/package.json").version;if(t!=="0.160.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.160.0 but got ${t}. You can reinstall dependencies to fix this issue.`);return e}catch(e){Q.push(e)}}else Q.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else Q.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}function rc(e){return e.reduce((t,n)=>{let r;try{r=n&&typeof n.message=="string"?n.message:String(n)}catch{r="Unknown error"}let s=new Error(r);return s.cause=t,s},null)}var J,Jd,Je,er,Q,Qn,Gd,Yd,Zd,Xd,tc,wt,bt,bo,wo,Qd,em,tm,nm,rm,sm,om,sc,am,Fh,Bh,Vh,Br=ke(()=>{J=Hd(import.meta.url),{readFileSync:Jd}=J("fs"),Je=null,er="native",Q=[],Qn=c(()=>{let e=!1;return process.platform==="linux"&&(e=Yd(),e===null&&(e=Zd()),e===null&&(e=Xd())),e},"isMusl"),Gd=c(e=>e.includes("libc.musl-")||e.includes("ld-musl-"),"isFileMusl"),Yd=c(()=>{try{return Jd("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},"isMuslFromFilesystem"),Zd=c(()=>{let e=null;return process.report&&typeof process.report.getReport=="function"&&(process.report.excludeNetwork=!0,e=process.report.getReport()),e?e.header&&e.header.glibcVersionRuntime?!1:!!(Array.isArray(e.sharedObjects)&&e.sharedObjects.some(Gd)):null},"isMuslFromReport"),Xd=c(()=>{try{return J("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}},"isMuslFromChildProcess");c(nc,"requireNative");c(rc,"createLoadErrorChain");tc=["wasm32-wasi","wasm32-wasip1"],wt=process.env.NAPI_RS_WASI_FLAVOR,bt=typeof wt=="string"&&wt.length>0;if(bt&&tc.indexOf(wt)===-1)throw new Error('Unsupported WASI flavor "'+wt+'". Available flavors: '+tc.join(", "));bo=process.env.NAPI_RS_FORCE_WASI==="error",wo=process.env.NAPI_RS_FORCE_WASI==="true"||bo||bt;wo||(Je=nc());if(!Je||wo){let e=null,t=!1,n=[],r=c((s,o,i)=>{try{J.resolve(s)}catch(a){if(!a||a.code!=="MODULE_NOT_FOUND")throw a;if(o){try{J.resolve(s+"/package.json")}catch(l){if(l&&l.code==="MODULE_NOT_FOUND")return a;throw a}throw a}return a}if(i){let a=null;for(let l=0;l<i.length;l++)try{return J.resolve(i[l]),null}catch(u){if(!u||u.code!=="MODULE_NOT_FOUND")throw u;a=u}return a}return null},"__napiWasiResolveCandidate");if(!t&&(!bt||wt==="wasm32-wasi")){let s=null,o=!1;try{s=r("./parser.wasi.cjs",!1,["./parser.wasm32-wasi.debug.wasm","./parser.wasm32-wasi.wasm"]),o=s!==null,o||(e=J("./parser.wasi.cjs"),Je=e,er="wasm32-wasi",t=!0)}catch(i){s=i,o=!0}o&&(n.push(s),Q.push(s))}if(!t&&(!bt||wt==="wasm32-wasip1")){let s=null,o=!1;try{s=r("./parser.wasip1.cjs",!1,["./parser.wasm32-wasip1.debug.wasm","./parser.wasm32-wasip1.wasm"]),o=s!==null,o||(e=J("./parser.wasip1.cjs"),Je=e,er="wasm32-wasip1",t=!0)}catch(i){s=i,o=!0}o&&(n.push(s),Q.push(s))}if(!t&&(!bt||wt==="wasm32-wasi")){let s=null,o=!1;try{if(s=r("@oxc-parser/binding-wasm32-wasi",!0,void 0),o=s!==null,!o){if(process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0"){let i=J("@oxc-parser/binding-wasm32-wasi/package.json").version;if(i!=="0.160.0")throw new Error(`WASI binding package version mismatch, expected 0.160.0 but got ${i}. You can reinstall dependencies to fix this issue.`)}e=J("@oxc-parser/binding-wasm32-wasi"),Je=e,er="wasm32-wasi",t=!0}}catch(i){s=i,o=!0}o&&(n.push(s),Q.push(s))}if(!t&&(!bt||wt==="wasm32-wasip1")){let s=null,o=!1;try{if(s=r("@oxc-parser/binding-wasm32-wasip1",!0,void 0),o=s!==null,!o){if(process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0"){let i=J("@oxc-parser/binding-wasm32-wasip1/package.json").version;if(i!=="0.160.0")throw new Error(`WASI binding package version mismatch, expected 0.160.0 but got ${i}. You can reinstall dependencies to fix this issue.`)}e=J("@oxc-parser/binding-wasm32-wasip1"),Je=e,er="wasm32-wasip1",t=!0}}catch(i){s=i,o=!0}o&&(n.push(s),Q.push(s))}if(!t&&wo&&!bo&&!bt&&(Je=nc()),(bo||bt)&&!t){let s=new Error(bt?'WASI binding for flavor "'+wt+'" not found':"WASI binding not found and NAPI_RS_FORCE_WASI is set to error");throw s.cause=rc(n),s}}if(!Je&&globalThis.process?.versions?.webcontainer)try{Je=J("./webcontainer-fallback.cjs")}catch(e){Q.push(e)}if(!Je){if(Q.length>0){let e=new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.");throw e.cause=rc(Q),e}throw new Error("Failed to load native binding")}({Severity:Qd,ParseResult:em,ExportExportNameKind:tm,ExportImportNameKind:nm,ExportLocalNameKind:rm,ImportNameKind:sm,parse:om,parseSync:sc,rawTransferSupported:am}=Je),{getBufferOffset:Fh,parseRaw:Bh,parseRawSync:Vh}=Je});function oc(e){let{module:t,comments:n,errors:r}=e,s=e.program,o;return{get program(){return o||(o=im(s),s=null),o},module:t,comments:n,errors:r}}function im(e){let{node:t,fixes:n}=JSON.parse(e);for(let r of n)cm(t,r);return t}function cm(e,t){let n=e;for(let r of t)n=n[r];if(n.bigint)n.value=BigInt(n.bigint);else try{n.value=RegExp(n.regex.pattern,n.regex.flags)}catch{}}var ac=ke(()=>{c(oc,"wrap");c(im,"jsonParseAst");c(cm,"applyFix")});var G,fe,ic,Vr,It,dn,cc,lc,$t,uc,pc,dc,$o,vo,mc,fc,hc,gc,qr,Eo,yc,bc,wc,Ht,$c,lm,vc=ke(()=>{({freeze:G}=Object),fe=G([]),ic=G(["decorators","key","typeAnnotation","value"]),Vr=G(["left","right"]),It=G(["argument"]),dn=G(["body"]),cc=G(["label"]),lc=G(["callee","typeArguments","arguments"]),$t=G(["expression"]),uc=G(["decorators","id","typeParameters","superClass","superTypeArguments","implements","body"]),pc=G(["test","consequent","alternate"]),dc=G(["left","right","body"]),$o=G(["id","typeParameters","params","returnType","body"]),vo=G(["key","value"]),mc=G(["local"]),fc=G(["object","property"]),hc=G(["decorators","key","typeAnnotation"]),gc=G(["expression","typeAnnotation"]),qr=G(["typeParameters","params","returnType"]),Eo=G(["expression","typeArguments"]),yc=G(["members"]),bc=G(["id","body"]),wc=G(["types"]),Ht=G(["typeAnnotation"]),$c=G(["params"]),lm=G({DebuggerStatement:fe,EmptyStatement:fe,Literal:fe,PrivateIdentifier:fe,Super:fe,TemplateElement:fe,ThisExpression:fe,JSXClosingFragment:fe,JSXEmptyExpression:fe,JSXIdentifier:fe,JSXOpeningFragment:fe,JSXText:fe,TSAnyKeyword:fe,TSBigIntKeyword:fe,TSBooleanKeyword:fe,TSIntrinsicKeyword:fe,TSJSDocUnknownType:fe,TSNeverKeyword:fe,TSNullKeyword:fe,TSNumberKeyword:fe,TSObjectKeyword:fe,TSStringKeyword:fe,TSSymbolKeyword:fe,TSThisType:fe,TSUndefinedKeyword:fe,TSUnknownKeyword:fe,TSVoidKeyword:fe,AccessorProperty:ic,ArrayExpression:G(["elements"]),ArrayPattern:G(["decorators","elements","typeAnnotation"]),ArrowFunctionExpression:G(["typeParameters","params","returnType","body"]),AssignmentExpression:Vr,AssignmentPattern:G(["decorators","left","right","typeAnnotation"]),AwaitExpression:It,BinaryExpression:Vr,BlockStatement:dn,BreakStatement:cc,CallExpression:lc,CatchClause:G(["param","body"]),ChainExpression:$t,ClassBody:dn,ClassDeclaration:uc,ClassExpression:uc,ConditionalExpression:pc,ContinueStatement:cc,Decorator:$t,DoWhileStatement:G(["body","test"]),ExportAllDeclaration:G(["exported","source","attributes"]),ExportDefaultDeclaration:G(["declaration"]),ExportNamedDeclaration:G(["declaration","specifiers","source","attributes"]),ExportSpecifier:G(["local","exported"]),ExpressionStatement:$t,ForInStatement:dc,ForOfStatement:dc,ForStatement:G(["init","test","update","body"]),FunctionDeclaration:$o,FunctionExpression:$o,Identifier:G(["decorators","typeAnnotation"]),IfStatement:pc,ImportAttribute:vo,ImportDeclaration:G(["specifiers","source","attributes"]),ImportDefaultSpecifier:mc,ImportExpression:G(["source","options"]),ImportNamespaceSpecifier:mc,ImportSpecifier:G(["imported","local"]),LabeledStatement:G(["label","body"]),LogicalExpression:Vr,MemberExpression:fc,MetaProperty:G(["meta","property"]),MethodDefinition:G(["decorators","key","value"]),NewExpression:lc,ObjectExpression:G(["properties"]),ObjectPattern:G(["decorators","properties","typeAnnotation"]),ParenthesizedExpression:$t,Program:dn,Property:vo,PropertyDefinition:ic,RestElement:G(["decorators","argument","typeAnnotation"]),ReturnStatement:It,SequenceExpression:G(["expressions"]),SpreadElement:It,StaticBlock:dn,SwitchCase:G(["test","consequent"]),SwitchStatement:G(["discriminant","cases"]),TaggedTemplateExpression:G(["tag","typeArguments","quasi"]),TemplateLiteral:G(["quasis","expressions"]),ThrowStatement:It,TryStatement:G(["block","handler","finalizer"]),UnaryExpression:It,UpdateExpression:It,V8IntrinsicExpression:G(["name","arguments"]),VariableDeclaration:G(["declarations"]),VariableDeclarator:G(["id","init"]),WhileStatement:G(["test","body"]),WithStatement:G(["object","body"]),YieldExpression:It,JSXAttribute:G(["name","value"]),JSXClosingElement:G(["name"]),JSXElement:G(["openingElement","children","closingElement"]),JSXExpressionContainer:$t,JSXFragment:G(["openingFragment","children","closingFragment"]),JSXMemberExpression:fc,JSXNamespacedName:G(["namespace","name"]),JSXOpeningElement:G(["name","typeArguments","attributes"]),JSXSpreadAttribute:It,JSXSpreadChild:$t,TSAbstractAccessorProperty:hc,TSAbstractMethodDefinition:vo,TSAbstractPropertyDefinition:hc,TSArrayType:G(["elementType"]),TSAsExpression:gc,TSCallSignatureDeclaration:qr,TSClassImplements:Eo,TSConditionalType:G(["checkType","extendsType","trueType","falseType"]),TSConstructSignatureDeclaration:qr,TSConstructorType:qr,TSDeclareFunction:$o,TSEmptyBodyFunctionExpression:G(["id","typeParameters","params","returnType"]),TSEnumBody:yc,TSEnumDeclaration:bc,TSEnumMember:G(["id","initializer"]),TSExportAssignment:$t,TSExternalModuleReference:$t,TSFunctionType:qr,TSImportEqualsDeclaration:G(["id","moduleReference"]),TSImportType:G(["source","options","qualifier","typeArguments"]),TSIndexSignature:G(["parameters","typeAnnotation"]),TSIndexedAccessType:G(["objectType","indexType"]),TSInferType:G(["typeParameter"]),TSInstantiationExpression:Eo,TSInterfaceBody:dn,TSInterfaceDeclaration:G(["id","typeParameters","extends","body"]),TSInterfaceHeritage:Eo,TSIntersectionType:wc,TSJSDocNonNullableType:Ht,TSJSDocNullableType:Ht,TSLiteralType:G(["literal"]),TSMappedType:G(["key","constraint","nameType","typeAnnotation"]),TSMethodSignature:G(["key","typeParameters","params","returnType"]),TSModuleBlock:dn,TSModuleDeclaration:bc,TSNamedTupleMember:G(["label","elementType"]),TSNamespaceExportDeclaration:G(["id"]),TSNonNullExpression:$t,TSOptionalType:Ht,TSParameterProperty:G(["decorators","parameter"]),TSParenthesizedType:Ht,TSPropertySignature:G(["key","typeAnnotation"]),TSQualifiedName:Vr,TSRestType:Ht,TSSatisfiesExpression:gc,TSTemplateLiteralType:G(["quasis","types"]),TSTupleType:G(["elementTypes"]),TSTypeAliasDeclaration:G(["id","typeParameters","typeAnnotation"]),TSTypeAnnotation:Ht,TSTypeAssertion:G(["typeAnnotation","expression"]),TSTypeLiteral:yc,TSTypeOperator:Ht,TSTypeParameter:G(["name","constraint","default"]),TSTypeParameterDeclaration:$c,TSTypeParameterInstantiation:$c,TSTypePredicate:G(["parameterName","typeAnnotation"]),TSTypeQuery:G(["exprName","typeArguments"]),TSTypeReference:G(["typeName","typeArguments"]),TSUnionType:wc})});var Ec=ke(()=>{});var xc=ke(()=>{Br()});import{createRequire as um}from"node:module";function fm(){xo===null&&({parseSyncRaw:xo,parse:pm}=Sc("./raw-transfer/eager.js"))}function hm(){So===null&&({parseSyncLazy:So,parse:dm,Visitor:mm}=Sc("./raw-transfer/lazy.js"))}function ko(e,t,n){return n?.experimentalRawTransfer?(fm(),xo(e,t,n)):n?.experimentalLazy?(hm(),So(e,t,n)):oc(sc(e,t,n))}var Sc,xo,pm,So,dm,mm,kc=ke(()=>{Br();ac();vc();Ec();Br();xc();Sc=um(import.meta.url),xo=null,So=null;c(fm,"loadRawTransfer");c(hm,"loadRawTransferLazy");c(ko,"parseSync")});import gm from"node:fs";import To from"node:path";import{fileURLToPath as ym}from"node:url";function vm(e,t){return String(e).localeCompare(String(t))}function Tc(e){let t=$m.exec(e);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]??null}:null}function Oc(e,t){let n=Tc(e),r=Tc(t);if(!n||!r)throw new TypeError(`Cannot compare invalid versions ${String(e)} and ${String(t)}`);for(let s of["major","minor","patch"])if(n[s]!==r[s])return n[s]-r[s];return n.prerelease===r.prerelease?0:n.prerelease===null?1:r.prerelease===null?-1:vm(n.prerelease,r.prerelease)}function Em(e){try{return gm.readFileSync(To.join(wm,e),"utf8")}catch(t){if(t?.code==="ENOENT")return null;throw t}}function xm(e){return[...Ac,...Ao].includes(e?.kind)?`exportDeprecations ${e.kind} ${e?.module}#${e?.name}`:`exportDeprecations ${e?.kind} ${e?.name}`}function Ro(e){if(e===null)return null;if(typeof e=="string")return e;if(e&&typeof e=="object"&&!Array.isArray(e)){if(Object.hasOwn(e,"import"))return Ro(e.import);if(Object.hasOwn(e,"default"))return Ro(e.default)}}function Nc(e,t){if(Object.hasOwn(e,t))return{value:e[t],capture:null};let n=Object.keys(e).filter(r=>r.includes("*")).sort((r,s)=>s.indexOf("*")-r.indexOf("*")||s.length-r.length);for(let r of n){let[s,o]=r.split("*");if(!t.startsWith(s)||!t.endsWith(o)||t.length<s.length+o.length)continue;let i=t.slice(s.length,o?-o.length:void 0);return{value:e[r],capture:i}}return null}function _c(e,t){let n=Nc(e,t),r=n&&Ro(n.value);return r&&n.capture!==null?r.replaceAll("*",n.capture):r}function Sm(e,t,n,{exportsMap:r,readSource:s},o,i=!1){if(typeof t!="string"||t!=="."&&!t.startsWith("./")||t.split("/").some(h=>h===".."))return o.push(`${e}: ${n} is not a package export`),null;if(t.includes("*"))return o.push(`${e}: ${n} must name one exact export, not a pattern`),null;let a=_c(r,t);if(!a)return o.push(`${e}: ${n} is not a package export`),null;let l=(i?/^\.\/dist\/(.+)\.css$/:/^\.\/dist\/(.+)\.js$/).exec(a);if(!l)return o.push(`${e}: ${n} does not resolve to a built ${i?"CSS stylesheet":"JavaScript module"}`),null;let u=`src/${l[1]}.${i?"css":"ts"}`,m=s(u);return typeof m!="string"?(o.push(`${e}: ${n} has no ${i?"CSS":"TypeScript"} source at ${u}`),null):{sourcePath:u,source:m}}function Rc(e,t,n){let r=e.findLast(s=>s.end<=n);return!r||!/^\s*$/.test(t.slice(r.end,n))?null:r.value}function km({sourcePath:e,source:t}){let n=ko(e,t);if(n.errors.length)return null;let r=n.comments.filter(o=>o.type==="Block"&&o.value.startsWith("*")),s=new Map;for(let o of n.module.staticExports)for(let i of o.entries){let a=i.exportName?.name;if(!a)continue;let l=Rc(r,t,i.start)??Rc(r,t,o.start)??"";s.set(a,{isType:i.isType===!0,deprecated:/@deprecated\b/.test(l)})}return s}function Tm(e,t,n,r){let s=km(t);return s||r.push(`${e}: ${n} source ${t.sourcePath} does not parse`),s}function Rm(e,t){let n=ko(e.sourcePath,e.source);if(n.errors.length)return null;let r=!1,s=c(o=>{if(!(!o||typeof o!="object"||r))if((o.type==="Literal"||o.type==="StringLiteral")&&o.value===t)r=!0;else for(let[i,a]of Object.entries(o))i!=="comments"&&(Array.isArray(a)?a.forEach(s):a&&typeof a=="object"&&s(a))},"visit");return s(n.program),r}function mn(e,{packageJson:t,readSource:n=Em,exportDeprecations:r=[]}){let s={status:"invalid",sourcePath:null,isType:null,deprecated:null,findings:[]},o=xm(e);if(!bm.includes(e?.kind))return s.findings.push(`${o}: unsupported export kind`),s;let i=e.kind==="entry-point"||e.kind==="stylesheet",a=i?e.name:e.module;if(typeof a!="string"||a!=="."&&!a.startsWith("./")||a.includes("*")||a.split("/").some(f=>f===".."))return s.findings.push(`${o}: must name one exact package export`),s;if(typeof e.name!="string"||!e.name)return s.findings.push(`${o}: contract name is required`),s;let l=Ao.includes(e.kind);if(l&&!(e.kind==="window-event"?/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/:/^data-lr-[a-z0-9]+(?:-[a-z0-9]+)*$/).test(e.name))return s.findings.push(`${o}: invalid ${e.kind} name`),s;let u=t?.exports;if(!u||typeof u!="object"||Array.isArray(u))return s.findings.push(`${o}: a current package exports map is required`),s;let m=Nc(u,a),h=m&&_c(u,a);if(!m||h===null)return{...s,status:"absent"};if(typeof h!="string"||!h)return s.findings.push(`${o}: package export conditions cannot be resolved`),s;let y=Sm(o,a,a,{exportsMap:u,readSource:n},s.findings,e.kind==="stylesheet");if(!y)return s;s.sourcePath=y.sourcePath;let w=r.some(f=>f.kind===e.kind&&f.name===e.name&&(f.module??null)===(e.module??null));if(e.kind==="stylesheet")return{...s,status:"present",deprecated:w};if(l){let f=Rm(y,e.name);if(f===null)s.findings.push(`${o}: source ${y.sourcePath} does not parse`);else return{...s,status:f?"present":"absent",deprecated:f?w:null};return s}let E=Tm(o,y,a,s.findings);if(!E)return s;if(i)return{...s,status:"present",deprecated:w};let x=E.get(e.name);return x?{...s,status:"present",isType:x.isType,deprecated:x.deprecated||w}:{...s,status:"absent"}}var fg,hg,Ac,Ao,bm,wm,$m,Wr=ke(()=>{"use strict";kc();fg=Object.freeze(["stable","experimental"]),hg=Object.freeze(["background","color","inline-size"]),Ac=Object.freeze(["type","function","constant","class"]),Ao=Object.freeze(["window-event","root-attribute"]),bm=Object.freeze(["entry-point","stylesheet",...Ac,...Ao]),wm=To.resolve(To.dirname(ym(import.meta.url)),".."),$m=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?$/;c(vm,"compareText");c(Tc,"parseVersion");c(Oc,"compareVersions");c(Em,"defaultReadSource");c(xm,"exportDeprecationLabel");c(Ro,"exportTarget");c(Nc,"resolveExportMapping");c(_c,"resolveExportTarget");c(Sm,"exportSource");c(Rc,"leadingJsDoc");c(km,"moduleExportsByName");c(Tm,"moduleExportsOrFinding");c(Rm,"moduleContainsContract");c(mn,"inspectExportContract")});function re(e,t){if(!e)throw new Error(t)}function ve(e){let t=typeof e=="string"&&Om.exec(e);return re(t,`Expected a stable published version, received ${String(e)}`),t.slice(1).map(Number)}function tt(e,t){let n=ve(e),r=ve(t);for(let s=0;s<3;s++)if(n[s]!==r[s])return n[s]-r[s];return 0}function Cc(e){if(e&&typeof e=="object"){for(let t of Object.values(e))Cc(t);Object.freeze(e)}return e}function me(e){re(Kr(e),"Invalid compatibility identity");let t=c(n=>typeof n=="string"&&!/[\u0000-\u001f]/u.test(n),"text");return e.scope==="member"?(re(/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(e.tag)&&Ic.has(e.kind)&&t(e.name)&&(e.name.length>0||["slot","slot-content"].includes(e.kind)),"Invalid member identity"),JSON.stringify(["member",e.tag,e.kind,e.name])):(re(e.scope==="export"&&Am.has(e.kind)&&t(e.name)&&e.name.length>0&&(e.module==null||t(e.module)&&e.module.length>0),"Invalid export identity"),JSON.stringify(["export",e.kind,e.module??null,e.name]))}function Ae(e,t="member"){return t==="member"?{scope:t,tag:e.tag,kind:e.kind,name:e.name}:{scope:t,kind:e.kind,module:e.module??null,name:e.name}}function Hr(e,t){let n=new Map,r=c(o=>n.set(me(Ae(o,"export")),o),"add"),s=new Set(e.exportDeprecations.map(o=>me(Ae(o,"export"))));for(let o of e.exportDeprecations)r(o);for(let o of t)for(let i of o.records)i.key.scope!=="export"||s.has(me(i.key))||(r(i.policy),r({...i.policy.replacement,module:i.policy.replacement.module??i.policy.module}));return[...n.values()]}function vt(e,t,n){return t==="component"?e?{name:e.tag,deprecated:!!e.maturity?.deprecated}:null:e?.surface?.[nr[t==="slot-content"?"slot":t]]?.find(r=>r.name===n)??null}function Mc(e){let t=[...e.maturity?.deprecations??[]];return e.maturity?.deprecated&&!t.some(n=>n.kind==="component")&&t.push(e.maturity.deprecated),t}function fn(e,t,n){let r=Object.create(null);for(let s of e){let o=t(s);re(!Object.hasOwn(r,o),`Duplicate ${n}: ${o}`),r[o]=s}return r}function Nm({metadata:e,packageJson:t,readSource:n}){let r=new Map;for(let s of e.exportDeprecations){if(ve(s.removalNotBefore)[0]>ve(t.version)[0]+1)continue;let o={...s.replacement,module:s.replacement.module??s.module},i=Ae(o,"export"),a=mn(o,{packageJson:t,readSource:n,exportDeprecations:e.exportDeprecations});re(a.status==="present"&&!a.deprecated,`Published replacement export is unavailable: ${me(i)}`),r.set(me(i),{key:i,sourcePath:a.sourcePath,isType:a.isType,deprecated:a.deprecated})}return[...r.values()]}function jc({metadata:e,inventory:t,packageJson:n,renameLedger:r,manifest:s,exportSources:o={}},i=1){re(i===1,`Unsupported compatibility reader ${i}`),re(e?.schemaVersion===2&&t?.schemaVersion===1&&r?.schemaVersion===1&&s?.schemaVersion==="1.0.0","Unsupported published input schema");let a=n?.version;ve(a),re(n.name==="@aceshooting/lyra-ui"&&t.pins?.lyraVersion===a&&e.history?.current?.version===a,"Published input versions disagree");let l=t.components.map(p=>({tag:p.tag,maturity:{deprecated:Jt(p.maturity?.deprecated??null),deprecations:Jt(p.maturity?.deprecations??[])},surface:Object.fromEntries(Object.values(nr).map(N=>[N,(p.surface?.[N]??[]).map(T=>Object.fromEntries(["name","type","attribute","property","reflects","hasDefault","default","deprecated"].filter(C=>Object.hasOwn(T,C)).map(C=>[C,C==="deprecated"?!!T[C]:Jt(T[C])])))]))})),u=fn(l,p=>p.tag,"published owner"),m=[...e.deprecations.map(p=>({key:Ae(p),policy:Jt(p)})),...e.exportDeprecations.map(p=>({key:Ae(p,"export"),policy:Jt(p)}))];fn(m,p=>me(p.key),"published policy");for(let{key:p,policy:N}of m)if(ve(N.since),ve(N.removalNotBefore),re(tt(N.since,a)<=0,"Published notice predates its release incorrectly"),p.scope==="member"){let T=Mc(u[p.tag]??{}).find(C=>me(Ae(C))===me(p));re(T&&Ur(T,N),`Published inventory policy disagrees: ${me(p)}`),re(vt(u[p.tag],p.kind,p.name),`Published source member missing: ${me(p)}`)}let h=Object.fromEntries(tr.map(p=>[p,Object.create(null)]));for(let p of l)for(let N of tr)for(let T of p.surface[nr[N]])(h[N][T.name]??=[]).push(p.tag);for(let p of Object.values(h))for(let N of Object.values(p))N.sort();let y=new Set(m.filter(p=>p.key.scope==="member").flatMap(({key:p,policy:N})=>[me(p),...N.attribute?[me({...p,kind:"attribute",name:N.attribute})]:[]])),w=[...hr(t)].map(([p,N])=>{let[T,C,I]=p.split("\0");return{tag:T,kind:C,name:I,upstreamTag:N}}).filter(p=>y.has(me(Ae(p)))),E=l.map(({tag:p,surface:N})=>({tag:p,surface:N})),f=m.filter(p=>ve(p.policy.removalNotBefore)[0]===ve(a)[0]+1&&ve(p.policy.since)[0]<ve(a)[0]).map(p=>p.policy.since).sort(tt)[0],S=f?(e.history.releases??[]).filter(p=>tt(p.version,f)>=0&&tt(p.version,a)<0).map(({tag:p,version:N,sourceCommit:T})=>({tag:p,version:N,sourceCommit:T})):[];return{schemaVersion:1,sourceRelease:`lyra-ui@${a}`,sourceVersion:a,records:m,components:E,mirrors:w,exposure:h,renameLedger:Jt(r),policyReleaseHistory:S,publishedExports:Nm({metadata:e,packageJson:n,readSource:c(p=>(re(Object.hasOwn(o,p),`Missing published export source ${p}`),o[p]),"readSource")})}}function Jr({packageVersion:e,releaseVersion:t=e,successors:n=[],currentInventory:r,currentExportDeprecations:s=[],currentExportSurface:o=null,componentRegistrationRoutes:i={},captures:a=[],retirementIndex:l=[]}){ve(e),ve(t),re(Array.isArray(a)&&Array.isArray(l),"Compatibility captures and retirements must be arrays");let u=fn(r.components,k=>k.tag,"current owner");re(Kr(i),"Current component registration routes must be an object");for(let[k,j]of Object.entries(i))re(u[k],`Registration route references an unknown current component: ${k}`),re(j===`./components/${k}.js`,`Registration route is not the stable tag-shaped route for ${k}`);let m=fn([...r.components.flatMap(k=>Mc(k).map(j=>({key:Ae(j),policy:j}))),...s.map(k=>({key:Ae(k,"export"),policy:k}))],k=>me(k.key),"current policy"),h=fn(o??[],k=>me(k.key),"current export surface"),y=fn(l,k=>me(k.key),"retirement"),w=new Set([...hr(r)].map(([k])=>{let[j,M,F]=k.split("\0");return me(Ae({tag:j,kind:M,name:F}))})),E=c(k=>p.has(k)&&w.has(k),"protectedMirror"),x=Object.create(null),f=Object.create(null),S=new Map,p=new Set,N=Object.fromEntries(tr.map(k=>[k,Object.create(null)])),T=c((k,j,M)=>{N[k][j]=[...new Set([...N[k][j]??[],...M])].sort()},"addExposure");for(let k of a){ve(k.sourceVersion),re(k.sourceRelease===`lyra-ui@${k.sourceVersion}`&&tt(k.sourceVersion,e)<=0,"Invalid published capture version"),re(!S.has(k.sourceRelease),`Duplicate published capture: ${k.sourceRelease}`),S.set(k.sourceRelease,k);for(let j of k.components){let M=f[j.tag];(!M||tt(k.sourceVersion,M.version)>0)&&(f[j.tag]={version:k.sourceVersion,component:j})}for(let j of k.mirrors)p.add(me(Ae(j)));for(let j of tr)for(let[M,F]of Object.entries(k.exposure[j]))T(j,M,F);for(let j of k.records){let M=me(j.key);ve(j.policy.since),ve(j.policy.removalNotBefore),re(tt(j.policy.since,k.sourceVersion)<=0,`Unpublished policy: ${M}`),re(!x[M]||Ur(x[M].policy,j.policy),`Conflicting published policy: ${M}`),x[M]??={...j,sources:[]},x[M].sources.push(k.sourceRelease)}}for(let k of r.components)for(let j of tr)for(let M of k.surface?.[nr[j]]??[])T(j,M.name,[k.tag]);let C=Object.create(null),I=Object.create(null),W=c(k=>{if(u[k])return k;let j=me({scope:"member",tag:k,kind:"component",name:k}),M=x[j]?.policy,F=y[j];return re(M?.replacement?.kind==="component"&&F&&tt(t,F.removedIn)>=0&&u[M.replacement.name],`Historical owner ${k} has no current supported replacement`),M.replacement.name},"effectiveOwner"),$=c((k,j,M)=>{if(typeof k!="string"||!Ic.has(j)||typeof M!="string")return null;let F=me({scope:"member",tag:k,kind:j,name:M}),D=n.find(_=>me({scope:"member",..._.key})===F);if(D&&!vt(u[k],j,M))return D.replacement;let O=x[F];return O&&y[F]&&!vt(u[k],j,M)&&Kr(O.policy.replacement)&&O.policy.replacement.kind!=="host-css-property"?O.policy.replacement:null},"retiredSuccessor"),L=c((k,j,M)=>{for(let F=0;F<8;F++){let D=vt(u[k],j,M);if(D)return D;let O=$(k,j,M);if(!O)return;O.kind==="component"&&(k=O.name),j=O.kind,M=O.name}},"resolveMember"),d=c((k,j,M)=>{let F=new Set;for(;;){let D=me({scope:"member",tag:k,kind:j,name:M});if(F.has(D))return!1;F.add(D);let O=vt(u[k],j,M);if(!O){let K=$(k,j,M);if(!K)return!1;K.kind==="component"&&(k=K.name),j=K.kind,M=K.name;continue}if(!O.deprecated)return!0;let _=m[D]?.policy?.replacement;if(!_||_.kind==="host-css-property")return!1;_.kind==="component"&&(k=_.name),j=_.kind,M=_.name}},"hasSupportedMemberSuccessor");for(let[k,j]of Object.entries(x)){let{key:M,policy:F,sources:D}=j,O=m[k],_=y[k],K=M.scope==="member"?vt(u[M.tag],M.kind,M.name):h[k];if(O)re(Ur(O.policy,F),`The published policy has changed: ${k}`),(M.scope==="member"||o!==null)&&re(K,`Current notice references a missing source member or export: ${k}`),C[k]={state:"current",key:M,policy:F,sourceMember:K,sourceOwner:M.tag??null};else{M.scope==="member"&&M.kind==="property"&&F.attribute&&re(!vt(u[M.tag],"attribute",F.attribute),`Current notice is missing for surviving paired attribute: ${k}`),re(!K||M.kind==="slot-content",`Current notice is missing for surviving source: ${k}`),re(_,`Missing retirement record: ${k}`),re(D.includes(_.sourceRelease),`Retirement has no exact published source: ${k}`);let Z=S.get(_.sourceRelease),te=M.scope==="member"?Z?.components.find(Ie=>Ie.tag===M.tag)??null:null,ce=M.scope==="member"&&te?vt(te,M.kind,M.name):null;M.scope==="member"&&(re(te,`Retirement has no exact published source component: ${k}`),re(ce,`Retirement has no exact published source member: ${k}`)),re(tt(t,_.removedIn)>=0,`Cannot remove ${k} before ${_.removedIn}`),re(tt(_.removedIn,F.removalNotBefore)>=0&&ve(F.removalNotBefore)[0]>=ve(F.since)[0]+2,`Retirement violates published floor: ${k}`);let se=M.scope==="member"&&M.kind==="property"&&F.attribute?me({...M,kind:"attribute",name:F.attribute}):null;re(!E(k)&&(!se||!E(se)),`Protected upstream mirrored member cannot retire: ${k}`),M.kind==="slot-content"&&re(K,`Retired slot content requires its surviving public slot: ${k}`);let le=F.replacement;re(Kr(le),`Missing replacement: ${k}`);let we,ge=null;if(M.scope==="member")ge=le.kind==="component"?le.name:W(M.tag),we=L(ge,le.kind,le.name),le.kind==="host-css-property"&&["background","color","inline-size"].includes(le.name)&&(we={name:le.name});else{let Ie=Ae({...le,module:le.module??F.module},"export");we=h[me(Ie)]}let be=a.some(Ie=>{if(!D.includes(Ie.sourceRelease)||ve(Ie.sourceVersion)[0]<ve(F.removalNotBefore)[0]-1)return!1;if(M.scope==="export"){let ze=me(Ae({...le,module:le.module??F.module},"export"));return Ie.publishedExports?.some(xt=>me(xt.key)===ze&&!xt.deprecated)}if(le.kind==="host-css-property")return["background","color","inline-size"].includes(le.name);let st=Ie.components.find(ze=>ze.tag===ge),ut=vt(st,le.kind,le.name);return le.kind==="component"&&Ie.records.some(ze=>ze.key.scope==="member"&&ze.key.kind==="component"&&ze.key.tag===st?.tag)?!1:ut&&!ut.deprecated});re(be,`Replacement was not available in the published compatibility window: ${k}`);let Ge=M.scope==="member"&&le.kind!=="host-css-property"?d(ge,le.kind,le.name):we&&!we.deprecated;re(we&&Ge,`Missing current supported replacement: ${k}`),C[k]={state:"retired",key:M,policy:F,removedIn:_.removedIn,sourceComponent:te,sourceMember:ce,sourceOwner:M.tag??null,replacementOwner:ge,replacementMember:we}}if(M.scope==="member"&&M.kind==="property"&&F.attribute){let Z=me({...M,kind:"attribute",name:F.attribute});re(!x[Z]||Ur(x[Z].policy,F),`Paired attribute policy collision: ${Z}`),re(!I[Z]||I[Z]===k,`Paired attribute identity collision: ${Z}`),I[Z]=k}}for(let[k,j]of Object.entries(y)){re(x[k],`Retirement has no published record: ${k}`),ve(j.removedIn);let M=x[k];re(M.sources.includes(j.sourceRelease),`Retirement has no exact published source: ${k}`),re(tt(j.removedIn,M.policy.removalNotBefore)>=0&&ve(M.policy.removalNotBefore)[0]>=ve(M.policy.since)[0]+2,`Retirement violates published floor: ${k}`);let F=M.key.scope==="member"&&M.key.kind==="property"&&M.policy.attribute?me({...M.key,kind:"attribute",name:M.policy.attribute}):null;re(!E(k)&&(!F||!E(F)),`Protected upstream mirrored member cannot retire: ${k}`)}return Cc(Jt({schemaVersion:1,packageVersion:e,componentRegistrationRoutes:i,records:C,aliases:I,exposure:N,successors:n,sourceComponents:Object.fromEntries(Object.entries(f).map(([k,j])=>[k,j.component]))}))}var nr,tr,Ic,Am,Om,Kr,Ur,Jt,Oo=ke(()=>{"use strict";Wr();xn();nr=Object.freeze({attribute:"attributes",property:"properties",event:"events",part:"parts","css-property":"cssProperties",slot:"slots","css-state":"cssStates",method:"methods"}),tr=["event","part","css-property"],Ic=new Set([...Object.keys(nr),"component","slot-content"]),Am=new Set(["entry-point","stylesheet","function","type","constant","class","window-event","root-attribute"]),Om=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u,Kr=c(e=>e!==null&&typeof e=="object"&&!Array.isArray(e),"plain"),Ur=c((e,t)=>JSON.stringify(e)===JSON.stringify(t),"same"),Jt=c(e=>structuredClone(e),"clone");c(re,"requireThat");c(ve,"version");c(tt,"compare");c(Cc,"freeze");c(me,"compatibilityKey");c(Ae,"policyKey");c(Hr,"compatibilityExportCandidates");c(vt,"member");c(Mc,"policies");c(fn,"index");c(Nm,"publishedExportSurface");c(jc,"extractPublishedCompatibility");c(Jr,"assembleCompatibilityContext")});import xe from"node:fs";import Et from"node:path";function ct(e,t){if(!e)throw new Error(t)}function zc(e,t){let n=JSON.parse(e),r=e.match(/"(?:\\.|[^"\\])*"|[{}[\]:,]|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/g),s=0;function o(){let i=r[s++];if(i==="{"){let a=new Set;for(;r[s]!=="}";){let l=JSON.parse(r[s++]);ct(!a.has(l),`${t}: duplicate JSON key ${l}`),a.add(l),s++,o(),r[s]===","&&s++}s++}else if(i==="["){for(;r[s]!=="]";)o(),r[s]===","&&s++;s++}}return c(o,"value"),o(),n}function Gt(e,t,{missing:n=!1,directory:r=!1}={}){ct(Et.isAbsolute(e)&&xe.realpathSync(e)===e,"Source root must be an absolute directory without symlinks");let s=Et.relative(e,t);ct(s&&!s.startsWith(`..${Et.sep}`)&&s!==".."&&!Et.isAbsolute(s),`Path escapes package: ${t}`);let o=e,i=s.split(Et.sep);for(let a=0;a<i.length;a++){o=Et.join(o,i[a]);let l=a===i.length-1;if(l&&n&&!xe.existsSync(o))try{xe.lstatSync(o)}catch(m){if(m.code==="ENOENT")return;throw m}let u=xe.lstatSync(o);ct(!u.isSymbolicLink()&&(l&&!r?u.isFile():u.isDirectory()),`Not a regular ${l&&!r?"file":"directory"} (symlinks forbidden): ${o}`)}}function nt(e,t,{missing:n=!1,binary:r=!1}={}){let s=Et.join(e,t);Gt(e,s,{missing:n});let o;try{o=xe.openSync(s,xe.constants.O_RDONLY|xe.constants.O_NOFOLLOW)}catch(i){if(n&&i.code==="ENOENT")return Gt(e,s,{missing:!0}),{file:s,original:null};throw i}try{return ct(xe.fstatSync(o).isFile(),`Not a regular source file: ${s}`),{file:s,original:xe.readFileSync(o,r?void 0:"utf8")}}finally{xe.closeSync(o)}}function Pc(e){ct(new Set(e.entries.map(i=>i.file)).size===e.entries.length,"Duplicate source write path");for(let i of e.entries){if(Buffer.isBuffer(i.original)||Buffer.isBuffer(i.expected)){ct(Buffer.isBuffer(i.original)&&i.expected===i.original,`Binary source guards must be read-only: ${i.file}`);continue}ct((typeof i.original=="string"||i.original===null)&&(typeof i.expected=="string"||i.expected===null),`Invalid source write bytes: ${i.file}`),ct(i.expected!==null||i.original===null,`Source write plans cannot delete files: ${i.file}`)}let t=c(i=>{let a=Buffer.isBuffer(i.original),l=nt(e.root,Et.relative(e.root,i.file),{missing:i.original===null,binary:a}).original;ct(a?l.equals(i.original):l===i.original,`${i.file}: changed while source fixtures were being prepared`)},"check");e.entries.forEach(t);let n=[],r=[],s,o=[];try{for(let i of e.entries.filter(a=>a.original!==a.expected)){let a=`${i.file}.source-${process.pid}-${n.length}`,l=xe.openSync(a,"wx",i.original===null?420:xe.statSync(i.file).mode);n.push({...i,temporary:a});try{xe.writeFileSync(l,i.expected)}finally{xe.closeSync(l)}}e.entries.forEach(t);for(let i of n)t(i),xe.renameSync(i.temporary,i.file),r.push(i)}catch(i){s=i;for(let a of r.reverse())try{if(nt(e.root,Et.relative(e.root,a.file),{missing:!0}).original!==a.expected)continue;if(a.original===null)xe.unlinkSync(a.file);else{let u=xe.openSync(a.temporary,"wx",xe.statSync(a.file).mode);try{xe.writeFileSync(u,a.original)}finally{xe.closeSync(u)}Gt(e.root,a.file),xe.renameSync(a.temporary,a.file)}}catch(l){o.push(l)}}finally{for(let i of n)try{Gt(e.root,i.temporary,{missing:!0}),xe.rmSync(i.temporary,{force:!0})}catch(a){o.push(a)}}if(o.length)throw new AggregateError([...s?[s]:[],...o],`${s?.message??"Source cleanup failed"}; some concurrent paths could not be restored or cleaned`);if(s)throw s}var Gr=ke(()=>{"use strict";c(ct,"invariant");c(zc,"parseSourceJson");c(Gt,"assertRegularSourcePath");c(nt,"readSourceSnapshot");c(Pc,"commitSourceWritePlan")});var Bc={};ra(Bc,{assembleComponentMetadata:()=>hn,commitComponentMetadataWritePlan:()=>jm,componentMetadataSourceFindings:()=>Cm,createComponentMetadataWritePlan:()=>Mm,partitionComponentMetadata:()=>Fc,readComponentMetadataSources:()=>Io});import rr from"node:fs";import lt from"node:path";import{fileURLToPath as _m}from"node:url";function he(e,t){if(!e)throw new Error(t)}function Ct(e,t,n){he(e&&typeof e=="object"&&!Array.isArray(e),`${n}: expected an object`);for(let r of Object.keys(e))he(t.includes(r),`${n}: unexpected key ${r}`);for(let r of t)he(Object.hasOwn(e,r),`${n}: missing key ${r}`)}function Io(e=Im){e=lt.resolve(e),he(rr.realpathSync(e)===e,"Metadata package root must not traverse symlinks");let t=[],n=c(x=>{let f=nt(e,x);return t.push(f),zc(f.original,x)},"read"),r=n("scripts/component-families.json"),s=n("scripts/fixtures/component-inventory.json"),o=r.families.map(x=>x.key);he(o.every(x=>/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(x))&&new Set(o).size===o.length,"Invalid or duplicate family names");let i=Object.fromEntries((s.components??[]).map(x=>[x.tag,x.family]));for(let[x,f]of Object.entries(r.directories??{})){let S=`lr-${x}`;Object.hasOwn(i,S)?he(i[S]===f,`${S}: catalog and inventory family differ`):i[S]=f}let a=["policy.json","profiles.json","exports.json","history.json","families"],l=lt.join(e,Yt);Gt(e,l,{directory:!0}),he(JSON.stringify(rr.readdirSync(l).sort())===JSON.stringify(a.sort()),"Unexpected or missing metadata source files"),Gt(e,lt.join(l,"families"),{directory:!0}),he(JSON.stringify(rr.readdirSync(lt.join(l,"families")).sort())===JSON.stringify(o.map(x=>`${x}.json`).sort()),"Unexpected or missing metadata family files");let u=n(`${Yt}/policy.json`),m=n(`${Yt}/profiles.json`),h=n(`${Yt}/exports.json`),y=n(`${Yt}/history.json`);Ct(u,["schemaVersion","metadataSchemaVersion","policy"],"policy.json"),Ct(m,["profiles"],"profiles.json"),Ct(h,["exportDeprecations"],"exports.json"),Ct(y,["history"],"history.json"),he(u.schemaVersion===1&&u.metadataSchemaVersion===2,"Unsupported metadata source schema");let w=o.map(x=>n(`${Yt}/families/${x}.json`));w.forEach((x,f)=>he(x.family===o[f],`${o[f]}: family file owner differs`));for(let x of w)for(let f of Object.values(x.assignments??{}).flat()){if(typeof f!="string"||Object.hasOwn(i,f)||!/^lr-[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(f))continue;let S=[];for(let[p,N]of Object.entries(r.directories??{})){let T=`src/components/${N}/${p}/${f.slice(3)}.class.ts`,C=`src/components/${f}.ts`;if(!rr.existsSync(lt.join(e,T))||!rr.existsSync(lt.join(e,C)))continue;let I=nt(e,T),W=nt(e,C);if(!I.original.split(`
3
+ `).some(d=>d.trim()===`* @customElement ${f}`))continue;let $=I.original.match(/^export class ([A-Za-z_$][\w$]*)\b/m)?.[1],L=W.original.split(`
4
+ `).map(d=>d.trim());!$||!L.includes(`import { ${$} } from './${N}/${p}/${f.slice(3)}.class.js';`)||!L.includes(`defineElement('${f.slice(3)}', ${$});`)||(t.push(I,W),S.push(N))}he(S.length<=1,`${f}: ambiguous source family owner`),S.length===1&&(i[f]=S[0])}t.push(nt(e,No,{missing:!0}));let E={packageDir:e,schemaVersion:u.metadataSchemaVersion,policy:u.policy,profiles:m.profiles,exportDeprecations:h.exportDeprecations,history:y.history,familyNames:o,familyByTag:i,families:w,snapshots:t};return hn(E),E}function hn(e){let t=Object.fromEntries(Object.keys(e.profiles).map(a=>[a,[]])),n=[],r=new Set,s=new Set,o=new Set;for(let a of e.families){Ct(a,["family","assignments","deprecations"],"family metadata"),he(e.familyNames.includes(a.family)&&!o.has(a.family),`Invalid or duplicate family ${a.family}`),o.add(a.family);let l=c(u=>he(e.familyByTag[u]===a.family,`${u}: expected family ${String(e.familyByTag[u])}, found ${a.family}`),"own");Ct(a.assignments,Object.keys(e.profiles),`${a.family} assignment profiles`);for(let[u,m]of Object.entries(a.assignments)){he(Array.isArray(m),`${u}: assignments must be an array`);for(let h of m)l(h),he(!r.has(h),`${h}: duplicate maturity assignment`),r.add(h),t[u].push(h)}he(Array.isArray(a.deprecations),`${a.family}: deprecations must be an array`);for(let u of a.deprecations){l(u.tag);let m=JSON.stringify([u.tag,u.kind,u.name]);he(!s.has(m),`${m}: duplicate member notice`),s.add(m),n.push(u)}}he(o.size===e.familyNames.length,"Missing metadata family");for(let a of Object.values(t))a.sort(Lc);n.sort((a,l)=>Lc(Dc(a),Dc(l))),he(Array.isArray(e.exportDeprecations),"exportDeprecations must be an array");let i=new Set;for(let a of e.exportDeprecations){let l=JSON.stringify([a.kind,a.module??null,a.name]);he(!i.has(l),`${l}: duplicate export notice`),i.add(l)}return he(e.history&&typeof e.history=="object"&&!Array.isArray(e.history),"history must be an object"),structuredClone({schemaVersion:e.schemaVersion,policy:e.policy,profiles:e.profiles,assignments:t,deprecations:n,exportDeprecations:e.exportDeprecations,history:e.history})}function Fc(e,{familyNames:t,familyByTag:n}){Ct(e,["schemaVersion","policy","profiles","assignments","deprecations","exportDeprecations","history"],"metadata"),he(e.schemaVersion===2,"Unsupported metadata aggregate schema"),Ct(e.assignments,Object.keys(e.profiles),"metadata assignments");let r=t.map(i=>({family:i,assignments:Object.fromEntries(Object.keys(e.profiles).map(a=>[a,[]])),deprecations:[]})),s=c(i=>{let a=r.find(l=>l.family===n[i]);return he(a,`${i}: missing metadata family owner`),a},"owner");for(let[i,a]of Object.entries(e.assignments))for(let l of a)s(l).assignments[i].push(l);for(let i of e.deprecations)s(i.tag).deprecations.push(i);let o=hn({...e,families:r,familyNames:t,familyByTag:n});return he(JSON.stringify(o)===JSON.stringify(e),"Metadata aggregate is not in canonical source order"),Object.fromEntries([["policy.json",{schemaVersion:1,metadataSchemaVersion:e.schemaVersion,policy:e.policy}],["profiles.json",{profiles:e.profiles}],["exports.json",{exportDeprecations:e.exportDeprecations}],["history.json",{history:e.history}],...r.map(i=>[`families/${i.family}.json`,i])].map(([i,a])=>[`${Yt}/${i}`,_o(a)]))}function Cm(e){return e.snapshots.find(n=>n.file===lt.join(e.packageDir,No))?.original===_o(hn(e))?[]:["component-metadata.json differs from its authored sources"]}function Mm(e,t,{extraWrites:n=[],guards:r=[],includeAggregate:s=!0,familyByTag:o=e.familyByTag}={}){let i=Fc(t,{...e,familyByTag:o});s&&(i[No]=_o(t));let a=new Map(e.snapshots.map(l=>[l.file,{...l,expected:l.original}]));for(let l of r)he(!a.has(l.file)||a.get(l.file).original===l.original,`Conflicting snapshot: ${l.file}`),a.set(l.file,{...l,expected:l.original});for(let[l,u]of Object.entries(i)){let m=lt.join(e.packageDir,l);he(a.has(m),`Missing source snapshot: ${m}`),a.get(m).expected=u}for(let l of n)he(!a.has(l.file)||a.get(l.file).original===l.original,`Conflicting snapshot: ${l.file}`),a.set(l.file,{...l});return{packageDir:e.packageDir,entries:[...a.values()]}}function jm(e){Pc({root:e.packageDir,entries:e.entries})}var Im,Yt,No,_o,Lc,Dc,Co=ke(()=>{"use strict";Gr();Im=lt.resolve(lt.dirname(_m(import.meta.url)),".."),Yt="scripts/fixtures/component-metadata",No="scripts/fixtures/component-metadata.json",_o=c(e=>`${JSON.stringify(e,null,2)}
5
+ `,"render"),Lc=c((e,t)=>String(e).localeCompare(String(t)),"compare"),Dc=c(e=>`${e.tag}:${e.kind}:${e.name}`,"memberKey");c(he,"invariant");c(Ct,"keys");c(Io,"readComponentMetadataSources");c(hn,"assembleComponentMetadata");c(Fc,"partitionComponentMetadata");c(Cm,"componentMetadataSourceFindings");c(Mm,"createComponentMetadataWritePlan");c(jm,"commitComponentMetadataWritePlan")});import{createHash as Wc}from"node:crypto";import{gzipSync as zm,gunzipSync as Pm}from"node:zlib";import{readFileSync as Lm}from"node:fs";import{join as Mo}from"node:path";function Fm(e){let t=e.filter(n=>n===Vc.migrationContract||n===Kc);if(t.length!==1)throw new Error("Missing or duplicate packed input for the migration contract");return{...Vc,migrationContract:t[0]}}function ee(e,t){if(!e)throw new Error(t)}function Zt(e){ee(typeof e=="string"&&e.length<=jo,"Invalid evidence base64");let t=Buffer.from(e,"base64");return ee(t.toString("base64")===e,"Noncanonical evidence base64"),t}function Uc(e){return zm(Ne(e),{level:9})}function gn(e,t=jo){return ee(e.length<=jo,"Compressed evidence exceeds size limit"),JSON.parse(Pm(e,{maxOutputLength:t}).toString("utf8"))}function Hc(e,t){return ee(ie(t)===e?.evidenceArchiveSha256,"Evidence archive hash mismatch"),gn(t)}function sr(e,t){return ee(["blob","tree","commit","tag"].includes(e),"Unsupported Git object type"),Wc("sha1").update(`${e} ${t.length}\0`).update(t).digest("hex")}function zo(e){let t=new Map,n=0;for(;n<e.length;){let r=e.indexOf(32,n),s=e.indexOf(0,r+1);ee(r>n&&s>r&&s+21<=e.length,"Malformed Git tree");let o=e.subarray(n,r).toString("ascii"),i=e.subarray(r+1,s).toString("utf8");ee(!t.has(i)&&i!=="."&&i!==".."&&!i.includes("/"),"Invalid Git tree entry"),t.set(i,{mode:o,oid:e.subarray(s+1,s+21).toString("hex")}),n=s+21}return t}function Yr({pin:e,objects:t,inputs:n}){ee(qc.test(e?.commit)&&qc.test(e?.tagObject),"Invalid pinned Git identity");let r=new Map,s=new Set;for(let u of t){let m=Zt(u.data);ee(!r.has(u.oid)&&sr(u.type,m)===u.oid,"Duplicate or corrupt Git object"),r.set(u.oid,{type:u.type,bytes:m})}let o=c((u,m)=>{let h=r.get(u);return ee(h?.type===m,`Missing ${m} Git object ${u}`),s.add(u),h.bytes},"get"),i=o(e.tagObject,"tag").toString("utf8").split(`
6
6
 
7
- `)[0];ne(i.split(`
7
+ `)[0];ee(i.split(`
8
8
  `).includes(`object ${e.commit}`)&&i.split(`
9
9
  `).includes("type commit")&&i.split(`
10
10
  `).includes(`tag ${e.tag}`),"Annotated tag does not bind the pinned release");let a=/^tree ([a-f0-9]{40})$/mu.exec(o(e.commit,"commit").toString("utf8").split(`
11
11
 
12
- `)[0])?.[1];ne(a,"Commit has no tree");let l=new Set;for(let u of n){ne(typeof u.path=="string"&&u.path.split("/").every(g=>g&&g!=="."&&g!=="..")&&!u.path.includes("\\")&&!l.has(u.path),"Invalid or duplicate Git input path"),l.add(u.path);let m=u.path.split("/"),h=a;for(let[g,y]of m.entries()){let $=Ro(o(h,"tree")).get(y);ne($,`Git path is absent: ${u.path}`),g<m.length-1?(ne($.mode==="40000","Git ancestor is not a tree"),h=$.oid):ne(["100644","100755"].includes($.mode)&&$.oid===u.gitBlob&&ts("blob",tn(u.data))===$.oid,`Git source bytes disagree: ${u.path}`)}}return ne(r.size===s.size,"Evidence contains unrelated Git objects"),!0}function jc(e,t,n){ne(e?.schemaVersion===1&&e.extractorVersion===1&&n?.schemaVersion===1,"Unsupported capture schema"),ne(e.sourceRelease===`lyra-ui@${e.sourceVersion}`&&e.package?.name==="@aceshooting/lyra-ui"&&e.package.version===e.sourceVersion,"Capture release identity mismatch"),ne(/^[a-f0-9]{64}$/u.test(e.package.tarballSha256)&&/^sha512-[A-Za-z0-9+/]{86}==$/u.test(e.package.registryIntegrity),"Invalid published tarball pin");let s=ud(e.inputs.filter(f=>f.origin==="packed").map(f=>f.path)),r=[...Object.entries(ld).map(([f,E])=>({origin:"source",role:f,path:`packages/lyra-ui/${E}`})),...Object.entries(s).map(([f,E])=>({origin:"packed",role:f,path:E}))];ne(e.inputs.length>=r.length,"Unexpected evidence input inventory");let o={source:{},packed:{}},i=new Set,a=[];for(let[f,E]of r.entries()){let p=e.inputs[f];ne(["origin","role","path"].every(O=>p[O]===E[O]),"Evidence input inventory changed");let A=n.payloads[p.sha256],k=tn(A);ne(me(k)===p.sha256&&k.length===p.bytes,`Evidence bytes disagree: ${p.path}`),i.add(p.sha256);let N=p.path===_c?fs(k):k;o[p.origin][p.role]=JSON.parse(N.toString("utf8")),p.origin==="source"?a.push({...p,data:A}):ne(p.gitBlob===null,"Packed input unexpectedly has Git identity")}o.source.exportSources=Object.create(null);let l=new Map;for(let f of e.inputs.slice(r.length)){let E=n.payloads[f.sha256],p=tn(E);if(ne(me(p)===f.sha256&&p.length===f.bytes,"Extra evidence bytes disagree: "+f.path),f.origin==="source-export"){ne(f.role==="text"&&/^packages\/lyra-ui\/src\/[A-Za-z0-9_./-]+\.(?:ts|css)$/u.test(f.path)&&!f.path.split("/").includes(".."),"Invalid extra source input");let A=f.path.slice(17);ne(!Object.hasOwn(o.source.exportSources,A),"Duplicate export source input"),o.source.exportSources[A]=p.toString("utf8")}else if(f.origin==="source-history")ne(f.role==="history"&&/^packages\/lyra-ui\/scripts\/fixtures\/compatibility-history\/(?:index\.json|[0-9]+\.[0-9]+\.[0-9]+\/(?:capture|facts)\.json|[0-9]+\.[0-9]+\.[0-9]+\/evidence\.json\.gz)$/u.test(f.path)&&!l.has(f.path),"Invalid or duplicate history evidence input"),l.set(f.path,p);else throw new Error("Invalid extra evidence origin");i.add(f.sha256),a.push({...f,data:E})}ne(Object.keys(n.payloads).length===i.size,"Evidence contains unrelated payloads"),Hs({pin:{...e.git,tag:e.sourceRelease},objects:n.gitObjects,inputs:a}),ne(o.packed.packageJson.name===e.package.name&&o.packed.packageJson.version===e.sourceVersion,"Packed package identity mismatch"),ne(JSON.stringify(o.source.manifest)===JSON.stringify(o.packed.manifest),"Published manifest differs from source manifest");let u=new Set,m=o.source.exportSources;o.source.exportSources=new Proxy(m,{get(f,E){return Object.hasOwn(f,E)&&u.add(E),f[E]}});let h=Ec(o.source,e.extractorVersion),g="packages/lyra-ui/scripts/fixtures/compatibility-history/",y=g+"index.json",$=null;if(l.size){ne(l.has(y),"Compatibility history evidence has no index");let f=JSON.parse(l.get(y).toString("utf8"));ne(f?.schemaVersion===1&&Array.isArray(f.captures)&&f.captures.length>0&&Array.isArray(f.retirements),"Unsupported source compatibility history"),ne(f.captures.length<=32,"Source compatibility history exceeds the capture limit");let E=new Set([y]),p=[],A=c((O,q)=>{let b=c(x=>{let I=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/u.exec(x);return ne(I,"Invalid compatibility history version"),I.slice(1).map(Number)},"parts"),j=b(O),d=b(q);for(let x=0;x<3;x++)if(j[x]!==d[x])return j[x]-d[x];return 0},"compareVersions"),k=new Set;for(let O of f.captures){ne(O&&typeof O.directory=="string"&&/^[0-9]+\.[0-9]+\.[0-9]+$/u.test(O.directory)&&/^[a-f0-9]{64}$/u.test(O.captureSha256)&&!k.has(O.directory),"Invalid or duplicate source history capture pin"),k.add(O.directory),ne(A(O.directory,e.sourceVersion)<0,"Source history contains a current or future capture");let q=O.directory,b=Object.fromEntries(["capture.json","facts.json","evidence.json.gz"].map(P=>[P,g+q+"/"+P]));for(let P of Object.values(b))E.add(P);ne(Object.values(b).every(P=>l.has(P)),"Source history capture is incomplete");let j=l.get(b["capture.json"]);ne(me(j)===O.captureSha256,"Source history capture differs from its index pin");let d=JSON.parse(j.toString("utf8"));ne(d.sourceVersion===q,"Source history directory/version mismatch");let x=JSON.parse(l.get(b["facts.json"]).toString("utf8")),I=Mc(d,l.get(b["evidence.json.gz"])),C=jc(d,x,I);ne(C.facts.sourceVersion===q,"Validated source history version mismatch"),p.push(C.facts)}ne(E.size===l.size&&[...E].every(O=>l.has(O)),"Source history file inventory differs from its index");let N=[];for(let O of Ws(o.source.metadata,p)){let q=yn(O,{packageJson:o.source.packageJson,readSource:c(b=>o.source.exportSources[b],"readSource"),exportDeprecations:o.source.metadata.exportDeprecations});ne(q.status!=="invalid","Cannot inspect historical export "+O.name+": "+(q.findings?.join("; ")??"invalid contract")),q.status==="present"&&N.push({key:Pe(O,"export"),...q})}$=Ks({packageVersion:e.sourceVersion,currentInventory:o.source.inventory,currentExportDeprecations:o.source.metadata.exportDeprecations,currentExportSurface:N,captures:p,retirementIndex:f.retirements})}else{let f=Number(e.sourceVersion.split(".")[0]);ne(f<23,"Published capture requires pinned compatibility history evidence")}let w=kn(o.source.renameLedger,o.source.inventory,{exportDeprecations:o.source.metadata.exportDeprecations,compatibilityContext:$,historicalReleaseMajor:Number(e.sourceVersion.split(".")[0])});return ne(JSON.stringify(w)===JSON.stringify(o.packed.migrationContract.lyraRenames),"Packed migration projection differs from published source"),ne(u.size===Object.keys(m).length,"Unrelated export source input"),ne(JSON.stringify(h)===JSON.stringify(t)&&me(De(t))===e.factsSha256,"Published facts differ from exact evidence extraction"),{facts:h,publishedMigration:o.packed.migrationContract,publishedManifest:structuredClone(o.source.manifest)}}function ns(e,{readBytes:t=cd}={}){let n=JSON.parse(t(ko(e,"capture.json")).toString("utf8")),s=t(ko(e,"evidence.json.gz")),r=JSON.parse(t(ko(e,"facts.json")).toString("utf8"));return{capture:n,...jc(n,r,Mc(n,s))}}function Pc(e,t,n=[]){ne(e?.schemaVersion===1&&Array.isArray(e.releases),"Unsupported policy witness schema");let s=new Map;for(let a of e.releases){if(ne(!s.has(a.sourceRelease)&&a.sourceRelease===`lyra-ui@${a.sourceVersion}`,"Duplicate or invalid policy witness release"),ne(a.input.path==="packages/lyra-ui/scripts/fixtures/component-metadata.json","Invalid policy witness input"),Hs({pin:{...a.git,tag:a.sourceRelease},objects:a.objects,inputs:[a.input,...a.publication?[a.publication.manifest]:[]]}),a.publication){let g=a.publication;ne(/^[a-f0-9]{64}$/u.test(g.tarballSha256)&&/^sha512-[A-Za-z0-9+/]{86}==$/u.test(g.registryIntegrity),"Invalid historical npm pin");let y=JSON.parse(tn(g.packageJson).toString("utf8"));ne(y.name==="@aceshooting/lyra-ui"&&y.version===a.sourceVersion&&g.manifest.path==="packages/lyra-ui/custom-elements.json"&&me(tn(g.manifest.data))===g.manifest.sha256,"Historical publication identity mismatch")}let l=tn(a.input.data);ne(me(l)===a.input.sha256,"Policy witness metadata hash mismatch");let u=JSON.parse(l.toString("utf8"));ne(u.schemaVersion===2&&u.history?.current?.version===a.sourceVersion,"Unsupported historical policy schema or identity");let m=[...u.deprecations,...u.exportDeprecations],h=new Map(m.map(g=>[JSON.stringify(g.tag?["member",g.tag,g.kind,g.name]:["export",g.kind,g.module??null,g.name]),g]));ne(h.size===m.length,"Duplicate historical policy identity"),s.set(a.sourceRelease,{witness:a,records:h})}let r=new Set,o=new Set,i=Object.create(null);for(let a of t){let l=a.facts??a,u=l.policyReleaseHistory??[];for(let h of u){let g=s.get(h.tag);ne(g&&g.witness.git.commit===h.sourceCommit&&g.witness.sourceVersion===h.version,`Missing immutable policy witness ${h.tag}`),r.add(h.tag)}let m=Number(l.sourceVersion.split(".")[0]);for(let h of l.records){if(Number(h.policy.removalNotBefore.split(".")[0])!==m+1||Number(h.policy.since.split(".")[0])>=m)continue;let g=JSON.stringify(h.key.scope==="member"?["member",h.key.tag,h.key.kind,h.key.name]:["export",h.key.kind,h.key.module??null,h.key.name]),y=null,$=!1;for(let w of u){let f=s.get(w.tag).records.get(g);if(!f){ne(y===null,`Published notice disappeared during its compatibility window: ${g}`);continue}if(y??=w.version,$||=!!s.get(w.tag).witness.publication,ne(f.since===h.policy.since&&f.removalNotBefore===h.policy.removalNotBefore,`Published policy window changed: ${g}`),JSON.stringify(f)!==JSON.stringify(h.policy)){let E=me(De(f)),p=me(De(h.policy)),A=n.map((N,O)=>({transition:N,index:O})).filter(({transition:N})=>JSON.stringify(N.key)===JSON.stringify(h.key)&&N.fromPolicySha256===E&&N.toPolicySha256===p&&typeof N.rationale=="string"&&N.rationale.trim());ne(A.length===1,`Unreviewed published guidance transition: ${g}`);let k=c(({replacement:N,rationale:O,...q})=>q,"withoutGuidance");ne(JSON.stringify(k(f))===JSON.stringify(k(h.policy))&&f.replacement.kind===h.policy.replacement.kind,`Guidance transition changes policy semantics: ${g}`),o.add(A[0].index)}}ne($,`No supplied published npm witness before the compatibility major: ${g}`),ne(y&&Number(y.split(".")[0])+2<=Number(h.policy.removalNotBefore.split(".")[0]),`No full later major after observed publication: ${g}`),i[g]=y}}return ne(r.size===s.size&&o.size===n.length,"Unrelated policy witness or transition"),i}var ld,Oc,_c,To,Nc,me,De,Js=_e(()=>{"use strict";ur();wo();Bs();Tn();ld=Object.freeze({packageJson:"package.json",manifest:"custom-elements.json",metadata:"scripts/fixtures/component-metadata.json",inventory:"scripts/fixtures/component-inventory.json",renameLedger:"scripts/fixtures/lyra-renames.json"}),Oc=Object.freeze({packageJson:"package/package.json",manifest:"package/custom-elements.json",migrationContract:"package/dist/cli/migration-contract.json"}),_c="package/dist/cli/"+ds;c(ud,"packedInputsFor");To=96*1024*1024,Nc=/^[a-f0-9]{40}$/u,me=c(e=>Cc("sha256").update(e).digest("hex"),"sha256"),De=c(e=>Buffer.from(`${JSON.stringify(e,null,2)}
13
- `),"jsonBytes");c(ne,"ensure");c(tn,"base64");c(Ic,"encodeEvidence");c(wn,"decodeEvidence");c(Mc,"decodeCaptureEvidence");c(ts,"gitObjectId");c(Ro,"parseGitTree");c(Hs,"verifyGitEvidence");c(jc,"validatePublishedCapture");c(ns,"readPublishedCaptureSync");c(Pc,"verifyPolicyWitnesses")});function Z(e,t){if(!e)throw new Error(t)}function cs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function fd(e,t){let n=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e):null;return Z(n&&n.length>0&&n.length<=Vc,`Invalid or oversized ${t}`),n}function as(e){return Z(typeof e=="string"&&e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&!/[\u0000-\u001f]/u.test(e)&&e.split("/").every(t=>t&&t!=="."&&t!==".."),"Unsafe evidence path"),e}function hd(e){let t=e.endsWith("/")?e.slice(0,-1):e;return as(t),e}function Wc(e){return Z(typeof e=="string"&&md.test(e),`Invalid stable release version: ${String(e)}`),e}function zc(e,t,n){Z(cs(e),`Invalid ${n} file map`);let s=new Set(t);return Z(Object.keys(e).length===s.size&&Object.keys(e).every(r=>s.has(r)),`${n} input set is incomplete or contains unrelated files`),Object.fromEntries(t.map(r=>[r,fd(e[r],`${n} file ${r}`).toString("utf8")]))}function nn(e){return Z(cs(e)&&["module","detailType","field"].every(t=>typeof e[t]=="string"&&e[t].length>0),"Invalid field declaration identity"),as(e.module),Z(/^[A-Za-z_$][\w$]*$/u.test(e.detailType)&&/^[A-Za-z_$][\w$]*$/u.test(e.field),"Invalid field declaration identity"),JSON.stringify([e.module,e.detailType,e.field])}function gd(e){return Z(cs(e)&&typeof e.tag=="string"&&/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(e.tag)&&typeof e.event=="string"&&e.event.startsWith("lr-"),"Invalid event-detail exposure identity"),JSON.stringify([e.tag,e.event,nn(e.declaration)])}function $d(e,t){let n=new RegExp(`\\bexport\\s+interface\\s+${t}\\b(?:\\s+extends\\s+[^{]+)?\\s*\\{`,"u").exec(e);Z(n,`Missing exported detail interface ${t}`);let s=n.index+n[0].length,r=1;for(;s<e.length&&r;s++)e[s]==="{"?r++:e[s]==="}"&&r--;return Z(r===0,`Unclosed detail interface ${t}`),e.slice(n.index,s)}function Dc(e,t){let n=new RegExp(`(?<readonly>readonly\\s+)?\\b${t}(?<optional>\\?)?\\s*:\\s*(?<type>[A-Za-z_$][\\w$]*(?:\\s*\\|\\s*[A-Za-z_$][\\w$]*)*)\\s*;`,"gu"),s=[...e.matchAll(n)];Z(s.length===1,`Expected exactly one ${t} field`);let r=s[0].groups,o=e.slice(0,s[0].index),i=o.lastIndexOf("/**"),a=o.lastIndexOf("*/"),l=i>=0&&a>i&&/^\s*$/u.test(o.slice(a+2))?o.slice(i,a+2).trim():null;return{type:r.type.replace(/\s+/gu,""),optional:!!r.optional,readonly:!!r.readonly,notice:l}}function rs(e){return e?.replace(/^\/\*\*|\*\/$/gu,"").replace(/^\s*\*\s?/gmu,"").replace(/\s+/gu," ").trim()??null}function Lc(e,t,n){let s=e[t];Z(typeof s=="string",`Missing declaration evidence ${t}`);let r=$d(s,n.detailType),o=Dc(r,n.field),i=Dc(r,"expanded");return{deprecated:o,expanded:i}}function wd(e,t){return e==="equal"?new RegExp(`(?:\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*expanded\\s*:\\s*\\1\\b|\\b${t}\\s*:\\s*expanded\\s*,\\s*expanded(?:\\s*[,}])|\\b${t}\\s*,\\s*expanded\\s*:\\s*${t}\\b|\\bexpanded\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*${t}\\s*:\\s*\\2\\b|\\bexpanded\\s*:\\s*${t}\\s*,\\s*${t}(?:\\s*[,}]))`,"u"):new RegExp(`(?:\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*expanded\\s*:\\s*!\\s*\\1\\b|\\bexpanded\\s*:\\s*!\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*${t}\\s*:\\s*\\2\\b|\\bexpanded\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*${t}\\s*:\\s*!\\s*\\3\\b|\\bexpanded\\s*:\\s*!\\s*${t}\\s*,\\s*${t}(?:\\s*[,}])|\\b${t}\\s*,\\s*expanded\\s*:\\s*!\\s*${t}\\b|\\bexpanded\\s*:\\s*${t}\\s*,\\s*${t}\\s*:\\s*!\\s*${t}\\b)`,"u")}function vd(e){return e.replace(/\s+/gu," ")}function Fc(e,t,n,s){let r=vd(e);return Z(r.includes(t),`Missing runtime emitter event ${t}`),Z(wd(s,n).test(r),`Runtime payload does not preserve ${s} ${n}/expanded values for ${t}`),!0}function No(e,t,n){return new RegExp(`['"]${t}['"]\\s*:\\s*CustomEvent\\s*<\\s*${n}\\s*>`,"u").test(e)}function Ys(e,t){let n=t?.exports?.[`./components/${e}.js`];return Z(cs(n)&&typeof n.default=="string"&&typeof n.types=="string",`Missing public package route for ${e}`),Z(n.default===`./dist/components/${e}.js`&&n.types.startsWith("./dist/"),`Unexpected public route for ${e}`),as(n.default.slice(2)),as(n.types.slice(2)),{runtimePath:n.default.slice(7),declarationPath:n.types.slice(7)}}function _o({sourceRelease:e,sourceVersion:t,packageJson:n,sourceFiles:s,packedFiles:r}){Wc(t),Z(e===`lyra-ui@${t}`&&n?.name==="@aceshooting/lyra-ui"&&n?.version===t,"Field-evidence release identity mismatch");let o=zc(s,Uc,"source"),i=[...new Set([...Hc,...Jc,...Ft.map(([m])=>{let h=Ys(m,n);return h.runtimePath.startsWith("components/")?`package/dist/${h.runtimePath}`:`package/dist/${h.runtimePath}`}),...Ft.map(([m])=>`package/dist/${Ys(m,n).declarationPath}`)])].sort(),a=zc(r,i,"packed");for(let m of Object.keys(a))Z(m.startsWith("package/dist/"),"Packed field evidence must use package dist paths");let l=Zs.map(m=>{let h=Gs(m.key.module),g=os(m.key.module.replace(/\.ts$/u,".d.ts")),y=Lc(o,h,m.key),$=Lc(a,g,m.key);for(let w of[y,$]){Z(w.deprecated.type==="boolean"&&w.deprecated.optional===!1,`Deprecated field shape changed: ${nn(m.key)}`),Z(w.expanded.type==="boolean"&&w.expanded.optional===m.expandedOptional,`Expanded field shape changed: ${nn(m.key)}`);let f=rs(w.deprecated.notice),E=rs(m.notice);Z(f===E&&/removal not before 23\.0\.0\./u.test(f),`Deprecated field notice changed: ${nn(m.key)} (expected ${JSON.stringify(E)}, found ${JSON.stringify(f)})`)}return Z(rs(y.deprecated.notice)===rs($.deprecated.notice),`Source and package field notices disagree: ${nn(m.key)}`),Z(y.deprecated.readonly===$.deprecated.readonly&&y.expanded.readonly===$.expanded.readonly,`Source and package readonly shape disagree: ${nn(m.key)}`),{key:m.key,notice:rs(y.deprecated.notice),noticeJSDoc:y.deprecated.notice,noticeFloor:"23.0.0",relation:m.relation,deprecatedField:y.deprecated,expandedField:y.expanded,sourcePath:h,packedDeclarationPath:g,sourceSha256:me(Buffer.from(o[h])),packedSha256:me(Buffer.from(a[g]))}}),u=qc.map(([m,h,g,y])=>{let $=Zs[g],w=Gs(y),f=os(y.replace(/\.ts$/u,".js")),E=Ed(m),p=Ft.find(([_])=>_===m),A=Gs(p[1]),k=Ys(m,n),N=`package/dist/${k.declarationPath}`,O=`package/dist/${k.runtimePath}`,q=os(p[3].replace(/\.ts$/u,".d.ts")),b=o[E],j=o[A];Z(b&&j&&b.includes(`./${p[1].replace(/\.ts$/u,".js")}`),`Source tag alias no longer reaches ${m}`),Z(j.includes(`defineElement('${m.slice(3)}', ${p[2]})`)&&j.includes(`./${p[3].split("/").at(-1).replace(/\.ts$/u,".js")}`),`Source registration route changed for ${m}`);let d=o[w];if(m.startsWith("lr-code-block")){let _=Gs(p[3]);Z(o[_].includes("export type { LyraCodeBlockToggleDetail }")&&o[_].includes("LyraCodeBlockBaseEventMap"),`Code-block type route changed for ${m}`),Z(No(d,h,$.key.detailType),`Source shared event detail route changed for ${m}/${h}`)}else Z(No(d,h,$.key.detailType),`Source event detail route changed for ${m}/${h}`);let x=os(y.replace(/\.ts$/u,".d.ts"));Z(No(a[x],h,$.key.detailType),`Packed event detail route changed for ${m}/${h}`);let I=`./${p[3].split("/").at(-1).replace(/\.ts$/u,".js")}`;Z(a[N]?.includes(I)&&a[q],`Packed public type route is missing for ${m}: ${N}, expected ${I}, class declaration ${!!a[q]}`);let C=os(y.replace(/\.ts$/u,".js"));Fc(o[w],h,$.key.field,$.relation),Fc(a[C],h,$.key.field,$.relation);let P=`${Lt}components/${p[1].replace(/\.ts$/u,".js")}`,M=`./${p[1].replace(/\.ts$/u,".js")}`;return Z(a[O]?.includes(M)&&a[P],`Packed registration route is missing for ${m}`),{key:{tag:m,event:h,declaration:$.key},role:h.endsWith("-request")?"request":"settled",emitterPath:y,emitterPackedPath:f,registrationPath:A,tagEntryPath:E,publicRuntimePath:O,publicDeclarationPath:N,relation:$.relation,staticBehaviorEvidence:"source-and-packed-emitter-bytes-only",sourceSha256:me(Buffer.from(o[w])),packedSha256:me(Buffer.from(a[f])),tagEntrySha256:me(Buffer.from(b)),registrationSourceSha256:me(Buffer.from(j)),packedRegistrationSha256:me(Buffer.from(a[P])),publicRuntimeSha256:me(Buffer.from(a[O])),publicDeclarationSha256:me(Buffer.from(a[N]))}});return Z(l.length===10&&u.length===20,"Field evidence inventory count mismatch"),Z(new Set(l.map(m=>nn(m.key))).size===10,"Duplicate field declaration"),Z(new Set(u.map(m=>gd(m.key))).size===20,"Duplicate field exposure"),{schemaVersion:1,sourceRelease:e,sourceVersion:t,declarations:l,exposures:u}}function Gc(e,t){Z(e?.schemaVersion===1&&JSON.stringify(e.requiredReleases)===JSON.stringify(lt)&&Array.isArray(e.attachments),"Unsupported or altered field-evidence index"),Z(e.attachments.length===lt.length,"Field-evidence index is missing a required release");let n=new Map(e.attachments.map(r=>[r.sourceRelease,r.descriptorSha256]));Z(n.size===e.attachments.length&&n.size===lt.length,"Duplicate field-evidence index release"),Z(t.length===lt.length,"Field-evidence attachment set is incomplete");let s=new Map(t.map(({attachment:r,descriptorSha256:o})=>[r.sourceRelease,o??r.descriptorSha256]));return Z(s.size===t.length&&lt.every(r=>s.has(r)&&n.get(r)===s.get(r)),"Field-evidence descriptors disagree with index"),Z([...s.keys()].every(r=>lt.includes(r)),"Unexpected field-evidence release"),!0}function Yc({captures:e,attachments:t,requiredReleases:n=lt}){Z(Array.isArray(e)&&Array.isArray(t),"Invalid field continuity inputs"),Z(JSON.stringify(n)===JSON.stringify(lt),"Field continuity release set differs from the approved exact set");let s=new Map(e.map(l=>[l.capture?.sourceRelease??l.sourceRelease,l])),r=new Map(t.map(l=>[l.attachment?.sourceRelease??l.sourceRelease,l]));Z(s.size===e.length&&r.size===t.length,"Duplicate field continuity release"),Z(e.length===n.length&&t.length===n.length,"Field continuity requires every published release witness");let o=[];for(let l of n){let u=s.get(l),m=r.get(l);Z(u&&m,`Missing field continuity release ${l}`);let h=u.capture??u,g=m.attachment??m;Z(g.sourceRelease===h.sourceRelease&&g.sourceVersion===h.sourceVersion,`Field evidence does not bind ordinary capture ${l}`),Z(g.git?.commit===h.git?.commit&&g.git?.tagObject===h.git?.tagObject,`Field source tag differs from ordinary capture ${l}`),Z(g.captureDescriptorSha256===me(De(h)),`Field attachment is not pinned to ordinary capture ${l}`),Z(g.package?.tarballSha256===h.package?.tarballSha256&&g.package?.registryIntegrity===h.package?.registryIntegrity,`Field npm package evidence differs from ordinary capture ${l}`);let y=m.facts??m.verified?.facts;Z(y?.sourceRelease===l&&y.declarations?.length===10&&y.exposures?.length===20,`Incomplete field facts ${l}`),o.push(y)}let i=c(l=>({declarations:l.declarations.map(({key:u,notice:m,noticeFloor:h,relation:g,deprecatedField:y,expandedField:$})=>({key:u,notice:m,noticeFloor:h,relation:g,deprecatedField:y,expandedField:$})),exposures:l.exposures.map(({key:u,role:m,relation:h,publicRuntimePath:g,publicDeclarationPath:y})=>({key:u,role:m,relation:h,publicRuntimePath:g,publicDeclarationPath:y}))}),"shape"),a=JSON.stringify(i(o[0]));return Z(o.slice(1).every(l=>JSON.stringify(i(l))===a),"Nested event-detail field contract changed across published releases"),o.map(l=>({sourceRelease:l.sourceRelease,declarationCount:l.declarations.length,exposureCount:l.exposures.length,observed:!0,facts:structuredClone(l)}))}function Io({attachment:e,facts:t,evidence:n,evidenceArchiveBytes:s,ordinaryCapture:r,ordinaryCaptureBytes:o,tarMembers:i,packageJson:a}){Z(e?.schemaVersion===1&&e.extractorVersion===1&&n?.schemaVersion===1,"Unsupported field attachment schema"),Z(lt.includes(e.sourceRelease)&&e.sourceRelease===`lyra-ui@${e.sourceVersion}`&&Wc(e.sourceVersion)===e.sourceVersion,"Field attachment release identity mismatch"),Z(e.package?.name==="@aceshooting/lyra-ui"&&e.package.version===e.sourceVersion,"Field attachment package identity mismatch"),Z(ss.test(e.package.tarballSha256)&&/^sha512-[A-Za-z0-9+/]{86}==$/u.test(e.package.registryIntegrity),"Invalid field attachment npm proof pins"),Z(Oo.test(e.git?.tagObject)&&Oo.test(e.git?.commit),"Invalid field attachment Git identity"),Z(ss.test(e.captureDescriptorSha256)&&ss.test(e.evidenceArchiveSha256)&&ss.test(e.factsSha256),"Invalid field attachment hash"),Z((Buffer.isBuffer(s)||s instanceof Uint8Array)&&me(Buffer.from(s))===e.evidenceArchiveSha256,"Field evidence archive hash mismatch"),Z(me(De(r))===e.captureDescriptorSha256,"Field attachment capture descriptor pin mismatch"),Z(r.sourceRelease===e.sourceRelease&&r.sourceVersion===e.sourceVersion&&r.git?.commit===e.git.commit&&r.git?.tagObject===e.git.tagObject,"Field attachment Git release differs from ordinary capture"),Z(JSON.stringify(r.package)===JSON.stringify(e.package),"Field attachment npm identity differs from ordinary capture"),Z(me(Buffer.from(o))===e.captureDescriptorSha256,"Ordinary capture descriptor bytes mismatch"),Z(Array.isArray(i)&&new Set(i).size===i.length,"Duplicate tar member");let l=i.map(hd);Z(new Set(l.map(E=>E.endsWith("/")?E.slice(0,-1):E)).size===l.length,"Duplicate canonical tar member"),Z(e.tarball?.memberCount===l.length&&me(De(i))===e.tarball.membersSha256,"Field tar member inventory hash mismatch");let u=Mo(a);Z(Array.isArray(e.inputs)&&e.inputs.length===u.length&&e.inputs.length<=Bc,"Field attachment input inventory is incomplete or oversized");let m=new Set(u.map(E=>`${E.origin}:${E.path}`)),h=new Set,g=new Set,y=[],$=Object.create(null),w=Object.create(null);for(let E of e.inputs){Z(cs(E)&&["source","packed"].includes(E.origin)&&["source-declaration","source-runtime","packed-declaration","packed-runtime"].includes(E.role)&&typeof E.path=="string","Invalid field attachment input"),as(E.path);let p=`${E.origin}:${E.path}`;Z(m.has(p)&&!h.has(p),`Unexpected or duplicate field input ${p}`);let A=u.find(O=>O.origin===E.origin&&O.path===E.path)?.role;Z(E.role===A,`Field input role changed for ${E.path}`),Z(ss.test(E.sha256)&&Number.isSafeInteger(E.bytes)&&E.bytes>=1&&E.bytes<=Vc,"Invalid field input hash or byte length");let k=n.payloads?.[E.sha256];Z(typeof k=="string",`Missing field input payload ${E.path}`);let N=Buffer.from(k,"base64");Z(N.toString("base64")===k&&N.length===E.bytes&&me(N)===E.sha256,`Field input bytes disagree ${E.path}`),E.origin==="source"?(Z(E.path.startsWith(is)&&Oo.test(E.gitBlob),"Source input has no Git blob identity"),y.push({...E,data:k}),$[E.path]=N):(Z(E.path.startsWith("package/")&&E.gitBlob===null&&l.includes(E.path),"Packed input has no matching tar member"),w[E.path]=N),h.add(p),g.add(E.sha256)}Z(m.size===h.size&&Object.keys(n.payloads).length===g.size,"Field evidence includes missing inputs or unrelated payloads"),Hs({pin:{...e.git,tag:e.sourceRelease},objects:n.gitObjects,inputs:y}),Z(me(De(t))===e.factsSha256,"Field facts hash mismatch");let f=_o({sourceRelease:e.sourceRelease,sourceVersion:e.sourceVersion,packageJson:a,sourceFiles:$,packedFiles:w});return Z(JSON.stringify(f)===JSON.stringify(t),"Field facts do not match exact source and packed evidence"),{facts:f,verified:!0}}function Mo(e){let t=new Set(Kc),n=Uc.map(i=>({origin:"source",role:t.has(i)?"source-declaration":"source-runtime",path:i})),s=new Set([...Hc,...Jc]);for(let[i]of Ft){let a=Ys(i,e);s.add(`package/dist/${a.runtimePath}`),s.add(`package/dist/${a.declarationPath}`)}let r=[...s].map(i=>({origin:"packed",role:i.endsWith(".d.ts")?"packed-declaration":"packed-runtime",path:i})),o=[...n,...r].sort((i,a)=>`${i.origin}:${i.path}`.localeCompare(`${a.origin}:${a.path}`));return Z(o.length<=Bc&&new Set(o.map(i=>`${i.origin}:${i.path}`)).size===o.length,"Invalid field evidence allowlist"),o}var is,Lt,vn,pd,Ao,md,ss,Oo,Bc,Vc,Qs,qc,Ft,Co,dd,Zs,lt,Xs,Kc,yd,bd,Uc,Hc,Jc,Ed,Gs,os,ag,ig,Zc=_e(()=>{"use strict";Js();is="packages/lyra-ui/",Lt="package/dist/",vn="/** @deprecated Use `expanded`, which carries the same value; removal not before 23.0.0. */",pd="/** @deprecated Use `expanded`, its inverse; removal not before 23.0.0. */",Ao="/** The inverse of `expanded`.\n * @deprecated Read `expanded` instead; removal not before 23.0.0. */",md=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u,ss=/^[a-f0-9]{64}$/u,Oo=/^[a-f0-9]{40}$/u,Bc=96,Vc=8*1024*1024,Qs=[["layout/details/details.class.ts","LyraDetailsToggleDetail","open","equal",!1,vn],["layout/multi-split/multi-split.class.ts","LyraMultiSplitToggleDetail","open","equal",!1,vn],["layout/navigation-menu-item/navigation-menu-item.class.ts","LyraNavigationMenuToggleDetail","open","equal",!1,vn],["layout/dock-panel/dock-panel.class.ts","LyraDockPanelCollapseChangeDetail","collapsed","inverse",!1,pd],["layout/app-rail/app-rail-item.class.ts","LyraAppRailItemToggleDetail","open","equal",!1,vn],["layout/app-rail/app-rail.class.ts","LyraAppRailToggleDetail","open","equal",!1,vn],["layout/app-rail-group/app-rail-group.class.ts","LyraAppRailGroupToggleDetail","open","equal",!1,vn],["conversation/thread-list/thread-list.class.ts","ThreadGroupToggleDetail","collapsed","inverse",!0,Ao],["conversation/chat-message/chat-message.class.ts","ChatMessageToggleDetail","collapsed","inverse",!1,Ao],["conversation/code-block/code-block-shared.ts","LyraCodeBlockToggleDetail","collapsed","inverse",!1,Ao]],qc=[["lr-details","lr-toggle",0,"layout/details/details.class.ts"],["lr-multi-split","lr-toggle-request",1,"layout/multi-split/multi-split.class.ts"],["lr-multi-split","lr-toggle",1,"layout/multi-split/multi-split.class.ts"],["lr-navigation-menu-item","lr-toggle",2,"layout/navigation-menu-item/navigation-menu-item.class.ts"],["lr-dock-panel","lr-collapse-request",3,"layout/dock-panel/dock-panel.class.ts"],["lr-dock-panel","lr-collapse-change",3,"layout/dock-panel/dock-panel.class.ts"],["lr-app-rail-item","lr-toggle-request",4,"layout/app-rail/app-rail-item.class.ts"],["lr-app-rail-item","lr-toggle",4,"layout/app-rail/app-rail-item.class.ts"],["lr-app-rail","lr-toggle-request",5,"layout/app-rail/app-rail.class.ts"],["lr-app-rail","lr-toggle",5,"layout/app-rail/app-rail.class.ts"],["lr-app-rail-group","lr-toggle-request",6,"layout/app-rail-group/app-rail-group.class.ts"],["lr-app-rail-group","lr-toggle",6,"layout/app-rail-group/app-rail-group.class.ts"],["lr-thread-list","lr-group-toggle-request",7,"conversation/thread-list/thread-list.class.ts"],["lr-thread-list","lr-group-toggle",7,"conversation/thread-list/thread-list.class.ts"],["lr-chat-message","lr-toggle-request",8,"conversation/chat-message/chat-message.class.ts"],["lr-chat-message","lr-toggle",8,"conversation/chat-message/chat-message.class.ts"],["lr-code-block","lr-toggle-request",9,"conversation/code-block/code-block-base.class.ts"],["lr-code-block","lr-toggle",9,"conversation/code-block/code-block-base.class.ts"],["lr-code-block-core","lr-toggle-request",9,"conversation/code-block/code-block-base.class.ts"],["lr-code-block-core","lr-toggle",9,"conversation/code-block/code-block-base.class.ts"]],Ft=[["lr-details","layout/details/details.ts","LyraDetails","layout/details/details.class.ts"],["lr-multi-split","layout/multi-split/multi-split.ts","LyraMultiSplit","layout/multi-split/multi-split.class.ts"],["lr-navigation-menu-item","layout/navigation-menu-item/navigation-menu-item.ts","LyraNavigationMenuItem","layout/navigation-menu-item/navigation-menu-item.class.ts"],["lr-dock-panel","layout/dock-panel/dock-panel.ts","LyraDockPanel","layout/dock-panel/dock-panel.class.ts"],["lr-app-rail-item","layout/app-rail/app-rail-item.ts","LyraAppRailItem","layout/app-rail/app-rail-item.class.ts"],["lr-app-rail","layout/app-rail/app-rail.ts","LyraAppRail","layout/app-rail/app-rail.class.ts"],["lr-app-rail-group","layout/app-rail-group/app-rail-group.ts","LyraAppRailGroup","layout/app-rail-group/app-rail-group.class.ts"],["lr-thread-list","conversation/thread-list/thread-list.ts","LyraThreadList","conversation/thread-list/thread-list.class.ts"],["lr-chat-message","conversation/chat-message/chat-message.ts","LyraChatMessage","conversation/chat-message/chat-message.class.ts"],["lr-code-block","conversation/code-block/code-block.ts","LyraCodeBlock","conversation/code-block/code-block.class.ts"],["lr-code-block-core","conversation/code-block/code-block-core.ts","LyraCodeBlockCore","conversation/code-block/code-block-core.class.ts"]],Co=["conversation/code-block/code-block-base.class.ts","conversation/code-block/code-block.class.ts","conversation/code-block/code-block-core.class.ts"],dd=c(([e,t,n])=>({module:e,detailType:t,field:n}),"declarationKeyValue"),Zs=Qs.map((e,t)=>({index:t,key:dd(e),relation:e[3],expandedOptional:e[4],notice:e[5]}));c(Z,"ensure");c(cs,"plain");c(fd,"asBytes");c(as,"cleanRelativePath");c(hd,"safeTarMember");c(Wc,"stable");c(zc,"parseTextFiles");c(nn,"fieldDeclarationKey");c(gd,"fieldExposureKey");lt=Object.freeze(["lyra-ui@22.0.0","lyra-ui@22.1.0","lyra-ui@23.0.0"]),Xs=c(e=>`${is}src/components/${e}`,"toSourcePath"),Kc=Qs.map(([e])=>Xs(e)),yd=Co.map(Xs),bd=Ft.flatMap(([,e,,t])=>{let n=Ft.find(s=>s[1]===e)?.[0];return[Xs(e),...n?[`${is}src/components/${n}.ts`]:[],Xs(t)]}),Uc=[...new Set([...Kc,...yd,...bd])].sort(),Hc=[...new Set([...Qs.map(([e])=>`${Lt}components/${e.replace(/\.ts$/u,".d.ts")}`),...Co.map(e=>`${Lt}components/${e.replace(/\.ts$/u,".d.ts")}`)])],Jc=[...new Set([...Qs.filter(([,e])=>e!=="LyraCodeBlockToggleDetail").map(([e])=>`${Lt}components/${e.replace(/\.ts$/u,".js")}`),...Co.map(e=>`${Lt}components/${e.replace(/\.ts$/u,".js")}`),...Ft.map(([,e])=>`${Lt}components/${e.replace(/\.ts$/u,".js")}`),...Ft.map(([e])=>`${Lt}components/${e}.js`)])];c($d,"findInterface");c(Dc,"propertyShape");c(rs,"normalizedNotice");c(Lc,"extractDeclaration");c(wd,"relationPattern");c(vd,"normalizedJs");c(Fc,"hasRuntimeContract");c(No,"hasEventType");c(Ys,"routeForTag");Ed=c(e=>`${is}src/components/${e}.ts`,"routeSourcePath"),Gs=c(e=>`${is}src/components/${e}`,"sourcePackagePath"),os=c(e=>`${Lt}components/${e}`,"packedPath");c(_o,"derivePublishedFieldFacts");c(Gc,"validateFieldEvidenceIndex");c(Yc,"verifyPublishedFieldContinuity");c(Io,"validatePublishedFieldAttachment");c(Mo,"expectedFieldInputPaths");ag=Object.freeze(Zs.map(e=>e.key)),ig=Object.freeze(qc.map(([e,t,n])=>({tag:e,event:t,declaration:Zs[n].key})))});import{realpathSync as Xc}from"node:fs";import{fileURLToPath as xd}from"node:url";function er(e,t=process.argv[1]){if(!t)return!1;try{return Xc(t)===Xc(xd(e))}catch{return!1}}var jo=_e(()=>{"use strict";c(er,"isMainModule")});import{readdirSync as Sd}from"node:fs";import{join as kd}from"node:path";function Po(e){return Sd(e,{withFileTypes:!0}).flatMap(t=>{let n=kd(e,t.name);return t.isDirectory()?Po(n):[n]})}var Qc=_e(()=>{"use strict";c(Po,"walk")});import{createHash as el}from"node:crypto";import{relative as Td,resolve as Rd}from"node:path";function Ad(e,t){let n=Rd(t),s=Po(n),r=el("sha256");for(let o of s.sort()){let i=Td(n,o);r.update(i).update("\0").update(el("sha256").update(ct(n,i,{binary:!0}).original).digest())}return`${e}\0${n}\0${r.digest("hex")}`}function tl(e,t=new WeakSet){if(e===null||typeof e!="object"||ArrayBuffer.isView(e)||t.has(e))return e;t.add(e);for(let n of Reflect.ownKeys(e))tl(e[n],t);return Object.freeze(e)}function tr(e,t,n,s){if(s!==void 0&&!Object.isFrozen(s))return n();let r;try{r=Ad(e,t)}catch{return n()}zo.has(r)||zo.set(r,new Map);let o=zo.get(r);return o.has(s)||o.set(s,tl(n())),o.get(s)}var zo,Do=_e(()=>{"use strict";Qc();Us();zo=new Map;c(Ad,"historyKey");c(tl,"deepFreeze");c(tr,"memoizedHistoryVerification")});import{execFileSync as nr}from"node:child_process";import{createHash as Od}from"node:crypto";import{existsSync as nl,mkdirSync as sl,readFileSync as Bt,renameSync as Nd,rmSync as Cd,statSync as _d,writeFileSync as Lo}from"node:fs";import{dirname as Id,join as Je,resolve as Fo}from"node:path";import{parseArgs as Md}from"node:util";function xe(e,t){if(!e)throw new Error(t)}function sr(e,t,n=32*1024*1024){return nr("git",["-C",e,...t],{maxBuffer:n})}function zd(e){let n=nr("tar",["-tzf",Fo(e)],{encoding:"utf8",maxBuffer:rl}).replace(/\n$/u,"").split(`
14
- `);xe(n.length>0&&n.length<=2e4&&new Set(n).size===n.length,"Tarball has duplicate or excessive members");for(let o of n){let i=o.endsWith("/")?o.slice(0,-1):o;xe(typeof i=="string"&&i.length>0&&!i.startsWith("/")&&!i.includes("\\")&&!/[\u0000-\u001f]/u.test(i)&&i.split("/").every(a=>a&&a!=="."&&a!==".."),"Tarball contains an unsafe member path")}let s=nr("tar",["-tvzf",Fo(e)],{encoding:"utf8",maxBuffer:rl}),r=new Map;for(let o of s.trimEnd().split(`
15
- `)){let i=o[0],a=o.split(/\s+/u).slice(5).join(" ");a&&r.set(a,i)}return{members:n,types:r}}function Dd(e,t,n,s){let r=t,o,i=n.split("/");for(let[l,u]of i.entries()){xe(u&&u!=="."&&u!==".."&&!u.includes("\\"),`Unsafe Git path ${n}`);let m=sr(e,["cat-file","tree",r]);s.set(r,{type:"tree",oid:r,data:m.toString("base64")}),o=Ro(m).get(u),xe(o,`Missing Git source path ${n}`),l<i.length-1&&(xe(o.mode==="40000",`Git path ancestor is not a tree: ${n}`),r=o.oid)}return xe(["100644","100755"].includes(o.mode),`Git source path is not a regular file: ${n}`),{bytes:sr(e,["cat-file","blob",o.oid]),oid:o.oid}}function il(e,t){let n=Bt(Je(e,"evidence.json.gz"));xe(me(n)===t.capture.evidenceArchiveSha256,"Ordinary capture evidence archive hash mismatch");let s=wn(n),r=t.capture.inputs.find(m=>m.origin==="packed"&&m.role==="packageJson"),o=t.capture.inputs.find(m=>m.origin==="source"&&m.role==="packageJson");xe(r&&o,"Ordinary capture has no package identity inputs");let i=Buffer.from(s.payloads[r.sha256],"base64"),a=Buffer.from(s.payloads[o.sha256],"base64"),l=JSON.parse(i.toString("utf8")),u=JSON.parse(a.toString("utf8"));return xe(l.name===u.name&&l.version===u.version&&JSON.stringify(l.exports)===JSON.stringify(u.exports),"Published package routes differ from pinned source"),l}function Ld({repository:e,sourceRelease:t,tagObject:n,commit:s,tarball:r,tarballSha256:o,registryIntegrity:i,ordinaryCaptureDirectory:a,output:l}){xe(/^lyra-ui@(22\.0\.0|22\.1\.0|23\.0\.0)$/u.test(t),"Unsupported field evidence release"),xe(ol.test(n)&&ol.test(s),"Invalid field release Git pins"),xe(typeof o=="string"&&/^[a-f0-9]{64}$/u.test(o)&&Pd.test(i),"Invalid field release npm pins"),xe(!nl(l),"Field evidence output already exists; published evidence is immutable");let u=ns(a),m=Bt(Je(a,"capture.json"));xe(u.capture.sourceRelease===t&&u.capture.git.tagObject===n&&u.capture.git.commit===s,"Field evidence release does not match ordinary capture"),xe(u.capture.package.tarballSha256===o&&u.capture.package.registryIntegrity===i,"Field evidence npm pins do not match ordinary capture");let h=il(a,u),g=_d(r).size;xe(g>0&&g<=jd,"Npm tarball is empty or exceeds the capture limit");let y=Bt(r);xe(me(y)===o&&`sha512-${Od("sha512").update(y).digest("base64")}`===i,"Field evidence tarball integrity mismatch");let{members:$,types:w}=zd(r),f=Mo(h),E=new Map,p=Object.create(null),A=[],k=sr(e,["cat-file","commit",s]),N=sr(e,["cat-file","tag",n]);xe(ts("commit",k)===s&&ts("tag",N)===n,"Git tag or commit object hash mismatch"),E.set(s,{type:"commit",oid:s,data:k.toString("base64")}),E.set(n,{type:"tag",oid:n,data:N.toString("base64")});let O=/^tree ([a-f0-9]{40})$/mu.exec(k.toString("utf8"))?.[1];xe(O,"Pinned field release commit has no tree");for(let M of f){let R,_=null;if(M.origin==="source"){let ee=Dd(e,O,M.path,E);R=ee.bytes,_=ee.oid}else xe($.filter(ee=>ee===M.path).length===1&&w.get(M.path)==="-",`Missing, duplicate, or non-file npm member ${M.path}`),R=nr("tar",["-xOzf",Fo(r),"--",M.path],{maxBuffer:8*1024*1024});xe(R.length>0&&R.length<=8*1024*1024,`Field evidence input exceeds member limit: ${M.path}`);let W=me(R);p[W]=R.toString("base64"),A.push({...M,sha256:W,bytes:R.length,gitBlob:_})}let q=Object.create(null),b=Object.create(null);for(let M of A){let R=Buffer.from(p[M.sha256],"base64");(M.origin==="source"?q:b)[M.path]=R}let j=_o({sourceRelease:t,sourceVersion:u.capture.sourceVersion,packageJson:h,sourceFiles:q,packedFiles:b}),d={schemaVersion:1,payloads:p,gitObjects:[...E.values()],tarMembers:[...$].sort()},x=Ic(d);xe(x.length<=al,"Field evidence archive exceeds size limit");let I={schemaVersion:1,sourceRelease:t,sourceVersion:u.capture.sourceVersion,git:{tagObject:n,commit:s},captureDescriptorSha256:me(m),package:{...u.capture.package},extractorVersion:1,inputs:A,tarball:{memberCount:$.length,membersSha256:me(De([...$].sort()))},evidenceArchiveSha256:me(x),factsSha256:me(De(j))},C=me(De(I));Io({attachment:I,facts:j,evidence:d,evidenceArchiveBytes:x,ordinaryCapture:u.capture,ordinaryCaptureBytes:m,tarMembers:d.tarMembers,packageJson:h}),sl(Id(l),{recursive:!0});let P=`${l}.pending-${process.pid}`;sl(P);try{if(Lo(Je(P,"attachment.json"),De(I)),Lo(Je(P,"facts.json"),De(j)),Lo(Je(P,"evidence.json.gz"),x),nl(l))throw new Error("Field attachment output appeared during capture");Nd(P,l)}finally{Cd(P,{recursive:!0,force:!0})}return{sourceRelease:t,declarations:j.declarations.length,exposures:j.exposures.length,archiveBytes:x.length,descriptorSha256:C}}function Fd(e,t){let n=Bt(Je(e,"attachment.json")),s=JSON.parse(n.toString("utf8")),r=Bt(Je(e,"evidence.json.gz"));xe(me(r)===s.evidenceArchiveSha256,"Field evidence archive hash mismatch");let o=wn(r,al);xe(o.tarMembers?.length===s.tarball?.memberCount&&me(De(o.tarMembers))===s.tarball.membersSha256,"Field tar member inventory mismatch");let i=JSON.parse(Bt(Je(e,"facts.json"),"utf8")),a=ns(t),l=Bt(Je(t,"capture.json")),u=il(t,a),m=Io({attachment:s,facts:i,evidence:o,evidenceArchiveBytes:r,ordinaryCapture:a.capture,ordinaryCaptureBytes:l,tarMembers:o.tarMembers,packageJson:u});return{attachment:s,facts:m.facts,evidence:o,descriptorSha256:me(n),verified:!0}}function Bd(e,t){let n=JSON.parse(Bt(Je(e,"index.json"),"utf8"));return Gc(n,t),n}function cl(e,{captures:t}={}){return xe(Array.isArray(t),"Published field history requires ordinary captures"),tr("published-field-history",e,()=>Vd(e,t),t)}function Vd(e,t){let n=Je(e,"field-evidence"),s=lt.map(i=>{let a=i.slice(8);return Fd(Je(n,a),Je(e,a))}),r=Bd(n,s),o=Yc({captures:t,attachments:s});return{captures:t,attachments:s,index:r,continuity:o}}var rl,al,jd,ol,Pd,ll=_e(()=>{"use strict";Js();Zc();jo();Do();rl=8*1024*1024,al=16*1024*1024,jd=64*1024*1024,ol=/^[a-f0-9]{40}$/u,Pd=/^sha512-[A-Za-z0-9+/]{86}==$/u;c(xe,"ensure");c(sr,"git");c(zd,"regularTarMembers");c(Dd,"gitTreePath");c(il,"packageJsonFromCapture");c(Ld,"capturePublishedFieldCompatibility");c(Fd,"readPublishedFieldAttachmentSync");c(Bd,"readFieldEvidenceIndex");c(cl,"checkPublishedFieldHistorySync");c(Vd,"verifyPublishedFieldHistory");if(er(import.meta.url)){let{values:e}=Md({options:Object.fromEntries(["repository","release","tag-object","commit","tarball","tarball-sha256","registry-integrity","capture-dir","output"].map(n=>[n,{type:"string"}]))});xe(Object.keys(e).length===9,"All field capture arguments are required");let t=Ld({repository:e.repository,sourceRelease:e.release,tagObject:e["tag-object"],commit:e.commit,tarball:e.tarball,tarballSha256:e["tarball-sha256"],registryIntegrity:e["registry-integrity"],ordinaryCaptureDirectory:e["capture-dir"],output:e.output});console.log(JSON.stringify(t,null,2))}});var fl={};Jo(fl,{checkPublishedCompatibility:()=>Hd,checkPublishedCompatibilitySync:()=>Vo,readCurrentCompatibilityContext:()=>dl,readCurrentCompatibilityContextSync:()=>ml});import{existsSync as Bo,readdirSync as qd,readFileSync as En}from"node:fs";import{dirname as ul,join as Ve,resolve as Wd,relative as Kd}from"node:path";import{fileURLToPath as pl}from"node:url";function Vo(e=Ve(ul(pl(import.meta.url)),"fixtures/compatibility-history")){return e=Wd(e),tr("published-compatibility",e,()=>Ud(e))}function Ud(e){let t=new Map,n=c(u=>(t.has(u)||t.set(u,ct(e,Kd(e,u),{binary:!0})),t.get(u).original),"readBytes"),s=JSON.parse(n(Ve(e,"index.json")).toString("utf8"));if(s.schemaVersion!==1||!Array.isArray(s.captures)||s.captures.length===0||!Array.isArray(s.retirements))throw new Error("Unsupported compatibility index");let r=new Set,o=[];for(let u of s.captures){if(!/^\d+\.\d+\.\d+$/u.test(u.directory)||r.has(u.directory))throw new Error("Invalid or duplicate capture directory");r.add(u.directory);let m=Ve(e,u.directory);if(me(n(Ve(m,"capture.json")))!==u.captureSha256)throw new Error("Capture descriptor differs from reviewed index pin");let h=ns(m,{readBytes:n});if(h.capture.sourceVersion!==u.directory)throw new Error("Capture directory identity mismatch");o.push(h)}if(s.policyWitnesses?.file!=="policy-witnesses.json.gz"||!Array.isArray(s.guidanceTransitions))throw new Error("Missing policy publication witnesses");let i=n(Ve(e,s.policyWitnesses.file));if(me(i)!==s.policyWitnesses.sha256)throw new Error("Policy witness archive differs from reviewed pin");let a=Pc(wn(i),o,s.guidanceTransitions),l=[];for(let{capture:u,facts:m,publishedManifest:h}of o){let g=new Map;for(let y of h.modules??[])for(let $ of y.declarations??[])if(!($.kind!=="class"||!$.customElement||!$.tagName)){if(g.has($.tagName))throw new Error("Ambiguous published component declaration");g.set($.tagName,{module:y.path,name:$.name,tag:$.tagName})}for(let{key:y,policy:$}of m.records){if(y.scope!=="member"||$.kind!=="component"||$.replacement?.kind!=="component")continue;let w=g.get($.tag),f=g.get($.replacement.name);if(!w||!f||$.name!==$.tag)throw new Error("Published component alias has no exact declaration identity");l.push({sourceRelease:u.sourceRelease,policy:structuredClone($),source:w,replacement:f})}}return{captures:o,retirements:s.retirements,observedPublication:a,classAliases:l,snapshots:[...t.values()]}}function ml(e=Ve(ul(pl(import.meta.url)),".."),t=null){let n=$n(xo(e)),s=JSON.parse(En(Ve(e,"package.json"),"utf8")),r=t??JSON.parse(En(Ve(e,"scripts/fixtures/component-inventory.json"),"utf8")),o=Vo(Ve(e,"scripts/fixtures/compatibility-history"));gc(s.version,"24.0.0")>=0&&cl(Ve(e,"scripts/fixtures/compatibility-history"),{captures:o.captures});let i=Ws(n,o.captures.map(E=>E.facts)),a=new Map,l=c(E=>(a.has(E)||a.set(E,En(Ve(e,E),"utf8")),a.get(E)),"readSource"),u=[];for(let E of i){let p=yn(E,{packageJson:s,readSource:l,exportDeprecations:n.exportDeprecations});if(p.status==="invalid")throw new Error(`Cannot inspect ${E.name}: ${p.findings.join("; ")}`);p.status==="present"&&u.push({key:Pe(E,"export"),...p})}let m=Object.create(null);for(let E of r.components){let p=`./components/${E.tag}.js`,A=s.exports?.[p];(typeof A=="string"?A:A?.default)===`./dist/components/${E.tag}.js`&&(m[E.tag]=p)}let h=Ve(e,"scripts/fixtures/compatibility-history/retirements-30.0.0.json"),g=Bo(h)?JSON.parse(En(h,"utf8")):null,y=Ve(e,"scripts/fixtures/compatibility-history/successors-32.0.0.json"),$=Bo(y)?JSON.parse(En(y,"utf8")):null;if($&&($.schemaVersion!==1||!Array.isArray($.successors)))throw new Error("Unsupported direct successor list");let w=Ve(e,"../../.changeset"),f=s.version;return Bo(w)&&qd(w).some(p=>p.endsWith(".md")&&p!=="README.md"&&/^---\n[\s\S]*?['"]@aceshooting\/lyra-ui['"]:\s*major\b[\s\S]*?\n---/u.test(En(Ve(w,p),"utf8")))&&(f=`${Number(s.version.split(".")[0])+1}.0.0`),Ks({packageVersion:s.version,releaseVersion:f,successors:[...g?.successors??[],...$?.successors??[]],currentInventory:r,currentExportDeprecations:n.exportDeprecations,currentExportSurface:u,componentRegistrationRoutes:m,captures:[...o.captures.map(E=>E.facts),...g?[g.capture]:[]],retirementIndex:[...o.retirements,...g?g.retirements:[]]})}async function Hd(e){return Vo(e)}async function dl(e,t){return ml(e,t)}var hl=_e(async()=>{"use strict";wo();So();Bs();ll();Js();jo();Do();Us();c(Vo,"checkPublishedCompatibilitySync");c(Ud,"verifyPublishedCompatibility");c(ml,"readCurrentCompatibilityContextSync");c(Hd,"checkPublishedCompatibility");c(dl,"readCurrentCompatibilityContext");if(er(import.meta.url)){let e=await dl();console.log(`Verified immutable published compatibility and ${Object.keys(e.records).length} current/retired policy records.`)}});Tn();import Le from"node:fs";import Ae from"node:path";import{fileURLToPath as bl}from"node:url";ur();import In from"node:fs";import Ht from"node:path";import{fileURLToPath as $u}from"node:url";var dr=["semantics","naming","keyboard","focus","states","announcements","motion"],Xl=Object.freeze({semantics:Object.freeze(["alert","article","button","checkbox","combobox","composition-primitive","dialog","document","grid","group","iframe","img","link","list","listbox","menu","menuitem","navigation","option","presentation","progressbar","radio","radiogroup","region","separator","slider","spinbutton","status","switch","tab","table","tablist","tabpanel","text-content","textbox","tooltip","transparent-content","tree","treeitem","video"]),naming:Object.freeze(["alternative-text","author-label-required","content-derived","content-or-author-label","control-labels-localized","current-page","frame-title","heading-level","value-text","visible-or-author-label"]),keyboard:Object.freeze(["arrow-navigation","data-point-navigation","escape-dismiss","home-end-navigation","media-controls","native-activation","native-editing","page-navigation","range-adjustment","spatial-adjustment","tab-cycle","typeahead"]),focus:Object.freeze(["focus-follows-selection","focus-preserved","focus-return","focus-trap","focus-visible-on-reveal","frame-focus-gated","initial-focus","native-focus","roving-focus"]),states:Object.freeze(["busy","checked","current","disabled","expanded","invalid","modal","multiselectable","orientation","paused","pressed","readonly","required","selected","sort","value-range"]),announcements:Object.freeze(["autoplay-content-change","character-count","content-change","copy-result","live-alert","live-status","page-change","playback-state","progress-value","selection-change","validation-message"]),motion:Object.freeze(["respects-reduced-motion","stops-autoplay","suppresses-animation","user-pause-control"])}),pa=Object.freeze({upstream:"pinned-public-contract",target:"lyra-authored-contract-and-automated-tests"});var ma=["typeEquivalences","structuralTypeAliases","methodParameterTypeEquivalences","defaultEquivalences","derivedDefaultEquivalences","inferredAttributeSuppressions","unknownMethodReturnTypes","cancelabilityEquivalences","cancelabilityPathAdditions","attributePropertyEquivalences","reflectionEquivalences","cssDefaultEquivalences","deprecationEquivalences"],un=new Map([["never",0],["conditional",1],["always",2]]),bs=[];var da=Object.freeze({dir:"platform-global-passthrough",lang:"platform-global-passthrough",role:"platform-global-passthrough",tabindex:"platform-global-passthrough",title:"platform-global-passthrough","did-ssr":"upstream-hydration-marker"});function On(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}c(On,"isPlainObject");function fa(e){return new Set(dr.flatMap(t=>(e?.[t]??[]).map(n=>`${t}:${n}`)))}c(fa,"accessibilityBehaviorSet");function Ql(e,t,n){let s=e?.[t],r=e?.[n];if(!s)throw new Error(`unknown upstream accessibility profile ${String(t)}`);if(!r)throw new Error(`unknown target accessibility profile ${String(n)}`);let o=fa(s),i=fa(r),a=[...o].filter(m=>!i.has(m)).sort(),l=[...i].filter(m=>!o.has(m)).sort();return{status:o.size===0&&i.size===0?"not-applicable":a.length>0?"warning-required":l.length>0?"target-additive":"equivalent",missing:a,additions:l}}c(Ql,"compareAccessibilityProfiles");function eu(e,t){if(!On(e)||Object.keys(e).length===0){t.push("accessibilityProfiles must be a non-empty object");return}for(let[n,s]of Object.entries(e)){if(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(n)||t.push(`accessibility profile ${n}: invalid profile name`),!On(s)){t.push(`accessibility profile ${n}: profile must be an object`);continue}let r=new Set(["description",...dr]),o=Object.keys(s).filter(i=>!r.has(i));o.length>0&&t.push(`accessibility profile ${n}: unknown key(s) ${o.join(", ")}`),(typeof s.description!="string"||!s.description.trim())&&t.push(`accessibility profile ${n}: description must be non-empty`);for(let i of dr){let a=s[i];if(!Array.isArray(a)){t.push(`accessibility profile ${n}: ${i} must be an array`);continue}new Set(a).size!==a.length&&t.push(`accessibility profile ${n}: duplicate ${i} behavior`),JSON.stringify(a)!==JSON.stringify([...a].sort())&&t.push(`accessibility profile ${n}: ${i} behaviors must be sorted`);let l=new Set(Xl[i]);for(let u of a)l.has(u)||t.push(`accessibility profile ${n}: unknown ${i} behavior ${String(u)}`)}}}c(eu,"validateAccessibilityProfiles");function tu(e,t,n){let s=e.parity?.accessibility;if(!On(s)){n.push(`${e.upstreamTag}: missing accessibility parity review`);return}let r=new Set(["reviewStatus","upstreamProfile","targetProfile","evidence","comparison","rationale"]),o=Object.keys(s).filter(l=>!r.has(l));o.length>0&&n.push(`${e.upstreamTag}: accessibility parity has unknown key(s) ${o.join(", ")}`),s.reviewStatus!=="complete"&&n.push(`${e.upstreamTag}: accessibility parity review is incomplete`),(!On(s.evidence)||s.evidence.upstream!==pa.upstream||s.evidence.target!==pa.target||Object.keys(s.evidence??{}).some(l=>l!=="upstream"&&l!=="target"))&&n.push(`${e.upstreamTag}: accessibility parity evidence is invalid`),(typeof s.rationale!="string"||!s.rationale.trim())&&n.push(`${e.upstreamTag}: accessibility parity rationale must be non-empty`);let i;try{i=Ql(t,s.upstreamProfile,s.targetProfile)}catch(l){n.push(`${e.upstreamTag}: ${l instanceof Error?l.message:String(l)}`);return}(!On(s.comparison)||!hs(s.comparison,i))&&n.push(`${e.upstreamTag}: stored accessibility comparison is stale`);let a=e.parity?.lightDom==="warning-required"&&Array.isArray(e.parity?.behaviorReviewFlags)&&e.parity.behaviorReviewFlags.length>0;(e.classification==="exact"||e.classification==="rewritten")&&i.status==="warning-required"&&!a&&n.push(`${e.upstreamTag}: automatic mapping has missing accessibility behavior`)}c(tu,"validateAccessibilityParity");function Oa(e,t){let n=[];if(eu(e,n),!Array.isArray(t))n.push("accessibility mappings must be an array");else for(let s of t)tu(s,e,n);return n.sort()}c(Oa,"validateAccessibilityContract");var _t="unspecified-public-documentation";var Ut=c((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"hasOwn"),nu=c(e=>e?.text?.replace(/\s+/g," ").trim()||"unknown","textOf");var ha=c(e=>[...new Set(e)].sort(),"unique");var su=["AnimationEvent","BeforeUnloadEvent","ClipboardEvent","CloseEvent","CompositionEvent","CustomEvent","DeviceMotionEvent","DeviceOrientationEvent","DragEvent","ErrorEvent","Event","FocusEvent","GamepadEvent","HashChangeEvent","InputEvent","KeyboardEvent","MessageEvent","MouseEvent","PageTransitionEvent","PointerEvent","PopStateEvent","ProgressEvent","PromiseRejectionEvent","SecurityPolicyViolationEvent","StorageEvent","SubmitEvent","ToggleEvent","TouchEvent","TrackEvent","TransitionEvent","UIEvent","WheelEvent"],gs=su.join("|"),ru=new RegExp(`^(${gs})(?:<.*>)?$`,"u"),ou=new RegExp(`^(?:${gs})(?:<.*>)?(?:\\s*\\|\\s*(?:${gs})(?:<.*>)?)+$`,"u"),au=new RegExp(`^(${gs})(?:<.*>)?\\s*&\\s*\\{[^]*\\bdetail\\s*:`,"u");function iu(e){let t=nu(e),n=ru.exec(t);if(n)return n[1];let s=au.exec(t);return s?s[1]:ou.test(t)?t:void 0}c(iu,"eventConstructor");var gf=Object.freeze({webawesome:"@awesome.me/webawesome",shoelace:"@shoelace-style/shoelace"});function Nn(e,t){return e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).sort().join("\0")===[...t].sort().join("\0")}c(Nn,"exactObjectKeys");var cu=new Set(["ambient-page-viewport"]),ga=Object.freeze({upstream:"pinned-package-black-box",target:"lyra-authored-contract-and-automated-tests"}),ya="method-edge-return-sentinel-divergence";function ba(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e.kind==="sentinel"?Nn(e,["kind","value"])&&(e.value===null||typeof e.value=="string"||typeof e.value=="boolean"||typeof e.value=="number"&&Number.isFinite(e.value)):e.kind==="measurement"&&Nn(e,["kind","basis"])&&cu.has(e.basis)}c(ba,"validMethodEdgeOutcome");function Na(e,{upstream:t,target:n}={}){let s=[],r=e?.upstreamTag??"<unknown>",o=e?.parity?.methodEdges,i=(t?.methods??[]).filter(g=>g.edgeSemantics),a=new Map(i.map(g=>[g.name,g])),l=e?.parity?.behaviorReviewFlags,u=Array.isArray(l)&&l.includes(ya);if(o===void 0)return i.length>0&&s.push(`${r}: missing method-edge parity review`),u&&s.push(`${r}: stale method-edge divergence behavior flag`),s;if(!Array.isArray(o)||o.length===0)return s.push(`${r}: parity.methodEdges must be a non-empty array`),u&&s.push(`${r}: stale method-edge divergence behavior flag`),s;let m=new Set,h=!1;for(let g of o){if(!(Nn(g,["method","evidence","cases","rationale"])&&typeof g.method=="string"&&!!g.method.trim()&&Nn(g.evidence,["upstream","target"])&&g.evidence.upstream===ga.upstream&&g.evidence.target===ga.target&&Array.isArray(g.cases)&&g.cases.length>0&&typeof g.rationale=="string"&&!!g.rationale.trim())){s.push(`${r}: malformed method-edge parity review`);continue}m.has(g.method)&&s.push(`${r}: duplicate method-edge parity review ${g.method}`),m.add(g.method);let $=a.get(g.method);t!==void 0&&!$&&s.push(`${r}#${g.method}: stale method-edge parity review`),n!==void 0&&!(n.methods??[]).some(E=>E.name===g.method)&&s.push(`${r}#${g.method}: dangling method-edge parity target`);let w=new Map(($?.edgeSemantics?.cases??[]).map(E=>[E.case,E])),f=new Set;for(let E of g.cases){if(!(Nn(E,["case","arguments","upstream","target","status"])&&typeof E.case=="string"&&!!E.case.trim()&&Array.isArray(E.arguments)&&E.arguments.every(k=>typeof k=="string"&&!!k.trim())&&ba(E.upstream)&&ba(E.target)&&(E.status==="equivalent"||E.status==="different"))){s.push(`${r}#${g.method}: malformed method-edge parity case`);continue}f.has(E.case)&&s.push(`${r}#${g.method}: duplicate method-edge parity case ${E.case}`),f.add(E.case);let A=hs(E.upstream,E.target)?"equivalent":"different";if(E.status!==A&&s.push(`${r}#${g.method}:${E.case}: stale method-edge parity status`),A==="different"&&(h=!0),$){let k=w.get(E.case);(!k||!hs(k.arguments,E.arguments)||!hs(k.outcome,E.upstream))&&s.push(`${r}#${g.method}:${E.case}: stored upstream method-edge observation is stale`)}}if($)for(let E of $.edgeSemantics.cases??[])f.has(E.case)||s.push(`${r}#${g.method}:${E.case}: missing method-edge parity case`)}if(t!==void 0)for(let g of i)m.has(g.name)||s.push(`${r}#${g.name}: missing method-edge parity review`);return h?(e.classification!=="warning-required"&&s.push(`${r}: method-edge divergence requires warning-required classification`),u||s.push(`${r}: missing ${ya} behavior flag`),o.some(y=>typeof e.rationale!="string"||typeof y?.rationale!="string"||!e.rationale.includes(y.rationale))&&s.push(`${r}: mapping rationale omits method-edge divergence`)):u&&s.push(`${r}: stale method-edge divergence behavior flag`),s}c(Na,"validateMethodEdgeParity");function fr(e,t){return e.startsWith(t)?`lr-${e.slice(t.length)}`:e}c(fr,"mappedEventName");function $a(e){return/^(?:no|not|without|hide|disable)-/.test(e)?-1:/^(?:with|show|enable)-/.test(e)?1:0}c($a,"polarity");function wa(e){return e.replace(/^(?:no|not|without|hide|disable|with|show|enable)-/,"")}c(wa,"polarityStem");function Fe(e,t,n,s){e.push({code:t,section:n,member:s})}c(Fe,"pushMissing");function pr(e,t){return`${e}:${t}`}c(pr,"normalizationKey");function va(e,t,n,s){let r=(e.defaultEquivalences??[]).find(o=>o.memberKind===t&&o.member===n&&o.upstream===s);return r?r.target:s}c(va,"normalizedExpectedDefault");function lu(e,t,n,s){return(e.attributePropertyEquivalences??[]).some(r=>r.attribute===t&&r.upstream===n&&r.target===s)}c(lu,"reviewedAttributeProperty");function Ea(e,t,n,s,r){return(e.reflectionEquivalences??[]).some(o=>o.memberKind===t&&o.member===n&&o.upstream===s&&o.target===r)}c(Ea,"reviewedReflection");function uu(e,t,n,s){return(e.cssDefaultEquivalences??[]).some(r=>r.member===t&&r.upstreamHasDefault===n.hasDefault&&(!r.upstreamHasDefault||r.upstream===n.default)&&r.targetHasDefault===s.hasDefault&&(!r.targetHasDefault||r.target===s.default))}c(uu,"reviewedCssDefault");function ys(e){if(e&&typeof e=="object"){let t=e.replacement;if(!t||typeof t!="object")return null;let n=typeof t.usage=="string"?t.usage.trim():"";return/^([a-z][a-z0-9-]*)\s*=\s*["'][^"']+["']$/iu.exec(n)?.[1]===t.name?n.replace(/\s+/gu,""):typeof t.name=="string"&&t.name?t.name:null}return typeof e!="string"?null:/\buse\s+(?:the\s+)?`([^`]+)`/iu.exec(e)?.[1]??/\buse\s+(?:the\s+)?(?!the\b)([a-z][a-z0-9-]*)\s+(?:part|property|attribute|slot|method)\b/iu.exec(e)?.[1]??null}c(ys,"deprecationReplacement");function pu(e,t,n,s,r,o,i){return(e.deprecationEquivalences??[]).some(a=>a.section===t&&a.member===n&&a.upstreamDeprecated===s&&a.upstreamReplacement===r&&a.targetDeprecated===o&&a.targetReplacement===i)}c(pu,"reviewedDeprecation");function Ca(e,t){if(e===null)return null;let n=/^([a-z][a-z0-9-]*)(=.*)$/iu.exec(e);return n?`${t.get(n[1])||n[1]}${n[2]}`:t.get(e)||e}c(Ca,"rewriteDeprecationReplacement");function xa(e,t,n,s,r){return r.hasDefault?!1:(e.derivedDefaultEquivalences??[]).some(o=>o.memberKind===t&&o.member===n&&o.upstream===s)}c(xa,"reviewedDerivedDefault");function _a(e,t){if(typeof e!="string")return!1;let n=null;for(let s=0;s<e.length;){let r=e[s];if(n){if(r==="\\"){s+=2;continue}r===n&&(n=null),s++;continue}if(r==="'"||r==='"'||r==="`"){n=r,s++;continue}if(/[A-Za-z_$]/u.test(r)){let o=s+1;for(;o<e.length&&/[A-Za-z0-9_$]/u.test(e[o]);)o++;if(e.slice(s,o)===t){let i=o;for(;i<e.length&&/\s/u.test(e[i]);)i++;if(e[i]==="?")for(i++;i<e.length&&/\s/u.test(e[i]);)i++;if(e[i]!==":"&&e[i]!=="(")return!0}s=o;continue}s++}return!1}c(_a,"containsTypePositionKeyword");function He(e){return _a(e,"any")}c(He,"containsAnyTypeKeyword");function Cn(e){return _a(e,"unknown")}c(Cn,"containsUnknownTypeKeyword");function _n(e){return typeof e=="string"&&e.includes("${")}c(_n,"containsTemplateInterpolation");function mu(e){return new Map((e?.structuralTypeAliases??[]).filter(t=>typeof t?.name=="string"&&typeof t.target=="string").map(t=>[t.name,t.target]))}c(mu,"structuralTypeAliasMap");function Sa(e,t){return typeof e!="string"?!1:new RegExp(`(^|[^A-Za-z0-9_$])${t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}([^A-Za-z0-9_$]|$)`,"u").test(e)}c(Sa,"typeContainsIdentifier");function Ia(e,t,n=new Set){if(typeof e!="string")return e;let s=mu(t);if(s.size===0)return e;let r="",o=null;for(let i=0;i<e.length;){let a=e[i];if(o){if(r+=a,a==="\\"&&i+1<e.length){r+=e[i+1],i+=2;continue}a===o&&(o=null),i+=1;continue}if(a==="'"||a==='"'||a==="`"){o=a,r+=a,i+=1;continue}if(/[A-Za-z_$]/u.test(a)){let l=i+1;for(;l<e.length&&/[A-Za-z0-9_$]/u.test(e[l]);)l+=1;let u=e.slice(i,l),m=s.get(u);typeof m=="string"&&!n.has(u)?r+=Ia(m,t,new Set([...n,u])):r+=u,i=l;continue}r+=a,i+=1}return r}c(Ia,"expandStructuralTypeAliases");function Rn(e,t,n,s,r){return He(s)||He(r)||t==="event"&&(pn(s)||pn(r)||hr(r))?!1:(e.typeEquivalences??[]).some(o=>o.memberKind===t&&o.member===n&&o.upstream===s&&o.target===r)}c(Rn,"reviewedTypeEquivalent");function du(e,t,n,s,r){return typeof s!="string"||typeof r!="string"||He(s)||He(r)||Cn(s)||Cn(r)||_n(s)||_n(r)?!1:(e.methodParameterTypeEquivalences??[]).some(o=>o.method===t&&o.parameter===n&&o.upstream===s&&o.target===r)}c(du,"reviewedMethodParameterTypeEquivalent");function fu(e,t,n,s){let r=un.get(n),o=un.get(s);if(r===void 0||o===void 0)return!1;let i=c(a=>a.event===t&&a.upstream===n&&a.target===s,"matches");return o>r?(e.cancelabilityEquivalences??[]).some(i):n==="always"&&s==="conditional"&&(e.cancelabilityPathAdditions??[]).some(i)}c(fu,"reviewedCancelability");function ka(e,t,n,s){return(e.defaults??[]).some(r=>r.action==="insert-if-absent"&&r.memberKind===t&&r.member===n&&r.value===s)}c(ka,"insertionPreservesDefault");function st(e,t){if(typeof e!="string")return e;let n=t==="wa-"?"Wa":t==="sl-"?"Sl":null;return n?e.replace(new RegExp(`\\b${n}([A-Z][A-Za-z0-9_$]*)\\b`,"gu"),"Lyra$1"):e}c(st,"mappedPublicType");function wt(e){return!!e&&e!=="unknown"&&e!==_t}c(wt,"hasPublishedType");function Ma(e){let t=[],n=0,s=0,r=null;for(let i=0;i<e.length;i+=1){let a=e[i];if(r){a===r&&e[i-1]!=="\\"&&(r=null);continue}if(a==="'"||a==='"'||a==="`"){r=a;continue}if("([{<".includes(a))s+=1;else if([")","]","}",">"].includes(a))s=Math.max(0,s-1);else if(a==="|"&&s===0){let l=e.slice(n,i).trim();l&&t.push(l),n=i+1}}let o=e.slice(n).trim();return o&&t.push(o),t}c(Ma,"splitTopLevelUnion");function Ta(e){return typeof e!="string"?[]:Ma(e.replace(/^\s*\|\s*/u,"").replace(/\s+/gu," ").trim())}c(Ta,"normalizedTypeTokens");function hu(e){return/^(?:'[^']*'|"[^"]*"|`[^`]*`)$/u.test(e)?"string":/^-?(?:\d+(?:\.\d*)?|\.\d+)$/u.test(e)?"number":e==="true"||e==="false"?"boolean":null}c(hu,"literalPrimitive");function An(e,t){if(He(e)||He(t))return!1;let n=Ta(e),s=Ta(t);if(n.length===s.length){let o=new Set(s);if(n.every(i=>o.has(i)))return!0}let r=new Set(s);return n.every(o=>{if(r.has(o))return!0;let i=hu(o);return!!(i&&r.has(i)||o==="array"&&s.some(a=>/(?:\[\]|Array<.+>)$/u.test(a)))})}c(An,"publicTypeCompatible");function Ra(e){if(typeof e!="string")return;let t=e.trim(),s=/^CustomEvent\s*</u.test(t)&&t.endsWith(">")?t.slice(t.indexOf("<")+1,-1).trim():t,r="",o=null,i=!1,a=0,l=0,u=0,m=0;for(let h of s){if(o){r+=h,i?i=!1:h==="\\"?i=!0:h===o&&(o=null);continue}if(h==="'"||h==='"'||h==="`"){o=h,r+=h;continue}/\s/u.test(h)||(h==="{"?a+=1:h==="}"?a=Math.max(0,a-1):h==="<"?l+=1:h===">"?l=Math.max(0,l-1):h==="["?u+=1:h==="]"?u=Math.max(0,u-1):h==="("?m+=1:h===")"&&(m=Math.max(0,m-1)),h===","&&a>0&&l===0&&u===0&&m===0?r+=";":r+=h)}return r.replace(/\bvoid\b/gu,"undefined").replace(/;\}/gu,"}")}c(Ra,"canonicalEventType");function ja(e){let t=e.trim();for(;t.startsWith("(")&&t.endsWith(")");){let n=0,s=null,r=!1;for(let o=0;o<t.length;o+=1){let i=t[o];if(s){i===s&&t[o-1]!=="\\"&&(s=null);continue}if(i==="'"||i==='"'||i==="`"){s=i;continue}if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0)){r=o===t.length-1;break}}if(!r)break;t=t.slice(1,-1).trim()}return t}c(ja,"stripBalancedOuterParentheses");function gu(e){let t=e.trim(),n=/^CustomEvent\s*</u.exec(t);if(!n)return;let s=n[0].lastIndexOf("<"),r=0,o=null;for(let i=s;i<t.length;i+=1){let a=t[i];if(o){a===o&&t[i-1]!=="\\"&&(o=null);continue}if(a==="'"||a==='"'||a==="`"){o=a;continue}if(a==="<")r+=1;else if(a===">"&&(r-=1,r===0))return t.slice(i+1).trim()===""?t.slice(s+1,i).trim():void 0}}c(gu,"customEventDetailType");function Aa(e){return Ma(ja(e)).includes("unknown")}c(Aa,"hasTopLevelUnknown");function pn(e){if(typeof e!="string")return!1;let t=ja(e);if(Aa(t))return!0;let n=gu(t);return n!==void 0&&Aa(n)}c(pn,"isUnknownEventType");function hr(e){return typeof e=="string"&&/^CustomEvent\s*$/u.test(e.trim())}c(hr,"isBareCustomEventType");function Pa(e,t,n={}){if(t=Ia(t,n),!wt(e)||!wt(t)||He(e)||He(t)||pn(e)||pn(t)||hr(t))return!1;let s=/^CustomEvent\s*</u.test(e.trim()),r=/^CustomEvent\s*</u.test(t.trim());return s!==r&&iu(s?t:e)!==void 0?!1:Ra(e)===Ra(t)}c(Pa,"eventTypeCompatible");function yu(e,t,n,s,r){let o=e??[],i=t??[];return i.length<o.length||!o.every((l,u)=>{let m=i[u];return!m||l.name!==m.name||l.type!==_t&&st(l.type,n)!==m.type&&!du(r,s,l.name,l.type,m.type)||(l.optional||l.hasDefault)&&!(m.optional||m.hasDefault)?!1:!l.hasDefault||m.hasDefault&&l.default===m.default})?!1:i.slice(o.length).every(l=>l.optional||l.hasDefault)}c(yu,"parametersMatch");function bu(e,t,n,s,r,o=!1){return yu(t.parameters,n.parameters,s,e,r)&&(t.returnType===_t||o&&t.returnType==="unknown"||st(t.returnType,s)===n.returnType)}c(bu,"overloadMatches");function mr(e,t,n,s,r,o=!1){return(t??[]).every(i=>(n??[]).some(a=>bu(e,i,a,s,r,o)))}c(mr,"methodOverloadsMatch");function za(e,t,{upstreamPrefix:n,rewrites:s={},normalizations:r={}}={}){let o=[],i=new Map((s.attributes??[]).map(p=>[p.from,p.to])),a=new Map((s.properties??[]).map(p=>[p.from,p.to])),l=new Set((s.attributes??[]).filter(p=>p.value!==void 0).map(p=>p.from)),u=new Set((s.properties??[]).filter(p=>p.value!==void 0).map(p=>p.from)),m=new Map((s.events??[]).map(p=>[p.from,p.to])),h=new Map((s.methods??[]).map(p=>[p.from,p.to])),g=new Map([["attributes",i],["properties",a],["events",m],["methods",h],["staticProperties",new Map],["staticMethods",new Map],["moduleExports",new Map],...["slots","parts","cssProperties","cssStates"].map(p=>[p,new Map((s[p]??[]).map(A=>[A.from,A.to]))])]),y=new Set((r.unknownMethodReturnTypes??[]).map(p=>p.method)),$=new Map((r.inferredAttributeSuppressions??[]).map(p=>[p.attribute,p])),w=new Set,f=new Set((e.attributes??[]).filter(p=>Object.hasOwn(da,p.name)).map(p=>p.property).filter(Boolean)),E=c((p,A,k)=>{let N=!!A.deprecated,O=!!k.deprecated,q=ys(A.deprecated),b=ys(k.deprecated),j=Ca(q,g.get(p)??new Map);(N!==O||N&&O&&j!==b)&&!pu(r,p,A.name,N,q,O,b)&&o.push({code:N===O?"deprecation-replacement-mismatch":"deprecation-mismatch",section:p,member:A.name,expected:N?j??!0:!1,actual:O?b??!0:!1})},"compareDeprecation");for(let p of e.attributes??[]){if(Object.hasOwn(da,p.name))continue;let A=$.get(p.name),k=A?.property;if(k&&(p.inferred===!0||A.explicit===!0)){w.add(k),(t.properties??[]).some(d=>d.name===k)||Fe(o,"missing-property","properties",k);continue}let N=i.get(p.name)||p.name,O=(t.attributes??[]).find(d=>d.name===N);if(l.has(p.name)){O||Fe(o,"missing-attribute","attributes",p.name);continue}if(!O){let d=(t.attributes??[]).find(x=>wa(x.name)===wa(N)&&$a(x.name)!==$a(N));d?o.push({code:"polarity-mismatch",section:"attributes",member:p.name,expected:N,actual:d.name}):Fe(o,"missing-attribute","attributes",p.name);continue}let q=st(p.type,n);wt(p.type)&&!An(q,O.type)&&!Rn(r,"attribute",p.name,p.type,O.type)&&o.push({code:"type-mismatch",section:"attributes",member:p.name,expected:q,actual:O.type});let b=a.get(p.property)||p.property;b!==O.property&&!lu(r,p.name,p.property,O.property)&&o.push({code:"attribute-property-mismatch",section:"attributes",member:p.name,expected:b,actual:O.property}),p.reflects!==O.reflects&&!Ea(r,"attribute",p.name,p.reflects,O.reflects)&&o.push({code:"reflection-mismatch",section:"attributes",member:p.name,expected:p.reflects,actual:Ut(O,"reflects")?O.reflects:null});let j=va(r,"attribute",p.name,p.default);p.hasDefault&&(!O.hasDefault||O.default!==j)&&!xa(r,"attribute",p.name,p.default,O)&&!ka(s,"attribute",p.name,j)&&o.push({code:"default-mismatch",section:"attributes",member:p.name,expected:j,actual:O.hasDefault?O.default:null}),E("attributes",p,O)}for(let p of e.properties??[]){if(f.has(p.name))continue;let A=a.get(p.name)||p.name,k=(t.properties??[]).find(N=>N.name===A);if(!(!k&&w.has(A))){if(u.has(p.name)){k||Fe(o,"missing-property","properties",p.name);continue}if((e.attributes??[]).some(N=>N.property===p.name)){k?p.readonly===!1&&k.readonly!==!1&&o.push({code:"readonly-mismatch",section:"properties",member:p.name,expected:p.readonly,actual:Ut(k,"readonly")?k.readonly:null}):Fe(o,"missing-property","properties",p.name),k&&E("properties",p,k);continue}if(!k)Fe(o,"missing-property","properties",p.name);else{let N=st(p.type,n);wt(p.type)&&!An(N,k.type)&&!Rn(r,"property",p.name,p.type,k.type)&&o.push({code:"type-mismatch",section:"properties",member:p.name,expected:N,actual:k.type}),p.reflects!==k.reflects&&!Ea(r,"property",p.name,p.reflects,k.reflects)&&o.push({code:"reflection-mismatch",section:"properties",member:p.name,expected:p.reflects,actual:Ut(k,"reflects")?k.reflects:null}),p.readonly===!1&&k.readonly!==!1&&o.push({code:"readonly-mismatch",section:"properties",member:p.name,expected:p.readonly,actual:Ut(k,"readonly")?k.readonly:null});let O=va(r,"property",p.name,p.default);if(E("properties",p,k),!p.hasDefault||k.hasDefault&&k.default===O||xa(r,"property",p.name,p.default,k)||ka(s,"property",p.name,O))continue;o.push({code:"default-mismatch",section:"properties",member:p.name,expected:O,actual:k.hasDefault?k.default:null})}}}for(let p of e.staticProperties??[]){let A=(t.staticProperties??[]).find(N=>N.name===p.name);if(!A){Fe(o,"missing-static-property","staticProperties",p.name);continue}let k=st(p.type,n);wt(p.type)&&!An(k,A.type)&&!Rn(r,"staticProperty",p.name,p.type,A.type)&&o.push({code:"static-property-type-mismatch",section:"staticProperties",member:p.name,expected:k,actual:A.type}),p.readonly===!1&&A.readonly!==!1&&o.push({code:"static-property-readonly-mismatch",section:"staticProperties",member:p.name,expected:!1,actual:Ut(A,"readonly")?A.readonly:null}),E("staticProperties",p,A)}for(let[p,A]of[["slots","missing-slot"],["parts","missing-part"],["cssProperties","missing-css-property"],["cssStates","missing-css-state"]]){let k=new Map((t[p]??[]).map(O=>[O.name,O])),N=new Map((s[p]??[]).map(O=>[O.from,O.to]));for(let O of e[p]??[]){let q=N.get(O.name)||O.name,b=k.get(q);if(!b){Fe(o,A,p,O.name);continue}p==="cssProperties"&&!(O.hasDefault===b.hasDefault&&(!O.hasDefault||O.default===b.default))&&!uu(r,O.name,O,b)&&o.push({code:"css-default-mismatch",section:p,member:O.name,expectedHasDefault:O.hasDefault,expected:O.hasDefault?O.default:null,actualHasDefault:b.hasDefault,actual:b.hasDefault?b.default:null}),E(p,O,b)}}for(let p of e.methods??[]){let A=h.get(p.name)||p.name,k=(t.methods??[]).find(N=>N.name===A);k?mr(p.name,p.overloads,k.overloads,n,r,y.has(p.name))||o.push({code:"method-signature-mismatch",section:"methods",member:p.name,expected:p.overloads,actual:k.overloads}):Fe(o,"missing-method","methods",p.name),k&&E("methods",p,k)}for(let p of e.staticMethods??[]){let A=(t.staticMethods??[]).find(k=>k.name===p.name);A?mr(p.name,p.overloads,A.overloads,n,r)||o.push({code:"static-method-signature-mismatch",section:"staticMethods",member:p.name,expected:p.overloads,actual:A.overloads}):Fe(o,"missing-static-method","staticMethods",p.name),A&&E("staticMethods",p,A)}for(let p of e.moduleExports??[]){let A=(t.moduleExports??[]).filter(N=>N.name===p.name);if(A.length===0){o.push({code:"missing-module-export",section:"moduleExports",member:p.name,module:p.module});continue}if(p.kind==="unknown")continue;let k=A.filter(N=>N.kind===p.kind);if(k.length===0){o.push({code:"module-export-kind-mismatch",section:"moduleExports",member:p.name,module:p.module,expected:p.kind,actual:ha(A.map(N=>N.kind))});continue}p.kind==="function"?k.some(O=>mr(p.name,p.overloads,O.overloads,n,r))||o.push({code:"module-export-signature-mismatch",section:"moduleExports",member:p.name,module:p.module,expected:p.overloads,actual:k.map(O=>O.overloads)}):wt(p.type)&&!k.some(N=>An(st(p.type,n),N.type)||Rn(r,"moduleExport",p.name,p.type,N.type))&&o.push({code:"module-export-type-mismatch",section:"moduleExports",member:p.name,module:p.module,expected:st(p.type,n),actual:ha(k.map(N=>N.type))})}for(let p of e.events??[]){let A=m.get(p.name)||fr(p.name,n),k=(t.events??[]).find(N=>N.name===A);if(!k)Fe(o,"missing-event","events",p.name);else{let N=st(p.type,n);wt(p.type)&&!Pa(N,k.type,r)&&!Rn(r,"event",p.name,p.type,k.type)&&o.push({code:"event-type-mismatch",section:"events",member:p.name,expected:N,actual:k.type}),p.cancelable!==_t&&k.cancelable!==p.cancelable&&!fu(r,p.name,p.cancelable,k.cancelable)&&o.push({code:"cancelability-mismatch",section:"events",member:p.name,expected:p.cancelable,actual:k.cancelable});for(let[O,q]of[["constructor","event-constructor-mismatch"],["bubbles","event-bubbles-mismatch"],["composed","event-composed-mismatch"]])!Ut(p,O)||k[O]===p[O]||o.push({code:q,section:"events",member:p.name,expected:p[O],actual:Ut(k,O)?k[O]:null});E("events",p,k)}}e.form?.associated&&!t.form?.associated&&o.push({code:"form-association-mismatch",section:"form",member:"associated"});for(let p of e.form?.properties??[])(t.form?.properties??[]).includes(p)||Fe(o,"missing-form-property","form",p);for(let p of e.form?.methods??[])(t.form?.methods??[]).includes(p)||Fe(o,"missing-form-method","form",p);for(let p of e.native?.forwardedEvents??[])(t.native?.forwardedEvents??[]).includes(p)||Fe(o,"missing-native-event","native",p);for(let p of e.native?.delegatedMethods??[])(t.native?.delegatedMethods??[]).includes(p)||Fe(o,"missing-native-method","native",p);return o.sort((p,A)=>`${p.section}:${p.member}:${p.code}`.localeCompare(`${A.section}:${A.member}:${A.code}`))}c(za,"compareMappedSurfaces");function ln(e){return e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)}c(ln,"isReviewedScalar");function Da(e,{upstream:t,target:n}={}){let s=[],r=e.normalizations;if(r===void 0)return s;if(!r||typeof r!="object"||Array.isArray(r))return[`${e.upstreamTag}: normalizations must be an object`];for(let d of ma)Array.isArray(r[d])||s.push(`${e.upstreamTag}: normalizations.${d} must be an array`);for(let d of Object.keys(r))ma.includes(d)||s.push(`${e.upstreamTag}: unknown normalization section ${d}`);let o=new Map((e.rewrites?.attributes??[]).map(d=>[d.from,d.to])),i=new Map((e.rewrites?.properties??[]).map(d=>[d.from,d.to])),a=new Set;for(let d of r.attributePropertyEquivalences??[]){if(!(typeof d?.attribute=="string"&&!!d.attribute&&typeof d.upstream=="string"&&!!d.upstream&&typeof d.target=="string"&&!!d.target&&Object.keys(d).length===3)){s.push(`${e.upstreamTag}: invalid normalizations.attributePropertyEquivalences rule`);continue}a.has(d.attribute)&&s.push(`${e.upstreamTag}: duplicate attribute-property normalization ${d.attribute}`),a.add(d.attribute);let I=(t?.attributes??[]).find(M=>M.name===d.attribute),C=o.get(d.attribute)||d.attribute,P=(n?.attributes??[]).find(M=>M.name===C);I?I.property!==d.upstream&&s.push(`${e.upstreamTag}: stale upstream attribute-property normalization ${d.attribute}`):s.push(`${e.upstreamTag}: dangling upstream attribute-property normalization ${d.attribute}`),P?P.property!==d.target?s.push(`${e.upstreamTag}: stale target attribute-property normalization ${d.attribute}`):(i.get(d.upstream)||d.upstream)===d.target&&s.push(`${e.upstreamTag}: stale equivalent attribute-property normalization ${d.attribute}`):s.push(`${e.upstreamTag}: dangling target attribute-property normalization ${d.attribute}`)}let l=new Set;for(let d of r.reflectionEquivalences??[]){if(!(["attribute","property"].includes(d?.memberKind)&&typeof d.member=="string"&&!!d.member&&typeof d.upstream=="boolean"&&typeof d.target=="boolean"&&d.upstream!==d.target&&Object.keys(d).length===4)){s.push(`${e.upstreamTag}: invalid normalizations.reflectionEquivalences rule`);continue}let I=`${d.memberKind}:${d.member}`;l.has(I)&&s.push(`${e.upstreamTag}: duplicate reflection normalization ${I}`),l.add(I);let C=d.memberKind==="attribute"?"attributes":"properties",P=d.memberKind==="attribute"?o:i,M=(t?.[C]??[]).find(_=>_.name===d.member),R=(n?.[C]??[]).find(_=>_.name===(P.get(d.member)||d.member));M?M.reflects!==d.upstream&&s.push(`${e.upstreamTag}: stale upstream reflection normalization ${I}`):s.push(`${e.upstreamTag}: dangling upstream reflection normalization ${I}`),R?R.reflects!==d.target&&s.push(`${e.upstreamTag}: stale target reflection normalization ${I}`):s.push(`${e.upstreamTag}: dangling target reflection normalization ${I}`)}let u=new Set;for(let d of r.cssDefaultEquivalences??[]){let x=new Set(["member","upstreamHasDefault","targetHasDefault"]);d?.upstreamHasDefault===!0&&x.add("upstream"),d?.targetHasDefault===!0&&x.add("target");let I=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.member=="string"&&!!d.member&&typeof d.upstreamHasDefault=="boolean"&&typeof d.targetHasDefault=="boolean"&&(d.upstreamHasDefault!==!0||ln(d.upstream))&&(d.targetHasDefault!==!0||ln(d.target))&&I.length===x.size&&I.every(_=>x.has(_))&&(d.upstreamHasDefault!==d.targetHasDefault||d.upstreamHasDefault&&d.upstream!==d.target))){s.push(`${e.upstreamTag}: invalid normalizations.cssDefaultEquivalences rule`);continue}u.has(d.member)&&s.push(`${e.upstreamTag}: duplicate CSS-default normalization ${d.member}`),u.add(d.member);let P=(t?.cssProperties??[]).find(_=>_.name===d.member),M=new Map((e.rewrites?.cssProperties??[]).map(_=>[_.from,_.to])).get(d.member)||d.member,R=(n?.cssProperties??[]).find(_=>_.name===M);P?(P.hasDefault!==d.upstreamHasDefault||d.upstreamHasDefault&&P.default!==d.upstream)&&s.push(`${e.upstreamTag}: stale upstream CSS-default normalization ${d.member}`):s.push(`${e.upstreamTag}: dangling upstream CSS-default normalization ${d.member}`),R?(R.hasDefault!==d.targetHasDefault||d.targetHasDefault&&R.default!==d.target)&&s.push(`${e.upstreamTag}: stale target CSS-default normalization ${d.member}`):s.push(`${e.upstreamTag}: dangling target CSS-default normalization ${d.member}`)}let m=new Set;for(let d of r.deprecationEquivalences??[]){if(!(["attributes","properties","slots","events","parts","cssProperties","cssStates","methods","staticProperties","staticMethods","moduleExports"].includes(d?.section)&&typeof d.member=="string"&&!!d.member&&typeof d.upstreamDeprecated=="boolean"&&(d.upstreamReplacement===null||typeof d.upstreamReplacement=="string")&&typeof d.targetDeprecated=="boolean"&&(d.targetReplacement===null||typeof d.targetReplacement=="string")&&Object.keys(d).length===6)){s.push(`${e.upstreamTag}: invalid normalizations.deprecationEquivalences rule`);continue}let I=`${d.section}:${d.member}`;m.has(I)&&s.push(`${e.upstreamTag}: duplicate deprecation normalization ${I}`),m.add(I);let C=new Map((e.rewrites?.[d.section]??[]).map(de=>[de.from,de.to])),P=C.get(d.member)||d.member,M=(t?.[d.section]??[]).find(de=>de.name===d.member),R=(n?.[d.section]??[]).find(de=>de.name===P);if(!M){s.push(`${e.upstreamTag}: dangling upstream deprecation normalization ${I}`);continue}if(!R){s.push(`${e.upstreamTag}: dangling target deprecation normalization ${I}`);continue}let _=!!M.deprecated,W=ys(M.deprecated),ee=!!R.deprecated,ae=ys(R.deprecated);(_!==d.upstreamDeprecated||W!==d.upstreamReplacement)&&s.push(`${e.upstreamTag}: stale upstream deprecation normalization ${I}`),(ee!==d.targetDeprecated||ae!==d.targetReplacement)&&s.push(`${e.upstreamTag}: stale target deprecation normalization ${I}`);let pe=Ca(W,C);_===ee&&pe===ae&&s.push(`${e.upstreamTag}: stale equivalent deprecation normalization ${I}`)}let h=new Set,g=new Map;for(let d of r.structuralTypeAliases??[]){let x=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.name=="string"&&/^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(d.name)&&typeof d.target=="string"&&!!d.target.trim()&&!He(d.target)&&!Cn(d.target)&&!_n(d.target)&&x.length===2&&x.every(C=>C==="name"||C==="target"))){s.push(`${e.upstreamTag}: invalid normalizations.structuralTypeAliases rule`);continue}h.has(d.name)&&s.push(`${e.upstreamTag}: duplicate structural type alias ${d.name}`),h.add(d.name),g.set(d.name,d.target)}let y=new Set,$=c((d,x=new Set)=>{if(x.has(d)){s.push(`${e.upstreamTag}: cyclic structural type alias ${d}`);return}if(y.has(d))return;let I=g.get(d);if(I===void 0)return;y.add(d);let C=new Set([...x,d]);for(let P of g.keys())Sa(I,P)&&$(P,C)},"visitStructuralAlias");for(let d of n?.events??[])for(let x of g.keys())Sa(d.type,x)&&$(x);for(let d of g.keys())y.has(d)||s.push(`${e.upstreamTag}: stale structural type alias ${d}`);let w=new Set;for(let d of r.typeEquivalences??[]){let x=d&&typeof d=="object"?Object.keys(d):[];if(!((d?.memberKind==="attribute"||d?.memberKind==="property"||d?.memberKind==="event"||d?.memberKind==="staticProperty"||d?.memberKind==="moduleExport")&&typeof d.member=="string"&&!!d.member&&typeof d.upstream=="string"&&!!d.upstream&&typeof d.target=="string"&&!!d.target&&d.upstream!==d.target&&x.length===4&&x.every(ae=>["memberKind","member","upstream","target"].includes(ae)))){s.push(`${e.upstreamTag}: invalid normalizations.typeEquivalences rule`);continue}let C=pr(d.memberKind,d.member);(He(d.upstream)||He(d.target)||d.memberKind==="event"&&hr(d.target))&&s.push(`${e.upstreamTag}: unsafe any type normalization ${C}`),d.memberKind==="event"&&(pn(d.upstream)||pn(d.target))&&s.push(`${e.upstreamTag}: unsafe unknown event type normalization ${C}`),w.has(C)&&s.push(`${e.upstreamTag}: duplicate normalizations.typeEquivalences rule ${C}`),w.add(C);let P=d.memberKind==="attribute"?"attributes":d.memberKind==="property"?"properties":d.memberKind==="event"?"events":d.memberKind==="staticProperty"?"staticProperties":"moduleExports",M=new Map((e.rewrites?.[P]??[]).map(ae=>[ae.from,ae.to])),R=e.upstreamTag?.startsWith("wa-")?"wa-":"sl-",_=M.get(d.member)||(d.memberKind==="event"?fr(d.member,R):d.member),W=(t?.[P]??[]).find(ae=>ae.name===d.member),ee=(n?.[P]??[]).find(ae=>ae.name===_);d.memberKind==="property"&&(t?.attributes??[]).some(ae=>ae.property===d.member)&&s.push(`${e.upstreamTag}: unreachable property type normalization ${C}`),W?(!wt(W.type)||W.type!==d.upstream)&&s.push(`${e.upstreamTag}: stale upstream type normalization ${C}`):s.push(`${e.upstreamTag}: dangling upstream type normalization ${C}`),ee?ee.type!==d.target?s.push(`${e.upstreamTag}: stale target type normalization ${C}`):W&&wt(W.type)&&(d.memberKind==="event"?Pa(st(W.type,R),ee.type,r):An(st(W.type,R),ee.type))&&s.push(`${e.upstreamTag}: stale compatible type normalization ${C}`):s.push(`${e.upstreamTag}: dangling target type normalization ${C}`)}let f=new Map((e.rewrites?.methods??[]).map(d=>[d.from,d.to])),E=new Set;for(let d of r.methodParameterTypeEquivalences??[]){let x=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.method=="string"&&!!d.method.trim()&&typeof d.parameter=="string"&&!!d.parameter.trim()&&typeof d.upstream=="string"&&!!d.upstream.trim()&&d.upstream!==_t&&typeof d.target=="string"&&!!d.target.trim()&&d.target!==_t&&d.upstream!==d.target&&x.length===4&&x.every(pe=>["method","parameter","upstream","target"].includes(pe)))){s.push(`${e.upstreamTag}: invalid normalizations.methodParameterTypeEquivalences rule`);continue}let C=`${d.method}:${d.parameter}`;E.has(C)&&s.push(`${e.upstreamTag}: duplicate normalizations.methodParameterTypeEquivalences rule ${C}`),E.add(C),(He(d.upstream)||He(d.target))&&s.push(`${e.upstreamTag}: unsafe any method-parameter type normalization ${C}`),(Cn(d.upstream)||Cn(d.target))&&s.push(`${e.upstreamTag}: unsafe unknown method-parameter type normalization ${C}`),(_n(d.upstream)||_n(d.target))&&s.push(`${e.upstreamTag}: unsafe template interpolation method-parameter type normalization ${C}`);let P=(t?.methods??[]).find(pe=>pe.name===d.method),M=f.get(d.method)||d.method,R=(n?.methods??[]).find(pe=>pe.name===M),_=(P?.overloads??[]).flatMap(pe=>pe.parameters??[]),W=(R?.overloads??[]).flatMap(pe=>pe.parameters??[]),ee=_.find(pe=>pe.name===d.parameter),ae=W.find(pe=>pe.name===d.parameter);P?ee?ee.type!==d.upstream&&s.push(`${e.upstreamTag}: stale upstream method-parameter type normalization ${C}`):s.push(`${e.upstreamTag}: dangling upstream method parameter normalization ${C}`):s.push(`${e.upstreamTag}: dangling upstream method-parameter type normalization ${C}`),R?ae?ae.type!==d.target?s.push(`${e.upstreamTag}: stale target method-parameter type normalization ${C}`):st(d.upstream,e.upstreamTag?.startsWith("wa-")?"wa-":"sl-")===ae.type&&s.push(`${e.upstreamTag}: stale compatible method-parameter type normalization ${C}`):s.push(`${e.upstreamTag}: dangling target method parameter normalization ${C}`):s.push(`${e.upstreamTag}: dangling target method-parameter type normalization ${C}`)}let p=new Set;for(let d of r.defaultEquivalences??[]){let x=d&&typeof d=="object"?Object.keys(d):[];if(!((d?.memberKind==="attribute"||d?.memberKind==="property")&&typeof d.member=="string"&&!!d.member&&Object.hasOwn(d,"upstream")&&Object.hasOwn(d,"target")&&ln(d.upstream)&&ln(d.target)&&d.upstream!==d.target&&x.length===4&&x.every(_=>["memberKind","member","upstream","target"].includes(_)))){s.push(`${e.upstreamTag}: invalid normalizations.defaultEquivalences rule`);continue}let C=pr(d.memberKind,d.member);p.has(C)&&s.push(`${e.upstreamTag}: duplicate normalizations.defaultEquivalences rule ${C}`),p.add(C);let P=d.memberKind==="attribute"?"attributes":"properties",M=(t?.[P]??[]).find(_=>_.name===d.member),R=(n?.[P]??[]).find(_=>_.name===d.member);M?(!M.hasDefault||M.default!==d.upstream)&&s.push(`${e.upstreamTag}: stale upstream default normalization ${C}`):s.push(`${e.upstreamTag}: dangling upstream normalization member ${C}`),R?(!R.hasDefault||R.default!==d.target)&&s.push(`${e.upstreamTag}: stale target default normalization ${C}`):s.push(`${e.upstreamTag}: dangling target normalization member ${C}`)}let A=new Set,k=new Set;for(let d of r.inferredAttributeSuppressions??[]){let x=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.attribute=="string"&&!!d.attribute&&typeof d.property=="string"&&!!d.property&&(d.explicit===void 0||d.explicit===!0)&&x.every(_=>_==="attribute"||_==="property"||_==="explicit"))){s.push(`${e.upstreamTag}: invalid normalizations.inferredAttributeSuppressions rule`);continue}(A.has(d.attribute)||k.has(d.property))&&s.push(`${e.upstreamTag}: duplicate normalizations.inferredAttributeSuppressions rule ${d.attribute}:${d.property}`),A.add(d.attribute),k.add(d.property);let C=(t?.attributes??[]).find(_=>_.name===d.attribute),P=(t?.properties??[]).find(_=>_.name===d.property),M=(n?.attributes??[]).find(_=>_.name===d.attribute),R=(n?.properties??[]).find(_=>_.name===d.property);C?(C.inferred!==!0&&d.explicit!==!0&&s.push(`${e.upstreamTag}: cannot suppress explicit upstream attribute ${d.attribute}`),C.inferred===!0&&d.explicit===!0&&s.push(`${e.upstreamTag}: stale explicit attribute suppression ${d.attribute}`),C.property!==d.property&&s.push(`${e.upstreamTag}: stale inferred attribute property ${d.attribute}:${d.property}`)):s.push(`${e.upstreamTag}: dangling inferred upstream attribute ${d.attribute}`),P||s.push(`${e.upstreamTag}: dangling inferred upstream property ${d.property}`),R||s.push(`${e.upstreamTag}: dangling inferred target property ${d.property}`),M&&s.push(`${e.upstreamTag}: stale inferred attribute suppression ${d.attribute}`)}let N=new Set;for(let d of r.derivedDefaultEquivalences??[]){let x=d&&typeof d=="object"?Object.keys(d):[];if(!((d?.memberKind==="attribute"||d?.memberKind==="property")&&typeof d.member=="string"&&!!d.member&&Object.hasOwn(d,"upstream")&&Object.hasOwn(d,"target")&&ln(d.upstream)&&ln(d.target)&&x.length===4&&x.every(_=>["memberKind","member","upstream","target"].includes(_)))){s.push(`${e.upstreamTag}: invalid normalizations.derivedDefaultEquivalences rule`);continue}let C=pr(d.memberKind,d.member);N.has(C)&&s.push(`${e.upstreamTag}: duplicate normalizations.derivedDefaultEquivalences rule ${C}`),N.add(C);let P=d.memberKind==="attribute"?"attributes":"properties",M=(t?.[P]??[]).find(_=>_.name===d.member),R=(n?.[P]??[]).find(_=>_.name===d.member);M?(!M.hasDefault||M.default!==d.upstream)&&s.push(`${e.upstreamTag}: stale derived upstream default ${C}`):s.push(`${e.upstreamTag}: dangling derived-default upstream member ${C}`),R?R.hasDefault&&s.push(`${e.upstreamTag}: stale derived target default ${C}`):s.push(`${e.upstreamTag}: dangling derived-default target member ${C}`)}let O=new Set;for(let d of r.unknownMethodReturnTypes??[]){let x=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.method=="string"&&!!d.method&&x.length===1&&x[0]==="method")){s.push(`${e.upstreamTag}: invalid normalizations.unknownMethodReturnTypes rule`);continue}O.has(d.method)&&s.push(`${e.upstreamTag}: duplicate normalizations.unknownMethodReturnTypes rule ${d.method}`),O.add(d.method);let C=(t?.methods??[]).find(M=>M.name===d.method),P=(n?.methods??[]).find(M=>M.name===d.method);C?(C.overloads??[]).some(M=>M.returnType==="unknown"||M.returnType===_t)||s.push(`${e.upstreamTag}: stale unknown-return normalization ${d.method}`):s.push(`${e.upstreamTag}: dangling unknown-return upstream method ${d.method}`),P?(P.overloads??[]).every(M=>M.returnType==="unknown"||M.returnType===_t)&&s.push(`${e.upstreamTag}: stale concrete target return normalization ${d.method}`):s.push(`${e.upstreamTag}: dangling unknown-return target method ${d.method}`)}let q=new Set,b=e.upstreamTag?.startsWith("sl-")?"sl-":"wa-",j=new Map((e.rewrites?.events??[]).map(d=>[d.from,d.to]));for(let[d,x]of[["cancelabilityEquivalences",["event","upstream","target"]],["cancelabilityPathAdditions",["event","upstream","target","addedPath"]]])for(let I of r[d]??[]){let C=I&&typeof I=="object"?Object.keys(I):[];if(!(typeof I?.event=="string"&&!!I.event&&un.has(I.upstream)&&un.has(I.target)&&C.length===x.length&&C.every(W=>x.includes(W))&&(d==="cancelabilityEquivalences"?un.get(I.target)>un.get(I.upstream):I.upstream==="always"&&I.target==="conditional"&&typeof I.addedPath=="string"&&!!I.addedPath))){s.push(`${e.upstreamTag}: invalid normalizations.${d} rule`);continue}q.has(I.event)&&s.push(`${e.upstreamTag}: duplicate cancelability normalization ${I.event}`),q.add(I.event);let M=(t?.events??[]).find(W=>W.name===I.event),R=j.get(I.event)||fr(I.event,b),_=(n?.events??[]).find(W=>W.name===R);M?M.cancelable!==I.upstream&&s.push(`${e.upstreamTag}: stale upstream cancelability normalization ${I.event}`):s.push(`${e.upstreamTag}: dangling upstream cancelability normalization ${I.event}`),_?_.cancelable!==I.target&&s.push(`${e.upstreamTag}: stale target cancelability normalization ${I.event}`):s.push(`${e.upstreamTag}: dangling target cancelability normalization ${I.event}`)}return s.sort()}c(Da,"validateMappingNormalizations");function hs(e,t){return JSON.stringify(e)===JSON.stringify(t)}c(hs,"sameJson");function La(e){let t=[];if(!Array.isArray(e?.localMigrations))return["localMigrations must be an array"];let n=new Set(bs),s=new Map((e.components??[]).map(o=>[o.tag,o])),r=new Set;for(let o of e.localMigrations){if(!o||typeof o!="object"||Array.isArray(o)){t.push("localMigrations entries must be objects");continue}let i=Object.keys(o).filter(h=>h!=="origin"&&h!=="tag"&&h!=="defaults");i.length&&t.push(`local migration has unknown key(s) ${i.join(", ")}`),n.has(o.origin)||t.push(`local migration has unknown origin ${String(o.origin)}`),(typeof o.tag!="string"||!o.tag.startsWith("lr-"))&&t.push(`local migration needs a valid lr-* tag, got ${String(o.tag)}`);let a=`${String(o.origin)}:${String(o.tag)}`;r.has(a)&&t.push(`duplicate local migration ${a}`),r.add(a);let l=s.get(o.tag);if(l||t.push(`${a}: target tag is not registered`),!Array.isArray(o.defaults)||o.defaults.length===0){t.push(`${a}: defaults must be a non-empty array`);continue}let u=new Map((l?.surface?.attributes??[]).map(h=>[h.name,h])),m=new Set;for(let h of o.defaults){if(!h||typeof h!="object"||Array.isArray(h)){t.push(`${a}: default rules must be objects`);continue}let g=Object.keys(h).filter($=>!["memberKind","member","action","value"].includes($));if(g.length&&t.push(`${a}: default rule has unknown key(s) ${g.join(", ")}`),h.memberKind!=="attribute"&&t.push(`${a}: local defaults support only attribute members`),h.action!=="insert-if-absent"&&t.push(`${a}: local defaults support only insert-if-absent`),typeof h.member!="string"||!h.member){t.push(`${a}: default rule needs a member`);continue}m.has(h.member)&&t.push(`${a}: duplicate default member ${h.member}`),m.add(h.member);let y=u.get(h.member);y||t.push(`${a}: unknown target attribute ${h.member}`),Object.hasOwn(h,"value")?typeof h.value!="string"&&typeof h.value!="boolean"&&!(typeof h.value=="number"&&Number.isFinite(h.value))?t.push(`${a}: ${h.member} value must be a finite string, number, or boolean`):h.value===!1?t.push(`${a}: false boolean insertion requires explicit converter evidence`):h.value===!0&&!String(y?.type).includes("boolean")&&t.push(`${a}: true presence insertion requires a boolean target attribute ${h.member}`):t.push(`${a}: ${h.member} needs a value`)}}return t}c(La,"validateLocalMigrations");Tn();var wr=Ht.dirname($u(import.meta.url)),vr=Ht.resolve(wr,".."),br=Ht.join(wr,ds),Wa=In.existsSync(br)?br:Ht.join(wr,"migration-contract.json"),Mn=In.existsSync(Wa),Fa=Mn?Wa:Ht.join(vr,"scripts","fixtures","component-inventory.json");function Ka(){let e=In.readFileSync(Fa),t=Fa===br?fs(e):e;return JSON.parse(t.toString("utf8"))}c(Ka,"readMigrationInventory");var wu=Ht.join(vr,"scripts","fixtures","lyra-renames.json"),$s=3,vs=Object.freeze([...bs,...Wt]),rt=new Set(["exact","rewritten"]),vu=new Set(["exact","rewritten","warning-required","conceptual-only","unsupported"]),Ua=["attributes","properties","events","slots","parts","cssProperties","methods"],gr=[...Ua,"defaults"],$r=["webawesome","shoelace"],Ba=new Set(["free","pro"]),Eu=new Set(["reviewed","tag-only","unreviewed"]),xu=new Set(["not-applicable","surface-only","warning-required","unreviewed"]),Su=new Set(["all","granular","unavailable"]),ku=new Set(["wa-random-content"]);function U(e,t){if(!e)throw new Error(`Invalid component inventory migration contract: ${t}`)}c(U,"invariant");function ws(e,t){return new Set((e?.surface?.[t]??[]).map(n=>n.name))}c(ws,"surfaceNames");function yr(e){return e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)}c(yr,"isScalar");function Va(e,t,n,s){let r=e.rewrites[s];U(Array.isArray(r),`${e.upstreamTag}: rewrites.${s} must be an array`);let o=ws(t,s),i=ws(n,s),a=new Set;for(let l of r){U(l&&typeof l.from=="string"&&l.from&&typeof l.to=="string"&&l.to,`${e.upstreamTag}: every rewrites.${s} rule needs non-empty from/to`);let u=Object.keys(l).filter(m=>m!=="from"&&m!=="to"&&m!=="value");U(u.length===0,`${e.upstreamTag}: rewrites.${s} rule has unknown key(s) ${u.join(", ")}`),U(l.value===void 0||["attributes","properties"].includes(s)&&typeof l.value=="string"&&l.value,`${e.upstreamTag}: rewrites.${s} value is only supported as a non-empty attribute/property string`),U(l.from!==l.to,`${e.upstreamTag}: rewrites.${s} cannot map a member to itself`),U(!a.has(l.from),`${e.upstreamTag}: duplicate rewrites.${s} source ${l.from}`),a.add(l.from),U(o.has(l.from),`${e.upstreamTag}: unknown ${s} source ${l.from}`),U(i.has(l.to),`${e.upstreamTag}: unknown target ${s} member ${l.to}`)}}c(Va,"validateMemberRules");function qa(e,t,n){let s=e.rewrites.defaults;U(Array.isArray(s),`${e.upstreamTag}: rewrites.defaults must be an array`);let r=new Set;for(let o of s){U(o?.memberKind==="attribute"||o?.memberKind==="property",`${e.upstreamTag}: default memberKind must be attribute or property`),U(typeof o.member=="string"&&o.member,`${e.upstreamTag}: default rule needs member`),U(o.action==="insert-if-absent"||o.action==="replace-value",`${e.upstreamTag}: unsupported default action ${String(o.action)}`);let i=o.action==="insert-if-absent"?new Set(["memberKind","member","action","value"]):new Set(["memberKind","member","action","from","to"]),a=Object.keys(o).filter(m=>!i.has(m));U(a.length===0,`${e.upstreamTag}: default rule has unknown key(s) ${a.join(", ")}`);let l=`${o.memberKind}:${o.member}:${o.action}`;U(!r.has(l),`${e.upstreamTag}: duplicate default rule ${l}`),r.add(l);let u=o.memberKind==="attribute"?"attributes":"properties";U(ws(n,u).has(o.member),`${e.upstreamTag}: unknown target ${l}`),o.action==="insert-if-absent"?(U(o.memberKind==="attribute",`${e.upstreamTag}: insert-if-absent is only deterministic for attributes`),U(Object.hasOwn(o,"value"),`${e.upstreamTag}: ${l} needs value`),U(yr(o.value),`${e.upstreamTag}: ${l} value must be a scalar`),U(!Object.hasOwn(o,"from")&&!Object.hasOwn(o,"to"),`${e.upstreamTag}: ${l} cannot use from/to`)):(U(ws(t,u).has(o.member),`${e.upstreamTag}: unknown source ${l}`),U(Object.hasOwn(o,"from")&&Object.hasOwn(o,"to"),`${e.upstreamTag}: ${l} needs from/to`),U(yr(o.from)&&yr(o.to),`${e.upstreamTag}: ${l} from/to must be scalars`),U(o.from!==o.to,`${e.upstreamTag}: ${l} cannot replace a value with itself`),U(!Object.hasOwn(o,"value"),`${e.upstreamTag}: ${l} cannot use value`))}}c(qa,"validateDefaultRules");function Tu(e,t){let n={"missing-attribute":"attributes","polarity-mismatch":"attributes","missing-property":"properties","missing-event":"events","missing-slot":"slots","missing-part":"parts","missing-css-property":"cssProperties","missing-method":"methods"};if(t.code==="default-mismatch")return e.rewrites.defaults.some(r=>r.member===t.member);let s=n[t.code];return!!(s&&e.rewrites[s].some(r=>r.from===t.member))}c(Tu,"driftCovered");function Ru(e,t){let n=Array.isArray(e.rewrites?.[t])?e.rewrites[t]:[];return{source:{surface:{[t]:n.map(s=>({name:s?.from}))}},target:{surface:{[t]:n.map(s=>({name:s?.to}))}}}}c(Ru,"runtimeMemberSurfaces");function Au(e){let t={surface:{attributes:[],properties:[]}},n={surface:{attributes:[],properties:[]}},s=Array.isArray(e.rewrites?.defaults)?e.rewrites.defaults:[];for(let r of s){let o=r?.memberKind==="attribute"?"attributes":"properties";n.surface[o].push({name:r?.member}),r?.action==="replace-value"&&t.surface[o].push({name:r?.member})}return{source:t,target:n}}c(Au,"runtimeDefaultSurfaces");function Es(e,{renameLedger:t=null,exportDeprecations:n=[],lyraVersion:s=null,compatibilityContext:r=null}={}){U(e?.schemaVersion===1,"schemaVersion must be 1");let o=Object.hasOwn(e,"migrationRuntimeSchemaVersion");if(o){U(e.migrationRuntimeSchemaVersion===$s,`migrationRuntimeSchemaVersion must be ${$s}`),U(t===null,"a packaged runtime inventory carries its own rename projection");let f=Sn(e.lyraRenames,{projected:!0});U(f.length===0,f.join("; "))}let i=la(o?e.lyraRenames:t?kn(t,e,{exportDeprecations:n,compatibilityContext:r}):na(),{lyraVersion:s});U(Array.isArray(e.components),"components must be an array"),U(Array.isArray(e.mappings),"mappings must be an array"),U(e.upstreams&&typeof e.upstreams=="object","upstreams must be an object");let a=Oa(e.accessibilityProfiles,e.mappings);U(a.length===0,a.join("; "));let l=new Map;for(let f of e.components){U(typeof f.tag=="string"&&f.tag,"every Lyra component needs a tag"),U(!l.has(f.tag),`duplicate Lyra component ${f.tag}`),U(typeof f.registrationModule=="string"&&f.registrationModule.endsWith(".ts"),`${f.tag}: registrationModule must end in .ts`),Object.hasOwn(f,"rootIncluded")&&U(typeof f.rootIncluded=="boolean",`${f.tag}: rootIncluded must be boolean`),Object.hasOwn(f,"optionalPeers")&&(U(Array.isArray(f.optionalPeers),`${f.tag}: optionalPeers must be an array`),U(f.optionalPeers.every(p=>typeof p=="string"&&p),`${f.tag}: optionalPeers entries must be non-empty package names`));let E=f.registrationRoute??r?.componentRegistrationRoutes?.[f.tag];E!==void 0&&U(E===`./components/${f.tag}.js`,`${f.tag}: registrationRoute must be its stable tag-shaped package entry`),l.set(f.tag,E===void 0?f:{...f,registrationRoute:E})}let u=La(e);U(u.length===0,u.join("; "));let m=new Map(bs.map(f=>[f,new Map]));for(let f of e.localMigrations)m.get(f.origin).set(f.tag,f);let h=new Map,g=new Map,y=new Map($r.map(f=>[f,[]])),$=!1;for(let f of $r){let E=e.upstreams[f],p=E?.components;U(Array.isArray(p),`${f}: upstream components must be an array`);let A=Array.isArray(E?.packages)?E.packages:typeof E?.package=="string"&&E.package?[{name:E.package,tiers:["free","pro"]}]:[];Array.isArray(E?.packages)&&($=!0),U(A.length>0,`${f}: packages must contain at least one identity`);for(let k of A){U(k&&typeof k.name=="string"&&k.name,`${f}: package identity needs a non-empty name`),U(!g.has(k.name),`duplicate package identity ${k.name}`),U(Array.isArray(k.tiers)&&k.tiers.length>0,`${k.name}: tiers must be a non-empty array`),U(k.tiers.every(O=>Ba.has(O)),`${k.name}: tiers contain an unsupported value`),U(new Set(k.tiers).size===k.tiers.length,`${k.name}: tiers contain duplicates`);let N={ecosystem:f,tiers:new Set(k.tiers)};g.set(k.name,N),y.get(f).push({name:k.name,tiers:N.tiers})}for(let k of p)U(!h.has(k.tag),`duplicate upstream component ${k.tag}`),Object.hasOwn(k,"tier")&&(U(Ba.has(k.tier),`${k.tag}: unsupported package tier`),U(y.get(f).some(N=>N.tiers.has(k.tier)),`${k.tag}: no ${f} package identity provides tier ${k.tier}`)),h.set(k.tag,{ecosystem:f,component:k})}let w=new Map;for(let f of e.mappings){U(typeof f.upstreamTag=="string"&&f.upstreamTag,"every mapping needs upstreamTag"),U(!w.has(f.upstreamTag),`duplicate mapping ${f.upstreamTag}`),U(vu.has(f.classification),`${f.upstreamTag}: invalid classification`),U(f.upstream==="webawesome"||f.upstream==="shoelace",`${f.upstreamTag}: invalid upstream`);let E=h.get(f.upstreamTag);U(E?.ecosystem===f.upstream,`${f.upstreamTag}: missing upstream surface`);let p=l.get(f.targetTag);rt.has(f.classification)&&U(p,`${f.upstreamTag}: automatic mapping needs a registered target`),U(f.rewrites&&typeof f.rewrites=="object",`${f.upstreamTag}: rewrites missing`);let A=Object.keys(f.rewrites).filter(k=>!gr.includes(k));U(A.length===0,`${f.upstreamTag}: unknown rewrite section(s) ${A.join(", ")}`);for(let k of Ua)if(o){let N=Ru(f,k);Va(f,N.source,N.target,k)}else Va(f,E.component,p,k);if(o){let k=Au(f);qa(f,k.source,k.target),U(!Object.hasOwn(f,"normalizations")&&!Object.hasOwn(f,"drift"),`${f.upstreamTag}: packaged runtime mappings cannot carry analyzer-only data`)}else{qa(f,E.component,p);let k=Da(f,{upstream:E.component.surface,target:p?.surface});U(k.length===0,k.join("; ")),U(Array.isArray(f.drift),`${f.upstreamTag}: drift must be an array`)}if($){let k=f.parity;U(k&&typeof k=="object"&&!Array.isArray(k),`${f.upstreamTag}: parity missing`);let N=Object.keys(k).filter(j=>!["staticApi","lightDom","runtime","behaviorReviewFlags","accessibility","methodEdges"].includes(j));U(N.length===0,`${f.upstreamTag}: parity has unknown key(s) ${N.join(", ")}`),U(Eu.has(k.staticApi),`${f.upstreamTag}: invalid parity.staticApi`),U(xu.has(k.lightDom),`${f.upstreamTag}: invalid parity.lightDom`),U(Array.isArray(k.behaviorReviewFlags)&&k.behaviorReviewFlags.every(j=>typeof j=="string"&&j)&&new Set(k.behaviorReviewFlags).size===k.behaviorReviewFlags.length,`${f.upstreamTag}: parity.behaviorReviewFlags must contain unique non-empty strings`),U(k.runtime&&typeof k.runtime=="object"&&!Array.isArray(k.runtime),`${f.upstreamTag}: parity.runtime missing`),U(Object.keys(k.runtime).every(j=>j==="registration"||j==="optionalPeers"),`${f.upstreamTag}: parity.runtime has unknown keys`),U(Su.has(k.runtime.registration),`${f.upstreamTag}: invalid parity.runtime.registration`),U(Array.isArray(k.runtime.optionalPeers),`${f.upstreamTag}: parity.runtime.optionalPeers must be an array`);let O=p?p.rootIncluded===!1?"granular":"all":"unavailable";U(k.runtime.registration===O,`${f.upstreamTag}: parity runtime registration is stale`);let q=[...p?.optionalPeers??[]].sort();U(JSON.stringify([...k.runtime.optionalPeers].sort())===JSON.stringify(q),`${f.upstreamTag}: parity runtime optional peers are stale`);let b=Na(f,o?{}:{upstream:E.component.surface,target:p?.surface});U(b.length===0,b.join("; ")),rt.has(f.classification)&&(k.behaviorReviewFlags.length>0?U(f.classification==="rewritten"&&ku.has(f.upstreamTag)&&k.lightDom==="warning-required",`${f.upstreamTag}: automatic behavior review lacks a registered conditional scanner`):U(k.lightDom!=="warning-required"&&k.lightDom!=="unreviewed",`${f.upstreamTag}: automatic mapping cannot require unscoped light-DOM review`))}if(!o&&p&&E.component.review?.status==="complete"){let k=za(E.component.surface,p.surface,{upstreamPrefix:f.upstream==="webawesome"?"wa-":"sl-",rewrites:f.rewrites,normalizations:f.normalizations});U(JSON.stringify(f.drift)===JSON.stringify(k),`${f.upstreamTag}: stored surface drift is stale`)}f.classification==="exact"&&(o||U(f.drift.length===0,`${f.upstreamTag}: exact mapping has surface drift`),U(gr.every(k=>f.rewrites[k].length===0),`${f.upstreamTag}: exact mapping cannot declare rewrite rules`)),f.classification==="rewritten"&&(U(gr.some(k=>f.rewrites[k].length>0),`${f.upstreamTag}: rewritten mapping needs at least one deterministic rule`),o||U(f.drift.every(k=>Tu(f,k)),`${f.upstreamTag}: rewritten mapping contains drift without a deterministic rule`)),w.set(f.upstreamTag,{...f,drift:f.drift??[],source:E.component,target:p})}U(w.size===h.size,"every upstream tag must have exactly one mapping");for(let f of h.keys())U(w.has(f),`${f}: missing mapping`);return{inventory:e,components:l,mappings:w,upstreamComponents:h,localMigrations:m,renameProfiles:i,packageIdentities:g,packagesByEcosystem:y}}c(Es,"buildMigrationContract");function Ou(e,{renameLedger:t,exportDeprecations:n=[],compatibilityContext:s=null}={}){U(!Object.hasOwn(e??{},"migrationRuntimeSchemaVersion"),"cannot project an already-packaged migration runtime inventory"),U(t&&typeof t=="object","createMigrationRuntimeInventory needs the rename ledger"),Es(e,{renameLedger:t,exportDeprecations:n,compatibilityContext:s});let r=new Set(e.mappings.map(i=>i.targetTag).filter(Boolean)),o=new Map;for(let i of e.localMigrations){r.add(i.tag);let a=o.get(i.tag)??new Set;for(let l of i.defaults)a.add(l.member);o.set(i.tag,a)}return{schemaVersion:1,migrationRuntimeSchemaVersion:$s,accessibilityProfiles:structuredClone(e.accessibilityProfiles),components:e.components.filter(i=>r.has(i.tag)).map(i=>({tag:i.tag,registrationModule:i.registrationModule,...s?.componentRegistrationRoutes?.[i.tag]?{registrationRoute:s.componentRegistrationRoutes[i.tag]}:{},rootIncluded:i.rootIncluded,optionalPeers:structuredClone(i.optionalPeers??[]),surface:{attributes:(i.surface?.attributes??[]).filter(a=>o.get(i.tag)?.has(a.name)).map(a=>({name:a.name,type:a.type}))}})),localMigrations:structuredClone(e.localMigrations),upstreams:Object.fromEntries($r.map(i=>{let a=e.upstreams[i];return[i,{packages:structuredClone(a.packages),components:a.components.map(l=>({tag:l.tag,tier:l.tier}))}]})),mappings:e.mappings.map(i=>({upstream:i.upstream,upstreamTag:i.upstreamTag,targetTag:i.targetTag,classification:i.classification,rationale:i.rationale,parity:structuredClone(i.parity),rewrites:structuredClone(i.rewrites)})),lyraRenames:kn(t,e,{exportDeprecations:n,compatibilityContext:s})}}c(Ou,"createMigrationRuntimeInventory");function Er(e=wu){return JSON.parse(In.readFileSync(e,"utf8"))}c(Er,"readRenameLedger");function xr(e=Ht.join(vr,"scripts","fixtures","component-metadata.json")){let t=JSON.parse(In.readFileSync(e,"utf8")).exportDeprecations;return U(Array.isArray(t),"component metadata must contain exportDeprecations"),t}c(xr,"readExportDeprecations");function Nu(e){let t=new Map,n=[],s=null,r=c((o,i)=>{t.has(o)&&t.get(o)!==i?n.push(`${o}: already mapped to ${t.get(o)}, also saw ${i}`):t.set(o,i)},"setMapping");for(let o of e.split(`
16
- `)){let i=o.trim();if(/^\|\s*Component\s*\|\s*Mirrors\s*\|\s*Notes\s*\|$/.test(i)){s="wa";continue}if(/^\|\s*Shoelace\s*\|\s*Lyra\s*\|\s*Migration note\s*\|$/.test(i)){s="sl";continue}if(!i.startsWith("|")){s=null;continue}if(!s)continue;let a=i.split("|").slice(1,-1).map(h=>h.trim());if(a.length<2)continue;if(s==="sl"){let h=[...a[0].matchAll(/<sl-([a-z0-9-]+)>/g)].map(y=>y[1]),g=new Set([...a[1].matchAll(/<lr-([a-z0-9-]+)>/g)].map(y=>y[1]));for(let y of h)g.has(y)&&r(`sl-${y}`,`lr-${y}`);continue}let l=[...a[0].matchAll(/<lr-([a-z0-9-]+)>/g)].map(h=>h[1]),u=[...a[1].matchAll(/`((?:wa|sl)-[a-z0-9-]+\*?)`/g)].map(h=>h[1]);if(!l.length||!u.length)continue;let m=new Set;for(let h of l)for(let g of["wa","sl"]){let y=`${g}-${h}`;if(u.includes(y))r(y,`lr-${h}`),m.add(y);else{let $=u.find(w=>w.endsWith("*")&&y.startsWith(w.slice(0,-1)));$&&(r(y,`lr-${h}`),m.add($))}}if(l.length===1)for(let h of u)!m.has(h)&&!h.endsWith("*")&&r(h,`lr-${l[0]}`)}return{map:t,conflicts:n}}c(Nu,"buildMirrorMap");import jn from"node:path";function xs(e,t,n=e.length){let s=t+4;if(s<n&&e[s]===">")return s+1;if(s+1<n&&e.startsWith("->",s))return s+2;for(let r=s;r<n;r+=1){if(r+3<=n&&e.startsWith("-->",r))return r+3;if(r+4<=n&&e.startsWith("--!>",r))return r+4}return n}c(xs,"htmlCommentEnd");function Or(e){return e.startsWith("wa-")?"webawesome":"shoelace"}c(Or,"ecosystemForTag");function Ln(e){let t=[0];for(let n=0;n<e.length;n+=1)e[n]===`
17
- `&&t.push(n+1);return t}c(Ln,"lineStarts");function Jt(e,t){let n=0,s=e.length;for(;n+1<s;){let r=Math.floor((n+s)/2);e[r]<=t?n=r:s=r}return{line:n+1,column:t-e[n]+1}}c(Jt,"locationAt");function xt({textStarts:e,file:t,offset:n,origin:s,upstreamTag:r,upstreamMember:o=null,action:i,target:a=null,warningCode:l=null,behaviorReviewFlags:u=null,message:m}){let h=Jt(e,n),g={file:t,line:h.line,column:h.column,origin:s,upstreamTag:r,upstreamMember:o,action:i,target:a,warningCode:l,message:m};return u?.length&&(g.behaviorReviewFlags=Object.freeze([...u])),g}c(xt,"reportEntry");function Gt(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){let s=xs(e,n);t.push([n,s]),n=s;continue}if(e.startsWith("/*",n)){let s=e.indexOf("*/",n+2),r=s<0?e.length:s+2;t.push([n,r]),n=r;continue}if(e.startsWith("//",n)){let s=e.indexOf(`
18
- `,n+2),r=s<0?e.length:s;t.push([n,r]),n=r;continue}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let s=e[n++];for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]===s){n+=1;break}else n+=1;continue}n+=1}return t}c(Gt,"commentRanges");function fe(e,t){return t.some(([n,s])=>e>=n&&e<s)}c(fe,"insideRanges");function Me(e,t){let n=0;for(;n<e.length;){let s=e[n];if(s!=='"'&&s!=="'"&&s!=="`"){n+=1;continue}let r=n,o=s;for(n+=1;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]===o){n+=1;break}else n+=1;if(t>=r&&t<n)return[r,n]}return null}c(Me,"quotedRangeContaining");function ei(e){let t=[];for(let n of e.matchAll(/<style(?:\s[^>]*)?>(?<body>[\s\S]*?)<\/style\s*>/gi)){let s=Me(e,n.index);if(!s||e[s[0]]!=="`"||!/\bhtml\s*$/.test(e.slice(0,s[0]))||As(e,s[0],n.index))continue;let r=n.index+n[0].indexOf(n.groups.body);t.push([r,r+n.groups.body.length])}return t}c(ei,"htmlTemplateStyleRanges");function As(e,t,n){let s=0;for(let r=t+1;r<n;r+=1){if(e[r]==="\\"){r+=1;continue}if(s===0){if(e.startsWith("${",r))s=1,r+=1;else if(e[r]==="`")return!1;continue}if(e[r]==='"'||e[r]==="'"){let o=e[r];for(r+=1;r<n&&e[r]!==o;)e[r]==="\\"&&(r+=1),r+=1;continue}if(e.startsWith("//",r)){let o=e.indexOf(`
19
- `,r+2);r=o<0||o>=n?n:o;continue}if(e.startsWith("/*",r)){let o=e.indexOf("*/",r+2);r=o<0||o>=n?n:o+1;continue}e[r]==="{"?s+=1:e[r]==="}"&&(s=Math.max(0,s-1))}return s>0}c(As,"insideTemplateExpression");function fn(e,t){let n=null,s=0;for(let r=t;r<e.length;r+=1){let o=e[r];if(n){o==="\\"?r+=1:o===n&&(n=null);continue}if(o==='"'||o==="'"||o==="`"){n=o;continue}if(o==="{")s+=1;else if(o==="}")s=Math.max(0,s-1);else if(o===">"&&s===0)return r}return-1}c(fn,"findTagEnd");function ti(e,t){let n=[],s=/<(?<closing>\/)?(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)(?=[\s/>])/g;for(let r of e.matchAll(s)){if(fe(r.index,t))continue;let o=!!r.groups.closing,i=r.index+1+(o?1:0),a=fn(e,r.index+r[0].length);a<0||n.push({tag:r.groups.tag,start:r.index,nameStart:i,nameEnd:i+r.groups.tag.length,end:a,closing:o,selfClosing:!o&&/\/\s*>$/.test(e.slice(r.index,a+1))})}return n}c(ti,"scanMarkupTags");function Fn(e,t,n=s=>fe(s,t)){let s=[],r=/<(?<tag>[a-z][a-z0-9.-]*)(?=[\s/>])/gi;for(let o of e.matchAll(r)){if(n(o.index))continue;let i=fn(e,o.index+o[0].length);if(i<0)continue;let a=o.index+1;s.push({tag:o.groups.tag,start:o.index,nameStart:a,nameEnd:a+o.groups.tag.length,end:i,closing:!1,selfClosing:/\/\s*>$/.test(e.slice(o.index,i+1))})}return s}c(Fn,"scanAllOpeningTags");var Pn="construction",zn="lookup",Te="[$A-Z_a-z][$\\w]*";function Dn(e){let t=e.trim();for(;t.startsWith("(")&&Et(t,0,"(",")")===t.length;)t=t.slice(1,-1).trim();return t.replace(/\?\.\s*\[\s*(['"])([$A-Z_a-z][$\w]*)\1\s*\]/g,".$2").replace(/\[\s*(['"])([$A-Z_a-z][$\w]*)\1\s*\]/g,".$2").replace(/\s*(?:\?\.|\.)\s*/g,".")}c(Dn,"normalizedMemberExpression");function ni(e){let[t,...n]=e.split("."),s=c(r=>`(?:${r}\\s*!?|\\(\\s*${r}\\s+as\\s+[^;\\n]+?\\)\\s*!?)`,"wrapped");return n.reduce((r,o)=>{let i=Ce(o);return s(`${r}(?:\\s*(?:\\.|\\?\\.)\\s*${i}|\\s*(?:\\?\\.)?\\s*\\[\\s*(?:'${i}'|"${i}"|\\x60${i}\\x60)\\s*\\])`)},s(Ce(t)))}c(ni,"memberExpressionPattern");function Cu(e,t){let n=Dn(e);if(t.has(n))return n;let s=e.trim();for(let r of t.keys())if(new RegExp(`^(?:${ni(r)})$`).test(s))return r;return n}c(Cu,"canonicalFactoryExpression");function Tr(e,t,n,s,r=!0){let o=Dn(e),i=o.match(/^(?<target>.+)\.bind\s*\([^()]*\)$/s);if(i&&(o=Dn(i.groups.target)),t.has(o))return t.get(o);if(o==="createElement"&&r)return Pn;for(let a of n)if(o===`${a}.createElement`)return Pn;for(let a of s)if(o===`${a}.get`||o===`${a}.whenDefined`)return zn;return null}c(Tr,"classifyFactoryExpression");function _u(e,t,n,s,r=!0){let o=Tr(e,t,n,s,r);if(o)return o;let i=e.match(new RegExp(`^(?:async\\s+)?(?:\\(\\s*(?<parameter>${Te})[^)]*\\)|(?<bare>${Te}))\\s*=>\\s*(?<body>.+)$`,"s"));if(!i)return null;let a=i.groups.parameter??i.groups.bare,u=i.groups.body.trim().replace(/^\{\s*return\s+/,"").replace(/\s*\}$/,"").trim().match(new RegExp(`^(?<factory>${Te}(?:\\s*\\.\\s*${Te})*)\\s*\\(\\s*${Ce(a)}\\s*\\)$`));return u?Tr(u.groups.factory,t,n,s,r):null}c(_u,"classifyFactoryInitializer");function Rr(e){let t=[];for(let n of e.split(",")){let s=n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n\r]*/g,"").trim();if(!s||s.startsWith("..."))continue;let r=s.match(new RegExp(`^(?<property>${Te})(?:\\s*:\\s*(?<local>${Te}))?(?:\\s*=.*)?$`));r&&t.push({property:r.groups.property,local:r.groups.local??r.groups.property})}return t}c(Rr,"parseDestructuredBindings");function Iu(e){let t=[],n=[];for(let s=0;s<e.length;s+=1){if(e.startsWith("//",s)){let o=e.indexOf(`
20
- `,s+2);s=o<0?e.length:o;continue}if(e.startsWith("/*",s)){let o=e.indexOf("*/",s+2);s=o<0?e.length:o+1;continue}let r=e[s];if(r==='"'||r==="'"||r==="`"){let o=r;for(s+=1;s<e.length;)if(e[s]==="\\")s+=2;else{if(e[s]===o)break;s+=1}continue}r==="{"?t.push(s):r==="}"&&t.length>0&&n.push([t.pop(),s+1])}return n}c(Iu,"codeBraceRanges");function Mu(e,t){return new RegExp(`(?<![$\\w])${Ce(t)}(?![$\\w])`).test(e)}c(Mu,"identifierAppears");function Ar(e,t,n){let s=null;for(let r of e)r[0]>=t||r[1]<=t||(!s||r[1]-r[0]<s[1]-s[0])&&(s=r);return s??[0,n]}c(Ar,"enclosingBraceRange");function Ha(e,t){let n={"(":")","[":"]","{":"}"},s=[],r=null;for(let o=0;o<e.length;o+=1){let i=e[o];if(r){i==="\\"?o+=1:i===r&&(r=null);continue}if(i==='"'||i==="'"||i==="`"){r=i;continue}if(Object.hasOwn(n,i))s.push(n[i]);else if(s.at(-1)===i)s.pop();else if(s.length===0&&i===t)return o}return-1}c(Ha,"topLevelIndex");function Ja(e,t){let n=e;for(;n;){let s=Ha(n,","),r=(s<0?n:n.slice(0,s)).trim(),o=Ha(r,"="),i=(o<0?r:r.slice(0,o)).trim(),a=i.replace(/^\.\.\.\s*/,"");if(new RegExp(`^(?:(?:public|private|protected|readonly|override)\\s+)*(?:\\.\\.\\.\\s*)?${Ce(t)}(?=\\s*(?:[?:]|$))`).test(i)||(a.startsWith("{")||a.startsWith("["))&&Mu(a,t))return!0;if(s<0)break;n=n.slice(s+1)}return!1}c(Ja,"parameterListBindsName");function Ss(e,t){let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n+=1;continue}if(e.startsWith("//",n)){let s=e.indexOf(`
21
- `,n+2);n=s<0?e.length:s+1;continue}if(e.startsWith("/*",n)){let s=e.indexOf("*/",n+2);n=s<0?e.length:s+2;continue}break}return n}c(Ss,"nextCodeIndex");function ju(e,t){let n=0,s=null;for(let r=t;r<e.length;r+=1){let o=e[r];if(s){o==="\\"?r+=1:o===s&&(s=null);continue}if(e.startsWith("//",r)){let i=e.indexOf(`
22
- `,r+2);r=i<0?e.length:i;continue}if(e.startsWith("/*",r)){let i=e.indexOf("*/",r+2);r=i<0?e.length:i+1;continue}if(o==='"'||o==="'"||o==="`"){s=o;continue}if(o==="<")n+=1;else if(o===">"&&e[r-1]!=="="){if(n-=1,n===0)return r;if(n<0)return-1}}return-1}c(ju,"matchingTypeParameterEnd");function Pu(e){let t=e.trimEnd();if(!t.endsWith(">"))return t;for(let n=0;n<t.length;n+=1)if(!(t[n]!=="<"||Me(t,n))&&ju(t,n)===t.length-1)return t.slice(0,n).trimEnd();return t}c(Pu,"stripTrailingTypeParameters");function zu(e,t,n){let s=[],r=c((i,a,l)=>{if(!a)return;let u=`${a[0]}:${a[1]}:${i}`;s.some(m=>m.key===u)||s.push({key:u,parameters:i,parameterRange:l,body:a})},"remember");for(let i=e.indexOf("(");i>=0;i=e.indexOf("(",i+1)){if(fe(i,t)||Me(e,i))continue;let a=Et(e,i,"(",")");if(a<=i+1||a>e.length)continue;let l=a-1,u=e.slice(Math.max(0,i-200),i),m=Pu(u),h=/\bfunction(?:\s*\*)?(?:\s+[$A-Z_a-z][$\w]*)?\s*$/s.test(m),g=m.match(/(?:^|[;{}\n])\s*(?:(?:public|private|protected|static|abstract|async|override|get|set)\s+)*(?:\*\s*)?(?<name>[$A-Z_a-z][$\w]*|constructor|\[['"][^'"\n]+['"]\])\s*$/s),y=!!(g&&!new Set(["catch","for","if","switch","while","with"]).has(g.groups.name)),w=e.slice(a,Math.min(e.length,a+500)).match(/^\s*(?::[\s\S]*?)?=>/),f=null;if(w){let E=Ss(e,a+w[0].length);f=e[E]==="{"?n.find(([p])=>p===E)??null:[E,Rs(e,E)]}else if(h||y){let E=Ss(e,a),p=e[E]==="{"?E:e.indexOf("{",E),A=e.slice(E,p<0?e.length:p);p>=0&&!/[;=]/.test(A)&&(f=n.find(([k])=>k===p)??null)}r(e.slice(i+1,l),f,[i+1,l]),i=l}let o=new RegExp(`(?<![$\\w])(?<parameter>${Te})\\s*=>`,"g");for(let i of e.matchAll(o)){if(fe(i.index,t)||Me(e,i.index))continue;let a=Ss(e,i.index+i[0].length),l=e[a]==="{"?n.find(([u])=>u===a)??null:[a,Rs(e,a)];r(i.groups.parameter,l,[i.index,i.index+i.groups.parameter.length])}return s}c(zu,"scanCallableScopes");function ks(e,t,n){let s=null;for(let{body:r}of e)r[0]>=t||r[1]<=t||(!s||r[1]-r[0]<s[1]-s[0])&&(s=r);return s??[0,n]}c(ks,"enclosingFunctionRange");function Bn(e,t){return!!(e&&t&&e[0]===t[0]&&e[1]===t[1])}c(Bn,"sameRange");function Du(e,t,n,s,r){let o=[],i=Ce(t),a=c((g,y)=>{if(fe(g.index,n)||Me(e,g.index))return;let $=s.find(([w])=>w===y);$&&o.push($)},"addBodyRange"),l=new RegExp(`\\b(?<kind>const|let|var|function|class)\\s+${i}(?![$\\w])`,"g");for(let g of e.matchAll(l))fe(g.index,n)||Me(e,g.index)||o.push(g.groups.kind==="var"||g.groups.kind==="function"?ks(r,g.index,e.length):Ar(s,g.index,e.length));let u=/\b(?<kind>const|let|var)\s*\{(?<bindings>[^{}\n]+)\}/g;for(let g of e.matchAll(u))fe(g.index,n)||Me(e,g.index)||Rr(g.groups.bindings).some(({local:y})=>y===t)&&o.push(g.groups.kind==="var"?ks(r,g.index,e.length):Ar(s,g.index,e.length));let m=/\bimport\s+(?<clause>[^'";\n]+?)\s+from\s*['"]/g;for(let g of e.matchAll(m)){if(fe(g.index,n)||Me(e,g.index))continue;let y=g.groups.clause.trim().replace(/^type\s+/,""),$=[],w=y.match(new RegExp(`^(?<local>${Te})(?:\\s*,|$)`));w&&$.push(w.groups.local);let f=y.match(new RegExp(`\\*\\s+as\\s+(?<local>${Te})`));f&&$.push(f.groups.local);let E=y.match(/\{(?<bindings>[\s\S]*?)\}/)?.groups.bindings;E&&$.push(...mn(E).map(({local:p})=>p)),$.includes(t)&&o.push([0,e.length])}for(let g of r)Ja(g.parameters,t)&&o.push(g.parameterRange,g.body);let h=/\bcatch\s*\(/g;for(let g of e.matchAll(h)){if(fe(g.index,n)||Me(e,g.index))continue;let y=g.index+g[0].lastIndexOf("("),$=Et(e,y,"(",")");if($<=y+1||$>e.length)continue;let w=e.slice(y+1,$-1);if(!Ja(w,t))continue;let f=Ss(e,$);e[f]==="{"&&a(g,f)}return o}c(Du,"identifierShadowRanges");function Ts(e,t,n){return(e.get(t)??[]).some(([s,r])=>n>=s&&n<r)}c(Ts,"identifierIsShadowedAt");function Nr(e,t,n){let s=null;for(let r of e.get(t)??[])n<r[0]||n>=r[1]||(!s||r[1]-r[0]<s[1]-s[0])&&(s=r);return s}c(Nr,"innermostShadowRange");function vt(e,t,n,s){return new Set([...e].filter(r=>{let o=r.split(".")[0],i=Nr(n,o,s);return(t.get(r)??[]).some(a=>s>=a.scope[0]&&s<a.scope[1]&&(a.global?!i:Bn(a.scope,i)))}))}c(vt,"visibleReferencesAt");function Ga(e,t,n,s,r){return e==="var"?ks(s,t,r):Ar(n,t,r)}c(Ga,"declarationScope");function It(e,t,n){let s=e.get(t)??[];return s.some(r=>r.kind===n.kind&&r.declarationIndex===n.declarationIndex&&Bn(r.scope,n.scope))?!1:(s.push(n),e.set(t,s),!0)}c(It,"addScopedRecord");function si(e,t,n){let s=Nr(e.shadowRanges,t.split(".")[0],n);return(e.bindingScopes.get(t)??[]).filter(r=>n>=r.scope[0]&&n<r.scope[1]&&(r.global?!s:Bn(r.scope,s))).sort((r,o)=>r.scope[1]-r.scope[0]-(o.scope[1]-o.scope[0])||o.declarationIndex-r.declarationIndex)[0]??null}c(si,"visibleBindingRecord");function Ya(e,t,n,s){let r={bindingScopes:t,shadowRanges:n};return new Map([...e].filter(([o])=>si(r,o,s)))}c(Ya,"visibleBindingsAt");function ri(e,t,n=new Map){let s=new Map(n),r=new Map,o=new Set(["document","window.document","globalThis.document"]),i=new Set(["customElements","window.customElements","globalThis.customElements"]),a=new Map,l=new Map,u=[0,e.length];for(let O of o)It(a,O,{scope:u,declarationIndex:-1,global:!0});for(let O of i)It(l,O,{scope:u,declarationIndex:-1,global:!0});let m=Iu(e),h=zu(e,t,m),g=new RegExp(`\\b(?<declarationKind>const|let|var)\\s+(?<name>${Te})(?:\\s*:[^=;\\n]+)?\\s*=\\s*(?<rhs>[^;\\n]+)`,"g"),y=[...e.matchAll(g)].filter(O=>!fe(O.index,t)&&!Me(e,O.index)),$=/\b(?<declarationKind>const|let|var)\s*\{(?<bindings>[^{}\n]+)\}\s*=\s*(?<source>[$A-Z_a-z][$\w]*(?:\s*\.\s*[$A-Z_a-z][$\w]*)*)/g,w=[...e.matchAll($)].filter(O=>!fe(O.index,t)&&!Me(e,O.index)),f=new RegExp(`\\bfunction\\s+(?<name>${Te})\\s*\\(\\s*(?<parameter>${Te})[^)]*\\)\\s*\\{\\s*return\\s+(?<factory>${Te}(?:\\s*\\.\\s*${Te})*)\\s*\\(\\s*\\k<parameter>\\s*\\)\\s*;?\\s*\\}`,"g"),E=[...e.matchAll(f)].filter(O=>!fe(O.index,t)&&!Me(e,O.index)),p=new Set(["createElement","customElements","document","globalThis","querySelector","querySelectorAll","window",...[...n.keys()].map(O=>O.split(".")[0]),...y.map(O=>O.groups.name),...w.flatMap(O=>Rr(O.groups.bindings).map(({local:q})=>q)),...E.map(O=>O.groups.name)]),A=new Map([...p].map(O=>[O,Du(e,O,t,m,h)]));for(let[O,q]of n)It(r,O,{kind:q,scope:u,declarationIndex:-1,declarationEnd:0,declarationKind:"import"});let k=Math.max(2,y.length+w.length+E.length+1);for(let O=0;O<k;O+=1){let q=!1;for(let b of y){let j=b.groups.name,d=Dn(b.groups.rhs),x=Ga(b.groups.declarationKind,b.index,m,h,e.length),I=vt(o,a,A,b.index),C=vt(i,l,A,b.index);I.has(d)&&(o.add(j),q=It(a,j,{scope:x,declarationIndex:b.index})||q),C.has(d)&&(i.add(j),q=It(l,j,{scope:x,declarationIndex:b.index})||q);let P=Ya(s,r,A,b.index),M=_u(d,P,I,C,!Ts(A,"createElement",b.index));M&&(s.set(j,M),q=It(r,j,{kind:M,scope:x,declarationIndex:b.index,declarationEnd:b.index+b[0].length,declarationKind:b.groups.declarationKind})||q)}for(let b of w){let j=Dn(b.groups.source),d=Ga(b.groups.declarationKind,b.index,m,h,e.length),x=vt(o,a,A,b.index).has(j),I=vt(i,l,A,b.index).has(j);if(!(!x&&!I))for(let C of Rr(b.groups.bindings)){let P=x&&C.property==="createElement"?Pn:I&&(C.property==="get"||C.property==="whenDefined")?zn:null;P&&(s.set(C.local,P),q=It(r,C.local,{kind:P,scope:d,declarationIndex:b.index,declarationEnd:b.index+b[0].length,declarationKind:b.groups.declarationKind})||q)}}for(let b of E){let j=vt(o,a,A,b.index),d=vt(i,l,A,b.index),x=Tr(b.groups.factory,Ya(s,r,A,b.index),j,d,!Ts(A,"createElement",b.index));if(x){let I=ks(h,b.index,e.length);s.set(b.groups.name,x),q=It(r,b.groups.name,{kind:x,scope:I,declarationIndex:b.index,declarationEnd:b.index+b[0].length,declarationKind:"function"})||q}}if(!q)break}let N=new Map;for(let[O,q]of r){let b=q.find(({scope:j})=>Bn(j,u));b&&N.set(O,b.kind)}return{bindings:s,bindingScopes:r,moduleBindings:N,documentReferences:o,documentReferenceScopes:a,registryReferences:i,registryReferenceScopes:l,shadowRanges:A}}c(ri,"scanLocalDomFactoryBindings");function Lu(e,t){let n=Math.max(e.lastIndexOf(";",t-1),e.lastIndexOf("{",t-1),e.lastIndexOf("}",t-1));return e.slice(n+1,t).match(new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+(?<alias>${Te})(?:\\s*:[^=]+)?\\s*=\\s*$`,"s"))?.groups.alias??null}c(Lu,"assignedConstructionAlias");function Fu(e,t,n,s,r){let o=si(r,t,n);if(!o||o.kind!==s||!new Set(["const","function","import"]).has(o.declarationKind)||o.declarationKind==="const"&&n<o.declarationEnd)return!1;let i=Math.max(o.declarationEnd??0,o.scope[0]),a=e.slice(i,n),l=new RegExp(`(?<![$\\w.])${Ce(t)}\\s*=(?!=|>)`,"g"),u=Gt(a);return![...a.matchAll(l)].some(m=>!fe(m.index,u)&&!Me(a,m.index)&&Bn(o.scope,Nr(r.shadowRanges,t.split(".")[0],i+m.index)))}c(Fu,"bindingIsStableBefore");function Bu(e,t,n){let s=new Map(n.bindings);s.set("createElement",Pn);for(let a of n.documentReferences)s.set(`${a}.createElement`,Pn);for(let a of n.registryReferences)s.set(`${a}.get`,zn),s.set(`${a}.whenDefined`,zn);let r=[...s.keys()].sort((a,l)=>l.length-a.length).map(ni).join("|");if(!r)return[];let o=new RegExp(`(?<![$\\w./])(?<api>(?:\\(\\s*(?:${r})\\s*\\)|(?:${r})))(?![$\\w])(?:\\s*\\.\\s*bind\\s*\\([^()]*\\))?\\s*(?:<[^>\\n]+>)?\\s*(?:(?:\\?\\.)?\\s*\\(\\s*|\\.\\s*call\\s*\\(\\s*[^,()]+\\s*,\\s*)(?<quote>['"\\x60])(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)\\k<quote>`,"g"),i=[];for(let a of e.matchAll(o)){let l=a[0].lastIndexOf(a.groups.tag),u=a.index+l;if(fe(a.index,t)||fe(u,t))continue;let m=Me(e,u),h=Me(e,a.index);if(m&&h&&m[0]===h[0]&&m[1]===h[1]&&(e[m[0]]!=="`"||!As(e,m[0],a.index)))continue;let g=Cu(a.groups.api,s);if(n.bindings.has(g)){if(!Fu(e,g,a.index,s.get(g),n))continue}else if(g==="createElement"){if(Ts(n.shadowRanges,g,a.index))continue}else if(g.endsWith(".createElement")){let w=g.slice(0,-14);if(!vt(n.documentReferences,n.documentReferenceScopes,n.shadowRanges,a.index).has(w))continue}else if(g.endsWith(".get")||g.endsWith(".whenDefined")){let w=g.endsWith(".get")?".get":".whenDefined",f=g.slice(0,-w.length);if(!vt(n.registryReferences,n.registryReferenceScopes,n.shadowRanges,a.index).has(f))continue}let y=a.index+a[0].lastIndexOf("(",l),$=Et(e,y,"(",")");i.push({tag:a.groups.tag,start:u,end:u+a.groups.tag.length,callStart:a.index,callEnd:$??a.index+a[0].length,resultAlias:Lu(e,a.index),kind:s.get(g)})}return i}c(Bu,"scanFactoryTagReferences");function oi(e,t,n=null){let s=ri(e,t,n??new Map),r=Bu(e,t,s),o=/(?<![$\w.])(?<api>(?:(?:window|globalThis)\.)?document\.querySelector(?:All)?|querySelector(?:All)?)\s*(?:<[^>\n]+>)?\(\s*(?<quote>['"])(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)\k<quote>/g;for(let a of e.matchAll(o)){if(fe(a.index,t))continue;if(a.groups.api.includes("document.")){let m=a.groups.api.replace(/\.querySelector(?:All)?$/,"");if(!vt(s.documentReferences,s.documentReferenceScopes,s.shadowRanges,a.index).has(m))continue}else if(Ts(s.shadowRanges,a.groups.api,a.index))continue;let l=a[0].lastIndexOf(a.groups.tag),u=a.index+l;r.push({tag:a.groups.tag,start:u,end:u+a.groups.tag.length,callStart:a.index,callEnd:a.index+a[0].length,resultAlias:null,kind:zn})}let i=new Map;for(let a of r)i.set(`${a.start}:${a.end}:${a.kind}`,a);return[...i.values()].sort((a,l)=>a.start-l.start||a.end-l.end)}c(oi,"scanApiTagReferences");function Et(e,t,n,s){let r=0,o=null;for(let i=t;i<e.length;i+=1){let a=e[i];if(o){a==="\\"?i+=1:a===o&&(o=null);continue}if(a==='"'||a==="'"||a==="`")o=a;else if(a===n)r+=1;else if(a===s&&--r===0)return i+1}return e.length}c(Et,"skipBalanced");function Vu(e,t){let n=e.indexOf(`
23
- `,t),s=e.indexOf(";",t),r=s>=0&&(n<0||s<n)?s:n<0?e.length:n,o=e.slice(t,r).trim();return o&&!/^(?:!|as\s+[^;\n]+|satisfies\s+[^;\n]+)$/.test(o)?null:r<e.length?r+1:r}c(Vu,"constructionStatementEnd");function qu(e,t){let n=t;for(;n<e.length;){if(/\s/.test(e[n])||e[n]===";"){n+=1;continue}if(e.startsWith("//",n)){let s=e.indexOf(`
24
- `,n+2);n=s<0?e.length:s+1;continue}if(e.startsWith("/*",n)){let s=e.indexOf("*/",n+2);n=s<0?e.length:s+2;continue}break}return n}c(qu,"skipMigrationTrivia");function Za(e,t){let n=new RegExp(`(?<![$\\w])${Ce(t)}(?![$\\w])`,"y"),s=0;for(;s<e.length;){let r=e[s];if(r==='"'||r==="'"||r==="`"){let o=r;for(s+=1;s<e.length;)if(e[s]==="\\")s+=2;else if(e[s]===o){s+=1;break}else s+=1;continue}if(e.startsWith("//",s)){let o=e.indexOf(`
25
- `,s+2);s=o<0?e.length:o+1;continue}if(e.startsWith("/*",s)){let o=e.indexOf("*/",s+2);s=o<0?e.length:o+2;continue}if(n.lastIndex=s,n.exec(e))return!0;s+=1}return!1}c(Za,"containsIdentifierCode");function Rs(e,t){let n={"(":0,"[":0,"{":0},s={")":"(","]":"[","}":"{"},r=null;for(let o=t;o<e.length;o+=1){let i=e[o];if(r){i==="\\"?o+=1:i===r&&(r=null);continue}if(e.startsWith("//",o)){let a=e.indexOf(`
26
- `,o+2);return a<0?e.length:a+1}if(e.startsWith("/*",o)){let a=e.indexOf("*/",o+2);o=a<0?e.length:a+1;continue}if(i==='"'||i==="'"||i==="`"){r=i;continue}if(Object.hasOwn(n,i))n[i]+=1;else if(Object.hasOwn(s,i)){let a=s[i];n[a]=Math.max(0,n[a]-1)}else if((i===";"||i===`
27
- `)&&n["("]===0&&n["["]===0&&n["{"]===0)return o+1}return e.length}c(Rs,"simpleStatementEnd");function Wu(e,t,n){let s=Ce(n),r=e.slice(t),o=r.match(new RegExp(`^${s}\\s*\\.\\s*setAttribute\\s*\\(\\s*(?<quote>['"])(?<member>[A-Za-z_:][-.A-Za-z0-9_:]*)\\k<quote>\\s*,`));if(o){let h=t+o[0].indexOf("("),g=Et(e,h,"(",")");if(Za(e.slice(h+1,g-1),n))return null;let y=Rs(e,g);return e.slice(g,y).replace(/[;\s]/g,"")?null:{member:o.groups.member,kind:"attribute",next:y}}let i=r.match(new RegExp(`^${s}\\s*\\.\\s*(?<member>${Te})\\s*=(?!=|>)`)),a=i?null:r.match(new RegExp(`^${s}\\s*\\[\\s*(?<quote>['"])(?<member>[^'"]+)\\k<quote>\\s*\\]\\s*=(?!=|>)`)),l=i??a;if(!l)return null;let u=Rs(e,t+l[0].length),m=e.slice(t+l[0].length,u);return Za(m,n)?null:{member:l.groups.member,kind:"property",next:u}}c(Wu,"scanImmediateAliasWrite");function Ku(e,t){let n=new Set([e.member,Qe(e.member),et(e.member)]);if(t.kind==="attribute"){let s=t.member.toLowerCase();return[...n].some(r=>r.toLowerCase()===s)}return n.has(t.member)}c(Ku,"defaultWriteMatches");function ai(e,t,n){if(!t.resultAlias)return{safe:!1,missing:n};let s=Vu(e,t.callEnd);if(s===null)return{safe:!1,missing:n};let r=new Set(n);for(let o=0;o<64&&r.size>0;o+=1){s=qu(e,s);let i=Wu(e,s,t.resultAlias);if(!i)break;for(let a of r)Ku(a,i)&&r.delete(a);s=i.next}return{safe:r.size===0,missing:[...r]}}c(ai,"assessImperativeDefaults");function ot(e,t){let n=[],s=t.nameEnd;for(;s<t.end;){for(;/\s/.test(e[s]??"");)s+=1;if(s>=t.end||e[s]==="/")break;if(e[s]==="{"){s=Et(e,s,"{","}");continue}let r=s;for(;s<t.end&&!/[\s=/>]/.test(e[s]);)s+=1;let o=s;if(o===r){s+=1;continue}for(;/\s/.test(e[s]??"");)s+=1;let i="boolean",a=null,l=null;if(e[s]==="="){for(s+=1;/\s/.test(e[s]??"");)s+=1;if(e[s]==='"'||e[s]==="'"){let u=e[s++];for(i="literal",a=s;s<t.end&&e[s]!==u;)e[s]==="\\"&&(s+=1),s+=1;l=s,e[s]===u&&(s+=1)}else if(e[s]==="{")i="expression",a=s,s=Et(e,s,"{","}"),l=s;else{for(i="literal",a=s;s<t.end&&!/[\s>]/.test(e[s]);)s+=1;l=s}}n.push({rawName:e.slice(r,o),nameStart:r,nameEnd:o,valueKind:i,valueStart:a,valueEnd:l,value:a===null?null:e.slice(a,l)})}return n}c(ot,"parseTagAttributes");function Qe(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replaceAll("_","-").toLowerCase()}c(Qe,"kebabCase");function et(e){return e.replace(/-([a-z0-9])/g,(t,n)=>n.toUpperCase())}c(et,"camelCase");function Xa(e){let t=et(e);return t[0]?.toUpperCase()+t.slice(1)}c(Xa,"pascalCase");function Vn(e,t){return e===e.toLowerCase()?Qe(t):et(t)}c(Vn,"memberStyle");function ii(e,t){let n=[],s=c((r,o,i,a="")=>n.push({section:r,prefix:o,name:i,suffix:a}),"addCandidate");e.startsWith("v-on:")?s("events","v-on:",e.slice(5)):e.startsWith("on:")?s("events","on:",e.slice(3)):e.startsWith("@")?s("events","@",e.slice(1)):/^on[A-Z]/.test(e)?s("events","on",e.slice(2),"jsx-event"):e.startsWith("v-bind:")?s("properties","v-bind:",e.slice(7)):e.startsWith("bind:")?s("properties","bind:",e.slice(5)):e.startsWith(":")?s("properties",":",e.slice(1)):e.startsWith(".")?s("properties",".",e.slice(1)):e.startsWith("?")?s("attributes","?",e.slice(1)):(s("attributes","",e),s("properties","",e));for(let r of n)for(let o of t.rewrites[r.section]){if(!(r.suffix==="jsx-event"?r.name===Xa(o.from):new Set([o.from,Qe(o.from),et(o.from)]).has(r.name)))continue;let a=r.suffix==="jsx-event"?Xa(o.to):Vn(r.name,o.to);return{section:r.section,from:o.from,to:o.to,value:o.value,prefix:r.prefix,replacement:`${r.prefix}${a}`}}return null}c(ii,"namedRule");function qn(e){return e.valueKind==="expression"||/^(?:[.?:]|v-bind:|bind:)/.test(e.rawName)}c(qn,"isDynamicAttribute");var Cr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ci(e){let t=[],n=new Map;for(let s of e){if(!s.closing&&!s.selfClosing){t.push(s);continue}if(s.closing)for(let r=t.length-1;r>=0;r-=1){if(t[r].tag!==s.tag)continue;let[o]=t.splice(r,1);n.set(o.start,s);break}}return n}c(ci,"pairedMarkupTokens");function li(e,t,n,s){let r=[],o=[],i=t,a=!1,l=/<(?<closing>\/)?(?<tag>[a-z][a-z0-9.:-]*)(?=[\s/>])/gi;l.lastIndex=t;let u=c((m,h)=>{o.length===0&&/\$\{|\{\{|<%/.test(e.slice(m,h))&&(a=!0)},"noteGap");for(let m=l.exec(e);m&&m.index<n;m=l.exec(e)){if(fe(m.index,s))continue;u(i,m.index);let h=fn(e,m.index+m[0].length);if(h<0||h>=n)break;let g=m.groups.tag.toLowerCase();if(m.groups.closing){for(let y=o.length-1;y>=0;y-=1)if(o[y]===g){o.splice(y,1);break}}else o.length===0&&r.push(g),!/\/\s*>$/.test(e.slice(m.index,h+1))&&!Cr.has(g)&&o.push(g);i=h+1,l.lastIndex=i}return u(i,n),{directTags:r,dynamicDirectContent:a}}c(li,"scanDirectElementChildren");function ui(e){return e.rawName.replace(/^(?:v-bind:|bind:|[.?:])/,"").toLowerCase()}c(ui,"normalizedAttributeName");function Uu(e){let t=e;for(;;){let n=t.replace(/\s+$/,"").replace(/\/\*[\s\S]*?\*\/$/,"").replace(/\/\/[^\n\r]*$/,"");if(n===t)return t;t=n}}c(Uu,"stripTrailingModuleTrivia");function Os(e,t){let n=Uu(e.slice(0,t));return/\bimport\s*\($/.test(n)?{sideEffect:!1,kind:"dynamic-import"}:/\brequire\s*\($/.test(n)?{sideEffect:!1,kind:"require"}:/\bfrom$/.test(n)?{sideEffect:!1,kind:"binding"}:/\bimport$/.test(n)?{sideEffect:!0,kind:"import"}:null}c(Os,"moduleSpecifierContext");function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c(Ce,"regexEscape");function pi(e,t,n){let s=[...n.packageIdentities.keys()].sort((i,a)=>a.length-i.length).map(Ce).join("|"),r=new RegExp(`(['"])(?<specifier>${s})(?<subpath>\\/[^'"\\s]*)?\\1`,"g"),o=[];for(let i of e.matchAll(r)){if(fe(i.index,t))continue;let a=i.index,l=Os(e,a);if(!l)continue;let u=`${i.groups.specifier}${i.groups.subpath??""}`,m=n.packageIdentities.get(i.groups.specifier);U(m,`unrecognized package identity ${i.groups.specifier}`);let h=a+i[0].length,g=e.indexOf(`
28
- `,h),y=g===-1?e.length:g,$=e.indexOf(";",h),w=$!==-1&&$<y?$+1:y;o.push({...l,ecosystem:m.ecosystem,tiers:m.tiers,packageName:i.groups.specifier,specifier:u,subpath:i.groups.subpath??"",quote:i[1],start:a+1,end:a+1+u.length,statementEnd:w})}return o}c(pi,"scanImports");function mn(e){let t=[],n=e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n\r]*/g,"");for(let s of n.split(",")){let r=s.trim().replace(/^type\s+/,"");if(!r)continue;let o=r.match(new RegExp(`^(?<imported>${Te})(?:\\s+as\\s+(?<local>${Te}))?$`));o&&t.push({imported:o.groups.imported,local:o.groups.local??o.groups.imported})}return t}c(mn,"parseNamedModuleBindings");function Hu(e,t){let n=[],s=[],r=[],o=[],i=c((a,l)=>{for(let u of e.matchAll(a))!fe(u.index,t)&&!Me(e,u.index)&&l(u)},"addMatches");return i(/\bimport\s+(?!type\b)\{(?<bindings>[\s\S]*?)\}\s*from\s*(?<quote>['"])(?<source>[^'"]+)\k<quote>/g,a=>{for(let l of mn(a.groups.bindings))n.push({source:a.groups.source,imported:l.imported,local:l.local})}),i(new RegExp(`\\bimport\\s+(?!type\\b)(?<local>${Te})(?:\\s*,\\s*(?:\\{[\\s\\S]*?\\}|\\*\\s+as\\s+${Te}))?\\s+from\\s*(?<quote>['"])(?<source>[^'"]+)\\k<quote>`,"g"),a=>n.push({source:a.groups.source,imported:"default",local:a.groups.local})),i(new RegExp(`\\bimport\\s+\\*\\s+as\\s+(?<local>${Te})\\s+from\\s*(?<quote>['"])(?<source>[^'"]+)\\k<quote>`,"g"),a=>n.push({source:a.groups.source,imported:"*",local:a.groups.local})),i(/\bexport\s*\{(?<bindings>[\s\S]*?)\}\s*from\s*(?<quote>['"])(?<source>[^'"]+)\k<quote>/g,a=>{for(let l of mn(a.groups.bindings))r.push({source:a.groups.source,imported:l.imported,exported:l.local})}),i(/\bexport\s*\*\s*from\s*(?<quote>['"])(?<source>[^'"]+)\k<quote>/g,a=>o.push(a.groups.source)),i(/\bexport\s*\{(?<bindings>[\s\S]*?)\}(?!\s*from\b)/g,a=>{for(let l of mn(a.groups.bindings))s.push({local:l.imported,exported:l.local})}),i(new RegExp(`\\bexport\\s+(?:const|let|var|function)\\s+(?<name>${Te})`,"g"),a=>s.push({local:a.groups.name,exported:a.groups.name})),i(new RegExp(`\\bexport\\s+default\\s+(?<name>${Te})(?![$\\w])`,"g"),a=>s.push({local:a.groups.name,exported:"default"})),{imports:n,localExports:s,reexports:r,starExports:o}}c(Hu,"scanModuleFactoryLinks");var Sr=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function kr(e,t,n){if(!t.startsWith("."))return null;let s=jn.resolve(jn.dirname(e),t),r=jn.extname(s),o=[s];if(r){let i=s.slice(0,-r.length);for(let a of Sr)o.push(`${i}${a}`)}else for(let i of Sr)o.push(`${s}${i}`);for(let i of Sr)o.push(jn.join(s,`index${i}`));return o.find(i=>n.has(i))??null}c(kr,"resolveScannedModule");function Qa(e,t){return e.size===t.size&&[...e].every(([n,s])=>t.get(n)===s)}c(Qa,"factoryMapEqual");function mi(e){let t=new Map;for(let[o,i]of e){let a=jn.resolve(o),l=Gt(i);t.set(a,{text:i,ignoredRanges:l,links:Hu(i,l)})}let n=new Set(t.keys()),s=new Map([...n].map(o=>[o,new Map])),r=new Map([...n].map(o=>[o,new Map]));for(let o=0;o<Math.max(4,t.size*4);o+=1){let i=!1;for(let[a,l]of t){let u=new Map;for(let g of l.links.imports){let y=kr(a,g.source,n);if(!y)continue;let $=s.get(y);if(g.imported==="*")for(let[w,f]of $)u.set(`${g.local}.${w}`,f);else{let w=$.get(g.imported);w&&u.set(g.local,w)}}let m=ri(l.text,l.ignoredRanges,u);Qa(r.get(a),u)||(r.set(a,u),i=!0);let h=new Map;for(let g of l.links.localExports){let y=m.moduleBindings.get(g.local);y&&h.set(g.exported,y)}for(let g of l.links.reexports){let y=kr(a,g.source,n),$=y?s.get(y).get(g.imported):null;$&&h.set(g.exported,$)}for(let g of l.links.starExports){let y=kr(a,g,n);if(y)for(let[$,w]of s.get(y))$!=="default"&&h.set($,w)}Qa(s.get(a),h)||(s.set(a,h),i=!0)}if(!i)break}return r}c(mi,"buildProjectDomFactoryBindings");function Wn(e,t){let n=[],s=new Set;for(let i of t){let a=`${i.start}:${i.end}:${i.replacement}`;s.has(a)||(s.add(a),n.push(i))}n.sort((i,a)=>i.start-a.start||i.end-a.end);for(let i=1;i<n.length;i+=1)if(n[i].start<n[i-1].end)throw new Error(`Migration rewrite conflict at offsets ${n[i-1].start} and ${n[i].start}`);let r=[],o=e.length;for(let i of[...n].sort((a,l)=>l.start-a.start||l.end-a.end))r.push(e.slice(i.end,o),i.replacement),o=i.start;return r.push(e.slice(0,o)),r.reverse().join("")}c(Wn,"finalizeEdits");function dn(e,t){return`${e}:${t}`}c(dn,"localMigrationKey");function _r(e){return String(e).replace(/^lyra-/,"")}c(_r,"originLabel");function Ns(e){if(e.value===!0)return e.member;let t=String(e.value).replaceAll("&","&amp;").replaceAll('"',"&quot;");return`${e.member}="${t}"`}c(Ns,"serializeLocalDefault");function Cs(e,t,n,s){let r=[],o=new Set,i=new Set(t.keys()),a=/\b(?:(?:[$A-Z_a-z][$\w]*)\s*(?:\?\.|\.)\s*(?:createElement|querySelector(?:All)?)|(?:createElement|querySelector(?:All)?)|customElements\.(?:get|whenDefined))\s*(?:<[^>\n]+>)?\(\s*(['"])(?<tag>lr-[a-z][a-z0-9-]*)\1/g;for(let l of e.matchAll(a)){if(fe(l.index,n)||!i.has(l.groups.tag))continue;let u=l.index+l[0].lastIndexOf(l.groups.tag),m=dn(t.get(l.groups.tag).origin,l.groups.tag);o.add(m),r.push({key:m,tag:l.groups.tag,offset:u,warningCode:"ALIASED_MEMBER_REVIEW",message:`${l.groups.tag} is accessed through a DOM alias; review property assignments before inserting ${_r(t.get(l.groups.tag).origin)} compatibility defaults.`})}for(let l of s){let u=t.get(l.tag);if(!u)continue;let m=e.slice(l.nameEnd,l.end),h=[/\{\s*\.\.\.[^}]+\}/g,/\bv-bind\s*=\s*(?:"[^"]*"|'[^']*'|\{[^}]*\})/g];for(let g of h)for(let y of m.matchAll(g)){let $=l.nameEnd+y.index,w=dn(u.origin,l.tag);o.add(w),r.push({key:w,tag:l.tag,offset:$,warningCode:"DYNAMIC_VALUE_REVIEW",message:`${l.tag} has an opaque attribute spread that may already provide a migrated default; expand or review it before running this profile.`})}}return{uses:r,blocked:o}}c(Cs,"scanLocalMigrationHazards");var Mt=Object.freeze({consumedInputs:["--lr-theme-border-radius-container","--lr-theme-border-radius-m","--lr-theme-border-radius-pill","--lr-theme-border-radius-xs","--lr-theme-border-width-medium","--lr-theme-border-width-thick","--lr-theme-border-width-thin","--lr-theme-color-border-strong","--lr-theme-color-brand-border-loud","--lr-theme-color-brand-border-normal","--lr-theme-color-brand-border-quiet","--lr-theme-color-brand-fill-loud","--lr-theme-color-brand-fill-normal","--lr-theme-color-brand-fill-quiet","--lr-theme-color-brand-on-loud","--lr-theme-color-brand-on-normal","--lr-theme-color-brand-on-quiet","--lr-theme-color-danger-border-loud","--lr-theme-color-danger-border-normal","--lr-theme-color-danger-border-quiet","--lr-theme-color-danger-fill-loud","--lr-theme-color-danger-fill-normal","--lr-theme-color-danger-fill-quiet","--lr-theme-color-danger-on-loud","--lr-theme-color-danger-on-normal","--lr-theme-color-danger-on-quiet","--lr-theme-color-focus","--lr-theme-color-mix-active","--lr-theme-color-mix-hover","--lr-theme-color-mix-partner","--lr-theme-color-neutral-border-loud","--lr-theme-color-neutral-border-normal","--lr-theme-color-neutral-border-quiet","--lr-theme-color-neutral-fill-loud","--lr-theme-color-neutral-fill-normal","--lr-theme-color-neutral-fill-quiet","--lr-theme-color-neutral-on-loud","--lr-theme-color-neutral-on-normal","--lr-theme-color-neutral-on-quiet","--lr-theme-color-no-data","--lr-theme-color-on-strong-overlay","--lr-theme-color-overlay","--lr-theme-color-overlay-strong","--lr-theme-color-shadow","--lr-theme-color-success-border-loud","--lr-theme-color-success-border-normal","--lr-theme-color-success-border-quiet","--lr-theme-color-success-fill-loud","--lr-theme-color-success-fill-normal","--lr-theme-color-success-fill-quiet","--lr-theme-color-success-on-loud","--lr-theme-color-success-on-normal","--lr-theme-color-success-on-quiet","--lr-theme-color-surface-border","--lr-theme-color-surface-border-subtle","--lr-theme-color-surface-container","--lr-theme-color-surface-container-high","--lr-theme-color-surface-container-highest","--lr-theme-color-surface-container-low","--lr-theme-color-surface-container-lowest","--lr-theme-color-surface-default","--lr-theme-color-surface-overlay","--lr-theme-color-surface-raised","--lr-theme-color-text-normal","--lr-theme-color-text-quiet","--lr-theme-color-warning-border-loud","--lr-theme-color-warning-border-normal","--lr-theme-color-warning-border-quiet","--lr-theme-color-warning-fill-loud","--lr-theme-color-warning-fill-normal","--lr-theme-color-warning-fill-quiet","--lr-theme-color-warning-on-loud","--lr-theme-color-warning-on-normal","--lr-theme-color-warning-on-quiet","--lr-theme-duration-fast","--lr-theme-duration-icon","--lr-theme-duration-normal","--lr-theme-duration-slow","--lr-theme-easing-emphasized","--lr-theme-easing-linear","--lr-theme-easing-standard","--lr-theme-focus-ring-offset","--lr-theme-focus-ring-width","--lr-theme-font-family-body","--lr-theme-font-family-heading","--lr-theme-font-family-mono","--lr-theme-font-size-2xl","--lr-theme-font-size-2xs","--lr-theme-font-size-3xl","--lr-theme-font-size-3xs","--lr-theme-font-size-lg","--lr-theme-font-size-m","--lr-theme-font-size-md-sm","--lr-theme-font-size-sm","--lr-theme-font-size-xl","--lr-theme-font-size-xs","--lr-theme-font-weight-bold","--lr-theme-font-weight-medium","--lr-theme-font-weight-normal","--lr-theme-font-weight-semibold","--lr-theme-hover-brightness","--lr-theme-line-break","--lr-theme-line-height-1-4","--lr-theme-line-height-compact","--lr-theme-line-height-loose","--lr-theme-line-height-none","--lr-theme-line-height-normal","--lr-theme-line-height-snug","--lr-theme-opacity-disabled","--lr-theme-opacity-muted","--lr-theme-otp-input-segment-size","--lr-theme-popover-viewport-clamp","--lr-theme-scroll-fade-size","--lr-theme-shadow-color","--lr-theme-shadow-l","--lr-theme-shadow-m","--lr-theme-shadow-s","--lr-theme-shadow-xl","--lr-theme-shadow-xs","--lr-theme-size-0-02em","--lr-theme-size-0-03em","--lr-theme-size-0-04em","--lr-theme-size-0-05rem","--lr-theme-size-0-0625rem","--lr-theme-size-0-09375rem","--lr-theme-size-0-125rem","--lr-theme-size-0-15rem","--lr-theme-size-0-1875rem","--lr-theme-size-0-1rem","--lr-theme-size-0-25rem","--lr-theme-size-0-3125rem","--lr-theme-size-0-35em","--lr-theme-size-0-375rem","--lr-theme-size-0-3em","--lr-theme-size-0-4375rem","--lr-theme-size-0-4em","--lr-theme-size-0-4rem","--lr-theme-size-0-5em","--lr-theme-size-0-5rem","--lr-theme-size-0-625rem","--lr-theme-size-0-6875rem","--lr-theme-size-0-6rem","--lr-theme-size-0-75em","--lr-theme-size-0-75rem","--lr-theme-size-0-7em","--lr-theme-size-0-875em","--lr-theme-size-0-8rem","--lr-theme-size-0-9375rem","--lr-theme-size-1-0625rem","--lr-theme-size-1-1rem","--lr-theme-size-1-25rem","--lr-theme-size-1-5em","--lr-theme-size-1-5rem","--lr-theme-size-1-75rem","--lr-theme-size-10px","--lr-theme-size-10rem","--lr-theme-size-12em","--lr-theme-size-12rem","--lr-theme-size-14px","--lr-theme-size-14rem","--lr-theme-size-15rem","--lr-theme-size-16px","--lr-theme-size-16rem","--lr-theme-size-18rem","--lr-theme-size-1em","--lr-theme-size-1px","--lr-theme-size-1rem","--lr-theme-size-2-25rem","--lr-theme-size-2-5ch","--lr-theme-size-2-5rem","--lr-theme-size-20rem","--lr-theme-size-22rem","--lr-theme-size-24px","--lr-theme-size-24rem","--lr-theme-size-280px","--lr-theme-size-28px","--lr-theme-size-28rem","--lr-theme-size-2px","--lr-theme-size-2rem","--lr-theme-size-3-5em","--lr-theme-size-3-5rem","--lr-theme-size-30rem","--lr-theme-size-32rem","--lr-theme-size-36rem","--lr-theme-size-38rem","--lr-theme-size-3ch","--lr-theme-size-3px","--lr-theme-size-3rem","--lr-theme-size-48rem","--lr-theme-size-4ch","--lr-theme-size-4px","--lr-theme-size-4rem","--lr-theme-size-5em","--lr-theme-size-5rem","--lr-theme-size-6ch","--lr-theme-size-6em","--lr-theme-size-6px","--lr-theme-size-6rem","--lr-theme-size-7rem","--lr-theme-size-8em","--lr-theme-size-8rem","--lr-theme-size-neg-0-15rem","--lr-theme-size-neg-0-25rem","--lr-theme-size-neg-1px","--lr-theme-size-neg-4px","--lr-theme-size-neg-6px","--lr-theme-size-neg-8px","--lr-theme-space-2xl","--lr-theme-space-2xs","--lr-theme-space-l","--lr-theme-space-m","--lr-theme-space-s","--lr-theme-space-xs","--lr-theme-table-row-height","--lr-theme-transition-fast","--lr-theme-transition-normal","--lr-theme-transition-slow","--lr-theme-word-break","--lr-theme-z-index-base","--lr-theme-z-index-content","--lr-theme-z-index-dropdown","--lr-theme-z-index-modal","--lr-theme-z-index-popover","--lr-theme-z-index-toast"],outputs:["--lr-border-width-medium","--lr-border-width-thick","--lr-border-width-thin","--lr-color-border","--lr-color-border-strong","--lr-color-border-subtle","--lr-color-brand","--lr-color-brand-border-loud","--lr-color-brand-border-normal","--lr-color-brand-border-quiet","--lr-color-brand-fill-loud","--lr-color-brand-fill-normal","--lr-color-brand-fill-quiet","--lr-color-brand-on-loud","--lr-color-brand-on-normal","--lr-color-brand-on-quiet","--lr-color-brand-quiet","--lr-color-danger","--lr-color-danger-border-loud","--lr-color-danger-border-normal","--lr-color-danger-border-quiet","--lr-color-danger-fill-loud","--lr-color-danger-fill-normal","--lr-color-danger-fill-quiet","--lr-color-danger-on-loud","--lr-color-danger-on-normal","--lr-color-danger-on-quiet","--lr-color-danger-quiet","--lr-color-mix-active","--lr-color-mix-hover","--lr-color-mix-partner","--lr-color-neutral","--lr-color-neutral-border-loud","--lr-color-neutral-border-normal","--lr-color-neutral-border-quiet","--lr-color-neutral-fill-loud","--lr-color-neutral-fill-normal","--lr-color-neutral-fill-quiet","--lr-color-neutral-on-loud","--lr-color-neutral-on-normal","--lr-color-neutral-on-quiet","--lr-color-no-data","--lr-color-on-brand","--lr-color-on-danger","--lr-color-on-neutral","--lr-color-on-strong-overlay","--lr-color-on-success","--lr-color-on-warning","--lr-color-overlay","--lr-color-overlay-strong","--lr-color-shadow","--lr-color-success","--lr-color-success-border-loud","--lr-color-success-border-normal","--lr-color-success-border-quiet","--lr-color-success-fill-loud","--lr-color-success-fill-normal","--lr-color-success-fill-quiet","--lr-color-success-on-loud","--lr-color-success-on-normal","--lr-color-success-on-quiet","--lr-color-success-quiet","--lr-color-surface","--lr-color-surface-container","--lr-color-surface-container-high","--lr-color-surface-container-highest","--lr-color-surface-container-low","--lr-color-surface-container-lowest","--lr-color-surface-overlay","--lr-color-surface-raised","--lr-color-text","--lr-color-text-quiet","--lr-color-warning","--lr-color-warning-border-loud","--lr-color-warning-border-normal","--lr-color-warning-border-quiet","--lr-color-warning-fill-loud","--lr-color-warning-fill-normal","--lr-color-warning-fill-quiet","--lr-color-warning-on-loud","--lr-color-warning-on-normal","--lr-color-warning-on-quiet","--lr-color-warning-quiet","--lr-duration-ambient","--lr-duration-base","--lr-duration-fast","--lr-duration-icon","--lr-easing-emphasized","--lr-easing-linear","--lr-easing-standard","--lr-focus-ring","--lr-focus-ring-color","--lr-focus-ring-offset","--lr-focus-ring-width","--lr-font","--lr-font-heading","--lr-font-mono","--lr-font-size-2xl","--lr-font-size-2xs","--lr-font-size-3xl","--lr-font-size-3xs","--lr-font-size-4xl","--lr-font-size-5xl","--lr-font-size-lg","--lr-font-size-m","--lr-font-size-md-sm","--lr-font-size-sm","--lr-font-size-xl","--lr-font-size-xs","--lr-font-weight-bold","--lr-font-weight-medium","--lr-font-weight-normal","--lr-font-weight-semibold","--lr-hover-brightness","--lr-layer-base","--lr-layer-content","--lr-layer-dropdown","--lr-layer-modal","--lr-layer-popover","--lr-layer-toast","--lr-line-break","--lr-line-height-1-4","--lr-line-height-compact","--lr-line-height-loose","--lr-line-height-none","--lr-line-height-normal","--lr-line-height-snug","--lr-mask-opaque","--lr-opacity-disabled","--lr-opacity-muted","--lr-otp-input-segment-size","--lr-popover-viewport-clamp","--lr-radius","--lr-radius-container","--lr-radius-pill","--lr-radius-xs","--lr-safe-area-bottom","--lr-safe-area-top","--lr-scroll-fade-size","--lr-shadow","--lr-shadow-color","--lr-shadow-l","--lr-shadow-m","--lr-shadow-s","--lr-shadow-xl","--lr-shadow-xs","--lr-size-0-02em","--lr-size-0-03em","--lr-size-0-04em","--lr-size-0-05rem","--lr-size-0-0625rem","--lr-size-0-09375rem","--lr-size-0-125rem","--lr-size-0-15rem","--lr-size-0-1875rem","--lr-size-0-1rem","--lr-size-0-25rem","--lr-size-0-3125rem","--lr-size-0-35em","--lr-size-0-375rem","--lr-size-0-3em","--lr-size-0-4375rem","--lr-size-0-4em","--lr-size-0-4rem","--lr-size-0-5em","--lr-size-0-5rem","--lr-size-0-625rem","--lr-size-0-6875rem","--lr-size-0-6rem","--lr-size-0-75em","--lr-size-0-75rem","--lr-size-0-7em","--lr-size-0-875em","--lr-size-0-8rem","--lr-size-0-9375rem","--lr-size-1-0625rem","--lr-size-1-1rem","--lr-size-1-25rem","--lr-size-1-5em","--lr-size-1-5rem","--lr-size-1-75rem","--lr-size-10px","--lr-size-10rem","--lr-size-12em","--lr-size-12rem","--lr-size-14px","--lr-size-14rem","--lr-size-15rem","--lr-size-16px","--lr-size-16rem","--lr-size-18rem","--lr-size-1em","--lr-size-1px","--lr-size-1rem","--lr-size-2-25rem","--lr-size-2-5ch","--lr-size-2-5rem","--lr-size-20rem","--lr-size-22rem","--lr-size-24px","--lr-size-24rem","--lr-size-280px","--lr-size-28px","--lr-size-28rem","--lr-size-2px","--lr-size-2rem","--lr-size-3-5em","--lr-size-3-5rem","--lr-size-30rem","--lr-size-32rem","--lr-size-36rem","--lr-size-38rem","--lr-size-3ch","--lr-size-3px","--lr-size-3rem","--lr-size-48rem","--lr-size-4ch","--lr-size-4px","--lr-size-4rem","--lr-size-5em","--lr-size-5rem","--lr-size-6ch","--lr-size-6em","--lr-size-6px","--lr-size-6rem","--lr-size-7rem","--lr-size-8em","--lr-size-8rem","--lr-size-neg-0-15rem","--lr-size-neg-0-25rem","--lr-size-neg-1px","--lr-size-neg-4px","--lr-size-neg-6px","--lr-size-neg-8px","--lr-space-2xl","--lr-space-2xs","--lr-space-3xl","--lr-space-4xl","--lr-space-l","--lr-space-m","--lr-space-s","--lr-space-xl","--lr-space-xs","--lr-table-row-min-height","--lr-transition-ambient","--lr-transition-base","--lr-transition-fast","--lr-transition-interactive","--lr-word-break"],feedingOutputs:["--lr-color-border","--lr-color-brand","--lr-color-brand-fill-loud","--lr-color-brand-fill-quiet","--lr-color-brand-on-loud","--lr-color-danger","--lr-color-danger-fill-loud","--lr-color-danger-fill-quiet","--lr-color-danger-on-loud","--lr-color-neutral-fill-loud","--lr-color-neutral-on-loud","--lr-color-success-fill-loud","--lr-color-success-fill-quiet","--lr-color-success-on-loud","--lr-color-surface","--lr-color-surface-overlay","--lr-color-surface-raised","--lr-color-text","--lr-color-warning-fill-loud","--lr-color-warning-fill-quiet","--lr-color-warning-on-loud","--lr-focus-ring-color","--lr-focus-ring-width","--lr-radius","--lr-shadow-m","--lr-transition-fast"],scopeAttributes:["data-lr-theme","data-lr-theme-scope","data-lr-mode","data-lr-look","data-lr-accent","data-lr-density","data-lr-contrast","data-lr-motion","data-lr-design-token-mode"],scopeClasses:["lr-light","lr-dark","lr-token-light","lr-token-dark"]});function Ju(e){let t="",n=0,s="";for(;n<e.length;){let r=e[n];if(s){if(t+=r,r==="\\"){t+=e[n+1]??"",n+=2;continue}r===s&&(s=""),n+=1;continue}if(r==='"'||r==="'"){s=r,t+=r,n+=1;continue}if(r==="/"&&e[n+1]==="*"){let o=e.indexOf("*/",n+2),i=o<0?e.length:o+2;t+=" ".repeat(i-n),n=i;continue}t+=r,n+=1}return t}c(Ju,"stripComments");function di(e,t){let n=[],s=0,r="",o=0;for(let i=0;i<e.length;i++){let a=e[i];if(r){a==="\\"?i+=1:a===r&&(r="");continue}a==='"'||a==="'"?r=a:a==="("||a==="["?s+=1:a===")"||a==="]"?s-=1:a===t&&s===0&&(n.push(e.slice(o,i)),o=i+1)}return n.push(e.slice(o)),n}c(di,"splitTopLevel");function fi(e){let t=Ju(e),n=[],s=[],r="",o="",i=0,a=c(()=>{let l=r.trim();if(r="",!l)return;let u=l.indexOf(":");if(u<=0)return;let m=l.slice(0,u).trim(),h=l.slice(u+1).trim(),g=/!\s*important\s*$/i.test(h);g&&(h=h.replace(/!\s*important\s*$/i,"").trim());let y=s.filter($=>$.kind==="rule");n.push({property:m,value:h,important:g,selector:y.length?y[y.length-1].prelude:"",atRules:s.filter($=>$.kind==="at").map($=>$.prelude)})},"flushDeclaration");for(let l=0;l<t.length;l++){let u=t[l];if(o){r+=u,u==="\\"?(r+=t[l+1]??"",l+=1):u===o&&(o="");continue}if(u==='"'||u==="'")o=u,r+=u;else if(u==="(")i+=1,r+=u;else if(u===")")i-=1,r+=u;else if(u==="{"&&i===0){let m=r.trim().replace(/\s+/g," ");r="",s.push({kind:m.startsWith("@")?"at":"rule",prelude:m})}else u==="}"&&i===0?(a(),s.pop()):u===";"&&i===0?s.length&&s[s.length-1].kind==="rule"?a():r="":r+=u}return n}c(fi,"readDeclarations");var Un="theme-scopes",Be="data-lr-theme-scope",_s=new Set(Mt.consumedInputs),Gu=new Set(Mt.outputs),Mr=new Set(Mt.feedingOutputs),Yu=new RegExp(`(?:^|[\\s/])[?.:@]?(?:${Mt.scopeAttributes.join("|")})(?=[\\s=/>]|$)`),Zu=new RegExp(`(?:^|[\\s"'\`{])(?:${Mt.scopeClasses.join("|")})(?=[\\s"'\`}]|$)`),Xu=new Set(["html","htm","js","mjs","cjs","ts","mts","cts","jsx","tsx","vue","svelte","astro"]),Qu=new Set(["css","scss","less","pcss","postcss"]),ep=new Set(["jsx","tsx"]),tp=c(e=>/\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase()??"","extensionOf");function Kn(e,t){let n=1,s=0;for(let r=e.indexOf(`
29
- `);r!==-1&&r<t;r=e.indexOf(`
30
- `,r+1))n+=1,s=r+1;return{line:n,column:t-s+1}}c(Kn,"lineColumn");function*np(e){let t=0;for(;(t=e.indexOf("<",t))!==-1;){let n=/^<([a-zA-Z][\w:-]*)/.exec(e.slice(t,t+80));if(!n){t+=1;continue}let s=t+n[0].length,r="",o=0;for(;s<e.length;s++){let i=e[s];if(r){i==="\\"?s+=1:i===r&&(r="");continue}if(o){i==="{"?o+=1:i==="}"?o-=1:(i==='"'||i==="'"||i==="`")&&(r=i);continue}if(i==='"'||i==="'")r=i;else if(i==="{")o=1;else if(i===">"||i==="<")break}if(e[s]!==">"){t+=1;continue}yield{start:t,tag:n[1],attributesStart:t+n[0].length,attributes:e.slice(t+n[0].length,s)},t=s+1}}c(np,"startTags");function sp(e){let t=/(?:^|\s)[.:]?style\s*=\s*/.exec(e);if(!t)return null;let n=e.slice(t.index+t[0].length),s=n[0];if(s==='"'||s==="'")return n.slice(1,n.indexOf(s,1)===-1?void 0:n.indexOf(s,1));let r=s==="$"&&n[1]==="{"?2:s==="{"?1:-1;if(r<0)return n.split(/\s/)[0];let o=1;for(let i=r;i<n.length;i++)if(n[i]==="{")o+=1;else if(n[i]==="}"&&--o===0)return n.slice(r,i);return n.slice(r)}c(sp,"styleValue");var hi=c(e=>[...e.matchAll(/(--lr-(?:theme-)?[a-z0-9-]+)\s*['"`]?\s*:/g)].map(t=>t[1]),"declaredIn"),rp=c(e=>[...new Set(hi(e).filter(t=>_s.has(t)))],"consumedIn"),op=c(e=>[...new Set(hi(e).filter(t=>Mr.has(t)))],"feedingIn");function ap(e,t){let n=e.slice(Math.max(0,t-600),t);return/\.map\(\s*(?:\([^)]*\)|[\w$]+)\s*=>|\brepeat\(|\bv-for=|\*ngFor=|\{#each\b|\.forEach\(/.test(n)}c(ap,"insideRepeat");function ip(e){return pp(e)}c(ip,"selectorIsScope");function cp(e){let t="";for(let n=0;n<e.length;n++){if(e.startsWith(":not(",n)){let s=0;for(n+=4;n<e.length;n++)if(e[n]==="(")s+=1;else if(e[n]===")"&&--s===0)break;continue}t+=e[n]}return t}c(cp,"withoutNegations");function lp(e){let t=0,n=0;for(let s=0;s<e.length;s++){let r=e[s];r==="("||r==="["?t+=1:r===")"||r==="]"?t-=1:t===0&&/[\s>+~]/.test(r)&&(n=s+1)}return e.slice(n)}c(lp,"subjectCompound");var up=[":root","html",...Mt.scopeClasses.map(e=>`.${e}`),...Mt.scopeAttributes.map(e=>`[${e}`)];function pp(e){let t=cp(e.trim()),n=lp(t);return up.some(s=>n.includes(s))?!0:/\.(?:light|dark)\b/.test(n)&&t.includes("[data-lr-look")}c(pp,"isThemeScopeSelector");function Ir(e,t,n,s,r){for(let o of mp(e)){if(!o.selector)continue;let i=di(o.selector,",").map(l=>l.trim()).filter(l=>!ip(l));if(!i.length)continue;let a=Kn(n,t+o.offset);_s.has(o.property)?r(a,{code:"THEME_SCOPE_CSS_INPUT_REVIEW",member:o.property,target:Be,message:`${i.join(", ")} sets ${o.property}, which the Lyra token layer consumes, but is not a theme scope: mark the matched elements with ${Be} (a :host or ::slotted() rule means the host or slotted element).`}):Gu.has(o.property)&&r(a,{code:"THEME_SCOPE_OUTPUT_REVIEW",member:o.property,target:Be,message:Mr.has(o.property)?`${i.join(", ")} sets the shared output ${o.property}: it now reaches deeper (until the next theme scope), and the outputs derived from it no longer follow it. Set its --lr-theme-* input on a theme scope, or mark the element with ${Be}.`:`${i.join(", ")} sets the shared output ${o.property}: it now reaches deeper, until the next theme scope, instead of stopping at the first Lyra component.`})}}c(Ir,"cssReports");function mp(e){let t=fi(e),n=0;return t.map(s=>{let r=e.indexOf(s.property,n),o=r===-1?n:r;return n=r===-1?n:r+s.property.length,{...s,offset:o}})}c(mp,"readDeclarationsWithOffsets");function jr(e,{file:t="input"}={}){let n=tp(t),s=[],r=ep.has(n)?` ${Be}=""`:` ${Be}`,o=c((u,{code:m,tag:h=null,member:g=null,target:y=null,message:$})=>s.push({file:t,...u,rule:Un,upstreamTag:h,upstreamMember:g,action:"manual-review",target:y,warningCode:m,message:$}),"warn"),i=/@aceshooting\/lyra-ui\/(?:dist\/)?theme\.css/.exec(e),a=/@aceshooting\/lyra-ui\/(?:dist\/)?(?:styles\/)?tokens-root\.css/.exec(e);if(i&&a&&o(Kn(e,a.index),{code:"THEME_SCOPE_DOUBLE_LAYER_REVIEW",member:"tokens-root.css",message:"theme.css already carries the Lyra document token layer: remove the tokens-root.css import (it is the same layer alone, for pages without theme.css)."}),Qu.has(n))return Ir(e,0,e,t,o),{insertions:[],warnings:s,marker:r};if(!Xu.has(n)&&n!=="")return{insertions:[],warnings:s,marker:r};let l=[];for(let u of np(e)){let m=sp(u.attributes);if(m===null)continue;let h=rp(m),g=op(m);if(!h.length&&!g.length){/\.\.\.\s*[\w$.]+/.test(m)&&/style/.test(u.attributes)&&o(Kn(e,u.start),{code:"THEME_SCOPE_DYNAMIC_INPUT_REVIEW",target:Be,message:`<${u.tag}> spreads a style object; if it can carry a --lr-theme-* input the Lyra token layer consumes, mark the element with ${Be}.`});continue}if(/\sdata-lr-not-a-scope(?=[\s=>]|$)/.test(u.attributes)||u.tag.toLowerCase()==="html"||Yu.test(u.attributes)||Zu.test(dp(u.attributes)))continue;let y=Kn(e,u.start),$=[...h,...g];l.push({offset:u.attributesStart,change:{file:t,...y,rule:Un,upstreamTag:u.tag,upstreamMember:$.join(" "),action:"insert-theme-scope",target:Be,message:h.length?`Mark <${u.tag}> with ${Be}: its inline ${h.join(", ")} must re-derive the Lyra token layer for the components below it.`:`Mark <${u.tag}> with ${Be}: other shared outputs derive from its inline ${g.join(", ")}, and only a theme scope re-derives them.`}}),ap(e,u.start)&&o(y,{code:"THEME_SCOPE_REPEATED_REVIEW",tag:u.tag,target:Be,message:`<${u.tag}> is rendered in a loop: each instance is now a theme scope that re-derives the whole token layer. Prefer setting ${$.join(", ")} once on a common ancestor scope.`})}for(let u of e.matchAll(/\.setProperty\(\s*(['"`])(--lr-[a-z0-9-]+)\1/g))!_s.has(u[2])&&!Mr.has(u[2])||o(Kn(e,u.index),{code:"THEME_SCOPE_DYNAMIC_INPUT_REVIEW",member:u[2],target:Be,message:_s.has(u[2])?`setProperty('${u[2]}') sets an input the Lyra token layer consumes: make sure the element is a theme scope (${Be}).`:`setProperty('${u[2]}') sets a shared output that other outputs derive from: they follow it only on a theme scope (${Be}).`});for(let u of e.matchAll(/\bcss`([^`]*)`/g))Ir(u[1],u.index+4,e,t,o);if(n==="html"||n==="htm"||n==="vue"||n==="svelte"||n==="astro")for(let u of e.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))Ir(u[1],u.index+u[0].indexOf(">")+1,e,t,o);return{insertions:l,warnings:s,marker:r}}c(jr,"analyzeThemeScopes");function Pr(e,{file:t="input"}={}){let{insertions:n,warnings:s,marker:r}=jr(e,{file:t}),o=e;for(let{offset:i}of[...n].sort((a,l)=>l.offset-a.offset))o=`${o.slice(0,i)}${r}${o.slice(i)}`;return{content:o,changes:n.map(({change:i})=>i),warnings:s}}c(Pr,"migrateThemeScopes");function dp(e){let t=/(?:^|\s)[.:]?(?:class|className)\s*=\s*/.exec(e);return t?e.slice(t.index+t[0].length,t.index+t[0].length+400):""}c(dp,"classValue");var Yt="RENAME_REVIEW",gi="RENAME_TARGET_SHARED_REVIEW",zr="NAME_GAINED_OWNER_REVIEW",jt="POLARITY_REVIEW",fp="DETAIL_SHAPE_REVIEW",yi="DETAIL_FIELD_REVIEW",hp="DEPRECATED_MEMBER_REVIEW",gp="DEPRECATED_CONTENT_REVIEW",Dr="RENAME_CONFLICT_REVIEW",bi="UNUSED_ACKNOWLEDGEMENT",yp=/lyra-migrate-reviewed:\s*([^\n]*)/g,bp=/^([A-Z][A-Z0-9_]*):(\S+)$/,$p="#default",Fr=/(?:\b(?:add|remove)EventListener|\bHostListener)\s*\(\s*$/,wp=/([A-Za-z_$][\w$]*(?:\s*(?:\?\.|\.)\s*#?[A-Za-z_$][\w$]*|\s*\([^()\n]*\)|\s*!(?!=))*)\s*(?:\?\.|\.)\s*(?:add|remove)EventListener\s*\(\s*$/,vp=/^\s*,\s*([A-Za-z_$][\w$]*(?:\s*(?:\?\.|\.)\s*#?[A-Za-z_$][\w$]*)*)\s*[,)]/,Ep=/\bnew\s+(?:CustomEvent|Event)\s*(?:<[^>\n]+>)?\(\s*(['"`])(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1/g,xp=/(?:\b(?:createElement|querySelector(?:All)?|closest|matches|unsafeStatic|literal)|\bcustomElements\s*\.\s*(?:get|whenDefined|define))\s*(?:<[^>\n]+>)?\(\s*$/,Sp=/\b(?:querySelector|closest|createElement)\s*(?:<[^>\n]+>)?\(\s*(['"`])(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1\s*\)\s*!?\s*(?:\?\.|\.)\s*([A-Za-z_$][\w$]*)/g,kp=new Set(["setAttribute","getAttribute","hasAttribute","removeAttribute","toggleAttribute"]),$i=new Set(["addEventListener","removeEventListener"]),Ei=/\.(?:css|scss|sass|less|pcss|styl)$/i,Tp=/\.(?:html?|xhtml|md|markdown|vue|svelte)$/i,Rp=/\.(?:html?|xhtml|md|markdown)$/i,Ap=/\.(?:[cm]?[jt]s)$/i,Op=256,xi=c(e=>e===""?$p:String(e),"ackName");function Pt(e){let t=[];for(let[n,s]of[...e].sort((r,o)=>r[0]-o[0])){let r=t.at(-1);r&&n<=r[1]?r[1]=Math.max(r[1],s):t.push([n,s])}return t}c(Pt,"mergeRanges");function at(e){return t=>{let n=0,s=e.length-1;for(;n<=s;){let r=n+s>>1;if(e[r][1]<=t)n=r+1;else if(e[r][0]>t)s=r-1;else return!0}return!1}}c(at,"rangeTester");function Kr(e,t){let n=t+1;for(;n<e.length;){let s=e[n];if(s==="\\")n+=2;else{if(s==="`")return n+1;s==="$"&&e[n+1]==="{"?n=Np(e,n+2):n+=1}}return e.length}c(Kr,"templateLiteralEnd");function Np(e,t){let n=1;for(;t<e.length;){let s=e[t];if(s==="`"){t=Kr(e,t);continue}if(s==='"'||s==="'"){for(t+=1;t<e.length&&e[t]!==s&&e[t]!==`
31
- `;)t+=e[t]==="\\"?2:1;t+=1;continue}if(s==="{")n+=1;else if(s==="}"&&--n===0)return t+1;t+=1}return e.length}c(Np,"templateExpressionEnd");function Ur(e,t){let n=[],s=0;for(;s<e.length;){let r=e[s];if(t(s))s+=1;else if(r==="`"){let o=Kr(e,s);n.push([s,o]),s=o}else if(r==='"'||r==="'"){for(s+=1;s<e.length&&e[s]!==r&&e[s]!==`
32
- `;)s+=e[s]==="\\"?2:1;s+=1}else s+=1}return n}c(Ur,"templateLiteralRanges");function Si(e,t,n){let s=[];for(let r of e.matchAll(new RegExp(`\\b(?:${t.join("|")})\\s*\``,"g"))){if(n(r.index))continue;let o=r.index+r[0].length-1;s.push([o,Kr(e,o)])}return Pt(s)}c(Si,"taggedTemplateRanges");function Cp(e,t){let n=Pt(Gt(e)),s=at(n),r=[],o=c((i,a)=>{let l=e.indexOf("<!--",i);for(;l>=0&&l<a;){let u=xs(e,l,a);s(l)||r.push([l,u]),l=e.indexOf("<!--",u)}},"addHtmlComments");if(Tp.test(t))o(0,e.length);else if(!Ei.test(t))for(let[i,a]of Ur(e,s))o(i,a);return Pt([...n,...r])}c(Cp,"renameIgnoredRanges");function _p(e,t,n,s){let r=new Map(s.map(l=>[l.start,l])),o=[],i=new Map,a=c((l,u)=>{let m=i.get(l)??[];m.includes(u)||m.push(u),i.set(l,m)},"cover");for(let[l,u]of t){let m=e.slice(l,u);if(!m.includes("lyra-migrate-reviewed:"))continue;let h=Jt(n,l).line,g=Jt(n,Math.max(l,u-1)).line,y=u;for(;y<e.length&&/[\s}]/.test(e[y]);)y+=1;let $=r.get(y),w=/^\s*\{?\s*$/.test(e.slice(n[h-1],l));for(let f of m.matchAll(yp)){let E=f[1].replace(/(?:\*\/|--!?>)[\s\S]*$/,"").split(/[\s,]+/).filter(Boolean),p={offset:l+f.index,entries:E.map(A=>{let k=bp.exec(A);return{token:A,code:k?.[1]??null,name:k?.[2]??null,used:!1}})};o.push(p);for(let A=h;A<=g;A+=1)a(A,p);if(w&&a(g+1,p),$){let A=Jt(n,$.end).line;for(let k=Jt(n,$.start).line;k<=A;k+=1)a(k,p)}}}return{consume(l,u,m){let h=xi(m);for(let g of i.get(l)??[]){let y=g.entries.find($=>$.code===u&&$.name===h);if(y)return y.used=!0,!0}return!1},unused:c(()=>o.flatMap(l=>l.entries.filter(u=>!u.used).map(u=>({offset:l.offset,entry:u}))),"unused")}}c(_p,"scanReviewAcknowledgements");function Br(e,t){let n=[],s=0;for(;s<e.length;){let r=e[s];if(t(s)||r!=='"'&&r!=="'"&&r!=="`"){s+=1;continue}let o=s;for(s+=1;s<e.length&&e[s]!==r&&(r==="`"||e[s]!==`
33
- `);)e[s]==="\\"&&(s+=1),s+=1;s+=1,r!=="`"&&n.push([o,s])}return n}c(Br,"quotedStringRanges");function Vr(e,t,n){if(Ei.test(t))return[[0,e.length]];let s=[];for(let r of e.matchAll(/<style(?:\s[^>]*)?>[\s\S]*?<\/style\s*>/gi))s.push([r.index,r.index+r[0].length]);return Pt([...s,...Si(e,["css"],n)])}c(Vr,"stylesheetRanges");function Ms(e,t){let n=t,s=0,r=0,o=Math.max(0,t-Op);for(;n>o;){let a=e[n-1];if(a==="]")s+=1;else if(a==="["){if(s===0)break;s-=1}else if(a===")")r+=1;else if(a==="("){if(r===0)break;r-=1}else if(s===0&&r===0&&/[\s,>+~{};'"`]/.test(a))break;n-=1}if(n===o&&o>0)return null;let i=e.slice(n,t);return(/^:global\(\s*([A-Za-z][\w-]*)\s*\)$/.exec(i)??/^([A-Za-z][\w-]*)/.exec(i))?.[1].toLowerCase()??null}c(Ms,"compoundTypeBefore");function Ip(e,t,n){let s=new Set;for(let r of t)for(let o of e.matchAll(new RegExp(`(?<![\\w-])${r}(?![\\w-])`,"g")))if(!n(o.index)){s.add(r);break}return s}c(Ip,"mentionedTags");function Mp(e,t,n){let s=[],r=[];for(let o of e.matchAll(new RegExp(`<(/)?${t}(?=[\\s/>])`,"g"))){if(n(o.index))continue;let i=fn(e,o.index+o[0].length);if(!(i<0))if(o[1]){let a=r.pop();a&&s.push({opening:a,closingStart:o.index})}else/\/\s*>$/.test(e.slice(o.index,i+1))||r.push({start:o.index,end:i})}return s}c(Mp,"elementPairs");function jp(e,t,n,s){let r=[],o=[],i=/<(\/)?([A-Za-z][\w.:-]*)(?=[\s/>])/g;i.lastIndex=t;for(let a=i.exec(e);a&&a.index<n;a=i.exec(e)){if(s(a.index))continue;let l=fn(e,a.index+a[0].length);if(l<0||l>=n)break;let u=a[2].toLowerCase();if(a[1]){let m=o.lastIndexOf(u);m>=0&&(o.length=m)}else{let m=a.index+1;o.length===0&&r.push({tag:u,start:a.index,nameStart:m,nameEnd:m+a[2].length,end:l}),!/\/\s*>$/.test(e.slice(a.index,l+1))&&!Cr.has(u)&&o.push(u)}i.lastIndex=l+1}return r}c(jp,"directChildTokens");function Pp(e,t){let n=[],s=t.nameEnd,r=null;for(;s<t.end;){let o=e[s];if(r){o==="\\"?s+=1:o===r&&(r=null),s+=1;continue}if(o==='"'||o==="'")r=o;else if(o==="{"){let i=Et(e,s,"{","}");!/=\s*$/.test(e.slice(t.nameEnd,s))&&e[s-1]!=="$"&&n.push({start:s,end:i,body:e.slice(s+1,i-1).trim()}),s=i;continue}s+=1}return n}c(Pp,"openingTagBraceGroups");function wi(e){if(/^\(lr-[a-z0-9-]+\)$/.test(e))return{name:e.slice(1,-1),offset:1};if(e.startsWith("onlr-"))return{name:e.slice(2).replace(/Capture$/,""),offset:2};for(let[t,n]of[["@","."],["v-on:","."],["on:","|"]])if(e.startsWith(t))return{name:e.slice(t.length).split(n)[0],offset:t.length};return null}c(wi,"markupEventName");function qr(e){let t=e.rawName,n;if(t.startsWith("?"))return{form:"attribute",offset:1,name:t.slice(1),dynamic:!0};if(n=/^\[attr\.([^\]]+)\]$/.exec(t))return{form:"attribute",offset:6,name:n[1],dynamic:!0};if(n=/^\[([A-Za-z_$][\w$]*)\]$/.exec(t))return{form:"property",offset:1,name:n[1],dynamic:!0};if(t.startsWith("."))return{form:"property",offset:1,name:t.slice(1),dynamic:!0};if(t.startsWith("bind:"))return{form:"property",offset:5,name:t.slice(5).split("|")[0],dynamic:!0};for(let r of["v-bind:",":"])if(t.startsWith(r))return{form:"member",offset:r.length,name:t.slice(r.length).split(".")[0],dynamic:!0};if(!/^[A-Za-z][\w-]*$/.test(t)||t.startsWith("onlr-"))return null;let s=e.valueKind==="expression"||/\$\{|\{\{/.test(e.value??"");return{form:/[A-Z]/.test(t)?"property":"attribute",offset:0,name:t,dynamic:s}}c(qr,"markupMemberBinding");function zp(e,t){if(t.valueEnd===null)return t.nameEnd;let n=e[t.valueStart-1];return(n==='"'||n==="'")&&e[t.valueEnd]===n?t.valueEnd+1:t.valueEnd}c(zp,"attributeEnd");function Dp(e){let t=new Set;for(let n of e){let s=qr(n);s&&t.add(Qe(s.name))}return t}c(Dp,"boundMemberNames");function vi(e,t){return e.sort((n,s)=>n.line-s.line||n.column-s.column||String(n[t]).localeCompare(String(s[t])))}c(vi,"sortReportEntries");function Lp(e,t,n,s,r,o){if(!n.length)return;let i="@aceshooting/lyra-ui",a=c(N=>`${i}${N.slice(1)}`,"specifierOf"),l=n.filter(N=>["function","type","constant","class"].includes(N.kind)),u=c((N,O,q="")=>o(N,{member:O.name,code:"DEPRECATED_MODULE_REVIEW",target:O.replacement,message:`${q}${O.kind} ${O.module?`${O.module}#`:""}${O.name} ${O.removedIn?`was removed in ${O.removedIn}`:`is deprecated and scheduled for removal in ${O.removalNotBefore}`}; review ${O.replacement}.`}),"report"),m=c(N=>l.filter(O=>N===i||N===a(O.module)),"namedFor"),h=Br(e,r),g=Ur(e,r),y=new Set([...h,...g.filter(([N,O])=>!e.slice(N,O).includes("${"))].map(([N])=>N)),$=at(h),w=at(Pt([...h,...g])),f=at(Vr(e,t,r)),E=c(N=>s.some(O=>N>=O.nameEnd&&N<O.end),"inMarkup"),p=c((N,O,q)=>{q.length&&o(N,{member:O,code:"MODULE_NAMESPACE_REVIEW",target:[...new Set(q.map(b=>b.replacement))].join("; "),message:`Review the namespace or dynamic import of ${O} for deprecated exports ${q.map(b=>b.name).join(", ")}. They cannot be safely renamed through aliases; the earliest removal is ${q.map(b=>b.removalNotBefore).sort()[0]}.`})},"opaque"),A=/\b(?:import|export)\s+(?:type\s+)?(?:[$A-Z_a-z][$\w]*\s*,\s*)?\{(?<bindings>[^{};]*)\}\s*from\s*(?<quote>['"])(?<source>@aceshooting\/lyra-ui(?:\/[^'"\s]+)?)\k<quote>/g,k=new Set;for(let N of e.matchAll(A)){if(r(N.index)||w(N.index))continue;let O=m(N.groups.source),q=N.index+N[0].indexOf("{")+1;for(let b of mn(N.groups.bindings)){let j=O.find(x=>x.name===b.imported);if(!j)continue;let d=[...N.groups.bindings.matchAll(new RegExp(`(?<![$\\w])${Ce(b.imported)}(?![$\\w])`,"g"))].find(x=>!r(q+x.index));d&&u(q+d.index,j)}k.add(N.index+N[0].lastIndexOf(N.groups.source)-1)}for(let N of e.matchAll(/(['"])(@aceshooting\/lyra-ui(?:\/[^'"\s]+)?)\1/g)){if(r(N.index))continue;let O=E(N.index),q=f(N.index);if(!y.has(N.index)&&!O&&!q)continue;let b=e.slice(Math.max(0,N.index-500),N.index),j=Os(e,N.index),d=q&&/@import\s+(?:url\(\s*)?$/.test(b),x=O&&/\b(?:href|src)\s*=\s*$/.test(b);if(!j&&!d&&!x)continue;let I=N[2];for(let P of n)(P.kind==="entry-point"||P.kind==="stylesheet")&&I===a(P.name)&&u(N.index+1,P);if(k.has(N.index)||!j||j.sideEffect)continue;let C=m(I);if(j.kind==="binding"&&/\bexport\s+(?:type\s+)?\*\s*(?:as\s+[$A-Z_a-z][$\w]*\s*)?from\s*$/.test(b))for(let P of C)u(N.index+1,P,"This re-export includes ");else p(N.index+1,I,C)}for(let N of e.matchAll(/@import\s+url\(\s*(@aceshooting\/lyra-ui\/[^\s)'";]+)\s*\)/g))if(!(r(N.index)||!f(N.index)))for(let O of n)O.kind==="stylesheet"&&N[1]===a(O.name)&&u(N.index+N[0].indexOf(N[1]),O);for(let N of n)if(N.kind==="window-event")for(let O of e.matchAll(new RegExp(`(['"\\x60])(${Ce(N.name)})\\1`,"g"))){if(r(O.index))continue;let q=e.slice(Math.max(0,O.index-200),O.index);(Fr.test(q)||/\bnew\s+(?:CustomEvent|Event)\s*(?:<[^>\n]+>)?\(\s*$/.test(q))&&y.has(O.index)&&u(O.index+1,N)}else if(N.kind==="root-attribute"){let O=new Set;for(let j of s)for(let d of ot(e,j))d.rawName.replace(/^\[attr\.(.+)\]$/,"$1").replace(/^(?:v-bind:|bind:|[?:])/,"")===N.name&&!$(d.nameStart)&&O.add(d.nameStart+d.rawName.indexOf(N.name));for(let j of e.matchAll(new RegExp(`(?<![\\w-])${Ce(N.name)}(?![\\w-])`,"g"))){if(r(j.index))continue;let d=j.index,x=e.slice(Math.max(0,d-180),d),I=e.slice(d+N.name.length),C=/\b(?:getAttribute|setAttribute|hasAttribute|removeAttribute|toggleAttribute)\s*\(\s*['"`]$/.test(x),P=/\[\s*$/.test(x)&&/^\s*(?:[~|^$*]?=|\])/.test(I),M=O.has(d);(C&&y.has(d-1)||P&&(f(d)||$(d))||M)&&u(d,N)}let q=N.name.slice(5).replace(/-([a-z])/g,(j,d)=>d.toUpperCase()),b=new RegExp(`\\bdataset\\s*(?:\\.\\s*${Ce(q)}\\b|\\[\\s*(['"])${Ce(q)}\\1\\s*\\])`,"g");for(let j of e.matchAll(b))!r(j.index)&&!w(j.index)&&u(j.index,N)}}c(Lp,"reportModuleReviews");var Fp="GLOBAL_REVIEW",Wr="@aceshooting/lyra-ui",Bp=/(?:^|\/)node_modules\/$/,Vp=/\.json$/i,Is="[$A-Za-z_][$\\w]*",Lr=c(e=>e.module==="."?Wr:`${Wr}${e.module.slice(1)}`,"exportSpecifier");function qp(e,t,n,{inComment:s,inCss:r,openingTokens:o,rewrite:i,warn:a}){let l=n.filter(y=>y.kind==="module"),u=n.filter(y=>y.kind==="export"),m=n.filter(y=>y.kind==="locale-key"),h=c((y,$,w,f)=>a(y,{member:w,code:Fp,target:$.to,message:f}),"review");if(l.length){let y=c(f=>o.some(E=>f>=E.nameEnd&&f<E.end),"inMarkup"),$=c((f,E,p,A)=>{A?i(E,E+f.from.length,f.to,{tag:null,member:p,action:"rewrite-module",target:f.to,message:`Rewrite ${f.from} to ${f.to}: ${f.summary}`}):h(E,f,p,`${p} is not provably a module specifier here (or is computed): ${f.summary} Use ${f.to}${f.prefix?"...":""} instead.`)},"handle"),w=c(f=>l.find(E=>E.prefix?f.startsWith(E.from)&&!(E.except??[]).some(p=>f.startsWith(p)):f===E.from),"entryFor");for(let f of e.matchAll(/(['"`])([^'"`\n]*?@aceshooting\/lyra-ui\/[^'"`\n]*)\1/g)){if(s(f.index))continue;let E=f[2].indexOf("@aceshooting/"),p=f[2].slice(0,E);if(p&&!Bp.test(p))continue;let A=f[2].slice(E),k=w(A);if(!k)continue;let N=f.index+1+E,O=e.slice(Math.max(0,f.index-500),f.index),q=Os(e,f.index),b=r(f.index)&&/@import\s+(?:url\(\s*)?$/.test(O),j=y(f.index)&&/\b(?:href|src)\s*=\s*$/.test(O),d=!A.includes("${")&&!!(p||Vp.test(t)||q||b||j);$(k,N,A,d)}for(let f of e.matchAll(/@import\s+url\(\s*(@aceshooting\/lyra-ui\/[^\s)'";]+)\s*\)/g)){let E=w(f[1]);s(f.index)||!r(f.index)||!E||$(E,f.index+f[0].indexOf(f[1]),f[1],!0)}}if(u.length){let y=new RegExp(`\\b(?:import|export)\\s+(?:type\\s+)?(?:${Is}\\s*,\\s*)?\\{(?<body>[^{};]*)\\}\\s*from\\s*(?<quote>['"])(?<source>${Ce(Wr)}(?:\\/[^'"\\s]+)?)\\k<quote>`,"g"),$=new RegExp(`^(\\s*(?:type\\s+)?)(${Is})(\\s+as\\s+${Is})?\\s*$`,"d");for(let w of e.matchAll(y)){if(s(w.index))continue;let f=w.index+w[0].indexOf("{")+1;for(let E of w.groups.body.matchAll(/[^,]+/g)){let p=$.exec(E[0]),A=p&&u.find(N=>N.from===p[2]);if(!A)continue;let k=f+E.index+p.indices[2][0];s(k)||(w.groups.source===Lr(A)?i(k,k+A.from.length,p[3]?A.to:`${A.to} as ${A.from}`,{tag:null,member:A.from,action:"rewrite-export",target:A.to,message:`${A.from} no longer exists; import ${A.to}${p[3]?"":` as ${A.from}`}: ${A.summary}`}):h(k,A,A.from,`${A.from} is not exported by ${w.groups.source} any more: ${A.summary} Import ${A.to} from ${Lr(A)}.`))}}for(let w of u){let f=Ce(Lr(w)),p=[...[...e.matchAll(new RegExp(`import\\s+(?:type\\s+)?\\*\\s+as\\s+(${Is})\\s+from\\s*(['"])${f}\\2`,"g"))].map(A=>A[1]).map(Ce),`import\\(\\s*['"]${f}['"]\\s*\\)`];for(let A of e.matchAll(new RegExp(`(?<![$\\w.])(?:${p.join("|")})\\s*\\.\\s*${w.from}(?![$\\w])`,"g")))s(A.index)||h(A.index+A[0].lastIndexOf(w.from),w,w.from,`${w.from} no longer exists: ${w.summary} Use ${w.to}.`)}}for(let y of n.filter($=>$.kind==="css-property")){let $=new RegExp(`${Ce(y.from)}${y.prefix?"[\\w-]*":"(?![\\w-])"}`,"g"),w=!y.prefix&&/^--[\w-]+$/.test(y.to);for(let f of e.matchAll($))s(f.index)||(w?i(f.index,f.index+f[0].length,y.to,{tag:null,member:f[0],action:"rewrite-css-property",target:y.to,message:`Rewrite ${y.from} to ${y.to}: ${y.summary}`}):h(f.index,y,f[0],`The custom property ${f[0]} was removed: ${y.summary} Use ${y.to}.`))}let g=n.filter(y=>y.kind==="part");if(g.length)for(let y of e.matchAll(/::part\(([^)]*)\)/g)){if(s(y.index))continue;let $=y[1].trim().split(/\s+/),w=Ms(e,y.index);for(let f of g)!$.includes(f.from)||!(w===f.tag||!w&&e.includes(f.tag))||h(y.index+y[0].indexOf(f.from),f,f.from,`The ${f.tag} part ${f.from} changed: ${f.summary} ${f.to}`)}if(m.length&&/registerLyraLocale|bridgeLyraLocale|\.strings\b|@aceshooting\/lyra-ui/.test(e))for(let y of m){if(y.tag&&!e.includes(y.tag))continue;let $=y.to?`use ${y.to}`:"it has no replacement",w=y.tag?`${y.tag} no longer reads the localization key ${y.from}; ${$}: ${y.summary}`:`The localization key ${y.from} was removed; ${$}: ${y.summary}`;for(let f of e.matchAll(new RegExp(`(?<![$\\w.-])${y.from}(?![$\\w-])`,"g"))){let E=e[f.index-1]??"",p=e.slice(f.index+y.from.length,f.index+y.from.length+12),A=/['"`]/.test(E)&&/^['"`]/.test(p);s(f.index)||!(A||/^\s*:/.test(p))||h(f.index,y,y.from,w)}}}c(qp,"applyGlobals");function ki(e,t,n){let s=n.file??"<memory>",r=n.origin,o=t.renameProfiles.get(r);U(o,`unknown migration origin ${String(r)}`);let i={content:e,changes:[],warnings:[],acknowledged:0,usage:{webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}},blockedMappings:new Set,blockedEcosystems:new Set,bareImportEcosystems:new Set,blockedLocalMigrations:new Set,constructedEvents:new Set};if(o.isEmpty)return i;let a=Ln(e),l=Cp(e,s),u=at(l),m=Fn(e,l,u),h=_p(e,l,a,m),g=Ap.test(s)?at(Si(e,["html","svg"],u)):()=>!1,y=at(Pt([...Br(e,u),...Ur(e,u)])),$=at(Vr(e,s,u)),w=c(v=>Rp.test(s)||g(v),"attributeSemantics"),f=`Lyra ${o.toMajor}`,E=`${o.aliasRemovalMajor}.0.0`;for(let v of e.matchAll(Ep))!u(v.index)&&o.renamesNamed("event",v[2]).length&&i.constructedEvents.add(v[2]);let p=new Set([...n.constructedEvents??[],...i.constructedEvents]),A=c((v,S)=>{let D=wp.exec(e.slice(Math.max(0,v-200),v))?.[1],L=vp.exec(e.slice(v+S.length+2,v+S.length+202))?.[1];return D&&L?`${D.replace(/\s+/g,"")}\0${L.replace(/\s+/g,"")}`:null},"listenerIdentity"),k=new Map;if(o.data.renames.some(v=>v.kind==="event"))for(let v of e.matchAll(/(['"`])(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1/g)){if(u(v.index)||!Fr.test(e.slice(Math.max(0,v.index-120),v.index)))continue;let S=A(v.index,v[2]);S&&k.set(S,new Set([...k.get(S)??[],v[2]]))}let N=c((v,S)=>{if(!k.size)return!1;let D=k.get(A(v,S));return!!D&&o.renamesNamed("event",S).some(L=>D.has(L.to))},"sameHandlerListens"),O=[],q=new Set,b=new Set,j=new Set,d=c(v=>[...new Set(v)],"unique"),x=c(v=>d(v).join(", "),"list"),I=c(v=>d(v.map(S=>S.tag)).length===1?v[0].tag:null,"soleTag"),C=c((v,S)=>`After review, mark the site with a "lyra-migrate-reviewed: ${v}:${xi(S)}" comment.`,"hint"),P=c((v,S,D,{tag:L,member:K,action:Q,target:se,message:B})=>{O.push({start:v,end:S,replacement:D}),i.changes.push(xt({textStarts:a,file:s,offset:v,origin:r,upstreamTag:L,upstreamMember:K,action:Q,target:se,message:B}))},"rewrite"),M=c((v,{tag:S=null,member:D,code:L,target:K=null,message:Q})=>{let se=`${v}:${L}:${D}`;if(!q.has(se)){if(q.add(se),h.consume(Jt(a,v).line,L,D)){i.acknowledged+=1;return}i.warnings.push(xt({textStarts:a,file:s,offset:v,origin:r,upstreamTag:S,upstreamMember:D,action:"manual-review",target:K,warningCode:L,message:`${Q} ${C(L,D)}`}))}},"warn"),R=c(v=>`${v.kind==="component"?`<${v.tag}>`:v.kind==="slot"&&v.name===""?`Content in the default slot of ${v.tag}`:`The ${v.tag} ${v.kind} ${v.name}`} ${v.removedIn?`was removed in ${v.removedIn}`:`is deprecated and scheduled for removal in ${v.removalNotBefore}`}; migrate to ${v.replacement} by hand.`,"reviewMessage"),_=c((v,S)=>M(v,{tag:S.tag,member:S.name,code:hp,target:S.replacement,message:R(S)}),"reportReview"),W=c((v,S)=>M(v,{tag:S.tag,member:S.property,code:"PROPERTY_CHANGE_REVIEW",target:S.property,message:`Review ${S.tag}.${S.property} for ${f}: ${S.summary}`}),"reportPropertyChange");if(Lp(e,s,o.data.moduleReviews,m,u,M),qp(e,s,o.data.globals,{inComment:u,inCss:$,openingTokens:m,rewrite:P,warn:M}),o.data.rules.includes("theme-scopes")){let v=jr(e,{file:s});for(let{offset:S,change:D}of v.insertions)P(S,S,v.marker,{tag:D.upstreamTag,member:D.upstreamMember,action:D.action,target:D.target,message:D.message});for(let S of v.warnings)M(a[S.line-1]+S.column-1,{tag:S.upstreamTag,member:S.upstreamMember??S.upstreamTag??S.target,code:S.warningCode,target:S.target,message:S.message})}let ee=c((v,S,D,L)=>{let K=L?o.reviewFor(L,v,S):null;if(K)_(D,K);else if(!o.exposes(v,S,L))for(let Q of o.reviewsNamed(v,S))_(D,Q)},"unownedReviews"),ae=c(v=>v==="css-property"?"custom property":v,"label"),pe=c(v=>{let S=o.detailsNamed(v);return S.length?` Its ${f} detail also changed: ${S.map(D=>`${D.tag}: ${D.summary}`).join(" ")}`:""},"detailNote"),de=c(({kind:v,name:S,start:D,context:L,rewritable:K,action:Q})=>{let se=o.renamesNamed(v,S),B=d(se.map(be=>be.to)),V=v==="event"&&p.has(S);if(K&&!V&&o.isGlobal(v,S))return P(D,D+S.length,B[0],{tag:I(se),member:S,action:Q,target:B[0],message:`Rename ${S} to ${B[0]}; every component exposing it renamed it, and no other component uses ${B[0]}.`}),B[0];let oe=d(B.flatMap(be=>o.sourceKeepers(v,S,be))).filter(be=>!se.some($e=>$e.tag===be)),ge=d(B.flatMap(be=>o.targetKeepers(v,S,be))),ce=B.length===1&&!oe.length&&ge.length>0&&!se.some(be=>be.polarity);return M(D,{tag:I(se),member:S,code:ce?gi:Yt,target:B.join(" | "),message:(v==="css-property"?"Custom properties inherit into nested components. ":L==="listener"?"This listener does not prove which element it listens to. ":"This string may name an event of any component. ")+`${x(se.map(be=>be.tag))} renamed the ${ae(v)} ${S} to ${B.join(" or ")}`+(oe.length?`, while ${x(oe)} still ${oe.length===1?"uses":"use"} ${S}`:"")+(ge.length?`; ${x(ge)} already ${ge.length===1?"uses":"use"} ${B.join(" and ")}, which this site would start reaching`:"")+(V?`; the scanned code also dispatches ${S} itself, so its listeners and dispatches must move together`:"")+`. Update it by hand for the components it is meant for; ${S} has a recorded removal floor of ${E}; check the installed release migration guide.`+(v==="event"?pe(B[0]):"")}),null},"unownedMove"),he=c((v,S,D=!0)=>{if(p.has(v))return null;let L=S?o.renameFor(S,"event",v):null;return L?o.targetKeepers("event",v,L.to).length?null:L.to:!D||!o.renamesNamed("event",v).length||o.exposes("event",v,S)?null:o.isGlobal("event",v)?o.renamesNamed("event",v)[0].to:null},"eventMove"),Ne=c((v,S,D)=>v==="same-handler"?`${S} already listens to ${D} with this same handler; renamed, the two identical registrations would collapse into one, so the handler would run once per activation instead of twice. Rename or remove this call, and its add or remove counterpart, together by hand.`:`${S} already listens to ${D}; merge the two handlers by hand.`,"conflictMessage"),Se=c(({name:v,start:S,owner:D,context:L,rewritable:K=!0,conflict:Q=!1})=>{let se=D?o.retiredEventFor(D,v):null,B=se?[se]:o.exposes("event",v,D)?[]:o.retiredEventsNamed(v);B.length&&M(S,{tag:se?D:I(B),member:v,code:"RETIRED_EVENT_REVIEW",target:d(B.map($e=>$e.replacement)).join(", "),message:`${v} is no longer dispatched by ${x(B.map($e=>$e.tag))} in ${f}. `+B.map($e=>`${$e.tag}: use ${$e.replacement}. ${$e.summary}`).join(" ")+" Review this listener and its matching removal together; keep unrelated events with the same spelling, check nested event targets, and merge any existing canonical listener without dropping or duplicating handler calls."});let V=D?o.renameFor(D,"event",v):null,oe=v;if(V){let $e=o.targetKeepers("event",v,V.to);if(p.has(v))M(S,{tag:D,member:v,code:Yt,target:V.to,message:`Not renamed: the scanned code dispatches ${v} itself, so this listener would stop hearing it. Rename the dispatch and its listeners to ${V.to} together; ${v} has a recorded removal floor of ${E}; check the installed release migration guide.${pe(V.to)}`});else if($e.length)M(S,{tag:D,member:v,code:gi,target:V.to,message:`Not renamed: ${x($e)} also ${$e.length===1?"dispatches":"dispatch"} ${V.to}, so this listener would start receiving their events when they are nested inside this ${D}. Rename it by hand and ignore events whose target is not this ${D}; ${v} has a recorded removal floor of ${E}; check the installed release migration guide.${pe(V.to)}`});else if(Q)M(S,{tag:D,member:v,code:Dr,target:V.to,message:`${Ne(Q,`This ${D}`,V.to)} ${v} has a recorded removal floor of ${E}; check the installed release migration guide.`});else{let Ge=o.sourceKeepers("event",v,V.to).filter(ue=>ue!==D);P(S,S+v.length,V.to,{tag:D,member:v,action:"rewrite-event",target:V.to,message:`Rename the ${D} event ${v} to ${V.to}.`+(Ge.length?` ${x(Ge)} still ${Ge.length===1?"dispatches":"dispatch"} ${v}; this listener stops hearing theirs from nested elements.`:"")}),oe=V.to}}else o.renamesNamed("event",v).length&&!o.exposes("event",v,D)&&(Q?M(S,{tag:I(o.renamesNamed("event",v)),member:v,code:Dr,target:o.renamesNamed("event",v)[0].to,message:Ne(Q,Q==="same-handler"?"This receiver":"This element",o.renamesNamed("event",v)[0].to)}):oe=de({kind:"event",name:v,start:S,context:L,rewritable:K,action:"rewrite-event"})??v);let ge=o.detailsNamed(oe),ce=D?o.detailFor(D,oe):null;if(ce||ge.length&&!o.exposes("event",oe,D)){let $e=ce?[ce]:ge;M(S,{tag:ce?D:I($e),member:oe,code:fp,target:oe,message:`The ${oe} event detail changed in ${f} and cannot be aliased: `+$e.map(Ge=>`${Ge.tag}: ${Ge.summary}`).join(" ")+` Update this handler if it reads the detail of ${ce?`the ${D} event`:"one of these components"}.`})}let be=oe===v?o.gainedOwners("event",v):[];be.length&&!o.exposes("event",v,D)&&M(S,{tag:I(be.map($e=>({tag:$e}))),member:v,code:zr,target:v,message:`In ${f}, ${x(be)} also ${be.length===1?"dispatches":"dispatch"} ${v}. This ${L} does not prove which element it listens to, so it may start receiving those events; ignore them by event target if it should not.`}),ee("event",v,S,D)},"eventSite"),ke=new Set,ut=/\b([A-Za-z_$][\w$]*)\s*(?:\?\.|\.)\s*detail\s*(?:\?\.|\.)\s*(open|collapsed)\b/g,ze=c((v,S,D=null,L=null)=>{if(ke.has(S))return;let K=D&&L?o.detailFieldFor(D,L):null;if(K&&K.field===v){let V=K.relation==="equal"?"detail.expanded":"!detail.expanded",oe=K.relation==="equal"?"carries the same value as":"is the inverse of",ge=K.removedIn?` It was removed in ${K.removedIn}.`:" This notice does not assert that the field was removed.";M(S,{tag:D,member:v,code:yi,target:V,message:`The ${D} ${L} detail field ${v} is deprecated: it ${oe} detail.expanded (${K.notice}). Read ${V} in this handler by hand; no field rewrite was applied.${ge}`}),ke.add(S);return}let Q=L?o.detailFieldsNamed(L).filter(V=>V.field===v):[],se=Q.length?Q:(o.data.detailFields??[]).filter(V=>V.field===v);if(!se.length)return;let B=[...new Set(se.map(V=>`${V.tag}/${V.event} (${V.relation})`))];M(S,{tag:null,member:v,code:yi,target:null,message:`This detail.${v} read has no proven Lyra tag and event. Matching published field contracts are ${B.join(", ")}; identify the runtime detail type and migrate it by hand. No field rewrite was applied.`}),ke.add(S)},"reportDetailField"),Vt=c((v,S,D)=>{if(D.valueStart===null||D.valueEnd===null)return;let L=e.slice(D.valueStart,D.valueEnd);for(let K of L.matchAll(ut)){let Q=D.valueStart+K.index+K[0].lastIndexOf(K[2]);ze(K[2],Q,v,S)}},"inspectMarkupDetailFields");for(let v of m){let S=v.tag.toLowerCase();for(let D of ot(e,v)){let L=wi(D.rawName);L&&L.name.startsWith("lr-")&&Vt(S,L.name,D)}}let Ot=c(({owner:v,kind:S,name:D,start:L,forms:K,dynamic:Q,removal:se})=>{let B=K.filter(([ge])=>ge==="property").map(([,ge])=>o.propertyChangeFor(v,ge)).find(Boolean);B&&W(L,B);let V=K.map(([ge,ce])=>o.reviewFor(v,ge,ce)).find(Boolean);V&&_(L,V);let oe=K.map(([ge,ce])=>o.renameFor(v,ge,ce)).find(Boolean);if(!oe)return null;if(oe.polarity==="inverted"&&(Q||!se)){let ge=S==="binding"?Vn(D,oe.to):oe.to;return M(L,{tag:v,member:oe.from,code:jt,target:oe.to,message:`${ge} is the inverse of ${D} on ${v}, and this ${S==="binding"?"binding":S==="property"?"property access":"attribute binding"} is not a static attribute. Bind the negated value to ${ge} by hand; ${D} has a recorded removal floor of ${E}; check the installed release migration guide.`}),null}return oe},"memberSite"),qe=c(v=>d([...o.data.renames.filter(S=>S.tag===v&&["attribute","property","event"].includes(S.kind)).map(S=>S.from),...o.data.reviews.filter(S=>S.tag===v&&["attribute","property","event"].includes(S.kind)).map(S=>S.name),...o.data.retiredEvents.filter(S=>S.tag===v).map(S=>S.event),...o.data.propertyChanges.filter(S=>S.tag===v).flatMap(S=>[S.property,...S.former?[S.former]:[]])]),"renamedMembers"),T=[];for(let v of m){let S=v.tag.toLowerCase(),D=ot(e,v),L=o.tags.has(S),K=L?Dp(D):null,Q=new Map,se=D.map(B=>{let V=wi(B.rawName),oe=B.rawName;if(V&&V.name.startsWith("lr-")){let ce=he(V.name,S);ce&&(oe=B.rawName.slice(0,V.offset)+ce+B.rawName.slice(V.offset+V.name.length))}else if(L){let ce=qr(B),be=ce&&!ce.form.startsWith("member")&&o.renameFor(S,ce.form,ce.name);be&&!be.polarity&&(oe=B.rawName.slice(0,ce.offset)+be.to+B.rawName.slice(ce.offset+ce.name.length))}let ge=oe.toLowerCase();return Q.set(ge,(Q.get(ge)??0)+1),{attribute:B,event:V,key:ge,renamed:oe!==B.rawName}});if(L&&qe(S).length)for(let B of Pp(e,v)){let V=/^[A-Za-z_$][\w$]*$/.exec(B.body)?.[0];if(!V){M(B.start,{tag:S,member:S,code:"DYNAMIC_VALUE_REVIEW",target:null,message:`This spread on ${S} may carry renamed or deprecated members (${x(qe(S))}); rename them where the object is built.`});continue}let oe=[["property",et(V)],["attribute",Qe(V)]],ge=oe.map(([$e,Ge])=>o.reviewFor(S,$e,Ge)).find(Boolean);ge&&_(B.start+1,ge);let ce=o.propertyChangeFor(S,et(V));ce&&W(B.start+1,ce);let be=oe.map(([$e,Ge])=>o.renameFor(S,$e,Ge)).find(Boolean);be&&M(B.start+1,{tag:S,member:be.from,code:be.polarity?jt:Yt,target:be.to,message:`The shorthand {${V}} binds the deprecated ${S} ${be.kind} ${be.from}; write ${Vn(V,be.to)}={${be.polarity?`!${V}`:V}} by hand.`})}for(let{attribute:B,event:V,key:oe,renamed:ge}of se){if(V){V.name.startsWith("lr-")&&(Vt(S,V.name,B),Se({name:V.name,start:B.nameStart+V.offset,owner:S,context:"listener",conflict:ge&&Q.get(oe)>1}));continue}if(!L)continue;if(/^v-(?:bind|on)$/.test(B.rawName)||B.rawName.startsWith("${")&&!/^\$\{\s*ref\s*\(/.test(B.rawName)){qe(S).length&&M(B.nameStart,{tag:S,member:S,code:"DYNAMIC_VALUE_REVIEW",target:null,message:`This object binding on ${S} may carry renamed or deprecated members (${x(qe(S))}); rename them where the object is built.`});continue}if(B.rawName==="exportparts"){if(B.valueKind!=="literal"||/\$\{|\{\{/.test(B.value??""))continue;for(let yt of(B.value??"").matchAll(/([^,\s:]+)(\s*:\s*[^,\s]+)?/g)){let bt=yt[1],nt=B.valueStart+yt.index,Uo=o.reviewFor(S,"part",bt);Uo&&_(nt,Uo);let rn=o.renameFor(S,"part",bt);rn&&P(nt,nt+bt.length,yt[2]?rn.to:`${rn.to}:${bt}`,{tag:S,member:bt,action:"rewrite-part",target:rn.to,message:yt[2]?`Forward the renamed ${S} part ${rn.to} under the same exported name.`:`Forward the renamed ${S} part ${rn.to} under its previous exported name ${bt}.`})}continue}let ce=qr(B);if(!ce)continue;let be=ce.form==="member"?[["property",et(ce.name)],["attribute",Qe(ce.name)]]:[[ce.form,ce.name]],$e=B.nameStart+ce.offset,Ge=ce.form==="attribute"&&ce.offset===0&&!ce.dynamic,ue=Ot({owner:S,kind:ce.form==="member"?"binding":ce.form,name:ce.name,start:$e,forms:be,dynamic:ce.dynamic,removal:Ge});if(!ue)continue;if(K.has(Qe(ue.to))||ge&&Q.get(oe)>1){M($e,{tag:S,member:ue.from,code:Dr,target:ue.to,message:`This ${S} already binds ${ue.to}; remove the deprecated ${ue.from} binding by hand.`});continue}if(ue.polarity==="inverted"){if(!w(v.start)){M($e,{tag:S,member:ue.from,code:jt,target:ue.to,message:`${ue.to} is the inverse of ${ue.from}. In this template syntax a static value may be assigned to the ${et(ue.from)} property as a string, where "false" is truthy, so set ${ue.to} by hand.`});continue}if(o.preservedDefaultsFor(S).some(nt=>nt.attribute===ue.to&&nt.value===!0)){M($e,{tag:S,member:ue.from,code:jt,target:ue.to,message:`${ue.from} has a preserved absent default, so removing an explicit attribute would let a later run insert ${ue.to}. Review this value using the old converter (a presence boolean treats even "false" as true), then migrate it by hand after the default migration is complete.`});continue}let yt=B.value??"",bt=zp(e,B);if(yt===""||yt==="true"||yt===ue.from){let nt=B.nameStart;for(;nt>0&&/\s/.test(e[nt-1]);)nt-=1;P(nt,bt,"",{tag:S,member:ue.from,action:"remove-attribute",target:ue.to,message:`Remove ${ue.from}: it restated the ${S} default, and ${ue.to} is off by default.`})}else yt==="false"?P(B.nameStart,bt,ue.to,{tag:S,member:ue.from,action:"rewrite-attribute",target:ue.to,message:`Replace ${ue.from}="false" with the presence of ${ue.to}.`}):M($e,{tag:S,member:ue.from,code:jt,target:ue.to,message:`${ue.from}="${B.value}" is not a boolean literal; set ${ue.to} to its inverse by hand.`});continue}let vl=ce.form==="member"?Vn(ce.name,ue.to):ue.to;P($e,$e+ce.name.length,vl,{tag:S,member:ue.from,action:`rewrite-${ue.kind}`,target:ue.to,message:`Rename the ${S} ${ue.kind} ${ue.from} to ${ue.to}.`})}L&&o.defaultsFor(S).length&&T.push({token:v,owner:S,bound:K})}let z=[...o.tags].filter(v=>o.slotContentFor(v).length||[...o.data.renames,...o.data.reviews].some(S=>S.tag===v&&S.kind==="slot"));for(let v of z)for(let S of Mp(e,v,u))for(let D of jp(e,S.opening.end+1,S.closingStart,u)){let L="",K=D.nameStart;for(let B of ot(e,D))if(B.rawName==="slot")L=B.valueKind==="literal"?B.value??"":null,K=B.valueStart??B.nameStart;else if(B.rawName==="v-slot")L="";else{let V=["v-slot:","#"].find(oe=>B.rawName.startsWith(oe));V&&(L=B.rawName.slice(V.length),K=B.nameStart+V.length,L==="default"&&(L=""))}if(L===null)continue;let Q=o.reviewFor(v,"slot",L);Q&&_(K,Q);let se=L===""?null:o.renameFor(v,"slot",L);if(se&&P(K,K+L.length,se.to,{tag:v,member:L,action:"rewrite-slot",target:se.to,message:`Rename the ${v} slot ${L} to ${se.to}.`}),D.tag!=="template")for(let B of o.slotContentFor(v)){if(B.slot!==L)continue;let V=(B.report??B.allow).includes(D.tag);(B.report?!V:V)||M(D.nameStart,{tag:v,member:D.tag,code:gp,target:null,message:`<${D.tag}> in ${L===""?"the default slot":`the ${L} slot`} of ${v}: ${B.summary}`})}}for(let v of e.matchAll(/::part\(([^)]*)\)/g)){if(u(v.index))continue;let S=Ms(e,v.index),D=v.index+7;for(let L of v[1].matchAll(/\S+/g)){let K=L[0],Q=D+L.index,se=S?o.renameFor(S,"part",K):null;if(se)P(Q,Q+K.length,se.to,{tag:S,member:K,action:"rewrite-part",target:se.to,message:`Rename the ${S} part ${K} to ${se.to}.`});else if(o.renamesNamed("part",K).length&&!o.exposes("part",K,S)){let B=o.renamesNamed("part",K),V=o.exposers("part",K).filter(oe=>!B.some(ge=>ge.tag===oe));M(Q,{tag:I(B),member:K,code:Yt,target:x(B.map(oe=>oe.to)),message:`This ::part() selector does not name the component that owns the part. ${x(B.map(oe=>oe.tag))} renamed the part ${K} to ${x(B.map(oe=>oe.to))}`+(V.length?`, while ${x(V)} still ${V.length===1?"exposes":"expose"} ${K}`:"")+". Rename it where the selector reaches a renamed component directly; a part forwarded through exportparts keeps its exported name."})}else if(o.gainedOwners("part",K).length&&!S?.startsWith("lr-")){let B=o.gainedOwners("part",K);M(Q,{tag:I(B.map(V=>({tag:V}))),member:K,code:zr,target:K,message:`In ${f}, ${x(B)} also ${B.length===1?"exposes":"expose"} the part ${K}, so this selector may start matching it.`})}ee("part",K,Q,S)}}let Y=new Set([...o.data.renames.filter(v=>v.kind==="css-property").flatMap(v=>[v.from,v.to]),...o.data.reviews.filter(v=>v.kind==="css-property").map(v=>v.name)]);if(Y.size)for(let v of e.matchAll(/(?<![\w-])--[A-Za-z0-9_-]+/g)){let S=v[0];if(!Y.has(S)||u(v.index))continue;o.renamesNamed("css-property",S).length&&de({kind:"css-property",name:S,start:v.index,context:"custom property",rewritable:!0,action:"rewrite-css-property"});let D=/^\s*['"]?\s*:/.test(e.slice(v.index+S.length,v.index+S.length+16))||/setProperty\s*\(\s*['"`]$/.test(e.slice(Math.max(0,v.index-24),v.index)),L=o.gainedOwners("css-property",S);D&&L.length&&M(v.index,{tag:I(L.map(K=>({tag:K}))),member:S,code:zr,target:S,message:`In ${f}, ${x(L)} also ${L.length===1?"reads":"read"} ${S}, so this declaration now reaches them when they are nested below it.`});for(let K of o.reviewsNamed("css-property",S))_(v.index,K)}for(let v of e.matchAll(/\[\s*([A-Za-z_][\w-]*)(?=\s*(?:[~|^$*]?=|\]))/g)){if(u(v.index))continue;let S=Ms(e,v.index);if(!S||!o.tags.has(S))continue;let D=v[1],L=v.index+v[0].length-D.length,K=o.reviewFor(S,"attribute",D);K&&_(L,K);let Q=o.renameFor(S,"attribute",D);if(Q){if(Q.polarity==="inverted"){M(L,{tag:S,member:D,code:jt,target:Q.to,message:`${Q.to} is the inverse of ${D}; rewrite this ${S} selector to test the opposite state (for example :not([${Q.to}])).`});continue}if(!Q.reflects){M(L,{tag:S,member:D,code:Yt,target:Q.to,message:`${S} does not reflect ${Q.to}, so [${Q.to}] matches only where markup sets it. Rename this selector once every place that sets ${D} (markup, setAttribute) sets ${Q.to} instead.`});continue}P(L,L+D.length,Q.to,{tag:S,member:D,action:"rewrite-attribute",target:Q.to,message:`Rename the ${S} attribute selector [${D}] to [${Q.to}]; ${S} reflects ${Q.to}.`})}}for(let v of e.matchAll(/:state\(\s*([a-z][a-z0-9-]*)\s*\)/g)){if(u(v.index))continue;let S=Ms(e,v.index),D=S?o.reviewFor(S,"css-state",v[1]):null;D&&_(v.index+v[0].indexOf(v[1]),D)}for(let v of o.data.reviews.filter(S=>S.kind==="component"))for(let S of e.matchAll(new RegExp(`(?<![\\w-])${v.tag}(?![\\w-])`,"g")))u(S.index)||e.slice(S.index-2,S.index)==="</"||_(S.index,v);let F=/(?:document\.)?querySelector\(\s*(['"])(lr-[a-z0-9-]+)\1\s*\)\s*!?\s*\.\s*addEventListener\(\s*(['"])(lr-[a-z0-9-]+)\3\s*,/g,H=/[A-Za-z_$][\w$]*\s*\.\s*addEventListener\(\s*(['"])(lr-[a-z0-9-]+)\1\s*,/g,X=c(v=>{let S=Math.max(0,v-4096),D=e.slice(S,v),L=null;for(let K of[F,H]){K.lastIndex=0;for(let Q of D.matchAll(K)){let se=K===F?Q[4]:Q[2],B=Q.index+Q[0].length,V=D.slice(B);!/=>|\bfunction\b/u.test(V)||/\)\s*;/u.test(V)||(!L||Q.index>=L.index)&&(L={owner:K===F?Q[2]:null,event:se,index:Q.index})}}return L},"scriptListenerAt");for(let v of e.matchAll(ut)){let S=v.index+v[0].lastIndexOf(v[2]);if(ke.has(S)||u(S)||y(S)||$(S))continue;let D=X(S);ze(v[2],S,D?.owner??null,D?.event??null)}for(let v of e.matchAll(Sp)){if(u(v.index))continue;let S=v[2],D=v[3],L=v.index+v[0].length-D.length,K=L+D.length;if(j.add(L),$i.has(D)||kp.has(D)){let se=/^\s*\(\s*(['"`])([^'"`\n]+)\1/.exec(e.slice(K,K+200));if(!se)continue;let B=K+se[0].length-1-se[2].length;if(b.add(B-1),$i.has(D)){Se({name:se[2],start:B,owner:S,context:"listener",conflict:N(B-1,se[2])&&"same-handler"});continue}let V=Ot({owner:S,kind:"attribute",name:se[2],start:B,forms:[["attribute",se[2]]],dynamic:!0});V&&P(B,B+se[2].length,V.to,{tag:S,member:V.from,action:"rewrite-attribute",target:V.to,message:`Rename the ${S} attribute ${V.from} to ${V.to}.`});continue}if(!o.tags.has(S))continue;if(/^\s*\(/.test(e.slice(K,K+64))){let se=o.reviewFor(S,"method",D);se&&_(L,se);continue}let Q=Ot({owner:S,kind:"property",name:D,start:L,forms:[["property",D]],dynamic:!0});Q&&P(L,K,Q.to,{tag:S,member:Q.from,action:"rewrite-property",target:Q.to,message:`Rename the ${S} property ${Q.from} to ${Q.to}.`})}let re=c(v=>o.renamesNamed("event",v).length||o.detailsNamed(v).length||o.retiredEventsNamed(v).length||o.reviewsNamed("event",v).length||o.gainedOwners("event",v).length,"eventNameMatters");for(let v of e.matchAll(/(['"`])(?:(window|document|body):)?(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1/g)){let S=v[3];if(b.has(v.index)||u(v.index)||!re(S))continue;let D=e.slice(Math.max(0,v.index-120),v.index);if(!v[2]&&xp.test(D))continue;let L=Fr.test(D);Se({name:S,start:v.index+1+(v[2]?v[2].length+1:0),owner:null,context:L?"listener":"event name string",rewritable:L,conflict:L&&!v[2]&&N(v.index,S)&&"same-handler"})}let ie=Ip(e,o.tags,u),ye=new Map,Ie=c((v,S)=>ye.set(v,[...ye.get(v)??[],S]),"addAccess");for(let v of o.data.renames)v.kind==="property"&&ie.has(v.tag)&&Ie(v.from,{tag:v.tag,rule:v,call:!1});for(let v of o.data.reviews)(v.kind==="property"||v.kind==="method")&&ie.has(v.tag)&&Ie(v.name,{tag:v.tag,review:v,call:v.kind==="method"});for(let v of o.data.propertyChanges)if(ie.has(v.tag))for(let S of[v.property,...v.former?[v.former]:[]])Ie(S,{tag:v.tag,propertyChange:v,call:!1});if(ye.size){let v=at(Pt(Br(e,u))),S=at(Vr(e,s,u)),D=at(Pt(m.map(L=>[L.start+1,L.end])));for(let L of e.matchAll(/(?<=[\w$)\]])\s*(?:\?\.|!?\.)\s*([A-Za-z_$][\w$]*)/g)){let K=L[1],Q=ye.get(K);if(!Q)continue;let se=L.index+L[0].length-K.length;if(j.has(se)||ke.has(se)||u(se)||v(se)||S(se)||D(se))continue;let B=/^\s*\(/.test(e.slice(se+K.length,se+K.length+64));for(let V of Q){if(V.call!==B)continue;if(V.propertyChange){W(se,V.propertyChange);continue}if(V.review){_(se,V.review);continue}let{rule:oe}=V;M(se,{tag:oe.tag,member:K,code:oe.polarity?jt:Yt,target:oe.to,message:`If this reads or writes an ${oe.tag}, ${oe.polarity?`use the inverse property .${oe.to}`:`rename .${K} to .${oe.to}`}; .${K} has a recorded removal floor of ${E}; check the installed release migration guide.`})}}}for(let v of e.matchAll(/\.\s*(?:set|get|has|remove|toggle)Attribute\s*\(\s*(['"`])([a-z][a-z0-9-]*)\1/g)){let S=v[2],D=v.index+v[0].length-1-S.length;if(!(b.has(D-1)||u(v.index)))for(let L of ie){let K=o.reviewFor(L,"attribute",S);K&&_(D,K);let Q=o.renameFor(L,"attribute",S);Q&&M(D,{tag:L,member:S,code:Q.polarity?jt:Yt,target:Q.to,message:`If this element is an ${L}, ${Q.polarity?`use the inverse attribute ${Q.to}`:`rename ${S} to ${Q.to}`}; ${S} has a recorded removal floor of ${E}; check the installed release migration guide.`})}}if(o.data.defaults.length){let v=new Map([...new Set(o.data.defaults.map(L=>L.tag))].map(L=>[L,{origin:r,tag:L,defaults:o.defaultsFor(L).map(K=>({member:K.attribute,value:K.value}))}])),S=Cs(e,v,l,T.map(({token:L})=>({...L,tag:L.tag.toLowerCase()}))),D=new Set([...n.blockedLocalMigrations??[],...S.blocked]);i.blockedLocalMigrations=S.blocked;for(let L of S.uses)M(L.offset,{tag:L.tag,member:L.tag,code:L.warningCode,target:L.tag,message:L.message});for(let{token:L,owner:K,bound:Q}of T){let se=o.defaultsFor(K).filter(V=>!o.defaultAliasesFor(K,V.attribute).some(oe=>Q.has(oe)));if(!se.length)continue;if(D.has(dn(r,K))){M(L.nameStart,{tag:K,member:K,code:"MAPPING_REVIEW_BLOCKED",target:K,message:`${K} did not receive its Lyra ${o.fromMajor} defaults (${se.map(V=>`${V.attribute}=${String(V.value)}`).join(", ")}) because the scanned target set accesses it through a DOM alias or an opaque attribute spread. Add them by hand where the previous default matters.`});continue}let B=[];for(let V of se)B.push(Ns({member:V.attribute,value:V.value})),i.changes.push(xt({textStarts:a,file:s,offset:L.end,origin:r,upstreamTag:K,upstreamMember:V.attribute,action:"insert-default",target:`${V.attribute}=${String(V.value)}`,message:`Insert ${V.attribute} to preserve the Lyra ${o.fromMajor} default.`}));if(B.length){let V=e[L.end-1]==="/"?L.end-1:L.end,oe=/\s/.test(e[V-1])?`${B.join(" ")} `:` ${B.join(" ")}`;O.push({start:V,end:V,replacement:oe})}}}if(!o.skipped.length)for(let{offset:v,entry:S}of h.unused()){let D=`${v}:${bi}:${S.token}`;q.has(D)||(q.add(D),i.warnings.push(xt({textStarts:a,file:s,offset:v,origin:r,upstreamTag:null,upstreamMember:S.token,action:"manual-review",target:null,warningCode:bi,message:S.code?`The acknowledgement ${S.token} matches no report on the lines it covers; remove it.`:`The acknowledgement ${S.token} is not of the form CODE:name, for example DETAIL_SHAPE_REVIEW:lr-close.`})))}return i.content=Wn(e,O),vi(i.changes,"action"),vi(i.warnings,"warningCode"),i}c(ki,"migrateRenameText");var ft="@aceshooting/lyra-ui",Wp=Object.freeze([["3xs","2xs"],["2xs","xs"],["xs","s"],["s","m"],["m","l"],["l","xl"],["xl","2xl"],["3xl","3xl"],["4xl","4xl"]]),Kp=Object.freeze(["xs","s","m","l","xl"]),Yr=Object.freeze([["xs","xs"],["s","sm"],["m","base"],["l","lg"],["xl","xl"],["2xl","2xl"],["3xl","3xl"],["4xl","4xl"],["5xl","5xl"]]),Oi=Object.freeze(["3xs","2xs","xs","s","m","l","xl","2xl","3xl","4xl","5xl"]),Ti=Object.freeze({"wa-stack":"lr-stack","wa-cluster":"lr-cluster","wa-flank":"lr-flank","wa-flank:start":"lr-flank","wa-flank:end":"lr-flank-end","wa-split":"lr-split","wa-split:row":"lr-split","wa-split:column":"lr-split-column","wa-frame":"lr-frame","wa-frame:square":"lr-frame-square","wa-frame:landscape":"lr-frame-landscape","wa-frame:portrait":"lr-frame-portrait","wa-grid":"lr-grid-auto","wa-span-grid":"lr-span-grid","wa-gap-0":"lr-gap-0",...Object.fromEntries(Wp.map(([e,t])=>[`wa-gap-${e}`,`lr-gap-${t}`])),"wa-align-items-start":"lr-items-start","wa-align-items-center":"lr-items-center","wa-align-items-end":"lr-items-end","wa-align-items-stretch":"lr-items-stretch","wa-align-items-baseline":"lr-items-baseline","wa-align-self-start":"lr-self-start","wa-align-self-center":"lr-self-center","wa-align-self-end":"lr-self-end","wa-align-self-stretch":"lr-self-stretch","wa-justify-content-start":"lr-justify-start","wa-justify-content-center":"lr-justify-center","wa-justify-content-end":"lr-justify-end","wa-justify-content-space-between":"lr-justify-between","wa-justify-content-space-around":"lr-justify-around","wa-flex-wrap":"lr-wrap","wa-flex-nowrap":"lr-nowrap","wa-border-radius-circle":"lr-radius-circle","wa-border-radius-pill":"lr-radius-pill","wa-border-radius-square":"lr-radius-none","wa-text-start":"lr-text-start","wa-text-center":"lr-text-center","wa-text-end":"lr-text-end","wa-text-nowrap":"lr-text-nowrap","wa-text-wrap-nowrap":"lr-text-nowrap","wa-text-truncate":"lr-truncate","wa-text-balance":"lr-text-balance","wa-text-wrap-balance":"lr-text-balance","wa-text-pretty":"lr-text-pretty","wa-text-wrap-pretty":"lr-text-pretty","wa-text-uppercase":"lr-uppercase","wa-text-lowercase":"lr-lowercase","wa-text-capitalize":"lr-capitalize","wa-font-weight-normal":"lr-font-normal","wa-font-weight-semibold":"lr-font-semibold","wa-font-weight-bold":"lr-font-bold","wa-color-text-quiet":"lr-text-quiet","wa-link-plain":"lr-link-plain","wa-list-plain":"lr-list-plain","wa-prose":"lr-prose","wa-visually-hidden":"lr-visually-hidden","wa-cloak":"lr-cloak","wa-placeholder":"lr-placeholder","wa-scroll-lock":"lr-scroll-lock","wa-neutral":"lr-neutral","wa-brand":"lr-brand","wa-success":"lr-success","wa-warning":"lr-warning","wa-danger":"lr-danger",...Object.fromEntries(Kp.map(e=>[`wa-size-${e}`,`lr-size-${e}`])),"wa-dark":"lr-dark","wa-light":"lr-light","sl-theme-dark":"lr-dark","sl-theme-light":"lr-light","sl-scroll-lock":"lr-scroll-lock"}),Ri=Object.freeze({...Object.fromEntries(Yr.map(([e,t])=>[`wa-font-size-${e}`,`lr-text-${t}`])),...Object.fromEntries(Yr.map(([e,t])=>[`wa-body-${e}`,`lr-text-${t}`])),"wa-border-radius-s":"lr-radius-xs","wa-border-radius-m":"lr-radius-m"}),Hr=c((e,t)=>Object.fromEntries(Oi.map(n=>[`wa-${e}-${n}`,t])),"typographyReview"),Ai=Object.freeze({...Hr("heading","lr-heading-1 to lr-heading-6 (levels, not sizes) or lr-text-* with lr-font-semibold"),...Object.fromEntries(Oi.filter(e=>!Yr.some(([t])=>t===e)).flatMap(e=>[[`wa-font-size-${e}`,"lr-text-xs to lr-text-5xl (there is no step this small)"],[`wa-body-${e}`,"lr-text-xs to lr-text-5xl (there is no step this small)"]])),...Hr("caption","lr-text-xs or lr-text-sm with lr-text-quiet"),...Hr("longform","lr-prose, or lr-text-* inside an lr-typography scope"),"wa-gap-2xl":"lr-gap-2xl (2rem) or lr-gap-3xl (3rem); Lyra has no 2.5rem step","wa-gap-5xl":"lr-gap-4xl (4rem); Lyra has no 5rem step","wa-border-radius-l":"lr-radius-container, or set border-radius in your own CSS","wa-align-self-baseline":"no lr-self-baseline; use lr-items-baseline on the parent","wa-justify-content-space-evenly":"no lr-justify-evenly; set justify-content: space-evenly in your own CSS","wa-flex-wrap-reverse":"no equivalent; set flex-wrap: wrap-reverse in your own CSS","wa-text-justify":"no equivalent; set text-align: justify in your own CSS","wa-font-weight-light":"no lr-font-light; lr-font-normal is the lightest utility","wa-color-text-normal":"no equivalent; text colour is inherited from the page","wa-color-text-link":"no equivalent class; links inside .lr-native and .lr-typography are styled, and lr-link-plain removes the styling","wa-link":"no equivalent class; links inside .lr-native and .lr-typography are styled","wa-not-prose":"lr-not-typography leaves an lr-typography scope; lr-prose has no opt-out class","wa-invert":"no equivalent; use lr-dark or lr-light on the scope","wa-visually-hidden-force":"lr-visually-hidden (Lyra applies it without a cascade override)","wa-visually-hidden-hint":"lr-visually-hidden on the hint element","wa-visually-hidden-label":"lr-visually-hidden on the label element","wa-form-control-label":"no equivalent; form controls style their own label part","wa-form-control-hint":"no equivalent; form controls style their own hint part","wa-form-control-value":"no equivalent; form controls style their own value","wa-form-control-placeholder":"no equivalent; form controls style their own placeholder","wa-theme-default":"no class; load @aceshooting/lyra-ui/theme.css (the default theme) once","wa-theme-awesome":"no equivalent theme; see the look and accent stylesheets (looks/*.css, accents.css)","wa-theme-shoelace":"no equivalent theme; see the look and accent stylesheets (looks/*.css, accents.css)","wa-button":"wrap the region in .lr-native, which styles native buttons, or use <lr-button>","wa-filled":"no equivalent; use <lr-button appearance> or a native control inside .lr-native","wa-outlined":"no equivalent; use <lr-button appearance> or a native control inside .lr-native","wa-plain":"no equivalent; use <lr-button appearance> or a native control inside .lr-native","wa-pill":"lr-radius-pill","wa-accent":"no equivalent; use the lr-brand variant class on the scope","wa-valid":"no equivalent; native validity styling comes from .lr-native","wa-invalid":"no equivalent; native validity styling comes from .lr-native","wa-zebra-rows":"no equivalent; style tables in your own CSS or use <lr-table>","wa-hover-rows":"no equivalent; style tables in your own CSS or use <lr-table>","wa-tabular-nums":"no equivalent; set font-variant-numeric: tabular-nums in your own CSS","sl-toast-stack":"no equivalent class; notifications are the <lr-toast> component"}),Up=Object.freeze(["blue","cyan","gray","green","indigo","orange","pink","purple","red","yellow"]),Hp=Object.freeze(["brand","neutral","success","warning","danger"]),Jp="a hue-pinned variant (hue override of a semantic variant) has no class; set the accent with data-lr-accent or the --lr-color-* tokens";function Gp(e){let t=/^wa-(?<variant>[a-z]+)-(?<hue>[a-z]+)$/.exec(e);return!!(t&&Hp.includes(t.groups.variant)&&Up.includes(t.groups.hue))}c(Gp,"isHuePair");var Yp=/^[A-Za-z_][\w:-]*$/;function Ni(e){return Object.hasOwn(Ti,e)?{kind:"exact",target:Ti[e]}:Object.hasOwn(Ri,e)?{kind:"approximate",target:Ri[e]}:Object.hasOwn(Ai,e)?{kind:"review",hint:Ai[e]}:Gp(e)?{kind:"review",hint:Jp}:null}c(Ni,"lookupUpstreamClass");var Zp="#";function Xp(e){let t="";for(let n=0;n<e.length;n+=1){let s=e.startsWith("${",n)||e.startsWith("{{",n)?2:0;if(!s){t+=e[n];continue}let r=s===2&&e[n]==="$"?"}":"}}",o=e.indexOf(r,n+s),i=o===-1?e.length:o+r.length;t+=Zp.repeat(i-n),n=i-1}return t}c(Xp,"maskInterpolations");function Hn(e,t,n){let s=Xp(e);for(let r of s.matchAll(/[^\s]+/g))Yp.test(r[0])&&n.push({token:r[0],start:t+r.index,end:t+r.index+r[0].length})}c(Hn,"tokensOf");function Jn(e,t){let n=e[t];for(let s=t+1;s<e.length;s+=1)if(e[s]==="\\")s+=1;else{if(e[s]===n)return s+1;if(n!=="`"&&(e[s]===`
34
- `||e[s]==="\r"))return-1}return-1}c(Jn,"stringEnd");function Jr(e,t,n,s){for(let r=t;r<n;r+=1){let o=e[r];if(o!=="'"&&o!=='"'&&o!=="`")continue;let i=Jn(e,r);i===-1||i>n||(Hn(e.slice(r+1,i-1),r+1,s),r=i-1)}}c(Jr,"literalTokens");function Gr(e,t){let n={"(":")","{":"}","[":"]"},s=[n[e[t]]];for(let r=t+1;r<e.length;r+=1){let o=e[r];if(o==="'"||o==='"'||o==="`"){let i=Jn(e,r);if(i===-1)return-1;r=i-1}else if(n[o])s.push(n[o]);else if(o===s.at(-1)&&(s.pop(),!s.length))return r}return-1}c(Gr,"closingBracket");function Ci(e,t=()=>!1){let n=[],s=c(a=>{for(let l of a)t(l.start)||n.push(l)},"add"),r=/(?<![\w:@.[\]()-])(?:class|className)\s*=\s*(?<quote>["'])/g;for(let a of e.matchAll(r)){let l=a.index+a[0].length-1,u=e.indexOf(a.groups.quote,l+1);if(u===-1)continue;let m=[];Hn(e.slice(l+1,u),l+1,m),s(m)}let o=/(?<![\w])(?::class|v-bind:class|\[class\]|\[ngClass\]|\[ng-class\]|ng-class|:\[class\]|ngClass)\s*=\s*(?<quote>["'])/g;for(let a of e.matchAll(o)){let l=a.index+a[0].length-1,u=e.indexOf(a.groups.quote,l+1);if(u===-1)continue;let m=[];Jr(e,l+1,u,m),s(m)}for(let a of e.matchAll(/(?<![\w:.-])className\s*=\s*\{/g)){let l=a.index+a[0].length-1,u=Gr(e,l);if(u===-1)continue;let m=[];Jr(e,l+1,u,m),s(m)}for(let a of e.matchAll(/\bclassMap\s*\(/g)){let l=a.index+a[0].length-1,u=Gr(e,l);if(u===-1)continue;let m=[];Jr(e,l+1,u,m),s(m)}for(let a of e.matchAll(/\bclassList\s*(?:\?\.|\.)\s*(?:add|remove|toggle|contains|replace)\s*\(/g)){let l=a.index+a[0].length-1,u=Gr(e,l);if(u===-1)continue;let m=[],h=0;for(let g=l+1;g<u;g+=1){let y=e[g];if(y==="'"||y==='"'||y==="`"){let $=Jn(e,g);if($===-1)break;let w=e.slice(l+1,g).replace(/\s+/g,""),f=w===""||w.endsWith(","),E=e.slice($,u).trimStart();h===0&&f&&(E===""||E.startsWith(","))&&Hn(e.slice(g+1,$-1),g+1,m),g=$-1}else y==="("||y==="["||y==="{"?h+=1:(y===")"||y==="]"||y==="}")&&(h-=1)}s(m)}for(let a of e.matchAll(/\.className\s*\+?=\s*(?<quote>["'`])/g)){let l=a.index+a[0].length-1,u=Jn(e,l);if(u===-1)continue;let m=[];Hn(e.slice(l+1,u-1),l+1,m),s(m)}for(let a of e.matchAll(/\bsetAttribute\s*\(\s*(["'])class\1\s*,\s*(?<quote>["'`])/g)){let l=a.index+a[0].length-1,u=Jn(e,l);if(u===-1)continue;let m=[];Hn(e.slice(l+1,u-1),l+1,m),s(m)}let i=new Set;return n.filter(a=>!i.has(a.start)&&i.add(a.start)).sort((a,l)=>a.start-l.start)}c(Ci,"scanClassTokens");var Qp=Object.freeze([{pattern:/^\/dist\/(?:webawesome|shoelace)\.js$/,kind:"registry"},{pattern:/^\/dist\/webawesome\.loader\.js$/,kind:"loader",targets:[`${ft}/autoloader-cdn.js`]},{pattern:/^\/dist\/shoelace-autoloader\.js$/,kind:"loader",targets:[`${ft}/autoloader-cdn.js`]},{pattern:/^\/dist\/utilities\/base-path(?:\.js)?$/,kind:"none",note:"Lyra resolves no asset base path: icons come from registered icon libraries and translations from registerLyraLocale(), so remove setBasePath() and register those explicitly."},{pattern:/^\/dist\/webawesome\.ssr-loader\.js$/,kind:"none",note:"Lyra server rendering uses @aceshooting/lyra-ui/ssr.js and ssr/all.js; migrate the server entry by hand."},{pattern:/^\/dist\/styles\/webawesome\.css$/,kind:"style",targets:[`${ft}/theme.css`,`${ft}/native.css`,`${ft}/utilities.css`],note:"native.css only styles descendants of an element with the lr-native class; add that class to the regions that relied on the global native styles."},{pattern:/^\/dist\/styles\/native\.css$/,kind:"style",targets:[`${ft}/native.css`],note:"native.css only styles descendants of an element with the lr-native class; add that class to the regions that relied on the global native styles."},{pattern:/^\/dist\/styles\/utilities\.css$/,kind:"style",targets:[`${ft}/utilities.css`]},{pattern:/^\/dist\/styles\/themes\/default\.css$/,kind:"style",targets:[`${ft}/theme.css`]},{pattern:/^\/dist\/themes\/light\.css$/,kind:"style",targets:[`${ft}/theme.css`]},{pattern:/^\/dist\/themes\/dark\.css$/,kind:"style",targets:[`${ft}/theme.css`],note:'Lyra ships one stylesheet for both modes; put lr-dark (or data-lr-mode="dark") where sl-theme-dark was.'},{pattern:/^\/dist\/styles\/layers\.css$/,kind:"none",note:"Lyra stylesheets declare their own cascade layers (lr-base, lr-theme, lr-utilities, lr-overrides); delete this import."},{pattern:/^\/dist\/styles\/themes\/(?:awesome|shoelace)\.css$/,kind:"none",note:"Lyra has no counterpart to this theme; start from theme.css and the looks/*.css and accents.css stylesheets."},{pattern:/^\/dist\/styles\/color\/.+\.css$/,kind:"none",note:"Lyra has no counterpart to this palette stylesheet; see palette.css and accents.css."},{pattern:/^\/dist\/(?:styles|themes)\/.+\.css$/,kind:"none",note:"No Lyra stylesheet is recorded for this file; compare it with theme.css, native.css and utilities.css."}]);function Zr(e){return Qp.find(t=>t.pattern.test(e))??null}c(Zr,"resolveUpstreamAssetRoute");function _i(e,t,n=()=>!1){let s=[...t.packageIdentities.keys()].sort((i,a)=>a.length-i.length).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(`@import\\s+url\\(\\s*(?<quote>['"])(?<package>${s})(?<subpath>\\/[^'"\\s]*)?\\k<quote>\\s*\\)`,"g"),o=[];for(let i of e.matchAll(r)){if(n(i.index))continue;let a=t.packageIdentities.get(i.groups.package),l=e.indexOf(i.groups.quote,i.index),u=`${i.groups.package}${i.groups.subpath??""}`,m=l+1+u.length+1,h=e.indexOf(")",m),g=e.indexOf(";",h),y=e.indexOf(`
35
- `,h),$=y===-1?e.length:y;o.push({sideEffect:!0,kind:"css-import",ecosystem:a.ecosystem,tiers:a.tiers,packageName:i.groups.package,specifier:u,subpath:i.groups.subpath??"",quote:i.groups.quote,start:l+1,end:l+1+u.length,statementEnd:g!==-1&&g<$?g+1:h+1,insertAfter:"css-import"})}return o}c(_i,"scanCssUrlImports");function Xr(e){return!e.subpath||Zr(e.subpath)?.kind==="registry"}c(Xr,"isRegistrationRoot");var Ii=new Set(["wa-animation","sl-animation","wa-animated-image","sl-animated-image"]),Mi=new Set(["wa-icon","sl-icon","sl-icon-button"]);function ji(e){return`${e} does not freeze or snap its animation under prefers-reduced-motion: reduce. The migrated Lyra target respects prefers-reduced-motion by default and does exactly that automatically. Review whether the migrated element should keep animating for users who asked for less motion, or set ignore-reduced-motion to preserve upstream playback under that preference.`}c(ji,"reducedMotionReviewMessage");function Pi(e){return`${e}'s icon-name vocabulary is not bundled with Lyra. The default library includes only add, check, close, search, menu, chevron-left, chevron-right, chevron-down, calendar, command, and trash; any other migrated name renders no glyph. Register the required vocabulary with registerIconLibrary('default', { resolver }) or replace each name explicitly.`}c(Pi,"iconVocabularyReviewMessage");function js(e){return e?e.classification==="warning-required"?"WARNING_REQUIRED":e.classification==="conceptual-only"?"CONCEPTUAL_MAPPING":"UNSUPPORTED_MAPPING":"UNKNOWN_UPSTREAM_TAG"}c(js,"warningCode");function em(e,t,n){let s=new Map,r=c((o,i,a,l,u,m,h)=>{let g=s.get(o.upstreamTag)??{mapping:o,aliases:[],uses:[]};s.has(o.upstreamTag)||s.set(o.upstreamTag,g),g.aliases.some($=>$.tagStart===i)||g.aliases.push({tagStart:i,alias:a});let y=`${l}:${u}:${m}`;g.uses.some($=>$.key===y)||g.uses.push({key:y,offset:l,alias:a,upstreamMember:u,target:m,message:h})},"addUse");for(let o of t.mappings.values()){if(!rt.has(o.classification))continue;let i=o.upstreamTag.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b(?:const|let|var)\\s+(?<alias>[$A-Z_a-z][$\\w]*)\\s*=\\s*(?:document\\.)?querySelector(?:<[^>\\n]+>)?\\(\\s*(['"])${i}\\2\\s*\\)`,"g");for(let l of e.matchAll(a)){if(fe(l.index,n))continue;let u=l.groups.alias,m=l.index+l[0].lastIndexOf(o.upstreamTag),h=l.index+l[0].length,y=`(?<![$\\w])${u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*`;for(let[$,w]of[["methods","(?=\\s*\\()"],["properties","(?=\\s*(?:=|\\.|\\?|;|$))"]])for(let f of o.rewrites[$]){let E=f.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p=new RegExp(`${y}(?<member>${E})${w}`,"g");p.lastIndex=h;for(let A=p.exec(e);A;A=p.exec(e)){let k=A.index+A[0].lastIndexOf(A.groups.member);fe(k,n)||r(o,m,u,k,f.from,f.to,`Aliased ${$} member ${u}.${f.from} must be migrated with its selector.`)}}for(let $ of o.rewrites.events){let w=$.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f=new RegExp(`${y}(?:add|remove)EventListener\\(\\s*(['"])(?<member>${w})\\1`,"g");f.lastIndex=h;for(let E=f.exec(e);E;E=f.exec(e)){let p=E.index+E[0].lastIndexOf(E.groups.member);fe(p,n)||r(o,m,u,p,$.from,$.to,`Aliased event ${u}.${$.from} must be migrated with its selector.`)}}for(let $ of o.rewrites.attributes){let w=$.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f=new RegExp(`${y}(?:get|set|has|toggle|remove)Attribute\\(\\s*(['"])(?<member>${w})\\1`,"g");f.lastIndex=h;for(let E=f.exec(e);E;E=f.exec(e)){let p=E.index+E[0].lastIndexOf(E.groups.member);fe(p,n)||r(o,m,u,p,$.from,$.to,`Aliased attribute ${u}.${$.from} must be migrated with its selector.`)}}}}return s}c(em,"scanAliasedRewriteReviews");function tm(e,t,n){let s=new Map;for(let r of t){if(r.closing)continue;let o=n.mappings.get(r.tag);if(!rt.has(o?.classification))continue;let i=ot(e,r);for(let a of o.rewrites.defaults){if(a.action!=="replace-value")continue;let l=new Set([a.member,Qe(a.member),et(a.member)]),u=i.find(h=>l.has(h.rawName.replace(/^[.?:]/,"")));if(!u||u.valueKind==="boolean"||!qn(u))continue;let m=s.get(o.upstreamTag)??{mapping:o,uses:[]};s.has(o.upstreamTag)||s.set(o.upstreamTag,m),m.uses.push({offset:u.valueStart,upstreamMember:a.member,target:String(a.to),message:`The ${a.member} value is dynamic; migrate ${String(a.from)} to ${String(a.to)} at its source before changing this component mapping.`})}}return s}c(tm,"scanDynamicDefaultReviews");var nm=Object.freeze({"host-layout":"Web Awesome uses display: contents while Lyra uses a block host with a shadow base; review inline placement and host-authored layout CSS.","multi-item-layout":"Lyra owns the simultaneous-item flex/wrap/gap context inside its shadow base instead of leaving it on the host.","unique-retry-bound":"Web Awesome promises non-repeating unique selection while Lyra uses a bounded retry and can eventually repeat.","forwarded-slot-candidates":"Lyra flattens a direct forwarding slot into projected candidates while Web Awesome treats only its direct element child as the candidate.","autoplay-semantics":"Lyra stops autoplay for reduced motion, keeps timer ticks silent, does not pause on hover, and exposes a localized paused control/state/event absent upstream."});function sm(e,t,n,s){let r=new Map,o=ci(t);for(let i of t){if(i.closing||i.tag!=="wa-random-content")continue;let a=s.mappings.get(i.tag);if(!rt.has(a?.classification)||!a.parity.behaviorReviewFlags.length)continue;let l=ot(e,i),u=c(O=>l.find(q=>ui(q)===O),"attribute"),m=o.get(i.start),h=m?li(e,i.end+1,m.start,n):{directTags:[],dynamicDirectContent:!i.selfClosing},g=[];(h.directTags.length>0||h.dynamicDirectContent)&&g.push("host-layout");let $=u("items"),w=$?qn($):!1,f=!$||$.value===null?1:Number($.value);(w||Number.isFinite(f)&&f>1)&&g.push("multi-item-layout");let E=u("mode"),p=E?qn(E):!1,A=Number.isFinite(f)?Math.max(1,Math.trunc(f)):1;(!E||p||E.value==="unique")&&(p||h.dynamicDirectContent||h.directTags.length>A)&&g.push("unique-retry-bound"),(h.directTags.includes("slot")||h.dynamicDirectContent)&&g.push("forwarded-slot-candidates"),u("autoplay")&&g.push("autoplay-semantics");let N=g.filter((O,q)=>a.parity.behaviorReviewFlags.includes(O)&&g.indexOf(O)===q);N.length&&r.set(i.start,{flags:N,message:`Review ${a.upstreamTag} before relying on the migrated behavior: `+N.map(O=>`${O}: ${nm[O]}`).join(" ")})}return r}c(sm,"scanConditionalBehaviorReviews");function Qr(e){return`rewrite-${{attributes:"attribute",properties:"property",events:"event",slots:"slot",parts:"part",cssProperties:"css-property",methods:"method"}[e]}`}c(Qr,"memberAction");function to(e){return typeof e.registrationRoute=="string"?`@aceshooting/lyra-ui/${e.registrationRoute.slice(2)}`:`@aceshooting/lyra-ui/${e.registrationModule.replace(/^src\//,"").replace(/\.ts$/,".js")}`}c(to,"targetImport");function rm(e,t){let n=new Map;for(let o of t??[]){let i=e.mappings.get(o);!i||!rt.has(i.classification)||!i.target||n.set(i.targetTag,i.target)}let s=[...n.values()].some(o=>o.rootIncluded!==!1),r=[...n.values()].filter(o=>o.rootIncluded===!1).map(to).sort();return[...s?["@aceshooting/lyra-ui/all.js"]:[],...r]}c(rm,"registrationClosure");function eo(e,t){let n=e.match(/\/components\/([a-z0-9-]+)\/(?:\1(?:\.component)?|index)\.(?:js|mjs)$/);return n?`${t==="webawesome"?"wa":"sl"}-${n[1]}`:null}c(eo,"deepImportTag");function om(e,t){return!!(t&&(!t.source?.tier||e.tiers.has(t.source.tier)))}c(om,"packageProvidesMapping");function Ps(e){return e?e.rationale||`The ${e.classification} mapping requires manual review.`:"No pinned inventory mapping exists for this upstream tag."}c(Ps,"mappingMessage");function am(e){return e.replace(/^(?:v-bind:|bind:|[.?:])/,"").toLowerCase()}c(am,"localAttributeName");function im(e,t,n){let s=n.file??"<memory>",r=n.origin,o=t.localMigrations.get(r);U(o,`unknown local migration origin ${String(r)}`);let i=Ln(e),a=Gt(e),l=Fn(e,a).filter(w=>o.has(w.tag)),u=Cs(e,o,a,l),m=new Set([...n.blockedLocalMigrations??[],...u.blocked]),h=[],g=[],y=[],$=c((w,f,E,p,A,k=null,N=null)=>xt({textStarts:i,file:s,offset:w,origin:r,upstreamTag:f,upstreamMember:N,action:E,target:p,warningCode:k,message:A}),"entry");for(let w of u.uses)y.push($(w.offset,w.tag,"manual-review",w.tag,w.message,w.warningCode));for(let w of l){let f=o.get(w.tag),E=dn(r,w.tag);if(m.has(E)){y.push($(w.nameStart,w.tag,"manual-review",w.tag,`${w.tag} remains unchanged because the scanned target set contains an aliased or dynamic value requiring review.`,"MAPPING_REVIEW_BLOCKED"));continue}let p=ot(e,w),A=new Set(p.map(N=>am(N.rawName))),k=[];for(let N of f.defaults)A.has(N.member.toLowerCase())||(k.push(Ns(N)),g.push($(w.end,w.tag,"insert-default",`${N.member}=${String(N.value)}`,`Insert ${N.member} to preserve the Lyra ${_r(r)} default.`,null,N.member)));if(k.length>0){let N=e[w.end-1]==="/"?w.end-1:w.end;h.push({start:N,end:N,replacement:` ${k.join(" ")}`})}}return g.sort((w,f)=>w.line-f.line||w.column-f.column||w.action.localeCompare(f.action)),y.sort((w,f)=>w.line-f.line||w.column-f.column||w.warningCode.localeCompare(f.warningCode)),{content:Wn(e,h),changes:g,warnings:y,usage:{webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}},blockedMappings:new Set,blockedEcosystems:new Set,bareImportEcosystems:new Set,blockedLocalMigrations:m}}c(im,"migrateLocalText");function zi(e){let t=[],n=new Set,s=c((a,l,u,m,h,g)=>{let y=`${a}:${m}`;n.has(y)||(n.add(y),t.push({offset:a,upstreamTag:l,member:u,code:m,target:h,message:g}))},"push"),r=/(?<![\w-])(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)(?![\w-])/g;for(let a of e.matchAll(/\bcss`/g)){let l=a.index+a[0].length,u=e.indexOf("`",l);if(u===-1)continue;let m=e.slice(l,u);for(let h of m.matchAll(r)){let g=h.groups.tag;s(l+h.index,g,"css-template","CSS_IN_JS_SELECTOR_REVIEW",g,`\`${g}\` appears in a css\`\` template and was NOT rewritten. A rule keyed on a tag that no longer exists matches nothing, silently. Rename the selector by hand.`)}}for(let a of e.matchAll(/::slotted\(\s*([^)]*)\)/g))for(let l of a[1].matchAll(r)){let u=l.groups.tag;s(a.index+a[0].indexOf(l.groups.tag),u,"::slotted","SLOTTED_SELECTOR_REVIEW",u,`\`::slotted(${u})\` was NOT rewritten and will match nothing after the migration. Rename it by hand.`)}let o=/\bthis(?:\s*\??\.\s*(?:shadowRoot|renderRoot))?\s*\??\.\s*(?:querySelector|querySelectorAll|closest|matches)\s*(?:<[^>\n]+>)?\(\s*(['"`])(?<selector>[^'"`]*)\1/g;for(let a of e.matchAll(o)){let l=a.index+a[0].lastIndexOf(a.groups.selector);for(let u of a.groups.selector.matchAll(r)){let m=u.groups.tag;s(l+u.index,m,"selector-string","SELECTOR_STRING_REVIEW",m,`\`${m}\` appears in a DOM selector string that was NOT rewritten. The query will return null after the migration rather than throwing. Rename it by hand.`)}}let i=new Set([...e.matchAll(/(--(?:wa|sl)-[a-z0-9-]+)\s*:/g)].map(a=>a[1]));for(let a of e.matchAll(/--(?<ecosystem>wa|sl)-[a-z0-9-]+/g)){let l=a[0];i.has(l)||s(a.index,`${a.groups.ecosystem}-tokens`,"custom-property","UPSTREAM_TOKEN_REVIEW",l,`\`${l}\` is an upstream design token with no automatic Lyra equivalent, and was left as-is. A var() naming a token that no longer exists falls back to its second argument, or to nothing -- silently. Map it by hand against llms/tokens.md; note the spacing scales are offset by one step, so renaming by name alone tightens every gap.`)}return t}c(zi,"scanUnrewrittenUpstreamReferences");function hn(e,t,n={}){if(n.origin&&t.renameProfiles?.has(n.origin))return ki(e,t,n);if(n.origin)return im(e,t,n);let s=n.file??"<memory>",r=n.rewriteBarePackages??new Set,o=n.rootRegistrationMappings??new Map,i=Ln(e),a=Gt(e),l=ei(e),u=ti(e,a),m=Fn(e,a),h=oi(e,a,n.domFactoryBindings),g=em(e,t,a),y=tm(e,u,t),$=sm(e,u,a,t),w=[...pi(e,a,t),..._i(e,t,T=>fe(T,a))].sort((T,z)=>T.start-z.start),f=new Set(w.filter(T=>T.sideEffect&&Xr(T)).map(T=>T.packageName)),E=new Set([...n.blockedMappings??[],...g.keys(),...y.keys()]),p=h.flatMap(T=>{if(T.kind!=="construction")return[];let z=t.mappings.get(T.tag),Y=z?.rewrites.defaults.filter(H=>H.action==="insert-if-absent")??[];if(!z||!rt.has(z.classification)||Y.length===0)return[];let F=ai(e,T,Y);return F.safe?[]:(E.add(z.upstreamTag),[{reference:T,mapping:z,defaults:Y,missing:F.missing}])}),A=new Set(n.registrationBlockedMappings??[]),k=new Set(n.blockedEcosystems??[]);for(let T of w){if(T.sideEffect)continue;let z=T.subpath?eo(T.specifier,T.ecosystem):null,Y=z?t.mappings.get(z):null;Y&&rt.has(Y.classification)?E.add(Y.upstreamTag):Xr(T)&&k.add(T.ecosystem)}let N=[],O=[],q=[],b={webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}},j=new Set,d=new Set,x=new Set,I=c((T,z)=>z??(T?.startsWith("wa-")?"webawesome":T?.startsWith("sl-")?"shoelace":null),"reportOrigin"),C=c((T,z,Y,F,H,X,re=null)=>{O.push(xt({textStarts:i,file:s,offset:T,origin:I(z,re),upstreamTag:z,upstreamMember:Y,action:F,target:H,message:X}))},"change"),P=c((T,z,Y,F,H,X,re=null,ie=null)=>{q.push(xt({textStarts:i,file:s,offset:T,origin:I(z,re),upstreamTag:z,upstreamMember:Y,action:"manual-review",target:H,warningCode:F,behaviorReviewFlags:ie,message:X}))},"warn"),M=c((T,z)=>{for(let Y of T.target?.optionalPeers??[]){let F=`${T.targetTag}:${Y}`;x.has(F)||(x.add(F),P(z,T.upstreamTag,"runtime","OPTIONAL_PEER_REQUIRED",Y,`${T.targetTag} requires the optional peer package ${Y}; install a compatible version before relying on the migrated component.`))}},"noteRuntimeRequirements"),R=c((T,z)=>{j.add(T.upstreamTag),M(T,z)},"noteAutomatic"),_=c((T,z,Y,F)=>{N.push({start:T,end:z,replacement:Y}),C(T,F.upstreamTag,F.upstreamMember,F.action,F.target,F.message,F.origin)},"addEdit"),W=c(T=>!!T&&(E.has(T.upstreamTag)||A.has(T.upstreamTag)||k.has(T.upstream)),"isBlocked"),ee=c(T=>rt.has(T?.classification)&&W(T),"isBlockedAutomatic"),ae=c(T=>rt.has(T?.classification)&&!W(T),"isAutomatic"),pe=c(T=>A.has(T.upstreamTag)?`${T.upstreamTag} remains unchanged because the scanned target set does not prove registration for ${T.targetTag}. Include ${to(T.target)} in the scan or migrate the file that owns its supported root registration import.`:`${T.upstreamTag} remains unchanged because the scanned target set contains a use that requires manual member, default, or import review.`,"blockedMessage"),de=c(T=>A.has(T.upstreamTag)?"REGISTRATION_CLOSURE_REQUIRED":"MAPPING_REVIEW_BLOCKED","blockedWarningCode");for(let{mapping:T,uses:z}of g.values())for(let Y of z)P(Y.offset,T.upstreamTag,Y.upstreamMember,"ALIASED_MEMBER_REVIEW",Y.target,Y.message);for(let{mapping:T,uses:z}of y.values())for(let Y of z)P(Y.offset,T.upstreamTag,Y.upstreamMember,"DYNAMIC_VALUE_REVIEW",Y.target,Y.message);for(let{reference:T,mapping:z,defaults:Y,missing:F}of p)P(T.start,z.upstreamTag,null,"IMPERATIVE_DEFAULT_REVIEW",z.targetTag,`${z.upstreamTag} is constructed imperatively and requires explicit migrated defaults (${Y.map(H=>`${H.member}=${String(H.value)}`).join(", ")}); review the created element before renaming this mapping. No unconditional immediate assignment was proven for ${F.map(H=>H.member).join(", ")}.`);let he=[],Ne=new Set;for(let T of u){let z=t.mappings.get(T.tag),Y=Or(T.tag);if(!ae(z)){if(z&&M(z,T.nameStart),T.closing&&Ne.has(T.tag))continue;T.closing||Ne.add(T.tag),b[Y].manual+=1,P(T.nameStart,T.tag,null,ee(z)?de(z):js(z),z?.targetTag??null,ee(z)?pe(z):Ps(z),null,z?.parity?.behaviorReviewFlags);continue}b[Y].automatic+=1,R(z,T.nameStart),_(T.nameStart,T.nameEnd,z.targetTag,{upstreamTag:T.tag,upstreamMember:null,action:"rewrite-tag",target:z.targetTag,message:`Rename ${T.tag} to ${z.targetTag}.`});let F=$.get(T.start);F&&P(T.nameStart,z.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",z.targetTag,F.message,null,F.flags),!T.closing&&Ii.has(T.tag)&&P(T.nameStart,z.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",z.targetTag,ji(z.upstreamTag),null,["reduced-motion-default"]),!T.closing&&Mi.has(T.tag)&&P(T.nameStart,z.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",z.targetTag,Pi(z.upstreamTag),null,["icon-name-vocabulary"]),T.closing||he.push({token:T,mapping:z,attributes:ot(e,T)})}for(let T of h){let z=t.mappings.get(T.tag),Y=Or(T.tag);if(!ae(z)){z&&M(z,T.start),b[Y].manual+=1,P(T.start,T.tag,null,ee(z)?de(z):js(z),z?.targetTag??null,ee(z)?pe(z):Ps(z),null,z?.parity?.behaviorReviewFlags);continue}b[Y].automatic+=1,R(z,T.start),_(T.start,T.end,z.targetTag,{upstreamTag:T.tag,upstreamMember:null,action:"rewrite-tag",target:z.targetTag,message:`Rename ${T.tag} to ${z.targetTag}.`}),Ii.has(T.tag)&&P(T.start,z.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",z.targetTag,ji(z.upstreamTag),null,["reduced-motion-default"]),Mi.has(T.tag)&&P(T.start,z.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",z.targetTag,Pi(z.upstreamTag),null,["icon-name-vocabulary"])}for(let{token:T,mapping:z,attributes:Y}of he){for(let H of Y){let X=ii(H.rawName,z);if(X){if(X.value!==void 0){X.prefix===""&&H.valueKind==="boolean"&&!Y.some(re=>re!==H&&[X.to,`.${X.to}`,`:${X.to}`,`v-bind:${X.to}`].includes(re.rawName))?_(H.nameStart,H.nameEnd,`${X.to}="${X.value}"`,{upstreamTag:z.upstreamTag,upstreamMember:X.from,action:Qr(X.section),target:`${X.to}="${X.value}"`,message:`Rewrite ${X.section} member ${X.from} to ${X.to}="${X.value}".`}):(b[z.upstream].manual+=1,P(H.nameStart,z.upstreamTag,X.from,"DYNAMIC_VALUE_REVIEW",X.to,`${X.from} is a boolean spelling of ${X.to}="${X.value}"; set ${X.to} to "${X.value}" when it is true and leave it unset otherwise.`));continue}_(H.nameStart,H.nameEnd,X.replacement,{upstreamTag:z.upstreamTag,upstreamMember:X.from,action:Qr(X.section),target:X.to,message:`Rewrite ${X.section} member ${X.from} to ${X.to}.`})}}let F=[];for(let H of z.rewrites.defaults){let X=new Set([H.member,Qe(H.member),et(H.member)]),re=Y.find(ie=>X.has(ie.rawName.replace(/^[.?:]/,"")));if(H.action==="insert-if-absent"){if(re)continue;F.push(`${Qe(H.member)}="${String(H.value).replaceAll("&","&amp;").replaceAll('"',"&quot;")}"`),C(T.end,z.upstreamTag,H.member,"insert-default",`${H.member}=${String(H.value)}`,`Insert ${H.member} to preserve the upstream default.`);continue}!re||re.valueKind==="boolean"||(qn(re)?(b[z.upstream].manual+=1,P(re.valueStart,z.upstreamTag,H.member,"DYNAMIC_VALUE_REVIEW",String(H.to),`The ${H.member} value is dynamic; replace ${String(H.from)} with ${String(H.to)} at its source.`)):re.value===String(H.from)&&_(re.valueStart,re.valueEnd,String(H.to),{upstreamTag:z.upstreamTag,upstreamMember:H.member,action:"replace-default",target:String(H.to),message:`Replace ${H.member} value ${String(H.from)} with ${String(H.to)}.`}))}if(F.length){let H=e[T.end-1]==="/"?T.end-1:T.end;N.push({start:H,end:H,replacement:` ${F.join(" ")}`})}}let Se=[],ke=[];for(let T of u)if(!T.closing&&!T.selfClosing)Se.push(T);else if(T.closing)for(let z=Se.length-1;z>=0;z-=1){if(Se[z].tag!==T.tag)continue;let[Y]=Se.splice(z,1);ke.push({opening:Y,closing:T});break}for(let{opening:T,closing:z}of ke){let Y=t.mappings.get(T.tag);if(!(!ae(Y)||!Y.rewrites.slots.length)){for(let F of m)if(!(F.start<=T.end||F.end>=z.start))for(let H of ot(e,F))if(H.rawName==="slot"&&H.valueKind==="literal"){let X=Y.rewrites.slots.find(re=>re.from===H.value);X&&_(H.valueStart,H.valueEnd,X.to,{upstreamTag:Y.upstreamTag,upstreamMember:X.from,action:"rewrite-slot",target:X.to,message:`Rewrite slot ${X.from} to ${X.to}.`})}else{let X=H.rawName.startsWith("v-slot:")?"v-slot:":H.rawName.startsWith("#")?"#":null;if(!X)continue;let re=H.rawName.slice(X.length),ie=Y.rewrites.slots.find(ye=>ye.from===re);ie&&_(H.nameStart,H.nameEnd,`${X}${ie.to}`,{upstreamTag:Y.upstreamTag,upstreamMember:ie.from,action:"rewrite-slot",target:ie.to,message:`Rewrite slot ${ie.from} to ${ie.to}.`})}}}let ut=/(?<selector>[^{}]+)\{(?<body>[^{}]*)\}/g;for(let T of e.matchAll(ut)){if(fe(T.index,a))continue;let z=T.index,Y=T.index+T[0].indexOf(T.groups.body);for(let F of t.mappings.values()){let H=new RegExp(`(?<![a-z0-9-])${F.upstreamTag}(?![a-z0-9-])`,"g"),X=[...T.groups.selector.matchAll(H)].filter(re=>{let ie=z+re.index;if(fe(ie,a))return!1;let ye=Me(e,ie);return ye?fe(ie,l)&&!As(e,ye[0],ie):!0});if(X.length){if(!ae(F)){b[F.upstream].manual+=X.length;for(let re of X){let ie=z+re.index;M(F,ie),P(ie,F.upstreamTag,null,ee(F)?de(F):js(F),F.targetTag,ee(F)?pe(F):Ps(F),null,F?.parity?.behaviorReviewFlags)}continue}for(let re of X){let ie=z+re.index;if(R(F,ie),F.upstreamTag==="wa-random-content"){let ye=["host-layout","multi-item-layout"];P(ie,F.upstreamTag,"selector","BEHAVIOR_REVIEW_REQUIRED",F.targetTag,"Review this selector after migration: Web Awesome lays candidates out through the host, while Lyra uses a block host and owns simultaneous-item flex layout inside its shadow base.",null,ye)}_(ie,ie+F.upstreamTag.length,F.targetTag,{upstreamTag:F.upstreamTag,upstreamMember:null,action:"rewrite-tag",target:F.targetTag,message:`Rename ${F.upstreamTag} selector to ${F.targetTag}.`})}for(let re of F.rewrites.parts){let ie=new RegExp(`(?<=::part\\()${re.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=\\))`,"g");for(let ye of T.groups.selector.matchAll(ie)){let Ie=z+ye.index;fe(Ie,a)||_(Ie,Ie+re.from.length,re.to,{upstreamTag:F.upstreamTag,upstreamMember:re.from,action:"rewrite-part",target:re.to,message:`Rewrite CSS part ${re.from} to ${re.to}.`})}}for(let re of F.rewrites.cssProperties){let ie=new RegExp(`${re.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![a-z0-9-])`,"g");for(let ye of T.groups.body.matchAll(ie)){let Ie=Y+ye.index;fe(Ie,a)||_(Ie,Ie+re.from.length,re.to,{upstreamTag:F.upstreamTag,upstreamMember:re.from,action:"rewrite-css-property",target:re.to,message:`Rewrite CSS custom property ${re.from} to ${re.to}.`})}}}}}for(let T of t.mappings.values()){if(!ae(T))continue;let Y=`(?:document\\.)?querySelector(?:<[^>\\n]+>)?\\(\\s*(['"])${T.upstreamTag.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\1\\s*\\)`;for(let[F,H]of[["methods","(?=\\s*\\()"],["properties","(?=\\s*(?:=|\\.|\\?|;|$))"]])for(let X of T.rewrites[F]){let re=X.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ie=new RegExp(`${Y}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*(?<member>${re})${H}`,"g");for(let ye of e.matchAll(ie)){if(fe(ye.index,a))continue;let Ie=ye[0].lastIndexOf(ye.groups.member),v=ye.index+Ie;if(X.value!==void 0){b[T.upstream].manual+=1,P(v,T.upstreamTag,X.from,"DYNAMIC_VALUE_REVIEW",X.to,`${X.from} is a boolean spelling of ${X.to}="${X.value}"; preserve explicit ${X.to} values and review the boolean expression.`);continue}_(v,v+X.from.length,X.to,{upstreamTag:T.upstreamTag,upstreamMember:X.from,action:Qr(F),target:X.to,message:`Rewrite ${F} member ${X.from} to ${X.to}.`})}}for(let F of T.rewrites.attributes.filter(H=>H.value!==void 0)){let H=F.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`${Y}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*(?:get|set|has|toggle|remove)Attribute\\(\\s*(['"])(?<member>${H})\\2`,"g");for(let re of e.matchAll(X)){if(fe(re.index,a))continue;let ie=re.index+re[0].lastIndexOf(re.groups.member);b[T.upstream].manual+=1,P(ie,T.upstreamTag,F.from,"DYNAMIC_VALUE_REVIEW",F.to,`${F.from} is a boolean spelling of ${F.to}="${F.value}"; review this attribute operation before migrating it.`)}}for(let F of T.rewrites.events){let H=F.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`${Y}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*(?:add|remove)EventListener\\(\\s*(['"])(?<member>${H})\\2`,"g");for(let re of e.matchAll(X)){if(fe(re.index,a))continue;let ie=re[0].lastIndexOf(re.groups.member),ye=re.index+ie;_(ye,ye+F.from.length,F.to,{upstreamTag:T.upstreamTag,upstreamMember:F.from,action:"rewrite-event",target:F.to,message:`Rewrite event ${F.from} to ${F.to}.`})}}}let ze=c((T,z,Y)=>P(T.start,null,"module",Y,null,z.note,T.ecosystem),"reportAsset");for(let T of w){let{ecosystem:z}=T,Y=T.subpath?Zr(T.subpath):null;if(!T.sideEffect&&Y?.kind==="none"){ze(T,Y,"UPSTREAM_ASSET_REVIEW");continue}if(!T.sideEffect){b[z].manual+=1,P(T.start,T.subpath?eo(T.specifier,z):null,"module","IMPORT_BINDING_REVIEW_REQUIRED",null,`The ${T.kind} import has runtime/type bindings whose exported names cannot be inferred safely.`,z);continue}if(Y&&Y.kind!=="registry"){let re=r.has(z)||r.has(T.packageName);if(Y.kind==="none")ze(T,Y,"UPSTREAM_ASSET_REVIEW");else if(Y.kind==="loader"&&!re)P(T.start,null,"module","PACKAGE_IMPORT_BLOCKED",Y.targets[0],`The ${z} autoloader import remains because this scan contains manual uses; the Lyra autoloader registers only migrated tags.`,z);else{_(T.start,T.end,Y.targets[0],{upstreamTag:null,origin:z,upstreamMember:"module",action:"rewrite-import",target:Y.targets[0],message:`Rewrite the ${T.packageName} ${Y.kind==="style"?"stylesheet":"loader"} import to its Lyra counterpart.`});let ie=e.includes(`\r
12
+ `)[0])?.[1];ee(a,"Commit has no tree");let l=new Set;for(let u of n){ee(typeof u.path=="string"&&u.path.split("/").every(y=>y&&y!=="."&&y!=="..")&&!u.path.includes("\\")&&!l.has(u.path),"Invalid or duplicate Git input path"),l.add(u.path);let m=u.path.split("/"),h=a;for(let[y,w]of m.entries()){let E=zo(o(h,"tree")).get(w);ee(E,`Git path is absent: ${u.path}`),y<m.length-1?(ee(E.mode==="40000","Git ancestor is not a tree"),h=E.oid):ee(["100644","100755"].includes(E.mode)&&E.oid===u.gitBlob&&sr("blob",Zt(u.data))===E.oid,`Git source bytes disagree: ${u.path}`)}}return ee(s.size===r.size,"Evidence contains unrelated Git objects"),!0}function Jc(e,t,n){ee(e?.schemaVersion===1&&e.extractorVersion===1&&n?.schemaVersion===1,"Unsupported capture schema"),ee(e.sourceRelease===`lyra-ui@${e.sourceVersion}`&&e.package?.name==="@aceshooting/lyra-ui"&&e.package.version===e.sourceVersion,"Capture release identity mismatch"),ee(/^[a-f0-9]{64}$/u.test(e.package.tarballSha256)&&/^sha512-[A-Za-z0-9+/]{86}==$/u.test(e.package.registryIntegrity),"Invalid published tarball pin");let r=Fm(e.inputs.filter(f=>f.origin==="packed").map(f=>f.path)),s=[...Object.entries(Dm).map(([f,S])=>({origin:"source",role:f,path:`packages/lyra-ui/${S}`})),...Object.entries(r).map(([f,S])=>({origin:"packed",role:f,path:S}))];ee(e.inputs.length>=s.length,"Unexpected evidence input inventory");let o={source:{},packed:{}},i=new Set,a=[];for(let[f,S]of s.entries()){let p=e.inputs[f];ee(["origin","role","path"].every(I=>p[I]===S[I]),"Evidence input inventory changed");let N=n.payloads[p.sha256],T=Zt(N);ee(ie(T)===p.sha256&&T.length===p.bytes,`Evidence bytes disagree: ${p.path}`),i.add(p.sha256);let C=p.path===Kc?yr(T):T;o[p.origin][p.role]=JSON.parse(C.toString("utf8")),p.origin==="source"?a.push({...p,data:N}):ee(p.gitBlob===null,"Packed input unexpectedly has Git identity")}o.source.exportSources=Object.create(null);let l=new Map;for(let f of e.inputs.slice(s.length)){let S=n.payloads[f.sha256],p=Zt(S);if(ee(ie(p)===f.sha256&&p.length===f.bytes,"Extra evidence bytes disagree: "+f.path),f.origin==="source-export"){ee(f.role==="text"&&/^packages\/lyra-ui\/src\/[A-Za-z0-9_./-]+\.(?:ts|css)$/u.test(f.path)&&!f.path.split("/").includes(".."),"Invalid extra source input");let N=f.path.slice(17);ee(!Object.hasOwn(o.source.exportSources,N),"Duplicate export source input"),o.source.exportSources[N]=p.toString("utf8")}else if(f.origin==="source-history")ee(f.role==="history"&&/^packages\/lyra-ui\/scripts\/fixtures\/compatibility-history\/(?:index\.json|[0-9]+\.[0-9]+\.[0-9]+\/(?:capture|facts)\.json|[0-9]+\.[0-9]+\.[0-9]+\/evidence\.json\.gz)$/u.test(f.path)&&!l.has(f.path),"Invalid or duplicate history evidence input"),l.set(f.path,p);else throw new Error("Invalid extra evidence origin");i.add(f.sha256),a.push({...f,data:S})}ee(Object.keys(n.payloads).length===i.size,"Evidence contains unrelated payloads"),Yr({pin:{...e.git,tag:e.sourceRelease},objects:n.gitObjects,inputs:a}),ee(o.packed.packageJson.name===e.package.name&&o.packed.packageJson.version===e.sourceVersion,"Packed package identity mismatch"),ee(JSON.stringify(o.source.manifest)===JSON.stringify(o.packed.manifest),"Published manifest differs from source manifest");let u=new Set,m=o.source.exportSources;o.source.exportSources=new Proxy(m,{get(f,S){return Object.hasOwn(f,S)&&u.add(S),f[S]}});let h=jc(o.source,e.extractorVersion),y="packages/lyra-ui/scripts/fixtures/compatibility-history/",w=y+"index.json",E=null;if(l.size){ee(l.has(w),"Compatibility history evidence has no index");let f=JSON.parse(l.get(w).toString("utf8"));ee(f?.schemaVersion===1&&Array.isArray(f.captures)&&f.captures.length>0&&Array.isArray(f.retirements),"Unsupported source compatibility history"),ee(f.captures.length<=32,"Source compatibility history exceeds the capture limit");let S=new Set([w]),p=[],N=c((I,W)=>{let $=c(k=>{let j=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/u.exec(k);return ee(j,"Invalid compatibility history version"),j.slice(1).map(Number)},"parts"),L=$(I),d=$(W);for(let k=0;k<3;k++)if(L[k]!==d[k])return L[k]-d[k];return 0},"compareVersions"),T=new Set;for(let I of f.captures){ee(I&&typeof I.directory=="string"&&/^[0-9]+\.[0-9]+\.[0-9]+$/u.test(I.directory)&&/^[a-f0-9]{64}$/u.test(I.captureSha256)&&!T.has(I.directory),"Invalid or duplicate source history capture pin"),T.add(I.directory),ee(N(I.directory,e.sourceVersion)<0,"Source history contains a current or future capture");let W=I.directory,$=Object.fromEntries(["capture.json","facts.json","evidence.json.gz"].map(F=>[F,y+W+"/"+F]));for(let F of Object.values($))S.add(F);ee(Object.values($).every(F=>l.has(F)),"Source history capture is incomplete");let L=l.get($["capture.json"]);ee(ie(L)===I.captureSha256,"Source history capture differs from its index pin");let d=JSON.parse(L.toString("utf8"));ee(d.sourceVersion===W,"Source history directory/version mismatch");let k=JSON.parse(l.get($["facts.json"]).toString("utf8")),j=Hc(d,l.get($["evidence.json.gz"])),M=Jc(d,k,j);ee(M.facts.sourceVersion===W,"Validated source history version mismatch"),p.push(M.facts)}ee(S.size===l.size&&[...S].every(I=>l.has(I)),"Source history file inventory differs from its index");let C=[];for(let I of Hr(o.source.metadata,p)){let W=mn(I,{packageJson:o.source.packageJson,readSource:c($=>o.source.exportSources[$],"readSource"),exportDeprecations:o.source.metadata.exportDeprecations});ee(W.status!=="invalid","Cannot inspect historical export "+I.name+": "+(W.findings?.join("; ")??"invalid contract")),W.status==="present"&&C.push({key:Ae(I,"export"),...W})}E=Jr({packageVersion:e.sourceVersion,currentInventory:o.source.inventory,currentExportDeprecations:o.source.metadata.exportDeprecations,currentExportSurface:C,captures:p,retirementIndex:f.retirements})}else{let f=Number(e.sourceVersion.split(".")[0]);ee(f<23,"Published capture requires pinned compatibility history evidence")}let x=En(o.source.renameLedger,o.source.inventory,{exportDeprecations:o.source.metadata.exportDeprecations,compatibilityContext:E,historicalReleaseMajor:Number(e.sourceVersion.split(".")[0])});return ee(JSON.stringify(x)===JSON.stringify(o.packed.migrationContract.lyraRenames),"Packed migration projection differs from published source"),ee(u.size===Object.keys(m).length,"Unrelated export source input"),ee(JSON.stringify(h)===JSON.stringify(t)&&ie(Ne(t))===e.factsSha256,"Published facts differ from exact evidence extraction"),{facts:h,publishedMigration:o.packed.migrationContract,publishedManifest:structuredClone(o.source.manifest)}}function or(e,{readBytes:t=Lm}={}){let n=JSON.parse(t(Mo(e,"capture.json")).toString("utf8")),r=t(Mo(e,"evidence.json.gz")),s=JSON.parse(t(Mo(e,"facts.json")).toString("utf8"));return{capture:n,...Jc(n,s,Hc(n,r))}}function Gc(e,t,n=[]){ee(e?.schemaVersion===1&&Array.isArray(e.releases),"Unsupported policy witness schema");let r=new Map;for(let a of e.releases){if(ee(!r.has(a.sourceRelease)&&a.sourceRelease===`lyra-ui@${a.sourceVersion}`,"Duplicate or invalid policy witness release"),ee(a.input.path==="packages/lyra-ui/scripts/fixtures/component-metadata.json","Invalid policy witness input"),Yr({pin:{...a.git,tag:a.sourceRelease},objects:a.objects,inputs:[a.input,...a.publication?[a.publication.manifest]:[]]}),a.publication){let y=a.publication;ee(/^[a-f0-9]{64}$/u.test(y.tarballSha256)&&/^sha512-[A-Za-z0-9+/]{86}==$/u.test(y.registryIntegrity),"Invalid historical npm pin");let w=JSON.parse(Zt(y.packageJson).toString("utf8"));ee(w.name==="@aceshooting/lyra-ui"&&w.version===a.sourceVersion&&y.manifest.path==="packages/lyra-ui/custom-elements.json"&&ie(Zt(y.manifest.data))===y.manifest.sha256,"Historical publication identity mismatch")}let l=Zt(a.input.data);ee(ie(l)===a.input.sha256,"Policy witness metadata hash mismatch");let u=JSON.parse(l.toString("utf8"));ee(u.schemaVersion===2&&u.history?.current?.version===a.sourceVersion,"Unsupported historical policy schema or identity");let m=[...u.deprecations,...u.exportDeprecations],h=new Map(m.map(y=>[JSON.stringify(y.tag?["member",y.tag,y.kind,y.name]:["export",y.kind,y.module??null,y.name]),y]));ee(h.size===m.length,"Duplicate historical policy identity"),r.set(a.sourceRelease,{witness:a,records:h})}let s=new Set,o=new Set,i=Object.create(null);for(let a of t){let l=a.facts??a,u=l.policyReleaseHistory??[];for(let h of u){let y=r.get(h.tag);ee(y&&y.witness.git.commit===h.sourceCommit&&y.witness.sourceVersion===h.version,`Missing immutable policy witness ${h.tag}`),s.add(h.tag)}let m=Number(l.sourceVersion.split(".")[0]);for(let h of l.records){if(Number(h.policy.removalNotBefore.split(".")[0])!==m+1||Number(h.policy.since.split(".")[0])>=m)continue;let y=JSON.stringify(h.key.scope==="member"?["member",h.key.tag,h.key.kind,h.key.name]:["export",h.key.kind,h.key.module??null,h.key.name]),w=null,E=!1;for(let x of u){let f=r.get(x.tag).records.get(y);if(!f){ee(w===null,`Published notice disappeared during its compatibility window: ${y}`);continue}if(w??=x.version,E||=!!r.get(x.tag).witness.publication,ee(f.since===h.policy.since&&f.removalNotBefore===h.policy.removalNotBefore,`Published policy window changed: ${y}`),JSON.stringify(f)!==JSON.stringify(h.policy)){let S=ie(Ne(f)),p=ie(Ne(h.policy)),N=n.map((C,I)=>({transition:C,index:I})).filter(({transition:C})=>JSON.stringify(C.key)===JSON.stringify(h.key)&&C.fromPolicySha256===S&&C.toPolicySha256===p&&typeof C.rationale=="string"&&C.rationale.trim());ee(N.length===1,`Unreviewed published guidance transition: ${y}`);let T=c(({replacement:C,rationale:I,...W})=>W,"withoutGuidance");ee(JSON.stringify(T(f))===JSON.stringify(T(h.policy))&&f.replacement.kind===h.policy.replacement.kind,`Guidance transition changes policy semantics: ${y}`),o.add(N[0].index)}}ee(E,`No supplied published npm witness before the compatibility major: ${y}`),ee(w&&Number(w.split(".")[0])+2<=Number(h.policy.removalNotBefore.split(".")[0]),`No full later major after observed publication: ${y}`),i[y]=w}}return ee(s.size===r.size&&o.size===n.length,"Unrelated policy witness or transition"),i}var Dm,Vc,Kc,jo,qc,ie,Ne,Zr=ke(()=>{"use strict";gs();Oo();Wr();xn();Dm=Object.freeze({packageJson:"package.json",manifest:"custom-elements.json",metadata:"scripts/fixtures/component-metadata.json",inventory:"scripts/fixtures/component-inventory.json",renameLedger:"scripts/fixtures/lyra-renames.json"}),Vc=Object.freeze({packageJson:"package/package.json",manifest:"package/custom-elements.json",migrationContract:"package/dist/cli/migration-contract.json"}),Kc="package/dist/cli/"+gr;c(Fm,"packedInputsFor");jo=96*1024*1024,qc=/^[a-f0-9]{40}$/u,ie=c(e=>Wc("sha256").update(e).digest("hex"),"sha256"),Ne=c(e=>Buffer.from(`${JSON.stringify(e,null,2)}
13
+ `),"jsonBytes");c(ee,"ensure");c(Zt,"base64");c(Uc,"encodeEvidence");c(gn,"decodeEvidence");c(Hc,"decodeCaptureEvidence");c(sr,"gitObjectId");c(zo,"parseGitTree");c(Yr,"verifyGitEvidence");c(Jc,"validatePublishedCapture");c(or,"readPublishedCaptureSync");c(Gc,"verifyPolicyWitnesses")});function Y(e,t){if(!e)throw new Error(t)}function pr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Wm(e,t){let n=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e):null;return Y(n&&n.length>0&&n.length<=tl,`Invalid or oversized ${t}`),n}function lr(e){return Y(typeof e=="string"&&e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&!/[\u0000-\u001f]/u.test(e)&&e.split("/").every(t=>t&&t!=="."&&t!==".."),"Unsafe evidence path"),e}function Km(e){let t=e.endsWith("/")?e.slice(0,-1):e;return lr(t),e}function rl(e){return Y(typeof e=="string"&&Vm.test(e),`Invalid stable release version: ${String(e)}`),e}function Yc(e,t,n){Y(pr(e),`Invalid ${n} file map`);let r=new Set(t);return Y(Object.keys(e).length===r.size&&Object.keys(e).every(s=>r.has(s)),`${n} input set is incomplete or contains unrelated files`),Object.fromEntries(t.map(s=>[s,Wm(e[s],`${n} file ${s}`).toString("utf8")]))}function Xt(e){return Y(pr(e)&&["module","detailType","field"].every(t=>typeof e[t]=="string"&&e[t].length>0),"Invalid field declaration identity"),lr(e.module),Y(/^[A-Za-z_$][\w$]*$/u.test(e.detailType)&&/^[A-Za-z_$][\w$]*$/u.test(e.field),"Invalid field declaration identity"),JSON.stringify([e.module,e.detailType,e.field])}function Um(e){return Y(pr(e)&&typeof e.tag=="string"&&/^lr-[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(e.tag)&&typeof e.event=="string"&&e.event.startsWith("lr-"),"Invalid event-detail exposure identity"),JSON.stringify([e.tag,e.event,Xt(e.declaration)])}function Gm(e,t){let n=new RegExp(`\\bexport\\s+interface\\s+${t}\\b(?:\\s+extends\\s+[^{]+)?\\s*\\{`,"u").exec(e);Y(n,`Missing exported detail interface ${t}`);let r=n.index+n[0].length,s=1;for(;r<e.length&&s;r++)e[r]==="{"?s++:e[r]==="}"&&s--;return Y(s===0,`Unclosed detail interface ${t}`),e.slice(n.index,r)}function Zc(e,t){let n=new RegExp(`(?<readonly>readonly\\s+)?\\b${t}(?<optional>\\?)?\\s*:\\s*(?<type>[A-Za-z_$][\\w$]*(?:\\s*\\|\\s*[A-Za-z_$][\\w$]*)*)\\s*;`,"gu"),r=[...e.matchAll(n)];Y(r.length===1,`Expected exactly one ${t} field`);let s=r[0].groups,o=e.slice(0,r[0].index),i=o.lastIndexOf("/**"),a=o.lastIndexOf("*/"),l=i>=0&&a>i&&/^\s*$/u.test(o.slice(a+2))?o.slice(i,a+2).trim():null;return{type:s.type.replace(/\s+/gu,""),optional:!!s.optional,readonly:!!s.readonly,notice:l}}function ir(e){return e?.replace(/^\/\*\*|\*\/$/gu,"").replace(/^\s*\*\s?/gmu,"").replace(/\s+/gu," ").trim()??null}function Xc(e,t,n){let r=e[t];Y(typeof r=="string",`Missing declaration evidence ${t}`);let s=Gm(r,n.detailType),o=Zc(s,n.field),i=Zc(s,"expanded");return{deprecated:o,expanded:i}}function Ym(e,t){return e==="equal"?new RegExp(`(?:\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*expanded\\s*:\\s*\\1\\b|\\b${t}\\s*:\\s*expanded\\s*,\\s*expanded(?:\\s*[,}])|\\b${t}\\s*,\\s*expanded\\s*:\\s*${t}\\b|\\bexpanded\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*${t}\\s*:\\s*\\2\\b|\\bexpanded\\s*:\\s*${t}\\s*,\\s*${t}(?:\\s*[,}]))`,"u"):new RegExp(`(?:\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*expanded\\s*:\\s*!\\s*\\1\\b|\\bexpanded\\s*:\\s*!\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*${t}\\s*:\\s*\\2\\b|\\bexpanded\\s*:\\s*([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)?)\\s*,\\s*${t}\\s*:\\s*!\\s*\\3\\b|\\bexpanded\\s*:\\s*!\\s*${t}\\s*,\\s*${t}(?:\\s*[,}])|\\b${t}\\s*,\\s*expanded\\s*:\\s*!\\s*${t}\\b|\\bexpanded\\s*:\\s*${t}\\s*,\\s*${t}\\s*:\\s*!\\s*${t}\\b)`,"u")}function Zm(e){return e.replace(/\s+/gu," ")}function Qc(e,t,n,r){let s=Zm(e);return Y(s.includes(t),`Missing runtime emitter event ${t}`),Y(Ym(r,n).test(s),`Runtime payload does not preserve ${r} ${n}/expanded values for ${t}`),!0}function Do(e,t,n){return new RegExp(`['"]${t}['"]\\s*:\\s*CustomEvent\\s*<\\s*${n}\\s*>`,"u").test(e)}function Qr(e,t){let n=t?.exports?.[`./components/${e}.js`];return Y(pr(n)&&typeof n.default=="string"&&typeof n.types=="string",`Missing public package route for ${e}`),Y(n.default===`./dist/components/${e}.js`&&n.types.startsWith("./dist/"),`Unexpected public route for ${e}`),lr(n.default.slice(2)),lr(n.types.slice(2)),{runtimePath:n.default.slice(7),declarationPath:n.types.slice(7)}}function Bo({sourceRelease:e,sourceVersion:t,packageJson:n,sourceFiles:r,packedFiles:s}){rl(t),Y(e===`lyra-ui@${t}`&&n?.name==="@aceshooting/lyra-ui"&&n?.version===t,"Field-evidence release identity mismatch");let o=Yc(r,ol,"source"),i=[...new Set([...al,...il,...jt.map(([m])=>{let h=Qr(m,n);return h.runtimePath.startsWith("components/")?`package/dist/${h.runtimePath}`:`package/dist/${h.runtimePath}`}),...jt.map(([m])=>`package/dist/${Qr(m,n).declarationPath}`)])].sort(),a=Yc(s,i,"packed");for(let m of Object.keys(a))Y(m.startsWith("package/dist/"),"Packed field evidence must use package dist paths");let l=es.map(m=>{let h=Xr(m.key.module),y=cr(m.key.module.replace(/\.ts$/u,".d.ts")),w=Xc(o,h,m.key),E=Xc(a,y,m.key);for(let x of[w,E]){Y(x.deprecated.type==="boolean"&&x.deprecated.optional===!1,`Deprecated field shape changed: ${Xt(m.key)}`),Y(x.expanded.type==="boolean"&&x.expanded.optional===m.expandedOptional,`Expanded field shape changed: ${Xt(m.key)}`);let f=ir(x.deprecated.notice),S=ir(m.notice);Y(f===S&&/removal not before 23\.0\.0\./u.test(f),`Deprecated field notice changed: ${Xt(m.key)} (expected ${JSON.stringify(S)}, found ${JSON.stringify(f)})`)}return Y(ir(w.deprecated.notice)===ir(E.deprecated.notice),`Source and package field notices disagree: ${Xt(m.key)}`),Y(w.deprecated.readonly===E.deprecated.readonly&&w.expanded.readonly===E.expanded.readonly,`Source and package readonly shape disagree: ${Xt(m.key)}`),{key:m.key,notice:ir(w.deprecated.notice),noticeJSDoc:w.deprecated.notice,noticeFloor:"23.0.0",relation:m.relation,deprecatedField:w.deprecated,expandedField:w.expanded,sourcePath:h,packedDeclarationPath:y,sourceSha256:ie(Buffer.from(o[h])),packedSha256:ie(Buffer.from(a[y]))}}),u=nl.map(([m,h,y,w])=>{let E=es[y],x=Xr(w),f=cr(w.replace(/\.ts$/u,".js")),S=Xm(m),p=jt.find(([_])=>_===m),N=Xr(p[1]),T=Qr(m,n),C=`package/dist/${T.declarationPath}`,I=`package/dist/${T.runtimePath}`,W=cr(p[3].replace(/\.ts$/u,".d.ts")),$=o[S],L=o[N];Y($&&L&&$.includes(`./${p[1].replace(/\.ts$/u,".js")}`),`Source tag alias no longer reaches ${m}`),Y(L.includes(`defineElement('${m.slice(3)}', ${p[2]})`)&&L.includes(`./${p[3].split("/").at(-1).replace(/\.ts$/u,".js")}`),`Source registration route changed for ${m}`);let d=o[x];if(m.startsWith("lr-code-block")){let _=Xr(p[3]);Y(o[_].includes("export type { LyraCodeBlockToggleDetail }")&&o[_].includes("LyraCodeBlockBaseEventMap"),`Code-block type route changed for ${m}`),Y(Do(d,h,E.key.detailType),`Source shared event detail route changed for ${m}/${h}`)}else Y(Do(d,h,E.key.detailType),`Source event detail route changed for ${m}/${h}`);let k=cr(w.replace(/\.ts$/u,".d.ts"));Y(Do(a[k],h,E.key.detailType),`Packed event detail route changed for ${m}/${h}`);let j=`./${p[3].split("/").at(-1).replace(/\.ts$/u,".js")}`;Y(a[C]?.includes(j)&&a[W],`Packed public type route is missing for ${m}: ${C}, expected ${j}, class declaration ${!!a[W]}`);let M=cr(w.replace(/\.ts$/u,".js"));Qc(o[x],h,E.key.field,E.relation),Qc(a[M],h,E.key.field,E.relation);let F=`${Mt}components/${p[1].replace(/\.ts$/u,".js")}`,D=`./${p[1].replace(/\.ts$/u,".js")}`;return Y(a[I]?.includes(D)&&a[F],`Packed registration route is missing for ${m}`),{key:{tag:m,event:h,declaration:E.key},role:h.endsWith("-request")?"request":"settled",emitterPath:w,emitterPackedPath:f,registrationPath:N,tagEntryPath:S,publicRuntimePath:I,publicDeclarationPath:C,relation:E.relation,staticBehaviorEvidence:"source-and-packed-emitter-bytes-only",sourceSha256:ie(Buffer.from(o[x])),packedSha256:ie(Buffer.from(a[f])),tagEntrySha256:ie(Buffer.from($)),registrationSourceSha256:ie(Buffer.from(L)),packedRegistrationSha256:ie(Buffer.from(a[F])),publicRuntimeSha256:ie(Buffer.from(a[I])),publicDeclarationSha256:ie(Buffer.from(a[C]))}});return Y(l.length===10&&u.length===20,"Field evidence inventory count mismatch"),Y(new Set(l.map(m=>Xt(m.key))).size===10,"Duplicate field declaration"),Y(new Set(u.map(m=>Um(m.key))).size===20,"Duplicate field exposure"),{schemaVersion:1,sourceRelease:e,sourceVersion:t,declarations:l,exposures:u}}function cl(e,t){Y(e?.schemaVersion===1&&JSON.stringify(e.requiredReleases)===JSON.stringify(rt)&&Array.isArray(e.attachments),"Unsupported or altered field-evidence index"),Y(e.attachments.length===rt.length,"Field-evidence index is missing a required release");let n=new Map(e.attachments.map(s=>[s.sourceRelease,s.descriptorSha256]));Y(n.size===e.attachments.length&&n.size===rt.length,"Duplicate field-evidence index release"),Y(t.length===rt.length,"Field-evidence attachment set is incomplete");let r=new Map(t.map(({attachment:s,descriptorSha256:o})=>[s.sourceRelease,o??s.descriptorSha256]));return Y(r.size===t.length&&rt.every(s=>r.has(s)&&n.get(s)===r.get(s)),"Field-evidence descriptors disagree with index"),Y([...r.keys()].every(s=>rt.includes(s)),"Unexpected field-evidence release"),!0}function ll({captures:e,attachments:t,requiredReleases:n=rt}){Y(Array.isArray(e)&&Array.isArray(t),"Invalid field continuity inputs"),Y(JSON.stringify(n)===JSON.stringify(rt),"Field continuity release set differs from the approved exact set");let r=new Map(e.map(l=>[l.capture?.sourceRelease??l.sourceRelease,l])),s=new Map(t.map(l=>[l.attachment?.sourceRelease??l.sourceRelease,l]));Y(r.size===e.length&&s.size===t.length,"Duplicate field continuity release"),Y(e.length===n.length&&t.length===n.length,"Field continuity requires every published release witness");let o=[];for(let l of n){let u=r.get(l),m=s.get(l);Y(u&&m,`Missing field continuity release ${l}`);let h=u.capture??u,y=m.attachment??m;Y(y.sourceRelease===h.sourceRelease&&y.sourceVersion===h.sourceVersion,`Field evidence does not bind ordinary capture ${l}`),Y(y.git?.commit===h.git?.commit&&y.git?.tagObject===h.git?.tagObject,`Field source tag differs from ordinary capture ${l}`),Y(y.captureDescriptorSha256===ie(Ne(h)),`Field attachment is not pinned to ordinary capture ${l}`),Y(y.package?.tarballSha256===h.package?.tarballSha256&&y.package?.registryIntegrity===h.package?.registryIntegrity,`Field npm package evidence differs from ordinary capture ${l}`);let w=m.facts??m.verified?.facts;Y(w?.sourceRelease===l&&w.declarations?.length===10&&w.exposures?.length===20,`Incomplete field facts ${l}`),o.push(w)}let i=c(l=>({declarations:l.declarations.map(({key:u,notice:m,noticeFloor:h,relation:y,deprecatedField:w,expandedField:E})=>({key:u,notice:m,noticeFloor:h,relation:y,deprecatedField:w,expandedField:E})),exposures:l.exposures.map(({key:u,role:m,relation:h,publicRuntimePath:y,publicDeclarationPath:w})=>({key:u,role:m,relation:h,publicRuntimePath:y,publicDeclarationPath:w}))}),"shape"),a=JSON.stringify(i(o[0]));return Y(o.slice(1).every(l=>JSON.stringify(i(l))===a),"Nested event-detail field contract changed across published releases"),o.map(l=>({sourceRelease:l.sourceRelease,declarationCount:l.declarations.length,exposureCount:l.exposures.length,observed:!0,facts:structuredClone(l)}))}function Vo({attachment:e,facts:t,evidence:n,evidenceArchiveBytes:r,ordinaryCapture:s,ordinaryCaptureBytes:o,tarMembers:i,packageJson:a}){Y(e?.schemaVersion===1&&e.extractorVersion===1&&n?.schemaVersion===1,"Unsupported field attachment schema"),Y(rt.includes(e.sourceRelease)&&e.sourceRelease===`lyra-ui@${e.sourceVersion}`&&rl(e.sourceVersion)===e.sourceVersion,"Field attachment release identity mismatch"),Y(e.package?.name==="@aceshooting/lyra-ui"&&e.package.version===e.sourceVersion,"Field attachment package identity mismatch"),Y(ar.test(e.package.tarballSha256)&&/^sha512-[A-Za-z0-9+/]{86}==$/u.test(e.package.registryIntegrity),"Invalid field attachment npm proof pins"),Y(Lo.test(e.git?.tagObject)&&Lo.test(e.git?.commit),"Invalid field attachment Git identity"),Y(ar.test(e.captureDescriptorSha256)&&ar.test(e.evidenceArchiveSha256)&&ar.test(e.factsSha256),"Invalid field attachment hash"),Y((Buffer.isBuffer(r)||r instanceof Uint8Array)&&ie(Buffer.from(r))===e.evidenceArchiveSha256,"Field evidence archive hash mismatch"),Y(ie(Ne(s))===e.captureDescriptorSha256,"Field attachment capture descriptor pin mismatch"),Y(s.sourceRelease===e.sourceRelease&&s.sourceVersion===e.sourceVersion&&s.git?.commit===e.git.commit&&s.git?.tagObject===e.git.tagObject,"Field attachment Git release differs from ordinary capture"),Y(JSON.stringify(s.package)===JSON.stringify(e.package),"Field attachment npm identity differs from ordinary capture"),Y(ie(Buffer.from(o))===e.captureDescriptorSha256,"Ordinary capture descriptor bytes mismatch"),Y(Array.isArray(i)&&new Set(i).size===i.length,"Duplicate tar member");let l=i.map(Km);Y(new Set(l.map(S=>S.endsWith("/")?S.slice(0,-1):S)).size===l.length,"Duplicate canonical tar member"),Y(e.tarball?.memberCount===l.length&&ie(Ne(i))===e.tarball.membersSha256,"Field tar member inventory hash mismatch");let u=qo(a);Y(Array.isArray(e.inputs)&&e.inputs.length===u.length&&e.inputs.length<=el,"Field attachment input inventory is incomplete or oversized");let m=new Set(u.map(S=>`${S.origin}:${S.path}`)),h=new Set,y=new Set,w=[],E=Object.create(null),x=Object.create(null);for(let S of e.inputs){Y(pr(S)&&["source","packed"].includes(S.origin)&&["source-declaration","source-runtime","packed-declaration","packed-runtime"].includes(S.role)&&typeof S.path=="string","Invalid field attachment input"),lr(S.path);let p=`${S.origin}:${S.path}`;Y(m.has(p)&&!h.has(p),`Unexpected or duplicate field input ${p}`);let N=u.find(I=>I.origin===S.origin&&I.path===S.path)?.role;Y(S.role===N,`Field input role changed for ${S.path}`),Y(ar.test(S.sha256)&&Number.isSafeInteger(S.bytes)&&S.bytes>=1&&S.bytes<=tl,"Invalid field input hash or byte length");let T=n.payloads?.[S.sha256];Y(typeof T=="string",`Missing field input payload ${S.path}`);let C=Buffer.from(T,"base64");Y(C.toString("base64")===T&&C.length===S.bytes&&ie(C)===S.sha256,`Field input bytes disagree ${S.path}`),S.origin==="source"?(Y(S.path.startsWith(ur)&&Lo.test(S.gitBlob),"Source input has no Git blob identity"),w.push({...S,data:T}),E[S.path]=C):(Y(S.path.startsWith("package/")&&S.gitBlob===null&&l.includes(S.path),"Packed input has no matching tar member"),x[S.path]=C),h.add(p),y.add(S.sha256)}Y(m.size===h.size&&Object.keys(n.payloads).length===y.size,"Field evidence includes missing inputs or unrelated payloads"),Yr({pin:{...e.git,tag:e.sourceRelease},objects:n.gitObjects,inputs:w}),Y(ie(Ne(t))===e.factsSha256,"Field facts hash mismatch");let f=Bo({sourceRelease:e.sourceRelease,sourceVersion:e.sourceVersion,packageJson:a,sourceFiles:E,packedFiles:x});return Y(JSON.stringify(f)===JSON.stringify(t),"Field facts do not match exact source and packed evidence"),{facts:f,verified:!0}}function qo(e){let t=new Set(sl),n=ol.map(i=>({origin:"source",role:t.has(i)?"source-declaration":"source-runtime",path:i})),r=new Set([...al,...il]);for(let[i]of jt){let a=Qr(i,e);r.add(`package/dist/${a.runtimePath}`),r.add(`package/dist/${a.declarationPath}`)}let s=[...r].map(i=>({origin:"packed",role:i.endsWith(".d.ts")?"packed-declaration":"packed-runtime",path:i})),o=[...n,...s].sort((i,a)=>`${i.origin}:${i.path}`.localeCompare(`${a.origin}:${a.path}`));return Y(o.length<=el&&new Set(o.map(i=>`${i.origin}:${i.path}`)).size===o.length,"Invalid field evidence allowlist"),o}var ur,Mt,yn,Bm,Po,Vm,ar,Lo,el,tl,ns,nl,jt,Fo,qm,es,rt,ts,sl,Hm,Jm,ol,al,il,Xm,Xr,cr,Vg,qg,ul=ke(()=>{"use strict";Zr();ur="packages/lyra-ui/",Mt="package/dist/",yn="/** @deprecated Use `expanded`, which carries the same value; removal not before 23.0.0. */",Bm="/** @deprecated Use `expanded`, its inverse; removal not before 23.0.0. */",Po="/** The inverse of `expanded`.\n * @deprecated Read `expanded` instead; removal not before 23.0.0. */",Vm=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u,ar=/^[a-f0-9]{64}$/u,Lo=/^[a-f0-9]{40}$/u,el=96,tl=8*1024*1024,ns=[["layout/details/details.class.ts","LyraDetailsToggleDetail","open","equal",!1,yn],["layout/multi-split/multi-split.class.ts","LyraMultiSplitToggleDetail","open","equal",!1,yn],["layout/navigation-menu-item/navigation-menu-item.class.ts","LyraNavigationMenuToggleDetail","open","equal",!1,yn],["layout/dock-panel/dock-panel.class.ts","LyraDockPanelCollapseChangeDetail","collapsed","inverse",!1,Bm],["layout/app-rail/app-rail-item.class.ts","LyraAppRailItemToggleDetail","open","equal",!1,yn],["layout/app-rail/app-rail.class.ts","LyraAppRailToggleDetail","open","equal",!1,yn],["layout/app-rail-group/app-rail-group.class.ts","LyraAppRailGroupToggleDetail","open","equal",!1,yn],["conversation/thread-list/thread-list.class.ts","ThreadGroupToggleDetail","collapsed","inverse",!0,Po],["conversation/chat-message/chat-message.class.ts","ChatMessageToggleDetail","collapsed","inverse",!1,Po],["conversation/code-block/code-block-shared.ts","LyraCodeBlockToggleDetail","collapsed","inverse",!1,Po]],nl=[["lr-details","lr-toggle",0,"layout/details/details.class.ts"],["lr-multi-split","lr-toggle-request",1,"layout/multi-split/multi-split.class.ts"],["lr-multi-split","lr-toggle",1,"layout/multi-split/multi-split.class.ts"],["lr-navigation-menu-item","lr-toggle",2,"layout/navigation-menu-item/navigation-menu-item.class.ts"],["lr-dock-panel","lr-collapse-request",3,"layout/dock-panel/dock-panel.class.ts"],["lr-dock-panel","lr-collapse-change",3,"layout/dock-panel/dock-panel.class.ts"],["lr-app-rail-item","lr-toggle-request",4,"layout/app-rail/app-rail-item.class.ts"],["lr-app-rail-item","lr-toggle",4,"layout/app-rail/app-rail-item.class.ts"],["lr-app-rail","lr-toggle-request",5,"layout/app-rail/app-rail.class.ts"],["lr-app-rail","lr-toggle",5,"layout/app-rail/app-rail.class.ts"],["lr-app-rail-group","lr-toggle-request",6,"layout/app-rail-group/app-rail-group.class.ts"],["lr-app-rail-group","lr-toggle",6,"layout/app-rail-group/app-rail-group.class.ts"],["lr-thread-list","lr-group-toggle-request",7,"conversation/thread-list/thread-list.class.ts"],["lr-thread-list","lr-group-toggle",7,"conversation/thread-list/thread-list.class.ts"],["lr-chat-message","lr-toggle-request",8,"conversation/chat-message/chat-message.class.ts"],["lr-chat-message","lr-toggle",8,"conversation/chat-message/chat-message.class.ts"],["lr-code-block","lr-toggle-request",9,"conversation/code-block/code-block-base.class.ts"],["lr-code-block","lr-toggle",9,"conversation/code-block/code-block-base.class.ts"],["lr-code-block-core","lr-toggle-request",9,"conversation/code-block/code-block-base.class.ts"],["lr-code-block-core","lr-toggle",9,"conversation/code-block/code-block-base.class.ts"]],jt=[["lr-details","layout/details/details.ts","LyraDetails","layout/details/details.class.ts"],["lr-multi-split","layout/multi-split/multi-split.ts","LyraMultiSplit","layout/multi-split/multi-split.class.ts"],["lr-navigation-menu-item","layout/navigation-menu-item/navigation-menu-item.ts","LyraNavigationMenuItem","layout/navigation-menu-item/navigation-menu-item.class.ts"],["lr-dock-panel","layout/dock-panel/dock-panel.ts","LyraDockPanel","layout/dock-panel/dock-panel.class.ts"],["lr-app-rail-item","layout/app-rail/app-rail-item.ts","LyraAppRailItem","layout/app-rail/app-rail-item.class.ts"],["lr-app-rail","layout/app-rail/app-rail.ts","LyraAppRail","layout/app-rail/app-rail.class.ts"],["lr-app-rail-group","layout/app-rail-group/app-rail-group.ts","LyraAppRailGroup","layout/app-rail-group/app-rail-group.class.ts"],["lr-thread-list","conversation/thread-list/thread-list.ts","LyraThreadList","conversation/thread-list/thread-list.class.ts"],["lr-chat-message","conversation/chat-message/chat-message.ts","LyraChatMessage","conversation/chat-message/chat-message.class.ts"],["lr-code-block","conversation/code-block/code-block.ts","LyraCodeBlock","conversation/code-block/code-block.class.ts"],["lr-code-block-core","conversation/code-block/code-block-core.ts","LyraCodeBlockCore","conversation/code-block/code-block-core.class.ts"]],Fo=["conversation/code-block/code-block-base.class.ts","conversation/code-block/code-block.class.ts","conversation/code-block/code-block-core.class.ts"],qm=c(([e,t,n])=>({module:e,detailType:t,field:n}),"declarationKeyValue"),es=ns.map((e,t)=>({index:t,key:qm(e),relation:e[3],expandedOptional:e[4],notice:e[5]}));c(Y,"ensure");c(pr,"plain");c(Wm,"asBytes");c(lr,"cleanRelativePath");c(Km,"safeTarMember");c(rl,"stable");c(Yc,"parseTextFiles");c(Xt,"fieldDeclarationKey");c(Um,"fieldExposureKey");rt=Object.freeze(["lyra-ui@22.0.0","lyra-ui@22.1.0","lyra-ui@23.0.0"]),ts=c(e=>`${ur}src/components/${e}`,"toSourcePath"),sl=ns.map(([e])=>ts(e)),Hm=Fo.map(ts),Jm=jt.flatMap(([,e,,t])=>{let n=jt.find(r=>r[1]===e)?.[0];return[ts(e),...n?[`${ur}src/components/${n}.ts`]:[],ts(t)]}),ol=[...new Set([...sl,...Hm,...Jm])].sort(),al=[...new Set([...ns.map(([e])=>`${Mt}components/${e.replace(/\.ts$/u,".d.ts")}`),...Fo.map(e=>`${Mt}components/${e.replace(/\.ts$/u,".d.ts")}`)])],il=[...new Set([...ns.filter(([,e])=>e!=="LyraCodeBlockToggleDetail").map(([e])=>`${Mt}components/${e.replace(/\.ts$/u,".js")}`),...Fo.map(e=>`${Mt}components/${e.replace(/\.ts$/u,".js")}`),...jt.map(([,e])=>`${Mt}components/${e.replace(/\.ts$/u,".js")}`),...jt.map(([e])=>`${Mt}components/${e}.js`)])];c(Gm,"findInterface");c(Zc,"propertyShape");c(ir,"normalizedNotice");c(Xc,"extractDeclaration");c(Ym,"relationPattern");c(Zm,"normalizedJs");c(Qc,"hasRuntimeContract");c(Do,"hasEventType");c(Qr,"routeForTag");Xm=c(e=>`${ur}src/components/${e}.ts`,"routeSourcePath"),Xr=c(e=>`${ur}src/components/${e}`,"sourcePackagePath"),cr=c(e=>`${Mt}components/${e}`,"packedPath");c(Bo,"derivePublishedFieldFacts");c(cl,"validateFieldEvidenceIndex");c(ll,"verifyPublishedFieldContinuity");c(Vo,"validatePublishedFieldAttachment");c(qo,"expectedFieldInputPaths");Vg=Object.freeze(es.map(e=>e.key)),qg=Object.freeze(nl.map(([e,t,n])=>({tag:e,event:t,declaration:es[n].key})))});import{realpathSync as pl}from"node:fs";import{fileURLToPath as Qm}from"node:url";function rs(e,t=process.argv[1]){if(!t)return!1;try{return pl(t)===pl(Qm(e))}catch{return!1}}var Wo=ke(()=>{"use strict";c(rs,"isMainModule")});import{readdirSync as ef}from"node:fs";import{join as tf}from"node:path";function Ko(e){return ef(e,{withFileTypes:!0}).flatMap(t=>{let n=tf(e,t.name);return t.isDirectory()?Ko(n):[n]})}var dl=ke(()=>{"use strict";c(Ko,"walk")});import{createHash as ml}from"node:crypto";import{relative as nf,resolve as rf}from"node:path";function sf(e,t){let n=rf(t),r=Ko(n),s=ml("sha256");for(let o of r.sort()){let i=nf(n,o);s.update(i).update("\0").update(ml("sha256").update(nt(n,i,{binary:!0}).original).digest())}return`${e}\0${n}\0${s.digest("hex")}`}function fl(e,t=new WeakSet){if(e===null||typeof e!="object"||ArrayBuffer.isView(e)||t.has(e))return e;t.add(e);for(let n of Reflect.ownKeys(e))fl(e[n],t);return Object.freeze(e)}function ss(e,t,n,r){if(r!==void 0&&!Object.isFrozen(r))return n();let s;try{s=sf(e,t)}catch{return n()}Uo.has(s)||Uo.set(s,new Map);let o=Uo.get(s);return o.has(r)||o.set(r,fl(n())),o.get(r)}var Uo,Ho=ke(()=>{"use strict";dl();Gr();Uo=new Map;c(sf,"historyKey");c(fl,"deepFreeze");c(ss,"memoizedHistoryVerification")});import{execFileSync as os}from"node:child_process";import{createHash as of}from"node:crypto";import{existsSync as hl,mkdirSync as gl,readFileSync as zt,renameSync as af,rmSync as cf,statSync as lf,writeFileSync as Jo}from"node:fs";import{dirname as uf,join as Be,resolve as Go}from"node:path";import{parseArgs as pf}from"node:util";function ye(e,t){if(!e)throw new Error(t)}function as(e,t,n=32*1024*1024){return os("git",["-C",e,...t],{maxBuffer:n})}function ff(e){let n=os("tar",["-tzf",Go(e)],{encoding:"utf8",maxBuffer:yl}).replace(/\n$/u,"").split(`
14
+ `);ye(n.length>0&&n.length<=2e4&&new Set(n).size===n.length,"Tarball has duplicate or excessive members");for(let o of n){let i=o.endsWith("/")?o.slice(0,-1):o;ye(typeof i=="string"&&i.length>0&&!i.startsWith("/")&&!i.includes("\\")&&!/[\u0000-\u001f]/u.test(i)&&i.split("/").every(a=>a&&a!=="."&&a!==".."),"Tarball contains an unsafe member path")}let r=os("tar",["-tvzf",Go(e)],{encoding:"utf8",maxBuffer:yl}),s=new Map;for(let o of r.trimEnd().split(`
15
+ `)){let i=o[0],a=o.split(/\s+/u).slice(5).join(" ");a&&s.set(a,i)}return{members:n,types:s}}function hf(e,t,n,r){let s=t,o,i=n.split("/");for(let[l,u]of i.entries()){ye(u&&u!=="."&&u!==".."&&!u.includes("\\"),`Unsafe Git path ${n}`);let m=as(e,["cat-file","tree",s]);r.set(s,{type:"tree",oid:s,data:m.toString("base64")}),o=zo(m).get(u),ye(o,`Missing Git source path ${n}`),l<i.length-1&&(ye(o.mode==="40000",`Git path ancestor is not a tree: ${n}`),s=o.oid)}return ye(["100644","100755"].includes(o.mode),`Git source path is not a regular file: ${n}`),{bytes:as(e,["cat-file","blob",o.oid]),oid:o.oid}}function $l(e,t){let n=zt(Be(e,"evidence.json.gz"));ye(ie(n)===t.capture.evidenceArchiveSha256,"Ordinary capture evidence archive hash mismatch");let r=gn(n),s=t.capture.inputs.find(m=>m.origin==="packed"&&m.role==="packageJson"),o=t.capture.inputs.find(m=>m.origin==="source"&&m.role==="packageJson");ye(s&&o,"Ordinary capture has no package identity inputs");let i=Buffer.from(r.payloads[s.sha256],"base64"),a=Buffer.from(r.payloads[o.sha256],"base64"),l=JSON.parse(i.toString("utf8")),u=JSON.parse(a.toString("utf8"));return ye(l.name===u.name&&l.version===u.version&&JSON.stringify(l.exports)===JSON.stringify(u.exports),"Published package routes differ from pinned source"),l}function gf({repository:e,sourceRelease:t,tagObject:n,commit:r,tarball:s,tarballSha256:o,registryIntegrity:i,ordinaryCaptureDirectory:a,output:l}){ye(/^lyra-ui@(22\.0\.0|22\.1\.0|23\.0\.0)$/u.test(t),"Unsupported field evidence release"),ye(bl.test(n)&&bl.test(r),"Invalid field release Git pins"),ye(typeof o=="string"&&/^[a-f0-9]{64}$/u.test(o)&&mf.test(i),"Invalid field release npm pins"),ye(!hl(l),"Field evidence output already exists; published evidence is immutable");let u=or(a),m=zt(Be(a,"capture.json"));ye(u.capture.sourceRelease===t&&u.capture.git.tagObject===n&&u.capture.git.commit===r,"Field evidence release does not match ordinary capture"),ye(u.capture.package.tarballSha256===o&&u.capture.package.registryIntegrity===i,"Field evidence npm pins do not match ordinary capture");let h=$l(a,u),y=lf(s).size;ye(y>0&&y<=df,"Npm tarball is empty or exceeds the capture limit");let w=zt(s);ye(ie(w)===o&&`sha512-${of("sha512").update(w).digest("base64")}`===i,"Field evidence tarball integrity mismatch");let{members:E,types:x}=ff(s),f=qo(h),S=new Map,p=Object.create(null),N=[],T=as(e,["cat-file","commit",r]),C=as(e,["cat-file","tag",n]);ye(sr("commit",T)===r&&sr("tag",C)===n,"Git tag or commit object hash mismatch"),S.set(r,{type:"commit",oid:r,data:T.toString("base64")}),S.set(n,{type:"tag",oid:n,data:C.toString("base64")});let I=/^tree ([a-f0-9]{40})$/mu.exec(T.toString("utf8"))?.[1];ye(I,"Pinned field release commit has no tree");for(let D of f){let O,_=null;if(D.origin==="source"){let Z=hf(e,I,D.path,S);O=Z.bytes,_=Z.oid}else ye(E.filter(Z=>Z===D.path).length===1&&x.get(D.path)==="-",`Missing, duplicate, or non-file npm member ${D.path}`),O=os("tar",["-xOzf",Go(s),"--",D.path],{maxBuffer:8*1024*1024});ye(O.length>0&&O.length<=8*1024*1024,`Field evidence input exceeds member limit: ${D.path}`);let K=ie(O);p[K]=O.toString("base64"),N.push({...D,sha256:K,bytes:O.length,gitBlob:_})}let W=Object.create(null),$=Object.create(null);for(let D of N){let O=Buffer.from(p[D.sha256],"base64");(D.origin==="source"?W:$)[D.path]=O}let L=Bo({sourceRelease:t,sourceVersion:u.capture.sourceVersion,packageJson:h,sourceFiles:W,packedFiles:$}),d={schemaVersion:1,payloads:p,gitObjects:[...S.values()],tarMembers:[...E].sort()},k=Uc(d);ye(k.length<=wl,"Field evidence archive exceeds size limit");let j={schemaVersion:1,sourceRelease:t,sourceVersion:u.capture.sourceVersion,git:{tagObject:n,commit:r},captureDescriptorSha256:ie(m),package:{...u.capture.package},extractorVersion:1,inputs:N,tarball:{memberCount:E.length,membersSha256:ie(Ne([...E].sort()))},evidenceArchiveSha256:ie(k),factsSha256:ie(Ne(L))},M=ie(Ne(j));Vo({attachment:j,facts:L,evidence:d,evidenceArchiveBytes:k,ordinaryCapture:u.capture,ordinaryCaptureBytes:m,tarMembers:d.tarMembers,packageJson:h}),gl(uf(l),{recursive:!0});let F=`${l}.pending-${process.pid}`;gl(F);try{if(Jo(Be(F,"attachment.json"),Ne(j)),Jo(Be(F,"facts.json"),Ne(L)),Jo(Be(F,"evidence.json.gz"),k),hl(l))throw new Error("Field attachment output appeared during capture");af(F,l)}finally{cf(F,{recursive:!0,force:!0})}return{sourceRelease:t,declarations:L.declarations.length,exposures:L.exposures.length,archiveBytes:k.length,descriptorSha256:M}}function yf(e,t){let n=zt(Be(e,"attachment.json")),r=JSON.parse(n.toString("utf8")),s=zt(Be(e,"evidence.json.gz"));ye(ie(s)===r.evidenceArchiveSha256,"Field evidence archive hash mismatch");let o=gn(s,wl);ye(o.tarMembers?.length===r.tarball?.memberCount&&ie(Ne(o.tarMembers))===r.tarball.membersSha256,"Field tar member inventory mismatch");let i=JSON.parse(zt(Be(e,"facts.json"),"utf8")),a=or(t),l=zt(Be(t,"capture.json")),u=$l(t,a),m=Vo({attachment:r,facts:i,evidence:o,evidenceArchiveBytes:s,ordinaryCapture:a.capture,ordinaryCaptureBytes:l,tarMembers:o.tarMembers,packageJson:u});return{attachment:r,facts:m.facts,evidence:o,descriptorSha256:ie(n),verified:!0}}function bf(e,t){let n=JSON.parse(zt(Be(e,"index.json"),"utf8"));return cl(n,t),n}function vl(e,{captures:t}={}){return ye(Array.isArray(t),"Published field history requires ordinary captures"),ss("published-field-history",e,()=>wf(e,t),t)}function wf(e,t){let n=Be(e,"field-evidence"),r=rt.map(i=>{let a=i.slice(8);return yf(Be(n,a),Be(e,a))}),s=bf(n,r),o=ll({captures:t,attachments:r});return{captures:t,attachments:r,index:s,continuity:o}}var yl,wl,df,bl,mf,El=ke(()=>{"use strict";Zr();ul();Wo();Ho();yl=8*1024*1024,wl=16*1024*1024,df=64*1024*1024,bl=/^[a-f0-9]{40}$/u,mf=/^sha512-[A-Za-z0-9+/]{86}==$/u;c(ye,"ensure");c(as,"git");c(ff,"regularTarMembers");c(hf,"gitTreePath");c($l,"packageJsonFromCapture");c(gf,"capturePublishedFieldCompatibility");c(yf,"readPublishedFieldAttachmentSync");c(bf,"readFieldEvidenceIndex");c(vl,"checkPublishedFieldHistorySync");c(wf,"verifyPublishedFieldHistory");if(rs(import.meta.url)){let{values:e}=pf({options:Object.fromEntries(["repository","release","tag-object","commit","tarball","tarball-sha256","registry-integrity","capture-dir","output"].map(n=>[n,{type:"string"}]))});ye(Object.keys(e).length===9,"All field capture arguments are required");let t=gf({repository:e.repository,sourceRelease:e.release,tagObject:e["tag-object"],commit:e.commit,tarball:e.tarball,tarballSha256:e["tarball-sha256"],registryIntegrity:e["registry-integrity"],ordinaryCaptureDirectory:e["capture-dir"],output:e.output});console.log(JSON.stringify(t,null,2))}});var Rl={};ra(Rl,{checkPublishedCompatibility:()=>Sf,checkPublishedCompatibilitySync:()=>Zo,readCurrentCompatibilityContext:()=>Tl,readCurrentCompatibilityContextSync:()=>kl});import{existsSync as Yo,readdirSync as $f,readFileSync as bn}from"node:fs";import{dirname as xl,join as je,resolve as vf,relative as Ef}from"node:path";import{fileURLToPath as Sl}from"node:url";function Zo(e=je(xl(Sl(import.meta.url)),"fixtures/compatibility-history")){return e=vf(e),ss("published-compatibility",e,()=>xf(e))}function xf(e){let t=new Map,n=c(u=>(t.has(u)||t.set(u,nt(e,Ef(e,u),{binary:!0})),t.get(u).original),"readBytes"),r=JSON.parse(n(je(e,"index.json")).toString("utf8"));if(r.schemaVersion!==1||!Array.isArray(r.captures)||r.captures.length===0||!Array.isArray(r.retirements))throw new Error("Unsupported compatibility index");let s=new Set,o=[];for(let u of r.captures){if(!/^\d+\.\d+\.\d+$/u.test(u.directory)||s.has(u.directory))throw new Error("Invalid or duplicate capture directory");s.add(u.directory);let m=je(e,u.directory);if(ie(n(je(m,"capture.json")))!==u.captureSha256)throw new Error("Capture descriptor differs from reviewed index pin");let h=or(m,{readBytes:n});if(h.capture.sourceVersion!==u.directory)throw new Error("Capture directory identity mismatch");o.push(h)}if(r.policyWitnesses?.file!=="policy-witnesses.json.gz"||!Array.isArray(r.guidanceTransitions))throw new Error("Missing policy publication witnesses");let i=n(je(e,r.policyWitnesses.file));if(ie(i)!==r.policyWitnesses.sha256)throw new Error("Policy witness archive differs from reviewed pin");let a=Gc(gn(i),o,r.guidanceTransitions),l=[];for(let{capture:u,facts:m,publishedManifest:h}of o){let y=new Map;for(let w of h.modules??[])for(let E of w.declarations??[])if(!(E.kind!=="class"||!E.customElement||!E.tagName)){if(y.has(E.tagName))throw new Error("Ambiguous published component declaration");y.set(E.tagName,{module:w.path,name:E.name,tag:E.tagName})}for(let{key:w,policy:E}of m.records){if(w.scope!=="member"||E.kind!=="component"||E.replacement?.kind!=="component")continue;let x=y.get(E.tag),f=y.get(E.replacement.name);if(!x||!f||E.name!==E.tag)throw new Error("Published component alias has no exact declaration identity");l.push({sourceRelease:u.sourceRelease,policy:structuredClone(E),source:x,replacement:f})}}return{captures:o,retirements:r.retirements,observedPublication:a,classAliases:l,snapshots:[...t.values()]}}function kl(e=je(xl(Sl(import.meta.url)),".."),t=null){let n=hn(Io(e)),r=JSON.parse(bn(je(e,"package.json"),"utf8")),s=t??JSON.parse(bn(je(e,"scripts/fixtures/component-inventory.json"),"utf8")),o=Zo(je(e,"scripts/fixtures/compatibility-history"));Oc(r.version,"24.0.0")>=0&&vl(je(e,"scripts/fixtures/compatibility-history"),{captures:o.captures});let i=Hr(n,o.captures.map(S=>S.facts)),a=new Map,l=c(S=>(a.has(S)||a.set(S,bn(je(e,S),"utf8")),a.get(S)),"readSource"),u=[];for(let S of i){let p=mn(S,{packageJson:r,readSource:l,exportDeprecations:n.exportDeprecations});if(p.status==="invalid")throw new Error(`Cannot inspect ${S.name}: ${p.findings.join("; ")}`);p.status==="present"&&u.push({key:Ae(S,"export"),...p})}let m=Object.create(null);for(let S of s.components){let p=`./components/${S.tag}.js`,N=r.exports?.[p];(typeof N=="string"?N:N?.default)===`./dist/components/${S.tag}.js`&&(m[S.tag]=p)}let h=je(e,"scripts/fixtures/compatibility-history/retirements-30.0.0.json"),y=Yo(h)?JSON.parse(bn(h,"utf8")):null,w=je(e,"scripts/fixtures/compatibility-history/successors-32.0.0.json"),E=Yo(w)?JSON.parse(bn(w,"utf8")):null;if(E&&(E.schemaVersion!==1||!Array.isArray(E.successors)))throw new Error("Unsupported direct successor list");let x=je(e,"../../.changeset"),f=r.version;return Yo(x)&&$f(x).some(p=>p.endsWith(".md")&&p!=="README.md"&&/^---\n[\s\S]*?['"]@aceshooting\/lyra-ui['"]:\s*major\b[\s\S]*?\n---/u.test(bn(je(x,p),"utf8")))&&(f=`${Number(r.version.split(".")[0])+1}.0.0`),Jr({packageVersion:r.version,releaseVersion:f,successors:[...y?.successors??[],...E?.successors??[]],currentInventory:s,currentExportDeprecations:n.exportDeprecations,currentExportSurface:u,componentRegistrationRoutes:m,captures:[...o.captures.map(S=>S.facts),...y?[y.capture]:[]],retirementIndex:[...o.retirements,...y?y.retirements:[]]})}async function Sf(e){return Zo(e)}async function Tl(e,t){return kl(e,t)}var Al=ke(async()=>{"use strict";Oo();Co();Wr();El();Zr();Wo();Ho();Gr();c(Zo,"checkPublishedCompatibilitySync");c(xf,"verifyPublishedCompatibility");c(kl,"readCurrentCompatibilityContextSync");c(Sf,"checkPublishedCompatibility");c(Tl,"readCurrentCompatibilityContext");if(rs(import.meta.url)){let e=await Tl();console.log(`Verified immutable published compatibility and ${Object.keys(e.records).length} current/retired policy records.`)}});xn();import _e from"node:fs";import Ee from"node:path";import{fileURLToPath as _l}from"node:url";gs();import jn from"node:fs";var Oe="@aceshooting/lyra-ui",pu=Object.freeze([["3xs","2xs"],["2xs","xs"],["xs","s"],["s","m"],["m","l"],["l","xl"],["xl","2xl"],["3xl","3xl"],["4xl","4xl"]]),du=Object.freeze(["xs","s","m","l","xl"]),Es=Object.freeze([["xs","xs"],["s","sm"],["m","base"],["l","lg"],["xl","xl"],["2xl","2xl"],["3xl","3xl"],["4xl","4xl"],["5xl","5xl"]]),Sa=Object.freeze(["3xs","2xs","xs","s","m","l","xl","2xl","3xl","4xl","5xl"]),$a=Object.freeze({"wa-stack":"lr-stack","wa-cluster":"lr-cluster","wa-flank":"lr-flank","wa-flank:start":"lr-flank","wa-flank:end":"lr-flank-end","wa-split":"lr-split","wa-split:row":"lr-split","wa-split:column":"lr-split-column","wa-frame":"lr-frame","wa-frame:square":"lr-frame-square","wa-frame:landscape":"lr-frame-landscape","wa-frame:portrait":"lr-frame-portrait","wa-grid":"lr-grid-auto","wa-span-grid":"lr-span-grid","wa-gap-0":"lr-gap-0",...Object.fromEntries(pu.map(([e,t])=>[`wa-gap-${e}`,`lr-gap-${t}`])),"wa-align-items-start":"lr-items-start","wa-align-items-center":"lr-items-center","wa-align-items-end":"lr-items-end","wa-align-items-stretch":"lr-items-stretch","wa-align-items-baseline":"lr-items-baseline","wa-align-self-baseline":"lr-self-baseline","wa-justify-content-space-evenly":"lr-justify-evenly","wa-flex-wrap-reverse":"lr-wrap-reverse","wa-text-justify":"lr-text-justify","wa-font-weight-light":"lr-font-light","wa-tabular-nums":"lr-tabular-nums","wa-zebra-rows":"lr-zebra-rows","wa-hover-rows":"lr-hover-rows","wa-align-self-start":"lr-self-start","wa-align-self-center":"lr-self-center","wa-align-self-end":"lr-self-end","wa-align-self-stretch":"lr-self-stretch","wa-justify-content-start":"lr-justify-start","wa-justify-content-center":"lr-justify-center","wa-justify-content-end":"lr-justify-end","wa-justify-content-space-between":"lr-justify-between","wa-justify-content-space-around":"lr-justify-around","wa-flex-wrap":"lr-wrap","wa-flex-nowrap":"lr-nowrap","wa-border-radius-circle":"lr-radius-circle","wa-border-radius-pill":"lr-radius-pill","wa-border-radius-square":"lr-radius-none","wa-text-start":"lr-text-start","wa-text-center":"lr-text-center","wa-text-end":"lr-text-end","wa-text-nowrap":"lr-text-nowrap","wa-text-wrap-nowrap":"lr-text-nowrap","wa-text-truncate":"lr-truncate","wa-text-balance":"lr-text-balance","wa-text-wrap-balance":"lr-text-balance","wa-text-pretty":"lr-text-pretty","wa-text-wrap-pretty":"lr-text-pretty","wa-text-uppercase":"lr-uppercase","wa-text-lowercase":"lr-lowercase","wa-text-capitalize":"lr-capitalize","wa-font-weight-normal":"lr-font-normal","wa-font-weight-semibold":"lr-font-semibold","wa-font-weight-bold":"lr-font-bold","wa-color-text-quiet":"lr-text-quiet","wa-link-plain":"lr-link-plain","wa-list-plain":"lr-list-plain","wa-prose":"lr-prose","wa-visually-hidden":"lr-visually-hidden","wa-cloak":"lr-cloak","wa-placeholder":"lr-placeholder","wa-scroll-lock":"lr-scroll-lock","wa-neutral":"lr-neutral","wa-brand":"lr-brand","wa-success":"lr-success","wa-warning":"lr-warning","wa-danger":"lr-danger",...Object.fromEntries(du.map(e=>[`wa-size-${e}`,`lr-size-${e}`])),"wa-button":"lr-button","wa-accent":"lr-accent","wa-filled":"lr-filled","wa-outlined":"lr-outlined","wa-plain":"lr-plain","wa-pill":"lr-radius-pill","wa-dark":"lr-dark","wa-light":"lr-light","sl-theme-dark":"lr-dark","sl-theme-light":"lr-light","sl-scroll-lock":"lr-scroll-lock"}),va=Object.freeze({...Object.fromEntries(Es.map(([e,t])=>[`wa-font-size-${e}`,`lr-text-${t}`])),...Object.fromEntries(Es.map(([e,t])=>[`wa-body-${e}`,`lr-text-${t}`])),"wa-border-radius-s":"lr-radius-xs","wa-border-radius-m":"lr-radius-m"}),ys=c((e,t)=>Object.fromEntries(Sa.map(n=>[`wa-${e}-${n}`,t])),"typographyReview"),Ea=Object.freeze({...ys("heading","lr-heading-1 to lr-heading-6 (levels, not sizes) or lr-text-* with lr-font-semibold"),...Object.fromEntries(Sa.filter(e=>!Es.some(([t])=>t===e)).flatMap(e=>[[`wa-font-size-${e}`,"lr-text-xs to lr-text-5xl (there is no step this small)"],[`wa-body-${e}`,"lr-text-xs to lr-text-5xl (there is no step this small)"]])),...ys("caption","lr-text-xs or lr-text-sm with lr-text-quiet"),...ys("longform","lr-prose, or lr-text-* inside an lr-typography scope"),"wa-gap-2xl":"lr-gap-2xl (2rem) or lr-gap-3xl (3rem); Lyra has no 2.5rem step","wa-gap-5xl":"lr-gap-4xl (4rem); Lyra has no 5rem step","wa-border-radius-l":"lr-radius-container, or set border-radius in your own CSS","wa-color-text-normal":"no equivalent; text colour is inherited from the page","wa-color-text-link":"no equivalent class; links inside .lr-native and .lr-typography are styled, and lr-link-plain removes the styling","wa-link":"no equivalent class; links inside .lr-native and .lr-typography are styled","wa-not-prose":"lr-not-typography leaves an lr-typography scope; lr-prose has no opt-out class","wa-invert":"no equivalent; use lr-dark or lr-light on the scope","wa-visually-hidden-force":"lr-visually-hidden (Lyra applies it without a cascade override)","wa-visually-hidden-hint":"lr-visually-hidden on the hint element","wa-visually-hidden-label":"lr-visually-hidden on the label element","wa-form-control-label":"no equivalent; form controls style their own label part","wa-form-control-hint":"no equivalent; form controls style their own hint part","wa-form-control-value":"no equivalent; form controls style their own value","wa-form-control-placeholder":"no equivalent; form controls style their own placeholder","wa-theme-default":"no class; load @aceshooting/lyra-ui/theme.css (the default theme) once","wa-theme-awesome":"no equivalent theme; see the look and accent stylesheets (looks/*.css, accents.css)","wa-theme-shoelace":"no equivalent theme; see the look and accent stylesheets (looks/*.css, accents.css)","wa-valid":"no equivalent; native validity styling comes from .lr-native","wa-invalid":"no equivalent; native validity styling comes from .lr-native","sl-toast-stack":"no equivalent class; notifications are the <lr-toast> component"}),mu=Object.freeze(["blue","cyan","gray","green","indigo","orange","pink","purple","red","yellow"]),fu=Object.freeze(["brand","neutral","success","warning","danger"]),hu="a hue-pinned variant (hue override of a semantic variant) has no class; set the accent with data-lr-accent or the --lr-color-* tokens";function gu(e){let t=/^wa-(?<variant>[a-z]+)-(?<hue>[a-z]+)$/.exec(e);return!!(t&&fu.includes(t.groups.variant)&&mu.includes(t.groups.hue))}c(gu,"isHuePair");var yu=/^[A-Za-z_][\w:-]*$/;function ka(e){return Object.hasOwn($a,e)?{kind:"exact",target:$a[e]}:Object.hasOwn(va,e)?{kind:"approximate",target:va[e]}:Object.hasOwn(Ea,e)?{kind:"review",hint:Ea[e]}:gu(e)?{kind:"review",hint:hu}:null}c(ka,"lookupUpstreamClass");var bu="#";function wu(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.startsWith("${",n)||e.startsWith("{{",n)?2:0;if(!r){t+=e[n];continue}let s=r===2&&e[n]==="$"?"}":"}}",o=e.indexOf(s,n+r),i=o===-1?e.length:o+s.length;t+=bu.repeat(i-n),n=i-1}return t}c(wu,"maskInterpolations");function kn(e,t,n){let r=wu(e);for(let s of r.matchAll(/[^\s]+/g))yu.test(s[0])&&n.push({token:s[0],start:t+s.index,end:t+s.index+s[0].length})}c(kn,"tokensOf");function Tn(e,t){let n=e[t];for(let r=t+1;r<e.length;r+=1)if(e[r]==="\\")r+=1;else{if(e[r]===n)return r+1;if(n!=="`"&&(e[r]===`
16
+ `||e[r]==="\r"))return-1}return-1}c(Tn,"stringEnd");function bs(e,t,n,r){for(let s=t;s<n;s+=1){let o=e[s];if(o!=="'"&&o!=='"'&&o!=="`")continue;let i=Tn(e,s);i===-1||i>n||(kn(e.slice(s+1,i-1),s+1,r),s=i-1)}}c(bs,"literalTokens");function ws(e,t){let n={"(":")","{":"}","[":"]"},r=[n[e[t]]];for(let s=t+1;s<e.length;s+=1){let o=e[s];if(o==="'"||o==='"'||o==="`"){let i=Tn(e,s);if(i===-1)return-1;s=i-1}else if(n[o])r.push(n[o]);else if(o===r.at(-1)&&(r.pop(),!r.length))return s}return-1}c(ws,"closingBracket");function Ta(e,t=()=>!1){let n=[],r=c(a=>{for(let l of a)t(l.start)||n.push(l)},"add"),s=/(?<![\w:@.[\]()-])(?:class|className)\s*=\s*(?<quote>["'])/g;for(let a of e.matchAll(s)){let l=a.index+a[0].length-1,u=e.indexOf(a.groups.quote,l+1);if(u===-1)continue;let m=[];kn(e.slice(l+1,u),l+1,m),r(m)}let o=/(?<![\w])(?::class|v-bind:class|\[class\]|\[ngClass\]|\[ng-class\]|ng-class|:\[class\]|ngClass)\s*=\s*(?<quote>["'])/g;for(let a of e.matchAll(o)){let l=a.index+a[0].length-1,u=e.indexOf(a.groups.quote,l+1);if(u===-1)continue;let m=[];bs(e,l+1,u,m),r(m)}for(let a of e.matchAll(/(?<![\w:.-])className\s*=\s*\{/g)){let l=a.index+a[0].length-1,u=ws(e,l);if(u===-1)continue;let m=[];bs(e,l+1,u,m),r(m)}for(let a of e.matchAll(/\bclassMap\s*\(/g)){let l=a.index+a[0].length-1,u=ws(e,l);if(u===-1)continue;let m=[];bs(e,l+1,u,m),r(m)}for(let a of e.matchAll(/\bclassList\s*(?:\?\.|\.)\s*(?:add|remove|toggle|contains|replace)\s*\(/g)){let l=a.index+a[0].length-1,u=ws(e,l);if(u===-1)continue;let m=[],h=0;for(let y=l+1;y<u;y+=1){let w=e[y];if(w==="'"||w==='"'||w==="`"){let E=Tn(e,y);if(E===-1)break;let x=e.slice(l+1,y).replace(/\s+/g,""),f=x===""||x.endsWith(","),S=e.slice(E,u).trimStart();h===0&&f&&(S===""||S.startsWith(","))&&kn(e.slice(y+1,E-1),y+1,m),y=E-1}else w==="("||w==="["||w==="{"?h+=1:(w===")"||w==="]"||w==="}")&&(h-=1)}r(m)}for(let a of e.matchAll(/\.className\s*\+?=\s*(?<quote>["'`])/g)){let l=a.index+a[0].length-1,u=Tn(e,l);if(u===-1)continue;let m=[];kn(e.slice(l+1,u-1),l+1,m),r(m)}for(let a of e.matchAll(/\bsetAttribute\s*\(\s*(["'])class\1\s*,\s*(?<quote>["'`])/g)){let l=a.index+a[0].length-1,u=Tn(e,l);if(u===-1)continue;let m=[];kn(e.slice(l+1,u-1),l+1,m),r(m)}let i=new Set;return n.filter(a=>!i.has(a.start)&&i.add(a.start)).sort((a,l)=>a.start-l.start)}c(Ta,"scanClassTokens");var $u=Object.freeze([{pattern:/^\/dist\/(?:webawesome|shoelace)\.js$/,kind:"registry"},{pattern:/^\/dist\/webawesome\.loader\.js$/,kind:"loader",targets:[`${Oe}/autoloader-cdn.js`]},{pattern:/^\/dist\/shoelace-autoloader\.js$/,kind:"loader",targets:[`${Oe}/autoloader-cdn.js`]},{pattern:/^\/dist\/utilities\/base-path(?:\.js)?$/,kind:"none",note:"Lyra resolves no asset base path: icons come from registered icon libraries and translations from registerLyraLocale(), so remove setBasePath() and register those explicitly."},{pattern:/^\/dist\/webawesome\.ssr-loader\.js$/,kind:"none",note:"Lyra server rendering uses @aceshooting/lyra-ui/ssr.js and ssr/all.js; migrate the server entry by hand."},{pattern:/^\/dist\/styles\/webawesome\.css$/,kind:"style",targets:[`${Oe}/theme.css`,`${Oe}/native.css`,`${Oe}/utilities.css`],note:"native.css only styles descendants of an element with the lr-native class; add that class to the regions that relied on the global native styles."},{pattern:/^\/dist\/styles\/native\.css$/,kind:"style",targets:[`${Oe}/native.css`],note:"native.css only styles descendants of an element with the lr-native class; add that class to the regions that relied on the global native styles."},{pattern:/^\/dist\/styles\/utilities\.css$/,kind:"style",targets:[`${Oe}/utilities.css`]},{pattern:/^\/dist\/styles\/themes\/default\.css$/,kind:"style",targets:[`${Oe}/theme.css`]},{pattern:/^\/dist\/themes\/light\.css$/,kind:"style",targets:[`${Oe}/theme.css`]},{pattern:/^\/dist\/themes\/dark\.css$/,kind:"style",targets:[`${Oe}/theme.css`],note:'Lyra ships one stylesheet for both modes; put lr-dark (or data-lr-mode="dark") where sl-theme-dark was.'},{pattern:/^\/dist\/styles\/layers\.css$/,kind:"none",note:"Lyra stylesheets declare their own cascade layers (lr-base, lr-theme, lr-utilities, lr-overrides); delete this import."},{pattern:/^\/dist\/styles\/themes\/(?:awesome|shoelace)\.css$/,kind:"none",note:"Lyra has no counterpart to this theme; start from theme.css and the looks/*.css and accents.css stylesheets."},{pattern:/^\/dist\/styles\/color\/.+\.css$/,kind:"none",note:"Lyra has no counterpart to this palette stylesheet; see palette.css and accents.css."},{pattern:/^\/dist\/(?:styles|themes)\/.+\.css$/,kind:"none",note:"No Lyra stylesheet is recorded for this file; compare it with theme.css, native.css and utilities.css."}]);function xs(e){return Su(e)??$u.find(t=>t.pattern.test(e))??null}c(xs,"resolveUpstreamAssetRoute");var xa="@aceshooting/lyra-translations",vu=Object.freeze(["am","ar","bg","bho","bn","ca","cs","da","de","de-CH","el","en-GB","es","es-419","et","fa","fa-AF","fi","fr","fr-CA","ga","gu","ha","he","hi","hr","hu","id","ig","it","ja","jv","kk","kn","ko","ln","lt","lv","ml","mr","ms","mt","my","nb","ne","nl","nn","om","or","pa","pcm","pl","pnb","ps","pt-BR","pt-PT","ro","ru","sd","sk","sl","sr","sr-Latn","su","sv","sw","ta","te","th","tl","tr","uk","ur","uz","vi","yo","zh-CN","zh-HK","zh-TW","zu"]),Eu=new Map(vu.map(e=>[e.toLowerCase(),e])),xu=Object.freeze({pt:{locale:"pt-BR",alternative:"pt-PT"},zh:{locale:"zh-CN",alternative:"zh-TW or zh-HK"}});function Su(e){let t=/^\/dist\/translations\/(?<lang>[A-Za-z]{2,3}(?:[-_][A-Za-z0-9]{2,8})*)\.js$/.exec(e);if(!t)return null;let n=t.groups.lang.replaceAll("_","-"),r=n.toLowerCase();if(r==="en"||r==="en-us")return{kind:"drop",locale:n,note:"English is built into Lyra UI, so this translation import has no counterpart and was removed."};let s=Eu.get(r);if(s)return{kind:"translation",locale:s,targets:[`${xa}/${s}.js`]};let o=xu[r];return o?{kind:"translation",locale:o.locale,targets:[`${xa}/${o.locale}.js`],note:`Lyra ships no bare "${n}" catalog, so this import now loads ${o.locale}, the region CLDR resolves "${n}" to. Switch to ${o.alternative} if that is the audience, and check that the page lang still selects it.`}:{kind:"none",locale:n,note:`Lyra ships no "${n}" catalog; pick the nearest locale from @aceshooting/lyra-ui/locales.json or register your own strings with registerLyraLocale().`}}c(Su,"resolveTranslationRoute");var Sn=`${Oe}/components/utility/icon/icon-library.js`,$s=`${Oe}/utilities/animation-registry.js`,vs="Animation names are keyed by component (for example dialog.show); check each name you set or read against the Lyra component it targets, because an unknown name is ignored silently.",Rn=Object.freeze({serialize:{target:`${Oe}/utilities/form.js`},registerIconLibrary:{target:Sn},unregisterIconLibrary:{target:Sn},setDefaultIconFamily:{target:Sn},getDefaultIconFamily:{target:Sn},getDefaultIconVariant:{target:Sn},allDefined:{target:`${Oe}/utilities/defined.js`},setDefaultAnimation:{target:$s,review:vs},setAnimation:{target:$s,review:vs},getAnimation:{target:$s,review:vs},getAnimationNames:{target:`${Oe}/components/media/animation/animation.class.js`},getEasingNames:{target:`${Oe}/components/media/animation/animation.class.js`}});function Ra(e){return/^\/dist\/utilities\/[a-z][a-z0-9-]*\.js$/.test(e)}c(Ra,"isUpstreamUtilitySubpath");function Aa(e,t,n=()=>!1){let r=[...t.packageIdentities.keys()].sort((i,a)=>a.length-i.length).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(`@import\\s+url\\(\\s*(?<quote>['"])(?<package>${r})(?<subpath>\\/[^'"\\s]*)?\\k<quote>\\s*\\)`,"g"),o=[];for(let i of e.matchAll(s)){if(n(i.index))continue;let a=t.packageIdentities.get(i.groups.package),l=e.indexOf(i.groups.quote,i.index),u=`${i.groups.package}${i.groups.subpath??""}`,m=l+1+u.length+1,h=e.indexOf(")",m),y=e.indexOf(";",h),w=e.indexOf(`
17
+ `,h),E=w===-1?e.length:w;o.push({sideEffect:!0,kind:"css-import",ecosystem:a.ecosystem,tiers:a.tiers,packageName:i.groups.package,specifier:u,subpath:i.groups.subpath??"",quote:i.groups.quote,start:l+1,end:l+1+u.length,statementEnd:y!==-1&&y<E?y+1:h+1,insertAfter:"css-import"})}return o}c(Aa,"scanCssUrlImports");var An=Object.freeze({"data-required":"required","data-optional":"optional","data-valid":"valid","data-invalid":"invalid","data-user-valid":"user-valid","data-user-invalid":"user-invalid"});import qt from"node:path";import{fileURLToPath as Uu}from"node:url";var Ts=["semantics","naming","keyboard","focus","states","announcements","motion"],ku=Object.freeze({semantics:Object.freeze(["alert","article","button","checkbox","combobox","composition-primitive","dialog","document","grid","group","iframe","img","link","list","listbox","menu","menuitem","navigation","option","presentation","progressbar","radio","radiogroup","region","separator","slider","spinbutton","status","switch","tab","table","tablist","tabpanel","text-content","textbox","tooltip","transparent-content","tree","treeitem","video"]),naming:Object.freeze(["alternative-text","author-label-required","content-derived","content-or-author-label","control-labels-localized","current-page","frame-title","heading-level","value-text","visible-or-author-label"]),keyboard:Object.freeze(["arrow-navigation","data-point-navigation","escape-dismiss","home-end-navigation","media-controls","native-activation","native-editing","page-navigation","range-adjustment","spatial-adjustment","tab-cycle","typeahead"]),focus:Object.freeze(["focus-follows-selection","focus-preserved","focus-return","focus-trap","focus-visible-on-reveal","frame-focus-gated","initial-focus","native-focus","roving-focus"]),states:Object.freeze(["busy","checked","current","disabled","expanded","invalid","modal","multiselectable","orientation","paused","pressed","readonly","required","selected","sort","value-range"]),announcements:Object.freeze(["autoplay-content-change","character-count","content-change","copy-result","live-alert","live-status","page-change","playback-state","progress-value","selection-change","validation-message"]),motion:Object.freeze(["respects-reduced-motion","stops-autoplay","suppresses-animation","user-pause-control"])}),Oa=Object.freeze({upstream:"pinned-public-contract",target:"lyra-authored-contract-and-automated-tests"});var Na=["typeEquivalences","structuralTypeAliases","methodParameterTypeEquivalences","defaultEquivalences","derivedDefaultEquivalences","inferredAttributeSuppressions","unknownMethodReturnTypes","cancelabilityEquivalences","cancelabilityPathAdditions","attributePropertyEquivalences","reflectionEquivalences","cssDefaultEquivalences","deprecationEquivalences"],an=new Map([["never",0],["conditional",1],["always",2]]),vr=[];var _a=Object.freeze({dir:"platform-global-passthrough",lang:"platform-global-passthrough",role:"platform-global-passthrough",tabindex:"platform-global-passthrough",title:"platform-global-passthrough","did-ssr":"upstream-hydration-marker"});function _n(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}c(_n,"isPlainObject");function Ia(e){return new Set(Ts.flatMap(t=>(e?.[t]??[]).map(n=>`${t}:${n}`)))}c(Ia,"accessibilityBehaviorSet");function Tu(e,t,n){let r=e?.[t],s=e?.[n];if(!r)throw new Error(`unknown upstream accessibility profile ${String(t)}`);if(!s)throw new Error(`unknown target accessibility profile ${String(n)}`);let o=Ia(r),i=Ia(s),a=[...o].filter(m=>!i.has(m)).sort(),l=[...i].filter(m=>!o.has(m)).sort();return{status:o.size===0&&i.size===0?"not-applicable":a.length>0?"warning-required":l.length>0?"target-additive":"equivalent",missing:a,additions:l}}c(Tu,"compareAccessibilityProfiles");function Ru(e,t){if(!_n(e)||Object.keys(e).length===0){t.push("accessibilityProfiles must be a non-empty object");return}for(let[n,r]of Object.entries(e)){if(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(n)||t.push(`accessibility profile ${n}: invalid profile name`),!_n(r)){t.push(`accessibility profile ${n}: profile must be an object`);continue}let s=new Set(["description",...Ts]),o=Object.keys(r).filter(i=>!s.has(i));o.length>0&&t.push(`accessibility profile ${n}: unknown key(s) ${o.join(", ")}`),(typeof r.description!="string"||!r.description.trim())&&t.push(`accessibility profile ${n}: description must be non-empty`);for(let i of Ts){let a=r[i];if(!Array.isArray(a)){t.push(`accessibility profile ${n}: ${i} must be an array`);continue}new Set(a).size!==a.length&&t.push(`accessibility profile ${n}: duplicate ${i} behavior`),JSON.stringify(a)!==JSON.stringify([...a].sort())&&t.push(`accessibility profile ${n}: ${i} behaviors must be sorted`);let l=new Set(ku[i]);for(let u of a)l.has(u)||t.push(`accessibility profile ${n}: unknown ${i} behavior ${String(u)}`)}}}c(Ru,"validateAccessibilityProfiles");function Au(e,t,n){let r=e.parity?.accessibility;if(!_n(r)){n.push(`${e.upstreamTag}: missing accessibility parity review`);return}let s=new Set(["reviewStatus","upstreamProfile","targetProfile","evidence","comparison","rationale"]),o=Object.keys(r).filter(l=>!s.has(l));o.length>0&&n.push(`${e.upstreamTag}: accessibility parity has unknown key(s) ${o.join(", ")}`),r.reviewStatus!=="complete"&&n.push(`${e.upstreamTag}: accessibility parity review is incomplete`),(!_n(r.evidence)||r.evidence.upstream!==Oa.upstream||r.evidence.target!==Oa.target||Object.keys(r.evidence??{}).some(l=>l!=="upstream"&&l!=="target"))&&n.push(`${e.upstreamTag}: accessibility parity evidence is invalid`),(typeof r.rationale!="string"||!r.rationale.trim())&&n.push(`${e.upstreamTag}: accessibility parity rationale must be non-empty`);let i;try{i=Tu(t,r.upstreamProfile,r.targetProfile)}catch(l){n.push(`${e.upstreamTag}: ${l instanceof Error?l.message:String(l)}`);return}(!_n(r.comparison)||!br(r.comparison,i))&&n.push(`${e.upstreamTag}: stored accessibility comparison is stale`);let a=e.parity?.lightDom==="warning-required"&&Array.isArray(e.parity?.behaviorReviewFlags)&&e.parity.behaviorReviewFlags.length>0;(e.classification==="exact"||e.classification==="rewritten")&&i.status==="warning-required"&&!a&&n.push(`${e.upstreamTag}: automatic mapping has missing accessibility behavior`)}c(Au,"validateAccessibilityParity");function Ha(e,t){let n=[];if(Ru(e,n),!Array.isArray(t))n.push("accessibility mappings must be an array");else for(let r of t)Au(r,e,n);return n.sort()}c(Ha,"validateAccessibilityContract");var Tt="unspecified-public-documentation";var Vt=c((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"hasOwn"),Ou=c(e=>e?.text?.replace(/\s+/g," ").trim()||"unknown","textOf");var Ca=c(e=>[...new Set(e)].sort(),"unique");var Nu=["AnimationEvent","BeforeUnloadEvent","ClipboardEvent","CloseEvent","CompositionEvent","CustomEvent","DeviceMotionEvent","DeviceOrientationEvent","DragEvent","ErrorEvent","Event","FocusEvent","GamepadEvent","HashChangeEvent","InputEvent","KeyboardEvent","MessageEvent","MouseEvent","PageTransitionEvent","PointerEvent","PopStateEvent","ProgressEvent","PromiseRejectionEvent","SecurityPolicyViolationEvent","StorageEvent","SubmitEvent","ToggleEvent","TouchEvent","TrackEvent","TransitionEvent","UIEvent","WheelEvent"],wr=Nu.join("|"),_u=new RegExp(`^(${wr})(?:<.*>)?$`,"u"),Iu=new RegExp(`^(?:${wr})(?:<.*>)?(?:\\s*\\|\\s*(?:${wr})(?:<.*>)?)+$`,"u"),Cu=new RegExp(`^(${wr})(?:<.*>)?\\s*&\\s*\\{[^]*\\bdetail\\s*:`,"u");function Mu(e){let t=Ou(e),n=_u.exec(t);if(n)return n[1];let r=Cu.exec(t);return r?r[1]:Iu.test(t)?t:void 0}c(Mu,"eventConstructor");var Jf=Object.freeze({webawesome:"@awesome.me/webawesome",shoelace:"@shoelace-style/shoelace"});function In(e,t){return e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).sort().join("\0")===[...t].sort().join("\0")}c(In,"exactObjectKeys");var ju=new Set(["ambient-page-viewport"]),Ma=Object.freeze({upstream:"pinned-package-black-box",target:"lyra-authored-contract-and-automated-tests"}),ja="method-edge-return-sentinel-divergence";function za(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e.kind==="sentinel"?In(e,["kind","value"])&&(e.value===null||typeof e.value=="string"||typeof e.value=="boolean"||typeof e.value=="number"&&Number.isFinite(e.value)):e.kind==="measurement"&&In(e,["kind","basis"])&&ju.has(e.basis)}c(za,"validMethodEdgeOutcome");function Ja(e,{upstream:t,target:n}={}){let r=[],s=e?.upstreamTag??"<unknown>",o=e?.parity?.methodEdges,i=(t?.methods??[]).filter(y=>y.edgeSemantics),a=new Map(i.map(y=>[y.name,y])),l=e?.parity?.behaviorReviewFlags,u=Array.isArray(l)&&l.includes(ja);if(o===void 0)return i.length>0&&r.push(`${s}: missing method-edge parity review`),u&&r.push(`${s}: stale method-edge divergence behavior flag`),r;if(!Array.isArray(o)||o.length===0)return r.push(`${s}: parity.methodEdges must be a non-empty array`),u&&r.push(`${s}: stale method-edge divergence behavior flag`),r;let m=new Set,h=!1;for(let y of o){if(!(In(y,["method","evidence","cases","rationale"])&&typeof y.method=="string"&&!!y.method.trim()&&In(y.evidence,["upstream","target"])&&y.evidence.upstream===Ma.upstream&&y.evidence.target===Ma.target&&Array.isArray(y.cases)&&y.cases.length>0&&typeof y.rationale=="string"&&!!y.rationale.trim())){r.push(`${s}: malformed method-edge parity review`);continue}m.has(y.method)&&r.push(`${s}: duplicate method-edge parity review ${y.method}`),m.add(y.method);let E=a.get(y.method);t!==void 0&&!E&&r.push(`${s}#${y.method}: stale method-edge parity review`),n!==void 0&&!(n.methods??[]).some(S=>S.name===y.method)&&r.push(`${s}#${y.method}: dangling method-edge parity target`);let x=new Map((E?.edgeSemantics?.cases??[]).map(S=>[S.case,S])),f=new Set;for(let S of y.cases){if(!(In(S,["case","arguments","upstream","target","status"])&&typeof S.case=="string"&&!!S.case.trim()&&Array.isArray(S.arguments)&&S.arguments.every(T=>typeof T=="string"&&!!T.trim())&&za(S.upstream)&&za(S.target)&&(S.status==="equivalent"||S.status==="different"))){r.push(`${s}#${y.method}: malformed method-edge parity case`);continue}f.has(S.case)&&r.push(`${s}#${y.method}: duplicate method-edge parity case ${S.case}`),f.add(S.case);let N=br(S.upstream,S.target)?"equivalent":"different";if(S.status!==N&&r.push(`${s}#${y.method}:${S.case}: stale method-edge parity status`),N==="different"&&(h=!0),E){let T=x.get(S.case);(!T||!br(T.arguments,S.arguments)||!br(T.outcome,S.upstream))&&r.push(`${s}#${y.method}:${S.case}: stored upstream method-edge observation is stale`)}}if(E)for(let S of E.edgeSemantics.cases??[])f.has(S.case)||r.push(`${s}#${y.method}:${S.case}: missing method-edge parity case`)}if(t!==void 0)for(let y of i)m.has(y.name)||r.push(`${s}#${y.name}: missing method-edge parity review`);return h?(e.classification!=="warning-required"&&r.push(`${s}: method-edge divergence requires warning-required classification`),u||r.push(`${s}: missing ${ja} behavior flag`),o.some(w=>typeof e.rationale!="string"||typeof w?.rationale!="string"||!e.rationale.includes(w.rationale))&&r.push(`${s}: mapping rationale omits method-edge divergence`)):u&&r.push(`${s}: stale method-edge divergence behavior flag`),r}c(Ja,"validateMethodEdgeParity");function Rs(e,t){return e.startsWith(t)?`lr-${e.slice(t.length)}`:e}c(Rs,"mappedEventName");function Pa(e){return/^(?:no|not|without|hide|disable)-/.test(e)?-1:/^(?:with|show|enable)-/.test(e)?1:0}c(Pa,"polarity");function La(e){return e.replace(/^(?:no|not|without|hide|disable|with|show|enable)-/,"")}c(La,"polarityStem");function Ce(e,t,n,r){e.push({code:t,section:n,member:r})}c(Ce,"pushMissing");function Ss(e,t){return`${e}:${t}`}c(Ss,"normalizationKey");function Da(e,t,n,r){let s=(e.defaultEquivalences??[]).find(o=>o.memberKind===t&&o.member===n&&o.upstream===r);return s?s.target:r}c(Da,"normalizedExpectedDefault");function zu(e,t,n,r){return(e.attributePropertyEquivalences??[]).some(s=>s.attribute===t&&s.upstream===n&&s.target===r)}c(zu,"reviewedAttributeProperty");function Fa(e,t,n,r,s){return(e.reflectionEquivalences??[]).some(o=>o.memberKind===t&&o.member===n&&o.upstream===r&&o.target===s)}c(Fa,"reviewedReflection");function Pu(e,t,n,r){return(e.cssDefaultEquivalences??[]).some(s=>s.member===t&&s.upstreamHasDefault===n.hasDefault&&(!s.upstreamHasDefault||s.upstream===n.default)&&s.targetHasDefault===r.hasDefault&&(!s.targetHasDefault||s.target===r.default))}c(Pu,"reviewedCssDefault");function $r(e){if(e&&typeof e=="object"){let t=e.replacement;if(!t||typeof t!="object")return null;let n=typeof t.usage=="string"?t.usage.trim():"";return/^([a-z][a-z0-9-]*)\s*=\s*["'][^"']+["']$/iu.exec(n)?.[1]===t.name?n.replace(/\s+/gu,""):typeof t.name=="string"&&t.name?t.name:null}return typeof e!="string"?null:/\buse\s+(?:the\s+)?`([^`]+)`/iu.exec(e)?.[1]??/\buse\s+(?:the\s+)?(?!the\b)([a-z][a-z0-9-]*)\s+(?:part|property|attribute|slot|method)\b/iu.exec(e)?.[1]??null}c($r,"deprecationReplacement");function Lu(e,t,n,r,s,o,i){return(e.deprecationEquivalences??[]).some(a=>a.section===t&&a.member===n&&a.upstreamDeprecated===r&&a.upstreamReplacement===s&&a.targetDeprecated===o&&a.targetReplacement===i)}c(Lu,"reviewedDeprecation");function Ga(e,t){if(e===null)return null;let n=/^([a-z][a-z0-9-]*)(=.*)$/iu.exec(e);return n?`${t.get(n[1])||n[1]}${n[2]}`:t.get(e)||e}c(Ga,"rewriteDeprecationReplacement");function Ba(e,t,n,r,s){return s.hasDefault?!1:(e.derivedDefaultEquivalences??[]).some(o=>o.memberKind===t&&o.member===n&&o.upstream===r)}c(Ba,"reviewedDerivedDefault");function Ya(e,t){if(typeof e!="string")return!1;let n=null;for(let r=0;r<e.length;){let s=e[r];if(n){if(s==="\\"){r+=2;continue}s===n&&(n=null),r++;continue}if(s==="'"||s==='"'||s==="`"){n=s,r++;continue}if(/[A-Za-z_$]/u.test(s)){let o=r+1;for(;o<e.length&&/[A-Za-z0-9_$]/u.test(e[o]);)o++;if(e.slice(r,o)===t){let i=o;for(;i<e.length&&/\s/u.test(e[i]);)i++;if(e[i]==="?")for(i++;i<e.length&&/\s/u.test(e[i]);)i++;if(e[i]!==":"&&e[i]!=="(")return!0}r=o;continue}r++}return!1}c(Ya,"containsTypePositionKeyword");function Fe(e){return Ya(e,"any")}c(Fe,"containsAnyTypeKeyword");function Cn(e){return Ya(e,"unknown")}c(Cn,"containsUnknownTypeKeyword");function Mn(e){return typeof e=="string"&&e.includes("${")}c(Mn,"containsTemplateInterpolation");function Du(e){return new Map((e?.structuralTypeAliases??[]).filter(t=>typeof t?.name=="string"&&typeof t.target=="string").map(t=>[t.name,t.target]))}c(Du,"structuralTypeAliasMap");function Va(e,t){return typeof e!="string"?!1:new RegExp(`(^|[^A-Za-z0-9_$])${t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}([^A-Za-z0-9_$]|$)`,"u").test(e)}c(Va,"typeContainsIdentifier");function Za(e,t,n=new Set){if(typeof e!="string")return e;let r=Du(t);if(r.size===0)return e;let s="",o=null;for(let i=0;i<e.length;){let a=e[i];if(o){if(s+=a,a==="\\"&&i+1<e.length){s+=e[i+1],i+=2;continue}a===o&&(o=null),i+=1;continue}if(a==="'"||a==='"'||a==="`"){o=a,s+=a,i+=1;continue}if(/[A-Za-z_$]/u.test(a)){let l=i+1;for(;l<e.length&&/[A-Za-z0-9_$]/u.test(e[l]);)l+=1;let u=e.slice(i,l),m=r.get(u);typeof m=="string"&&!n.has(u)?s+=Za(m,t,new Set([...n,u])):s+=u,i=l;continue}s+=a,i+=1}return s}c(Za,"expandStructuralTypeAliases");function On(e,t,n,r,s){return Fe(r)||Fe(s)||t==="event"&&(cn(r)||cn(s)||As(s))?!1:(e.typeEquivalences??[]).some(o=>o.memberKind===t&&o.member===n&&o.upstream===r&&o.target===s)}c(On,"reviewedTypeEquivalent");function Fu(e,t,n,r,s){return typeof r!="string"||typeof s!="string"||Fe(r)||Fe(s)||Cn(r)||Cn(s)||Mn(r)||Mn(s)?!1:(e.methodParameterTypeEquivalences??[]).some(o=>o.method===t&&o.parameter===n&&o.upstream===r&&o.target===s)}c(Fu,"reviewedMethodParameterTypeEquivalent");function Bu(e,t,n,r){let s=an.get(n),o=an.get(r);if(s===void 0||o===void 0)return!1;let i=c(a=>a.event===t&&a.upstream===n&&a.target===r,"matches");return o>s?(e.cancelabilityEquivalences??[]).some(i):n==="always"&&r==="conditional"&&(e.cancelabilityPathAdditions??[]).some(i)}c(Bu,"reviewedCancelability");function qa(e,t,n,r){return(e.defaults??[]).some(s=>s.action==="insert-if-absent"&&s.memberKind===t&&s.member===n&&s.value===r)}c(qa,"insertionPreservesDefault");function Ze(e,t){if(typeof e!="string")return e;let n=t==="wa-"?"Wa":t==="sl-"?"Sl":null;return n?e.replace(new RegExp(`\\b${n}([A-Z][A-Za-z0-9_$]*)\\b`,"gu"),"Lyra$1"):e}c(Ze,"mappedPublicType");function ft(e){return!!e&&e!=="unknown"&&e!==Tt}c(ft,"hasPublishedType");function Xa(e){let t=[],n=0,r=0,s=null;for(let i=0;i<e.length;i+=1){let a=e[i];if(s){a===s&&e[i-1]!=="\\"&&(s=null);continue}if(a==="'"||a==='"'||a==="`"){s=a;continue}if("([{<".includes(a))r+=1;else if([")","]","}",">"].includes(a))r=Math.max(0,r-1);else if(a==="|"&&r===0){let l=e.slice(n,i).trim();l&&t.push(l),n=i+1}}let o=e.slice(n).trim();return o&&t.push(o),t}c(Xa,"splitTopLevelUnion");function Wa(e){return typeof e!="string"?[]:Xa(e.replace(/^\s*\|\s*/u,"").replace(/\s+/gu," ").trim())}c(Wa,"normalizedTypeTokens");function Vu(e){return/^(?:'[^']*'|"[^"]*"|`[^`]*`)$/u.test(e)?"string":/^-?(?:\d+(?:\.\d*)?|\.\d+)$/u.test(e)?"number":e==="true"||e==="false"?"boolean":null}c(Vu,"literalPrimitive");function Nn(e,t){if(Fe(e)||Fe(t))return!1;let n=Wa(e),r=Wa(t);if(n.length===r.length){let o=new Set(r);if(n.every(i=>o.has(i)))return!0}let s=new Set(r);return n.every(o=>{if(s.has(o))return!0;let i=Vu(o);return!!(i&&s.has(i)||o==="array"&&r.some(a=>/(?:\[\]|Array<.+>)$/u.test(a)))})}c(Nn,"publicTypeCompatible");function Ka(e){if(typeof e!="string")return;let t=e.trim(),r=/^CustomEvent\s*</u.test(t)&&t.endsWith(">")?t.slice(t.indexOf("<")+1,-1).trim():t,s="",o=null,i=!1,a=0,l=0,u=0,m=0;for(let h of r){if(o){s+=h,i?i=!1:h==="\\"?i=!0:h===o&&(o=null);continue}if(h==="'"||h==='"'||h==="`"){o=h,s+=h;continue}/\s/u.test(h)||(h==="{"?a+=1:h==="}"?a=Math.max(0,a-1):h==="<"?l+=1:h===">"?l=Math.max(0,l-1):h==="["?u+=1:h==="]"?u=Math.max(0,u-1):h==="("?m+=1:h===")"&&(m=Math.max(0,m-1)),h===","&&a>0&&l===0&&u===0&&m===0?s+=";":s+=h)}return s.replace(/\bvoid\b/gu,"undefined").replace(/;\}/gu,"}")}c(Ka,"canonicalEventType");function Qa(e){let t=e.trim();for(;t.startsWith("(")&&t.endsWith(")");){let n=0,r=null,s=!1;for(let o=0;o<t.length;o+=1){let i=t[o];if(r){i===r&&t[o-1]!=="\\"&&(r=null);continue}if(i==="'"||i==='"'||i==="`"){r=i;continue}if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0)){s=o===t.length-1;break}}if(!s)break;t=t.slice(1,-1).trim()}return t}c(Qa,"stripBalancedOuterParentheses");function qu(e){let t=e.trim(),n=/^CustomEvent\s*</u.exec(t);if(!n)return;let r=n[0].lastIndexOf("<"),s=0,o=null;for(let i=r;i<t.length;i+=1){let a=t[i];if(o){a===o&&t[i-1]!=="\\"&&(o=null);continue}if(a==="'"||a==='"'||a==="`"){o=a;continue}if(a==="<")s+=1;else if(a===">"&&(s-=1,s===0))return t.slice(i+1).trim()===""?t.slice(r+1,i).trim():void 0}}c(qu,"customEventDetailType");function Ua(e){return Xa(Qa(e)).includes("unknown")}c(Ua,"hasTopLevelUnknown");function cn(e){if(typeof e!="string")return!1;let t=Qa(e);if(Ua(t))return!0;let n=qu(t);return n!==void 0&&Ua(n)}c(cn,"isUnknownEventType");function As(e){return typeof e=="string"&&/^CustomEvent\s*$/u.test(e.trim())}c(As,"isBareCustomEventType");function ei(e,t,n={}){if(t=Za(t,n),!ft(e)||!ft(t)||Fe(e)||Fe(t)||cn(e)||cn(t)||As(t))return!1;let r=/^CustomEvent\s*</u.test(e.trim()),s=/^CustomEvent\s*</u.test(t.trim());return r!==s&&Mu(r?t:e)!==void 0?!1:Ka(e)===Ka(t)}c(ei,"eventTypeCompatible");function Wu(e,t,n,r,s){let o=e??[],i=t??[];return i.length<o.length||!o.every((l,u)=>{let m=i[u];return!m||l.name!==m.name||l.type!==Tt&&Ze(l.type,n)!==m.type&&!Fu(s,r,l.name,l.type,m.type)||(l.optional||l.hasDefault)&&!(m.optional||m.hasDefault)?!1:!l.hasDefault||m.hasDefault&&l.default===m.default})?!1:i.slice(o.length).every(l=>l.optional||l.hasDefault)}c(Wu,"parametersMatch");function Ku(e,t,n,r,s,o=!1){return Wu(t.parameters,n.parameters,r,e,s)&&(t.returnType===Tt||o&&t.returnType==="unknown"||Ze(t.returnType,r)===n.returnType)}c(Ku,"overloadMatches");function ks(e,t,n,r,s,o=!1){return(t??[]).every(i=>(n??[]).some(a=>Ku(e,i,a,r,s,o)))}c(ks,"methodOverloadsMatch");function ti(e,t,{upstreamPrefix:n,rewrites:r={},normalizations:s={}}={}){let o=[],i=new Map((r.attributes??[]).map(p=>[p.from,p.to])),a=new Map((r.properties??[]).map(p=>[p.from,p.to])),l=new Set((r.attributes??[]).filter(p=>p.value!==void 0).map(p=>p.from)),u=new Set((r.properties??[]).filter(p=>p.value!==void 0).map(p=>p.from)),m=new Map((r.events??[]).map(p=>[p.from,p.to])),h=new Map((r.methods??[]).map(p=>[p.from,p.to])),y=new Map([["attributes",i],["properties",a],["events",m],["methods",h],["staticProperties",new Map],["staticMethods",new Map],["moduleExports",new Map],...["slots","parts","cssProperties","cssStates"].map(p=>[p,new Map((r[p]??[]).map(N=>[N.from,N.to]))])]),w=new Set((s.unknownMethodReturnTypes??[]).map(p=>p.method)),E=new Map((s.inferredAttributeSuppressions??[]).map(p=>[p.attribute,p])),x=new Set,f=new Set((e.attributes??[]).filter(p=>Object.hasOwn(_a,p.name)).map(p=>p.property).filter(Boolean)),S=c((p,N,T)=>{let C=!!N.deprecated,I=!!T.deprecated,W=$r(N.deprecated),$=$r(T.deprecated),L=Ga(W,y.get(p)??new Map);(C!==I||C&&I&&L!==$)&&!Lu(s,p,N.name,C,W,I,$)&&o.push({code:C===I?"deprecation-replacement-mismatch":"deprecation-mismatch",section:p,member:N.name,expected:C?L??!0:!1,actual:I?$??!0:!1})},"compareDeprecation");for(let p of e.attributes??[]){if(Object.hasOwn(_a,p.name))continue;let N=E.get(p.name),T=N?.property;if(T&&(p.inferred===!0||N.explicit===!0)){x.add(T),(t.properties??[]).some(d=>d.name===T)||Ce(o,"missing-property","properties",T);continue}let C=i.get(p.name)||p.name,I=(t.attributes??[]).find(d=>d.name===C);if(l.has(p.name)){I||Ce(o,"missing-attribute","attributes",p.name);continue}if(!I){let d=(t.attributes??[]).find(k=>La(k.name)===La(C)&&Pa(k.name)!==Pa(C));d?o.push({code:"polarity-mismatch",section:"attributes",member:p.name,expected:C,actual:d.name}):Ce(o,"missing-attribute","attributes",p.name);continue}let W=Ze(p.type,n);ft(p.type)&&!Nn(W,I.type)&&!On(s,"attribute",p.name,p.type,I.type)&&o.push({code:"type-mismatch",section:"attributes",member:p.name,expected:W,actual:I.type});let $=a.get(p.property)||p.property;$!==I.property&&!zu(s,p.name,p.property,I.property)&&o.push({code:"attribute-property-mismatch",section:"attributes",member:p.name,expected:$,actual:I.property}),p.reflects!==I.reflects&&!Fa(s,"attribute",p.name,p.reflects,I.reflects)&&o.push({code:"reflection-mismatch",section:"attributes",member:p.name,expected:p.reflects,actual:Vt(I,"reflects")?I.reflects:null});let L=Da(s,"attribute",p.name,p.default);p.hasDefault&&(!I.hasDefault||I.default!==L)&&!Ba(s,"attribute",p.name,p.default,I)&&!qa(r,"attribute",p.name,L)&&o.push({code:"default-mismatch",section:"attributes",member:p.name,expected:L,actual:I.hasDefault?I.default:null}),S("attributes",p,I)}for(let p of e.properties??[]){if(f.has(p.name))continue;let N=a.get(p.name)||p.name,T=(t.properties??[]).find(C=>C.name===N);if(!(!T&&x.has(N))){if(u.has(p.name)){T||Ce(o,"missing-property","properties",p.name);continue}if((e.attributes??[]).some(C=>C.property===p.name)){T?p.readonly===!1&&T.readonly!==!1&&o.push({code:"readonly-mismatch",section:"properties",member:p.name,expected:p.readonly,actual:Vt(T,"readonly")?T.readonly:null}):Ce(o,"missing-property","properties",p.name),T&&S("properties",p,T);continue}if(!T)Ce(o,"missing-property","properties",p.name);else{let C=Ze(p.type,n);ft(p.type)&&!Nn(C,T.type)&&!On(s,"property",p.name,p.type,T.type)&&o.push({code:"type-mismatch",section:"properties",member:p.name,expected:C,actual:T.type}),p.reflects!==T.reflects&&!Fa(s,"property",p.name,p.reflects,T.reflects)&&o.push({code:"reflection-mismatch",section:"properties",member:p.name,expected:p.reflects,actual:Vt(T,"reflects")?T.reflects:null}),p.readonly===!1&&T.readonly!==!1&&o.push({code:"readonly-mismatch",section:"properties",member:p.name,expected:p.readonly,actual:Vt(T,"readonly")?T.readonly:null});let I=Da(s,"property",p.name,p.default);if(S("properties",p,T),!p.hasDefault||T.hasDefault&&T.default===I||Ba(s,"property",p.name,p.default,T)||qa(r,"property",p.name,I))continue;o.push({code:"default-mismatch",section:"properties",member:p.name,expected:I,actual:T.hasDefault?T.default:null})}}}for(let p of e.staticProperties??[]){let N=(t.staticProperties??[]).find(C=>C.name===p.name);if(!N){Ce(o,"missing-static-property","staticProperties",p.name);continue}let T=Ze(p.type,n);ft(p.type)&&!Nn(T,N.type)&&!On(s,"staticProperty",p.name,p.type,N.type)&&o.push({code:"static-property-type-mismatch",section:"staticProperties",member:p.name,expected:T,actual:N.type}),p.readonly===!1&&N.readonly!==!1&&o.push({code:"static-property-readonly-mismatch",section:"staticProperties",member:p.name,expected:!1,actual:Vt(N,"readonly")?N.readonly:null}),S("staticProperties",p,N)}for(let[p,N]of[["slots","missing-slot"],["parts","missing-part"],["cssProperties","missing-css-property"],["cssStates","missing-css-state"]]){let T=new Map((t[p]??[]).map(I=>[I.name,I])),C=new Map((r[p]??[]).map(I=>[I.from,I.to]));for(let I of e[p]??[]){let W=C.get(I.name)||I.name,$=T.get(W);if(!$){Ce(o,N,p,I.name);continue}p==="cssProperties"&&!(I.hasDefault===$.hasDefault&&(!I.hasDefault||I.default===$.default))&&!Pu(s,I.name,I,$)&&o.push({code:"css-default-mismatch",section:p,member:I.name,expectedHasDefault:I.hasDefault,expected:I.hasDefault?I.default:null,actualHasDefault:$.hasDefault,actual:$.hasDefault?$.default:null}),S(p,I,$)}}for(let p of e.methods??[]){let N=h.get(p.name)||p.name,T=(t.methods??[]).find(C=>C.name===N);T?ks(p.name,p.overloads,T.overloads,n,s,w.has(p.name))||o.push({code:"method-signature-mismatch",section:"methods",member:p.name,expected:p.overloads,actual:T.overloads}):Ce(o,"missing-method","methods",p.name),T&&S("methods",p,T)}for(let p of e.staticMethods??[]){let N=(t.staticMethods??[]).find(T=>T.name===p.name);N?ks(p.name,p.overloads,N.overloads,n,s)||o.push({code:"static-method-signature-mismatch",section:"staticMethods",member:p.name,expected:p.overloads,actual:N.overloads}):Ce(o,"missing-static-method","staticMethods",p.name),N&&S("staticMethods",p,N)}for(let p of e.moduleExports??[]){let N=(t.moduleExports??[]).filter(C=>C.name===p.name);if(N.length===0){o.push({code:"missing-module-export",section:"moduleExports",member:p.name,module:p.module});continue}if(p.kind==="unknown")continue;let T=N.filter(C=>C.kind===p.kind);if(T.length===0){o.push({code:"module-export-kind-mismatch",section:"moduleExports",member:p.name,module:p.module,expected:p.kind,actual:Ca(N.map(C=>C.kind))});continue}p.kind==="function"?T.some(I=>ks(p.name,p.overloads,I.overloads,n,s))||o.push({code:"module-export-signature-mismatch",section:"moduleExports",member:p.name,module:p.module,expected:p.overloads,actual:T.map(I=>I.overloads)}):ft(p.type)&&!T.some(C=>Nn(Ze(p.type,n),C.type)||On(s,"moduleExport",p.name,p.type,C.type))&&o.push({code:"module-export-type-mismatch",section:"moduleExports",member:p.name,module:p.module,expected:Ze(p.type,n),actual:Ca(T.map(C=>C.type))})}for(let p of e.events??[]){let N=m.get(p.name)||Rs(p.name,n),T=(t.events??[]).find(C=>C.name===N);if(!T)Ce(o,"missing-event","events",p.name);else{let C=Ze(p.type,n);ft(p.type)&&!ei(C,T.type,s)&&!On(s,"event",p.name,p.type,T.type)&&o.push({code:"event-type-mismatch",section:"events",member:p.name,expected:C,actual:T.type}),p.cancelable!==Tt&&T.cancelable!==p.cancelable&&!Bu(s,p.name,p.cancelable,T.cancelable)&&o.push({code:"cancelability-mismatch",section:"events",member:p.name,expected:p.cancelable,actual:T.cancelable});for(let[I,W]of[["constructor","event-constructor-mismatch"],["bubbles","event-bubbles-mismatch"],["composed","event-composed-mismatch"]])!Vt(p,I)||T[I]===p[I]||o.push({code:W,section:"events",member:p.name,expected:p[I],actual:Vt(T,I)?T[I]:null});S("events",p,T)}}e.form?.associated&&!t.form?.associated&&o.push({code:"form-association-mismatch",section:"form",member:"associated"});for(let p of e.form?.properties??[])(t.form?.properties??[]).includes(p)||Ce(o,"missing-form-property","form",p);for(let p of e.form?.methods??[])(t.form?.methods??[]).includes(p)||Ce(o,"missing-form-method","form",p);for(let p of e.native?.forwardedEvents??[])(t.native?.forwardedEvents??[]).includes(p)||Ce(o,"missing-native-event","native",p);for(let p of e.native?.delegatedMethods??[])(t.native?.delegatedMethods??[]).includes(p)||Ce(o,"missing-native-method","native",p);return o.sort((p,N)=>`${p.section}:${p.member}:${p.code}`.localeCompare(`${N.section}:${N.member}:${N.code}`))}c(ti,"compareMappedSurfaces");function on(e){return e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)}c(on,"isReviewedScalar");function ni(e,{upstream:t,target:n}={}){let r=[],s=e.normalizations;if(s===void 0)return r;if(!s||typeof s!="object"||Array.isArray(s))return[`${e.upstreamTag}: normalizations must be an object`];for(let d of Na)Array.isArray(s[d])||r.push(`${e.upstreamTag}: normalizations.${d} must be an array`);for(let d of Object.keys(s))Na.includes(d)||r.push(`${e.upstreamTag}: unknown normalization section ${d}`);let o=new Map((e.rewrites?.attributes??[]).map(d=>[d.from,d.to])),i=new Map((e.rewrites?.properties??[]).map(d=>[d.from,d.to])),a=new Set;for(let d of s.attributePropertyEquivalences??[]){if(!(typeof d?.attribute=="string"&&!!d.attribute&&typeof d.upstream=="string"&&!!d.upstream&&typeof d.target=="string"&&!!d.target&&Object.keys(d).length===3)){r.push(`${e.upstreamTag}: invalid normalizations.attributePropertyEquivalences rule`);continue}a.has(d.attribute)&&r.push(`${e.upstreamTag}: duplicate attribute-property normalization ${d.attribute}`),a.add(d.attribute);let j=(t?.attributes??[]).find(D=>D.name===d.attribute),M=o.get(d.attribute)||d.attribute,F=(n?.attributes??[]).find(D=>D.name===M);j?j.property!==d.upstream&&r.push(`${e.upstreamTag}: stale upstream attribute-property normalization ${d.attribute}`):r.push(`${e.upstreamTag}: dangling upstream attribute-property normalization ${d.attribute}`),F?F.property!==d.target?r.push(`${e.upstreamTag}: stale target attribute-property normalization ${d.attribute}`):(i.get(d.upstream)||d.upstream)===d.target&&r.push(`${e.upstreamTag}: stale equivalent attribute-property normalization ${d.attribute}`):r.push(`${e.upstreamTag}: dangling target attribute-property normalization ${d.attribute}`)}let l=new Set;for(let d of s.reflectionEquivalences??[]){if(!(["attribute","property"].includes(d?.memberKind)&&typeof d.member=="string"&&!!d.member&&typeof d.upstream=="boolean"&&typeof d.target=="boolean"&&d.upstream!==d.target&&Object.keys(d).length===4)){r.push(`${e.upstreamTag}: invalid normalizations.reflectionEquivalences rule`);continue}let j=`${d.memberKind}:${d.member}`;l.has(j)&&r.push(`${e.upstreamTag}: duplicate reflection normalization ${j}`),l.add(j);let M=d.memberKind==="attribute"?"attributes":"properties",F=d.memberKind==="attribute"?o:i,D=(t?.[M]??[]).find(_=>_.name===d.member),O=(n?.[M]??[]).find(_=>_.name===(F.get(d.member)||d.member));D?D.reflects!==d.upstream&&r.push(`${e.upstreamTag}: stale upstream reflection normalization ${j}`):r.push(`${e.upstreamTag}: dangling upstream reflection normalization ${j}`),O?O.reflects!==d.target&&r.push(`${e.upstreamTag}: stale target reflection normalization ${j}`):r.push(`${e.upstreamTag}: dangling target reflection normalization ${j}`)}let u=new Set;for(let d of s.cssDefaultEquivalences??[]){let k=new Set(["member","upstreamHasDefault","targetHasDefault"]);d?.upstreamHasDefault===!0&&k.add("upstream"),d?.targetHasDefault===!0&&k.add("target");let j=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.member=="string"&&!!d.member&&typeof d.upstreamHasDefault=="boolean"&&typeof d.targetHasDefault=="boolean"&&(d.upstreamHasDefault!==!0||on(d.upstream))&&(d.targetHasDefault!==!0||on(d.target))&&j.length===k.size&&j.every(_=>k.has(_))&&(d.upstreamHasDefault!==d.targetHasDefault||d.upstreamHasDefault&&d.upstream!==d.target))){r.push(`${e.upstreamTag}: invalid normalizations.cssDefaultEquivalences rule`);continue}u.has(d.member)&&r.push(`${e.upstreamTag}: duplicate CSS-default normalization ${d.member}`),u.add(d.member);let F=(t?.cssProperties??[]).find(_=>_.name===d.member),D=new Map((e.rewrites?.cssProperties??[]).map(_=>[_.from,_.to])).get(d.member)||d.member,O=(n?.cssProperties??[]).find(_=>_.name===D);F?(F.hasDefault!==d.upstreamHasDefault||d.upstreamHasDefault&&F.default!==d.upstream)&&r.push(`${e.upstreamTag}: stale upstream CSS-default normalization ${d.member}`):r.push(`${e.upstreamTag}: dangling upstream CSS-default normalization ${d.member}`),O?(O.hasDefault!==d.targetHasDefault||d.targetHasDefault&&O.default!==d.target)&&r.push(`${e.upstreamTag}: stale target CSS-default normalization ${d.member}`):r.push(`${e.upstreamTag}: dangling target CSS-default normalization ${d.member}`)}let m=new Set;for(let d of s.deprecationEquivalences??[]){if(!(["attributes","properties","slots","events","parts","cssProperties","cssStates","methods","staticProperties","staticMethods","moduleExports"].includes(d?.section)&&typeof d.member=="string"&&!!d.member&&typeof d.upstreamDeprecated=="boolean"&&(d.upstreamReplacement===null||typeof d.upstreamReplacement=="string")&&typeof d.targetDeprecated=="boolean"&&(d.targetReplacement===null||typeof d.targetReplacement=="string")&&Object.keys(d).length===6)){r.push(`${e.upstreamTag}: invalid normalizations.deprecationEquivalences rule`);continue}let j=`${d.section}:${d.member}`;m.has(j)&&r.push(`${e.upstreamTag}: duplicate deprecation normalization ${j}`),m.add(j);let M=new Map((e.rewrites?.[d.section]??[]).map(se=>[se.from,se.to])),F=M.get(d.member)||d.member,D=(t?.[d.section]??[]).find(se=>se.name===d.member),O=(n?.[d.section]??[]).find(se=>se.name===F);if(!D){r.push(`${e.upstreamTag}: dangling upstream deprecation normalization ${j}`);continue}if(!O){r.push(`${e.upstreamTag}: dangling target deprecation normalization ${j}`);continue}let _=!!D.deprecated,K=$r(D.deprecated),Z=!!O.deprecated,te=$r(O.deprecated);(_!==d.upstreamDeprecated||K!==d.upstreamReplacement)&&r.push(`${e.upstreamTag}: stale upstream deprecation normalization ${j}`),(Z!==d.targetDeprecated||te!==d.targetReplacement)&&r.push(`${e.upstreamTag}: stale target deprecation normalization ${j}`);let ce=Ga(K,M);_===Z&&ce===te&&r.push(`${e.upstreamTag}: stale equivalent deprecation normalization ${j}`)}let h=new Set,y=new Map;for(let d of s.structuralTypeAliases??[]){let k=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.name=="string"&&/^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(d.name)&&typeof d.target=="string"&&!!d.target.trim()&&!Fe(d.target)&&!Cn(d.target)&&!Mn(d.target)&&k.length===2&&k.every(M=>M==="name"||M==="target"))){r.push(`${e.upstreamTag}: invalid normalizations.structuralTypeAliases rule`);continue}h.has(d.name)&&r.push(`${e.upstreamTag}: duplicate structural type alias ${d.name}`),h.add(d.name),y.set(d.name,d.target)}let w=new Set,E=c((d,k=new Set)=>{if(k.has(d)){r.push(`${e.upstreamTag}: cyclic structural type alias ${d}`);return}if(w.has(d))return;let j=y.get(d);if(j===void 0)return;w.add(d);let M=new Set([...k,d]);for(let F of y.keys())Va(j,F)&&E(F,M)},"visitStructuralAlias");for(let d of n?.events??[])for(let k of y.keys())Va(d.type,k)&&E(k);for(let d of y.keys())w.has(d)||r.push(`${e.upstreamTag}: stale structural type alias ${d}`);let x=new Set;for(let d of s.typeEquivalences??[]){let k=d&&typeof d=="object"?Object.keys(d):[];if(!((d?.memberKind==="attribute"||d?.memberKind==="property"||d?.memberKind==="event"||d?.memberKind==="staticProperty"||d?.memberKind==="moduleExport")&&typeof d.member=="string"&&!!d.member&&typeof d.upstream=="string"&&!!d.upstream&&typeof d.target=="string"&&!!d.target&&d.upstream!==d.target&&k.length===4&&k.every(te=>["memberKind","member","upstream","target"].includes(te)))){r.push(`${e.upstreamTag}: invalid normalizations.typeEquivalences rule`);continue}let M=Ss(d.memberKind,d.member);(Fe(d.upstream)||Fe(d.target)||d.memberKind==="event"&&As(d.target))&&r.push(`${e.upstreamTag}: unsafe any type normalization ${M}`),d.memberKind==="event"&&(cn(d.upstream)||cn(d.target))&&r.push(`${e.upstreamTag}: unsafe unknown event type normalization ${M}`),x.has(M)&&r.push(`${e.upstreamTag}: duplicate normalizations.typeEquivalences rule ${M}`),x.add(M);let F=d.memberKind==="attribute"?"attributes":d.memberKind==="property"?"properties":d.memberKind==="event"?"events":d.memberKind==="staticProperty"?"staticProperties":"moduleExports",D=new Map((e.rewrites?.[F]??[]).map(te=>[te.from,te.to])),O=e.upstreamTag?.startsWith("wa-")?"wa-":"sl-",_=D.get(d.member)||(d.memberKind==="event"?Rs(d.member,O):d.member),K=(t?.[F]??[]).find(te=>te.name===d.member),Z=(n?.[F]??[]).find(te=>te.name===_);d.memberKind==="property"&&(t?.attributes??[]).some(te=>te.property===d.member)&&r.push(`${e.upstreamTag}: unreachable property type normalization ${M}`),K?(!ft(K.type)||K.type!==d.upstream)&&r.push(`${e.upstreamTag}: stale upstream type normalization ${M}`):r.push(`${e.upstreamTag}: dangling upstream type normalization ${M}`),Z?Z.type!==d.target?r.push(`${e.upstreamTag}: stale target type normalization ${M}`):K&&ft(K.type)&&(d.memberKind==="event"?ei(Ze(K.type,O),Z.type,s):Nn(Ze(K.type,O),Z.type))&&r.push(`${e.upstreamTag}: stale compatible type normalization ${M}`):r.push(`${e.upstreamTag}: dangling target type normalization ${M}`)}let f=new Map((e.rewrites?.methods??[]).map(d=>[d.from,d.to])),S=new Set;for(let d of s.methodParameterTypeEquivalences??[]){let k=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.method=="string"&&!!d.method.trim()&&typeof d.parameter=="string"&&!!d.parameter.trim()&&typeof d.upstream=="string"&&!!d.upstream.trim()&&d.upstream!==Tt&&typeof d.target=="string"&&!!d.target.trim()&&d.target!==Tt&&d.upstream!==d.target&&k.length===4&&k.every(ce=>["method","parameter","upstream","target"].includes(ce)))){r.push(`${e.upstreamTag}: invalid normalizations.methodParameterTypeEquivalences rule`);continue}let M=`${d.method}:${d.parameter}`;S.has(M)&&r.push(`${e.upstreamTag}: duplicate normalizations.methodParameterTypeEquivalences rule ${M}`),S.add(M),(Fe(d.upstream)||Fe(d.target))&&r.push(`${e.upstreamTag}: unsafe any method-parameter type normalization ${M}`),(Cn(d.upstream)||Cn(d.target))&&r.push(`${e.upstreamTag}: unsafe unknown method-parameter type normalization ${M}`),(Mn(d.upstream)||Mn(d.target))&&r.push(`${e.upstreamTag}: unsafe template interpolation method-parameter type normalization ${M}`);let F=(t?.methods??[]).find(ce=>ce.name===d.method),D=f.get(d.method)||d.method,O=(n?.methods??[]).find(ce=>ce.name===D),_=(F?.overloads??[]).flatMap(ce=>ce.parameters??[]),K=(O?.overloads??[]).flatMap(ce=>ce.parameters??[]),Z=_.find(ce=>ce.name===d.parameter),te=K.find(ce=>ce.name===d.parameter);F?Z?Z.type!==d.upstream&&r.push(`${e.upstreamTag}: stale upstream method-parameter type normalization ${M}`):r.push(`${e.upstreamTag}: dangling upstream method parameter normalization ${M}`):r.push(`${e.upstreamTag}: dangling upstream method-parameter type normalization ${M}`),O?te?te.type!==d.target?r.push(`${e.upstreamTag}: stale target method-parameter type normalization ${M}`):Ze(d.upstream,e.upstreamTag?.startsWith("wa-")?"wa-":"sl-")===te.type&&r.push(`${e.upstreamTag}: stale compatible method-parameter type normalization ${M}`):r.push(`${e.upstreamTag}: dangling target method parameter normalization ${M}`):r.push(`${e.upstreamTag}: dangling target method-parameter type normalization ${M}`)}let p=new Set;for(let d of s.defaultEquivalences??[]){let k=d&&typeof d=="object"?Object.keys(d):[];if(!((d?.memberKind==="attribute"||d?.memberKind==="property")&&typeof d.member=="string"&&!!d.member&&Object.hasOwn(d,"upstream")&&Object.hasOwn(d,"target")&&on(d.upstream)&&on(d.target)&&d.upstream!==d.target&&k.length===4&&k.every(_=>["memberKind","member","upstream","target"].includes(_)))){r.push(`${e.upstreamTag}: invalid normalizations.defaultEquivalences rule`);continue}let M=Ss(d.memberKind,d.member);p.has(M)&&r.push(`${e.upstreamTag}: duplicate normalizations.defaultEquivalences rule ${M}`),p.add(M);let F=d.memberKind==="attribute"?"attributes":"properties",D=(t?.[F]??[]).find(_=>_.name===d.member),O=(n?.[F]??[]).find(_=>_.name===d.member);D?(!D.hasDefault||D.default!==d.upstream)&&r.push(`${e.upstreamTag}: stale upstream default normalization ${M}`):r.push(`${e.upstreamTag}: dangling upstream normalization member ${M}`),O?(!O.hasDefault||O.default!==d.target)&&r.push(`${e.upstreamTag}: stale target default normalization ${M}`):r.push(`${e.upstreamTag}: dangling target normalization member ${M}`)}let N=new Set,T=new Set;for(let d of s.inferredAttributeSuppressions??[]){let k=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.attribute=="string"&&!!d.attribute&&typeof d.property=="string"&&!!d.property&&(d.explicit===void 0||d.explicit===!0)&&k.every(_=>_==="attribute"||_==="property"||_==="explicit"))){r.push(`${e.upstreamTag}: invalid normalizations.inferredAttributeSuppressions rule`);continue}(N.has(d.attribute)||T.has(d.property))&&r.push(`${e.upstreamTag}: duplicate normalizations.inferredAttributeSuppressions rule ${d.attribute}:${d.property}`),N.add(d.attribute),T.add(d.property);let M=(t?.attributes??[]).find(_=>_.name===d.attribute),F=(t?.properties??[]).find(_=>_.name===d.property),D=(n?.attributes??[]).find(_=>_.name===d.attribute),O=(n?.properties??[]).find(_=>_.name===d.property);M?(M.inferred!==!0&&d.explicit!==!0&&r.push(`${e.upstreamTag}: cannot suppress explicit upstream attribute ${d.attribute}`),M.inferred===!0&&d.explicit===!0&&r.push(`${e.upstreamTag}: stale explicit attribute suppression ${d.attribute}`),M.property!==d.property&&r.push(`${e.upstreamTag}: stale inferred attribute property ${d.attribute}:${d.property}`)):r.push(`${e.upstreamTag}: dangling inferred upstream attribute ${d.attribute}`),F||r.push(`${e.upstreamTag}: dangling inferred upstream property ${d.property}`),O||r.push(`${e.upstreamTag}: dangling inferred target property ${d.property}`),D&&r.push(`${e.upstreamTag}: stale inferred attribute suppression ${d.attribute}`)}let C=new Set;for(let d of s.derivedDefaultEquivalences??[]){let k=d&&typeof d=="object"?Object.keys(d):[];if(!((d?.memberKind==="attribute"||d?.memberKind==="property")&&typeof d.member=="string"&&!!d.member&&Object.hasOwn(d,"upstream")&&Object.hasOwn(d,"target")&&on(d.upstream)&&on(d.target)&&k.length===4&&k.every(_=>["memberKind","member","upstream","target"].includes(_)))){r.push(`${e.upstreamTag}: invalid normalizations.derivedDefaultEquivalences rule`);continue}let M=Ss(d.memberKind,d.member);C.has(M)&&r.push(`${e.upstreamTag}: duplicate normalizations.derivedDefaultEquivalences rule ${M}`),C.add(M);let F=d.memberKind==="attribute"?"attributes":"properties",D=(t?.[F]??[]).find(_=>_.name===d.member),O=(n?.[F]??[]).find(_=>_.name===d.member);D?(!D.hasDefault||D.default!==d.upstream)&&r.push(`${e.upstreamTag}: stale derived upstream default ${M}`):r.push(`${e.upstreamTag}: dangling derived-default upstream member ${M}`),O?O.hasDefault&&r.push(`${e.upstreamTag}: stale derived target default ${M}`):r.push(`${e.upstreamTag}: dangling derived-default target member ${M}`)}let I=new Set;for(let d of s.unknownMethodReturnTypes??[]){let k=d&&typeof d=="object"?Object.keys(d):[];if(!(typeof d?.method=="string"&&!!d.method&&k.length===1&&k[0]==="method")){r.push(`${e.upstreamTag}: invalid normalizations.unknownMethodReturnTypes rule`);continue}I.has(d.method)&&r.push(`${e.upstreamTag}: duplicate normalizations.unknownMethodReturnTypes rule ${d.method}`),I.add(d.method);let M=(t?.methods??[]).find(D=>D.name===d.method),F=(n?.methods??[]).find(D=>D.name===d.method);M?(M.overloads??[]).some(D=>D.returnType==="unknown"||D.returnType===Tt)||r.push(`${e.upstreamTag}: stale unknown-return normalization ${d.method}`):r.push(`${e.upstreamTag}: dangling unknown-return upstream method ${d.method}`),F?(F.overloads??[]).every(D=>D.returnType==="unknown"||D.returnType===Tt)&&r.push(`${e.upstreamTag}: stale concrete target return normalization ${d.method}`):r.push(`${e.upstreamTag}: dangling unknown-return target method ${d.method}`)}let W=new Set,$=e.upstreamTag?.startsWith("sl-")?"sl-":"wa-",L=new Map((e.rewrites?.events??[]).map(d=>[d.from,d.to]));for(let[d,k]of[["cancelabilityEquivalences",["event","upstream","target"]],["cancelabilityPathAdditions",["event","upstream","target","addedPath"]]])for(let j of s[d]??[]){let M=j&&typeof j=="object"?Object.keys(j):[];if(!(typeof j?.event=="string"&&!!j.event&&an.has(j.upstream)&&an.has(j.target)&&M.length===k.length&&M.every(K=>k.includes(K))&&(d==="cancelabilityEquivalences"?an.get(j.target)>an.get(j.upstream):j.upstream==="always"&&j.target==="conditional"&&typeof j.addedPath=="string"&&!!j.addedPath))){r.push(`${e.upstreamTag}: invalid normalizations.${d} rule`);continue}W.has(j.event)&&r.push(`${e.upstreamTag}: duplicate cancelability normalization ${j.event}`),W.add(j.event);let D=(t?.events??[]).find(K=>K.name===j.event),O=L.get(j.event)||Rs(j.event,$),_=(n?.events??[]).find(K=>K.name===O);D?D.cancelable!==j.upstream&&r.push(`${e.upstreamTag}: stale upstream cancelability normalization ${j.event}`):r.push(`${e.upstreamTag}: dangling upstream cancelability normalization ${j.event}`),_?_.cancelable!==j.target&&r.push(`${e.upstreamTag}: stale target cancelability normalization ${j.event}`):r.push(`${e.upstreamTag}: dangling target cancelability normalization ${j.event}`)}return r.sort()}c(ni,"validateMappingNormalizations");function br(e,t){return JSON.stringify(e)===JSON.stringify(t)}c(br,"sameJson");function ri(e){let t=[];if(!Array.isArray(e?.localMigrations))return["localMigrations must be an array"];let n=new Set(vr),r=new Map((e.components??[]).map(o=>[o.tag,o])),s=new Set;for(let o of e.localMigrations){if(!o||typeof o!="object"||Array.isArray(o)){t.push("localMigrations entries must be objects");continue}let i=Object.keys(o).filter(h=>h!=="origin"&&h!=="tag"&&h!=="defaults");i.length&&t.push(`local migration has unknown key(s) ${i.join(", ")}`),n.has(o.origin)||t.push(`local migration has unknown origin ${String(o.origin)}`),(typeof o.tag!="string"||!o.tag.startsWith("lr-"))&&t.push(`local migration needs a valid lr-* tag, got ${String(o.tag)}`);let a=`${String(o.origin)}:${String(o.tag)}`;s.has(a)&&t.push(`duplicate local migration ${a}`),s.add(a);let l=r.get(o.tag);if(l||t.push(`${a}: target tag is not registered`),!Array.isArray(o.defaults)||o.defaults.length===0){t.push(`${a}: defaults must be a non-empty array`);continue}let u=new Map((l?.surface?.attributes??[]).map(h=>[h.name,h])),m=new Set;for(let h of o.defaults){if(!h||typeof h!="object"||Array.isArray(h)){t.push(`${a}: default rules must be objects`);continue}let y=Object.keys(h).filter(E=>!["memberKind","member","action","value"].includes(E));if(y.length&&t.push(`${a}: default rule has unknown key(s) ${y.join(", ")}`),h.memberKind!=="attribute"&&t.push(`${a}: local defaults support only attribute members`),h.action!=="insert-if-absent"&&t.push(`${a}: local defaults support only insert-if-absent`),typeof h.member!="string"||!h.member){t.push(`${a}: default rule needs a member`);continue}m.has(h.member)&&t.push(`${a}: duplicate default member ${h.member}`),m.add(h.member);let w=u.get(h.member);w||t.push(`${a}: unknown target attribute ${h.member}`),Object.hasOwn(h,"value")?typeof h.value!="string"&&typeof h.value!="boolean"&&!(typeof h.value=="number"&&Number.isFinite(h.value))?t.push(`${a}: ${h.member} value must be a finite string, number, or boolean`):h.value===!1?t.push(`${a}: false boolean insertion requires explicit converter evidence`):h.value===!0&&!String(w?.type).includes("boolean")&&t.push(`${a}: true presence insertion requires a boolean target attribute ${h.member}`):t.push(`${a}: ${h.member} needs a value`)}}return t}c(ri,"validateLocalMigrations");xn();var Cs=qt.dirname(Uu(import.meta.url)),Ms=qt.resolve(Cs,".."),_s=qt.join(Cs,gr),ci=jn.existsSync(_s)?_s:qt.join(Cs,"migration-contract.json"),zn=jn.existsSync(ci),si=zn?ci:qt.join(Ms,"scripts","fixtures","component-inventory.json");function li(){let e=jn.readFileSync(si),t=si===_s?yr(e):e;return JSON.parse(t.toString("utf8"))}c(li,"readMigrationInventory");var Hu=qt.join(Ms,"scripts","fixtures","lyra-renames.json"),Er=3,Sr=Object.freeze([...vr,...Ft]),Xe=new Set(["exact","rewritten"]),Ju=new Set(["exact","rewritten","warning-required","conceptual-only","unsupported"]),ui=["attributes","properties","events","slots","parts","cssProperties","methods"],Os=[...ui,"defaults"],Is=["webawesome","shoelace"],oi=new Set(["free","pro"]),Gu=new Set(["reviewed","tag-only","unreviewed"]),Yu=new Set(["not-applicable","surface-only","warning-required","unreviewed"]),Zu=new Set(["all","granular","unavailable"]),Xu=new Set(["wa-random-content"]);function U(e,t){if(!e)throw new Error(`Invalid component inventory migration contract: ${t}`)}c(U,"invariant");function xr(e,t){return new Set((e?.surface?.[t]??[]).map(n=>n.name))}c(xr,"surfaceNames");function Ns(e){return e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)}c(Ns,"isScalar");function ai(e,t,n,r){let s=e.rewrites[r];U(Array.isArray(s),`${e.upstreamTag}: rewrites.${r} must be an array`);let o=xr(t,r),i=xr(n,r),a=new Set;for(let l of s){U(l&&typeof l.from=="string"&&l.from&&typeof l.to=="string"&&l.to,`${e.upstreamTag}: every rewrites.${r} rule needs non-empty from/to`);let u=Object.keys(l).filter(m=>m!=="from"&&m!=="to"&&m!=="value");U(u.length===0,`${e.upstreamTag}: rewrites.${r} rule has unknown key(s) ${u.join(", ")}`),U(l.value===void 0||["attributes","properties"].includes(r)&&typeof l.value=="string"&&l.value,`${e.upstreamTag}: rewrites.${r} value is only supported as a non-empty attribute/property string`),U(l.from!==l.to,`${e.upstreamTag}: rewrites.${r} cannot map a member to itself`),U(!a.has(l.from),`${e.upstreamTag}: duplicate rewrites.${r} source ${l.from}`),a.add(l.from),U(o.has(l.from),`${e.upstreamTag}: unknown ${r} source ${l.from}`),U(i.has(l.to),`${e.upstreamTag}: unknown target ${r} member ${l.to}`)}}c(ai,"validateMemberRules");function ii(e,t,n){let r=e.rewrites.defaults;U(Array.isArray(r),`${e.upstreamTag}: rewrites.defaults must be an array`);let s=new Set;for(let o of r){U(o?.memberKind==="attribute"||o?.memberKind==="property",`${e.upstreamTag}: default memberKind must be attribute or property`),U(typeof o.member=="string"&&o.member,`${e.upstreamTag}: default rule needs member`),U(o.action==="insert-if-absent"||o.action==="replace-value",`${e.upstreamTag}: unsupported default action ${String(o.action)}`);let i=o.action==="insert-if-absent"?new Set(["memberKind","member","action","value"]):new Set(["memberKind","member","action","from","to"]),a=Object.keys(o).filter(m=>!i.has(m));U(a.length===0,`${e.upstreamTag}: default rule has unknown key(s) ${a.join(", ")}`);let l=`${o.memberKind}:${o.member}:${o.action}`;U(!s.has(l),`${e.upstreamTag}: duplicate default rule ${l}`),s.add(l);let u=o.memberKind==="attribute"?"attributes":"properties";U(xr(n,u).has(o.member),`${e.upstreamTag}: unknown target ${l}`),o.action==="insert-if-absent"?(U(o.memberKind==="attribute",`${e.upstreamTag}: insert-if-absent is only deterministic for attributes`),U(Object.hasOwn(o,"value"),`${e.upstreamTag}: ${l} needs value`),U(Ns(o.value),`${e.upstreamTag}: ${l} value must be a scalar`),U(!Object.hasOwn(o,"from")&&!Object.hasOwn(o,"to"),`${e.upstreamTag}: ${l} cannot use from/to`)):(U(xr(t,u).has(o.member),`${e.upstreamTag}: unknown source ${l}`),U(Object.hasOwn(o,"from")&&Object.hasOwn(o,"to"),`${e.upstreamTag}: ${l} needs from/to`),U(Ns(o.from)&&Ns(o.to),`${e.upstreamTag}: ${l} from/to must be scalars`),U(o.from!==o.to,`${e.upstreamTag}: ${l} cannot replace a value with itself`),U(!Object.hasOwn(o,"value"),`${e.upstreamTag}: ${l} cannot use value`))}}c(ii,"validateDefaultRules");function Qu(e,t){let n={"missing-attribute":"attributes","polarity-mismatch":"attributes","missing-property":"properties","missing-event":"events","missing-slot":"slots","missing-part":"parts","missing-css-property":"cssProperties","missing-method":"methods"};if(t.code==="default-mismatch")return e.rewrites.defaults.some(s=>s.member===t.member);let r=n[t.code];return!!(r&&e.rewrites[r].some(s=>s.from===t.member))}c(Qu,"driftCovered");function ep(e,t){let n=Array.isArray(e.rewrites?.[t])?e.rewrites[t]:[];return{source:{surface:{[t]:n.map(r=>({name:r?.from}))}},target:{surface:{[t]:n.map(r=>({name:r?.to}))}}}}c(ep,"runtimeMemberSurfaces");function tp(e){let t={surface:{attributes:[],properties:[]}},n={surface:{attributes:[],properties:[]}},r=Array.isArray(e.rewrites?.defaults)?e.rewrites.defaults:[];for(let s of r){let o=s?.memberKind==="attribute"?"attributes":"properties";n.surface[o].push({name:s?.member}),s?.action==="replace-value"&&t.surface[o].push({name:s?.member})}return{source:t,target:n}}c(tp,"runtimeDefaultSurfaces");function kr(e,{renameLedger:t=null,exportDeprecations:n=[],lyraVersion:r=null,compatibilityContext:s=null}={}){U(e?.schemaVersion===1,"schemaVersion must be 1");let o=Object.hasOwn(e,"migrationRuntimeSchemaVersion");if(o){U(e.migrationRuntimeSchemaVersion===Er,`migrationRuntimeSchemaVersion must be ${Er}`),U(t===null,"a packaged runtime inventory carries its own rename projection");let f=vn(e.lyraRenames,{projected:!0});U(f.length===0,f.join("; "))}let i=ba(o?e.lyraRenames:t?En(t,e,{exportDeprecations:n,compatibilityContext:s}):pa(),{lyraVersion:r});U(Array.isArray(e.components),"components must be an array"),U(Array.isArray(e.mappings),"mappings must be an array"),U(e.upstreams&&typeof e.upstreams=="object","upstreams must be an object");let a=Ha(e.accessibilityProfiles,e.mappings);U(a.length===0,a.join("; "));let l=new Map;for(let f of e.components){U(typeof f.tag=="string"&&f.tag,"every Lyra component needs a tag"),U(!l.has(f.tag),`duplicate Lyra component ${f.tag}`),U(typeof f.registrationModule=="string"&&f.registrationModule.endsWith(".ts"),`${f.tag}: registrationModule must end in .ts`),Object.hasOwn(f,"rootIncluded")&&U(typeof f.rootIncluded=="boolean",`${f.tag}: rootIncluded must be boolean`),Object.hasOwn(f,"optionalPeers")&&(U(Array.isArray(f.optionalPeers),`${f.tag}: optionalPeers must be an array`),U(f.optionalPeers.every(p=>typeof p=="string"&&p),`${f.tag}: optionalPeers entries must be non-empty package names`));let S=f.registrationRoute??s?.componentRegistrationRoutes?.[f.tag];S!==void 0&&U(S===`./components/${f.tag}.js`,`${f.tag}: registrationRoute must be its stable tag-shaped package entry`),l.set(f.tag,S===void 0?f:{...f,registrationRoute:S})}let u=ri(e);U(u.length===0,u.join("; "));let m=new Map(vr.map(f=>[f,new Map]));for(let f of e.localMigrations)m.get(f.origin).set(f.tag,f);let h=new Map,y=new Map,w=new Map(Is.map(f=>[f,[]])),E=!1;for(let f of Is){let S=e.upstreams[f],p=S?.components;U(Array.isArray(p),`${f}: upstream components must be an array`);let N=Array.isArray(S?.packages)?S.packages:typeof S?.package=="string"&&S.package?[{name:S.package,tiers:["free","pro"]}]:[];Array.isArray(S?.packages)&&(E=!0),U(N.length>0,`${f}: packages must contain at least one identity`);for(let T of N){U(T&&typeof T.name=="string"&&T.name,`${f}: package identity needs a non-empty name`),U(!y.has(T.name),`duplicate package identity ${T.name}`),U(Array.isArray(T.tiers)&&T.tiers.length>0,`${T.name}: tiers must be a non-empty array`),U(T.tiers.every(I=>oi.has(I)),`${T.name}: tiers contain an unsupported value`),U(new Set(T.tiers).size===T.tiers.length,`${T.name}: tiers contain duplicates`);let C={ecosystem:f,tiers:new Set(T.tiers)};y.set(T.name,C),w.get(f).push({name:T.name,tiers:C.tiers})}for(let T of p)U(!h.has(T.tag),`duplicate upstream component ${T.tag}`),Object.hasOwn(T,"tier")&&(U(oi.has(T.tier),`${T.tag}: unsupported package tier`),U(w.get(f).some(C=>C.tiers.has(T.tier)),`${T.tag}: no ${f} package identity provides tier ${T.tier}`)),h.set(T.tag,{ecosystem:f,component:T})}let x=new Map;for(let f of e.mappings){U(typeof f.upstreamTag=="string"&&f.upstreamTag,"every mapping needs upstreamTag"),U(!x.has(f.upstreamTag),`duplicate mapping ${f.upstreamTag}`),U(Ju.has(f.classification),`${f.upstreamTag}: invalid classification`),U(f.upstream==="webawesome"||f.upstream==="shoelace",`${f.upstreamTag}: invalid upstream`);let S=h.get(f.upstreamTag);U(S?.ecosystem===f.upstream,`${f.upstreamTag}: missing upstream surface`);let p=l.get(f.targetTag);Xe.has(f.classification)&&U(p,`${f.upstreamTag}: automatic mapping needs a registered target`),U(f.rewrites&&typeof f.rewrites=="object",`${f.upstreamTag}: rewrites missing`);let N=Object.keys(f.rewrites).filter(T=>!Os.includes(T));U(N.length===0,`${f.upstreamTag}: unknown rewrite section(s) ${N.join(", ")}`);for(let T of ui)if(o){let C=ep(f,T);ai(f,C.source,C.target,T)}else ai(f,S.component,p,T);if(o){let T=tp(f);ii(f,T.source,T.target),U(!Object.hasOwn(f,"normalizations")&&!Object.hasOwn(f,"drift"),`${f.upstreamTag}: packaged runtime mappings cannot carry analyzer-only data`)}else{ii(f,S.component,p);let T=ni(f,{upstream:S.component.surface,target:p?.surface});U(T.length===0,T.join("; ")),U(Array.isArray(f.drift),`${f.upstreamTag}: drift must be an array`)}if(E){let T=f.parity;U(T&&typeof T=="object"&&!Array.isArray(T),`${f.upstreamTag}: parity missing`);let C=Object.keys(T).filter(L=>!["staticApi","lightDom","runtime","behaviorReviewFlags","accessibility","methodEdges"].includes(L));U(C.length===0,`${f.upstreamTag}: parity has unknown key(s) ${C.join(", ")}`),U(Gu.has(T.staticApi),`${f.upstreamTag}: invalid parity.staticApi`),U(Yu.has(T.lightDom),`${f.upstreamTag}: invalid parity.lightDom`),U(Array.isArray(T.behaviorReviewFlags)&&T.behaviorReviewFlags.every(L=>typeof L=="string"&&L)&&new Set(T.behaviorReviewFlags).size===T.behaviorReviewFlags.length,`${f.upstreamTag}: parity.behaviorReviewFlags must contain unique non-empty strings`),U(T.runtime&&typeof T.runtime=="object"&&!Array.isArray(T.runtime),`${f.upstreamTag}: parity.runtime missing`),U(Object.keys(T.runtime).every(L=>L==="registration"||L==="optionalPeers"),`${f.upstreamTag}: parity.runtime has unknown keys`),U(Zu.has(T.runtime.registration),`${f.upstreamTag}: invalid parity.runtime.registration`),U(Array.isArray(T.runtime.optionalPeers),`${f.upstreamTag}: parity.runtime.optionalPeers must be an array`);let I=p?p.rootIncluded===!1?"granular":"all":"unavailable";U(T.runtime.registration===I,`${f.upstreamTag}: parity runtime registration is stale`);let W=[...p?.optionalPeers??[]].sort();U(JSON.stringify([...T.runtime.optionalPeers].sort())===JSON.stringify(W),`${f.upstreamTag}: parity runtime optional peers are stale`);let $=Ja(f,o?{}:{upstream:S.component.surface,target:p?.surface});U($.length===0,$.join("; ")),Xe.has(f.classification)&&(T.behaviorReviewFlags.length>0?U(f.classification==="rewritten"&&Xu.has(f.upstreamTag)&&T.lightDom==="warning-required",`${f.upstreamTag}: automatic behavior review lacks a registered conditional scanner`):U(T.lightDom!=="warning-required"&&T.lightDom!=="unreviewed",`${f.upstreamTag}: automatic mapping cannot require unscoped light-DOM review`))}if(!o&&p&&S.component.review?.status==="complete"){let T=ti(S.component.surface,p.surface,{upstreamPrefix:f.upstream==="webawesome"?"wa-":"sl-",rewrites:f.rewrites,normalizations:f.normalizations});U(JSON.stringify(f.drift)===JSON.stringify(T),`${f.upstreamTag}: stored surface drift is stale`)}f.classification==="exact"&&(o||U(f.drift.length===0,`${f.upstreamTag}: exact mapping has surface drift`),U(Os.every(T=>f.rewrites[T].length===0),`${f.upstreamTag}: exact mapping cannot declare rewrite rules`)),f.classification==="rewritten"&&(U(Os.some(T=>f.rewrites[T].length>0),`${f.upstreamTag}: rewritten mapping needs at least one deterministic rule`),o||U(f.drift.every(T=>Qu(f,T)),`${f.upstreamTag}: rewritten mapping contains drift without a deterministic rule`)),x.set(f.upstreamTag,{...f,drift:f.drift??[],source:S.component,target:p})}U(x.size===h.size,"every upstream tag must have exactly one mapping");for(let f of h.keys())U(x.has(f),`${f}: missing mapping`);return{inventory:e,components:l,mappings:x,upstreamComponents:h,localMigrations:m,renameProfiles:i,packageIdentities:y,packagesByEcosystem:w}}c(kr,"buildMigrationContract");function np(e,{renameLedger:t,exportDeprecations:n=[],compatibilityContext:r=null}={}){U(!Object.hasOwn(e??{},"migrationRuntimeSchemaVersion"),"cannot project an already-packaged migration runtime inventory"),U(t&&typeof t=="object","createMigrationRuntimeInventory needs the rename ledger"),kr(e,{renameLedger:t,exportDeprecations:n,compatibilityContext:r});let s=new Set(e.mappings.map(i=>i.targetTag).filter(Boolean)),o=new Map;for(let i of e.localMigrations){s.add(i.tag);let a=o.get(i.tag)??new Set;for(let l of i.defaults)a.add(l.member);o.set(i.tag,a)}return{schemaVersion:1,migrationRuntimeSchemaVersion:Er,accessibilityProfiles:structuredClone(e.accessibilityProfiles),components:e.components.filter(i=>s.has(i.tag)).map(i=>({tag:i.tag,registrationModule:i.registrationModule,...r?.componentRegistrationRoutes?.[i.tag]?{registrationRoute:r.componentRegistrationRoutes[i.tag]}:{},rootIncluded:i.rootIncluded,optionalPeers:structuredClone(i.optionalPeers??[]),surface:{attributes:(i.surface?.attributes??[]).filter(a=>o.get(i.tag)?.has(a.name)).map(a=>({name:a.name,type:a.type})),cssStates:(i.surface?.cssStates??[]).filter(a=>Object.values(An).includes(a.name)).map(a=>({name:a.name}))}})),localMigrations:structuredClone(e.localMigrations),upstreams:Object.fromEntries(Is.map(i=>{let a=e.upstreams[i];return[i,{packages:structuredClone(a.packages),components:a.components.map(l=>({tag:l.tag,tier:l.tier}))}]})),mappings:e.mappings.map(i=>({upstream:i.upstream,upstreamTag:i.upstreamTag,targetTag:i.targetTag,classification:i.classification,rationale:i.rationale,parity:structuredClone(i.parity),rewrites:structuredClone(i.rewrites)})),lyraRenames:En(t,e,{exportDeprecations:n,compatibilityContext:r})}}c(np,"createMigrationRuntimeInventory");function js(e=Hu){return JSON.parse(jn.readFileSync(e,"utf8"))}c(js,"readRenameLedger");function zs(e=qt.join(Ms,"scripts","fixtures","component-metadata.json")){let t=JSON.parse(jn.readFileSync(e,"utf8")).exportDeprecations;return U(Array.isArray(t),"component metadata must contain exportDeprecations"),t}c(zs,"readExportDeprecations");function rp(e){let t=new Map,n=[],r=null,s=c((o,i)=>{t.has(o)&&t.get(o)!==i?n.push(`${o}: already mapped to ${t.get(o)}, also saw ${i}`):t.set(o,i)},"setMapping");for(let o of e.split(`
18
+ `)){let i=o.trim();if(/^\|\s*Component\s*\|\s*Mirrors\s*\|\s*Notes\s*\|$/.test(i)){r="wa";continue}if(/^\|\s*Shoelace\s*\|\s*Lyra\s*\|\s*Migration note\s*\|$/.test(i)){r="sl";continue}if(!i.startsWith("|")){r=null;continue}if(!r)continue;let a=i.split("|").slice(1,-1).map(h=>h.trim());if(a.length<2)continue;if(r==="sl"){let h=[...a[0].matchAll(/<sl-([a-z0-9-]+)>/g)].map(w=>w[1]),y=new Set([...a[1].matchAll(/<lr-([a-z0-9-]+)>/g)].map(w=>w[1]));for(let w of h)y.has(w)&&s(`sl-${w}`,`lr-${w}`);continue}let l=[...a[0].matchAll(/<lr-([a-z0-9-]+)>/g)].map(h=>h[1]),u=[...a[1].matchAll(/`((?:wa|sl)-[a-z0-9-]+\*?)`/g)].map(h=>h[1]);if(!l.length||!u.length)continue;let m=new Set;for(let h of l)for(let y of["wa","sl"]){let w=`${y}-${h}`;if(u.includes(w))s(w,`lr-${h}`),m.add(w);else{let E=u.find(x=>x.endsWith("*")&&w.startsWith(x.slice(0,-1)));E&&(s(w,`lr-${h}`),m.add(E))}}if(l.length===1)for(let h of u)!m.has(h)&&!h.endsWith("*")&&s(h,`lr-${l[0]}`)}return{map:t,conflicts:n}}c(rp,"buildMirrorMap");import Pn from"node:path";function Tr(e,t,n=e.length){let r=t+4;if(r<n&&e[r]===">")return r+1;if(r+1<n&&e.startsWith("->",r))return r+2;for(let s=r;s<n;s+=1){if(s+3<=n&&e.startsWith("-->",s))return s+3;if(s+4<=n&&e.startsWith("--!>",s))return s+4}return n}c(Tr,"htmlCommentEnd");function _r(e){return e.startsWith("wa-")?"webawesome":"shoelace"}c(_r,"ecosystemForTag");function Bn(e){let t=[0];for(let n=0;n<e.length;n+=1)e[n]===`
19
+ `&&t.push(n+1);return t}c(Bn,"lineStarts");function Wt(e,t){let n=0,r=e.length;for(;n+1<r;){let s=Math.floor((n+r)/2);e[s]<=t?n=s:r=s}return{line:n+1,column:t-e[n]+1}}c(Wt,"locationAt");function yt({textStarts:e,file:t,offset:n,origin:r,upstreamTag:s,upstreamMember:o=null,action:i,target:a=null,warningCode:l=null,behaviorReviewFlags:u=null,message:m}){let h=Wt(e,n),y={file:t,line:h.line,column:h.column,origin:r,upstreamTag:s,upstreamMember:o,action:i,target:a,warningCode:l,message:m};return u?.length&&(y.behaviorReviewFlags=Object.freeze([...u])),y}c(yt,"reportEntry");function Kt(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){let r=Tr(e,n);t.push([n,r]),n=r;continue}if(e.startsWith("/*",n)){let r=e.indexOf("*/",n+2),s=r<0?e.length:r+2;t.push([n,s]),n=s;continue}if(e.startsWith("//",n)){let r=e.indexOf(`
20
+ `,n+2),s=r<0?e.length:r;t.push([n,s]),n=s;continue}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n++];for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]===r){n+=1;break}else n+=1;continue}n+=1}return t}c(Kt,"commentRanges");function ae(e,t){return t.some(([n,r])=>e>=n&&e<r)}c(ae,"insideRanges");function Te(e,t){let n=0;for(;n<e.length;){let r=e[n];if(r!=='"'&&r!=="'"&&r!=="`"){n+=1;continue}let s=n,o=r;for(n+=1;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]===o){n+=1;break}else n+=1;if(t>=s&&t<n)return[s,n]}return null}c(Te,"quotedRangeContaining");function bi(e){let t=[];for(let n of e.matchAll(/<style(?:\s[^>]*)?>(?<body>[\s\S]*?)<\/style\s*>/gi)){let r=Te(e,n.index);if(!r||e[r[0]]!=="`"||!/\bhtml\s*$/.test(e.slice(0,r[0]))||Ir(e,r[0],n.index))continue;let s=n.index+n[0].indexOf(n.groups.body);t.push([s,s+n.groups.body.length])}return t}c(bi,"htmlTemplateStyleRanges");function Ir(e,t,n){let r=0;for(let s=t+1;s<n;s+=1){if(e[s]==="\\"){s+=1;continue}if(r===0){if(e.startsWith("${",s))r=1,s+=1;else if(e[s]==="`")return!1;continue}if(e[s]==='"'||e[s]==="'"){let o=e[s];for(s+=1;s<n&&e[s]!==o;)e[s]==="\\"&&(s+=1),s+=1;continue}if(e.startsWith("//",s)){let o=e.indexOf(`
21
+ `,s+2);s=o<0||o>=n?n:o;continue}if(e.startsWith("/*",s)){let o=e.indexOf("*/",s+2);s=o<0||o>=n?n:o+1;continue}e[s]==="{"?r+=1:e[s]==="}"&&(r=Math.max(0,r-1))}return r>0}c(Ir,"insideTemplateExpression");function un(e,t){let n=null,r=0;for(let s=t;s<e.length;s+=1){let o=e[s];if(n){o==="\\"?s+=1:o===n&&(n=null);continue}if(o==='"'||o==="'"||o==="`"){n=o;continue}if(o==="{")r+=1;else if(o==="}")r=Math.max(0,r-1);else if(o===">"&&r===0)return s}return-1}c(un,"findTagEnd");function wi(e,t){let n=[],r=/<(?<closing>\/)?(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)(?=[\s/>])/g;for(let s of e.matchAll(r)){if(ae(s.index,t))continue;let o=!!s.groups.closing,i=s.index+1+(o?1:0),a=un(e,s.index+s[0].length);a<0||n.push({tag:s.groups.tag,start:s.index,nameStart:i,nameEnd:i+s.groups.tag.length,end:a,closing:o,selfClosing:!o&&/\/\s*>$/.test(e.slice(s.index,a+1))})}return n}c(wi,"scanMarkupTags");function Vn(e,t,n=r=>ae(r,t)){let r=[],s=/<(?<tag>[a-z][a-z0-9.-]*)(?=[\s/>])/gi;for(let o of e.matchAll(s)){if(n(o.index))continue;let i=un(e,o.index+o[0].length);if(i<0)continue;let a=o.index+1;r.push({tag:o.groups.tag,start:o.index,nameStart:a,nameEnd:a+o.groups.tag.length,end:i,closing:!1,selfClosing:/\/\s*>$/.test(e.slice(o.index,i+1))})}return r}c(Vn,"scanAllOpeningTags");var Ln="construction",Dn="lookup",$e="[$A-Z_a-z][$\\w]*";function Fn(e){let t=e.trim();for(;t.startsWith("(")&&gt(t,0,"(",")")===t.length;)t=t.slice(1,-1).trim();return t.replace(/\?\.\s*\[\s*(['"])([$A-Z_a-z][$\w]*)\1\s*\]/g,".$2").replace(/\[\s*(['"])([$A-Z_a-z][$\w]*)\1\s*\]/g,".$2").replace(/\s*(?:\?\.|\.)\s*/g,".")}c(Fn,"normalizedMemberExpression");function $i(e){let[t,...n]=e.split("."),r=c(s=>`(?:${s}\\s*!?|\\(\\s*${s}\\s+as\\s+[^;\\n]+?\\)\\s*!?)`,"wrapped");return n.reduce((s,o)=>{let i=Se(o);return r(`${s}(?:\\s*(?:\\.|\\?\\.)\\s*${i}|\\s*(?:\\?\\.)?\\s*\\[\\s*(?:'${i}'|"${i}"|\\x60${i}\\x60)\\s*\\])`)},r(Se(t)))}c($i,"memberExpressionPattern");function sp(e,t){let n=Fn(e);if(t.has(n))return n;let r=e.trim();for(let s of t.keys())if(new RegExp(`^(?:${$i(s)})$`).test(r))return s;return n}c(sp,"canonicalFactoryExpression");function Ds(e,t,n,r,s=!0){let o=Fn(e),i=o.match(/^(?<target>.+)\.bind\s*\([^()]*\)$/s);if(i&&(o=Fn(i.groups.target)),t.has(o))return t.get(o);if(o==="createElement"&&s)return Ln;for(let a of n)if(o===`${a}.createElement`)return Ln;for(let a of r)if(o===`${a}.get`||o===`${a}.whenDefined`)return Dn;return null}c(Ds,"classifyFactoryExpression");function op(e,t,n,r,s=!0){let o=Ds(e,t,n,r,s);if(o)return o;let i=e.match(new RegExp(`^(?:async\\s+)?(?:\\(\\s*(?<parameter>${$e})[^)]*\\)|(?<bare>${$e}))\\s*=>\\s*(?<body>.+)$`,"s"));if(!i)return null;let a=i.groups.parameter??i.groups.bare,u=i.groups.body.trim().replace(/^\{\s*return\s+/,"").replace(/\s*\}$/,"").trim().match(new RegExp(`^(?<factory>${$e}(?:\\s*\\.\\s*${$e})*)\\s*\\(\\s*${Se(a)}\\s*\\)$`));return u?Ds(u.groups.factory,t,n,r,s):null}c(op,"classifyFactoryInitializer");function Fs(e){let t=[];for(let n of e.split(",")){let r=n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n\r]*/g,"").trim();if(!r||r.startsWith("..."))continue;let s=r.match(new RegExp(`^(?<property>${$e})(?:\\s*:\\s*(?<local>${$e}))?(?:\\s*=.*)?$`));s&&t.push({property:s.groups.property,local:s.groups.local??s.groups.property})}return t}c(Fs,"parseDestructuredBindings");function ap(e){let t=[],n=[];for(let r=0;r<e.length;r+=1){if(e.startsWith("//",r)){let o=e.indexOf(`
22
+ `,r+2);r=o<0?e.length:o;continue}if(e.startsWith("/*",r)){let o=e.indexOf("*/",r+2);r=o<0?e.length:o+1;continue}let s=e[r];if(s==='"'||s==="'"||s==="`"){let o=s;for(r+=1;r<e.length;)if(e[r]==="\\")r+=2;else{if(e[r]===o)break;r+=1}continue}s==="{"?t.push(r):s==="}"&&t.length>0&&n.push([t.pop(),r+1])}return n}c(ap,"codeBraceRanges");function ip(e,t){return new RegExp(`(?<![$\\w])${Se(t)}(?![$\\w])`).test(e)}c(ip,"identifierAppears");function Bs(e,t,n){let r=null;for(let s of e)s[0]>=t||s[1]<=t||(!r||s[1]-s[0]<r[1]-r[0])&&(r=s);return r??[0,n]}c(Bs,"enclosingBraceRange");function pi(e,t){let n={"(":")","[":"]","{":"}"},r=[],s=null;for(let o=0;o<e.length;o+=1){let i=e[o];if(s){i==="\\"?o+=1:i===s&&(s=null);continue}if(i==='"'||i==="'"||i==="`"){s=i;continue}if(Object.hasOwn(n,i))r.push(n[i]);else if(r.at(-1)===i)r.pop();else if(r.length===0&&i===t)return o}return-1}c(pi,"topLevelIndex");function di(e,t){let n=e;for(;n;){let r=pi(n,","),s=(r<0?n:n.slice(0,r)).trim(),o=pi(s,"="),i=(o<0?s:s.slice(0,o)).trim(),a=i.replace(/^\.\.\.\s*/,"");if(new RegExp(`^(?:(?:public|private|protected|readonly|override)\\s+)*(?:\\.\\.\\.\\s*)?${Se(t)}(?=\\s*(?:[?:]|$))`).test(i)||(a.startsWith("{")||a.startsWith("["))&&ip(a,t))return!0;if(r<0)break;n=n.slice(r+1)}return!1}c(di,"parameterListBindsName");function Rr(e,t){let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n+=1;continue}if(e.startsWith("//",n)){let r=e.indexOf(`
23
+ `,n+2);n=r<0?e.length:r+1;continue}if(e.startsWith("/*",n)){let r=e.indexOf("*/",n+2);n=r<0?e.length:r+2;continue}break}return n}c(Rr,"nextCodeIndex");function cp(e,t){let n=0,r=null;for(let s=t;s<e.length;s+=1){let o=e[s];if(r){o==="\\"?s+=1:o===r&&(r=null);continue}if(e.startsWith("//",s)){let i=e.indexOf(`
24
+ `,s+2);s=i<0?e.length:i;continue}if(e.startsWith("/*",s)){let i=e.indexOf("*/",s+2);s=i<0?e.length:i+1;continue}if(o==='"'||o==="'"||o==="`"){r=o;continue}if(o==="<")n+=1;else if(o===">"&&e[s-1]!=="="){if(n-=1,n===0)return s;if(n<0)return-1}}return-1}c(cp,"matchingTypeParameterEnd");function lp(e){let t=e.trimEnd();if(!t.endsWith(">"))return t;for(let n=0;n<t.length;n+=1)if(!(t[n]!=="<"||Te(t,n))&&cp(t,n)===t.length-1)return t.slice(0,n).trimEnd();return t}c(lp,"stripTrailingTypeParameters");function up(e,t,n){let r=[],s=c((i,a,l)=>{if(!a)return;let u=`${a[0]}:${a[1]}:${i}`;r.some(m=>m.key===u)||r.push({key:u,parameters:i,parameterRange:l,body:a})},"remember");for(let i=e.indexOf("(");i>=0;i=e.indexOf("(",i+1)){if(ae(i,t)||Te(e,i))continue;let a=gt(e,i,"(",")");if(a<=i+1||a>e.length)continue;let l=a-1,u=e.slice(Math.max(0,i-200),i),m=lp(u),h=/\bfunction(?:\s*\*)?(?:\s+[$A-Z_a-z][$\w]*)?\s*$/s.test(m),y=m.match(/(?:^|[;{}\n])\s*(?:(?:public|private|protected|static|abstract|async|override|get|set)\s+)*(?:\*\s*)?(?<name>[$A-Z_a-z][$\w]*|constructor|\[['"][^'"\n]+['"]\])\s*$/s),w=!!(y&&!new Set(["catch","for","if","switch","while","with"]).has(y.groups.name)),x=e.slice(a,Math.min(e.length,a+500)).match(/^\s*(?::[\s\S]*?)?=>/),f=null;if(x){let S=Rr(e,a+x[0].length);f=e[S]==="{"?n.find(([p])=>p===S)??null:[S,Nr(e,S)]}else if(h||w){let S=Rr(e,a),p=e[S]==="{"?S:e.indexOf("{",S),N=e.slice(S,p<0?e.length:p);p>=0&&!/[;=]/.test(N)&&(f=n.find(([T])=>T===p)??null)}s(e.slice(i+1,l),f,[i+1,l]),i=l}let o=new RegExp(`(?<![$\\w])(?<parameter>${$e})\\s*=>`,"g");for(let i of e.matchAll(o)){if(ae(i.index,t)||Te(e,i.index))continue;let a=Rr(e,i.index+i[0].length),l=e[a]==="{"?n.find(([u])=>u===a)??null:[a,Nr(e,a)];s(i.groups.parameter,l,[i.index,i.index+i.groups.parameter.length])}return r}c(up,"scanCallableScopes");function Ar(e,t,n){let r=null;for(let{body:s}of e)s[0]>=t||s[1]<=t||(!r||s[1]-s[0]<r[1]-r[0])&&(r=s);return r??[0,n]}c(Ar,"enclosingFunctionRange");function qn(e,t){return!!(e&&t&&e[0]===t[0]&&e[1]===t[1])}c(qn,"sameRange");function pp(e,t,n,r,s){let o=[],i=Se(t),a=c((y,w)=>{if(ae(y.index,n)||Te(e,y.index))return;let E=r.find(([x])=>x===w);E&&o.push(E)},"addBodyRange"),l=new RegExp(`\\b(?<kind>const|let|var|function|class)\\s+${i}(?![$\\w])`,"g");for(let y of e.matchAll(l))ae(y.index,n)||Te(e,y.index)||o.push(y.groups.kind==="var"||y.groups.kind==="function"?Ar(s,y.index,e.length):Bs(r,y.index,e.length));let u=/\b(?<kind>const|let|var)\s*\{(?<bindings>[^{}\n]+)\}/g;for(let y of e.matchAll(u))ae(y.index,n)||Te(e,y.index)||Fs(y.groups.bindings).some(({local:w})=>w===t)&&o.push(y.groups.kind==="var"?Ar(s,y.index,e.length):Bs(r,y.index,e.length));let m=/\bimport\s+(?<clause>[^'";\n]+?)\s+from\s*['"]/g;for(let y of e.matchAll(m)){if(ae(y.index,n)||Te(e,y.index))continue;let w=y.groups.clause.trim().replace(/^type\s+/,""),E=[],x=w.match(new RegExp(`^(?<local>${$e})(?:\\s*,|$)`));x&&E.push(x.groups.local);let f=w.match(new RegExp(`\\*\\s+as\\s+(?<local>${$e})`));f&&E.push(f.groups.local);let S=w.match(/\{(?<bindings>[\s\S]*?)\}/)?.groups.bindings;S&&E.push(...At(S).map(({local:p})=>p)),E.includes(t)&&o.push([0,e.length])}for(let y of s)di(y.parameters,t)&&o.push(y.parameterRange,y.body);let h=/\bcatch\s*\(/g;for(let y of e.matchAll(h)){if(ae(y.index,n)||Te(e,y.index))continue;let w=y.index+y[0].lastIndexOf("("),E=gt(e,w,"(",")");if(E<=w+1||E>e.length)continue;let x=e.slice(w+1,E-1);if(!di(x,t))continue;let f=Rr(e,E);e[f]==="{"&&a(y,f)}return o}c(pp,"identifierShadowRanges");function Or(e,t,n){return(e.get(t)??[]).some(([r,s])=>n>=r&&n<s)}c(Or,"identifierIsShadowedAt");function Vs(e,t,n){let r=null;for(let s of e.get(t)??[])n<s[0]||n>=s[1]||(!r||s[1]-s[0]<r[1]-r[0])&&(r=s);return r}c(Vs,"innermostShadowRange");function ht(e,t,n,r){return new Set([...e].filter(s=>{let o=s.split(".")[0],i=Vs(n,o,r);return(t.get(s)??[]).some(a=>r>=a.scope[0]&&r<a.scope[1]&&(a.global?!i:qn(a.scope,i)))}))}c(ht,"visibleReferencesAt");function mi(e,t,n,r,s){return e==="var"?Ar(r,t,s):Bs(n,t,s)}c(mi,"declarationScope");function Rt(e,t,n){let r=e.get(t)??[];return r.some(s=>s.kind===n.kind&&s.declarationIndex===n.declarationIndex&&qn(s.scope,n.scope))?!1:(r.push(n),e.set(t,r),!0)}c(Rt,"addScopedRecord");function vi(e,t,n){let r=Vs(e.shadowRanges,t.split(".")[0],n);return(e.bindingScopes.get(t)??[]).filter(s=>n>=s.scope[0]&&n<s.scope[1]&&(s.global?!r:qn(s.scope,r))).sort((s,o)=>s.scope[1]-s.scope[0]-(o.scope[1]-o.scope[0])||o.declarationIndex-s.declarationIndex)[0]??null}c(vi,"visibleBindingRecord");function fi(e,t,n,r){let s={bindingScopes:t,shadowRanges:n};return new Map([...e].filter(([o])=>vi(s,o,r)))}c(fi,"visibleBindingsAt");function Ei(e,t,n=new Map){let r=new Map(n),s=new Map,o=new Set(["document","window.document","globalThis.document"]),i=new Set(["customElements","window.customElements","globalThis.customElements"]),a=new Map,l=new Map,u=[0,e.length];for(let I of o)Rt(a,I,{scope:u,declarationIndex:-1,global:!0});for(let I of i)Rt(l,I,{scope:u,declarationIndex:-1,global:!0});let m=ap(e),h=up(e,t,m),y=new RegExp(`\\b(?<declarationKind>const|let|var)\\s+(?<name>${$e})(?:\\s*:[^=;\\n]+)?\\s*=\\s*(?<rhs>[^;\\n]+)`,"g"),w=[...e.matchAll(y)].filter(I=>!ae(I.index,t)&&!Te(e,I.index)),E=/\b(?<declarationKind>const|let|var)\s*\{(?<bindings>[^{}\n]+)\}\s*=\s*(?<source>[$A-Z_a-z][$\w]*(?:\s*\.\s*[$A-Z_a-z][$\w]*)*)/g,x=[...e.matchAll(E)].filter(I=>!ae(I.index,t)&&!Te(e,I.index)),f=new RegExp(`\\bfunction\\s+(?<name>${$e})\\s*\\(\\s*(?<parameter>${$e})[^)]*\\)\\s*\\{\\s*return\\s+(?<factory>${$e}(?:\\s*\\.\\s*${$e})*)\\s*\\(\\s*\\k<parameter>\\s*\\)\\s*;?\\s*\\}`,"g"),S=[...e.matchAll(f)].filter(I=>!ae(I.index,t)&&!Te(e,I.index)),p=new Set(["createElement","customElements","document","globalThis","querySelector","querySelectorAll","window",...[...n.keys()].map(I=>I.split(".")[0]),...w.map(I=>I.groups.name),...x.flatMap(I=>Fs(I.groups.bindings).map(({local:W})=>W)),...S.map(I=>I.groups.name)]),N=new Map([...p].map(I=>[I,pp(e,I,t,m,h)]));for(let[I,W]of n)Rt(s,I,{kind:W,scope:u,declarationIndex:-1,declarationEnd:0,declarationKind:"import"});let T=Math.max(2,w.length+x.length+S.length+1);for(let I=0;I<T;I+=1){let W=!1;for(let $ of w){let L=$.groups.name,d=Fn($.groups.rhs),k=mi($.groups.declarationKind,$.index,m,h,e.length),j=ht(o,a,N,$.index),M=ht(i,l,N,$.index);j.has(d)&&(o.add(L),W=Rt(a,L,{scope:k,declarationIndex:$.index})||W),M.has(d)&&(i.add(L),W=Rt(l,L,{scope:k,declarationIndex:$.index})||W);let F=fi(r,s,N,$.index),D=op(d,F,j,M,!Or(N,"createElement",$.index));D&&(r.set(L,D),W=Rt(s,L,{kind:D,scope:k,declarationIndex:$.index,declarationEnd:$.index+$[0].length,declarationKind:$.groups.declarationKind})||W)}for(let $ of x){let L=Fn($.groups.source),d=mi($.groups.declarationKind,$.index,m,h,e.length),k=ht(o,a,N,$.index).has(L),j=ht(i,l,N,$.index).has(L);if(!(!k&&!j))for(let M of Fs($.groups.bindings)){let F=k&&M.property==="createElement"?Ln:j&&(M.property==="get"||M.property==="whenDefined")?Dn:null;F&&(r.set(M.local,F),W=Rt(s,M.local,{kind:F,scope:d,declarationIndex:$.index,declarationEnd:$.index+$[0].length,declarationKind:$.groups.declarationKind})||W)}}for(let $ of S){let L=ht(o,a,N,$.index),d=ht(i,l,N,$.index),k=Ds($.groups.factory,fi(r,s,N,$.index),L,d,!Or(N,"createElement",$.index));if(k){let j=Ar(h,$.index,e.length);r.set($.groups.name,k),W=Rt(s,$.groups.name,{kind:k,scope:j,declarationIndex:$.index,declarationEnd:$.index+$[0].length,declarationKind:"function"})||W}}if(!W)break}let C=new Map;for(let[I,W]of s){let $=W.find(({scope:L})=>qn(L,u));$&&C.set(I,$.kind)}return{bindings:r,bindingScopes:s,moduleBindings:C,documentReferences:o,documentReferenceScopes:a,registryReferences:i,registryReferenceScopes:l,shadowRanges:N}}c(Ei,"scanLocalDomFactoryBindings");function dp(e,t){let n=Math.max(e.lastIndexOf(";",t-1),e.lastIndexOf("{",t-1),e.lastIndexOf("}",t-1));return e.slice(n+1,t).match(new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+(?<alias>${$e})(?:\\s*:[^=]+)?\\s*=\\s*$`,"s"))?.groups.alias??null}c(dp,"assignedConstructionAlias");function mp(e,t,n,r,s){let o=vi(s,t,n);if(!o||o.kind!==r||!new Set(["const","function","import"]).has(o.declarationKind)||o.declarationKind==="const"&&n<o.declarationEnd)return!1;let i=Math.max(o.declarationEnd??0,o.scope[0]),a=e.slice(i,n),l=new RegExp(`(?<![$\\w.])${Se(t)}\\s*=(?!=|>)`,"g"),u=Kt(a);return![...a.matchAll(l)].some(m=>!ae(m.index,u)&&!Te(a,m.index)&&qn(o.scope,Vs(s.shadowRanges,t.split(".")[0],i+m.index)))}c(mp,"bindingIsStableBefore");function fp(e,t,n){let r=new Map(n.bindings);r.set("createElement",Ln);for(let a of n.documentReferences)r.set(`${a}.createElement`,Ln);for(let a of n.registryReferences)r.set(`${a}.get`,Dn),r.set(`${a}.whenDefined`,Dn);let s=[...r.keys()].sort((a,l)=>l.length-a.length).map($i).join("|");if(!s)return[];let o=new RegExp(`(?<![$\\w./])(?<api>(?:\\(\\s*(?:${s})\\s*\\)|(?:${s})))(?![$\\w])(?:\\s*\\.\\s*bind\\s*\\([^()]*\\))?\\s*(?:<[^>\\n]+>)?\\s*(?:(?:\\?\\.)?\\s*\\(\\s*|\\.\\s*call\\s*\\(\\s*[^,()]+\\s*,\\s*)(?<quote>['"\\x60])(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)\\k<quote>`,"g"),i=[];for(let a of e.matchAll(o)){let l=a[0].lastIndexOf(a.groups.tag),u=a.index+l;if(ae(a.index,t)||ae(u,t))continue;let m=Te(e,u),h=Te(e,a.index);if(m&&h&&m[0]===h[0]&&m[1]===h[1]&&(e[m[0]]!=="`"||!Ir(e,m[0],a.index)))continue;let y=sp(a.groups.api,r);if(n.bindings.has(y)){if(!mp(e,y,a.index,r.get(y),n))continue}else if(y==="createElement"){if(Or(n.shadowRanges,y,a.index))continue}else if(y.endsWith(".createElement")){let x=y.slice(0,-14);if(!ht(n.documentReferences,n.documentReferenceScopes,n.shadowRanges,a.index).has(x))continue}else if(y.endsWith(".get")||y.endsWith(".whenDefined")){let x=y.endsWith(".get")?".get":".whenDefined",f=y.slice(0,-x.length);if(!ht(n.registryReferences,n.registryReferenceScopes,n.shadowRanges,a.index).has(f))continue}let w=a.index+a[0].lastIndexOf("(",l),E=gt(e,w,"(",")");i.push({tag:a.groups.tag,start:u,end:u+a.groups.tag.length,callStart:a.index,callEnd:E??a.index+a[0].length,resultAlias:dp(e,a.index),kind:r.get(y)})}return i}c(fp,"scanFactoryTagReferences");function xi(e,t,n=null){let r=Ei(e,t,n??new Map),s=fp(e,t,r),o=/(?<![$\w.])(?<api>(?:(?:window|globalThis)\.)?document\.querySelector(?:All)?|querySelector(?:All)?)\s*(?:<[^>\n]+>)?\(\s*(?<quote>['"])(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)\k<quote>/g;for(let a of e.matchAll(o)){if(ae(a.index,t))continue;if(a.groups.api.includes("document.")){let m=a.groups.api.replace(/\.querySelector(?:All)?$/,"");if(!ht(r.documentReferences,r.documentReferenceScopes,r.shadowRanges,a.index).has(m))continue}else if(Or(r.shadowRanges,a.groups.api,a.index))continue;let l=a[0].lastIndexOf(a.groups.tag),u=a.index+l;s.push({tag:a.groups.tag,start:u,end:u+a.groups.tag.length,callStart:a.index,callEnd:a.index+a[0].length,resultAlias:null,kind:Dn})}let i=new Map;for(let a of s)i.set(`${a.start}:${a.end}:${a.kind}`,a);return[...i.values()].sort((a,l)=>a.start-l.start||a.end-l.end)}c(xi,"scanApiTagReferences");function gt(e,t,n,r){let s=0,o=null;for(let i=t;i<e.length;i+=1){let a=e[i];if(o){a==="\\"?i+=1:a===o&&(o=null);continue}if(a==='"'||a==="'"||a==="`")o=a;else if(a===n)s+=1;else if(a===r&&--s===0)return i+1}return e.length}c(gt,"skipBalanced");function hp(e,t){let n=e.indexOf(`
25
+ `,t),r=e.indexOf(";",t),s=r>=0&&(n<0||r<n)?r:n<0?e.length:n,o=e.slice(t,s).trim();return o&&!/^(?:!|as\s+[^;\n]+|satisfies\s+[^;\n]+)$/.test(o)?null:s<e.length?s+1:s}c(hp,"constructionStatementEnd");function gp(e,t){let n=t;for(;n<e.length;){if(/\s/.test(e[n])||e[n]===";"){n+=1;continue}if(e.startsWith("//",n)){let r=e.indexOf(`
26
+ `,n+2);n=r<0?e.length:r+1;continue}if(e.startsWith("/*",n)){let r=e.indexOf("*/",n+2);n=r<0?e.length:r+2;continue}break}return n}c(gp,"skipMigrationTrivia");function hi(e,t){let n=new RegExp(`(?<![$\\w])${Se(t)}(?![$\\w])`,"y"),r=0;for(;r<e.length;){let s=e[r];if(s==='"'||s==="'"||s==="`"){let o=s;for(r+=1;r<e.length;)if(e[r]==="\\")r+=2;else if(e[r]===o){r+=1;break}else r+=1;continue}if(e.startsWith("//",r)){let o=e.indexOf(`
27
+ `,r+2);r=o<0?e.length:o+1;continue}if(e.startsWith("/*",r)){let o=e.indexOf("*/",r+2);r=o<0?e.length:o+2;continue}if(n.lastIndex=r,n.exec(e))return!0;r+=1}return!1}c(hi,"containsIdentifierCode");function Nr(e,t){let n={"(":0,"[":0,"{":0},r={")":"(","]":"[","}":"{"},s=null;for(let o=t;o<e.length;o+=1){let i=e[o];if(s){i==="\\"?o+=1:i===s&&(s=null);continue}if(e.startsWith("//",o)){let a=e.indexOf(`
28
+ `,o+2);return a<0?e.length:a+1}if(e.startsWith("/*",o)){let a=e.indexOf("*/",o+2);o=a<0?e.length:a+1;continue}if(i==='"'||i==="'"||i==="`"){s=i;continue}if(Object.hasOwn(n,i))n[i]+=1;else if(Object.hasOwn(r,i)){let a=r[i];n[a]=Math.max(0,n[a]-1)}else if((i===";"||i===`
29
+ `)&&n["("]===0&&n["["]===0&&n["{"]===0)return o+1}return e.length}c(Nr,"simpleStatementEnd");function yp(e,t,n){let r=Se(n),s=e.slice(t),o=s.match(new RegExp(`^${r}\\s*\\.\\s*setAttribute\\s*\\(\\s*(?<quote>['"])(?<member>[A-Za-z_:][-.A-Za-z0-9_:]*)\\k<quote>\\s*,`));if(o){let h=t+o[0].indexOf("("),y=gt(e,h,"(",")");if(hi(e.slice(h+1,y-1),n))return null;let w=Nr(e,y);return e.slice(y,w).replace(/[;\s]/g,"")?null:{member:o.groups.member,kind:"attribute",next:w}}let i=s.match(new RegExp(`^${r}\\s*\\.\\s*(?<member>${$e})\\s*=(?!=|>)`)),a=i?null:s.match(new RegExp(`^${r}\\s*\\[\\s*(?<quote>['"])(?<member>[^'"]+)\\k<quote>\\s*\\]\\s*=(?!=|>)`)),l=i??a;if(!l)return null;let u=Nr(e,t+l[0].length),m=e.slice(t+l[0].length,u);return hi(m,n)?null:{member:l.groups.member,kind:"property",next:u}}c(yp,"scanImmediateAliasWrite");function bp(e,t){let n=new Set([e.member,Ue(e.member),He(e.member)]);if(t.kind==="attribute"){let r=t.member.toLowerCase();return[...n].some(s=>s.toLowerCase()===r)}return n.has(t.member)}c(bp,"defaultWriteMatches");function Si(e,t,n){if(!t.resultAlias)return{safe:!1,missing:n};let r=hp(e,t.callEnd);if(r===null)return{safe:!1,missing:n};let s=new Set(n);for(let o=0;o<64&&s.size>0;o+=1){r=gp(e,r);let i=yp(e,r,t.resultAlias);if(!i)break;for(let a of s)bp(a,i)&&s.delete(a);r=i.next}return{safe:s.size===0,missing:[...s]}}c(Si,"assessImperativeDefaults");function Qe(e,t){let n=[],r=t.nameEnd;for(;r<t.end;){for(;/\s/.test(e[r]??"");)r+=1;if(r>=t.end||e[r]==="/")break;if(e[r]==="{"){r=gt(e,r,"{","}");continue}let s=r;for(;r<t.end&&!/[\s=/>]/.test(e[r]);)r+=1;let o=r;if(o===s){r+=1;continue}for(;/\s/.test(e[r]??"");)r+=1;let i="boolean",a=null,l=null;if(e[r]==="="){for(r+=1;/\s/.test(e[r]??"");)r+=1;if(e[r]==='"'||e[r]==="'"){let u=e[r++];for(i="literal",a=r;r<t.end&&e[r]!==u;)e[r]==="\\"&&(r+=1),r+=1;l=r,e[r]===u&&(r+=1)}else if(e[r]==="{")i="expression",a=r,r=gt(e,r,"{","}"),l=r;else{for(i="literal",a=r;r<t.end&&!/[\s>]/.test(e[r]);)r+=1;l=r}}n.push({rawName:e.slice(s,o),nameStart:s,nameEnd:o,valueKind:i,valueStart:a,valueEnd:l,value:a===null?null:e.slice(a,l)})}return n}c(Qe,"parseTagAttributes");function Ue(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replaceAll("_","-").toLowerCase()}c(Ue,"kebabCase");function He(e){return e.replace(/-([a-z0-9])/g,(t,n)=>n.toUpperCase())}c(He,"camelCase");function gi(e){let t=He(e);return t[0]?.toUpperCase()+t.slice(1)}c(gi,"pascalCase");function Wn(e,t){return e===e.toLowerCase()?Ue(t):He(t)}c(Wn,"memberStyle");function ki(e,t){let n=[],r=c((s,o,i,a="")=>n.push({section:s,prefix:o,name:i,suffix:a}),"addCandidate");e.startsWith("v-on:")?r("events","v-on:",e.slice(5)):e.startsWith("on:")?r("events","on:",e.slice(3)):e.startsWith("@")?r("events","@",e.slice(1)):/^on[A-Z]/.test(e)?r("events","on",e.slice(2),"jsx-event"):e.startsWith("v-bind:")?r("properties","v-bind:",e.slice(7)):e.startsWith("bind:")?r("properties","bind:",e.slice(5)):e.startsWith(":")?r("properties",":",e.slice(1)):e.startsWith(".")?r("properties",".",e.slice(1)):e.startsWith("?")?r("attributes","?",e.slice(1)):(r("attributes","",e),r("properties","",e));for(let s of n)for(let o of t.rewrites[s.section]){if(!(s.suffix==="jsx-event"?s.name===gi(o.from):new Set([o.from,Ue(o.from),He(o.from)]).has(s.name)))continue;let a=s.suffix==="jsx-event"?gi(o.to):Wn(s.name,o.to);return{section:s.section,from:o.from,to:o.to,value:o.value,prefix:s.prefix,replacement:`${s.prefix}${a}`}}return null}c(ki,"namedRule");function Kn(e){return e.valueKind==="expression"||/^(?:[.?:]|v-bind:|bind:)/.test(e.rawName)}c(Kn,"isDynamicAttribute");var qs=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Ti(e){let t=[],n=new Map;for(let r of e){if(!r.closing&&!r.selfClosing){t.push(r);continue}if(r.closing)for(let s=t.length-1;s>=0;s-=1){if(t[s].tag!==r.tag)continue;let[o]=t.splice(s,1);n.set(o.start,r);break}}return n}c(Ti,"pairedMarkupTokens");function Ri(e,t,n,r){let s=[],o=[],i=t,a=!1,l=/<(?<closing>\/)?(?<tag>[a-z][a-z0-9.:-]*)(?=[\s/>])/gi;l.lastIndex=t;let u=c((m,h)=>{o.length===0&&/\$\{|\{\{|<%/.test(e.slice(m,h))&&(a=!0)},"noteGap");for(let m=l.exec(e);m&&m.index<n;m=l.exec(e)){if(ae(m.index,r))continue;u(i,m.index);let h=un(e,m.index+m[0].length);if(h<0||h>=n)break;let y=m.groups.tag.toLowerCase();if(m.groups.closing){for(let w=o.length-1;w>=0;w-=1)if(o[w]===y){o.splice(w,1);break}}else o.length===0&&s.push(y),!/\/\s*>$/.test(e.slice(m.index,h+1))&&!qs.has(y)&&o.push(y);i=h+1,l.lastIndex=i}return u(i,n),{directTags:s,dynamicDirectContent:a}}c(Ri,"scanDirectElementChildren");function Ai(e){return e.rawName.replace(/^(?:v-bind:|bind:|[.?:])/,"").toLowerCase()}c(Ai,"normalizedAttributeName");function Ws(e){let t=e;for(;;){let n=t.replace(/\s+$/,"").replace(/\/\*[\s\S]*?\*\/$/,"").replace(/\/\/[^\n\r]*$/,"");if(n===t)return t;t=n}}c(Ws,"stripTrailingModuleTrivia");function Cr(e,t){let n=Ws(e.slice(0,t));return/\bimport\s*\($/.test(n)?{sideEffect:!1,kind:"dynamic-import"}:/\brequire\s*\($/.test(n)?{sideEffect:!1,kind:"require"}:/\bfrom$/.test(n)?{sideEffect:!1,kind:"binding"}:/\bimport$/.test(n)?{sideEffect:!0,kind:"import"}:null}c(Cr,"moduleSpecifierContext");function Se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c(Se,"regexEscape");function Oi(e,t,n){let r=[...n.packageIdentities.keys()].sort((i,a)=>a.length-i.length).map(Se).join("|"),s=new RegExp(`(['"])(?<specifier>${r})(?<subpath>\\/[^'"\\s]*)?\\1`,"g"),o=[];for(let i of e.matchAll(s)){if(ae(i.index,t))continue;let a=i.index,l=Cr(e,a);if(!l)continue;let u=`${i.groups.specifier}${i.groups.subpath??""}`,m=n.packageIdentities.get(i.groups.specifier);U(m,`unrecognized package identity ${i.groups.specifier}`);let h=a+i[0].length,y=e.indexOf(`
30
+ `,h),w=y===-1?e.length:y,E=e.indexOf(";",h),x=E!==-1&&E<w?E+1:w;o.push({...l,ecosystem:m.ecosystem,tiers:m.tiers,packageName:i.groups.specifier,specifier:u,subpath:i.groups.subpath??"",quote:i[1],start:a+1,end:a+1+u.length,statementEnd:x})}return o}c(Oi,"scanImports");function At(e){let t=[],n=e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n\r]*/g,"");for(let r of n.split(",")){let s=r.trim().replace(/^type\s+/,"");if(!s)continue;let o=s.match(new RegExp(`^(?<imported>${$e})(?:\\s+as\\s+(?<local>${$e}))?$`));o&&t.push({imported:o.groups.imported,local:o.groups.local??o.groups.imported})}return t}c(At,"parseNamedModuleBindings");function wp(e,t){let n=[],r=[],s=[],o=[],i=c((a,l)=>{for(let u of e.matchAll(a))!ae(u.index,t)&&!Te(e,u.index)&&l(u)},"addMatches");return i(/\bimport\s+(?!type\b)\{(?<bindings>[\s\S]*?)\}\s*from\s*(?<quote>['"])(?<source>[^'"]+)\k<quote>/g,a=>{for(let l of At(a.groups.bindings))n.push({source:a.groups.source,imported:l.imported,local:l.local})}),i(new RegExp(`\\bimport\\s+(?!type\\b)(?<local>${$e})(?:\\s*,\\s*(?:\\{[\\s\\S]*?\\}|\\*\\s+as\\s+${$e}))?\\s+from\\s*(?<quote>['"])(?<source>[^'"]+)\\k<quote>`,"g"),a=>n.push({source:a.groups.source,imported:"default",local:a.groups.local})),i(new RegExp(`\\bimport\\s+\\*\\s+as\\s+(?<local>${$e})\\s+from\\s*(?<quote>['"])(?<source>[^'"]+)\\k<quote>`,"g"),a=>n.push({source:a.groups.source,imported:"*",local:a.groups.local})),i(/\bexport\s*\{(?<bindings>[\s\S]*?)\}\s*from\s*(?<quote>['"])(?<source>[^'"]+)\k<quote>/g,a=>{for(let l of At(a.groups.bindings))s.push({source:a.groups.source,imported:l.imported,exported:l.local})}),i(/\bexport\s*\*\s*from\s*(?<quote>['"])(?<source>[^'"]+)\k<quote>/g,a=>o.push(a.groups.source)),i(/\bexport\s*\{(?<bindings>[\s\S]*?)\}(?!\s*from\b)/g,a=>{for(let l of At(a.groups.bindings))r.push({local:l.imported,exported:l.local})}),i(new RegExp(`\\bexport\\s+(?:const|let|var|function)\\s+(?<name>${$e})`,"g"),a=>r.push({local:a.groups.name,exported:a.groups.name})),i(new RegExp(`\\bexport\\s+default\\s+(?<name>${$e})(?![$\\w])`,"g"),a=>r.push({local:a.groups.name,exported:"default"})),{imports:n,localExports:r,reexports:s,starExports:o}}c(wp,"scanModuleFactoryLinks");var Ps=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function Ls(e,t,n){if(!t.startsWith("."))return null;let r=Pn.resolve(Pn.dirname(e),t),s=Pn.extname(r),o=[r];if(s){let i=r.slice(0,-s.length);for(let a of Ps)o.push(`${i}${a}`)}else for(let i of Ps)o.push(`${r}${i}`);for(let i of Ps)o.push(Pn.join(r,`index${i}`));return o.find(i=>n.has(i))??null}c(Ls,"resolveScannedModule");function yi(e,t){return e.size===t.size&&[...e].every(([n,r])=>t.get(n)===r)}c(yi,"factoryMapEqual");function Ni(e){let t=new Map;for(let[o,i]of e){let a=Pn.resolve(o),l=Kt(i);t.set(a,{text:i,ignoredRanges:l,links:wp(i,l)})}let n=new Set(t.keys()),r=new Map([...n].map(o=>[o,new Map])),s=new Map([...n].map(o=>[o,new Map]));for(let o=0;o<Math.max(4,t.size*4);o+=1){let i=!1;for(let[a,l]of t){let u=new Map;for(let y of l.links.imports){let w=Ls(a,y.source,n);if(!w)continue;let E=r.get(w);if(y.imported==="*")for(let[x,f]of E)u.set(`${y.local}.${x}`,f);else{let x=E.get(y.imported);x&&u.set(y.local,x)}}let m=Ei(l.text,l.ignoredRanges,u);yi(s.get(a),u)||(s.set(a,u),i=!0);let h=new Map;for(let y of l.links.localExports){let w=m.moduleBindings.get(y.local);w&&h.set(y.exported,w)}for(let y of l.links.reexports){let w=Ls(a,y.source,n),E=w?r.get(w).get(y.imported):null;E&&h.set(y.exported,E)}for(let y of l.links.starExports){let w=Ls(a,y,n);if(w)for(let[E,x]of r.get(w))E!=="default"&&h.set(E,x)}yi(r.get(a),h)||(r.set(a,h),i=!0)}if(!i)break}return s}c(Ni,"buildProjectDomFactoryBindings");function Un(e,t){let n=[],r=new Set;for(let i of t){let a=`${i.start}:${i.end}:${i.replacement}`;r.has(a)||(r.add(a),n.push(i))}n.sort((i,a)=>i.start-a.start||i.end-a.end);for(let i=1;i<n.length;i+=1)if(n[i].start<n[i-1].end)throw new Error(`Migration rewrite conflict at offsets ${n[i-1].start} and ${n[i].start}`);let s=[],o=e.length;for(let i of[...n].sort((a,l)=>l.start-a.start||l.end-a.end))s.push(e.slice(i.end,o),i.replacement),o=i.start;return s.push(e.slice(0,o)),s.reverse().join("")}c(Un,"finalizeEdits");function ln(e,t){return`${e}:${t}`}c(ln,"localMigrationKey");function Ks(e){return String(e).replace(/^lyra-/,"")}c(Ks,"originLabel");function Mr(e){if(e.value===!0)return e.member;let t=String(e.value).replaceAll("&","&amp;").replaceAll('"',"&quot;");return`${e.member}="${t}"`}c(Mr,"serializeLocalDefault");function jr(e,t,n,r){let s=[],o=new Set,i=new Set(t.keys()),a=/\b(?:(?:[$A-Z_a-z][$\w]*)\s*(?:\?\.|\.)\s*(?:createElement|querySelector(?:All)?)|(?:createElement|querySelector(?:All)?)|customElements\.(?:get|whenDefined))\s*(?:<[^>\n]+>)?\(\s*(['"])(?<tag>lr-[a-z][a-z0-9-]*)\1/g;for(let l of e.matchAll(a)){if(ae(l.index,n)||!i.has(l.groups.tag))continue;let u=l.index+l[0].lastIndexOf(l.groups.tag),m=ln(t.get(l.groups.tag).origin,l.groups.tag);o.add(m),s.push({key:m,tag:l.groups.tag,offset:u,warningCode:"ALIASED_MEMBER_REVIEW",message:`${l.groups.tag} is accessed through a DOM alias; review property assignments before inserting ${Ks(t.get(l.groups.tag).origin)} compatibility defaults.`})}for(let l of r){let u=t.get(l.tag);if(!u)continue;let m=e.slice(l.nameEnd,l.end),h=[/\{\s*\.\.\.[^}]+\}/g,/\bv-bind\s*=\s*(?:"[^"]*"|'[^']*'|\{[^}]*\})/g];for(let y of h)for(let w of m.matchAll(y)){let E=l.nameEnd+w.index,x=ln(u.origin,l.tag);o.add(x),s.push({key:x,tag:l.tag,offset:E,warningCode:"DYNAMIC_VALUE_REVIEW",message:`${l.tag} has an opaque attribute spread that may already provide a migrated default; expand or review it before running this profile.`})}}return{uses:s,blocked:o}}c(jr,"scanLocalMigrationHazards");var Ot=Object.freeze({consumedInputs:["--lr-theme-border-radius-container","--lr-theme-border-radius-m","--lr-theme-border-radius-pill","--lr-theme-border-radius-xs","--lr-theme-border-width-medium","--lr-theme-border-width-thick","--lr-theme-border-width-thin","--lr-theme-color-border-strong","--lr-theme-color-brand-border-loud","--lr-theme-color-brand-border-normal","--lr-theme-color-brand-border-quiet","--lr-theme-color-brand-fill-loud","--lr-theme-color-brand-fill-normal","--lr-theme-color-brand-fill-quiet","--lr-theme-color-brand-on-loud","--lr-theme-color-brand-on-normal","--lr-theme-color-brand-on-quiet","--lr-theme-color-danger-border-loud","--lr-theme-color-danger-border-normal","--lr-theme-color-danger-border-quiet","--lr-theme-color-danger-fill-loud","--lr-theme-color-danger-fill-normal","--lr-theme-color-danger-fill-quiet","--lr-theme-color-danger-on-loud","--lr-theme-color-danger-on-normal","--lr-theme-color-danger-on-quiet","--lr-theme-color-focus","--lr-theme-color-mix-active","--lr-theme-color-mix-hover","--lr-theme-color-mix-partner","--lr-theme-color-neutral-border-loud","--lr-theme-color-neutral-border-normal","--lr-theme-color-neutral-border-quiet","--lr-theme-color-neutral-fill-loud","--lr-theme-color-neutral-fill-normal","--lr-theme-color-neutral-fill-quiet","--lr-theme-color-neutral-on-loud","--lr-theme-color-neutral-on-normal","--lr-theme-color-neutral-on-quiet","--lr-theme-color-no-data","--lr-theme-color-on-strong-overlay","--lr-theme-color-overlay","--lr-theme-color-overlay-strong","--lr-theme-color-shadow","--lr-theme-color-success-border-loud","--lr-theme-color-success-border-normal","--lr-theme-color-success-border-quiet","--lr-theme-color-success-fill-loud","--lr-theme-color-success-fill-normal","--lr-theme-color-success-fill-quiet","--lr-theme-color-success-on-loud","--lr-theme-color-success-on-normal","--lr-theme-color-success-on-quiet","--lr-theme-color-surface-border","--lr-theme-color-surface-border-subtle","--lr-theme-color-surface-container","--lr-theme-color-surface-container-high","--lr-theme-color-surface-container-highest","--lr-theme-color-surface-container-low","--lr-theme-color-surface-container-lowest","--lr-theme-color-surface-default","--lr-theme-color-surface-overlay","--lr-theme-color-surface-raised","--lr-theme-color-text-normal","--lr-theme-color-text-quiet","--lr-theme-color-warning-border-loud","--lr-theme-color-warning-border-normal","--lr-theme-color-warning-border-quiet","--lr-theme-color-warning-fill-loud","--lr-theme-color-warning-fill-normal","--lr-theme-color-warning-fill-quiet","--lr-theme-color-warning-on-loud","--lr-theme-color-warning-on-normal","--lr-theme-color-warning-on-quiet","--lr-theme-duration-fast","--lr-theme-duration-icon","--lr-theme-duration-normal","--lr-theme-duration-slow","--lr-theme-easing-emphasized","--lr-theme-easing-linear","--lr-theme-easing-standard","--lr-theme-focus-ring-offset","--lr-theme-focus-ring-width","--lr-theme-font-family-body","--lr-theme-font-family-heading","--lr-theme-font-family-mono","--lr-theme-font-size-2xl","--lr-theme-font-size-2xs","--lr-theme-font-size-3xl","--lr-theme-font-size-3xs","--lr-theme-font-size-lg","--lr-theme-font-size-m","--lr-theme-font-size-md-sm","--lr-theme-font-size-sm","--lr-theme-font-size-xl","--lr-theme-font-size-xs","--lr-theme-font-weight-bold","--lr-theme-font-weight-medium","--lr-theme-font-weight-normal","--lr-theme-font-weight-semibold","--lr-theme-hover-brightness","--lr-theme-line-break","--lr-theme-line-height-1-4","--lr-theme-line-height-compact","--lr-theme-line-height-loose","--lr-theme-line-height-none","--lr-theme-line-height-normal","--lr-theme-line-height-snug","--lr-theme-opacity-disabled","--lr-theme-opacity-muted","--lr-theme-otp-input-segment-size","--lr-theme-popover-viewport-clamp","--lr-theme-scroll-fade-size","--lr-theme-shadow-color","--lr-theme-shadow-l","--lr-theme-shadow-m","--lr-theme-shadow-s","--lr-theme-shadow-xl","--lr-theme-shadow-xs","--lr-theme-size-0-02em","--lr-theme-size-0-03em","--lr-theme-size-0-04em","--lr-theme-size-0-05rem","--lr-theme-size-0-0625rem","--lr-theme-size-0-09375rem","--lr-theme-size-0-125rem","--lr-theme-size-0-15rem","--lr-theme-size-0-1875rem","--lr-theme-size-0-1rem","--lr-theme-size-0-25rem","--lr-theme-size-0-3125rem","--lr-theme-size-0-35em","--lr-theme-size-0-375rem","--lr-theme-size-0-3em","--lr-theme-size-0-4375rem","--lr-theme-size-0-4em","--lr-theme-size-0-4rem","--lr-theme-size-0-5em","--lr-theme-size-0-5rem","--lr-theme-size-0-625rem","--lr-theme-size-0-6875rem","--lr-theme-size-0-6rem","--lr-theme-size-0-75em","--lr-theme-size-0-75rem","--lr-theme-size-0-7em","--lr-theme-size-0-875em","--lr-theme-size-0-8rem","--lr-theme-size-0-9375rem","--lr-theme-size-1-0625rem","--lr-theme-size-1-1rem","--lr-theme-size-1-25rem","--lr-theme-size-1-5em","--lr-theme-size-1-5rem","--lr-theme-size-1-75rem","--lr-theme-size-10px","--lr-theme-size-10rem","--lr-theme-size-12em","--lr-theme-size-12rem","--lr-theme-size-14px","--lr-theme-size-14rem","--lr-theme-size-15rem","--lr-theme-size-16px","--lr-theme-size-16rem","--lr-theme-size-18rem","--lr-theme-size-1em","--lr-theme-size-1px","--lr-theme-size-1rem","--lr-theme-size-2-25rem","--lr-theme-size-2-5ch","--lr-theme-size-2-5rem","--lr-theme-size-20rem","--lr-theme-size-22rem","--lr-theme-size-24px","--lr-theme-size-24rem","--lr-theme-size-280px","--lr-theme-size-28px","--lr-theme-size-28rem","--lr-theme-size-2px","--lr-theme-size-2rem","--lr-theme-size-3-5em","--lr-theme-size-3-5rem","--lr-theme-size-30rem","--lr-theme-size-32rem","--lr-theme-size-36rem","--lr-theme-size-38rem","--lr-theme-size-3ch","--lr-theme-size-3px","--lr-theme-size-3rem","--lr-theme-size-48rem","--lr-theme-size-4ch","--lr-theme-size-4px","--lr-theme-size-4rem","--lr-theme-size-5em","--lr-theme-size-5rem","--lr-theme-size-6ch","--lr-theme-size-6em","--lr-theme-size-6px","--lr-theme-size-6rem","--lr-theme-size-7rem","--lr-theme-size-8em","--lr-theme-size-8rem","--lr-theme-size-neg-0-15rem","--lr-theme-size-neg-0-25rem","--lr-theme-size-neg-1px","--lr-theme-size-neg-4px","--lr-theme-size-neg-6px","--lr-theme-size-neg-8px","--lr-theme-space-2xl","--lr-theme-space-2xs","--lr-theme-space-l","--lr-theme-space-m","--lr-theme-space-s","--lr-theme-space-xs","--lr-theme-table-row-height","--lr-theme-transition-fast","--lr-theme-transition-normal","--lr-theme-transition-slow","--lr-theme-word-break","--lr-theme-z-index-base","--lr-theme-z-index-content","--lr-theme-z-index-dropdown","--lr-theme-z-index-modal","--lr-theme-z-index-popover","--lr-theme-z-index-toast"],outputs:["--lr-border-width-medium","--lr-border-width-thick","--lr-border-width-thin","--lr-color-border","--lr-color-border-strong","--lr-color-border-subtle","--lr-color-brand","--lr-color-brand-border-loud","--lr-color-brand-border-normal","--lr-color-brand-border-quiet","--lr-color-brand-fill-loud","--lr-color-brand-fill-normal","--lr-color-brand-fill-quiet","--lr-color-brand-on-loud","--lr-color-brand-on-normal","--lr-color-brand-on-quiet","--lr-color-brand-quiet","--lr-color-danger","--lr-color-danger-border-loud","--lr-color-danger-border-normal","--lr-color-danger-border-quiet","--lr-color-danger-fill-loud","--lr-color-danger-fill-normal","--lr-color-danger-fill-quiet","--lr-color-danger-on-loud","--lr-color-danger-on-normal","--lr-color-danger-on-quiet","--lr-color-danger-quiet","--lr-color-mix-active","--lr-color-mix-hover","--lr-color-mix-partner","--lr-color-neutral","--lr-color-neutral-border-loud","--lr-color-neutral-border-normal","--lr-color-neutral-border-quiet","--lr-color-neutral-fill-loud","--lr-color-neutral-fill-normal","--lr-color-neutral-fill-quiet","--lr-color-neutral-on-loud","--lr-color-neutral-on-normal","--lr-color-neutral-on-quiet","--lr-color-no-data","--lr-color-on-brand","--lr-color-on-danger","--lr-color-on-neutral","--lr-color-on-strong-overlay","--lr-color-on-success","--lr-color-on-warning","--lr-color-overlay","--lr-color-overlay-strong","--lr-color-shadow","--lr-color-success","--lr-color-success-border-loud","--lr-color-success-border-normal","--lr-color-success-border-quiet","--lr-color-success-fill-loud","--lr-color-success-fill-normal","--lr-color-success-fill-quiet","--lr-color-success-on-loud","--lr-color-success-on-normal","--lr-color-success-on-quiet","--lr-color-success-quiet","--lr-color-surface","--lr-color-surface-container","--lr-color-surface-container-high","--lr-color-surface-container-highest","--lr-color-surface-container-low","--lr-color-surface-container-lowest","--lr-color-surface-overlay","--lr-color-surface-raised","--lr-color-text","--lr-color-text-quiet","--lr-color-warning","--lr-color-warning-border-loud","--lr-color-warning-border-normal","--lr-color-warning-border-quiet","--lr-color-warning-fill-loud","--lr-color-warning-fill-normal","--lr-color-warning-fill-quiet","--lr-color-warning-on-loud","--lr-color-warning-on-normal","--lr-color-warning-on-quiet","--lr-color-warning-quiet","--lr-duration-ambient","--lr-duration-base","--lr-duration-fast","--lr-duration-icon","--lr-easing-emphasized","--lr-easing-linear","--lr-easing-standard","--lr-focus-ring","--lr-focus-ring-color","--lr-focus-ring-offset","--lr-focus-ring-width","--lr-font","--lr-font-heading","--lr-font-mono","--lr-font-size-2xl","--lr-font-size-2xs","--lr-font-size-3xl","--lr-font-size-3xs","--lr-font-size-4xl","--lr-font-size-5xl","--lr-font-size-lg","--lr-font-size-m","--lr-font-size-md-sm","--lr-font-size-sm","--lr-font-size-xl","--lr-font-size-xs","--lr-font-weight-bold","--lr-font-weight-medium","--lr-font-weight-normal","--lr-font-weight-semibold","--lr-hover-brightness","--lr-layer-base","--lr-layer-content","--lr-layer-dropdown","--lr-layer-modal","--lr-layer-popover","--lr-layer-toast","--lr-line-break","--lr-line-height-1-4","--lr-line-height-compact","--lr-line-height-loose","--lr-line-height-none","--lr-line-height-normal","--lr-line-height-snug","--lr-mask-opaque","--lr-opacity-disabled","--lr-opacity-muted","--lr-otp-input-segment-size","--lr-popover-viewport-clamp","--lr-radius","--lr-radius-container","--lr-radius-pill","--lr-radius-xs","--lr-safe-area-bottom","--lr-safe-area-top","--lr-scroll-fade-size","--lr-shadow","--lr-shadow-color","--lr-shadow-l","--lr-shadow-m","--lr-shadow-s","--lr-shadow-xl","--lr-shadow-xs","--lr-size-0-02em","--lr-size-0-03em","--lr-size-0-04em","--lr-size-0-05rem","--lr-size-0-0625rem","--lr-size-0-09375rem","--lr-size-0-125rem","--lr-size-0-15rem","--lr-size-0-1875rem","--lr-size-0-1rem","--lr-size-0-25rem","--lr-size-0-3125rem","--lr-size-0-35em","--lr-size-0-375rem","--lr-size-0-3em","--lr-size-0-4375rem","--lr-size-0-4em","--lr-size-0-4rem","--lr-size-0-5em","--lr-size-0-5rem","--lr-size-0-625rem","--lr-size-0-6875rem","--lr-size-0-6rem","--lr-size-0-75em","--lr-size-0-75rem","--lr-size-0-7em","--lr-size-0-875em","--lr-size-0-8rem","--lr-size-0-9375rem","--lr-size-1-0625rem","--lr-size-1-1rem","--lr-size-1-25rem","--lr-size-1-5em","--lr-size-1-5rem","--lr-size-1-75rem","--lr-size-10px","--lr-size-10rem","--lr-size-12em","--lr-size-12rem","--lr-size-14px","--lr-size-14rem","--lr-size-15rem","--lr-size-16px","--lr-size-16rem","--lr-size-18rem","--lr-size-1em","--lr-size-1px","--lr-size-1rem","--lr-size-2-25rem","--lr-size-2-5ch","--lr-size-2-5rem","--lr-size-20rem","--lr-size-22rem","--lr-size-24px","--lr-size-24rem","--lr-size-280px","--lr-size-28px","--lr-size-28rem","--lr-size-2px","--lr-size-2rem","--lr-size-3-5em","--lr-size-3-5rem","--lr-size-30rem","--lr-size-32rem","--lr-size-36rem","--lr-size-38rem","--lr-size-3ch","--lr-size-3px","--lr-size-3rem","--lr-size-48rem","--lr-size-4ch","--lr-size-4px","--lr-size-4rem","--lr-size-5em","--lr-size-5rem","--lr-size-6ch","--lr-size-6em","--lr-size-6px","--lr-size-6rem","--lr-size-7rem","--lr-size-8em","--lr-size-8rem","--lr-size-neg-0-15rem","--lr-size-neg-0-25rem","--lr-size-neg-1px","--lr-size-neg-4px","--lr-size-neg-6px","--lr-size-neg-8px","--lr-space-2xl","--lr-space-2xs","--lr-space-3xl","--lr-space-4xl","--lr-space-l","--lr-space-m","--lr-space-s","--lr-space-xl","--lr-space-xs","--lr-table-row-min-height","--lr-transition-ambient","--lr-transition-base","--lr-transition-fast","--lr-transition-interactive","--lr-word-break"],feedingOutputs:["--lr-color-border","--lr-color-brand","--lr-color-brand-fill-loud","--lr-color-brand-fill-quiet","--lr-color-brand-on-loud","--lr-color-danger","--lr-color-danger-fill-loud","--lr-color-danger-fill-quiet","--lr-color-danger-on-loud","--lr-color-neutral-fill-loud","--lr-color-neutral-on-loud","--lr-color-success-fill-loud","--lr-color-success-fill-quiet","--lr-color-success-on-loud","--lr-color-surface","--lr-color-surface-overlay","--lr-color-surface-raised","--lr-color-text","--lr-color-warning-fill-loud","--lr-color-warning-fill-quiet","--lr-color-warning-on-loud","--lr-focus-ring-color","--lr-focus-ring-width","--lr-radius","--lr-shadow-m","--lr-transition-fast"],scopeAttributes:["data-lr-theme","data-lr-theme-scope","data-lr-mode","data-lr-look","data-lr-accent","data-lr-accent-neutral","data-lr-accent-success","data-lr-accent-warning","data-lr-accent-danger","data-lr-density","data-lr-contrast","data-lr-motion","data-lr-design-token-mode"],scopeClasses:["lr-light","lr-dark","lr-token-light","lr-token-dark"]});function $p(e){let t="",n=0,r="";for(;n<e.length;){let s=e[n];if(r){if(t+=s,s==="\\"){t+=e[n+1]??"",n+=2;continue}s===r&&(r=""),n+=1;continue}if(s==='"'||s==="'"){r=s,t+=s,n+=1;continue}if(s==="/"&&e[n+1]==="*"){let o=e.indexOf("*/",n+2),i=o<0?e.length:o+2;t+=" ".repeat(i-n),n=i;continue}t+=s,n+=1}return t}c($p,"stripComments");function _i(e,t){let n=[],r=0,s="",o=0;for(let i=0;i<e.length;i++){let a=e[i];if(s){a==="\\"?i+=1:a===s&&(s="");continue}a==='"'||a==="'"?s=a:a==="("||a==="["?r+=1:a===")"||a==="]"?r-=1:a===t&&r===0&&(n.push(e.slice(o,i)),o=i+1)}return n.push(e.slice(o)),n}c(_i,"splitTopLevel");function Ii(e){let t=$p(e),n=[],r=[],s="",o="",i=0,a=c(()=>{let l=s.trim();if(s="",!l)return;let u=l.indexOf(":");if(u<=0)return;let m=l.slice(0,u).trim(),h=l.slice(u+1).trim(),y=/!\s*important\s*$/i.test(h);y&&(h=h.replace(/!\s*important\s*$/i,"").trim());let w=r.filter(E=>E.kind==="rule");n.push({property:m,value:h,important:y,selector:w.length?w[w.length-1].prelude:"",atRules:r.filter(E=>E.kind==="at").map(E=>E.prelude)})},"flushDeclaration");for(let l=0;l<t.length;l++){let u=t[l];if(o){s+=u,u==="\\"?(s+=t[l+1]??"",l+=1):u===o&&(o="");continue}if(u==='"'||u==="'")o=u,s+=u;else if(u==="(")i+=1,s+=u;else if(u===")")i-=1,s+=u;else if(u==="{"&&i===0){let m=s.trim().replace(/\s+/g," ");s="",r.push({kind:m.startsWith("@")?"at":"rule",prelude:m})}else u==="}"&&i===0?(a(),r.pop()):u===";"&&i===0?r.length&&r[r.length-1].kind==="rule"?a():s="":s+=u}return n}c(Ii,"readDeclarations");var Jn="theme-scopes",Me="data-lr-theme-scope",zr=new Set(Ot.consumedInputs),vp=new Set(Ot.outputs),Hs=new Set(Ot.feedingOutputs),Ep=new RegExp(`(?:^|[\\s/])[?.:@]?(?:${Ot.scopeAttributes.join("|")})(?=[\\s=/>]|$)`),xp=new RegExp(`(?:^|[\\s"'\`{])(?:${Ot.scopeClasses.join("|")})(?=[\\s"'\`}]|$)`),Sp=new Set(["html","htm","js","mjs","cjs","ts","mts","cts","jsx","tsx","vue","svelte","astro"]),kp=new Set(["css","scss","less","pcss","postcss"]),Tp=new Set(["jsx","tsx"]),Rp=c(e=>/\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase()??"","extensionOf");function Hn(e,t){let n=1,r=0;for(let s=e.indexOf(`
31
+ `);s!==-1&&s<t;s=e.indexOf(`
32
+ `,s+1))n+=1,r=s+1;return{line:n,column:t-r+1}}c(Hn,"lineColumn");function*Ap(e){let t=0;for(;(t=e.indexOf("<",t))!==-1;){let n=/^<([a-zA-Z][\w:-]*)/.exec(e.slice(t,t+80));if(!n){t+=1;continue}let r=t+n[0].length,s="",o=0;for(;r<e.length;r++){let i=e[r];if(s){i==="\\"?r+=1:i===s&&(s="");continue}if(o){i==="{"?o+=1:i==="}"?o-=1:(i==='"'||i==="'"||i==="`")&&(s=i);continue}if(i==='"'||i==="'")s=i;else if(i==="{")o=1;else if(i===">"||i==="<")break}if(e[r]!==">"){t+=1;continue}yield{start:t,tag:n[1],attributesStart:t+n[0].length,attributes:e.slice(t+n[0].length,r)},t=r+1}}c(Ap,"startTags");function Op(e){let t=/(?:^|\s)[.:]?style\s*=\s*/.exec(e);if(!t)return null;let n=e.slice(t.index+t[0].length),r=n[0];if(r==='"'||r==="'")return n.slice(1,n.indexOf(r,1)===-1?void 0:n.indexOf(r,1));let s=r==="$"&&n[1]==="{"?2:r==="{"?1:-1;if(s<0)return n.split(/\s/)[0];let o=1;for(let i=s;i<n.length;i++)if(n[i]==="{")o+=1;else if(n[i]==="}"&&--o===0)return n.slice(s,i);return n.slice(s)}c(Op,"styleValue");var Ci=c(e=>[...e.matchAll(/(--lr-(?:theme-)?[a-z0-9-]+)\s*['"`]?\s*:/g)].map(t=>t[1]),"declaredIn"),Np=c(e=>[...new Set(Ci(e).filter(t=>zr.has(t)))],"consumedIn"),_p=c(e=>[...new Set(Ci(e).filter(t=>Hs.has(t)))],"feedingIn");function Ip(e,t){let n=e.slice(Math.max(0,t-600),t);return/\.map\(\s*(?:\([^)]*\)|[\w$]+)\s*=>|\brepeat\(|\bv-for=|\*ngFor=|\{#each\b|\.forEach\(/.test(n)}c(Ip,"insideRepeat");function Cp(e){return Pp(e)}c(Cp,"selectorIsScope");function Mp(e){let t="";for(let n=0;n<e.length;n++){if(e.startsWith(":not(",n)){let r=0;for(n+=4;n<e.length;n++)if(e[n]==="(")r+=1;else if(e[n]===")"&&--r===0)break;continue}t+=e[n]}return t}c(Mp,"withoutNegations");function jp(e){let t=0,n=0;for(let r=0;r<e.length;r++){let s=e[r];s==="("||s==="["?t+=1:s===")"||s==="]"?t-=1:t===0&&/[\s>+~]/.test(s)&&(n=r+1)}return e.slice(n)}c(jp,"subjectCompound");var zp=[":root","html",...Ot.scopeClasses.map(e=>`.${e}`),...Ot.scopeAttributes.map(e=>`[${e}`)];function Pp(e){let t=Mp(e.trim()),n=jp(t);return zp.some(r=>n.includes(r))?!0:/\.(?:light|dark)\b/.test(n)&&t.includes("[data-lr-look")}c(Pp,"isThemeScopeSelector");function Us(e,t,n,r,s){for(let o of Lp(e)){if(!o.selector)continue;let i=_i(o.selector,",").map(l=>l.trim()).filter(l=>!Cp(l));if(!i.length)continue;let a=Hn(n,t+o.offset);zr.has(o.property)?s(a,{code:"THEME_SCOPE_CSS_INPUT_REVIEW",member:o.property,target:Me,message:`${i.join(", ")} sets ${o.property}, which the Lyra token layer consumes, but is not a theme scope: mark the matched elements with ${Me} (a :host or ::slotted() rule means the host or slotted element).`}):vp.has(o.property)&&s(a,{code:"THEME_SCOPE_OUTPUT_REVIEW",member:o.property,target:Me,message:Hs.has(o.property)?`${i.join(", ")} sets the shared output ${o.property}: it now reaches deeper (until the next theme scope), and the outputs derived from it no longer follow it. Set its --lr-theme-* input on a theme scope, or mark the element with ${Me}.`:`${i.join(", ")} sets the shared output ${o.property}: it now reaches deeper, until the next theme scope, instead of stopping at the first Lyra component.`})}}c(Us,"cssReports");function Lp(e){let t=Ii(e),n=0;return t.map(r=>{let s=e.indexOf(r.property,n),o=s===-1?n:s;return n=s===-1?n:s+r.property.length,{...r,offset:o}})}c(Lp,"readDeclarationsWithOffsets");function Js(e,{file:t="input"}={}){let n=Rp(t),r=[],s=Tp.has(n)?` ${Me}=""`:` ${Me}`,o=c((u,{code:m,tag:h=null,member:y=null,target:w=null,message:E})=>r.push({file:t,...u,rule:Jn,upstreamTag:h,upstreamMember:y,action:"manual-review",target:w,warningCode:m,message:E}),"warn"),i=/@aceshooting\/lyra-ui\/(?:dist\/)?theme\.css/.exec(e),a=/@aceshooting\/lyra-ui\/(?:dist\/)?(?:styles\/)?tokens-root\.css/.exec(e);if(i&&a&&o(Hn(e,a.index),{code:"THEME_SCOPE_DOUBLE_LAYER_REVIEW",member:"tokens-root.css",message:"theme.css already carries the Lyra document token layer: remove the tokens-root.css import (it is the same layer alone, for pages without theme.css)."}),kp.has(n))return Us(e,0,e,t,o),{insertions:[],warnings:r,marker:s};if(!Sp.has(n)&&n!=="")return{insertions:[],warnings:r,marker:s};let l=[];for(let u of Ap(e)){let m=Op(u.attributes);if(m===null)continue;let h=Np(m),y=_p(m);if(!h.length&&!y.length){/\.\.\.\s*[\w$.]+/.test(m)&&/style/.test(u.attributes)&&o(Hn(e,u.start),{code:"THEME_SCOPE_DYNAMIC_INPUT_REVIEW",target:Me,message:`<${u.tag}> spreads a style object; if it can carry a --lr-theme-* input the Lyra token layer consumes, mark the element with ${Me}.`});continue}if(/\sdata-lr-not-a-scope(?=[\s=>]|$)/.test(u.attributes)||u.tag.toLowerCase()==="html"||Ep.test(u.attributes)||xp.test(Dp(u.attributes)))continue;let w=Hn(e,u.start),E=[...h,...y];l.push({offset:u.attributesStart,change:{file:t,...w,rule:Jn,upstreamTag:u.tag,upstreamMember:E.join(" "),action:"insert-theme-scope",target:Me,message:h.length?`Mark <${u.tag}> with ${Me}: its inline ${h.join(", ")} must re-derive the Lyra token layer for the components below it.`:`Mark <${u.tag}> with ${Me}: other shared outputs derive from its inline ${y.join(", ")}, and only a theme scope re-derives them.`}}),Ip(e,u.start)&&o(w,{code:"THEME_SCOPE_REPEATED_REVIEW",tag:u.tag,target:Me,message:`<${u.tag}> is rendered in a loop: each instance is now a theme scope that re-derives the whole token layer. Prefer setting ${E.join(", ")} once on a common ancestor scope.`})}for(let u of e.matchAll(/\.setProperty\(\s*(['"`])(--lr-[a-z0-9-]+)\1/g))!zr.has(u[2])&&!Hs.has(u[2])||o(Hn(e,u.index),{code:"THEME_SCOPE_DYNAMIC_INPUT_REVIEW",member:u[2],target:Me,message:zr.has(u[2])?`setProperty('${u[2]}') sets an input the Lyra token layer consumes: make sure the element is a theme scope (${Me}).`:`setProperty('${u[2]}') sets a shared output that other outputs derive from: they follow it only on a theme scope (${Me}).`});for(let u of e.matchAll(/\bcss`([^`]*)`/g))Us(u[1],u.index+4,e,t,o);if(n==="html"||n==="htm"||n==="vue"||n==="svelte"||n==="astro")for(let u of e.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))Us(u[1],u.index+u[0].indexOf(">")+1,e,t,o);return{insertions:l,warnings:r,marker:s}}c(Js,"analyzeThemeScopes");function Gs(e,{file:t="input"}={}){let{insertions:n,warnings:r,marker:s}=Js(e,{file:t}),o=e;for(let{offset:i}of[...n].sort((a,l)=>l.offset-a.offset))o=`${o.slice(0,i)}${s}${o.slice(i)}`;return{content:o,changes:n.map(({change:i})=>i),warnings:r}}c(Gs,"migrateThemeScopes");function Dp(e){let t=/(?:^|\s)[.:]?(?:class|className)\s*=\s*/.exec(e);return t?e.slice(t.index+t[0].length,t.index+t[0].length+400):""}c(Dp,"classValue");var Ut="RENAME_REVIEW",Mi="RENAME_TARGET_SHARED_REVIEW",Ys="NAME_GAINED_OWNER_REVIEW",Nt="POLARITY_REVIEW",Fp="DETAIL_SHAPE_REVIEW",ji="DETAIL_FIELD_REVIEW",Bp="DEPRECATED_MEMBER_REVIEW",Vp="DEPRECATED_CONTENT_REVIEW",Zs="RENAME_CONFLICT_REVIEW",zi="UNUSED_ACKNOWLEDGEMENT",qp=/lyra-migrate-reviewed:\s*([^\n]*)/g,Wp=/^([A-Z][A-Z0-9_]*):(\S+)$/,Kp="#default",Qs=/(?:\b(?:add|remove)EventListener|\bHostListener)\s*\(\s*$/,Up=/([A-Za-z_$][\w$]*(?:\s*(?:\?\.|\.)\s*#?[A-Za-z_$][\w$]*|\s*\([^()\n]*\)|\s*!(?!=))*)\s*(?:\?\.|\.)\s*(?:add|remove)EventListener\s*\(\s*$/,Hp=/^\s*,\s*([A-Za-z_$][\w$]*(?:\s*(?:\?\.|\.)\s*#?[A-Za-z_$][\w$]*)*)\s*[,)]/,Jp=/\bnew\s+(?:CustomEvent|Event)\s*(?:<[^>\n]+>)?\(\s*(['"`])(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1/g,Gp=/(?:\b(?:createElement|querySelector(?:All)?|closest|matches|unsafeStatic|literal)|\bcustomElements\s*\.\s*(?:get|whenDefined|define))\s*(?:<[^>\n]+>)?\(\s*$/,Yp=/\b(?:querySelector|closest|createElement)\s*(?:<[^>\n]+>)?\(\s*(['"`])(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1\s*\)\s*!?\s*(?:\?\.|\.)\s*([A-Za-z_$][\w$]*)/g,Zp=new Set(["setAttribute","getAttribute","hasAttribute","removeAttribute","toggleAttribute"]),Pi=new Set(["addEventListener","removeEventListener"]),Fi=/\.(?:css|scss|sass|less|pcss|styl)$/i,Xp=/\.(?:html?|xhtml|md|markdown|vue|svelte)$/i,Qp=/\.(?:html?|xhtml|md|markdown)$/i,ed=/\.(?:[cm]?[jt]s)$/i,td=256,Bi=c(e=>e===""?Kp:String(e),"ackName");function _t(e){let t=[];for(let[n,r]of[...e].sort((s,o)=>s[0]-o[0])){let s=t.at(-1);s&&n<=s[1]?s[1]=Math.max(s[1],r):t.push([n,r])}return t}c(_t,"mergeRanges");function et(e){return t=>{let n=0,r=e.length-1;for(;n<=r;){let s=n+r>>1;if(e[s][1]<=t)n=s+1;else if(e[s][0]>t)r=s-1;else return!0}return!1}}c(et,"rangeTester");function so(e,t){let n=t+1;for(;n<e.length;){let r=e[n];if(r==="\\")n+=2;else{if(r==="`")return n+1;r==="$"&&e[n+1]==="{"?n=nd(e,n+2):n+=1}}return e.length}c(so,"templateLiteralEnd");function nd(e,t){let n=1;for(;t<e.length;){let r=e[t];if(r==="`"){t=so(e,t);continue}if(r==='"'||r==="'"){for(t+=1;t<e.length&&e[t]!==r&&e[t]!==`
33
+ `;)t+=e[t]==="\\"?2:1;t+=1;continue}if(r==="{")n+=1;else if(r==="}"&&--n===0)return t+1;t+=1}return e.length}c(nd,"templateExpressionEnd");function oo(e,t){let n=[],r=0;for(;r<e.length;){let s=e[r];if(t(r))r+=1;else if(s==="`"){let o=so(e,r);n.push([r,o]),r=o}else if(s==='"'||s==="'"){for(r+=1;r<e.length&&e[r]!==s&&e[r]!==`
34
+ `;)r+=e[r]==="\\"?2:1;r+=1}else r+=1}return n}c(oo,"templateLiteralRanges");function Vi(e,t,n){let r=[];for(let s of e.matchAll(new RegExp(`\\b(?:${t.join("|")})\\s*\``,"g"))){if(n(s.index))continue;let o=s.index+s[0].length-1;r.push([o,so(e,o)])}return _t(r)}c(Vi,"taggedTemplateRanges");function rd(e,t){let n=_t(Kt(e)),r=et(n),s=[],o=c((i,a)=>{let l=e.indexOf("<!--",i);for(;l>=0&&l<a;){let u=Tr(e,l,a);r(l)||s.push([l,u]),l=e.indexOf("<!--",u)}},"addHtmlComments");if(Xp.test(t))o(0,e.length);else if(!Fi.test(t))for(let[i,a]of oo(e,r))o(i,a);return _t([...n,...s])}c(rd,"renameIgnoredRanges");function sd(e,t,n,r){let s=new Map(r.map(l=>[l.start,l])),o=[],i=new Map,a=c((l,u)=>{let m=i.get(l)??[];m.includes(u)||m.push(u),i.set(l,m)},"cover");for(let[l,u]of t){let m=e.slice(l,u);if(!m.includes("lyra-migrate-reviewed:"))continue;let h=Wt(n,l).line,y=Wt(n,Math.max(l,u-1)).line,w=u;for(;w<e.length&&/[\s}]/.test(e[w]);)w+=1;let E=s.get(w),x=/^\s*\{?\s*$/.test(e.slice(n[h-1],l));for(let f of m.matchAll(qp)){let S=f[1].replace(/(?:\*\/|--!?>)[\s\S]*$/,"").split(/[\s,]+/).filter(Boolean),p={offset:l+f.index,entries:S.map(N=>{let T=Wp.exec(N);return{token:N,code:T?.[1]??null,name:T?.[2]??null,used:!1}})};o.push(p);for(let N=h;N<=y;N+=1)a(N,p);if(x&&a(y+1,p),E){let N=Wt(n,E.end).line;for(let T=Wt(n,E.start).line;T<=N;T+=1)a(T,p)}}}return{consume(l,u,m){let h=Bi(m);for(let y of i.get(l)??[]){let w=y.entries.find(E=>E.code===u&&E.name===h);if(w)return w.used=!0,!0}return!1},unused:c(()=>o.flatMap(l=>l.entries.filter(u=>!u.used).map(u=>({offset:l.offset,entry:u}))),"unused")}}c(sd,"scanReviewAcknowledgements");function eo(e,t){let n=[],r=0;for(;r<e.length;){let s=e[r];if(t(r)||s!=='"'&&s!=="'"&&s!=="`"){r+=1;continue}let o=r;for(r+=1;r<e.length&&e[r]!==s&&(s==="`"||e[r]!==`
35
+ `);)e[r]==="\\"&&(r+=1),r+=1;r+=1,s!=="`"&&n.push([o,r])}return n}c(eo,"quotedStringRanges");function to(e,t,n){if(Fi.test(t))return[[0,e.length]];let r=[];for(let s of e.matchAll(/<style(?:\s[^>]*)?>[\s\S]*?<\/style\s*>/gi))r.push([s.index,s.index+s[0].length]);return _t([...r,...Vi(e,["css"],n)])}c(to,"stylesheetRanges");function Lr(e,t){let n=t,r=0,s=0,o=Math.max(0,t-td);for(;n>o;){let a=e[n-1];if(a==="]")r+=1;else if(a==="["){if(r===0)break;r-=1}else if(a===")")s+=1;else if(a==="("){if(s===0)break;s-=1}else if(r===0&&s===0&&/[\s,>+~{};'"`]/.test(a))break;n-=1}if(n===o&&o>0)return null;let i=e.slice(n,t);return(/^:global\(\s*([A-Za-z][\w-]*)\s*\)$/.exec(i)??/^([A-Za-z][\w-]*)/.exec(i))?.[1].toLowerCase()??null}c(Lr,"compoundTypeBefore");function od(e,t,n){let r=new Set;for(let s of t)for(let o of e.matchAll(new RegExp(`(?<![\\w-])${s}(?![\\w-])`,"g")))if(!n(o.index)){r.add(s);break}return r}c(od,"mentionedTags");function ad(e,t,n){let r=[],s=[];for(let o of e.matchAll(new RegExp(`<(/)?${t}(?=[\\s/>])`,"g"))){if(n(o.index))continue;let i=un(e,o.index+o[0].length);if(!(i<0))if(o[1]){let a=s.pop();a&&r.push({opening:a,closingStart:o.index})}else/\/\s*>$/.test(e.slice(o.index,i+1))||s.push({start:o.index,end:i})}return r}c(ad,"elementPairs");function id(e,t,n,r){let s=[],o=[],i=/<(\/)?([A-Za-z][\w.:-]*)(?=[\s/>])/g;i.lastIndex=t;for(let a=i.exec(e);a&&a.index<n;a=i.exec(e)){if(r(a.index))continue;let l=un(e,a.index+a[0].length);if(l<0||l>=n)break;let u=a[2].toLowerCase();if(a[1]){let m=o.lastIndexOf(u);m>=0&&(o.length=m)}else{let m=a.index+1;o.length===0&&s.push({tag:u,start:a.index,nameStart:m,nameEnd:m+a[2].length,end:l}),!/\/\s*>$/.test(e.slice(a.index,l+1))&&!qs.has(u)&&o.push(u)}i.lastIndex=l+1}return s}c(id,"directChildTokens");function cd(e,t){let n=[],r=t.nameEnd,s=null;for(;r<t.end;){let o=e[r];if(s){o==="\\"?r+=1:o===s&&(s=null),r+=1;continue}if(o==='"'||o==="'")s=o;else if(o==="{"){let i=gt(e,r,"{","}");!/=\s*$/.test(e.slice(t.nameEnd,r))&&e[r-1]!=="$"&&n.push({start:r,end:i,body:e.slice(r+1,i-1).trim()}),r=i;continue}r+=1}return n}c(cd,"openingTagBraceGroups");function Li(e){if(/^\(lr-[a-z0-9-]+\)$/.test(e))return{name:e.slice(1,-1),offset:1};if(e.startsWith("onlr-"))return{name:e.slice(2).replace(/Capture$/,""),offset:2};for(let[t,n]of[["@","."],["v-on:","."],["on:","|"]])if(e.startsWith(t))return{name:e.slice(t.length).split(n)[0],offset:t.length};return null}c(Li,"markupEventName");function no(e){let t=e.rawName,n;if(t.startsWith("?"))return{form:"attribute",offset:1,name:t.slice(1),dynamic:!0};if(n=/^\[attr\.([^\]]+)\]$/.exec(t))return{form:"attribute",offset:6,name:n[1],dynamic:!0};if(n=/^\[([A-Za-z_$][\w$]*)\]$/.exec(t))return{form:"property",offset:1,name:n[1],dynamic:!0};if(t.startsWith("."))return{form:"property",offset:1,name:t.slice(1),dynamic:!0};if(t.startsWith("bind:"))return{form:"property",offset:5,name:t.slice(5).split("|")[0],dynamic:!0};for(let s of["v-bind:",":"])if(t.startsWith(s))return{form:"member",offset:s.length,name:t.slice(s.length).split(".")[0],dynamic:!0};if(!/^[A-Za-z][\w-]*$/.test(t)||t.startsWith("onlr-"))return null;let r=e.valueKind==="expression"||/\$\{|\{\{/.test(e.value??"");return{form:/[A-Z]/.test(t)?"property":"attribute",offset:0,name:t,dynamic:r}}c(no,"markupMemberBinding");function ld(e,t){if(t.valueEnd===null)return t.nameEnd;let n=e[t.valueStart-1];return(n==='"'||n==="'")&&e[t.valueEnd]===n?t.valueEnd+1:t.valueEnd}c(ld,"attributeEnd");function ud(e){let t=new Set;for(let n of e){let r=no(n);r&&t.add(Ue(r.name))}return t}c(ud,"boundMemberNames");function Di(e,t){return e.sort((n,r)=>n.line-r.line||n.column-r.column||String(n[t]).localeCompare(String(r[t])))}c(Di,"sortReportEntries");function pd(e,t,n,r,s,o){if(!n.length)return;let i="@aceshooting/lyra-ui",a=c(C=>`${i}${C.slice(1)}`,"specifierOf"),l=n.filter(C=>["function","type","constant","class"].includes(C.kind)),u=c((C,I,W="")=>o(C,{member:I.name,code:"DEPRECATED_MODULE_REVIEW",target:I.replacement,message:`${W}${I.kind} ${I.module?`${I.module}#`:""}${I.name} ${I.removedIn?`was removed in ${I.removedIn}`:`is deprecated and scheduled for removal in ${I.removalNotBefore}`}; review ${I.replacement}.`}),"report"),m=c(C=>l.filter(I=>C===i||C===a(I.module)),"namedFor"),h=eo(e,s),y=oo(e,s),w=new Set([...h,...y.filter(([C,I])=>!e.slice(C,I).includes("${"))].map(([C])=>C)),E=et(h),x=et(_t([...h,...y])),f=et(to(e,t,s)),S=c(C=>r.some(I=>C>=I.nameEnd&&C<I.end),"inMarkup"),p=c((C,I,W)=>{W.length&&o(C,{member:I,code:"MODULE_NAMESPACE_REVIEW",target:[...new Set(W.map($=>$.replacement))].join("; "),message:`Review the namespace or dynamic import of ${I} for deprecated exports ${W.map($=>$.name).join(", ")}. They cannot be safely renamed through aliases; the earliest removal is ${W.map($=>$.removalNotBefore).sort()[0]}.`})},"opaque"),N=/\b(?:import|export)\s+(?:type\s+)?(?:[$A-Z_a-z][$\w]*\s*,\s*)?\{(?<bindings>[^{};]*)\}\s*from\s*(?<quote>['"])(?<source>@aceshooting\/lyra-ui(?:\/[^'"\s]+)?)\k<quote>/g,T=new Set;for(let C of e.matchAll(N)){if(s(C.index)||x(C.index))continue;let I=m(C.groups.source),W=C.index+C[0].indexOf("{")+1;for(let $ of At(C.groups.bindings)){let L=I.find(k=>k.name===$.imported);if(!L)continue;let d=[...C.groups.bindings.matchAll(new RegExp(`(?<![$\\w])${Se($.imported)}(?![$\\w])`,"g"))].find(k=>!s(W+k.index));d&&u(W+d.index,L)}T.add(C.index+C[0].lastIndexOf(C.groups.source)-1)}for(let C of e.matchAll(/(['"])(@aceshooting\/lyra-ui(?:\/[^'"\s]+)?)\1/g)){if(s(C.index))continue;let I=S(C.index),W=f(C.index);if(!w.has(C.index)&&!I&&!W)continue;let $=e.slice(Math.max(0,C.index-500),C.index),L=Cr(e,C.index),d=W&&/@import\s+(?:url\(\s*)?$/.test($),k=I&&/\b(?:href|src)\s*=\s*$/.test($);if(!L&&!d&&!k)continue;let j=C[2];for(let F of n)(F.kind==="entry-point"||F.kind==="stylesheet")&&j===a(F.name)&&u(C.index+1,F);if(T.has(C.index)||!L||L.sideEffect)continue;let M=m(j);if(L.kind==="binding"&&/\bexport\s+(?:type\s+)?\*\s*(?:as\s+[$A-Z_a-z][$\w]*\s*)?from\s*$/.test($))for(let F of M)u(C.index+1,F,"This re-export includes ");else p(C.index+1,j,M)}for(let C of e.matchAll(/@import\s+url\(\s*(@aceshooting\/lyra-ui\/[^\s)'";]+)\s*\)/g))if(!(s(C.index)||!f(C.index)))for(let I of n)I.kind==="stylesheet"&&C[1]===a(I.name)&&u(C.index+C[0].indexOf(C[1]),I);for(let C of n)if(C.kind==="window-event")for(let I of e.matchAll(new RegExp(`(['"\\x60])(${Se(C.name)})\\1`,"g"))){if(s(I.index))continue;let W=e.slice(Math.max(0,I.index-200),I.index);(Qs.test(W)||/\bnew\s+(?:CustomEvent|Event)\s*(?:<[^>\n]+>)?\(\s*$/.test(W))&&w.has(I.index)&&u(I.index+1,C)}else if(C.kind==="root-attribute"){let I=new Set;for(let L of r)for(let d of Qe(e,L))d.rawName.replace(/^\[attr\.(.+)\]$/,"$1").replace(/^(?:v-bind:|bind:|[?:])/,"")===C.name&&!E(d.nameStart)&&I.add(d.nameStart+d.rawName.indexOf(C.name));for(let L of e.matchAll(new RegExp(`(?<![\\w-])${Se(C.name)}(?![\\w-])`,"g"))){if(s(L.index))continue;let d=L.index,k=e.slice(Math.max(0,d-180),d),j=e.slice(d+C.name.length),M=/\b(?:getAttribute|setAttribute|hasAttribute|removeAttribute|toggleAttribute)\s*\(\s*['"`]$/.test(k),F=/\[\s*$/.test(k)&&/^\s*(?:[~|^$*]?=|\])/.test(j),D=I.has(d);(M&&w.has(d-1)||F&&(f(d)||E(d))||D)&&u(d,C)}let W=C.name.slice(5).replace(/-([a-z])/g,(L,d)=>d.toUpperCase()),$=new RegExp(`\\bdataset\\s*(?:\\.\\s*${Se(W)}\\b|\\[\\s*(['"])${Se(W)}\\1\\s*\\])`,"g");for(let L of e.matchAll($))!s(L.index)&&!x(L.index)&&u(L.index,C)}}c(pd,"reportModuleReviews");var dd="GLOBAL_REVIEW",ro="@aceshooting/lyra-ui",md=/(?:^|\/)node_modules\/$/,fd=/\.json$/i,Pr="[$A-Za-z_][$\\w]*",Xs=c(e=>e.module==="."?ro:`${ro}${e.module.slice(1)}`,"exportSpecifier");function hd(e,t,n,{inComment:r,inCss:s,openingTokens:o,rewrite:i,warn:a}){let l=n.filter(w=>w.kind==="module"),u=n.filter(w=>w.kind==="export"),m=n.filter(w=>w.kind==="locale-key"),h=c((w,E,x,f)=>a(w,{member:x,code:dd,target:E.to,message:f}),"review");if(l.length){let w=c(f=>o.some(S=>f>=S.nameEnd&&f<S.end),"inMarkup"),E=c((f,S,p,N)=>{N?i(S,S+f.from.length,f.to,{tag:null,member:p,action:"rewrite-module",target:f.to,message:`Rewrite ${f.from} to ${f.to}: ${f.summary}`}):h(S,f,p,`${p} is not provably a module specifier here (or is computed): ${f.summary} Use ${f.to}${f.prefix?"...":""} instead.`)},"handle"),x=c(f=>l.find(S=>S.prefix?f.startsWith(S.from)&&!(S.except??[]).some(p=>f.startsWith(p)):f===S.from),"entryFor");for(let f of e.matchAll(/(['"`])([^'"`\n]*?@aceshooting\/lyra-ui\/[^'"`\n]*)\1/g)){if(r(f.index))continue;let S=f[2].indexOf("@aceshooting/"),p=f[2].slice(0,S);if(p&&!md.test(p))continue;let N=f[2].slice(S),T=x(N);if(!T)continue;let C=f.index+1+S,I=e.slice(Math.max(0,f.index-500),f.index),W=Cr(e,f.index),$=s(f.index)&&/@import\s+(?:url\(\s*)?$/.test(I),L=w(f.index)&&/\b(?:href|src)\s*=\s*$/.test(I),d=!N.includes("${")&&!!(p||fd.test(t)||W||$||L);E(T,C,N,d)}for(let f of e.matchAll(/@import\s+url\(\s*(@aceshooting\/lyra-ui\/[^\s)'";]+)\s*\)/g)){let S=x(f[1]);r(f.index)||!s(f.index)||!S||E(S,f.index+f[0].indexOf(f[1]),f[1],!0)}}if(u.length){let w=new RegExp(`\\b(?:import|export)\\s+(?:type\\s+)?(?:${Pr}\\s*,\\s*)?\\{(?<body>[^{};]*)\\}\\s*from\\s*(?<quote>['"])(?<source>${Se(ro)}(?:\\/[^'"\\s]+)?)\\k<quote>`,"g"),E=new RegExp(`^(\\s*(?:type\\s+)?)(${Pr})(\\s+as\\s+${Pr})?\\s*$`,"d");for(let x of e.matchAll(w)){if(r(x.index))continue;let f=x.index+x[0].indexOf("{")+1;for(let S of x.groups.body.matchAll(/[^,]+/g)){let p=E.exec(S[0]),N=p&&u.find(C=>C.from===p[2]);if(!N)continue;let T=f+S.index+p.indices[2][0];r(T)||(x.groups.source===Xs(N)?i(T,T+N.from.length,p[3]?N.to:`${N.to} as ${N.from}`,{tag:null,member:N.from,action:"rewrite-export",target:N.to,message:`${N.from} no longer exists; import ${N.to}${p[3]?"":` as ${N.from}`}: ${N.summary}`}):h(T,N,N.from,`${N.from} is not exported by ${x.groups.source} any more: ${N.summary} Import ${N.to} from ${Xs(N)}.`))}}for(let x of u){let f=Se(Xs(x)),p=[...[...e.matchAll(new RegExp(`import\\s+(?:type\\s+)?\\*\\s+as\\s+(${Pr})\\s+from\\s*(['"])${f}\\2`,"g"))].map(N=>N[1]).map(Se),`import\\(\\s*['"]${f}['"]\\s*\\)`];for(let N of e.matchAll(new RegExp(`(?<![$\\w.])(?:${p.join("|")})\\s*\\.\\s*${x.from}(?![$\\w])`,"g")))r(N.index)||h(N.index+N[0].lastIndexOf(x.from),x,x.from,`${x.from} no longer exists: ${x.summary} Use ${x.to}.`)}}for(let w of n.filter(E=>E.kind==="css-property")){let E=new RegExp(`${Se(w.from)}${w.prefix?"[\\w-]*":"(?![\\w-])"}`,"g"),x=!w.prefix&&/^--[\w-]+$/.test(w.to);for(let f of e.matchAll(E))r(f.index)||(x?i(f.index,f.index+f[0].length,w.to,{tag:null,member:f[0],action:"rewrite-css-property",target:w.to,message:`Rewrite ${w.from} to ${w.to}: ${w.summary}`}):h(f.index,w,f[0],`The custom property ${f[0]} was removed: ${w.summary} Use ${w.to}.`))}let y=n.filter(w=>w.kind==="part");if(y.length)for(let w of e.matchAll(/::part\(([^)]*)\)/g)){if(r(w.index))continue;let E=w[1].trim().split(/\s+/),x=Lr(e,w.index);for(let f of y)!E.includes(f.from)||!(x===f.tag||!x&&e.includes(f.tag))||h(w.index+w[0].indexOf(f.from),f,f.from,`The ${f.tag} part ${f.from} changed: ${f.summary} ${f.to}`)}if(m.length&&/registerLyraLocale|bridgeLyraLocale|\.strings\b|@aceshooting\/lyra-ui/.test(e))for(let w of m){if(w.tag&&!e.includes(w.tag))continue;let E=w.to?`use ${w.to}`:"it has no replacement",x=w.tag?`${w.tag} no longer reads the localization key ${w.from}; ${E}: ${w.summary}`:`The localization key ${w.from} was removed; ${E}: ${w.summary}`;for(let f of e.matchAll(new RegExp(`(?<![$\\w.-])${w.from}(?![$\\w-])`,"g"))){let S=e[f.index-1]??"",p=e.slice(f.index+w.from.length,f.index+w.from.length+12),N=/['"`]/.test(S)&&/^['"`]/.test(p);r(f.index)||!(N||/^\s*:/.test(p))||h(f.index,w,w.from,x)}}}c(hd,"applyGlobals");function qi(e,t,n){let r=n.file??"<memory>",s=n.origin,o=t.renameProfiles.get(s);U(o,`unknown migration origin ${String(s)}`);let i={content:e,changes:[],warnings:[],acknowledged:0,usage:{webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}},blockedMappings:new Set,blockedEcosystems:new Set,bareImportEcosystems:new Set,blockedLocalMigrations:new Set,constructedEvents:new Set};if(o.isEmpty)return i;let a=Bn(e),l=rd(e,r),u=et(l),m=Vn(e,l,u),h=sd(e,l,a,m),y=ed.test(r)?et(Vi(e,["html","svg"],u)):()=>!1,w=et(_t([...eo(e,u),...oo(e,u)])),E=et(to(e,r,u)),x=c(g=>Qp.test(r)||y(g),"attributeSemantics"),f=`Lyra ${o.toMajor}`,S=`${o.aliasRemovalMajor}.0.0`;for(let g of e.matchAll(Jp))!u(g.index)&&o.renamesNamed("event",g[2]).length&&i.constructedEvents.add(g[2]);let p=new Set([...n.constructedEvents??[],...i.constructedEvents]),N=c((g,b)=>{let A=Up.exec(e.slice(Math.max(0,g-200),g))?.[1],R=Hp.exec(e.slice(g+b.length+2,g+b.length+202))?.[1];return A&&R?`${A.replace(/\s+/g,"")}\0${R.replace(/\s+/g,"")}`:null},"listenerIdentity"),T=new Map;if(o.data.renames.some(g=>g.kind==="event"))for(let g of e.matchAll(/(['"`])(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1/g)){if(u(g.index)||!Qs.test(e.slice(Math.max(0,g.index-120),g.index)))continue;let b=N(g.index,g[2]);b&&T.set(b,new Set([...T.get(b)??[],g[2]]))}let C=c((g,b)=>{if(!T.size)return!1;let A=T.get(N(g,b));return!!A&&o.renamesNamed("event",b).some(R=>A.has(R.to))},"sameHandlerListens"),I=[],W=new Set,$=new Set,L=new Set,d=c(g=>[...new Set(g)],"unique"),k=c(g=>d(g).join(", "),"list"),j=c(g=>d(g.map(b=>b.tag)).length===1?g[0].tag:null,"soleTag"),M=c((g,b)=>`After review, mark the site with a "lyra-migrate-reviewed: ${g}:${Bi(b)}" comment.`,"hint"),F=c((g,b,A,{tag:R,member:z,action:V,target:H,message:q})=>{I.push({start:g,end:b,replacement:A}),i.changes.push(yt({textStarts:a,file:r,offset:g,origin:s,upstreamTag:R,upstreamMember:z,action:V,target:H,message:q}))},"rewrite"),D=c((g,{tag:b=null,member:A,code:R,target:z=null,message:V})=>{let H=`${g}:${R}:${A}`;if(!W.has(H)){if(W.add(H),h.consume(Wt(a,g).line,R,A)){i.acknowledged+=1;return}i.warnings.push(yt({textStarts:a,file:r,offset:g,origin:s,upstreamTag:b,upstreamMember:A,action:"manual-review",target:z,warningCode:R,message:`${V} ${M(R,A)}`}))}},"warn"),O=c(g=>`${g.kind==="component"?`<${g.tag}>`:g.kind==="slot"&&g.name===""?`Content in the default slot of ${g.tag}`:`The ${g.tag} ${g.kind} ${g.name}`} ${g.removedIn?`was removed in ${g.removedIn}`:`is deprecated and scheduled for removal in ${g.removalNotBefore}`}; migrate to ${g.replacement} by hand.`,"reviewMessage"),_=c((g,b)=>D(g,{tag:b.tag,member:b.name,code:Bp,target:b.replacement,message:O(b)}),"reportReview"),K=c((g,b)=>D(g,{tag:b.tag,member:b.property,code:"PROPERTY_CHANGE_REVIEW",target:b.property,message:`Review ${b.tag}.${b.property} for ${f}: ${b.summary}`}),"reportPropertyChange");if(pd(e,r,o.data.moduleReviews,m,u,D),hd(e,r,o.data.globals,{inComment:u,inCss:E,openingTokens:m,rewrite:F,warn:D}),o.data.rules.includes("theme-scopes")){let g=Js(e,{file:r});for(let{offset:b,change:A}of g.insertions)F(b,b,g.marker,{tag:A.upstreamTag,member:A.upstreamMember,action:A.action,target:A.target,message:A.message});for(let b of g.warnings)D(a[b.line-1]+b.column-1,{tag:b.upstreamTag,member:b.upstreamMember??b.upstreamTag??b.target,code:b.warningCode,target:b.target,message:b.message})}let Z=c((g,b,A,R)=>{let z=R?o.reviewFor(R,g,b):null;if(z)_(A,z);else if(!o.exposes(g,b,R))for(let V of o.reviewsNamed(g,b))_(A,V)},"unownedReviews"),te=c(g=>g==="css-property"?"custom property":g,"label"),ce=c(g=>{let b=o.detailsNamed(g);return b.length?` Its ${f} detail also changed: ${b.map(A=>`${A.tag}: ${A.summary}`).join(" ")}`:""},"detailNote"),se=c(({kind:g,name:b,start:A,context:R,rewritable:z,action:V})=>{let H=o.renamesNamed(g,b),q=d(H.map(pe=>pe.to)),B=g==="event"&&p.has(b);if(z&&!B&&o.isGlobal(g,b))return F(A,A+b.length,q[0],{tag:j(H),member:b,action:V,target:q[0],message:`Rename ${b} to ${q[0]}; every component exposing it renamed it, and no other component uses ${q[0]}.`}),q[0];let X=d(q.flatMap(pe=>o.sourceKeepers(g,b,pe))).filter(pe=>!H.some(de=>de.tag===pe)),ue=d(q.flatMap(pe=>o.targetKeepers(g,b,pe))),ne=q.length===1&&!X.length&&ue.length>0&&!H.some(pe=>pe.polarity);return D(A,{tag:j(H),member:b,code:ne?Mi:Ut,target:q.join(" | "),message:(g==="css-property"?"Custom properties inherit into nested components. ":R==="listener"?"This listener does not prove which element it listens to. ":"This string may name an event of any component. ")+`${k(H.map(pe=>pe.tag))} renamed the ${te(g)} ${b} to ${q.join(" or ")}`+(X.length?`, while ${k(X)} still ${X.length===1?"uses":"use"} ${b}`:"")+(ue.length?`; ${k(ue)} already ${ue.length===1?"uses":"use"} ${q.join(" and ")}, which this site would start reaching`:"")+(B?`; the scanned code also dispatches ${b} itself, so its listeners and dispatches must move together`:"")+`. Update it by hand for the components it is meant for; ${b} has a recorded removal floor of ${S}; check the installed release migration guide.`+(g==="event"?ce(q[0]):"")}),null},"unownedMove"),le=c((g,b,A=!0)=>{if(p.has(g))return null;let R=b?o.renameFor(b,"event",g):null;return R?o.targetKeepers("event",g,R.to).length?null:R.to:!A||!o.renamesNamed("event",g).length||o.exposes("event",g,b)?null:o.isGlobal("event",g)?o.renamesNamed("event",g)[0].to:null},"eventMove"),we=c((g,b,A)=>g==="same-handler"?`${b} already listens to ${A} with this same handler; renamed, the two identical registrations would collapse into one, so the handler would run once per activation instead of twice. Rename or remove this call, and its add or remove counterpart, together by hand.`:`${b} already listens to ${A}; merge the two handlers by hand.`,"conflictMessage"),ge=c(({name:g,start:b,owner:A,context:R,rewritable:z=!0,conflict:V=!1})=>{let H=A?o.retiredEventFor(A,g):null,q=H?[H]:o.exposes("event",g,A)?[]:o.retiredEventsNamed(g);q.length&&D(b,{tag:H?A:j(q),member:g,code:"RETIRED_EVENT_REVIEW",target:d(q.map(de=>de.replacement)).join(", "),message:`${g} is no longer dispatched by ${k(q.map(de=>de.tag))} in ${f}. `+q.map(de=>`${de.tag}: use ${de.replacement}. ${de.summary}`).join(" ")+" Review this listener and its matching removal together; keep unrelated events with the same spelling, check nested event targets, and merge any existing canonical listener without dropping or duplicating handler calls."});let B=A?o.renameFor(A,"event",g):null,X=g;if(B){let de=o.targetKeepers("event",g,B.to);if(p.has(g))D(b,{tag:A,member:g,code:Ut,target:B.to,message:`Not renamed: the scanned code dispatches ${g} itself, so this listener would stop hearing it. Rename the dispatch and its listeners to ${B.to} together; ${g} has a recorded removal floor of ${S}; check the installed release migration guide.${ce(B.to)}`});else if(de.length)D(b,{tag:A,member:g,code:Mi,target:B.to,message:`Not renamed: ${k(de)} also ${de.length===1?"dispatches":"dispatch"} ${B.to}, so this listener would start receiving their events when they are nested inside this ${A}. Rename it by hand and ignore events whose target is not this ${A}; ${g} has a recorded removal floor of ${S}; check the installed release migration guide.${ce(B.to)}`});else if(V)D(b,{tag:A,member:g,code:Zs,target:B.to,message:`${we(V,`This ${A}`,B.to)} ${g} has a recorded removal floor of ${S}; check the installed release migration guide.`});else{let Ve=o.sourceKeepers("event",g,B.to).filter(oe=>oe!==A);F(b,b+g.length,B.to,{tag:A,member:g,action:"rewrite-event",target:B.to,message:`Rename the ${A} event ${g} to ${B.to}.`+(Ve.length?` ${k(Ve)} still ${Ve.length===1?"dispatches":"dispatch"} ${g}; this listener stops hearing theirs from nested elements.`:"")}),X=B.to}}else o.renamesNamed("event",g).length&&!o.exposes("event",g,A)&&(V?D(b,{tag:j(o.renamesNamed("event",g)),member:g,code:Zs,target:o.renamesNamed("event",g)[0].to,message:we(V,V==="same-handler"?"This receiver":"This element",o.renamesNamed("event",g)[0].to)}):X=se({kind:"event",name:g,start:b,context:R,rewritable:z,action:"rewrite-event"})??g);let ue=o.detailsNamed(X),ne=A?o.detailFor(A,X):null;if(ne||ue.length&&!o.exposes("event",X,A)){let de=ne?[ne]:ue;D(b,{tag:ne?A:j(de),member:X,code:Fp,target:X,message:`The ${X} event detail changed in ${f} and cannot be aliased: `+de.map(Ve=>`${Ve.tag}: ${Ve.summary}`).join(" ")+` Update this handler if it reads the detail of ${ne?`the ${A} event`:"one of these components"}.`})}let pe=X===g?o.gainedOwners("event",g):[];pe.length&&!o.exposes("event",g,A)&&D(b,{tag:j(pe.map(de=>({tag:de}))),member:g,code:Ys,target:g,message:`In ${f}, ${k(pe)} also ${pe.length===1?"dispatches":"dispatch"} ${g}. This ${R} does not prove which element it listens to, so it may start receiving those events; ignore them by event target if it should not.`}),Z("event",g,b,A)},"eventSite"),be=new Set,Ge=/\b([A-Za-z_$][\w$]*)\s*(?:\?\.|\.)\s*detail\s*(?:\?\.|\.)\s*(open|collapsed)\b/g,Ie=c((g,b,A=null,R=null)=>{if(be.has(b))return;let z=A&&R?o.detailFieldFor(A,R):null;if(z&&z.field===g){let B=z.relation==="equal"?"detail.expanded":"!detail.expanded",X=z.relation==="equal"?"carries the same value as":"is the inverse of",ue=z.removedIn?` It was removed in ${z.removedIn}.`:" This notice does not assert that the field was removed.";D(b,{tag:A,member:g,code:ji,target:B,message:`The ${A} ${R} detail field ${g} is deprecated: it ${X} detail.expanded (${z.notice}). Read ${B} in this handler by hand; no field rewrite was applied.${ue}`}),be.add(b);return}let V=R?o.detailFieldsNamed(R).filter(B=>B.field===g):[],H=V.length?V:(o.data.detailFields??[]).filter(B=>B.field===g);if(!H.length)return;let q=[...new Set(H.map(B=>`${B.tag}/${B.event} (${B.relation})`))];D(b,{tag:null,member:g,code:ji,target:null,message:`This detail.${g} read has no proven Lyra tag and event. Matching published field contracts are ${q.join(", ")}; identify the runtime detail type and migrate it by hand. No field rewrite was applied.`}),be.add(b)},"reportDetailField"),st=c((g,b,A)=>{if(A.valueStart===null||A.valueEnd===null)return;let R=e.slice(A.valueStart,A.valueEnd);for(let z of R.matchAll(Ge)){let V=A.valueStart+z.index+z[0].lastIndexOf(z[2]);Ie(z[2],V,g,b)}},"inspectMarkupDetailFields");for(let g of m){let b=g.tag.toLowerCase();for(let A of Qe(e,g)){let R=Li(A.rawName);R&&R.name.startsWith("lr-")&&st(b,R.name,A)}}let ut=c(({owner:g,kind:b,name:A,start:R,forms:z,dynamic:V,removal:H})=>{let q=z.filter(([ue])=>ue==="property").map(([,ue])=>o.propertyChangeFor(g,ue)).find(Boolean);q&&K(R,q);let B=z.map(([ue,ne])=>o.reviewFor(g,ue,ne)).find(Boolean);B&&_(R,B);let X=z.map(([ue,ne])=>o.renameFor(g,ue,ne)).find(Boolean);if(!X)return null;if(X.polarity==="inverted"&&(V||!H)){let ue=b==="binding"?Wn(A,X.to):X.to;return D(R,{tag:g,member:X.from,code:Nt,target:X.to,message:`${ue} is the inverse of ${A} on ${g}, and this ${b==="binding"?"binding":b==="property"?"property access":"attribute binding"} is not a static attribute. Bind the negated value to ${ue} by hand; ${A} has a recorded removal floor of ${S}; check the installed release migration guide.`}),null}return X},"memberSite"),ze=c(g=>d([...o.data.renames.filter(b=>b.tag===g&&["attribute","property","event"].includes(b.kind)).map(b=>b.from),...o.data.reviews.filter(b=>b.tag===g&&["attribute","property","event"].includes(b.kind)).map(b=>b.name),...o.data.retiredEvents.filter(b=>b.tag===g).map(b=>b.event),...o.data.propertyChanges.filter(b=>b.tag===g).flatMap(b=>[b.property,...b.former?[b.former]:[]])]),"renamedMembers"),xt=[];for(let g of m){let b=g.tag.toLowerCase(),A=Qe(e,g),R=o.tags.has(b),z=R?ud(A):null,V=new Map,H=A.map(q=>{let B=Li(q.rawName),X=q.rawName;if(B&&B.name.startsWith("lr-")){let ne=le(B.name,b);ne&&(X=q.rawName.slice(0,B.offset)+ne+q.rawName.slice(B.offset+B.name.length))}else if(R){let ne=no(q),pe=ne&&!ne.form.startsWith("member")&&o.renameFor(b,ne.form,ne.name);pe&&!pe.polarity&&(X=q.rawName.slice(0,ne.offset)+pe.to+q.rawName.slice(ne.offset+ne.name.length))}let ue=X.toLowerCase();return V.set(ue,(V.get(ue)??0)+1),{attribute:q,event:B,key:ue,renamed:X!==q.rawName}});if(R&&ze(b).length)for(let q of cd(e,g)){let B=/^[A-Za-z_$][\w$]*$/.exec(q.body)?.[0];if(!B){D(q.start,{tag:b,member:b,code:"DYNAMIC_VALUE_REVIEW",target:null,message:`This spread on ${b} may carry renamed or deprecated members (${k(ze(b))}); rename them where the object is built.`});continue}let X=[["property",He(B)],["attribute",Ue(B)]],ue=X.map(([de,Ve])=>o.reviewFor(b,de,Ve)).find(Boolean);ue&&_(q.start+1,ue);let ne=o.propertyChangeFor(b,He(B));ne&&K(q.start+1,ne);let pe=X.map(([de,Ve])=>o.renameFor(b,de,Ve)).find(Boolean);pe&&D(q.start+1,{tag:b,member:pe.from,code:pe.polarity?Nt:Ut,target:pe.to,message:`The shorthand {${B}} binds the deprecated ${b} ${pe.kind} ${pe.from}; write ${Wn(B,pe.to)}={${pe.polarity?`!${B}`:B}} by hand.`})}for(let{attribute:q,event:B,key:X,renamed:ue}of H){if(B){B.name.startsWith("lr-")&&(st(b,B.name,q),ge({name:B.name,start:q.nameStart+B.offset,owner:b,context:"listener",conflict:ue&&V.get(X)>1}));continue}if(!R)continue;if(/^v-(?:bind|on)$/.test(q.rawName)||q.rawName.startsWith("${")&&!/^\$\{\s*ref\s*\(/.test(q.rawName)){ze(b).length&&D(q.nameStart,{tag:b,member:b,code:"DYNAMIC_VALUE_REVIEW",target:null,message:`This object binding on ${b} may carry renamed or deprecated members (${k(ze(b))}); rename them where the object is built.`});continue}if(q.rawName==="exportparts"){if(q.valueKind!=="literal"||/\$\{|\{\{/.test(q.value??""))continue;for(let pt of(q.value??"").matchAll(/([^,\s:]+)(\s*:\s*[^,\s]+)?/g)){let dt=pt[1],Ye=q.valueStart+pt.index,ta=o.reviewFor(b,"part",dt);ta&&_(Ye,ta);let tn=o.renameFor(b,"part",dt);tn&&F(Ye,Ye+dt.length,pt[2]?tn.to:`${tn.to}:${dt}`,{tag:b,member:dt,action:"rewrite-part",target:tn.to,message:pt[2]?`Forward the renamed ${b} part ${tn.to} under the same exported name.`:`Forward the renamed ${b} part ${tn.to} under its previous exported name ${dt}.`})}continue}let ne=no(q);if(!ne)continue;let pe=ne.form==="member"?[["property",He(ne.name)],["attribute",Ue(ne.name)]]:[[ne.form,ne.name]],de=q.nameStart+ne.offset,Ve=ne.form==="attribute"&&ne.offset===0&&!ne.dynamic,oe=ut({owner:b,kind:ne.form==="member"?"binding":ne.form,name:ne.name,start:de,forms:pe,dynamic:ne.dynamic,removal:Ve});if(!oe)continue;if(z.has(Ue(oe.to))||ue&&V.get(X)>1){D(de,{tag:b,member:oe.from,code:Zs,target:oe.to,message:`This ${b} already binds ${oe.to}; remove the deprecated ${oe.from} binding by hand.`});continue}if(oe.polarity==="inverted"){if(!x(g.start)){D(de,{tag:b,member:oe.from,code:Nt,target:oe.to,message:`${oe.to} is the inverse of ${oe.from}. In this template syntax a static value may be assigned to the ${He(oe.from)} property as a string, where "false" is truthy, so set ${oe.to} by hand.`});continue}if(o.preservedDefaultsFor(b).some(Ye=>Ye.attribute===oe.to&&Ye.value===!0)){D(de,{tag:b,member:oe.from,code:Nt,target:oe.to,message:`${oe.from} has a preserved absent default, so removing an explicit attribute would let a later run insert ${oe.to}. Review this value using the old converter (a presence boolean treats even "false" as true), then migrate it by hand after the default migration is complete.`});continue}let pt=q.value??"",dt=ld(e,q);if(pt===""||pt==="true"||pt===oe.from){let Ye=q.nameStart;for(;Ye>0&&/\s/.test(e[Ye-1]);)Ye-=1;F(Ye,dt,"",{tag:b,member:oe.from,action:"remove-attribute",target:oe.to,message:`Remove ${oe.from}: it restated the ${b} default, and ${oe.to} is off by default.`})}else pt==="false"?F(q.nameStart,dt,oe.to,{tag:b,member:oe.from,action:"rewrite-attribute",target:oe.to,message:`Replace ${oe.from}="false" with the presence of ${oe.to}.`}):D(de,{tag:b,member:oe.from,code:Nt,target:oe.to,message:`${oe.from}="${q.value}" is not a boolean literal; set ${oe.to} to its inverse by hand.`});continue}let Ml=ne.form==="member"?Wn(ne.name,oe.to):oe.to;F(de,de+ne.name.length,Ml,{tag:b,member:oe.from,action:`rewrite-${oe.kind}`,target:oe.to,message:`Rename the ${b} ${oe.kind} ${oe.from} to ${oe.to}.`})}R&&o.defaultsFor(b).length&&xt.push({token:g,owner:b,bound:z})}let Pt=[...o.tags].filter(g=>o.slotContentFor(g).length||[...o.data.renames,...o.data.reviews].some(b=>b.tag===g&&b.kind==="slot"));for(let g of Pt)for(let b of ad(e,g,u))for(let A of id(e,b.opening.end+1,b.closingStart,u)){let R="",z=A.nameStart;for(let q of Qe(e,A))if(q.rawName==="slot")R=q.valueKind==="literal"?q.value??"":null,z=q.valueStart??q.nameStart;else if(q.rawName==="v-slot")R="";else{let B=["v-slot:","#"].find(X=>q.rawName.startsWith(X));B&&(R=q.rawName.slice(B.length),z=q.nameStart+B.length,R==="default"&&(R=""))}if(R===null)continue;let V=o.reviewFor(g,"slot",R);V&&_(z,V);let H=R===""?null:o.renameFor(g,"slot",R);if(H&&F(z,z+R.length,H.to,{tag:g,member:R,action:"rewrite-slot",target:H.to,message:`Rename the ${g} slot ${R} to ${H.to}.`}),A.tag!=="template")for(let q of o.slotContentFor(g)){if(q.slot!==R)continue;let B=(q.report??q.allow).includes(A.tag);(q.report?!B:B)||D(A.nameStart,{tag:g,member:A.tag,code:Vp,target:null,message:`<${A.tag}> in ${R===""?"the default slot":`the ${R} slot`} of ${g}: ${q.summary}`})}}for(let g of e.matchAll(/::part\(([^)]*)\)/g)){if(u(g.index))continue;let b=Lr(e,g.index),A=g.index+7;for(let R of g[1].matchAll(/\S+/g)){let z=R[0],V=A+R.index,H=b?o.renameFor(b,"part",z):null;if(H)F(V,V+z.length,H.to,{tag:b,member:z,action:"rewrite-part",target:H.to,message:`Rename the ${b} part ${z} to ${H.to}.`});else if(o.renamesNamed("part",z).length&&!o.exposes("part",z,b)){let q=o.renamesNamed("part",z),B=o.exposers("part",z).filter(X=>!q.some(ue=>ue.tag===X));D(V,{tag:j(q),member:z,code:Ut,target:k(q.map(X=>X.to)),message:`This ::part() selector does not name the component that owns the part. ${k(q.map(X=>X.tag))} renamed the part ${z} to ${k(q.map(X=>X.to))}`+(B.length?`, while ${k(B)} still ${B.length===1?"exposes":"expose"} ${z}`:"")+". Rename it where the selector reaches a renamed component directly; a part forwarded through exportparts keeps its exported name."})}else if(o.gainedOwners("part",z).length&&!b?.startsWith("lr-")){let q=o.gainedOwners("part",z);D(V,{tag:j(q.map(B=>({tag:B}))),member:z,code:Ys,target:z,message:`In ${f}, ${k(q)} also ${q.length===1?"exposes":"expose"} the part ${z}, so this selector may start matching it.`})}Z("part",z,V,b)}}let Lt=new Set([...o.data.renames.filter(g=>g.kind==="css-property").flatMap(g=>[g.from,g.to]),...o.data.reviews.filter(g=>g.kind==="css-property").map(g=>g.name)]);if(Lt.size)for(let g of e.matchAll(/(?<![\w-])--[A-Za-z0-9_-]+/g)){let b=g[0];if(!Lt.has(b)||u(g.index))continue;o.renamesNamed("css-property",b).length&&se({kind:"css-property",name:b,start:g.index,context:"custom property",rewritable:!0,action:"rewrite-css-property"});let A=/^\s*['"]?\s*:/.test(e.slice(g.index+b.length,g.index+b.length+16))||/setProperty\s*\(\s*['"`]$/.test(e.slice(Math.max(0,g.index-24),g.index)),R=o.gainedOwners("css-property",b);A&&R.length&&D(g.index,{tag:j(R.map(z=>({tag:z}))),member:b,code:Ys,target:b,message:`In ${f}, ${k(R)} also ${R.length===1?"reads":"read"} ${b}, so this declaration now reaches them when they are nested below it.`});for(let z of o.reviewsNamed("css-property",b))_(g.index,z)}for(let g of e.matchAll(/\[\s*([A-Za-z_][\w-]*)(?=\s*(?:[~|^$*]?=|\]))/g)){if(u(g.index))continue;let b=Lr(e,g.index);if(!b||!o.tags.has(b))continue;let A=g[1],R=g.index+g[0].length-A.length,z=o.reviewFor(b,"attribute",A);z&&_(R,z);let V=o.renameFor(b,"attribute",A);if(V){if(V.polarity==="inverted"){D(R,{tag:b,member:A,code:Nt,target:V.to,message:`${V.to} is the inverse of ${A}; rewrite this ${b} selector to test the opposite state (for example :not([${V.to}])).`});continue}if(!V.reflects){D(R,{tag:b,member:A,code:Ut,target:V.to,message:`${b} does not reflect ${V.to}, so [${V.to}] matches only where markup sets it. Rename this selector once every place that sets ${A} (markup, setAttribute) sets ${V.to} instead.`});continue}F(R,R+A.length,V.to,{tag:b,member:A,action:"rewrite-attribute",target:V.to,message:`Rename the ${b} attribute selector [${A}] to [${V.to}]; ${b} reflects ${V.to}.`})}}for(let g of e.matchAll(/:state\(\s*([a-z][a-z0-9-]*)\s*\)/g)){if(u(g.index))continue;let b=Lr(e,g.index),A=b?o.reviewFor(b,"css-state",g[1]):null;A&&_(g.index+g[0].indexOf(g[1]),A)}for(let g of o.data.reviews.filter(b=>b.kind==="component"))for(let b of e.matchAll(new RegExp(`(?<![\\w-])${g.tag}(?![\\w-])`,"g")))u(b.index)||e.slice(b.index-2,b.index)==="</"||_(b.index,g);let wn=/(?:document\.)?querySelector\(\s*(['"])(lr-[a-z0-9-]+)\1\s*\)\s*!?\s*\.\s*addEventListener\(\s*(['"])(lr-[a-z0-9-]+)\3\s*,/g,cs=/[A-Za-z_$][\w$]*\s*\.\s*addEventListener\(\s*(['"])(lr-[a-z0-9-]+)\1\s*,/g,ls=c(g=>{let b=Math.max(0,g-4096),A=e.slice(b,g),R=null;for(let z of[wn,cs]){z.lastIndex=0;for(let V of A.matchAll(z)){let H=z===wn?V[4]:V[2],q=V.index+V[0].length,B=A.slice(q);!/=>|\bfunction\b/u.test(B)||/\)\s*;/u.test(B)||(!R||V.index>=R.index)&&(R={owner:z===wn?V[2]:null,event:H,index:V.index})}}return R},"scriptListenerAt");for(let g of e.matchAll(Ge)){let b=g.index+g[0].lastIndexOf(g[2]);if(be.has(b)||u(b)||w(b)||E(b))continue;let A=ls(b);Ie(g[2],b,A?.owner??null,A?.event??null)}for(let g of e.matchAll(Yp)){if(u(g.index))continue;let b=g[2],A=g[3],R=g.index+g[0].length-A.length,z=R+A.length;if(L.add(R),Pi.has(A)||Zp.has(A)){let H=/^\s*\(\s*(['"`])([^'"`\n]+)\1/.exec(e.slice(z,z+200));if(!H)continue;let q=z+H[0].length-1-H[2].length;if($.add(q-1),Pi.has(A)){ge({name:H[2],start:q,owner:b,context:"listener",conflict:C(q-1,H[2])&&"same-handler"});continue}let B=ut({owner:b,kind:"attribute",name:H[2],start:q,forms:[["attribute",H[2]]],dynamic:!0});B&&F(q,q+H[2].length,B.to,{tag:b,member:B.from,action:"rewrite-attribute",target:B.to,message:`Rename the ${b} attribute ${B.from} to ${B.to}.`});continue}if(!o.tags.has(b))continue;if(/^\s*\(/.test(e.slice(z,z+64))){let H=o.reviewFor(b,"method",A);H&&_(R,H);continue}let V=ut({owner:b,kind:"property",name:A,start:R,forms:[["property",A]],dynamic:!0});V&&F(R,z,V.to,{tag:b,member:V.from,action:"rewrite-property",target:V.to,message:`Rename the ${b} property ${V.from} to ${V.to}.`})}let us=c(g=>o.renamesNamed("event",g).length||o.detailsNamed(g).length||o.retiredEventsNamed(g).length||o.reviewsNamed("event",g).length||o.gainedOwners("event",g).length,"eventNameMatters");for(let g of e.matchAll(/(['"`])(?:(window|document|body):)?(lr-[a-z0-9]+(?:-[a-z0-9]+)*)\1/g)){let b=g[3];if($.has(g.index)||u(g.index)||!us(b))continue;let A=e.slice(Math.max(0,g.index-120),g.index);if(!g[2]&&Gp.test(A))continue;let R=Qs.test(A);ge({name:b,start:g.index+1+(g[2]?g[2].length+1:0),owner:null,context:R?"listener":"event name string",rewritable:R,conflict:R&&!g[2]&&C(g.index,b)&&"same-handler"})}let en=od(e,o.tags,u),v=new Map,P=c((g,b)=>v.set(g,[...v.get(g)??[],b]),"addAccess");for(let g of o.data.renames)g.kind==="property"&&en.has(g.tag)&&P(g.from,{tag:g.tag,rule:g,call:!1});for(let g of o.data.reviews)(g.kind==="property"||g.kind==="method")&&en.has(g.tag)&&P(g.name,{tag:g.tag,review:g,call:g.kind==="method"});for(let g of o.data.propertyChanges)if(en.has(g.tag))for(let b of[g.property,...g.former?[g.former]:[]])P(b,{tag:g.tag,propertyChange:g,call:!1});if(v.size){let g=et(_t(eo(e,u))),b=et(to(e,r,u)),A=et(_t(m.map(R=>[R.start+1,R.end])));for(let R of e.matchAll(/(?<=[\w$)\]])\s*(?:\?\.|!?\.)\s*([A-Za-z_$][\w$]*)/g)){let z=R[1],V=v.get(z);if(!V)continue;let H=R.index+R[0].length-z.length;if(L.has(H)||be.has(H)||u(H)||g(H)||b(H)||A(H))continue;let q=/^\s*\(/.test(e.slice(H+z.length,H+z.length+64));for(let B of V){if(B.call!==q)continue;if(B.propertyChange){K(H,B.propertyChange);continue}if(B.review){_(H,B.review);continue}let{rule:X}=B;D(H,{tag:X.tag,member:z,code:X.polarity?Nt:Ut,target:X.to,message:`If this reads or writes an ${X.tag}, ${X.polarity?`use the inverse property .${X.to}`:`rename .${z} to .${X.to}`}; .${z} has a recorded removal floor of ${S}; check the installed release migration guide.`})}}}for(let g of e.matchAll(/\.\s*(?:set|get|has|remove|toggle)Attribute\s*\(\s*(['"`])([a-z][a-z0-9-]*)\1/g)){let b=g[2],A=g.index+g[0].length-1-b.length;if(!($.has(A-1)||u(g.index)))for(let R of en){let z=o.reviewFor(R,"attribute",b);z&&_(A,z);let V=o.renameFor(R,"attribute",b);V&&D(A,{tag:R,member:b,code:V.polarity?Nt:Ut,target:V.to,message:`If this element is an ${R}, ${V.polarity?`use the inverse attribute ${V.to}`:`rename ${b} to ${V.to}`}; ${b} has a recorded removal floor of ${S}; check the installed release migration guide.`})}}if(o.data.defaults.length){let g=new Map([...new Set(o.data.defaults.map(R=>R.tag))].map(R=>[R,{origin:s,tag:R,defaults:o.defaultsFor(R).map(z=>({member:z.attribute,value:z.value}))}])),b=jr(e,g,l,xt.map(({token:R})=>({...R,tag:R.tag.toLowerCase()}))),A=new Set([...n.blockedLocalMigrations??[],...b.blocked]);i.blockedLocalMigrations=b.blocked;for(let R of b.uses)D(R.offset,{tag:R.tag,member:R.tag,code:R.warningCode,target:R.tag,message:R.message});for(let{token:R,owner:z,bound:V}of xt){let H=o.defaultsFor(z).filter(B=>!o.defaultAliasesFor(z,B.attribute).some(X=>V.has(X)));if(!H.length)continue;if(A.has(ln(s,z))){D(R.nameStart,{tag:z,member:z,code:"MAPPING_REVIEW_BLOCKED",target:z,message:`${z} did not receive its Lyra ${o.fromMajor} defaults (${H.map(B=>`${B.attribute}=${String(B.value)}`).join(", ")}) because the scanned target set accesses it through a DOM alias or an opaque attribute spread. Add them by hand where the previous default matters.`});continue}let q=[];for(let B of H)q.push(Mr({member:B.attribute,value:B.value})),i.changes.push(yt({textStarts:a,file:r,offset:R.end,origin:s,upstreamTag:z,upstreamMember:B.attribute,action:"insert-default",target:`${B.attribute}=${String(B.value)}`,message:`Insert ${B.attribute} to preserve the Lyra ${o.fromMajor} default.`}));if(q.length){let B=e[R.end-1]==="/"?R.end-1:R.end,X=/\s/.test(e[B-1])?`${q.join(" ")} `:` ${q.join(" ")}`;I.push({start:B,end:B,replacement:X})}}}if(!o.skipped.length)for(let{offset:g,entry:b}of h.unused()){let A=`${g}:${zi}:${b.token}`;W.has(A)||(W.add(A),i.warnings.push(yt({textStarts:a,file:r,offset:g,origin:s,upstreamTag:null,upstreamMember:b.token,action:"manual-review",target:null,warningCode:zi,message:b.code?`The acknowledgement ${b.token} matches no report on the lines it covers; remove it.`:`The acknowledgement ${b.token} is not of the form CODE:name, for example DETAIL_SHAPE_REVIEW:lr-close.`})))}return i.content=Un(e,I),Di(i.changes,"action"),Di(i.warnings,"warningCode"),i}c(qi,"migrateRenameText");var Gn={$comment:["Reviewed routes from Web Awesome (--wa-*) and Shoelace (--sl-*) design tokens to Lyra document-layer tokens, read by scripts/migration-token-routes.mjs.","Only upstream token NAMES and their publicly documented values or roles were compared; no upstream source was copied.","exact: the same role, and for a metric scale the same documented value; rewritten silently and reported as a change.","approximate: the same role with a value that may differ; rewritten and reported as UPSTREAM_TOKEN_APPROXIMATE_REVIEW.","review: a known token with no Lyra equivalent; left as-is and reported as UPSTREAM_TOKEN_REVIEW with the note as the hint. reviewPatterns cover whole families the same way.","Every target must be declared by the document token layer (src/styles/tokens-root.css); scripts/migration-token-routes.test.mjs enforces it."],exact:{"--sl-border-radius-large":"--lr-radius","--sl-border-radius-medium":"--lr-radius-xs","--sl-border-radius-pill":"--lr-radius-pill","--sl-focus-ring":"--lr-focus-ring","--sl-focus-ring-color":"--lr-focus-ring-color","--sl-focus-ring-width":"--lr-focus-ring-width","--sl-font-mono":"--lr-font-mono","--sl-font-sans":"--lr-font","--sl-font-size-2x-small":"--lr-font-size-2xs","--sl-font-size-3x-large":"--lr-font-size-5xl","--sl-font-size-large":"--lr-font-size-xl","--sl-font-size-small":"--lr-font-size-m","--sl-font-size-x-small":"--lr-font-size-xs","--sl-font-weight-bold":"--lr-font-weight-bold","--sl-font-weight-normal":"--lr-font-weight-normal","--sl-font-weight-semibold":"--lr-font-weight-medium","--sl-input-border-width":"--lr-border-width-thin","--sl-line-height-dense":"--lr-line-height-1-4","--sl-line-height-denser":"--lr-line-height-none","--sl-overlay-background-color":"--lr-color-overlay","--sl-panel-background-color":"--lr-color-surface","--sl-panel-border-width":"--lr-border-width-thin","--sl-spacing-2x-small":"--lr-space-xs","--sl-spacing-3x-large":"--lr-space-3xl","--sl-spacing-3x-small":"--lr-space-2xs","--sl-spacing-medium":"--lr-space-l","--sl-spacing-small":"--lr-space-m","--sl-spacing-x-small":"--lr-space-s","--sl-z-index-dropdown":"--lr-layer-dropdown","--wa-border-radius-pill":"--lr-radius-pill","--wa-border-width-l":"--lr-border-width-thick","--wa-border-width-m":"--lr-border-width-medium","--wa-border-width-s":"--lr-border-width-thin","--wa-color-brand-border-loud":"--lr-color-brand-border-loud","--wa-color-brand-border-normal":"--lr-color-brand-border-normal","--wa-color-brand-border-quiet":"--lr-color-brand-border-quiet","--wa-color-brand-fill-loud":"--lr-color-brand-fill-loud","--wa-color-brand-fill-normal":"--lr-color-brand-fill-normal","--wa-color-brand-fill-quiet":"--lr-color-brand-fill-quiet","--wa-color-brand-on-loud":"--lr-color-brand-on-loud","--wa-color-brand-on-normal":"--lr-color-brand-on-normal","--wa-color-brand-on-quiet":"--lr-color-brand-on-quiet","--wa-color-danger-border-loud":"--lr-color-danger-border-loud","--wa-color-danger-border-normal":"--lr-color-danger-border-normal","--wa-color-danger-border-quiet":"--lr-color-danger-border-quiet","--wa-color-danger-fill-loud":"--lr-color-danger-fill-loud","--wa-color-danger-fill-normal":"--lr-color-danger-fill-normal","--wa-color-danger-fill-quiet":"--lr-color-danger-fill-quiet","--wa-color-danger-on-loud":"--lr-color-danger-on-loud","--wa-color-danger-on-normal":"--lr-color-danger-on-normal","--wa-color-danger-on-quiet":"--lr-color-danger-on-quiet","--wa-color-focus":"--lr-focus-ring-color","--wa-color-neutral-border-loud":"--lr-color-neutral-border-loud","--wa-color-neutral-border-normal":"--lr-color-neutral-border-normal","--wa-color-neutral-border-quiet":"--lr-color-neutral-border-quiet","--wa-color-neutral-fill-loud":"--lr-color-neutral-fill-loud","--wa-color-neutral-fill-normal":"--lr-color-neutral-fill-normal","--wa-color-neutral-fill-quiet":"--lr-color-neutral-fill-quiet","--wa-color-neutral-on-loud":"--lr-color-neutral-on-loud","--wa-color-neutral-on-normal":"--lr-color-neutral-on-normal","--wa-color-neutral-on-quiet":"--lr-color-neutral-on-quiet","--wa-color-overlay-modal":"--lr-color-overlay","--wa-color-shadow":"--lr-color-shadow","--wa-color-success-border-loud":"--lr-color-success-border-loud","--wa-color-success-border-normal":"--lr-color-success-border-normal","--wa-color-success-border-quiet":"--lr-color-success-border-quiet","--wa-color-success-fill-loud":"--lr-color-success-fill-loud","--wa-color-success-fill-normal":"--lr-color-success-fill-normal","--wa-color-success-fill-quiet":"--lr-color-success-fill-quiet","--wa-color-success-on-loud":"--lr-color-success-on-loud","--wa-color-success-on-normal":"--lr-color-success-on-normal","--wa-color-success-on-quiet":"--lr-color-success-on-quiet","--wa-color-surface-border":"--lr-color-border","--wa-color-surface-default":"--lr-color-surface","--wa-color-surface-raised":"--lr-color-surface-raised","--wa-color-text-normal":"--lr-color-text","--wa-color-text-quiet":"--lr-color-text-quiet","--wa-color-warning-border-loud":"--lr-color-warning-border-loud","--wa-color-warning-border-normal":"--lr-color-warning-border-normal","--wa-color-warning-border-quiet":"--lr-color-warning-border-quiet","--wa-color-warning-fill-loud":"--lr-color-warning-fill-loud","--wa-color-warning-fill-normal":"--lr-color-warning-fill-normal","--wa-color-warning-fill-quiet":"--lr-color-warning-fill-quiet","--wa-color-warning-on-loud":"--lr-color-warning-on-loud","--wa-color-warning-on-normal":"--lr-color-warning-on-normal","--wa-color-warning-on-quiet":"--lr-color-warning-on-quiet","--wa-font-family-body":"--lr-font","--wa-font-family-code":"--lr-font-mono","--wa-font-family-heading":"--lr-font-heading","--wa-font-weight-normal":"--lr-font-weight-normal","--wa-space-2xs":"--lr-space-xs","--wa-space-3xl":"--lr-space-3xl","--wa-space-3xs":"--lr-space-2xs","--wa-space-4xl":"--lr-space-4xl","--wa-space-l":"--lr-space-xl","--wa-space-m":"--lr-space-l","--wa-space-s":"--lr-space-m","--wa-space-xl":"--lr-space-2xl","--wa-space-xs":"--lr-space-s"},approximate:{"--sl-color-danger-600":{target:"--lr-color-danger-fill-loud",note:"the 600 step is the loud danger fill role; the Lyra semantic grid is theme-derived, not a numbered palette"},"--sl-color-neutral-600":{target:"--lr-color-neutral-fill-loud",note:"the 600 step is the loud neutral fill role; the Lyra semantic grid is theme-derived, not a numbered palette"},"--sl-color-primary-600":{target:"--lr-color-brand-fill-loud",note:"the 600 step is the loud brand fill role; the Lyra semantic grid is theme-derived, not a numbered palette"},"--sl-color-success-600":{target:"--lr-color-success-fill-loud",note:"the 600 step is the loud success fill role; the Lyra semantic grid is theme-derived, not a numbered palette"},"--sl-color-warning-600":{target:"--lr-color-warning-fill-loud",note:"the 600 step is the loud warning fill role; the Lyra semantic grid is theme-derived, not a numbered palette"},"--sl-panel-border-color":{target:"--lr-color-border",note:"the panel border role maps to the Lyra border role, which is a stronger default line"},"--sl-shadow-large":{target:"--lr-shadow-l",note:"the elevation step matches but the shadow geometry differs"},"--sl-shadow-medium":{target:"--lr-shadow-m",note:"the elevation step matches but the shadow geometry differs"},"--sl-shadow-small":{target:"--lr-shadow-s",note:"the elevation step matches but the shadow geometry differs"},"--sl-shadow-x-large":{target:"--lr-shadow-xl",note:"the elevation step matches but the shadow geometry differs"},"--sl-shadow-x-small":{target:"--lr-shadow-xs",note:"the elevation step matches but the shadow geometry differs"},"--sl-transition-fast":{target:"--lr-duration-fast",note:"the duration role matches, but 150ms becomes the shorter Lyra fast duration"},"--sl-transition-medium":{target:"--lr-duration-base",note:"the duration role matches, but 250ms becomes the shorter Lyra base duration"},"--sl-z-index-toast":{target:"--lr-layer-toast",note:"the toast role matches but the Lyra layer sits higher than 950"},"--sl-z-index-tooltip":{target:"--lr-layer-popover",note:"the same stacking value under the Lyra popover role"},"--wa-border-radius-m":{target:"--lr-radius",note:"the radius scales are not value-aligned"},"--wa-border-radius-s":{target:"--lr-radius-xs",note:"the radius scales are not value-aligned"},"--wa-focus-ring":{target:"--lr-focus-ring",note:"the shorthand role matches but its width or style may differ"},"--wa-focus-ring-offset":{target:"--lr-focus-ring-offset",note:"the role matches but the offset may differ"},"--wa-focus-ring-width":{target:"--lr-focus-ring-width",note:"the role matches but the width may differ"},"--wa-font-size-2xl":{target:"--lr-font-size-2xl",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-2xs":{target:"--lr-font-size-2xs",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-3xl":{target:"--lr-font-size-3xl",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-3xs":{target:"--lr-font-size-3xs",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-4xl":{target:"--lr-font-size-4xl",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-5xl":{target:"--lr-font-size-5xl",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-l":{target:"--lr-font-size-lg",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-s":{target:"--lr-font-size-sm",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-xl":{target:"--lr-font-size-xl",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-size-xs":{target:"--lr-font-size-xs",note:"the type scales are not value-aligned, so check the rendered size"},"--wa-font-weight-bold":{target:"--lr-font-weight-bold",note:"the named weight is the same role, but the numeric weight may differ by one step"},"--wa-font-weight-semibold":{target:"--lr-font-weight-semibold",note:"the named weight is the same role, but the numeric weight may differ by one step"},"--wa-line-height-condensed":{target:"--lr-line-height-compact",note:"the line-height roles match but the ratios are not value-aligned"},"--wa-line-height-expanded":{target:"--lr-line-height-loose",note:"the line-height roles match but the ratios are not value-aligned"},"--wa-line-height-normal":{target:"--lr-line-height-normal",note:"the line-height roles match but the ratios are not value-aligned"},"--wa-shadow-l":{target:"--lr-shadow-l",note:"the elevation step matches but the shadow geometry differs"},"--wa-shadow-m":{target:"--lr-shadow-m",note:"the elevation step matches but the shadow geometry differs"},"--wa-shadow-s":{target:"--lr-shadow-s",note:"the elevation step matches but the shadow geometry differs"},"--wa-transition-easing":{target:"--lr-easing-standard",note:"the easing role matches but the timing function may differ"},"--wa-transition-fast":{target:"--lr-duration-fast",note:"the duration role matches but the length differs"},"--wa-transition-normal":{target:"--lr-duration-base",note:"the duration role matches but the length differs"}},review:{"--sl-border-radius-circle":"Lyra has no circle radius token; use 50%","--sl-border-radius-small":"0.1875rem has no Lyra radius step; the neighbours are a literal 0 and --lr-radius-xs (0.25rem)","--sl-border-radius-x-large":"1rem has no Lyra radius step; --lr-radius (0.5rem) is the default","--sl-focus-ring-offset":"the Lyra focus ring offset defaults to 0px rather than 1px; use --lr-focus-ring-offset and check the gap","--sl-focus-ring-style":"the Lyra focus ring is always solid; use --lr-focus-ring","--sl-font-serif":"Lyra has no serif family token; declare the family yourself","--sl-font-size-2x-large":"2.25rem has no Lyra type step; the neighbours are --lr-font-size-3xl (2rem) and --lr-font-size-4xl (2.5rem)","--sl-font-size-4x-large":"4.5rem has no Lyra type step; Lyra type stops at --lr-font-size-5xl (3rem)","--sl-font-size-medium":"Lyra has no 1rem type step; the neighbours are --lr-font-size-m (0.875rem) and --lr-font-size-lg (1.125rem)","--sl-font-size-x-large":"1.5rem has no Lyra type step; the neighbours are --lr-font-size-xl (1.25rem) and --lr-font-size-2xl (1.75rem)","--sl-font-weight-light":"Lyra has no light weight token; --lr-font-weight-normal is the lightest","--sl-line-height-loose":"2.2 has no Lyra line-height step; --lr-line-height-loose (1.6) is the tallest","--sl-line-height-looser":"2.6 has no Lyra line-height step; --lr-line-height-loose (1.6) is the tallest","--sl-line-height-normal":"1.8 has no Lyra line-height step; --lr-line-height-loose (1.6) is the tallest","--sl-spacing-2x-large":"2.25rem has no Lyra spacing step; the neighbours are --lr-space-2xl (2rem) and --lr-space-3xl (3rem)","--sl-spacing-4x-large":"4.5rem has no Lyra spacing step; Lyra spacing stops at --lr-space-4xl (4rem)","--sl-spacing-large":"1.25rem has no Lyra spacing step; the neighbours are --lr-space-l (1rem) and --lr-space-xl (1.5rem)","--sl-spacing-x-large":"1.75rem has no Lyra spacing step; the neighbours are --lr-space-xl (1.5rem) and --lr-space-2xl (2rem)","--sl-transition-slow":"Lyra has no 500ms interaction duration; --lr-duration-ambient (1.8s) is for ambient motion only","--sl-transition-x-fast":"Lyra has no 50ms duration; --lr-duration-fast (120ms) is the shortest","--sl-transition-x-slow":"Lyra has no 1000ms interaction duration; --lr-duration-ambient (1.8s) is for ambient motion only","--sl-z-index-dialog":"Lyra stacks dialogs on --lr-layer-modal (1000), above its dropdown layer; check the relative order","--sl-z-index-drawer":"Lyra stacks drawers on --lr-layer-modal (1000), above its dropdown layer; check the relative order","--wa-border-radius-circle":"Lyra has no circle radius token; use 50%","--wa-border-radius-l":"Lyra has no large radius step; use --lr-radius-container or a literal","--wa-border-radius-square":"Lyra has no square radius token; use 0","--wa-border-style":"Lyra has no border-style token; use solid","--wa-color-overlay-inline":"Lyra has one overlay scrim, --lr-color-overlay","--wa-color-overlay-media":"Lyra has --lr-color-overlay and --lr-color-overlay-strong; choose by contrast","--wa-color-surface-lowered":"Lyra has no lowered surface; the surface-container steps (--lr-color-surface-container-low and siblings) are the nearest roles","--wa-color-text-link":"Lyra has no link colour token; --lr-color-brand-fill-loud is the usual choice","--wa-focus-ring-style":"the Lyra focus ring is always solid; use --lr-focus-ring","--wa-font-family-longform":"Lyra has no long-form family token; use --lr-font or --lr-font-heading","--wa-font-size-m":"Lyra has no 1rem type step; the neighbours are --lr-font-size-m (0.875rem) and --lr-font-size-lg (1.125rem)","--wa-font-size-scale":"Lyra has no type-scale multiplier; retheme the individual --lr-theme-font-size-* inputs","--wa-font-weight-light":"Lyra has no light weight token; --lr-font-weight-normal is the lightest","--wa-space-2xl":"2.5rem has no Lyra spacing step; the neighbours are --lr-space-2xl (2rem) and --lr-space-3xl (3rem)","--wa-space-5xl":"Lyra spacing stops at --lr-space-4xl (4rem)","--wa-space-scale":"Lyra has no spacing multiplier; retheme the individual --lr-theme-space-* inputs","--wa-transition-slow":"Lyra has no slow interaction duration; --lr-duration-ambient (1.8s) is for ambient motion only"},reviewPatterns:[{pattern:"^--sl-color-(?:primary|success|warning|danger|neutral)-\\d+$",note:"Lyra has no numbered palette custom properties; use the semantic --lr-color-<role>-{fill,border,on}-{quiet,normal,loud} grid"},{pattern:"^--sl-color-[a-z]+-\\d+$",note:"Lyra has no hue palette custom properties; use a semantic --lr-color-* role or a literal colour"},{pattern:"^--wa-color-(?:brand|neutral|success|warning|danger)-\\d+$",note:"Lyra has no numbered palette custom properties; use the semantic --lr-color-<role>-{fill,border,on}-{quiet,normal,loud} grid"},{pattern:"^--wa-color-[a-z]+-\\d+$",note:"Lyra has no hue palette custom properties; use a semantic --lr-color-* role or a literal colour"}]};var yd=new Map(Object.entries(Gn.exact)),bd=new Map(Object.entries(Gn.approximate)),wd=new Map(Object.entries(Gn.review)),$d=Gn.reviewPatterns.map(({pattern:e,note:t})=>({pattern:new RegExp(e),note:t})),vd=/(?<![\w-])--(?<ecosystem>wa|sl)-[a-z0-9-]+(?![\w-])/g;function ao(e){let t=yd.get(e);if(t)return{kind:"exact",target:t,note:null};let n=bd.get(e);if(n)return{kind:"approximate",target:n.target,note:n.note};let r=wd.get(e)??$d.find(({pattern:s})=>s.test(e))?.note;return r?{kind:"review",target:null,note:r}:null}c(ao,"lookupUpstreamToken");function Ed(e){return new Set([...e.matchAll(/(--(?:wa|sl)-[a-z0-9-]+)\s*:/g)].map(t=>t[1]))}c(Ed,"declaredUpstreamTokens");function Wi(e,t=()=>!1){let n=Ed(e),r=[];for(let s of e.matchAll(vd)){let o=s[0];if(n.has(o)||t(s.index))continue;let i=ao(o);!i||i.kind==="review"||r.push({start:s.index,end:s.index+o.length,token:o,origin:s.groups.ecosystem==="sl"?"shoelace":"webawesome",kind:i.kind,target:i.target,note:i.note})}return r}c(Wi,"scanUpstreamTokenRoutes");var Dr="@aceshooting/lyra-translations";function xd(e,t){let n=[];for(let r of e.matchAll(/\bcss\s*`/g)){if(ae(r.index,t))continue;let s=r.index+r[0].length-1,o=Te(e,s);!o||o[0]!==s||n.push([s+1,o[1]-1])}return n}c(xd,"cssTemplateRanges");function Sd(e,t){let n=[];for(let[r,s]of t){let o=e.slice(r,s);for(let i of o.matchAll(/\/\*[\s\S]*?(?:\*\/|$)/g))n.push([r+i.index,r+i.index+i[0].length])}return n}c(Sd,"templateCssCommentRanges");var Gi=/(?<![\w\-.#:=["'\\])(?<tag>(?:wa|sl)-[a-z][a-z0-9-]*)(?![\w-])/g,kd=/(?:\?\.|\.)\s*(?:querySelector|querySelectorAll|closest|matches)\s*(?:<[^>\n]+>)?\(\s*(?<quote>['"`])(?<selector>[^'"`$\\\n]*)\k<quote>/g,Td=/(?<![\w$.])(?:(?:window|globalThis)\s*\.\s*)?document\s*[?!]?\s*$/;function Rd(e,t,n){let r=[],s=0;for(let o=t;o<n;o+=1){let i=e[o];if(i==="(")s+=1;else if(i===")"){if(s===0)break;s-=1}else{if(s===0&&(/[\s,>+~{]/.test(i)||e.startsWith("::",o)))break;if(i==="["){let a=e.indexOf("]",o);if(a===-1||a>=n)break;let l=/^\[\s*(?<attribute>data-[a-z-]+)\s*\]$/.exec(e.slice(o,a+1));l&&Object.hasOwn(An,l.groups.attribute)&&r.push({start:o,end:a+1,attribute:l.groups.attribute}),o=a}}}return r}c(Rd,"compoundValidationAttributes");function Ad(e){return new Set((e.target?.surface?.cssStates??[]).map(t=>t.name))}c(Ad,"documentedStates");function io(e){return!e.subpath||xs(e.subpath)?.kind==="registry"}c(io,"isRegistrationRoot");var Ki=new Set(["wa-animation","sl-animation","wa-animated-image","sl-animated-image"]),Ui=new Set(["wa-icon","sl-icon","sl-icon-button"]);function Hi(e){return`${e} does not freeze or snap its animation under prefers-reduced-motion: reduce. The migrated Lyra target respects prefers-reduced-motion by default and does exactly that automatically. Review whether the migrated element should keep animating for users who asked for less motion, or set ignore-reduced-motion to preserve upstream playback under that preference.`}c(Hi,"reducedMotionReviewMessage");function Od(e){return e.startsWith("sl-")?{vocabulary:"Bootstrap Icons",call:"registerBootstrapIconLibrary({ name: 'default' })",module:"@aceshooting/lyra-ui/components/utility/icon/icon-library-bootstrap.js",extra:" (pass basePath to self-host)"}:{vocabulary:"Font Awesome",call:"registerFontAwesomeIconLibrary({ name: 'default' })",module:"@aceshooting/lyra-ui/components/utility/icon/icon-library-font-awesome.js",extra:" (add kitCode for Pro families)"}}c(Od,"iconVocabularyPreset");function Ji(e){let t=Od(e);return`${e}'s icon-name vocabulary is not bundled with Lyra. The default library includes only add, check, close, search, menu, chevron-left, chevron-right, chevron-down, calendar, command, and trash; any other migrated name renders no glyph. To keep the upstream ${t.vocabulary} names, call ${t.call} from ${t.module} once at startup${t.extra}; otherwise register the required vocabulary with registerIconLibrary('default', { resolver }) or replace each name explicitly.`}c(Ji,"iconVocabularyReviewMessage");function Yn(e){return e?e.classification==="warning-required"?"WARNING_REQUIRED":e.classification==="conceptual-only"?"CONCEPTUAL_MAPPING":"UNSUPPORTED_MAPPING":"UNKNOWN_UPSTREAM_TAG"}c(Yn,"warningCode");function Nd(e,t,n){let r=new Map,s=c((o,i,a,l,u,m,h)=>{let y=r.get(o.upstreamTag)??{mapping:o,aliases:[],uses:[]};r.has(o.upstreamTag)||r.set(o.upstreamTag,y),y.aliases.some(E=>E.tagStart===i)||y.aliases.push({tagStart:i,alias:a});let w=`${l}:${u}:${m}`;y.uses.some(E=>E.key===w)||y.uses.push({key:w,offset:l,alias:a,upstreamMember:u,target:m,message:h})},"addUse");for(let o of t.mappings.values()){if(!Xe.has(o.classification))continue;let i=o.upstreamTag.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b(?:const|let|var)\\s+(?<alias>[$A-Z_a-z][$\\w]*)\\s*=\\s*(?:document\\.)?querySelector(?:<[^>\\n]+>)?\\(\\s*(['"])${i}\\2\\s*\\)`,"g");for(let l of e.matchAll(a)){if(ae(l.index,n))continue;let u=l.groups.alias,m=l.index+l[0].lastIndexOf(o.upstreamTag),h=l.index+l[0].length,w=`(?<![$\\w])${u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*`;for(let[E,x]of[["methods","(?=\\s*\\()"],["properties","(?=\\s*(?:=|\\.|\\?|;|$))"]])for(let f of o.rewrites[E]){let S=f.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p=new RegExp(`${w}(?<member>${S})${x}`,"g");p.lastIndex=h;for(let N=p.exec(e);N;N=p.exec(e)){let T=N.index+N[0].lastIndexOf(N.groups.member);ae(T,n)||s(o,m,u,T,f.from,f.to,`Aliased ${E} member ${u}.${f.from} must be migrated with its selector.`)}}for(let E of o.rewrites.events){let x=E.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f=new RegExp(`${w}(?:add|remove)EventListener\\(\\s*(['"])(?<member>${x})\\1`,"g");f.lastIndex=h;for(let S=f.exec(e);S;S=f.exec(e)){let p=S.index+S[0].lastIndexOf(S.groups.member);ae(p,n)||s(o,m,u,p,E.from,E.to,`Aliased event ${u}.${E.from} must be migrated with its selector.`)}}for(let E of o.rewrites.attributes){let x=E.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f=new RegExp(`${w}(?:get|set|has|toggle|remove)Attribute\\(\\s*(['"])(?<member>${x})\\1`,"g");f.lastIndex=h;for(let S=f.exec(e);S;S=f.exec(e)){let p=S.index+S[0].lastIndexOf(S.groups.member);ae(p,n)||s(o,m,u,p,E.from,E.to,`Aliased attribute ${u}.${E.from} must be migrated with its selector.`)}}}}return r}c(Nd,"scanAliasedRewriteReviews");function _d(e,t,n){let r=new Map;for(let s of t){if(s.closing)continue;let o=n.mappings.get(s.tag);if(!Xe.has(o?.classification))continue;let i=Qe(e,s);for(let a of o.rewrites.defaults){if(a.action!=="replace-value")continue;let l=new Set([a.member,Ue(a.member),He(a.member)]),u=i.find(h=>l.has(h.rawName.replace(/^[.?:]/,"")));if(!u||u.valueKind==="boolean"||!Kn(u))continue;let m=r.get(o.upstreamTag)??{mapping:o,uses:[]};r.has(o.upstreamTag)||r.set(o.upstreamTag,m),m.uses.push({offset:u.valueStart,upstreamMember:a.member,target:String(a.to),message:`The ${a.member} value is dynamic; migrate ${String(a.from)} to ${String(a.to)} at its source before changing this component mapping.`})}}return r}c(_d,"scanDynamicDefaultReviews");var Id=Object.freeze({"host-layout":"Web Awesome uses display: contents while Lyra uses a block host with a shadow base; review inline placement and host-authored layout CSS.","multi-item-layout":"Lyra owns the simultaneous-item flex/wrap/gap context inside its shadow base instead of leaving it on the host.","unique-retry-bound":"Web Awesome promises non-repeating unique selection while Lyra uses a bounded retry and can eventually repeat.","forwarded-slot-candidates":"Lyra flattens a direct forwarding slot into projected candidates while Web Awesome treats only its direct element child as the candidate.","autoplay-semantics":"Lyra stops autoplay for reduced motion, keeps timer ticks silent, does not pause on hover, and exposes a localized paused control/state/event absent upstream."});function Cd(e,t,n,r){let s=new Map,o=Ti(t);for(let i of t){if(i.closing||i.tag!=="wa-random-content")continue;let a=r.mappings.get(i.tag);if(!Xe.has(a?.classification)||!a.parity.behaviorReviewFlags.length)continue;let l=Qe(e,i),u=c(I=>l.find(W=>Ai(W)===I),"attribute"),m=o.get(i.start),h=m?Ri(e,i.end+1,m.start,n):{directTags:[],dynamicDirectContent:!i.selfClosing},y=[];(h.directTags.length>0||h.dynamicDirectContent)&&y.push("host-layout");let E=u("items"),x=E?Kn(E):!1,f=!E||E.value===null?1:Number(E.value);(x||Number.isFinite(f)&&f>1)&&y.push("multi-item-layout");let S=u("mode"),p=S?Kn(S):!1,N=Number.isFinite(f)?Math.max(1,Math.trunc(f)):1;(!S||p||S.value==="unique")&&(p||h.dynamicDirectContent||h.directTags.length>N)&&y.push("unique-retry-bound"),(h.directTags.includes("slot")||h.dynamicDirectContent)&&y.push("forwarded-slot-candidates"),u("autoplay")&&y.push("autoplay-semantics");let C=y.filter((I,W)=>a.parity.behaviorReviewFlags.includes(I)&&y.indexOf(I)===W);C.length&&s.set(i.start,{flags:C,message:`Review ${a.upstreamTag} before relying on the migrated behavior: `+C.map(I=>`${I}: ${Id[I]}`).join(" ")})}return s}c(Cd,"scanConditionalBehaviorReviews");function co(e){return`rewrite-${{attributes:"attribute",properties:"property",events:"event",slots:"slot",parts:"part",cssProperties:"css-property",methods:"method"}[e]}`}c(co,"memberAction");function uo(e){return typeof e.registrationRoute=="string"?`@aceshooting/lyra-ui/${e.registrationRoute.slice(2)}`:`@aceshooting/lyra-ui/${e.registrationModule.replace(/^src\//,"").replace(/\.ts$/,".js")}`}c(uo,"targetImport");function Md(e,t){let n=new Map;for(let o of t??[]){let i=e.mappings.get(o);!i||!Xe.has(i.classification)||!i.target||n.set(i.targetTag,i.target)}let r=[...n.values()].some(o=>o.rootIncluded!==!1),s=[...n.values()].filter(o=>o.rootIncluded===!1).map(uo).sort();return[...r?["@aceshooting/lyra-ui/all.js"]:[],...s]}c(Md,"registrationClosure");function lo(e,t){let n=e.match(/\/components\/([a-z0-9-]+)\/(?:\1(?:\.component)?|index)\.(?:js|mjs)$/);return n?`${t==="webawesome"?"wa":"sl"}-${n[1]}`:null}c(lo,"deepImportTag");function jd(e,t){return!!(t&&(!t.source?.tier||e.tiers.has(t.source.tier)))}c(jd,"packageProvidesMapping");function Zn(e){return e?e.rationale||`The ${e.classification} mapping requires manual review.`:"No pinned inventory mapping exists for this upstream tag."}c(Zn,"mappingMessage");function zd(e){return e.replace(/^(?:v-bind:|bind:|[.?:])/,"").toLowerCase()}c(zd,"localAttributeName");function Pd(e,t,n){let r=n.file??"<memory>",s=n.origin,o=t.localMigrations.get(s);U(o,`unknown local migration origin ${String(s)}`);let i=Bn(e),a=Kt(e),l=Vn(e,a).filter(x=>o.has(x.tag)),u=jr(e,o,a,l),m=new Set([...n.blockedLocalMigrations??[],...u.blocked]),h=[],y=[],w=[],E=c((x,f,S,p,N,T=null,C=null)=>yt({textStarts:i,file:r,offset:x,origin:s,upstreamTag:f,upstreamMember:C,action:S,target:p,warningCode:T,message:N}),"entry");for(let x of u.uses)w.push(E(x.offset,x.tag,"manual-review",x.tag,x.message,x.warningCode));for(let x of l){let f=o.get(x.tag),S=ln(s,x.tag);if(m.has(S)){w.push(E(x.nameStart,x.tag,"manual-review",x.tag,`${x.tag} remains unchanged because the scanned target set contains an aliased or dynamic value requiring review.`,"MAPPING_REVIEW_BLOCKED"));continue}let p=Qe(e,x),N=new Set(p.map(C=>zd(C.rawName))),T=[];for(let C of f.defaults)N.has(C.member.toLowerCase())||(T.push(Mr(C)),y.push(E(x.end,x.tag,"insert-default",`${C.member}=${String(C.value)}`,`Insert ${C.member} to preserve the Lyra ${Ks(s)} default.`,null,C.member)));if(T.length>0){let C=e[x.end-1]==="/"?x.end-1:x.end;h.push({start:C,end:C,replacement:` ${T.join(" ")}`})}}return y.sort((x,f)=>x.line-f.line||x.column-f.column||x.action.localeCompare(f.action)),w.sort((x,f)=>x.line-f.line||x.column-f.column||x.warningCode.localeCompare(f.warningCode)),{content:Un(e,h),changes:y,warnings:w,usage:{webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}},blockedMappings:new Set,blockedEcosystems:new Set,bareImportEcosystems:new Set,blockedLocalMigrations:m}}c(Pd,"migrateLocalText");function Yi(e){let t=[],n=new Set,r=c((a,l,u,m,h,y)=>{let w=`${a}:${m}`;n.has(w)||(n.add(w),t.push({offset:a,upstreamTag:l,member:u,code:m,target:h,message:y}))},"push"),s=Gi;for(let a of e.matchAll(/\bcss`/g)){let l=a.index+a[0].length,u=e.indexOf("`",l);if(u===-1)continue;let m=e.slice(l,u).replace(/\/\*[\s\S]*?(?:\*\/|$)/g,h=>" ".repeat(h.length));for(let h of m.matchAll(s)){let y=h.groups.tag;r(l+h.index,y,"css-template","CSS_IN_JS_SELECTOR_REVIEW",y,`\`${y}\` appears in a css\`\` template and was NOT rewritten. A rule keyed on a tag that no longer exists matches nothing, silently. Rename the selector by hand.`)}}for(let a of e.matchAll(/::slotted\(\s*([^)]*)\)/g))for(let l of a[1].matchAll(s)){let u=l.groups.tag;r(a.index+a[0].indexOf(l.groups.tag),u,"::slotted","SLOTTED_SELECTOR_REVIEW",u,`\`::slotted(${u})\` was NOT rewritten and will match nothing after the migration. Rename it by hand.`)}let o=/\bthis(?:\s*\??\.\s*(?:shadowRoot|renderRoot))?\s*\??\.\s*(?:querySelector|querySelectorAll|closest|matches)\s*(?:<[^>\n]+>)?\(\s*(['"`])(?<selector>[^'"`]*)\1/g;for(let a of e.matchAll(o)){let l=a.index+a[0].lastIndexOf(a.groups.selector);for(let u of a.groups.selector.matchAll(s)){let m=u.groups.tag;r(l+u.index,m,"selector-string","SELECTOR_STRING_REVIEW",m,`\`${m}\` appears in a DOM selector string that was NOT rewritten. The query will return null after the migration rather than throwing. Rename it by hand.`)}}let i=new Set([...e.matchAll(/(--(?:wa|sl)-[a-z0-9-]+)\s*:/g)].map(a=>a[1]));for(let a of e.matchAll(/--(?<ecosystem>wa|sl)-[a-z0-9-]+/g)){let l=a[0];if(i.has(l))continue;let u=ao(l)?.note;r(a.index,`${a.groups.ecosystem}-tokens`,"custom-property","UPSTREAM_TOKEN_REVIEW",l,`\`${l}\` is an upstream design token with no exact Lyra equivalent, and was left as-is${u?`: ${u}`:""}. A var() naming a token that no longer exists falls back to its second argument, or to nothing -- silently. Map it by hand against llms/tokens.md; note the spacing scales are offset by one step, so renaming by name alone tightens every gap.`)}return t}c(Yi,"scanUnrewrittenUpstreamReferences");function pn(e,t,n={}){if(n.origin&&t.renameProfiles?.has(n.origin))return qi(e,t,n);if(n.origin)return Pd(e,t,n);let r=n.file??"<memory>",s=n.rewriteBarePackages??new Set,o=n.rootRegistrationMappings??new Map,i=Bn(e),a=Kt(e),l=bi(e),u=xd(e,a),m=Sd(e,u),h=wi(e,a),y=Vn(e,a),w=xi(e,a,n.domFactoryBindings),E=Nd(e,t,a),x=_d(e,h,t),f=Cd(e,h,a,t),S=[...Oi(e,a,t),...Aa(e,t,v=>ae(v,a))].sort((v,P)=>v.start-P.start),p=new Set(S.filter(v=>v.sideEffect&&io(v)).map(v=>v.packageName)),N=new Set([...n.blockedMappings??[],...E.keys(),...x.keys()]),T=w.flatMap(v=>{if(v.kind!=="construction")return[];let P=t.mappings.get(v.tag),g=P?.rewrites.defaults.filter(A=>A.action==="insert-if-absent")??[];if(!P||!Xe.has(P.classification)||g.length===0)return[];let b=Si(e,v,g);return b.safe?[]:(N.add(P.upstreamTag),[{reference:v,mapping:P,defaults:g,missing:b.missing}])}),C=new Set(n.registrationBlockedMappings??[]),I=new Set(n.blockedEcosystems??[]);for(let v of S){if(v.sideEffect)continue;let P=v.subpath?lo(v.specifier,v.ecosystem):null,g=P?t.mappings.get(P):null;g&&Xe.has(g.classification)?N.add(g.upstreamTag):io(v)&&I.add(v.ecosystem)}let W=[],$=[],L=[],d={webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}},k=new Set,j=new Set,M=new Set,F=new Set,D=c((v,P)=>P??(v?.startsWith("wa-")?"webawesome":v?.startsWith("sl-")?"shoelace":null),"reportOrigin"),O=c((v,P,g,b,A,R,z=null)=>{$.push(yt({textStarts:i,file:r,offset:v,origin:D(P,z),upstreamTag:P,upstreamMember:g,action:b,target:A,message:R}))},"change"),_=c((v,P,g,b,A,R,z=null,V=null)=>{L.push(yt({textStarts:i,file:r,offset:v,origin:D(P,z),upstreamTag:P,upstreamMember:g,action:"manual-review",target:A,warningCode:b,behaviorReviewFlags:V,message:R}))},"warn"),K=c((v,P)=>{for(let g of v.target?.optionalPeers??[]){let b=`${v.targetTag}:${g}`;M.has(b)||(M.add(b),_(P,v.upstreamTag,"runtime","OPTIONAL_PEER_REQUIRED",g,`${v.targetTag} requires the optional peer package ${g}; install a compatible version before relying on the migrated component.`))}},"noteRuntimeRequirements"),Z=c((v,P)=>{k.add(v.upstreamTag),K(v,P)},"noteAutomatic"),te=c((v,P,g,b)=>{W.push({start:v,end:P,replacement:g}),O(v,b.upstreamTag,b.upstreamMember,b.action,b.target,b.message,b.origin)},"addEdit"),ce=c(v=>!!v&&(N.has(v.upstreamTag)||C.has(v.upstreamTag)||I.has(v.upstream)),"isBlocked"),se=c(v=>Xe.has(v?.classification)&&ce(v),"isBlockedAutomatic"),le=c(v=>Xe.has(v?.classification)&&!ce(v),"isAutomatic"),we=c(v=>C.has(v.upstreamTag)?`${v.upstreamTag} remains unchanged because the scanned target set does not prove registration for ${v.targetTag}. Include ${uo(v.target)} in the scan or migrate the file that owns its supported root registration import.`:`${v.upstreamTag} remains unchanged because the scanned target set contains a use that requires manual member, default, or import review.`,"blockedMessage"),ge=c(v=>C.has(v.upstreamTag)?"REGISTRATION_CLOSURE_REQUIRED":"MAPPING_REVIEW_BLOCKED","blockedWarningCode"),be=c((v,P,g)=>{if(v.upstream!=="shoelace")return;let b=Ad(v);for(let A of Rd(e,P,g)){let R=An[A.attribute];b.has(R)?te(A.start,A.end,`:state(${R})`,{upstreamTag:v.upstreamTag,upstreamMember:A.attribute,action:"rewrite-validation-state",target:`:state(${R})`,message:`Rewrite the [${A.attribute}] selector to the ${v.targetTag} :state(${R}) custom state.`}):_(A.start,v.upstreamTag,A.attribute,"VALIDATION_STATE_REVIEW",v.targetTag,`${v.targetTag} documents no :state(${R}) custom state, so the [${A.attribute}] selector was left as-is and will not match after the migration; restyle this validation state by hand.`)}},"migrateValidationAttributes");for(let{mapping:v,uses:P}of E.values())for(let g of P)_(g.offset,v.upstreamTag,g.upstreamMember,"ALIASED_MEMBER_REVIEW",g.target,g.message);for(let{mapping:v,uses:P}of x.values())for(let g of P)_(g.offset,v.upstreamTag,g.upstreamMember,"DYNAMIC_VALUE_REVIEW",g.target,g.message);for(let{reference:v,mapping:P,defaults:g,missing:b}of T)_(v.start,P.upstreamTag,null,"IMPERATIVE_DEFAULT_REVIEW",P.targetTag,`${P.upstreamTag} is constructed imperatively and requires explicit migrated defaults (${g.map(A=>`${A.member}=${String(A.value)}`).join(", ")}); review the created element before renaming this mapping. No unconditional immediate assignment was proven for ${b.map(A=>A.member).join(", ")}.`);let Ge=[],Ie=new Set;for(let v of h){let P=t.mappings.get(v.tag),g=_r(v.tag);if(!le(P)){if(P&&K(P,v.nameStart),v.closing&&Ie.has(v.tag))continue;v.closing||Ie.add(v.tag),d[g].manual+=1,_(v.nameStart,v.tag,null,se(P)?ge(P):Yn(P),P?.targetTag??null,se(P)?we(P):Zn(P),null,P?.parity?.behaviorReviewFlags);continue}d[g].automatic+=1,Z(P,v.nameStart),te(v.nameStart,v.nameEnd,P.targetTag,{upstreamTag:v.tag,upstreamMember:null,action:"rewrite-tag",target:P.targetTag,message:`Rename ${v.tag} to ${P.targetTag}.`});let b=f.get(v.start);b&&_(v.nameStart,P.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",P.targetTag,b.message,null,b.flags),!v.closing&&Ki.has(v.tag)&&_(v.nameStart,P.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",P.targetTag,Hi(P.upstreamTag),null,["reduced-motion-default"]),!v.closing&&Ui.has(v.tag)&&_(v.nameStart,P.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",P.targetTag,Ji(P.upstreamTag),null,["icon-name-vocabulary"]),v.closing||Ge.push({token:v,mapping:P,attributes:Qe(e,v)})}for(let v of w){let P=t.mappings.get(v.tag),g=_r(v.tag);if(!le(P)){P&&K(P,v.start),d[g].manual+=1,_(v.start,v.tag,null,se(P)?ge(P):Yn(P),P?.targetTag??null,se(P)?we(P):Zn(P),null,P?.parity?.behaviorReviewFlags);continue}d[g].automatic+=1,Z(P,v.start),te(v.start,v.end,P.targetTag,{upstreamTag:v.tag,upstreamMember:null,action:"rewrite-tag",target:P.targetTag,message:`Rename ${v.tag} to ${P.targetTag}.`}),Ki.has(v.tag)&&_(v.start,P.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",P.targetTag,Hi(P.upstreamTag),null,["reduced-motion-default"]),Ui.has(v.tag)&&_(v.start,P.upstreamTag,null,"BEHAVIOR_REVIEW_REQUIRED",P.targetTag,Ji(P.upstreamTag),null,["icon-name-vocabulary"])}for(let{token:v,mapping:P,attributes:g}of Ge){for(let A of g){let R=ki(A.rawName,P);if(R){if(R.value!==void 0){R.prefix===""&&A.valueKind==="boolean"&&!g.some(z=>z!==A&&[R.to,`.${R.to}`,`:${R.to}`,`v-bind:${R.to}`].includes(z.rawName))?te(A.nameStart,A.nameEnd,`${R.to}="${R.value}"`,{upstreamTag:P.upstreamTag,upstreamMember:R.from,action:co(R.section),target:`${R.to}="${R.value}"`,message:`Rewrite ${R.section} member ${R.from} to ${R.to}="${R.value}".`}):(d[P.upstream].manual+=1,_(A.nameStart,P.upstreamTag,R.from,"DYNAMIC_VALUE_REVIEW",R.to,`${R.from} is a boolean spelling of ${R.to}="${R.value}"; set ${R.to} to "${R.value}" when it is true and leave it unset otherwise.`));continue}te(A.nameStart,A.nameEnd,R.replacement,{upstreamTag:P.upstreamTag,upstreamMember:R.from,action:co(R.section),target:R.to,message:`Rewrite ${R.section} member ${R.from} to ${R.to}.`})}}let b=[];for(let A of P.rewrites.defaults){let R=new Set([A.member,Ue(A.member),He(A.member)]),z=g.find(V=>R.has(V.rawName.replace(/^[.?:]/,"")));if(A.action==="insert-if-absent"){if(z)continue;b.push(`${Ue(A.member)}="${String(A.value).replaceAll("&","&amp;").replaceAll('"',"&quot;")}"`),O(v.end,P.upstreamTag,A.member,"insert-default",`${A.member}=${String(A.value)}`,`Insert ${A.member} to preserve the upstream default.`);continue}!z||z.valueKind==="boolean"||(Kn(z)?(d[P.upstream].manual+=1,_(z.valueStart,P.upstreamTag,A.member,"DYNAMIC_VALUE_REVIEW",String(A.to),`The ${A.member} value is dynamic; replace ${String(A.from)} with ${String(A.to)} at its source.`)):z.value===String(A.from)&&te(z.valueStart,z.valueEnd,String(A.to),{upstreamTag:P.upstreamTag,upstreamMember:A.member,action:"replace-default",target:String(A.to),message:`Replace ${A.member} value ${String(A.from)} with ${String(A.to)}.`}))}if(b.length){let A=e[v.end-1]==="/"?v.end-1:v.end;W.push({start:A,end:A,replacement:` ${b.join(" ")}`})}}let st=[],ut=[];for(let v of h)if(!v.closing&&!v.selfClosing)st.push(v);else if(v.closing)for(let P=st.length-1;P>=0;P-=1){if(st[P].tag!==v.tag)continue;let[g]=st.splice(P,1);ut.push({opening:g,closing:v});break}for(let{opening:v,closing:P}of ut){let g=t.mappings.get(v.tag);if(!(!le(g)||!g.rewrites.slots.length)){for(let b of y)if(!(b.start<=v.end||b.end>=P.start))for(let A of Qe(e,b))if(A.rawName==="slot"&&A.valueKind==="literal"){let R=g.rewrites.slots.find(z=>z.from===A.value);R&&te(A.valueStart,A.valueEnd,R.to,{upstreamTag:g.upstreamTag,upstreamMember:R.from,action:"rewrite-slot",target:R.to,message:`Rewrite slot ${R.from} to ${R.to}.`})}else{let R=A.rawName.startsWith("v-slot:")?"v-slot:":A.rawName.startsWith("#")?"#":null;if(!R)continue;let z=A.rawName.slice(R.length),V=g.rewrites.slots.find(H=>H.from===z);V&&te(A.nameStart,A.nameEnd,`${R}${V.to}`,{upstreamTag:g.upstreamTag,upstreamMember:V.from,action:"rewrite-slot",target:V.to,message:`Rewrite slot ${V.from} to ${V.to}.`})}}}let ze=/(?<selector>[^{}]+)\{(?<body>[^{}]*)\}/g;for(let v of e.matchAll(ze)){if(ae(v.index,a))continue;let P=v.index,g=v.index+v[0].indexOf(v.groups.body);for(let b of t.mappings.values()){let A=new RegExp(`(?<![\\w.#=\\["'\\\\-])${b.upstreamTag}(?![a-z0-9-])`,"g"),R=[...v.groups.selector.matchAll(A)].filter(z=>{let V=P+z.index;if(ae(V,a)||ae(V,m))return!1;let H=Te(e,V);return H?(ae(V,l)||ae(V,u))&&!Ir(e,H[0],V):!0});if(R.length){if(!le(b)){d[b.upstream].manual+=R.length;for(let z of R){let V=P+z.index;F.add(V),K(b,V),_(V,b.upstreamTag,null,se(b)?ge(b):Yn(b),b.targetTag,se(b)?we(b):Zn(b),null,b?.parity?.behaviorReviewFlags)}continue}for(let z of R){let V=P+z.index;if(Z(b,V),b.upstreamTag==="wa-random-content"){let H=["host-layout","multi-item-layout"];_(V,b.upstreamTag,"selector","BEHAVIOR_REVIEW_REQUIRED",b.targetTag,"Review this selector after migration: Web Awesome lays candidates out through the host, while Lyra uses a block host and owns simultaneous-item flex layout inside its shadow base.",null,H)}te(V,V+b.upstreamTag.length,b.targetTag,{upstreamTag:b.upstreamTag,upstreamMember:null,action:"rewrite-tag",target:b.targetTag,message:`Rename ${b.upstreamTag} selector to ${b.targetTag}.`}),be(b,V+b.upstreamTag.length,P+v.groups.selector.length)}for(let z of b.rewrites.parts){let V=new RegExp(`(?<=::part\\()${z.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=\\))`,"g");for(let H of v.groups.selector.matchAll(V)){let q=P+H.index;ae(q,a)||te(q,q+z.from.length,z.to,{upstreamTag:b.upstreamTag,upstreamMember:z.from,action:"rewrite-part",target:z.to,message:`Rewrite CSS part ${z.from} to ${z.to}.`})}}for(let z of b.rewrites.cssProperties){let V=new RegExp(`${z.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![a-z0-9-])`,"g");for(let H of v.groups.body.matchAll(V)){let q=g+H.index;ae(q,a)||te(q,q+z.from.length,z.to,{upstreamTag:b.upstreamTag,upstreamMember:z.from,action:"rewrite-css-property",target:z.to,message:`Rewrite CSS custom property ${z.from} to ${z.to}.`})}}}}}let xt=new Set(w.map(v=>v.start));for(let v of e.matchAll(kd)){if(ae(v.index,a)||Td.test(e.slice(Math.max(0,v.index-64),v.index)))continue;let P=v.index+v[0].length-1-v.groups.selector.length,g=P+v.groups.selector.length;for(let b of v.groups.selector.matchAll(Gi)){let A=b.groups.tag,R=P+b.index,z=t.mappings.get(A);if(!z||xt.has(R))continue;F.add(R);let V=_r(A);if(!le(z)){K(z,R),d[V].manual+=1,_(R,A,"selector-string",se(z)?ge(z):Yn(z),z.targetTag,se(z)?we(z):Zn(z),null,z.parity?.behaviorReviewFlags);continue}d[V].automatic+=1,Z(z,R),te(R,R+A.length,z.targetTag,{upstreamTag:A,upstreamMember:"selector-string",action:"rewrite-tag",target:z.targetTag,message:`Rename ${A} to ${z.targetTag} in a DOM selector string.`}),be(z,R+A.length,g)}}for(let v of t.mappings.values()){if(!le(v))continue;let g=`(?:document\\.)?querySelector(?:<[^>\\n]+>)?\\(\\s*(['"])${v.upstreamTag.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\1\\s*\\)`;for(let[b,A]of[["methods","(?=\\s*\\()"],["properties","(?=\\s*(?:=|\\.|\\?|;|$))"]])for(let R of v.rewrites[b]){let z=R.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),V=new RegExp(`${g}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*(?<member>${z})${A}`,"g");for(let H of e.matchAll(V)){if(ae(H.index,a))continue;let q=H[0].lastIndexOf(H.groups.member),B=H.index+q;if(R.value!==void 0){d[v.upstream].manual+=1,_(B,v.upstreamTag,R.from,"DYNAMIC_VALUE_REVIEW",R.to,`${R.from} is a boolean spelling of ${R.to}="${R.value}"; preserve explicit ${R.to} values and review the boolean expression.`);continue}te(B,B+R.from.length,R.to,{upstreamTag:v.upstreamTag,upstreamMember:R.from,action:co(b),target:R.to,message:`Rewrite ${b} member ${R.from} to ${R.to}.`})}}for(let b of v.rewrites.attributes.filter(A=>A.value!==void 0)){let A=b.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(`${g}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*(?:get|set|has|toggle|remove)Attribute\\(\\s*(['"])(?<member>${A})\\2`,"g");for(let z of e.matchAll(R)){if(ae(z.index,a))continue;let V=z.index+z[0].lastIndexOf(z.groups.member);d[v.upstream].manual+=1,_(V,v.upstreamTag,b.from,"DYNAMIC_VALUE_REVIEW",b.to,`${b.from} is a boolean spelling of ${b.to}="${b.value}"; review this attribute operation before migrating it.`)}}for(let b of v.rewrites.events){let A=b.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(`${g}\\s*(?:\\?\\.|!\\s*\\.|\\.)\\s*(?:add|remove)EventListener\\(\\s*(['"])(?<member>${A})\\2`,"g");for(let z of e.matchAll(R)){if(ae(z.index,a))continue;let V=z[0].lastIndexOf(z.groups.member),H=z.index+V;te(H,H+b.from.length,b.to,{upstreamTag:v.upstreamTag,upstreamMember:b.from,action:"rewrite-event",target:b.to,message:`Rewrite event ${b.from} to ${b.to}.`})}}}let Pt=c((v,P,g)=>_(v.start,null,"module",g,null,P.note,v.ecosystem),"reportAsset"),Lt=e.includes(`\r
36
36
  `)?`\r
37
37
  `:`
38
- `;for(let ye of Y.targets.slice(1).reverse()){let Ie=`${T.quote}${ye}${T.quote}`;N.push({start:T.statementEnd,end:T.statementEnd,replacement:T.kind==="css-import"?`${ie}@import url(${Ie});`:`${ie}import ${Ie};`}),C(T.start,null,"module","insert-registration",ye,"Insert the Lyra stylesheet that replaces the rest of the upstream bundle.",z)}Y.note&&ze(T,Y,"UPSTREAM_ASSET_REVIEW")}continue}if(Xr(T)){let re=r.has(z)||r.has(T.packageName),ie=o.get(T.packageName)??o.get(z)??new Set,ye=rm(t,ie);if(re&&ye.length>0){_(T.start,T.end,ye[0],{upstreamTag:null,origin:z,upstreamMember:"module",action:"rewrite-import",target:ye[0],message:`Rewrite ${T.packageName} root registration import to its proven Lyra registration closure.`});let Ie=e.includes(`\r
39
- `)?`\r
40
- `:`
41
- `;for(let v of ye.slice(1))N.push({start:T.statementEnd,end:T.statementEnd,replacement:`${Ie}import ${T.quote}${v}${T.quote};`}),C(T.start,null,"module","insert-registration",v,"Insert granular registration for a root-excluded Lyra target.",z)}else P(T.start,null,"module","PACKAGE_IMPORT_BLOCKED","@aceshooting/lyra-ui/all.js",`The ${z} package import remains because this scan contains manual uses or no proven registration closure.`,z);continue}let F=eo(T.specifier,z),H=F?t.mappings.get(F):null;if(H&&!om(T,H)){b[z].manual+=1,M(H,T.start),P(T.start,F,"module","PACKAGE_TIER_MISMATCH",H.targetTag,`${T.packageName} does not provide the ${H.source.tier} ${F} registration entry; use a package identity that provides that tier before migrating it.`,z);continue}if(!F||!ae(H)){b[z].manual+=1,H&&M(H,T.start),P(T.start,F,"module",ee(H)?de(H):H?js(H):"UNRESOLVED_DEEP_IMPORT",H?.targetTag??null,ee(H)?pe(H):F?Ps(H):`No component registration entry can be derived from ${T.specifier}.`,z,H?.parity?.behaviorReviewFlags);continue}b[z].automatic+=1,R(H,T.start),d.add(H.upstreamTag);let X=to(H.target);_(T.start,T.end,X,{upstreamTag:F,upstreamMember:"module",action:"rewrite-import",target:X,message:`Rewrite the ${F} registration entry to its checked Lyra package route.`})}for(let{token:T,start:z,end:Y}of Ci(e,F=>fe(F,a))){let F=Ni(T);if(!F)continue;let H=T.startsWith("sl-")?"shoelace":"webawesome";if(F.kind==="review"){P(z,null,T,"UPSTREAM_CLASS_REVIEW",null,`The ${T} class has no automatic Lyra equivalent: ${F.hint}.`,H);continue}_(z,Y,F.target,{upstreamTag:null,origin:H,upstreamMember:T,action:"rewrite-class",target:F.target,message:`Rewrite the ${T} class to ${F.target}.`}),F.kind==="approximate"&&P(z,null,T,"UPSTREAM_CLASS_APPROXIMATE_REVIEW",F.target,`${T} was rewritten to the nearest Lyra class ${F.target}; the type and radius scales are not value-aligned, so check the rendered size.`,H)}let Vt=N.map(T=>[T.start,T.end]),Ot=c(T=>Vt.some(([z,Y])=>T>=z&&T<Y),"wasRewritten");for(let T of zi(e))Ot(T.offset)||P(T.offset,T.upstreamTag,T.member,T.code,T.target,T.message);let qe=Wn(e,N);return O.sort((T,z)=>T.line-z.line||T.column-z.column||T.action.localeCompare(z.action)),q.sort((T,z)=>T.line-z.line||T.column-z.column||T.warningCode.localeCompare(z.warningCode)),{content:qe,changes:O,warnings:q,usage:b,blockedMappings:E,blockedEcosystems:k,bareImportPackages:f,automaticMappings:j,deepRegistrationMappings:d}}c(hn,"migrateText");var Gn="immutable-collections",oo="IMMUTABLE_COLLECTION_REVIEW",no="MAP_CENTER_REVIEW",Li=Object.freeze([{tag:"lr-activity-feed",className:"LyraActivityFeed",properties:["entries"]},{tag:"lr-agent-trace",className:"LyraAgentTrace",properties:["spans"]},{tag:"lr-calendar",className:"LyraCalendar",properties:["events"]},{tag:"lr-claim-evidence",className:"LyraClaimEvidence",properties:["citations","claims"]},{tag:"lr-command-palette",className:"LyraCommandPalette",properties:["commands"]},{tag:"lr-date-picker",className:"LyraDatePicker",properties:["presets"]},{tag:"lr-eval-dataset",className:"LyraEvalDataset",properties:["examples"]},{tag:"lr-eval-run",className:"LyraEvalRun",properties:["examples"]},{tag:"lr-grounding-summary",className:"LyraGroundingSummary",properties:["citations"]},{tag:"lr-ingestion-queue",className:"LyraIngestionQueue",properties:["items"]},{tag:"lr-map",className:"LyraMap",properties:["dataLayers","images","markers","styleOverrides"]},{tag:"lr-memory-panel",className:"LyraMemoryPanel",properties:["longTerm","shortTerm"]},{tag:"lr-mention-popover",className:"LyraMentionPopover",properties:["items"]},{tag:"lr-node-palette",className:"LyraNodePalette",properties:["items"]},{tag:"lr-prompt-queue",className:"LyraPromptQueue",properties:["items"]},{tag:"lr-retrieval-results",className:"LyraRetrievalResults",properties:["chunks"]},{tag:"lr-span-waterfall",className:"LyraSpanWaterfall",properties:["spans"]},{tag:"lr-stat",className:"LyraStat",properties:["rows"]},{tag:"lr-swatch-picker",className:"LyraSwatchPicker",properties:["items"]},{tag:"lr-task-list",className:"LyraTaskList",properties:["items"]},{tag:"lr-test-results",className:"LyraTestResults",properties:["suites"]},{tag:"lr-thread-list",className:"LyraThreadList",properties:["threads"]},{tag:"lr-tool-timeline",className:"LyraToolTimeline",properties:["entries"]},{tag:"lr-trace-tree",className:"LyraTraceTree",properties:["spans"]},{tag:"lr-virtual-list",className:"LyraVirtualList",properties:["items"]}]),cm=["push","splice","pop","shift","unshift","sort","reverse","fill","copyWithin"],Di=cm.join("|"),lm=new Set(["css","scss","less","pcss","postcss","json"]),um=[...new Set(Li.flatMap(e=>e.properties))].sort(),so=um.join("|"),ao=String.raw`[A-Za-z_$][\w$]*(?:(?:\?\.|\.)[A-Za-z_$][\w$]*)*`,pm=/lyra-migrate-reviewed:\s*([^\n]*)/g,mm=c(e=>/\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase()??"","extensionOf"),zs=c(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp");function Fi(e,t){let n=1,s=0;for(let r=e.indexOf(`
42
- `);r!==-1&&r<t;r=e.indexOf(`
43
- `,r+1))n+=1,s=r+1;return{line:n,column:t-s+1}}c(Fi,"lineColumn");function ro(e,t,n){return Li.filter(s=>{if(!s.properties.includes(t))return!1;let r=n.get(s.tag);return r===void 0&&(r=new RegExp(`(?<![\\w-])${s.tag}(?![\\w-])|\\b${s.className}\\b`).test(e),n.set(s.tag,r)),r})}c(ro,"owners");function Bi(e,t,n,s=oo){let r=e.lastIndexOf(`
38
+ `,wn=c(v=>{let P=Ws(e.slice(0,v.start-1));return/\bimport$/.test(P)?P.length-6:null},"importStatementStart"),cs=c(v=>{if(v.kind!=="binding"||!Ra(v.subpath))return!1;let P=c(B=>`No Lyra counterpart is recorded for ${B.join(", ")} from ${v.specifier}; the import was left unchanged. Recorded utilities: ${Object.keys(Rn).join(", ")}.`,"blocked"),g=/\bimport\s*\{(?<bindings>[^{}]*)\}\s*from\s*$/.exec(e.slice(0,v.start-1));if(!g||ae(g.index,a))return!1;let A=g.groups.bindings.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n\r]*/g,"").split(",").map(B=>B.trim()).filter(Boolean),R=At(g.groups.bindings);if(!R.length||R.length!==A.length||A.some(B=>/^type\s/.test(B)))return!1;let z=R.filter(B=>!Object.hasOwn(Rn,B.imported));if(z.length)return P(z.map(B=>B.imported));let V=new Map;for(let B of R){let{target:X}=Rn[B.imported],ue=V.get(X)??[];ue.push(B.imported===B.local?B.imported:`${B.imported} as ${B.local}`),V.set(X,ue)}let H=e[v.statementEnd-1]===";"?";":"",q=[...V].map(([B,X])=>`import { ${X.join(", ")} } from ${v.quote}${B}${v.quote}${H}`).join(Lt);W.push({start:g.index,end:v.statementEnd,replacement:q});for(let B of R){let X=Rn[B.imported];O(g.index,null,B.imported,"rewrite-import",X.target,`Import ${B.imported} from its Lyra subpath ${X.target}.`,v.ecosystem),X.review&&_(g.index,null,B.imported,"UTILITY_BEHAVIOR_REVIEW",X.target,X.review,v.ecosystem)}return!0},"rewriteUtilityImport");for(let v of S){let{ecosystem:P}=v,g=v.subpath?xs(v.subpath):null;if(!v.sideEffect&&g?.kind==="none"){Pt(v,g,"UPSTREAM_ASSET_REVIEW");continue}let b=v.sideEffect?!1:cs(v);if(b===!0)continue;if(!v.sideEffect){d[P].manual+=1,_(v.start,v.subpath?lo(v.specifier,P):null,"module","IMPORT_BINDING_REVIEW_REQUIRED",null,typeof b=="string"?b:`The ${v.kind} import has runtime/type bindings whose exported names cannot be inferred safely.`,P);continue}if(g?.kind==="drop"){let V=wn(v);if(V===null){Pt(v,g,"UPSTREAM_ASSET_REVIEW");continue}let H=e.lastIndexOf(`
39
+ `,V-1)+1,q=e.indexOf(`
40
+ `,v.statementEnd),B=q===-1?e.length:q+1,X=/^[ \t]*$/.test(e.slice(H,V))&&/^[ \t]*\r?\n?$/.test(e.slice(v.statementEnd,B));W.push(X?{start:H,end:B,replacement:""}:{start:V,end:v.statementEnd,replacement:""}),O(v.start,null,"module","remove-import",null,g.note,P);continue}if(g?.kind==="translation"){te(v.start,v.end,g.targets[0],{upstreamTag:null,origin:P,upstreamMember:"module",action:"rewrite-import",target:g.targets[0],message:`Rewrite the ${v.packageName} translation import to the Lyra ${g.locale} catalog.`}),g.note&&Pt(v,g,"TRANSLATION_LOCALE_REVIEW"),M.has(Dr)||(M.add(Dr),_(v.start,null,"module","OPTIONAL_PEER_REQUIRED",Dr,`Lyra locale catalogs ship in the optional peer package ${Dr}; install it at the same version as @aceshooting/lyra-ui.`,P));continue}if(g&&g.kind!=="registry"){let V=s.has(P)||s.has(v.packageName);if(g.kind==="none")Pt(v,g,"UPSTREAM_ASSET_REVIEW");else if(g.kind==="loader"&&!V)_(v.start,null,"module","PACKAGE_IMPORT_BLOCKED",g.targets[0],`The ${P} autoloader import remains because this scan contains manual uses; the Lyra autoloader registers only migrated tags.`,P);else{te(v.start,v.end,g.targets[0],{upstreamTag:null,origin:P,upstreamMember:"module",action:"rewrite-import",target:g.targets[0],message:`Rewrite the ${v.packageName} ${g.kind==="style"?"stylesheet":"loader"} import to its Lyra counterpart.`});for(let H of g.targets.slice(1).reverse()){let q=`${v.quote}${H}${v.quote}`;W.push({start:v.statementEnd,end:v.statementEnd,replacement:v.kind==="css-import"?`${Lt}@import url(${q});`:`${Lt}import ${q};`}),O(v.start,null,"module","insert-registration",H,"Insert the Lyra stylesheet that replaces the rest of the upstream bundle.",P)}g.note&&Pt(v,g,"UPSTREAM_ASSET_REVIEW")}continue}if(io(v)){let V=s.has(P)||s.has(v.packageName),H=o.get(v.packageName)??o.get(P)??new Set,q=Md(t,H);if(V&&q.length>0){te(v.start,v.end,q[0],{upstreamTag:null,origin:P,upstreamMember:"module",action:"rewrite-import",target:q[0],message:`Rewrite ${v.packageName} root registration import to its proven Lyra registration closure.`});for(let B of q.slice(1))W.push({start:v.statementEnd,end:v.statementEnd,replacement:`${Lt}import ${v.quote}${B}${v.quote};`}),O(v.start,null,"module","insert-registration",B,"Insert granular registration for a root-excluded Lyra target.",P)}else _(v.start,null,"module","PACKAGE_IMPORT_BLOCKED","@aceshooting/lyra-ui/all.js",`The ${P} package import remains because this scan contains manual uses or no proven registration closure.`,P);continue}let A=lo(v.specifier,P),R=A?t.mappings.get(A):null;if(R&&!jd(v,R)){d[P].manual+=1,K(R,v.start),_(v.start,A,"module","PACKAGE_TIER_MISMATCH",R.targetTag,`${v.packageName} does not provide the ${R.source.tier} ${A} registration entry; use a package identity that provides that tier before migrating it.`,P);continue}if(!A||!le(R)){d[P].manual+=1,R&&K(R,v.start),_(v.start,A,"module",se(R)?ge(R):R?Yn(R):"UNRESOLVED_DEEP_IMPORT",R?.targetTag??null,se(R)?we(R):A?Zn(R):`No component registration entry can be derived from ${v.specifier}.`,P,R?.parity?.behaviorReviewFlags);continue}d[P].automatic+=1,Z(R,v.start),j.add(R.upstreamTag);let z=uo(R.target);te(v.start,v.end,z,{upstreamTag:A,upstreamMember:"module",action:"rewrite-import",target:z,message:`Rewrite the ${A} registration entry to its checked Lyra package route.`})}for(let{token:v,start:P,end:g}of Ta(e,b=>ae(b,a))){let b=ka(v);if(!b)continue;let A=v.startsWith("sl-")?"shoelace":"webawesome";if(b.kind==="review"){_(P,null,v,"UPSTREAM_CLASS_REVIEW",null,`The ${v} class has no automatic Lyra equivalent: ${b.hint}.`,A);continue}te(P,g,b.target,{upstreamTag:null,origin:A,upstreamMember:v,action:"rewrite-class",target:b.target,message:`Rewrite the ${v} class to ${b.target}.`}),b.kind==="approximate"&&_(P,null,v,"UPSTREAM_CLASS_APPROXIMATE_REVIEW",b.target,`${v} was rewritten to the nearest Lyra class ${b.target}; the type and radius scales are not value-aligned, so check the rendered size.`,A)}for(let v of Wi(e,P=>ae(P,a)))W.some(P=>v.start<P.end&&P.start<v.end)||(te(v.start,v.end,v.target,{upstreamTag:null,origin:v.origin,upstreamMember:v.token,action:"rewrite-token",target:v.target,message:`Rewrite the ${v.token} design token to ${v.target}.`}),v.kind==="approximate"&&_(v.start,null,v.token,"UPSTREAM_TOKEN_APPROXIMATE_REVIEW",v.target,`${v.token} was rewritten to the nearest Lyra token ${v.target}; ${v.note}.`,v.origin));let ls=W.map(v=>[v.start,v.end]),us=c(v=>ls.some(([P,g])=>v>=P&&v<g),"wasRewritten");for(let v of Yi(e))us(v.offset)||F.has(v.offset)||_(v.offset,v.upstreamTag,v.member,v.code,v.target,v.message);let en=Un(e,W);return $.sort((v,P)=>v.line-P.line||v.column-P.column||v.action.localeCompare(P.action)),L.sort((v,P)=>v.line-P.line||v.column-P.column||v.warningCode.localeCompare(P.warningCode)),{content:en,changes:$,warnings:L,usage:d,blockedMappings:N,blockedEcosystems:I,bareImportPackages:p,automaticMappings:k,deepRegistrationMappings:j}}c(pn,"migrateText");var Xn="immutable-collections",ho="IMMUTABLE_COLLECTION_REVIEW",po="MAP_CENTER_REVIEW",Xi=Object.freeze([{tag:"lr-activity-feed",className:"LyraActivityFeed",properties:["entries"]},{tag:"lr-agent-trace",className:"LyraAgentTrace",properties:["spans"]},{tag:"lr-calendar",className:"LyraCalendar",properties:["events"]},{tag:"lr-claim-evidence",className:"LyraClaimEvidence",properties:["citations","claims"]},{tag:"lr-command-palette",className:"LyraCommandPalette",properties:["commands"]},{tag:"lr-date-picker",className:"LyraDatePicker",properties:["presets"]},{tag:"lr-eval-dataset",className:"LyraEvalDataset",properties:["examples"]},{tag:"lr-eval-run",className:"LyraEvalRun",properties:["examples"]},{tag:"lr-grounding-summary",className:"LyraGroundingSummary",properties:["citations"]},{tag:"lr-ingestion-queue",className:"LyraIngestionQueue",properties:["items"]},{tag:"lr-map",className:"LyraMap",properties:["dataLayers","images","markers","styleOverrides"]},{tag:"lr-memory-panel",className:"LyraMemoryPanel",properties:["longTerm","shortTerm"]},{tag:"lr-mention-popover",className:"LyraMentionPopover",properties:["items"]},{tag:"lr-node-palette",className:"LyraNodePalette",properties:["items"]},{tag:"lr-prompt-queue",className:"LyraPromptQueue",properties:["items"]},{tag:"lr-retrieval-results",className:"LyraRetrievalResults",properties:["chunks"]},{tag:"lr-span-waterfall",className:"LyraSpanWaterfall",properties:["spans"]},{tag:"lr-stat",className:"LyraStat",properties:["rows"]},{tag:"lr-swatch-picker",className:"LyraSwatchPicker",properties:["items"]},{tag:"lr-task-list",className:"LyraTaskList",properties:["items"]},{tag:"lr-test-results",className:"LyraTestResults",properties:["suites"]},{tag:"lr-thread-list",className:"LyraThreadList",properties:["threads"]},{tag:"lr-tool-timeline",className:"LyraToolTimeline",properties:["entries"]},{tag:"lr-trace-tree",className:"LyraTraceTree",properties:["spans"]},{tag:"lr-virtual-list",className:"LyraVirtualList",properties:["items"]}]),Ld=["push","splice","pop","shift","unshift","sort","reverse","fill","copyWithin"],Zi=Ld.join("|"),Dd=new Set(["css","scss","less","pcss","postcss","json"]),Fd=[...new Set(Xi.flatMap(e=>e.properties))].sort(),mo=Fd.join("|"),go=String.raw`[A-Za-z_$][\w$]*(?:(?:\?\.|\.)[A-Za-z_$][\w$]*)*`,Bd=/lyra-migrate-reviewed:\s*([^\n]*)/g,Vd=c(e=>/\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase()??"","extensionOf"),Fr=c(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp");function Qi(e,t){let n=1,r=0;for(let s=e.indexOf(`
41
+ `);s!==-1&&s<t;s=e.indexOf(`
42
+ `,s+1))n+=1,r=s+1;return{line:n,column:t-r+1}}c(Qi,"lineColumn");function fo(e,t,n){return Xi.filter(r=>{if(!r.properties.includes(t))return!1;let s=n.get(r.tag);return s===void 0&&(s=new RegExp(`(?<![\\w-])${r.tag}(?![\\w-])|\\b${r.className}\\b`).test(e),n.set(r.tag,s)),s})}c(fo,"owners");function ec(e,t,n,r=ho){let s=e.lastIndexOf(`
44
43
  `,t-1)+1,o=e.indexOf(`
45
- `,t),i=r>0?e.lastIndexOf(`
46
- `,r-2)+1:r,a=e.slice(i,o===-1?e.length:o);for(let l of a.matchAll(pm))if(new RegExp(`${s}:\\s*(?:lr-[a-z-]+\\.)?${n}(?![\\w$])`).test(l[1]))return!0;return!1}c(Bi,"acknowledged");function dm(e,{file:t="input"}={}){let n=[];if(lm.has(mm(t)))return{warnings:n};let s=new Map,r=new Set,o=c((u,m,h,g)=>{let y=`${u}:${m}`;r.has(y)||Bi(e,u,m)||(r.add(y),n.push({file:t,...Fi(e,u),rule:Gn,upstreamTag:h.map($=>$.tag).join(" "),upstreamMember:m,action:"manual-review",target:"new array",warningCode:oo,message:g}))},"warn"),i=c((u,m)=>`${u.map(h=>`${h.tag}.${m}`).join(" / ")}`,"describe"),a=c(u=>`Acknowledge a reviewed site with lyra-migrate-reviewed: ${oo}:${u}.`,"acknowledgement");for(let u of e.matchAll(new RegExp(String.raw`(?:\.|\?\.)(${so})\s*(?:\?\.|\.)\s*(${Di})\s*\(`,"g"))){let m=ro(e,u[1],s);m.length&&o(u.index,u[1],m,`${u[1]}.${u[2]}() changes ${i(m,u[1])} in place; assigning the same array again is ignored since Lyra 30, so the view does not update. Assign a new array (for example [...${u[1]}, item]) instead. ${a(u[1])}`)}for(let u of e.matchAll(new RegExp(String.raw`(${ao})\.(${so})\s*=(?!=)\s*\1\.\2(?![\w$.(\[?])`,"g"))){let m=ro(e,u[2],s);m.length&&o(u.index,u[2],m,`${u[1]}.${u[2]} = ${u[1]}.${u[2]} assigns the array the property already holds, which is ignored since Lyra 30 (${i(m,u[2])}). Assign a new array. ${a(u[2])}`)}let l=new RegExp(String.raw`(${ao})\.(${so})\s*=(?!=)\s*([A-Za-z_$][\w$]*)\s*(?:as\s+[^;\n]+)?(?=[;\n,)]|$)`,"g");for(let u of e.matchAll(l)){let[,m,h,g]=u,y=ro(e,h,s);if(!y.length)continue;let $=e.slice(0,u.index),w=new RegExp(String.raw`(?:const|let|var)\s+${zs(g)}\b[^=\n]*=\s*${zs(m)}\.${h}\s*(?:as\s+[^;\n]+)?\s*[;\n]`,"g"),f=null;for(let p of $.matchAll(w))f=p;if(!f)continue;let E=$.slice(f.index+f[0].length);new RegExp(String.raw`\b${zs(g)}\s*\.\s*(?:${Di})\s*\(|\b${zs(g)}\s*\[[^\]\n]+\]\s*=(?!=)`).test(E)&&o(u.index,h,y,`${g} is the array ${m}.${h} already holds and is changed in place before being assigned back; that assignment is ignored since Lyra 30 (${i(y,h)}). Copy it first (const ${g} = [...${m}.${h}]). ${a(h)}`)}return gm(e,t,n),n.sort((u,m)=>u.line-m.line||u.column-m.column),{warnings:n}}c(dm,"analyzeImmutableCollections");var fm=/(?<![\w-])lr-map(?![\w-])|\bLyraMap\b/,hm=new RegExp(String.raw`(${ao})\.center\s*=(?!=)`,"g");function gm(e,t,n){if(fm.test(e))for(let s of e.matchAll(hm))Bi(e,s.index,"center",no)||n.push({file:t,...Fi(e,s.index),rule:Gn,upstreamTag:"lr-map",upstreamMember:"center",action:"manual-review",target:"jumpTo()",warningCode:no,message:`${s[1]}.center = … compares by value since Lyra 30: assigning the coordinates lr-map was last given moves nothing, so it no longer re-centres a map the user has panned. If this line re-centres, call ${s[1]}.jumpTo({ center }) (or flyTo()/easeTo()); an initial or changed centre needs no change. Acknowledge a reviewed site with lyra-migrate-reviewed: ${no}:center.`})}c(gm,"analyzeMapCenter");function io(e,{file:t="input"}={}){return{content:e,changes:[],warnings:dm(e,{file:t}).warnings}}c(io,"migrateImmutableCollections");var Wo=Object.freeze([Un,Gn]),Jd=Object.freeze({[Un]:Pr,[Gn]:io});function Gd({files:e,rule:t,dryRun:n=!1,reportPath:s=null,cwd:r=process.cwd(),collectDiff:o=!1}){U(Wo.includes(t),`unknown migration rule ${String(t)}`);let i=[],a=[],l=[],u=0;for(let h of e){let g=Le.readFileSync(h,"utf8"),y=Jd[t](g,{file:sn(h,r)});i.push(...y.changes),a.push(...y.warnings),y.content!==g&&(u+=1,o&&l.push($l(sn(h,r),g,y.content)),n||Le.writeFileSync(h,y.content,"utf8"))}let m={schemaVersion:qo,rule:t,dryRun:n,filesScanned:e.length,filesChanged:u,changes:i,warnings:a,summary:{rewrites:i.length,warnings:a.length}};return s&&Le.writeFileSync(s,`${JSON.stringify(m,null,2)}
47
- `,"utf8"),o?{...m,diff:l.join("")}:m}c(Gd,"migrateRuleFiles");var qo=1,Yd=new Set(["html","htm","ts","tsx","js","jsx","mjs","cjs","css","vue","svelte","mdx","md"]),Zd=new Set(["node_modules","dist","build","coverage",".turbo",".cache"]);function gl(e){let t=e.split(`
48
- `),n=t.at(-1)==="";return n&&t.pop(),t.map((s,r)=>{let o=r<t.length-1||n;return{line:s,eol:o,key:o?s:`${s}\0`}})}c(gl,"diffLines");function Xd(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n].key===t[n].key;)n+=1;let s=0;for(;s<e.length-n&&s<t.length-n&&e[e.length-1-s].key===t[t.length-1-s].key;)s+=1;let r=e.slice(n,e.length-s),o=t.slice(n,t.length-s),i=c((y,$,w)=>$===-w||$!==w&&y.get($-1)<y.get($+1),"goesDown"),a=[],l=new Map([[1,0]]);e:for(let y=0;y<=r.length+o.length;y+=1){a.push(l);let $=new Map;for(let w=-y;w<=y;w+=2){let f=i(l,w,y)?l.get(w+1):l.get(w-1)+1,E=f-w;for(;f<r.length&&E<o.length&&r[f].key===o[E].key;)f+=1,E+=1;if($.set(w,f),f>=r.length&&E>=o.length)break e}l=$}let u=[],m=r.length,h=o.length;for(let y=a.length-1;y>=0;y-=1){let $=a[y],w=m-h,f=i($,w,y)?w+1:w-1,E=$.get(f),p=E-f;for(;m>E&&h>p;)m-=1,h-=1,u.push({type:" ",before:n+m,after:n+h});y>0&&(m===E?u.push({type:"+",after:n+h-1}):u.push({type:"-",before:n+m-1})),m=E,h=p}u.reverse();let g=[];for(let y=0;y<n;y+=1)g.push({type:" ",before:y,after:y});g.push(...u);for(let y=s;y>0;y-=1)g.push({type:" ",before:e.length-y,after:t.length-y});return g}c(Xd,"diffOperations");function yl(e){if(/^[\x21-\x7e]+$/.test(e)&&!/["\\]/.test(e))return e;let t='"';for(let n of Buffer.from(e,"utf8"))n===34||n===92?t+=`\\${String.fromCharCode(n)}`:n>=32&&n<=126?t+=String.fromCharCode(n):t+=`\\${n.toString(8).padStart(3,"0")}`;return`${t}"`}c(yl,"quoteDiffPath");function $l(e,t,n,s=3){if(t===n)return"";let r=gl(t),o=gl(n),i=Xd(r,o),a=[0],l=[0];for(let h of i)a.push(a.at(-1)+(h.type==="+"?0:1)),l.push(l.at(-1)+(h.type==="-"?0:1));let u=[];i.forEach((h,g)=>{if(h.type===" ")return;let y=u.at(-1);y&&g-y.end<=s*2+1?y.end=g:u.push({start:g,end:g})});let m=[`--- ${yl(`a/${e}`)}
49
- `,`+++ ${yl(`b/${e}`)}
50
- `];for(let h of u){let g=Math.max(0,h.start-s),y=Math.min(i.length,h.end+s+1),$=a[y]-a[g],w=l[y]-l[g],f=a[g]+($?1:0),E=l[g]+(w?1:0);m.push(`@@ -${f},${$} +${E},${w} @@
51
- `);for(let p of i.slice(g,y)){let A=p.type==="+"?o[p.after]:r[p.before];m.push(`${p.type}${A.line}
52
- `),A.eol||m.push(`\
53
- `)}}return m.join("")}c($l,"unifiedDiff");function sn(e,t){return(Ae.relative(t,e)||Ae.basename(e)).split(Ae.sep).join("/")}c(sn,"reportPathName");function Qd({files:e,inventory:t,dryRun:n=!1,reportPath:s=null,cwd:r=process.cwd(),origin:o=null,renameLedger:i=null,exportDeprecations:a=[],lyraVersion:l=null,collectDiff:u=!1,compatibilityContext:m=null}){if(u){let M=e.filter(R=>{let _=Ae.relative(r,R);return _===".."||_.startsWith(`..${Ae.sep}`)||Ae.isAbsolute(_)});if(M.length)throw new Error(`--diff needs every target inside the working directory; run it from a common parent of ${M.join(", ")}.`)}let h=Es(t,{renameLedger:i,exportDeprecations:a,lyraVersion:l,compatibilityContext:m}),g=new Map(e.map(M=>[M,Le.readFileSync(M,"utf8")])),y=[],$=c((M,R,_)=>{u&&_!==R&&y.push($l(sn(M,r),R,_))},"noteDiff"),w=c(M=>(s&&Le.writeFileSync(s,`${JSON.stringify(M,null,2)}
54
- `,"utf8"),u?{...M,diff:y.join("")}:M),"finish");if(o!==null){let M=h.renameProfiles.has(o);U(h.localMigrations.has(o)||M,`unknown local migration origin ${String(o)}`);let R=new Set,_=new Set;for(let[Ne,Se]of g){let ke=hn(Se,h,{file:sn(Ne,r),origin:o});for(let ut of ke.blockedLocalMigrations)R.add(ut);for(let ut of ke.constructedEvents??[])_.add(ut)}let W=[],ee=[],ae=0,pe=0;for(let[Ne,Se]of g){let ke=hn(Se,h,{file:sn(Ne,r),origin:o,blockedLocalMigrations:R,constructedEvents:_});W.push(...ke.changes),ee.push(...ke.warnings),pe+=ke.acknowledged??0,ke.content!==Se&&(ae+=1,$(Ne,Se,ke.content),n||Le.writeFileSync(Ne,ke.content,"utf8"))}let de=c(Ne=>Ne.sort((Se,ke)=>Se.file.localeCompare(ke.file)||Se.line-ke.line||Se.column-ke.column||Se.action.localeCompare(ke.action)),"sortEntries");de(W),de(ee);let he={rewrites:W.length,warnings:ee.length};return M&&(he.acknowledged=pe,l!==null&&(he.skipped=h.renameProfiles.get(o).skipped.length)),w({schemaVersion:qo,origin:o,dryRun:n,filesScanned:e.length,filesChanged:ae,changes:W,warnings:ee,summary:he})}let f=mi(g),E=new Set,p=new Set,A=new Set,k=new Set,N=new Set,O={webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}};for(let[M,R]of g){let _=hn(R,h,{file:sn(M,r),rewriteBarePackages:new Set,domFactoryBindings:f.get(Ae.resolve(M))});for(let W of Object.keys(O))O[W].automatic+=_.usage[W].automatic,O[W].manual+=_.usage[W].manual;for(let W of _.blockedMappings)E.add(W);for(let W of _.blockedEcosystems)p.add(W);for(let W of _.bareImportPackages)A.add(W);for(let W of _.automaticMappings)k.add(W);for(let W of _.deepRegistrationMappings)N.add(W)}for(let M of A){let R=h.packageIdentities.get(M);R&&O[R.ecosystem].manual>0&&p.add(R.ecosystem)}let q=new Set([...A].filter(M=>{let R=h.packageIdentities.get(M);if(!R)return!1;let _=O[R.ecosystem];return _.automatic>0&&_.manual===0&&!p.has(R.ecosystem)})),b=new Map([...A].map(M=>{let R=h.packageIdentities.get(M),_=new Set([...k].filter(W=>{let ee=h.mappings.get(W);return!!(R&&ee?.upstream===R.ecosystem&&(!ee.source?.tier||R.tiers.has(ee.source.tier)))}));return[M,_]})),j=new Set(N);for(let M of q)for(let R of b.get(M)??[])j.add(R);let d=new Set([...k].filter(M=>!j.has(M))),x=[],I=[],C=0;for(let[M,R]of g){let _=hn(R,h,{file:sn(M,r),rewriteBarePackages:q,rootRegistrationMappings:b,blockedMappings:E,blockedEcosystems:p,registrationBlockedMappings:d,domFactoryBindings:f.get(Ae.resolve(M))});x.push(..._.changes),I.push(..._.warnings),_.content!==R&&(C+=1,$(M,R,_.content),n||Le.writeFileSync(M,_.content,"utf8"))}let P=c(M=>M.sort((R,_)=>R.file.localeCompare(_.file)||R.line-_.line||R.column-_.column||R.action.localeCompare(_.action)),"sortEntries");return P(x),P(I),w({schemaVersion:qo,origin:null,dryRun:n,filesScanned:e.length,filesChanged:C,changes:x,warnings:I,summary:{rewrites:x.length,warnings:I.length}})}c(Qd,"migrateFiles");function wl(e){let t={check:!1,diff:!1,dryRun:!1,help:!1,extensions:Yd,lyraVersion:null,origin:null,report:null,rule:null,targets:[]},n=!1;for(let s of e)if(!n&&s==="--")n=!0;else if(!n&&(s==="--dry-run"||s==="-n"))t.dryRun=!0;else if(!n&&s==="--check")t.check=!0,t.dryRun=!0;else if(!n&&s==="--diff")t.diff=!0,t.dryRun=!0;else if(!n&&(s==="--help"||s==="-h"))t.help=!0;else if(!n&&s.startsWith("--ext="))t.extensions=new Set(s.slice(6).split(",").map(r=>r.trim().replace(/^\./,"").toLowerCase()).filter(Boolean));else if(!n&&s.startsWith("--report=")){if(t.report=s.slice(9),!t.report)throw new Error("--report requires a path")}else if(!n&&s.startsWith("--lyra-version=")){if(t.lyraVersion=s.slice(15),mt(t.lyraVersion,t.lyraVersion)!==0)throw new Error(`--lyra-version needs a version such as 22.0.0, got ${t.lyraVersion||"nothing"}`)}else if(!n&&s.startsWith("--origin=")){if(t.origin=s.slice(9),!t.origin)throw new Error("--origin requires a value");if(!vs.includes(t.origin))throw new Error(`Unknown migration origin: ${t.origin}`)}else if(!n&&s.startsWith("--rule=")){if(t.rule=s.slice(7),!Wo.includes(t.rule))throw new Error(`Unknown migration rule: ${t.rule}`)}else{if(!n&&s.startsWith("-"))throw new Error(`Unknown option: ${s}`);t.targets.push(s)}return t}c(wl,"parseArgs");function ef(){console.log(`Usage: lyra-ui-migrate [--check] [--dry-run] [--diff] [--origin=${vs.join("|")}] [--rule=${Wo.join("|")}] [--lyra-version=x.y.z] [--report=path] [--ext=html,ts,...] targets...
44
+ `,t),i=s>0?e.lastIndexOf(`
45
+ `,s-2)+1:s,a=e.slice(i,o===-1?e.length:o);for(let l of a.matchAll(Bd))if(new RegExp(`${r}:\\s*(?:lr-[a-z-]+\\.)?${n}(?![\\w$])`).test(l[1]))return!0;return!1}c(ec,"acknowledged");function qd(e,{file:t="input"}={}){let n=[];if(Dd.has(Vd(t)))return{warnings:n};let r=new Map,s=new Set,o=c((u,m,h,y)=>{let w=`${u}:${m}`;s.has(w)||ec(e,u,m)||(s.add(w),n.push({file:t,...Qi(e,u),rule:Xn,upstreamTag:h.map(E=>E.tag).join(" "),upstreamMember:m,action:"manual-review",target:"new array",warningCode:ho,message:y}))},"warn"),i=c((u,m)=>`${u.map(h=>`${h.tag}.${m}`).join(" / ")}`,"describe"),a=c(u=>`Acknowledge a reviewed site with lyra-migrate-reviewed: ${ho}:${u}.`,"acknowledgement");for(let u of e.matchAll(new RegExp(String.raw`(?:\.|\?\.)(${mo})\s*(?:\?\.|\.)\s*(${Zi})\s*\(`,"g"))){let m=fo(e,u[1],r);m.length&&o(u.index,u[1],m,`${u[1]}.${u[2]}() changes ${i(m,u[1])} in place; assigning the same array again is ignored since Lyra 30, so the view does not update. Assign a new array (for example [...${u[1]}, item]) instead. ${a(u[1])}`)}for(let u of e.matchAll(new RegExp(String.raw`(${go})\.(${mo})\s*=(?!=)\s*\1\.\2(?![\w$.(\[?])`,"g"))){let m=fo(e,u[2],r);m.length&&o(u.index,u[2],m,`${u[1]}.${u[2]} = ${u[1]}.${u[2]} assigns the array the property already holds, which is ignored since Lyra 30 (${i(m,u[2])}). Assign a new array. ${a(u[2])}`)}let l=new RegExp(String.raw`(${go})\.(${mo})\s*=(?!=)\s*([A-Za-z_$][\w$]*)\s*(?:as\s+[^;\n]+)?(?=[;\n,)]|$)`,"g");for(let u of e.matchAll(l)){let[,m,h,y]=u,w=fo(e,h,r);if(!w.length)continue;let E=e.slice(0,u.index),x=new RegExp(String.raw`(?:const|let|var)\s+${Fr(y)}\b[^=\n]*=\s*${Fr(m)}\.${h}\s*(?:as\s+[^;\n]+)?\s*[;\n]`,"g"),f=null;for(let p of E.matchAll(x))f=p;if(!f)continue;let S=E.slice(f.index+f[0].length);new RegExp(String.raw`\b${Fr(y)}\s*\.\s*(?:${Zi})\s*\(|\b${Fr(y)}\s*\[[^\]\n]+\]\s*=(?!=)`).test(S)&&o(u.index,h,w,`${y} is the array ${m}.${h} already holds and is changed in place before being assigned back; that assignment is ignored since Lyra 30 (${i(w,h)}). Copy it first (const ${y} = [...${m}.${h}]). ${a(h)}`)}return Ud(e,t,n),n.sort((u,m)=>u.line-m.line||u.column-m.column),{warnings:n}}c(qd,"analyzeImmutableCollections");var Wd=/(?<![\w-])lr-map(?![\w-])|\bLyraMap\b/,Kd=new RegExp(String.raw`(${go})\.center\s*=(?!=)`,"g");function Ud(e,t,n){if(Wd.test(e))for(let r of e.matchAll(Kd))ec(e,r.index,"center",po)||n.push({file:t,...Qi(e,r.index),rule:Xn,upstreamTag:"lr-map",upstreamMember:"center",action:"manual-review",target:"jumpTo()",warningCode:po,message:`${r[1]}.center = … compares by value since Lyra 30: assigning the coordinates lr-map was last given moves nothing, so it no longer re-centres a map the user has panned. If this line re-centres, call ${r[1]}.jumpTo({ center }) (or flyTo()/easeTo()); an initial or changed centre needs no change. Acknowledge a reviewed site with lyra-migrate-reviewed: ${po}:center.`})}c(Ud,"analyzeMapCenter");function yo(e,{file:t="input"}={}){return{content:e,changes:[],warnings:qd(e,{file:t}).warnings}}c(yo,"migrateImmutableCollections");var Qo=Object.freeze([Jn,Xn]),kf=Object.freeze({[Jn]:Gs,[Xn]:yo});function Tf({files:e,rule:t,dryRun:n=!1,reportPath:r=null,cwd:s=process.cwd(),collectDiff:o=!1}){U(Qo.includes(t),`unknown migration rule ${String(t)}`);let i=[],a=[],l=[],u=0;for(let h of e){let y=_e.readFileSync(h,"utf8"),w=kf[t](y,{file:Qt(h,s)});i.push(...w.changes),a.push(...w.warnings),w.content!==y&&(u+=1,o&&l.push(Il(Qt(h,s),y,w.content)),n||_e.writeFileSync(h,w.content,"utf8"))}let m={schemaVersion:Xo,rule:t,dryRun:n,filesScanned:e.length,filesChanged:u,changes:i,warnings:a,summary:{rewrites:i.length,warnings:a.length}};return r&&_e.writeFileSync(r,`${JSON.stringify(m,null,2)}
46
+ `,"utf8"),o?{...m,diff:l.join("")}:m}c(Tf,"migrateRuleFiles");var Xo=1,Rf=new Set(["html","htm","ts","tsx","js","jsx","mjs","cjs","css","vue","svelte","mdx","md"]),Af=new Set(["node_modules","dist","build","coverage",".turbo",".cache"]);function Ol(e){let t=e.split(`
47
+ `),n=t.at(-1)==="";return n&&t.pop(),t.map((r,s)=>{let o=s<t.length-1||n;return{line:r,eol:o,key:o?r:`${r}\0`}})}c(Ol,"diffLines");function Of(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n].key===t[n].key;)n+=1;let r=0;for(;r<e.length-n&&r<t.length-n&&e[e.length-1-r].key===t[t.length-1-r].key;)r+=1;let s=e.slice(n,e.length-r),o=t.slice(n,t.length-r),i=c((w,E,x)=>E===-x||E!==x&&w.get(E-1)<w.get(E+1),"goesDown"),a=[],l=new Map([[1,0]]);e:for(let w=0;w<=s.length+o.length;w+=1){a.push(l);let E=new Map;for(let x=-w;x<=w;x+=2){let f=i(l,x,w)?l.get(x+1):l.get(x-1)+1,S=f-x;for(;f<s.length&&S<o.length&&s[f].key===o[S].key;)f+=1,S+=1;if(E.set(x,f),f>=s.length&&S>=o.length)break e}l=E}let u=[],m=s.length,h=o.length;for(let w=a.length-1;w>=0;w-=1){let E=a[w],x=m-h,f=i(E,x,w)?x+1:x-1,S=E.get(f),p=S-f;for(;m>S&&h>p;)m-=1,h-=1,u.push({type:" ",before:n+m,after:n+h});w>0&&(m===S?u.push({type:"+",after:n+h-1}):u.push({type:"-",before:n+m-1})),m=S,h=p}u.reverse();let y=[];for(let w=0;w<n;w+=1)y.push({type:" ",before:w,after:w});y.push(...u);for(let w=r;w>0;w-=1)y.push({type:" ",before:e.length-w,after:t.length-w});return y}c(Of,"diffOperations");function Nl(e){if(/^[\x21-\x7e]+$/.test(e)&&!/["\\]/.test(e))return e;let t='"';for(let n of Buffer.from(e,"utf8"))n===34||n===92?t+=`\\${String.fromCharCode(n)}`:n>=32&&n<=126?t+=String.fromCharCode(n):t+=`\\${n.toString(8).padStart(3,"0")}`;return`${t}"`}c(Nl,"quoteDiffPath");function Il(e,t,n,r=3){if(t===n)return"";let s=Ol(t),o=Ol(n),i=Of(s,o),a=[0],l=[0];for(let h of i)a.push(a.at(-1)+(h.type==="+"?0:1)),l.push(l.at(-1)+(h.type==="-"?0:1));let u=[];i.forEach((h,y)=>{if(h.type===" ")return;let w=u.at(-1);w&&y-w.end<=r*2+1?w.end=y:u.push({start:y,end:y})});let m=[`--- ${Nl(`a/${e}`)}
48
+ `,`+++ ${Nl(`b/${e}`)}
49
+ `];for(let h of u){let y=Math.max(0,h.start-r),w=Math.min(i.length,h.end+r+1),E=a[w]-a[y],x=l[w]-l[y],f=a[y]+(E?1:0),S=l[y]+(x?1:0);m.push(`@@ -${f},${E} +${S},${x} @@
50
+ `);for(let p of i.slice(y,w)){let N=p.type==="+"?o[p.after]:s[p.before];m.push(`${p.type}${N.line}
51
+ `),N.eol||m.push(`\
52
+ `)}}return m.join("")}c(Il,"unifiedDiff");function Qt(e,t){return(Ee.relative(t,e)||Ee.basename(e)).split(Ee.sep).join("/")}c(Qt,"reportPathName");function Nf({files:e,inventory:t,dryRun:n=!1,reportPath:r=null,cwd:s=process.cwd(),origin:o=null,renameLedger:i=null,exportDeprecations:a=[],lyraVersion:l=null,collectDiff:u=!1,compatibilityContext:m=null}){if(u){let D=e.filter(O=>{let _=Ee.relative(s,O);return _===".."||_.startsWith(`..${Ee.sep}`)||Ee.isAbsolute(_)});if(D.length)throw new Error(`--diff needs every target inside the working directory; run it from a common parent of ${D.join(", ")}.`)}let h=kr(t,{renameLedger:i,exportDeprecations:a,lyraVersion:l,compatibilityContext:m}),y=new Map(e.map(D=>[D,_e.readFileSync(D,"utf8")])),w=[],E=c((D,O,_)=>{u&&_!==O&&w.push(Il(Qt(D,s),O,_))},"noteDiff"),x=c(D=>(r&&_e.writeFileSync(r,`${JSON.stringify(D,null,2)}
53
+ `,"utf8"),u?{...D,diff:w.join("")}:D),"finish");if(o!==null){let D=h.renameProfiles.has(o);U(h.localMigrations.has(o)||D,`unknown local migration origin ${String(o)}`);let O=new Set,_=new Set;for(let[we,ge]of y){let be=pn(ge,h,{file:Qt(we,s),origin:o});for(let Ge of be.blockedLocalMigrations)O.add(Ge);for(let Ge of be.constructedEvents??[])_.add(Ge)}let K=[],Z=[],te=0,ce=0;for(let[we,ge]of y){let be=pn(ge,h,{file:Qt(we,s),origin:o,blockedLocalMigrations:O,constructedEvents:_});K.push(...be.changes),Z.push(...be.warnings),ce+=be.acknowledged??0,be.content!==ge&&(te+=1,E(we,ge,be.content),n||_e.writeFileSync(we,be.content,"utf8"))}let se=c(we=>we.sort((ge,be)=>ge.file.localeCompare(be.file)||ge.line-be.line||ge.column-be.column||ge.action.localeCompare(be.action)),"sortEntries");se(K),se(Z);let le={rewrites:K.length,warnings:Z.length};return D&&(le.acknowledged=ce,l!==null&&(le.skipped=h.renameProfiles.get(o).skipped.length)),x({schemaVersion:Xo,origin:o,dryRun:n,filesScanned:e.length,filesChanged:te,changes:K,warnings:Z,summary:le})}let f=Ni(y),S=new Set,p=new Set,N=new Set,T=new Set,C=new Set,I={webawesome:{automatic:0,manual:0},shoelace:{automatic:0,manual:0}};for(let[D,O]of y){let _=pn(O,h,{file:Qt(D,s),rewriteBarePackages:new Set,domFactoryBindings:f.get(Ee.resolve(D))});for(let K of Object.keys(I))I[K].automatic+=_.usage[K].automatic,I[K].manual+=_.usage[K].manual;for(let K of _.blockedMappings)S.add(K);for(let K of _.blockedEcosystems)p.add(K);for(let K of _.bareImportPackages)N.add(K);for(let K of _.automaticMappings)T.add(K);for(let K of _.deepRegistrationMappings)C.add(K)}for(let D of N){let O=h.packageIdentities.get(D);O&&I[O.ecosystem].manual>0&&p.add(O.ecosystem)}let W=new Set([...N].filter(D=>{let O=h.packageIdentities.get(D);if(!O)return!1;let _=I[O.ecosystem];return _.automatic>0&&_.manual===0&&!p.has(O.ecosystem)})),$=new Map([...N].map(D=>{let O=h.packageIdentities.get(D),_=new Set([...T].filter(K=>{let Z=h.mappings.get(K);return!!(O&&Z?.upstream===O.ecosystem&&(!Z.source?.tier||O.tiers.has(Z.source.tier)))}));return[D,_]})),L=new Set(C);for(let D of W)for(let O of $.get(D)??[])L.add(O);let d=new Set([...T].filter(D=>!L.has(D))),k=[],j=[],M=0;for(let[D,O]of y){let _=pn(O,h,{file:Qt(D,s),rewriteBarePackages:W,rootRegistrationMappings:$,blockedMappings:S,blockedEcosystems:p,registrationBlockedMappings:d,domFactoryBindings:f.get(Ee.resolve(D))});k.push(..._.changes),j.push(..._.warnings),_.content!==O&&(M+=1,E(D,O,_.content),n||_e.writeFileSync(D,_.content,"utf8"))}let F=c(D=>D.sort((O,_)=>O.file.localeCompare(_.file)||O.line-_.line||O.column-_.column||O.action.localeCompare(_.action)),"sortEntries");return F(k),F(j),x({schemaVersion:Xo,origin:null,dryRun:n,filesScanned:e.length,filesChanged:M,changes:k,warnings:j,summary:{rewrites:k.length,warnings:j.length}})}c(Nf,"migrateFiles");function Cl(e){let t={check:!1,diff:!1,dryRun:!1,help:!1,extensions:Rf,lyraVersion:null,origin:null,report:null,rule:null,targets:[]},n=!1;for(let r of e)if(!n&&r==="--")n=!0;else if(!n&&(r==="--dry-run"||r==="-n"))t.dryRun=!0;else if(!n&&r==="--check")t.check=!0,t.dryRun=!0;else if(!n&&r==="--diff")t.diff=!0,t.dryRun=!0;else if(!n&&(r==="--help"||r==="-h"))t.help=!0;else if(!n&&r.startsWith("--ext="))t.extensions=new Set(r.slice(6).split(",").map(s=>s.trim().replace(/^\./,"").toLowerCase()).filter(Boolean));else if(!n&&r.startsWith("--report=")){if(t.report=r.slice(9),!t.report)throw new Error("--report requires a path")}else if(!n&&r.startsWith("--lyra-version=")){if(t.lyraVersion=r.slice(15),at(t.lyraVersion,t.lyraVersion)!==0)throw new Error(`--lyra-version needs a version such as 22.0.0, got ${t.lyraVersion||"nothing"}`)}else if(!n&&r.startsWith("--origin=")){if(t.origin=r.slice(9),!t.origin)throw new Error("--origin requires a value");if(!Sr.includes(t.origin))throw new Error(`Unknown migration origin: ${t.origin}`)}else if(!n&&r.startsWith("--rule=")){if(t.rule=r.slice(7),!Qo.includes(t.rule))throw new Error(`Unknown migration rule: ${t.rule}`)}else{if(!n&&r.startsWith("-"))throw new Error(`Unknown option: ${r}`);t.targets.push(r)}return t}c(Cl,"parseArgs");function _f(){console.log(`Usage: lyra-ui-migrate [--check] [--dry-run] [--diff] [--origin=${Sr.join("|")}] [--rule=${Qo.join("|")}] [--lyra-version=x.y.z] [--report=path] [--ext=html,ts,...] targets...
55
54
 
56
55
  Only exact and fully rewritten inventory mappings change automatically. Conceptual, unsafe,
57
56
  unsupported, unknown, and unresolved deep-import uses remain unchanged with source-located
@@ -69,8 +68,9 @@ stylesheets, window events and root attributes; review their replacement semanti
69
68
  --origin=lyra-v25 migrates names that change from Lyra 25 to Lyra 26 and reports the rest.
70
69
  --origin=lyra-v26 moves the package specifiers and root-barrel types that Lyra 27 relocated,
71
70
  reports removed localization keys, and runs the theme-scopes rule. --origin=lyra-v31 reports
72
- listeners of events removed in Lyra 32, detail and default changes, with each replacement. Lyra
73
- profiles never rewrite
71
+ listeners of events removed in Lyra 32, detail and default changes, with each replacement.
72
+ --origin=lyra-v32 rewrites custom properties folded in Lyra 33 and reports changed property
73
+ semantics. Lyra profiles never rewrite
74
74
  tags. Run a Lyra profile with the CLI of the installed release, after upgrading.
75
75
 
76
76
  --dry-run, -n report changes without writing source files
@@ -82,6 +82,8 @@ tags. Run a Lyra profile with the CLI of the installed release, after upgrading.
82
82
  --origin=lyra-v26 move specifiers and types relocated in Lyra 27, report removed locale keys
83
83
  and apply --rule=theme-scopes
84
84
  --origin=lyra-v31 report events, details and defaults that change from Lyra 31 to Lyra 32
85
+ --origin=lyra-v32 migrate custom properties and report property semantics that change from
86
+ Lyra 32 to Lyra 33
85
87
  --rule=theme-scopes Lyra 27: mark elements whose inline style sets a token-layer input with
86
88
  data-lr-theme-scope; report dynamic inputs, markers in loops, and CSS that
87
89
  sets inputs or shared outputs outside a theme scope (runs without --origin)
@@ -97,4 +99,4 @@ tags. Run a Lyra profile with the CLI of the installed release, after upgrading.
97
99
 
98
100
  A reviewed rename-profile warning is acknowledged by a "lyra-migrate-reviewed: CODE:name" comment
99
101
  (for example DETAIL_SHAPE_REVIEW:lr-close) on the reported line, alone on the line above it, or
100
- directly before the reported element's opening tag.`)}c(ef,"printUsage");function tf(e=process.cwd()){let t=Ae.resolve(e);for(;;){let n=Ae.join(t,"node_modules","@aceshooting","lyra-ui","package.json");if(Le.existsSync(n))try{let r=JSON.parse(Le.readFileSync(n,"utf8")).version;return mt(r,r)===0?r:null}catch{return null}let s=Ae.dirname(t);if(s===t)return null;t=s}}c(tf,"detectInstalledLyraVersion");function Ko(e,t){let n=[];for(let s of Le.readdirSync(e,{withFileTypes:!0})){if(s.name.startsWith("."))continue;let r=Ae.join(e,s.name);s.isDirectory()?Zd.has(s.name)||n.push(...Ko(r,t)):s.isFile()&&t(r,s.name)&&n.push(r)}return n}c(Ko,"walkDir");function nf(e){let t="^";for(let n=0;n<e.length;n+=1){let s=e[n];s==="**"?t+="(?:.*/)?":(t+=s.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]"),n<e.length-1&&(t+="/"))}return new RegExp(`${t}$`)}c(nf,"globToRegExp");function sf(e){let t=e.split(Ae.sep).join("/").split("/"),n=0;for(;n<t.length&&!/[*?]/.test(t[n]);)n+=1;let s=Ae.resolve(t.slice(0,n).join("/")||".");if(!Le.existsSync(s)||!Le.statSync(s).isDirectory())return[];let r=nf(t.slice(n));return Ko(s,()=>!0).filter(o=>r.test(Ae.relative(s,o).split(Ae.sep).join("/")))}c(sf,"expandGlob");function rf(e,t){let n=new Set;for(let s of e){if(/[*?]/.test(s)){for(let o of sf(s))n.add(o);continue}let r=Ae.resolve(s);if(!Le.existsSync(r)){console.error(`warning: path not found, skipping: ${s}`);continue}if(Le.statSync(r).isDirectory())for(let o of Ko(r,(i,a)=>t.has(Ae.extname(a).slice(1).toLowerCase())))n.add(o);else n.add(r)}return[...n].sort()}c(rf,"collectFiles");function rr(e,{compatibilityContext:t=null,currentExportDeprecations:n=null}={}){let s;try{s=wl(e)}catch(o){return console.error(o instanceof Error?o.message:o),1}if(s.help||!s.targets.length)return ef(),s.help?0:1;let r=rf(s.targets,s.extensions);if(!r.length)return console.error("No files matched the given path(s)/pattern(s)."),1;if(s.rule!==null&&s.origin!==null)return console.error("--rule runs on its own; omit --origin."),1;try{if(s.rule!==null){let m=Gd({files:r,rule:s.rule,dryRun:s.dryRun,reportPath:s.report?Ae.resolve(s.report):null,collectDiff:s.diff}),h=s.diff?console.error:console.log;s.diff&&process.stdout.write(m.diff);for(let g of m.changes)h(`${g.file}:${g.line}:${g.column} ${g.action}: ${g.message}`);for(let g of m.warnings)h(`${g.file}:${g.line}:${g.column} warning ${g.warningCode}: ${g.message}`);return h(`${m.filesScanned} file(s) scanned, ${m.filesChanged} changed, ${m.summary.rewrites} rewrite(s), ${m.summary.warnings} warning(s).`),s.dryRun&&m.filesChanged&&h("Dry run only -- no source files were written."),s.report&&h(`JSON report written to ${s.report}.`),s.check&&(m.filesChanged>0||m.summary.warnings>0)?1:0}let o=Ka(),i=Wt.includes(s.origin),a=i?s.lyraVersion??tf():null,l=Qd({files:r,inventory:o,dryRun:s.dryRun,origin:s.origin,renameLedger:Mn?null:Er(),exportDeprecations:Mn?[]:n??xr(),compatibilityContext:t,lyraVersion:a,reportPath:s.report?Ae.resolve(s.report):null,collectDiff:s.diff}),u=s.diff?console.error:console.log;s.diff&&process.stdout.write(l.diff),i&&u(a===null?"No installed @aceshooting/lyra-ui found under the working directory; applying every entry of the profile.":`Applying entries available in @aceshooting/lyra-ui ${a}`+(l.summary.skipped?`; ${l.summary.skipped} entr${l.summary.skipped===1?"y needs":"ies need"} a later release.`:"."));for(let m of l.changes)u(`${m.file}:${m.line}:${m.column} ${m.action}: ${m.message}`);for(let m of l.warnings)u(`${m.file}:${m.line}:${m.column} warning ${m.warningCode}: ${m.message}`);if(u(`${l.filesScanned} file(s) scanned, ${l.filesChanged} changed, ${l.summary.rewrites} rewrite(s), ${l.summary.warnings} warning(s)`+(Object.hasOwn(l.summary,"acknowledged")?`, ${l.summary.acknowledged} acknowledged.`:".")),s.dryRun&&l.filesChanged&&u("Dry run only -- no source files were written."),s.report&&u(`JSON report written to ${s.report}.`),s.check){let m=l.filesChanged>0||l.summary.warnings>0;return u(m?`Migration check failed: ${l.filesChanged} file(s) need changes and ${l.summary.warnings} warning(s) require review.`:"Migration check passed: no rewrites or warnings remain."),m?1:0}return 0}catch(o){return console.error(o instanceof Error?o.message:o),1}}c(rr,"run");function of(){let e=process.argv[1];if(!e)return!1;let t=bl(import.meta.url);try{return Le.realpathSync(e)===Le.realpathSync(t)}catch{return Ae.resolve(e)===t}}c(of,"invokedAsCli");async function af(){let{readCurrentCompatibilityContext:e}=await hl().then(()=>fl),{readComponentMetadataSources:t,assembleComponentMetadata:n}=await Promise.resolve().then(()=>(So(),Ac)),s=Ae.resolve(Ae.dirname(bl(import.meta.url)),"..");return{compatibilityContext:await e(s),currentExportDeprecations:n(t(s)).exportDeprecations}}c(af,"prepareContributorContext");async function cf(e,{prepareContext:t=af}={}){if(Mn)return rr(e);let n;try{n=wl(e)}catch{return rr(e)}return n.help||!n.targets.length||n.rule!==null?rr(e):rr(e,await t())}c(cf,"runCli");of()&&(process.exitCode=await cf(process.argv.slice(2)));export{vs as MIGRATION_ORIGINS,qo as MIGRATION_REPORT_SCHEMA_VERSION,Wo as MIGRATION_RULES,$s as MIGRATION_RUNTIME_SCHEMA_VERSION,Es as buildMigrationContract,Nu as buildMirrorMap,rf as collectFiles,Ou as createMigrationRuntimeInventory,tf as detectInstalledLyraVersion,Qd as migrateFiles,io as migrateImmutableCollections,Gd as migrateRuleFiles,hn as migrateText,Pr as migrateThemeScopes,wl as parseArgs,xr as readExportDeprecations,Er as readRenameLedger,rr as run,cf as runCli,zi as scanUnrewrittenUpstreamReferences,$l as unifiedDiff};
102
+ directly before the reported element's opening tag.`)}c(_f,"printUsage");function If(e=process.cwd()){let t=Ee.resolve(e);for(;;){let n=Ee.join(t,"node_modules","@aceshooting","lyra-ui","package.json");if(_e.existsSync(n))try{let s=JSON.parse(_e.readFileSync(n,"utf8")).version;return at(s,s)===0?s:null}catch{return null}let r=Ee.dirname(t);if(r===t)return null;t=r}}c(If,"detectInstalledLyraVersion");function ea(e,t){let n=[];for(let r of _e.readdirSync(e,{withFileTypes:!0})){if(r.name.startsWith("."))continue;let s=Ee.join(e,r.name);r.isDirectory()?Af.has(r.name)||n.push(...ea(s,t)):r.isFile()&&t(s,r.name)&&n.push(s)}return n}c(ea,"walkDir");function Cf(e){let t="^";for(let n=0;n<e.length;n+=1){let r=e[n];r==="**"?t+="(?:.*/)?":(t+=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]"),n<e.length-1&&(t+="/"))}return new RegExp(`${t}$`)}c(Cf,"globToRegExp");function Mf(e){let t=e.split(Ee.sep).join("/").split("/"),n=0;for(;n<t.length&&!/[*?]/.test(t[n]);)n+=1;let r=Ee.resolve(t.slice(0,n).join("/")||".");if(!_e.existsSync(r)||!_e.statSync(r).isDirectory())return[];let s=Cf(t.slice(n));return ea(r,()=>!0).filter(o=>s.test(Ee.relative(r,o).split(Ee.sep).join("/")))}c(Mf,"expandGlob");function jf(e,t){let n=new Set;for(let r of e){if(/[*?]/.test(r)){for(let o of Mf(r))n.add(o);continue}let s=Ee.resolve(r);if(!_e.existsSync(s)){console.error(`warning: path not found, skipping: ${r}`);continue}if(_e.statSync(s).isDirectory())for(let o of ea(s,(i,a)=>t.has(Ee.extname(a).slice(1).toLowerCase())))n.add(o);else n.add(s)}return[...n].sort()}c(jf,"collectFiles");function is(e,{compatibilityContext:t=null,currentExportDeprecations:n=null}={}){let r;try{r=Cl(e)}catch(o){return console.error(o instanceof Error?o.message:o),1}if(r.help||!r.targets.length)return _f(),r.help?0:1;let s=jf(r.targets,r.extensions);if(!s.length)return console.error("No files matched the given path(s)/pattern(s)."),1;if(r.rule!==null&&r.origin!==null)return console.error("--rule runs on its own; omit --origin."),1;try{if(r.rule!==null){let m=Tf({files:s,rule:r.rule,dryRun:r.dryRun,reportPath:r.report?Ee.resolve(r.report):null,collectDiff:r.diff}),h=r.diff?console.error:console.log;r.diff&&process.stdout.write(m.diff);for(let y of m.changes)h(`${y.file}:${y.line}:${y.column} ${y.action}: ${y.message}`);for(let y of m.warnings)h(`${y.file}:${y.line}:${y.column} warning ${y.warningCode}: ${y.message}`);return h(`${m.filesScanned} file(s) scanned, ${m.filesChanged} changed, ${m.summary.rewrites} rewrite(s), ${m.summary.warnings} warning(s).`),r.dryRun&&m.filesChanged&&h("Dry run only -- no source files were written."),r.report&&h(`JSON report written to ${r.report}.`),r.check&&(m.filesChanged>0||m.summary.warnings>0)?1:0}let o=li(),i=Ft.includes(r.origin),a=i?r.lyraVersion??If():null,l=Nf({files:s,inventory:o,dryRun:r.dryRun,origin:r.origin,renameLedger:zn?null:js(),exportDeprecations:zn?[]:n??zs(),compatibilityContext:t,lyraVersion:a,reportPath:r.report?Ee.resolve(r.report):null,collectDiff:r.diff}),u=r.diff?console.error:console.log;r.diff&&process.stdout.write(l.diff),i&&u(a===null?"No installed @aceshooting/lyra-ui found under the working directory; applying every entry of the profile.":`Applying entries available in @aceshooting/lyra-ui ${a}`+(l.summary.skipped?`; ${l.summary.skipped} entr${l.summary.skipped===1?"y needs":"ies need"} a later release.`:"."));for(let m of l.changes)u(`${m.file}:${m.line}:${m.column} ${m.action}: ${m.message}`);for(let m of l.warnings)u(`${m.file}:${m.line}:${m.column} warning ${m.warningCode}: ${m.message}`);if(u(`${l.filesScanned} file(s) scanned, ${l.filesChanged} changed, ${l.summary.rewrites} rewrite(s), ${l.summary.warnings} warning(s)`+(Object.hasOwn(l.summary,"acknowledged")?`, ${l.summary.acknowledged} acknowledged.`:".")),r.dryRun&&l.filesChanged&&u("Dry run only -- no source files were written."),r.report&&u(`JSON report written to ${r.report}.`),r.check){let m=l.filesChanged>0||l.summary.warnings>0;return u(m?`Migration check failed: ${l.filesChanged} file(s) need changes and ${l.summary.warnings} warning(s) require review.`:"Migration check passed: no rewrites or warnings remain."),m?1:0}return 0}catch(o){return console.error(o instanceof Error?o.message:o),1}}c(is,"run");function zf(){let e=process.argv[1];if(!e)return!1;let t=_l(import.meta.url);try{return _e.realpathSync(e)===_e.realpathSync(t)}catch{return Ee.resolve(e)===t}}c(zf,"invokedAsCli");async function Pf(){let{readCurrentCompatibilityContext:e}=await Al().then(()=>Rl),{readComponentMetadataSources:t,assembleComponentMetadata:n}=await Promise.resolve().then(()=>(Co(),Bc)),r=Ee.resolve(Ee.dirname(_l(import.meta.url)),"..");return{compatibilityContext:await e(r),currentExportDeprecations:n(t(r)).exportDeprecations}}c(Pf,"prepareContributorContext");async function Lf(e,{prepareContext:t=Pf}={}){if(zn)return is(e);let n;try{n=Cl(e)}catch{return is(e)}return n.help||!n.targets.length||n.rule!==null?is(e):is(e,await t())}c(Lf,"runCli");zf()&&(process.exitCode=await Lf(process.argv.slice(2)));export{Sr as MIGRATION_ORIGINS,Xo as MIGRATION_REPORT_SCHEMA_VERSION,Qo as MIGRATION_RULES,Er as MIGRATION_RUNTIME_SCHEMA_VERSION,kr as buildMigrationContract,rp as buildMirrorMap,jf as collectFiles,np as createMigrationRuntimeInventory,If as detectInstalledLyraVersion,Nf as migrateFiles,yo as migrateImmutableCollections,Tf as migrateRuleFiles,pn as migrateText,Gs as migrateThemeScopes,Cl as parseArgs,zs as readExportDeprecations,js as readRenameLedger,is as run,Lf as runCli,Yi as scanUnrewrittenUpstreamReferences,Il as unifiedDiff};