import{a as r}from"./asyncComputed-D5HqUDwR.js";import"./jwt-decode.esm-DyyavT6h.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="21098b35-47ea-4e5e-89e4-eda80cee48bf",t._sentryDebugIdIdentifier="sentry-dbid-21098b35-47ea-4e5e-89e4-eda80cee48bf")}catch{}})();class o{async check(){return(await fetch("/_editor/api/linters/check")).json()}async fix(e,s){const n=await fetch(`/_editor/api/linters/fix/${e}/${s}`,{method:"POST"});if(!n.ok)throw new Error("Failed to fix");return a.refetch(),n.json()}}const i=new o,a=r(async()=>(await i.check()).map(e=>new u(e)));class c{name;label;ruleName;constructor(e,s){this.name=e.name,this.label=e.label,this.ruleName=s}async fix(){await i.fix(this.ruleName,this.name)}}class l{constructor(e,s){this.ruleName=s,this.label=e.label,this.fixes=e.fixes.map(n=>new c(n,s))}label;fixes}class u{name;label;type;issues;constructor(e){this.name=e.name,this.label=e.label,this.type=e.type,this.issues=e.issues.map(s=>new l(s,this.name))}static get asyncComputed(){return a}static fromName(e){const s=a.result.value?.find(n=>n.name===e);if(!s)throw new Error(`Rule ${e} not found`);return s}}export{u as L};
//# sourceMappingURL=linters-xND8Zwy-.js.map
