import{Va as u,Ya as S,a as o,b as m,c,d as s,e as v,f as V,kb as E,lb as p}from"./chunk-RKHDN2Z7.mjs";var i=class extends p{static{o(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}};var g=new Set(["cmd","command"]),M=new Set(["evt","event"]),l=new Set(["rmo","readmodel"]),y=new Set(["pcr","processor"]),h=new Set(["ui"]);function T(t){let e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){let d={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(d,e)}}o(T,"registerValidationChecks");var n=class{static{o(this,"EventModelingValidator")}checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(g.has(e.modelEntityType)?this.validateSources(e,new Set([...h,...y]),"command","ui or processor",r):M.has(e.modelEntityType)?this.validateSources(e,g,"event","command",r):l.has(e.modelEntityType)?this.validateSources(e,M,"read model","event",r):y.has(e.modelEntityType)?this.validateSources(e,l,"processor","read model",r):h.has(e.modelEntityType)&&this.validateSources(e,l,"ui","read model",r))}validateSources(e,r,d,C,f){for(let F of e.sourceFrames){let a=F.ref;a!==void 0&&!r.has(a.modelEntityType)&&f("error",`A ${d} can only receive input from a ${C}, not from '${a.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}};var k={parser:{TokenBuilder:o(()=>new i,"TokenBuilder"),ValueConverter:o(()=>new E,"ValueConverter")},validation:{EventModelingValidator:o(()=>new n,"EventModelingValidator")}};function B(t=v){let e=s(c(t),u),r=s(m({shared:e}),S,k);return e.ServiceRegistry.register(r),T(r),{shared:e,EventModel:r}}o(B,"createEventModelingServices");export{k as a,B as b};
