@elyx-code/project-logic-tree 0.0.6127 → 0.0.6128

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.
package/dist/index.js CHANGED
@@ -26707,16 +26707,14 @@ d(ce, "MUTABLE_META_PROPERTIES", [
26707
26707
  ...ce.MUTABLE_META_PROPERTIES,
26708
26708
  ...ce.INMUTABLE_META_PROPERTIES
26709
26709
  ]), // Properties pointing to nested entities that are declared before the entity itself
26710
- d(ce, "MUTABLE_UPSTREAM_PROPERTIES", [
26711
- "entity",
26712
- "andChildrenGroup",
26713
- "orChildrenGroup",
26714
- "parent"
26715
- ]), d(ce, "INMUTABLE_UPSTREAM_PROPERTIES", []), d(ce, "UPSTREAM_PROPERTIES", [
26710
+ d(ce, "MUTABLE_UPSTREAM_PROPERTIES", ["entity", "parent"]), d(ce, "INMUTABLE_UPSTREAM_PROPERTIES", []), d(ce, "UPSTREAM_PROPERTIES", [
26716
26711
  ...ce.MUTABLE_UPSTREAM_PROPERTIES,
26717
26712
  ...ce.INMUTABLE_UPSTREAM_PROPERTIES
26718
26713
  ]), // Properties pointing to nested entities that are declared after the entity itself or are direct children
26719
- d(ce, "MUTABLE_DOWNSTREAM_PROPERTIES", []), d(ce, "INMUTABLE_DOWNSTREAM_PROPERTIES", []), d(ce, "DOWNSTREAM_PROPERTIES", [
26714
+ d(ce, "MUTABLE_DOWNSTREAM_PROPERTIES", []), d(ce, "INMUTABLE_DOWNSTREAM_PROPERTIES", [
26715
+ "andChildrenGroup",
26716
+ "orChildrenGroup"
26717
+ ]), d(ce, "DOWNSTREAM_PROPERTIES", [
26720
26718
  ...ce.MUTABLE_DOWNSTREAM_PROPERTIES,
26721
26719
  ...ce.INMUTABLE_DOWNSTREAM_PROPERTIES
26722
26720
  ]), d(ce, "PROPERTIES", [
@@ -45867,6 +45865,7 @@ function _2(r, e = /* @__PURE__ */ new Set(), t = {
45867
45865
  r,
45868
45866
  ...r.inputs.flatMap((n) => P(n, e, t)),
45869
45867
  ...r.outputs.flatMap((n) => P(n, e, t)),
45868
+ ...r.error ? P(r.error, e, t) : [],
45870
45869
  ...r.parent ? P(r.parent, e, t) : []
45871
45870
  ];
45872
45871
  }
@@ -57,7 +57,7 @@ ${dr}`,issue:null}))}}}const o=n.parent&&t.get(n.parent)||t.getBuiltIn(n.parent)
57
57
  The entitities of type '${q(h,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property so no 'parentRelationType' is needed.`,issue:null})),o.dataType)){const f=(p=o.dataType)==null?void 0:p.id;a.push(new g({id:`${e.id}--${T.NewEntityWouldOverriteExisting}`,code:T.NewEntityWouldOverriteExisting,severity:E.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot be added as a child to the entity with id '${n.parent}' and type '${u}', because it already has a 'data-type' child with id '${f}'.
58
58
  The entitities of type '${q(h,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property. You can inspect the existing data-type entity with the 'describe_entity' action. Like so:
59
59
  ${bn({describe_entity:f})}
60
- Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}u===i.DataType&&(!n.parentRelationType||!(n.parentRelationType===et.AndDataTypeGroup||n.parentRelationType===et.OrDataTypeGroup))&&a.push(new g({id:`${e.id}--${T.InvalidParentRelationType}`,code:T.InvalidParentRelationType,severity:E.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'or-data-type-group' or 'and-data-type-group' when being added as a child to an entity of type 'data-type'.`,issue:null}))}return{errors:a,modifiedData:n}}get isGroup(){const e=[...this.andChildrenGroup||[],...this.orChildrenGroup||[]];if(e.length>1){let t=0;for(const n of e)if(n.isResolved&&(t++,t>1))return!0}return!1}get isResolved(){return[i.BuiltInBaseEntity,i.ActionDescriptor].includes(this.parent.type)||pr(this.parent)?!0:!(!this.entity&&!this.isGroup)}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}hydrateAncestors(){const e=[],t=[],n=[];if(this.initialData.parent){const a=A(this.initialData.parent),s=this.project.get(a);s&&(this.setParent(s),e.push(s))}if(this.initialData.entity){const a=A(this.initialData.entity),s=this.project.get(a);s&&(s.type===i.DefinitionEntity&&s.parent===this||(this.setEntity(s),e.push(s)))}return{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];return this.initialized=!0,{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent.type===i.DataType?this.parentRelationType===et.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===et.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.setDataType(this),e.push(this.parent),{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(n=>n.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(n=>n.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){var e,t;if(this.initialized)return this;if(this.initialized=!0,this.initialData.entity)if(this.initialData.entity.type===i.GenericReference){const n=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=n}else this.entity=b(this.initialData.entity,this.project),((t=(e=this.initialData.entity)==null?void 0:e.parent)==null?void 0:t.id)===this.id&&this.entity.setParent(this),this.entity.type===i.DefinitionEntity&&this.entity.initChildren();return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a})),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a})),this.afterAllChildrenInitialized(),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,this.isList=e.isList!==void 0?e.isList:this.isList,this.inferred=e.inferred!==void 0?e.inferred:this.inferred,this.like=e.like!==void 0?e.like:this.like,this.asType=e.asType!==void 0?e.asType:this.asType,this.implementationChooseOne=e.implementationChooseOne!==void 0?e.implementationChooseOne:this.implementationChooseOne,this}async load(e=V,...t){return await pe.repository.load(this.id,...t),this}async create(e=V,...t){return await pe.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await pe.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await pe.repository.delete(this.id,...t),this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const n=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(!e){this.parent.type===i.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===i.DataType){if(this.parentRelationType===et.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===et.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else this.parent.removeDataType();n.push(s)}return{affected:m(n),removed:m(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent===this){const{affected:n}=this.entity.restore({seenEntities:e});t.push(...n)}if(this.parent.type===i.DataType){const n=this.parent;Array.isArray(n.andChildrenGroup)&&n.andChildrenGroup.push(this)}if(this.parent.type===i.DataType){const n=this.parent;this.parentRelationType===et.AndDataTypeGroup?Array.isArray(n.andChildrenGroup)&&n.andChildrenGroup.push(this):this.parentRelationType===et.OrDataTypeGroup&&Array.isArray(n.orChildrenGroup)&&n.orChildrenGroup.push(this)}else{const n=this.parent;n.setDataType(this),t.push(n)}return{affected:t,self:this}}toFlat(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.andChildrenGroup)==null?void 0:n.flatMap(o=>o.toFlat(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlat(e)))||[],...((s=this.entity)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.andChildrenGroup)==null?void 0:n.flatMap(o=>o.toFlatIds(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatIds(e)))||[],...((s=this.entity)==null?void 0:s.toFlatIds(e))||[]])}toJSON(e=new Set){var t,n,a,s;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,options:this.options,isList:this.isList,asType:this.asType,like:this.like,inferred:this.inferred,parentRelationType:this.parentRelationType,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(o=>o.toJSON(e)))||null,orChildrenGroup:((n=this.orChildrenGroup)==null?void 0:n.map(o=>o.toJSON(e)))||null,entity:((a=this.entity)==null?void 0:a.parent)===this?this.entity.toJSON(e):((s=this.entity)==null?void 0:s.toReference())||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p,u,h,f;let t;return(n=e.seenEntityMaps)!=null&&n.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||Ye(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(s=e.seenEntities)!=null&&s.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:this.version,type:this.type,options:this.options,isList:this.isList,asType:this.asType,like:this.like,inferred:this.inferred,parentRelationType:this.parentRelationType,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:((p=this.andChildrenGroup)==null?void 0:p.map(R=>R.toJSONClone({...e,newId:null})))||null,orChildrenGroup:((u=this.orChildrenGroup)==null?void 0:u.map(R=>R.toJSONClone({...e,newId:null})))||null,entity:((h=this.entity)==null?void 0:h.parent)===this?this.entity.toJSONClone({...e,newId:null}):((f=this.entity)==null?void 0:f.toReference({seenEntityMaps:e.seenEntityMaps}))||null,parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n,a,s,o;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,type:this.type,isList:this.isList,options:this.options,asType:this.asType,parentRelationType:this.parentRelationType,like:this.like,inferred:this.inferred,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:((a=this.andChildrenGroup)==null?void 0:a.map(l=>l.toReference(e)))||null,orChildrenGroup:((s=this.orChildrenGroup)==null?void 0:s.map(l=>l.toReference(e)))||null,entity:((o=this.entity)==null?void 0:o.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.andChildrenGroup)==null?void 0:n.flatMap(o=>o.toFlatJSON(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatJSON(e)))||[],...((s=this.entity)==null?void 0:s.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,options:this.options,isList:this.isList,like:this.like,parentRelationType:this.parentRelationType,asType:this.asType,entity:((e=this.entity)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.andChildrenGroup)==null?void 0:n.flatMap(s=>s.toFlatGenerationTarget(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(s=>s.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==i.DefinitionEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,n;return this.errors=[],(e=this.andChildrenGroup)==null||e.forEach(a=>a.clearErrors()),(t=this.orChildrenGroup)==null||t.forEach(a=>a.clearErrors()),this.inferred&&((n=this.entity)==null||n.clearErrors()),this}validate(){const e=M7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var v,I,D;let a=He(e,this),s=e||this.parent;const o=t||de(Ka(this),i.DataType,a),l=o.split("-id"),p=l[l.length-1||0]||o,u={id:o,version:1,type:i.DataType,isList:this.isList,asType:this.asType,options:this.options,parentRelationType:this.parentRelationType,like:this.like,inferred:this.inferred,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:null,orChildrenGroup:null,entity:null,parent:s.toReference()},h=ke(u,a);e&&h.setParent(e),n&&h.subscribe(),h.initChildren();const f=(v=this.andChildrenGroup)==null?void 0:v.map((S,$)=>S.clone(h,p+"-and-group-data-type-"+$+"-id",n)),R=(I=this.orChildrenGroup)==null?void 0:I.map((S,$)=>S.clone(h,p+"-or-group-data-type-"+$+"-id",n));if(h.andChildrenGroup=f||null,h.orChildrenGroup=R||null,this.entity&&this.entity.type===i.DefinitionEntity&&((D=this.entity)==null?void 0:D.parent)===this){const S=this.entity.clone(h,p+"-inferred-entity-id",n);h.setEntity(S)}else this.entity&&h.setEntity(this.entity);return h}merge(e){const t=[],n=[],a=[];if(this.asType!==(e==null?void 0:e.asType)&&(this.sync({asType:e==null?void 0:e.asType}),t.push(this)),this.isList!==!(e!=null&&e.isList)&&(this.sync({isList:e==null?void 0:e.isList}),t.push(this)),this.like!==(e==null?void 0:e.like)&&(this.sync({like:e==null?void 0:e.like}),t.push(this)),e!=null&&e.inferred){if(e.entity&&e.entity.type===i.DefinitionEntity&&e.entity.parent===e){const s=e.entity.clone(this,this.id+"--"+M.UUID.uuid()+"--inferred-entity-id",!0);this.setEntity(s),n.push(s)}else e.entity&&(this.setEntity(e.entity),t.push(this));this.inferred||(this.sync({inferred:!0}),t.push(this))}else if(this.inferred){if(this.sync({inferred:!1}),t.push(this),this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:new Set});a.push(...o),s.push(...s)}e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this))}else e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this));return{updated:m(t),added:m(n),removed:m(a),self:this}}addToAndGroup(e){return this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(e)||this.andChildrenGroup.push(e),this}addToOrGroup(e){return this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(e)||this.orChildrenGroup.push(e),this}setEntity(e){return this.entity=e,this}isObject(){return!!this.entity&&(this.entity.type===i.DefinitionEntity||this.entity.name===C.KeyValue)}hasStrictObjectStructure(){var e;return this.isObject()&&((e=this.entity)==null?void 0:e.type)===i.DefinitionEntity}inferFromInputs(e){var t;if(!this.inferred)return this;if(!this.entity&&e.length){const n={id:this.id+"--"+M.UUID.uuid()+"--infered-entity",type:i.DefinitionEntity,version:1,name:w(this.parent,this.project)+" data type definition",description:((t=this.parent)==null?void 0:t.description)||null,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:this.toReference()},a=b(n,this.project);a.setParent(this),a.initChildren(),a.sync(n),this.setEntity(a)}return this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent!==this&&this.entity.setParent(this),this.entity&&this.entity.inferFromInputs(e),this.like||this.sync({like:!0}),this}};c(pe,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(pe,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType","like"]),c(pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"inferred"]),c(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),c(pe,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),c(pe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),c(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let ki=pe;function V7(r){var l;const e=Z6(),t=r.toJSON();e.safeParse(t).success;const a=N7(r),s=kn(r),o=[...a,...s];if(r.id==="exec-sequentially-operation-call-id"){const p=Q({id:`${r.id}--${G.PropertyImplementsNonAbstact}`,message:`Property "${w(r,r.project)}" with id "${r.id}" implements a non-abstract property "${w(r,r.project)}" with id "${r.id}".`,issue:null,severity:E.Error,code:G.PropertyImplementsNonAbstact,entity:r});o.push(p.error)}return r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate(),Be(r.errors,o)}function N7(r){const e=[];return r.inputs.forEach(t=>{t.validate()}),Be(r.errors,e)}const ye=class ye{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Operation);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let n=t;if(e.parent){const f=A(e.parent);n=t.get(f)}const a=A(e.declaration),s=t.get(a),o=e.calledByEntry.map(f=>{const R=A(f);return t.get(R)}),l=e.calledBySuccess.map(f=>{const R=A(f);return t.get(R)}),p=e.calledByError.map(f=>{const R=A(f);return t.get(R)}),u={id:e.id,version:1,type:i.Operation,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:n},h=b(u,t);return h.setParent(n),h.initChildren(),h}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[...pt,i.Project],optional:!0}},t);n=s.modifiedData,a.push(...s.errors,...je(n));const o=A(n.declaration);if(o){const l=AS(o,t);a.push(...l)}else{const l=`
60
+ Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}u===i.DataType&&(!n.parentRelationType||!(n.parentRelationType===et.AndDataTypeGroup||n.parentRelationType===et.OrDataTypeGroup))&&a.push(new g({id:`${e.id}--${T.InvalidParentRelationType}`,code:T.InvalidParentRelationType,severity:E.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'or-data-type-group' or 'and-data-type-group' when being added as a child to an entity of type 'data-type'.`,issue:null}))}return{errors:a,modifiedData:n}}get isGroup(){const e=[...this.andChildrenGroup||[],...this.orChildrenGroup||[]];if(e.length>1){let t=0;for(const n of e)if(n.isResolved&&(t++,t>1))return!0}return!1}get isResolved(){return[i.BuiltInBaseEntity,i.ActionDescriptor].includes(this.parent.type)||pr(this.parent)?!0:!(!this.entity&&!this.isGroup)}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}hydrateAncestors(){const e=[],t=[],n=[];if(this.initialData.parent){const a=A(this.initialData.parent),s=this.project.get(a);s&&(this.setParent(s),e.push(s))}if(this.initialData.entity){const a=A(this.initialData.entity),s=this.project.get(a);s&&(s.type===i.DefinitionEntity&&s.parent===this||(this.setEntity(s),e.push(s)))}return{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];return this.initialized=!0,{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent.type===i.DataType?this.parentRelationType===et.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===et.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.setDataType(this),e.push(this.parent),{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(n=>n.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(n=>n.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){var e,t;if(this.initialized)return this;if(this.initialized=!0,this.initialData.entity)if(this.initialData.entity.type===i.GenericReference){const n=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=n}else this.entity=b(this.initialData.entity,this.project),((t=(e=this.initialData.entity)==null?void 0:e.parent)==null?void 0:t.id)===this.id&&this.entity.setParent(this),this.entity.type===i.DefinitionEntity&&this.entity.initChildren();return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a})),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a})),this.afterAllChildrenInitialized(),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,this.isList=e.isList!==void 0?e.isList:this.isList,this.inferred=e.inferred!==void 0?e.inferred:this.inferred,this.like=e.like!==void 0?e.like:this.like,this.asType=e.asType!==void 0?e.asType:this.asType,this.implementationChooseOne=e.implementationChooseOne!==void 0?e.implementationChooseOne:this.implementationChooseOne,this}async load(e=V,...t){return await pe.repository.load(this.id,...t),this}async create(e=V,...t){return await pe.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await pe.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await pe.repository.delete(this.id,...t),this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const n=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(!e){this.parent.type===i.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===i.DataType){if(this.parentRelationType===et.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===et.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else this.parent.removeDataType();n.push(s)}return{affected:m(n),removed:m(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent===this){const{affected:n}=this.entity.restore({seenEntities:e});t.push(...n)}if(this.parent.type===i.DataType){const n=this.parent;Array.isArray(n.andChildrenGroup)&&n.andChildrenGroup.push(this)}if(this.parent.type===i.DataType){const n=this.parent;this.parentRelationType===et.AndDataTypeGroup?Array.isArray(n.andChildrenGroup)&&n.andChildrenGroup.push(this):this.parentRelationType===et.OrDataTypeGroup&&Array.isArray(n.orChildrenGroup)&&n.orChildrenGroup.push(this)}else{const n=this.parent;n.setDataType(this),t.push(n)}return{affected:t,self:this}}toFlat(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.andChildrenGroup)==null?void 0:n.flatMap(o=>o.toFlat(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlat(e)))||[],...((s=this.entity)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.andChildrenGroup)==null?void 0:n.flatMap(o=>o.toFlatIds(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatIds(e)))||[],...((s=this.entity)==null?void 0:s.toFlatIds(e))||[]])}toJSON(e=new Set){var t,n,a,s;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,options:this.options,isList:this.isList,asType:this.asType,like:this.like,inferred:this.inferred,parentRelationType:this.parentRelationType,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(o=>o.toJSON(e)))||null,orChildrenGroup:((n=this.orChildrenGroup)==null?void 0:n.map(o=>o.toJSON(e)))||null,entity:((a=this.entity)==null?void 0:a.parent)===this?this.entity.toJSON(e):((s=this.entity)==null?void 0:s.toReference())||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p,u,h,f;let t;return(n=e.seenEntityMaps)!=null&&n.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||Ye(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(s=e.seenEntities)!=null&&s.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:this.version,type:this.type,options:this.options,isList:this.isList,asType:this.asType,like:this.like,inferred:this.inferred,parentRelationType:this.parentRelationType,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:((p=this.andChildrenGroup)==null?void 0:p.map(R=>R.toJSONClone({...e,newId:null})))||null,orChildrenGroup:((u=this.orChildrenGroup)==null?void 0:u.map(R=>R.toJSONClone({...e,newId:null})))||null,entity:((h=this.entity)==null?void 0:h.parent)===this?this.entity.toJSONClone({...e,newId:null}):((f=this.entity)==null?void 0:f.toReference({seenEntityMaps:e.seenEntityMaps}))||null,parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n,a,s,o;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,type:this.type,isList:this.isList,options:this.options,asType:this.asType,parentRelationType:this.parentRelationType,like:this.like,inferred:this.inferred,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:((a=this.andChildrenGroup)==null?void 0:a.map(l=>l.toReference(e)))||null,orChildrenGroup:((s=this.orChildrenGroup)==null?void 0:s.map(l=>l.toReference(e)))||null,entity:((o=this.entity)==null?void 0:o.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.andChildrenGroup)==null?void 0:n.flatMap(o=>o.toFlatJSON(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatJSON(e)))||[],...((s=this.entity)==null?void 0:s.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,options:this.options,isList:this.isList,like:this.like,parentRelationType:this.parentRelationType,asType:this.asType,entity:((e=this.entity)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.andChildrenGroup)==null?void 0:n.flatMap(s=>s.toFlatGenerationTarget(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(s=>s.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==i.DefinitionEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,n;return this.errors=[],(e=this.andChildrenGroup)==null||e.forEach(a=>a.clearErrors()),(t=this.orChildrenGroup)==null||t.forEach(a=>a.clearErrors()),this.inferred&&((n=this.entity)==null||n.clearErrors()),this}validate(){const e=M7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var v,I,D;let a=He(e,this),s=e||this.parent;const o=t||de(Ka(this),i.DataType,a),l=o.split("-id"),p=l[l.length-1||0]||o,u={id:o,version:1,type:i.DataType,isList:this.isList,asType:this.asType,options:this.options,parentRelationType:this.parentRelationType,like:this.like,inferred:this.inferred,implementationChooseOne:this.implementationChooseOne,andChildrenGroup:null,orChildrenGroup:null,entity:null,parent:s.toReference()},h=ke(u,a);e&&h.setParent(e),n&&h.subscribe(),h.initChildren();const f=(v=this.andChildrenGroup)==null?void 0:v.map((S,$)=>S.clone(h,p+"-and-group-data-type-"+$+"-id",n)),R=(I=this.orChildrenGroup)==null?void 0:I.map((S,$)=>S.clone(h,p+"-or-group-data-type-"+$+"-id",n));if(h.andChildrenGroup=f||null,h.orChildrenGroup=R||null,this.entity&&this.entity.type===i.DefinitionEntity&&((D=this.entity)==null?void 0:D.parent)===this){const S=this.entity.clone(h,p+"-inferred-entity-id",n);h.setEntity(S)}else this.entity&&h.setEntity(this.entity);return h}merge(e){const t=[],n=[],a=[];if(this.asType!==(e==null?void 0:e.asType)&&(this.sync({asType:e==null?void 0:e.asType}),t.push(this)),this.isList!==!(e!=null&&e.isList)&&(this.sync({isList:e==null?void 0:e.isList}),t.push(this)),this.like!==(e==null?void 0:e.like)&&(this.sync({like:e==null?void 0:e.like}),t.push(this)),e!=null&&e.inferred){if(e.entity&&e.entity.type===i.DefinitionEntity&&e.entity.parent===e){const s=e.entity.clone(this,this.id+"--"+M.UUID.uuid()+"--inferred-entity-id",!0);this.setEntity(s),n.push(s)}else e.entity&&(this.setEntity(e.entity),t.push(this));this.inferred||(this.sync({inferred:!0}),t.push(this))}else if(this.inferred){if(this.sync({inferred:!1}),t.push(this),this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:new Set});a.push(...o),s.push(...s)}e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this))}else e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this));return{updated:m(t),added:m(n),removed:m(a),self:this}}addToAndGroup(e){return this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(e)||this.andChildrenGroup.push(e),this}addToOrGroup(e){return this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(e)||this.orChildrenGroup.push(e),this}setEntity(e){return this.entity=e,this}isObject(){return!!this.entity&&(this.entity.type===i.DefinitionEntity||this.entity.name===C.KeyValue)}hasStrictObjectStructure(){var e;return this.isObject()&&((e=this.entity)==null?void 0:e.type)===i.DefinitionEntity}inferFromInputs(e){var t;if(!this.inferred)return this;if(!this.entity&&e.length){const n={id:this.id+"--"+M.UUID.uuid()+"--infered-entity",type:i.DefinitionEntity,version:1,name:w(this.parent,this.project)+" data type definition",description:((t=this.parent)==null?void 0:t.description)||null,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:this.toReference()},a=b(n,this.project);a.setParent(this),a.initChildren(),a.sync(n),this.setEntity(a)}return this.entity&&this.entity.type===i.DefinitionEntity&&this.entity.parent!==this&&this.entity.setParent(this),this.entity&&this.entity.inferFromInputs(e),this.like||this.sync({like:!0}),this}};c(pe,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(pe,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType","like"]),c(pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"inferred"]),c(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),c(pe,"MUTABLE_UPSTREAM_PROPERTIES",["entity","parent"]),c(pe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),c(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",["andChildrenGroup","orChildrenGroup"]),c(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let ki=pe;function V7(r){var l;const e=Z6(),t=r.toJSON();e.safeParse(t).success;const a=N7(r),s=kn(r),o=[...a,...s];if(r.id==="exec-sequentially-operation-call-id"){const p=Q({id:`${r.id}--${G.PropertyImplementsNonAbstact}`,message:`Property "${w(r,r.project)}" with id "${r.id}" implements a non-abstract property "${w(r,r.project)}" with id "${r.id}".`,issue:null,severity:E.Error,code:G.PropertyImplementsNonAbstact,entity:r});o.push(p.error)}return r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate(),Be(r.errors,o)}function N7(r){const e=[];return r.inputs.forEach(t=>{t.validate()}),Be(r.errors,e)}const ye=class ye{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Operation);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let n=t;if(e.parent){const f=A(e.parent);n=t.get(f)}const a=A(e.declaration),s=t.get(a),o=e.calledByEntry.map(f=>{const R=A(f);return t.get(R)}),l=e.calledBySuccess.map(f=>{const R=A(f);return t.get(R)}),p=e.calledByError.map(f=>{const R=A(f);return t.get(R)}),u={id:e.id,version:1,type:i.Operation,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:n},h=b(u,t);return h.setParent(n),h.initChildren(),h}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[...pt,i.Project],optional:!0}},t);n=s.modifiedData,a.push(...s.errors,...je(n));const o=A(n.declaration);if(o){const l=AS(o,t);a.push(...l)}else{const l=`
61
61
  All built-in 'action-descriptor' entity ids are:
62
62
  - ${t.operationDeclarations.map(p=>`${p.id} (${w(p,t)})`).join(`
63
63
  - `)}.
@@ -400,7 +400,7 @@ All global 'function-declaration' entity ids are:
400
400
  The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities.`;a.push(new g({id:`${n.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${i.FunctionCall}" with id "${n.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'function-declaration' entity.
401
401
  References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${l}`,issue:null}))}return{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new g({id:`${this.id}--${T.InvalidParentUpdate}`,code:T.InvalidParentUpdate,severity:E.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
402
402
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
403
- You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}hydrateAncestors(){const e=[],t=[],n=[];if(this.initialData.parent){const a=A(this.initialData.parent),s=this.project.get(a);s&&(this.setParent(s),e.push(s))}if(this.initialData.declaration){const a=A(this.initialData.declaration),s=this.project.get(a);s&&(this.setDeclaration(s),e.push(s))}return this.initialData.calledByEntry.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addEntryCaller(o),e.push(o))}),this.initialData.calledBySuccess.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addSuccessCaller(o),e.push(o))}),this.initialData.calledByError.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addErrorCaller(o),e.push(o))}),{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];this.initialized=!0;const{updated:a,added:s,removed:o}=this.syncMissingFixedInputs(),{updated:l,added:p,removed:u}=this.syncMissingFixedOutputs();return e.push(...a,...l),t.push(...s,...p),n.push(...o,...u),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){var a;const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addFunctionCall(this),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:m(e),added:m(t),removed:m(n),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(n=>n.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(n=>n.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.find(t=>t.id===e.id)||this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.find(t=>t.id===e.id)||this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const n=this.errorCalls.findIndex(a=>a.id===e.id);return n>-1&&this.errorCalls.splice(n,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===i.FunctionDeclaration){const e=b(this.initialData.declaration,this.project);this.declaration=e}else{const e=A(this.initialData.declaration),t=this.project.get(e);this.declaration=t}return this.successCalls=this.initialData.successCalls.map(e=>{const t=b(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=b(e,this.project);return t.addErrorCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=b(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.error&&(this.error=b(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.afterAllChildrenInitialized(),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(e=V,...t){return await we.repository.load(this.id,...t),this}async create(e=V,...t){return await we.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await we.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await we.repository.delete(this.id,...t),this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const n=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});n.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});n.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{n.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{n.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{n.push(o),o.removeCall(this)}),{affected:m(n),removed:m(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:n}=this.process.restore({seenEntities:e});t.push(...n)}return this.inputs.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(n=>{t.push(n),n.addSuccessCaller(this)}),this.errorCalls.forEach(n=>{t.push(n),n.addErrorCaller(this)}),this.calledBySuccess.forEach(n=>{t.push(n),n.addSuccessCall(this)}),this.calledByError.forEach(n=>{t.push(n),n.addErrorCall(this)}),this.calledByEntry.forEach(n=>{t.push(n),n.addCall(this)}),{affected:m(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(n=>n.toFlat(e)),...this.errorCalls.flatMap(n=>n.toFlat(e)),...this.inputs.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[],...this.calledBy.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(n=>n.toFlatIds(e)),...this.errorCalls.flatMap(n=>n.toFlatIds(e)),...this.inputs.flatMap(n=>n.toFlatIds(e)),...this.outputs.flatMap(n=>n.toFlatIds(e))])}toJSON(e=new Set){var t,n;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(a=>a.toJSON(e)),errorCalls:this.errorCalls.map(a=>a.toJSON(e)),calledBySuccess:this.calledBySuccess.map(a=>a.toReference()),calledByError:this.calledByError.map(a=>a.toReference()),calledByEntry:this.calledByEntry.map(a=>a.toReference()),process:(t=this.process)==null?void 0:t.toJSON(e),declaration:this.declaration.toJSON(e),inputs:this.inputs.map(a=>a.toJSON(e)),outputs:this.outputs.map(a=>a.toJSON(e)),parent:this.parent.toReference(),error:(n=this.error)==null?void 0:n.toJSON(e)})}toJSONClone(e=L){var n,a,s,o,l,p,u;let t;return(n=e.seenEntityMaps)!=null&&n.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||Ye(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(s=e.seenEntities)!=null&&s.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(h=>h.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(h=>h.toJSONClone({...e,newId:null})),calledBySuccess:this.calledBySuccess.map(h=>h.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(h=>h.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(h=>h.toReference({seenEntityMaps:e.seenEntityMaps})),process:(p=this.process)==null?void 0:p.toJSONClone({...e,newId:null}),declaration:this.declaration.toJSONClone({...e,newId:null}),inputs:this.inputs.map(h=>h.toJSONClone({...e,newId:null})),outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),error:(u=this.error)==null?void 0:u.toJSONClone({...e,newId:null}),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference(e):null,inputs:this.inputs.map(a=>a.toReference(e)),outputs:this.outputs.map(a=>a.toReference(e)),declaration:this.declaration.toReference(e),successCalls:this.successCalls.map(a=>a.toReference(e)),errorCalls:this.errorCalls.map(a=>a.toReference(e)),calledBySuccess:this.calledBySuccess.map(a=>a.toReference(e)),calledByError:this.calledByError.map(a=>a.toReference(e)),calledByEntry:this.calledByEntry.map(a=>a.toReference(e)),error:this.error?this.error.toReference(e):null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(n=>n.toFlatJSON(e)),...this.errorCalls.flatMap(n=>n.toFlatJSON(e)),...this.inputs.flatMap(n=>n.toFlatJSON(e)),...this.outputs.flatMap(n=>n.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,version:this.version,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(n=>n.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(n=>n.toFlatGenerationTarget(e)),...this.inputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(n=>n.clearErrors()),this.outputs.forEach(n=>n.clearErrors()),this.successCalls.forEach(n=>n.clearErrors()),this.errorCalls.forEach(n=>n.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=Eq(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var R,v;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.FunctionCall,a);s.inputs=[];const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const u=ke(s,a);e?u.setParent(e):u.setParent(this.parent),n&&u.subscribe(),u.initChildren();const h=(R=this.inputs)==null?void 0:R.map((I,D)=>I.clone(u,p+"-input-map-"+D+"-id",n));u.inputs=h;const f=(v=this.outputs)==null?void 0:v.map((I,D)=>I.clone(u,p+"-output-map-"+D+"-id",n));return u.outputs=f,this.error&&(u.error=this.error.clone(u,p+"-error-map-id",n)),this.process&&(u.process=this.process.clone(u,p+"-process-id",n)),u}removeUnrecognizedInputs(){const e=[],t=[],n=[];return this.inputs.forEach(a=>{if(!this.declaration.inputs.find(o=>{var l;return o.id===((l=a.declaration)==null?void 0:l.id)})){const o=a.remove();n.push(...o.removed),e.push(...o.affected)}}),{updated:m(e),added:m(t),removed:m(n),self:this}}removeUnrecognizedOutputs(){const e=[],t=[],n=[];return this.outputs.forEach(a=>{if(!this.declaration.getUniqueReturnDeclarations().find(o=>{var l;return o.id===((l=a.declaration)==null?void 0:l.id)})){const o=a.remove();n.push(...o.removed),e.push(...o.affected)}}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncMissingFixedInputs(){const e=[],t=[],n=[],a=this.declaration.inputs.filter(p=>!this.inputs.find(u=>u.declaration.id===p.id));this.inputs.sort((p,u)=>p.index-u.index),a.forEach(p=>{this.inputs.forEach(f=>{f.index>=p.index&&f.sync({index:f.index+1})});const u={id:M.UUID.uuid(),version:1,type:i.InputMap,declaration:p.toJSON(),readsValue:null,defaultValue:null,index:p.index,name:null,description:null,parent:this.toReference()},h=b(u,this.project);h.setParent(this),h.initChildren(),h.addSelfToProject(),t.push(h)}),this.inputs.sort((p,u)=>p.index-u.index);const{updated:s,added:o,removed:l}=this.removeUnrecognizedInputs();return e.push(...s),t.push(...o),n.push(...l),{updated:m(e),added:m(t),removed:m(n),self:this}}syncMissingFixedOutputs(){const e=[],t=[],n=[],a=[];this.outputs=this.initialData.outputs.map(u=>{const h=b(u,this.project);return a.push(h.index),h.setParent(this),h.initChildren(),h});const s=this.declaration.getUniqueReturnDeclarations().filter(u=>!this.outputs.find(h=>h.declaration.id===u.id));this.outputs.sort((u,h)=>u.index-h.index),s.forEach((u,h)=>{this.outputs.forEach(I=>{I.index>=u.index&&I.index++});const f=a.includes(u.index)?this.outputs.length-1+h:u.index,R={id:M.UUID.uuid(),version:1,type:i.OutputMap,declaration:u.toJSON(),defaultValue:null,writesValues:[],index:f,parent:this.toReference()},v=b(R,this.project);v.setParent(this),v.initChildren(),v.addSelfToProject()}),this.outputs.sort((u,h)=>u.index-h.index);const{updated:o,added:l,removed:p}=this.removeUnrecognizedOutputs();return e.push(...o),t.push(...l),n.push(...p),{updated:m(e),added:m(t),removed:m(n),self:this}}};c(we,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(we,"MUTABLE_BASE_PROPERTIES",[]),c(we,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(we,"BASE_PROPERTIES",[...we.MUTABLE_BASE_PROPERTIES,...we.INMUTABLE_BASE_PROPERTIES]),c(we,"MUTABLE_META_PROPERTIES",["x","y"]),c(we,"INMUTABLE_META_PROPERTIES",[...we.INMUTABLE_BASE_PROPERTIES]),c(we,"META_PROPERTIES",[...we.MUTABLE_META_PROPERTIES,...we.INMUTABLE_META_PROPERTIES]),c(we,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(we,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(we,"UPSTREAM_PROPERTIES",[...we.MUTABLE_UPSTREAM_PROPERTIES,...we.INMUTABLE_UPSTREAM_PROPERTIES]),c(we,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(we,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(we,"DOWNSTREAM_PROPERTIES",[...we.MUTABLE_DOWNSTREAM_PROPERTIES,...we.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(we,"PROPERTIES",[...we.META_PROPERTIES,...we.UPSTREAM_PROPERTIES,...we.DOWNSTREAM_PROPERTIES]);let Xr=we;function zu(r){return r&&typeof r.then=="function"}class Zu{constructor(e){c(this,"order",[]);c(this,"flatRecord",{});c(this,"onGoingVisits",{});this.flatten(e),this.orderEntities()}flatten(e){const t=new Set(np()),n=m(O(e,t,{ignoreBuiltInBaseEntities:!0})),a=new Set;for(const s of n)this.flatRecord[s.id]=s,a.add(s.id);this.order=Array.from(a)}moveEntityAfterDependencies(e){const t=cl(e,this.flatRecord);for(const n of t){const a=this.order.indexOf(n),s=this.order.indexOf(e.id);if(a>s)return this.order.splice(s,1),this.order.splice(a,0,e.id),!0}return!1}orderEntities(){let e=!1;for(let t=0;t<this.order.length;t++){const n=this.order[t],a=this.flatRecord[n];if(this.moveEntityAfterDependencies(a)){e=!0;break}}e&&this.orderEntities()}getUpstreamOngoingDependenciesVisits(e,t){const n=cl(this.flatRecord[e],this.flatRecord),a={};return Object.entries(this.onGoingVisits[t]||{}).forEach(([s,o])=>{Array.from(n).includes(s)&&(a[s]=o)}),a}getDownstreamOngoingDependenciesVisits(e,t){const n=Object.keys(this.onGoingVisits[t]||{}),a=new Set(n.flatMap(o=>Array.from(cl(this.flatRecord[o],this.flatRecord)))),s={};return Array.from(a).forEach(o=>{o===e&&(s[o]=this.onGoingVisits[t][o])}),s}async settlePromises(e,t){const n=Object.values(e);n.length&&await Promise.all(n),Object.keys(e).forEach(a=>{delete this.onGoingVisits[t][a]})}visit(e){const t=this.order;for(const n of t)e(this.flatRecord[n],this.flatRecord);return this}reverseVisit(e){const t=this.order.slice().reverse();for(const n of t)e(this.flatRecord[n],this.flatRecord);return this}async visitAsync(e){const t=this.order,n=Math.random().toString(36).substring(7);this.onGoingVisits[n]={};for(const a of t){const s=this.getUpstreamOngoingDependenciesVisits(a,n);Object.keys(s).length&&await this.settlePromises(s,n);const o=e(this.flatRecord[a],this.flatRecord);zu(o)&&(this.onGoingVisits[n][a]=o)}return await this.settlePromises(this.onGoingVisits[n],n),this.onGoingVisits[n]={},this}async reverseVisitAsync(e){const t=this.order.slice().reverse(),n=Math.random().toString(36).substring(7);this.onGoingVisits[n]={};for(const a of t){const s=this.getDownstreamOngoingDependenciesVisits(a,n);Object.keys(s).length&&await this.settlePromises(s,n);const o=e(this.flatRecord[a],this.flatRecord);zu(o)&&(this.onGoingVisits[n][a]=o)}return await this.settlePromises(this.onGoingVisits[n],n),this.onGoingVisits[n]={},this}}function OS(r){var e;switch(r.id){case _["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const t=r.project.entities.filter(p=>!!p.implements.find(u=>u.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(t.find(p=>!!p.properties.find(u=>{var h;return u.implements&&u.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((h=u.getDefaultValue())==null?void 0:h.value)===!0}))){const u=t[0].properties.find(f=>f.implements&&f.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),h=u==null?void 0:u.defaultValue;if(h)h.value=!0;else if(u!=null&&u.dataType){const f=(e=u==null?void 0:u.dataType)==null?void 0:e.id.split("-id")[0],R=b({id:f+"-default-value-id",version:1,type:i.LiteralValue,name:C.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:u==null?void 0:u.dataType.toReference()},r.project);return R.setParent(u==null?void 0:u.dataType),R.initChildren(),R.addSelfToProject(),{newEntities:[R]}}return{newEntities:[]}}const a=r.project.get(_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),s=al(a,"Main database");if(s.errors.length>0)return{newEntities:[]};const o=s.implemented.properties.find(p=>p.implements&&p.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),l=o==null?void 0:o.defaultValue;if(l)l.value=!0;else if(o!=null&&o.dataType){const p=o==null?void 0:o.dataType.id.split("-id")[0],u=b({id:p+"-default-value-id",version:1,type:i.LiteralValue,name:C.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:o==null?void 0:o.dataType.toReference()},r.project);u.setParent(o==null?void 0:o.dataType),u.initChildren(),u.addSelfToProject()}return{newEntities:[s.implemented]}}}return{newEntities:[]}}function PS(r){return r.implements.filter(t=>t.type===i.BuiltInBaseEntity).map(t=>{switch(t.id){case _["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=r.project.entities.filter(l=>l.implements.find(p=>p.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(l=>!!l.properties.find(p=>{var u;return p.implements&&p.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((u=p.getDefaultValue())==null?void 0:u.value)===!0}));if(!a)return{newEntities:[]};const s=r.properties.find(l=>l.implements&&l.implements.id===_["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id),o=s==null?void 0:s.defaultValue;if(s&&(s!=null&&s.dataType)&&!o){const l=s==null?void 0:s.dataType.id.split("-id")[0],p=b({id:l+"-default-value-id",version:1,type:i.LiteralValue,name:C.EntityTemplate,autogeneration:null,value:null,valueAsType:a,parent:s==null?void 0:s.dataType.toReference()},r.project);return p.setParent(s==null?void 0:s.dataType),p.initChildren(),p.addSelfToProject(),{newEntities:[p]}}return{newEntities:[]}}}}),{newEntities:[]}}function al(r,e,t){const n=t||de(e,i.DefinitionEntity,r.project),a=n.split("-id"),s=a[a.length-1||0]||n,o={id:n,version:1,name:e,type:i.DefinitionEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[r],x:0,y:0,parent:r.project},l=Zo(o,r.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=OS(r),u=b(o,r.project);u.setParent(r.project),u.initChildren();const h=r.properties.map(v=>{const I=s+"-"+de(w(v,r.project),i.Property,r.project),D=v.clone(u,I);return D.abstract=!1,D.implements=v,D.setParent(u),u.addProperty(D),D}),f=r.abstractMethods.map(v=>{const I=s+de(v.name,i.FunctionDeclaration,r.project),D=v.implementAsFunctionDeclaration(I),S={id:I+"-parent-ref-id",type:i.GenericReference,entityId:n,entityType:i.DefinitionEntity},$={...D,implements:v,parent:S},j=b($,r.project);return u.addMethod(j),j.setParent(u),j.initChildren(),j.implements=v,j});o.properties=h,o.methods=f;const R=PS(u);return{implemented:u,errors:[],entitiesChanges:{new:[u,...p.newEntities,...R.newEntities],updated:[u],deleted:[]}}}function Ku(r,e){return e.entities.find(a=>{const s=a.properties,o=s.map(f=>f.name),l=r.every(f=>o.includes(f)),p=o.filter(f=>!r.includes(f)),u=s.every(f=>!p.includes(f.name)||!f.required);return l&&u})||null}function CS(r,e,t=et.OrDataTypeGroup){const n=[],a=[],s=[],l={id:e.id+"--nested-data-type-id-"+r.id,version:1,type:i.DataType,entity:r.toJSON(),isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:t,parent:e.toReference()},p=b(l,r.project);return a.push(p),p.setParent(e),p.initChildren(),p.setEntity(r),p.addSelfToProject(),{updated:m(n),added:m(a),removed:m(s),self:p}}function Xu(r,e,t,n){const a=[],s=[],o=[];switch(typeof r){case"string":let l=!1;const p=new Date(r);if(p instanceof Date&&!isNaN(p.valueOf())&&(l=!0),l){const u=e.project.getBuiltIn(_[i.PrimitiveEntity][C.Date].id);e.setEntity(u);break}else{const u=e.project.getBuiltIn(_[i.PrimitiveEntity][C.String].id);e.setEntity(u);break}case"number":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Number].id));break;case"boolean":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Boolean].id));break;case"object":if(r===null){e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Null].id));break}else if(Array.isArray(r))if(e.sync({isList:!0}),r.length>0){const u=r.slice(0,5).filter(f=>f!==void 0);if(u.every(f=>typeof f==typeof u[0])&&(typeof u[0]!="object"||u[0]===null))switch(typeof u[0]){case"string":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.String].id));break;case"number":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Number].id));break;case"boolean":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Boolean].id));break;case"object":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Null].id));break}else{const f=[];let R=!1;u.forEach((I,D)=>{if(Array.isArray(I)&&(R=!0),typeof I=="object"&&!Array.isArray(I)&&I!==null){const S=sl(I,e.project,{...t,id:e.id+"--or-child-data-type-entity-id-"+D},n);S.hasCreated&&f.push(S.changeSet.self),a.push(...S.changeSet.updated),s.push(...S.changeSet.added),o.push(...S.changeSet.removed)}});const v=m(f);if(!v.length&&!R){u.forEach(I=>{const D={id:M.UUID.uuid(),version:1,type:i.DataType,entity:null,isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:et.OrDataTypeGroup,parent:e.toReference()},S=b(D,e.project);switch(S.setParent(e),S.initChildren(),S.addSelfToProject(),typeof I){case"string":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.String].id));break;case"number":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.Number].id));break;case"boolean":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.Boolean].id));break;case"object":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.Null].id));break}});break}else v.length===1&&!R?e.setEntity(v[0]):u.forEach((I,D)=>{if(typeof I=="object"&&!Array.isArray(I)&&I!==null){const S=Ku(Object.keys(I),e.project);if(S){const $=CS(S||v[0],e,et.OrDataTypeGroup);a.push(...$.updated),s.push(...$.added),o.push(...$.removed)}}else{const S={id:e.id+"--or-child-data-type-id--"+D,version:1,type:i.DataType,entity:null,isList:Array.isArray(I),asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:et.OrDataTypeGroup,parent:e.toReference()},$=b(S,e.project);$.setParent(e),$.initChildren(),$.addSelfToProject();const j=Xu(I,$,{...t,id:e.id+"--or-child-data-type-entity-id-"+D},n);a.push(...j.updated),s.push(...j.added),o.push(...j.removed)}})}}else{const u=sl(r[0],e.project,{...t},n);e.setEntity(u.changeSet.self),a.push(...u.changeSet.updated),s.push(...u.changeSet.added),o.push(...u.changeSet.removed);break}else{const u=sl(r,e.project,{...t},n);e.setEntity(u.changeSet.self),a.push(...u.changeSet.updated),s.push(...u.changeSet.added),o.push(...u.changeSet.removed);break}}return{updated:m(a),added:m(s),removed:m(o),self:e}}function sl(r,e,t,n){const a=[],s=[],o=[],l=Object.keys(r),p=Ku(l,e);if(p)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],self:p}};const u=n?t.name+" of "+n.name:t.name,f={id:t.id||de(u,i.DefinitionEntity,e),version:1,name:u,type:i.DefinitionEntity,description:t.description||null,static:t.static||!1,abstract:t.abstract||!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[],x:0,y:0,parent:e.toReference()},R=b(f,e);return R.setParent(e),R.initChildren(),R.addSelfToProject(),s.push(R),l.forEach((v,I)=>{const D=de(u+" "+v,i.Property,e),S={id:D,version:1,name:v,type:i.Property,description:null,static:!1,abstract:!1,defaultValue:null,constant:!1,dataType:null,implements:null,index:I,hidden:!1,private:!1,required:!0,parent:R.toReference()},$=b(S,e);$.setParent(R),$.initChildren(),$.addSelfToProject(),s.push($);const j=r[v],oe={id:D+"--data-type-id",version:1,type:i.DataType,entity:null,isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parent:$.toReference()},ae=b(oe,e);ae.setParent($),ae.initChildren(),ae.addSelfToProject(),s.push(ae);const Xe=Xu(j,ae,{...t,name:v,id:D+"--data-type-entity-id"},n||R);a.push(...Xe.updated),s.push(...Xe.added),o.push(...Xe.removed)}),{hasCreated:!0,changeSet:{updated:m(a),added:m(s),removed:m(o),self:R}}}function ol(r,e){const t=Qr(r);if(t.length===0)return{list:[],last:null};let n=null;return{list:t.flatMap(s=>{if(s===e)return n=s,[s];const o=ol(s,e);return o.last&&(n=o.last),[s,...o.list]}),last:n}}function wS(r,e,t=new Set){const n=cr(r),a=cr(e),s=n.filter(p=>!a.includes(p)),o=n.filter(p=>a.includes(p)),l=s.reduce((p,u)=>t.has(u.id)?p:(t.add(u.id),m([...p,...wS(u,e,t)])),[]);return m([...o,...l])}function es(r,e){const t=ol(r,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function Rq(r,e){return!!ol(r,e).last}function gq(r){if(We.includes(r.type))return r;if([...Xt,i.VariableDeclaration].includes(r.type)){const e=r.parent;return We.includes(e.type)?e:null}return null}function Qu(r,e){if(!r||!e)throw new Error("Both entities must be defined to find a common ancestor");if(r===e)return r;const t=r.parent;if(t){if(t===e)return e;if(t.type===i.Project)return null}else return null;const n=e.parent;if(n){if(n===r)return r;if(n.type===i.Project)return null}else return null;return Qu(t,n)}function lt(r){if(ss.includes(r.type)){if(r.type===i.FunctionDeclaration){const e=r.parent;if(e.type===i.DefinitionEntity)return e;if(e.type===i.Loop)return e}return r}else{const e=r.parent;return e?lt(e):null}}function ll(r,e){const t=ts(r,e);if(!t)return null;if(ss.includes(t.type)){if(t.type===i.FunctionDeclaration){const n=ts(t.parent,e);if(n){if(n.type===i.DefinitionEntity)return n;if(n.type===i.Loop)return n}}return t}else{const n=t.parent?ts(t.parent,e):null;return n?ll(n,e):null}}function BS(r){if(!r)return null;if(Xt.includes(r.type))return r;const e=r.parent;return e?BS(e):null}function MS(r){if(!r)return null;if(Je.includes(r.type))return r;const e=r.parent;return e?MS(e):null}function _S(r){if(!r)return null;if(on.includes(r.type))return r;const e=r.parent;return e?_S(e):null}function bq(r){return r.type===i.VariableDeclaration?[r]:Je.includes(r.type)?[...r.inputs,...r.outputs||[]]:xe.includes(r.type)?r.outputs:ii.includes(r.type)||r.type===i.FunctionDeclaration?r.inputs:[]}function vq(r){const e=cr(r),t=[],n=[];Tp.includes(r.type)&&t.push(...ep(r));const a=e.filter(s=>{const o=t.includes(s);return o?!1:Xt.includes(s.type)&&!o?(n.push(s),!1):!0});return t.sort((s,o)=>es(o,s)?-1:0),n.sort((s,o)=>es(o,s)?-1:0),[...t,...n,...a]}function VS(r){return[...r].sort((e,t)=>es(t,e)?-1:0)}function Iq(r){const e=VS(r),t=[];return e.forEach(n=>{const a=t[t.length-1];if(a){const s=a[a.length-1];es(n,s)?t.push([n]):a.push(n)}else t.push([n])}),t}function Ot(r){const e=r.map(t=>lt(t));return m(e)}function ep(r){return Je.includes(r.type)?[...Ot(r.successCalls),...Ot(r.errorCalls)]:We.includes(r.type)?Ot(r.calls):[]}function Dq(r,e){return ep(r).includes(e)}function tp(r){return r.writesValues||[]}function Aq(r,e){return tp(r).includes(e)}function NS(r){var e;return Fe.includes((e=r==null?void 0:r.readsValue)==null?void 0:e.type)?r.readsValue:null}function Sq(r){return r.writesValues}function LS(r=[]){return r.map(NS).filter(e=>!!e)}function dl(r=[]){return r.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function GS(r=[]){return r.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function $S(r){return Fe.includes(r.type)?r:null}function FS(r){return r.writesValues.map($S).filter(e=>!!e)}function US(r=[]){return r.reduce((e,t)=>t.type===i.OutputMap?[...e,...FS(t)]:e,[])}function Ue(r){return Je.includes(r.type)?[...vn(Ot(r.successCalls)),...vn(Ot(r.errorCalls))]:We.includes(r.type)?vn(Ot(r.calls)):[]}function Oq(r){return Je.includes(r.type)?[...vn(Ot(r.successCalls)),...vn(Ot(r.errorCalls))]:We.includes(r.type)?vn(Ot(r.calls)):[]}function xS(r,e=new Set){return r.writesValues.filter(n=>Fe.includes(n.type)&&!e.has(n.id)).reduce((n,a)=>e.has(a.id)?n:[...n,...Ae(a,e)],[])}function jS(r,e=new Set){var n;return(((n=r.readsValue)==null?void 0:n.writesValues)||[]).filter(a=>Fe.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...Ae(s,e)],[])}function Ae(r,e=new Set){if(e.has(r.id))return[];if(r.type===i.ReturnStatement)return GS(r.outputs).reduce((n,a)=>[...n,...Ae(a,e)],[]);if(r.type===i.FunctionCall||r.type===i.Operation||r.type===i.Condition)return[...Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Ae(l||o,e)]},[]),...LS(r.inputs),...US(r.outputs)].reduce((s,o)=>[...s,...Ae(o,e)],[]);if(ii.includes(r.type)){const t=dl(r.inputs),a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Ae(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Ae(o,e)],[])}if(r.type===i.FunctionDeclaration){const t=[...dl(r.inputs)],a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Ae(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Ae(o)],[])}if(Fe.includes(r.type)){e.add(r.id);const n=Ue(r).reduce((a,s)=>{const o=lt(s);return[...a,...Ae(o||s,e)]},[]);return[r,...n,...jS(r,e),...xS(r,e)]}return[]}function Nt(r,e=new Set){return e.has(r.id)?[]:(e.add(r.id),[...cr(r).reduce((a,s)=>[...a,s,...Nt(s,e)],[])])}function vn(r){return r.reduce((e,t)=>t.type===i.ReturnStatement||t.type===i.ContinueStatement||t.type===i.BreakStatement?[...e,t]:[...e,t,...Ue(t)],[])}function kS(r){const e=r.entities||[],t=[...e,...r.functions||[],...r.events||[],...r.projects||[]],n=e.reduce((p,u)=>[...p,...u.properties],[]),a=e.reduce((p,u)=>[...p,...u.methods],[]),s=a.reduce((p,u)=>[...p,...dl(u.inputs),...vn(Ot(u.calls)),...u.returnStatements],[]),o=r.functions.reduce((p,u)=>[...p,...vn(Ot(u.calls)),...u.returnStatements],[]),l=r.events.reduce((p,u)=>[...p,...vn(Ot(u.calls)),...u.returnStatements],[]);return[...t,...n,...a,...s,...o,...l]}function qS(r,e){return e.filter(n=>{if(!n)return!1;switch(n.type){case i.FunctionCall:return n.inputs.find(a=>a.id===r.id)!==void 0||n.outputs.find(a=>a.id===r.id)!==void 0;case i.Condition:return n.successCalls.find(a=>a.id===r.id)!==void 0||n.errorCalls.find(a=>a.id===r.id)!==void 0||n.inputs.find(a=>a.id===r.id)!==void 0;case i.Operation:return n.outputs.find(a=>a.id===r.id)!==void 0;case i.VariableDeclaration:return Je.includes(r.type)?RO(r).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===n.id})!==void 0:!1;case i.DefinitionEntity:return n.properties.find(a=>a.id===r.id)!==void 0||n.methods.find(a=>a.id===r.id)!==void 0;case i.FunctionDeclaration:return n.inputs.find(a=>a.id===r.id)!==void 0||(n.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===r.id)!==void 0;default:return!1}})}function Pq(r){const e=kS(r.project);return qS(r,e)}function ts(r,e){return r?typeof r=="string"?e[r]:r.type===i.GenericReference?e[r.entityId]:e[r.id]?e[r.id]:null:null}function JS(r,e){const t=[];if(Xt.includes(r.type)){qt(r).forEach(s=>{const o=ll(s,e);o&&t.push(o)});const a=[...r.inputs||[],...r.outputs||[]].map(s=>{const o=ts(s,e);return o?bO(o,e):null}).filter(s=>s!==null);t.push(...m(a))}if(Fe.includes(r.type)){const n=ul(r);n&&t.push(n)}return m(t)}function Qr(r){const e=[];if(Xt.includes(r.type)){r.calledBy.forEach(a=>{const s=lt(a);s&&e.push(s)});const n=[...r.inputs||[],...r.outputs||[]].map(a=>ul(a)).filter(a=>a!==null);e.push(...m(n))}if(Fe.includes(r.type)){const t=ul(r);t&&e.push(t)}return m(e)}function qt(r){return[...r.calledByEntry||[],...r.calledByError||[],...r.calledBySuccess||[]]}function WS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ActionDescriptor)throw new Error("Entity must be an action descriptor to be flattened");return[r,...r.inputs.flatMap(n=>O(n,e,t)),...r.outputs.flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function YS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ArgumentDeclaration)throw new Error("Entity must be an argument declaration to be flattened");return[r,...r.defaultValue?O(r.defaultValue,e):[],...r.writesValues.flatMap(n=>O(n,e,t)),...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function HS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.BreakStatement)throw new Error("Entity must be a break statement to be flattened");return[r,...r.outputs.flatMap(n=>O(n,e,t)),...r.throws?O(r.throws,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function zS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.BuiltInBaseEntity)throw new Error("Entity must be a built-in base entity to be flattened");return[r,...(r.properties||[]).flatMap(n=>O(n,e,t)),...(r.methods||[]).flatMap(n=>O(n,e,t)),...(r.abstractMethods||[]).flatMap(n=>O(n,e,t)),...(r.extends||[]).flatMap(n=>O(n,e,t))]}function ZS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Condition)throw new Error("Entity must be a condition to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function KS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ContinueStatement)throw new Error("Entity must be a continue statement to be flattened");return[r,...r.outputs.flatMap(n=>O(n,e,t)),...r.throws?O(r.throws,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function XS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.DefinitionEntity)throw new Error("Entity must be a definition entity to be flattened");return[r,...(r.extends||[]).flatMap(n=>O(n,e,t)),...(r.implements||[]).flatMap(n=>O(n,e,t)),...(r.properties||[]).flatMap(n=>O(n,e,t)),...(r.methods||[]).flatMap(n=>O(n,e,t)),...(r.abstractMethods||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function QS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.DataType)throw new Error("Entity must be a data type to be flattened");return[r,...(r.andChildrenGroup||[]).flatMap(n=>O(n,e,t)),...(r.orChildrenGroup||[]).flatMap(n=>O(n,e,t)),...r.entity?O(r.entity,e,t):[],...r.parent?O(r.parent,e,t):[]]}function eO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.FunctionCall)throw new Error("Entity must be a function call to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function tO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.FunctionDeclaration)throw new Error("Entity must be a function declaration to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.returnStatements||[]).flatMap(n=>O(n,e,t)),...(r.calls||[]).flatMap(n=>O(n,e,t)),...r.implements?O(r.implements,e,t):[],...r.parent?O(r.parent,e,t):[]]}function nO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.GlobalEvent)throw new Error("Entity must be a global event to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.calls||[]).flatMap(n=>O(n,e,t)),...(r.returnStatements||[]).flatMap(n=>O(n,e,t)),...r.implements?O(r.implements,e,t):[],...r.parent?O(r.parent,e,t):[]]}function rO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.InputMap)throw new Error("Entity must be an input map to be flattened");return[r,...r.readsValue?O(r.readsValue,e,t):[],...r.declaration?O(r.declaration,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...r.parent?O(r.parent,e,t):[]]}function iO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.InstalledProject)throw new Error("Entity must be an installed project to be flattened");return[r,...(r.functions||[]).flatMap(n=>O(n,e,t)),...(r.events||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function aO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.InternalCall)throw new Error("Entity must be an internal call to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...r.parent?O(r.parent,e,t):[]]}function sO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.LiteralValue)throw new Error("Entity must be a literal value to be flattened");return[r,...r.valueAsType?Array.isArray(r.valueAsType)?r.valueAsType.flatMap(n=>O(n,e,t)):O(r.valueAsType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function oO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Loop)throw new Error("Entity must be a loop to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...r.body?O(r.body,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...(r.breakStatements||[]).flatMap(n=>O(n,e,t)),...(r.continueStatements||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function lO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Operation)throw new Error("Entity must be an operation to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function dO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.OutputMap)throw new Error("Entity must be an output map to be flattened");return[r,...(r.writesValues||[]).flatMap(n=>O(n,e,t)),...r.declaration?O(r.declaration,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...r.parent?O(r.parent,e,t):[]]}function cO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.PrimitiveEntity)throw new Error("Entity must be a primitive entity to be flattened");return[r,...(r.properties||[]).flatMap(n=>O(n,e,t)),...(r.methods||[]).flatMap(n=>O(n,e,t)),...(r.abstractMethods||[]).flatMap(n=>O(n,e,t))]}function uO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Project)throw new Error("Entity must be a project to be flattened");return[r,...(r.entities||[]).flatMap(n=>O(n,e,t)),...(r.functions||[]).flatMap(n=>O(n,e,t)),...(r.events||[]).flatMap(n=>O(n,e,t)),...(r.projects||[]).flatMap(n=>O(n,e,t)),...(r.variableDeclarations||[]).flatMap(n=>O(n,e,t)),...(r.variableInstances||[]).flatMap(n=>O(n,e,t)),...(r.operations||[]).flatMap(n=>O(n,e,t)),...(r.conditions||[]).flatMap(n=>O(n,e,t)),...(r.functionCalls||[]).flatMap(n=>O(n,e,t)),...(r.projects||[]).flatMap(n=>O(n,e,t)),...(r.loops||[]).flatMap(n=>O(n,e,t)),...(r.searches||[]).flatMap(n=>O(n,e,t))]}function pO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Property)throw new Error("Entity must be a property to be flattened");return[r,...r.defaultValue?O(r.defaultValue,e,t):[],...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function yO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ReturnDeclaration)throw new Error("Entity must be a return declaration to be flattened");return[r,...r.readsValue?O(r.readsValue,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function hO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ReturnStatement)throw new Error("Entity must be a return statement to be flattened");return[r,...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.throws?O(r.throws,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function fO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Search)throw new Error("Entity must be a search to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputsDeclarations||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputsDeclarations||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function mO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ValueDescriptor)throw new Error("Entity must be a value descriptor to be flattened");return[r,...r.defaultValue?O(r.defaultValue,e,t):[],...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function TO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.VariableDeclaration)throw new Error("Entity must be a variable declaration to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(r.internalCalls||[]).flatMap(n=>O(n,e,t)),...(r.writesValues||[]).flatMap(n=>O(n,e,t)),...r.readsValue?O(r.readsValue,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function EO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.VariableInstance)throw new Error("Entity must be a variable instance to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(r.internalCalls||[]).flatMap(n=>O(n,e,t)),...(r.writesValues||[]).flatMap(n=>O(n,e,t)),...r.readsValue?O(r.readsValue,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.declaration?O(r.declaration,e,t):[],...r.parent?O(r.parent,e,t):[]]}function np(){const r=new Set;return mg.flatMap(t=>O(t,r)).map(t=>t.id)}function O(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(!r)throw new Error("Entity must be defined to be flattened");if(r.type===i.GenericReference)return[];if(t.ignoreBuiltInBaseEntities&&(Jn.includes(r.type)||np().includes(r.id)))return[];if(e.has(r.id))return[];switch(r.type){case i.FunctionCall:return eO(r,e,t);case i.Operation:return lO(r,e,t);case i.Condition:return ZS(r,e,t);case i.Loop:return oO(r,e,t);case i.Search:return fO(r,e,t);case i.GlobalEvent:return nO(r,e,t);case i.ReturnStatement:return hO(r,e,t);case i.ContinueStatement:return KS(r,e,t);case i.BreakStatement:return HS(r,e,t);case i.VariableDeclaration:return TO(r,e,t);case i.DefinitionEntity:return XS(r,e,t);case i.FunctionDeclaration:return tO(r,e,t);case i.Project:return uO(r,e,t);case i.ActionDescriptor:return WS(r,e,t);case i.ArgumentDeclaration:return YS(r,e,t);case i.ReturnDeclaration:return yO(r,e,t);case i.ValueDescriptor:return mO(r,e,t);case i.InputMap:return rO(r,e,t);case i.OutputMap:return dO(r,e,t);case i.DataType:return QS(r,e,t);case i.InstalledProject:return iO(r,e,t);case i.InternalCall:return aO(r,e,t);case i.LiteralValue:return sO(r,e,t);case i.Property:return pO(r,e,t);case i.VariableInstance:return EO(r,e,t);case i.BuiltInBaseEntity:return t.ignoreBuiltInBaseEntities?[]:zS(r,e,t);case i.PrimitiveEntity:return t.ignoreBuiltInBaseEntities?[]:cO(r,e,t)}return[]}function cl(r,e){if(Jn.includes(r.type))return new Set;const t=JS(r,e),n=new Set(t.map(a=>a.id));if(r.type===i.LiteralValue&&r.valueAsType&&(Array.isArray(r.valueAsType)?r.valueAsType.forEach(a=>{n.add(a.id)}):n.add(r.valueAsType.id)),r.type===i.DataType&&r.entity&&(r.entity.type===i.DefinitionEntity?(r.entity.parent.entityId||r.entity.parent.id)!==r.id&&n.add(r.entity.id):n.add(r.entity.id)),fp.includes(r.type)){const a=r.parent;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(mp.includes(r.type)){const a=r.implements;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(gl.includes(r.type)){const a=r.declaration;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(An.includes(r.type)){const a=r.readsValue;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Xt.includes(r.type)){const a=[...r.calledBySuccess||[],...r.calledByEntry||[],...r.calledByError||[]];a.length&&a.forEach(s=>{s.type===i.GenericReference?n.add(s.entityId):n.add(s.id)})}return n}function rp(r){return r.type===i.FunctionCall||r.type===i.InternalCall||[i.Operation,i.Condition,i.Loop].includes(r.type)?r.declaration.inputs:r.type===i.FunctionDeclaration||ii.includes(r.type)?r.inputs:r.type===i.Search?r.inputsDeclarations:[]}function Cq(r,e){return e.type===i.Condition?e.inputs.find(t=>t.declaration.id===r.id):e.type===i.FunctionCall||e.type===i.Operation?e.inputs.find(t=>t.declaration.id===r.id):null}function RO(r){return Je.includes(r.type)?r.inputs:[]}function gO(r){var e;return r.type===i.FunctionCall?((e=r.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[i.Operation,i.Condition,i.Loop].includes(r.type)?r.declaration.outputs:r.type===i.Search?r.outputsDeclarations:xe.includes(r.type)?r.outputs:[]}function wq(r,e){return e.type===i.Condition?null:e.type===i.FunctionCall||e.type===i.Operation?e.outputs.find(t=>t.declaration.id===r.id):null}function Bq(r){return r.type===i.Condition?[]:Je.includes(r.type)?r.outputs:[]}function ul(r){const e=r.readsValue;return e?lt(e):null}function bO(r,e){const t=r.readsValue;return t?ll(t,e):null}function vO(r){const e=r.internalCalls||[];return m(Ot(m(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function Hi(r){const e=tp(r),t=[];return e.forEach(n=>{if(Fe.includes(n.type))t.push(n);else if(An.includes(n.type)){const a=n.parent;t.push(a)}}),t}function m(r){const e=new Set;return r.filter(t=>!t||e.has(t.id)?!1:(e.add(t.id),!0))}function cr(r,e=!1){const t=[];if(r.type===i.Project&&t.push(...(r==null?void 0:r.entities)||[],...(r==null?void 0:r.functions)||[],...(r==null?void 0:r.variableDeclarations)||[],...(r==null?void 0:r.variableInstances)||[],...(r==null?void 0:r.searches)||[],...(r==null?void 0:r.loops)||[],...(r==null?void 0:r.operations)||[],...(r==null?void 0:r.conditions)||[],...(r==null?void 0:r.functionCalls)||[],...(r==null?void 0:r.events)||[],...(r==null?void 0:r.projects)||[]),pt.includes(r.type)&&t.push(...(r==null?void 0:r.detachedChildren)||[]),r.type===i.DefinitionEntity){const n=[...r.suggestedMethods,...r.methods].flatMap(a=>a.collapsed&&e?[]:cr(a));t.push(...n)}if(r.type===i.Condition){const n=r.successCalls.map(s=>lt(s)),a=r.errorCalls.map(s=>lt(s));t.push(...n,...a)}if(ii.includes(r.type)){if(r.collapsed&&e)return[];const n=r.inputs.map(s=>Hi(s)).flat(),a=r.calls.map(s=>lt(s));t.push(...m(n),...a)}if(Je.includes(r.type)&&r.type!==i.Condition&&r.type!==i.Loop){const n=r==null?void 0:r.outputs.map(o=>Hi(o)).flat(),a=r.successCalls.map(o=>lt(o)),s=r.errorCalls.map(o=>lt(o));t.push(...m(n),...a,...s)}if(Fe.includes(r.type)){const n=Hi(r),a=vO(r);t.push(...n,...a)}if(r.type===i.Loop){const n=r.outputs.map(o=>Hi(o)).flat();if(r.body){const o=cr(r.body,e);t.push(...o)}const a=r.errorCalls.map(o=>lt(o)),s=r.successCalls.map(o=>lt(o));t.push(...m(n),...s,...a)}if(r.type===i.FunctionDeclaration){if(r.collapsed&&e)return[];const n=r.inputs.map(s=>Hi(s)).flat(),a=r.calls.map(s=>lt(s));t.push(...m(n),...a)}return m(t)}function IO(r,e=!1){const t=cr(r,e),n=[...t,...t.reduce((a,s)=>[...a,...IO(s,e)],[])];return m(n)}function DO(r){const e=Qr(r),t=[...e,...e.reduce((n,a)=>[...n,...DO(a)],[])];return m(t)}function pl(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...pl(t),...yl(t)]:[...e,t.name],[])}function yl(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...yl(t),...pl(t)]:[...e,t.name],[])}function ip(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...ip(t),...ap(t)]:[...e,t],[])}function ap(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...ap(t),...ip(t)]:[...e,t],[])}function sp(r){return[...yl(r),...pl(r)].filter((t,n,a)=>a.indexOf(t)===n)}function AO(r){return r.implements.length===0&&r.extends.length===0?null:r.implements.find(n=>n.type===i.BuiltInBaseEntity&&n.name===U.PERSISTED_ENTITY)?r:[...r.implements,...r.extends].reduce((n,a)=>{if(a.type===i.DefinitionEntity){const s=AO(a);if(s)return s}return n},null)}function Mq(r){const e=r.extends.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function _q(r){const e=r.implements.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function op(r){const e=r.extends.find(t=>t.type===i.DefinitionEntity);return e&&e.type===i.DefinitionEntity?e:null}function ur(r){const e=[...r.implements,...r.extends].reduce((t,n)=>n.type===i.BuiltInBaseEntity?[...t,n]:n.type===i.DefinitionEntity?[...t,...ur(n)]:t,[]);return m(e)}function lp(r){return r.type===i.PrimitiveEntity?!0:r.type===i.BuiltInBaseEntity?r.interactive:!ur(r).find(n=>!n.interactive)}function Vq(r){return r.parent===r.project&&r.project.variableDeclarations.includes(r)}function dp(r){return r.parent!==r.project?!1:i.VariableDeclaration===r.type?r.project.variableDeclarations.includes(r):i.VariableInstance===r.type?r.project.variableInstances.includes(r):i.FunctionCall===r.type?r.project.functionCalls.includes(r):i.Condition===r.type?r.project.conditions.includes(r):i.Operation===r.type?r.project.operations.includes(r):i.Loop===r.type?r.project.loops.includes(r):i.Search===r.type?r.project.searches.includes(r):!1}function SO(r){if([...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||dp(r))return!1;const e=Qr(r);return e.length===0?!0:e.some(t=>SO(t))}function cp(r){return[...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||dp(r)?!1:Qr(r).length===0}function OO(r,e=0){if(cp(r)){const t=Qr(r);return t.length===0?r:t.map(a=>OO(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function PO(r){const e=[];if(cp(r))e.push(r);else return[];return Qr(r).forEach(n=>{e.push(...PO(n))}),e}function CO(r){return r.type===i.FunctionDeclaration&&r.parent!==r.project&&!![i.DefinitionEntity,i.Loop,i.InstalledProject].includes(r.parent.type)}function Nq(r,e){const t=new Map;return r.forEach(n=>{t.set(n.id,n)}),e.forEach(n=>{t.set(n.id,n)}),Array.from(t.values())}function hl(r){switch(r){case i.DefinitionEntity:return ei;case i.FunctionDeclaration:return jr;case i.VariableDeclaration:return sn;case i.VariableInstance:return Wr;case i.FunctionCall:return Xr;case i.Operation:return kr;case i.Condition:return Jr;case i.ReturnStatement:return Zr;case i.Loop:return qr;case i.Search:return Yr;case i.InputMap:return xn;case i.OutputMap:return jn;case i.ArgumentDeclaration:return zr;case i.ReturnDeclaration:return kt;case i.Property:return xr;case i.InstalledProject:return Hr;case i.Project:return M;case i.BuiltInBaseEntity:return In;default:return null}}function Pt(r,e){if(pt.includes(r.type))return r;if(Jn.includes(r.type))return null;const t=r.parent;if(!t)return null;if(t.type===i.GenericReference){const n=A(t);if(!n)return null;const a=e.get(n);return a?Pt(a,e):null}else return t===e?e:Pt(t,e)}function up(r,e){if(Jn.includes(r.type)||e.getBuiltIn(r.id))return null;const t=Lt(r.parent,e);return t?t===e?pt.includes(r.type)?r:null:t.type===i.DefinitionEntity?r:up(t,e):null}function fl(r,e,t){if(r===e||e===t||r===t)return!1;const n=Pt(e.parent,t);return n===r?!0:fl(n,e,t)}var ml=(r=>(r.SameBothLocal="same-both-local",r.AInB="a-in-b",r.BInA="b-in-a",r.ParallelInCommonParent="parallel-in-common-parent",r.ParallelInProject="parallel-in-project",r.AIsGlobalBIsNot="a-is-global-b-is-not",r.BIsGlobalAIsNot="b-is-global-a-is-not",r.SameBothGlobal="same-both-global",r))(ml||{});function ns(r,e,t){const n=Pt(r,t),a=Pt(e,t);if(!n)throw new Error("Could not find scope owner for the entity: "+r.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(n===a&&n.type!==i.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:n};if(n===a&&n.type===i.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:n};if(n.type===i.Project&&a.type!==i.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:n};if(n.type!==i.Project&&a.type===i.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(fl(n,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:n};if(fl(a,n,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=Qu(n,a);return l===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:l}:l?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:Pt(l,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function wO(r,e,t){const n=ns(r,e,t);if(!n.compatible||n.type!=="same-both-local")return null;if(r===e)return r;let a=Pt(r.parent,t);if(a){if(a===e)return e;if(a.type===i.Project)return r}else return r;for(;a;){if(a){if(a===e)return e;if(a.type===i.Project)return r}else return r;a=Pt(a.parent,t)}let s=Pt(e.parent,t);if(s){if(s===r)return r;if(s.type===i.Project)return e}else return e;for(;s;){if(s){if(s===r)return r;if(s.type===i.Project)return e}else return e;s=Pt(s.parent,t)}return null}function BO(r){return r.length===0?null:r.length===1?r[0]:r.reduce((t,n)=>{const a=wO(t,n,n.project);return!a||a===n?t:n},r[0])}function Lt(r,e){if(!r)return null;let t;return typeof r=="string"?t=r:r.type===i.GenericReference?t=A(r):t=r.id,t===e.id?e:e.get(t)}function pr(r){if(!r)return null;if(Jn.includes(r.type))return r;if(r.type===i.Project)return null;if(r.project.getBuiltIn(r.id))return r;const e=r.parent;return!e||e.type===i.Project?null:pr(e)}function Lq(r,e){var t;if(r.readsValue){const n=Lt(r.readsValue,e.project);e.setValueWriter(n),n.addValueReader(e)}else r.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function rs(r){const e=[];function t(s,o){return e.some(l=>l.blockedByCaller===s&&l.blockedByCalling===o)}function n(s,o){t(s,o)||e.push({blockedByCaller:s,blockedByCalling:o})}const a=up(r,r.project);return r.calledBySuccess.forEach(s=>{[...s.successCalls||[]].forEach(p=>{xe.includes(p.type)&&p!==r&&(Ue(r).find(f=>f===p)||n(s,p))});let l;if(Je.includes(s.type)&&(l=s),l){const p=rs(l);p.reachable||Ue(r).find(f=>f===s)||p.blocks.forEach(f=>{n(s,f.blockedByCalling)})}}),r.calledByError.forEach(s=>{[...s.errorCalls||[]].forEach(p=>{xe.includes(p.type)&&p!==r&&(Ue(r).find(f=>f===p)||n(s,p))});let l;if(Je.includes(s.type)&&(l=s),l){const p=rs(l);p.reachable||Ue(r).find(f=>f===s)||p.blocks.forEach(f=>{n(s,f.blockedByCalling)})}}),r.calledByEntry.forEach(s=>{if([...s.calls||[]].forEach(p=>{xe.includes(p.type)&&p!==r&&(Ue(r).find(f=>f===p)||n(s,p))}),s===a)return;let l;if(s.type===i.FunctionDeclaration){const p=lt(s);if(p.type===i.DefinitionEntity)return;p.type===i.Loop&&(l=p)}if(l){const p=rs(l);p.reachable||p.blocks.forEach(u=>{n(s,u.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function Gq(r){return ss.includes(r.type)?r.type===i.FunctionDeclaration?!CO(r):!0:!1}function $q(r){if(i.ActionDescriptor===r.type){if(r.project.operationDeclarations.find(s=>s.id===r.id))return i.Operation;if(r.project.globalEventActionDescriptors.find(s=>s.id===r.id))return i.GlobalEvent;if(r.project.loopDeclarations.find(s=>s.id===r.id))return i.Loop;if(r.project.conditionDeclarations.find(s=>s.id===r.id))return i.Condition}return r.type}function zi(r,e){if(r.type!==i.DefinitionEntity||r.abstract)return!1;const t=op(r)||r;return!!sp(t).includes(e)}function Fq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,U.PERSISTED_ENTITY)){e.push(t);return}}),m(e)}function Uq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,U.RELATIONAL_DATABASE)){e.push(t);return}}),m(e)}function xq(r){return r.type!==i.DefinitionEntity||r.abstract||!zi(r,U.PERSISTED_ENTITY)?null:(r==null?void 0:r.properties.find(t=>{var n;return((n=t.implements)==null?void 0:n.id)===_[i.BuiltInBaseEntity][U.PERSISTED_ENTITY].properties.primaryKey.id&&!t.abstract}))||null}function jq(r){if(r.type!==i.DefinitionEntity)return[];if(r.abstract)return[];if(!zi(r,U.PERSISTED_ENTITY))return[];const e=[],t=r.properties.filter(n=>{var a;return((a=n.implements)==null?void 0:a.id)!==_[i.BuiltInBaseEntity][U.PERSISTED_ENTITY].properties.database.id&&!n.abstract});return e.push(...t),e}function kq(r){var t;if(!r||r.type!==i.DefinitionEntity||!zi(r,U.PERSISTED_ENTITY))return null;const e=r.properties.find(n=>{var a;return((a=n.implements)==null?void 0:a.id)===_[i.BuiltInBaseEntity][U.PERSISTED_ENTITY].properties.database.id});return(t=e==null?void 0:e.getDefaultValue())==null?void 0:t.valueAsType}function He(r,e){var n;if(!Rp.includes(e.type)||!r)return e.project||null;let t=e.project;return r.type===i.Project?t=r:((n=e.project)==null?void 0:n.id)!==r.project.id&&(t=r.project),t}function qq(r,e){const t=[];if(r.parent)if(r.id===r.parent)t.push(new g({id:`${r.id}--${r.parent}--${T.SelfReference}`,code:T.SelfReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to itself at 'parent'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));else{const n=e.get(r.parent);n?[i.Project,i.DataType].includes(n.type)||t.push(new g({id:`${r.id}--${r.parent}--${T.InvalidParentReference}`,code:T.InvalidParentReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a parent reference that isn't pointing to an entity of type 'project' or 'data-type'.`,issue:null})):t.push(new g({id:`${r.id}--${r.parent}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return r.implements&&Array.isArray(r.implements)?r.implements.forEach(n=>{if(r.id===n){t.push(new g({id:`${r.id}--${n}--${T.SelfReference}`,code:T.SelfReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to itself at one of the 'implements' references. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));return}const a=e.get(n);a?[i.DefinitionEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new g({id:`${r.id}--${n}--${T.InvalidImplementsReference}`,code:T.InvalidImplementsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.InvalidImplementsReference}`,code:T.InvalidImplementsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an entity of type 'definition-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${n}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}):t.push(new g({id:`${r.id}--${B.InvalidObjectStructure}`,code:B.InvalidObjectStructure,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' property that isn't an array.`,issue:null})),r.extends&&Array.isArray(r.extends)&&r.extends.forEach(n=>{const a=e.get(n);a?[i.DefinitionEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new g({id:`${r.id}--${n}--${T.InvalidExtendsReference}`,code:T.InvalidExtendsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'extends' reference that isn't pointing to a non-abstract entity. Did you want to use the property 'implements', which holds a list of references to absract entities, instead?`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.InvalidExtendsReference}`,code:T.InvalidExtendsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'extends' reference that isn't pointing to an entity of type 'definition-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${n}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}const De=class De{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"static");c(this,"abstract");c(this,"type",i.DefinitionEntity);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"implements",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestedProperties",[]);c(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let n=t;if(e.parent){const p=A(e.parent);n=t.get(p)}const a=[];e.implements&&e.implements.forEach(p=>{a.push(t.get(p)||t.getBuiltIn(p))});const s=[];e.extends&&e.extends.forEach(p=>{s.push(t.get(p)||t.getBuiltIn(p))});const o={id:e.id,version:1,name:e.name,type:i.DefinitionEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:n},l=b(o,t);return l.setParent(n),l.initChildren(),l}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=qq(n,t),o=Zo(n,t);a.push(...s,...o,...je(n));const l=n.parent?t.get(n.parent):null;if(l&&l.type===i.DataType){const p=l;p.entity&&a.push(new g({id:`${e.id}--${T.NewEntityWouldOverriteExisting}`,code:T.NewEntityWouldOverriteExisting,severity:E.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${p.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
403
+ You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}hydrateAncestors(){const e=[],t=[],n=[];if(this.initialData.parent){const a=A(this.initialData.parent),s=this.project.get(a);s&&(this.setParent(s),e.push(s))}if(this.initialData.declaration){const a=A(this.initialData.declaration),s=this.project.get(a);s&&(this.setDeclaration(s),e.push(s))}return this.initialData.calledByEntry.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addEntryCaller(o),e.push(o))}),this.initialData.calledBySuccess.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addSuccessCaller(o),e.push(o))}),this.initialData.calledByError.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addErrorCaller(o),e.push(o))}),{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];this.initialized=!0;const{updated:a,added:s,removed:o}=this.syncMissingFixedInputs(),{updated:l,added:p,removed:u}=this.syncMissingFixedOutputs();return e.push(...a,...l),t.push(...s,...p),n.push(...o,...u),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){var a;const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addFunctionCall(this),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:m(e),added:m(t),removed:m(n),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(n=>n.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(n=>n.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.find(t=>t.id===e.id)||this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.find(t=>t.id===e.id)||this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const n=this.errorCalls.findIndex(a=>a.id===e.id);return n>-1&&this.errorCalls.splice(n,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===i.FunctionDeclaration){const e=b(this.initialData.declaration,this.project);this.declaration=e}else{const e=A(this.initialData.declaration),t=this.project.get(e);this.declaration=t}return this.successCalls=this.initialData.successCalls.map(e=>{const t=b(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=b(e,this.project);return t.addErrorCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=b(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.error&&(this.error=b(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.afterAllChildrenInitialized(),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(e=V,...t){return await we.repository.load(this.id,...t),this}async create(e=V,...t){return await we.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await we.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await we.repository.delete(this.id,...t),this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const n=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});n.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});n.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{n.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{n.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{n.push(o),o.removeCall(this)}),{affected:m(n),removed:m(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:n}=this.process.restore({seenEntities:e});t.push(...n)}return this.inputs.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(n=>{t.push(n),n.addSuccessCaller(this)}),this.errorCalls.forEach(n=>{t.push(n),n.addErrorCaller(this)}),this.calledBySuccess.forEach(n=>{t.push(n),n.addSuccessCall(this)}),this.calledByError.forEach(n=>{t.push(n),n.addErrorCall(this)}),this.calledByEntry.forEach(n=>{t.push(n),n.addCall(this)}),{affected:m(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(n=>n.toFlat(e)),...this.errorCalls.flatMap(n=>n.toFlat(e)),...this.inputs.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[],...this.calledBy.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(n=>n.toFlatIds(e)),...this.errorCalls.flatMap(n=>n.toFlatIds(e)),...this.inputs.flatMap(n=>n.toFlatIds(e)),...this.outputs.flatMap(n=>n.toFlatIds(e))])}toJSON(e=new Set){var t,n;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(a=>a.toJSON(e)),errorCalls:this.errorCalls.map(a=>a.toJSON(e)),calledBySuccess:this.calledBySuccess.map(a=>a.toReference()),calledByError:this.calledByError.map(a=>a.toReference()),calledByEntry:this.calledByEntry.map(a=>a.toReference()),process:(t=this.process)==null?void 0:t.toJSON(e),declaration:this.declaration.toJSON(e),inputs:this.inputs.map(a=>a.toJSON(e)),outputs:this.outputs.map(a=>a.toJSON(e)),parent:this.parent.toReference(),error:(n=this.error)==null?void 0:n.toJSON(e)})}toJSONClone(e=L){var n,a,s,o,l,p,u;let t;return(n=e.seenEntityMaps)!=null&&n.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||Ye(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(s=e.seenEntities)!=null&&s.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(h=>h.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(h=>h.toJSONClone({...e,newId:null})),calledBySuccess:this.calledBySuccess.map(h=>h.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(h=>h.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(h=>h.toReference({seenEntityMaps:e.seenEntityMaps})),process:(p=this.process)==null?void 0:p.toJSONClone({...e,newId:null}),declaration:this.declaration.toJSONClone({...e,newId:null}),inputs:this.inputs.map(h=>h.toJSONClone({...e,newId:null})),outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),error:(u=this.error)==null?void 0:u.toJSONClone({...e,newId:null}),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference(e):null,inputs:this.inputs.map(a=>a.toReference(e)),outputs:this.outputs.map(a=>a.toReference(e)),declaration:this.declaration.toReference(e),successCalls:this.successCalls.map(a=>a.toReference(e)),errorCalls:this.errorCalls.map(a=>a.toReference(e)),calledBySuccess:this.calledBySuccess.map(a=>a.toReference(e)),calledByError:this.calledByError.map(a=>a.toReference(e)),calledByEntry:this.calledByEntry.map(a=>a.toReference(e)),error:this.error?this.error.toReference(e):null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(n=>n.toFlatJSON(e)),...this.errorCalls.flatMap(n=>n.toFlatJSON(e)),...this.inputs.flatMap(n=>n.toFlatJSON(e)),...this.outputs.flatMap(n=>n.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,version:this.version,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(n=>n.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(n=>n.toFlatGenerationTarget(e)),...this.inputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(n=>n.clearErrors()),this.outputs.forEach(n=>n.clearErrors()),this.successCalls.forEach(n=>n.clearErrors()),this.errorCalls.forEach(n=>n.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=Eq(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var R,v;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.FunctionCall,a);s.inputs=[];const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const u=ke(s,a);e?u.setParent(e):u.setParent(this.parent),n&&u.subscribe(),u.initChildren();const h=(R=this.inputs)==null?void 0:R.map((I,D)=>I.clone(u,p+"-input-map-"+D+"-id",n));u.inputs=h;const f=(v=this.outputs)==null?void 0:v.map((I,D)=>I.clone(u,p+"-output-map-"+D+"-id",n));return u.outputs=f,this.error&&(u.error=this.error.clone(u,p+"-error-map-id",n)),this.process&&(u.process=this.process.clone(u,p+"-process-id",n)),u}removeUnrecognizedInputs(){const e=[],t=[],n=[];return this.inputs.forEach(a=>{if(!this.declaration.inputs.find(o=>{var l;return o.id===((l=a.declaration)==null?void 0:l.id)})){const o=a.remove();n.push(...o.removed),e.push(...o.affected)}}),{updated:m(e),added:m(t),removed:m(n),self:this}}removeUnrecognizedOutputs(){const e=[],t=[],n=[];return this.outputs.forEach(a=>{if(!this.declaration.getUniqueReturnDeclarations().find(o=>{var l;return o.id===((l=a.declaration)==null?void 0:l.id)})){const o=a.remove();n.push(...o.removed),e.push(...o.affected)}}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncMissingFixedInputs(){const e=[],t=[],n=[],a=this.declaration.inputs.filter(p=>!this.inputs.find(u=>u.declaration.id===p.id));this.inputs.sort((p,u)=>p.index-u.index),a.forEach(p=>{this.inputs.forEach(f=>{f.index>=p.index&&f.sync({index:f.index+1})});const u={id:M.UUID.uuid(),version:1,type:i.InputMap,declaration:p.toJSON(),readsValue:null,defaultValue:null,index:p.index,name:null,description:null,parent:this.toReference()},h=b(u,this.project);h.setParent(this),h.initChildren(),h.addSelfToProject(),t.push(h)}),this.inputs.sort((p,u)=>p.index-u.index);const{updated:s,added:o,removed:l}=this.removeUnrecognizedInputs();return e.push(...s),t.push(...o),n.push(...l),{updated:m(e),added:m(t),removed:m(n),self:this}}syncMissingFixedOutputs(){const e=[],t=[],n=[],a=[];this.outputs=this.initialData.outputs.map(u=>{const h=b(u,this.project);return a.push(h.index),h.setParent(this),h.initChildren(),h});const s=this.declaration.getUniqueReturnDeclarations().filter(u=>!this.outputs.find(h=>h.declaration.id===u.id));this.outputs.sort((u,h)=>u.index-h.index),s.forEach((u,h)=>{this.outputs.forEach(I=>{I.index>=u.index&&I.index++});const f=a.includes(u.index)?this.outputs.length-1+h:u.index,R={id:M.UUID.uuid(),version:1,type:i.OutputMap,declaration:u.toJSON(),defaultValue:null,writesValues:[],index:f,parent:this.toReference()},v=b(R,this.project);v.setParent(this),v.initChildren(),v.addSelfToProject()}),this.outputs.sort((u,h)=>u.index-h.index);const{updated:o,added:l,removed:p}=this.removeUnrecognizedOutputs();return e.push(...o),t.push(...l),n.push(...p),{updated:m(e),added:m(t),removed:m(n),self:this}}};c(we,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(we,"MUTABLE_BASE_PROPERTIES",[]),c(we,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(we,"BASE_PROPERTIES",[...we.MUTABLE_BASE_PROPERTIES,...we.INMUTABLE_BASE_PROPERTIES]),c(we,"MUTABLE_META_PROPERTIES",["x","y"]),c(we,"INMUTABLE_META_PROPERTIES",[...we.INMUTABLE_BASE_PROPERTIES]),c(we,"META_PROPERTIES",[...we.MUTABLE_META_PROPERTIES,...we.INMUTABLE_META_PROPERTIES]),c(we,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(we,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(we,"UPSTREAM_PROPERTIES",[...we.MUTABLE_UPSTREAM_PROPERTIES,...we.INMUTABLE_UPSTREAM_PROPERTIES]),c(we,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(we,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(we,"DOWNSTREAM_PROPERTIES",[...we.MUTABLE_DOWNSTREAM_PROPERTIES,...we.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(we,"PROPERTIES",[...we.META_PROPERTIES,...we.UPSTREAM_PROPERTIES,...we.DOWNSTREAM_PROPERTIES]);let Xr=we;function zu(r){return r&&typeof r.then=="function"}class Zu{constructor(e){c(this,"order",[]);c(this,"flatRecord",{});c(this,"onGoingVisits",{});this.flatten(e),this.orderEntities()}flatten(e){const t=new Set(np()),n=m(O(e,t,{ignoreBuiltInBaseEntities:!0})),a=new Set;for(const s of n)this.flatRecord[s.id]=s,a.add(s.id);this.order=Array.from(a)}moveEntityAfterDependencies(e){const t=cl(e,this.flatRecord);for(const n of t){const a=this.order.indexOf(n),s=this.order.indexOf(e.id);if(a>s)return this.order.splice(s,1),this.order.splice(a,0,e.id),!0}return!1}orderEntities(){let e=!1;for(let t=0;t<this.order.length;t++){const n=this.order[t],a=this.flatRecord[n];if(this.moveEntityAfterDependencies(a)){e=!0;break}}e&&this.orderEntities()}getUpstreamOngoingDependenciesVisits(e,t){const n=cl(this.flatRecord[e],this.flatRecord),a={};return Object.entries(this.onGoingVisits[t]||{}).forEach(([s,o])=>{Array.from(n).includes(s)&&(a[s]=o)}),a}getDownstreamOngoingDependenciesVisits(e,t){const n=Object.keys(this.onGoingVisits[t]||{}),a=new Set(n.flatMap(o=>Array.from(cl(this.flatRecord[o],this.flatRecord)))),s={};return Array.from(a).forEach(o=>{o===e&&(s[o]=this.onGoingVisits[t][o])}),s}async settlePromises(e,t){const n=Object.values(e);n.length&&await Promise.all(n),Object.keys(e).forEach(a=>{delete this.onGoingVisits[t][a]})}visit(e){const t=this.order;for(const n of t)e(this.flatRecord[n],this.flatRecord);return this}reverseVisit(e){const t=this.order.slice().reverse();for(const n of t)e(this.flatRecord[n],this.flatRecord);return this}async visitAsync(e){const t=this.order,n=Math.random().toString(36).substring(7);this.onGoingVisits[n]={};for(const a of t){const s=this.getUpstreamOngoingDependenciesVisits(a,n);Object.keys(s).length&&await this.settlePromises(s,n);const o=e(this.flatRecord[a],this.flatRecord);zu(o)&&(this.onGoingVisits[n][a]=o)}return await this.settlePromises(this.onGoingVisits[n],n),this.onGoingVisits[n]={},this}async reverseVisitAsync(e){const t=this.order.slice().reverse(),n=Math.random().toString(36).substring(7);this.onGoingVisits[n]={};for(const a of t){const s=this.getDownstreamOngoingDependenciesVisits(a,n);Object.keys(s).length&&await this.settlePromises(s,n);const o=e(this.flatRecord[a],this.flatRecord);zu(o)&&(this.onGoingVisits[n][a]=o)}return await this.settlePromises(this.onGoingVisits[n],n),this.onGoingVisits[n]={},this}}function OS(r){var e;switch(r.id){case _["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const t=r.project.entities.filter(p=>!!p.implements.find(u=>u.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(t.find(p=>!!p.properties.find(u=>{var h;return u.implements&&u.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((h=u.getDefaultValue())==null?void 0:h.value)===!0}))){const u=t[0].properties.find(f=>f.implements&&f.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),h=u==null?void 0:u.defaultValue;if(h)h.value=!0;else if(u!=null&&u.dataType){const f=(e=u==null?void 0:u.dataType)==null?void 0:e.id.split("-id")[0],R=b({id:f+"-default-value-id",version:1,type:i.LiteralValue,name:C.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:u==null?void 0:u.dataType.toReference()},r.project);return R.setParent(u==null?void 0:u.dataType),R.initChildren(),R.addSelfToProject(),{newEntities:[R]}}return{newEntities:[]}}const a=r.project.get(_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),s=al(a,"Main database");if(s.errors.length>0)return{newEntities:[]};const o=s.implemented.properties.find(p=>p.implements&&p.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),l=o==null?void 0:o.defaultValue;if(l)l.value=!0;else if(o!=null&&o.dataType){const p=o==null?void 0:o.dataType.id.split("-id")[0],u=b({id:p+"-default-value-id",version:1,type:i.LiteralValue,name:C.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:o==null?void 0:o.dataType.toReference()},r.project);u.setParent(o==null?void 0:o.dataType),u.initChildren(),u.addSelfToProject()}return{newEntities:[s.implemented]}}}return{newEntities:[]}}function PS(r){return r.implements.filter(t=>t.type===i.BuiltInBaseEntity).map(t=>{switch(t.id){case _["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=r.project.entities.filter(l=>l.implements.find(p=>p.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(l=>!!l.properties.find(p=>{var u;return p.implements&&p.implements.id===_["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((u=p.getDefaultValue())==null?void 0:u.value)===!0}));if(!a)return{newEntities:[]};const s=r.properties.find(l=>l.implements&&l.implements.id===_["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id),o=s==null?void 0:s.defaultValue;if(s&&(s!=null&&s.dataType)&&!o){const l=s==null?void 0:s.dataType.id.split("-id")[0],p=b({id:l+"-default-value-id",version:1,type:i.LiteralValue,name:C.EntityTemplate,autogeneration:null,value:null,valueAsType:a,parent:s==null?void 0:s.dataType.toReference()},r.project);return p.setParent(s==null?void 0:s.dataType),p.initChildren(),p.addSelfToProject(),{newEntities:[p]}}return{newEntities:[]}}}}),{newEntities:[]}}function al(r,e,t){const n=t||de(e,i.DefinitionEntity,r.project),a=n.split("-id"),s=a[a.length-1||0]||n,o={id:n,version:1,name:e,type:i.DefinitionEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[r],x:0,y:0,parent:r.project},l=Zo(o,r.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=OS(r),u=b(o,r.project);u.setParent(r.project),u.initChildren();const h=r.properties.map(v=>{const I=s+"-"+de(w(v,r.project),i.Property,r.project),D=v.clone(u,I);return D.abstract=!1,D.implements=v,D.setParent(u),u.addProperty(D),D}),f=r.abstractMethods.map(v=>{const I=s+de(v.name,i.FunctionDeclaration,r.project),D=v.implementAsFunctionDeclaration(I),S={id:I+"-parent-ref-id",type:i.GenericReference,entityId:n,entityType:i.DefinitionEntity},$={...D,implements:v,parent:S},j=b($,r.project);return u.addMethod(j),j.setParent(u),j.initChildren(),j.implements=v,j});o.properties=h,o.methods=f;const R=PS(u);return{implemented:u,errors:[],entitiesChanges:{new:[u,...p.newEntities,...R.newEntities],updated:[u],deleted:[]}}}function Ku(r,e){return e.entities.find(a=>{const s=a.properties,o=s.map(f=>f.name),l=r.every(f=>o.includes(f)),p=o.filter(f=>!r.includes(f)),u=s.every(f=>!p.includes(f.name)||!f.required);return l&&u})||null}function CS(r,e,t=et.OrDataTypeGroup){const n=[],a=[],s=[],l={id:e.id+"--nested-data-type-id-"+r.id,version:1,type:i.DataType,entity:r.toJSON(),isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:t,parent:e.toReference()},p=b(l,r.project);return a.push(p),p.setParent(e),p.initChildren(),p.setEntity(r),p.addSelfToProject(),{updated:m(n),added:m(a),removed:m(s),self:p}}function Xu(r,e,t,n){const a=[],s=[],o=[];switch(typeof r){case"string":let l=!1;const p=new Date(r);if(p instanceof Date&&!isNaN(p.valueOf())&&(l=!0),l){const u=e.project.getBuiltIn(_[i.PrimitiveEntity][C.Date].id);e.setEntity(u);break}else{const u=e.project.getBuiltIn(_[i.PrimitiveEntity][C.String].id);e.setEntity(u);break}case"number":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Number].id));break;case"boolean":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Boolean].id));break;case"object":if(r===null){e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Null].id));break}else if(Array.isArray(r))if(e.sync({isList:!0}),r.length>0){const u=r.slice(0,5).filter(f=>f!==void 0);if(u.every(f=>typeof f==typeof u[0])&&(typeof u[0]!="object"||u[0]===null))switch(typeof u[0]){case"string":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.String].id));break;case"number":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Number].id));break;case"boolean":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Boolean].id));break;case"object":e.setEntity(e.project.getBuiltIn(_[i.PrimitiveEntity][C.Null].id));break}else{const f=[];let R=!1;u.forEach((I,D)=>{if(Array.isArray(I)&&(R=!0),typeof I=="object"&&!Array.isArray(I)&&I!==null){const S=sl(I,e.project,{...t,id:e.id+"--or-child-data-type-entity-id-"+D},n);S.hasCreated&&f.push(S.changeSet.self),a.push(...S.changeSet.updated),s.push(...S.changeSet.added),o.push(...S.changeSet.removed)}});const v=m(f);if(!v.length&&!R){u.forEach(I=>{const D={id:M.UUID.uuid(),version:1,type:i.DataType,entity:null,isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:et.OrDataTypeGroup,parent:e.toReference()},S=b(D,e.project);switch(S.setParent(e),S.initChildren(),S.addSelfToProject(),typeof I){case"string":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.String].id));break;case"number":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.Number].id));break;case"boolean":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.Boolean].id));break;case"object":S.setEntity(S.project.getBuiltIn(_[i.PrimitiveEntity][C.Null].id));break}});break}else v.length===1&&!R?e.setEntity(v[0]):u.forEach((I,D)=>{if(typeof I=="object"&&!Array.isArray(I)&&I!==null){const S=Ku(Object.keys(I),e.project);if(S){const $=CS(S||v[0],e,et.OrDataTypeGroup);a.push(...$.updated),s.push(...$.added),o.push(...$.removed)}}else{const S={id:e.id+"--or-child-data-type-id--"+D,version:1,type:i.DataType,entity:null,isList:Array.isArray(I),asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:et.OrDataTypeGroup,parent:e.toReference()},$=b(S,e.project);$.setParent(e),$.initChildren(),$.addSelfToProject();const j=Xu(I,$,{...t,id:e.id+"--or-child-data-type-entity-id-"+D},n);a.push(...j.updated),s.push(...j.added),o.push(...j.removed)}})}}else{const u=sl(r[0],e.project,{...t},n);e.setEntity(u.changeSet.self),a.push(...u.changeSet.updated),s.push(...u.changeSet.added),o.push(...u.changeSet.removed);break}else{const u=sl(r,e.project,{...t},n);e.setEntity(u.changeSet.self),a.push(...u.changeSet.updated),s.push(...u.changeSet.added),o.push(...u.changeSet.removed);break}}return{updated:m(a),added:m(s),removed:m(o),self:e}}function sl(r,e,t,n){const a=[],s=[],o=[],l=Object.keys(r),p=Ku(l,e);if(p)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],self:p}};const u=n?t.name+" of "+n.name:t.name,f={id:t.id||de(u,i.DefinitionEntity,e),version:1,name:u,type:i.DefinitionEntity,description:t.description||null,static:t.static||!1,abstract:t.abstract||!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[],x:0,y:0,parent:e.toReference()},R=b(f,e);return R.setParent(e),R.initChildren(),R.addSelfToProject(),s.push(R),l.forEach((v,I)=>{const D=de(u+" "+v,i.Property,e),S={id:D,version:1,name:v,type:i.Property,description:null,static:!1,abstract:!1,defaultValue:null,constant:!1,dataType:null,implements:null,index:I,hidden:!1,private:!1,required:!0,parent:R.toReference()},$=b(S,e);$.setParent(R),$.initChildren(),$.addSelfToProject(),s.push($);const j=r[v],oe={id:D+"--data-type-id",version:1,type:i.DataType,entity:null,isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parent:$.toReference()},ae=b(oe,e);ae.setParent($),ae.initChildren(),ae.addSelfToProject(),s.push(ae);const Xe=Xu(j,ae,{...t,name:v,id:D+"--data-type-entity-id"},n||R);a.push(...Xe.updated),s.push(...Xe.added),o.push(...Xe.removed)}),{hasCreated:!0,changeSet:{updated:m(a),added:m(s),removed:m(o),self:R}}}function ol(r,e){const t=Qr(r);if(t.length===0)return{list:[],last:null};let n=null;return{list:t.flatMap(s=>{if(s===e)return n=s,[s];const o=ol(s,e);return o.last&&(n=o.last),[s,...o.list]}),last:n}}function wS(r,e,t=new Set){const n=cr(r),a=cr(e),s=n.filter(p=>!a.includes(p)),o=n.filter(p=>a.includes(p)),l=s.reduce((p,u)=>t.has(u.id)?p:(t.add(u.id),m([...p,...wS(u,e,t)])),[]);return m([...o,...l])}function es(r,e){const t=ol(r,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function Rq(r,e){return!!ol(r,e).last}function gq(r){if(We.includes(r.type))return r;if([...Xt,i.VariableDeclaration].includes(r.type)){const e=r.parent;return We.includes(e.type)?e:null}return null}function Qu(r,e){if(!r||!e)throw new Error("Both entities must be defined to find a common ancestor");if(r===e)return r;const t=r.parent;if(t){if(t===e)return e;if(t.type===i.Project)return null}else return null;const n=e.parent;if(n){if(n===r)return r;if(n.type===i.Project)return null}else return null;return Qu(t,n)}function lt(r){if(ss.includes(r.type)){if(r.type===i.FunctionDeclaration){const e=r.parent;if(e.type===i.DefinitionEntity)return e;if(e.type===i.Loop)return e}return r}else{const e=r.parent;return e?lt(e):null}}function ll(r,e){const t=ts(r,e);if(!t)return null;if(ss.includes(t.type)){if(t.type===i.FunctionDeclaration){const n=ts(t.parent,e);if(n){if(n.type===i.DefinitionEntity)return n;if(n.type===i.Loop)return n}}return t}else{const n=t.parent?ts(t.parent,e):null;return n?ll(n,e):null}}function BS(r){if(!r)return null;if(Xt.includes(r.type))return r;const e=r.parent;return e?BS(e):null}function MS(r){if(!r)return null;if(Je.includes(r.type))return r;const e=r.parent;return e?MS(e):null}function _S(r){if(!r)return null;if(on.includes(r.type))return r;const e=r.parent;return e?_S(e):null}function bq(r){return r.type===i.VariableDeclaration?[r]:Je.includes(r.type)?[...r.inputs,...r.outputs||[]]:xe.includes(r.type)?r.outputs:ii.includes(r.type)||r.type===i.FunctionDeclaration?r.inputs:[]}function vq(r){const e=cr(r),t=[],n=[];Tp.includes(r.type)&&t.push(...ep(r));const a=e.filter(s=>{const o=t.includes(s);return o?!1:Xt.includes(s.type)&&!o?(n.push(s),!1):!0});return t.sort((s,o)=>es(o,s)?-1:0),n.sort((s,o)=>es(o,s)?-1:0),[...t,...n,...a]}function VS(r){return[...r].sort((e,t)=>es(t,e)?-1:0)}function Iq(r){const e=VS(r),t=[];return e.forEach(n=>{const a=t[t.length-1];if(a){const s=a[a.length-1];es(n,s)?t.push([n]):a.push(n)}else t.push([n])}),t}function Ot(r){const e=r.map(t=>lt(t));return m(e)}function ep(r){return Je.includes(r.type)?[...Ot(r.successCalls),...Ot(r.errorCalls)]:We.includes(r.type)?Ot(r.calls):[]}function Dq(r,e){return ep(r).includes(e)}function tp(r){return r.writesValues||[]}function Aq(r,e){return tp(r).includes(e)}function NS(r){var e;return Fe.includes((e=r==null?void 0:r.readsValue)==null?void 0:e.type)?r.readsValue:null}function Sq(r){return r.writesValues}function LS(r=[]){return r.map(NS).filter(e=>!!e)}function dl(r=[]){return r.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function GS(r=[]){return r.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function $S(r){return Fe.includes(r.type)?r:null}function FS(r){return r.writesValues.map($S).filter(e=>!!e)}function US(r=[]){return r.reduce((e,t)=>t.type===i.OutputMap?[...e,...FS(t)]:e,[])}function Ue(r){return Je.includes(r.type)?[...vn(Ot(r.successCalls)),...vn(Ot(r.errorCalls))]:We.includes(r.type)?vn(Ot(r.calls)):[]}function Oq(r){return Je.includes(r.type)?[...vn(Ot(r.successCalls)),...vn(Ot(r.errorCalls))]:We.includes(r.type)?vn(Ot(r.calls)):[]}function xS(r,e=new Set){return r.writesValues.filter(n=>Fe.includes(n.type)&&!e.has(n.id)).reduce((n,a)=>e.has(a.id)?n:[...n,...Ae(a,e)],[])}function jS(r,e=new Set){var n;return(((n=r.readsValue)==null?void 0:n.writesValues)||[]).filter(a=>Fe.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...Ae(s,e)],[])}function Ae(r,e=new Set){if(e.has(r.id))return[];if(r.type===i.ReturnStatement)return GS(r.outputs).reduce((n,a)=>[...n,...Ae(a,e)],[]);if(r.type===i.FunctionCall||r.type===i.Operation||r.type===i.Condition)return[...Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Ae(l||o,e)]},[]),...LS(r.inputs),...US(r.outputs)].reduce((s,o)=>[...s,...Ae(o,e)],[]);if(ii.includes(r.type)){const t=dl(r.inputs),a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Ae(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Ae(o,e)],[])}if(r.type===i.FunctionDeclaration){const t=[...dl(r.inputs)],a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Ae(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Ae(o)],[])}if(Fe.includes(r.type)){e.add(r.id);const n=Ue(r).reduce((a,s)=>{const o=lt(s);return[...a,...Ae(o||s,e)]},[]);return[r,...n,...jS(r,e),...xS(r,e)]}return[]}function Nt(r,e=new Set){return e.has(r.id)?[]:(e.add(r.id),[...cr(r).reduce((a,s)=>[...a,s,...Nt(s,e)],[])])}function vn(r){return r.reduce((e,t)=>t.type===i.ReturnStatement||t.type===i.ContinueStatement||t.type===i.BreakStatement?[...e,t]:[...e,t,...Ue(t)],[])}function kS(r){const e=r.entities||[],t=[...e,...r.functions||[],...r.events||[],...r.projects||[]],n=e.reduce((p,u)=>[...p,...u.properties],[]),a=e.reduce((p,u)=>[...p,...u.methods],[]),s=a.reduce((p,u)=>[...p,...dl(u.inputs),...vn(Ot(u.calls)),...u.returnStatements],[]),o=r.functions.reduce((p,u)=>[...p,...vn(Ot(u.calls)),...u.returnStatements],[]),l=r.events.reduce((p,u)=>[...p,...vn(Ot(u.calls)),...u.returnStatements],[]);return[...t,...n,...a,...s,...o,...l]}function qS(r,e){return e.filter(n=>{if(!n)return!1;switch(n.type){case i.FunctionCall:return n.inputs.find(a=>a.id===r.id)!==void 0||n.outputs.find(a=>a.id===r.id)!==void 0;case i.Condition:return n.successCalls.find(a=>a.id===r.id)!==void 0||n.errorCalls.find(a=>a.id===r.id)!==void 0||n.inputs.find(a=>a.id===r.id)!==void 0;case i.Operation:return n.outputs.find(a=>a.id===r.id)!==void 0;case i.VariableDeclaration:return Je.includes(r.type)?RO(r).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===n.id})!==void 0:!1;case i.DefinitionEntity:return n.properties.find(a=>a.id===r.id)!==void 0||n.methods.find(a=>a.id===r.id)!==void 0;case i.FunctionDeclaration:return n.inputs.find(a=>a.id===r.id)!==void 0||(n.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===r.id)!==void 0;default:return!1}})}function Pq(r){const e=kS(r.project);return qS(r,e)}function ts(r,e){return r?typeof r=="string"?e[r]:r.type===i.GenericReference?e[r.entityId]:e[r.id]?e[r.id]:null:null}function JS(r,e){const t=[];if(Xt.includes(r.type)){qt(r).forEach(s=>{const o=ll(s,e);o&&t.push(o)});const a=[...r.inputs||[],...r.outputs||[]].map(s=>{const o=ts(s,e);return o?bO(o,e):null}).filter(s=>s!==null);t.push(...m(a))}if(Fe.includes(r.type)){const n=ul(r);n&&t.push(n)}return m(t)}function Qr(r){const e=[];if(Xt.includes(r.type)){r.calledBy.forEach(a=>{const s=lt(a);s&&e.push(s)});const n=[...r.inputs||[],...r.outputs||[]].map(a=>ul(a)).filter(a=>a!==null);e.push(...m(n))}if(Fe.includes(r.type)){const t=ul(r);t&&e.push(t)}return m(e)}function qt(r){return[...r.calledByEntry||[],...r.calledByError||[],...r.calledBySuccess||[]]}function WS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ActionDescriptor)throw new Error("Entity must be an action descriptor to be flattened");return[r,...r.inputs.flatMap(n=>O(n,e,t)),...r.outputs.flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.parent?O(r.parent,e,t):[]]}function YS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ArgumentDeclaration)throw new Error("Entity must be an argument declaration to be flattened");return[r,...r.defaultValue?O(r.defaultValue,e):[],...r.writesValues.flatMap(n=>O(n,e,t)),...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function HS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.BreakStatement)throw new Error("Entity must be a break statement to be flattened");return[r,...r.outputs.flatMap(n=>O(n,e,t)),...r.throws?O(r.throws,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function zS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.BuiltInBaseEntity)throw new Error("Entity must be a built-in base entity to be flattened");return[r,...(r.properties||[]).flatMap(n=>O(n,e,t)),...(r.methods||[]).flatMap(n=>O(n,e,t)),...(r.abstractMethods||[]).flatMap(n=>O(n,e,t)),...(r.extends||[]).flatMap(n=>O(n,e,t))]}function ZS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Condition)throw new Error("Entity must be a condition to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function KS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ContinueStatement)throw new Error("Entity must be a continue statement to be flattened");return[r,...r.outputs.flatMap(n=>O(n,e,t)),...r.throws?O(r.throws,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function XS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.DefinitionEntity)throw new Error("Entity must be a definition entity to be flattened");return[r,...(r.extends||[]).flatMap(n=>O(n,e,t)),...(r.implements||[]).flatMap(n=>O(n,e,t)),...(r.properties||[]).flatMap(n=>O(n,e,t)),...(r.methods||[]).flatMap(n=>O(n,e,t)),...(r.abstractMethods||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function QS(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.DataType)throw new Error("Entity must be a data type to be flattened");return[r,...(r.andChildrenGroup||[]).flatMap(n=>O(n,e,t)),...(r.orChildrenGroup||[]).flatMap(n=>O(n,e,t)),...r.entity?O(r.entity,e,t):[],...r.parent?O(r.parent,e,t):[]]}function eO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.FunctionCall)throw new Error("Entity must be a function call to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function tO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.FunctionDeclaration)throw new Error("Entity must be a function declaration to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.returnStatements||[]).flatMap(n=>O(n,e,t)),...(r.calls||[]).flatMap(n=>O(n,e,t)),...r.implements?O(r.implements,e,t):[],...r.parent?O(r.parent,e,t):[]]}function nO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.GlobalEvent)throw new Error("Entity must be a global event to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.calls||[]).flatMap(n=>O(n,e,t)),...(r.returnStatements||[]).flatMap(n=>O(n,e,t)),...r.implements?O(r.implements,e,t):[],...r.parent?O(r.parent,e,t):[]]}function rO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.InputMap)throw new Error("Entity must be an input map to be flattened");return[r,...r.readsValue?O(r.readsValue,e,t):[],...r.declaration?O(r.declaration,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...r.parent?O(r.parent,e,t):[]]}function iO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.InstalledProject)throw new Error("Entity must be an installed project to be flattened");return[r,...(r.functions||[]).flatMap(n=>O(n,e,t)),...(r.events||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function aO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.InternalCall)throw new Error("Entity must be an internal call to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...r.parent?O(r.parent,e,t):[]]}function sO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.LiteralValue)throw new Error("Entity must be a literal value to be flattened");return[r,...r.valueAsType?Array.isArray(r.valueAsType)?r.valueAsType.flatMap(n=>O(n,e,t)):O(r.valueAsType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function oO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Loop)throw new Error("Entity must be a loop to be flattened");return[r,...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...r.body?O(r.body,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...(r.breakStatements||[]).flatMap(n=>O(n,e,t)),...(r.continueStatements||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function lO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Operation)throw new Error("Entity must be an operation to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...r.process?O(r.process,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function dO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.OutputMap)throw new Error("Entity must be an output map to be flattened");return[r,...(r.writesValues||[]).flatMap(n=>O(n,e,t)),...r.declaration?O(r.declaration,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...r.parent?O(r.parent,e,t):[]]}function cO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.PrimitiveEntity)throw new Error("Entity must be a primitive entity to be flattened");return[r,...(r.properties||[]).flatMap(n=>O(n,e,t)),...(r.methods||[]).flatMap(n=>O(n,e,t)),...(r.abstractMethods||[]).flatMap(n=>O(n,e,t))]}function uO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Project)throw new Error("Entity must be a project to be flattened");return[r,...(r.entities||[]).flatMap(n=>O(n,e,t)),...(r.functions||[]).flatMap(n=>O(n,e,t)),...(r.events||[]).flatMap(n=>O(n,e,t)),...(r.projects||[]).flatMap(n=>O(n,e,t)),...(r.variableDeclarations||[]).flatMap(n=>O(n,e,t)),...(r.variableInstances||[]).flatMap(n=>O(n,e,t)),...(r.operations||[]).flatMap(n=>O(n,e,t)),...(r.conditions||[]).flatMap(n=>O(n,e,t)),...(r.functionCalls||[]).flatMap(n=>O(n,e,t)),...(r.projects||[]).flatMap(n=>O(n,e,t)),...(r.loops||[]).flatMap(n=>O(n,e,t)),...(r.searches||[]).flatMap(n=>O(n,e,t))]}function pO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Property)throw new Error("Entity must be a property to be flattened");return[r,...r.defaultValue?O(r.defaultValue,e,t):[],...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function yO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ReturnDeclaration)throw new Error("Entity must be a return declaration to be flattened");return[r,...r.readsValue?O(r.readsValue,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function hO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ReturnStatement)throw new Error("Entity must be a return statement to be flattened");return[r,...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.throws?O(r.throws,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function fO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.Search)throw new Error("Entity must be a search to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputsDeclarations||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputsDeclarations||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...r.error?O(r.error,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.parent?O(r.parent,e,t):[]]}function mO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.ValueDescriptor)throw new Error("Entity must be a value descriptor to be flattened");return[r,...r.defaultValue?O(r.defaultValue,e,t):[],...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function TO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.VariableDeclaration)throw new Error("Entity must be a variable declaration to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(r.internalCalls||[]).flatMap(n=>O(n,e,t)),...(r.writesValues||[]).flatMap(n=>O(n,e,t)),...r.readsValue?O(r.readsValue,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.dataType?O(r.dataType,e,t):[],...r.parent?O(r.parent,e,t):[]]}function EO(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(e.has(r.id))return[];if(e.add(r.id),r.type!==i.VariableInstance)throw new Error("Entity must be a variable instance to be flattened");return[r,...(r.successCalls||[]).flatMap(n=>O(n,e,t)),...(r.errorCalls||[]).flatMap(n=>O(n,e,t)),...(r.inputs||[]).flatMap(n=>O(n,e,t)),...(r.outputs||[]).flatMap(n=>O(n,e,t)),...(r.internalCalls||[]).flatMap(n=>O(n,e,t)),...(r.writesValues||[]).flatMap(n=>O(n,e,t)),...r.readsValue?O(r.readsValue,e,t):[],...r.defaultValue?O(r.defaultValue,e,t):[],...(qt(r)||[]).flatMap(n=>O(n,e,t)),...r.declaration?O(r.declaration,e,t):[],...r.parent?O(r.parent,e,t):[]]}function np(){const r=new Set;return mg.flatMap(t=>O(t,r)).map(t=>t.id)}function O(r,e=new Set,t={ignoreBuiltInBaseEntities:!1}){if(!r)throw new Error("Entity must be defined to be flattened");if(r.type===i.GenericReference)return[];if(t.ignoreBuiltInBaseEntities&&(Jn.includes(r.type)||np().includes(r.id)))return[];if(e.has(r.id))return[];switch(r.type){case i.FunctionCall:return eO(r,e,t);case i.Operation:return lO(r,e,t);case i.Condition:return ZS(r,e,t);case i.Loop:return oO(r,e,t);case i.Search:return fO(r,e,t);case i.GlobalEvent:return nO(r,e,t);case i.ReturnStatement:return hO(r,e,t);case i.ContinueStatement:return KS(r,e,t);case i.BreakStatement:return HS(r,e,t);case i.VariableDeclaration:return TO(r,e,t);case i.DefinitionEntity:return XS(r,e,t);case i.FunctionDeclaration:return tO(r,e,t);case i.Project:return uO(r,e,t);case i.ActionDescriptor:return WS(r,e,t);case i.ArgumentDeclaration:return YS(r,e,t);case i.ReturnDeclaration:return yO(r,e,t);case i.ValueDescriptor:return mO(r,e,t);case i.InputMap:return rO(r,e,t);case i.OutputMap:return dO(r,e,t);case i.DataType:return QS(r,e,t);case i.InstalledProject:return iO(r,e,t);case i.InternalCall:return aO(r,e,t);case i.LiteralValue:return sO(r,e,t);case i.Property:return pO(r,e,t);case i.VariableInstance:return EO(r,e,t);case i.BuiltInBaseEntity:return t.ignoreBuiltInBaseEntities?[]:zS(r,e,t);case i.PrimitiveEntity:return t.ignoreBuiltInBaseEntities?[]:cO(r,e,t)}return[]}function cl(r,e){if(Jn.includes(r.type))return new Set;const t=JS(r,e),n=new Set(t.map(a=>a.id));if(r.type===i.LiteralValue&&r.valueAsType&&(Array.isArray(r.valueAsType)?r.valueAsType.forEach(a=>{n.add(a.id)}):n.add(r.valueAsType.id)),r.type===i.DataType&&r.entity&&(r.entity.type===i.DefinitionEntity?(r.entity.parent.entityId||r.entity.parent.id)!==r.id&&n.add(r.entity.id):n.add(r.entity.id)),fp.includes(r.type)){const a=r.parent;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(mp.includes(r.type)){const a=r.implements;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(gl.includes(r.type)){const a=r.declaration;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(An.includes(r.type)){const a=r.readsValue;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Xt.includes(r.type)){const a=[...r.calledBySuccess||[],...r.calledByEntry||[],...r.calledByError||[]];a.length&&a.forEach(s=>{s.type===i.GenericReference?n.add(s.entityId):n.add(s.id)})}return n}function rp(r){return r.type===i.FunctionCall||r.type===i.InternalCall||[i.Operation,i.Condition,i.Loop].includes(r.type)?r.declaration.inputs:r.type===i.FunctionDeclaration||ii.includes(r.type)?r.inputs:r.type===i.Search?r.inputsDeclarations:[]}function Cq(r,e){return e.type===i.Condition?e.inputs.find(t=>t.declaration.id===r.id):e.type===i.FunctionCall||e.type===i.Operation?e.inputs.find(t=>t.declaration.id===r.id):null}function RO(r){return Je.includes(r.type)?r.inputs:[]}function gO(r){var e;return r.type===i.FunctionCall?((e=r.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[i.Operation,i.Condition,i.Loop].includes(r.type)?r.declaration.outputs:r.type===i.Search?r.outputsDeclarations:xe.includes(r.type)?r.outputs:[]}function wq(r,e){return e.type===i.Condition?null:e.type===i.FunctionCall||e.type===i.Operation?e.outputs.find(t=>t.declaration.id===r.id):null}function Bq(r){return r.type===i.Condition?[]:Je.includes(r.type)?r.outputs:[]}function ul(r){const e=r.readsValue;return e?lt(e):null}function bO(r,e){const t=r.readsValue;return t?ll(t,e):null}function vO(r){const e=r.internalCalls||[];return m(Ot(m(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function Hi(r){const e=tp(r),t=[];return e.forEach(n=>{if(Fe.includes(n.type))t.push(n);else if(An.includes(n.type)){const a=n.parent;t.push(a)}}),t}function m(r){const e=new Set;return r.filter(t=>!t||e.has(t.id)?!1:(e.add(t.id),!0))}function cr(r,e=!1){const t=[];if(r.type===i.Project&&t.push(...(r==null?void 0:r.entities)||[],...(r==null?void 0:r.functions)||[],...(r==null?void 0:r.variableDeclarations)||[],...(r==null?void 0:r.variableInstances)||[],...(r==null?void 0:r.searches)||[],...(r==null?void 0:r.loops)||[],...(r==null?void 0:r.operations)||[],...(r==null?void 0:r.conditions)||[],...(r==null?void 0:r.functionCalls)||[],...(r==null?void 0:r.events)||[],...(r==null?void 0:r.projects)||[]),pt.includes(r.type)&&t.push(...(r==null?void 0:r.detachedChildren)||[]),r.type===i.DefinitionEntity){const n=[...r.suggestedMethods,...r.methods].flatMap(a=>a.collapsed&&e?[]:cr(a));t.push(...n)}if(r.type===i.Condition){const n=r.successCalls.map(s=>lt(s)),a=r.errorCalls.map(s=>lt(s));t.push(...n,...a)}if(ii.includes(r.type)){if(r.collapsed&&e)return[];const n=r.inputs.map(s=>Hi(s)).flat(),a=r.calls.map(s=>lt(s));t.push(...m(n),...a)}if(Je.includes(r.type)&&r.type!==i.Condition&&r.type!==i.Loop){const n=r==null?void 0:r.outputs.map(o=>Hi(o)).flat(),a=r.successCalls.map(o=>lt(o)),s=r.errorCalls.map(o=>lt(o));t.push(...m(n),...a,...s)}if(Fe.includes(r.type)){const n=Hi(r),a=vO(r);t.push(...n,...a)}if(r.type===i.Loop){const n=r.outputs.map(o=>Hi(o)).flat();if(r.body){const o=cr(r.body,e);t.push(...o)}const a=r.errorCalls.map(o=>lt(o)),s=r.successCalls.map(o=>lt(o));t.push(...m(n),...s,...a)}if(r.type===i.FunctionDeclaration){if(r.collapsed&&e)return[];const n=r.inputs.map(s=>Hi(s)).flat(),a=r.calls.map(s=>lt(s));t.push(...m(n),...a)}return m(t)}function IO(r,e=!1){const t=cr(r,e),n=[...t,...t.reduce((a,s)=>[...a,...IO(s,e)],[])];return m(n)}function DO(r){const e=Qr(r),t=[...e,...e.reduce((n,a)=>[...n,...DO(a)],[])];return m(t)}function pl(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...pl(t),...yl(t)]:[...e,t.name],[])}function yl(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...yl(t),...pl(t)]:[...e,t.name],[])}function ip(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...ip(t),...ap(t)]:[...e,t],[])}function ap(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...ap(t),...ip(t)]:[...e,t],[])}function sp(r){return[...yl(r),...pl(r)].filter((t,n,a)=>a.indexOf(t)===n)}function AO(r){return r.implements.length===0&&r.extends.length===0?null:r.implements.find(n=>n.type===i.BuiltInBaseEntity&&n.name===U.PERSISTED_ENTITY)?r:[...r.implements,...r.extends].reduce((n,a)=>{if(a.type===i.DefinitionEntity){const s=AO(a);if(s)return s}return n},null)}function Mq(r){const e=r.extends.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function _q(r){const e=r.implements.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function op(r){const e=r.extends.find(t=>t.type===i.DefinitionEntity);return e&&e.type===i.DefinitionEntity?e:null}function ur(r){const e=[...r.implements,...r.extends].reduce((t,n)=>n.type===i.BuiltInBaseEntity?[...t,n]:n.type===i.DefinitionEntity?[...t,...ur(n)]:t,[]);return m(e)}function lp(r){return r.type===i.PrimitiveEntity?!0:r.type===i.BuiltInBaseEntity?r.interactive:!ur(r).find(n=>!n.interactive)}function Vq(r){return r.parent===r.project&&r.project.variableDeclarations.includes(r)}function dp(r){return r.parent!==r.project?!1:i.VariableDeclaration===r.type?r.project.variableDeclarations.includes(r):i.VariableInstance===r.type?r.project.variableInstances.includes(r):i.FunctionCall===r.type?r.project.functionCalls.includes(r):i.Condition===r.type?r.project.conditions.includes(r):i.Operation===r.type?r.project.operations.includes(r):i.Loop===r.type?r.project.loops.includes(r):i.Search===r.type?r.project.searches.includes(r):!1}function SO(r){if([...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||dp(r))return!1;const e=Qr(r);return e.length===0?!0:e.some(t=>SO(t))}function cp(r){return[...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||dp(r)?!1:Qr(r).length===0}function OO(r,e=0){if(cp(r)){const t=Qr(r);return t.length===0?r:t.map(a=>OO(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function PO(r){const e=[];if(cp(r))e.push(r);else return[];return Qr(r).forEach(n=>{e.push(...PO(n))}),e}function CO(r){return r.type===i.FunctionDeclaration&&r.parent!==r.project&&!![i.DefinitionEntity,i.Loop,i.InstalledProject].includes(r.parent.type)}function Nq(r,e){const t=new Map;return r.forEach(n=>{t.set(n.id,n)}),e.forEach(n=>{t.set(n.id,n)}),Array.from(t.values())}function hl(r){switch(r){case i.DefinitionEntity:return ei;case i.FunctionDeclaration:return jr;case i.VariableDeclaration:return sn;case i.VariableInstance:return Wr;case i.FunctionCall:return Xr;case i.Operation:return kr;case i.Condition:return Jr;case i.ReturnStatement:return Zr;case i.Loop:return qr;case i.Search:return Yr;case i.InputMap:return xn;case i.OutputMap:return jn;case i.ArgumentDeclaration:return zr;case i.ReturnDeclaration:return kt;case i.Property:return xr;case i.InstalledProject:return Hr;case i.Project:return M;case i.BuiltInBaseEntity:return In;default:return null}}function Pt(r,e){if(pt.includes(r.type))return r;if(Jn.includes(r.type))return null;const t=r.parent;if(!t)return null;if(t.type===i.GenericReference){const n=A(t);if(!n)return null;const a=e.get(n);return a?Pt(a,e):null}else return t===e?e:Pt(t,e)}function up(r,e){if(Jn.includes(r.type)||e.getBuiltIn(r.id))return null;const t=Lt(r.parent,e);return t?t===e?pt.includes(r.type)?r:null:t.type===i.DefinitionEntity?r:up(t,e):null}function fl(r,e,t){if(r===e||e===t||r===t)return!1;const n=Pt(e.parent,t);return n===r?!0:fl(n,e,t)}var ml=(r=>(r.SameBothLocal="same-both-local",r.AInB="a-in-b",r.BInA="b-in-a",r.ParallelInCommonParent="parallel-in-common-parent",r.ParallelInProject="parallel-in-project",r.AIsGlobalBIsNot="a-is-global-b-is-not",r.BIsGlobalAIsNot="b-is-global-a-is-not",r.SameBothGlobal="same-both-global",r))(ml||{});function ns(r,e,t){const n=Pt(r,t),a=Pt(e,t);if(!n)throw new Error("Could not find scope owner for the entity: "+r.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(n===a&&n.type!==i.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:n};if(n===a&&n.type===i.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:n};if(n.type===i.Project&&a.type!==i.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:n};if(n.type!==i.Project&&a.type===i.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(fl(n,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:n};if(fl(a,n,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=Qu(n,a);return l===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:l}:l?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:Pt(l,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function wO(r,e,t){const n=ns(r,e,t);if(!n.compatible||n.type!=="same-both-local")return null;if(r===e)return r;let a=Pt(r.parent,t);if(a){if(a===e)return e;if(a.type===i.Project)return r}else return r;for(;a;){if(a){if(a===e)return e;if(a.type===i.Project)return r}else return r;a=Pt(a.parent,t)}let s=Pt(e.parent,t);if(s){if(s===r)return r;if(s.type===i.Project)return e}else return e;for(;s;){if(s){if(s===r)return r;if(s.type===i.Project)return e}else return e;s=Pt(s.parent,t)}return null}function BO(r){return r.length===0?null:r.length===1?r[0]:r.reduce((t,n)=>{const a=wO(t,n,n.project);return!a||a===n?t:n},r[0])}function Lt(r,e){if(!r)return null;let t;return typeof r=="string"?t=r:r.type===i.GenericReference?t=A(r):t=r.id,t===e.id?e:e.get(t)}function pr(r){if(!r)return null;if(Jn.includes(r.type))return r;if(r.type===i.Project)return null;if(r.project.getBuiltIn(r.id))return r;const e=r.parent;return!e||e.type===i.Project?null:pr(e)}function Lq(r,e){var t;if(r.readsValue){const n=Lt(r.readsValue,e.project);e.setValueWriter(n),n.addValueReader(e)}else r.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function rs(r){const e=[];function t(s,o){return e.some(l=>l.blockedByCaller===s&&l.blockedByCalling===o)}function n(s,o){t(s,o)||e.push({blockedByCaller:s,blockedByCalling:o})}const a=up(r,r.project);return r.calledBySuccess.forEach(s=>{[...s.successCalls||[]].forEach(p=>{xe.includes(p.type)&&p!==r&&(Ue(r).find(f=>f===p)||n(s,p))});let l;if(Je.includes(s.type)&&(l=s),l){const p=rs(l);p.reachable||Ue(r).find(f=>f===s)||p.blocks.forEach(f=>{n(s,f.blockedByCalling)})}}),r.calledByError.forEach(s=>{[...s.errorCalls||[]].forEach(p=>{xe.includes(p.type)&&p!==r&&(Ue(r).find(f=>f===p)||n(s,p))});let l;if(Je.includes(s.type)&&(l=s),l){const p=rs(l);p.reachable||Ue(r).find(f=>f===s)||p.blocks.forEach(f=>{n(s,f.blockedByCalling)})}}),r.calledByEntry.forEach(s=>{if([...s.calls||[]].forEach(p=>{xe.includes(p.type)&&p!==r&&(Ue(r).find(f=>f===p)||n(s,p))}),s===a)return;let l;if(s.type===i.FunctionDeclaration){const p=lt(s);if(p.type===i.DefinitionEntity)return;p.type===i.Loop&&(l=p)}if(l){const p=rs(l);p.reachable||p.blocks.forEach(u=>{n(s,u.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function Gq(r){return ss.includes(r.type)?r.type===i.FunctionDeclaration?!CO(r):!0:!1}function $q(r){if(i.ActionDescriptor===r.type){if(r.project.operationDeclarations.find(s=>s.id===r.id))return i.Operation;if(r.project.globalEventActionDescriptors.find(s=>s.id===r.id))return i.GlobalEvent;if(r.project.loopDeclarations.find(s=>s.id===r.id))return i.Loop;if(r.project.conditionDeclarations.find(s=>s.id===r.id))return i.Condition}return r.type}function zi(r,e){if(r.type!==i.DefinitionEntity||r.abstract)return!1;const t=op(r)||r;return!!sp(t).includes(e)}function Fq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,U.PERSISTED_ENTITY)){e.push(t);return}}),m(e)}function Uq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,U.RELATIONAL_DATABASE)){e.push(t);return}}),m(e)}function xq(r){return r.type!==i.DefinitionEntity||r.abstract||!zi(r,U.PERSISTED_ENTITY)?null:(r==null?void 0:r.properties.find(t=>{var n;return((n=t.implements)==null?void 0:n.id)===_[i.BuiltInBaseEntity][U.PERSISTED_ENTITY].properties.primaryKey.id&&!t.abstract}))||null}function jq(r){if(r.type!==i.DefinitionEntity)return[];if(r.abstract)return[];if(!zi(r,U.PERSISTED_ENTITY))return[];const e=[],t=r.properties.filter(n=>{var a;return((a=n.implements)==null?void 0:a.id)!==_[i.BuiltInBaseEntity][U.PERSISTED_ENTITY].properties.database.id&&!n.abstract});return e.push(...t),e}function kq(r){var t;if(!r||r.type!==i.DefinitionEntity||!zi(r,U.PERSISTED_ENTITY))return null;const e=r.properties.find(n=>{var a;return((a=n.implements)==null?void 0:a.id)===_[i.BuiltInBaseEntity][U.PERSISTED_ENTITY].properties.database.id});return(t=e==null?void 0:e.getDefaultValue())==null?void 0:t.valueAsType}function He(r,e){var n;if(!Rp.includes(e.type)||!r)return e.project||null;let t=e.project;return r.type===i.Project?t=r:((n=e.project)==null?void 0:n.id)!==r.project.id&&(t=r.project),t}function qq(r,e){const t=[];if(r.parent)if(r.id===r.parent)t.push(new g({id:`${r.id}--${r.parent}--${T.SelfReference}`,code:T.SelfReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to itself at 'parent'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));else{const n=e.get(r.parent);n?[i.Project,i.DataType].includes(n.type)||t.push(new g({id:`${r.id}--${r.parent}--${T.InvalidParentReference}`,code:T.InvalidParentReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a parent reference that isn't pointing to an entity of type 'project' or 'data-type'.`,issue:null})):t.push(new g({id:`${r.id}--${r.parent}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return r.implements&&Array.isArray(r.implements)?r.implements.forEach(n=>{if(r.id===n){t.push(new g({id:`${r.id}--${n}--${T.SelfReference}`,code:T.SelfReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to itself at one of the 'implements' references. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));return}const a=e.get(n);a?[i.DefinitionEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new g({id:`${r.id}--${n}--${T.InvalidImplementsReference}`,code:T.InvalidImplementsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.InvalidImplementsReference}`,code:T.InvalidImplementsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an entity of type 'definition-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${n}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}):t.push(new g({id:`${r.id}--${B.InvalidObjectStructure}`,code:B.InvalidObjectStructure,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' property that isn't an array.`,issue:null})),r.extends&&Array.isArray(r.extends)&&r.extends.forEach(n=>{const a=e.get(n);a?[i.DefinitionEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new g({id:`${r.id}--${n}--${T.InvalidExtendsReference}`,code:T.InvalidExtendsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'extends' reference that isn't pointing to a non-abstract entity. Did you want to use the property 'implements', which holds a list of references to absract entities, instead?`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.InvalidExtendsReference}`,code:T.InvalidExtendsReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'extends' reference that isn't pointing to an entity of type 'definition-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new g({id:`${r.id}--${n}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${n}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}const De=class De{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"static");c(this,"abstract");c(this,"type",i.DefinitionEntity);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"implements",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestedProperties",[]);c(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let n=t;if(e.parent){const p=A(e.parent);n=t.get(p)}const a=[];e.implements&&e.implements.forEach(p=>{a.push(t.get(p)||t.getBuiltIn(p))});const s=[];e.extends&&e.extends.forEach(p=>{s.push(t.get(p)||t.getBuiltIn(p))});const o={id:e.id,version:1,name:e.name,type:i.DefinitionEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:n},l=b(o,t);return l.setParent(n),l.initChildren(),l}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=qq(n,t),o=Zo(n,t);a.push(...s,...o,...je(n));const l=n.parent?t.get(n.parent):null;if(l&&l.type===i.DataType){const p=l;p.entity&&a.push(new g({id:`${e.id}--${T.NewEntityWouldOverriteExisting}`,code:T.NewEntityWouldOverriteExisting,severity:E.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${p.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
404
404
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
405
405
  ${bn({describe_entity:p.entity.id})}
406
406
  Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return{errors:a,modifiedData:n}}get allBasePropertiesFromExtendedAndImplementedEntities(){return m([...this.extends.reduce((e,t)=>[...[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract),...e],[]),...this.implements.reduce((e,t)=>[...[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract),...e],[])])}get extendedPropertiesFromOriginalParents(){return m(this.extends.reduce((e,t)=>{const n=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...n]},[]))}get implementedPropertiesFromOriginalParents(){return m([...this.extends.reduce((e,t)=>{const n=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(s=>!!s.abstract&&!n.find(o=>o.name===s.name));return[...n,...a,...e]},[]),...this.implements.reduce((e,t)=>{const n=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(s=>!!s.abstract&&!n.find(o=>o.name===s.name));return[...n,...a,...e]},[])].filter(e=>!!e.abstract))}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new g({id:`${this.id}--${T.InvalidParentUpdate}`,code:T.InvalidParentUpdate,severity:E.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an '${this.type}', must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}hydrateAncestors(){const e=[],t=[],n=[];if(this.initialData.parent){const a=A(this.initialData.parent),s=this.project.get(a);s&&(this.setParent(s),e.push(s))}return this.initialData.extends.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addExtension(o),e.push(o))}),this.initialData.implements.forEach(a=>{const s=A(a),o=this.project.get(s);o&&(this.addImplementation(o),e.push(o))}),{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];return this.initialized=!0,this.syncImplementationProperties(),this.addExtendedProperties(),this.addSuggestions(),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];if(this.parent.type===i.DataType){const a=this.parent;a.entity=this,e.push(a)}else this.project.addDefinitionEntity(this);return{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}addExtension(e){return this.extends.includes(e)||this.extends.push(e),this}removeExtension(e){return this.extends=this.extends.filter(t=>t.id!==e.id),this}addImplementation(e){return this.implements.includes(e)||this.implements.push(e),this}removeImplementation(e){return this.implements=this.implements.filter(t=>t.id!==e.id),this}removeProperty(e){return this.properties=this.properties.filter(t=>t.id!==e.id),this}addMethod(e){return this.methods.includes(e)||(this.methods.push(e),this.suggestedMethods=this.suggestedMethods.filter(t=>t.name!==e.name)),this}removeMethod(e){return this.methods=this.methods.filter(t=>t.id!==e.id),this}addProperty(e){return this.properties.includes(e)||(this.properties.push(e),this.suggestedProperties=this.suggestedProperties.filter(t=>t.name!==e.name)),this}addSuggestedProperty(e){return this.suggestedProperties.includes(e)||this.suggestedProperties.push(e),this}addSuggestedMethod(e){return this.suggestedMethods.includes(e)||this.suggestedMethods.push(e),this}removeSuggestedProperty(e){return this.suggestedProperties=this.suggestedProperties.filter(t=>t.id!==e.id),this}removeSuggestedMethod(e){return this.suggestedMethods=this.suggestedMethods.filter(t=>t.id!==e.id),this}addAbstractMethod(e){return this.abstractMethods.includes(e)||this.abstractMethods.push(e),this}removeAbstractMethod(e){return this.abstractMethods=this.abstractMethods.filter(t=>t.id!==e.id),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.properties=this.initialData.properties.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.methods=this.initialData.methods.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.abstractMethods=this.initialData.abstractMethods.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.extends=this.initialData.extends.map(e=>b(e,this.project)),this.implements=this.initialData.implements.map(e=>b(e,this.project)),this.afterAllChildrenInitialized(),this)}syncImplementationProperties(){const e=this.properties,t=this.implementedPropertiesFromOriginalParents,n=[...this.allBasePropertiesFromExtendedAndImplementedEntities,...e];return t.filter(s=>!n.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id})).forEach(s=>{if(this.properties.find(u=>{var h;return((h=u.implements)==null?void 0:h.id)===s.id}))return;const l=this.properties.find(u=>u.name===s.name&&!!u.abstract&&!u.implements);if(l){l.implements=s,l.abstract=!1;return}const p=s.clone(this,M.UUID.uuid());p.initChildren(),p.implements=s,p.abstract=!1,this.addProperty(p)}),this}addExtendedProperties(){const e=this.properties,t=this.extendedPropertiesFromOriginalParents,n=t.filter(s=>t.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id})?!1:!s.abstract),a=new Set(e.map(s=>s.name));return n.forEach(s=>{if(a.has(s.name))return;a.add(s.name);const o=s.clone(this,M.UUID.uuid());o.initChildren(),this.addProperty(o)}),this}addSuggestions(){return this.implements.forEach(e=>{v5(this,e).forEach(a=>{const s=a.toJSON();s.id=`_suggestion--parent--${this.id}--${a.id}`;const o=b(s,this.project);o.suggestion=!0,o.setParent(this),o.initChildren(),this.addSuggestedProperty(o)}),I5(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),l=b(o,this.project);if(l.suggestion=!0,l.setParent(this),l.initChildren(),l.inputs.forEach(p=>{p.suggestion=!0}),l.returnStatements.length){const p=l.returnStatements[0];p.suggestion=!0,p.outputs.forEach(u=>{u.suggestion=!0})}this.addSuggestedMethod(l)})}),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.x=e.x||this.x,this.y=e.y||this.y,this.static=e.static||this.static,this.abstract=e.abstract||this.abstract,this}async load(e=V,...t){return await De.repository.load(this.id,...t),this}async create(e=V,...t){return await De.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await De.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await De.repository.delete(this.id,...t),this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const n=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.properties.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.methods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),{affected:m(n),removed:m(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.properties.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),{affected:m(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(n=>n.toFlat(e)),...this.implements.flatMap(n=>n.toFlat(e)),...this.properties.flatMap(n=>n.toFlat(e)),...this.methods.flatMap(n=>n.toFlat(e)),...this.abstractMethods.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(n=>n.toFlatIds(e)),...this.implements.flatMap(n=>n.toFlatIds(e)),...this.properties.flatMap(n=>n.toFlatIds(e)),...this.methods.flatMap(n=>n.toFlatIds(e)),...this.abstractMethods.flatMap(n=>n.toFlatIds(e))])}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),implements:this.implements.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e)),parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l;let t;return(n=e.seenEntityMaps)!=null&&n.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||Ye(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(s=e.seenEntities)!=null&&s.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:1,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(p=>p.toJSONClone({...e,newId:null})),methods:this.methods.map(p=>p.toJSONClone({...e,newId:null})),abstractMethods:this.abstractMethods.map(p=>p.toJSONClone({...e,newId:null})),implements:this.implements.map(p=>p.type===i.BuiltInBaseEntity?p.toJSON():p.toJSONClone({...e,newId:null})),extends:this.extends.map(p=>p.type===i.BuiltInBaseEntity?p.toJSON():p.toJSONClone({...e,newId:null})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,name:this.name,description:this.description,type:this.type,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(a=>a.toReference(e)),methods:this.methods.map(a=>a.toReference(e)),abstractMethods:this.abstractMethods.map(a=>a.toReference(e)),implements:this.implements.map(a=>a.toReference(e)),extends:this.extends.map(a=>a.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(n=>n.toFlatJSON(e)),...this.methods.flatMap(n=>n.toFlatJSON(e)),...this.abstractMethods.flatMap(n=>n.toFlatJSON(e)),...this.implements.flatMap(n=>n.toFlatJSON(e)),...this.extends.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,static:this.static,abstract:this.abstract,extends:this.extends.map(t=>t.id),implements:this.implements.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(n=>n.toFlatGenerationTarget(e)),...this.methods.flatMap(n=>n.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(n=>n.toFlatGenerationTarget(e)),...this.implements.filter(n=>n.type===i.DefinitionEntity).flatMap(n=>n.toFlatGenerationTarget(e)),...this.implements.filter(n=>n.type===i.DefinitionEntity).flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){return this.errors=b5(this),{success:!0,error:null,data:null}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var v,I,D;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.DefinitionEntity,a);s.properties=[],s.methods=[],s.abstractMethods=[];const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const u=ke(s,a);e&&u.setParent(e),n&&u.subscribe(),u.initChildren();const h=(v=this.properties)==null?void 0:v.map((S,$)=>S.clone(u,p+"-property-"+$+"-id",n));u.properties=h;const f=(I=this.methods)==null?void 0:I.map((S,$)=>S.clone(u,p+"-method-"+$+"-id",n));u.methods=f;const R=(D=this.abstractMethods)==null?void 0:D.map((S,$)=>S.clone(u,p+"-abstract-method-"+$+"-id",n));return u.abstractMethods=R,u}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return al(this,e,t)}getAllInteractiveMethods(){const e=this.implements.filter(n=>n.type===i.DefinitionEntity||n.type===i.BuiltInBaseEntity&&n.interactive);return m([...this.methods,...this.extends.flatMap(n=>n.getAllInteractiveMethods()),...e.flatMap(n=>n.getAllInteractiveMethods())])}inferFromInputs(e){if(this.parent.type!==i.DataType||!this.parent.inferred)return this;const t=[];e.forEach(s=>{t.find(l=>w(l,this.project)===w(s,this.project))||t.push(s)});const n=this.properties.filter(s=>!s.getDataType());t.forEach(s=>{const o=n.find(f=>w(f,this.project)===w(s,this.project));if(!o)return;const p=Ur(s.parent).getMasterInputWithValueWritterFromAllInstances(s),u=gn(p),h=u==null?void 0:u.clone(o,o.id+"--"+M.UUID.uuid()+"--data-type",!0);h&&o.setDataType(h),s.setDeclaration(o)});const a=[];return t.forEach(s=>{if(!s.declaration){a.push(s);return}}),a.length===0?this:(a.forEach(s=>{const o=this.properties.find(v=>w(v,this.project)===w(s,this.project));if(o){if(s.setDeclaration(o),!o.getDataType()){const I=Ur(s.parent).getMasterInputWithValueWritterFromAllInstances(s),D=gn(I),S=D==null?void 0:D.clone(o,o.id+"--"+M.UUID.uuid()+"--data-type",!0);S&&o.setDataType(S)}return}const l={id:s.id+"--"+M.UUID.uuid()+"--inferred-property",type:i.Property,version:1,name:w(s,this.project),description:s.description,defaultValue:null,static:!0,abstract:!1,private:!1,hidden:!1,required:!1,constant:!0,index:s.index,implements:null,dataType:null,parent:this.toReference()},p=b(l,this.project);p.setParent(this),p.initChildren();const h=Ur(s.parent).getMasterInputWithValueWritterFromAllInstances(s),f=gn(h),R=f==null?void 0:f.clone(p,l.id+"--"+M.UUID.uuid()+"--data-type",!0);return R&&p.setDataType(R),this.addProperty(p),s.setDeclaration(p),p}),this)}};c(De,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(De,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),c(De,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(De,"BASE_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,...De.INMUTABLE_BASE_PROPERTIES]),c(De,"MUTABLE_META_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,"x","y"]),c(De,"INMUTABLE_META_PROPERTIES",[...De.INMUTABLE_BASE_PROPERTIES]),c(De,"META_PROPERTIES",[...De.MUTABLE_META_PROPERTIES,...De.INMUTABLE_META_PROPERTIES]),c(De,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),c(De,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(De,"UPSTREAM_PROPERTIES",[...De.MUTABLE_UPSTREAM_PROPERTIES,...De.INMUTABLE_UPSTREAM_PROPERTIES]),c(De,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),c(De,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(De,"DOWNSTREAM_PROPERTIES",[...De.MUTABLE_DOWNSTREAM_PROPERTIES,...De.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(De,"PROPERTIES",[...De.META_PROPERTIES,...De.UPSTREAM_PROPERTIES,...De.DOWNSTREAM_PROPERTIES]);let ei=De;function Jq(r){const e=X9(),t=r.toJSON();e.safeParse(t).success;const a=[];return Be(r.errors,a)}const as=class as{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",i.BuiltInBaseEntity);c(this,"abstract",!1);c(this,"static");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"interactive",!1);c(this,"errors",[]);c(this,"project");this.initialData=this.initialData||e,this.project=this.project||t,this.id=this.id||e.id,this.version=this.version||e.version,this.name=this.name||e.name,this.static=this.static||e.static,this.interactive=this.interactive||e.interactive,this.abstract=e.abstract,this.properties=this.initialData.properties.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(n=>b(n,this.project))}get allBasePropertiesFromExtendedAndImplementedEntities(){return m(this.extends.reduce((e,t)=>{const n=[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract);return[...e,...n]},[]))}get extendedPropertiesFromOriginalParents(){return m(this.extends.reduce((e,t)=>{const n=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...n]},[]))}get implementedPropertiesFromOriginalParents(){return m([...this.extends.reduce((e,t)=>{const n=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(s=>!!s.abstract&&!n.find(o=>o.name===s.name));return[...n,...a,...e]},[])])}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(e=V,...t){return await as.repository.load(this.id,...t),this}remove(e={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(n=>n.toFlat(e)),...this.methods.flatMap(n=>n.toFlat(e)),...this.abstractMethods.flatMap(n=>n.toFlat(e)),...this.extends.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(n=>n.toFlatIds(e)),...this.methods.flatMap(n=>n.toFlatIds(e)),...this.abstractMethods.flatMap(n=>n.toFlatIds(e)),...this.extends.flatMap(n=>n.toFlatIds(e))])}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e))})}toReference(e=L){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(e=L){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(t=>t.toReference()),methods:this.methods.map(t=>t.toReference()),abstractMethods:this.abstractMethods.map(t=>t.toReference()),extends:this.extends.map(t=>t.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(n=>n.toFlatJSON(e)),...this.methods.flatMap(n=>n.toFlatJSON(e)),...this.abstractMethods.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(n=>n.toFlatGenerationTarget(e)),...this.methods.flatMap(n=>n.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=Jq(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}implement(e,t){return al(this,e,t)}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(n=>n.type===i.BuiltInBaseEntity&&n.interactive||n.type===i.PrimitiveEntity).forEach(n=>{n instanceof as&&e.push(...n.getAllInteractiveMethods())})),m(e)}};c(as,"repository",{load:async(e,...t)=>null});let In=as;function Wq(r){const e=k9(),t=r.toJSON();e.safeParse(t).success;const a=[];return Be(r.errors,a)}const El=class El{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",i.PrimitiveEntity);c(this,"static");c(this,"abstract");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(this,"project");this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.static=e.static,this.abstract=e.abstract,this.properties=this.initialData.properties.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(n=>{const a=b(n,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(n=>{const a=b(n,this.project);return a.parent=this,a})}get allBasePropertiesFromExtendedAndImplementedEntities(){return m(this.extends.reduce((e,t)=>{const n=[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract);return[...e,...n]},[]))}get extendedPropertiesFromOriginalParents(){return m(this.extends.reduce((e,t)=>{const n=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...n]},[]))}get implementedPropertiesFromOriginalParents(){return m([...this.extends.reduce((e,t)=>{const n=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(s=>!!s.abstract&&!n.find(o=>o.name===s.name));return[...n,...a,...e]},[])])}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(e=V,...t){return await El.repository.load(this.id,...t),this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(n=>n.toFlat(e)),...this.methods.flatMap(n=>n.toFlat(e)),...this.abstractMethods.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(n=>n.toFlatIds(e)),...this.methods.flatMap(n=>n.toFlatIds(e)),...this.abstractMethods.flatMap(n=>n.toFlatIds(e))])}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e))})}toReference(e=L){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(e=L){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,properties:this.properties.map(t=>t.toReference()),methods:this.methods.map(t=>t.toReference()),abstractMethods:this.abstractMethods.map(t=>t.toReference()),extends:this.extends.map(t=>t.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(n=>n.toFlatJSON(e)),...this.methods.flatMap(n=>n.toFlatJSON(e)),...this.abstractMethods.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(n=>n.toFlatGenerationTarget(e)),...this.methods.flatMap(n=>n.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=Wq(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(n=>n.type===i.BuiltInBaseEntity&&n.interactive||n.type===i.PrimitiveEntity).forEach(n=>{n instanceof In&&e.push(...n.getAllInteractiveMethods())}),m(e)}};c(El,"repository",{load:async(e,...t)=>null});let Kt=El;function ke(r,e){if(!r)throw new Error("Entity is null");const t=e.get(r.id);switch(r.type){case i.LiteralValue:return t||new Wi(r,e);case i.DefinitionEntity:return t||new ei(r,e);case i.PrimitiveEntity:return t||new Kt(r,e);case i.FunctionDeclaration:return t||new jr(r,e);case i.GlobalEvent:return t||new qi(r,e);case i.DataType:return t||new ki(r,e);case i.Property:return t||new xr(r,e);case i.FunctionCall:return t||new Xr(r,e);case i.Condition:return t||new Jr(r,e);case i.Operation:return t||new kr(r,e);case i.VariableDeclaration:return t||new sn(r,e);case i.VariableInstance:return t||new Wr(r,e);case i.OutputMap:return t||new jn(r,e);case i.ReturnDeclaration:return t||new kt(r,e);case i.ArgumentDeclaration:return t||new zr(r,e);case i.InputMap:return t||new xn(r,e);case i.Project:return t||new M(r);case i.InstalledProject:return t||new Hr(r,e);case i.ActionDescriptor:return t||new se(r,e);case i.ReturnStatement:return t||new Zr(r,e);case i.Loop:return t||new qr(r,e);case i.Search:return t||new Yr(r,e);case i.ValueDescriptor:return t||new Kr(r,e);case i.BuiltInBaseEntity:return t||new In(r,e);case i.InternalCall:return t||new Ji(r,e);case i.ContinueStatement:return t||new St(r,e);case i.BreakStatement:return t||new Yi(r,e);case i.GenericReference:return e.get(r.entityId);default:throw new Error("Invalid entity type: "+r.type)}}function b(r,e){if(!r)throw new Error("Entity is null");const t=ke(r,e);return t.subscribe(),t}function Yq(r,e){if(!r)throw new Error("Entity is null");switch(r.type){case i.LiteralValue:return Wi.fromGenerationTarget(r,e);case i.DefinitionEntity:return ei.fromGenerationTarget(r,e);case i.FunctionDeclaration:return jr.fromGenerationTarget(r,e);case i.GlobalEvent:return qi.fromGenerationTarget(r,e);case i.DataType:return ki.fromGenerationTarget(r,e);case i.Property:return xr.fromGenerationTarget(r,e);case i.FunctionCall:return Xr.fromGenerationTarget(r,e);case i.Condition:return Jr.fromGenerationTarget(r,e);case i.Operation:return kr.fromGenerationTarget(r,e);case i.VariableDeclaration:return sn.fromGenerationTarget(r,e);case i.VariableInstance:return Wr.fromGenerationTarget(r,e);case i.OutputMap:return jn.fromGenerationTarget(r,e);case i.ReturnDeclaration:return kt.fromGenerationTarget(r,e);case i.ArgumentDeclaration:return zr.fromGenerationTarget(r,e);case i.InputMap:return xn.fromGenerationTarget(r,e);case i.InstalledProject:return Hr.fromGenerationTarget(r,e);case i.ReturnStatement:return Zr.fromGenerationTarget(r,e);case i.Loop:return qr.fromGenerationTarget(r,e);case i.Search:return Yr.fromGenerationTarget(r,e);case i.ActionDescriptor:return se.fromGenerationTarget(r,e);case i.ValueDescriptor:return Kr.fromGenerationTarget(r,e);case i.InternalCall:return Ji.fromGenerationTarget(r,e);case i.ContinueStatement:return St.fromGenerationTarget(r,e);case i.BreakStatement:return Yi.fromGenerationTarget(r,e);default:throw new Error("Invalid entity type: "+r.type)}}const L={seenEntityMaps:new Map,seenEntities:new Set};class MO{constructor(){c(this,"initialData")}}const V={cascade:!1},_O={load:async(r,...e)=>null},Hq={create:async(r,...e)=>r,update:async(r,...e)=>r,delete:async(r,...e)=>{},..._O};class zq{}class Zq extends MO{}class Kq{}class Xq{}class Qq{}class pp{}class eJ extends pp{}class tJ extends pp{}class nJ{}class qn{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==i.GenericReference)e.readsValue=b(e.initialData.readsValue,e.project);else if(e.initialData.readsValue&&e.initialData.readsValue.type===i.GenericReference){const t=Lt(e.initialData.readsValue,e.project);t&&(e.readsValue=t)}if(e.readsValue){if(Fe.includes(e.readsValue.type)){let t=e.parent;pt.includes(t.type)||(t=t.parent);const n=e.type===i.InputMap&&e.parent.type===i.Loop;n&&(t=e.parent.parent),e.readsValue.setParent(t),e.readsValue.initChildren(),!n&&t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):n||t.subscribeDetachedChild(e.readsValue)}e.readsValue.addValueReader(e)}return e.readsValue}static hydrateReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==i.GenericReference)e.readsValue=b(e.initialData.readsValue,e.project);else if(e.initialData.readsValue&&e.initialData.readsValue.type===i.GenericReference){const t=Lt(e.initialData.readsValue,e.project);t&&(e.readsValue=t)}if(e.readsValue){if(Fe.includes(e.readsValue.type)){let t=e.parent;pt.includes(t.type)||(t=t.parent);const n=e.type===i.InputMap&&e.parent.type===i.Loop;n&&(t=e.parent.parent),e.readsValue.setParent(t),!n&&t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):n||t.subscribeDetachedChild(e.readsValue)}e.readsValue.addValueReader(e)}return e.readsValue}}class is{static initWritesValues(e,t){const n=e.initialData.writesValues.reduce((s,o)=>{if(o.type===i.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const l=b(o,e.project);return l.setValueWriter(e),Fe.includes(l.type)&&(l.setParent(t),l.initChildren()),[...s,l]},[]),a=[...e.writesValues];return e.writesValues=m([...a,...n]),e.writesValues}}class rJ{}const te=class te{constructor(e){c(this,"initialData");c(this,"id");c(this,"version");c(this,"type",i.Project);c(this,"name",null);c(this,"description",null);c(this,"x");c(this,"y");c(this,"entities",[]);c(this,"projects",[]);c(this,"functions",[]);c(this,"events",[]);c(this,"variableDeclarations",[]);c(this,"variableInstances",[]);c(this,"conditions",[]);c(this,"operations",[]);c(this,"functionCalls",[]);c(this,"loops",[]);c(this,"searches",[]);c(this,"primitives",[]);c(this,"builtInBaseEntities",[]);c(this,"operationDeclarations",[]);c(this,"globalEventActionDescriptors",[]);c(this,"loopDeclarations",[]);c(this,"loopDeclarationsBodies",[]);c(this,"conditionDeclarations",[]);c(this,"valueDescriptors",[]);c(this,"dataTypes",[]);c(this,"project");c(this,"instances",{});c(this,"builtInInstances",{});c(this,"errors",[]);c(this,"references",[]);c(this,"initialized",!1);this.initialData=e,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=0,this.y=0,this.instances[this.id]=this;try{(!te.UUID||te.UUID.isBackup)&&(te.UUID=eo==null?void 0:eo()),te.UUID||(te.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:t=>t})}catch(t){console.error("Error initializing UUID module",t),te.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:n=>n}}}static injectUUIDModule(e){te.UUID=e}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[];return a.push(...je(n)),{errors:a,modifiedData:n}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async n=>{await t.init(this),n(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}hydrateAncestors(){const e=[],t=[],n=[];return{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];return this.initialized=!0,this.validate(),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[],t=[],n=[];return{updated:m(e),added:m(t),removed:m(n),self:this}}get instancesList(){return Object.values(this.instances)}isOperationDeclaration(e){return this.operationDeclarations.includes(e)}isGlobalEventActionDescriptor(e){return this.globalEventActionDescriptors.includes(e)}isLoopDeclaration(e){return this.loopDeclarations.includes(e)}isConditionDeclaration(e){return this.conditionDeclarations.includes(e)}initChildren(){return this.initialized?this:(this.initialized=!0,this.entities=this.initialData.entities.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.projects=this.initialData.projects.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.variableDeclarations=this.initialData.variableDeclarations.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.variableInstances=this.initialData.variableInstances.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.conditions=this.initialData.conditions.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.operations=this.initialData.operations.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.functions=this.initialData.functions.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.functionCalls=this.initialData.functionCalls.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.loops=this.initialData.loops.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.searches=this.initialData.searches.map(e=>{const t=b(e,this);return t.setParent(this),t.initChildren(),t}),this.attachOrphanReferences(),this.afterAllChildrenInitialized(),this)}subscribeInstance(e){return(!this.instances[e.id]||this.instances[e.id]!==e)&&(this.instances[e.id]=e),this}subscribeBuiltInInstance(e){return(!this.builtInInstances[e.id]||this.builtInInstances[e.id]!==e)&&(this.builtInInstances[e.id]=e),this}subscribe(){return this}unsubscribe(){return this}unsubscribeInstance(e){return delete this.instances[e.id],this}findSubscribedInstance(e){return this.instances[e.id]||null}findSubscribedBuiltInInstance(e){return this.builtInInstances[e.id]||null}get(e){return this.instances[e]||this.builtInInstances[e]||null}getManaged(e){return this.instances[e]||null}getBuiltIn(e){return this.builtInInstances[e]||null}findSubscribedInstanceFromReference(e){return this.instances[e.entityId]||null}findSubscribedBuiltInInstanceFromReference(e){return this.builtInInstances[e.entityId]||null}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(e=V,...t){return await te.repository.load(this.id,...t),this}async create(e=V,...t){return await te.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await te.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await te.repository.delete(this.id,...t),this}remove({ignoreUpstream:e}={ignoreUpstream:!1}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}getAllBuiltInIds(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlatIds(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlatIds(e)),...this.operationDeclarations.flatMap(t=>t.toFlatIds(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlatIds(e)),...this.loopDeclarations.flatMap(t=>t.toFlatIds(e)),...this.conditionDeclarations.flatMap(t=>t.toFlatIds(e)),...this.valueDescriptors.flatMap(t=>t.toFlatIds(e)),...this.dataTypes.flatMap(t=>t.toFlatIds(e))]}getAllBuiltIn(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlat(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlat(e)),...this.operationDeclarations.flatMap(t=>t.toFlat(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlat(e)),...this.loopDeclarations.flatMap(t=>t.toFlat(e)),...this.conditionDeclarations.flatMap(t=>t.toFlat(e)),...this.valueDescriptors.flatMap(t=>t.toFlat(e)),...this.dataTypes.flatMap(t=>t.toFlat(e))]}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(n=>n.toFlat(e)),...this.functions.flatMap(n=>n.toFlat(e)),...this.events.flatMap(n=>n.toFlat(e)),...this.projects.flatMap(n=>n.toFlat(e)),...this.variableDeclarations.flatMap(n=>n.toFlat(e)),...this.variableInstances.flatMap(n=>n.toFlat(e)),...this.conditions.flatMap(n=>n.toFlat(e)),...this.operations.flatMap(n=>n.toFlat(e)),...this.functionCalls.flatMap(n=>n.toFlat(e)),...this.loops.flatMap(n=>n.toFlat(e)),...this.searches.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(t=>t.toJSON(e)),variableDeclarations:this.variableDeclarations.map(t=>t.toJSON(e)),variableInstances:this.variableInstances.map(t=>t.toJSON(e)),conditions:this.conditions.map(t=>t.toJSON(e)),operations:this.operations.map(t=>t.toJSON(e)),loops:this.loops.map(t=>t.toJSON(e)),searches:this.searches.map(t=>t.toJSON(e)),functions:this.functions.map(t=>t.toJSON(e)),events:this.events.map(t=>t.toJSON(e)),projects:this.projects.map(t=>t.toJSON(e)),functionCalls:this.functionCalls.map(t=>t.toJSON(e))})}toJSONClone(e={uuidStrategy:"uuid"}){const t=new Map,n=new Set,a=this.getAllBuiltInIds();return Object.keys(this.instances).forEach(s=>{if(a.includes(s)){t.set(s,s);return}t.set(s,te.UUID.uuid())}),n.add(this.id),{id:t.get(this.id),version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),projects:this.projects.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),variableDeclarations:this.variableDeclarations.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),variableInstances:this.variableInstances.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),conditions:this.conditions.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),operations:this.operations.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),functions:this.functions.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),events:this.events.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),functionCalls:this.functionCalls.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),loops:this.loops.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null})),searches:this.searches.map(s=>s.toJSONClone({...e,seenEntityMaps:t,seenEntities:n,newId:null}))}}toReference(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+te.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n;let t=this.id;return(n=e.seenEntityMaps)!=null&&n.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(a=>a.toReference(e)),functions:this.functions.map(a=>a.toReference(e)),events:this.events.map(a=>a.toReference(e)),projects:this.projects.map(a=>a.toReference(e)),variableDeclarations:this.variableDeclarations.map(a=>a.toReference(e)),variableInstances:this.variableInstances.map(a=>a.toReference(e)),conditions:this.conditions.map(a=>a.toReference(e)),operations:this.operations.map(a=>a.toReference(e)),functionCalls:this.functionCalls.map(a=>a.toReference(e)),loops:this.loops.map(a=>a.toReference(e)),searches:this.searches.map(a=>a.toReference(e))}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(n=>n.toFlatJSON(e)),...this.functions.flatMap(n=>n.toFlatJSON(e)),...this.events.flatMap(n=>n.toFlatJSON(e)),...this.projects.flatMap(n=>n.toFlatJSON(e)),...this.variableDeclarations.flatMap(n=>n.toFlatJSON(e)),...this.variableInstances.flatMap(n=>n.toFlatJSON(e)),...this.conditions.flatMap(n=>n.toFlatJSON(e)),...this.operations.flatMap(n=>n.toFlatJSON(e)),...this.functionCalls.flatMap(n=>n.toFlatJSON(e)),...this.loops.flatMap(n=>n.toFlatJSON(e)),...this.searches.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(n=>n.toFlatGenerationTarget(e)),...this.functions.flatMap(n=>n.toFlatGenerationTarget(e)),...this.events.flatMap(n=>n.toFlatGenerationTarget(e)),...this.projects.flatMap(n=>n.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(n=>n.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(n=>n.toFlatGenerationTarget(e)),...this.conditions.flatMap(n=>n.toFlatGenerationTarget(e)),...this.operations.flatMap(n=>n.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(n=>n.toFlatGenerationTarget(e)),...this.loops.flatMap(n=>n.toFlatGenerationTarget(e)),...this.searches.flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.entities.forEach(e=>e.clearErrors()),this.projects.forEach(e=>e.clearErrors()),this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this.variableDeclarations.forEach(e=>e.clearErrors()),this.variableInstances.forEach(e=>e.clearErrors()),this.conditions.forEach(e=>e.clearErrors()),this.operations.forEach(e=>e.clearErrors()),this.functionCalls.forEach(e=>e.clearErrors()),this.loops.forEach(e=>e.clearErrors()),this.searches.forEach(e=>e.clearErrors()),this}validate(){const e=f5(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return this}getDefinitionEntity(e){return this.entities.find(t=>t.id===e)||null}addDefinitionEntityFromTransfer(e){const t=b(e,this);return this.addDefinitionEntity(t),t}addDefinitionEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=b(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=b(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=b(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=b(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=b(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=b(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=b(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=b(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=b(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=b(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeDefinitionEntity(e){const t=this.entities.findIndex(n=>n.id===e.id);if(t>-1){const n=this.entities[t];return this.entities.splice(t,1),n}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(n=>n.id===e.id);if(t>-1){const n=this.functions[t];return this.functions.splice(t,1),n}return null}removeExternalProject(e){const t=this.projects.findIndex(n=>n.id===e.id);if(t>-1){const n=this.projects[t];return this.projects.splice(t,1),n}return null}removeGlobalEvent(e){const t=this.events.findIndex(n=>n.id===e.id);if(t>-1){const n=this.events[t];return this.events.splice(t,1),n}return null}removeTopLevelVariableDeclaration(e){if(e.type!==i.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(n=>n.id===e.id);if(t>-1){const n=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),n}return null}getEntryPoints(){return[...this.functions,...this.events,...this.entities.flatMap(t=>t.methods)]}getFunctionDeclaration(e){return this.functions.find(t=>t.id===e)||null}getConditions(){return[...this.conditions,...this.getEntryPoints().reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.functionCalls.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.operations.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.loops.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.searches.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.functionCalls.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.conditions.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.loops.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.searches.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.conditions.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.operations.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.loops.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.searches.reduce((t,n)=>{const a=Ue(n);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,n)=>{const a=Ae(n);return[...t,...a]},[]),...this.functionCalls.reduce((t,n)=>{const a=Ae(n);return[...t,...a]},[]),...this.conditions.reduce((t,n)=>{const a=Ae(n);return[...t,...a]},[]),...this.operations.reduce((t,n)=>{const a=Ae(n);return[...t,...a]},[]),...this.loops.reduce((t,n)=>{const a=Ae(n);return[...t,...a]},[]),...this.searches.reduce((t,n)=>{const a=Ae(n);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return m([...this.variableDeclarations,...this.getEntryPoints().reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,n)=>{const s=Ae(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(n=>{if(!n.declaration){const a=n.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(l=>l.id===s);o&&n.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===U.PERSISTED_ENTITY)||null}};c(te,"UUID",{isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),c(te,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(te,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(te,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(te,"BASE_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,...te.INMUTABLE_BASE_PROPERTIES]),c(te,"MUTABLE_META_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,"x","y"]),c(te,"INMUTABLE_META_PROPERTIES",[...te.INMUTABLE_BASE_PROPERTIES]),c(te,"META_PROPERTIES",[...te.MUTABLE_META_PROPERTIES,...te.INMUTABLE_META_PROPERTIES]),c(te,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(te,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),c(te,"UPSTREAM_PROPERTIES",[...te.MUTABLE_UPSTREAM_PROPERTIES,...te.INMUTABLE_UPSTREAM_PROPERTIES]),c(te,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),c(te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(te,"DOWNSTREAM_PROPERTIES",[...te.MUTABLE_DOWNSTREAM_PROPERTIES,...te.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(te,"PROPERTIES",[...te.META_PROPERTIES,...te.UPSTREAM_PROPERTIES,...te.DOWNSTREAM_PROPERTIES]);let M=te;class VO extends se{constructor(t){super(Qt,t);c(this,"id",Ve.Parallel);c(this,"name",Ve.Parallel);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",Qt);c(this,"type",i.ActionDescriptor);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"error",null);c(this,"project");this.project=t,this.inputs=Qt.inputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.outputs=Qt.outputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Qt.error?b(Qt.error,this.project):null}}class NO extends se{constructor(t){super(Rt,t);c(this,"id",Rt.id);c(this,"name",Rt.name);c(this,"description",Rt.description);c(this,"version",Rt.version);c(this,"autoexecutable",!1);c(this,"initialData",Rt);c(this,"type",i.ActionDescriptor);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"error",null);c(this,"project");this.project=t,this.inputs=Rt.inputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.outputs=Rt.outputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Rt.error?b(Rt.error,this.project):null}}class LO extends se{constructor(t){super(wn,t);c(this,"id",Ve.Sequential);c(this,"name",Ve.Sequential);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",wn);c(this,"type",i.ActionDescriptor);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"error",null);c(this,"project");this.project=t,this.inputs=wn.inputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.outputs=wn.outputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.error=wn.error?b(wn.error,this.project):null}}class iJ extends se{constructor(e){super(Xi,e)}}class aJ extends se{constructor(e){super(hr,e)}}class sJ extends se{constructor(t){super(fr,t);c(this,"autoexecutable",!0)}getEntityToMatchInputMap(t){return t.inputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Ne.Validate].inputs.entityToMatch.id})||null}getDataToValidateInputMap(t){return t.inputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Ne.Validate].inputs.dataToValidate.id})||null}getOutputDataOutputMap(t){return t.outputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Ne.Validate].outputs.outputEntity.id})||null}getEntityToMatch(t){let n=null;if(t.readsValue){const s=t.readsValue.getDataType();s&&s.entity&&s.entity.type===i.DefinitionEntity&&(n=s.entity)}const a=t.getDefaultValue();return!n&&a&&a.valueAsType&&!Array.isArray(a.valueAsType)&&a.valueAsType.type===i.DefinitionEntity&&(n=a.valueAsType),n}syncOperationInstance(t){const n=this.getEntityToMatchInputMap(t);n&&this.syncEntityToMatchInputMapDataType(n);const a=this.getDataToValidateInputMap(t);a&&this.syncDataToValidateInputMapDataType(a);const s=this.getOutputDataOutputMap(t);return s&&this.syncOutputDataOutputMapDataType(s),t}syncEntityToMatchInputMapDataType(t){var a,s,o;if(((a=t.declaration)==null?void 0:a.id)!==_.operation[Ne.Validate].inputs.entityToMatch.id)return null;if(!t.dataType){const l={id:t.id+"--"+M.UUID.uuid()+"--infered-data-type",version:1,type:i.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!0,entity:null,like:!0,inferred:!0,parent:t.toReference()},p=b(l,t.project);p.setParent(t),p.initChildren(),t.setDataType(p)}(s=t.dataType)==null||s.sync({inferred:!0,like:!1,asType:!0});const n=this.getEntityToMatch(t);return(o=t.dataType)==null||o.setEntity(n),t.dataType}syncDataToValidateInputMapDataType(t){var o,l,p;if(((o=t.declaration)==null?void 0:o.id)!==_.operation[Ne.Validate].inputs.dataToValidate.id)return null;const n=this.getEntityToMatchInputMap(t.parent);if(!n||!this.getEntityToMatch(n))return null;if(!t.dataType){const u={id:t.id+"--"+M.UUID.uuid()+"--infered-data-type",version:1,type:i.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,like:!0,inferred:!0,parent:t.toReference()},h=b(u,t.project);h.setParent(t),h.initChildren(),t.setDataType(h)}(l=t.dataType)==null||l.sync({inferred:!0,like:!0,asType:!1});const s=this.getEntityToMatch(n);return(p=t.dataType)==null||p.setEntity(s),t.dataType}syncOutputDataOutputMapDataType(t){var o,l,p;if(((o=t.declaration)==null?void 0:o.id)!==_.operation[Ne.Validate].outputs.outputEntity.id)return null;const n=this.getEntityToMatchInputMap(t.parent);if(!n||!this.getEntityToMatch(n))return null;if(!t.dataType){const u={id:t.id+"--"+M.UUID.uuid()+"--infered-data-type",version:1,type:i.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,like:!0,inferred:!0,parent:t.toReference()},h=b(u,t.project);h.setParent(t),h.initChildren(),t.setDataType(h)}(l=t.dataType)==null||l.sync({inferred:!0,like:!0,asType:!1});const s=this.getEntityToMatch(n);return(p=t.dataType)==null||p.setEntity(s),t.dataType}inferInputMapDataType(t){var n,a;return((n=t.declaration)==null?void 0:n.id)===_.operation[Ne.Validate].inputs.entityToMatch.id?this.syncEntityToMatchInputMapDataType(t):((a=t.declaration)==null?void 0:a.id)===_.operation[Ne.Validate].inputs.dataToValidate.id?this.syncDataToValidateInputMapDataType(t):null}inferOutputMapDataType(t){var n;return((n=t.declaration)==null?void 0:n.id)===_.operation[Ne.Validate].outputs.outputEntity.id?this.syncOutputDataOutputMapDataType(t):null}}class oJ extends se{constructor(e){super(wl,e)}}class lJ extends se{constructor(e){super(Ml,e)}}class dJ extends se{constructor(e){super(_l,e)}}class cJ extends se{constructor(e){super(us,e)}}class uJ extends se{constructor(e){super(ls,e)}}class pJ extends se{constructor(e){super(Ki,e)}}function yJ(r){const e=[new LO(r),new VO(r),new NO(r),new iJ(r),new aJ(r),new sJ(r),new cJ(r),new oJ(r),new dJ(r),new lJ(r),new uJ(r),new pJ(r),new se(Cl,r),new se(Pl,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}class GO extends In{constructor(t){super(st,t);c(this,"initialData");c(this,"id",U.PERSISTED_ENTITY);c(this,"version",1);c(this,"name",U.PERSISTED_ENTITY);c(this,"description",st.description);c(this,"type",i.BuiltInBaseEntity);c(this,"abstract",st.abstract);c(this,"static",st.static);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(this,"project");this.initialData=st,this.project=t,this.id=st.id,this.version=st.version,this.name=st.name,this.static=st.static,this.abstract=st.abstract,this.properties=this.initialData.properties.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(n=>{const a=b(n,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(n=>{const a=b(n,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(n=>b(n,this.project))}}function hJ(r){const e=[new GO(r),new In(ra,r),new In(un,r),new In(Ss,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.builtInBaseEntities=e,e}function fJ(r){const e=[new Kt(J,r),new Kt(Sn,r),new Kt(ee,r),new Kt(it,r),new Kt(On,r),new Kt(ln,r),new Kt(Pn,r),new Kt(ai,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.primitives=e,e}function mJ(r){const e=[new se(Ps,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.globalEventActionDescriptors=e,e}function TJ(r){const e=[new se(ta,r),new se(Wn,r),new se(ea,r),new se(li,r),new se(di,r),new se(Rs,r)];e.forEach(n=>{n.initChildren(),r.subscribeBuiltInInstance(n)}),r.loopDeclarations=e;const t=[new se(Kl,r),new se(bs,r),new se(Wl,r),new se(JT,r),new se(cE,r),new se(kl,r)];return t.forEach(n=>{n.initChildren(),r.subscribeBuiltInInstance(n)}),r.loopDeclarationsBodies=t,e}function EJ(r){const e=[new Kr(Cs,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.valueDescriptors=e,e}function RJ(r){const e=[new se(gr,r),new se(hi,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}const ti={},Tl={};async function gJ(r,e={}){const t={...RD};return t.id=r.id,e.empty?{data:{id:r.id,type:i.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function yp(r){const e=new M(r);return fJ(e),hJ(e),yJ(e),mJ(e),TJ(e),EJ(e),RJ(e),e.getAllBuiltIn().forEach(n=>{e.builtInInstances[n.id]||(e.builtInInstances[n.id]=n,delete e.instances[n.id])}),e}function bJ(r){const e=new Map,t=r.getAllBuiltInIds();Object.keys(r.instances).forEach(a=>{if(t.includes(a)){e.set(a,a);return}e.set(a,M.UUID.uuid())});const n=yp(r.toShallowJSON({seenEntityMaps:e}));return new Zu(r).visit(a=>{const s=b(a.toShallowJSON({seenEntityMaps:e}),n);s.hydrateAncestors(),s.addSelfToProject()}).visit(a=>{const s=n.get(e.get(a.id));s&&s.afterAllChildrenInitialized()}),n.afterAllChildrenInitialized(),n}function $O(r){const e=yp(r);return new Zu(r).visit(t=>{const n=b(t,e);n.hydrateAncestors(),n.addSelfToProject()}).visit(t=>{const n=e.get(t.id);n&&n.afterAllChildrenInitialized()}),e.afterAllChildrenInitialized(),e}async function vJ(r,e={}){if(r.id&&ti[r.id])return ti[r.id];if(r.id&&Tl[r.id])return await Tl[r.id],ti[r.id];const t=gJ(r,e);r.id&&(Tl[r.id]=t);const n=await t;if(n.data){const a=$O(n.data);return ti[r.id]=a,r.id&&delete Tl[r.id],a}return null}function IJ(r){return ti[r.id]&&delete ti[r.id],null}const DJ="test_primitive_entities_export";d.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=Wu,d.ALL_BUILT_IN_BASE_ENTITIES=ZR,d.ALL_BUILT_IN_CONDITION_ENTITIES=cg,d.ALL_BUILT_IN_GLOBAL_EVENT_ENTITIES=pg,d.ALL_BUILT_IN_LOOP_ENTITIES=SE,d.ALL_BUILT_IN_OPERATION_ENTITIES=Lm,d.ALL_BUILT_IN_PRIMITIVE_ENTITIES=Sp,d.ALL_BUILT_IN_TOP_LEVEL_ENTITIES=mg,d.ALL_BUILT_IN_VALUE_DESCRIPTORS=fg,d.ActionDescriptorState=se,d.ActionInputMapState=H7,d.ActionOutputMapState=K7,d.AppendToListOperationInputIds=Vh,d.AppendToListOperationOutputIds=Nh,d.ArgumentDeclarationState=zr,d.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=ju,d.BUILT_IN_BASE_ENTITY_IDS=_,d.BUILT_IN_ENTITY_TYPES=Jn,d.BaseCanvasDraggableState=Kq,d.BaseEntityNames=U,d.BaseState=Zq,d.BaseValueDescriptorIds=os,d.BreakStatementState=Yi,d.BuiltInBaseEntityState=In,d.CACHED_PROJECTS_BY_ID=ti,d.CALLABLE_ENTITIES_EXPLANATION=dq,d.CALLABLE_TYPES=Xt,d.CALLER_ENTITIES_EXPLANATION=TS,d.CALLER_TYPES=on,d.CALLS_UPDATE_EXPLANATION=lr,d.COMPARISON_CONDITIONS=lg,d.CONDITIONS=dg,d.CUSTOM_ENTITY_OPERATIONS=em,d.CallableEntityClass=Qq,d.CallerEntityClass=pp,d.ChildEntityState=Xq,d.ComparisonOperatorTypes=qe,d.ConditionState=Jr,d.ContinueStatementState=St,d.CreateNewInputIds=Pf,d.CreateNewOutputIds=Cf,d.DRAGGABLE_CALLABLE_TYPES=vl,d.DRAGGABLE_CALLER_TYPES=Tp,d.DRAGGABLE_ELEMENT_TYPES=ss,d.DRAGGABLE_EXECUTABLE_TYPES=xO,d.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=bl,d.DataTypeCompatibilityTypes=zt,d.DataTypeParentChildRelation=et,d.DataTypeState=ki,d.DefinitionEntityState=ei,d.EDITABLE_PERSISTANCE_REPOSITORY_DEFAULTS=Hq,d.ENTITIES_WITH_VALLUES_EXPLANATION=el,d.ENTITY_PERSISTANCE_OPTIONS_DEFAULTS=V,d.ENTITY_RECUSION_OPTIONS_DEFAULTS=L,d.ENTITY_TYPES=jO,d.ENTITY_WITH_DECLARATION_TYPES=FO,d.ENTITY_WITH_LOGIC_SCOPE_TYPES=pt,d.ENTITY_WITH_NAMES_TYPES=Ep,d.ENTITY_WITH_PARENT_TYPES=fp,d.ENTITY_WITH_USER_MANAGED_DECLARATION_TYPES=gl,d.ENTITY_WITH_USER_MANAGED_SINGLE_IMPLEMENTS_TYPES=mp,d.ENTITY_WITH_VALUE_TYPES=hp,d.ENTRY_POINT_ENTITIES_EXPLANATION=Xa,d.ENTRY_POINT_TYPES=We,d.EVENT_TYPES=ii,d.EXECUTABLE_TYPES=UO,d.EXECUTION_OPERATIONS=Of,d.EntityError=Cr,d.EntityErrorSeverity=E,d.EntityGenerationError=g,d.EntityGenerationErrorCode=T,d.EntityInstanceErrorCode=G,d.EntityOperations=Ne,d.EntityType=i,d.EntityWithLogicScopeClass=rJ,d.EntityWithValueClass=nJ,d.EntryPointEntityClass=eJ,d.ExecutionOperations=Ve,d.ExecutionTerminationType=hS,d.FunctionCallState=Xr,d.FunctionDeclarationState=jr,d.GLOBAL_EVENT_DECLARATIONS=ug,d.GetLastInListOperationInputIds=vh,d.GetLastInListOperationOutputIds=Ih,d.GlobalEventNames=Dn,d.GlobalEventState=qi,d.HTTPOperations=dt,d.HTTP_OPERATIONS=Vm,d.InputMapState=xn,d.InstalledProjectState=Hr,d.InternalCallState=Ji,d.JoinListOperationInputIds=jy,d.JoinListOperationOutputIds=ky,d.LIST_OPERATIONS=Hh,d.ListOperations=X,d.LiteralValueState=Wi,d.LoopState=qr,d.LoopTypes=k,d.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=dr,d.NUMBER_OPERATIONS=ny,d.NumberOperations=Ge,d.OPERATION_DECLARATIONS=Nm,d.OperationState=kr,d.OutputMapParentChildRelation=ri,d.OutputMapState=jn,d.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=tl,d.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=or,d.PASS_THROUGH_CALLABLE_TYPES=Je,d.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=Ju,d.ParallelExecutionOperation=VO,d.PassThroughCallableEntityClass=tJ,d.PersistedEntity=GO,d.PersistedEntityMethods=Gt,d.PrimitiveEntityState=Kt,d.PrimitiveTypes=C,d.ProjectState=M,d.PropertyState=xr,d.READ_ONLY_ENTITY_PERSISTANCE_REPOSITORY=_O,d.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=cq,d.ReturnDeclarationState=kt,d.ReturnStatementState=Zr,d.STANDALONE_CONDITIONS=QR,d.STRING_OPERATIONS=xy,d.ScopeCompatibilityType=ml,d.SearchState=Yr,d.SequentialExecutionOperation=LO,d.SequentialExecutionOperationInputIds=hf,d.SequentialExecutionOperationOutputIds=ff,d.SharedEntityErrorCode=B,d.SharedStateFunctionality=MO,d.SplitListOperationInputIds=ih,d.SplitListOperationOutputIds=ah,d.StandaloneOperatorTypes=Jt,d.StringOperations=re,d.TERMINATION_TYPES=xe,d.Traverser=Zu,d.USER_MANAGED_ENTITY_TYPES=Rp,d.UserManagedEntityStateFunctionality=zq,d.VALUE_READING_ENTITIES_EXPLANATION=qu,d.VALUE_READING_TYPES=An,d.VALUE_WRITING_ENTITIES_EXPLANATION=ES,d.VALUE_WRITING_TYPES=Ze,d.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=ku,d.VARIABLE_TYPES=Fe,d.ValueAutogenerationType=ze,d.ValueDescriptorParentChildRelation=P,d.ValueDescriptorState=Kr,d.ValueReadingEntityClass=qn,d.ValueWritingEntityClass=is,d.VariableDeclarationState=sn,d.VariableInputMapState=Y7,d.VariableInstanceState=Wr,d.VariableOutputMapState=Z7,d.WaitOperation=NO,d.WaitOperationInputIds=of,d.WaitOperationOutputIds=lf,d.appendToListOperation=us,d.appendToListOperationElementToAppendArgument=Nl,d.appendToListOperationElementToAppendArgumentParentRef=kh,d.appendToListOperationElementToAppendArgumentRef=$h,d.appendToListOperationError=Yh,d.appendToListOperationErrorParentRef=Wh,d.appendToListOperationListArgument=Vl,d.appendToListOperationListArgumentParentRef=jh,d.appendToListOperationListArgumentRef=Lh,d.appendToListOperationListDataType=Gh,d.appendToListOperationResultListDataType=xh,d.appendToListOperationResultListReturn=Jh,d.appendToListOperationResultListReturnParentRef=qh,d.appendToListOperationResultListReturnRef=Uh,d.appendToListOperationSecondListDataType=Fh,d.asGenerationActionExample=bn,d.booleanPrototype=Sn,d.capitalizeFirstLetter=Jo,d.checkAreDataTypesCompatible=Zt,d.checkAreDefinitionEntitiesCompatibleAsDataType=nS,d.checkArePropertiesCompatibleAsDataType=tS,d.checkIsBranchDependentButNotDirectlyOnBranch=es,d.checkIsBranchDependentOnBranch=Rq,d.checkIsCallableEntityReachable=rs,d.checkIsCanvasEntity=Gq,d.checkIsDetachedBranch=SO,d.checkIsDetachedBranchShallow=cp,d.checkIsGlobalVariable=Vq,d.checkIsGloballyDeclared=dp,d.checkIsMethod=CO,d.checkIsNestedScope=fl,d.checkScopeCompatibility=ns,d.cloneProject=bJ,d.countedLoopActionDescriptor=ta,d.countedLoopActionDescriptorDynamicReturnDeclaration=EE,d.countedLoopActionDescriptorDynamicReturnDeclarationParentRef=TE,d.countedLoopActionDescriptorStringArgumentDeclaration=mE,d.countedLoopActionDescriptorStringArgumentDeclarationDataType=hE,d.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValue=pE,d.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValueParentRef=uE,d.countedLoopActionDescriptorStringArgumentDeclarationDataTypeParentRef=yE,d.countedLoopActionDescriptorStringArgumentDeclarationParentRef=fE,d.countedLoopBodyActionDescriptor=Kl,d.countedLoopBodyActionDescriptorAnyDynamicArgument=IE,d.countedLoopBodyActionDescriptorAnyDynamicArgumentParentRef=vE,d.countedLoopBodyActionDescriptorAnyDynamicReturn=AE,d.countedLoopBodyActionDescriptorAnyDynamicReturnParentRef=DE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Zl,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=gE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=RE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=bE,d.createDefinitionEntityFromJSONObject=sl,d.createEntityError=Q,d.createNestedDataTypeForEntity=CS,d.createNewInstanceOperation=hr,d.createNewInstanceOperationEntityToInstanciateArgument=Gf,d.createNewInstanceOperationEntityToInstanciateArgumentRef=Vf,d.createNewInstanceOperationEntityToInstanciateDataType=Nf,d.createNewInstanceOperationError=xf,d.createNewInstanceOperationErrorParentRef=Uf,d.createNewInstanceOperationNewEntityDataArgument=_f,d.createNewInstanceOperationNewEntityDataArgumentDataType=Mf,d.createNewInstanceOperationNewEntityDataArgumentDataTypeParentRef=Bf,d.createNewInstanceOperationNewEntityDataArgumentParentRef=wf,d.createNewInstanceOperationOutputEntityDeclaration=Ff,d.createNewInstanceOperationOutputEntityDeclarationParentRef=$f,d.createNewInstanceOperationRef=Lf,d.createSemanticId=de,d.createStateFromGenerationTargetType=Yq,d.createStateFromType=ke,d.createStateFromTypeAndSubscribe=b,d.cronJobBuiltInBaseEntity=Ss,d.cronJobBuiltInBaseEntityExpressionProperty=HR,d.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=zO,d.cronJobBuiltInBaseEntityExpressionPropertyRef=WR,d.cronJobBuiltInBaseEntityRef=YR,d.cronJobTriggeredFunctionDeclarationBlueprint=ud,d.cronJobTriggeredFunctionDeclarationBlueprintParentRef=qR,d.dataTypeCompatibilityToErrorExplanation=SS,d.datePrototype=ln,d.dateValueAutogenerationSchema=Oc,d.definitionEntityToZodSchema=Mg,d.deletePersistedEntityMethod=cd,d.deletePersistedEntityMethodParentRef=CR,d.deleteRootProject=IJ,d.endpointBuiltInBaseEntity=ra,d.endpointBuiltInBaseEntityRef=wE,d.endpointBuiltInBaseEntityRefFour=uR,d.endpointBuiltInBaseEntityRefThree=FE,d.endpointBuiltInBaseEntityRefTwo=NE,d.endpointBuiltInCorsProperty=BE,d.endpointBuiltInCorsPropertyDataType=CE,d.endpointBuiltInCorsPropertyDataTypeRef=OE,d.endpointBuiltInCorsPropertyRef=PE,d.endpointBuiltInMethodProperty=Ql,d.endpointBuiltInMethodPropertyDataType=$E,d.endpointBuiltInMethodPropertyDataTypeRef=LE,d.endpointBuiltInMethodPropertyRef=GE,d.endpointBuiltInPathProperty=Xl,d.endpointBuiltInPathPropertyDataType=VE,d.endpointBuiltInPathPropertyDataTypeRef=ME,d.endpointBuiltInPathPropertyRef=_E,d.endpointPathParamsArgumentDeclaration=td,d.endpointPathParamsArgumentDeclarationRef=zE,d.endpointPathParamsVariableDataType=ZE,d.endpointPathParamsVariableDataTypeRef=HE,d.endpointReachedTriggerActionDescriptor=od,d.endpointReachedTriggerActionDescriptorRef=KE,d.endpointReachedTriggerActionDescriptorRefFour=eR,d.endpointReachedTriggerActionDescriptorRefThree=QE,d.endpointReachedTriggerActionDescriptorRefTwo=XE,d.endpointRequestBodyArgumentDeclaration=rd,d.endpointRequestBodyArgumentDeclarationRef=kE,d.endpointRequestBodyVariableDataType=qE,d.endpointRequestHeadersArgumentDeclaration=ed,d.endpointRequestHeadersArgumentDeclarationRef=xE,d.endpointRequestHeadersVariableDataType=jE,d.endpointRequestHeadersVariableDataTypeRef=UE,d.endpointRequestQueryParamsArgumentDeclaration=nd,d.endpointRequestQueryParamsArgumentDeclarationRef=WE,d.endpointRequestQueryParamsVariableDataType=YE,d.endpointRequestQueryParamsVariableDataTypeRef=JE,d.endpointResponseBodyDataType=dR,d.endpointResponseBodyReturnDeclaration=sd,d.endpointResponseBodyReturnDeclarationRef=lR,d.endpointResponseCodeDataType=nR,d.endpointResponseCodeReturnDeclaration=id,d.endpointResponseCodeReturnDeclarationRef=tR,d.endpointResponseHeadersDataType=sR,d.endpointResponseHeadersDataTypeRef=iR,d.endpointResponseHeadersReturnDeclaration=ad,d.endpointResponseHeadersReturnDeclarationRef=aR,d.endpointReturnStatementRef=rR,d.endpointReturnStatementRefThree=cR,d.endpointReturnStatementRefTwo=oR,d.enrichFromKnownEntities=ts,d.enumOptionsProperty=Ap,d.enumOptionsPropertyDataType=Ip,d.enumOptionsPropertyDataTypeRef=bp,d.enumOptionsPropertyRef=vp,d.enumPrototype=On,d.enumPrototypeRef=Dp,d.executionBuiltInBaseEntity=Os,d.executionBuiltInEntityAbortMethod=pd,d.executionBuiltInEntityAbortMethodParentRef=zR,d.filterOutDuplicateEntities=m,d.filterOutDuplicateErrors=V9,d.findEntityFromKeys=Ku,d.findReferenceToSelfInList=qS,d.findReferencesToSelfInProject=Pq,d.flattenActionDescriptor=WS,d.flattenArgumentDeclaration=YS,d.flattenBreakStatement=HS,d.flattenBuiltInBaseEntity=zS,d.flattenCalls=vn,d.flattenCanvasAncestorsUntil=ol,d.flattenCondition=ZS,d.flattenContinueStatement=KS,d.flattenDataType=QS,d.flattenDefinitionEntity=XS,d.flattenDefinitionEntityExtensionAndImplementationTypes=sp,d.flattenDefinitionEntityExtensionTypes=yl,d.flattenDefinitionEntityExtensions=ip,d.flattenDefinitionEntityImplementations=ap,d.flattenDefinitionEntityImplementionTypes=pl,d.flattenDerivedCanvasEntities=Nt,d.flattenDetachedBranch=PO,d.flattenElementCalls=Ue,d.flattenElementCallsOnTheSameScope=Oq,d.flattenEntity=O,d.flattenFunctionCall=eO,d.flattenFunctionDeclaration=tO,d.flattenGlobalEvent=nO,d.flattenInputMap=rO,d.flattenInstalledProject=iO,d.flattenInternalCall=aO,d.flattenLiteralValue=sO,d.flattenLoop=oO,d.flattenOperation=lO,d.flattenOutputMap=dO,d.flattenPrimitiveEntity=cO,d.flattenProject=uO,d.flattenProjectElements=kS,d.flattenProperty=pO,d.flattenRelatedCanvasElementsOnTheLeft=DO,d.flattenRelatedCanvasElementsOnTheRight=IO,d.flattenReturnDeclaration=yO,d.flattenReturnStatement=hO,d.flattenSearch=fO,d.flattenValueDescriptor=mO,d.flattenVariableDeclaration=TO,d.flattenVariableInstance=EO,d.flattenVariableReads=jS,d.flattenVariableWrites=xS,d.flattenVariables=Ae,d.fromZodParseToEntityGenerationErrors=Fu,d.generate=YC,d.generateActionExample=uq,d.generateExecutionDataType=R7,d.generateIdFromStrategy=Ye,d.generateMutablePropertiesExplanation=Ko,d.generateRandomBoolean=ib,d.generateRandomDate=Lg,d.generateRandomDateAfter=_g,d.generateRandomDateBefore=Vg,d.generateRandomDateBetweenRange=Ng,d.generateRandomNumber=Qg,d.generateRandomNumberAfter=Zg,d.generateRandomNumberBefore=Kg,d.generateRandomNumberBetweenRange=Xg,d.generateRandomText=rb,d.generateRandomTextAfter=eb,d.generateRandomTextBefore=tb,d.generateRandomTextBetweenRange=nb,d.generateUniqueUUID=zg,d.getAllActionDescriptorsForConditions=il,d.getAllActionDescriptorsForGlobalEvents=nl,d.getAllActionDescriptorsForLoops=rl,d.getAllActionDescriptorsForOperations=fq,d.getAllBuiltInEntityIds=np,d.getAllGloballyDeclaredFunctionDeclarationsExplanation=IS,d.getBaseBuiltInEntities=ur,d.getBaseSchemaBasedOnType=fS,d.getBuiltInEntityOwner=pr,d.getCallableEntityReferenceSchema=at,d.getCallableEntityTypeSchema=kD,d.getCalledBy=qt,d.getCallerEntityReferenceSchema=F3,d.getCallerEntityTypeSchema=$3,d.getCalls=ep,d.getCanvasEntitiesDerivedFromInternalCalls=vO,d.getCanvasEntitiesDerivedFromWrites=Hi,d.getCanvasEntityDerivedFromValueReadingEntity=ul,d.getCanvasEntityDerivedFromValueReadingEntityFromTransfer=bO,d.getCanvasEntityReferenceSchema=n5,d.getCanvasEntityTypeSchema=t5,d.getChildrenEntityWithValues=bq,d.getColumnProperties=jq,d.getCommonAncestor=Qu,d.getCommonChildren=wS,d.getDatabaseEntities=Uq,d.getDatabaseEntity=kq,d.getDeclaration=Ur,d.getDeepestScope=BO,d.getDefinitionEntityExtends=zi,d.getDraggableCallableEntityReferenceSchema=JD,d.getDraggableCallableEntityTypeSchema=qD,d.getDraggableCallerEntityReferenceSchema=x3,d.getDraggableCallerEntityTypeSchema=U3,d.getDraggableExecutableEntityReferenceSchema=J3,d.getDraggableExecutableEntityTypeSchema=q3,d.getDraggablePassThroughCallableEntityReferenceSchema=Go,d.getDraggablePassThroughCallableEntityTypeSchema=Lo,d.getDraggablePlayableEntityReferenceSchema=Z3,d.getDraggablePlayableEntityTypeSchema=z3,d.getEntityArgumentDeclarations=rp,d.getEntityInputMaps=RO,d.getEntityOutputMaps=Bq,d.getEntityReferenceSchema=e5,d.getEntityReturnDeclarations=gO,d.getEntityTypeSchema=Q3,d.getEntityWithLogicScopeReferenceSchema=$n,d.getEntityWithLogicScopeTypeSchema=W3,d.getEntityWithValueReferenceSchema=jD,d.getEntityWithValueTypeSchema=G3,d.getEntryPointEntityReferenceSchema=nt,d.getEntryPointEntityTypeSchema=ir,d.getEventEntityReferenceSchema=Vo,d.getEventEntityTypeSchema=_o,d.getExecutableEntityReferenceSchema=k3,d.getExecutableEntityTypeSchema=j3,d.getExtendedBuiltInEntity=Mq,d.getExtendedDefinitionEntity=op,d.getGenerationTargetSchemaBasedOnType=mS,d.getHeadIfPartOfDetachedBranch=OO,d.getHighestScope=wO,d.getImplementedBuiltInEntity=_q,d.getIsInteractive=lp,d.getLastInListOperation=_l,d.getLastInListOperationError=_h,d.getLastInListOperationErrorParentRef=Mh,d.getLastInListOperationInputListArgument=Ch,d.getLastInListOperationInputListArgumentParentRef=Ph,d.getLastInListOperationInputListArgumentRef=Dh,d.getLastInListOperationInputListDataType=Ah,d.getLastInListOperationOutputElementDataType=Oh,d.getLastInListOperationOutputElementReturn=Bh,d.getLastInListOperationOutputElementReturnParentRef=wh,d.getLastInListOperationOutputElementReturnRef=Sh,d.getLinkedEntitiesFromArgumentDeclaration=Sq,d.getLowestPersistedEntityImplementation=AO,d.getParentCallableEntity=BS,d.getParentCallerEntity=_S,d.getParentCanvasEntities=Ot,d.getParentCanvasEntity=lt,d.getParentCanvasEntityFromTransfer=ll,d.getParentEntryPoint=gq,d.getParentPassthroughCallableEntity=MS,d.getPassThroughCallableEntityReferenceSchema=$e,d.getPassThroughCallableEntityTypeSchema=No,d.getPeristedEntities=Fq,d.getPlayableEntityReferenceSchema=H3,d.getPlayableEntityTypeSchema=Y3,d.getProject=vJ,d.getPrototypeByType=hl,d.getReferenceEntityId=A,d.getReferencedEntitiesStateOrErrors=Qo,d.getReferencedEntityStateOrErrors=Uu,d.getRelatedCanvasElementsOnTheLeft=Qr,d.getRelatedCanvasElementsOnTheLeftFromTransfer=JS,d.getRelatedCanvasElementsOnTheRight=cr,d.getRootEntryPointScopeOwner=up,d.getScopeOwner=Pt,d.getTerminationReferenceSchema=X3,d.getTerminationTypeSchema=K3,d.getUpstreamDependencyIds=cl,d.getUsedArgFromDeclaration=Cq,d.getUsedReturnFromDeclaration=wq,d.getValueReadingEntityReferenceSchema=xD,d.getValueReadingEntityTypeSchema=Gn,d.getValueWritingEntityReferenceSchema=L3,d.getValueWritingEntityTypeSchema=xa,d.getVariableFromInputMapping=NS,d.getVariableFromReturnVariablePointer=$S,d.getVariableReferenceSchema=rr,d.getVariableTypeSchema=Vr,d.getVariablesFromArgumentDeclarations=dl,d.getVariablesFromInputMaps=LS,d.getVariablesFromOutputMapping=FS,d.getVariablesFromOutputMaps=US,d.getVariablesFromReturnDeclarations=GS,d.getVariablesInSameOrHigherScope=Mu,d.getWrites=tp,d.groupCallsBasedOnParallelizableExecution=Iq,d.handleAfterEntityImplementationSideEffects=PS,d.handleBeforeEntityImplementationSideEffects=OS,d.httpRequestBodyArgument=fs,d.httpRequestBodyArgumentRef=ym,d.httpRequestBodyDataType=hm,d.httpRequestHeadersArgument=hs,d.httpRequestHeadersArgumentRef=um,d.httpRequestHeadersDataType=pm,d.httpRequestMethodArgument=ps,d.httpRequestMethodArgumentRef=dm,d.httpRequestMethodDataType=cm,d.httpRequestMethodDataTypeRef=om,d.httpRequestOperation=Xi,d.httpRequestOperationErrorValueDescriptor=xl,d.httpRequestOperationErrorValueDescriptorDatatype=_m,d.httpRequestOperationErrorValueDescriptorRef=Mm,d.httpRequestOperationRef=Pm,d.httpRequestOperationRefEight=wm,d.httpRequestOperationRefFive=Sm,d.httpRequestOperationRefFour=Am,d.httpRequestOperationRefNine=Bm,d.httpRequestOperationRefSeven=Cm,d.httpRequestOperationRefSix=Om,d.httpRequestOperationRefThree=Dm,d.httpRequestOperationRefTwo=Im,d.httpRequestQueryParamsArgument=Ul,d.httpRequestQueryParamsArgumentRef=am,d.httpRequestQueryParamsDataType=sm,d.httpRequestVariableURLArgument=ys,d.httpRequestVariableURLArgumentRef=rm,d.httpRequestVariableURLDataType=im,d.httpRequestVariableURLDataTypeRef=tm,d.httpResponseBodyReturnDataType=vm,d.httpResponseBodyReturnDataTypeRef=gm,d.httpResponseBodyReturnReturn=Es,d.httpResponseBodyReturnReturnRef=bm,d.httpResponseCodeDataType=mm,d.httpResponseCodeReturn=ms,d.httpResponseCodeReturnRef=fm,d.httpResponseHeadersDataType=Rm,d.httpResponseHeadersDataTypeRef=Tm,d.httpResponseHeadersReturn=Ts,d.httpResponseHeadersReturnRef=Em,d.implement=al,d.inferArgumentDeclarationDataType=rS,d.inferDataType=gn,d.inferInputMapDataType=Cu,d.inferOutputMapDataType=Bu,d.inferPropertyDataType=sS,d.inferReturnDeclarationDataType=wu,d.inferValueDescriptorDataType=oS,d.inferVariableDeclarationDataType=aS,d.inferVariableInstanceDataType=iS,d.initBaseProjectEntity=yp,d.initProject=$O,d.isPromise=zu,d.iterateOverListActionDescriptorListArgumentDeclaration=yT,d.iterateOverListActionDescriptorListArgumentDeclarationDataType=uT,d.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=cT,d.iterateOverListActionDescriptorListArgumentDeclarationParentRef=pT,d.iterateOverListLoopActionDescriptor=Wn,d.iterateOverListLoopActionDescriptorDynamicReturnDeclaration=fT,d.iterateOverListLoopActionDescriptorDynamicReturnDeclarationParentRef=hT,d.iterateOverListLoopBodyActionDescriptor=bs,d.iterateOverListLoopBodyActionDescriptorAnyDynamicArgument=DT,d.iterateOverListLoopBodyActionDescriptorAnyDynamicArgumentParentRef=IT,d.iterateOverListLoopBodyActionDescriptorAnyDynamicReturn=ST,d.iterateOverListLoopBodyActionDescriptorAnyDynamicReturnParentRef=AT,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclaration=gs,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=TT,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=mT,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=ET,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclaration=vT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=gT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=RT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=bT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclaration=BT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataType=CT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataTypeParentRef=PT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationParentRef=wT,d.iterateOverObjectKeysLoopActionDescriptor=li,d.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclaration=_T,d.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclarationParentRef=MT,d.iterateOverObjectKeysLoopBodyActionDescriptor=JT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgument=jT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgumentParentRef=xT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturn=qT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturnParentRef=kT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Yl,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=NT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=VT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=LT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclaration=UT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=$T,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=GT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=FT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclaration=ZT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataType=HT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataTypeParentRef=YT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationParentRef=zT,d.iterateOverObjectValuesLoopActionDescriptor=di,d.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclaration=XT,d.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclarationParentRef=KT,d.iterateOverObjectValuesLoopBodyActionDescriptor=cE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgument=oE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgumentParentRef=sE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturn=dE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturnParentRef=lE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Hl,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=eE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=QT,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=tE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclaration=aE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=rE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=nE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=iE,d.iterateOverStringActionDescriptorDynamicReturnDeclaration=Xm,d.iterateOverStringActionDescriptorDynamicReturnDeclarationParentRef=Km,d.iterateOverStringActionDescriptorStringArgumentDeclaration=Zm,d.iterateOverStringActionDescriptorStringArgumentDeclarationDataType=Hm,d.iterateOverStringActionDescriptorStringArgumentDeclarationDataTypeParentRef=Ym,d.iterateOverStringActionDescriptorStringArgumentDeclarationParentRef=zm,d.iterateOverStringLoopActionDescriptor=ea,d.iterateOverStringLoopBodyActionDescriptor=Wl,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgument=sT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgumentParentRef=aT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturn=lT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturnParentRef=oT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclaration=ql,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=eT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=Qm,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=tT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Jl,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=rT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=nT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=iT,d.joinListOperation=wl,d.joinListOperationError=rh,d.joinListOperationErrorParentRef=nh,d.joinListOperationFirstListArgument=Ky,d.joinListOperationFirstListArgumentParentRef=Zy,d.joinListOperationFirstListArgumentRef=qy,d.joinListOperationFirstListDataType=Jy,d.joinListOperationResultListDataType=zy,d.joinListOperationResultListReturn=th,d.joinListOperationResultListReturnParentRef=eh,d.joinListOperationResultListReturnRef=Hy,d.joinListOperationSecondListArgument=Qy,d.joinListOperationSecondListArgumentParentRef=Xy,d.joinListOperationSecondListArgumentRef=Wy,d.joinListOperationSecondListDataType=Yy,d.joinListWithLastSeparator=q,d.joinStringsOperation=Ki,d.joinStringsOperationDynamicStringArgument=Iy,d.joinStringsOperationDynamicStringArgumentParentRef=vy,d.joinStringsOperationDynamicStringArgumentRef=gy,d.joinStringsOperationDynamicStringDataType=by,d.joinStringsOperationError=Ry,d.joinStringsOperationErrorParentRef=Ey,d.joinStringsOperationFirstStringArgument=ds,d.joinStringsOperationFirstStringArgumentParentRef=dy,d.joinStringsOperationFirstStringArgumentRef=ry,d.joinStringsOperationFirstStringDataType=iy,d.joinStringsOperationResultStringDataType=ly,d.joinStringsOperationResultStringReturn=Zi,d.joinStringsOperationResultStringReturnParentRef=Ty,d.joinStringsOperationResultStringReturnRef=oy,d.joinStringsOperationSecondStringArgument=cs,d.joinStringsOperationSecondStringArgumentParentRef=my,d.joinStringsOperationSecondStringArgumentRef=ay,d.joinStringsOperationSecondStringDataType=sy,d.joinStringsOperationSeparatorStringArgument=fy,d.joinStringsOperationSeparatorStringArgumentParentRef=hy,d.joinStringsOperationSeparatorStringArgumentRef=cy,d.joinStringsOperationSeparatorStringDataType=yy,d.joinStringsOperationSeparatorStringDataTypeDefaultValue=py,d.joinStringsOperationSeparatorStringDataTypeDefaultValueParentRef=uy,d.keyValuePrototype=ai,d.lowercaseFirstLetter=Wo,d.manualFlowActionDescriptorDeclarationArgumentDeclaration=jl,d.manualFlowActionDescriptorDeclarationArgumentDeclarationDataType=Um,d.manualFlowActionDescriptorDeclarationArgumentDeclarationDataTypeParentRef=Fm,d.manualFlowActionDescriptorDeclarationArgumentDeclarationParentRef=xm,d.manualFlowLoopActionDescriptor=Rs,d.manualFlowLoopActionDescriptorDynamicReturnDeclaration=$m,d.manualFlowLoopActionDescriptorDynamicReturnDeclarationParentRef=Gm,d.manualFlowLoopBodyActionDescriptor=kl,d.manualFlowLoopBodyActionDescriptorAnyDynamicArgument=km,d.manualFlowLoopBodyActionDescriptorAnyDynamicArgumentParentRef=jm,d.manualFlowLoopBodyActionDescriptorAnyDynamicReturn=Jm,d.manualFlowLoopBodyActionDescriptorAnyDynamicReturnParentRef=qm,d.mapActionDescriptorToTypeItRepresents=$q,d.mergeEntityErrorsList=N9,d.mergeListOfEntities=Nq,d.methodDefaultValue=lm,d.mockClientProject=RD,d.moreThanOrEqualCondition=hi,d.moreThanOrEqualConditionLeftHandArgument=rg,d.moreThanOrEqualConditionLeftHandArgumentDataType=tg,d.moreThanOrEqualConditionLeftHandArgumentDataTypeParentRef=eg,d.moreThanOrEqualConditionLeftHandArgumentParentRef=ng,d.moreThanOrEqualConditionRightHandArgument=og,d.moreThanOrEqualConditionRightHandArgumentDataType=ag,d.moreThanOrEqualConditionRightHandArgumentDataTypeParentRef=ig,d.moreThanOrEqualConditionRightHandArgumentParentRef=sg,d.notEmptyCondition=gr,d.notEmptyConditionArgument=XR,d.notEmptyConditionRef=KR,d.nullPrototype=gp,d.numberAdditionOperation=ls,d.numberAdditionOperationDynamicSummandArgument=Fp,d.numberAdditionOperationDynamicSummandArgumentType=$p,d.numberAdditionOperationDynamicSummandArgumentTypeParentRef=Gp,d.numberAdditionOperationError=Lp,d.numberAdditionOperationErrorParentRef=Np,d.numberAdditionOperationFirstNumberArgument=Il,d.numberAdditionOperationFirstNumberArgumentRef=Op,d.numberAdditionOperationFirstNumberDataType=Pp,d.numberAdditionOperationRef=_p,d.numberAdditionOperationRefThree=Al,d.numberAdditionOperationRefTwo=Vp,d.numberAdditionOperationResultNumberDataType=Mp,d.numberAdditionOperationResultNumberReturn=Sl,d.numberAdditionOperationResultNumberReturnRef=Bp,d.numberAdditionOperationSecondNumberArgument=Dl,d.numberAdditionOperationSecondNumberArgumentRef=Cp,d.numberAdditionOperationSecondNumberDataType=wp,d.numberPrototype=ee,d.numberSubtractionOperation=Pl,d.numberSubtractionOperationDynamicSubtrahendArgument=ty,d.numberSubtractionOperationDynamicSubtrahendArgumentType=ey,d.numberSubtractionOperationDynamicSubtrahendArgumentTypeParentRef=Qp,d.numberSubtractionOperationError=Xp,d.numberSubtractionOperationErrorParentRef=Kp,d.numberSubtractionOperationFirstNumberArgument=Wp,d.numberSubtractionOperationFirstNumberArgumentRef=Up,d.numberSubtractionOperationFirstNumberDataType=xp,d.numberSubtractionOperationRef=Ol,d.numberSubtractionOperationRefThree=zp,d.numberSubtractionOperationRefTwo=Yp,d.numberSubtractionOperationResultNumberDataType=Jp,d.numberSubtractionOperationResultNumberReturn=Zp,d.numberSubtractionOperationResultNumberReturnRef=qp,d.numberSubtractionOperationSecondNumberArgument=Hp,d.numberSubtractionOperationSecondNumberArgumentRef=jp,d.numberSubtractionOperationSecondNumberDataType=kp,d.numberValueAutogenerationSchema=Sc,d.parallelExecutionOperation=Qt,d.parallelExecutionOperationError=sf,d.parallelExecutionOperationErrorParentRef=af,d.parallelExecutionOperationListOfExecutionResultsDataType=tf,d.parallelExecutionOperationListOfExecutionResultsReturn=Gl,d.parallelExecutionOperationListOfExecutionResultsReturnRef=ef,d.parallelExecutionOperationListOfFunctionsArgument=Ll,d.parallelExecutionOperationListOfFunctionsArgumentDatatype=Qh,d.parallelExecutionOperationListOfFunctionsArgumentRef=Xh,d.parallelExecutionOperationListOfFunctionsBlueprint=Kh,d.parallelExecutionOperationListOfFunctionsBlueprintDynamicInput=Zh,d.parallelExecutionOperationListOfFunctionsBlueprintDynamicOutput=zh,d.parallelExecutionOperationRef=nf,d.parallelExecutionOperationRefThree=rf,d.persistedBuiltInBaseEntity=st,d.persistedBuiltInBaseEntityDatabaseProperty=ui,d.persistedBuiltInBaseEntityDatabasePropertyDataType=MR,d.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=YO,d.persistedBuiltInBaseEntityDatabasePropertyParentRef=_R,d.persistedBuiltInBaseEntityDatabasePropertyRef=BR,d.persistedBuiltInBaseEntityPrimaryKeyProperty=pi,d.persistedBuiltInBaseEntityPrimaryKeyPropertyDataType=xR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOption=NR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOptionParentRef=VR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyParentRef=jR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyRef=UR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOption=GR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOptionParentRef=LR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOption=FR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOptionParentRef=$R,d.processOutputGlobalValueDescriptorDataType=hg,d.processOutputGlobalValueDescriptorReturn=Cs,d.processOutputGlobalValueDescriptorReturnRef=yg,d.projectPublicationCompletedGlobalEvent=Ps,d.propertyToZodSchema=Bg,d.relationalDatabaseBuiltInBaseEntity=un,d.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=dd,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataType=OR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=SR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=PR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=AR,d.relationalDatabaseBuiltInBaseEntityDefaultProperty=ld,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataType=DR,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=vR,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=IR,d.relationalDatabaseBuiltInBaseEntityIdentifierProperty=vs,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataType=hR,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=pR,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=yR,d.relationalDatabaseBuiltInBaseEntityMinSizeProperty=As,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataType=bR,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=RR,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=gR,d.relationalDatabaseBuiltInBaseEntityPasswordProperty=Ds,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataType=ER,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=WO,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=TR,d.relationalDatabaseBuiltInBaseEntityRef=ci,d.relationalDatabaseBuiltInBaseEntityUsernameProperty=Is,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataType=mR,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=JO,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=fR,d.resolveActionDescriptorName=yS,d.resolveBaseEntityName=dS,d.resolveBuiltInBaseEntityDataTypeLabel=cS,d.resolveClonedEntityProject=He,d.resolveConditionOperatorLabel=zo,d.resolveDataType=Yo,d.resolveDataTypeEntityOrNestedChildrenFromLiteralValue=Xu,d.resolveDataTypeLabel=Ka,d.resolveDefinitionEntityDataTypeLabel=D7,d.resolveEntityDataTypeLabel=I7,d.resolveEntityName=w,d.resolveFirstCallsSecond=Dq,d.resolveFirstWritesSecond=Aq,d.resolvePrimaryKeyProperty=xq,d.resolvePrimitiveEntityName=pS,d.resolveSearchName=uS,d.resolveVariableScope=g7,d.sequentialExecutionOperation=wn,d.sequentialExecutionOperationError=Sf,d.sequentialExecutionOperationErrorParentRef=Af,d.sequentialExecutionOperationListOfExecutionResultsDataType=vf,d.sequentialExecutionOperationListOfExecutionResultsReturn=Fl,d.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Df,d.sequentialExecutionOperationListOfExecutionResultsReturnRef=bf,d.sequentialExecutionOperationListOfFunctionsArgument=$l,d.sequentialExecutionOperationListOfFunctionsArgumentDatatype=gf,d.sequentialExecutionOperationListOfFunctionsArgumentParentRef=If,d.sequentialExecutionOperationListOfFunctionsArgumentRef=Rf,d.sequentialExecutionOperationListOfFunctionsBlueprint=Ef,d.sequentialExecutionOperationListOfFunctionsBlueprintDynamicInput=Tf,d.sequentialExecutionOperationListOfFunctionsBlueprintDynamicOutput=mf,d.softDeletePersistedEntityMethod=HO,d.softDeletePersistedEntityMethodParentRef=kR,d.sortCallsBasedOnExecutionDependencies=VS,d.sortChildrenEntitiesBasedOnExecutionDependencies=vq,d.splitListOperation=Ml,d.splitListOperationError=bh,d.splitListOperationErrorParentRef=gh,d.splitListOperationFirstOutputListDataType=ch,d.splitListOperationFirstOutputListReturn=mh,d.splitListOperationFirstOutputListReturnParentRef=fh,d.splitListOperationFirstOutputListReturnRef=Bl,d.splitListOperationInputListArgument=ph,d.splitListOperationInputListArgumentParentRef=uh,d.splitListOperationInputListArgumentRef=sh,d.splitListOperationInputListDataType=oh,d.splitListOperationSecondOutputListDataType=Th,d.splitListOperationSecondOutputListReturn=Rh,d.splitListOperationSecondOutputListReturnParentRef=Eh,d.splitListOperationSplitIndexArgument=hh,d.splitListOperationSplitIndexArgumentParentRef=yh,d.splitListOperationSplitIndexArgumentRef=lh,d.splitListOperationSplitIndexDataType=dh,d.splitStringOperation=Cl,d.splitStringOperationError=Uy,d.splitStringOperationErrorParentRef=Fy,d.splitStringOperationFirstPartResultStringDataType=Cy,d.splitStringOperationFirstPartResultStringReturn=$y,d.splitStringOperationFirstPartResultStringReturnParentRef=Gy,d.splitStringOperationFirstPartResultStringReturnRef=Py,d.splitStringOperationIndexArgument=Ny,d.splitStringOperationIndexArgumentParentRef=Vy,d.splitStringOperationIndexArgumentRef=Sy,d.splitStringOperationIndexDataType=Oy,d.splitStringOperationSecondPartResultStringDataType=By,d.splitStringOperationSecondPartResultStringReturn=kO,d.splitStringOperationSecondPartResultStringReturnParentRef=Ly,d.splitStringOperationSecondPartResultStringReturnRef=wy,d.splitStringOperationStringArgument=_y,d.splitStringOperationStringArgumentParentRef=My,d.splitStringOperationStringArgumentRef=Dy,d.splitStringOperationStringDataType=Ay,d.stringPrototype=J,d.stringValueAutogenerationSchema=Ac,d.suggestNewIdForEntity=$u,d.test_primitive_entities_export=DJ,d.toCamelCase=b7,d.toEntityState=Lt,d.toKebabCase=lS,d.toLowerCaseKebabCase=Ho,d.toPascalCase=v7,d.untypedDataPrototype=it,d.updateErrorsList=Be,d.updateValueReader=Lq,d.urlDefaultValue=nm,d.uuidPrototype=Pn,d.validateArgumentDeclarationName=Lu,d.validateCalledByErrorIdInAction=yq,d.validateCalledByIdInAction=pq,d.validateCallers=vS,d.validateConditionEntityDeclaration=mq,d.validateDataOperation=fr,d.validateDataOperationDataToValidateArgument=Jf,d.validateDataOperationDataToValidateArgumentParentRef=qf,d.validateDataOperationDataToValidateArgumentRef=jf,d.validateDataOperationDataToValidateDataType=kf,d.validateDataOperationEntityToMatchTypeArgument=zf,d.validateDataOperationEntityToMatchTypeArgumentParentRef=Hf,d.validateDataOperationEntityToMatchTypeArgumentRef=Wf,d.validateDataOperationEntityToMatchTypeDataType=Yf,d.validateDataOperationError=Qf,d.validateDataOperationErrorParentRef=Xf,d.validateDataOperationOutputEntityDeclaration=Kf,d.validateDataOperationOutputEntityDeclarationParentRef=Zf,d.validateDefinitionEntityName=Zo,d.validateEntryCaller=bS,d.validateErrorCaller=gS,d.validateFunctionCallDeclaration=DS,d.validateFunctionDeclarationName=_u,d.validateGeneratedEntityParentIsNotBuiltInEntity=lq,d.validateGeneration=sq,d.validateGenerationTarget=je,d.validateGenerationUpdate=oq,d.validateLoopEntityDeclaration=Tq,d.validateName=A7,d.validateOperationEntityDeclaration=AS,d.validatePropertyName=Nu,d.validateReachability=kn,d.validateReadsValueInActionPayload=hq,d.validateReferenceObject=Xo,d.validateReferenceToOne=xu,d.validateReferences=tt,d.validateReturnDeclarationName=Gu,d.validateSuccessCaller=RS,d.validateValueReaderGenerationUpdate=Qa,d.validateValueWritter=Yu,d.validateVariableDeclarationName=Vu,d.validateVariableInternalCallUse=Hu,d.valueAutogenerationCurrentDateAndTimeSchema=bD,d.valueAutogenerationGenericSchema=Eo,d.valueAutogenerationOptions=Pc,d.valueAutogenerationOptionsSchema=gD,d.valueAutogenerationRandomBooleanSchema=Dc,d.valueAutogenerationRandomDateBetweenSchema=wD,d.valueAutogenerationRandomDateFromSchema=PD,d.valueAutogenerationRandomDateSchema=bo,d.valueAutogenerationRandomDateUntilSchema=CD,d.valueAutogenerationRandomNumberBetweenSchema=DD,d.valueAutogenerationRandomNumberFromSchema=vD,d.valueAutogenerationRandomNumberSchema=Ro,d.valueAutogenerationRandomNumberUntilSchema=ID,d.valueAutogenerationRandomSchema=Va,d.valueAutogenerationRandomTextBetweenSchema=OD,d.valueAutogenerationRandomTextFromSchema=AD,d.valueAutogenerationRandomTextSchema=go,d.valueAutogenerationRandomTextUntilSchema=SD,d.valueAutogenerationRangeValueTypesSchema=_a,d.valueAutogenerationUniqueSchema=Ic,d.waitOperation=Rt,d.waitOperationMillisecondsNumberArgument=yr,d.waitOperationMillisecondsNumberArgumentRef=df,d.waitOperationMillisecondsNumberDataType=cf,d.waitOperationOperationError=yf,d.waitOperationOperationErrorParentRef=pf,d.waitOperationRef=uf,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyx-code/project-logic-tree",
3
- "version": "0.0.6127",
3
+ "version": "0.0.6128",
4
4
  "author": "Sergio Herrero",
5
5
  "license": "UNLICENSED",
6
6
  "description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",