@aceshooting/lyra-ui 33.0.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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){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.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"),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.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"),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(`
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
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
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
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(`
@@ -12,7 +12,7 @@ var na=Object.defineProperty;var c=(e,t)=>na(e,"name",{value:t,configurable:!0})
12
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
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
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-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-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","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]===`
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
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
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
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]===`