import{n as e}from"./rolldown-runtime-Czos8NxU.js";import{_ as t,d as n,f as r,g as i,h as a,m as o,n as s,p as c,s as l,t as u,v as d}from"./chunk-FPAJGGOC-lJdDka4i.js";function f(e){let t=e.validation.TreemapValidator,n=e.validation.ValidationRegistry;if(n){let e={Treemap:t.checkSingleRoot.bind(t)};n.register(e,t)}}function p(e=a){let r=i(d(e),l),o=i(t({shared:r}),n,v);return r.ServiceRegistry.register(o),f(o),{shared:r,Treemap:o}}var m,h,g,_,v,y=e((()=>{c(),o(),m=class extends u{static{r(this,`TreemapTokenBuilder`)}constructor(){super([`treemap`])}},h=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,g=class extends s{static{r(this,`TreemapValueConverter`)}runCustomConverter(e,t,n){if(e.name===`NUMBER2`)return parseFloat(t.replace(/,/g,``));if(e.name===`SEPARATOR`||e.name===`STRING2`)return t.substring(1,t.length-1);if(e.name===`INDENTATION`)return t.length;if(e.name===`ClassDef`){if(typeof t!=`string`)return t;let e=h.exec(t);if(e)return{$type:`ClassDefStatement`,className:e[1],styleText:e[2]||void 0}}}},r(f,`registerValidationChecks`),_=class{static{r(this,`TreemapValidator`)}checkSingleRoot(e,t){let n;for(let r of e.TreemapRows)r.item&&(n===void 0&&r.indent===void 0?n=0:(r.indent===void 0||n!==void 0&&n>=parseInt(r.indent,10))&&t(`error`,`Multiple root nodes are not allowed in a treemap.`,{node:r,property:`item`}))}},v={parser:{TokenBuilder:r(()=>new m,`TokenBuilder`),ValueConverter:r(()=>new g,`ValueConverter`)},validation:{TreemapValidator:r(()=>new _,`TreemapValidator`)}},r(p,`createTreemapServices`)}));export{p as n,y as r,v as t};
//# sourceMappingURL=chunk-FWNWRKHM-B6H7yxyG.js.map