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