@elyx-code/project-logic-tree 0.0.6136 → 0.0.6138
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 +772 -775
- package/dist/index.umd.cjs +36 -36
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(d,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(d=typeof globalThis<"u"?globalThis:d||self,i(d["@elyx-code/project-logic-tree"]={}))})(this,function(d){"use strict";var SJ=Object.defineProperty;var OJ=(d,i,U)=>i in d?SJ(d,i,{enumerable:!0,configurable:!0,writable:!0,value:U}):d[i]=U;var c=(d,i,U)=>(OJ(d,typeof i!="symbol"?i+"":i,U),U);var i=(r=>(r.DefinitionEntity="definition-entity",r.BuiltInBaseEntity="built-in-base-entity",r.Project="project",r.InstalledProject="installed-project",r.GlobalEvent="global-event",r.DataType="data-type",r.FunctionCall="function-call",r.FunctionDeclaration="function-declaration",r.ActionDescriptor="action-descriptor",r.ValueDescriptor="value-descriptor",r.ArgumentDeclaration="argument-declaration",r.InputMap="input-map",r.ReturnStatement="return-statement",r.BreakStatement="break-statement",r.ContinueStatement="continue-statement",r.ReturnDeclaration="return-declaration",r.OutputMap="output-map",r.PrimitiveEntity="primitive-entity",r.LiteralValue="literal-value",r.Property="property",r.Operation="operation",r.Condition="condition",r.VariableDeclaration="variable-declaration",r.VariableInstance="variable-instance",r.Search="search",r.Loop="loop",r.InternalCall="internal-call",r.GenericReference="generic-reference",r))(i||{}),U=(r=>(r.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",r.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",r.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",r.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",r.EXECUTION="BUILT_IN_EXECUTION_ENTITY",r.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",r))(U||{}),ze=(r=>(r.CurrentDateAndTime="current-date-and-time",r.Unique="unique",r.Random="random",r))(ze||{}),C=(r=>(r.EntityTemplate="entity-template",r.ActionDescriptor="action-descriptor",r.String="string",r.Number="number",r.Boolean="boolean",r.Null="null",r.Enum="enum",r.KeyValue="key-value",r.Date="date",r.UUID="uuid",r.File="file",r.Untyped="untyped",r))(C||{}),Ge=(r=>(r.Addition="addition",r.Subtraction="subtraction",r.Multiplication="multiplication",r.Division="division",r.Remainder="remainder",r.Exponentiation="exponentiation",r))(Ge||{}),re=(r=>(r.Join="string-join",r.Split="string-split",r.DeleteLast="string-delete-last",r.DeleteFirst="string-delete-first",r.DeleteIndex="string-delete-index",r.AddIndex="string-add-index",r.ReplaceFirst="string-replace-first",r.ReplaceLast="string-replace-last",r.ReplaceIndex="string-replace-index",r.ReplaceSingleMatch="string-replace-single-match",r.ReplaceAllMatches="string-replace-all-matches",r.GetIndex="string-get-index",r.GetFirst="string-get-first",r.GetLast="string-get-last",r.Append="string-append",r.Prepend="string-prepend",r))(re||{}),X=(r=>(r.Join="list-join",r.Split="list-split",r.DeleteLast="list-delete-last",r.DeleteFirst="list-delete-first",r.DeleteIndex="list-delete-index",r.AddIndex="list-add-index",r.ReplaceFirst="list-replace-first",r.ReplaceLast="list-replace-last",r.ReplaceIndex="list-replace-index",r.ReplaceSingleMatch="list-replace-single-match",r.ReplaceAllMatches="list-replace-all-matches",r.GetIndex="list-get-index",r.GetFirst="list-get-first",r.GetLast="list-get-last",r.Append="list-append",r.Prepend="list-prepend",r))(X||{}),Ne=(r=>(r.Parallel="parallel",r.Sequential="sequential",r.Wait="wait",r))(Ne||{}),Le=(r=>(r.CreateNewInstance="create-new-instance",r.Validate="validate",r))(Le||{}),dt=(r=>(r.HttpRequest="base-http-request",r))(dt||{}),qe=(r=>(r.Equal="equal",r.NotEqual="not-equal",r.And="and",r.Or="or",r.LessThan="less-than",r.MoreThan="more-than",r.LessThanOrEqual="less-than-or-equal",r.MoreThanOrEqual="more-than-or-equal",r))(qe||{}),Jt=(r=>(r.Empty="empty",r.NotEmpty="not-empty",r))(Jt||{}),k=(r=>(r.ManualFlow="manual-flow-loop",r.Counted="counted-loop",r.List="list-loop",r.ObjectKeys="object-keys-loop",r.ObjectValues="object-values-loop",r.String="string-loop",r))(k||{}),P=(r=>(r.FixedArguments="fixed-arguments",r.FixedReturns="fixed-returns",r.ReturnedError="returned-error",r.OngoingProcessExecution="ongoing-process-execution",r.DynamicArgument="dynamic-argument-types",r.DynamicReturn="dynamic-return-types",r))(P||{}),et=(r=>(r.OrDataTypeGroup="or-data-type-group",r.AndDataTypeGroup="and-data-type-group",r))(et||{}),In=(r=>(r.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",r))(In||{}),Gt=(r=>(r.DeletePersistedEntity="base-delete-persisted-entity",r.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",r.AbortExecution="base-abort-execution",r))(Gt||{}),ri=(r=>(r.Error="error",r.Task="task",r.Return="return",r))(ri||{});const Dn=[i.VariableDeclaration,i.VariableInstance,i.InputMap,i.ReturnDeclaration],Ze=[i.VariableDeclaration,i.VariableInstance,i.ArgumentDeclaration,i.OutputMap],mp=[...Dn,...Ze],Fe=[i.VariableDeclaration,i.VariableInstance],Tp=[i.FunctionDeclaration,i.Condition,i.Loop,i.Operation,i.FunctionCall,i.Search,i.InternalCall,i.GlobalEvent,i.DefinitionEntity,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.VariableDeclaration,i.VariableInstance,i.LiteralValue,i.ActionDescriptor,i.ValueDescriptor,i.Property,i.DataType,i.InstalledProject,i.ArgumentDeclaration,i.InputMap,i.OutputMap,i.ReturnDeclaration],Ep=[i.FunctionDeclaration,i.Property,i.ArgumentDeclaration,i.ReturnDeclaration],Il=[i.FunctionCall,i.VariableInstance,i.InputMap,i.OutputMap,i.InternalCall],UO=[...Il,i.Condition,i.Loop,i.Operation,i.Condition],ii=[i.GlobalEvent],Je=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.InternalCall,i.Loop],Dl=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.Loop],We=[i.FunctionDeclaration,...ii],Xt=[...Je,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],Al=[...Dl,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],sn=[...Je,...We],Rp=[...Dl,...We],xO=[...Xt,...We],jO=[...Al,...We],pt=[...We,i.Loop],xe=[i.ReturnStatement,i.BreakStatement,i.ContinueStatement],kO=[i.DefinitionEntity,i.BuiltInBaseEntity,i.Project,i.InstalledProject,i.GlobalEvent,i.DataType,i.FunctionCall,i.FunctionDeclaration,i.ActionDescriptor,i.ValueDescriptor,i.ArgumentDeclaration,i.InputMap,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.ReturnDeclaration,i.OutputMap,i.PrimitiveEntity,i.LiteralValue,i.Property,i.Operation,i.Condition,i.VariableDeclaration,i.VariableInstance,i.Search,i.Loop,i.InternalCall],ls=[i.DefinitionEntity,i.GlobalEvent,i.FunctionDeclaration,i.FunctionCall,i.VariableDeclaration,i.VariableInstance,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.InstalledProject,i.Loop,i.Search],gp=[i.DefinitionEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor],qn=[i.BuiltInBaseEntity,i.PrimitiveEntity],bp=[i.DefinitionEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.GlobalEvent,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor,i.InputMap,i.OutputMap,i.FunctionCall,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.VariableInstance,i.LiteralValue,i.InternalCall];var ds=(r=>(r.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",r))(ds||{});const _={[i.PrimitiveEntity]:{[C.String]:{id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",properties:{}},[C.Boolean]:{id:"f596545d-1565-4faa-9969-d95fa5edfea4",properties:{}},[C.Number]:{id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",properties:{}},[C.KeyValue]:{id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",properties:{}},[C.Enum]:{id:"9542b8b4-2642-4eee-9db9-def7963a17a0",properties:{options:{id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",dataType:{id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",defaultValue:{id:"enum-options-property-data-type-default-value-id"}}}}},[C.UUID]:{id:"4a6234aa-c0f6-4731-b4dd-750388029226",properties:{}},[C.Date]:{id:"dc58f38b-d574-4956-aac6-32ce9529b937",properties:{}},[C.Null]:{id:"7d698f34-5a89-4aab-846b-07ef3843b8c4",properties:{}},[C.Untyped]:{id:"4044a018-818e-49d7-bf9a-c3dd1fff2102",properties:{}}},[i.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[i.BuiltInBaseEntity]:{[U.KEY_VALUE_PARAM]:{id:U.KEY_VALUE_PARAM},[U.HTTP_ENDPOINT]:{id:U.HTTP_ENDPOINT,properties:{method:{id:"http-endpoint-built-in-method-property-id"},path:{id:"http-endpoint-built-in-path-property-id"},cors:{id:"http-endpoint-built-in-cors-property-id"}}},[U.PERSISTED_ENTITY]:{id:U.PERSISTED_ENTITY,properties:{database:{id:"persisted-built-in-base-entity-database-property-id"},primaryKey:{id:"persisted-built-in-base-entity-primary-key-property-id"}}},[U.RELATIONAL_DATABASE]:{id:U.RELATIONAL_DATABASE,properties:{identifier:{id:"relational-database-built-in-base-entity-identifier-property-id"},username:{id:"relational-database-built-in-base-entity-username-property-id"},password:{id:"relational-database-built-in-base-entity-password-property-id"},minSize:{id:"relational-database-built-in-base-entity-min-size-property-id"},default:{id:"relational-database-built-in-base-entity-default-property-id"},autoscaling:{id:"relational-database-built-in-base-entity-autoscaling-property-id"}}},[U.CRON_JOB]:{id:U.CRON_JOB,properties:{expression:{id:"cron-job-built-in-base-entity-expression-property-id"}}}},[i.Operation]:{[re.Join]:{id:re.Join,inputs:{separator:{id:"join-strings-separator-input-id"},first:{id:"join-strings-first-string-input-id"},second:{id:"join-strings-second-string-input-id"},dynamicString:{id:"join-strings-dynamic-string-input-id"}},outputs:{result:{id:"join-strings-result-string-return-delaration-id"},error:{id:"join-strings-error-return-delaration-id"}}},[re.Split]:{id:re.Split,inputs:{stringValue:{id:"split-string-string-input-id"},indexLocation:{id:"split-string-index-input-id"}},outputs:{firstPartResult:{id:"split-string-first-part-result-string-return-delaration-id"},secondPartResult:{id:"split-string-second-part-result-string-return-delaration-id"},error:{id:"split-string-error-return-delaration-id"}}},[Ge.Addition]:{id:Ge.Addition,inputs:{firstSummand:{id:"number-addition-first-summand-number-input-id"},secondSummand:{id:"number-addition-second-summand-number-input-id"},dynamicSummand:{id:"number-addition-dynamic-summand-number-input-id"}},outputs:{result:{id:"number-addition-result-number-return-delaration-id",dataType:{id:"number-addition-result-number-data-type-id"}},error:{id:"number-addition-error-return-delaration-id"}}},[Ge.Subtraction]:{id:Ge.Subtraction,inputs:{minuend:{id:"number-subtraction-minuend-number-input-id"},subtrahend:{id:"number-subtraction-subtrahend-number-input-id"},dynamicSubtrahend:{id:"number-subtraction-dynamic-subtrahend-number-input-id"}},outputs:{result:{id:"number-subtraction-result-number-return-delaration-id",dataType:{id:"number-subtraction-result-number-data-type-id"}},error:{id:"number-subtraction-error-return-delaration-id"}}},[dt.HttpRequest]:{id:dt.HttpRequest,inputs:{url:{id:"http-request-url-input-id"},query:{id:"http-request-query-input-id"},method:{id:"http-request-method-input-id"},headers:{id:"http-request-headers-input-id"},body:{id:"http-request-body-string-input-id"}},outputs:{code:{id:"http-response-code-return-delaration-id"},body:{id:"http-response-body-return-delaration-id"},headers:{id:"http-response-headers-return-delaration-id"},error:{id:"http-request-error-return-delaration-id"}}},[Le.Validate]:{id:Le.Validate,inputs:{entityToMatch:{id:"validate-data-entity-to-match-input-id"},dataToValidate:{id:"validate-data-data-to-validate-input-id"}},outputs:{outputEntity:{id:"validate-data-output-entity-return-delaration-id"},error:{id:"validate-data-error-return-delaration-id"}}},[Ne.Parallel]:{id:Ne.Parallel,inputs:{listOfActions:{id:"parallel-execution-list-of-actions-input-id"}},outputs:{results:{id:"parallel-execution-results-output-id",dataType:{id:"parallel-execution-results-data-type-id"}},error:{id:"parallel-execution-error-output-id"}}}},[i.Loop]:{[k.List]:{id:k.List,inputs:{list:{id:"iterate-over-list-loop-list-input-id"}},outputs:{results:{id:"iterate-over-list-loop-output-id"}},body:{id:"iterate-over-list-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-list-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-list-loop-current-value-input-id"}}}},[k.String]:{id:k.String,inputs:{string:{id:"iterate-over-string-loop-string-input-id"}},outputs:{results:{id:"iterate-over-string-loop-output-id"}},body:{id:"iterate-over-string-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-string-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-string-loop-current-value-input-id"}}}},[k.ObjectKeys]:{id:k.ObjectKeys,inputs:{object:{id:"iterate-over-object-keys-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-keys-loop-output-id"}},body:{id:"iterate-over-object-keys-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-keys-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-keys-loop-current-value-input-id"}}}},[k.ObjectValues]:{id:k.ObjectValues,inputs:{object:{id:"iterate-over-object-values-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-values-loop-output-id"}},body:{id:"iterate-over-object-values-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-values-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-values-loop-current-value-input-id"}}}},[k.ManualFlow]:{id:k.ManualFlow,inputs:{},outputs:{results:{id:"manual-flow-loop-output-id"}},body:{id:"manual-flow-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-manual-flow-loop-iteration-number-input-id"}}}},[k.Counted]:{id:k.Counted,inputs:{number:{id:"counted-loop-number-input-id"}},outputs:{results:{id:"counted-loop-output-id"}},body:{id:"counted-loop-body-descriptor-id",inputs:{iterationNumber:{id:"counted-loop-iteration-number-input-id"}}}}},[i.Condition]:{[qe.MoreThanOrEqual]:{id:qe.MoreThanOrEqual,inputs:{leftHand:{id:"condition-more-than-or-equal-left-hand-input-id",dataType:{id:"condition-more-than-or-equal-left-hand-data-type-id"}},rightHand:{id:"condition-more-than-or-equal-right-hand-input-id",dataType:{id:"condition-more-than-or-equal-right-hand-data-type-id"}}}},[Jt.NotEmpty]:{id:Jt.NotEmpty,inputs:{leftHand:{id:"condition-not-empty-input-id"}}}},[i.GlobalEvent]:{[In.PROJECT_PUBLICATION_COMPLETED]:{id:In.PROJECT_PUBLICATION_COMPLETED}}},$t=_[i.PrimitiveEntity],J={type:i.PrimitiveEntity,id:$t.string.id,description:"A string of characters.",version:1,name:C.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},An={type:i.PrimitiveEntity,id:$t.boolean.id,description:"A 'true' or 'false' value.",version:1,name:C.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},ee={type:i.PrimitiveEntity,id:$t.number.id,description:"A number value.",version:1,name:C.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},vp={type:i.PrimitiveEntity,id:$t.null.id,description:"An explicitly empty value.",version:1,name:C.Null,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},it={type:i.PrimitiveEntity,id:$t.untyped.id,description:"Data of any type that isn't known in advance.",version:1,name:C.Untyped,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ip={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:i.GenericReference,entityId:$t.enum.properties.options.id,entityType:i.Property},Dp={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:i.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:i.Property},Ap={like:!1,inferred:!1,id:$t.enum.properties.options.dataType.id,version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:J,asType:!1,parent:Dp},Sp={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:i.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:i.PrimitiveEntity},Op={constant:!1,hidden:!1,required:!0,id:$t.enum.properties.options.id,name:"Options",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,defaultValue:{id:$t.enum.properties.options.dataType.defaultValue.id,type:i.LiteralValue,version:1,name:C.KeyValue,autogeneration:null,value:[],valueAsType:null,parent:Ip},dataType:Ap,description:"Options for the enum. Each option is a text value.",parent:Sp},Sn={type:i.PrimitiveEntity,id:$t.enum.id,description:"A set of text options to choose from.",version:1,name:C.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[Op],methods:[]},on={type:i.PrimitiveEntity,id:$t.date.id,description:"A date and time value.",version:1,name:C.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},On={type:i.PrimitiveEntity,id:$t.uuid.id,description:"A unique identifier in the form of a 36-character string.",version:1,name:C.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[J],properties:[],methods:[]},ai={type:i.PrimitiveEntity,id:$t[C.KeyValue].id,description:"A complex data structure with any combination of properties with names and values.",version:1,name:C.KeyValue,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Pp=[J,An,ee,vp,it,Sn,on,On,ai],ln=_[i.Operation][Ge.Addition],Cp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:ln.inputs.firstSummand.id,entityType:i.ValueDescriptor},wp={like:!1,inferred:!1,id:"number-addition-first-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Cp},Bp={type:i.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:ln.inputs.secondSummand.id,entityType:i.ValueDescriptor},Mp={like:!1,inferred:!1,id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Bp},_p={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:ln.outputs.result.id,entityType:i.ValueDescriptor},Vp={like:!1,inferred:!1,id:ln.outputs.result.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:_p},Np={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ge.Addition,entityType:i.ActionDescriptor},Sl={id:ln.inputs.firstSummand.id,type:i.ValueDescriptor,version:1,name:"Summand",description:"The first number to add",defaultValue:null,dataType:wp,required:!0,parentRelationType:P.FixedArguments,index:0,parent:Np},Lp={type:i.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:Ge.Addition,entityType:i.ActionDescriptor},Ol={id:ln.inputs.secondSummand.id,type:i.ValueDescriptor,description:"The second number to add",version:1,name:"Summand",defaultValue:null,dataType:Mp,required:!0,parentRelationType:P.FixedArguments,index:1,parent:Lp},Pl={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ge.Addition,entityType:i.ActionDescriptor},Cl={parentRelationType:P.FixedReturns,id:ln.outputs.result.id,type:i.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",defaultValue:null,dataType:Vp,required:!0,index:0,parent:Pl},Gp={type:i.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:Ge.Addition,entityType:i.ActionDescriptor},$p={parentRelationType:P.FixedReturns,id:ln.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Gp},Fp={type:i.GenericReference,id:"number-addition-operation-dynamic-summand-argument-type-parent-ref",entityId:ln.inputs.dynamicSummand.id,entityType:i.ValueDescriptor},Up={like:!1,inferred:!1,id:"number-addition-operation-dynamic-summand-argument-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Fp},xp={parentRelationType:P.DynamicArgument,id:ln.inputs.dynamicSummand.id,type:i.ValueDescriptor,description:"A number to add",version:1,name:"Summand",defaultValue:null,dataType:Up,required:!0,index:2,parent:Pl},cs={id:Ge.Addition,type:i.ActionDescriptor,description:"Sum numbers",version:1,name:Ge.Addition,inputs:[Sl,Ol,xp],error:$p,outputs:[Cl],parent:null},dn=_[i.Operation][Ge.Subtraction],jp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:dn.inputs.minuend.id,entityType:i.ValueDescriptor},kp={like:!1,inferred:!1,id:"number-subtraction-first-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:jp},qp={type:i.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:dn.inputs.subtrahend.id,entityType:i.ValueDescriptor},Jp={like:!1,inferred:!1,id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:qp},Wp={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:dn.outputs.result.id,entityType:i.ValueDescriptor},Yp={like:!1,inferred:!1,id:dn.outputs.result.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Wp},wl={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},Hp={id:dn.inputs.minuend.id,type:i.ValueDescriptor,version:1,name:"Minuend",description:"Base number to substract from",defaultValue:null,dataType:kp,required:!0,parentRelationType:P.FixedArguments,index:0,parent:wl},zp={type:i.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},Zp={id:dn.inputs.subtrahend.id,type:i.ValueDescriptor,description:"The second number to substract",version:1,name:"Subtrahend",defaultValue:null,dataType:Jp,required:!0,parentRelationType:P.FixedArguments,index:1,parent:zp},Kp={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},Xp={parentRelationType:P.FixedReturns,id:dn.outputs.result.id,type:i.ValueDescriptor,description:"The result number of the subtraction",version:1,name:"Result",defaultValue:null,dataType:Yp,required:!0,index:0,parent:Kp},Qp={type:i.GenericReference,id:"number-subtraction-operation-error-parent-ref",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},ey={parentRelationType:P.FixedReturns,id:dn.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Qp},ty={type:i.GenericReference,id:"number-subtraction-operation-dynamic-subtrahend-argument-type-parent-ref",entityId:dn.inputs.dynamicSubtrahend.id,entityType:i.ValueDescriptor},ny={like:!1,inferred:!1,id:"number-subtraction-operation-dynamic-subtrahend-argument-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:ty},ry={id:dn.inputs.dynamicSubtrahend.id,type:i.ValueDescriptor,version:1,name:"Subtrahend",description:"A number to substract",defaultValue:null,dataType:ny,required:!0,parentRelationType:P.DynamicArgument,index:2,parent:wl},Bl={id:Ge.Subtraction,type:i.ActionDescriptor,description:"Substract numbers",version:1,name:Ge.Subtraction,inputs:[Hp,Zp,ry],error:ey,outputs:[Xp],parent:null},iy={[Ge.Addition]:cs,[Ge.Subtraction]:Bl},Wt=_[i.Operation][re.Join],ay={type:i.GenericReference,id:"join-strings-first-string-argument-declaration",entityId:Wt.inputs.first.id,entityType:i.ValueDescriptor},sy={like:!1,inferred:!1,id:"join-strings-first-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:ay},oy={type:i.GenericReference,id:"join-strings-second-string-argument-declaration",entityId:Wt.inputs.second.id,entityType:i.ValueDescriptor},ly={like:!1,inferred:!1,id:"join-strings-second-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:oy},dy={type:i.GenericReference,id:"join-strings-result-string-return-delaration",entityId:Wt.outputs.result.id,entityType:i.ValueDescriptor},cy={like:!1,inferred:!1,id:"join-strings-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:dy},uy={type:i.GenericReference,id:"join-strings-operation-first-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},us={id:Wt.inputs.first.id,type:i.ValueDescriptor,version:1,name:"Text",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",defaultValue:null,dataType:sy,parentRelationType:P.FixedArguments,required:!0,index:1,parent:uy},py={type:i.GenericReference,id:"join-strings-first-string-argument-declaration",entityId:Wt.inputs.first.id,entityType:i.ValueDescriptor},yy={type:i.GenericReference,id:"join-strings-separator-string-data-type-default-value-parent-ref",entityId:Wt.inputs.separator.id,entityType:i.ValueDescriptor},hy={type:i.LiteralValue,id:"join-strings-separator-string-data-type-default-value-id",version:1,name:C.String,value:"",valueAsType:null,autogeneration:null,parent:yy},fy={like:!1,inferred:!1,id:"join-strings-separator-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:py},my={type:i.GenericReference,id:"join-strings-operation-separator-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Ty={id:Wt.inputs.separator.id,type:i.ValueDescriptor,version:1,name:"Separator",description:"The text value that will be inserted between each of the values that are joined.",defaultValue:hy,dataType:fy,parentRelationType:P.FixedArguments,required:!1,index:0,parent:my},Ey={type:i.GenericReference,id:"join-strings-operation-second-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},ps={id:Wt.inputs.second.id,type:i.ValueDescriptor,version:1,name:"Text",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",defaultValue:null,dataType:ly,parentRelationType:P.FixedArguments,required:!0,index:2,parent:Ey},Ry={type:i.GenericReference,id:"join-strings-operation-result-string-return-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Zi={parentRelationType:P.FixedReturns,id:Wt.outputs.result.id,type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",defaultValue:null,dataType:cy,required:!0,index:0,parent:Ry},gy={type:i.GenericReference,id:"join-strings-operation-error-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},by={parentRelationType:P.FixedReturns,id:Wt.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:gy},vy={type:i.GenericReference,id:"join-strings-dynamic-string-argument-declaration",entityId:Wt.inputs.dynamicString.id,entityType:i.ValueDescriptor},Iy={like:!1,inferred:!1,id:"join-strings-dynamic-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:vy},Dy={type:i.GenericReference,id:"join-strings-operation-dynamic-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Ay={id:Wt.inputs.dynamicString.id,type:i.ValueDescriptor,version:1,name:"Text",description:"Text to join to the previous ones. Its value will be at the end of the resulting text.",defaultValue:null,dataType:Iy,parentRelationType:P.DynamicArgument,required:!0,index:3,parent:Dy},Ki={id:re.Join,type:i.ActionDescriptor,version:1,name:re.Join,description:"Join text values together, to form a single resulting text value.",inputs:[Ty,us,ps,Ay],outputs:[Zi],error:by,parent:null},Pn=_[i.Operation][re.Split],Sy={type:i.GenericReference,id:"split-string-string-argument-declaration",entityId:Pn.inputs.stringValue.id,entityType:i.ValueDescriptor},Oy={like:!1,inferred:!1,id:"split-string-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:Sy},Py={type:i.GenericReference,id:"split-string-index-argument-declaration",entityId:Pn.inputs.indexLocation.id,entityType:i.ValueDescriptor},Cy={like:!1,inferred:!1,id:"split-string-index-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Py},wy={type:i.GenericReference,id:"split-string-first-part-result-string-return-delaration",entityId:Pn.outputs.firstPartResult.id,entityType:i.ValueDescriptor},By={like:!1,inferred:!1,id:"split-string-first-part-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:wy},My={type:i.GenericReference,id:"split-string-second-part-result-string-return-delaration",entityId:Pn.outputs.secondPartResult.id,entityType:i.ValueDescriptor},_y={like:!1,inferred:!1,id:"split-string-second-part-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:My},Vy={type:i.GenericReference,id:"split-string-operation-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Ny={id:Pn.inputs.stringValue.id,type:i.ValueDescriptor,version:1,name:"Text value",description:"The text value that will be split into two at the given index location.",defaultValue:null,dataType:Oy,parentRelationType:P.FixedArguments,required:!0,index:0,parent:Vy},Ly={type:i.GenericReference,id:"split-string-operation-index-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Gy={id:Pn.inputs.indexLocation.id,type:i.ValueDescriptor,version:1,name:"Index location",description:"The index location where the text will be split into two. The text at this index will be the beginning of the second text.",defaultValue:null,dataType:Cy,parentRelationType:P.FixedArguments,required:!0,index:1,parent:Ly},$y={type:i.GenericReference,id:"split-string-operation-second-part-result-string-return-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},qO={parentRelationType:P.FixedReturns,id:Pn.outputs.secondPartResult.id,type:i.ValueDescriptor,version:1,name:"Second part",description:"The secont part of the resulting text value.",defaultValue:null,dataType:_y,required:!0,index:1,parent:$y},Fy={type:i.GenericReference,id:"split-string-operation-first-part-result-string-return-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Uy={parentRelationType:P.FixedReturns,id:Pn.outputs.firstPartResult.id,type:i.ValueDescriptor,version:1,name:"First part",description:"The first part of the resulting text value.",defaultValue:null,dataType:By,required:!0,index:0,parent:Fy},xy={type:i.GenericReference,id:"split-string-operation-error-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},jy={parentRelationType:P.FixedReturns,id:Pn.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:xy},Ml={id:re.Split,type:i.ActionDescriptor,version:1,name:re.Split,description:"Split a text into two, at the given index location.",inputs:[Ny,Gy],outputs:[Uy],error:jy,parent:null},ky={[re.Join]:Ki,[re.Split]:Ml};var qy=(r=>(r.FirstInputList="join-list-first-list-argument-declaration",r.SecondInputList="join-list-second-list-argument-declaration",r))(qy||{}),Jy=(r=>(r.ResultList="join-list-result-list-return-delaration",r.Error="join-list-error-return-delaration",r))(Jy||{});const Wy={type:i.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:i.ValueDescriptor},Yy={like:!1,inferred:!1,id:"join-list-first-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Wy},Hy={type:i.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:i.ValueDescriptor},zy={like:!1,inferred:!1,id:"join-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Hy},Zy={type:i.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:i.ValueDescriptor},Ky={like:!1,inferred:!1,id:"join-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Zy},Xy={type:i.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},Qy={id:"join-list-first-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first list to join to the second one. Its values will be at the beginning of the resulting list.",defaultValue:null,dataType:Yy,parentRelationType:P.FixedArguments,required:!0,index:0,parent:Xy},eh={type:i.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},th={id:"join-list-second-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"Second value",description:"The second list to join to the first one. Its values will be at the end of the resulting list.",defaultValue:null,dataType:zy,parentRelationType:P.FixedArguments,required:!0,index:1,parent:eh},nh={type:i.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},rh={parentRelationType:P.FixedReturns,id:"join-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",defaultValue:null,dataType:Ky,required:!0,index:0,parent:nh},ih={type:i.GenericReference,id:"join-list-operation-error-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},ah={parentRelationType:P.FixedReturns,id:"join-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:ih},_l={id:X.Join,type:i.ActionDescriptor,version:1,name:X.Join,description:"Join two lists together, to form a single resulting list value.",inputs:[Qy,th],error:ah,outputs:[rh],parent:null};var sh=(r=>(r.InputList="list-to-split-argument-declaration",r.SplitIndex="split-list-index-argument-declaration",r))(sh||{}),oh=(r=>(r.FirstOutputList="split-list-first-output-list-return-delaration",r.SecondOutputList="split-list-second-output-list-return-delaration",r.Error="split-list-error-return-delaration",r))(oh||{});const lh={type:i.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:i.ValueDescriptor},dh={like:!1,inferred:!1,id:"split-list-operation-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:lh},ch={type:i.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:i.ValueDescriptor},uh={like:!1,inferred:!1,id:"split-list-operation-split-index-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:ch},Vl={type:i.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:i.ValueDescriptor},ph={like:!1,inferred:!1,id:"split-list-operation-first-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Vl},yh={type:i.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},hh={id:"list-to-split-argument-declaration",type:i.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",defaultValue:null,dataType:dh,parentRelationType:P.FixedArguments,required:!0,index:0,parent:yh},fh={type:i.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},mh={id:"split-list-index-argument-declaration",type:i.ValueDescriptor,version:1,name:"Split location",description:"The index at which to split the list. The value at this index will be the first value of the second list.",defaultValue:null,dataType:uh,parentRelationType:P.FixedArguments,required:!0,index:1,parent:fh},Th={type:i.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},Eh={parentRelationType:P.FixedReturns,id:"split-list-first-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",defaultValue:null,dataType:ph,required:!0,index:0,parent:Th},Rh={like:!1,inferred:!1,id:"split-list-operation-second-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Vl},gh={type:i.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},bh={parentRelationType:P.FixedReturns,id:"split-list-second-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",defaultValue:null,dataType:Rh,required:!0,index:0,parent:gh},vh={type:i.GenericReference,id:"split-list-operation-error-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},Ih={parentRelationType:P.FixedReturns,id:"split-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:vh},Nl={id:X.Split,type:i.ActionDescriptor,version:1,name:X.Split,description:"Splits a given list at the given index, and returns two lists, one with the values up to the index, and the other with the values after the index",inputs:[hh,mh],outputs:[Eh,bh],error:Ih,parent:null};var Dh=(r=>(r.InputList="get-last-in-list-input-list-argument-declaration",r))(Dh||{}),Ah=(r=>(r.OutputElement="get-last-in-list-output-element-return-delaration",r.Error="get-last-in-list-error-return-delaration",r))(Ah||{});const Sh={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:i.ValueDescriptor},Oh={like:!1,inferred:!1,id:"get-last-in-list-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Sh},Ph={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:i.ValueDescriptor},Ch={like:!1,inferred:!1,id:"get-last-in-list-output-element-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Ph},wh={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:X.GetLast,entityType:i.ActionDescriptor},Bh={id:"get-last-in-list-input-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",defaultValue:null,dataType:Oh,parentRelationType:P.FixedArguments,required:!0,index:0,parent:wh},Mh={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:X.GetLast,entityType:i.ActionDescriptor},_h={parentRelationType:P.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:i.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",defaultValue:null,dataType:Ch,required:!0,index:0,parent:Mh},Vh={type:i.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:X.GetLast,entityType:i.ActionDescriptor},Nh={parentRelationType:P.FixedReturns,id:"get-last-in-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Vh},Ll={id:X.GetLast,type:i.ActionDescriptor,version:1,name:X.GetLast,description:"Outputs the last element of a given list.",inputs:[Bh],outputs:[_h],error:Nh,parent:null};var Lh=(r=>(r.List="append-to-list-lsit-argument-declaration",r.ElementToAppend="append-to-list-element-to-append-argument-declaration",r))(Lh||{}),Gh=(r=>(r.ResultList="append-to-list-result-list-return-delaration",r.Error="append-to-list-error-return-delaration",r))(Gh||{});const $h={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:i.ValueDescriptor},Fh={like:!1,inferred:!1,id:"append-to-list-lsit-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:$h},Uh={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:i.ValueDescriptor},xh={like:!1,inferred:!1,id:"append-to-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Uh},jh={type:i.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:i.ValueDescriptor},kh={like:!1,inferred:!1,id:"append-to-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:jh},qh={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},Gl={id:"append-to-list-lsit-argument-declaration",type:i.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",defaultValue:null,dataType:Fh,parentRelationType:P.FixedArguments,required:!0,index:0,parent:qh},Jh={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},$l={id:"append-to-list-element-to-append-argument-declaration",type:i.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",defaultValue:null,dataType:xh,parentRelationType:P.FixedArguments,required:!0,index:1,parent:Jh},Wh={type:i.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},Yh={parentRelationType:P.FixedReturns,id:"append-to-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",defaultValue:null,dataType:kh,required:!0,index:0,parent:Wh},Hh={type:i.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},zh={parentRelationType:P.FixedReturns,id:"append-to-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Hh},ys={id:X.Append,type:i.ActionDescriptor,version:1,name:X.Append,description:"Adds a given element to the end of a list value.",inputs:[Gl,$l],error:zh,outputs:[Yh],parent:null},Zh={[X.Join]:_l,[X.Split]:Nl,[X.GetLast]:Ll,[X.Append]:ys},si=_[i.Operation][Ne.Parallel],Kh={id:"parallel-execution-list-of-functions-blueprint-dynamic-output-id",type:i.ValueDescriptor,version:1,name:"Any output value",description:"An output value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},Xh={id:"parallel-execution-list-of-functions-blueprint-dynamic-input-id",type:i.ValueDescriptor,version:1,name:"Any input value",description:"An input value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},Qh={id:"parallel-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",inputs:[Xh],outputs:[Kh],error:null,parent:null},ef={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:si.inputs.listOfActions.id,entityType:i.ValueDescriptor},tf={like:!1,inferred:!1,id:"parallel-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Qh,asType:!1,isList:!0,parent:ef},nf={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:si.outputs.results.id,entityType:i.ValueDescriptor},rf={like:!1,inferred:!1,id:si.outputs.results.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!0,parent:nf},af={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ne.Parallel,entityType:i.ActionDescriptor},Fl={id:si.inputs.listOfActions.id,type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:tf,defaultValue:null,required:!0,index:0,parent:af,parentRelationType:P.FixedArguments},sf={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ne.Parallel,entityType:i.ActionDescriptor},Ul={id:si.outputs.results.id,type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:rf,defaultValue:null,required:!0,index:0,parent:sf,parentRelationType:P.FixedReturns},of={type:i.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ne.Parallel,entityType:i.ActionDescriptor},lf={id:si.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:of,parentRelationType:P.ReturnedError},Qt={id:Ne.Parallel,type:i.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ne.Parallel,inputs:[Fl],outputs:[Ul],error:lf,parent:null};var df=(r=>(r.MillisecondsNumber="wait-milliseconds-number-argument-declaration",r))(df||{}),cf=(r=>(r.Error="wait-operation-error-return-delaration",r))(cf||{});const uf={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:i.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},pf={like:!1,inferred:!1,id:"wait-milliseconds-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:uf},yf={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:i.ActionDescriptor,entityId:Ne.Wait},pr={id:"wait-milliseconds-number-argument-declaration",type:i.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",defaultValue:null,dataType:pf,required:!0,index:0,parent:yf,parentRelationType:P.FixedArguments},hf={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ne.Wait,entityType:i.ActionDescriptor},ff={id:"wait-operation-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:hf,parentRelationType:P.ReturnedError},Rt={id:Ne.Wait,type:i.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ne.Wait,inputs:[pr],outputs:[],error:ff,parent:null};var mf=(r=>(r.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",r))(mf||{}),Tf=(r=>(r.ListOfExecutionResults="sequential-execution-result-return-delaration",r.Error="sequential-execution-error-return-delaration",r))(Tf||{});const Ef={id:"sequential-execution-list-of-functions-blueprint-dynamic-output-id",type:i.ValueDescriptor,version:1,name:"Any output value",description:"An output value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},Rf={id:"sequential-execution-list-of-functions-blueprint-dynamic-input-id",type:i.ValueDescriptor,version:1,name:"Any input value",description:"An input value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},gf={id:"sequential-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",inputs:[Rf],outputs:[Ef],error:null,parent:null},bf={type:i.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:i.ValueDescriptor},vf={like:!1,inferred:!1,id:"sequential-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:gf,asType:!1,isList:!0,parent:bf},If={type:i.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:i.ValueDescriptor},Df={like:!1,inferred:!1,id:"sequential-execution-list-of-execution-results-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!0,parent:If},Af={type:i.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ne.Sequential,entityType:i.ActionDescriptor},xl={id:"sequential-execution-list-of-functions-argument-declaration",type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",defaultValue:null,dataType:vf,required:!0,index:0,parent:Af,parentRelationType:P.FixedArguments},Sf={type:i.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ne.Sequential,entityType:i.ActionDescriptor},jl={id:"sequential-execution-result-return-delaration",type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",defaultValue:null,dataType:Df,required:!0,index:0,parent:Sf,parentRelationType:P.FixedReturns},Of={type:i.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ne.Sequential,entityType:i.ActionDescriptor},Pf={id:"sequential-execution-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Of,parentRelationType:P.ReturnedError},Cn={id:Ne.Sequential,type:i.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ne.Sequential,inputs:[xl],outputs:[jl],error:Pf,parent:null},Cf={[Ne.Parallel]:Qt,[Ne.Wait]:Rt,[Ne.Sequential]:Cn};var wf=(r=>(r.EntityToInstanciate="entity-to-instanciate-argument-declaration",r.NewEntityData="new-entity-data-argument-declaration",r))(wf||{}),Bf=(r=>(r.Error="create-new-instance-error-return-delaration",r))(Bf||{});const Mf={type:i.GenericReference,id:"new-entity-data-argument-declaration-parent-ref",entityId:Le.CreateNewInstance,entityType:i.ActionDescriptor},_f={type:i.GenericReference,id:"new-entity-data-argument-data-type-parent-ref",entityId:"new-entity-data-argument-declaration",entityType:i.ValueDescriptor},Vf={like:!1,inferred:!1,id:"new-entity-data-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:_f},Nf={id:"new-entity-data-argument-declaration",type:i.ValueDescriptor,version:1,name:"Data for new entity",description:"The data to be used to create the new entity, with all the required properties",dataType:Vf,required:!0,defaultValue:null,parentRelationType:P.FixedArguments,index:1,parent:Mf},Lf={type:i.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},Gf={like:!1,inferred:!1,id:"entity-to-instanciate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,parent:Lf},$f={type:i.GenericReference,id:"create-new-instance-operation-ref",entityType:i.ActionDescriptor,entityId:Le.CreateNewInstance},Ff={id:"entity-to-instanciate-argument-declaration",type:i.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",defaultValue:null,dataType:Gf,required:!0,parentRelationType:P.FixedArguments,index:0,parent:$f},Uf={type:i.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Le.CreateNewInstance,entityType:i.ActionDescriptor},xf={parentRelationType:P.FixedReturns,id:"create-new-instance-output-entity-declaration",type:i.ValueDescriptor,version:1,name:"Created entity",description:"The entity that was created",defaultValue:null,dataType:null,parent:Uf,required:!0,index:0},jf={type:i.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Le.CreateNewInstance,entityType:i.ActionDescriptor},kf={parentRelationType:P.FixedReturns,id:"create-new-instance-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:jf},yr={id:Le.CreateNewInstance,type:i.ActionDescriptor,description:"Creates a new copy of a given entity, with the given values for each property, or default values if a value is not provided",version:1,name:Le.CreateNewInstance,inputs:[Ff,Nf],outputs:[xf],error:kf,parent:null},oi=_[i.Operation][Le.Validate],qf={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:oi.inputs.dataToValidate.id},Jf={like:!1,inferred:!1,id:"validate-data-operation-data-to-validate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:qf},Wf={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Le.Validate},Yf={id:oi.inputs.dataToValidate.id,type:i.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",defaultValue:null,dataType:Jf,required:!0,parentRelationType:P.FixedArguments,index:0,parent:Wf},Hf={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:oi.inputs.entityToMatch.id},zf={like:!1,inferred:!1,id:"validate-data-operation-entity-to-match-type-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,parent:Hf},Zf={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Le.Validate},Kf={id:oi.inputs.entityToMatch.id,type:i.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:zf,defaultValue:null,required:!0,index:0,parentRelationType:P.FixedArguments,parent:Zf},Xf={type:i.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Le.Validate,entityType:i.ActionDescriptor},Qf={id:oi.outputs.outputEntity.id,type:i.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",defaultValue:null,parent:Xf,required:!0,index:0,parentRelationType:P.FixedReturns},em={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Le.Validate,entityType:i.ActionDescriptor},tm={id:oi.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,defaultValue:null,required:!0,index:1,parent:em,parentRelationType:P.ReturnedError},hr={id:Le.Validate,type:i.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Le.Validate,inputs:[Kf,Yf],outputs:[Qf],error:tm,parent:null},nm={[Le.CreateNewInstance]:yr,[Le.Validate]:hr},Qe=_[i.Operation]["base-http-request"],rm={type:i.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:i.ValueDescriptor,entityId:Qe.inputs.url.id},im={id:"http-request-url-default-value-id",type:i.LiteralValue,version:1,value:"https://some-url.com",name:C.String,valueAsType:null,parent:rm,autogeneration:null},am={type:i.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Qe.inputs.url.id,entityType:i.ValueDescriptor},sm={like:!1,inferred:!1,id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:am},om={type:i.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Qe.inputs.query.id,entityType:i.ValueDescriptor},lm={like:!1,inferred:!1,id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:om},dm={type:i.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:i.ValueDescriptor,entityId:Qe.inputs.method.id},cm={id:"http-request-method-default-value-id",type:i.LiteralValue,version:1,value:"GET",name:C.Enum,valueAsType:null,parent:dm,autogeneration:null},um={type:i.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Qe.inputs.method.id,entityType:i.ValueDescriptor},pm={like:!1,inferred:!1,id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:um},ym={type:i.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Qe.inputs.headers.id,entityType:i.ValueDescriptor},hm={like:!1,inferred:!1,id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,asType:!1,isList:!1,parent:ym},fm={type:i.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Qe.inputs.body.id,entityType:i.ValueDescriptor},mm={like:!1,inferred:!1,id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,asType:!1,isList:!1,parent:fm},Tm={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:Qe.outputs.code.id},Em={like:!1,inferred:!1,id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Tm},Rm={type:i.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:i.ValueDescriptor,entityId:Qe.outputs.headers.id},gm={type:i.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:i.ValueDescriptor,entityId:Qe.outputs.headers.id},bm={like:!1,inferred:!1,id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,isList:!1,asType:!1,parent:gm},vm={type:i.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:i.ValueDescriptor,entityId:Qe.outputs.body.id},Im={type:i.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:i.ValueDescriptor,entityId:Qe.outputs.body.id},Dm={like:!1,inferred:!1,id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,isList:!1,asType:!1,parent:Im},Am={type:i.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},hs={id:Qe.inputs.method.id,type:i.ValueDescriptor,description:"A single word that represents the type of request you want to make. For example: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, CUSTOM",version:1,name:"Method",defaultValue:cm,dataType:pm,required:!1,index:0,parentRelationType:P.FixedArguments,parent:Am},Sm={type:i.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},fs={id:Qe.inputs.url.id,type:i.ValueDescriptor,description:"The base domain, or address where the request is being sent to. For example: https://some-url.com",version:1,name:"URL",dataType:sm,defaultValue:im,required:!1,index:1,parentRelationType:P.FixedArguments,parent:Sm},Om={type:i.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},kl={id:Qe.inputs.query.id,type:i.ValueDescriptor,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",version:1,name:"Query Params",defaultValue:null,dataType:lm,required:!1,index:2,parentRelationType:P.FixedArguments,parent:Om},Pm={type:i.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},ms={id:Qe.inputs.headers.id,type:i.ValueDescriptor,description:"A set of any properties, with names and values that represent metadata about the request, such as the server, date, content type, and more, that you want to send alongside your request data.",version:1,name:"Headers",defaultValue:null,dataType:hm,required:!1,index:3,parent:Pm,parentRelationType:P.FixedArguments},Cm={type:i.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Ts={id:Qe.inputs.body.id,type:i.ValueDescriptor,description:"The main data payload of the request. This is the data that you want to send to the server. It could be anything, but it is usually a KeyValue data structure or a text value.",version:1,name:"Body",dataType:mm,defaultValue:null,required:!1,index:4,parentRelationType:P.FixedArguments,parent:Cm},wm={type:i.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Es={id:Qe.outputs.code.id,type:i.ValueDescriptor,description:'A standardized status code of the response. It is a 3-digit number that represents the response status. For example, 200 means "OK", 404 means "Not Found", and 500 means "Internal Server Error".',version:1,name:"Code",defaultValue:null,dataType:Em,required:!0,index:0,parentRelationType:P.FixedReturns,parent:wm},Bm={type:i.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Rs={parentRelationType:P.FixedReturns,id:Qe.outputs.headers.id,type:i.ValueDescriptor,description:"A set of any properties, with names and value that the server sent back to you. It represents metadata about the response, such as the server, date, content type, and more.",version:1,name:"Headers",defaultValue:{id:"http-response-headers-default-value-id",type:i.LiteralValue,version:1,value:{},name:C.KeyValue,parent:Rm,valueAsType:null,autogeneration:null},dataType:bm,required:!0,index:1,parent:Bm},Mm={type:i.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},gs={id:Qe.outputs.body.id,type:i.ValueDescriptor,description:"The main data payload of the response. This is the data that the server sent back to you. It could be anything, but it is usually a KeyValue data structure or a text value.",version:1,name:"Body",parentRelationType:P.FixedReturns,dataType:Dm,defaultValue:{id:"http-response-body-default-value-id",type:i.LiteralValue,version:1,value:{},name:C.KeyValue,parent:vm,valueAsType:null,autogeneration:null},required:!0,index:2,parent:Mm},_m={type:i.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Vm={type:i.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:i.ValueDescriptor,entityId:Qe.outputs.error.id},Nm={like:!1,inferred:!1,id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,isList:!1,asType:!1,parent:Vm},ql={parentRelationType:P.ReturnedError,id:Qe.outputs.error.id,type:i.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",defaultValue:null,dataType:Nm,required:!0,index:0,parent:_m},Xi={type:i.ActionDescriptor,id:dt.HttpRequest,name:dt.HttpRequest,description:"Make an HTTP request, out to the internet, to a given URL with the specified method, query parameters, headers, and body.",version:1,inputs:[hs,fs,kl,ms,Ts],outputs:[Es,Rs,gs],error:ql,parent:null},Lm={[dt.HttpRequest]:Xi},Gm={...ky,...iy,...Zh,...Cf,...nm,...Lm},$m=Object.values(Gm),JO=_[i.Loop]["manual-flow-loop"],Fm={id:"manual-flow-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:k.ManualFlow,entityType:i.ActionDescriptor},Um={id:JO.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:Fm,parentRelationType:P.DynamicReturn},bs={id:k.ManualFlow,type:i.ActionDescriptor,version:1,name:k.ManualFlow,description:"A loop that is manually controlled by the continue and break statements. It runs until the break statement is called, and it can skip to the next iteration with the continue statement.",inputs:[],outputs:[Um],error:null,parent:null},Qi=_[i.Loop]["manual-flow-loop"],xm={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"manual-flow-loop-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},jm={like:!1,inferred:!1,id:"manual-flow-loop-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:xm},km={id:"manual-flow-loop-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:Qi.body.id,entityType:i.ActionDescriptor},Jl={id:Qi.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the manual flow loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:jm,required:!0,index:0,parentRelationType:P.FixedArguments,parent:km},qm={id:"manual-flow-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:Qi.body.id,entityType:i.ActionDescriptor},Jm={id:"manual-flow-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:1,parentRelationType:P.DynamicArgument,parent:qm},Wm={id:"manual-flow-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:Qi.body.id,entityType:i.ActionDescriptor},Ym={id:"manual-flow-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:Wm},vs={id:Qi.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the manual flow loop.",inputs:[Jl,Jm],outputs:[Ym],error:null,parent:null},Hm=_[i.Loop]["string-loop"],zm={id:"iterate-over-string-loop-string-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-string-loop-string-argument-declaration-id",entityType:i.ValueDescriptor},Zm={like:!1,inferred:!1,id:"iterate-over-string-loop-string-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:J,asType:!1,parent:zm},Km={id:"iterate-over-string-loop-string-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:k.String,entityType:i.ActionDescriptor},Xm={id:Hm.inputs.string.id,type:i.ValueDescriptor,version:1,name:"Texts",description:"The text to iterate over the characters of",defaultValue:null,required:!0,dataType:Zm,index:0,parent:Km,parentRelationType:P.FixedArguments},Qm={id:"iterate-over-string-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:k.String,entityType:i.ActionDescriptor},eT={id:Hm.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:Qm,parentRelationType:P.DynamicReturn},ea={id:k.String,type:i.ActionDescriptor,version:1,name:k.String,description:"Iterates over a string of entities",inputs:[Xm],outputs:[eT],error:null,parent:null},fr=_[i.Loop]["string-loop"],tT={id:"iterate-over-string-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-string-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},nT={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:J,asType:!1,parent:tT},rT={id:"iterate-over-string-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},Wl={id:fr.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the string that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:nT,required:!0,index:1,parentRelationType:P.FixedArguments,parent:rT},iT={id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-string-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},aT={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:iT},sT={id:"iterate-over-string-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},Yl={id:fr.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:aT,required:!0,index:0,parentRelationType:P.FixedArguments,parent:sT},oT={id:"iterate-over-string-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},lT={id:"iterate-over-string-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:oT},dT={id:"iterate-over-string-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},cT={id:"iterate-over-string-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:dT},Is={id:fr.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",inputs:[Yl,Wl,lT],outputs:[cT],error:null,parent:null},uT=_[i.Loop]["list-loop"],pT={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:i.ValueDescriptor},yT={like:!1,inferred:!1,id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,entity:null,asType:!1,parent:pT},hT={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:k.List,entityType:i.ActionDescriptor},fT={id:uT.inputs.list.id,type:i.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,defaultValue:null,dataType:yT,index:0,parent:hT,parentRelationType:P.FixedArguments},mT={id:"iterate-over-list-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:k.List,entityType:i.ActionDescriptor},TT={id:uT.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",required:!1,defaultValue:null,dataType:null,index:0,parent:mT,parentRelationType:P.DynamicReturn},Jn={id:k.List,type:i.ActionDescriptor,version:1,name:k.List,description:"Iterates over a list of entities",inputs:[fT],outputs:[TT],error:null,parent:null},mr=_[i.Loop]["list-loop"],ET={id:"iterate-over-list-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},RT={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:null,asType:!1,parent:ET},gT={id:"iterate-over-list-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},Ds={id:mr.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the list that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:RT,required:!0,index:1,parentRelationType:P.FixedArguments,parent:gT},bT={id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},vT={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:bT},IT={id:"iterate-over-list-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},DT={id:mr.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the list loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:vT,required:!0,index:0,parentRelationType:P.FixedArguments,parent:IT},AT={id:"iterate-over-list-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},ST={id:"iterate-over-list-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:AT},OT={id:"iterate-over-list-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},PT={id:"iterate-over-list-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:OT},ta={id:mr.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the list loop.",inputs:[DT,Ds,ST],outputs:[PT],error:null,parent:null},CT=_[i.Loop]["object-keys-loop"],wT={id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-keys-loop-object-argument-declaration-id",entityType:i.ValueDescriptor},BT={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:it,asType:!1,parent:wT},MT={id:"iterate-over-object-keys-loop-object-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:k.ObjectKeys,entityType:i.ActionDescriptor},_T={id:CT.inputs.object.id,type:i.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,defaultValue:null,dataType:BT,index:0,parent:MT,parentRelationType:P.FixedArguments},VT={id:"iterate-over-object-keys-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:k.ObjectKeys,entityType:i.ActionDescriptor},NT={id:CT.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:VT,parentRelationType:P.DynamicReturn},li={id:k.ObjectKeys,type:i.ActionDescriptor,version:1,name:k.ObjectKeys,description:"Iterates over a object of entities",inputs:[_T],outputs:[NT],error:null,parent:null},Tr=_[i.Loop]["object-keys-loop"],LT={id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},GT={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:J,asType:!1,parent:LT},$T={id:"iterate-over-object-keys-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},Hl={id:Tr.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-keys that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:GT,required:!0,index:1,parentRelationType:P.FixedArguments,parent:$T},FT={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},UT={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:FT},xT={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},jT={id:Tr.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-keys loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:UT,required:!0,index:0,parentRelationType:P.FixedArguments,parent:xT},kT={id:"iterate-over-object-keys-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},qT={id:"iterate-over-object-keys-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:kT},JT={id:"iterate-over-object-keys-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},WT={id:"iterate-over-object-keys-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:JT},zl={id:Tr.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-keys loop.",inputs:[jT,Hl,qT],outputs:[WT],error:null,parent:null},YT=_[i.Loop]["object-values-loop"],HT={id:"iterate-over-object-values-loop-object-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-values-loop-object-argument-declaration-id",entityType:i.ValueDescriptor},zT={like:!1,inferred:!1,id:"iterate-over-object-values-loop-object-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:it,asType:!1,parent:HT},ZT={id:"iterate-over-object-values-loop-object-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:k.ObjectValues,entityType:i.ActionDescriptor},KT={id:YT.inputs.object.id,type:i.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,defaultValue:null,dataType:zT,index:0,parent:ZT,parentRelationType:P.FixedArguments},XT={id:"iterate-over-object-values-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:k.ObjectValues,entityType:i.ActionDescriptor},QT={id:YT.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:XT,parentRelationType:P.DynamicReturn},di={id:k.ObjectValues,type:i.ActionDescriptor,version:1,name:k.ObjectValues,description:"Iterates over a object of entities",inputs:[KT],outputs:[QT],error:null,parent:null},Er=_[i.Loop]["object-values-loop"],eE={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-values-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},tE={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:null,entity:null,asType:null,like:!1,inferred:!1,parent:eE},nE={id:"iterate-over-object-values-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},Zl={id:Er.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-values that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:tE,required:!0,index:1,parentRelationType:P.FixedArguments,parent:nE},rE={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-values-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},iE={like:!1,inferred:!1,id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:rE},aE={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},sE={id:Er.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-values loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:iE,required:!0,index:0,parentRelationType:P.FixedArguments,parent:aE},oE={id:"iterate-over-object-values-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},lE={id:"iterate-over-object-values-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:oE},dE={id:"iterate-over-object-values-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},cE={id:"iterate-over-object-values-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:dE},Kl={id:Er.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-values loop.",inputs:[sE,Zl,lE],outputs:[cE],error:null,parent:null},Xl=_[i.Loop]["counted-loop"],uE={id:"counted-loop-string-argument-declaration-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:Xl.inputs.number.id,entityType:i.ValueDescriptor},pE={id:"counted-loop-string-argument-declaration-data-type-default-value-id",type:i.LiteralValue,name:C.Number,version:1,value:5,valueAsType:null,autogeneration:null,parent:uE},yE={id:"counted-loop-string-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"counted-loop-string-argument-declaration-id",entityType:i.ValueDescriptor},hE={like:!1,inferred:!1,id:"counted-loop-string-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:yE},fE={id:"counted-loop-string-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:k.Counted,entityType:i.ActionDescriptor},mE={id:Xl.inputs.number.id,type:i.ValueDescriptor,version:1,name:"Number of iterations",description:"The number of iterations to perform",required:!0,dataType:hE,defaultValue:pE,index:0,parent:fE,parentRelationType:P.FixedArguments},TE={id:"counted-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:k.Counted,entityType:i.ActionDescriptor},EE={id:Xl.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:TE,parentRelationType:P.DynamicReturn},na={id:k.Counted,type:i.ActionDescriptor,version:1,name:k.Counted,description:"Iterates a given number of times",inputs:[mE],outputs:[EE],error:null,parent:null},ra=_[i.Loop]["counted-loop"],RE={id:"counted-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"counted-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},gE={like:!1,inferred:!1,id:"counted-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:RE},bE={id:"counted-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:ra.body.id,entityType:i.ActionDescriptor},Ql={id:ra.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:gE,required:!0,index:0,parentRelationType:P.FixedArguments,parent:bE},vE={id:"counted-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:ra.body.id,entityType:i.ActionDescriptor},IE={id:"counted-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:1,parentRelationType:P.DynamicArgument,parent:vE},DE={id:"counted-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:ra.body.id,entityType:i.ActionDescriptor},AE={id:"counted-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:DE},As={id:ra.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",inputs:[Ql,IE],outputs:[AE],error:null,parent:null},SE=[bs,Jn,ea,li,di,na],OE=[vs,ta,Is,zl,Kl,As],Wn=_[i.BuiltInBaseEntity][U.HTTP_ENDPOINT].properties,PE={id:"endpointBuiltInCorsPropertyDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:Wn.cors.id},CE={id:"endpointBuiltInCorsPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Wn.cors.id},wE={like:!1,inferred:!1,id:"endpointBuiltInCorsPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:J,asType:!1,parent:CE},BE={id:"endpointBuiltInBaseEntityRef",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:U.HTTP_ENDPOINT},ME={constant:!1,hidden:!0,required:!0,id:Wn.cors.id,name:"Allowed origins",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:wE,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:["*"],parent:PE,autogeneration:null,valueAsType:null},description:"The origins that are allowed to access this endpoint, use * for all origins, or http://example.com/* to be as specific as you need.",parent:BE},_E={id:"endpointBuiltInPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:Wn.path.id},VE={id:"endpointBuiltInPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Wn.path.id},NE={like:!1,inferred:!1,id:"endpointBuiltInPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:VE},LE={id:"endpointBuiltInBaseEntityRefTwo",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:U.HTTP_ENDPOINT},ed={constant:!1,id:Wn.path.id,hidden:!1,required:!0,name:"Path",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:NE,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.String,value:"/",parent:_E,autogeneration:null,valueAsType:null},description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:LE},GE={id:"endpointBuiltInMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:Wn.method.id},$E={id:"endpointBuiltInMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"endpointBuiltInMethodProperty"},FE={like:!1,inferred:!1,id:"endpointBuiltInMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Sn,isList:!0,asType:!1,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:$E},UE={id:"endpointBuiltInBaseEntityRefThree",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:U.HTTP_ENDPOINT},td={constant:!1,hidden:!1,required:!0,id:Wn.method.id,name:"Method",version:1,type:i.Property,private:!1,index:2,implements:null,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,value:"GET",name:C.Enum,parent:GE,autogeneration:null,valueAsType:null},abstract:!0,static:!0,dataType:FE,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:UE},xE={id:"endpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointRequestHeadersArgumentDeclaration"},jE={id:"endpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},kE={like:!1,inferred:!1,id:"endpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:jE},qE={id:"endpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},JE={like:!1,inferred:!1,id:"endpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:qE},WE={id:"endpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointRequestQueryParamsArgumentDeclaration"},YE={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},HE={like:!1,inferred:!1,id:"endpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,asType:!1,entity:ai,parent:YE},zE={id:"endpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointPathParamsArgumentDeclaration"},ZE={id:"endpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},KE={like:!1,inferred:!1,id:"endpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:ai,asType:!1,parent:ZE},XE={id:"endpointReachedTriggerActionDescriptorRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},nd={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ValueDescriptor,name:"Request headers",dataType:kE,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:xE,autogeneration:null,valueAsType:null},required:!0,index:0,parentRelationType:P.FixedArguments,parent:XE},QE={id:"endpointReachedTriggerActionDescriptorRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},rd={id:"endpointPathParamsArgumentDeclaration",type:i.ValueDescriptor,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",dataType:KE,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:[],parent:zE,autogeneration:null,valueAsType:null},required:!0,index:1,parentRelationType:P.FixedArguments,parent:QE},eR={id:"endpointReachedTriggerActionDescriptorRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},id={id:"endpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ValueDescriptor,name:"Request query params",dataType:HE,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:[],parent:WE,autogeneration:null,valueAsType:null},required:!0,index:2,parentRelationType:P.FixedArguments,parent:eR},tR={id:"endpointReachedTriggerActionDescriptorRefFour",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},ad={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ValueDescriptor,name:"Request body",dataType:JE,defaultValue:null,index:3,required:!0,parentRelationType:P.FixedArguments,parent:tR},nR={id:"endpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},rR={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:nR},iR={id:"endpointReturnStatementRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},sd={id:"endpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ValueDescriptor,name:"Response code",dataType:rR,defaultValue:null,required:!0,index:0,parentRelationType:P.FixedReturns,parent:iR},aR={id:"endpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointResponseHeadersReturnDeclaration"},sR={id:"endpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},oR={like:!1,inferred:!1,id:"endpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:sR},lR={id:"endpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},od={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ValueDescriptor,name:"Response headers",dataType:oR,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:aR,autogeneration:null,valueAsType:null},required:!1,index:1,parentRelationType:P.FixedReturns,parent:lR},dR={id:"endpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},cR={like:!1,inferred:!1,id:"endpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:dR},uR={id:"endpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},ld={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ValueDescriptor,name:"Response body",dataType:cR,defaultValue:null,required:!1,index:2,parentRelationType:P.FixedReturns,parent:uR},pR={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:U.HTTP_ENDPOINT},dd={id:"endpointReachedTriggerActionDescriptor",type:i.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",inputs:[nd,rd,id,ad],outputs:[sd,od,ld],error:null,parent:pR},ia={id:U.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:U.HTTP_ENDPOINT,type:i.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[ME,ed,td],abstractMethods:[dd],extends:[],methods:[]},ct=_[i.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,yR={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.identifier.id,entityType:i.Property},hR={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:i.GenericReference,entityId:ct.properties.identifier.id,entityType:i.Property},fR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:hR},ci={id:"relational-database-built-in-base-entity-ref-id",type:i.GenericReference,entityId:U.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Ss={constant:!1,id:ct.properties.identifier.id,hidden:!1,required:!0,name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:null,parent:yR,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:fR,description:"The name of the main database inside of the server instance where the data will be stored.",parent:ci},WO={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:i.Property},mR={id:"relational-database-built-in-base-entity-username-property-ref-id",type:i.GenericReference,entityId:ct.properties.username.id,entityType:i.Property},TR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:mR},Os={constant:!1,hidden:!1,required:!0,id:ct.properties.username.id,name:"Username",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:ct.properties.username.id,entityType:i.Property},autogeneration:null,valueAsType:null},dataType:TR,description:"The username that will be used to connect to the database.",parent:ci},YO={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:i.Property},ER={id:"relational-database-built-in-base-entity-password-property-ref-id",type:i.GenericReference,entityId:ct.properties.password.id,entityType:i.Property},RR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:ER},Ps={constant:!1,hidden:!1,required:!0,id:ct.properties.password.id,name:"Password",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,defaultValue:null,dataType:RR,description:"The password that will be used to connect to the database.",parent:ci},gR={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.minSize.id,entityType:i.Property},bR={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:i.GenericReference,entityId:ct.properties.minSize.id,entityType:i.Property},vR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:bR},Cs={constant:!1,hidden:!0,required:!0,id:ct.properties.minSize.id,name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:6,parent:gR,autogeneration:null,valueAsType:null},dataType:vR,description:"The minimum size of the database in GB.",parent:ci},IR={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.default.id,entityType:i.Property},DR={id:"relational-database-built-in-base-entity-default-property-ref-id",type:i.GenericReference,entityId:ct.properties.default.id,entityType:i.Property},AR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:An,asType:!1,parent:DR},cd={constant:!1,hidden:!0,required:!0,id:ct.properties.default.id,name:"Default",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!1,parent:IR,autogeneration:null,valueAsType:null},dataType:AR,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:ci},SR={id:"relational-database-built-in-base-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:ct.properties.autoscaling.id,entityType:i.Property},OR={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.autoscaling.id,entityType:i.Property},PR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:An,asType:!1,parent:SR},CR={id:"relational-database-built-in-base-entity-autoscaling-property-parent-ref-id",type:i.GenericReference,entityId:U.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},ud={constant:!1,hidden:!0,required:!0,id:ct.properties.autoscaling.id,name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,defaultValue:{id:"relational-database-built-in-base-entity-autoscaling-property-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!1,parent:OR,autogeneration:null,valueAsType:null},dataType:PR,description:"If true, this database will automatically scale up or down in memory size, based on the usage.",parent:CR},cn={id:U.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:U.RELATIONAL_DATABASE,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Ss,Os,Ps,Cs,cd,ud],abstractMethods:[],methods:[],extends:[]},wR={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:Gt.DeletePersistedEntity},pd={type:i.FunctionDeclaration,id:Gt.DeletePersistedEntity,name:Gt.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:wR,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},BR=_[i.BuiltInBaseEntity][U.PERSISTED_ENTITY].properties,HO={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:i.DataType},MR={id:"persisted-built-in-base-entity-database-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:i.Property},_R={like:!1,inferred:!1,id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:MR},VR={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:i.GenericReference,entityId:U.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},ui={constant:!1,hidden:!0,required:!0,id:BR.database.id,name:"Database",version:1,type:i.Property,defaultValue:null,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:_R,description:"The database that the entity belongs to.",parent:VR},NR={id:"persisted-built-in-base-entity-primary-key-property-number-data-type-option-parent-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-data-type-id",entityType:i.DataType},LR={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-number-data-type-option-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parentRelationType:et.OrDataTypeGroup,parent:NR},GR={id:"persisted-built-in-base-entity-primary-key-property-string-data-type-option-parent-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-data-type-id",entityType:i.DataType},$R={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-string-data-type-option-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parentRelationType:et.OrDataTypeGroup,parent:GR},FR={id:"persisted-built-in-base-entity-primary-key-property-uuid-data-type-option-parent-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-data-type-id",entityType:i.DataType},UR={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-uuid-data-type-option-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parentRelationType:et.OrDataTypeGroup,parent:FR},xR={id:"persisted-built-in-base-entity-primary-key-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-id",entityType:i.Property},jR={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:[UR,$R,LR],isList:!1,entity:null,asType:null,implementationChooseOne:!0,parent:xR},kR={id:"persisted-built-in-base-entity-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:U.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},pi={constant:!1,hidden:!1,required:!0,id:BR.primaryKey.id,name:"Primary key",version:1,type:i.Property,defaultValue:null,private:!1,abstract:!0,implements:null,static:!1,index:0,dataType:jR,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:kR},st={id:U.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:U.PERSISTED_ENTITY,type:i.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[ui,pi],methods:[pd],extends:[]},qR={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:Gt.SoftDeletePersistedEntity},zO={type:i.FunctionDeclaration,id:Gt.SoftDeletePersistedEntity,name:Gt.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:qR,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},JR={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:U.HTTP_ENDPOINT},yd={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:i.ActionDescriptor,description:"Executed when the cron job is triggered",inputs:[],error:null,outputs:[],parent:JR},WR=_[i.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,ZO={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:i.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:i.DataType},YR={id:"cron-job-built-in-base-entity-expression-property-ref",type:i.GenericReference,entityId:WR.properties.expression.id,entityType:i.Property},KO={like:!1,inferred:!1,id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:YR},HR={id:"cron-job-built-in-base-entity-ref",type:i.GenericReference,entityId:U.CRON_JOB,entityType:i.BuiltInBaseEntity},zR={constant:!1,hidden:!1,required:!0,id:WR.properties.expression.id,name:"Cron expression",version:1,type:i.Property,defaultValue:null,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:KO,description:"The cron-job expression that defines when the cron-job job should be triggered. The expression should be in the format of a cron-job expression.",parent:HR},ws={id:U.CRON_JOB,version:1,description:"This entity represents a scheduled trigger. The action on this entity will be executed one the time set by the cron-job expression is reached.",name:U.CRON_JOB,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[zR],methods:[],abstractMethods:[yd],extends:[]},ZR={type:i.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:i.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},hd={id:"execution-built-in-entity-abort-method-id",type:i.FunctionDeclaration,version:1,name:Gt.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:ZR},Bs={id:U.EXECUTION,type:i.BuiltInBaseEntity,version:1,name:U.EXECUTION,description:"A reference to an ongoing execution of any entity that can be called. Eg: Operations, custom trigger calls, etc.",static:!1,abstract:!1,interactive:!0,extends:[],properties:[],methods:[hd],abstractMethods:[]},KR=[ia,cn,st,ws,Bs],XO=_[i.Condition]["not-empty"],XR={type:i.GenericReference,id:"not-empty-condition-ref",entityType:i.ActionDescriptor,entityId:Jt.NotEmpty},QR={id:XO.inputs.leftHand.id,type:i.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",defaultValue:null,dataType:null,required:!0,parentRelationType:P.FixedArguments,index:0,parent:XR},Rr={type:i.ActionDescriptor,id:Jt.NotEmpty,version:1,name:Jt.NotEmpty,description:"Checks if the value is not empty",parent:null,inputs:[QR],outputs:[],error:null},eg={[Jt.NotEmpty]:Rr},yi=_[i.Condition]["more-than-or-equal"],tg={type:i.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-data-type-parent-ref",entityType:i.ValueDescriptor,entityId:yi.inputs.leftHand.id},ng={type:i.DataType,id:yi.inputs.leftHand.dataType.id,version:1,entity:ee,like:!1,isList:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,parent:tg},rg={type:i.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:qe.MoreThanOrEqual},ig={id:yi.inputs.leftHand.id,type:i.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",defaultValue:null,dataType:ng,required:!0,parentRelationType:P.FixedArguments,index:0,parent:rg},ag={type:i.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-data-type-parent-ref",entityType:i.ValueDescriptor,entityId:yi.inputs.rightHand.id},sg={type:i.DataType,id:yi.inputs.rightHand.dataType.id,version:1,entity:ee,like:!1,isList:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,parent:ag},og={type:i.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:qe.MoreThanOrEqual},lg={id:yi.inputs.rightHand.id,type:i.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",defaultValue:null,dataType:sg,required:!0,parentRelationType:P.FixedArguments,index:1,parent:og},hi={type:i.ActionDescriptor,id:qe.MoreThanOrEqual,version:1,name:qe.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,inputs:[ig,lg],outputs:[],error:null},dg={[qe.MoreThanOrEqual]:hi},cg={...eg,...dg},ug=Object.values(cg),Ms={type:i.ActionDescriptor,id:In.PROJECT_PUBLICATION_COMPLETED,version:1,name:In.PROJECT_PUBLICATION_COMPLETED,description:"The event that is triggered when the project has completed its publication and all its code and resurces are now deployed and ready to be used by the users",parent:null,inputs:[],outputs:[],error:null},pg={[In.PROJECT_PUBLICATION_COMPLETED]:Ms},yg=Object.values(pg),fd=_[i.ValueDescriptor][ds.ActionOngoingProcessOutputValue],hg={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:fd.id},fg={like:!1,inferred:!1,id:fd.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Bs,asType:!1,isList:!1,parent:hg},aa={id:fd.id,type:i.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",defaultValue:null,dataType:fg,required:!0,index:0,parent:null,parentRelationType:P.OngoingProcessExecution},mg=[aa],Tg=[...Pp,...$m,...SE,...OE,...KR,...ug,...yg,...mg,aa];var le;(function(r){r.assertEqual=a=>a;function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},r.getValidEnumValues=a=>{const s=r.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of s)o[l]=a[l];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(s){return a[s]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&s.push(o);return s},r.find=(a,s)=>{for(const o of a)if(s(o))return o},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}r.joinValues=n,r.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(le||(le={}));var md;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(md||(md={}));const x=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yn=r=>{switch(typeof r){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(r)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(r)?x.array:r===null?x.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?x.promise:typeof Map<"u"&&r instanceof Map?x.map:typeof Set<"u"&&r instanceof Set?x.set:typeof Date<"u"&&r instanceof Date?x.date:x.object;default:return x.unknown}},N=le.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),QO=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class wt extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let l=n,p=0;for(;p<o.path.length;){const u=o.path[p];p===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(o))):l[u]=l[u]||{_errors:[]},l=l[u],p++}}};return a(this),n}static assert(e){if(!(e instanceof wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}wt.create=r=>new wt(r);const fi=(r,e)=>{let t;switch(r.code){case N.invalid_type:r.received===x.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case N.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,le.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:t=`Unrecognized key(s) in object: ${le.joinValues(r.keys,", ")}`;break;case N.invalid_union:t="Invalid input";break;case N.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${le.joinValues(r.options)}`;break;case N.invalid_enum_value:t=`Invalid enum value. Expected ${le.joinValues(r.options)}, received '${r.received}'`;break;case N.invalid_arguments:t="Invalid function arguments";break;case N.invalid_return_type:t="Invalid function return type";break;case N.invalid_date:t="Invalid date";break;case N.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:le.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case N.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case N.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case N.custom:t="Invalid input";break;case N.invalid_intersection_types:t="Intersection results could not be merged";break;case N.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case N.not_finite:t="Number must be finite";break;default:t=e.defaultError,le.assertNever(r)}return{message:t}};let Eg=fi;function eP(r){Eg=r}function _s(){return Eg}const Vs=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="";const p=n.filter(u=>!!u).slice().reverse();for(const u of p)l=u(o,{data:e,defaultError:l}).message;return{...a,path:s,message:l}},tP=[];function $(r,e){const t=_s(),n=Vs({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===fi?void 0:fi].filter(a=>!!a)});r.common.issues.push(n)}class yt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return z;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const s=await a.key,o=await a.value;n.push({key:s,value:o})}return yt.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return z;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}}const z=Object.freeze({status:"aborted"}),mi=r=>({status:"dirty",value:r}),gt=r=>({status:"valid",value:r}),Td=r=>r.status==="aborted",Ed=r=>r.status==="dirty",sa=r=>r.status==="valid",oa=r=>typeof Promise<"u"&&r instanceof Promise;function Ns(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function Rg(r,e,t,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!a:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(r,t):a?a.value=t:e.set(r,t),t}typeof SuppressedError=="function"&&SuppressedError;var W;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(W||(W={}));var la,da;class un{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gg=(r,e)=>{if(sa(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new wt(r.common.issues);return this._error=t,this._error}}};function ne(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{var p,u;const{message:h}=r;return o.code==="invalid_enum_value"?{message:h??l.defaultError}:typeof l.data>"u"?{message:(p=h??n)!==null&&p!==void 0?p:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(u=h??t)!==null&&u!==void 0?u:l.defaultError}},description:a}}class ie{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Yn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:Yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(oa(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const a={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return gg(a,s)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yn(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(oa(a)?a:Promise.resolve(a));return gg(n,s)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),l=()=>s.addIssue({code:N.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new nn({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return yn.create(this,this._def)}nullable(){return Kn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tn.create(this,this._def)}promise(){return gi.create(this,this._def)}or(e){return ya.create([this,e],this._def)}and(e){return ha.create(this,e,this._def)}transform(e){return new nn({...ne(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ra({...ne(this._def),innerType:this,defaultValue:t,typeName:Y.ZodDefault})}brand(){return new bd({typeName:Y.ZodBranded,type:this,...ne(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ga({...ne(this._def),innerType:this,catchValue:t,typeName:Y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ba.create(this,e)}readonly(){return va.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nP=/^c[^\s-]{8,}$/i,rP=/^[0-9a-z]+$/,iP=/^[0-9A-HJKMNP-TV-Z]{26}$/,aP=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sP=/^[a-z0-9_-]{21}$/i,oP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Rd;const cP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uP=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,pP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bg="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",yP=new RegExp(`^${bg}$`);function vg(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function hP(r){return new RegExp(`^${vg(r)}$`)}function Ig(r){let e=`${bg}T${vg(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function fP(r,e){return!!((e==="v4"||!e)&&cP.test(r)||(e==="v6"||!e)&&uP.test(r))}class en extends ie{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:x.string,received:s.parsedType}),z}const n=new yt;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,l=e.data.length<s.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?$(a,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&$(a,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")lP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"email",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Rd||(Rd=new RegExp(dP,"u")),Rd.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"emoji",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")aP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"uuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")sP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"nanoid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")nP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"cuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")rP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"cuid2",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")iP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"ulid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),$(a,{validation:"url",code:N.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"regex",code:N.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ig(s).test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?yP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?hP(s).test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?oP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"duration",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?fP(e.data,s.version)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"ip",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?pP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"base64",code:N.invalid_string,message:s.message}),n.dirty()):le.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:N.invalid_string,...W.errToObj(n)})}_addCheck(e){return new en({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...W.errToObj(e)})}url(e){return this._addCheck({kind:"url",...W.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...W.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...W.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...W.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...W.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...W.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...W.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...W.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...W.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...W.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...W.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...W.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...W.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...W.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...W.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...W.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...W.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...W.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...W.errToObj(t)})}nonempty(e){return this.min(1,W.errToObj(e))}trim(){return new en({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}en.create=r=>{var e;return new en({checks:[],typeName:Y.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};function mP(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,s=parseInt(r.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class Hn extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:x.number,received:s.parsedType}),z}let n;const a=new yt;for(const s of this._def.checks)s.kind==="int"?le.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?mP(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:N.not_finite,message:s.message}),a.dirty()):le.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,n,a){return new Hn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:W.toString(a)}]})}_addCheck(e){return new Hn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:W.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:W.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&le.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Hn.create=r=>new Hn({checks:[],typeName:Y.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});class zn extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==x.bigint){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:x.bigint,received:s.parsedType}),z}let n;const a=new yt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):le.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,n,a){return new zn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:W.toString(a)}]})}_addCheck(e){return new zn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}zn.create=r=>{var e;return new zn({checks:[],typeName:Y.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};class ca extends ie{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==x.boolean){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:x.boolean,received:n.parsedType}),z}return gt(e.data)}}ca.create=r=>new ca({typeName:Y.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});class gr extends ie{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:x.date,received:s.parsedType}),z}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_date}),z}const n=new yt;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):le.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new gr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:W.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:W.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}gr.create=r=>new gr({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:Y.ZodDate,...ne(r)});class Ls extends ie{_parse(e){if(this._getType(e)!==x.symbol){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:x.symbol,received:n.parsedType}),z}return gt(e.data)}}Ls.create=r=>new Ls({typeName:Y.ZodSymbol,...ne(r)});class ua extends ie{_parse(e){if(this._getType(e)!==x.undefined){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:x.undefined,received:n.parsedType}),z}return gt(e.data)}}ua.create=r=>new ua({typeName:Y.ZodUndefined,...ne(r)});class pa extends ie{_parse(e){if(this._getType(e)!==x.null){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:x.null,received:n.parsedType}),z}return gt(e.data)}}pa.create=r=>new pa({typeName:Y.ZodNull,...ne(r)});class Ti extends ie{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}}Ti.create=r=>new Ti({typeName:Y.ZodAny,...ne(r)});class br extends ie{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}}br.create=r=>new br({typeName:Y.ZodUnknown,...ne(r)});class wn extends ie{_parse(e){const t=this._getOrReturnCtx(e);return $(t,{code:N.invalid_type,expected:x.never,received:t.parsedType}),z}}wn.create=r=>new wn({typeName:Y.ZodNever,...ne(r)});class Gs extends ie{_parse(e){if(this._getType(e)!==x.undefined){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:x.void,received:n.parsedType}),z}return gt(e.data)}}Gs.create=r=>new Gs({typeName:Y.ZodVoid,...ne(r)});class tn extends ie{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==x.array)return $(t,{code:N.invalid_type,expected:x.array,received:t.parsedType}),z;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&($(t,{code:o?N.too_big:N.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&($(t,{code:N.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&($(t,{code:N.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,l)=>a.type._parseAsync(new un(t,o,t.path,l)))).then(o=>yt.mergeArray(n,o));const s=[...t.data].map((o,l)=>a.type._parseSync(new un(t,o,t.path,l)));return yt.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new tn({...this._def,minLength:{value:e,message:W.toString(t)}})}max(e,t){return new tn({...this._def,maxLength:{value:e,message:W.toString(t)}})}length(e,t){return new tn({...this._def,exactLength:{value:e,message:W.toString(t)}})}nonempty(e){return this.min(1,e)}}tn.create=(r,e)=>new tn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...ne(e)});function Ei(r){if(r instanceof Ke){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=yn.create(Ei(n))}return new Ke({...r._def,shape:()=>e})}else return r instanceof tn?new tn({...r._def,type:Ei(r.element)}):r instanceof yn?yn.create(Ei(r.unwrap())):r instanceof Kn?Kn.create(Ei(r.unwrap())):r instanceof pn?pn.create(r.items.map(e=>Ei(e))):r}class Ke extends ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=le.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==x.object){const u=this._getOrReturnCtx(e);return $(u,{code:N.invalid_type,expected:x.object,received:u.parsedType}),z}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof wn&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||l.push(u);const p=[];for(const u of o){const h=s[u],f=a.data[u];p.push({key:{status:"valid",value:u},value:h._parse(new un(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof wn){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of l)p.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(u==="strict")l.length>0&&($(a,{code:N.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of l){const f=a.data[h];p.push({key:{status:"valid",value:h},value:u._parse(new un(a,f,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of p){const f=await h.key,R=await h.value;u.push({key:f,value:R,alwaysSet:h.alwaysSet})}return u}).then(u=>yt.mergeObjectSync(n,u)):yt.mergeObjectSync(n,p)}get shape(){return this._def.shape()}strict(e){return W.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var a,s,o,l;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(l=W.errToObj(e).message)!==null&&l!==void 0?l:p}:{message:p}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ke({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ke({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const t={};return le.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new Ke({...this._def,shape:()=>t})}omit(e){const t={};return le.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new Ke({...this._def,shape:()=>t})}deepPartial(){return Ei(this)}partial(e){const t={};return le.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}),new Ke({...this._def,shape:()=>t})}required(e){const t={};return le.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof yn;)s=s._def.innerType;t[n]=s}}),new Ke({...this._def,shape:()=>t})}keyof(){return Dg(le.objectKeys(this.shape))}}Ke.create=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strip",catchall:wn.create(),typeName:Y.ZodObject,...ne(e)}),Ke.strictCreate=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strict",catchall:wn.create(),typeName:Y.ZodObject,...ne(e)}),Ke.lazycreate=(r,e)=>new Ke({shape:r,unknownKeys:"strip",catchall:wn.create(),typeName:Y.ZodObject,...ne(e)});class ya extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=s.map(l=>new wt(l.ctx.common.issues));return $(t,{code:N.invalid_union,unionErrors:o}),z}if(t.common.async)return Promise.all(n.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let s;const o=[];for(const p of n){const u={...t,common:{...t.common,issues:[]},parent:null},h=p._parseSync({data:t.data,path:t.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(p=>new wt(p));return $(t,{code:N.invalid_union,unionErrors:l}),z}}get options(){return this._def.options}}ya.create=(r,e)=>new ya({options:r,typeName:Y.ZodUnion,...ne(e)});const Bn=r=>r instanceof ma?Bn(r.schema):r instanceof nn?Bn(r.innerType()):r instanceof Ta?[r.value]:r instanceof Zn?r.options:r instanceof Ea?le.objectValues(r.enum):r instanceof Ra?Bn(r._def.innerType):r instanceof ua?[void 0]:r instanceof pa?[null]:r instanceof yn?[void 0,...Bn(r.unwrap())]:r instanceof Kn?[null,...Bn(r.unwrap())]:r instanceof bd||r instanceof va?Bn(r.unwrap()):r instanceof ga?Bn(r._def.innerType):[];class $s extends ie{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return $(t,{code:N.invalid_type,expected:x.object,received:t.parsedType}),z;const n=this.discriminator,a=t.data[n],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):($(t,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const a=new Map;for(const s of t){const o=Bn(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,s)}}return new $s({typeName:Y.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...ne(n)})}}function gd(r,e){const t=Yn(r),n=Yn(e);if(r===e)return{valid:!0,data:r};if(t===x.object&&n===x.object){const a=le.objectKeys(e),s=le.objectKeys(r).filter(l=>a.indexOf(l)!==-1),o={...r,...e};for(const l of s){const p=gd(r[l],e[l]);if(!p.valid)return{valid:!1};o[l]=p.data}return{valid:!0,data:o}}else if(t===x.array&&n===x.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<r.length;s++){const o=r[s],l=e[s],p=gd(o,l);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===x.date&&n===x.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ha extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(s,o)=>{if(Td(s)||Td(o))return z;const l=gd(s.value,o.value);return l.valid?((Ed(s)||Ed(o))&&t.dirty(),{status:t.value,value:l.data}):($(n,{code:N.invalid_intersection_types}),z)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ha.create=(r,e,t)=>new ha({left:r,right:e,typeName:Y.ZodIntersection,...ne(t)});class pn extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.array)return $(n,{code:N.invalid_type,expected:x.array,received:n.parsedType}),z;if(n.data.length<this._def.items.length)return $(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z;!this._def.rest&&n.data.length>this._def.items.length&&($(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((o,l)=>{const p=this._def.items[l]||this._def.rest;return p?p._parse(new un(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>yt.mergeArray(t,o)):yt.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new pn({...this._def,rest:e})}}pn.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pn({items:r,typeName:Y.ZodTuple,rest:null,...ne(e)})};class fa extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.object)return $(n,{code:N.invalid_type,expected:x.object,received:n.parsedType}),z;const a=[],s=this._def.keyType,o=this._def.valueType;for(const l in n.data)a.push({key:s._parse(new un(n,l,n.path,l)),value:o._parse(new un(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?yt.mergeObjectAsync(t,a):yt.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ie?new fa({keyType:e,valueType:t,typeName:Y.ZodRecord,...ne(n)}):new fa({keyType:en.create(),valueType:e,typeName:Y.ZodRecord,...ne(t)})}}class Fs extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.map)return $(n,{code:N.invalid_type,expected:x.map,received:n.parsedType}),z;const a=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([l,p],u)=>({key:a._parse(new un(n,l,n.path,[u,"key"])),value:s._parse(new un(n,p,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const p of o){const u=await p.key,h=await p.value;if(u.status==="aborted"||h.status==="aborted")return z;(u.status==="dirty"||h.status==="dirty")&&t.dirty(),l.set(u.value,h.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const p of o){const u=p.key,h=p.value;if(u.status==="aborted"||h.status==="aborted")return z;(u.status==="dirty"||h.status==="dirty")&&t.dirty(),l.set(u.value,h.value)}return{status:t.value,value:l}}}}Fs.create=(r,e,t)=>new Fs({valueType:e,keyType:r,typeName:Y.ZodMap,...ne(t)});class vr extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.set)return $(n,{code:N.invalid_type,expected:x.set,received:n.parsedType}),z;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&($(n,{code:N.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&($(n,{code:N.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(p){const u=new Set;for(const h of p){if(h.status==="aborted")return z;h.status==="dirty"&&t.dirty(),u.add(h.value)}return{status:t.value,value:u}}const l=[...n.data.values()].map((p,u)=>s._parse(new un(n,p,n.path,u)));return n.common.async?Promise.all(l).then(p=>o(p)):o(l)}min(e,t){return new vr({...this._def,minSize:{value:e,message:W.toString(t)}})}max(e,t){return new vr({...this._def,maxSize:{value:e,message:W.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}vr.create=(r,e)=>new vr({valueType:r,minSize:null,maxSize:null,typeName:Y.ZodSet,...ne(e)});class Ri extends ie{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return $(t,{code:N.invalid_type,expected:x.function,received:t.parsedType}),z;function n(l,p){return Vs({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_s(),fi].filter(u=>!!u),issueData:{code:N.invalid_arguments,argumentsError:p}})}function a(l,p){return Vs({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_s(),fi].filter(u=>!!u),issueData:{code:N.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof gi){const l=this;return gt(async function(...p){const u=new wt([]),h=await l._def.args.parseAsync(p,s).catch(v=>{throw u.addIssue(n(p,v)),u}),f=await Reflect.apply(o,this,h);return await l._def.returns._def.type.parseAsync(f,s).catch(v=>{throw u.addIssue(a(f,v)),u})})}else{const l=this;return gt(function(...p){const u=l._def.args.safeParse(p,s);if(!u.success)throw new wt([n(p,u.error)]);const h=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(h,s);if(!f.success)throw new wt([a(h,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ri({...this._def,args:pn.create(e).rest(br.create())})}returns(e){return new Ri({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ri({args:e||pn.create([]).rest(br.create()),returns:t||br.create(),typeName:Y.ZodFunction,...ne(n)})}}class ma extends ie{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ma.create=(r,e)=>new ma({getter:r,typeName:Y.ZodLazy,...ne(e)});class Ta extends ie{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return $(t,{received:t.data,code:N.invalid_literal,expected:this._def.value}),z}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ta.create=(r,e)=>new Ta({value:r,typeName:Y.ZodLiteral,...ne(e)});function Dg(r,e){return new Zn({values:r,typeName:Y.ZodEnum,...ne(e)})}class Zn extends ie{constructor(){super(...arguments),la.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{expected:le.joinValues(n),received:t.parsedType,code:N.invalid_type}),z}if(Ns(this,la,"f")||Rg(this,la,new Set(this._def.values),"f"),!Ns(this,la,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{received:t.data,code:N.invalid_enum_value,options:n}),z}return gt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Zn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Zn.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}la=new WeakMap,Zn.create=Dg;class Ea extends ie{constructor(){super(...arguments),da.set(this,void 0)}_parse(e){const t=le.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==x.string&&n.parsedType!==x.number){const a=le.objectValues(t);return $(n,{expected:le.joinValues(a),received:n.parsedType,code:N.invalid_type}),z}if(Ns(this,da,"f")||Rg(this,da,new Set(le.getValidEnumValues(this._def.values)),"f"),!Ns(this,da,"f").has(e.data)){const a=le.objectValues(t);return $(n,{received:n.data,code:N.invalid_enum_value,options:a}),z}return gt(e.data)}get enum(){return this._def.values}}da=new WeakMap,Ea.create=(r,e)=>new Ea({values:r,typeName:Y.ZodNativeEnum,...ne(e)});class gi extends ie{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&t.common.async===!1)return $(t,{code:N.invalid_type,expected:x.promise,received:t.parsedType}),z;const n=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return gt(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}gi.create=(r,e)=>new gi({type:r,typeName:Y.ZodPromise,...ne(e)});class nn extends ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{$(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async l=>{if(t.value==="aborted")return z;const p=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return p.status==="aborted"?z:p.status==="dirty"||t.value==="dirty"?mi(p.value):p});{if(t.value==="aborted")return z;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?z:l.status==="dirty"||t.value==="dirty"?mi(l.value):l}}if(a.type==="refinement"){const o=l=>{const p=a.refinement(l,s);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?z:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?z:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!sa(o))return o;const l=a.transform(o.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>sa(o)?Promise.resolve(a.transform(o.value,s)).then(l=>({status:t.value,value:l})):o);le.assertNever(a)}}nn.create=(r,e,t)=>new nn({schema:r,typeName:Y.ZodEffects,effect:e,...ne(t)}),nn.createWithPreprocess=(r,e,t)=>new nn({schema:e,effect:{type:"preprocess",transform:r},typeName:Y.ZodEffects,...ne(t)});class yn extends ie{_parse(e){return this._getType(e)===x.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}yn.create=(r,e)=>new yn({innerType:r,typeName:Y.ZodOptional,...ne(e)});class Kn extends ie{_parse(e){return this._getType(e)===x.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Kn.create=(r,e)=>new Kn({innerType:r,typeName:Y.ZodNullable,...ne(e)});class Ra extends ie{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===x.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ra.create=(r,e)=>new Ra({innerType:r,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});class ga extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return oa(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new wt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new wt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ga.create=(r,e)=>new ga({innerType:r,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});class Us extends ie{_parse(e){if(this._getType(e)!==x.nan){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:x.nan,received:n.parsedType}),z}return{status:"valid",value:e.data}}}Us.create=r=>new Us({typeName:Y.ZodNaN,...ne(r)});const TP=Symbol("zod_brand");class bd extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ba extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?z:s.status==="dirty"?(t.dirty(),mi(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?z:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new ba({in:e,out:t,typeName:Y.ZodPipeline})}}class va extends ie{_parse(e){const t=this._def.innerType._parse(e),n=a=>(sa(a)&&(a.value=Object.freeze(a.value)),a);return oa(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}va.create=(r,e)=>new va({innerType:r,typeName:Y.ZodReadonly,...ne(e)});function Ag(r,e={},t){return r?Ti.create().superRefine((n,a)=>{var s,o;if(!r(n)){const l=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,p=(o=(s=l.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,u=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...u,fatal:p})}}):Ti.create()}const EP={object:Ke.lazycreate};var Y;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(Y||(Y={}));const RP=(r,e={message:`Input not instance of ${r.name}`})=>Ag(t=>t instanceof r,e),xs=en.create,vd=Hn.create,gP=Us.create,bP=zn.create,Id=ca.create,Sg=gr.create,vP=Ls.create,IP=ua.create,Og=pa.create,DP=Ti.create,js=br.create,AP=wn.create,SP=Gs.create,OP=tn.create,Pg=Ke.create,PP=Ke.strictCreate,CP=ya.create,wP=$s.create,BP=ha.create,MP=pn.create,Cg=fa.create,_P=Fs.create,VP=vr.create,NP=Ri.create,LP=ma.create,GP=Ta.create,wg=Zn.create,$P=Ea.create,FP=gi.create,Bg=nn.create,UP=yn.create,xP=Kn.create,jP=nn.createWithPreprocess,kP=ba.create;var y=Object.freeze({__proto__:null,defaultErrorMap:fi,setErrorMap:eP,getErrorMap:_s,makeIssue:Vs,EMPTY_PATH:tP,addIssueToContext:$,ParseStatus:yt,INVALID:z,DIRTY:mi,OK:gt,isAborted:Td,isDirty:Ed,isValid:sa,isAsync:oa,get util(){return le},get objectUtil(){return md},ZodParsedType:x,getParsedType:Yn,ZodType:ie,datetimeRegex:Ig,ZodString:en,ZodNumber:Hn,ZodBigInt:zn,ZodBoolean:ca,ZodDate:gr,ZodSymbol:Ls,ZodUndefined:ua,ZodNull:pa,ZodAny:Ti,ZodUnknown:br,ZodNever:wn,ZodVoid:Gs,ZodArray:tn,ZodObject:Ke,ZodUnion:ya,ZodDiscriminatedUnion:$s,ZodIntersection:ha,ZodTuple:pn,ZodRecord:fa,ZodMap:Fs,ZodSet:vr,ZodFunction:Ri,ZodLazy:ma,ZodLiteral:Ta,ZodEnum:Zn,ZodNativeEnum:Ea,ZodPromise:gi,ZodEffects:nn,ZodTransformer:nn,ZodOptional:yn,ZodNullable:Kn,ZodDefault:Ra,ZodCatch:ga,ZodNaN:Us,BRAND:TP,ZodBranded:bd,ZodPipeline:ba,ZodReadonly:va,custom:Ag,Schema:ie,ZodSchema:ie,late:EP,get ZodFirstPartyTypeKind(){return Y},coerce:{string:r=>en.create({...r,coerce:!0}),number:r=>Hn.create({...r,coerce:!0}),boolean:r=>ca.create({...r,coerce:!0}),bigint:r=>zn.create({...r,coerce:!0}),date:r=>gr.create({...r,coerce:!0})},any:DP,array:OP,bigint:bP,boolean:Id,date:Sg,discriminatedUnion:wP,effect:Bg,enum:wg,function:NP,instanceof:RP,intersection:BP,lazy:LP,literal:GP,map:_P,nan:gP,nativeEnum:$P,never:AP,null:Og,nullable:xP,number:vd,object:Pg,oboolean:()=>Id().optional(),onumber:()=>vd().optional(),optional:UP,ostring:()=>xs().optional(),pipeline:kP,preprocess:jP,promise:FP,record:Cg,set:VP,strictObject:PP,string:xs,symbol:vP,transformer:Bg,tuple:MP,undefined:IP,union:CP,unknown:js,void:SP,NEVER:z,ZodIssueCode:N,quotelessJson:QO,ZodError:wt});function Mg(r){var a,s,o;if(!(r!=null&&r.dataType))return js();const e=!r.required,t=r.dataType.isList||!1;let n=js();if(((a=r.dataType.entity)==null?void 0:a.type)===i.PrimitiveEntity)switch(r.dataType.entity.name){case C.String:n=xs();break;case C.KeyValue:n=Cg(js());break;case C.Number:n=vd();break;case C.Boolean:n=Id();break;case C.Date:n=Sg();break;case C.Enum:{const l=r.dataType.options||[];if(l.length===0)throw new Error(`Enum property ${r.name} has no options`);n=wg(l);break}case C.Null:n=Og();break;case C.UUID:n=xs().uuid();break}else if(((s=r.dataType.entity)==null?void 0:s.type)===i.DefinitionEntity)n=_g(r.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=r.dataType.entity)==null?void 0:o.type}`);return e&&(n=n.nullable()),t&&(n=n.array()),n}function _g(r){const e=Pg({});for(const t of r.properties){const n=Mg(t);e.shape[t.name]=n}return e}function Vg(r){const e=r.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function Ng(r){const e=r.rangeEnd;return new Date(Math.random()*e.getTime())}function Lg(r){const e=r.rangeStart,t=r.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function Gg(r){return r.rangeStart&&r.rangeEnd?Lg(r):r.rangeStart?Vg(r):r.rangeEnd?Ng(r):new Date}function qP(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $g={},ks={},qs={};Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=WP;let Js;const JP=new Uint8Array(16);function WP(){if(!Js&&(Js=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Js))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Js(JP)}var Xn={},Ir={},Ws={};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.default=void 0;var YP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Ws.default=YP,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.default=void 0;var HP=zP(Ws);function zP(r){return r&&r.__esModule?r:{default:r}}function ZP(r){return typeof r=="string"&&HP.default.test(r)}var KP=ZP;Ir.default=KP,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.default=void 0,Xn.unsafeStringify=Fg;var XP=QP(Ir);function QP(r){return r&&r.__esModule?r:{default:r}}const ut=[];for(let r=0;r<256;++r)ut.push((r+256).toString(16).slice(1));function Fg(r,e=0){return ut[r[e+0]]+ut[r[e+1]]+ut[r[e+2]]+ut[r[e+3]]+"-"+ut[r[e+4]]+ut[r[e+5]]+"-"+ut[r[e+6]]+ut[r[e+7]]+"-"+ut[r[e+8]]+ut[r[e+9]]+"-"+ut[r[e+10]]+ut[r[e+11]]+ut[r[e+12]]+ut[r[e+13]]+ut[r[e+14]]+ut[r[e+15]]}function eC(r,e=0){const t=Fg(r,e);if(!(0,XP.default)(t))throw TypeError("Stringified UUID is invalid");return t}var tC=eC;Xn.default=tC,Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=void 0;var nC=iC(qs),rC=Xn;function iC(r){return r&&r.__esModule?r:{default:r}}let Ug,Dd,Ad=0,Sd=0;function aC(r,e,t){let n=e&&t||0;const a=e||new Array(16);r=r||{};let s=r.node||Ug,o=r.clockseq!==void 0?r.clockseq:Dd;if(s==null||o==null){const R=r.random||(r.rng||nC.default)();s==null&&(s=Ug=[R[0]|1,R[1],R[2],R[3],R[4],R[5]]),o==null&&(o=Dd=(R[6]<<8|R[7])&16383)}let l=r.msecs!==void 0?r.msecs:Date.now(),p=r.nsecs!==void 0?r.nsecs:Sd+1;const u=l-Ad+(p-Sd)/1e4;if(u<0&&r.clockseq===void 0&&(o=o+1&16383),(u<0||l>Ad)&&r.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ad=l,Sd=p,Dd=o,l+=122192928e5;const h=((l&268435455)*1e4+p)%4294967296;a[n++]=h>>>24&255,a[n++]=h>>>16&255,a[n++]=h>>>8&255,a[n++]=h&255;const f=l/4294967296*1e4&268435455;a[n++]=f>>>8&255,a[n++]=f&255,a[n++]=f>>>24&15|16,a[n++]=f>>>16&255,a[n++]=o>>>8|128,a[n++]=o&255;for(let R=0;R<6;++R)a[n+R]=s[R];return e||(0,rC.unsafeStringify)(a)}var sC=aC;ks.default=sC;var Ys={},Qn={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.default=void 0;var oC=lC(Ir);function lC(r){return r&&r.__esModule?r:{default:r}}function dC(r){if(!(0,oC.default)(r))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(r.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(r.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(r.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(r.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var cC=dC;Ia.default=cC,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.URL=Qn.DNS=void 0,Qn.default=fC;var uC=Xn,pC=yC(Ia);function yC(r){return r&&r.__esModule?r:{default:r}}function hC(r){r=unescape(encodeURIComponent(r));const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e}const xg="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Qn.DNS=xg;const jg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Qn.URL=jg;function fC(r,e,t){function n(a,s,o,l){var p;if(typeof a=="string"&&(a=hC(a)),typeof s=="string"&&(s=(0,pC.default)(s)),((p=s)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+a.length);if(u.set(s),u.set(a,s.length),u=t(u),u[6]=u[6]&15|e,u[8]=u[8]&63|128,o){l=l||0;for(let h=0;h<16;++h)o[l+h]=u[h];return o}return(0,uC.unsafeStringify)(u)}try{n.name=r}catch{}return n.DNS=xg,n.URL=jg,n}var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.default=void 0;function mC(r){if(typeof r=="string"){const e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(let t=0;t<e.length;++t)r[t]=e.charCodeAt(t)}return TC(EC(RC(r),r.length*8))}function TC(r){const e=[],t=r.length*32,n="0123456789abcdef";for(let a=0;a<t;a+=8){const s=r[a>>5]>>>a%32&255,o=parseInt(n.charAt(s>>>4&15)+n.charAt(s&15),16);e.push(o)}return e}function kg(r){return(r+64>>>9<<4)+14+1}function EC(r,e){r[e>>5]|=128<<e%32,r[kg(e)-1]=e;let t=1732584193,n=-271733879,a=-1732584194,s=271733878;for(let o=0;o<r.length;o+=16){const l=t,p=n,u=a,h=s;t=ht(t,n,a,s,r[o],7,-680876936),s=ht(s,t,n,a,r[o+1],12,-389564586),a=ht(a,s,t,n,r[o+2],17,606105819),n=ht(n,a,s,t,r[o+3],22,-1044525330),t=ht(t,n,a,s,r[o+4],7,-176418897),s=ht(s,t,n,a,r[o+5],12,1200080426),a=ht(a,s,t,n,r[o+6],17,-1473231341),n=ht(n,a,s,t,r[o+7],22,-45705983),t=ht(t,n,a,s,r[o+8],7,1770035416),s=ht(s,t,n,a,r[o+9],12,-1958414417),a=ht(a,s,t,n,r[o+10],17,-42063),n=ht(n,a,s,t,r[o+11],22,-1990404162),t=ht(t,n,a,s,r[o+12],7,1804603682),s=ht(s,t,n,a,r[o+13],12,-40341101),a=ht(a,s,t,n,r[o+14],17,-1502002290),n=ht(n,a,s,t,r[o+15],22,1236535329),t=ft(t,n,a,s,r[o+1],5,-165796510),s=ft(s,t,n,a,r[o+6],9,-1069501632),a=ft(a,s,t,n,r[o+11],14,643717713),n=ft(n,a,s,t,r[o],20,-373897302),t=ft(t,n,a,s,r[o+5],5,-701558691),s=ft(s,t,n,a,r[o+10],9,38016083),a=ft(a,s,t,n,r[o+15],14,-660478335),n=ft(n,a,s,t,r[o+4],20,-405537848),t=ft(t,n,a,s,r[o+9],5,568446438),s=ft(s,t,n,a,r[o+14],9,-1019803690),a=ft(a,s,t,n,r[o+3],14,-187363961),n=ft(n,a,s,t,r[o+8],20,1163531501),t=ft(t,n,a,s,r[o+13],5,-1444681467),s=ft(s,t,n,a,r[o+2],9,-51403784),a=ft(a,s,t,n,r[o+7],14,1735328473),n=ft(n,a,s,t,r[o+12],20,-1926607734),t=mt(t,n,a,s,r[o+5],4,-378558),s=mt(s,t,n,a,r[o+8],11,-2022574463),a=mt(a,s,t,n,r[o+11],16,1839030562),n=mt(n,a,s,t,r[o+14],23,-35309556),t=mt(t,n,a,s,r[o+1],4,-1530992060),s=mt(s,t,n,a,r[o+4],11,1272893353),a=mt(a,s,t,n,r[o+7],16,-155497632),n=mt(n,a,s,t,r[o+10],23,-1094730640),t=mt(t,n,a,s,r[o+13],4,681279174),s=mt(s,t,n,a,r[o],11,-358537222),a=mt(a,s,t,n,r[o+3],16,-722521979),n=mt(n,a,s,t,r[o+6],23,76029189),t=mt(t,n,a,s,r[o+9],4,-640364487),s=mt(s,t,n,a,r[o+12],11,-421815835),a=mt(a,s,t,n,r[o+15],16,530742520),n=mt(n,a,s,t,r[o+2],23,-995338651),t=Tt(t,n,a,s,r[o],6,-198630844),s=Tt(s,t,n,a,r[o+7],10,1126891415),a=Tt(a,s,t,n,r[o+14],15,-1416354905),n=Tt(n,a,s,t,r[o+5],21,-57434055),t=Tt(t,n,a,s,r[o+12],6,1700485571),s=Tt(s,t,n,a,r[o+3],10,-1894986606),a=Tt(a,s,t,n,r[o+10],15,-1051523),n=Tt(n,a,s,t,r[o+1],21,-2054922799),t=Tt(t,n,a,s,r[o+8],6,1873313359),s=Tt(s,t,n,a,r[o+15],10,-30611744),a=Tt(a,s,t,n,r[o+6],15,-1560198380),n=Tt(n,a,s,t,r[o+13],21,1309151649),t=Tt(t,n,a,s,r[o+4],6,-145523070),s=Tt(s,t,n,a,r[o+11],10,-1120210379),a=Tt(a,s,t,n,r[o+2],15,718787259),n=Tt(n,a,s,t,r[o+9],21,-343485551),t=er(t,l),n=er(n,p),a=er(a,u),s=er(s,h)}return[t,n,a,s]}function RC(r){if(r.length===0)return[];const e=r.length*8,t=new Uint32Array(kg(e));for(let n=0;n<e;n+=8)t[n>>5]|=(r[n/8]&255)<<n%32;return t}function er(r,e){const t=(r&65535)+(e&65535);return(r>>16)+(e>>16)+(t>>16)<<16|t&65535}function gC(r,e){return r<<e|r>>>32-e}function zs(r,e,t,n,a,s){return er(gC(er(er(e,r),er(n,s)),a),t)}function ht(r,e,t,n,a,s,o){return zs(e&t|~e&n,r,e,a,s,o)}function ft(r,e,t,n,a,s,o){return zs(e&n|t&~n,r,e,a,s,o)}function mt(r,e,t,n,a,s,o){return zs(e^t^n,r,e,a,s,o)}function Tt(r,e,t,n,a,s,o){return zs(t^(e|~n),r,e,a,s,o)}var bC=mC;Hs.default=bC,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=void 0;var vC=qg(Qn),IC=qg(Hs);function qg(r){return r&&r.__esModule?r:{default:r}}var DC=(0,vC.default)("v3",48,IC.default);Ys.default=DC;var Zs={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.default=void 0;var AC={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Ks.default=AC,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.default=void 0;var Jg=Wg(Ks),SC=Wg(qs),OC=Xn;function Wg(r){return r&&r.__esModule?r:{default:r}}function PC(r,e,t){if(Jg.default.randomUUID&&!e&&!r)return Jg.default.randomUUID();r=r||{};const n=r.random||(r.rng||SC.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=n[a];return e}return(0,OC.unsafeStringify)(n)}var CC=PC;Zs.default=CC;var Xs={},Qs={};Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.default=void 0;function wC(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function Od(r,e){return r<<e|r>>>32-e}function BC(r){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){const o=unescape(encodeURIComponent(r));r=[];for(let l=0;l<o.length;++l)r.push(o.charCodeAt(l))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);const n=r.length/4+2,a=Math.ceil(n/16),s=new Array(a);for(let o=0;o<a;++o){const l=new Uint32Array(16);for(let p=0;p<16;++p)l[p]=r[o*64+p*4]<<24|r[o*64+p*4+1]<<16|r[o*64+p*4+2]<<8|r[o*64+p*4+3];s[o]=l}s[a-1][14]=(r.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(r.length-1)*8&4294967295;for(let o=0;o<a;++o){const l=new Uint32Array(80);for(let v=0;v<16;++v)l[v]=s[o][v];for(let v=16;v<80;++v)l[v]=Od(l[v-3]^l[v-8]^l[v-14]^l[v-16],1);let p=t[0],u=t[1],h=t[2],f=t[3],R=t[4];for(let v=0;v<80;++v){const I=Math.floor(v/20),D=Od(p,5)+wC(I,u,h,f)+R+e[I]+l[v]>>>0;R=f,f=h,h=Od(u,30)>>>0,u=p,p=D}t[0]=t[0]+p>>>0,t[1]=t[1]+u>>>0,t[2]=t[2]+h>>>0,t[3]=t[3]+f>>>0,t[4]=t[4]+R>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var MC=BC;Qs.default=MC,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=void 0;var _C=Yg(Qn),VC=Yg(Qs);function Yg(r){return r&&r.__esModule?r:{default:r}}var NC=(0,_C.default)("v5",80,VC.default);Xs.default=NC;var eo={};Object.defineProperty(eo,"__esModule",{value:!0}),eo.default=void 0;var LC="00000000-0000-0000-0000-000000000000";eo.default=LC;var to={};Object.defineProperty(to,"__esModule",{value:!0}),to.default=void 0;var GC=$C(Ir);function $C(r){return r&&r.__esModule?r:{default:r}}function FC(r){if(!(0,GC.default)(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}var UC=FC;to.default=UC,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return o.default}});var e=h(ks),t=h(Ys),n=h(Zs),a=h(Xs),s=h(eo),o=h(to),l=h(Ir),p=h(Xn),u=h(Ia);function h(f){return f&&f.__esModule?f:{default:f}}}($g);function Pd(r,e){if(!r||!e||!r.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=r,this.dstAlphabet=e}Pd.prototype.convert=function(r){var e,t,n,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,l=r.length,p=typeof r=="string"?"":[];if(!this.isValid(r))throw new Error('Number "'+r+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return r;for(e=0;e<l;e++)a[e]=this.srcAlphabet.indexOf(r[e]);do{for(t=0,n=0,e=0;e<l;e++)t=t*s+a[e],t>=o?(a[n++]=parseInt(t/o,10),t=t%o):n>0&&(a[n++]=0);l=n,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(n!==0);return p},Pd.prototype.isValid=function(r){for(var e=0;e<r.length;++e)if(this.srcAlphabet.indexOf(r[e])===-1)return!1;return!0};var xC=Pd,jC=xC;function Da(r,e){var t=new jC(r,e);return function(n){return t.convert(n)}}Da.BIN="01",Da.OCT="01234567",Da.DEC="0123456789",Da.HEX="0123456789abcdef";var kC=Da;const{v4:Cd,validate:qC}=$g,no=kC,wd={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},JC={consistentLength:!0};let Bd;const Hg=(r,e,t)=>{const n=e(r.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?n:n.padStart(t.shortIdLength,t.paddingChar)},zg=(r,e)=>{const n=e(r).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[n[1],n[2],n[3],n[4],n[5]].join("-")},WC=r=>Math.ceil(Math.log(2**128)/Math.log(r));var YC=(()=>{const r=(e,t)=>{const n=e||wd.flickrBase58,a={...JC,...t};if([...new Set(Array.from(n))].length!==n.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=WC(n.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:n[0]},l=no(no.HEX,n),p=no(n,no.HEX),u=()=>Hg(Cd(),l,o),f={alphabet:n,fromUUID:R=>Hg(R,l,o),maxLength:s,generate:u,new:u,toUUID:R=>zg(R,p),uuid:Cd,validate:(R,v=!1)=>{if(!R||typeof R!="string")return!1;const I=a.consistentLength?R.length===s:R.length<=s,D=R.split("").every(S=>n.includes(S));return v===!1?I&&D:I&&D&&qC(zg(R,p))}};return Object.freeze(f),f};return r.constants=wd,r.uuid=Cd,r.generate=()=>(Bd||(Bd=r(wd.flickrBase58).generate),Bd()),r})();const ro=qP(YC);function Zg(){return ro().uuid()}function Kg(r){return r.rangeStart+Math.random()}function Xg(r){const e=r.rangeEnd;return Math.random()*e}function Qg(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random()*(t-e)+e}function eb(r){return r.rangeStart&&r.rangeEnd?Qg(r):r.rangeStart?Kg(r):r.rangeEnd?Xg(r):Math.random()}function tb(r){const e=r.rangeStart;return Math.random().toString(36).substring(e)}function nb(r){const e=r.rangeEnd;return Math.random().toString(36).substring(0,e)}function rb(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random().toString(36).substring(e,t)}function ib(r){return r.rangeStart&&r.rangeEnd?rb(r):r.rangeStart?tb(r):r.rangeEnd?nb(r):Math.random().toString(36)}function ab(r){return Math.random()>=.5}function HC(r){if(!r||!r.autogeneration)return null;switch(r.autogeneration.type){case ze.CurrentDateAndTime:if(r.name===C.Date)return new Date;case ze.Random:{if(r.name===C.Date)return Gg(r.autogeneration);if(r.name===C.Number)return eb(r.autogeneration);if(r.name===C.String)return ib(r.autogeneration);if(r.name===C.Boolean)return ab(r.autogeneration)}case ze.Unique:if(r.name===C.UUID)return Zg();default:throw new Error(`Generating a ${r.autogeneration.type} value for a ${r.name} is not supported`)}}const H="e7eb5382-3d99-44fd-972a-b8b1e819f6be",sb="global-user-variable-id",Md="last-executed-timestamp-variable-id",zC={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:i.ValueDescriptor},ZC={id:"alternative-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:i.Property},KC={like:!1,inferred:!1,id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:ZC},io={id:"alternative-relational-database-entity-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-id",entityType:i.DefinitionEntity},XC={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:Ss,static:!0,index:0,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:null,parent:zC,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:KC,description:"The name of the main database inside of the server instance where the data will be stored.",parent:io};i.GenericReference,i.ValueDescriptor;const QC={id:"alternative-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:i.Property},ew={like:!1,inferred:!1,id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:QC},tw={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:Os,static:!0,index:1,defaultValue:null,dataType:ew,description:"The username that will be used to connect to the database.",parent:io};i.GenericReference,i.ValueDescriptor;const nw={id:"alternative-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:i.Property},rw={like:!1,inferred:!1,id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:nw},iw={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:Ps,static:!0,index:2,defaultValue:null,dataType:rw,description:"The password that will be used to connect to the database.",parent:io},aw={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:i.ValueDescriptor},sw={id:"alternative-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:i.Property},ow={like:!1,inferred:!1,id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:sw},lw={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Cs,static:!0,index:3,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:6,parent:aw,autogeneration:null,valueAsType:null},dataType:ow,description:"The minimum size of the database in GB.",parent:io},dw={id:"alternative-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},_d={id:"alternative-relational-database-entity-id",type:i.DefinitionEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[XC,tw,iw,lw],methods:[],abstractMethods:[],extends:[],implements:[cn],x:0,y:0,parent:dw},cw={id:"animal-prototype-database-property-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-id",entityType:i.Property},uw={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-id",entityType:i.Property},pw={like:!1,inferred:!1,id:"animal-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:cw},yw={id:"animal-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",entityType:i.DefinitionEntity},hw={constant:!1,hidden:!1,required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:_d,autogeneration:null,parent:uw},dataType:pw,description:"The database that the entity belongs to.",parent:yw},fw={type:i.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:i.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},mw={like:!1,inferred:!1,id:"c1930577-9e79-48a6-8905-be24611015c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:fw},Tw={type:i.GenericReference,id:"animal-name-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"83eaa847-e62b-4192-84fb-3d8d6f5ea970"},Ew={constant:!1,hidden:!1,required:!0,type:i.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",defaultValue:null,implements:pi,static:!1,private:!1,index:0,dataType:mw,abstract:!1,parent:Tw},Rw={type:i.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:i.Project,entityId:H},gw={type:i.DefinitionEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[hw,Ew],methods:[],extends:[],implements:[st],x:0,y:0,parent:Rw},Aa="base-table-entity",ob="base-table-entity-identifier-property-id";i.GenericReference,i.Property,i.GenericReference,i.Property;const bw={id:"base-table-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:ob,entityType:i.Property},vw={id:"base-table-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-identifier-property-id",entityType:i.Property},Iw={like:!1,inferred:!1,id:"base-table-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:vw},Dw={id:"base-table-entity-identifier-property-parent-ref-id",type:i.GenericReference,entityId:Aa,entityType:i.DefinitionEntity};i.Property,i.LiteralValue,C.UUID,ze.Unique,i.GenericReference,i.Property;const Aw={id:"base-table-entity-deleted-at-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-deleted-at-property-id",entityType:i.Property},Sw={like:!1,inferred:!1,id:"base-table-entity-deleted-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:on,asType:!1,parent:Aw},Ow={id:"base-table-entity-deleted-at-property-parent-ref-id",type:i.GenericReference,entityId:Aa,entityType:i.DefinitionEntity},Pw={constant:!1,hidden:!0,required:!0,id:"base-table-entity-deleted-at-property-id",name:"Deleted at",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!1,index:0,defaultValue:null,dataType:Sw,description:"The date and time when the entity was deleted.",parent:Ow};i.GenericReference,i.Property;const Cw={id:"base-table-entity-created-at-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-created-at-property-id",entityType:i.Property},ww={like:!1,inferred:!1,id:"base-table-entity-created-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:on,asType:!1,parent:Cw},Bw={id:"base-table-entity-created-at-property-parent-ref-id",type:i.GenericReference,entityId:Aa,entityType:i.DefinitionEntity},Mw={constant:!1,hidden:!0,required:!0,id:"base-table-entity-created-at-property-id",name:"Created at",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!1,index:0,defaultValue:null,dataType:ww,description:"The date and time when the entity was created.",parent:Bw};i.GenericReference,i.Property;const _w={id:"base-table-entity-updated-at-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-updated-at-property-id",entityType:i.Property},Vw={like:!1,inferred:!1,id:"base-table-entity-updated-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:on,asType:!1,parent:_w},Nw={id:"base-table-entity-updated-at-property-parent-ref-id",type:i.GenericReference,entityId:Aa,entityType:i.DefinitionEntity},Lw={constant:!1,hidden:!0,required:!0,id:"base-table-entity-updated-at-property-id",name:"Updated at",version:1,type:i.Property,private:!1,implements:null,abstract:!0,static:!1,index:0,defaultValue:null,dataType:Vw,description:"The date and time when the entity was last updated.",parent:Nw},Gw={id:"base-table-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Ft={id:Aa,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:"Base database table format",type:i.DefinitionEntity,abstract:!0,static:!1,abstractMethods:[],implements:[],properties:[Pw,Mw,Lw],methods:[],extends:[],x:0,y:0,parent:Gw},$w={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:i.Property},Fw={id:"default-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:i.Property},Uw={like:!1,inferred:!1,id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:Fw},bi={id:"default-relational-database-entity-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-id",entityType:i.DefinitionEntity},xw={constant:!1,id:"default-relational-database-entity-identifier-property-id",hidden:!1,required:!0,name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:Ss,static:!0,index:0,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"main",parent:$w,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:Uw,description:"The name of the main database inside of the server instance where the data will be stored.",parent:bi};i.GenericReference,i.Property;const jw={id:"default-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:i.Property},kw={id:"default-relational-database-entity-username-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:i.Property},qw={like:!1,inferred:!1,id:"default-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:jw},Jw={constant:!1,hidden:!1,required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:Os,defaultValue:{id:"default-relational-database-entity-username-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"root",parent:kw,autogeneration:null,valueAsType:null},static:!0,index:1,dataType:qw,description:"The username that will be used to connect to the database.",parent:bi};i.GenericReference,i.Property;const Ww={id:"default-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:i.Property},Yw={id:"default-relational-database-entity-password-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:i.Property},Hw={like:!1,inferred:!1,id:"default-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:Ww},zw={constant:!1,hidden:!1,required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:Ps,static:!0,index:2,defaultValue:{id:"default-relational-database-entity-password-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"password",parent:Yw,autogeneration:null,valueAsType:null},dataType:Hw,description:"The password that will be used to connect to the database.",parent:bi},Zw={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:i.Property},Kw={id:"default-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:i.Property},Xw={like:!1,inferred:!1,id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:Kw},Qw={constant:!1,hidden:!1,required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Cs,static:!0,index:3,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:6,parent:Zw,autogeneration:null,valueAsType:null},dataType:Xw,description:"The minimum size of the database in GB.",parent:bi},eB={id:"default-relational-database-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:i.Property},tB={id:"default-relational-database-entity-default-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:i.Property},nB={like:!1,inferred:!1,id:"default-relational-database-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:tB},rB={constant:!1,id:"default-relational-database-entity-default-property-id",hidden:!0,required:!0,name:"Default",description:"Whether this database is automatically picked by other entities as the default database.",version:1,type:i.Property,private:!1,abstract:!1,implements:cd,static:!0,index:4,dataType:nB,defaultValue:{id:"default-relational-database-entity-default-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!0,parent:eB,autogeneration:null,valueAsType:null},parent:bi},iB={id:"default-relational-database-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:i.Property},aB={id:"default-relational-database-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:i.Property},sB={like:!1,inferred:!1,id:"default-relational-database-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:aB},oB={constant:!1,id:"default-relational-database-entity-autoscaling-property-id",hidden:!1,required:!0,name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!1,implements:ud,static:!0,index:5,defaultValue:{id:"default-relational-database-entity-autoscaling-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!0,parent:iB,autogeneration:null,valueAsType:null},dataType:sB,description:"If true, this database will automatically scale up or down in memory size, based on the usage.s",parent:bi},lB={id:"default-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Vd={id:"default-relational-database-entity-id",type:i.DefinitionEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[rB,oB,xw,Jw,zw,Qw],methods:[],abstractMethods:[],extends:[],implements:[cn],x:0,y:0,parent:lB},dB={id:"user-prototype-database-property-data-type-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-id",entityType:i.Property},cB={id:"user-prototype-database-property-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-id",entityType:i.Property},uB={like:!1,inferred:!1,id:"user-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:cB},pB={id:"user-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.DefinitionEntity},yB={constant:!1,hidden:!1,required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:Vd,autogeneration:null,parent:dB},dataType:uB,description:"The database that the entity belongs to.",parent:pB},hB={type:i.GenericReference,id:"user-prototype-parent-ref-id",entityType:i.Project,entityId:H},fB={id:"user-prototype-primary-key-property-data-type-ref-id",type:i.GenericReference,entityId:"user-prototype-primary-key-property-id",entityType:i.Property},mB={id:"user-prototype-primary-key-property-ref-id",type:i.GenericReference,entityId:"user-prototype-primary-key-property-id",entityType:i.Property},TB={like:!1,inferred:!1,id:"user-prototype-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:mB},EB={id:"user-prototype-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.DefinitionEntity},RB={constant:!1,hidden:!1,required:!0,id:"user-prototype-primary-key-property-id",name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:pi,static:!1,index:1,defaultValue:{id:"user-prototype-primary-key-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.UUID,value:null,parent:fB,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:TB,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:EB},Nd={type:i.DefinitionEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[st,Ft],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[yB,RB],methods:[],x:0,y:0,parent:hB},gB={type:i.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:i.Property,entityId:"person-date-of-birth-property-id"},bB={like:!1,inferred:!1,id:"person-date-of-birth-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:on,isList:!1,asType:!1,parent:gB},vB={type:i.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},IB={constant:!1,hidden:!1,required:!0,type:i.Property,id:"person-date-of-birth-property-id",version:1,name:"Date of birth",description:"The date of birth of the person",implements:null,private:!1,static:!1,index:0,defaultValue:null,dataType:bB,abstract:!1,parent:vB},DB={type:i.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:i.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},AB={like:!1,inferred:!1,id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:DB},SB={type:i.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:i.DefinitionEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},OB={constant:!1,hidden:!1,required:!0,type:i.Property,id:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7",version:1,name:"Name",description:"The name of the person",implements:null,private:!1,static:!1,index:0,defaultValue:null,dataType:AB,abstract:!1,parent:SB},PB={type:i.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:i.Project,entityId:H},bt={type:i.DefinitionEntity,id:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416",version:1,name:"Person",description:"A entity to store more information about a person than the user entity does, to split the responsibilities and keep it the logic clean.",properties:[OB,IB],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[Nd],x:0,y:0,parent:PB},CB={type:i.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},wB={type:i.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:i.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},BB={type:i.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},MB={type:i.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:i.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},_B={like:!1,inferred:!1,id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:MB},Ld={constant:!0,isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:i.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,defaultValue:null,dataType:_B,implements:null,readsValue:BB,required:!0,index:0,parent:wB},VB={type:i.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},NB={type:i.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},lb={type:i.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[Ld],calledByError:[],calledByEntry:[VB],calledBySuccess:[],throws:null,x:0,y:0,parent:NB},LB={type:i.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},GB={like:!1,inferred:!1,id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:LB},db={constant:!0,id:"500dee3a-3435-4453-9699-0d053f646523",type:i.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,defaultValue:null,dataType:GB,implements:null,required:!0,writesValues:[Ld],index:0,parent:CB},$B={type:i.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},cb={type:i.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[db],calls:[lb],returnStatements:[lb],index:0,collapsed:!1,private:!1,x:0,y:0,parent:$B},FB={type:i.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:i.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},UB={like:!1,inferred:!1,id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,parent:FB},xB={type:i.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:i.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},jB={type:i.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},kB={constant:!0,required:!0,id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:i.VariableDeclaration,version:1,name:"Output Account Owner",description:null,defaultValue:null,dataType:UB,readsValue:xB,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:jB},qB={type:i.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},JB={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:i.OutputMap,version:1,declaration:Ld,defaultValue:null,writesValues:[kB],index:0,parent:qB},WB={type:i.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},YB={type:i.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},HB={type:i.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},zB={like:!1,inferred:!1,id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,parent:HB},ZB={type:i.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},KB={type:i.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},XB={type:i.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},QB={type:i.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},ub={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:i.InputMap,version:1,declaration:db,name:null,description:null,readsValue:QB,defaultValue:null,index:0,parent:XB},eM={constant:!0,required:!0,type:i.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,defaultValue:null,dataType:zB,readsValue:ZB,writesValues:[ub],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:KB},tM={type:i.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:cb,inputs:[ub],outputs:[JB],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[WB],calledBySuccess:[],parent:YB,error:null,x:0,y:0},nM={type:i.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},rM={like:!1,inferred:!1,id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,parent:nM},iM={type:i.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},aM={constant:!0,id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:i.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",defaultValue:null,dataType:rM,implements:null,required:!0,index:0,writesValues:[eM],parent:iM},sM={type:i.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},oM={type:i.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[aM],collapsed:!0,returnStatements:[],calls:[tM],private:!1,index:0,implements:null,x:0,y:0,parent:sM},lM={type:i.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:i.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},dM={like:!1,inferred:!1,id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:lM},cM={type:i.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},uM={constant:!1,hidden:!1,required:!0,type:i.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,defaultValue:null,implements:pi,static:!1,index:0,dataType:dM,abstract:!1,parent:cM},pM={type:i.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:i.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},yM={like:!1,inferred:!1,id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:pM},hM={type:i.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},fM={constant:!1,hidden:!1,required:!0,type:i.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,defaultValue:null,dataType:yM,implements:null,static:!1,private:!0,abstract:!1,parent:hM},mM={type:i.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:i.Project,entityId:H},vi={type:i.DefinitionEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[uM,fM],methods:[cb,oM],extends:[],implements:[st,Ft],x:0,y:0,parent:mM},Sa="bitcoin-api-response-id",pb="time-property-id",yb="disclaimer-property-id",hb="chart-name-property-id",fb="bpi-property-id",ao="bpi-entity-id",mb="usd-property-id",Tb="gbp-property-id",Eb="eur-property-id",Ii="currency-entity-id",Rb="currency-code-property-id",gb="currency-symbol-property-id",bb="currency-rate-property-id",vb="currency-description-property-id",Ib="currency-rate-number-property-id",TM={type:i.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:i.Property,entityId:Rb},EM={like:!1,inferred:!1,id:"code-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["USD","GBP","EUR"],parent:TM},RM={type:i.GenericReference,id:"code-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},gM={constant:!1,hidden:!1,required:!0,type:i.Property,id:Rb,version:1,name:"code",description:null,defaultValue:null,dataType:EM,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:RM},bM={type:i.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:i.Property,entityId:gb},vM={like:!1,inferred:!1,id:"symbol-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["$","£","€"],parent:bM},IM={type:i.GenericReference,id:"symbol-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},DM={constant:!1,hidden:!1,required:!0,type:i.Property,id:gb,version:1,name:"symbol",description:null,index:0,defaultValue:null,dataType:vM,implements:null,static:!1,private:!1,abstract:!1,parent:IM},AM={type:i.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:i.Property,entityId:bb},SM={like:!1,inferred:!1,id:"rate-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:AM},OM={type:i.GenericReference,id:"rate-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},PM={constant:!1,hidden:!1,required:!0,type:i.Property,id:bb,version:1,name:"rate",description:null,index:0,defaultValue:null,dataType:SM,implements:null,static:!1,private:!1,abstract:!1,parent:OM},CM={type:i.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:i.Property,entityId:vb},wM={like:!1,inferred:!1,id:"description-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:CM},BM={type:i.GenericReference,id:"description-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},MM={constant:!1,hidden:!1,required:!0,type:i.Property,id:vb,version:1,name:"description",description:null,defaultValue:null,dataType:wM,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:BM},_M={type:i.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:i.Property,entityId:Ib},VM={like:!1,inferred:!1,id:"rate-number-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:_M},NM={type:i.GenericReference,id:"rate-number-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},LM={constant:!1,hidden:!1,required:!0,type:i.Property,id:Ib,version:1,name:"rate_float",description:null,defaultValue:null,dataType:VM,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:NM},GM={type:i.GenericReference,id:"currency-prototype-parent-ref-id",entityType:i.Project,entityId:H},so={type:i.DefinitionEntity,id:Ii,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[gM,DM,PM,MM,LM],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:GM},$M={type:i.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:i.Property,entityId:mb},FM={like:!1,inferred:!1,id:"usd-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:so,isList:!1,asType:!1,parent:$M},UM={type:i.GenericReference,id:"usd-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:ao},xM={constant:!1,hidden:!1,required:!0,id:mb,type:i.Property,version:1,name:"USD",description:null,index:0,dataType:FM,defaultValue:null,implements:null,static:!1,private:!1,abstract:!1,parent:UM},jM={type:i.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:i.Property,entityId:Tb},kM={like:!1,inferred:!1,id:"gbp-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:so,isList:!1,asType:!1,parent:jM},qM={type:i.GenericReference,id:"gbp-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:ao},JM={constant:!1,hidden:!1,required:!0,id:Tb,type:i.Property,version:1,name:"GBP",description:null,index:0,dataType:kM,defaultValue:null,implements:null,static:!1,private:!1,abstract:!1,parent:qM},WM={type:i.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:i.Property,entityId:Eb},YM={like:!1,inferred:!1,id:"eur-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:so,isList:!1,asType:!1,parent:WM},HM={type:i.GenericReference,id:"eur-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:ao},zM={constant:!1,hidden:!1,required:!0,id:Eb,type:i.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,defaultValue:null,dataType:YM,private:!1,abstract:!1,parent:HM},ZM={type:i.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:i.Project,entityId:H},Db={type:i.DefinitionEntity,id:ao,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[xM,JM,zM],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:ZM},KM={type:i.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:i.Property,entityId:pb},XM={like:!1,inferred:!1,id:"time-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ai,isList:!1,asType:!1,parent:KM},QM={type:i.GenericReference,id:"time-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Sa},e_={constant:!1,hidden:!1,required:!0,type:i.Property,id:pb,version:1,name:"time",description:null,index:0,defaultValue:null,dataType:XM,implements:null,static:!1,private:!1,abstract:!1,parent:QM},t_={type:i.GenericReference,id:"disclaimer-property-data-type-parent-ref-id",entityType:i.Property,entityId:yb},n_={like:!1,inferred:!1,id:"disclaimer-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:t_},r_={type:i.GenericReference,id:"disclaimer-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Sa},i_={constant:!1,hidden:!1,required:!0,type:i.Property,id:yb,version:1,name:"disclaimer",description:null,index:0,defaultValue:null,dataType:n_,implements:null,static:!1,private:!1,abstract:!1,parent:r_},a_={type:i.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:i.Property,entityId:hb},s_={like:!1,inferred:!1,id:"chart-name-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:a_},o_={type:i.GenericReference,id:"chart-name-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Sa},l_={constant:!1,hidden:!1,required:!0,type:i.Property,id:hb,version:1,name:"chartName",description:null,index:0,defaultValue:null,dataType:s_,implements:null,static:!1,private:!1,abstract:!1,parent:o_},d_={type:i.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:i.Property,entityId:fb},c_={like:!1,inferred:!1,id:"bpi-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Db,isList:!1,asType:!1,parent:d_},u_={type:i.GenericReference,id:"bpi-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Sa},p_={constant:!1,hidden:!1,required:!0,type:i.Property,id:fb,version:1,name:"bpi",description:null,implements:null,index:0,defaultValue:null,dataType:c_,static:!1,private:!1,abstract:!1,parent:u_},y_={type:i.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:i.Project,entityId:H},Ab={type:i.DefinitionEntity,id:Sa,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[e_,i_,l_,p_],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:y_},h_={type:i.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},f_={like:!1,inferred:!1,id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:h_},m_={type:i.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:i.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},T_={type:i.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:i.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},E_={like:!1,inferred:!1,id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:T_},R_={type:i.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Sb={constant:!0,isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",implements:null,defaultValue:null,dataType:E_,readsValue:R_,required:!0,index:0,parent:m_},g_={type:i.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},b_={constant:!0,id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:i.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,implements:null,defaultValue:null,dataType:f_,writesValues:[Sb],required:!0,index:0,parent:g_},v_={type:i.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},I_={type:i.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},D_={type:i.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},Ob={type:i.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[Sb],calledByError:[],calledByEntry:[I_],calledBySuccess:[],throws:null,x:0,y:0,parent:D_},A_={type:i.FunctionDeclaration,id:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4",version:1,name:"Change owner of company",description:"Change the owner of the company to a new person",inputs:[b_],calls:[Ob],index:0,collapsed:!1,implements:null,returnStatements:[Ob],private:!1,x:0,y:0,parent:v_},S_={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},O_={type:i.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},P_={type:i.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:i.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},C_={type:i.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},w_={type:i.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:i.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},B_={like:!1,inferred:!1,id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:An,asType:!1,isList:!1,parent:w_},Gd={constant:!0,isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:i.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",defaultValue:null,dataType:B_,implements:null,readsValue:C_,required:!0,index:0,parent:P_},M_={type:i.GenericReference,id:"gov-company-registry-return-statement-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},$d={type:i.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[Gd],calledByError:[],calledByEntry:[],calledBySuccess:[S_,M_],throws:null,x:0,y:0,parent:O_},__={type:i.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},V_={type:i.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},Pb={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:kl,name:null,description:null,readsValue:V_,defaultValue:null,parent:__,index:2},N_={type:i.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},L_={like:!1,inferred:!1,id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:An,isList:!1,asType:!1,parent:N_},G_={type:i.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},$_={type:i.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:i.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},F_={type:i.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:i.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},Cb={constant:!0,required:!0,type:i.VariableDeclaration,id:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a",version:1,name:"Is name registered",description:"Whether the company name is registered with the government company registry",defaultValue:null,dataType:L_,readsValue:$_,writesValues:[Gd],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[F_],successCalls:[$d],errorCalls:[],internalCalls:[],x:0,y:0,parent:G_},U_={type:i.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:i.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},x_={type:i.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},j_={type:i.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:fs,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:i.LiteralValue,version:1,value:"https://api.publicapis.org/entries",name:C.String,valueAsType:null,parent:U_,autogeneration:null},index:1,parent:x_},k_={type:i.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},q_={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:i.OutputMap,version:1,defaultValue:null,declaration:gs,index:2,writesValues:[Cb],parent:k_},J_={type:i.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},W_={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:i.InputMap,version:1,declaration:hs,name:null,description:null,readsValue:null,index:0,defaultValue:null,parent:J_},Y_={type:i.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},H_={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:i.InputMap,version:1,name:null,description:null,declaration:ms,index:3,readsValue:null,defaultValue:null,parent:Y_},z_={type:i.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},Z_={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:i.InputMap,version:1,declaration:Ts,name:null,description:null,readsValue:null,index:4,defaultValue:null,parent:z_},K_={type:i.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},X_={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:i.OutputMap,version:1,defaultValue:null,declaration:Rs,index:1,writesValues:[],parent:K_},Q_={type:i.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},eV={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:i.OutputMap,version:1,defaultValue:null,declaration:Es,index:0,writesValues:[],parent:Q_},tV={type:i.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},nV={type:i.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},rV={type:i.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},iV={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},aV={type:i.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:i.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},sV={like:!1,inferred:!1,id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,asType:!1,isList:!1,parent:aV},oV={type:i.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:i.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},wb={constant:!0,isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:i.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:sV,defaultValue:null,implements:null,required:!0,readsValue:null,index:0,parent:oV},Bb={type:i.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[iV],calledByEntry:[],calledBySuccess:[],throws:wb,x:0,y:0,parent:rV},lV={type:i.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},dV={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:i.OutputMap,declaration:ql,defaultValue:null,version:1,writesValues:[wb],index:0,parentRelationType:ri.Error,parent:lV},cV={type:i.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Xi,inputs:[W_,j_,Pb,H_,Z_],outputs:[eV,X_,q_],process:null,calledByError:[],calledByEntry:[tV],calledBySuccess:[],successCalls:[$d,Cb],errorCalls:[Bb],error:dV,x:0,y:0,parent:nV},uV={type:i.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:i.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},pV={type:i.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},yV={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:us,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:i.LiteralValue,version:1,value:"?name=",name:C.String,parent:uV,valueAsType:null,autogeneration:null},index:0,parent:pV},hV={type:i.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},fV={type:i.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},mV={type:i.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},TV={like:!1,inferred:!1,id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:mV},EV={type:i.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:i.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},RV={type:i.GenericReference,id:"assembled-query-string-called-by-ref",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Mb={constant:!0,required:!0,type:i.VariableDeclaration,id:"83e12ebb-c958-4dee-b750-8ab9930f0f4e",version:1,name:"Query string",description:"The final, assembled query string that will be used in the HTTP request to the government company registry",defaultValue:null,dataType:TV,readsValue:EV,writesValues:[Pb],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[RV],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:fV},gV={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:i.OutputMap,version:1,defaultValue:null,writesValues:[Mb],declaration:Zi,index:0,parent:hV},bV={type:i.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},vV={type:i.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},IV={type:i.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:i.ArgumentDeclaration},DV={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},_b={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:i.InputMap,declaration:ps,name:null,description:null,readsValue:IV,defaultValue:null,index:1,parent:DV},AV={type:i.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:Ki,version:1,inputs:[_b,yV],outputs:[gV],process:null,calledByError:[],calledByEntry:[bV],calledBySuccess:[],successCalls:[Mb],errorCalls:[],error:null,x:0,y:0,parent:vV},SV={type:i.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:i.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},OV={like:!1,inferred:!1,id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:SV},PV={type:i.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},Vb={constant:!0,id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:i.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:OV,defaultValue:null,implements:null,required:!1,writesValues:[_b],index:0,parent:PV},CV={type:i.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:i.Project,entityId:H},Nb={type:i.FunctionDeclaration,id:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d",version:1,name:"Check Gov Company Registry availability",description:"Check whether the company name is already registered in the government company registry, or it is available for a new company to use.",inputs:[Vb],calls:[AV,cV],returnStatements:[$d,Bb],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:CV},wV={type:i.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},BV={type:i.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},MV={type:i.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},_V={type:i.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Lb={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:i.InputMap,declaration:Vb,name:null,description:null,readsValue:MV,defaultValue:null,index:0,parent:_V},VV={type:i.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},NV={type:i.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:i.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},LV={like:!1,inferred:!1,id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:An,asType:!1,isList:!1,parent:NV},GV={type:i.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:i.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},$V={type:i.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},FV={type:i.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Gb={constant:!0,required:!0,type:i.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",defaultValue:null,dataType:LV,readsValue:GV,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[FV],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:$V},UV={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.OutputMap,version:1,declaration:Gd,defaultValue:null,writesValues:[Gb],index:0,parent:VV},xV={type:i.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:Nb,inputs:[Lb],outputs:[UV],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[wV],successCalls:[Gb],errorCalls:[],error:null,x:0,y:0,parent:BV},jV={type:i.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},kV={type:i.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},qV={type:i.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},JV={type:i.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},$b={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:i.InputMap,declaration:Rr.inputs[0],name:null,description:null,readsValue:qV,defaultValue:null,index:0,parent:JV},WV={type:i.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:Rr,inputs:[$b],calledByError:[],calledByEntry:[jV],calledBySuccess:[],successCalls:[xV],errorCalls:[],x:0,y:0,parent:kV},YV={type:i.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},HV={type:i.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:i.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},zV={like:!1,inferred:!1,id:"d64152ea-831f-4426-9506-a39bfa170513",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vi,asType:!1,isList:!1,parent:HV},ZV={type:i.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},KV={type:i.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},XV={type:i.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},Fb={constant:!0,required:!0,type:i.VariableDeclaration,id:"9c928995-0dd5-4f97-9962-56b343bc8a45",version:1,name:"New bank account",description:"The new entity value representing the new bank account of the company",defaultValue:null,dataType:zV,readsValue:KV,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[XV],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:ZV},QV={type:i.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},eN={like:!1,inferred:!1,id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vi,asType:!1,isList:!1,parent:QV},tN={constant:!0,id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:i.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:eN,implements:null,defaultValue:null,required:!0,index:1,writesValues:[Fb],parent:YV},nN={type:i.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},rN={type:i.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},iN={type:i.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},aN={like:!1,inferred:!1,id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:iN},sN={constant:!0,id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:i.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:aN,implements:null,defaultValue:null,required:!0,index:0,writesValues:[$b,Lb],parent:rN},oN={type:i.FunctionDeclaration,id:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84",version:1,name:"Company changed event",description:"The event that is triggered when a company is changed",returnStatements:[],collapsed:!1,inputs:[sN,tN],calls:[WV,Fb],index:1,private:!1,implements:null,x:0,y:0,parent:nN},lN={type:i.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},dN={type:i.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-manager-property-id"},cN={like:!1,inferred:!1,id:"employee-manager-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lN,isList:!1,asType:!1,parent:dN},uN={type:i.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},pN={constant:!1,required:!0,hidden:!1,type:i.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,defaultValue:null,dataType:cN,abstract:!1,parent:uN},yN={type:i.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-start-date-property-id"},hN={like:!1,inferred:!1,id:"employee-start-date-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:on,isList:!1,asType:!1,parent:yN},fN={type:i.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},mN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"employee-start-date-property-id",version:1,name:"Start date",description:"The date the employee started working in the company",index:0,private:!1,static:!1,defaultValue:null,implements:null,dataType:hN,abstract:!1,parent:fN},TN={type:i.GenericReference,id:"employee-department-property-ref-id",entityType:i.Property,entityId:"employee-department-property-id"},EN={like:!1,inferred:!1,id:"employee-department-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],parent:TN},RN={type:i.GenericReference,id:"employee-department-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},gN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"employee-department-property-id",version:1,name:"Department",description:"The department the employee works in, from a list of departments in the company",index:0,defaultValue:null,implements:null,static:!1,private:!1,dataType:EN,abstract:!1,parent:RN},bN={type:i.GenericReference,id:"employee-prototype-parent-ref-id",entityType:i.Project,entityId:H},Yt={type:i.DefinitionEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[gN,mN,pN],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[bt],x:0,y:0,parent:bN},vN={type:i.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:i.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},IN={like:!1,inferred:!1,id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:vN},DN={type:i.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},AN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,defaultValue:null,implements:null,dataType:IN,abstract:!1,parent:DN},SN={type:i.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:i.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},ON={like:!1,inferred:!1,id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vi,isList:!1,asType:!1,parent:SN},PN={type:i.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},Fd={constant:!1,hidden:!1,required:!0,type:i.Property,id:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",version:1,name:"Bank account",description:"The bank account of the company",index:1,implements:null,static:!1,private:!1,defaultValue:null,dataType:ON,abstract:!1,parent:PN},CN={type:i.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:i.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},wN={like:!1,inferred:!1,id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:CN},BN={type:i.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},MN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"19a31727-1fba-40a5-be25-18e0f149d5cb",version:1,name:"Company Owner",description:"The person that owns the company",index:2,static:!1,implements:null,defaultValue:null,dataType:wN,private:!0,abstract:!1,parent:BN},_N={type:i.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:i.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},VN={like:!1,inferred:!1,id:"ad44250b-40c2-48f7-a480-381fa938f562",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,isList:!0,asType:!1,parent:_N},NN={type:i.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},LN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,defaultValue:null,dataType:VN,implements:null,private:!0,static:!1,abstract:!1,parent:NN},GN={id:"company-prototype-primary-key-property-data-type-ref-id",type:i.GenericReference,entityId:"company-prototype-primary-key-property-id",entityType:i.Property},$N={id:"company-prototype-primary-key-property-ref-id",type:i.GenericReference,entityId:"company-prototype-primary-key-property-id",entityType:i.Property},FN={like:!1,inferred:!1,id:"company-prototype-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:$N},UN={id:"company-prototype-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",entityType:i.DefinitionEntity},xN={constant:!1,hidden:!1,required:!0,id:"company-prototype-primary-key-property-id",name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:pi,static:!1,index:4,defaultValue:{id:"company-prototype-primary-key-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.UUID,value:null,parent:GN,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:FN,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:UN},jN={type:i.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:i.Project,entityId:H},Ht={type:i.DefinitionEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[AN,Fd,MN,LN,xN],static:!1,abstract:!1,abstractMethods:[],methods:[A_,oN],extends:[],implements:[st,Ft],x:0,y:0,parent:jN},kN={type:i.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:i.Project,entityId:H},Ud={type:i.FunctionDeclaration,id:"0f89260c-8c58-4639-8629-d9ea5ab40ba7",version:1,name:"Show popup",description:null,inputs:[],calls:[],returnStatements:[],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:kN};i.GenericReference,i.DataType;const qN={id:"cron-job-entity-expression-property-ref-id",type:i.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:i.Property},JN={like:!1,inferred:!1,id:"cron-job-entity-expression-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:qN},WN={id:"cron-job-entity-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.DefinitionEntity},YN={constant:!1,hidden:!1,required:!0,id:"cron-job-entity-expression-property-id",type:i.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",defaultValue:null,dataType:JN,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:WN},HN={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:i.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:i.FunctionDeclaration},zN={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:i.FunctionDeclaration},ZN={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:i.FunctionCall,declaration:Ud,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[HN],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:zN},KN={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.DefinitionEntity},XN={id:"cron-job-entity-trigger-func-decl-id",version:1,type:i.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:yd,calls:[ZN],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:KN},QN={id:"cron-job-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},eL={id:"cron-job-entity-id",version:1,type:i.DefinitionEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[YN],static:!0,abstract:!1,abstractMethods:[],extends:[ws],implements:[],methods:[XN],x:0,y:0,parent:QN},tL={type:i.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:i.Project,entityId:H},nL={type:i.DefinitionEntity,id:"6f0908c2-09c6-4a8b-8f43-d2467fe6fb39",version:1,name:"Get bank all bank accounts",description:null,properties:[],static:!0,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[ia],x:0,y:0,parent:tL},oo="f558fbf8-67de-4545-9804-6ae621e0b2d4",rL={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},iL={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},aL={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:J,asType:!1,parent:iL},sL={id:"getCompanyByIdEndpointReachedEntityEventRef",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},oL={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},lL={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},dL={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:lL},cL={constant:!0,id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request headers",defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:oL,autogeneration:null,valueAsType:null},dataType:dL,implements:nd,required:!0,index:0,parent:sL},uL={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},pL={constant:!0,id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:i.ArgumentDeclaration,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",writesValues:[],defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:rL,autogeneration:null,valueAsType:null},dataType:aL,implements:rd,required:!0,index:1,parent:uL},yL={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},hL={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},fL={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},mL={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,asType:!1,entity:J,parent:fL},TL={constant:!0,id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ArgumentDeclaration,writesValues:[],name:"Request query params",defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:hL,autogeneration:null,valueAsType:null},dataType:mL,implements:id,required:!0,index:2,parent:yL},EL={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},RL={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},gL={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:RL},bL={constant:!0,id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request body",defaultValue:null,dataType:gL,implements:ad,index:3,required:!0,parent:EL},vL={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},IL={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:vL},DL={id:"getCompanyByIdEndpointReturnStatementRef",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},AL={constant:!0,isError:!1,id:"getCompanyByIdEndpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ReturnDeclaration,name:"Response code",defaultValue:null,dataType:IL,implements:sd,readsValue:null,required:!0,index:0,parent:DL},SL={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},OL={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},PL={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:OL},CL={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},wL={constant:!0,isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ReturnDeclaration,name:"Response headers",defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:SL,autogeneration:null,valueAsType:null},dataType:PL,implements:od,readsValue:null,required:!0,index:1,parent:CL},BL={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},ML={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:BL},_L={id:"getCompanyByIdEndpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},VL={constant:!0,isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ReturnDeclaration,name:"Response body",implements:ld,defaultValue:null,dataType:ML,readsValue:null,required:!0,index:2,parent:_L},NL={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:i.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:i.FunctionDeclaration},LL={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},GL={id:"getCompanyByIdEndpointReturnStatement",type:i.ReturnStatement,version:1,outputs:[AL,wL,VL],calledByError:[],calledByEntry:[NL],calledBySuccess:[],throws:null,x:0,y:0,parent:LL},$L={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:oo},FL={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:i.FunctionDeclaration,inputs:[cL,pL,TL,bL],returnStatements:[GL],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:dd,index:0,private:!1,x:0,y:0,parent:$L},UL={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointPathProperty"},xL={id:"getCompanyByIdEndpointPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointPathProperty"},jL={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:xL},kL={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:i.GenericReference,entityType:i.DefinitionEntity,entityId:oo},qL={constant:!1,id:"getCompanyByIdEndpointPathProperty",hidden:!1,required:!0,name:"Path",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:ed,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.String,value:"/company/{id}",parent:UL,valueAsType:null,autogeneration:null},dataType:jL,index:1,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:kL},JL={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointMethodProperty"},WL={id:"getCompanyByIdEndpointMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointMethodProperty"},YL={like:!1,inferred:!1,id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Sn,isList:!0,asType:!1,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:WL},HL={id:"getCompanyByIdEndpointBaseEntityRefThree",type:i.GenericReference,entityType:i.DefinitionEntity,entityId:oo},zL={constant:!1,hidden:!1,required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:td,index:0,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,value:"GET",name:C.Enum,parent:JL,valueAsType:null,autogeneration:null},dataType:YL,description:null,parent:HL},ZL={type:i.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:i.Project,entityId:H},KL={type:i.DefinitionEntity,id:oo,version:1,name:"Get given company data by id",description:null,properties:[qL,zL],methods:[FL],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[ia],x:0,y:0,parent:ZL},XL={id:"plant-prototype-database-property-ref-id",type:i.GenericReference,entityId:"plant-prototype-database-property-id",entityType:i.Property},QL={id:"plant-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"plant-prototype-database-property-id",entityType:i.Property},e0={like:!1,inferred:!1,id:"plant-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:XL},t0={id:"plant-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"plant-entity-id",entityType:i.DefinitionEntity},n0={constant:!1,hidden:!1,required:!0,id:"plant-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"plant-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:_d,autogeneration:null,parent:QL},dataType:e0,description:"The database that the entity belongs to.",parent:t0},r0={type:i.GenericReference,id:"plant-name-property-ref-id",entityType:i.Property,entityId:"plant-name-property-id"},i0={like:!1,inferred:!1,id:"plant-name-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:r0},a0={type:i.GenericReference,id:"animal-name-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"plant-entity-id"},s0={constant:!1,hidden:!1,required:!0,type:i.Property,id:"plant-name-property-id",version:1,name:"Name",description:"The name of the plant",defaultValue:null,implements:null,static:!1,private:!1,index:0,dataType:i0,abstract:!1,parent:a0},o0={type:i.GenericReference,id:"plant-prototype-parent-ref-id",entityType:i.Project,entityId:H},l0={type:i.DefinitionEntity,id:"plant-entity-id",version:1,name:"Plant",description:"A living creature that is not an animal",abstract:!1,static:!1,abstractMethods:[],properties:[n0,s0],methods:[],extends:[],implements:[st],x:0,y:0,parent:o0},d0={id:"product-prototype-database-property-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-id",entityType:i.Property},c0={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-id",entityType:i.Property},u0={like:!1,inferred:!1,id:"product-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:d0},p0={id:"product-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",entityType:i.DefinitionEntity},y0={constant:!1,hidden:!1,required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:Vd,autogeneration:null,parent:c0},dataType:u0,description:"The database that the entity belongs to.",parent:p0},h0={type:i.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:i.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},f0={like:!1,inferred:!1,id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:h0},m0={type:i.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:i.DefinitionEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},T0={constant:!1,hidden:!1,required:!0,type:i.Property,id:"d519c26a-15b8-40d8-ad09-13fa9342e9ba",version:1,name:"Name",description:"The name of the product",index:0,implements:null,static:!1,private:!1,defaultValue:null,dataType:f0,abstract:!1,parent:m0},E0={type:i.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:i.Project,entityId:H},R0={id:"product-prototype-primary-key-property-data-type-ref-id",type:i.GenericReference,entityId:"product-prototype-primary-key-property-id",entityType:i.Property},g0={id:"product-prototype-primary-key-property-ref-id",type:i.GenericReference,entityId:"product-prototype-primary-key-property-id",entityType:i.Property},b0={like:!1,inferred:!1,id:"product-prototype-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:g0},v0={id:"product-prototype-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",entityType:i.DefinitionEntity},I0={constant:!1,hidden:!1,required:!0,id:"product-prototype-primary-key-property-id",name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,defaultValue:{id:"product-prototype-primary-key-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.UUID,value:null,parent:R0,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:b0,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:v0},D0={type:i.DefinitionEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[st,Ft],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[I0,y0,T0],methods:[],x:0,y:0,parent:E0},Di="project-loaded-event-id",Mn="get-bitcoin-price-http-call-operation-id",Ub="get-bitcoin-price-http-call-response-body-id",lo="validate-bitcoin-price-response-operation-ids",A0={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Ub},S0={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:i.Operation,entityId:lo},xb={id:"validate-bitcoin-data-to-validate-input-map-id",type:i.InputMap,version:1,declaration:hr.inputs[1],name:null,description:null,readsValue:A0,defaultValue:null,index:0,parent:S0},O0={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},P0={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:i.Operation,entityId:lo},C0={id:"validate-bitcoin-type-to-match-input-map-id",type:i.InputMap,version:1,declaration:hr.inputs[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:i.LiteralValue,version:1,name:C.EntityTemplate,valueAsType:Ab,value:null,parent:O0,autogeneration:null},index:0,parent:P0},w0={type:i.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:i.Operation,entityId:lo},B0={id:"validate-bitcoin-validated-entity-output-map-id",type:i.OutputMap,version:1,defaultValue:null,declaration:hr.outputs[0],writesValues:[],index:0,parent:w0},M0={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:i.GlobalEvent,entityId:Di},_0={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:i.Operation,entityId:Mn},V0={type:i.Operation,id:lo,version:1,declaration:hr,inputs:[C0,xb],outputs:[B0],process:null,successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[_0],parent:M0},N0={type:i.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:i.FunctionCall,entityId:Mn},L0={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:i.InputMap,declaration:hs,name:null,description:null,readsValue:null,defaultValue:null,index:0,parent:N0},G0={type:i.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:i.FunctionCall,entityId:Mn},$0={type:i.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:i.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},F0={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:i.InputMap,declaration:fs,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:i.LiteralValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:C.String,parent:$0,valueAsType:null,autogeneration:null},index:1,parent:G0},U0={type:i.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:i.FunctionCall,entityId:Mn},x0={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:i.InputMap,declaration:ms,name:null,description:null,readsValue:null,defaultValue:null,index:2,parent:U0},j0={type:i.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:i.FunctionCall,entityId:Mn},k0={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:i.InputMap,declaration:Ts,name:null,description:null,readsValue:null,defaultValue:null,index:3,parent:j0},q0={type:i.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:i.FunctionCall,entityId:Mn},J0={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:i.OutputMap,defaultValue:null,declaration:Rs,writesValues:[],index:1,parent:q0},W0={type:i.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:i.FunctionCall,entityId:Mn},Y0={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:i.OutputMap,defaultValue:null,declaration:Es,writesValues:[],index:0,parent:W0},H0={type:i.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:i.FunctionCall,entityId:Mn},z0={id:Ub,type:i.OutputMap,defaultValue:null,version:1,declaration:gs,writesValues:[xb],index:2,parent:H0},Z0={type:i.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:i.GlobalEvent,entityId:Di},K0={type:i.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:i.GlobalEvent,entityId:Di},X0={type:i.Operation,id:Mn,version:1,declaration:Xi,inputs:[L0,F0,x0,k0],outputs:[Y0,J0,z0],process:null,parent:K0,calledByError:[],calledByEntry:[Z0],calledBySuccess:[],successCalls:[V0],errorCalls:[],error:null,x:0,y:0},Q0={type:i.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:i.GlobalEvent,entityId:Di},e1={type:i.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:i.GlobalEvent,entityId:Di},t1={process:null,type:i.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:Ud,inputs:[],outputs:[],calledByError:[],calledByEntry:[Q0],calledBySuccess:[],parent:e1,successCalls:[],errorCalls:[],error:null,x:0,y:0},n1={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:i.GenericReference,entityType:i.Project,entityId:H},r1={type:i.GlobalEvent,id:Di,version:1,name:In.PROJECT_PUBLICATION_COMPLETED,description:null,returnStatements:[],collapsed:!1,implements:Ms,parent:n1,inputs:[],calls:[t1,X0],x:0,y:0},Ut="abort-execution-func-declaration-id",Oa="abort-execution-func-exec-var-declaration-id",xd="abort-execution-func-small-wait-op-id",jd="abort-execution-func-long-wait-op-id",jb="abort-execution-func-long-wait-process-output-id",kb="abort-execution-func-exec-var-instance-write-id",qb="abort-execution-func-long-wait-return-stmt-id",Jb="abort-execution-func-small-wait-return-stmt-id",i1="abort-execution-func-exec-var-instance-abort-call-id",kd="abort-execution-func-exec-var-instance-abort-internal-call-id",qd="abort-execution-func-exec-second-wait-op-id",a1={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},s1={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},o1={like:!1,inferred:!1,id:"short-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:a1},l1={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:Jb},d1={constant:!0,isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 1",description:"A random string that is returned by the function",defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:s1},dataType:o1,implements:null,readsValue:null,required:!0,index:0,parent:l1},c1={type:i.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:qd},u1={type:i.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},Wb={type:i.ReturnStatement,id:Jb,version:1,outputs:[d1],calledByError:[],calledByEntry:[],calledBySuccess:[c1],throws:null,x:0,y:0,parent:u1},p1={type:i.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"second-wait-argument-map-id"},y1={type:i.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:qd},h1={id:"second-wait-argument-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:i.LiteralValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:C.Number,parent:p1},index:0,parent:y1},f1={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},m1={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.InternalCall,entityId:kd},T1={id:qd,type:i.Operation,version:1,declaration:Rt,inputs:[h1],outputs:[],process:null,successCalls:[Wb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[m1],error:null,parent:f1},E1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:i.VariableInstance,entityId:kb},R1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:i.Operation,entityId:xd},g1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},b1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id-2",entityType:i.VariableDeclaration,entityId:Oa},v1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:i.InternalCall,entityId:kd},I1={id:i1,type:i.VariableInstance,version:1,declaration:b1,defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[v1],parent:g1},Yb={id:kd,type:i.InternalCall,version:1,inputs:[],outputs:[],declaration:hd,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[E1,R1],successCalls:[T1],errorCalls:[],error:null,index:0,parent:I1},D1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},A1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:Oa},S1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:i.FunctionDeclaration,entityId:Ut},O1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Oa},P1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:i.OutputMap,entityId:jb},Jd={id:kb,type:i.VariableInstance,version:1,declaration:O1,inputs:[],outputs:[],defaultValue:null,calledByError:[],calledByEntry:[S1],calledBySuccess:[A1],successCalls:[Yb],errorCalls:[],x:0,y:0,readsValue:P1,writesValues:[],internalCalls:[],parent:D1},C1={type:i.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:Oa};i.GenericReference,i.DataType;const w1={like:!1,inferred:!1,id:"abort-exec-func-var-decl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Bs,version:1,asType:!1,isList:!1,parent:C1},B1={type:i.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},M1={type:i.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Ut},_1={constant:!0,required:!0,id:Oa,type:i.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",defaultValue:null,dataType:w1,inputs:[],outputs:[],calledByError:[],calledByEntry:[M1],calledBySuccess:[],successCalls:[Jd],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:B1},V1={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},N1={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},L1={like:!1,inferred:!1,id:"long-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:V1},G1={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:qb},$1={constant:!0,isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 2",description:"A random string that is returned by the function",implements:null,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:N1},dataType:L1,readsValue:null,required:!0,index:0,parent:G1},F1={type:i.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:jd},U1={type:i.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},Hb={type:i.ReturnStatement,id:qb,version:1,outputs:[$1],calledByError:[],calledByEntry:[],calledBySuccess:[F1],throws:null,x:0,y:0,parent:U1},x1={type:i.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"long-argument-map-id"},zb={type:i.GenericReference,id:"long-argument-map-parent-ref-id",entityType:i.Operation,entityId:jd},j1={id:"long-argument-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:i.LiteralValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:C.Number,parent:x1},index:0,parent:zb},k1={type:i.GenericReference,id:"long-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},q1={type:i.GenericReference,id:"long-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Ut},J1={id:jb,type:i.OutputMap,version:1,defaultValue:null,declaration:aa,writesValues:[Jd],index:0,parent:zb},W1={id:jd,type:i.Operation,version:1,declaration:Rt,inputs:[j1],outputs:[],process:J1,successCalls:[Hb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[q1],calledBySuccess:[],error:null,parent:k1},Y1={type:i.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"small-wait-argument-map-id"},H1={type:i.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:xd},z1={id:"small-wait-argument-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:i.LiteralValue,version:1,value:500,valueAsType:null,autogeneration:null,name:C.Number,parent:Y1},index:0,parent:H1},Z1={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},K1={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Ut},X1={id:xd,type:i.Operation,version:1,declaration:Rt,inputs:[z1],outputs:[],process:null,successCalls:[Yb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[K1],calledBySuccess:[],error:null,parent:Z1},Q1={type:i.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:i.Project,entityId:H},Zb={id:Ut,type:i.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[Hb,Wb],calls:[X1,_1,Jd,W1],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:Q1},eG={type:i.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:i.Project,entityId:H},tG={id:"call-execution-abort-func-id",type:i.FunctionCall,version:1,declaration:Zb,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:eG},co="manual-hello-world-loop-func-decl-id",Kb="manual-hello-world-loop-func-return-statement-id",hn="manual-hello-world-loop-id",Pa="manual-hello-world-loop-body-id",Wd="manual-hello-world-loop-break-statement-id",Ca="manual-hello-world-loop-current-iteration-number-output-map-id",Yd="manual-hello-world-loop-previous-iterations-results-output-map-id",Hd="assembled-hello-world-text-output-id",nG="assembled-hello-world-list-output-id",wa="iteration-number-is-equal-or-greater-than-10-condition-id",uo="join-hello-world-and-number-operation-id",po="append-string-to-list-operation-id",Xb="hello-world-loop-output-map-id",rG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:i.ReturnStatement,entityId:Kb},iG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:i.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},aG={like:!1,inferred:!1,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!0,asType:!1,parent:iG},sG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:i.OutputMap,entityId:Xb},Qb={constant:!0,isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:i.ReturnDeclaration,name:"Results",description:null,defaultValue:null,dataType:aG,implements:null,readsValue:sG,required:!0,index:0,parent:rG},oG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:i.Loop,entityId:hn},lG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:i.FunctionDeclaration,entityId:co},ev={type:i.ReturnStatement,id:Kb,version:1,outputs:[Qb],calledByError:[],calledByEntry:[],calledBySuccess:[oG],parent:lG,throws:null,x:0,y:0},dG={type:i.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:i.BreakStatement,entityId:Wd},tv={constant:!0,isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,defaultValue:null,dataType:null,readsValue:null,implements:null,required:!0,index:0,parent:dG},cG={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Ca},uG={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-ref-id",entityType:i.BreakStatement,entityId:Wd},nv={constant:!0,isError:!1,id:"hello-world-loop-break-statement-counter-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration counter",description:null,implements:null,defaultValue:null,dataType:null,readsValue:cG,required:!0,index:1,parent:uG},pG={type:i.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:i.Condition,entityId:wa},yG={type:i.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:i.Loop,entityId:hn},rv={type:i.BreakStatement,id:Wd,version:1,outputs:[tv,nv],calledByError:[],calledByEntry:[],calledBySuccess:[pG],parent:yG,throws:null,x:0,y:0},hG={type:i.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:i.ContinueStatement,entityId:"hello-world-loop-continue-statement"},fG={type:i.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:i.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},mG={like:!1,inferred:!1,id:"hello-world-loop-continue-statement-output-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:fG},TG={type:i.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:i.OutputMap,entityId:Hd},iv={constant:!0,isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,defaultValue:null,implements:null,dataType:mG,readsValue:TG,required:!0,index:0,parent:hG},EG={type:i.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:i.Condition,entityId:wa},RG={type:i.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:i.Loop,entityId:hn},av={type:i.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[iv],calledBySuccess:[],calledByError:[EG],calledByEntry:[],parent:RG,throws:null,x:0,y:0};i.GenericReference,i.InputMap;const gG={type:i.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:i.Operation,entityId:po},bG={type:i.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Yd},sv={id:"append-string-to-list-base-string-map-id",type:i.InputMap,version:1,declaration:Gl,name:null,description:null,readsValue:bG,defaultValue:null,index:0,parent:gG},vG={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:po},IG={id:nG,type:i.OutputMap,version:1,defaultValue:null,writesValues:[tv],declaration:Zi,index:0,parent:vG},DG={type:i.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:i.Condition,entityId:wa},AG={type:i.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Hd},SG={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:po},ov={id:"latest-string-to-add-input-map-id",version:1,type:i.InputMap,declaration:$l,name:null,description:null,readsValue:AG,defaultValue:null,index:1,parent:SG},OG={type:i.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:i.FunctionDeclaration,entityId:hn},PG={type:i.Operation,id:po,declaration:ys,version:1,inputs:[sv,ov],outputs:[IG],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[DG],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:OG},CG={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:Pa},wG={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:i.Loop,entityId:hn},BG={type:i.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Ca},lv={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:i.Condition,entityId:wa},MG={id:"current-iteration-number-to-check-map-id",version:1,type:i.InputMap,declaration:hi.inputs[0],name:null,description:null,readsValue:BG,index:0,defaultValue:null,parent:lv},_G={type:i.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"max-num-iterations-value-map-id"},VG={id:"max-num-iterations-value-map-id",version:1,type:i.InputMap,declaration:hi.inputs[1],name:null,description:null,readsValue:null,index:1,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:10,autogeneration:null,valueAsType:null,parent:_G},parent:lv},NG={type:i.Condition,id:wa,version:1,declaration:hi,inputs:[MG,VG],calledByError:[],calledByEntry:[CG],calledBySuccess:[],successCalls:[rv,PG],errorCalls:[av],x:0,y:0,parent:wG},LG={type:i.GenericReference,id:"base-string-map-ref-id",entityType:i.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},GG={type:i.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:i.Operation,entityId:uo},$G={id:"join-hello-world-and-number-base-string-map-id",type:i.InputMap,version:1,declaration:us,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:i.LiteralValue,version:1,value:"Hello world ",name:C.String,parent:LG,valueAsType:null,autogeneration:null},index:0,parent:GG},FG={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:uo},UG={id:Hd,type:i.OutputMap,version:1,defaultValue:null,writesValues:[ov,iv],declaration:Zi,index:0,parent:FG},xG={type:i.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:Pa},jG={type:i.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Ca},kG={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:uo},dv={id:"current-iteration-number-input-map-id",version:1,type:i.InputMap,declaration:ps,name:null,description:null,readsValue:jG,defaultValue:null,index:1,parent:kG},qG={type:i.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:i.FunctionDeclaration,entityId:hn},JG={type:i.Operation,id:uo,declaration:Ki,version:1,inputs:[$G,dv],outputs:[UG],process:null,calledByError:[],calledByEntry:[xG],calledBySuccess:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:qG},WG={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:Yd,entityType:i.ArgumentDeclaration},YG={like:!1,inferred:!1,id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,entity:null,asType:!1,parent:WG},HG={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:i.GenericReference,entityId:Pa,entityType:i.FunctionDeclaration},zG={constant:!0,id:Yd,type:i.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,defaultValue:null,dataType:YG,implements:null,writesValues:[sv],index:1,parent:HG},ZG={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:i.GenericReference,entityId:Pa,entityType:i.FunctionDeclaration},KG={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:Ca,entityType:i.ArgumentDeclaration};i.DataType;const XG={constant:!0,id:Ca,type:i.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,implements:Jl,defaultValue:null,dataType:null,writesValues:[dv,nv],index:0,parent:ZG},QG={id:"manual-flow-loop-body-parent-ref-id",type:i.GenericReference,entityId:hn,entityType:i.Loop},e$={id:Pa,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[XG,zG],calls:[NG,JG],implements:vs,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:QG},t$={type:i.GenericReference,id:"hello-world-loop-iteration-result-inline-output-declaration-parent-ref-id",entityType:i.Loop,entityId:hn},cv={id:"hello-world-loop-iteration-result-inline-output-declaration-id",version:1,type:i.ValueDescriptor,name:"Iteration result",defaultValue:null,description:null,dataType:null,required:!0,parentRelationType:P.FixedReturns,index:0,parent:t$},n$={type:i.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:i.Loop,entityId:hn},r$={type:i.OutputMap,id:Xb,version:1,defaultValue:null,declaration:cv,writesValues:[Qb],index:0,parent:n$},i$={id:"manual-hello-world-loop-parent-ref-id",type:i.GenericReference,entityId:co,entityType:i.FunctionDeclaration},a$={id:"manual-hello-world-loop-called-by-ref-id",type:i.GenericReference,entityId:co,entityType:i.FunctionDeclaration},s$={id:hn,type:i.Loop,version:1,declaration:bs,inputs:[],outputsDeclarations:[cv],outputs:[r$],body:e$,successCalls:[ev],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[a$],calledBySuccess:[],breakStatements:[rv],continueStatements:[av],x:0,y:0,parent:i$},o$={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},uv={type:i.FunctionDeclaration,id:co,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[s$],returnStatements:[ev],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:o$},l$={type:i.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:i.Project,entityId:H},d$={id:"call-hello-world-loop-id",type:i.FunctionCall,version:1,declaration:uv,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:l$},_n="company-dto-function-declaration-id",zd="company-dto-func-declaration-argument-dcl-id",fn="company-dto-function-company-variable-id",tr="company-dto-function-company-dto-variable-id",Ai="iterate-over-employee-list-loop-id",pv="iterate-over-employee-list-loop-employee-dto-output-map-id",Zd="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",yo="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",yv="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",hv="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",fv="iterate-over-employee-list-continue-statement-id",ho="iterate-over-employee-list-loop-body-id",mv="company-dto-func-declaration-return-statement-id",Tv="company-dto-func-declaration-return-decl-id",Ev="company-dto-func-declaration-company-variable-id-output-map-id",Rv="company-dto-func-declaration-company-variable-employess-output-map-id",gv="company-dto-func-declaration-company-variable-name-output-map-id",c$="company-dto-func-declaration-company-dto-variable-input-map-id",u$="company-dto-func-declaration-company-dto-variable-employess-input-map-id",p$="company-dto-func-declaration-company-dto-variable-name-input-map-id",fo="company-dto-func-declaration-owner-variable-id",y$="company-dto-func-declaration-company-dto-variable-owner-input-map-id",bv="company-dto-func-declaration-company-variable-owner-output-map-id",vv="company-dto-func-declaration-owner-variable-id-output-map-id",mo="company-dto-func-declaration-bank-account-variable-id",h$="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",Iv="company-dto-func-declaration-company-variable-bank-account-output-map-id",Dv="company-dto-func-declaration-bank-account-variable-id-output-map-id",f$={type:i.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:Tv},m$={like:!1,inferred:!1,id:"company-dto-func-returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!1,parent:f$},T$={type:i.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:mv},E$={type:i.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:tr},Av={constant:!0,isError:!1,id:Tv,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",defaultValue:null,implements:null,dataType:m$,readsValue:E$,required:!0,index:0,parent:T$},R$={type:i.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:tr},g$={type:i.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n},Kd={type:i.ReturnStatement,id:mv,version:1,outputs:[Av],calledByError:[],calledByEntry:[],calledBySuccess:[R$],throws:null,x:0,y:0,parent:g$},b$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:vv},v$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Sv={id:y$,type:i.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,index:5,readsValue:b$,parent:v$},I$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Dv},D$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Ov={id:h$,type:i.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,index:4,readsValue:I$,parent:D$},A$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:gv},S$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Pv={id:p$,type:i.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,index:3,readsValue:A$,parent:S$},O$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:pv},P$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Cv={id:u$,type:i.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,index:2,readsValue:O$,parent:P$},C$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Ev},w$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},wv={id:c$,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,index:1,readsValue:C$,parent:w$},B$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n},M$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:mo},_$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:fo},V$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:i.VariableDeclaration,entityId:Ai},Xd={constant:!0,required:!0,id:tr,type:i.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[M$,_$,V$],successCalls:[Kd],errorCalls:[],readsValue:null,writesValues:[Av],inputs:[wv,Pv,Ov,Sv,Cv],outputs:[],internalCalls:[],parent:B$,x:0,y:0},Dr="employee-dto-func-declaration-id",Qd="employee-dto-func-declaration-argument-dcl-id",Bv="employee-dto-func-declaration-return-statement-id",Mv="employee-dto-func-declaration-return-decl-id",Ar="employee-dto-func-declaration-employee-variable-id",Sr="employee-dto-func-declaration-employee-dto-variable-id",To="employee-dto-func-declaration-manager-variable-id",_v="employee-dto-func-declaration-employee-variable-id-output-map-id",Vv="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",Nv="employee-dto-func-declaration-employee-variable-department-output-map-id",Lv="employee-dto-func-declaration-employee-variable-manager-output-map-id",Gv="employee-dto-func-declaration-manager-variable-id-output-map-id",N$="employee-dto-func-declaration-employee-dto-variable-input-map-id",L$="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",G$="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",$$="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",F$={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:Mv},U$={like:!1,inferred:!1,id:"employee-dto-func-returned-employee-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!1,parent:F$},x$={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:Bv},j$={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:Sr},$v={constant:!0,isError:!1,id:Mv,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",defaultValue:null,dataType:U$,implements:null,readsValue:j$,required:!0,index:0,parent:x$},k$={type:i.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:Sr},q$={type:i.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr},ec={type:i.ReturnStatement,id:Bv,version:1,outputs:[$v],calledByError:[],calledByEntry:[],calledBySuccess:[k$],throws:null,x:0,y:0,parent:q$},J$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Gv},W$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},Fv={id:$$,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:J$,parent:W$},Y$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Nv},H$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},Uv={id:G$,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:Y$,parent:H$},z$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Vv},Z$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},xv={id:L$,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:z$,parent:Z$},K$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:_v},X$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},jv={id:N$,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:K$,parent:X$},Q$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr},eF={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:To},tF={constant:!0,required:!0,id:Sr,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[eF],successCalls:[ec],errorCalls:[],readsValue:null,writesValues:[$v],inputs:[jv,xv,Uv,Fv],outputs:[],internalCalls:[],parent:Q$,x:0,y:0},nF={type:i.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:To},rF={id:Gv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[Fv],parent:nF},iF={type:i.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:To},aF={like:!1,inferred:!1,id:"employee-dto-func-manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:iF},sF={type:i.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:Lv},oF={type:i.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr};i.GenericReference,i.VariableDeclaration;const kv={constant:!0,required:!0,id:To,type:i.VariableDeclaration,version:1,name:"Manager",description:"A variable holding an inherited manager",defaultValue:null,dataType:aF,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[tF],errorCalls:[],readsValue:sF,writesValues:[],inputs:[],outputs:[rF],internalCalls:[],parent:oF,x:0,y:0},lF={type:i.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},dF={id:Lv,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[2],index:3,writesValues:[kv],parent:lF},cF={type:i.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},uF={id:Nv,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[0],index:2,writesValues:[Uv],parent:cF},pF={type:i.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},yF={id:Vv,type:i.OutputMap,version:1,defaultValue:null,declaration:bt.properties[1],index:1,writesValues:[xv],parent:pF},hF={type:i.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},fF={id:_v,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[jv],parent:hF},mF={type:i.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},TF={like:!1,inferred:!1,id:"employee-dto-func-employee-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:mF},EF={type:i.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr},RF={type:i.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Qd},gF={type:i.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:Dr},qv={constant:!0,required:!0,id:Ar,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:TF,description:"A variable holding a company employee",calledByError:[],defaultValue:null,calledByEntry:[gF],calledBySuccess:[],successCalls:[kv],errorCalls:[],readsValue:RF,writesValues:[],inputs:[],outputs:[fF,yF,uF,dF],internalCalls:[],parent:EF,x:0,y:0},bF={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:Qd,entityType:i.ArgumentDeclaration},vF={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:Yt,asType:!1,isList:!1,like:!1,inferred:!1,parent:bF},IF={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:Dr,entityType:i.FunctionDeclaration},DF={constant:!0,type:i.ArgumentDeclaration,id:Qd,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,implements:null,defaultValue:null,dataType:vF,index:0,writesValues:[qv],parent:IF},AF={type:i.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},tc={type:i.FunctionDeclaration,id:Dr,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[DF],calls:[qv],implements:null,returnStatements:[ec],collapsed:!1,private:!1,x:0,y:0,parent:AF},SF={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:yv,entityType:i.ReturnDeclaration},OF={like:!1,inferred:!1,id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:SF},PF={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:i.GenericReference,entityId:hv,entityType:i.OutputMap},CF={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:i.GenericReference,entityId:fv,entityType:i.ContinueStatement},Jv={constant:!0,isError:!1,id:yv,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",defaultValue:null,readsValue:PF,dataType:OF,implements:null,required:!0,index:0,parent:CF},wF={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:i.GenericReference,entityId:yo,entityType:i.FunctionCall},BF={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},Wv={id:fv,type:i.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[wF],outputs:[Jv],throws:null,x:0,y:0,parent:BF},MF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:yo,entityType:i.FunctionCall},_F={id:hv,type:i.OutputMap,version:1,defaultValue:null,declaration:ec.outputs[0],writesValues:[Jv],index:0,parent:MF},VF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:i.GenericReference,entityId:Zd,entityType:i.ArgumentDeclaration},NF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:i.GenericReference,entityId:yo,entityType:i.FunctionCall},Yv={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:tc.inputs[0],readsValue:VF,index:0,defaultValue:null,parent:NF},LF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:i.GenericReference,entityId:ho,entityType:i.FunctionDeclaration},GF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:i.GenericReference,entityId:ho,entityType:i.FunctionDeclaration},$F={id:yo,type:i.FunctionCall,version:1,declaration:tc,inputs:[Yv],process:null,outputs:[_F],calledByError:[],calledByEntry:[LF],calledBySuccess:[],successCalls:[Wv],errorCalls:[],error:null,x:0,y:0,parent:GF},FF={type:i.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:Zd,entityType:i.ArgumentDeclaration},UF={like:!1,inferred:!1,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,isList:!1,asType:!1,parent:FF},xF={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:ho,entityType:i.FunctionDeclaration},jF={constant:!0,id:Zd,type:i.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",defaultValue:null,dataType:UF,required:!0,implements:Ds,index:0,writesValues:[Yv],parent:xF},kF={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},qF={id:ho,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[jF],calls:[$F],implements:ta,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:kF},JF={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},WF={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:i.GenericReference,entityId:Rv,entityType:i.OutputMap},Hv={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Jn.inputs[0],defaultValue:null,readsValue:WF,index:0,parent:JF},YF={id:"iterate-over-employee-list-loop-parent-ref-id",type:i.GenericReference,entityId:_n,entityType:i.FunctionDeclaration},HF={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},zF={id:pv,type:i.OutputMap,version:1,defaultValue:null,declaration:Jn.outputs[0],writesValues:[Cv],index:0,parent:HF},ZF={type:i.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:i.VariableDeclaration,entityId:fn},KF={id:Ai,type:i.Loop,version:1,declaration:Jn,inputs:[Hv],successCalls:[Xd],errorCalls:[],outputsDeclarations:[],outputs:[zF],body:qF,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[ZF],breakStatements:[],continueStatements:[Wv],error:null,x:0,y:0,parent:YF},XF={type:i.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mo},QF={id:Dv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[Ov],parent:XF},eU={type:i.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:mo},tU={like:!1,inferred:!1,id:"company-dto-func-bank-account-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:eU},nU={type:i.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:Iv},rU={type:i.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n};i.GenericReference,i.VariableDeclaration;const zv={constant:!0,required:!0,id:mo,type:i.VariableDeclaration,version:1,name:"Bank account",description:"A variable holding an inherited bank account",defaultValue:null,dataType:tU,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Xd],errorCalls:[],readsValue:nU,writesValues:[],inputs:[],outputs:[QF],internalCalls:[],parent:rU,x:0,y:0},iU={type:i.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fo},aU={id:vv,type:i.OutputMap,version:1,declaration:Ft.properties[0],index:0,defaultValue:null,writesValues:[Sv],parent:iU},sU={type:i.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:fo},oU={like:!1,inferred:!1,id:"company-dto-func-owner-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:sU},lU={type:i.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:bv},dU={type:i.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n};i.GenericReference,i.VariableDeclaration;const Zv={constant:!0,required:!0,id:fo,type:i.VariableDeclaration,version:1,name:"Owner",dataType:oU,description:"A variable holding an inherited owner",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Xd],errorCalls:[],readsValue:lU,writesValues:[],inputs:[],outputs:[aU],internalCalls:[],parent:dU,x:0,y:0},cU={type:i.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},uU={id:bv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[2],index:4,writesValues:[Zv],parent:cU},pU={type:i.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},yU={id:Iv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[2],index:3,writesValues:[zv],parent:pU},hU={type:i.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},fU={id:gv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[0],index:2,writesValues:[Pv],parent:hU},mU={type:i.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},TU={id:Rv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[3],index:1,writesValues:[Hv],parent:mU},EU={type:i.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},RU={id:Ev,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[wv],parent:EU},gU={type:i.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},bU={like:!1,inferred:!1,id:"company-dto-func-company-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:gU},vU={type:i.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n},IU={type:i.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:zd},DU={type:i.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:_n},Kv={constant:!0,required:!0,id:fn,type:i.VariableDeclaration,version:1,name:"Company",dataType:bU,description:"A variable holding a company",defaultValue:null,calledByError:[],calledByEntry:[DU],calledBySuccess:[],successCalls:[zv,Zv,KF],errorCalls:[],readsValue:IU,writesValues:[],inputs:[],outputs:[RU,TU,fU,yU,uU],internalCalls:[],parent:vU,x:0,y:0},AU={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:zd,entityType:i.ArgumentDeclaration},SU={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:Ht,asType:!1,isList:!1,like:!1,inferred:!1,parent:AU},OU={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:_n,entityType:i.FunctionDeclaration},PU={constant:!0,type:i.ArgumentDeclaration,id:zd,version:1,name:"Company",description:"The company to create a DTO for",defaultValue:null,required:!0,implements:null,dataType:SU,index:0,writesValues:[Kv],parent:OU},CU={type:i.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},nc={type:i.FunctionDeclaration,id:_n,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[PU],calls:[Kv],implements:null,index:null,returnStatements:[Kd],collapsed:!1,private:!1,x:0,y:0,parent:CU},Ba="exec-in-parallel-operation-call-id",Ma="exec-sequentially-operation-call-id",vt="concurrency-and-wait-function-declaration-id",Xv="concurrency-and-wait-return-statement-id",Qv="concurrency-and-wait-return-declaration-id",rc="exec-in-parallel-argument-map-id",eI="exec-sequentially-argument-map-id",ic="wait-for-2-seconds-operation-id",tI="wait-for-2-seconds-argument-map-id",ac="map-company-dto-function-call-id",nI="map-company-dto-function-call-company-dto-output-map-id",Eo="company-dto-variable-one-id",sc="company-dto-variable-one-instance-id",rI="company-dto-variable-two-id",wU={type:i.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:Qv},BU={like:!1,inferred:!1,id:"returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:wU},MU={type:i.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:Xv},_U={type:i.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:rI},iI={constant:!0,isError:!1,id:Qv,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",defaultValue:null,dataType:BU,implements:null,readsValue:_U,required:!0,index:0,parent:MU},VU={type:i.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:ic},NU={type:i.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},aI={type:i.ReturnStatement,id:Xv,version:1,outputs:[iI],calledByError:[],calledByEntry:[],calledBySuccess:[VU],throws:null,x:0,y:0,parent:NU},LU={type:i.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:i.VariableInstance,entityId:sc},GU={type:i.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:i.VariableInstance,entityId:sc},$U={type:i.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},sI={constant:!0,required:!0,id:rI,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,defaultValue:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[LU],internalCalls:[],writesValues:[iI],readsValue:GU,x:0,y:0,parent:$U},FU={type:i.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Eo},UU={type:i.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:Eo},xU={type:i.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},jU={type:i.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Eo},oI={id:sc,type:i.VariableInstance,version:1,declaration:jU,inputs:[],outputs:[],successCalls:[sI],errorCalls:[],defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[FU],internalCalls:[],writesValues:[sI],readsValue:UU,x:0,y:0,parent:xU},kU={type:i.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:i.FunctionCall,entityId:ac},qU={type:i.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:i.OutputMap,entityId:nI},JU={type:i.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},lI={constant:!0,required:!0,id:Eo,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,defaultValue:null,dataType:null,inputs:[],outputs:[],successCalls:[oI],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[kU],internalCalls:[],writesValues:[oI],readsValue:qU,x:0,y:0,parent:JU},dI={type:i.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:i.FunctionCall,entityId:ac},WU={id:"map-company-dto-function-call-company-input-map-id",type:i.InputMap,version:1,declaration:nc.inputs[0],name:null,description:null,defaultValue:null,index:0,readsValue:null,parent:dI},YU={id:nI,type:i.OutputMap,version:1,defaultValue:null,declaration:Kd.outputs[0],writesValues:[lI],index:0,parent:dI},HU={id:"map-company-dto-function-call-called-by-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:vt},zU={id:"map-company-dto-function-call-parent-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:vt},ZU={id:ac,type:i.FunctionCall,version:1,declaration:nc,successCalls:[lI],process:null,errorCalls:[],inputs:[WU],outputs:[YU],calledByError:[],calledByEntry:[HU],calledBySuccess:[],parent:zU,x:0,y:0,error:null},KU={type:i.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:Md},XU={type:i.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:i.VariableDeclaration,entityId:Md},QU={like:!1,inferred:!1,id:"last-timestamp-variable-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:on,version:1,asType:!1,isList:!1,parent:KU},e4={type:i.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:i.Project,entityId:H},oc={constant:!0,required:!0,id:Md,type:i.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",defaultValue:{id:"last-timestamp-variable-default-value-id",type:i.LiteralValue,version:1,name:C.Date,value:null,autogeneration:{type:ze.CurrentDateAndTime,rangeStart:null,rangeEnd:null},valueAsType:null,parent:XU},dataType:QU,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:e4},t4={type:i.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:tI},n4={type:i.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:i.Operation,entityId:ic},r4={id:tI,type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:i.LiteralValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:C.Number,parent:t4},index:0,parent:n4},i4={type:i.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},a4={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:i.Operation,entityId:Ma},s4={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:i.Operation,entityId:Ba},cI={id:ic,type:i.Operation,version:1,declaration:Qt,inputs:[r4],outputs:[],process:null,successCalls:[aI],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[a4,s4],error:null,parent:i4},o4={type:i.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"wait-for-random-amount-input-map-id"},l4={type:i.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:i.Operation,entityId:"wait-for-random-amount-id"},d4={id:"wait-for-random-amount-input-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:i.LiteralValue,version:1,value:null,valueAsType:null,autogeneration:{type:ze.Random,rangeStart:1e3,rangeEnd:4e3},name:C.Number,parent:o4},index:0,parent:l4},c4={type:i.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:i.Project,entityId:H},Si={id:"wait-for-random-amount-id",type:i.Operation,version:1,declaration:Qt,inputs:[d4],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:c4},lc="list-of-functions-variable-id",u4={type:i.GenericReference,id:"list-of-functions-variable-action-descriptor-dynamic-argument-parent-ref-id",entityType:i.ActionDescriptor,entityId:"list-of-functions-variable-action-descriptor-id"},p4={id:"list-of-functions-variable-action-descriptor-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any input value",description:"Any input value that can be passed to the action",defaultValue:null,index:0,required:!1,dataType:null,parent:u4},y4={type:i.GenericReference,id:"list-of-functions-variable-action-descriptor-dynamic-return-parent-ref-id",entityType:i.ActionDescriptor,entityId:"list-of-functions-variable-action-descriptor-id"},h4={id:"list-of-functions-variable-action-descriptor-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any output value",description:"Any output value that can be returned to the action",defaultValue:null,index:0,required:!1,dataType:null,parent:y4},f4={type:i.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:lc},m4={id:"list-of-functions-variable-action-descriptor-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",inputs:[p4],error:null,outputs:[h4],parent:null},T4={type:i.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:i.VariableDeclaration,entityId:lc},E4={like:!1,inferred:!1,id:"list-of-functions-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:m4,asType:!1,isList:!0,parent:f4},R4={type:i.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt};i.GenericReference,i.InputMap;const g4={type:i.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:i.InputMap,entityId:eI},b4={type:i.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:i.InputMap,entityId:rc},uI={constant:!0,required:!0,id:lc,type:i.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.ActionDescriptor,value:null,valueAsType:[Si,Si,Si,Si,Si],autogeneration:null,parent:T4},dataType:E4,parent:R4,readsValue:null,writesValues:[g4,b4],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},v4={type:i.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:i.Operation,entityId:Ba},I4={type:i.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},D4={type:i.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-in-parallel-return-map-id"},A4={type:i.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:i.Operation,entityId:Ba},pI={id:"exec-in-parallel-result-variable-id",type:i.VariableInstance,version:1,declaration:oc,readsValue:D4,writesValues:[],defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[A4],successCalls:[],errorCalls:[],internalCalls:[],parent:I4,x:0,y:0},S4={id:"exec-in-parallel-return-map-id",type:i.OutputMap,version:1,defaultValue:null,declaration:Ul,writesValues:[pI],index:0,parent:v4},O4={type:i.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:i.Operation,entityId:Ba},P4={id:rc,type:i.InputMap,version:1,declaration:Fl,name:null,description:null,readsValue:uI,defaultValue:null,index:0,parent:O4},C4={type:i.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},w4={type:i.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:vt},B4={process:null,id:Ba,type:i.Operation,version:1,declaration:Qt,inputs:[P4],outputs:[S4],successCalls:[cI,pI],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[w4],calledBySuccess:[],error:null,parent:C4},M4={type:i.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:i.Operation,entityId:Ma},_4={type:i.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},V4={type:i.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-sequentially-return-map-id"},N4={type:i.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:i.Operation,entityId:Ma},yI={id:"exec-sequentially-result-variable-id",type:i.VariableInstance,version:1,declaration:oc,readsValue:V4,defaultValue:null,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[N4],successCalls:[],errorCalls:[],internalCalls:[],parent:_4,x:0,y:0},L4={id:"exec-sequentially-return-map-id",type:i.OutputMap,version:1,defaultValue:null,declaration:jl,writesValues:[yI],index:0,parent:M4},G4={type:i.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:i.Operation,entityId:Ma},$4={id:eI,type:i.InputMap,version:1,declaration:xl,name:null,description:null,readsValue:uI,defaultValue:null,index:0,parent:G4},F4={type:i.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},U4={type:i.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:vt},x4={id:Ma,type:i.Operation,version:1,declaration:Cn,inputs:[$4],process:null,outputs:[L4],successCalls:[cI,yI],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[U4],calledBySuccess:[],error:null,parent:F4},j4={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},k4={type:i.FunctionDeclaration,id:vt,version:1,name:"Execute with concurrency and wait",description:"Executes a hardcoded list of actions in parallel and waits for some time before ending the logic with some unrelated data payload as the result.",inputs:[],calls:[x4,B4,ZU],returnStatements:[aI],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:j4},q4={type:i.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:i.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},J4={like:!1,inferred:!1,id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,isList:!1,asType:!1,parent:q4},W4={type:i.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:i.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},Y4={constant:!0,isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",defaultValue:null,implements:null,dataType:J4,readsValue:null,required:!0,index:0,parent:W4},H4={type:i.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:i.FunctionDeclaration,entityId:"5059c093-eda2-4efc-b7b4-aaaadd4d44de"},z4={type:i.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:i.FunctionDeclaration,entityId:"5059c093-eda2-4efc-b7b4-aaaadd4d44de"},hI={type:i.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[Y4],calledByError:[],calledByEntry:[z4],calledBySuccess:[],throws:null,x:0,y:0,parent:H4},Z4={type:i.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:i.Project,entityId:H},K4={type:i.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[hI],index:null,implements:null,returnStatements:[hI],collapsed:!1,private:!1,x:0,y:0,parent:Z4},dc="get-current-date-and-time-func-decl-id",fI="get-current-date-and-time-return-statement-id",cc="get-current-date-and-time-return-declaration-id",X4="get-current-date-and-time-return-declaration-data-type-id",Q4={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:i.ReturnDeclaration,entityId:cc},ex={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:cc},tx={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:X4,version:1,entity:on,asType:!1,isList:!1,like:!1,inferred:!1,parent:ex},nx={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:i.ReturnStatement,entityId:fI};i.ReturnDeclaration,i.LiteralValue,C.Date,ze.CurrentDateAndTime;const rx={type:i.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:dc},ix={type:i.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dc};i.ReturnStatement;const ax={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},sx={type:i.FunctionDeclaration,id:dc,version:1,name:"Get current date and time",description:"Generates and returns the current date and time at the time of the execution",inputs:[],calls:[],returnStatements:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:ax},mI="do-math-return-statement-id",uc="do-math-return-declaration-id",ox={type:i.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:i.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},lx={like:!1,inferred:!1,id:"do-math-func-var-to-return-one-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:ox},dx={type:i.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},cx={type:i.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:i.ReturnDeclaration,entityId:uc},ux={constant:!0,required:!0,type:i.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",defaultValue:null,dataType:lx,readsValue:null,writesValues:[cx],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:dx},px={type:i.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:i.ReturnStatement,entityId:mI},yx={type:i.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:i.ReturnDeclaration,entityId:uc},hx={like:!1,inferred:!1,id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:yx},fx={constant:!0,isError:!1,id:uc,version:1,type:i.ReturnDeclaration,name:"Result",description:null,implements:null,defaultValue:null,dataType:hx,readsValue:ux,required:!0,index:0,parent:px},mx={type:i.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},Tx={type:i.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},TI={type:i.ReturnStatement,id:mI,version:1,outputs:[fx],calledByError:[],calledByEntry:[],calledBySuccess:[mx],parent:Tx,throws:null,x:0,y:0},Ex={type:i.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:i.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},Rx={like:!1,inferred:!1,id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Ex},gx={type:i.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},bx={type:i.GenericReference,id:"do-math-func-return-one-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},vx={type:i.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},EI={constant:!0,required:!0,type:i.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:Rx,description:null,defaultValue:null,readsValue:vx,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[bx],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:gx},Ix={type:i.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},Dx={type:i.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},Ax={type:i.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:i.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},Sx={like:!1,inferred:!1,id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Ax},Ox={type:i.GenericReference,id:"do-math-func-return-two-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},RI={constant:!0,required:!0,type:i.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[Ox],successCalls:[],errorCalls:[],dataType:Sx,readsValue:Dx,writesValues:[],internalCalls:[],parent:Ix,x:0,y:0},gI={type:i.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},Px={type:i.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},Cx={type:i.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},wx={type:i.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:i.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},bI={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:i.InputMap,declaration:Sl,name:null,description:null,readsValue:wx,defaultValue:null,index:0,parent:Cx},Bx={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:i.OutputMap,version:1,defaultValue:null,declaration:Cl,writesValues:[EI,RI],index:0,parent:Px},Mx={type:i.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},_x={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:i.GenericReference,entityType:i.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},vI={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:i.InputMap,declaration:Ol,name:null,description:null,readsValue:_x,defaultValue:null,index:1,parent:Mx},Vx={type:i.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:cs,version:1,inputs:[bI,vI],outputs:[Bx],calledByError:[],calledByEntry:[gI],calledBySuccess:[],process:null,successCalls:[TI,EI,RI],errorCalls:[],parent:gI,error:null,x:0,y:0},Nx={type:i.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:i.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},Lx={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:i.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:i.ArgumentDeclaration},II={like:!1,inferred:!1,id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Lx},Gx={type:i.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:i.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},$x={type:i.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},Fx={type:i.GenericReference,id:"do-math-func-var-called-by-ref",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},DI={constant:!0,required:!0,id:"72a338d8-0183-4ca2-8760-227517854595",type:i.VariableDeclaration,version:1,name:"Z",description:null,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:i.LiteralValue,version:1,value:1,name:C.Number,valueAsType:null,autogeneration:null,parent:Nx},dataType:II,inputs:[],outputs:[],calledByError:[],calledByEntry:[Fx],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:Gx,writesValues:[vI],internalCalls:[],x:0,y:0,parent:$x},Ux={entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:i.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},xx={constant:!0,id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:i.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",defaultValue:null,dataType:II,implements:null,writesValues:[DI],required:!0,index:1,parent:Ux},jx={type:i.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:i.Project,entityId:H},kx={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},qx={type:i.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:i.VariableDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},Jx={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:i.ArgumentDeclaration},Wx={like:!1,inferred:!1,id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Jx},Yx={constant:!0,id:"d8895765-f705-457e-85fa-25d130926769",type:i.ArgumentDeclaration,version:1,name:"N",dataType:Wx,description:"The number to add",implements:null,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:i.LiteralValue,version:1,value:5,name:C.Number,valueAsType:null,autogeneration:null,parent:qx},writesValues:[bI],required:!0,index:0,parent:kx},Hx={type:i.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[Yx,xx],calls:[Vx,DI],implements:null,index:null,collapsed:!1,returnStatements:[TI],private:!1,x:0,y:0,parent:jx},It="replace-bank-account-in-company-func-declaration-id",pc="company-entity-to-modify-arg-declaration-id",yc="account-number-to-create-arg-decl-id",Oi="company-main-variable-id",Pi="search-person-by-id-id",AI="new-bank-account-owner-arg-decl-id",SI="search-person-by-id-output-declaration-id",hc="search-person-by-id-output-entity-map-id",_a="person-not-empty-condition-id",Ro="create-new-bank-account-instance-operation-id",OI="create-new-bank-account-instance-operation-output-entity-map-id",PI="company-bank-account-output-map-id",fc="old-bank-account-var-declaration-id",CI="old-bank-account-var-instance-id",wI="company-variable-instance-id",mc="delete-bank-account-internal-call-id",Va="new-bank-account-data-variable-declaration-id",zx={type:i.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},Zx={type:i.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:i.InternalCall,entityId:mc},Kx={type:i.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Oi},Xx={type:i.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:wI},Qx={type:i.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:OI},BI={type:i.InputMap,id:"bank-account-input-map-id",version:1,readsValue:Qx,declaration:Fd,name:null,description:null,index:0,defaultValue:null,parent:Xx},ej={type:i.VariableInstance,id:wI,version:1,defaultValue:null,declaration:Kx,inputs:[BI],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[Zx],successCalls:[],errorCalls:[],internalCalls:[],parent:zx,readsValue:null,writesValues:[],x:0,y:0},tj={type:i.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Oi},nj={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:vi,asType:!1,isList:!1,like:!1,inferred:!1,parent:tj},rj={type:i.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:PI},ij={type:i.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},aj={type:i.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Oi},sj={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:i.Operation,entityId:Ro};i.GenericReference,i.VariableInstance;const oj={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:fc},lj={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-decl-ref-id",entityType:i.VariableDeclaration,entityId:fc},dj={type:i.GenericReference,id:"bank-account-variable-parent-ref-two-id",entityType:i.FunctionDeclaration,entityId:It},cj={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-internal-call-ref-id",entityType:i.InternalCall,entityId:mc},uj={type:i.VariableInstance,id:CI,version:1,defaultValue:null,declaration:lj,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],internalCalls:[cj],errorCalls:[],parent:dj,readsValue:null,writesValues:[],x:0,y:0},MI={process:null,type:i.InternalCall,id:mc,version:1,declaration:pd,index:0,successCalls:[ej],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[sj,oj],parent:uj},_I={constant:!0,required:!0,type:i.VariableDeclaration,id:fc,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:nj,defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[aj],successCalls:[MI],internalCalls:[],errorCalls:[],parent:ij,readsValue:rj,writesValues:[],x:0,y:0},pj={type:i.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Oi},yj={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:Ht,asType:!1,isList:!1,like:!1,inferred:!1,parent:pj},hj={type:i.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:pc},fj={type:i.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},mj={type:i.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:It},Tj={type:i.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Oi},Ej={id:PI,version:1,type:i.OutputMap,defaultValue:null,declaration:Fd,index:0,parent:Tj,writesValues:[_I]},VI={constant:!0,required:!0,type:i.VariableDeclaration,id:Oi,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",defaultValue:null,dataType:yj,inputs:[],outputs:[Ej],calledByError:[],calledByEntry:[mj],calledBySuccess:[],successCalls:[_I],errorCalls:[],parent:fj,internalCalls:[],readsValue:hj,writesValues:[],x:0,y:0},Rj={type:i.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Va},gj={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.OutputMap,entityId:hc},NI={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:i.InputMap,declaration:null,name:"Account owner",description:null,readsValue:gj,index:1,defaultValue:null,parent:Rj},bj={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:yc},vj={type:i.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Va},LI={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:i.InputMap,declaration:null,name:"Account number",description:null,readsValue:bj,defaultValue:null,index:0,parent:vj},GI={type:i.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:i.Operation,entityId:Ro},Ij={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:i.InputMap,declaration:yr.inputs[0],name:null,description:null,index:0,readsValue:null,defaultValue:{type:i.LiteralValue,name:C.EntityTemplate,value:null,valueAsType:vi,autogeneration:null},parent:GI},Dj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-entity-data-input-map-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:Va},$I={id:"create-new-bank-account-instance-operation-entity-data-input-map-id",version:1,type:i.InputMap,declaration:yr.inputs[1],name:null,description:null,index:1,readsValue:Dj,defaultValue:null,parent:GI},Aj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:i.Operation,entityId:Ro},Sj={id:OI,version:1,type:i.OutputMap,defaultValue:null,declaration:yr.outputs[0],index:0,writesValues:[BI],parent:Aj},Oj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.Condition,entityId:_a},Pj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Va},Cj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},FI={process:null,id:Ro,type:i.Operation,version:1,declaration:yr,inputs:[Ij,$I],error:null,outputs:[Sj],successCalls:[MI],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[Pj,Oj],parent:Cj,x:0,y:0},wj={type:i.GenericReference,id:"new-bank-account-data-variable-declaration-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},Bj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.Condition,entityId:_a},Mj={constant:!0,required:!0,id:Va,type:i.VariableDeclaration,version:1,defaultValue:null,inputs:[LI,NI],dataType:null,name:"New bank Account's data",description:null,readsValue:null,outputs:[],writesValues:[$I],successCalls:[FI],errorCalls:[],internalCalls:[],calledByError:[],calledBySuccess:[Bj],calledByEntry:[],x:0,y:0,parent:wj},_j={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:i.ReturnDeclaration},Vj={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:i.ReturnDeclaration},Nj={like:!1,inferred:!1,id:"person-not-found-thrown-error-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:Vj},Lj={id:"person-not-found-thrown-error-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:i.ReturnStatement},Gj={constant:!0,isError:!0,id:"person-not-found-thrown-error-id",type:i.ReturnDeclaration,version:1,dataType:Nj,name:"Person not found error",description:"If the person entity was not found this error is outputted",defaultValue:{id:"person-not-found-thrown-error-datatype-default-value-id",type:i.LiteralValue,version:1,value:"Person not found",name:C.String,parent:_j,valueAsType:null,autogeneration:null},parent:Lj,implements:null,required:!0,index:0,readsValue:null},$j={id:"person-not-found-error-return-statement-called-by-ref-id",type:i.GenericReference,entityId:_a,entityType:i.Condition},Fj={id:"person-not-found-error-return-statement-parent-ref-id",type:i.GenericReference,entityId:It,entityType:i.FunctionDeclaration},Uj={id:"person-not-found-error-return-statement-id",type:i.ReturnStatement,version:1,throws:Gj,outputs:[],calledBySuccess:[],calledByError:[$j],calledByEntry:[],x:0,y:0,parent:Fj},xj={type:i.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:i.Search,entityId:Pi},jj={type:i.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},kj={type:i.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:hc},qj={type:i.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:i.Condition,entityId:_a},UI={id:"person-entity-to-check-map-id",version:1,type:i.InputMap,declaration:Rr.inputs[0],name:null,description:null,readsValue:kj,index:0,defaultValue:null,parent:qj},Jj={type:i.Condition,id:_a,version:1,declaration:Rr,inputs:[UI],calledByError:[],calledByEntry:[],calledBySuccess:[xj],successCalls:[Mj,FI],errorCalls:[Uj],x:0,y:0,parent:jj},Wj={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:i.ValueDescriptor,entityId:SI},Yj={like:!1,inferred:!1,id:"search-person-by-id-output-entity-declaration-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,asType:!1,entity:bt,parent:Wj},Hj={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:i.Search,entityId:Pi},xI={id:SI,type:i.ValueDescriptor,version:1,defaultValue:null,dataType:Yj,name:"Found person",description:"The person entity that was found",parent:Hj,required:!0,index:0},zj={type:i.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:i.Search,entityId:Pi},Zj={type:i.OutputMap,id:hc,version:1,defaultValue:null,declaration:xI,parent:zj,writesValues:[UI,NI],index:0},Kj={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:i.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:i.ArgumentDeclaration};i.DataType;const Xj={type:i.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:i.Search,entityId:Pi},jI={id:"search-person-by-id-input-declaration-id",type:i.ValueDescriptor,version:1,dataType:null,defaultValue:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",parentRelationType:P.FixedArguments,index:0,required:!0,parent:Xj},Qj={type:i.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:i.Search,entityId:Pi},e8={id:"search-person-by-id-input-map-reads-value-ref-id",type:i.GenericReference,entityId:AI,entityType:i.ArgumentDeclaration},kI={type:i.InputMap,id:"search-person-by-id-input-map",version:1,declaration:jI,name:null,description:null,readsValue:e8,defaultValue:null,parent:Qj,index:0},t8="SELECT * FROM Person WHERE id = your_id;",n8={type:i.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},r8={type:i.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:It},i8={type:i.Search,id:Pi,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:t8,inputsDeclarations:[jI],inputs:[kI],outputsDeclarations:[xI],outputs:[Zj],calledByError:[],calledByEntry:[r8],calledBySuccess:[],error:null,successCalls:[Jj],errorCalls:[],parent:n8,x:0,y:0};i.GenericReference,i.DataType;const a8={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:yc,entityType:i.ArgumentDeclaration},s8={like:!1,inferred:!1,id:"account-number-to-create-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:a8},o8={entityType:i.FunctionDeclaration,entityId:It,type:i.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},l8={constant:!0,id:yc,type:i.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",defaultValue:null,dataType:s8,implements:null,writesValues:[LI],required:!0,index:1,parent:o8};i.GenericReference,i.DataType;const d8={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:i.ArgumentDeclaration},c8={like:!1,inferred:!1,id:"new-bank-account-owner-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:On,isList:!1,asType:!1,parent:d8},u8={entityType:i.FunctionDeclaration,entityId:It,type:i.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},p8={constant:!0,id:AI,type:i.ArgumentDeclaration,version:1,name:"New account owner ID",description:"If it has changed, this is the new person entity, that owns of the bank account",defaultValue:null,dataType:c8,implements:null,writesValues:[kI],required:!1,index:1,parent:u8},y8={type:i.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:i.Project,entityId:H},h8={type:i.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:i.FunctionDeclaration,entityId:It};i.GenericReference,i.DataType;const f8={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:pc,entityType:i.ArgumentDeclaration},m8={like:!1,inferred:!1,id:"company-entity-to-modify-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:f8},T8={constant:!0,id:pc,type:i.ArgumentDeclaration,version:1,name:"Company",defaultValue:null,dataType:m8,implements:null,description:"The company to replace the bank account for",writesValues:[VI],required:!0,index:0,parent:h8},E8={type:i.FunctionDeclaration,id:It,version:1,name:"Replace bank account",description:"This action takes an existing company and data to create a new bank account entity. It then creates a bank account, deletes the old one, and updates the company with the new bank account",inputs:[T8,l8,p8],index:null,implements:null,calls:[i8,VI],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:y8},R8={type:i.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},g8={type:i.FunctionDeclaration,version:1,id:"6bedb217-f844-4332-af72-9626b2a32511",name:"Some library main function",description:null,inputs:[],calls:[],implements:null,collapsed:!0,index:null,returnStatements:[],private:!1,parent:R8,x:0,y:0},b8={type:i.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:i.Project,entityId:H},v8={type:i.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},I8={type:i.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[g8],events:[],implements:v8,parent:b8,x:0,y:0},Tc="global-counted-test-loop-id",qI="global-counted-test-loop-body-id",JI="global-counted-test-loop-body-current-iteration-value-argument-declaration-id",D8={type:i.GenericReference,id:"global-counted-test-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:JI,entityType:i.ArgumentDeclaration},A8={like:!1,inferred:!1,id:"global-counted-test-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:D8},S8={id:"global-counted-test-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:qI,entityType:i.FunctionDeclaration},O8={constant:!0,id:JI,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:A8,implements:Ql,required:!0,index:0,writesValues:[],parent:S8},P8={id:"global-counted-test-loop-body-parent-ref-id",type:i.GenericReference,entityId:Tc,entityType:i.Loop},C8={id:qI,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[O8],calls:[],implements:As,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:P8},Ci="random-company-employee-test-variable-id",Ec="manager-global-variable-id",WI="global-user-instance-id",mn="employee-mapped-dto-variable-id",Or="employee-mapped-dto-variable-instance-id",YI="random-employee-id-output-map-id",HI="random-employee-birth-date-output-map-id",zI="random-employee-department-output-map-id",ZI="random-employee-manager-output-map-id",KI="manager-global-id-output-map-id",XI="global-user-instance-id-output-map-id",w8="employee-mapped-dto-requester-id-input-map-id",QI="employee-mapped-dto-now-timestamp-input-map-id",B8="employee-mapped-dto-id-input-map-id",M8="employee-mapped-dto-birth-date-input-map-id",_8="employee-mapped-dto-department-input-map-id",V8="employee-mapped-dto-manager-input-map-id",N8={id:"global-counted-test-loop-iteration-number-input-map-parent-ref-id",type:i.GenericReference,entityId:Tc,entityType:i.Loop};i.GenericReference,i.VariableDeclaration;const L8={id:"global-counted-test-loop-iteration-number-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:na.inputs[0],defaultValue:null,readsValue:null,index:0,parent:N8},G8={id:"global-counted-test-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},$8={id:"global-counted-test-loop-called-by-success-ref-id",type:i.GenericReference,entityId:Or,entityType:i.VariableDeclaration},eD={id:Tc,type:i.Loop,version:1,declaration:na,inputs:[L8],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:C8,calledByError:[],calledByEntry:[],calledBySuccess:[$8],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:G8},Rc="global-object-keys-test-loop-id",tD="global-object-keys-test-loop-body-id",nD="global-object-keys-test-loop-body-current-iteration-value-argument-declaration-id",F8={type:i.GenericReference,id:"global-object-keys-test-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:nD,entityType:i.ArgumentDeclaration},U8={like:!1,inferred:!1,id:"global-object-keys-test-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:F8},x8={id:"global-object-keys-test-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:tD,entityType:i.FunctionDeclaration},j8={constant:!0,id:nD,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:U8,implements:Hl,required:!0,index:0,writesValues:[],parent:x8},k8={id:"global-object-keys-test-loop-body-parent-ref-id",type:i.GenericReference,entityId:Rc,entityType:i.Loop},q8={id:tD,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[j8],calls:[],implements:li,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:k8},J8={id:"global-object-keys-test-loop-iteration-object-input-map-parent-ref-id",type:i.GenericReference,entityId:Rc,entityType:i.Loop},W8={id:"global-object-keys-test-loop-iteration-object-input-map-reads-value-ref-id",type:i.GenericReference,entityId:mn,entityType:i.VariableDeclaration},rD={id:"global-object-keys-test-loop-iteration-object-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:li.inputs[0],defaultValue:null,readsValue:W8,index:0,parent:J8},Y8={id:"global-object-keys-test-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},H8={id:"global-object-keys-test-loop-called-by-success-ref-two-id",type:i.GenericReference,entityId:Or,entityType:i.VariableDeclaration},z8={id:"global-object-keys-test-loop-called-by-success-ref-one-id",type:i.GenericReference,entityId:mn,entityType:i.VariableDeclaration},gc={id:Rc,type:i.Loop,version:1,declaration:li,inputs:[rD],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:q8,calledByError:[],calledByEntry:[],calledBySuccess:[z8,H8],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:Y8},bc="global-object-values-test-loop-id",iD="global-object-values-test-loop-body-id",aD="global-object-values-test-loop-body-current-iteration-value-argument-declaration-id",Z8={type:i.GenericReference,id:"global-object-values-test-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:aD,entityType:i.ArgumentDeclaration},K8={like:!1,inferred:!1,id:"global-object-values-test-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:Z8},X8={id:"global-object-values-test-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:iD,entityType:i.FunctionDeclaration},Q8={constant:!0,id:aD,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:K8,implements:Zl,required:!0,index:0,writesValues:[],parent:X8},ek={id:"global-object-values-test-loop-body-parent-ref-id",type:i.GenericReference,entityId:bc,entityType:i.Loop},tk={id:iD,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[Q8],calls:[],implements:di,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:ek},nk={id:"global-object-values-test-loop-iteration-object-input-map-parent-ref-id",type:i.GenericReference,entityId:bc,entityType:i.Loop},rk={id:"global-object-values-test-loop-iteration-object-input-map-reads-value-ref-id",type:i.GenericReference,entityId:Or,entityType:i.VariableDeclaration},sD={id:"global-object-values-test-loop-iteration-object-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:di.inputs[0],defaultValue:null,readsValue:rk,index:0,parent:nk},ik={id:"global-object-values-test-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},ak={id:"global-object-values-test-loop-called-by-success-ref-id",type:i.GenericReference,entityId:Or,entityType:i.VariableInstance},oD={id:bc,type:i.Loop,version:1,declaration:di,inputs:[sD],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:tk,calledByError:[],calledByEntry:[],calledBySuccess:[ak],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:ik},vc="global-test-iterate-over-string-loop-id",Ic="global-test-iterate-over-string-loop-body-id",go="global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-id",lD="global-test-iterate-over-string-loop-iteration-list-input-map-id",sk={type:i.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:go,entityType:i.ArgumentDeclaration},ok={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:sk},lk={id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Ic,entityType:i.FunctionDeclaration},dk={constant:!0,id:go,type:i.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",defaultValue:null,dataType:ok,implements:Wl,required:!0,index:1,writesValues:[],parent:lk},ck={type:i.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:go,entityType:i.ArgumentDeclaration},uk={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:ck},pk={id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Ic,entityType:i.FunctionDeclaration},yk={constant:!0,id:go,type:i.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",defaultValue:null,dataType:uk,implements:Yl,required:!0,index:0,writesValues:[],parent:pk},hk={id:"global-test-iterate-over-string-loop-body-parent-ref-id",type:i.GenericReference,entityId:vc,entityType:i.Loop},fk={id:Ic,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[yk,dk],calls:[],implements:Is,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:hk},mk={id:"global-test-iterate-over-string-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:vc,entityType:i.Loop},Tk={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-parent-ref-id",type:i.GenericReference,entityId:lD,entityType:i.InputMap},Ek={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-id",type:i.LiteralValue,name:C.String,version:1,value:"Hello",valueAsType:null,autogeneration:{type:ze.Random,rangeStart:4,rangeEnd:5},parent:Tk},Rk={id:lD,type:i.InputMap,version:1,name:null,description:null,declaration:ea.inputs[0],defaultValue:Ek,readsValue:null,index:0,parent:mk},gk={id:"global-test-iterate-over-string-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},bk={id:vc,type:i.Loop,version:1,declaration:ea,inputs:[Rk],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:fk,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:gk},Dc="iterate-over-list-loop-id",dD="iterate-over-list-loop-body-id",cD="iterate-over-list-loop-body-current-iteration-value-argument-declaration-id",vk={type:i.GenericReference,id:"iterate-over-list-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:cD,entityType:i.ArgumentDeclaration},Ik={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:vk},Dk={id:"iterate-over-list-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:dD,entityType:i.FunctionDeclaration},Ak={constant:!0,id:cD,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:Ik,implements:Ds,required:!0,index:0,writesValues:[],parent:Dk},Sk={id:"iterate-over-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:Dc,entityType:i.Loop},Ok={id:dD,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[Ak],calls:[],implements:ta,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:Sk},Pk={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:Dc,entityType:i.Loop},Ck={id:"iterate-over-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Jn.inputs[0],defaultValue:null,readsValue:null,index:0,parent:Pk},wk={id:"iterate-over-list-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Bk={id:Dc,type:i.Loop,version:1,declaration:Jn,inputs:[Ck],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:Ok,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:wk},Mk=`SELECT
|
|
1
|
+
(function(d,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(d=typeof globalThis<"u"?globalThis:d||self,i(d["@elyx-code/project-logic-tree"]={}))})(this,function(d){"use strict";var SJ=Object.defineProperty;var OJ=(d,i,F)=>i in d?SJ(d,i,{enumerable:!0,configurable:!0,writable:!0,value:F}):d[i]=F;var c=(d,i,F)=>(OJ(d,typeof i!="symbol"?i+"":i,F),F);var i=(r=>(r.DefinitionEntity="definition-entity",r.BuiltInBaseEntity="built-in-base-entity",r.Project="project",r.InstalledProject="installed-project",r.GlobalEvent="global-event",r.DataType="data-type",r.FunctionCall="function-call",r.FunctionDeclaration="function-declaration",r.ActionDescriptor="action-descriptor",r.ValueDescriptor="value-descriptor",r.ArgumentDeclaration="argument-declaration",r.InputMap="input-map",r.ReturnStatement="return-statement",r.BreakStatement="break-statement",r.ContinueStatement="continue-statement",r.ReturnDeclaration="return-declaration",r.OutputMap="output-map",r.PrimitiveEntity="primitive-entity",r.LiteralValue="literal-value",r.Property="property",r.Operation="operation",r.Condition="condition",r.VariableDeclaration="variable-declaration",r.VariableInstance="variable-instance",r.Search="search",r.Loop="loop",r.InternalCall="internal-call",r.GenericReference="generic-reference",r))(i||{}),F=(r=>(r.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",r.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",r.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",r.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",r.EXECUTION="BUILT_IN_EXECUTION_ENTITY",r.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",r))(F||{}),ze=(r=>(r.CurrentDateAndTime="current-date-and-time",r.Unique="unique",r.Random="random",r))(ze||{}),C=(r=>(r.EntityTemplate="entity-template",r.ActionDescriptor="action-descriptor",r.String="string",r.Number="number",r.Boolean="boolean",r.Null="null",r.Enum="enum",r.KeyValue="key-value",r.Date="date",r.UUID="uuid",r.File="file",r.Untyped="untyped",r))(C||{}),Ge=(r=>(r.Addition="addition",r.Subtraction="subtraction",r.Multiplication="multiplication",r.Division="division",r.Remainder="remainder",r.Exponentiation="exponentiation",r))(Ge||{}),re=(r=>(r.Join="string-join",r.Split="string-split",r.DeleteLast="string-delete-last",r.DeleteFirst="string-delete-first",r.DeleteIndex="string-delete-index",r.AddIndex="string-add-index",r.ReplaceFirst="string-replace-first",r.ReplaceLast="string-replace-last",r.ReplaceIndex="string-replace-index",r.ReplaceSingleMatch="string-replace-single-match",r.ReplaceAllMatches="string-replace-all-matches",r.GetIndex="string-get-index",r.GetFirst="string-get-first",r.GetLast="string-get-last",r.Append="string-append",r.Prepend="string-prepend",r))(re||{}),X=(r=>(r.Join="list-join",r.Split="list-split",r.DeleteLast="list-delete-last",r.DeleteFirst="list-delete-first",r.DeleteIndex="list-delete-index",r.AddIndex="list-add-index",r.ReplaceFirst="list-replace-first",r.ReplaceLast="list-replace-last",r.ReplaceIndex="list-replace-index",r.ReplaceSingleMatch="list-replace-single-match",r.ReplaceAllMatches="list-replace-all-matches",r.GetIndex="list-get-index",r.GetFirst="list-get-first",r.GetLast="list-get-last",r.Append="list-append",r.Prepend="list-prepend",r))(X||{}),Ne=(r=>(r.Parallel="parallel",r.Sequential="sequential",r.Wait="wait",r))(Ne||{}),Le=(r=>(r.CreateNewInstance="create-new-instance",r.Validate="validate",r))(Le||{}),dt=(r=>(r.HttpRequest="base-http-request",r))(dt||{}),qe=(r=>(r.Equal="equal",r.NotEqual="not-equal",r.And="and",r.Or="or",r.LessThan="less-than",r.MoreThan="more-than",r.LessThanOrEqual="less-than-or-equal",r.MoreThanOrEqual="more-than-or-equal",r))(qe||{}),Jt=(r=>(r.Empty="empty",r.NotEmpty="not-empty",r))(Jt||{}),j=(r=>(r.ManualFlow="manual-flow-loop",r.Counted="counted-loop",r.List="list-loop",r.ObjectKeys="object-keys-loop",r.ObjectValues="object-values-loop",r.String="string-loop",r))(j||{}),P=(r=>(r.FixedArguments="fixed-arguments",r.FixedReturns="fixed-returns",r.ReturnedError="returned-error",r.OngoingProcessExecution="ongoing-process-execution",r.DynamicArgument="dynamic-argument-types",r.DynamicReturn="dynamic-return-types",r))(P||{}),et=(r=>(r.OrDataTypeGroup="or-data-type-group",r.AndDataTypeGroup="and-data-type-group",r))(et||{}),In=(r=>(r.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",r))(In||{}),Gt=(r=>(r.DeletePersistedEntity="base-delete-persisted-entity",r.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",r.AbortExecution="base-abort-execution",r))(Gt||{}),ri=(r=>(r.Error="error",r.Task="task",r.Return="return",r))(ri||{});const Dn=[i.VariableDeclaration,i.VariableInstance,i.InputMap,i.ReturnDeclaration],Ze=[i.VariableDeclaration,i.VariableInstance,i.ArgumentDeclaration,i.OutputMap],mp=[...Dn,...Ze],Fe=[i.VariableDeclaration,i.VariableInstance],Tp=[i.FunctionDeclaration,i.Condition,i.Loop,i.Operation,i.FunctionCall,i.Search,i.InternalCall,i.GlobalEvent,i.DefinitionEntity,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.VariableDeclaration,i.VariableInstance,i.LiteralValue,i.ActionDescriptor,i.ValueDescriptor,i.Property,i.DataType,i.InstalledProject,i.ArgumentDeclaration,i.InputMap,i.OutputMap,i.ReturnDeclaration],Ep=[i.FunctionDeclaration,i.Property,i.ArgumentDeclaration,i.ReturnDeclaration],Il=[i.FunctionCall,i.VariableInstance,i.InputMap,i.OutputMap,i.InternalCall],UO=[...Il,i.Condition,i.Loop,i.Operation,i.Condition],ii=[i.GlobalEvent],Je=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.InternalCall,i.Loop],Dl=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.Loop],We=[i.FunctionDeclaration,...ii],Xt=[...Je,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],Al=[...Dl,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],sn=[...Je,...We],Rp=[...Dl,...We],xO=[...Xt,...We],jO=[...Al,...We],pt=[...We,i.Loop],xe=[i.ReturnStatement,i.BreakStatement,i.ContinueStatement],kO=[i.DefinitionEntity,i.BuiltInBaseEntity,i.Project,i.InstalledProject,i.GlobalEvent,i.DataType,i.FunctionCall,i.FunctionDeclaration,i.ActionDescriptor,i.ValueDescriptor,i.ArgumentDeclaration,i.InputMap,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.ReturnDeclaration,i.OutputMap,i.PrimitiveEntity,i.LiteralValue,i.Property,i.Operation,i.Condition,i.VariableDeclaration,i.VariableInstance,i.Search,i.Loop,i.InternalCall],os=[i.DefinitionEntity,i.GlobalEvent,i.FunctionDeclaration,i.FunctionCall,i.VariableDeclaration,i.VariableInstance,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.InstalledProject,i.Loop,i.Search],gp=[i.DefinitionEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor],qn=[i.BuiltInBaseEntity,i.PrimitiveEntity],bp=[i.DefinitionEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.GlobalEvent,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor,i.InputMap,i.OutputMap,i.FunctionCall,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.VariableInstance,i.LiteralValue,i.InternalCall];var ls=(r=>(r.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",r))(ls||{});const _={[i.PrimitiveEntity]:{[C.String]:{id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",properties:{}},[C.Boolean]:{id:"f596545d-1565-4faa-9969-d95fa5edfea4",properties:{}},[C.Number]:{id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",properties:{}},[C.KeyValue]:{id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",properties:{}},[C.Enum]:{id:"9542b8b4-2642-4eee-9db9-def7963a17a0",properties:{options:{id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",dataType:{id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",defaultValue:{id:"enum-options-property-data-type-default-value-id"}}}}},[C.UUID]:{id:"4a6234aa-c0f6-4731-b4dd-750388029226",properties:{}},[C.Date]:{id:"dc58f38b-d574-4956-aac6-32ce9529b937",properties:{}},[C.Null]:{id:"7d698f34-5a89-4aab-846b-07ef3843b8c4",properties:{}},[C.Untyped]:{id:"4044a018-818e-49d7-bf9a-c3dd1fff2102",properties:{}}},[i.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[i.BuiltInBaseEntity]:{[F.KEY_VALUE_PARAM]:{id:F.KEY_VALUE_PARAM},[F.HTTP_ENDPOINT]:{id:F.HTTP_ENDPOINT,properties:{method:{id:"http-endpoint-built-in-method-property-id"},path:{id:"http-endpoint-built-in-path-property-id"},cors:{id:"http-endpoint-built-in-cors-property-id"}}},[F.PERSISTED_ENTITY]:{id:F.PERSISTED_ENTITY,properties:{database:{id:"persisted-built-in-base-entity-database-property-id"},primaryKey:{id:"persisted-built-in-base-entity-primary-key-property-id"}}},[F.RELATIONAL_DATABASE]:{id:F.RELATIONAL_DATABASE,properties:{identifier:{id:"relational-database-built-in-base-entity-identifier-property-id"},username:{id:"relational-database-built-in-base-entity-username-property-id"},password:{id:"relational-database-built-in-base-entity-password-property-id"},minSize:{id:"relational-database-built-in-base-entity-min-size-property-id"},default:{id:"relational-database-built-in-base-entity-default-property-id"},autoscaling:{id:"relational-database-built-in-base-entity-autoscaling-property-id"}}},[F.CRON_JOB]:{id:F.CRON_JOB,properties:{expression:{id:"cron-job-built-in-base-entity-expression-property-id"}}}},[i.Operation]:{[re.Join]:{id:re.Join,inputs:{separator:{id:"join-strings-separator-input-id"},first:{id:"join-strings-first-string-input-id"},second:{id:"join-strings-second-string-input-id"},dynamicString:{id:"join-strings-dynamic-string-input-id"}},outputs:{result:{id:"join-strings-result-string-return-delaration-id"},error:{id:"join-strings-error-return-delaration-id"}}},[re.Split]:{id:re.Split,inputs:{stringValue:{id:"split-string-string-input-id"},indexLocation:{id:"split-string-index-input-id"}},outputs:{firstPartResult:{id:"split-string-first-part-result-string-return-delaration-id"},secondPartResult:{id:"split-string-second-part-result-string-return-delaration-id"},error:{id:"split-string-error-return-delaration-id"}}},[Ge.Addition]:{id:Ge.Addition,inputs:{firstSummand:{id:"number-addition-first-summand-number-input-id"},secondSummand:{id:"number-addition-second-summand-number-input-id"},dynamicSummand:{id:"number-addition-dynamic-summand-number-input-id"}},outputs:{result:{id:"number-addition-result-number-return-delaration-id",dataType:{id:"number-addition-result-number-data-type-id"}},error:{id:"number-addition-error-return-delaration-id"}}},[Ge.Subtraction]:{id:Ge.Subtraction,inputs:{minuend:{id:"number-subtraction-minuend-number-input-id"},subtrahend:{id:"number-subtraction-subtrahend-number-input-id"},dynamicSubtrahend:{id:"number-subtraction-dynamic-subtrahend-number-input-id"}},outputs:{result:{id:"number-subtraction-result-number-return-delaration-id",dataType:{id:"number-subtraction-result-number-data-type-id"}},error:{id:"number-subtraction-error-return-delaration-id"}}},[dt.HttpRequest]:{id:dt.HttpRequest,inputs:{url:{id:"http-request-url-input-id"},query:{id:"http-request-query-input-id"},method:{id:"http-request-method-input-id"},headers:{id:"http-request-headers-input-id"},body:{id:"http-request-body-string-input-id"}},outputs:{code:{id:"http-response-code-return-delaration-id"},body:{id:"http-response-body-return-delaration-id"},headers:{id:"http-response-headers-return-delaration-id"},error:{id:"http-request-error-return-delaration-id"}}},[Le.Validate]:{id:Le.Validate,inputs:{entityToMatch:{id:"validate-data-entity-to-match-input-id"},dataToValidate:{id:"validate-data-data-to-validate-input-id"}},outputs:{outputEntity:{id:"validate-data-output-entity-return-delaration-id"},error:{id:"validate-data-error-return-delaration-id"}}},[Ne.Parallel]:{id:Ne.Parallel,inputs:{listOfActions:{id:"parallel-execution-list-of-actions-input-id"}},outputs:{results:{id:"parallel-execution-results-output-id",dataType:{id:"parallel-execution-results-data-type-id"}},error:{id:"parallel-execution-error-output-id"}}}},[i.Loop]:{[j.List]:{id:j.List,inputs:{list:{id:"iterate-over-list-loop-list-input-id"}},outputs:{results:{id:"iterate-over-list-loop-output-id"}},body:{id:"iterate-over-list-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-list-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-list-loop-current-value-input-id"}}}},[j.String]:{id:j.String,inputs:{string:{id:"iterate-over-string-loop-string-input-id"}},outputs:{results:{id:"iterate-over-string-loop-output-id"}},body:{id:"iterate-over-string-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-string-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-string-loop-current-value-input-id"}}}},[j.ObjectKeys]:{id:j.ObjectKeys,inputs:{object:{id:"iterate-over-object-keys-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-keys-loop-output-id"}},body:{id:"iterate-over-object-keys-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-keys-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-keys-loop-current-value-input-id"}}}},[j.ObjectValues]:{id:j.ObjectValues,inputs:{object:{id:"iterate-over-object-values-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-values-loop-output-id"}},body:{id:"iterate-over-object-values-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-values-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-values-loop-current-value-input-id"}}}},[j.ManualFlow]:{id:j.ManualFlow,inputs:{},outputs:{results:{id:"manual-flow-loop-output-id"}},body:{id:"manual-flow-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-manual-flow-loop-iteration-number-input-id"}}}},[j.Counted]:{id:j.Counted,inputs:{number:{id:"counted-loop-number-input-id"}},outputs:{results:{id:"counted-loop-output-id"}},body:{id:"counted-loop-body-descriptor-id",inputs:{iterationNumber:{id:"counted-loop-iteration-number-input-id"}}}}},[i.Condition]:{[qe.MoreThanOrEqual]:{id:qe.MoreThanOrEqual,inputs:{leftHand:{id:"condition-more-than-or-equal-left-hand-input-id",dataType:{id:"condition-more-than-or-equal-left-hand-data-type-id"}},rightHand:{id:"condition-more-than-or-equal-right-hand-input-id",dataType:{id:"condition-more-than-or-equal-right-hand-data-type-id"}}}},[Jt.NotEmpty]:{id:Jt.NotEmpty,inputs:{leftHand:{id:"condition-not-empty-input-id"}}}},[i.GlobalEvent]:{[In.PROJECT_PUBLICATION_COMPLETED]:{id:In.PROJECT_PUBLICATION_COMPLETED}}},$t=_[i.PrimitiveEntity],J={type:i.PrimitiveEntity,id:$t.string.id,description:"A string of characters.",version:1,name:C.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},An={type:i.PrimitiveEntity,id:$t.boolean.id,description:"A 'true' or 'false' value.",version:1,name:C.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},ee={type:i.PrimitiveEntity,id:$t.number.id,description:"A number value.",version:1,name:C.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},vp={type:i.PrimitiveEntity,id:$t.null.id,description:"An explicitly empty value.",version:1,name:C.Null,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},it={type:i.PrimitiveEntity,id:$t.untyped.id,description:"Data of any type that isn't known in advance.",version:1,name:C.Untyped,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ip={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:i.GenericReference,entityId:$t.enum.properties.options.id,entityType:i.Property},Dp={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:i.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:i.Property},Ap={like:!1,inferred:!1,id:$t.enum.properties.options.dataType.id,version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:J,asType:!1,parent:Dp},Sp={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:i.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:i.PrimitiveEntity},Op={constant:!1,hidden:!1,required:!0,id:$t.enum.properties.options.id,name:"Options",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,defaultValue:{id:$t.enum.properties.options.dataType.defaultValue.id,type:i.LiteralValue,version:1,name:C.KeyValue,autogeneration:null,value:[],valueAsType:null,parent:Ip},dataType:Ap,description:"Options for the enum. Each option is a text value.",parent:Sp},Sn={type:i.PrimitiveEntity,id:$t.enum.id,description:"A set of text options to choose from.",version:1,name:C.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[Op],methods:[]},on={type:i.PrimitiveEntity,id:$t.date.id,description:"A date and time value.",version:1,name:C.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},On={type:i.PrimitiveEntity,id:$t.uuid.id,description:"A unique identifier in the form of a 36-character string.",version:1,name:C.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[J],properties:[],methods:[]},ai={type:i.PrimitiveEntity,id:$t[C.KeyValue].id,description:"A complex data structure with any combination of properties with names and values.",version:1,name:C.KeyValue,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Pp=[J,An,ee,vp,it,Sn,on,On,ai],ln=_[i.Operation][Ge.Addition],Cp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:ln.inputs.firstSummand.id,entityType:i.ValueDescriptor},wp={like:!1,inferred:!1,id:"number-addition-first-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Cp},Bp={type:i.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:ln.inputs.secondSummand.id,entityType:i.ValueDescriptor},Mp={like:!1,inferred:!1,id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Bp},_p={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:ln.outputs.result.id,entityType:i.ValueDescriptor},Vp={like:!1,inferred:!1,id:ln.outputs.result.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:_p},Np={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ge.Addition,entityType:i.ActionDescriptor},Sl={id:ln.inputs.firstSummand.id,type:i.ValueDescriptor,version:1,name:"Summand",description:"The first number to add",defaultValue:null,dataType:wp,required:!0,parentRelationType:P.FixedArguments,index:0,parent:Np},Lp={type:i.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:Ge.Addition,entityType:i.ActionDescriptor},Ol={id:ln.inputs.secondSummand.id,type:i.ValueDescriptor,description:"The second number to add",version:1,name:"Summand",defaultValue:null,dataType:Mp,required:!0,parentRelationType:P.FixedArguments,index:1,parent:Lp},Pl={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ge.Addition,entityType:i.ActionDescriptor},Cl={parentRelationType:P.FixedReturns,id:ln.outputs.result.id,type:i.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",defaultValue:null,dataType:Vp,required:!0,index:0,parent:Pl},Gp={type:i.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:Ge.Addition,entityType:i.ActionDescriptor},$p={parentRelationType:P.FixedReturns,id:ln.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Gp},Fp={type:i.GenericReference,id:"number-addition-operation-dynamic-summand-argument-type-parent-ref",entityId:ln.inputs.dynamicSummand.id,entityType:i.ValueDescriptor},Up={like:!1,inferred:!1,id:"number-addition-operation-dynamic-summand-argument-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Fp},xp={parentRelationType:P.DynamicArgument,id:ln.inputs.dynamicSummand.id,type:i.ValueDescriptor,description:"A number to add",version:1,name:"Summand",defaultValue:null,dataType:Up,required:!0,index:2,parent:Pl},ds={id:Ge.Addition,type:i.ActionDescriptor,description:"Sum numbers",version:1,name:Ge.Addition,inputs:[Sl,Ol,xp],error:$p,outputs:[Cl],parent:null},dn=_[i.Operation][Ge.Subtraction],jp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:dn.inputs.minuend.id,entityType:i.ValueDescriptor},kp={like:!1,inferred:!1,id:"number-subtraction-first-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:jp},qp={type:i.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:dn.inputs.subtrahend.id,entityType:i.ValueDescriptor},Jp={like:!1,inferred:!1,id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:qp},Wp={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:dn.outputs.result.id,entityType:i.ValueDescriptor},Yp={like:!1,inferred:!1,id:dn.outputs.result.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Wp},wl={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},Hp={id:dn.inputs.minuend.id,type:i.ValueDescriptor,version:1,name:"Minuend",description:"Base number to substract from",defaultValue:null,dataType:kp,required:!0,parentRelationType:P.FixedArguments,index:0,parent:wl},zp={type:i.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},Zp={id:dn.inputs.subtrahend.id,type:i.ValueDescriptor,description:"The second number to substract",version:1,name:"Subtrahend",defaultValue:null,dataType:Jp,required:!0,parentRelationType:P.FixedArguments,index:1,parent:zp},Kp={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},Xp={parentRelationType:P.FixedReturns,id:dn.outputs.result.id,type:i.ValueDescriptor,description:"The result number of the subtraction",version:1,name:"Result",defaultValue:null,dataType:Yp,required:!0,index:0,parent:Kp},Qp={type:i.GenericReference,id:"number-subtraction-operation-error-parent-ref",entityId:Ge.Subtraction,entityType:i.ActionDescriptor},ey={parentRelationType:P.FixedReturns,id:dn.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Qp},ty={type:i.GenericReference,id:"number-subtraction-operation-dynamic-subtrahend-argument-type-parent-ref",entityId:dn.inputs.dynamicSubtrahend.id,entityType:i.ValueDescriptor},ny={like:!1,inferred:!1,id:"number-subtraction-operation-dynamic-subtrahend-argument-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:ty},ry={id:dn.inputs.dynamicSubtrahend.id,type:i.ValueDescriptor,version:1,name:"Subtrahend",description:"A number to substract",defaultValue:null,dataType:ny,required:!0,parentRelationType:P.DynamicArgument,index:2,parent:wl},Bl={id:Ge.Subtraction,type:i.ActionDescriptor,description:"Substract numbers",version:1,name:Ge.Subtraction,inputs:[Hp,Zp,ry],error:ey,outputs:[Xp],parent:null},iy={[Ge.Addition]:ds,[Ge.Subtraction]:Bl},Wt=_[i.Operation][re.Join],ay={type:i.GenericReference,id:"join-strings-first-string-argument-declaration",entityId:Wt.inputs.first.id,entityType:i.ValueDescriptor},sy={like:!1,inferred:!1,id:"join-strings-first-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:ay},oy={type:i.GenericReference,id:"join-strings-second-string-argument-declaration",entityId:Wt.inputs.second.id,entityType:i.ValueDescriptor},ly={like:!1,inferred:!1,id:"join-strings-second-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:oy},dy={type:i.GenericReference,id:"join-strings-result-string-return-delaration",entityId:Wt.outputs.result.id,entityType:i.ValueDescriptor},cy={like:!1,inferred:!1,id:"join-strings-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:dy},uy={type:i.GenericReference,id:"join-strings-operation-first-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},cs={id:Wt.inputs.first.id,type:i.ValueDescriptor,version:1,name:"Text",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",defaultValue:null,dataType:sy,parentRelationType:P.FixedArguments,required:!0,index:1,parent:uy},py={type:i.GenericReference,id:"join-strings-first-string-argument-declaration",entityId:Wt.inputs.first.id,entityType:i.ValueDescriptor},yy={type:i.GenericReference,id:"join-strings-separator-string-data-type-default-value-parent-ref",entityId:Wt.inputs.separator.id,entityType:i.ValueDescriptor},hy={type:i.LiteralValue,id:"join-strings-separator-string-data-type-default-value-id",version:1,name:C.String,value:"",valueAsType:null,autogeneration:null,parent:yy},fy={like:!1,inferred:!1,id:"join-strings-separator-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:py},my={type:i.GenericReference,id:"join-strings-operation-separator-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Ty={id:Wt.inputs.separator.id,type:i.ValueDescriptor,version:1,name:"Separator",description:"The text value that will be inserted between each of the values that are joined.",defaultValue:hy,dataType:fy,parentRelationType:P.FixedArguments,required:!1,index:0,parent:my},Ey={type:i.GenericReference,id:"join-strings-operation-second-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},us={id:Wt.inputs.second.id,type:i.ValueDescriptor,version:1,name:"Text",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",defaultValue:null,dataType:ly,parentRelationType:P.FixedArguments,required:!0,index:2,parent:Ey},Ry={type:i.GenericReference,id:"join-strings-operation-result-string-return-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Zi={parentRelationType:P.FixedReturns,id:Wt.outputs.result.id,type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",defaultValue:null,dataType:cy,required:!0,index:0,parent:Ry},gy={type:i.GenericReference,id:"join-strings-operation-error-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},by={parentRelationType:P.FixedReturns,id:Wt.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:gy},vy={type:i.GenericReference,id:"join-strings-dynamic-string-argument-declaration",entityId:Wt.inputs.dynamicString.id,entityType:i.ValueDescriptor},Iy={like:!1,inferred:!1,id:"join-strings-dynamic-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:vy},Dy={type:i.GenericReference,id:"join-strings-operation-dynamic-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Ay={id:Wt.inputs.dynamicString.id,type:i.ValueDescriptor,version:1,name:"Text",description:"Text to join to the previous ones. Its value will be at the end of the resulting text.",defaultValue:null,dataType:Iy,parentRelationType:P.DynamicArgument,required:!0,index:3,parent:Dy},Ki={id:re.Join,type:i.ActionDescriptor,version:1,name:re.Join,description:"Join text values together, to form a single resulting text value.",inputs:[Ty,cs,us,Ay],outputs:[Zi],error:by,parent:null},Pn=_[i.Operation][re.Split],Sy={type:i.GenericReference,id:"split-string-string-argument-declaration",entityId:Pn.inputs.stringValue.id,entityType:i.ValueDescriptor},Oy={like:!1,inferred:!1,id:"split-string-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:Sy},Py={type:i.GenericReference,id:"split-string-index-argument-declaration",entityId:Pn.inputs.indexLocation.id,entityType:i.ValueDescriptor},Cy={like:!1,inferred:!1,id:"split-string-index-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Py},wy={type:i.GenericReference,id:"split-string-first-part-result-string-return-delaration",entityId:Pn.outputs.firstPartResult.id,entityType:i.ValueDescriptor},By={like:!1,inferred:!1,id:"split-string-first-part-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:wy},My={type:i.GenericReference,id:"split-string-second-part-result-string-return-delaration",entityId:Pn.outputs.secondPartResult.id,entityType:i.ValueDescriptor},_y={like:!1,inferred:!1,id:"split-string-second-part-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:My},Vy={type:i.GenericReference,id:"split-string-operation-string-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Ny={id:Pn.inputs.stringValue.id,type:i.ValueDescriptor,version:1,name:"Text value",description:"The text value that will be split into two at the given index location.",defaultValue:null,dataType:Oy,parentRelationType:P.FixedArguments,required:!0,index:0,parent:Vy},Ly={type:i.GenericReference,id:"split-string-operation-index-argument-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Gy={id:Pn.inputs.indexLocation.id,type:i.ValueDescriptor,version:1,name:"Index location",description:"The index location where the text will be split into two. The text at this index will be the beginning of the second text.",defaultValue:null,dataType:Cy,parentRelationType:P.FixedArguments,required:!0,index:1,parent:Ly},$y={type:i.GenericReference,id:"split-string-operation-second-part-result-string-return-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},qO={parentRelationType:P.FixedReturns,id:Pn.outputs.secondPartResult.id,type:i.ValueDescriptor,version:1,name:"Second part",description:"The secont part of the resulting text value.",defaultValue:null,dataType:_y,required:!0,index:1,parent:$y},Fy={type:i.GenericReference,id:"split-string-operation-first-part-result-string-return-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},Uy={parentRelationType:P.FixedReturns,id:Pn.outputs.firstPartResult.id,type:i.ValueDescriptor,version:1,name:"First part",description:"The first part of the resulting text value.",defaultValue:null,dataType:By,required:!0,index:0,parent:Fy},xy={type:i.GenericReference,id:"split-string-operation-error-parent-ref",entityId:re.Join,entityType:i.ActionDescriptor},jy={parentRelationType:P.FixedReturns,id:Pn.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:xy},Ml={id:re.Split,type:i.ActionDescriptor,version:1,name:re.Split,description:"Split a text into two, at the given index location.",inputs:[Ny,Gy],outputs:[Uy],error:jy,parent:null},ky={[re.Join]:Ki,[re.Split]:Ml};var qy=(r=>(r.FirstInputList="join-list-first-list-argument-declaration",r.SecondInputList="join-list-second-list-argument-declaration",r))(qy||{}),Jy=(r=>(r.ResultList="join-list-result-list-return-delaration",r.Error="join-list-error-return-delaration",r))(Jy||{});const Wy={type:i.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:i.ValueDescriptor},Yy={like:!1,inferred:!1,id:"join-list-first-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Wy},Hy={type:i.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:i.ValueDescriptor},zy={like:!1,inferred:!1,id:"join-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Hy},Zy={type:i.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:i.ValueDescriptor},Ky={like:!1,inferred:!1,id:"join-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Zy},Xy={type:i.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},Qy={id:"join-list-first-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first list to join to the second one. Its values will be at the beginning of the resulting list.",defaultValue:null,dataType:Yy,parentRelationType:P.FixedArguments,required:!0,index:0,parent:Xy},eh={type:i.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},th={id:"join-list-second-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"Second value",description:"The second list to join to the first one. Its values will be at the end of the resulting list.",defaultValue:null,dataType:zy,parentRelationType:P.FixedArguments,required:!0,index:1,parent:eh},nh={type:i.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},rh={parentRelationType:P.FixedReturns,id:"join-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",defaultValue:null,dataType:Ky,required:!0,index:0,parent:nh},ih={type:i.GenericReference,id:"join-list-operation-error-parent-ref",entityId:X.Join,entityType:i.ActionDescriptor},ah={parentRelationType:P.FixedReturns,id:"join-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:ih},_l={id:X.Join,type:i.ActionDescriptor,version:1,name:X.Join,description:"Join two lists together, to form a single resulting list value.",inputs:[Qy,th],error:ah,outputs:[rh],parent:null};var sh=(r=>(r.InputList="list-to-split-argument-declaration",r.SplitIndex="split-list-index-argument-declaration",r))(sh||{}),oh=(r=>(r.FirstOutputList="split-list-first-output-list-return-delaration",r.SecondOutputList="split-list-second-output-list-return-delaration",r.Error="split-list-error-return-delaration",r))(oh||{});const lh={type:i.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:i.ValueDescriptor},dh={like:!1,inferred:!1,id:"split-list-operation-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:lh},ch={type:i.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:i.ValueDescriptor},uh={like:!1,inferred:!1,id:"split-list-operation-split-index-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:ch},Vl={type:i.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:i.ValueDescriptor},ph={like:!1,inferred:!1,id:"split-list-operation-first-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Vl},yh={type:i.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},hh={id:"list-to-split-argument-declaration",type:i.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",defaultValue:null,dataType:dh,parentRelationType:P.FixedArguments,required:!0,index:0,parent:yh},fh={type:i.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},mh={id:"split-list-index-argument-declaration",type:i.ValueDescriptor,version:1,name:"Split location",description:"The index at which to split the list. The value at this index will be the first value of the second list.",defaultValue:null,dataType:uh,parentRelationType:P.FixedArguments,required:!0,index:1,parent:fh},Th={type:i.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},Eh={parentRelationType:P.FixedReturns,id:"split-list-first-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",defaultValue:null,dataType:ph,required:!0,index:0,parent:Th},Rh={like:!1,inferred:!1,id:"split-list-operation-second-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Vl},gh={type:i.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},bh={parentRelationType:P.FixedReturns,id:"split-list-second-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",defaultValue:null,dataType:Rh,required:!0,index:0,parent:gh},vh={type:i.GenericReference,id:"split-list-operation-error-parent-ref",entityId:X.Split,entityType:i.ActionDescriptor},Ih={parentRelationType:P.FixedReturns,id:"split-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:vh},Nl={id:X.Split,type:i.ActionDescriptor,version:1,name:X.Split,description:"Splits a given list at the given index, and returns two lists, one with the values up to the index, and the other with the values after the index",inputs:[hh,mh],outputs:[Eh,bh],error:Ih,parent:null};var Dh=(r=>(r.InputList="get-last-in-list-input-list-argument-declaration",r))(Dh||{}),Ah=(r=>(r.OutputElement="get-last-in-list-output-element-return-delaration",r.Error="get-last-in-list-error-return-delaration",r))(Ah||{});const Sh={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:i.ValueDescriptor},Oh={like:!1,inferred:!1,id:"get-last-in-list-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Sh},Ph={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:i.ValueDescriptor},Ch={like:!1,inferred:!1,id:"get-last-in-list-output-element-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:Ph},wh={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:X.GetLast,entityType:i.ActionDescriptor},Bh={id:"get-last-in-list-input-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",defaultValue:null,dataType:Oh,parentRelationType:P.FixedArguments,required:!0,index:0,parent:wh},Mh={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:X.GetLast,entityType:i.ActionDescriptor},_h={parentRelationType:P.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:i.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",defaultValue:null,dataType:Ch,required:!0,index:0,parent:Mh},Vh={type:i.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:X.GetLast,entityType:i.ActionDescriptor},Nh={parentRelationType:P.FixedReturns,id:"get-last-in-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Vh},Ll={id:X.GetLast,type:i.ActionDescriptor,version:1,name:X.GetLast,description:"Outputs the last element of a given list.",inputs:[Bh],outputs:[_h],error:Nh,parent:null};var Lh=(r=>(r.List="append-to-list-lsit-argument-declaration",r.ElementToAppend="append-to-list-element-to-append-argument-declaration",r))(Lh||{}),Gh=(r=>(r.ResultList="append-to-list-result-list-return-delaration",r.Error="append-to-list-error-return-delaration",r))(Gh||{});const $h={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:i.ValueDescriptor},Fh={like:!1,inferred:!1,id:"append-to-list-lsit-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:$h},Uh={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:i.ValueDescriptor},xh={like:!1,inferred:!1,id:"append-to-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,parent:Uh},jh={type:i.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:i.ValueDescriptor},kh={like:!1,inferred:!1,id:"append-to-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!0,parent:jh},qh={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},Gl={id:"append-to-list-lsit-argument-declaration",type:i.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",defaultValue:null,dataType:Fh,parentRelationType:P.FixedArguments,required:!0,index:0,parent:qh},Jh={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},$l={id:"append-to-list-element-to-append-argument-declaration",type:i.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",defaultValue:null,dataType:xh,parentRelationType:P.FixedArguments,required:!0,index:1,parent:Jh},Wh={type:i.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},Yh={parentRelationType:P.FixedReturns,id:"append-to-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",defaultValue:null,dataType:kh,required:!0,index:0,parent:Wh},Hh={type:i.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:X.Append,entityType:i.ActionDescriptor},zh={parentRelationType:P.FixedReturns,id:"append-to-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Hh},ps={id:X.Append,type:i.ActionDescriptor,version:1,name:X.Append,description:"Adds a given element to the end of a list value.",inputs:[Gl,$l],error:zh,outputs:[Yh],parent:null},Zh={[X.Join]:_l,[X.Split]:Nl,[X.GetLast]:Ll,[X.Append]:ps},si=_[i.Operation][Ne.Parallel],Kh={id:"parallel-execution-list-of-functions-blueprint-dynamic-output-id",type:i.ValueDescriptor,version:1,name:"Any output value",description:"An output value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},Xh={id:"parallel-execution-list-of-functions-blueprint-dynamic-input-id",type:i.ValueDescriptor,version:1,name:"Any input value",description:"An input value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},Qh={id:"parallel-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",inputs:[Xh],outputs:[Kh],error:null,parent:null},ef={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:si.inputs.listOfActions.id,entityType:i.ValueDescriptor},tf={like:!1,inferred:!1,id:"parallel-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Qh,asType:!1,isList:!0,parent:ef},nf={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:si.outputs.results.id,entityType:i.ValueDescriptor},rf={like:!1,inferred:!1,id:si.outputs.results.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!0,parent:nf},af={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ne.Parallel,entityType:i.ActionDescriptor},Fl={id:si.inputs.listOfActions.id,type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:tf,defaultValue:null,required:!0,index:0,parent:af,parentRelationType:P.FixedArguments},sf={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ne.Parallel,entityType:i.ActionDescriptor},Ul={id:si.outputs.results.id,type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:rf,defaultValue:null,required:!0,index:0,parent:sf,parentRelationType:P.FixedReturns},of={type:i.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ne.Parallel,entityType:i.ActionDescriptor},lf={id:si.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:of,parentRelationType:P.ReturnedError},Qt={id:Ne.Parallel,type:i.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ne.Parallel,inputs:[Fl],outputs:[Ul],error:lf,parent:null};var df=(r=>(r.MillisecondsNumber="wait-milliseconds-number-argument-declaration",r))(df||{}),cf=(r=>(r.Error="wait-operation-error-return-delaration",r))(cf||{});const uf={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:i.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},pf={like:!1,inferred:!1,id:"wait-milliseconds-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:uf},yf={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:i.ActionDescriptor,entityId:Ne.Wait},pr={id:"wait-milliseconds-number-argument-declaration",type:i.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",defaultValue:null,dataType:pf,required:!0,index:0,parent:yf,parentRelationType:P.FixedArguments},hf={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ne.Wait,entityType:i.ActionDescriptor},ff={id:"wait-operation-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:hf,parentRelationType:P.ReturnedError},Rt={id:Ne.Wait,type:i.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ne.Wait,inputs:[pr],outputs:[],error:ff,parent:null};var mf=(r=>(r.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",r))(mf||{}),Tf=(r=>(r.ListOfExecutionResults="sequential-execution-result-return-delaration",r.Error="sequential-execution-error-return-delaration",r))(Tf||{});const Ef={id:"sequential-execution-list-of-functions-blueprint-dynamic-output-id",type:i.ValueDescriptor,version:1,name:"Any output value",description:"An output value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},Rf={id:"sequential-execution-list-of-functions-blueprint-dynamic-input-id",type:i.ValueDescriptor,version:1,name:"Any input value",description:"An input value of any type, to be used in the action to be executed.",defaultValue:null,dataType:null,required:!1,index:0,parent:null,parentRelationType:P.DynamicArgument},gf={id:"sequential-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",inputs:[Rf],outputs:[Ef],error:null,parent:null},bf={type:i.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:i.ValueDescriptor},vf={like:!1,inferred:!1,id:"sequential-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:gf,asType:!1,isList:!0,parent:bf},If={type:i.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:i.ValueDescriptor},Df={like:!1,inferred:!1,id:"sequential-execution-list-of-execution-results-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!0,parent:If},Af={type:i.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ne.Sequential,entityType:i.ActionDescriptor},xl={id:"sequential-execution-list-of-functions-argument-declaration",type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",defaultValue:null,dataType:vf,required:!0,index:0,parent:Af,parentRelationType:P.FixedArguments},Sf={type:i.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ne.Sequential,entityType:i.ActionDescriptor},jl={id:"sequential-execution-result-return-delaration",type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",defaultValue:null,dataType:Df,required:!0,index:0,parent:Sf,parentRelationType:P.FixedReturns},Of={type:i.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ne.Sequential,entityType:i.ActionDescriptor},Pf={id:"sequential-execution-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:Of,parentRelationType:P.ReturnedError},Cn={id:Ne.Sequential,type:i.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ne.Sequential,inputs:[xl],outputs:[jl],error:Pf,parent:null},Cf={[Ne.Parallel]:Qt,[Ne.Wait]:Rt,[Ne.Sequential]:Cn};var wf=(r=>(r.EntityToInstanciate="entity-to-instanciate-argument-declaration",r.NewEntityData="new-entity-data-argument-declaration",r))(wf||{}),Bf=(r=>(r.Error="create-new-instance-error-return-delaration",r))(Bf||{});const Mf={type:i.GenericReference,id:"new-entity-data-argument-declaration-parent-ref",entityId:Le.CreateNewInstance,entityType:i.ActionDescriptor},_f={type:i.GenericReference,id:"new-entity-data-argument-data-type-parent-ref",entityId:"new-entity-data-argument-declaration",entityType:i.ValueDescriptor},Vf={like:!1,inferred:!1,id:"new-entity-data-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:_f},Nf={id:"new-entity-data-argument-declaration",type:i.ValueDescriptor,version:1,name:"Data for new entity",description:"The data to be used to create the new entity, with all the required properties",dataType:Vf,required:!0,defaultValue:null,parentRelationType:P.FixedArguments,index:1,parent:Mf},Lf={type:i.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},Gf={like:!1,inferred:!1,id:"entity-to-instanciate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,parent:Lf},$f={type:i.GenericReference,id:"create-new-instance-operation-ref",entityType:i.ActionDescriptor,entityId:Le.CreateNewInstance},Ff={id:"entity-to-instanciate-argument-declaration",type:i.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",defaultValue:null,dataType:Gf,required:!0,parentRelationType:P.FixedArguments,index:0,parent:$f},Uf={type:i.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Le.CreateNewInstance,entityType:i.ActionDescriptor},xf={parentRelationType:P.FixedReturns,id:"create-new-instance-output-entity-declaration",type:i.ValueDescriptor,version:1,name:"Created entity",description:"The entity that was created",defaultValue:null,dataType:null,parent:Uf,required:!0,index:0},jf={type:i.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Le.CreateNewInstance,entityType:i.ActionDescriptor},kf={parentRelationType:P.FixedReturns,id:"create-new-instance-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",defaultValue:null,dataType:null,required:!0,index:1,parent:jf},yr={id:Le.CreateNewInstance,type:i.ActionDescriptor,description:"Creates a new copy of a given entity, with the given values for each property, or default values if a value is not provided",version:1,name:Le.CreateNewInstance,inputs:[Ff,Nf],outputs:[xf],error:kf,parent:null},oi=_[i.Operation][Le.Validate],qf={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:oi.inputs.dataToValidate.id},Jf={like:!1,inferred:!1,id:"validate-data-operation-data-to-validate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:qf},Wf={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Le.Validate},Yf={id:oi.inputs.dataToValidate.id,type:i.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",defaultValue:null,dataType:Jf,required:!0,parentRelationType:P.FixedArguments,index:0,parent:Wf},Hf={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:oi.inputs.entityToMatch.id},zf={like:!1,inferred:!1,id:"validate-data-operation-entity-to-match-type-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,parent:Hf},Zf={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Le.Validate},Kf={id:oi.inputs.entityToMatch.id,type:i.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:zf,defaultValue:null,required:!0,index:0,parentRelationType:P.FixedArguments,parent:Zf},Xf={type:i.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Le.Validate,entityType:i.ActionDescriptor},Qf={id:oi.outputs.outputEntity.id,type:i.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",defaultValue:null,parent:Xf,required:!0,index:0,parentRelationType:P.FixedReturns},em={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Le.Validate,entityType:i.ActionDescriptor},tm={id:oi.outputs.error.id,type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,defaultValue:null,required:!0,index:1,parent:em,parentRelationType:P.ReturnedError},hr={id:Le.Validate,type:i.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Le.Validate,inputs:[Kf,Yf],outputs:[Qf],error:tm,parent:null},nm={[Le.CreateNewInstance]:yr,[Le.Validate]:hr},Qe=_[i.Operation]["base-http-request"],rm={type:i.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:i.ValueDescriptor,entityId:Qe.inputs.url.id},im={id:"http-request-url-default-value-id",type:i.LiteralValue,version:1,value:"https://some-url.com",name:C.String,valueAsType:null,parent:rm,autogeneration:null},am={type:i.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Qe.inputs.url.id,entityType:i.ValueDescriptor},sm={like:!1,inferred:!1,id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:am},om={type:i.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Qe.inputs.query.id,entityType:i.ValueDescriptor},lm={like:!1,inferred:!1,id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:om},dm={type:i.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:i.ValueDescriptor,entityId:Qe.inputs.method.id},cm={id:"http-request-method-default-value-id",type:i.LiteralValue,version:1,value:"GET",name:C.Enum,valueAsType:null,parent:dm,autogeneration:null},um={type:i.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Qe.inputs.method.id,entityType:i.ValueDescriptor},pm={like:!1,inferred:!1,id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:um},ym={type:i.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Qe.inputs.headers.id,entityType:i.ValueDescriptor},hm={like:!1,inferred:!1,id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,asType:!1,isList:!1,parent:ym},fm={type:i.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Qe.inputs.body.id,entityType:i.ValueDescriptor},mm={like:!1,inferred:!1,id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,asType:!1,isList:!1,parent:fm},Tm={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:Qe.outputs.code.id},Em={like:!1,inferred:!1,id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Tm},Rm={type:i.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:i.ValueDescriptor,entityId:Qe.outputs.headers.id},gm={type:i.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:i.ValueDescriptor,entityId:Qe.outputs.headers.id},bm={like:!1,inferred:!1,id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,isList:!1,asType:!1,parent:gm},vm={type:i.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:i.ValueDescriptor,entityId:Qe.outputs.body.id},Im={type:i.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:i.ValueDescriptor,entityId:Qe.outputs.body.id},Dm={like:!1,inferred:!1,id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,isList:!1,asType:!1,parent:Im},Am={type:i.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},ys={id:Qe.inputs.method.id,type:i.ValueDescriptor,description:"A single word that represents the type of request you want to make. For example: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, CUSTOM",version:1,name:"Method",defaultValue:cm,dataType:pm,required:!1,index:0,parentRelationType:P.FixedArguments,parent:Am},Sm={type:i.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},hs={id:Qe.inputs.url.id,type:i.ValueDescriptor,description:"The base domain, or address where the request is being sent to. For example: https://some-url.com",version:1,name:"URL",dataType:sm,defaultValue:im,required:!1,index:1,parentRelationType:P.FixedArguments,parent:Sm},Om={type:i.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},kl={id:Qe.inputs.query.id,type:i.ValueDescriptor,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",version:1,name:"Query Params",defaultValue:null,dataType:lm,required:!1,index:2,parentRelationType:P.FixedArguments,parent:Om},Pm={type:i.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},fs={id:Qe.inputs.headers.id,type:i.ValueDescriptor,description:"A set of any properties, with names and values that represent metadata about the request, such as the server, date, content type, and more, that you want to send alongside your request data.",version:1,name:"Headers",defaultValue:null,dataType:hm,required:!1,index:3,parent:Pm,parentRelationType:P.FixedArguments},Cm={type:i.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},ms={id:Qe.inputs.body.id,type:i.ValueDescriptor,description:"The main data payload of the request. This is the data that you want to send to the server. It could be anything, but it is usually a KeyValue data structure or a text value.",version:1,name:"Body",dataType:mm,defaultValue:null,required:!1,index:4,parentRelationType:P.FixedArguments,parent:Cm},wm={type:i.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Ts={id:Qe.outputs.code.id,type:i.ValueDescriptor,description:'A standardized status code of the response. It is a 3-digit number that represents the response status. For example, 200 means "OK", 404 means "Not Found", and 500 means "Internal Server Error".',version:1,name:"Code",defaultValue:null,dataType:Em,required:!0,index:0,parentRelationType:P.FixedReturns,parent:wm},Bm={type:i.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Es={parentRelationType:P.FixedReturns,id:Qe.outputs.headers.id,type:i.ValueDescriptor,description:"A set of any properties, with names and value that the server sent back to you. It represents metadata about the response, such as the server, date, content type, and more.",version:1,name:"Headers",defaultValue:{id:"http-response-headers-default-value-id",type:i.LiteralValue,version:1,value:{},name:C.KeyValue,parent:Rm,valueAsType:null,autogeneration:null},dataType:bm,required:!0,index:1,parent:Bm},Mm={type:i.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Rs={id:Qe.outputs.body.id,type:i.ValueDescriptor,description:"The main data payload of the response. This is the data that the server sent back to you. It could be anything, but it is usually a KeyValue data structure or a text value.",version:1,name:"Body",parentRelationType:P.FixedReturns,dataType:Dm,defaultValue:{id:"http-response-body-default-value-id",type:i.LiteralValue,version:1,value:{},name:C.KeyValue,parent:vm,valueAsType:null,autogeneration:null},required:!0,index:2,parent:Mm},_m={type:i.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:i.ActionDescriptor,entityId:dt.HttpRequest},Vm={type:i.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:i.ValueDescriptor,entityId:Qe.outputs.error.id},Nm={like:!1,inferred:!1,id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,isList:!1,asType:!1,parent:Vm},ql={parentRelationType:P.ReturnedError,id:Qe.outputs.error.id,type:i.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",defaultValue:null,dataType:Nm,required:!0,index:0,parent:_m},Xi={type:i.ActionDescriptor,id:dt.HttpRequest,name:dt.HttpRequest,description:"Make an HTTP request, out to the internet, to a given URL with the specified method, query parameters, headers, and body.",version:1,inputs:[ys,hs,kl,fs,ms],outputs:[Ts,Es,Rs],error:ql,parent:null},Lm={[dt.HttpRequest]:Xi},Gm={...ky,...iy,...Zh,...Cf,...nm,...Lm},$m=Object.values(Gm),JO=_[i.Loop]["manual-flow-loop"],Fm={id:"manual-flow-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:j.ManualFlow,entityType:i.ActionDescriptor},Um={id:JO.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:Fm,parentRelationType:P.DynamicReturn},gs={id:j.ManualFlow,type:i.ActionDescriptor,version:1,name:j.ManualFlow,description:"A loop that is manually controlled by the continue and break statements. It runs until the break statement is called, and it can skip to the next iteration with the continue statement.",inputs:[],outputs:[Um],error:null,parent:null},Qi=_[i.Loop]["manual-flow-loop"],xm={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"manual-flow-loop-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},jm={like:!1,inferred:!1,id:"manual-flow-loop-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:xm},km={id:"manual-flow-loop-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:Qi.body.id,entityType:i.ActionDescriptor},Jl={id:Qi.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the manual flow loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:jm,required:!0,index:0,parentRelationType:P.FixedArguments,parent:km},qm={id:"manual-flow-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:Qi.body.id,entityType:i.ActionDescriptor},Jm={id:"manual-flow-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:1,parentRelationType:P.DynamicArgument,parent:qm},Wm={id:"manual-flow-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:Qi.body.id,entityType:i.ActionDescriptor},Ym={id:"manual-flow-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:Wm},bs={id:Qi.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the manual flow loop.",inputs:[Jl,Jm],outputs:[Ym],error:null,parent:null},Hm=_[i.Loop]["string-loop"],zm={id:"iterate-over-string-loop-string-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-string-loop-string-argument-declaration-id",entityType:i.ValueDescriptor},Zm={like:!1,inferred:!1,id:"iterate-over-string-loop-string-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:J,asType:!1,parent:zm},Km={id:"iterate-over-string-loop-string-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:j.String,entityType:i.ActionDescriptor},Xm={id:Hm.inputs.string.id,type:i.ValueDescriptor,version:1,name:"Texts",description:"The text to iterate over the characters of",defaultValue:null,required:!0,dataType:Zm,index:0,parent:Km,parentRelationType:P.FixedArguments},Qm={id:"iterate-over-string-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:j.String,entityType:i.ActionDescriptor},eT={id:Hm.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:Qm,parentRelationType:P.DynamicReturn},ea={id:j.String,type:i.ActionDescriptor,version:1,name:j.String,description:"Iterates over a string of entities",inputs:[Xm],outputs:[eT],error:null,parent:null},fr=_[i.Loop]["string-loop"],tT={id:"iterate-over-string-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-string-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},nT={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:J,asType:!1,parent:tT},rT={id:"iterate-over-string-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},Wl={id:fr.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the string that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:nT,required:!0,index:1,parentRelationType:P.FixedArguments,parent:rT},iT={id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-string-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},aT={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:iT},sT={id:"iterate-over-string-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},Yl={id:fr.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:aT,required:!0,index:0,parentRelationType:P.FixedArguments,parent:sT},oT={id:"iterate-over-string-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},lT={id:"iterate-over-string-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:oT},dT={id:"iterate-over-string-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:fr.body.id,entityType:i.ActionDescriptor},cT={id:"iterate-over-string-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:dT},vs={id:fr.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",inputs:[Yl,Wl,lT],outputs:[cT],error:null,parent:null},uT=_[i.Loop]["list-loop"],pT={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:i.ValueDescriptor},yT={like:!1,inferred:!1,id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,entity:null,asType:!1,parent:pT},hT={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:j.List,entityType:i.ActionDescriptor},fT={id:uT.inputs.list.id,type:i.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,defaultValue:null,dataType:yT,index:0,parent:hT,parentRelationType:P.FixedArguments},mT={id:"iterate-over-list-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:j.List,entityType:i.ActionDescriptor},TT={id:uT.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",required:!1,defaultValue:null,dataType:null,index:0,parent:mT,parentRelationType:P.DynamicReturn},Jn={id:j.List,type:i.ActionDescriptor,version:1,name:j.List,description:"Iterates over a list of entities",inputs:[fT],outputs:[TT],error:null,parent:null},mr=_[i.Loop]["list-loop"],ET={id:"iterate-over-list-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},RT={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:null,asType:!1,parent:ET},gT={id:"iterate-over-list-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},Is={id:mr.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the list that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:RT,required:!0,index:1,parentRelationType:P.FixedArguments,parent:gT},bT={id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},vT={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:bT},IT={id:"iterate-over-list-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},DT={id:mr.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the list loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:vT,required:!0,index:0,parentRelationType:P.FixedArguments,parent:IT},AT={id:"iterate-over-list-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},ST={id:"iterate-over-list-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:AT},OT={id:"iterate-over-list-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:mr.body.id,entityType:i.ActionDescriptor},PT={id:"iterate-over-list-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:OT},ta={id:mr.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the list loop.",inputs:[DT,Is,ST],outputs:[PT],error:null,parent:null},CT=_[i.Loop]["object-keys-loop"],wT={id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-keys-loop-object-argument-declaration-id",entityType:i.ValueDescriptor},BT={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:it,asType:!1,parent:wT},MT={id:"iterate-over-object-keys-loop-object-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:j.ObjectKeys,entityType:i.ActionDescriptor},_T={id:CT.inputs.object.id,type:i.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,defaultValue:null,dataType:BT,index:0,parent:MT,parentRelationType:P.FixedArguments},VT={id:"iterate-over-object-keys-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:j.ObjectKeys,entityType:i.ActionDescriptor},NT={id:CT.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:VT,parentRelationType:P.DynamicReturn},li={id:j.ObjectKeys,type:i.ActionDescriptor,version:1,name:j.ObjectKeys,description:"Iterates over a object of entities",inputs:[_T],outputs:[NT],error:null,parent:null},Tr=_[i.Loop]["object-keys-loop"],LT={id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},GT={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:J,asType:!1,parent:LT},$T={id:"iterate-over-object-keys-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},Hl={id:Tr.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-keys that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:GT,required:!0,index:1,parentRelationType:P.FixedArguments,parent:$T},FT={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},UT={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:FT},xT={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},jT={id:Tr.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-keys loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:UT,required:!0,index:0,parentRelationType:P.FixedArguments,parent:xT},kT={id:"iterate-over-object-keys-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},qT={id:"iterate-over-object-keys-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:kT},JT={id:"iterate-over-object-keys-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:Tr.body.id,entityType:i.ActionDescriptor},WT={id:"iterate-over-object-keys-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:JT},zl={id:Tr.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-keys loop.",inputs:[jT,Hl,qT],outputs:[WT],error:null,parent:null},YT=_[i.Loop]["object-values-loop"],HT={id:"iterate-over-object-values-loop-object-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-values-loop-object-argument-declaration-id",entityType:i.ValueDescriptor},zT={like:!1,inferred:!1,id:"iterate-over-object-values-loop-object-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:it,asType:!1,parent:HT},ZT={id:"iterate-over-object-values-loop-object-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:j.ObjectValues,entityType:i.ActionDescriptor},KT={id:YT.inputs.object.id,type:i.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,defaultValue:null,dataType:zT,index:0,parent:ZT,parentRelationType:P.FixedArguments},XT={id:"iterate-over-object-values-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:j.ObjectValues,entityType:i.ActionDescriptor},QT={id:YT.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:XT,parentRelationType:P.DynamicReturn},di={id:j.ObjectValues,type:i.ActionDescriptor,version:1,name:j.ObjectValues,description:"Iterates over a object of entities",inputs:[KT],outputs:[QT],error:null,parent:null},Er=_[i.Loop]["object-values-loop"],eE={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-values-loop-body-current-value-declaration-id",entityType:i.ValueDescriptor},tE={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:null,entity:null,asType:null,like:!1,inferred:!1,parent:eE},nE={id:"iterate-over-object-values-loop-body-current-value-declaration-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},Zl={id:Er.body.inputs.currentValue.id,type:i.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-values that is being iterated over. This value is passed to the child actions.",defaultValue:null,dataType:tE,required:!0,index:1,parentRelationType:P.FixedArguments,parent:nE},rE={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-object-values-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},iE={like:!1,inferred:!1,id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:rE},aE={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},sE={id:Er.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-values loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:iE,required:!0,index:0,parentRelationType:P.FixedArguments,parent:aE},oE={id:"iterate-over-object-values-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},lE={id:"iterate-over-object-values-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:2,parentRelationType:P.DynamicArgument,parent:oE},dE={id:"iterate-over-object-values-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:Er.body.id,entityType:i.ActionDescriptor},cE={id:"iterate-over-object-values-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:dE},Kl={id:Er.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-values loop.",inputs:[sE,Zl,lE],outputs:[cE],error:null,parent:null},Xl=_[i.Loop]["counted-loop"],uE={id:"counted-loop-string-argument-declaration-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:Xl.inputs.number.id,entityType:i.ValueDescriptor},pE={id:"counted-loop-string-argument-declaration-data-type-default-value-id",type:i.LiteralValue,name:C.Number,version:1,value:5,valueAsType:null,autogeneration:null,parent:uE},yE={id:"counted-loop-string-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"counted-loop-string-argument-declaration-id",entityType:i.ValueDescriptor},hE={like:!1,inferred:!1,id:"counted-loop-string-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:yE},fE={id:"counted-loop-string-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:j.Counted,entityType:i.ActionDescriptor},mE={id:Xl.inputs.number.id,type:i.ValueDescriptor,version:1,name:"Number of iterations",description:"The number of iterations to perform",required:!0,dataType:hE,defaultValue:pE,index:0,parent:fE,parentRelationType:P.FixedArguments},TE={id:"counted-loop-dynamic-return-declaration-parent-ref-id",type:i.GenericReference,entityId:j.Counted,entityType:i.ActionDescriptor},EE={id:Xl.outputs.results.id,type:i.ValueDescriptor,version:1,name:"Ouput value",description:"An output value of the loop",defaultValue:null,required:!1,dataType:null,index:0,parent:TE,parentRelationType:P.DynamicReturn},na={id:j.Counted,type:i.ActionDescriptor,version:1,name:j.Counted,description:"Iterates a given number of times",inputs:[mE],outputs:[EE],error:null,parent:null},ra=_[i.Loop]["counted-loop"],RE={id:"counted-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"counted-loop-body-current-iteration-number-declaration-id",entityType:i.ValueDescriptor},gE={like:!1,inferred:!1,id:"counted-loop-body-current-iteration-number-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,entity:ee,asType:!1,parent:RE},bE={id:"counted-loop-body-current-iteration-number-declaration-parent-ref-id",type:i.GenericReference,entityId:ra.body.id,entityType:i.ActionDescriptor},Ql={id:ra.body.inputs.iterationNumber.id,type:i.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",defaultValue:null,dataType:gE,required:!0,index:0,parentRelationType:P.FixedArguments,parent:bE},vE={id:"counted-loop-body-any-dynamic-argument-parent-ref-id",type:i.GenericReference,entityId:ra.body.id,entityType:i.ActionDescriptor},IE={id:"counted-loop-body-any-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values inputed to the loop's body as an aggregation of the respective values outputed.",defaultValue:null,dataType:null,required:!1,index:1,parentRelationType:P.DynamicArgument,parent:vE},DE={id:"counted-loop-body-any-dynamic-return-parent-ref-id",type:i.GenericReference,entityId:ra.body.id,entityType:i.ActionDescriptor},AE={id:"counted-loop-body-any-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any value",description:"Values outputed by the loop's body.",defaultValue:null,dataType:null,required:!1,index:0,parentRelationType:P.DynamicReturn,parent:DE},Ds={id:ra.body.id,type:i.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",inputs:[Ql,IE],outputs:[AE],error:null,parent:null},SE=[gs,Jn,ea,li,di,na],OE=[bs,ta,vs,zl,Kl,Ds],Wn=_[i.BuiltInBaseEntity][F.HTTP_ENDPOINT].properties,PE={id:"endpointBuiltInCorsPropertyDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:Wn.cors.id},CE={id:"endpointBuiltInCorsPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Wn.cors.id},wE={like:!1,inferred:!1,id:"endpointBuiltInCorsPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:J,asType:!1,parent:CE},BE={id:"endpointBuiltInBaseEntityRef",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:F.HTTP_ENDPOINT},ME={constant:!1,hidden:!0,required:!0,id:Wn.cors.id,name:"Allowed origins",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:wE,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:["*"],parent:PE,autogeneration:null,valueAsType:null},description:"The origins that are allowed to access this endpoint, use * for all origins, or http://example.com/* to be as specific as you need.",parent:BE},_E={id:"endpointBuiltInPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:Wn.path.id},VE={id:"endpointBuiltInPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Wn.path.id},NE={like:!1,inferred:!1,id:"endpointBuiltInPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:VE},LE={id:"endpointBuiltInBaseEntityRefTwo",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:F.HTTP_ENDPOINT},ed={constant:!1,id:Wn.path.id,hidden:!1,required:!0,name:"Path",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:NE,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.String,value:"/",parent:_E,autogeneration:null,valueAsType:null},description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:LE},GE={id:"endpointBuiltInMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:Wn.method.id},$E={id:"endpointBuiltInMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"endpointBuiltInMethodProperty"},FE={like:!1,inferred:!1,id:"endpointBuiltInMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Sn,isList:!0,asType:!1,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:$E},UE={id:"endpointBuiltInBaseEntityRefThree",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:F.HTTP_ENDPOINT},td={constant:!1,hidden:!1,required:!0,id:Wn.method.id,name:"Method",version:1,type:i.Property,private:!1,index:2,implements:null,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,value:"GET",name:C.Enum,parent:GE,autogeneration:null,valueAsType:null},abstract:!0,static:!0,dataType:FE,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:UE},xE={id:"endpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointRequestHeadersArgumentDeclaration"},jE={id:"endpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},kE={like:!1,inferred:!1,id:"endpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:jE},qE={id:"endpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},JE={like:!1,inferred:!1,id:"endpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:qE},WE={id:"endpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointRequestQueryParamsArgumentDeclaration"},YE={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},HE={like:!1,inferred:!1,id:"endpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,asType:!1,entity:ai,parent:YE},zE={id:"endpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointPathParamsArgumentDeclaration"},ZE={id:"endpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},KE={like:!1,inferred:!1,id:"endpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:ai,asType:!1,parent:ZE},XE={id:"endpointReachedTriggerActionDescriptorRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},nd={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ValueDescriptor,name:"Request headers",dataType:kE,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:xE,autogeneration:null,valueAsType:null},required:!0,index:0,parentRelationType:P.FixedArguments,parent:XE},QE={id:"endpointReachedTriggerActionDescriptorRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},rd={id:"endpointPathParamsArgumentDeclaration",type:i.ValueDescriptor,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",dataType:KE,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:[],parent:zE,autogeneration:null,valueAsType:null},required:!0,index:1,parentRelationType:P.FixedArguments,parent:QE},eR={id:"endpointReachedTriggerActionDescriptorRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},id={id:"endpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ValueDescriptor,name:"Request query params",dataType:HE,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:[],parent:WE,autogeneration:null,valueAsType:null},required:!0,index:2,parentRelationType:P.FixedArguments,parent:eR},tR={id:"endpointReachedTriggerActionDescriptorRefFour",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},ad={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ValueDescriptor,name:"Request body",dataType:JE,defaultValue:null,index:3,required:!0,parentRelationType:P.FixedArguments,parent:tR},nR={id:"endpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},rR={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:nR},iR={id:"endpointReturnStatementRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},sd={id:"endpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ValueDescriptor,name:"Response code",dataType:rR,defaultValue:null,required:!0,index:0,parentRelationType:P.FixedReturns,parent:iR},aR={id:"endpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.ValueDescriptor,entityId:"endpointResponseHeadersReturnDeclaration"},sR={id:"endpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},oR={like:!1,inferred:!1,id:"endpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:sR},lR={id:"endpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},od={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ValueDescriptor,name:"Response headers",dataType:oR,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:aR,autogeneration:null,valueAsType:null},required:!1,index:1,parentRelationType:P.FixedReturns,parent:lR},dR={id:"endpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},cR={like:!1,inferred:!1,id:"endpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:dR},uR={id:"endpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},ld={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ValueDescriptor,name:"Response body",dataType:cR,defaultValue:null,required:!1,index:2,parentRelationType:P.FixedReturns,parent:uR},pR={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:F.HTTP_ENDPOINT},dd={id:"endpointReachedTriggerActionDescriptor",type:i.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",inputs:[nd,rd,id,ad],outputs:[sd,od,ld],error:null,parent:pR},ia={id:F.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:F.HTTP_ENDPOINT,type:i.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[ME,ed,td],abstractMethods:[dd],extends:[],methods:[]},ct=_[i.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,yR={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.identifier.id,entityType:i.Property},hR={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:i.GenericReference,entityId:ct.properties.identifier.id,entityType:i.Property},fR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:hR},ci={id:"relational-database-built-in-base-entity-ref-id",type:i.GenericReference,entityId:F.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},As={constant:!1,id:ct.properties.identifier.id,hidden:!1,required:!0,name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:null,parent:yR,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:fR,description:"The name of the main database inside of the server instance where the data will be stored.",parent:ci},WO={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:i.Property},mR={id:"relational-database-built-in-base-entity-username-property-ref-id",type:i.GenericReference,entityId:ct.properties.username.id,entityType:i.Property},TR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:mR},Ss={constant:!1,hidden:!1,required:!0,id:ct.properties.username.id,name:"Username",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:ct.properties.username.id,entityType:i.Property},autogeneration:null,valueAsType:null},dataType:TR,description:"The username that will be used to connect to the database.",parent:ci},YO={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:i.Property},ER={id:"relational-database-built-in-base-entity-password-property-ref-id",type:i.GenericReference,entityId:ct.properties.password.id,entityType:i.Property},RR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:ER},Os={constant:!1,hidden:!1,required:!0,id:ct.properties.password.id,name:"Password",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,defaultValue:null,dataType:RR,description:"The password that will be used to connect to the database.",parent:ci},gR={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.minSize.id,entityType:i.Property},bR={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:i.GenericReference,entityId:ct.properties.minSize.id,entityType:i.Property},vR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:bR},Ps={constant:!1,hidden:!0,required:!0,id:ct.properties.minSize.id,name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:6,parent:gR,autogeneration:null,valueAsType:null},dataType:vR,description:"The minimum size of the database in GB.",parent:ci},IR={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.default.id,entityType:i.Property},DR={id:"relational-database-built-in-base-entity-default-property-ref-id",type:i.GenericReference,entityId:ct.properties.default.id,entityType:i.Property},AR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:An,asType:!1,parent:DR},cd={constant:!1,hidden:!0,required:!0,id:ct.properties.default.id,name:"Default",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!1,parent:IR,autogeneration:null,valueAsType:null},dataType:AR,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:ci},SR={id:"relational-database-built-in-base-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:ct.properties.autoscaling.id,entityType:i.Property},OR={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:ct.properties.autoscaling.id,entityType:i.Property},PR={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:An,asType:!1,parent:SR},CR={id:"relational-database-built-in-base-entity-autoscaling-property-parent-ref-id",type:i.GenericReference,entityId:F.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},ud={constant:!1,hidden:!0,required:!0,id:ct.properties.autoscaling.id,name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,defaultValue:{id:"relational-database-built-in-base-entity-autoscaling-property-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!1,parent:OR,autogeneration:null,valueAsType:null},dataType:PR,description:"If true, this database will automatically scale up or down in memory size, based on the usage.",parent:CR},cn={id:F.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:F.RELATIONAL_DATABASE,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[As,Ss,Os,Ps,cd,ud],abstractMethods:[],methods:[],extends:[]},wR={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:Gt.DeletePersistedEntity},pd={type:i.FunctionDeclaration,id:Gt.DeletePersistedEntity,name:Gt.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:wR,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},BR=_[i.BuiltInBaseEntity][F.PERSISTED_ENTITY].properties,HO={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:i.DataType},MR={id:"persisted-built-in-base-entity-database-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:i.Property},_R={like:!1,inferred:!1,id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:MR},VR={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:i.GenericReference,entityId:F.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},ui={constant:!1,hidden:!0,required:!0,id:BR.database.id,name:"Database",version:1,type:i.Property,defaultValue:null,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:_R,description:"The database that the entity belongs to.",parent:VR},NR={id:"persisted-built-in-base-entity-primary-key-property-number-data-type-option-parent-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-data-type-id",entityType:i.DataType},LR={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-number-data-type-option-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parentRelationType:et.OrDataTypeGroup,parent:NR},GR={id:"persisted-built-in-base-entity-primary-key-property-string-data-type-option-parent-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-data-type-id",entityType:i.DataType},$R={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-string-data-type-option-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parentRelationType:et.OrDataTypeGroup,parent:GR},FR={id:"persisted-built-in-base-entity-primary-key-property-uuid-data-type-option-parent-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-data-type-id",entityType:i.DataType},UR={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-uuid-data-type-option-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parentRelationType:et.OrDataTypeGroup,parent:FR},xR={id:"persisted-built-in-base-entity-primary-key-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-primary-key-property-id",entityType:i.Property},jR={like:!1,inferred:!1,id:"persisted-built-in-base-entity-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:[UR,$R,LR],isList:!1,entity:null,asType:null,implementationChooseOne:!0,parent:xR},kR={id:"persisted-built-in-base-entity-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:F.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},pi={constant:!1,hidden:!1,required:!0,id:BR.primaryKey.id,name:"Primary key",version:1,type:i.Property,defaultValue:null,private:!1,abstract:!0,implements:null,static:!1,index:0,dataType:jR,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:kR},st={id:F.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:F.PERSISTED_ENTITY,type:i.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[ui,pi],methods:[pd],extends:[]},qR={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:Gt.SoftDeletePersistedEntity},zO={type:i.FunctionDeclaration,id:Gt.SoftDeletePersistedEntity,name:Gt.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:qR,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},JR={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:F.HTTP_ENDPOINT},yd={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:i.ActionDescriptor,description:"Executed when the cron job is triggered",inputs:[],error:null,outputs:[],parent:JR},WR=_[i.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,ZO={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:i.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:i.DataType},YR={id:"cron-job-built-in-base-entity-expression-property-ref",type:i.GenericReference,entityId:WR.properties.expression.id,entityType:i.Property},KO={like:!1,inferred:!1,id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:YR},HR={id:"cron-job-built-in-base-entity-ref",type:i.GenericReference,entityId:F.CRON_JOB,entityType:i.BuiltInBaseEntity},zR={constant:!1,hidden:!1,required:!0,id:WR.properties.expression.id,name:"Cron expression",version:1,type:i.Property,defaultValue:null,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:KO,description:"The cron-job expression that defines when the cron-job job should be triggered. The expression should be in the format of a cron-job expression.",parent:HR},Cs={id:F.CRON_JOB,version:1,description:"This entity represents a scheduled trigger. The action on this entity will be executed one the time set by the cron-job expression is reached.",name:F.CRON_JOB,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[zR],methods:[],abstractMethods:[yd],extends:[]},ZR={type:i.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:i.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},hd={id:"execution-built-in-entity-abort-method-id",type:i.FunctionDeclaration,version:1,name:Gt.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:ZR},ws={id:F.EXECUTION,type:i.BuiltInBaseEntity,version:1,name:F.EXECUTION,description:"A reference to an ongoing execution of any entity that can be called. Eg: Operations, custom trigger calls, etc.",static:!1,abstract:!1,interactive:!0,extends:[],properties:[],methods:[hd],abstractMethods:[]},KR=[ia,cn,st,Cs,ws],XO=_[i.Condition]["not-empty"],XR={type:i.GenericReference,id:"not-empty-condition-ref",entityType:i.ActionDescriptor,entityId:Jt.NotEmpty},QR={id:XO.inputs.leftHand.id,type:i.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",defaultValue:null,dataType:null,required:!0,parentRelationType:P.FixedArguments,index:0,parent:XR},Rr={type:i.ActionDescriptor,id:Jt.NotEmpty,version:1,name:Jt.NotEmpty,description:"Checks if the value is not empty",parent:null,inputs:[QR],outputs:[],error:null},eg={[Jt.NotEmpty]:Rr},yi=_[i.Condition]["more-than-or-equal"],tg={type:i.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-data-type-parent-ref",entityType:i.ValueDescriptor,entityId:yi.inputs.leftHand.id},ng={type:i.DataType,id:yi.inputs.leftHand.dataType.id,version:1,entity:ee,like:!1,isList:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,parent:tg},rg={type:i.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:qe.MoreThanOrEqual},ig={id:yi.inputs.leftHand.id,type:i.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",defaultValue:null,dataType:ng,required:!0,parentRelationType:P.FixedArguments,index:0,parent:rg},ag={type:i.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-data-type-parent-ref",entityType:i.ValueDescriptor,entityId:yi.inputs.rightHand.id},sg={type:i.DataType,id:yi.inputs.rightHand.dataType.id,version:1,entity:ee,like:!1,isList:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,parent:ag},og={type:i.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:qe.MoreThanOrEqual},lg={id:yi.inputs.rightHand.id,type:i.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",defaultValue:null,dataType:sg,required:!0,parentRelationType:P.FixedArguments,index:1,parent:og},hi={type:i.ActionDescriptor,id:qe.MoreThanOrEqual,version:1,name:qe.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,inputs:[ig,lg],outputs:[],error:null},dg={[qe.MoreThanOrEqual]:hi},cg={...eg,...dg},ug=Object.values(cg),Bs={type:i.ActionDescriptor,id:In.PROJECT_PUBLICATION_COMPLETED,version:1,name:In.PROJECT_PUBLICATION_COMPLETED,description:"The event that is triggered when the project has completed its publication and all its code and resurces are now deployed and ready to be used by the users",parent:null,inputs:[],outputs:[],error:null},pg={[In.PROJECT_PUBLICATION_COMPLETED]:Bs},yg=Object.values(pg),fd=_[i.ValueDescriptor][ls.ActionOngoingProcessOutputValue],hg={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:fd.id},fg={like:!1,inferred:!1,id:fd.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ws,asType:!1,isList:!1,parent:hg},Ms={id:fd.id,type:i.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",defaultValue:null,dataType:fg,required:!0,index:0,parent:null,parentRelationType:P.OngoingProcessExecution},mg=[Ms],Tg=[...Pp,...$m,...SE,...OE,...KR,...ug,...yg,...mg];var le;(function(r){r.assertEqual=a=>a;function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},r.getValidEnumValues=a=>{const s=r.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of s)o[l]=a[l];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(s){return a[s]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&s.push(o);return s},r.find=(a,s)=>{for(const o of a)if(s(o))return o},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}r.joinValues=n,r.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(le||(le={}));var md;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(md||(md={}));const U=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yn=r=>{switch(typeof r){case"undefined":return U.undefined;case"string":return U.string;case"number":return isNaN(r)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(r)?U.array:r===null?U.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?U.promise:typeof Map<"u"&&r instanceof Map?U.map:typeof Set<"u"&&r instanceof Set?U.set:typeof Date<"u"&&r instanceof Date?U.date:U.object;default:return U.unknown}},N=le.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),QO=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class wt extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let l=n,p=0;for(;p<o.path.length;){const u=o.path[p];p===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(o))):l[u]=l[u]||{_errors:[]},l=l[u],p++}}};return a(this),n}static assert(e){if(!(e instanceof wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}wt.create=r=>new wt(r);const fi=(r,e)=>{let t;switch(r.code){case N.invalid_type:r.received===U.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case N.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,le.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:t=`Unrecognized key(s) in object: ${le.joinValues(r.keys,", ")}`;break;case N.invalid_union:t="Invalid input";break;case N.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${le.joinValues(r.options)}`;break;case N.invalid_enum_value:t=`Invalid enum value. Expected ${le.joinValues(r.options)}, received '${r.received}'`;break;case N.invalid_arguments:t="Invalid function arguments";break;case N.invalid_return_type:t="Invalid function return type";break;case N.invalid_date:t="Invalid date";break;case N.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:le.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case N.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case N.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case N.custom:t="Invalid input";break;case N.invalid_intersection_types:t="Intersection results could not be merged";break;case N.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case N.not_finite:t="Number must be finite";break;default:t=e.defaultError,le.assertNever(r)}return{message:t}};let Eg=fi;function eP(r){Eg=r}function _s(){return Eg}const Vs=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="";const p=n.filter(u=>!!u).slice().reverse();for(const u of p)l=u(o,{data:e,defaultError:l}).message;return{...a,path:s,message:l}},tP=[];function $(r,e){const t=_s(),n=Vs({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===fi?void 0:fi].filter(a=>!!a)});r.common.issues.push(n)}class yt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return z;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const s=await a.key,o=await a.value;n.push({key:s,value:o})}return yt.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return z;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}}const z=Object.freeze({status:"aborted"}),mi=r=>({status:"dirty",value:r}),gt=r=>({status:"valid",value:r}),Td=r=>r.status==="aborted",Ed=r=>r.status==="dirty",aa=r=>r.status==="valid",sa=r=>typeof Promise<"u"&&r instanceof Promise;function Ns(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function Rg(r,e,t,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!a:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(r,t):a?a.value=t:e.set(r,t),t}typeof SuppressedError=="function"&&SuppressedError;var W;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(W||(W={}));var oa,la;class un{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gg=(r,e)=>{if(aa(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new wt(r.common.issues);return this._error=t,this._error}}};function ne(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{var p,u;const{message:h}=r;return o.code==="invalid_enum_value"?{message:h??l.defaultError}:typeof l.data>"u"?{message:(p=h??n)!==null&&p!==void 0?p:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(u=h??t)!==null&&u!==void 0?u:l.defaultError}},description:a}}class ie{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Yn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:Yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(sa(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const a={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return gg(a,s)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yn(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(sa(a)?a:Promise.resolve(a));return gg(n,s)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),l=()=>s.addIssue({code:N.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new nn({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return yn.create(this,this._def)}nullable(){return Kn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tn.create(this,this._def)}promise(){return gi.create(this,this._def)}or(e){return pa.create([this,e],this._def)}and(e){return ya.create(this,e,this._def)}transform(e){return new nn({...ne(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ea({...ne(this._def),innerType:this,defaultValue:t,typeName:Y.ZodDefault})}brand(){return new bd({typeName:Y.ZodBranded,type:this,...ne(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ra({...ne(this._def),innerType:this,catchValue:t,typeName:Y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ga.create(this,e)}readonly(){return ba.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nP=/^c[^\s-]{8,}$/i,rP=/^[0-9a-z]+$/,iP=/^[0-9A-HJKMNP-TV-Z]{26}$/,aP=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sP=/^[a-z0-9_-]{21}$/i,oP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Rd;const cP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uP=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,pP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bg="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",yP=new RegExp(`^${bg}$`);function vg(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function hP(r){return new RegExp(`^${vg(r)}$`)}function Ig(r){let e=`${bg}T${vg(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function fP(r,e){return!!((e==="v4"||!e)&&cP.test(r)||(e==="v6"||!e)&&uP.test(r))}class en extends ie{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:U.string,received:s.parsedType}),z}const n=new yt;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,l=e.data.length<s.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?$(a,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&$(a,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")lP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"email",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Rd||(Rd=new RegExp(dP,"u")),Rd.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"emoji",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")aP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"uuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")sP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"nanoid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")nP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"cuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")rP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"cuid2",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")iP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"ulid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),$(a,{validation:"url",code:N.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"regex",code:N.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ig(s).test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?yP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?hP(s).test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{code:N.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?oP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"duration",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?fP(e.data,s.version)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"ip",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?pP.test(e.data)||(a=this._getOrReturnCtx(e,a),$(a,{validation:"base64",code:N.invalid_string,message:s.message}),n.dirty()):le.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:N.invalid_string,...W.errToObj(n)})}_addCheck(e){return new en({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...W.errToObj(e)})}url(e){return this._addCheck({kind:"url",...W.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...W.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...W.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...W.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...W.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...W.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...W.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...W.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...W.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...W.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...W.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...W.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...W.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...W.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...W.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...W.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...W.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...W.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...W.errToObj(t)})}nonempty(e){return this.min(1,W.errToObj(e))}trim(){return new en({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}en.create=r=>{var e;return new en({checks:[],typeName:Y.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};function mP(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,s=parseInt(r.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class Hn extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:U.number,received:s.parsedType}),z}let n;const a=new yt;for(const s of this._def.checks)s.kind==="int"?le.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?mP(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:N.not_finite,message:s.message}),a.dirty()):le.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,n,a){return new Hn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:W.toString(a)}]})}_addCheck(e){return new Hn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:W.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:W.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&le.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Hn.create=r=>new Hn({checks:[],typeName:Y.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});class zn extends ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==U.bigint){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:U.bigint,received:s.parsedType}),z}let n;const a=new yt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),$(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):le.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,n,a){return new zn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:W.toString(a)}]})}_addCheck(e){return new zn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}zn.create=r=>{var e;return new zn({checks:[],typeName:Y.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};class da extends ie{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:U.boolean,received:n.parsedType}),z}return gt(e.data)}}da.create=r=>new da({typeName:Y.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});class gr extends ie{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_type,expected:U.date,received:s.parsedType}),z}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return $(s,{code:N.invalid_date}),z}const n=new yt;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),$(a,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):le.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new gr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:W.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:W.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}gr.create=r=>new gr({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:Y.ZodDate,...ne(r)});class Ls extends ie{_parse(e){if(this._getType(e)!==U.symbol){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:U.symbol,received:n.parsedType}),z}return gt(e.data)}}Ls.create=r=>new Ls({typeName:Y.ZodSymbol,...ne(r)});class ca extends ie{_parse(e){if(this._getType(e)!==U.undefined){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:U.undefined,received:n.parsedType}),z}return gt(e.data)}}ca.create=r=>new ca({typeName:Y.ZodUndefined,...ne(r)});class ua extends ie{_parse(e){if(this._getType(e)!==U.null){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:U.null,received:n.parsedType}),z}return gt(e.data)}}ua.create=r=>new ua({typeName:Y.ZodNull,...ne(r)});class Ti extends ie{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}}Ti.create=r=>new Ti({typeName:Y.ZodAny,...ne(r)});class br extends ie{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}}br.create=r=>new br({typeName:Y.ZodUnknown,...ne(r)});class wn extends ie{_parse(e){const t=this._getOrReturnCtx(e);return $(t,{code:N.invalid_type,expected:U.never,received:t.parsedType}),z}}wn.create=r=>new wn({typeName:Y.ZodNever,...ne(r)});class Gs extends ie{_parse(e){if(this._getType(e)!==U.undefined){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:U.void,received:n.parsedType}),z}return gt(e.data)}}Gs.create=r=>new Gs({typeName:Y.ZodVoid,...ne(r)});class tn extends ie{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==U.array)return $(t,{code:N.invalid_type,expected:U.array,received:t.parsedType}),z;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&($(t,{code:o?N.too_big:N.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&($(t,{code:N.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&($(t,{code:N.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,l)=>a.type._parseAsync(new un(t,o,t.path,l)))).then(o=>yt.mergeArray(n,o));const s=[...t.data].map((o,l)=>a.type._parseSync(new un(t,o,t.path,l)));return yt.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new tn({...this._def,minLength:{value:e,message:W.toString(t)}})}max(e,t){return new tn({...this._def,maxLength:{value:e,message:W.toString(t)}})}length(e,t){return new tn({...this._def,exactLength:{value:e,message:W.toString(t)}})}nonempty(e){return this.min(1,e)}}tn.create=(r,e)=>new tn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...ne(e)});function Ei(r){if(r instanceof Ke){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=yn.create(Ei(n))}return new Ke({...r._def,shape:()=>e})}else return r instanceof tn?new tn({...r._def,type:Ei(r.element)}):r instanceof yn?yn.create(Ei(r.unwrap())):r instanceof Kn?Kn.create(Ei(r.unwrap())):r instanceof pn?pn.create(r.items.map(e=>Ei(e))):r}class Ke extends ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=le.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==U.object){const u=this._getOrReturnCtx(e);return $(u,{code:N.invalid_type,expected:U.object,received:u.parsedType}),z}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof wn&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||l.push(u);const p=[];for(const u of o){const h=s[u],f=a.data[u];p.push({key:{status:"valid",value:u},value:h._parse(new un(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof wn){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of l)p.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(u==="strict")l.length>0&&($(a,{code:N.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of l){const f=a.data[h];p.push({key:{status:"valid",value:h},value:u._parse(new un(a,f,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of p){const f=await h.key,R=await h.value;u.push({key:f,value:R,alwaysSet:h.alwaysSet})}return u}).then(u=>yt.mergeObjectSync(n,u)):yt.mergeObjectSync(n,p)}get shape(){return this._def.shape()}strict(e){return W.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var a,s,o,l;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(l=W.errToObj(e).message)!==null&&l!==void 0?l:p}:{message:p}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ke({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ke({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const t={};return le.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new Ke({...this._def,shape:()=>t})}omit(e){const t={};return le.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new Ke({...this._def,shape:()=>t})}deepPartial(){return Ei(this)}partial(e){const t={};return le.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}),new Ke({...this._def,shape:()=>t})}required(e){const t={};return le.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof yn;)s=s._def.innerType;t[n]=s}}),new Ke({...this._def,shape:()=>t})}keyof(){return Dg(le.objectKeys(this.shape))}}Ke.create=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strip",catchall:wn.create(),typeName:Y.ZodObject,...ne(e)}),Ke.strictCreate=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strict",catchall:wn.create(),typeName:Y.ZodObject,...ne(e)}),Ke.lazycreate=(r,e)=>new Ke({shape:r,unknownKeys:"strip",catchall:wn.create(),typeName:Y.ZodObject,...ne(e)});class pa extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=s.map(l=>new wt(l.ctx.common.issues));return $(t,{code:N.invalid_union,unionErrors:o}),z}if(t.common.async)return Promise.all(n.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let s;const o=[];for(const p of n){const u={...t,common:{...t.common,issues:[]},parent:null},h=p._parseSync({data:t.data,path:t.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(p=>new wt(p));return $(t,{code:N.invalid_union,unionErrors:l}),z}}get options(){return this._def.options}}pa.create=(r,e)=>new pa({options:r,typeName:Y.ZodUnion,...ne(e)});const Bn=r=>r instanceof fa?Bn(r.schema):r instanceof nn?Bn(r.innerType()):r instanceof ma?[r.value]:r instanceof Zn?r.options:r instanceof Ta?le.objectValues(r.enum):r instanceof Ea?Bn(r._def.innerType):r instanceof ca?[void 0]:r instanceof ua?[null]:r instanceof yn?[void 0,...Bn(r.unwrap())]:r instanceof Kn?[null,...Bn(r.unwrap())]:r instanceof bd||r instanceof ba?Bn(r.unwrap()):r instanceof Ra?Bn(r._def.innerType):[];class $s extends ie{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==U.object)return $(t,{code:N.invalid_type,expected:U.object,received:t.parsedType}),z;const n=this.discriminator,a=t.data[n],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):($(t,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const a=new Map;for(const s of t){const o=Bn(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,s)}}return new $s({typeName:Y.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...ne(n)})}}function gd(r,e){const t=Yn(r),n=Yn(e);if(r===e)return{valid:!0,data:r};if(t===U.object&&n===U.object){const a=le.objectKeys(e),s=le.objectKeys(r).filter(l=>a.indexOf(l)!==-1),o={...r,...e};for(const l of s){const p=gd(r[l],e[l]);if(!p.valid)return{valid:!1};o[l]=p.data}return{valid:!0,data:o}}else if(t===U.array&&n===U.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<r.length;s++){const o=r[s],l=e[s],p=gd(o,l);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===U.date&&n===U.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ya extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(s,o)=>{if(Td(s)||Td(o))return z;const l=gd(s.value,o.value);return l.valid?((Ed(s)||Ed(o))&&t.dirty(),{status:t.value,value:l.data}):($(n,{code:N.invalid_intersection_types}),z)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ya.create=(r,e,t)=>new ya({left:r,right:e,typeName:Y.ZodIntersection,...ne(t)});class pn extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return $(n,{code:N.invalid_type,expected:U.array,received:n.parsedType}),z;if(n.data.length<this._def.items.length)return $(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z;!this._def.rest&&n.data.length>this._def.items.length&&($(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((o,l)=>{const p=this._def.items[l]||this._def.rest;return p?p._parse(new un(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>yt.mergeArray(t,o)):yt.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new pn({...this._def,rest:e})}}pn.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pn({items:r,typeName:Y.ZodTuple,rest:null,...ne(e)})};class ha extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return $(n,{code:N.invalid_type,expected:U.object,received:n.parsedType}),z;const a=[],s=this._def.keyType,o=this._def.valueType;for(const l in n.data)a.push({key:s._parse(new un(n,l,n.path,l)),value:o._parse(new un(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?yt.mergeObjectAsync(t,a):yt.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ie?new ha({keyType:e,valueType:t,typeName:Y.ZodRecord,...ne(n)}):new ha({keyType:en.create(),valueType:e,typeName:Y.ZodRecord,...ne(t)})}}class Fs extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return $(n,{code:N.invalid_type,expected:U.map,received:n.parsedType}),z;const a=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([l,p],u)=>({key:a._parse(new un(n,l,n.path,[u,"key"])),value:s._parse(new un(n,p,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const p of o){const u=await p.key,h=await p.value;if(u.status==="aborted"||h.status==="aborted")return z;(u.status==="dirty"||h.status==="dirty")&&t.dirty(),l.set(u.value,h.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const p of o){const u=p.key,h=p.value;if(u.status==="aborted"||h.status==="aborted")return z;(u.status==="dirty"||h.status==="dirty")&&t.dirty(),l.set(u.value,h.value)}return{status:t.value,value:l}}}}Fs.create=(r,e,t)=>new Fs({valueType:e,keyType:r,typeName:Y.ZodMap,...ne(t)});class vr extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return $(n,{code:N.invalid_type,expected:U.set,received:n.parsedType}),z;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&($(n,{code:N.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&($(n,{code:N.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(p){const u=new Set;for(const h of p){if(h.status==="aborted")return z;h.status==="dirty"&&t.dirty(),u.add(h.value)}return{status:t.value,value:u}}const l=[...n.data.values()].map((p,u)=>s._parse(new un(n,p,n.path,u)));return n.common.async?Promise.all(l).then(p=>o(p)):o(l)}min(e,t){return new vr({...this._def,minSize:{value:e,message:W.toString(t)}})}max(e,t){return new vr({...this._def,maxSize:{value:e,message:W.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}vr.create=(r,e)=>new vr({valueType:r,minSize:null,maxSize:null,typeName:Y.ZodSet,...ne(e)});class Ri extends ie{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==U.function)return $(t,{code:N.invalid_type,expected:U.function,received:t.parsedType}),z;function n(l,p){return Vs({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_s(),fi].filter(u=>!!u),issueData:{code:N.invalid_arguments,argumentsError:p}})}function a(l,p){return Vs({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_s(),fi].filter(u=>!!u),issueData:{code:N.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof gi){const l=this;return gt(async function(...p){const u=new wt([]),h=await l._def.args.parseAsync(p,s).catch(v=>{throw u.addIssue(n(p,v)),u}),f=await Reflect.apply(o,this,h);return await l._def.returns._def.type.parseAsync(f,s).catch(v=>{throw u.addIssue(a(f,v)),u})})}else{const l=this;return gt(function(...p){const u=l._def.args.safeParse(p,s);if(!u.success)throw new wt([n(p,u.error)]);const h=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(h,s);if(!f.success)throw new wt([a(h,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ri({...this._def,args:pn.create(e).rest(br.create())})}returns(e){return new Ri({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ri({args:e||pn.create([]).rest(br.create()),returns:t||br.create(),typeName:Y.ZodFunction,...ne(n)})}}class fa extends ie{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}fa.create=(r,e)=>new fa({getter:r,typeName:Y.ZodLazy,...ne(e)});class ma extends ie{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return $(t,{received:t.data,code:N.invalid_literal,expected:this._def.value}),z}return{status:"valid",value:e.data}}get value(){return this._def.value}}ma.create=(r,e)=>new ma({value:r,typeName:Y.ZodLiteral,...ne(e)});function Dg(r,e){return new Zn({values:r,typeName:Y.ZodEnum,...ne(e)})}class Zn extends ie{constructor(){super(...arguments),oa.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{expected:le.joinValues(n),received:t.parsedType,code:N.invalid_type}),z}if(Ns(this,oa,"f")||Rg(this,oa,new Set(this._def.values),"f"),!Ns(this,oa,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{received:t.data,code:N.invalid_enum_value,options:n}),z}return gt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Zn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Zn.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}oa=new WeakMap,Zn.create=Dg;class Ta extends ie{constructor(){super(...arguments),la.set(this,void 0)}_parse(e){const t=le.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){const a=le.objectValues(t);return $(n,{expected:le.joinValues(a),received:n.parsedType,code:N.invalid_type}),z}if(Ns(this,la,"f")||Rg(this,la,new Set(le.getValidEnumValues(this._def.values)),"f"),!Ns(this,la,"f").has(e.data)){const a=le.objectValues(t);return $(n,{received:n.data,code:N.invalid_enum_value,options:a}),z}return gt(e.data)}get enum(){return this._def.values}}la=new WeakMap,Ta.create=(r,e)=>new Ta({values:r,typeName:Y.ZodNativeEnum,...ne(e)});class gi extends ie{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==U.promise&&t.common.async===!1)return $(t,{code:N.invalid_type,expected:U.promise,received:t.parsedType}),z;const n=t.parsedType===U.promise?t.data:Promise.resolve(t.data);return gt(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}gi.create=(r,e)=>new gi({type:r,typeName:Y.ZodPromise,...ne(e)});class nn extends ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{$(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async l=>{if(t.value==="aborted")return z;const p=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return p.status==="aborted"?z:p.status==="dirty"||t.value==="dirty"?mi(p.value):p});{if(t.value==="aborted")return z;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?z:l.status==="dirty"||t.value==="dirty"?mi(l.value):l}}if(a.type==="refinement"){const o=l=>{const p=a.refinement(l,s);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?z:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?z:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!aa(o))return o;const l=a.transform(o.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>aa(o)?Promise.resolve(a.transform(o.value,s)).then(l=>({status:t.value,value:l})):o);le.assertNever(a)}}nn.create=(r,e,t)=>new nn({schema:r,typeName:Y.ZodEffects,effect:e,...ne(t)}),nn.createWithPreprocess=(r,e,t)=>new nn({schema:e,effect:{type:"preprocess",transform:r},typeName:Y.ZodEffects,...ne(t)});class yn extends ie{_parse(e){return this._getType(e)===U.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}yn.create=(r,e)=>new yn({innerType:r,typeName:Y.ZodOptional,...ne(e)});class Kn extends ie{_parse(e){return this._getType(e)===U.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Kn.create=(r,e)=>new Kn({innerType:r,typeName:Y.ZodNullable,...ne(e)});class Ea extends ie{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ea.create=(r,e)=>new Ea({innerType:r,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});class Ra extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return sa(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new wt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new wt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ra.create=(r,e)=>new Ra({innerType:r,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});class Us extends ie{_parse(e){if(this._getType(e)!==U.nan){const n=this._getOrReturnCtx(e);return $(n,{code:N.invalid_type,expected:U.nan,received:n.parsedType}),z}return{status:"valid",value:e.data}}}Us.create=r=>new Us({typeName:Y.ZodNaN,...ne(r)});const TP=Symbol("zod_brand");class bd extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ga extends ie{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?z:s.status==="dirty"?(t.dirty(),mi(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?z:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new ga({in:e,out:t,typeName:Y.ZodPipeline})}}class ba extends ie{_parse(e){const t=this._def.innerType._parse(e),n=a=>(aa(a)&&(a.value=Object.freeze(a.value)),a);return sa(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}ba.create=(r,e)=>new ba({innerType:r,typeName:Y.ZodReadonly,...ne(e)});function Ag(r,e={},t){return r?Ti.create().superRefine((n,a)=>{var s,o;if(!r(n)){const l=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,p=(o=(s=l.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,u=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...u,fatal:p})}}):Ti.create()}const EP={object:Ke.lazycreate};var Y;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(Y||(Y={}));const RP=(r,e={message:`Input not instance of ${r.name}`})=>Ag(t=>t instanceof r,e),xs=en.create,vd=Hn.create,gP=Us.create,bP=zn.create,Id=da.create,Sg=gr.create,vP=Ls.create,IP=ca.create,Og=ua.create,DP=Ti.create,js=br.create,AP=wn.create,SP=Gs.create,OP=tn.create,Pg=Ke.create,PP=Ke.strictCreate,CP=pa.create,wP=$s.create,BP=ya.create,MP=pn.create,Cg=ha.create,_P=Fs.create,VP=vr.create,NP=Ri.create,LP=fa.create,GP=ma.create,wg=Zn.create,$P=Ta.create,FP=gi.create,Bg=nn.create,UP=yn.create,xP=Kn.create,jP=nn.createWithPreprocess,kP=ga.create;var y=Object.freeze({__proto__:null,defaultErrorMap:fi,setErrorMap:eP,getErrorMap:_s,makeIssue:Vs,EMPTY_PATH:tP,addIssueToContext:$,ParseStatus:yt,INVALID:z,DIRTY:mi,OK:gt,isAborted:Td,isDirty:Ed,isValid:aa,isAsync:sa,get util(){return le},get objectUtil(){return md},ZodParsedType:U,getParsedType:Yn,ZodType:ie,datetimeRegex:Ig,ZodString:en,ZodNumber:Hn,ZodBigInt:zn,ZodBoolean:da,ZodDate:gr,ZodSymbol:Ls,ZodUndefined:ca,ZodNull:ua,ZodAny:Ti,ZodUnknown:br,ZodNever:wn,ZodVoid:Gs,ZodArray:tn,ZodObject:Ke,ZodUnion:pa,ZodDiscriminatedUnion:$s,ZodIntersection:ya,ZodTuple:pn,ZodRecord:ha,ZodMap:Fs,ZodSet:vr,ZodFunction:Ri,ZodLazy:fa,ZodLiteral:ma,ZodEnum:Zn,ZodNativeEnum:Ta,ZodPromise:gi,ZodEffects:nn,ZodTransformer:nn,ZodOptional:yn,ZodNullable:Kn,ZodDefault:Ea,ZodCatch:Ra,ZodNaN:Us,BRAND:TP,ZodBranded:bd,ZodPipeline:ga,ZodReadonly:ba,custom:Ag,Schema:ie,ZodSchema:ie,late:EP,get ZodFirstPartyTypeKind(){return Y},coerce:{string:r=>en.create({...r,coerce:!0}),number:r=>Hn.create({...r,coerce:!0}),boolean:r=>da.create({...r,coerce:!0}),bigint:r=>zn.create({...r,coerce:!0}),date:r=>gr.create({...r,coerce:!0})},any:DP,array:OP,bigint:bP,boolean:Id,date:Sg,discriminatedUnion:wP,effect:Bg,enum:wg,function:NP,instanceof:RP,intersection:BP,lazy:LP,literal:GP,map:_P,nan:gP,nativeEnum:$P,never:AP,null:Og,nullable:xP,number:vd,object:Pg,oboolean:()=>Id().optional(),onumber:()=>vd().optional(),optional:UP,ostring:()=>xs().optional(),pipeline:kP,preprocess:jP,promise:FP,record:Cg,set:VP,strictObject:PP,string:xs,symbol:vP,transformer:Bg,tuple:MP,undefined:IP,union:CP,unknown:js,void:SP,NEVER:z,ZodIssueCode:N,quotelessJson:QO,ZodError:wt});function Mg(r){var a,s,o;if(!(r!=null&&r.dataType))return js();const e=!r.required,t=r.dataType.isList||!1;let n=js();if(((a=r.dataType.entity)==null?void 0:a.type)===i.PrimitiveEntity)switch(r.dataType.entity.name){case C.String:n=xs();break;case C.KeyValue:n=Cg(js());break;case C.Number:n=vd();break;case C.Boolean:n=Id();break;case C.Date:n=Sg();break;case C.Enum:{const l=r.dataType.options||[];if(l.length===0)throw new Error(`Enum property ${r.name} has no options`);n=wg(l);break}case C.Null:n=Og();break;case C.UUID:n=xs().uuid();break}else if(((s=r.dataType.entity)==null?void 0:s.type)===i.DefinitionEntity)n=_g(r.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=r.dataType.entity)==null?void 0:o.type}`);return e&&(n=n.nullable()),t&&(n=n.array()),n}function _g(r){const e=Pg({});for(const t of r.properties){const n=Mg(t);e.shape[t.name]=n}return e}function Vg(r){const e=r.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function Ng(r){const e=r.rangeEnd;return new Date(Math.random()*e.getTime())}function Lg(r){const e=r.rangeStart,t=r.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function Gg(r){return r.rangeStart&&r.rangeEnd?Lg(r):r.rangeStart?Vg(r):r.rangeEnd?Ng(r):new Date}function qP(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $g={},ks={},qs={};Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=WP;let Js;const JP=new Uint8Array(16);function WP(){if(!Js&&(Js=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Js))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Js(JP)}var Xn={},Ir={},Ws={};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.default=void 0;var YP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Ws.default=YP,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.default=void 0;var HP=zP(Ws);function zP(r){return r&&r.__esModule?r:{default:r}}function ZP(r){return typeof r=="string"&&HP.default.test(r)}var KP=ZP;Ir.default=KP,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.default=void 0,Xn.unsafeStringify=Fg;var XP=QP(Ir);function QP(r){return r&&r.__esModule?r:{default:r}}const ut=[];for(let r=0;r<256;++r)ut.push((r+256).toString(16).slice(1));function Fg(r,e=0){return ut[r[e+0]]+ut[r[e+1]]+ut[r[e+2]]+ut[r[e+3]]+"-"+ut[r[e+4]]+ut[r[e+5]]+"-"+ut[r[e+6]]+ut[r[e+7]]+"-"+ut[r[e+8]]+ut[r[e+9]]+"-"+ut[r[e+10]]+ut[r[e+11]]+ut[r[e+12]]+ut[r[e+13]]+ut[r[e+14]]+ut[r[e+15]]}function eC(r,e=0){const t=Fg(r,e);if(!(0,XP.default)(t))throw TypeError("Stringified UUID is invalid");return t}var tC=eC;Xn.default=tC,Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=void 0;var nC=iC(qs),rC=Xn;function iC(r){return r&&r.__esModule?r:{default:r}}let Ug,Dd,Ad=0,Sd=0;function aC(r,e,t){let n=e&&t||0;const a=e||new Array(16);r=r||{};let s=r.node||Ug,o=r.clockseq!==void 0?r.clockseq:Dd;if(s==null||o==null){const R=r.random||(r.rng||nC.default)();s==null&&(s=Ug=[R[0]|1,R[1],R[2],R[3],R[4],R[5]]),o==null&&(o=Dd=(R[6]<<8|R[7])&16383)}let l=r.msecs!==void 0?r.msecs:Date.now(),p=r.nsecs!==void 0?r.nsecs:Sd+1;const u=l-Ad+(p-Sd)/1e4;if(u<0&&r.clockseq===void 0&&(o=o+1&16383),(u<0||l>Ad)&&r.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ad=l,Sd=p,Dd=o,l+=122192928e5;const h=((l&268435455)*1e4+p)%4294967296;a[n++]=h>>>24&255,a[n++]=h>>>16&255,a[n++]=h>>>8&255,a[n++]=h&255;const f=l/4294967296*1e4&268435455;a[n++]=f>>>8&255,a[n++]=f&255,a[n++]=f>>>24&15|16,a[n++]=f>>>16&255,a[n++]=o>>>8|128,a[n++]=o&255;for(let R=0;R<6;++R)a[n+R]=s[R];return e||(0,rC.unsafeStringify)(a)}var sC=aC;ks.default=sC;var Ys={},Qn={},va={};Object.defineProperty(va,"__esModule",{value:!0}),va.default=void 0;var oC=lC(Ir);function lC(r){return r&&r.__esModule?r:{default:r}}function dC(r){if(!(0,oC.default)(r))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(r.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(r.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(r.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(r.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var cC=dC;va.default=cC,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.URL=Qn.DNS=void 0,Qn.default=fC;var uC=Xn,pC=yC(va);function yC(r){return r&&r.__esModule?r:{default:r}}function hC(r){r=unescape(encodeURIComponent(r));const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e}const xg="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Qn.DNS=xg;const jg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Qn.URL=jg;function fC(r,e,t){function n(a,s,o,l){var p;if(typeof a=="string"&&(a=hC(a)),typeof s=="string"&&(s=(0,pC.default)(s)),((p=s)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+a.length);if(u.set(s),u.set(a,s.length),u=t(u),u[6]=u[6]&15|e,u[8]=u[8]&63|128,o){l=l||0;for(let h=0;h<16;++h)o[l+h]=u[h];return o}return(0,uC.unsafeStringify)(u)}try{n.name=r}catch{}return n.DNS=xg,n.URL=jg,n}var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.default=void 0;function mC(r){if(typeof r=="string"){const e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(let t=0;t<e.length;++t)r[t]=e.charCodeAt(t)}return TC(EC(RC(r),r.length*8))}function TC(r){const e=[],t=r.length*32,n="0123456789abcdef";for(let a=0;a<t;a+=8){const s=r[a>>5]>>>a%32&255,o=parseInt(n.charAt(s>>>4&15)+n.charAt(s&15),16);e.push(o)}return e}function kg(r){return(r+64>>>9<<4)+14+1}function EC(r,e){r[e>>5]|=128<<e%32,r[kg(e)-1]=e;let t=1732584193,n=-271733879,a=-1732584194,s=271733878;for(let o=0;o<r.length;o+=16){const l=t,p=n,u=a,h=s;t=ht(t,n,a,s,r[o],7,-680876936),s=ht(s,t,n,a,r[o+1],12,-389564586),a=ht(a,s,t,n,r[o+2],17,606105819),n=ht(n,a,s,t,r[o+3],22,-1044525330),t=ht(t,n,a,s,r[o+4],7,-176418897),s=ht(s,t,n,a,r[o+5],12,1200080426),a=ht(a,s,t,n,r[o+6],17,-1473231341),n=ht(n,a,s,t,r[o+7],22,-45705983),t=ht(t,n,a,s,r[o+8],7,1770035416),s=ht(s,t,n,a,r[o+9],12,-1958414417),a=ht(a,s,t,n,r[o+10],17,-42063),n=ht(n,a,s,t,r[o+11],22,-1990404162),t=ht(t,n,a,s,r[o+12],7,1804603682),s=ht(s,t,n,a,r[o+13],12,-40341101),a=ht(a,s,t,n,r[o+14],17,-1502002290),n=ht(n,a,s,t,r[o+15],22,1236535329),t=ft(t,n,a,s,r[o+1],5,-165796510),s=ft(s,t,n,a,r[o+6],9,-1069501632),a=ft(a,s,t,n,r[o+11],14,643717713),n=ft(n,a,s,t,r[o],20,-373897302),t=ft(t,n,a,s,r[o+5],5,-701558691),s=ft(s,t,n,a,r[o+10],9,38016083),a=ft(a,s,t,n,r[o+15],14,-660478335),n=ft(n,a,s,t,r[o+4],20,-405537848),t=ft(t,n,a,s,r[o+9],5,568446438),s=ft(s,t,n,a,r[o+14],9,-1019803690),a=ft(a,s,t,n,r[o+3],14,-187363961),n=ft(n,a,s,t,r[o+8],20,1163531501),t=ft(t,n,a,s,r[o+13],5,-1444681467),s=ft(s,t,n,a,r[o+2],9,-51403784),a=ft(a,s,t,n,r[o+7],14,1735328473),n=ft(n,a,s,t,r[o+12],20,-1926607734),t=mt(t,n,a,s,r[o+5],4,-378558),s=mt(s,t,n,a,r[o+8],11,-2022574463),a=mt(a,s,t,n,r[o+11],16,1839030562),n=mt(n,a,s,t,r[o+14],23,-35309556),t=mt(t,n,a,s,r[o+1],4,-1530992060),s=mt(s,t,n,a,r[o+4],11,1272893353),a=mt(a,s,t,n,r[o+7],16,-155497632),n=mt(n,a,s,t,r[o+10],23,-1094730640),t=mt(t,n,a,s,r[o+13],4,681279174),s=mt(s,t,n,a,r[o],11,-358537222),a=mt(a,s,t,n,r[o+3],16,-722521979),n=mt(n,a,s,t,r[o+6],23,76029189),t=mt(t,n,a,s,r[o+9],4,-640364487),s=mt(s,t,n,a,r[o+12],11,-421815835),a=mt(a,s,t,n,r[o+15],16,530742520),n=mt(n,a,s,t,r[o+2],23,-995338651),t=Tt(t,n,a,s,r[o],6,-198630844),s=Tt(s,t,n,a,r[o+7],10,1126891415),a=Tt(a,s,t,n,r[o+14],15,-1416354905),n=Tt(n,a,s,t,r[o+5],21,-57434055),t=Tt(t,n,a,s,r[o+12],6,1700485571),s=Tt(s,t,n,a,r[o+3],10,-1894986606),a=Tt(a,s,t,n,r[o+10],15,-1051523),n=Tt(n,a,s,t,r[o+1],21,-2054922799),t=Tt(t,n,a,s,r[o+8],6,1873313359),s=Tt(s,t,n,a,r[o+15],10,-30611744),a=Tt(a,s,t,n,r[o+6],15,-1560198380),n=Tt(n,a,s,t,r[o+13],21,1309151649),t=Tt(t,n,a,s,r[o+4],6,-145523070),s=Tt(s,t,n,a,r[o+11],10,-1120210379),a=Tt(a,s,t,n,r[o+2],15,718787259),n=Tt(n,a,s,t,r[o+9],21,-343485551),t=er(t,l),n=er(n,p),a=er(a,u),s=er(s,h)}return[t,n,a,s]}function RC(r){if(r.length===0)return[];const e=r.length*8,t=new Uint32Array(kg(e));for(let n=0;n<e;n+=8)t[n>>5]|=(r[n/8]&255)<<n%32;return t}function er(r,e){const t=(r&65535)+(e&65535);return(r>>16)+(e>>16)+(t>>16)<<16|t&65535}function gC(r,e){return r<<e|r>>>32-e}function zs(r,e,t,n,a,s){return er(gC(er(er(e,r),er(n,s)),a),t)}function ht(r,e,t,n,a,s,o){return zs(e&t|~e&n,r,e,a,s,o)}function ft(r,e,t,n,a,s,o){return zs(e&n|t&~n,r,e,a,s,o)}function mt(r,e,t,n,a,s,o){return zs(e^t^n,r,e,a,s,o)}function Tt(r,e,t,n,a,s,o){return zs(t^(e|~n),r,e,a,s,o)}var bC=mC;Hs.default=bC,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=void 0;var vC=qg(Qn),IC=qg(Hs);function qg(r){return r&&r.__esModule?r:{default:r}}var DC=(0,vC.default)("v3",48,IC.default);Ys.default=DC;var Zs={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.default=void 0;var AC={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Ks.default=AC,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.default=void 0;var Jg=Wg(Ks),SC=Wg(qs),OC=Xn;function Wg(r){return r&&r.__esModule?r:{default:r}}function PC(r,e,t){if(Jg.default.randomUUID&&!e&&!r)return Jg.default.randomUUID();r=r||{};const n=r.random||(r.rng||SC.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=n[a];return e}return(0,OC.unsafeStringify)(n)}var CC=PC;Zs.default=CC;var Xs={},Qs={};Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.default=void 0;function wC(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function Od(r,e){return r<<e|r>>>32-e}function BC(r){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){const o=unescape(encodeURIComponent(r));r=[];for(let l=0;l<o.length;++l)r.push(o.charCodeAt(l))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);const n=r.length/4+2,a=Math.ceil(n/16),s=new Array(a);for(let o=0;o<a;++o){const l=new Uint32Array(16);for(let p=0;p<16;++p)l[p]=r[o*64+p*4]<<24|r[o*64+p*4+1]<<16|r[o*64+p*4+2]<<8|r[o*64+p*4+3];s[o]=l}s[a-1][14]=(r.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(r.length-1)*8&4294967295;for(let o=0;o<a;++o){const l=new Uint32Array(80);for(let v=0;v<16;++v)l[v]=s[o][v];for(let v=16;v<80;++v)l[v]=Od(l[v-3]^l[v-8]^l[v-14]^l[v-16],1);let p=t[0],u=t[1],h=t[2],f=t[3],R=t[4];for(let v=0;v<80;++v){const I=Math.floor(v/20),D=Od(p,5)+wC(I,u,h,f)+R+e[I]+l[v]>>>0;R=f,f=h,h=Od(u,30)>>>0,u=p,p=D}t[0]=t[0]+p>>>0,t[1]=t[1]+u>>>0,t[2]=t[2]+h>>>0,t[3]=t[3]+f>>>0,t[4]=t[4]+R>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var MC=BC;Qs.default=MC,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=void 0;var _C=Yg(Qn),VC=Yg(Qs);function Yg(r){return r&&r.__esModule?r:{default:r}}var NC=(0,_C.default)("v5",80,VC.default);Xs.default=NC;var eo={};Object.defineProperty(eo,"__esModule",{value:!0}),eo.default=void 0;var LC="00000000-0000-0000-0000-000000000000";eo.default=LC;var to={};Object.defineProperty(to,"__esModule",{value:!0}),to.default=void 0;var GC=$C(Ir);function $C(r){return r&&r.__esModule?r:{default:r}}function FC(r){if(!(0,GC.default)(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}var UC=FC;to.default=UC,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return o.default}});var e=h(ks),t=h(Ys),n=h(Zs),a=h(Xs),s=h(eo),o=h(to),l=h(Ir),p=h(Xn),u=h(va);function h(f){return f&&f.__esModule?f:{default:f}}}($g);function Pd(r,e){if(!r||!e||!r.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=r,this.dstAlphabet=e}Pd.prototype.convert=function(r){var e,t,n,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,l=r.length,p=typeof r=="string"?"":[];if(!this.isValid(r))throw new Error('Number "'+r+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return r;for(e=0;e<l;e++)a[e]=this.srcAlphabet.indexOf(r[e]);do{for(t=0,n=0,e=0;e<l;e++)t=t*s+a[e],t>=o?(a[n++]=parseInt(t/o,10),t=t%o):n>0&&(a[n++]=0);l=n,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(n!==0);return p},Pd.prototype.isValid=function(r){for(var e=0;e<r.length;++e)if(this.srcAlphabet.indexOf(r[e])===-1)return!1;return!0};var xC=Pd,jC=xC;function Ia(r,e){var t=new jC(r,e);return function(n){return t.convert(n)}}Ia.BIN="01",Ia.OCT="01234567",Ia.DEC="0123456789",Ia.HEX="0123456789abcdef";var kC=Ia;const{v4:Cd,validate:qC}=$g,no=kC,wd={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},JC={consistentLength:!0};let Bd;const Hg=(r,e,t)=>{const n=e(r.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?n:n.padStart(t.shortIdLength,t.paddingChar)},zg=(r,e)=>{const n=e(r).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[n[1],n[2],n[3],n[4],n[5]].join("-")},WC=r=>Math.ceil(Math.log(2**128)/Math.log(r));var YC=(()=>{const r=(e,t)=>{const n=e||wd.flickrBase58,a={...JC,...t};if([...new Set(Array.from(n))].length!==n.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=WC(n.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:n[0]},l=no(no.HEX,n),p=no(n,no.HEX),u=()=>Hg(Cd(),l,o),f={alphabet:n,fromUUID:R=>Hg(R,l,o),maxLength:s,generate:u,new:u,toUUID:R=>zg(R,p),uuid:Cd,validate:(R,v=!1)=>{if(!R||typeof R!="string")return!1;const I=a.consistentLength?R.length===s:R.length<=s,D=R.split("").every(S=>n.includes(S));return v===!1?I&&D:I&&D&&qC(zg(R,p))}};return Object.freeze(f),f};return r.constants=wd,r.uuid=Cd,r.generate=()=>(Bd||(Bd=r(wd.flickrBase58).generate),Bd()),r})();const ro=qP(YC);function Zg(){return ro().uuid()}function Kg(r){return r.rangeStart+Math.random()}function Xg(r){const e=r.rangeEnd;return Math.random()*e}function Qg(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random()*(t-e)+e}function eb(r){return r.rangeStart&&r.rangeEnd?Qg(r):r.rangeStart?Kg(r):r.rangeEnd?Xg(r):Math.random()}function tb(r){const e=r.rangeStart;return Math.random().toString(36).substring(e)}function nb(r){const e=r.rangeEnd;return Math.random().toString(36).substring(0,e)}function rb(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random().toString(36).substring(e,t)}function ib(r){return r.rangeStart&&r.rangeEnd?rb(r):r.rangeStart?tb(r):r.rangeEnd?nb(r):Math.random().toString(36)}function ab(r){return Math.random()>=.5}function HC(r){if(!r||!r.autogeneration)return null;switch(r.autogeneration.type){case ze.CurrentDateAndTime:if(r.name===C.Date)return new Date;case ze.Random:{if(r.name===C.Date)return Gg(r.autogeneration);if(r.name===C.Number)return eb(r.autogeneration);if(r.name===C.String)return ib(r.autogeneration);if(r.name===C.Boolean)return ab(r.autogeneration)}case ze.Unique:if(r.name===C.UUID)return Zg();default:throw new Error(`Generating a ${r.autogeneration.type} value for a ${r.name} is not supported`)}}const H="e7eb5382-3d99-44fd-972a-b8b1e819f6be",sb="global-user-variable-id",Md="last-executed-timestamp-variable-id",zC={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:i.ValueDescriptor},ZC={id:"alternative-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:i.Property},KC={like:!1,inferred:!1,id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:ZC},io={id:"alternative-relational-database-entity-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-id",entityType:i.DefinitionEntity},XC={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:As,static:!0,index:0,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:null,parent:zC,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:KC,description:"The name of the main database inside of the server instance where the data will be stored.",parent:io};i.GenericReference,i.ValueDescriptor;const QC={id:"alternative-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:i.Property},ew={like:!1,inferred:!1,id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:QC},tw={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:Ss,static:!0,index:1,defaultValue:null,dataType:ew,description:"The username that will be used to connect to the database.",parent:io};i.GenericReference,i.ValueDescriptor;const nw={id:"alternative-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:i.Property},rw={like:!1,inferred:!1,id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:nw},iw={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:Os,static:!0,index:2,defaultValue:null,dataType:rw,description:"The password that will be used to connect to the database.",parent:io},aw={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:i.ValueDescriptor},sw={id:"alternative-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:i.Property},ow={like:!1,inferred:!1,id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:sw},lw={constant:!1,hidden:!1,required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Ps,static:!0,index:3,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:6,parent:aw,autogeneration:null,valueAsType:null},dataType:ow,description:"The minimum size of the database in GB.",parent:io},dw={id:"alternative-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},_d={id:"alternative-relational-database-entity-id",type:i.DefinitionEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[XC,tw,iw,lw],methods:[],abstractMethods:[],extends:[],implements:[cn],x:0,y:0,parent:dw},cw={id:"animal-prototype-database-property-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-id",entityType:i.Property},uw={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-id",entityType:i.Property},pw={like:!1,inferred:!1,id:"animal-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:cw},yw={id:"animal-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",entityType:i.DefinitionEntity},hw={constant:!1,hidden:!1,required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:_d,autogeneration:null,parent:uw},dataType:pw,description:"The database that the entity belongs to.",parent:yw},fw={type:i.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:i.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},mw={like:!1,inferred:!1,id:"c1930577-9e79-48a6-8905-be24611015c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:fw},Tw={type:i.GenericReference,id:"animal-name-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"83eaa847-e62b-4192-84fb-3d8d6f5ea970"},Ew={constant:!1,hidden:!1,required:!0,type:i.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",defaultValue:null,implements:pi,static:!1,private:!1,index:0,dataType:mw,abstract:!1,parent:Tw},Rw={type:i.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:i.Project,entityId:H},gw={type:i.DefinitionEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[hw,Ew],methods:[],extends:[],implements:[st],x:0,y:0,parent:Rw},Da="base-table-entity",ob="base-table-entity-identifier-property-id";i.GenericReference,i.Property,i.GenericReference,i.Property;const bw={id:"base-table-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:ob,entityType:i.Property},vw={id:"base-table-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-identifier-property-id",entityType:i.Property},Iw={like:!1,inferred:!1,id:"base-table-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:vw},Dw={id:"base-table-entity-identifier-property-parent-ref-id",type:i.GenericReference,entityId:Da,entityType:i.DefinitionEntity};i.Property,i.LiteralValue,C.UUID,ze.Unique,i.GenericReference,i.Property;const Aw={id:"base-table-entity-deleted-at-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-deleted-at-property-id",entityType:i.Property},Sw={like:!1,inferred:!1,id:"base-table-entity-deleted-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:on,asType:!1,parent:Aw},Ow={id:"base-table-entity-deleted-at-property-parent-ref-id",type:i.GenericReference,entityId:Da,entityType:i.DefinitionEntity},Pw={constant:!1,hidden:!0,required:!0,id:"base-table-entity-deleted-at-property-id",name:"Deleted at",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!1,index:0,defaultValue:null,dataType:Sw,description:"The date and time when the entity was deleted.",parent:Ow};i.GenericReference,i.Property;const Cw={id:"base-table-entity-created-at-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-created-at-property-id",entityType:i.Property},ww={like:!1,inferred:!1,id:"base-table-entity-created-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:on,asType:!1,parent:Cw},Bw={id:"base-table-entity-created-at-property-parent-ref-id",type:i.GenericReference,entityId:Da,entityType:i.DefinitionEntity},Mw={constant:!1,hidden:!0,required:!0,id:"base-table-entity-created-at-property-id",name:"Created at",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!1,index:0,defaultValue:null,dataType:ww,description:"The date and time when the entity was created.",parent:Bw};i.GenericReference,i.Property;const _w={id:"base-table-entity-updated-at-property-ref-id",type:i.GenericReference,entityId:"base-table-entity-updated-at-property-id",entityType:i.Property},Vw={like:!1,inferred:!1,id:"base-table-entity-updated-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:on,asType:!1,parent:_w},Nw={id:"base-table-entity-updated-at-property-parent-ref-id",type:i.GenericReference,entityId:Da,entityType:i.DefinitionEntity},Lw={constant:!1,hidden:!0,required:!0,id:"base-table-entity-updated-at-property-id",name:"Updated at",version:1,type:i.Property,private:!1,implements:null,abstract:!0,static:!1,index:0,defaultValue:null,dataType:Vw,description:"The date and time when the entity was last updated.",parent:Nw},Gw={id:"base-table-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Ft={id:Da,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:"Base database table format",type:i.DefinitionEntity,abstract:!0,static:!1,abstractMethods:[],implements:[],properties:[Pw,Mw,Lw],methods:[],extends:[],x:0,y:0,parent:Gw},$w={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:i.Property},Fw={id:"default-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:i.Property},Uw={like:!1,inferred:!1,id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:Fw},bi={id:"default-relational-database-entity-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-id",entityType:i.DefinitionEntity},xw={constant:!1,id:"default-relational-database-entity-identifier-property-id",hidden:!1,required:!0,name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:As,static:!0,index:0,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"main",parent:$w,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:Uw,description:"The name of the main database inside of the server instance where the data will be stored.",parent:bi};i.GenericReference,i.Property;const jw={id:"default-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:i.Property},kw={id:"default-relational-database-entity-username-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:i.Property},qw={like:!1,inferred:!1,id:"default-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:jw},Jw={constant:!1,hidden:!1,required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:Ss,defaultValue:{id:"default-relational-database-entity-username-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"root",parent:kw,autogeneration:null,valueAsType:null},static:!0,index:1,dataType:qw,description:"The username that will be used to connect to the database.",parent:bi};i.GenericReference,i.Property;const Ww={id:"default-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:i.Property},Yw={id:"default-relational-database-entity-password-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:i.Property},Hw={like:!1,inferred:!1,id:"default-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:Ww},zw={constant:!1,hidden:!1,required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:Os,static:!0,index:2,defaultValue:{id:"default-relational-database-entity-password-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"password",parent:Yw,autogeneration:null,valueAsType:null},dataType:Hw,description:"The password that will be used to connect to the database.",parent:bi},Zw={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:i.Property},Kw={id:"default-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:i.Property},Xw={like:!1,inferred:!1,id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:Kw},Qw={constant:!1,hidden:!1,required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Ps,static:!0,index:3,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:6,parent:Zw,autogeneration:null,valueAsType:null},dataType:Xw,description:"The minimum size of the database in GB.",parent:bi},eB={id:"default-relational-database-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:i.Property},tB={id:"default-relational-database-entity-default-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:i.Property},nB={like:!1,inferred:!1,id:"default-relational-database-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:tB},rB={constant:!1,id:"default-relational-database-entity-default-property-id",hidden:!0,required:!0,name:"Default",description:"Whether this database is automatically picked by other entities as the default database.",version:1,type:i.Property,private:!1,abstract:!1,implements:cd,static:!0,index:4,dataType:nB,defaultValue:{id:"default-relational-database-entity-default-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!0,parent:eB,autogeneration:null,valueAsType:null},parent:bi},iB={id:"default-relational-database-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:i.Property},aB={id:"default-relational-database-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:i.Property},sB={like:!1,inferred:!1,id:"default-relational-database-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:ee,asType:!1,parent:aB},oB={constant:!1,id:"default-relational-database-entity-autoscaling-property-id",hidden:!1,required:!0,name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!1,implements:ud,static:!0,index:5,defaultValue:{id:"default-relational-database-entity-autoscaling-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.Boolean,value:!0,parent:iB,autogeneration:null,valueAsType:null},dataType:sB,description:"If true, this database will automatically scale up or down in memory size, based on the usage.s",parent:bi},lB={id:"default-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Vd={id:"default-relational-database-entity-id",type:i.DefinitionEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[rB,oB,xw,Jw,zw,Qw],methods:[],abstractMethods:[],extends:[],implements:[cn],x:0,y:0,parent:lB},dB={id:"user-prototype-database-property-data-type-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-id",entityType:i.Property},cB={id:"user-prototype-database-property-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-id",entityType:i.Property},uB={like:!1,inferred:!1,id:"user-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:cB},pB={id:"user-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.DefinitionEntity},yB={constant:!1,hidden:!1,required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:Vd,autogeneration:null,parent:dB},dataType:uB,description:"The database that the entity belongs to.",parent:pB},hB={type:i.GenericReference,id:"user-prototype-parent-ref-id",entityType:i.Project,entityId:H},fB={id:"user-prototype-primary-key-property-data-type-ref-id",type:i.GenericReference,entityId:"user-prototype-primary-key-property-id",entityType:i.Property},mB={id:"user-prototype-primary-key-property-ref-id",type:i.GenericReference,entityId:"user-prototype-primary-key-property-id",entityType:i.Property},TB={like:!1,inferred:!1,id:"user-prototype-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:mB},EB={id:"user-prototype-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.DefinitionEntity},RB={constant:!1,hidden:!1,required:!0,id:"user-prototype-primary-key-property-id",name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:pi,static:!1,index:1,defaultValue:{id:"user-prototype-primary-key-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.UUID,value:null,parent:fB,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:TB,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:EB},Nd={type:i.DefinitionEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[st,Ft],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[yB,RB],methods:[],x:0,y:0,parent:hB},gB={type:i.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:i.Property,entityId:"person-date-of-birth-property-id"},bB={like:!1,inferred:!1,id:"person-date-of-birth-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:on,isList:!1,asType:!1,parent:gB},vB={type:i.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},IB={constant:!1,hidden:!1,required:!0,type:i.Property,id:"person-date-of-birth-property-id",version:1,name:"Date of birth",description:"The date of birth of the person",implements:null,private:!1,static:!1,index:0,defaultValue:null,dataType:bB,abstract:!1,parent:vB},DB={type:i.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:i.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},AB={like:!1,inferred:!1,id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:DB},SB={type:i.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:i.DefinitionEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},OB={constant:!1,hidden:!1,required:!0,type:i.Property,id:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7",version:1,name:"Name",description:"The name of the person",implements:null,private:!1,static:!1,index:0,defaultValue:null,dataType:AB,abstract:!1,parent:SB},PB={type:i.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:i.Project,entityId:H},bt={type:i.DefinitionEntity,id:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416",version:1,name:"Person",description:"A entity to store more information about a person than the user entity does, to split the responsibilities and keep it the logic clean.",properties:[OB,IB],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[Nd],x:0,y:0,parent:PB},CB={type:i.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},wB={type:i.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:i.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},BB={type:i.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},MB={type:i.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:i.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},_B={like:!1,inferred:!1,id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:MB},Ld={constant:!0,isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:i.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,defaultValue:null,dataType:_B,implements:null,readsValue:BB,required:!0,index:0,parent:wB},VB={type:i.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},NB={type:i.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},lb={type:i.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[Ld],calledByError:[],calledByEntry:[VB],calledBySuccess:[],throws:null,x:0,y:0,parent:NB},LB={type:i.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},GB={like:!1,inferred:!1,id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:LB},db={constant:!0,id:"500dee3a-3435-4453-9699-0d053f646523",type:i.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,defaultValue:null,dataType:GB,implements:null,required:!0,writesValues:[Ld],index:0,parent:CB},$B={type:i.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},cb={type:i.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[db],calls:[lb],returnStatements:[lb],index:0,collapsed:!1,private:!1,x:0,y:0,parent:$B},FB={type:i.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:i.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},UB={like:!1,inferred:!1,id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,parent:FB},xB={type:i.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:i.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},jB={type:i.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},kB={constant:!0,required:!0,id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:i.VariableDeclaration,version:1,name:"Output Account Owner",description:null,defaultValue:null,dataType:UB,readsValue:xB,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:jB},qB={type:i.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},JB={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:i.OutputMap,version:1,declaration:Ld,defaultValue:null,writesValues:[kB],index:0,parent:qB},WB={type:i.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},YB={type:i.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},HB={type:i.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},zB={like:!1,inferred:!1,id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,parent:HB},ZB={type:i.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},KB={type:i.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},XB={type:i.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},QB={type:i.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},ub={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:i.InputMap,version:1,declaration:db,name:null,description:null,readsValue:QB,defaultValue:null,index:0,parent:XB},eM={constant:!0,required:!0,type:i.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,defaultValue:null,dataType:zB,readsValue:ZB,writesValues:[ub],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:KB},tM={type:i.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:cb,inputs:[ub],outputs:[JB],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[WB],calledBySuccess:[],parent:YB,error:null,x:0,y:0},nM={type:i.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},rM={like:!1,inferred:!1,id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,parent:nM},iM={type:i.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},aM={constant:!0,id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:i.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",defaultValue:null,dataType:rM,implements:null,required:!0,index:0,writesValues:[eM],parent:iM},sM={type:i.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},oM={type:i.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[aM],collapsed:!0,returnStatements:[],calls:[tM],private:!1,index:0,implements:null,x:0,y:0,parent:sM},lM={type:i.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:i.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},dM={like:!1,inferred:!1,id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:lM},cM={type:i.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},uM={constant:!1,hidden:!1,required:!0,type:i.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,defaultValue:null,implements:pi,static:!1,index:0,dataType:dM,abstract:!1,parent:cM},pM={type:i.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:i.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},yM={like:!1,inferred:!1,id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:pM},hM={type:i.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:i.DefinitionEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},fM={constant:!1,hidden:!1,required:!0,type:i.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,defaultValue:null,dataType:yM,implements:null,static:!1,private:!0,abstract:!1,parent:hM},mM={type:i.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:i.Project,entityId:H},vi={type:i.DefinitionEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[uM,fM],methods:[cb,oM],extends:[],implements:[st,Ft],x:0,y:0,parent:mM},Aa="bitcoin-api-response-id",pb="time-property-id",yb="disclaimer-property-id",hb="chart-name-property-id",fb="bpi-property-id",ao="bpi-entity-id",mb="usd-property-id",Tb="gbp-property-id",Eb="eur-property-id",Ii="currency-entity-id",Rb="currency-code-property-id",gb="currency-symbol-property-id",bb="currency-rate-property-id",vb="currency-description-property-id",Ib="currency-rate-number-property-id",TM={type:i.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:i.Property,entityId:Rb},EM={like:!1,inferred:!1,id:"code-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["USD","GBP","EUR"],parent:TM},RM={type:i.GenericReference,id:"code-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},gM={constant:!1,hidden:!1,required:!0,type:i.Property,id:Rb,version:1,name:"code",description:null,defaultValue:null,dataType:EM,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:RM},bM={type:i.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:i.Property,entityId:gb},vM={like:!1,inferred:!1,id:"symbol-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["$","£","€"],parent:bM},IM={type:i.GenericReference,id:"symbol-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},DM={constant:!1,hidden:!1,required:!0,type:i.Property,id:gb,version:1,name:"symbol",description:null,index:0,defaultValue:null,dataType:vM,implements:null,static:!1,private:!1,abstract:!1,parent:IM},AM={type:i.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:i.Property,entityId:bb},SM={like:!1,inferred:!1,id:"rate-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:AM},OM={type:i.GenericReference,id:"rate-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},PM={constant:!1,hidden:!1,required:!0,type:i.Property,id:bb,version:1,name:"rate",description:null,index:0,defaultValue:null,dataType:SM,implements:null,static:!1,private:!1,abstract:!1,parent:OM},CM={type:i.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:i.Property,entityId:vb},wM={like:!1,inferred:!1,id:"description-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:CM},BM={type:i.GenericReference,id:"description-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},MM={constant:!1,hidden:!1,required:!0,type:i.Property,id:vb,version:1,name:"description",description:null,defaultValue:null,dataType:wM,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:BM},_M={type:i.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:i.Property,entityId:Ib},VM={like:!1,inferred:!1,id:"rate-number-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:_M},NM={type:i.GenericReference,id:"rate-number-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Ii},LM={constant:!1,hidden:!1,required:!0,type:i.Property,id:Ib,version:1,name:"rate_float",description:null,defaultValue:null,dataType:VM,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:NM},GM={type:i.GenericReference,id:"currency-prototype-parent-ref-id",entityType:i.Project,entityId:H},so={type:i.DefinitionEntity,id:Ii,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[gM,DM,PM,MM,LM],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:GM},$M={type:i.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:i.Property,entityId:mb},FM={like:!1,inferred:!1,id:"usd-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:so,isList:!1,asType:!1,parent:$M},UM={type:i.GenericReference,id:"usd-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:ao},xM={constant:!1,hidden:!1,required:!0,id:mb,type:i.Property,version:1,name:"USD",description:null,index:0,dataType:FM,defaultValue:null,implements:null,static:!1,private:!1,abstract:!1,parent:UM},jM={type:i.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:i.Property,entityId:Tb},kM={like:!1,inferred:!1,id:"gbp-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:so,isList:!1,asType:!1,parent:jM},qM={type:i.GenericReference,id:"gbp-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:ao},JM={constant:!1,hidden:!1,required:!0,id:Tb,type:i.Property,version:1,name:"GBP",description:null,index:0,dataType:kM,defaultValue:null,implements:null,static:!1,private:!1,abstract:!1,parent:qM},WM={type:i.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:i.Property,entityId:Eb},YM={like:!1,inferred:!1,id:"eur-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:so,isList:!1,asType:!1,parent:WM},HM={type:i.GenericReference,id:"eur-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:ao},zM={constant:!1,hidden:!1,required:!0,id:Eb,type:i.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,defaultValue:null,dataType:YM,private:!1,abstract:!1,parent:HM},ZM={type:i.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:i.Project,entityId:H},Db={type:i.DefinitionEntity,id:ao,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[xM,JM,zM],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:ZM},KM={type:i.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:i.Property,entityId:pb},XM={like:!1,inferred:!1,id:"time-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ai,isList:!1,asType:!1,parent:KM},QM={type:i.GenericReference,id:"time-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Aa},e_={constant:!1,hidden:!1,required:!0,type:i.Property,id:pb,version:1,name:"time",description:null,index:0,defaultValue:null,dataType:XM,implements:null,static:!1,private:!1,abstract:!1,parent:QM},t_={type:i.GenericReference,id:"disclaimer-property-data-type-parent-ref-id",entityType:i.Property,entityId:yb},n_={like:!1,inferred:!1,id:"disclaimer-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:t_},r_={type:i.GenericReference,id:"disclaimer-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Aa},i_={constant:!1,hidden:!1,required:!0,type:i.Property,id:yb,version:1,name:"disclaimer",description:null,index:0,defaultValue:null,dataType:n_,implements:null,static:!1,private:!1,abstract:!1,parent:r_},a_={type:i.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:i.Property,entityId:hb},s_={like:!1,inferred:!1,id:"chart-name-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:a_},o_={type:i.GenericReference,id:"chart-name-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Aa},l_={constant:!1,hidden:!1,required:!0,type:i.Property,id:hb,version:1,name:"chartName",description:null,index:0,defaultValue:null,dataType:s_,implements:null,static:!1,private:!1,abstract:!1,parent:o_},d_={type:i.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:i.Property,entityId:fb},c_={like:!1,inferred:!1,id:"bpi-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Db,isList:!1,asType:!1,parent:d_},u_={type:i.GenericReference,id:"bpi-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:Aa},p_={constant:!1,hidden:!1,required:!0,type:i.Property,id:fb,version:1,name:"bpi",description:null,implements:null,index:0,defaultValue:null,dataType:c_,static:!1,private:!1,abstract:!1,parent:u_},y_={type:i.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:i.Project,entityId:H},Ab={type:i.DefinitionEntity,id:Aa,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[e_,i_,l_,p_],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:y_},h_={type:i.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},f_={like:!1,inferred:!1,id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:h_},m_={type:i.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:i.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},T_={type:i.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:i.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},E_={like:!1,inferred:!1,id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:T_},R_={type:i.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Sb={constant:!0,isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",implements:null,defaultValue:null,dataType:E_,readsValue:R_,required:!0,index:0,parent:m_},g_={type:i.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},b_={constant:!0,id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:i.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,implements:null,defaultValue:null,dataType:f_,writesValues:[Sb],required:!0,index:0,parent:g_},v_={type:i.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},I_={type:i.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},D_={type:i.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},Ob={type:i.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[Sb],calledByError:[],calledByEntry:[I_],calledBySuccess:[],throws:null,x:0,y:0,parent:D_},A_={type:i.FunctionDeclaration,id:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4",version:1,name:"Change owner of company",description:"Change the owner of the company to a new person",inputs:[b_],calls:[Ob],index:0,collapsed:!1,implements:null,returnStatements:[Ob],private:!1,x:0,y:0,parent:v_},S_={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},O_={type:i.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},P_={type:i.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:i.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},C_={type:i.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},w_={type:i.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:i.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},B_={like:!1,inferred:!1,id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:An,asType:!1,isList:!1,parent:w_},Gd={constant:!0,isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:i.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",defaultValue:null,dataType:B_,implements:null,readsValue:C_,required:!0,index:0,parent:P_},M_={type:i.GenericReference,id:"gov-company-registry-return-statement-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},$d={type:i.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[Gd],calledByError:[],calledByEntry:[],calledBySuccess:[S_,M_],throws:null,x:0,y:0,parent:O_},__={type:i.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},V_={type:i.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},Pb={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:kl,name:null,description:null,readsValue:V_,defaultValue:null,parent:__,index:2},N_={type:i.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},L_={like:!1,inferred:!1,id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:An,isList:!1,asType:!1,parent:N_},G_={type:i.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},$_={type:i.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:i.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},F_={type:i.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:i.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},Cb={constant:!0,required:!0,type:i.VariableDeclaration,id:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a",version:1,name:"Is name registered",description:"Whether the company name is registered with the government company registry",defaultValue:null,dataType:L_,readsValue:$_,writesValues:[Gd],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[F_],successCalls:[$d],errorCalls:[],internalCalls:[],x:0,y:0,parent:G_},U_={type:i.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:i.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},x_={type:i.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},j_={type:i.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:hs,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:i.LiteralValue,version:1,value:"https://api.publicapis.org/entries",name:C.String,valueAsType:null,parent:U_,autogeneration:null},index:1,parent:x_},k_={type:i.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},q_={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:i.OutputMap,version:1,defaultValue:null,declaration:Rs,index:2,writesValues:[Cb],parent:k_},J_={type:i.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},W_={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:i.InputMap,version:1,declaration:ys,name:null,description:null,readsValue:null,index:0,defaultValue:null,parent:J_},Y_={type:i.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},H_={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:i.InputMap,version:1,name:null,description:null,declaration:fs,index:3,readsValue:null,defaultValue:null,parent:Y_},z_={type:i.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},Z_={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:i.InputMap,version:1,declaration:ms,name:null,description:null,readsValue:null,index:4,defaultValue:null,parent:z_},K_={type:i.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},X_={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:i.OutputMap,version:1,defaultValue:null,declaration:Es,index:1,writesValues:[],parent:K_},Q_={type:i.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},eV={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:i.OutputMap,version:1,defaultValue:null,declaration:Ts,index:0,writesValues:[],parent:Q_},tV={type:i.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},nV={type:i.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},rV={type:i.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},iV={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},aV={type:i.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:i.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},sV={like:!1,inferred:!1,id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:it,asType:!1,isList:!1,parent:aV},oV={type:i.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:i.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},wb={constant:!0,isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:i.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:sV,defaultValue:null,implements:null,required:!0,readsValue:null,index:0,parent:oV},Bb={type:i.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[iV],calledByEntry:[],calledBySuccess:[],throws:wb,x:0,y:0,parent:rV},lV={type:i.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},dV={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:i.OutputMap,declaration:ql,defaultValue:null,version:1,writesValues:[wb],index:0,parentRelationType:ri.Error,parent:lV},cV={type:i.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Xi,inputs:[W_,j_,Pb,H_,Z_],outputs:[eV,X_,q_],process:null,calledByError:[],calledByEntry:[tV],calledBySuccess:[],successCalls:[$d,Cb],errorCalls:[Bb],error:dV,x:0,y:0,parent:nV},uV={type:i.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:i.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},pV={type:i.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},yV={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:cs,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:i.LiteralValue,version:1,value:"?name=",name:C.String,parent:uV,valueAsType:null,autogeneration:null},index:0,parent:pV},hV={type:i.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},fV={type:i.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},mV={type:i.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},TV={like:!1,inferred:!1,id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:mV},EV={type:i.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:i.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},RV={type:i.GenericReference,id:"assembled-query-string-called-by-ref",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Mb={constant:!0,required:!0,type:i.VariableDeclaration,id:"83e12ebb-c958-4dee-b750-8ab9930f0f4e",version:1,name:"Query string",description:"The final, assembled query string that will be used in the HTTP request to the government company registry",defaultValue:null,dataType:TV,readsValue:EV,writesValues:[Pb],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[RV],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:fV},gV={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:i.OutputMap,version:1,defaultValue:null,writesValues:[Mb],declaration:Zi,index:0,parent:hV},bV={type:i.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},vV={type:i.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},IV={type:i.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:i.ArgumentDeclaration},DV={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},_b={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:i.InputMap,declaration:us,name:null,description:null,readsValue:IV,defaultValue:null,index:1,parent:DV},AV={type:i.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:Ki,version:1,inputs:[_b,yV],outputs:[gV],process:null,calledByError:[],calledByEntry:[bV],calledBySuccess:[],successCalls:[Mb],errorCalls:[],error:null,x:0,y:0,parent:vV},SV={type:i.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:i.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},OV={like:!1,inferred:!1,id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:SV},PV={type:i.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},Vb={constant:!0,id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:i.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:OV,defaultValue:null,implements:null,required:!1,writesValues:[_b],index:0,parent:PV},CV={type:i.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:i.Project,entityId:H},Nb={type:i.FunctionDeclaration,id:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d",version:1,name:"Check Gov Company Registry availability",description:"Check whether the company name is already registered in the government company registry, or it is available for a new company to use.",inputs:[Vb],calls:[AV,cV],returnStatements:[$d,Bb],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:CV},wV={type:i.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},BV={type:i.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},MV={type:i.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},_V={type:i.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Lb={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:i.InputMap,declaration:Vb,name:null,description:null,readsValue:MV,defaultValue:null,index:0,parent:_V},VV={type:i.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},NV={type:i.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:i.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},LV={like:!1,inferred:!1,id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:An,asType:!1,isList:!1,parent:NV},GV={type:i.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:i.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},$V={type:i.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},FV={type:i.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Gb={constant:!0,required:!0,type:i.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",defaultValue:null,dataType:LV,readsValue:GV,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[FV],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:$V},UV={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.OutputMap,version:1,declaration:Gd,defaultValue:null,writesValues:[Gb],index:0,parent:VV},xV={type:i.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:Nb,inputs:[Lb],outputs:[UV],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[wV],successCalls:[Gb],errorCalls:[],error:null,x:0,y:0,parent:BV},jV={type:i.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},kV={type:i.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},qV={type:i.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},JV={type:i.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},$b={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:i.InputMap,declaration:Rr.inputs[0],name:null,description:null,readsValue:qV,defaultValue:null,index:0,parent:JV},WV={type:i.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:Rr,inputs:[$b],calledByError:[],calledByEntry:[jV],calledBySuccess:[],successCalls:[xV],errorCalls:[],x:0,y:0,parent:kV},YV={type:i.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},HV={type:i.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:i.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},zV={like:!1,inferred:!1,id:"d64152ea-831f-4426-9506-a39bfa170513",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vi,asType:!1,isList:!1,parent:HV},ZV={type:i.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},KV={type:i.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},XV={type:i.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},Fb={constant:!0,required:!0,type:i.VariableDeclaration,id:"9c928995-0dd5-4f97-9962-56b343bc8a45",version:1,name:"New bank account",description:"The new entity value representing the new bank account of the company",defaultValue:null,dataType:zV,readsValue:KV,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[XV],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:ZV},QV={type:i.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},eN={like:!1,inferred:!1,id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vi,asType:!1,isList:!1,parent:QV},tN={constant:!0,id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:i.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:eN,implements:null,defaultValue:null,required:!0,index:1,writesValues:[Fb],parent:YV},nN={type:i.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},rN={type:i.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},iN={type:i.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},aN={like:!1,inferred:!1,id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:iN},sN={constant:!0,id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:i.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:aN,implements:null,defaultValue:null,required:!0,index:0,writesValues:[$b,Lb],parent:rN},oN={type:i.FunctionDeclaration,id:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84",version:1,name:"Company changed event",description:"The event that is triggered when a company is changed",returnStatements:[],collapsed:!1,inputs:[sN,tN],calls:[WV,Fb],index:1,private:!1,implements:null,x:0,y:0,parent:nN},lN={type:i.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},dN={type:i.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-manager-property-id"},cN={like:!1,inferred:!1,id:"employee-manager-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lN,isList:!1,asType:!1,parent:dN},uN={type:i.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},pN={constant:!1,required:!0,hidden:!1,type:i.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,defaultValue:null,dataType:cN,abstract:!1,parent:uN},yN={type:i.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-start-date-property-id"},hN={like:!1,inferred:!1,id:"employee-start-date-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:on,isList:!1,asType:!1,parent:yN},fN={type:i.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},mN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"employee-start-date-property-id",version:1,name:"Start date",description:"The date the employee started working in the company",index:0,private:!1,static:!1,defaultValue:null,implements:null,dataType:hN,abstract:!1,parent:fN},TN={type:i.GenericReference,id:"employee-department-property-ref-id",entityType:i.Property,entityId:"employee-department-property-id"},EN={like:!1,inferred:!1,id:"employee-department-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],parent:TN},RN={type:i.GenericReference,id:"employee-department-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"employee-entity-id"},gN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"employee-department-property-id",version:1,name:"Department",description:"The department the employee works in, from a list of departments in the company",index:0,defaultValue:null,implements:null,static:!1,private:!1,dataType:EN,abstract:!1,parent:RN},bN={type:i.GenericReference,id:"employee-prototype-parent-ref-id",entityType:i.Project,entityId:H},Yt={type:i.DefinitionEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[gN,mN,pN],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[bt],x:0,y:0,parent:bN},vN={type:i.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:i.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},IN={like:!1,inferred:!1,id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:vN},DN={type:i.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},AN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,defaultValue:null,implements:null,dataType:IN,abstract:!1,parent:DN},SN={type:i.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:i.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},ON={like:!1,inferred:!1,id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vi,isList:!1,asType:!1,parent:SN},PN={type:i.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},Fd={constant:!1,hidden:!1,required:!0,type:i.Property,id:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",version:1,name:"Bank account",description:"The bank account of the company",index:1,implements:null,static:!1,private:!1,defaultValue:null,dataType:ON,abstract:!1,parent:PN},CN={type:i.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:i.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},wN={like:!1,inferred:!1,id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,parent:CN},BN={type:i.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},MN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"19a31727-1fba-40a5-be25-18e0f149d5cb",version:1,name:"Company Owner",description:"The person that owns the company",index:2,static:!1,implements:null,defaultValue:null,dataType:wN,private:!0,abstract:!1,parent:BN},_N={type:i.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:i.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},VN={like:!1,inferred:!1,id:"ad44250b-40c2-48f7-a480-381fa938f562",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,isList:!0,asType:!1,parent:_N},NN={type:i.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:i.DefinitionEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},LN={constant:!1,hidden:!1,required:!0,type:i.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,defaultValue:null,dataType:VN,implements:null,private:!0,static:!1,abstract:!1,parent:NN},GN={id:"company-prototype-primary-key-property-data-type-ref-id",type:i.GenericReference,entityId:"company-prototype-primary-key-property-id",entityType:i.Property},$N={id:"company-prototype-primary-key-property-ref-id",type:i.GenericReference,entityId:"company-prototype-primary-key-property-id",entityType:i.Property},FN={like:!1,inferred:!1,id:"company-prototype-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:$N},UN={id:"company-prototype-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",entityType:i.DefinitionEntity},xN={constant:!1,hidden:!1,required:!0,id:"company-prototype-primary-key-property-id",name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:pi,static:!1,index:4,defaultValue:{id:"company-prototype-primary-key-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.UUID,value:null,parent:GN,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:FN,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:UN},jN={type:i.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:i.Project,entityId:H},Ht={type:i.DefinitionEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[AN,Fd,MN,LN,xN],static:!1,abstract:!1,abstractMethods:[],methods:[A_,oN],extends:[],implements:[st,Ft],x:0,y:0,parent:jN},kN={type:i.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:i.Project,entityId:H},Ud={type:i.FunctionDeclaration,id:"0f89260c-8c58-4639-8629-d9ea5ab40ba7",version:1,name:"Show popup",description:null,inputs:[],calls:[],returnStatements:[],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:kN};i.GenericReference,i.DataType;const qN={id:"cron-job-entity-expression-property-ref-id",type:i.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:i.Property},JN={like:!1,inferred:!1,id:"cron-job-entity-expression-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:qN},WN={id:"cron-job-entity-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.DefinitionEntity},YN={constant:!1,hidden:!1,required:!0,id:"cron-job-entity-expression-property-id",type:i.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",defaultValue:null,dataType:JN,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:WN},HN={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:i.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:i.FunctionDeclaration},zN={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:i.FunctionDeclaration},ZN={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:i.FunctionCall,declaration:Ud,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[HN],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:zN},KN={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.DefinitionEntity},XN={id:"cron-job-entity-trigger-func-decl-id",version:1,type:i.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:yd,calls:[ZN],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:KN},QN={id:"cron-job-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},eL={id:"cron-job-entity-id",version:1,type:i.DefinitionEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[YN],static:!0,abstract:!1,abstractMethods:[],extends:[Cs],implements:[],methods:[XN],x:0,y:0,parent:QN},tL={type:i.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:i.Project,entityId:H},nL={type:i.DefinitionEntity,id:"6f0908c2-09c6-4a8b-8f43-d2467fe6fb39",version:1,name:"Get bank all bank accounts",description:null,properties:[],static:!0,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[ia],x:0,y:0,parent:tL},oo="f558fbf8-67de-4545-9804-6ae621e0b2d4",rL={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},iL={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},aL={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:J,asType:!1,parent:iL},sL={id:"getCompanyByIdEndpointReachedEntityEventRef",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},oL={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},lL={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},dL={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:lL},cL={constant:!0,id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request headers",defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:oL,autogeneration:null,valueAsType:null},dataType:dL,implements:nd,required:!0,index:0,parent:sL},uL={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},pL={constant:!0,id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:i.ArgumentDeclaration,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",writesValues:[],defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:rL,autogeneration:null,valueAsType:null},dataType:aL,implements:rd,required:!0,index:1,parent:uL},yL={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},hL={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},fL={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},mL={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,asType:!1,entity:J,parent:fL},TL={constant:!0,id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ArgumentDeclaration,writesValues:[],name:"Request query params",defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:hL,autogeneration:null,valueAsType:null},dataType:mL,implements:id,required:!0,index:2,parent:yL},EL={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},RL={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},gL={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:RL},bL={constant:!0,id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request body",defaultValue:null,dataType:gL,implements:ad,index:3,required:!0,parent:EL},vL={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},IL={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:vL},DL={id:"getCompanyByIdEndpointReturnStatementRef",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},AL={constant:!0,isError:!1,id:"getCompanyByIdEndpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ReturnDeclaration,name:"Response code",defaultValue:null,dataType:IL,implements:sd,readsValue:null,required:!0,index:0,parent:DL},SL={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},OL={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},PL={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,entity:it,asType:!1,parent:OL},CL={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},wL={constant:!0,isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ReturnDeclaration,name:"Response headers",defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.KeyValue,value:{},parent:SL,autogeneration:null,valueAsType:null},dataType:PL,implements:od,readsValue:null,required:!0,index:1,parent:CL},BL={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},ML={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,asType:!1,entity:it,parent:BL},_L={id:"getCompanyByIdEndpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},VL={constant:!0,isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ReturnDeclaration,name:"Response body",implements:ld,defaultValue:null,dataType:ML,readsValue:null,required:!0,index:2,parent:_L},NL={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:i.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:i.FunctionDeclaration},LL={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},GL={id:"getCompanyByIdEndpointReturnStatement",type:i.ReturnStatement,version:1,outputs:[AL,wL,VL],calledByError:[],calledByEntry:[NL],calledBySuccess:[],throws:null,x:0,y:0,parent:LL},$L={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:oo},FL={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:i.FunctionDeclaration,inputs:[cL,pL,TL,bL],returnStatements:[GL],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:dd,index:0,private:!1,x:0,y:0,parent:$L},UL={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointPathProperty"},xL={id:"getCompanyByIdEndpointPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointPathProperty"},jL={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:J,asType:!1,parent:xL},kL={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:i.GenericReference,entityType:i.DefinitionEntity,entityId:oo},qL={constant:!1,id:"getCompanyByIdEndpointPathProperty",hidden:!1,required:!0,name:"Path",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:ed,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,name:C.String,value:"/company/{id}",parent:UL,valueAsType:null,autogeneration:null},dataType:jL,index:1,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:kL},JL={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointMethodProperty"},WL={id:"getCompanyByIdEndpointMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointMethodProperty"},YL={like:!1,inferred:!1,id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Sn,isList:!0,asType:!1,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:WL},HL={id:"getCompanyByIdEndpointBaseEntityRefThree",type:i.GenericReference,entityType:i.DefinitionEntity,entityId:oo},zL={constant:!1,hidden:!1,required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:td,index:0,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:i.LiteralValue,version:1,value:"GET",name:C.Enum,parent:JL,valueAsType:null,autogeneration:null},dataType:YL,description:null,parent:HL},ZL={type:i.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:i.Project,entityId:H},KL={type:i.DefinitionEntity,id:oo,version:1,name:"Get given company data by id",description:null,properties:[qL,zL],methods:[FL],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[ia],x:0,y:0,parent:ZL},XL={id:"plant-prototype-database-property-ref-id",type:i.GenericReference,entityId:"plant-prototype-database-property-id",entityType:i.Property},QL={id:"plant-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"plant-prototype-database-property-id",entityType:i.Property},e0={like:!1,inferred:!1,id:"plant-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:XL},t0={id:"plant-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"plant-entity-id",entityType:i.DefinitionEntity},n0={constant:!1,hidden:!1,required:!0,id:"plant-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"plant-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:_d,autogeneration:null,parent:QL},dataType:e0,description:"The database that the entity belongs to.",parent:t0},r0={type:i.GenericReference,id:"plant-name-property-ref-id",entityType:i.Property,entityId:"plant-name-property-id"},i0={like:!1,inferred:!1,id:"plant-name-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:r0},a0={type:i.GenericReference,id:"animal-name-property-parent-ref-id",entityType:i.DefinitionEntity,entityId:"plant-entity-id"},s0={constant:!1,hidden:!1,required:!0,type:i.Property,id:"plant-name-property-id",version:1,name:"Name",description:"The name of the plant",defaultValue:null,implements:null,static:!1,private:!1,index:0,dataType:i0,abstract:!1,parent:a0},o0={type:i.GenericReference,id:"plant-prototype-parent-ref-id",entityType:i.Project,entityId:H},l0={type:i.DefinitionEntity,id:"plant-entity-id",version:1,name:"Plant",description:"A living creature that is not an animal",abstract:!1,static:!1,abstractMethods:[],properties:[n0,s0],methods:[],extends:[],implements:[st],x:0,y:0,parent:o0},d0={id:"product-prototype-database-property-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-id",entityType:i.Property},c0={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-id",entityType:i.Property},u0={like:!1,inferred:!1,id:"product-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:cn,asType:!1,parent:d0},p0={id:"product-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",entityType:i.DefinitionEntity},y0={constant:!1,hidden:!1,required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:ui,static:!0,index:0,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:i.LiteralValue,version:1,value:null,name:C.EntityTemplate,valueAsType:Vd,autogeneration:null,parent:c0},dataType:u0,description:"The database that the entity belongs to.",parent:p0},h0={type:i.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:i.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},f0={like:!1,inferred:!1,id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:h0},m0={type:i.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:i.DefinitionEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},T0={constant:!1,hidden:!1,required:!0,type:i.Property,id:"d519c26a-15b8-40d8-ad09-13fa9342e9ba",version:1,name:"Name",description:"The name of the product",index:0,implements:null,static:!1,private:!1,defaultValue:null,dataType:f0,abstract:!1,parent:m0},E0={type:i.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:i.Project,entityId:H},R0={id:"product-prototype-primary-key-property-data-type-ref-id",type:i.GenericReference,entityId:"product-prototype-primary-key-property-id",entityType:i.Property},g0={id:"product-prototype-primary-key-property-ref-id",type:i.GenericReference,entityId:"product-prototype-primary-key-property-id",entityType:i.Property},b0={like:!1,inferred:!1,id:"product-prototype-primary-key-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,entity:On,asType:!1,parent:g0},v0={id:"product-prototype-primary-key-property-parent-ref-id",type:i.GenericReference,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",entityType:i.DefinitionEntity},I0={constant:!1,hidden:!1,required:!0,id:"product-prototype-primary-key-property-id",name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,defaultValue:{id:"product-prototype-primary-key-property-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.UUID,value:null,parent:R0,autogeneration:{type:ze.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},dataType:b0,description:"A property with a unique value for the entity, that can be used to identify the entity among other entities of the same type.",parent:v0},D0={type:i.DefinitionEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[st,Ft],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[I0,y0,T0],methods:[],x:0,y:0,parent:E0},Di="project-loaded-event-id",Mn="get-bitcoin-price-http-call-operation-id",Ub="get-bitcoin-price-http-call-response-body-id",lo="validate-bitcoin-price-response-operation-ids",A0={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Ub},S0={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:i.Operation,entityId:lo},xb={id:"validate-bitcoin-data-to-validate-input-map-id",type:i.InputMap,version:1,declaration:hr.inputs[1],name:null,description:null,readsValue:A0,defaultValue:null,index:0,parent:S0},O0={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},P0={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:i.Operation,entityId:lo},C0={id:"validate-bitcoin-type-to-match-input-map-id",type:i.InputMap,version:1,declaration:hr.inputs[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:i.LiteralValue,version:1,name:C.EntityTemplate,valueAsType:Ab,value:null,parent:O0,autogeneration:null},index:0,parent:P0},w0={type:i.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:i.Operation,entityId:lo},B0={id:"validate-bitcoin-validated-entity-output-map-id",type:i.OutputMap,version:1,defaultValue:null,declaration:hr.outputs[0],writesValues:[],index:0,parent:w0},M0={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:i.GlobalEvent,entityId:Di},_0={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:i.Operation,entityId:Mn},V0={type:i.Operation,id:lo,version:1,declaration:hr,inputs:[C0,xb],outputs:[B0],process:null,successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[_0],parent:M0},N0={type:i.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:i.FunctionCall,entityId:Mn},L0={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:i.InputMap,declaration:ys,name:null,description:null,readsValue:null,defaultValue:null,index:0,parent:N0},G0={type:i.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:i.FunctionCall,entityId:Mn},$0={type:i.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:i.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},F0={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:i.InputMap,declaration:hs,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:i.LiteralValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:C.String,parent:$0,valueAsType:null,autogeneration:null},index:1,parent:G0},U0={type:i.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:i.FunctionCall,entityId:Mn},x0={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:i.InputMap,declaration:fs,name:null,description:null,readsValue:null,defaultValue:null,index:2,parent:U0},j0={type:i.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:i.FunctionCall,entityId:Mn},k0={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:i.InputMap,declaration:ms,name:null,description:null,readsValue:null,defaultValue:null,index:3,parent:j0},q0={type:i.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:i.FunctionCall,entityId:Mn},J0={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:i.OutputMap,defaultValue:null,declaration:Es,writesValues:[],index:1,parent:q0},W0={type:i.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:i.FunctionCall,entityId:Mn},Y0={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:i.OutputMap,defaultValue:null,declaration:Ts,writesValues:[],index:0,parent:W0},H0={type:i.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:i.FunctionCall,entityId:Mn},z0={id:Ub,type:i.OutputMap,defaultValue:null,version:1,declaration:Rs,writesValues:[xb],index:2,parent:H0},Z0={type:i.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:i.GlobalEvent,entityId:Di},K0={type:i.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:i.GlobalEvent,entityId:Di},X0={type:i.Operation,id:Mn,version:1,declaration:Xi,inputs:[L0,F0,x0,k0],outputs:[Y0,J0,z0],process:null,parent:K0,calledByError:[],calledByEntry:[Z0],calledBySuccess:[],successCalls:[V0],errorCalls:[],error:null,x:0,y:0},Q0={type:i.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:i.GlobalEvent,entityId:Di},e1={type:i.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:i.GlobalEvent,entityId:Di},t1={process:null,type:i.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:Ud,inputs:[],outputs:[],calledByError:[],calledByEntry:[Q0],calledBySuccess:[],parent:e1,successCalls:[],errorCalls:[],error:null,x:0,y:0},n1={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:i.GenericReference,entityType:i.Project,entityId:H},r1={type:i.GlobalEvent,id:Di,version:1,name:In.PROJECT_PUBLICATION_COMPLETED,description:null,returnStatements:[],collapsed:!1,implements:Bs,parent:n1,inputs:[],calls:[t1,X0],x:0,y:0},Ut="abort-execution-func-declaration-id",Sa="abort-execution-func-exec-var-declaration-id",xd="abort-execution-func-small-wait-op-id",jd="abort-execution-func-long-wait-op-id",jb="abort-execution-func-long-wait-process-output-id",kb="abort-execution-func-exec-var-instance-write-id",qb="abort-execution-func-long-wait-return-stmt-id",Jb="abort-execution-func-small-wait-return-stmt-id",i1="abort-execution-func-exec-var-instance-abort-call-id",kd="abort-execution-func-exec-var-instance-abort-internal-call-id",qd="abort-execution-func-exec-second-wait-op-id",a1={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},s1={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},o1={like:!1,inferred:!1,id:"short-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:a1},l1={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:Jb},d1={constant:!0,isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 1",description:"A random string that is returned by the function",defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:s1},dataType:o1,implements:null,readsValue:null,required:!0,index:0,parent:l1},c1={type:i.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:qd},u1={type:i.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},Wb={type:i.ReturnStatement,id:Jb,version:1,outputs:[d1],calledByError:[],calledByEntry:[],calledBySuccess:[c1],throws:null,x:0,y:0,parent:u1},p1={type:i.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"second-wait-argument-map-id"},y1={type:i.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:qd},h1={id:"second-wait-argument-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:i.LiteralValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:C.Number,parent:p1},index:0,parent:y1},f1={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},m1={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.InternalCall,entityId:kd},T1={id:qd,type:i.Operation,version:1,declaration:Rt,inputs:[h1],outputs:[],process:null,successCalls:[Wb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[m1],error:null,parent:f1},E1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:i.VariableInstance,entityId:kb},R1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:i.Operation,entityId:xd},g1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},b1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id-2",entityType:i.VariableDeclaration,entityId:Sa},v1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:i.InternalCall,entityId:kd},I1={id:i1,type:i.VariableInstance,version:1,declaration:b1,defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[v1],parent:g1},Yb={id:kd,type:i.InternalCall,version:1,inputs:[],outputs:[],declaration:hd,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[E1,R1],successCalls:[T1],errorCalls:[],error:null,index:0,parent:I1},D1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},A1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:Sa},S1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:i.FunctionDeclaration,entityId:Ut},O1={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Sa},P1={type:i.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:i.OutputMap,entityId:jb},Jd={id:kb,type:i.VariableInstance,version:1,declaration:O1,inputs:[],outputs:[],defaultValue:null,calledByError:[],calledByEntry:[S1],calledBySuccess:[A1],successCalls:[Yb],errorCalls:[],x:0,y:0,readsValue:P1,writesValues:[],internalCalls:[],parent:D1},C1={type:i.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sa};i.GenericReference,i.DataType;const w1={like:!1,inferred:!1,id:"abort-exec-func-var-decl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:ws,version:1,asType:!1,isList:!1,parent:C1},B1={type:i.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},M1={type:i.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Ut},_1={constant:!0,required:!0,id:Sa,type:i.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",defaultValue:null,dataType:w1,inputs:[],outputs:[],calledByError:[],calledByEntry:[M1],calledBySuccess:[],successCalls:[Jd],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:B1},V1={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},N1={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},L1={like:!1,inferred:!1,id:"long-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,asType:!1,isList:!1,parent:V1},G1={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:qb},$1={constant:!0,isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 2",description:"A random string that is returned by the function",implements:null,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:N1},dataType:L1,readsValue:null,required:!0,index:0,parent:G1},F1={type:i.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:jd},U1={type:i.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},Hb={type:i.ReturnStatement,id:qb,version:1,outputs:[$1],calledByError:[],calledByEntry:[],calledBySuccess:[F1],throws:null,x:0,y:0,parent:U1},x1={type:i.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"long-argument-map-id"},zb={type:i.GenericReference,id:"long-argument-map-parent-ref-id",entityType:i.Operation,entityId:jd},j1={id:"long-argument-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:i.LiteralValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:C.Number,parent:x1},index:0,parent:zb},k1={type:i.GenericReference,id:"long-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},q1={type:i.GenericReference,id:"long-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Ut},J1={id:jb,type:i.OutputMap,version:1,defaultValue:null,declaration:Ms,writesValues:[Jd],index:0,parent:zb},W1={id:jd,type:i.Operation,version:1,declaration:Rt,inputs:[j1],outputs:[],process:J1,successCalls:[Hb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[q1],calledBySuccess:[],error:null,parent:k1},Y1={type:i.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"small-wait-argument-map-id"},H1={type:i.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:xd},z1={id:"small-wait-argument-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:i.LiteralValue,version:1,value:500,valueAsType:null,autogeneration:null,name:C.Number,parent:Y1},index:0,parent:H1},Z1={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Ut},K1={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Ut},X1={id:xd,type:i.Operation,version:1,declaration:Rt,inputs:[z1],outputs:[],process:null,successCalls:[Yb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[K1],calledBySuccess:[],error:null,parent:Z1},Q1={type:i.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:i.Project,entityId:H},Zb={id:Ut,type:i.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[Hb,Wb],calls:[X1,_1,Jd,W1],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:Q1},eG={type:i.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:i.Project,entityId:H},tG={id:"call-execution-abort-func-id",type:i.FunctionCall,version:1,declaration:Zb,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:eG},co="manual-hello-world-loop-func-decl-id",Kb="manual-hello-world-loop-func-return-statement-id",hn="manual-hello-world-loop-id",Oa="manual-hello-world-loop-body-id",Wd="manual-hello-world-loop-break-statement-id",Pa="manual-hello-world-loop-current-iteration-number-output-map-id",Yd="manual-hello-world-loop-previous-iterations-results-output-map-id",Hd="assembled-hello-world-text-output-id",nG="assembled-hello-world-list-output-id",Ca="iteration-number-is-equal-or-greater-than-10-condition-id",uo="join-hello-world-and-number-operation-id",po="append-string-to-list-operation-id",Xb="hello-world-loop-output-map-id",rG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:i.ReturnStatement,entityId:Kb},iG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:i.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},aG={like:!1,inferred:!1,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!0,asType:!1,parent:iG},sG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:i.OutputMap,entityId:Xb},Qb={constant:!0,isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:i.ReturnDeclaration,name:"Results",description:null,defaultValue:null,dataType:aG,implements:null,readsValue:sG,required:!0,index:0,parent:rG},oG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:i.Loop,entityId:hn},lG={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:i.FunctionDeclaration,entityId:co},ev={type:i.ReturnStatement,id:Kb,version:1,outputs:[Qb],calledByError:[],calledByEntry:[],calledBySuccess:[oG],parent:lG,throws:null,x:0,y:0},dG={type:i.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:i.BreakStatement,entityId:Wd},tv={constant:!0,isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,defaultValue:null,dataType:null,readsValue:null,implements:null,required:!0,index:0,parent:dG},cG={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Pa},uG={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-ref-id",entityType:i.BreakStatement,entityId:Wd},nv={constant:!0,isError:!1,id:"hello-world-loop-break-statement-counter-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration counter",description:null,implements:null,defaultValue:null,dataType:null,readsValue:cG,required:!0,index:1,parent:uG},pG={type:i.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:i.Condition,entityId:Ca},yG={type:i.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:i.Loop,entityId:hn},rv={type:i.BreakStatement,id:Wd,version:1,outputs:[tv,nv],calledByError:[],calledByEntry:[],calledBySuccess:[pG],parent:yG,throws:null,x:0,y:0},hG={type:i.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:i.ContinueStatement,entityId:"hello-world-loop-continue-statement"},fG={type:i.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:i.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},mG={like:!1,inferred:!1,id:"hello-world-loop-continue-statement-output-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:fG},TG={type:i.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:i.OutputMap,entityId:Hd},iv={constant:!0,isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,defaultValue:null,implements:null,dataType:mG,readsValue:TG,required:!0,index:0,parent:hG},EG={type:i.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:i.Condition,entityId:Ca},RG={type:i.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:i.Loop,entityId:hn},av={type:i.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[iv],calledBySuccess:[],calledByError:[EG],calledByEntry:[],parent:RG,throws:null,x:0,y:0};i.GenericReference,i.InputMap;const gG={type:i.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:i.Operation,entityId:po},bG={type:i.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Yd},sv={id:"append-string-to-list-base-string-map-id",type:i.InputMap,version:1,declaration:Gl,name:null,description:null,readsValue:bG,defaultValue:null,index:0,parent:gG},vG={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:po},IG={id:nG,type:i.OutputMap,version:1,defaultValue:null,writesValues:[tv],declaration:Zi,index:0,parent:vG},DG={type:i.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:i.Condition,entityId:Ca},AG={type:i.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Hd},SG={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:po},ov={id:"latest-string-to-add-input-map-id",version:1,type:i.InputMap,declaration:$l,name:null,description:null,readsValue:AG,defaultValue:null,index:1,parent:SG},OG={type:i.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:i.FunctionDeclaration,entityId:hn},PG={type:i.Operation,id:po,declaration:ps,version:1,inputs:[sv,ov],outputs:[IG],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[DG],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:OG},CG={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:Oa},wG={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:i.Loop,entityId:hn},BG={type:i.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Pa},lv={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:i.Condition,entityId:Ca},MG={id:"current-iteration-number-to-check-map-id",version:1,type:i.InputMap,declaration:hi.inputs[0],name:null,description:null,readsValue:BG,index:0,defaultValue:null,parent:lv},_G={type:i.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"max-num-iterations-value-map-id"},VG={id:"max-num-iterations-value-map-id",version:1,type:i.InputMap,declaration:hi.inputs[1],name:null,description:null,readsValue:null,index:1,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:i.LiteralValue,version:1,name:C.Number,value:10,autogeneration:null,valueAsType:null,parent:_G},parent:lv},NG={type:i.Condition,id:Ca,version:1,declaration:hi,inputs:[MG,VG],calledByError:[],calledByEntry:[CG],calledBySuccess:[],successCalls:[rv,PG],errorCalls:[av],x:0,y:0,parent:wG},LG={type:i.GenericReference,id:"base-string-map-ref-id",entityType:i.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},GG={type:i.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:i.Operation,entityId:uo},$G={id:"join-hello-world-and-number-base-string-map-id",type:i.InputMap,version:1,declaration:cs,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:i.LiteralValue,version:1,value:"Hello world ",name:C.String,parent:LG,valueAsType:null,autogeneration:null},index:0,parent:GG},FG={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:uo},UG={id:Hd,type:i.OutputMap,version:1,defaultValue:null,writesValues:[ov,iv],declaration:Zi,index:0,parent:FG},xG={type:i.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:Oa},jG={type:i.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Pa},kG={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:uo},dv={id:"current-iteration-number-input-map-id",version:1,type:i.InputMap,declaration:us,name:null,description:null,readsValue:jG,defaultValue:null,index:1,parent:kG},qG={type:i.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:i.FunctionDeclaration,entityId:hn},JG={type:i.Operation,id:uo,declaration:Ki,version:1,inputs:[$G,dv],outputs:[UG],process:null,calledByError:[],calledByEntry:[xG],calledBySuccess:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:qG},WG={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:Yd,entityType:i.ArgumentDeclaration},YG={like:!1,inferred:!1,id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,entity:null,asType:!1,parent:WG},HG={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:i.GenericReference,entityId:Oa,entityType:i.FunctionDeclaration},zG={constant:!0,id:Yd,type:i.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,defaultValue:null,dataType:YG,implements:null,writesValues:[sv],index:1,parent:HG},ZG={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:i.GenericReference,entityId:Oa,entityType:i.FunctionDeclaration},KG={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:Pa,entityType:i.ArgumentDeclaration};i.DataType;const XG={constant:!0,id:Pa,type:i.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,implements:Jl,defaultValue:null,dataType:null,writesValues:[dv,nv],index:0,parent:ZG},QG={id:"manual-flow-loop-body-parent-ref-id",type:i.GenericReference,entityId:hn,entityType:i.Loop},e$={id:Oa,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[XG,zG],calls:[NG,JG],implements:bs,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:QG},t$={type:i.GenericReference,id:"hello-world-loop-iteration-result-inline-output-declaration-parent-ref-id",entityType:i.Loop,entityId:hn},cv={id:"hello-world-loop-iteration-result-inline-output-declaration-id",version:1,type:i.ValueDescriptor,name:"Iteration result",defaultValue:null,description:null,dataType:null,required:!0,parentRelationType:P.FixedReturns,index:0,parent:t$},n$={type:i.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:i.Loop,entityId:hn},r$={type:i.OutputMap,id:Xb,version:1,defaultValue:null,declaration:cv,writesValues:[Qb],index:0,parent:n$},i$={id:"manual-hello-world-loop-parent-ref-id",type:i.GenericReference,entityId:co,entityType:i.FunctionDeclaration},a$={id:"manual-hello-world-loop-called-by-ref-id",type:i.GenericReference,entityId:co,entityType:i.FunctionDeclaration},s$={id:hn,type:i.Loop,version:1,declaration:gs,inputs:[],outputsDeclarations:[cv],outputs:[r$],body:e$,successCalls:[ev],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[a$],calledBySuccess:[],breakStatements:[rv],continueStatements:[av],x:0,y:0,parent:i$},o$={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},uv={type:i.FunctionDeclaration,id:co,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[s$],returnStatements:[ev],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:o$},l$={type:i.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:i.Project,entityId:H},d$={id:"call-hello-world-loop-id",type:i.FunctionCall,version:1,declaration:uv,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:l$},_n="company-dto-function-declaration-id",zd="company-dto-func-declaration-argument-dcl-id",fn="company-dto-function-company-variable-id",tr="company-dto-function-company-dto-variable-id",Ai="iterate-over-employee-list-loop-id",pv="iterate-over-employee-list-loop-employee-dto-output-map-id",Zd="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",yo="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",yv="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",hv="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",fv="iterate-over-employee-list-continue-statement-id",ho="iterate-over-employee-list-loop-body-id",mv="company-dto-func-declaration-return-statement-id",Tv="company-dto-func-declaration-return-decl-id",Ev="company-dto-func-declaration-company-variable-id-output-map-id",Rv="company-dto-func-declaration-company-variable-employess-output-map-id",gv="company-dto-func-declaration-company-variable-name-output-map-id",c$="company-dto-func-declaration-company-dto-variable-input-map-id",u$="company-dto-func-declaration-company-dto-variable-employess-input-map-id",p$="company-dto-func-declaration-company-dto-variable-name-input-map-id",fo="company-dto-func-declaration-owner-variable-id",y$="company-dto-func-declaration-company-dto-variable-owner-input-map-id",bv="company-dto-func-declaration-company-variable-owner-output-map-id",vv="company-dto-func-declaration-owner-variable-id-output-map-id",mo="company-dto-func-declaration-bank-account-variable-id",h$="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",Iv="company-dto-func-declaration-company-variable-bank-account-output-map-id",Dv="company-dto-func-declaration-bank-account-variable-id-output-map-id",f$={type:i.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:Tv},m$={like:!1,inferred:!1,id:"company-dto-func-returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!1,parent:f$},T$={type:i.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:mv},E$={type:i.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:tr},Av={constant:!0,isError:!1,id:Tv,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",defaultValue:null,implements:null,dataType:m$,readsValue:E$,required:!0,index:0,parent:T$},R$={type:i.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:tr},g$={type:i.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n},Kd={type:i.ReturnStatement,id:mv,version:1,outputs:[Av],calledByError:[],calledByEntry:[],calledBySuccess:[R$],throws:null,x:0,y:0,parent:g$},b$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:vv},v$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Sv={id:y$,type:i.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,index:5,readsValue:b$,parent:v$},I$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Dv},D$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Ov={id:h$,type:i.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,index:4,readsValue:I$,parent:D$},A$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:gv},S$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Pv={id:p$,type:i.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,index:3,readsValue:A$,parent:S$},O$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:pv},P$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},Cv={id:u$,type:i.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,index:2,readsValue:O$,parent:P$},C$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Ev},w$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},wv={id:c$,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,index:1,readsValue:C$,parent:w$},B$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n},M$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:mo},_$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:fo},V$={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:i.VariableDeclaration,entityId:Ai},Xd={constant:!0,required:!0,id:tr,type:i.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[M$,_$,V$],successCalls:[Kd],errorCalls:[],readsValue:null,writesValues:[Av],inputs:[wv,Pv,Ov,Sv,Cv],outputs:[],internalCalls:[],parent:B$,x:0,y:0},Dr="employee-dto-func-declaration-id",Qd="employee-dto-func-declaration-argument-dcl-id",Bv="employee-dto-func-declaration-return-statement-id",Mv="employee-dto-func-declaration-return-decl-id",Ar="employee-dto-func-declaration-employee-variable-id",Sr="employee-dto-func-declaration-employee-dto-variable-id",To="employee-dto-func-declaration-manager-variable-id",_v="employee-dto-func-declaration-employee-variable-id-output-map-id",Vv="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",Nv="employee-dto-func-declaration-employee-variable-department-output-map-id",Lv="employee-dto-func-declaration-employee-variable-manager-output-map-id",Gv="employee-dto-func-declaration-manager-variable-id-output-map-id",N$="employee-dto-func-declaration-employee-dto-variable-input-map-id",L$="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",G$="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",$$="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",F$={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:Mv},U$={like:!1,inferred:!1,id:"employee-dto-func-returned-employee-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!1,parent:F$},x$={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:Bv},j$={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:Sr},$v={constant:!0,isError:!1,id:Mv,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",defaultValue:null,dataType:U$,implements:null,readsValue:j$,required:!0,index:0,parent:x$},k$={type:i.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:Sr},q$={type:i.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr},ec={type:i.ReturnStatement,id:Bv,version:1,outputs:[$v],calledByError:[],calledByEntry:[],calledBySuccess:[k$],throws:null,x:0,y:0,parent:q$},J$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Gv},W$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},Fv={id:$$,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:J$,parent:W$},Y$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Nv},H$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},Uv={id:G$,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:Y$,parent:H$},z$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Vv},Z$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},xv={id:L$,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:z$,parent:Z$},K$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:_v},X$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Sr},jv={id:N$,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:K$,parent:X$},Q$={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr},eF={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:To},tF={constant:!0,required:!0,id:Sr,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[eF],successCalls:[ec],errorCalls:[],readsValue:null,writesValues:[$v],inputs:[jv,xv,Uv,Fv],outputs:[],internalCalls:[],parent:Q$,x:0,y:0},nF={type:i.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:To},rF={id:Gv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[Fv],parent:nF},iF={type:i.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:To},aF={like:!1,inferred:!1,id:"employee-dto-func-manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:iF},sF={type:i.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:Lv},oF={type:i.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr};i.GenericReference,i.VariableDeclaration;const kv={constant:!0,required:!0,id:To,type:i.VariableDeclaration,version:1,name:"Manager",description:"A variable holding an inherited manager",defaultValue:null,dataType:aF,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[tF],errorCalls:[],readsValue:sF,writesValues:[],inputs:[],outputs:[rF],internalCalls:[],parent:oF,x:0,y:0},lF={type:i.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},dF={id:Lv,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[2],index:3,writesValues:[kv],parent:lF},cF={type:i.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},uF={id:Nv,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[0],index:2,writesValues:[Uv],parent:cF},pF={type:i.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},yF={id:Vv,type:i.OutputMap,version:1,defaultValue:null,declaration:bt.properties[1],index:1,writesValues:[xv],parent:pF},hF={type:i.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},fF={id:_v,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[jv],parent:hF},mF={type:i.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ar},TF={like:!1,inferred:!1,id:"employee-dto-func-employee-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:mF},EF={type:i.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Dr},RF={type:i.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Qd},gF={type:i.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:Dr},qv={constant:!0,required:!0,id:Ar,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:TF,description:"A variable holding a company employee",calledByError:[],defaultValue:null,calledByEntry:[gF],calledBySuccess:[],successCalls:[kv],errorCalls:[],readsValue:RF,writesValues:[],inputs:[],outputs:[fF,yF,uF,dF],internalCalls:[],parent:EF,x:0,y:0},bF={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:Qd,entityType:i.ArgumentDeclaration},vF={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:Yt,asType:!1,isList:!1,like:!1,inferred:!1,parent:bF},IF={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:Dr,entityType:i.FunctionDeclaration},DF={constant:!0,type:i.ArgumentDeclaration,id:Qd,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,implements:null,defaultValue:null,dataType:vF,index:0,writesValues:[qv],parent:IF},AF={type:i.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},tc={type:i.FunctionDeclaration,id:Dr,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[DF],calls:[qv],implements:null,returnStatements:[ec],collapsed:!1,private:!1,x:0,y:0,parent:AF},SF={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:yv,entityType:i.ReturnDeclaration},OF={like:!1,inferred:!1,id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:SF},PF={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:i.GenericReference,entityId:hv,entityType:i.OutputMap},CF={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:i.GenericReference,entityId:fv,entityType:i.ContinueStatement},Jv={constant:!0,isError:!1,id:yv,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",defaultValue:null,readsValue:PF,dataType:OF,implements:null,required:!0,index:0,parent:CF},wF={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:i.GenericReference,entityId:yo,entityType:i.FunctionCall},BF={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},Wv={id:fv,type:i.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[wF],outputs:[Jv],throws:null,x:0,y:0,parent:BF},MF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:yo,entityType:i.FunctionCall},_F={id:hv,type:i.OutputMap,version:1,defaultValue:null,declaration:ec.outputs[0],writesValues:[Jv],index:0,parent:MF},VF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:i.GenericReference,entityId:Zd,entityType:i.ArgumentDeclaration},NF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:i.GenericReference,entityId:yo,entityType:i.FunctionCall},Yv={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:tc.inputs[0],readsValue:VF,index:0,defaultValue:null,parent:NF},LF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:i.GenericReference,entityId:ho,entityType:i.FunctionDeclaration},GF={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:i.GenericReference,entityId:ho,entityType:i.FunctionDeclaration},$F={id:yo,type:i.FunctionCall,version:1,declaration:tc,inputs:[Yv],process:null,outputs:[_F],calledByError:[],calledByEntry:[LF],calledBySuccess:[],successCalls:[Wv],errorCalls:[],error:null,x:0,y:0,parent:GF},FF={type:i.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:Zd,entityType:i.ArgumentDeclaration},UF={like:!1,inferred:!1,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,isList:!1,asType:!1,parent:FF},xF={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:ho,entityType:i.FunctionDeclaration},jF={constant:!0,id:Zd,type:i.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",defaultValue:null,dataType:UF,required:!0,implements:Is,index:0,writesValues:[Yv],parent:xF},kF={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},qF={id:ho,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[jF],calls:[$F],implements:ta,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:kF},JF={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},WF={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:i.GenericReference,entityId:Rv,entityType:i.OutputMap},Hv={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Jn.inputs[0],defaultValue:null,readsValue:WF,index:0,parent:JF},YF={id:"iterate-over-employee-list-loop-parent-ref-id",type:i.GenericReference,entityId:_n,entityType:i.FunctionDeclaration},HF={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:Ai,entityType:i.Loop},zF={id:pv,type:i.OutputMap,version:1,defaultValue:null,declaration:Jn.outputs[0],writesValues:[Cv],index:0,parent:HF},ZF={type:i.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:i.VariableDeclaration,entityId:fn},KF={id:Ai,type:i.Loop,version:1,declaration:Jn,inputs:[Hv],successCalls:[Xd],errorCalls:[],outputsDeclarations:[],outputs:[zF],body:qF,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[ZF],breakStatements:[],continueStatements:[Wv],error:null,x:0,y:0,parent:YF},XF={type:i.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mo},QF={id:Dv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[Ov],parent:XF},eU={type:i.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:mo},tU={like:!1,inferred:!1,id:"company-dto-func-bank-account-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:eU},nU={type:i.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:Iv},rU={type:i.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n};i.GenericReference,i.VariableDeclaration;const zv={constant:!0,required:!0,id:mo,type:i.VariableDeclaration,version:1,name:"Bank account",description:"A variable holding an inherited bank account",defaultValue:null,dataType:tU,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Xd],errorCalls:[],readsValue:nU,writesValues:[],inputs:[],outputs:[QF],internalCalls:[],parent:rU,x:0,y:0},iU={type:i.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fo},aU={id:vv,type:i.OutputMap,version:1,declaration:Ft.properties[0],index:0,defaultValue:null,writesValues:[Sv],parent:iU},sU={type:i.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:fo},oU={like:!1,inferred:!1,id:"company-dto-func-owner-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:sU},lU={type:i.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:bv},dU={type:i.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n};i.GenericReference,i.VariableDeclaration;const Zv={constant:!0,required:!0,id:fo,type:i.VariableDeclaration,version:1,name:"Owner",dataType:oU,description:"A variable holding an inherited owner",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Xd],errorCalls:[],readsValue:lU,writesValues:[],inputs:[],outputs:[aU],internalCalls:[],parent:dU,x:0,y:0},cU={type:i.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},uU={id:bv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[2],index:4,writesValues:[Zv],parent:cU},pU={type:i.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},yU={id:Iv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[2],index:3,writesValues:[zv],parent:pU},hU={type:i.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},fU={id:gv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[0],index:2,writesValues:[Pv],parent:hU},mU={type:i.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},TU={id:Rv,type:i.OutputMap,version:1,defaultValue:null,declaration:Ht.properties[3],index:1,writesValues:[Hv],parent:mU},EU={type:i.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},RU={id:Ev,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[wv],parent:EU},gU={type:i.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:fn},bU={like:!1,inferred:!1,id:"company-dto-func-company-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:gU},vU={type:i.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:_n},IU={type:i.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:zd},DU={type:i.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:_n},Kv={constant:!0,required:!0,id:fn,type:i.VariableDeclaration,version:1,name:"Company",dataType:bU,description:"A variable holding a company",defaultValue:null,calledByError:[],calledByEntry:[DU],calledBySuccess:[],successCalls:[zv,Zv,KF],errorCalls:[],readsValue:IU,writesValues:[],inputs:[],outputs:[RU,TU,fU,yU,uU],internalCalls:[],parent:vU,x:0,y:0},AU={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:zd,entityType:i.ArgumentDeclaration},SU={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:Ht,asType:!1,isList:!1,like:!1,inferred:!1,parent:AU},OU={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:_n,entityType:i.FunctionDeclaration},PU={constant:!0,type:i.ArgumentDeclaration,id:zd,version:1,name:"Company",description:"The company to create a DTO for",defaultValue:null,required:!0,implements:null,dataType:SU,index:0,writesValues:[Kv],parent:OU},CU={type:i.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},nc={type:i.FunctionDeclaration,id:_n,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[PU],calls:[Kv],implements:null,index:null,returnStatements:[Kd],collapsed:!1,private:!1,x:0,y:0,parent:CU},wa="exec-in-parallel-operation-call-id",Ba="exec-sequentially-operation-call-id",vt="concurrency-and-wait-function-declaration-id",Xv="concurrency-and-wait-return-statement-id",Qv="concurrency-and-wait-return-declaration-id",rc="exec-in-parallel-argument-map-id",eI="exec-sequentially-argument-map-id",ic="wait-for-2-seconds-operation-id",tI="wait-for-2-seconds-argument-map-id",ac="map-company-dto-function-call-id",nI="map-company-dto-function-call-company-dto-output-map-id",Eo="company-dto-variable-one-id",sc="company-dto-variable-one-instance-id",rI="company-dto-variable-two-id",wU={type:i.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:Qv},BU={like:!1,inferred:!1,id:"returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,asType:!1,isList:!1,parent:wU},MU={type:i.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:Xv},_U={type:i.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:rI},iI={constant:!0,isError:!1,id:Qv,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",defaultValue:null,dataType:BU,implements:null,readsValue:_U,required:!0,index:0,parent:MU},VU={type:i.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:ic},NU={type:i.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},aI={type:i.ReturnStatement,id:Xv,version:1,outputs:[iI],calledByError:[],calledByEntry:[],calledBySuccess:[VU],throws:null,x:0,y:0,parent:NU},LU={type:i.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:i.VariableInstance,entityId:sc},GU={type:i.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:i.VariableInstance,entityId:sc},$U={type:i.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},sI={constant:!0,required:!0,id:rI,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,defaultValue:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[LU],internalCalls:[],writesValues:[iI],readsValue:GU,x:0,y:0,parent:$U},FU={type:i.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Eo},UU={type:i.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:Eo},xU={type:i.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},jU={type:i.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Eo},oI={id:sc,type:i.VariableInstance,version:1,declaration:jU,inputs:[],outputs:[],successCalls:[sI],errorCalls:[],defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[FU],internalCalls:[],writesValues:[sI],readsValue:UU,x:0,y:0,parent:xU},kU={type:i.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:i.FunctionCall,entityId:ac},qU={type:i.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:i.OutputMap,entityId:nI},JU={type:i.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},lI={constant:!0,required:!0,id:Eo,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,defaultValue:null,dataType:null,inputs:[],outputs:[],successCalls:[oI],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[kU],internalCalls:[],writesValues:[oI],readsValue:qU,x:0,y:0,parent:JU},dI={type:i.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:i.FunctionCall,entityId:ac},WU={id:"map-company-dto-function-call-company-input-map-id",type:i.InputMap,version:1,declaration:nc.inputs[0],name:null,description:null,defaultValue:null,index:0,readsValue:null,parent:dI},YU={id:nI,type:i.OutputMap,version:1,defaultValue:null,declaration:Kd.outputs[0],writesValues:[lI],index:0,parent:dI},HU={id:"map-company-dto-function-call-called-by-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:vt},zU={id:"map-company-dto-function-call-parent-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:vt},ZU={id:ac,type:i.FunctionCall,version:1,declaration:nc,successCalls:[lI],process:null,errorCalls:[],inputs:[WU],outputs:[YU],calledByError:[],calledByEntry:[HU],calledBySuccess:[],parent:zU,x:0,y:0,error:null},KU={type:i.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:Md},XU={type:i.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:i.VariableDeclaration,entityId:Md},QU={like:!1,inferred:!1,id:"last-timestamp-variable-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:on,version:1,asType:!1,isList:!1,parent:KU},e4={type:i.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:i.Project,entityId:H},oc={constant:!0,required:!0,id:Md,type:i.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",defaultValue:{id:"last-timestamp-variable-default-value-id",type:i.LiteralValue,version:1,name:C.Date,value:null,autogeneration:{type:ze.CurrentDateAndTime,rangeStart:null,rangeEnd:null},valueAsType:null,parent:XU},dataType:QU,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:e4},t4={type:i.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:tI},n4={type:i.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:i.Operation,entityId:ic},r4={id:tI,type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:i.LiteralValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:C.Number,parent:t4},index:0,parent:n4},i4={type:i.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},a4={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:i.Operation,entityId:Ba},s4={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:i.Operation,entityId:wa},cI={id:ic,type:i.Operation,version:1,declaration:Qt,inputs:[r4],outputs:[],process:null,successCalls:[aI],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[a4,s4],error:null,parent:i4},o4={type:i.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"wait-for-random-amount-input-map-id"},l4={type:i.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:i.Operation,entityId:"wait-for-random-amount-id"},d4={id:"wait-for-random-amount-input-map-id",type:i.InputMap,version:1,declaration:pr,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:i.LiteralValue,version:1,value:null,valueAsType:null,autogeneration:{type:ze.Random,rangeStart:1e3,rangeEnd:4e3},name:C.Number,parent:o4},index:0,parent:l4},c4={type:i.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:i.Project,entityId:H},Si={id:"wait-for-random-amount-id",type:i.Operation,version:1,declaration:Qt,inputs:[d4],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:c4},lc="list-of-functions-variable-id",u4={type:i.GenericReference,id:"list-of-functions-variable-action-descriptor-dynamic-argument-parent-ref-id",entityType:i.ActionDescriptor,entityId:"list-of-functions-variable-action-descriptor-id"},p4={id:"list-of-functions-variable-action-descriptor-dynamic-argument-id",type:i.ValueDescriptor,version:1,name:"Any input value",description:"Any input value that can be passed to the action",defaultValue:null,index:0,required:!1,dataType:null,parent:u4},y4={type:i.GenericReference,id:"list-of-functions-variable-action-descriptor-dynamic-return-parent-ref-id",entityType:i.ActionDescriptor,entityId:"list-of-functions-variable-action-descriptor-id"},h4={id:"list-of-functions-variable-action-descriptor-dynamic-return-id",type:i.ValueDescriptor,version:1,name:"Any output value",description:"Any output value that can be returned to the action",defaultValue:null,index:0,required:!1,dataType:null,parent:y4},f4={type:i.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:lc},m4={id:"list-of-functions-variable-action-descriptor-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",inputs:[p4],error:null,outputs:[h4],parent:null},T4={type:i.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:i.VariableDeclaration,entityId:lc},E4={like:!1,inferred:!1,id:"list-of-functions-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:m4,asType:!1,isList:!0,parent:f4},R4={type:i.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt};i.GenericReference,i.InputMap;const g4={type:i.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:i.InputMap,entityId:eI},b4={type:i.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:i.InputMap,entityId:rc},uI={constant:!0,required:!0,id:lc,type:i.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:i.LiteralValue,version:1,name:C.ActionDescriptor,value:null,valueAsType:[Si,Si,Si,Si,Si],autogeneration:null,parent:T4},dataType:E4,parent:R4,readsValue:null,writesValues:[g4,b4],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},v4={type:i.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:i.Operation,entityId:wa},I4={type:i.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},D4={type:i.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-in-parallel-return-map-id"},A4={type:i.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:i.Operation,entityId:wa},pI={id:"exec-in-parallel-result-variable-id",type:i.VariableInstance,version:1,declaration:oc,readsValue:D4,writesValues:[],defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[A4],successCalls:[],errorCalls:[],internalCalls:[],parent:I4,x:0,y:0},S4={id:"exec-in-parallel-return-map-id",type:i.OutputMap,version:1,defaultValue:null,declaration:Ul,writesValues:[pI],index:0,parent:v4},O4={type:i.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:i.Operation,entityId:wa},P4={id:rc,type:i.InputMap,version:1,declaration:Fl,name:null,description:null,readsValue:uI,defaultValue:null,index:0,parent:O4},C4={type:i.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},w4={type:i.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:vt},B4={process:null,id:wa,type:i.Operation,version:1,declaration:Qt,inputs:[P4],outputs:[S4],successCalls:[cI,pI],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[w4],calledBySuccess:[],error:null,parent:C4},M4={type:i.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:i.Operation,entityId:Ba},_4={type:i.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},V4={type:i.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-sequentially-return-map-id"},N4={type:i.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:i.Operation,entityId:Ba},yI={id:"exec-sequentially-result-variable-id",type:i.VariableInstance,version:1,declaration:oc,readsValue:V4,defaultValue:null,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[N4],successCalls:[],errorCalls:[],internalCalls:[],parent:_4,x:0,y:0},L4={id:"exec-sequentially-return-map-id",type:i.OutputMap,version:1,defaultValue:null,declaration:jl,writesValues:[yI],index:0,parent:M4},G4={type:i.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:i.Operation,entityId:Ba},$4={id:eI,type:i.InputMap,version:1,declaration:xl,name:null,description:null,readsValue:uI,defaultValue:null,index:0,parent:G4},F4={type:i.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:i.FunctionDeclaration,entityId:vt},U4={type:i.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:vt},x4={id:Ba,type:i.Operation,version:1,declaration:Cn,inputs:[$4],process:null,outputs:[L4],successCalls:[cI,yI],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[U4],calledBySuccess:[],error:null,parent:F4},j4={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},k4={type:i.FunctionDeclaration,id:vt,version:1,name:"Execute with concurrency and wait",description:"Executes a hardcoded list of actions in parallel and waits for some time before ending the logic with some unrelated data payload as the result.",inputs:[],calls:[x4,B4,ZU],returnStatements:[aI],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:j4},q4={type:i.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:i.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},J4={like:!1,inferred:!1,id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ht,isList:!1,asType:!1,parent:q4},W4={type:i.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:i.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},Y4={constant:!0,isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",defaultValue:null,implements:null,dataType:J4,readsValue:null,required:!0,index:0,parent:W4},H4={type:i.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:i.FunctionDeclaration,entityId:"5059c093-eda2-4efc-b7b4-aaaadd4d44de"},z4={type:i.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:i.FunctionDeclaration,entityId:"5059c093-eda2-4efc-b7b4-aaaadd4d44de"},hI={type:i.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[Y4],calledByError:[],calledByEntry:[z4],calledBySuccess:[],throws:null,x:0,y:0,parent:H4},Z4={type:i.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:i.Project,entityId:H},K4={type:i.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[hI],index:null,implements:null,returnStatements:[hI],collapsed:!1,private:!1,x:0,y:0,parent:Z4},dc="get-current-date-and-time-func-decl-id",fI="get-current-date-and-time-return-statement-id",cc="get-current-date-and-time-return-declaration-id",X4="get-current-date-and-time-return-declaration-data-type-id",Q4={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:i.ReturnDeclaration,entityId:cc},ex={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:cc},tx={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:X4,version:1,entity:on,asType:!1,isList:!1,like:!1,inferred:!1,parent:ex},nx={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:i.ReturnStatement,entityId:fI};i.ReturnDeclaration,i.LiteralValue,C.Date,ze.CurrentDateAndTime;const rx={type:i.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:dc},ix={type:i.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dc};i.ReturnStatement;const ax={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},sx={type:i.FunctionDeclaration,id:dc,version:1,name:"Get current date and time",description:"Generates and returns the current date and time at the time of the execution",inputs:[],calls:[],returnStatements:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:ax},mI="do-math-return-statement-id",uc="do-math-return-declaration-id",ox={type:i.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:i.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},lx={like:!1,inferred:!1,id:"do-math-func-var-to-return-one-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:ox},dx={type:i.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},cx={type:i.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:i.ReturnDeclaration,entityId:uc},ux={constant:!0,required:!0,type:i.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",defaultValue:null,dataType:lx,readsValue:null,writesValues:[cx],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:dx},px={type:i.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:i.ReturnStatement,entityId:mI},yx={type:i.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:i.ReturnDeclaration,entityId:uc},hx={like:!1,inferred:!1,id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:yx},fx={constant:!0,isError:!1,id:uc,version:1,type:i.ReturnDeclaration,name:"Result",description:null,implements:null,defaultValue:null,dataType:hx,readsValue:ux,required:!0,index:0,parent:px},mx={type:i.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},Tx={type:i.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},TI={type:i.ReturnStatement,id:mI,version:1,outputs:[fx],calledByError:[],calledByEntry:[],calledBySuccess:[mx],parent:Tx,throws:null,x:0,y:0},Ex={type:i.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:i.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},Rx={like:!1,inferred:!1,id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,asType:!1,isList:!1,parent:Ex},gx={type:i.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},bx={type:i.GenericReference,id:"do-math-func-return-one-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},vx={type:i.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},EI={constant:!0,required:!0,type:i.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:Rx,description:null,defaultValue:null,readsValue:vx,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[bx],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:gx},Ix={type:i.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},Dx={type:i.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},Ax={type:i.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:i.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},Sx={like:!1,inferred:!1,id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Ax},Ox={type:i.GenericReference,id:"do-math-func-return-two-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},RI={constant:!0,required:!0,type:i.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[Ox],successCalls:[],errorCalls:[],dataType:Sx,readsValue:Dx,writesValues:[],internalCalls:[],parent:Ix,x:0,y:0},gI={type:i.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},Px={type:i.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},Cx={type:i.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},wx={type:i.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:i.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},bI={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:i.InputMap,declaration:Sl,name:null,description:null,readsValue:wx,defaultValue:null,index:0,parent:Cx},Bx={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:i.OutputMap,version:1,defaultValue:null,declaration:Cl,writesValues:[EI,RI],index:0,parent:Px},Mx={type:i.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},_x={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:i.GenericReference,entityType:i.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},vI={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:i.InputMap,declaration:Ol,name:null,description:null,readsValue:_x,defaultValue:null,index:1,parent:Mx},Vx={type:i.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:ds,version:1,inputs:[bI,vI],outputs:[Bx],calledByError:[],calledByEntry:[gI],calledBySuccess:[],process:null,successCalls:[TI,EI,RI],errorCalls:[],parent:gI,error:null,x:0,y:0},Nx={type:i.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:i.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},Lx={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:i.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:i.ArgumentDeclaration},II={like:!1,inferred:!1,id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Lx},Gx={type:i.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:i.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},$x={type:i.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},Fx={type:i.GenericReference,id:"do-math-func-var-called-by-ref",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},DI={constant:!0,required:!0,id:"72a338d8-0183-4ca2-8760-227517854595",type:i.VariableDeclaration,version:1,name:"Z",description:null,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:i.LiteralValue,version:1,value:1,name:C.Number,valueAsType:null,autogeneration:null,parent:Nx},dataType:II,inputs:[],outputs:[],calledByError:[],calledByEntry:[Fx],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:Gx,writesValues:[vI],internalCalls:[],x:0,y:0,parent:$x},Ux={entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:i.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},xx={constant:!0,id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:i.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",defaultValue:null,dataType:II,implements:null,writesValues:[DI],required:!0,index:1,parent:Ux},jx={type:i.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:i.Project,entityId:H},kx={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},qx={type:i.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:i.VariableDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},Jx={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:i.ArgumentDeclaration},Wx={like:!1,inferred:!1,id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:Jx},Yx={constant:!0,id:"d8895765-f705-457e-85fa-25d130926769",type:i.ArgumentDeclaration,version:1,name:"N",dataType:Wx,description:"The number to add",implements:null,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:i.LiteralValue,version:1,value:5,name:C.Number,valueAsType:null,autogeneration:null,parent:qx},writesValues:[bI],required:!0,index:0,parent:kx},Hx={type:i.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[Yx,xx],calls:[Vx,DI],implements:null,index:null,collapsed:!1,returnStatements:[TI],private:!1,x:0,y:0,parent:jx},It="replace-bank-account-in-company-func-declaration-id",pc="company-entity-to-modify-arg-declaration-id",yc="account-number-to-create-arg-decl-id",Oi="company-main-variable-id",Pi="search-person-by-id-id",AI="new-bank-account-owner-arg-decl-id",SI="search-person-by-id-output-declaration-id",hc="search-person-by-id-output-entity-map-id",Ma="person-not-empty-condition-id",Ro="create-new-bank-account-instance-operation-id",OI="create-new-bank-account-instance-operation-output-entity-map-id",PI="company-bank-account-output-map-id",fc="old-bank-account-var-declaration-id",CI="old-bank-account-var-instance-id",wI="company-variable-instance-id",mc="delete-bank-account-internal-call-id",_a="new-bank-account-data-variable-declaration-id",zx={type:i.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},Zx={type:i.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:i.InternalCall,entityId:mc},Kx={type:i.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Oi},Xx={type:i.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:wI},Qx={type:i.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:OI},BI={type:i.InputMap,id:"bank-account-input-map-id",version:1,readsValue:Qx,declaration:Fd,name:null,description:null,index:0,defaultValue:null,parent:Xx},ej={type:i.VariableInstance,id:wI,version:1,defaultValue:null,declaration:Kx,inputs:[BI],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[Zx],successCalls:[],errorCalls:[],internalCalls:[],parent:zx,readsValue:null,writesValues:[],x:0,y:0},tj={type:i.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Oi},nj={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:vi,asType:!1,isList:!1,like:!1,inferred:!1,parent:tj},rj={type:i.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:PI},ij={type:i.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},aj={type:i.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Oi},sj={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:i.Operation,entityId:Ro};i.GenericReference,i.VariableInstance;const oj={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:fc},lj={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-decl-ref-id",entityType:i.VariableDeclaration,entityId:fc},dj={type:i.GenericReference,id:"bank-account-variable-parent-ref-two-id",entityType:i.FunctionDeclaration,entityId:It},cj={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-internal-call-ref-id",entityType:i.InternalCall,entityId:mc},uj={type:i.VariableInstance,id:CI,version:1,defaultValue:null,declaration:lj,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],internalCalls:[cj],errorCalls:[],parent:dj,readsValue:null,writesValues:[],x:0,y:0},MI={process:null,type:i.InternalCall,id:mc,version:1,declaration:pd,index:0,successCalls:[ej],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[sj,oj],parent:uj},_I={constant:!0,required:!0,type:i.VariableDeclaration,id:fc,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:nj,defaultValue:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[aj],successCalls:[MI],internalCalls:[],errorCalls:[],parent:ij,readsValue:rj,writesValues:[],x:0,y:0},pj={type:i.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Oi},yj={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:Ht,asType:!1,isList:!1,like:!1,inferred:!1,parent:pj},hj={type:i.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:pc},fj={type:i.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},mj={type:i.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:It},Tj={type:i.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Oi},Ej={id:PI,version:1,type:i.OutputMap,defaultValue:null,declaration:Fd,index:0,parent:Tj,writesValues:[_I]},VI={constant:!0,required:!0,type:i.VariableDeclaration,id:Oi,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",defaultValue:null,dataType:yj,inputs:[],outputs:[Ej],calledByError:[],calledByEntry:[mj],calledBySuccess:[],successCalls:[_I],errorCalls:[],parent:fj,internalCalls:[],readsValue:hj,writesValues:[],x:0,y:0},Rj={type:i.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:_a},gj={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.OutputMap,entityId:hc},NI={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:i.InputMap,declaration:null,name:"Account owner",description:null,readsValue:gj,index:1,defaultValue:null,parent:Rj},bj={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:yc},vj={type:i.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:_a},LI={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:i.InputMap,declaration:null,name:"Account number",description:null,readsValue:bj,defaultValue:null,index:0,parent:vj},GI={type:i.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:i.Operation,entityId:Ro},Ij={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:i.InputMap,declaration:yr.inputs[0],name:null,description:null,index:0,readsValue:null,defaultValue:{type:i.LiteralValue,name:C.EntityTemplate,value:null,valueAsType:vi,autogeneration:null},parent:GI},Dj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-entity-data-input-map-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:_a},$I={id:"create-new-bank-account-instance-operation-entity-data-input-map-id",version:1,type:i.InputMap,declaration:yr.inputs[1],name:null,description:null,index:1,readsValue:Dj,defaultValue:null,parent:GI},Aj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:i.Operation,entityId:Ro},Sj={id:OI,version:1,type:i.OutputMap,defaultValue:null,declaration:yr.outputs[0],index:0,writesValues:[BI],parent:Aj},Oj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.Condition,entityId:Ma},Pj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.VariableDeclaration,entityId:_a},Cj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},FI={process:null,id:Ro,type:i.Operation,version:1,declaration:yr,inputs:[Ij,$I],error:null,outputs:[Sj],successCalls:[MI],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[Pj,Oj],parent:Cj,x:0,y:0},wj={type:i.GenericReference,id:"new-bank-account-data-variable-declaration-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},Bj={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.Condition,entityId:Ma},Mj={constant:!0,required:!0,id:_a,type:i.VariableDeclaration,version:1,defaultValue:null,inputs:[LI,NI],dataType:null,name:"New bank Account's data",description:null,readsValue:null,outputs:[],writesValues:[$I],successCalls:[FI],errorCalls:[],internalCalls:[],calledByError:[],calledBySuccess:[Bj],calledByEntry:[],x:0,y:0,parent:wj},_j={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:i.ReturnDeclaration},Vj={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:i.ReturnDeclaration},Nj={like:!1,inferred:!1,id:"person-not-found-thrown-error-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:Vj},Lj={id:"person-not-found-thrown-error-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:i.ReturnStatement},Gj={constant:!0,isError:!0,id:"person-not-found-thrown-error-id",type:i.ReturnDeclaration,version:1,dataType:Nj,name:"Person not found error",description:"If the person entity was not found this error is outputted",defaultValue:{id:"person-not-found-thrown-error-datatype-default-value-id",type:i.LiteralValue,version:1,value:"Person not found",name:C.String,parent:_j,valueAsType:null,autogeneration:null},parent:Lj,implements:null,required:!0,index:0,readsValue:null},$j={id:"person-not-found-error-return-statement-called-by-ref-id",type:i.GenericReference,entityId:Ma,entityType:i.Condition},Fj={id:"person-not-found-error-return-statement-parent-ref-id",type:i.GenericReference,entityId:It,entityType:i.FunctionDeclaration},Uj={id:"person-not-found-error-return-statement-id",type:i.ReturnStatement,version:1,throws:Gj,outputs:[],calledBySuccess:[],calledByError:[$j],calledByEntry:[],x:0,y:0,parent:Fj},xj={type:i.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:i.Search,entityId:Pi},jj={type:i.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},kj={type:i.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:hc},qj={type:i.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:i.Condition,entityId:Ma},UI={id:"person-entity-to-check-map-id",version:1,type:i.InputMap,declaration:Rr.inputs[0],name:null,description:null,readsValue:kj,index:0,defaultValue:null,parent:qj},Jj={type:i.Condition,id:Ma,version:1,declaration:Rr,inputs:[UI],calledByError:[],calledByEntry:[],calledBySuccess:[xj],successCalls:[Mj,FI],errorCalls:[Uj],x:0,y:0,parent:jj},Wj={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:i.ValueDescriptor,entityId:SI},Yj={like:!1,inferred:!1,id:"search-person-by-id-output-entity-declaration-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,asType:!1,entity:bt,parent:Wj},Hj={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:i.Search,entityId:Pi},xI={id:SI,type:i.ValueDescriptor,version:1,defaultValue:null,dataType:Yj,name:"Found person",description:"The person entity that was found",parent:Hj,required:!0,index:0},zj={type:i.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:i.Search,entityId:Pi},Zj={type:i.OutputMap,id:hc,version:1,defaultValue:null,declaration:xI,parent:zj,writesValues:[UI,NI],index:0},Kj={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:i.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:i.ArgumentDeclaration};i.DataType;const Xj={type:i.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:i.Search,entityId:Pi},jI={id:"search-person-by-id-input-declaration-id",type:i.ValueDescriptor,version:1,dataType:null,defaultValue:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",parentRelationType:P.FixedArguments,index:0,required:!0,parent:Xj},Qj={type:i.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:i.Search,entityId:Pi},e8={id:"search-person-by-id-input-map-reads-value-ref-id",type:i.GenericReference,entityId:AI,entityType:i.ArgumentDeclaration},kI={type:i.InputMap,id:"search-person-by-id-input-map",version:1,declaration:jI,name:null,description:null,readsValue:e8,defaultValue:null,parent:Qj,index:0},t8="SELECT * FROM Person WHERE id = your_id;",n8={type:i.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:i.FunctionDeclaration,entityId:It},r8={type:i.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:It},i8={type:i.Search,id:Pi,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:t8,inputsDeclarations:[jI],inputs:[kI],outputsDeclarations:[xI],outputs:[Zj],calledByError:[],calledByEntry:[r8],calledBySuccess:[],error:null,successCalls:[Jj],errorCalls:[],parent:n8,x:0,y:0};i.GenericReference,i.DataType;const a8={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:yc,entityType:i.ArgumentDeclaration},s8={like:!1,inferred:!1,id:"account-number-to-create-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:J,isList:!1,asType:!1,parent:a8},o8={entityType:i.FunctionDeclaration,entityId:It,type:i.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},l8={constant:!0,id:yc,type:i.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",defaultValue:null,dataType:s8,implements:null,writesValues:[LI],required:!0,index:1,parent:o8};i.GenericReference,i.DataType;const d8={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:i.ArgumentDeclaration},c8={like:!1,inferred:!1,id:"new-bank-account-owner-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:On,isList:!1,asType:!1,parent:d8},u8={entityType:i.FunctionDeclaration,entityId:It,type:i.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},p8={constant:!0,id:AI,type:i.ArgumentDeclaration,version:1,name:"New account owner ID",description:"If it has changed, this is the new person entity, that owns of the bank account",defaultValue:null,dataType:c8,implements:null,writesValues:[kI],required:!1,index:1,parent:u8},y8={type:i.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:i.Project,entityId:H},h8={type:i.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:i.FunctionDeclaration,entityId:It};i.GenericReference,i.DataType;const f8={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:pc,entityType:i.ArgumentDeclaration},m8={like:!1,inferred:!1,id:"company-entity-to-modify-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ee,isList:!1,asType:!1,parent:f8},T8={constant:!0,id:pc,type:i.ArgumentDeclaration,version:1,name:"Company",defaultValue:null,dataType:m8,implements:null,description:"The company to replace the bank account for",writesValues:[VI],required:!0,index:0,parent:h8},E8={type:i.FunctionDeclaration,id:It,version:1,name:"Replace bank account",description:"This action takes an existing company and data to create a new bank account entity. It then creates a bank account, deletes the old one, and updates the company with the new bank account",inputs:[T8,l8,p8],index:null,implements:null,calls:[i8,VI],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:y8},R8={type:i.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},g8={type:i.FunctionDeclaration,version:1,id:"6bedb217-f844-4332-af72-9626b2a32511",name:"Some library main function",description:null,inputs:[],calls:[],implements:null,collapsed:!0,index:null,returnStatements:[],private:!1,parent:R8,x:0,y:0},b8={type:i.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:i.Project,entityId:H},v8={type:i.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},I8={type:i.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[g8],events:[],implements:v8,parent:b8,x:0,y:0},Tc="global-counted-test-loop-id",qI="global-counted-test-loop-body-id",JI="global-counted-test-loop-body-current-iteration-value-argument-declaration-id",D8={type:i.GenericReference,id:"global-counted-test-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:JI,entityType:i.ArgumentDeclaration},A8={like:!1,inferred:!1,id:"global-counted-test-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:D8},S8={id:"global-counted-test-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:qI,entityType:i.FunctionDeclaration},O8={constant:!0,id:JI,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:A8,implements:Ql,required:!0,index:0,writesValues:[],parent:S8},P8={id:"global-counted-test-loop-body-parent-ref-id",type:i.GenericReference,entityId:Tc,entityType:i.Loop},C8={id:qI,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[O8],calls:[],implements:Ds,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:P8},Ci="random-company-employee-test-variable-id",Ec="manager-global-variable-id",WI="global-user-instance-id",mn="employee-mapped-dto-variable-id",Or="employee-mapped-dto-variable-instance-id",YI="random-employee-id-output-map-id",HI="random-employee-birth-date-output-map-id",zI="random-employee-department-output-map-id",ZI="random-employee-manager-output-map-id",KI="manager-global-id-output-map-id",XI="global-user-instance-id-output-map-id",w8="employee-mapped-dto-requester-id-input-map-id",QI="employee-mapped-dto-now-timestamp-input-map-id",B8="employee-mapped-dto-id-input-map-id",M8="employee-mapped-dto-birth-date-input-map-id",_8="employee-mapped-dto-department-input-map-id",V8="employee-mapped-dto-manager-input-map-id",N8={id:"global-counted-test-loop-iteration-number-input-map-parent-ref-id",type:i.GenericReference,entityId:Tc,entityType:i.Loop};i.GenericReference,i.VariableDeclaration;const L8={id:"global-counted-test-loop-iteration-number-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:na.inputs[0],defaultValue:null,readsValue:null,index:0,parent:N8},G8={id:"global-counted-test-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},$8={id:"global-counted-test-loop-called-by-success-ref-id",type:i.GenericReference,entityId:Or,entityType:i.VariableDeclaration},eD={id:Tc,type:i.Loop,version:1,declaration:na,inputs:[L8],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:C8,calledByError:[],calledByEntry:[],calledBySuccess:[$8],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:G8},Rc="global-object-keys-test-loop-id",tD="global-object-keys-test-loop-body-id",nD="global-object-keys-test-loop-body-current-iteration-value-argument-declaration-id",F8={type:i.GenericReference,id:"global-object-keys-test-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:nD,entityType:i.ArgumentDeclaration},U8={like:!1,inferred:!1,id:"global-object-keys-test-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:F8},x8={id:"global-object-keys-test-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:tD,entityType:i.FunctionDeclaration},j8={constant:!0,id:nD,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:U8,implements:Hl,required:!0,index:0,writesValues:[],parent:x8},k8={id:"global-object-keys-test-loop-body-parent-ref-id",type:i.GenericReference,entityId:Rc,entityType:i.Loop},q8={id:tD,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[j8],calls:[],implements:li,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:k8},J8={id:"global-object-keys-test-loop-iteration-object-input-map-parent-ref-id",type:i.GenericReference,entityId:Rc,entityType:i.Loop},W8={id:"global-object-keys-test-loop-iteration-object-input-map-reads-value-ref-id",type:i.GenericReference,entityId:mn,entityType:i.VariableDeclaration},rD={id:"global-object-keys-test-loop-iteration-object-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:li.inputs[0],defaultValue:null,readsValue:W8,index:0,parent:J8},Y8={id:"global-object-keys-test-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},H8={id:"global-object-keys-test-loop-called-by-success-ref-two-id",type:i.GenericReference,entityId:Or,entityType:i.VariableDeclaration},z8={id:"global-object-keys-test-loop-called-by-success-ref-one-id",type:i.GenericReference,entityId:mn,entityType:i.VariableDeclaration},gc={id:Rc,type:i.Loop,version:1,declaration:li,inputs:[rD],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:q8,calledByError:[],calledByEntry:[],calledBySuccess:[z8,H8],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:Y8},bc="global-object-values-test-loop-id",iD="global-object-values-test-loop-body-id",aD="global-object-values-test-loop-body-current-iteration-value-argument-declaration-id",Z8={type:i.GenericReference,id:"global-object-values-test-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:aD,entityType:i.ArgumentDeclaration},K8={like:!1,inferred:!1,id:"global-object-values-test-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:Z8},X8={id:"global-object-values-test-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:iD,entityType:i.FunctionDeclaration},Q8={constant:!0,id:aD,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:K8,implements:Zl,required:!0,index:0,writesValues:[],parent:X8},ek={id:"global-object-values-test-loop-body-parent-ref-id",type:i.GenericReference,entityId:bc,entityType:i.Loop},tk={id:iD,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[Q8],calls:[],implements:di,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:ek},nk={id:"global-object-values-test-loop-iteration-object-input-map-parent-ref-id",type:i.GenericReference,entityId:bc,entityType:i.Loop},rk={id:"global-object-values-test-loop-iteration-object-input-map-reads-value-ref-id",type:i.GenericReference,entityId:Or,entityType:i.VariableDeclaration},sD={id:"global-object-values-test-loop-iteration-object-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:di.inputs[0],defaultValue:null,readsValue:rk,index:0,parent:nk},ik={id:"global-object-values-test-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},ak={id:"global-object-values-test-loop-called-by-success-ref-id",type:i.GenericReference,entityId:Or,entityType:i.VariableInstance},oD={id:bc,type:i.Loop,version:1,declaration:di,inputs:[sD],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:tk,calledByError:[],calledByEntry:[],calledBySuccess:[ak],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:ik},vc="global-test-iterate-over-string-loop-id",Ic="global-test-iterate-over-string-loop-body-id",go="global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-id",lD="global-test-iterate-over-string-loop-iteration-list-input-map-id",sk={type:i.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:go,entityType:i.ArgumentDeclaration},ok={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:sk},lk={id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Ic,entityType:i.FunctionDeclaration},dk={constant:!0,id:go,type:i.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",defaultValue:null,dataType:ok,implements:Wl,required:!0,index:1,writesValues:[],parent:lk},ck={type:i.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:go,entityType:i.ArgumentDeclaration},uk={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:ck},pk={id:"global-test-iterate-over-string-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Ic,entityType:i.FunctionDeclaration},yk={constant:!0,id:go,type:i.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",defaultValue:null,dataType:uk,implements:Yl,required:!0,index:0,writesValues:[],parent:pk},hk={id:"global-test-iterate-over-string-loop-body-parent-ref-id",type:i.GenericReference,entityId:vc,entityType:i.Loop},fk={id:Ic,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[yk,dk],calls:[],implements:vs,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:hk},mk={id:"global-test-iterate-over-string-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:vc,entityType:i.Loop},Tk={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-parent-ref-id",type:i.GenericReference,entityId:lD,entityType:i.InputMap},Ek={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-id",type:i.LiteralValue,name:C.String,version:1,value:"Hello",valueAsType:null,autogeneration:{type:ze.Random,rangeStart:4,rangeEnd:5},parent:Tk},Rk={id:lD,type:i.InputMap,version:1,name:null,description:null,declaration:ea.inputs[0],defaultValue:Ek,readsValue:null,index:0,parent:mk},gk={id:"global-test-iterate-over-string-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},bk={id:vc,type:i.Loop,version:1,declaration:ea,inputs:[Rk],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:fk,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:gk},Dc="iterate-over-list-loop-id",dD="iterate-over-list-loop-body-id",cD="iterate-over-list-loop-body-current-iteration-value-argument-declaration-id",vk={type:i.GenericReference,id:"iterate-over-list-loop-body-current-iteration-value-argument-declaration-data-type-parent-ref-id",entityId:cD,entityType:i.ArgumentDeclaration},Ik={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-value-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,parent:vk},Dk={id:"iterate-over-list-loop-body-current-iteration-value-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:dD,entityType:i.FunctionDeclaration},Ak={constant:!0,id:cD,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",defaultValue:null,dataType:Ik,implements:Is,required:!0,index:0,writesValues:[],parent:Dk},Sk={id:"iterate-over-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:Dc,entityType:i.Loop},Ok={id:dD,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[Ak],calls:[],implements:ta,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:Sk},Pk={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:Dc,entityType:i.Loop},Ck={id:"iterate-over-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Jn.inputs[0],defaultValue:null,readsValue:null,index:0,parent:Pk},wk={id:"iterate-over-list-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Bk={id:Dc,type:i.Loop,version:1,declaration:Jn,inputs:[Ck],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:Ok,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:wk},Mk=`SELECT
|
|
2
2
|
Employee.identifier AS EmployeeID,
|
|
3
3
|
Employee.startDate AS startDate,
|
|
4
4
|
User.identifier AS userID,
|
|
@@ -21,7 +21,7 @@ WHERE
|
|
|
21
21
|
AND Employee.manager IS NOT NULL
|
|
22
22
|
OR (Employee.manager = User.identifier AND User.identifier IS NOT NULL)
|
|
23
23
|
ORDER BY Employee.startDate DESC, Employee.department ASC
|
|
24
|
-
LIMIT 10 OFFSET 0;`,_k={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Vk={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},uD={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:i.ValueDescriptor,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",defaultValue:null,dataType:null,required:!0,index:0,parent:Vk},Nk={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},Lk={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:i.OutputMap,version:1,defaultValue:null,declaration:uD,writesValues:[],index:0,parent:Nk},Gk={id:"find-companies-with-multiple-employees-and-bank-account",type:i.Search,version:1,name:"Find companies with multiple employees and a bank account",description:"This search statement finds companies with multiple employees and an existing bank account",inputsDeclarations:[],outputsDeclarations:[uD],inputs:[],outputs:[Lk],query:Mk,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:_k},$k={type:i.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:KI},Fk={type:i.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},pD={id:V8,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:$k,parent:Fk},Uk={type:i.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:zI},xk={type:i.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},yD={id:_8,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:Uk,parent:xk},jk={type:i.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:HI},kk={type:i.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},hD={id:M8,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:jk,parent:kk},qk={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:YI},Jk={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},fD={id:B8,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:qk,parent:Jk},Wk={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:XI},Yk={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},mD={id:w8,type:i.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,index:0,readsValue:Wk,parent:Yk},Hk={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ec},zk={id:KI,type:i.OutputMap,version:1,declaration:Ft.properties[0],defaultValue:null,index:0,writesValues:[pD],parent:Hk},Zk={type:i.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ec},Kk={like:!1,inferred:!1,id:"manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:Zk},Xk={type:i.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:ZI},Qk={type:i.GenericReference,id:"manager-variable-parent-ref-id",entityType:i.Project,entityId:H},TD={constant:!0,required:!0,id:Ec,type:i.VariableDeclaration,version:1,name:"Manager",dataType:Kk,description:"A variable holding an inherited manager for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:Xk,writesValues:[],inputs:[],outputs:[zk],internalCalls:[],parent:Qk,x:0,y:0},e9={type:i.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},t9={id:ZI,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[2],index:3,writesValues:[TD],parent:e9},n9={type:i.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},r9={id:zI,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[0],index:2,writesValues:[yD],parent:n9},i9={type:i.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},a9={id:HI,type:i.OutputMap,version:1,defaultValue:null,declaration:bt.properties[1],index:1,writesValues:[hD],parent:i9},s9={type:i.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},o9={id:YI,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[fD],parent:s9},l9={type:i.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},d9={like:!1,inferred:!1,id:"random-company-employee-test-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:l9},c9={type:i.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:i.Project,entityId:H},u9={constant:!0,required:!0,id:Ci,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:d9,description:"A variable holding a random company employee for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[o9,a9,r9,t9],internalCalls:[],parent:c9,x:0,y:0},p9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:QI},y9={type:i.LiteralValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:C.Date,version:1,valueAsType:null,value:null,autogeneration:{type:ze.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:p9},h9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:Or},f9={id:QI,type:i.InputMap,version:1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:y9,index:5,readsValue:null,parent:h9},m9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",entityType:i.VariableDeclaration,entityId:mn},T9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:mn},E9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},R9={id:Or,type:i.VariableInstance,version:1,defaultValue:null,declaration:m9,calledByError:[],calledByEntry:[],calledBySuccess:[T9],successCalls:[gc,oD,eD],errorCalls:[],readsValue:null,writesValues:[sD],inputs:[f9],outputs:[],internalCalls:[],parent:E9,x:0,y:0},g9={type:i.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:i.Project,entityId:H},b9={constant:!0,required:!0,id:mn,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[gc,R9],errorCalls:[],readsValue:null,writesValues:[rD],inputs:[mD,fD,hD,yD,pD],outputs:[],internalCalls:[],parent:g9,x:0,y:0},v9={type:i.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:i.VariableDeclaration,entityId:sb},I9={like:!1,inferred:!1,id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Nd,version:1,asType:!1,isList:!1,parent:v9},D9={type:i.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:i.Project,entityId:H},ED={constant:!0,required:!0,id:sb,type:i.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",defaultValue:null,dataType:I9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:D9},A9={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableInstance,entityId:WI},S9={id:XI,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[mD],parent:A9},O9={type:i.GenericReference,id:"global-user-instance-parent-ref-id",entityType:i.Project,entityId:H},P9={id:WI,type:i.VariableInstance,version:1,defaultValue:null,declaration:ED,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[S9],internalCalls:[],parent:O9,x:0,y:0},C9={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},w9={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:i.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},B9={like:!1,inferred:!1,id:"is-test-environment-variable-dcl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:An,version:1,asType:!1,isList:!1,parent:C9},M9={type:i.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:i.Project,entityId:H},RD={constant:!0,required:!0,id:"is-test-environment-variable-dcl-id",type:i.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:C.Boolean,version:1,value:null,type:i.LiteralValue,autogeneration:{type:ze.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:w9},dataType:B9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:M9},_9={type:i.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},V9={id:"is-test-environment-variable-instance-id",type:i.VariableInstance,version:1,defaultValue:null,declaration:RD,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:_9,x:0,y:0},gD={type:i.Project,id:H,version:1,name:"Mocked project to compile",description:"This project is used to test all sorts of features and edge cases. It is not meant to be used in production. Or to have any functionality that makes sense",projects:[I8],entities:[Vd,Ft,Nd,bt,D0,Yt,so,Db,Ab,vi,nL,Ht,KL,_d,gw,l0,eL],functions:[k4,Zb,tc,K4,sx,uv,nc,Ud,E8,Nb,Hx],events:[r1],variableDeclarations:[RD,ED,oc,u9,TD,b9],variableInstances:[V9,P9],conditions:[],operations:[Si],functionCalls:[tG,d$],loops:[Bk,gc,oD,bk,eD],searches:[Gk]};var E=(r=>(r.Error="error",r.Warning="warning",r))(E||{}),B=(r=>(r.InvalidObjectStructure="invalid-object-structure",r.NameNotUniqueInScope="name-not-unique-in-scope",r.EmptyName="empty-name",r.MissingCaller="missing-caller",r.PropertyOverwrite="property-overwrite",r.MethodOverwrite="method-overwrite",r.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",r.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",r.UnreachableEntity="unreachable-entity",r.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",r.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",r.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",r.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",r.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",r))(B||{}),T=(r=>(r.RootReference="root-reference",r.ReferencedEntityNotFound="referenced-entity-not-found",r.EntityIdNotUnique="entity-id-not-unique",r.BuiltInEntityGenerated="built-in-entity-generated",r.BuiltInEntityUpdated="built-in-entity-updated",r.BuiltInEntityDeleted="built-in-entity-deleted",r.UnknownEntityType="unknown-entity-type",r.MissingTypeProperty="missing-type-property",r.MissingIdProperty="missing-id-property",r.BuiltInEntityParent="built-in-entity-parent",r.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",r.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",r.RecommendedImplementOperationAction="recommended-implement-operation-action",r.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",r.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",r.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",r.RecommendedImplementConditionAction="recommended-implement-condition-action",r.InvalidReferenceObjectStructure="invalid-reference-object-structure",r.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",r.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",r.InvalidParentReference="invalid-parent-reference",r.InvalidImplementsReference="invalid-implements-reference",r.InvalidExtendsReference="invalid-extends-reference",r.InvalidGenerationActionPayload="invalid-generation-action-payload",r.InvalidReference="invalid-reference",r.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",r.InvalidUpdateEntityOperation="invalid-update-entity-operation",r.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",r.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",r.UnrecognizedProperty="unrecognized-property",r.SelfReference="self-reference",r.DuplicateReference="duplicate-reference",r.CallerWithIncompatibleScope="caller-with-incompatible-scope",r.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",r.InvalidInputMapDeclaration="invalid-input-map-declaration",r.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",r.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",r.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",r.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",r.OutputOverwrite="output-overwrite",r.InputOverwrite="input-overwrite",r.IncompatibleScope="incompatible-scope",r.InvalidParentUpdate="invalid-parent-update",r.NonInteractiveEntityReferenced="non-interactive-entity-referenced",r.InvalidParentRelationType="invalid-parent-relation-type",r))(T||{}),G=(r=>(r.NoPrimaryKeyProperty="no-primary-key-property",r.ScopeWithoutLogic="scope-without-logic",r.ExtendingAbstractEntity="extending-abstract-entity",r.ImplementingNonAbstractEntity="implementing-non-abstract-entity",r.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",r.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",r.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",r.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",r.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",r.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",r.IncorrectEntityImplementation="incorrect-entity-implementation",r.IncorrectMethodImplementation="incorrect-method-implementation",r.IncorrectPropertyImplementation="incorrect-property-implementation",r.PropertyImplementsNonAbstact="property-implements-non-abstract",r.NonStaticPropertyImplementsStatic="non-static-property-implements-static",r.StaticPropertyImplementsNonStatic="static-property-implements-non-static",r.PropertyImplementsIncompatibleType="property-implements-incompatible-type",r.MissingPropertyImplementation="missing-property-implementation",r.MissingMethodImplementation="missing-method-implementation",r.NoProperties="no-properties",r.ReadingFromIncompatibleType="reading-from-incompatible-type",r.WritingToIncompatibleType="writing-to-incompatible-type",r.InvalidPropertiesCombination="invalid-properties-combination",r.DisconnectedCallableEntity="disconnected-callable-entity",r.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",r.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",r.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",r.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",r.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",r.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",r))(G||{});class g{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code}toEntityError(e){return this.code in B?new Pr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class Pr{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");c(this,"entity");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code,this.entity=e.entity}clone(){return new Pr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function N9(r){const e=new Set;return r.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function Q(r){const e=r.entity.errors.find(n=>n.id===r.id);return e?{new:!1,error:e}:{new:!0,error:new Pr(r)}}function L9(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 Me(r,e){const t=[];return e.forEach(n=>{const a=r.find(s=>s.id===n.id);a?t.push(a):t.push(n)}),t}const Na=y.union([y.string(),y.number(),y.boolean(),y.date()]),bD=y.enum([ze.CurrentDateAndTime,ze.Random,ze.Unique]),bo=y.object({type:bD,rangeStart:Na.nullable(),rangeEnd:Na.nullable()}),La=bo.extend({type:y.literal(ze.Random),rangeStart:Na,rangeEnd:Na}),Ac=bo.extend({type:y.literal(ze.Unique),rangeStart:y.null(),rangeEnd:y.null()}),vD=bo.extend({type:y.literal(ze.CurrentDateAndTime),rangeStart:y.null(),rangeEnd:y.null()}),vo=La.extend({rangeStart:y.number().nullable(),rangeEnd:y.number().nullable()}),ID=vo.extend({rangeStart:y.number(),rangeEnd:y.null()}),DD=vo.extend({rangeStart:y.null(),rangeEnd:y.number()}),AD=vo.extend({rangeStart:y.number(),rangeEnd:y.number()}),Io=La.extend({rangeStart:y.number().nullable(),rangeEnd:y.number().nullable()}),SD=Io.extend({rangeStart:y.number(),rangeEnd:y.null()}),OD=Io.extend({rangeStart:y.null(),rangeEnd:y.number()}),PD=Io.extend({rangeStart:y.number(),rangeEnd:y.number()}),Do=La.extend({rangeStart:y.date().nullable(),rangeEnd:y.date().nullable()}),CD=Do.extend({rangeStart:y.date(),rangeEnd:y.null()}),wD=Do.extend({rangeStart:y.null(),rangeEnd:y.date()}),BD=Do.extend({rangeStart:y.date(),rangeEnd:y.date()}),Sc=La.extend({rangeStart:y.null(),rangeEnd:y.null()}),Oc=y.union([SD,OD,PD]),Pc=y.union([ID,DD,AD]),Cc=y.union([CD,wD,BD,vD]),wc=y.union([Oc,Pc,Cc,Ac,Sc]);function Ga(){return y.union([y.object({type:y.literal(i.ValueDescriptor)}),y.record(y.string(),y.any())])}function MD(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ValueDescriptor)})}function Bc(){return y.object({id:y.string(),type:y.literal(i.ValueDescriptor),name:y.string(),required:y.boolean()})}function G9(){return Bc().merge(y.object({version:y.number(),index:y.number()}))}function $9(){return Bc().merge(y.object({}))}function F9(){return y.object({dataType:Mr(),parent:wr()})}function U9(){return G9().merge(F9())}function Ao(){return y.union([y.object({type:y.literal(i.PrimitiveEntity)}),y.record(y.string(),y.any())])}function So(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.PrimitiveEntity)})}function Oo(){return y.object({id:y.string(),type:y.literal(i.PrimitiveEntity),name:y.string(),description:y.string().nullable(),static:y.boolean(),abstract:y.boolean()})}function x9(){return Oo().merge(y.object({version:y.number()}))}function j9(){return Oo().merge(y.object({}))}function k9(){return y.object({properties:y.array(Cr()),methods:y.array(xt()),abstractMethods:y.array(Tn()),extends:y.array(y.union([Ao(),wi()]))})}function q9(){return x9().merge(k9())}function Cr(){return y.union([y.object({type:y.literal(i.Property)}),y.record(y.string(),y.any())])}function _D(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Property)})}function Mc(){return y.object({id:y.string(),type:y.literal(i.Property),name:y.string(),description:y.string().nullable(),private:y.boolean(),static:y.boolean(),required:y.boolean(),abstract:y.boolean()})}function J9(){return Mc().merge(y.object({version:y.number(),index:y.number()}))}function W9(){return Mc().merge(y.object({}))}function Y9(){return y.object({dataType:Mr(),implements:Cr().nullable(),parent:y.union([Nr(),So(),Po()])})}function H9(){return J9().merge(Y9())}function z9(){return y.enum([U.CRON_JOB,U.EXECUTION,U.HTTP_ENDPOINT,U.PERSISTED_ENTITY,U.RELATIONAL_DATABASE])}function wi(){return y.union([y.object({type:y.literal(i.BuiltInBaseEntity)}),y.record(y.string(),y.any())])}function Po(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.BuiltInBaseEntity)})}function _c(){return y.object({id:y.string(),version:y.number(),type:y.literal(i.BuiltInBaseEntity),name:z9(),description:y.string().nullable(),abstract:y.boolean(),static:y.boolean()})}function Z9(){return _c()}function K9(){return _c().merge(y.object({}))}function X9(){return y.object({properties:y.array(Cr()),methods:y.array(xt()),abstractMethods:y.array(Tn()),extends:y.array(y.union([wi(),Ao()]))})}function Q9(){return Z9().merge(X9())}function Tn(){return y.union([y.object({type:y.literal(i.ActionDescriptor)}),y.record(y.string(),y.any())])}function wr(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ActionDescriptor)})}function Co(){return y.object({id:y.string(),type:y.literal(i.ActionDescriptor),name:y.string(),description:y.string().nullable()})}function e6(){return Co().merge(y.object({version:y.number()}))}function t6(){return Co().merge(y.object({}))}function n6(){return y.object({inputs:y.array(Ga()),outputs:y.array(Ga()),parent:y.union([Bt(),Nr(),Po(),So()]).nullable()})}function VD(){return e6().merge(n6())}function Bi(){return y.union([y.object({type:y.literal(i.Loop)}),y.record(y.string(),y.any())])}function En(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Loop)})}function ND(){return y.object({id:y.string(),type:y.literal(i.Loop)})}function r6(){return ND().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function i6(){return ND().merge(y.object({declaration:y.union([y.string(),xt()])}))}function a6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),declaration:Tn(),inputs:y.array(rn()),outputs:y.array(Dt()),outputsDeclarations:y.array(Ga()),successCalls:y.array(at()),errorCalls:y.array(at()),error:Dt(),body:xt(),parent:y.union([Gn(),Bt()]),breakStatements:y.array(Ni()),continueStatements:y.array(Mi())})}function s6(){return r6().merge(a6())}function Mi(){return y.union([y.object({type:y.literal(i.ContinueStatement)}),y.record(y.string(),y.any())])}function _i(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ContinueStatement)})}function Vc(){return y.object({id:y.string(),type:y.literal(i.ContinueStatement)})}function o6(){return Vc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function l6(){return Vc().merge(y.object({}))}function d6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),outputs:y.array(Vn()),throws:y.optional(Vn()),parent:En()})}function c6(){return o6().merge(d6())}function Br(){return y.union([y.object({type:y.literal(i.ReturnStatement)}),y.record(y.string(),y.any())])}function Vi(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ReturnStatement)})}function Nc(){return y.object({id:y.string(),type:y.literal(i.ReturnStatement)})}function u6(){return Nc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function p6(){return Nc().merge(y.object({}))}function y6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),outputs:y.array(Vn()),throws:y.optional(Vn()),parent:Gn()})}function h6(){return u6().merge(y6())}function Vn(){return y.union([y.object({type:y.literal(i.ReturnDeclaration)}),y.record(y.string(),y.any())])}function LD(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ReturnDeclaration)})}function Lc(){return y.object({id:y.string(),type:y.literal(i.ReturnDeclaration),name:y.string(),description:y.string().nullable(),isError:y.boolean()})}function f6(){return Lc().merge(y.object({version:y.number(),index:y.number()}))}function m6(){return Lc().merge(y.object({}))}function T6(){return y.object({dataType:Mr().nullable(),readsValue:ka().nullable(),parent:y.union([Vi(),wr(),Nn(),_i()])})}function E6(){return f6().merge(T6())}function Ni(){return y.union([y.object({type:y.literal(i.BreakStatement)}),y.record(y.string(),y.any())])}function Nn(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.BreakStatement)})}function Gc(){return y.object({id:y.string(),type:y.literal(i.BreakStatement)})}function R6(){return Gc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function g6(){return Gc().merge(y.object({}))}function b6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),outputs:y.array(Vn()),throws:y.optional(Vn()),parent:En()})}function v6(){return R6().merge(b6())}function Dt(){return y.union([y.object({type:y.literal(i.OutputMap)}),y.record(y.string(),y.any())])}function $c(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.OutputMap)})}function Fc(){return y.object({id:y.string(),type:y.literal(i.OutputMap)})}function I6(){return Fc().merge(y.object({version:y.number(),index:y.number()}))}function D6(){return Fc().merge(y.object({}))}function A6(){return y.object({writesValues:y.array(Ln()),declaration:y.union([Vn(),Cr()]),parent:y.union([$e(),En(),Nn()])})}function S6(){return I6().merge(A6())}function Li(){return y.union([y.object({type:y.literal(i.FunctionCall)}),y.record(y.string(),y.any())])}function $a(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.FunctionCall)})}function Uc(){return y.object({id:y.string(),type:y.literal(i.FunctionCall)})}function O6(){return Uc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function P6(){return Uc().merge(y.object({}))}function C6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),writesValues:y.array(Ln()),declaration:xt(),inputs:y.array(rn()),outputs:y.array(Dt()),error:y.optional(Dt()),parent:y.union([Gn(),Bt()])})}function w6(){return O6().merge(C6())}function B6(){return y.enum([qe.Equal,qe.NotEqual,qe.MoreThan,qe.MoreThanOrEqual,qe.LessThan,qe.LessThanOrEqual,qe.And,qe.Or,Jt.Empty,Jt.NotEmpty])}function Fa(){return y.union([y.object({type:y.literal(i.Condition)}),y.record(y.string(),y.any())])}function wo(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Condition)})}function xc(){return y.object({id:y.string(),type:y.literal(i.Condition)})}function M6(){return xc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function _6(){return xc().merge(y.object({}))}function V6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),leftValue:rn(),rightValue:rn().nullable(),operator:B6(),parent:y.union([Gn(),Bt()])})}function N6(){return M6().merge(V6())}function Ua(){return y.union([y.object({type:y.literal(i.Search)}),y.record(y.string(),y.any())])}function xa(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Search)})}function jc(){return y.object({id:y.string(),type:y.literal(i.Search),name:y.string(),query:y.any(),description:y.string().nullable()})}function L6(){return jc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function G6(){return jc().merge(y.object({}))}function $6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),inputsDeclarations:y.array(Vr()),inputs:y.array(rn()),outputsDeclarations:y.array(Ga()),outputs:y.array(Dt()),parent:y.union([Gn(),Bt()]),error:Dt().nullable()})}function F6(){return L6().merge($6())}function ja(){return y.union([y.object({type:y.literal(i.InternalCall)}),y.record(y.string(),y.any())])}function kc(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.InternalCall)})}function qc(){return y.object({id:y.string(),type:y.literal(i.InternalCall),index:y.number()})}function U6(){return qc().merge(y.object({version:y.number(),index:y.number()}))}function x6(){return qc().merge(y.object({declaration:y.union([y.string(),xt()])}))}function j6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),writesValues:y.array(Ln()),declaration:xt(),inputs:y.array(rn()),outputs:y.array(Dt()),parent:nr(),error:y.optional(Dt())})}function k6(){return U6().merge(j6())}function rn(){return y.union([y.object({type:y.literal(i.InputMap)}),y.record(y.string(),y.any())])}function Bo(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.InputMap)})}function Jc(){return y.object({id:y.string(),type:y.literal(i.InputMap),name:y.string().nullable().optional(),description:y.string().nullable().optional()})}function q6(){return Jc().merge(y.object({version:y.number(),index:y.number()}))}function J6(){return Jc().merge(y.object({}))}function W6(){return y.object({defaultValue:Wc().nullable(),declaration:y.union([Vr(),Cr()]).nullable(),readsValue:ka().nullable(),parent:y.union([$e(),Bo(),En(),Nn()])})}function Y6(){return q6().merge(W6())}function Gi(){return y.union([y.object({type:y.literal(i.Operation)}),y.record(y.string(),y.any())])}function $i(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Operation)})}function Mo(){return y.object({id:y.string(),type:y.literal(i.Operation)})}function H6(){return Mo().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function z6(){return Mo().merge(y.object({}))}function Z6(){return Mo().merge(y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),writesValues:y.array(Ln()),declaration:Tn(),inputs:y.array(rn()),outputs:y.array(Dt()),error:y.array(Dt()),parent:y.union([Gn(),Bt()])}))}function K6(){return H6().merge(Z6())}function _o(){return y.union([y.string(),y.number(),y.boolean(),y.null(),y.date()])}function GD(){return y.record(y.string(),_o())}function X6(){return y.array(y.union([_o(),GD()]))}function $D(){return y.union([_o(),GD(),X6()])}function FD(){return y.union([_o(),$D()])}function UD(){return y.enum([C.String,C.Number,C.Boolean,C.Null,C.Date,C.KeyValue,C.Enum,C.File,C.UUID,C.EntityTemplate,C.ActionDescriptor])}function Q6(){return y.union([Nr(),$i(),qa()])}function e3(){return y.object({id:y.string(),name:UD(),type:y.literal(i.LiteralValue),value:FD(),autogeneration:wc.nullable()})}function t3(){return e3().merge(y.object({}))}function an(){return y.object({id:y.string(),version:y.number(),name:UD(),type:y.literal(i.LiteralValue),value:FD(),valueAsType:Q6().nullable(),autogeneration:wc.nullable(),parent:y.union([Yc(),Bo()])})}function n3(){return an().extend({name:y.literal(C.String),value:y.string(),autogeneration:Oc.nullable()})}function r3(){return an().extend({name:y.literal(C.Number),value:y.number(),autogeneration:Pc.nullable()})}function i3(){return an().extend({name:y.literal(C.Boolean),value:y.boolean(),autogeneration:Sc.nullable()})}function a3(){return an().extend({name:y.literal(C.Null),value:y.null(),autogeneration:y.null()})}function s3(){return an().extend({name:y.literal(C.Date),value:y.date(),autogeneration:Cc.nullable()})}function o3(){return an().extend({name:y.literal(C.KeyValue),value:$D(),autogeneration:y.null()})}function l3(){return an().extend({name:y.literal(C.Enum),value:y.string(),autogeneration:y.null()})}function d3(){return an().extend({name:y.literal(C.File),value:y.string(),autogeneration:y.null()})}function c3(){return an().extend({name:y.literal(C.UUID),value:y.string(),autogeneration:Ac.nullable()})}function u3(){return an().extend({name:y.literal(C.EntityTemplate),value:Nr(),autogeneration:y.null()})}function p3(){return an().extend({name:y.literal(C.ActionDescriptor),value:qa(),autogeneration:y.null()})}function Wc(){return y.union([n3(),r3(),i3(),a3(),s3(),o3(),l3(),d3(),c3(),u3(),p3()])}function Mr(){return y.union([y.object({type:y.literal(i.DataType)}),y.record(y.string(),y.any())])}function Yc(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.DataType)})}function Hc(){return y.object({id:y.string(),type:y.literal(i.DataType),isNullable:y.boolean(),isList:y.boolean(),constant:y.boolean(),asType:y.boolean(),options:y.array(y.string()).optional()})}function y3(){return Hc().merge(y.object({version:y.number()}))}function h3(){return Hc().merge(y.object({}))}function f3(){return y.object({defaultValue:Wc().nullable(),entity:y.union([Fi(),wi(),Ao(),Tn()]).nullable(),parent:y.union([_D(),kD(),MD()])})}function m3(){return y3().merge(f3())}function zc(){return y.union([y.object({type:y.literal(i.VariableDeclaration)}),y.record(y.string(),y.any())])}function T3(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.VariableDeclaration)})}function Zc(){return y.object({id:y.string(),type:y.literal(i.VariableDeclaration),name:y.string(),description:y.string().nullable()})}function E3(){return Zc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function R3(){return Zc().merge(y.object({}))}function g3(){return y.object({dataType:Mr().nullable(),readsValue:ka().nullable(),writesValues:y.array(Ln()),inputs:y.array(rn()),outputs:y.array(Dt()),successCalls:y.array(at()),errorCalls:y.array(at()),internalCalls:y.array(ja()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),parent:y.union([Gn(),Bt()])})}function b3(){return E3().merge(g3())}function xD(){return y.union([y.object({type:y.literal(i.VariableInstance)}),y.record(y.string(),y.any())])}function v3(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.VariableInstance)})}function Kc(){return y.object({id:y.string(),type:y.literal(i.VariableInstance)})}function I3(){return Kc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function D3(){return Kc().merge(y.object({}))}function A3(){return y.object({declaration:zc(),dataType:Mr().nullable(),readsValue:ka().nullable(),writesValues:y.array(Ln()),inputs:y.array(rn()),outputs:y.array(Dt()),successCalls:y.array(at()),errorCalls:y.array(at()),internalCalls:y.array(ja()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),parent:y.union([Gn(),Bt()])})}function S3(){return I3().merge(A3())}function Xc(){return y.union([y.object({type:y.literal(i.InstalledProject)}),y.record(y.string(),y.any())])}function Vo(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.InstalledProject)})}function O3(){return y.object({id:y.string(),type:y.literal(i.InstalledProject)})}function P3(){return y.object({version:y.number(),x:y.number(),y:y.number()})}function C3(){return y.object({})}function w3(){return y.object({implements:Bt(),description:y.string().nullable(),functions:y.array(xt()),events:y.array(Qc()),parent:Bt()})}function B3(){return P3().merge(w3())}function Qc(){return y.union([y.object({type:y.literal(i.GlobalEvent)}),y.record(y.string(),y.any())])}function M3(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.GlobalEvent)})}function No(){return y.object({id:y.string(),type:y.literal(i.GlobalEvent),name:y.string(),collapsed:y.boolean()})}function _3(){return No().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function V3(){return No().merge(y.object({}))}function N3(){return No().merge(y.object({returnStatements:y.array(Br()),implements:y.array(VD()),inputs:y.array(Vr()),calls:y.array(at()),parent:y.union([Bt(),Vo()])}))}function L3(){return _3().merge(N3())}function _r(){return y.union([zc(),xD()])}function nr(){return y.union([T3(),v3()])}function Ln(){return y.union([_r(),rn(),Vn()])}function jD(){return y.union([nr(),Bo(),LD()])}function ka(){return y.union([_r(),Vr(),Dt(),Gi(),ja(),Li()])}function G3(){return y.union([nr(),eu(),$c(),$i(),kc(),$a()])}function $3(){return y.union([Vr(),Dt(),Ln()])}function kD(){return y.union([eu(),$c(),jD()])}function Lo(){return Qc()}function Go(){return M3()}function $o(){return y.union([Gi(),Li(),Fa(),Ua(),_r(),ja(),Bi()])}function $e(){return y.union([$i(),$a(),wo(),xa(),nr(),kc(),En()])}function Fo(){return y.union([Gi(),Li(),Fa(),Ua(),_r(),Bi()])}function Uo(){return y.union([$i(),$a(),wo(),xa(),nr(),En()])}function qD(){return y.union([$o(),Br(),Ni(),Mi()])}function at(){return y.union([$e(),Vi(),Nn(),_i()])}function JD(){return y.union([Fo(),Br(),Ni(),Mi()])}function WD(){return y.union([Uo(),Vi(),Nn(),_i()])}function rr(){return y.union([xt(),Lo()])}function nt(){return y.union([qa(),Go()])}function F3(){return y.union([$o(),rr()])}function U3(){return y.union([$e(),nt()])}function x3(){return y.union([Fo(),rr()])}function j3(){return y.union([Uo(),nt()])}function k3(){return y.union([qD(),rr()])}function q3(){return y.union([at(),nt()])}function J3(){return y.union([JD(),rr()])}function W3(){return y.union([WD(),nt()])}function Y3(){return y.union([rr(),Bi()])}function Gn(){return y.union([nt(),En()])}function H3(){return y.union([$o(),rr()])}function z3(){return y.union([$e(),nt()])}function Z3(){return y.union([Fo(),rr()])}function K3(){return y.union([Uo(),nt()])}function X3(){return y.union([Br(),Ni(),Mi()])}function Q3(){return y.union([Vi(),Nn(),_i()])}function e5(){return y.union([wi(),p5(),Xc(),Fi(),xt(),Lo(),_r(),rn(),Dt(),Fa(),Gi(),Li(),Vn(),Vr(),Ao(),Mr(),Cr(),Tn(),Br(),Mi(),Ni(),Bi(),Ua(),Tn(),Tn(),Ga(),ja()])}function t5(){return y.union([Po(),Bt(),Vo(),Nr(),qa(),Go(),nr(),Bo(),$c(),wo(),$i(),$a(),LD(),eu(),So(),Yc(),_D(),wr(),Vi(),_i(),Nn(),En(),xa(),wr(),wr(),MD(),kc()])}function n5(){return y.union([Xc(),Fi(),xt(),Lo(),_r(),Fa(),Gi(),Li(),Br(),Mi(),Ni(),Bi(),Ua()])}function r5(){return y.union([Vo(),Nr(),qa(),Go(),nr(),wo(),$i(),$a(),Vi(),_i(),Nn(),En(),xa()])}function Vr(){return y.union([y.object({type:y.literal(i.ArgumentDeclaration)}),y.record(y.string(),y.any())])}function eu(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ArgumentDeclaration)})}function tu(){return y.object({id:y.string(),type:y.literal(i.ArgumentDeclaration)})}function i5(){return tu().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function a5(){return tu().merge(y.object({}))}function s5(){return y.object({dataType:Mr().nullable(),writesValues:y.array(Ln()),parent:y.union([nt(),wr(),wr(),xa(),Nn()])})}function o5(){return i5().merge(s5())}function xt(){return y.union([y.object({type:y.literal(i.FunctionDeclaration)}),y.record(y.string(),y.any())])}function qa(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.FunctionDeclaration)})}function nu(){return y.object({id:y.string(),type:y.literal(i.FunctionDeclaration),name:y.string(),description:y.string().nullable()})}function l5(){return nu().merge(y.object({version:y.number(),x:y.number(),y:y.number(),index:y.number().nullable()}))}function d5(){return nu()}function c5(){return y.object({inputs:y.array(Vr()),implements:Tn().nullable(),returnStatements:y.array(Br()),parent:y.union([Bt(),Vo(),Nr(),En(),Po(),So()])})}function u5(){return l5().merge(c5())}function p5(){return y.union([y.object({type:y.literal(i.Project)}),y.record(y.string(),y.any())])}function Bt(){return y.object({entityType:y.literal(i.Project),entityId:y.string(),id:y.string(),type:y.literal(i.GenericReference)})}function ru(){return y.object({id:y.string(),type:y.literal(i.Project),name:y.string(),description:y.string().nullable()})}function y5(){return ru().merge(y.object({version:y.number()}))}function h5(){return ru()}function f5(){return y.object({entities:y.array(Fi()),functions:y.array(xt()),events:y.array(Qc()),projects:y.array(Xc()),variableDeclarations:y.array(zc()),variableInstances:y.array(xD()),conditions:y.array(Fa()),operations:y.array(Gi()),functionCalls:y.array(Li()),loops:y.array(Bi()),searches:y.array(Ua())})}function m5(){return y5().merge(f5())}function Fi(){return y.union([y.object({type:y.literal(i.DefinitionEntity)}),y.record(y.string(),y.any())])}function Nr(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.DefinitionEntity)})}function iu(){return y.object({id:y.string(),type:y.literal(i.DefinitionEntity),name:y.string(),description:y.string().nullable(),static:y.boolean(),abstract:y.boolean()})}function T5(){return iu().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function E5(){return iu().merge(y.object({}))}function R5(){return y.union([Bt(),Yc()])}function g5(){return y.object({properties:y.array(Cr()),methods:y.array(xt()),abstractMethods:y.array(Tn()),extends:y.array(y.union([Fi(),wi()])),implements:y.array(y.union([Fi(),wi()])),parent:R5()})}function b5(){return T5().merge(g5())}function v5(r){const e=b5(),t=r.toJSON();e.safeParse(t).success;const a=r.implements.flatMap(h=>A5(r,h)),s=r.extends.flatMap(h=>S5(r,h)),o=P5(r),l=O5(r);r.methods.flatMap(h=>h.validate());const p=[...a,...s,...o,...l];return Me(r.errors,p)}function I5(r,e){const t=e.properties.filter(s=>s.abstract),n=[];let a=[...r.properties];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):n.push(s)}),n}function D5(r,e){const t=e.abstractMethods,n=[];let a=[...r.methods];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):n.push(s)}),n}function A5(r,e){const t=[];if(!e.abstract){const h=Q({id:r.id+"--"+G.ImplementingNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:G.ImplementingNonAbstractEntity,entity:r});return t.push(h.error),t}const n=e.properties.filter(h=>h.abstract),a=[];let s=[...r.properties];n.forEach(h=>{const f=s.find(R=>{var v;return((v=R.implements)==null?void 0:v.id)===h.id});f?s=s.filter(R=>R.id!==f.id):a.push(h)}),a.length&&a.forEach(h=>{const f=Q({id:r.id+"--"+G.MissingPropertyImplementation+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:E.Error,code:G.MissingPropertyImplementation,entity:r});t.push(f.error)});const o=[];let l=[...r.methods];e.abstractMethods.forEach(h=>{const f=l.find(R=>{var v;return((v=R.implements)==null?void 0:v.id)===h.id});f?l=l.filter(R=>R.id!==f.id):o.push(h)}),o.length&&o.forEach(h=>{const f=Q({id:r.id+"--"+G.MissingMethodImplementation+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:E.Error,code:G.MissingMethodImplementation,entity:r});t.push(f.error)});const p=[];e.properties.forEach(h=>{const f=s.find(R=>R.name===h.name);f&&p.push([f,h])}),p.length&&p.forEach(([h])=>{const f=Q({id:r.id+"--"+B.PropertyOverwrite+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.PropertyOverwrite,entity:r});t.push(f.error)});const u=[];return e.methods.forEach(h=>{const f=l.find(R=>R.name===h.name);f&&u.push([f,h])}),u.length&&u.forEach(([h])=>{const f=Q({id:r.id+"--"+B.MethodOverwrite+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.MethodOverwrite,entity:r});t.push(f.error)}),t}function S5(r,e){const t=[],n=[];if(e.abstract){const s=Q({id:r.id+"--"+G.ExtendingAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:G.ExtendingAbstractEntity,entity:r});return t.push(s.error),t}r.properties.forEach(s=>{var l;const o=e.properties.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&n.push(s)}),n.length&&n.forEach(s=>{const o=Q({id:r.id+"--"+B.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.PropertyOverwrite,entity:r});t.push(o.error)});const a=[];return r.methods.forEach(s=>{var l;const o=e.methods.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=Q({id:r.id+"--"+B.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.MethodOverwrite,entity:r});t.push(o.error)}),t}function O5(r){const e=[];if(!r.properties.length){const t=Q({id:r.id+"--"+G.NoProperties,message:"No properties implemented",issue:null,severity:E.Warning,code:G.NoProperties,entity:r});e.push(t.error)}return r.properties.forEach(t=>{t.validate()}),e}function P5(r){const e=[];if(r.abstract){if(r.methods.length){const t=Q({id:r.id+"--"+G.AbstractEntityWithNonAbstractMethods,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:E.Error,code:G.AbstractEntityWithNonAbstractMethods,entity:r});e.push(t.error)}if(r.properties.some(t=>!t.abstract)){const t=Q({id:r.id+"--"+G.AbstractEntityWithNonAbstractProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:E.Error,code:G.AbstractEntityWithNonAbstractProperties,entity:r});e.push(t.error),r.properties.forEach(n=>{if(!n.abstract){const a=Q({id:r.id+"--"+G.StaticEntityWithNonStaticProperties+"--"+n.id,message:`Property "${n.name}" with id "${n.id}" of entity "${r.name}" with id "${r.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:E.Error,code:G.StaticEntityWithNonStaticProperties,entity:r});e.push(a.error)}})}}else{if(r.abstractMethods.length){const t=Q({id:r.id+"--"+G.AbstractPropertyInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract methods`,issue:null,severity:E.Error,code:G.AbstractPropertyInNonAbstractEntity,entity:r});e.push(t.error)}if(r.properties.some(t=>t.abstract)){const t=Q({id:r.id+"--"+G.AbstractMethodInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract properties`,issue:null,severity:E.Error,code:G.AbstractMethodInNonAbstractEntity,entity:r});e.push(t.error),r.properties.forEach(n=>{if(n.abstract){const a=Q({id:r.id+"--"+G.AbstractMethodInNonAbstractEntity+"--"+n.id,message:`Property "${n.name}" with id "${n.id}" of entity "${r.name}" with id "${r.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:E.Error,code:G.AbstractMethodInNonAbstractEntity,entity:r});e.push(a.error)}})}}if(r.static&&r.properties.some(t=>!t.static)){const t=Q({id:r.id+"--"+G.StaticEntityWithNonStaticProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as static but has non-static properties`,issue:null,severity:E.Error,code:G.StaticEntityWithNonStaticProperties,entity:r});e.push(t.error),r.properties.forEach(n=>{if(!n.static){const a=Q({id:r.id+"--"+G.NonStaticPropertyInStaticEntity+"--"+n.id,message:`Property "${n.name}" with id "${n.id}" of entity "${r.name}" with id "${r.id}" is not marked as static but the entity is marked as static`,issue:null,severity:E.Error,code:G.NonStaticPropertyInStaticEntity,entity:r});e.push(a.error)}})}return e}function C5(r){return r instanceof Error&&r.name==="ZodError"&&"issues"in r&&Array.isArray(r.issues)}var w5=class extends Error{constructor(e,t){super(e,t);c(this,"name");c(this,"details");this.name="ZodValidationError",this.details=B5(t)}toString(){return this.message}};function B5(r){if(r){const e=r.cause;if(C5(e))return e.issues}return[]}function M5(r){return r.length!==0}var _5=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function V5(r){return r.length===1?r[0].toString():r.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+N5(t)+'"]';if(!_5.test(t))return e+'["'+t+'"]';const n=e.length===0?"":".";return e+n+t},"")}function N5(r){return r.replace(/"/g,'\\"')}var L5="; ",G5=99,YD="Validation error",$5=": ",F5=", or ";function U5(r={}){const{issueSeparator:e=L5,unionSeparator:t=F5,prefixSeparator:n=$5,prefix:a=YD,includePath:s=!0,maxIssuesInMessage:o=G5}=r;return l=>{const p=l.slice(0,o).map(u=>xo({issue:u,issueSeparator:e,unionSeparator:t,includePath:s})).join(e);return x5(p,a,n)}}function xo(r){const{issue:e,issueSeparator:t,unionSeparator:n,includePath:a}=r;if(e.code===N.invalid_union)return e.unionErrors.reduce((s,o)=>{const l=o.issues.map(p=>xo({issue:p,issueSeparator:t,unionSeparator:n,includePath:a})).join(t);return s.includes(l)||s.push(l),s},[]).join(n);if(e.code===N.invalid_arguments)return[e.message,...e.argumentsError.issues.map(s=>xo({issue:s,issueSeparator:t,unionSeparator:n,includePath:a}))].join(t);if(e.code===N.invalid_return_type)return[e.message,...e.returnTypeError.issues.map(s=>xo({issue:s,issueSeparator:t,unionSeparator:n,includePath:a}))].join(t);if(a&&M5(e.path)){if(e.path.length===1){const s=e.path[0];if(typeof s=="number")return`${e.message} at index ${s}`}return`${e.message} at "${V5(e.path)}"`}return e.message}function x5(r,e,t){return e!==null?r.length>0?[e,r].join(t):e:r.length>0?r:YD}function j5(r,e={}){const n=k5(e)([r]);return new w5(n,{cause:new wt([r])})}function k5(r){return"messageBuilder"in r?r.messageBuilder:U5(r)}var HD="1.13.7",zD=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},jo=Array.prototype,au=Object.prototype,ZD=typeof Symbol<"u"?Symbol.prototype:null,q5=jo.push,Ja=jo.slice,Wa=au.toString,J5=au.hasOwnProperty,KD=typeof ArrayBuffer<"u",W5=typeof DataView<"u",Y5=Array.isArray,XD=Object.keys,QD=Object.create,eA=KD&&ArrayBuffer.isView,H5=isNaN,z5=isFinite,tA=!{toString:null}.propertyIsEnumerable("toString"),nA=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Z5=Math.pow(2,53)-1;function Mt(r,e){return e=e==null?r.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),n=Array(t),a=0;a<t;a++)n[a]=arguments[a+e];switch(e){case 0:return r.call(this,n);case 1:return r.call(this,arguments[0],n);case 2:return r.call(this,arguments[0],arguments[1],n)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=n,r.apply(this,s)}}function ir(r){var e=typeof r;return e==="function"||e==="object"&&!!r}function K5(r){return r===null}function rA(r){return r===void 0}function iA(r){return r===!0||r===!1||Wa.call(r)==="[object Boolean]"}function X5(r){return!!(r&&r.nodeType===1)}function Et(r){var e="[object "+r+"]";return function(t){return Wa.call(t)===e}}const su=Et("String"),aA=Et("Number"),Q5=Et("Date"),e2=Et("RegExp"),t2=Et("Error"),sA=Et("Symbol"),oA=Et("ArrayBuffer");var lA=Et("Function"),n2=zD.document&&zD.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof n2!="function"&&(lA=function(r){return typeof r=="function"||!1});const At=lA,dA=Et("Object");var cA=W5&&(!/\[native code\]/.test(String(DataView))||dA(new DataView(new ArrayBuffer(8)))),ou=typeof Map<"u"&&dA(new Map),r2=Et("DataView");function i2(r){return r!=null&&At(r.getInt8)&&oA(r.buffer)}const ko=cA?i2:r2,Lr=Y5||Et("Array");function ar(r,e){return r!=null&&J5.call(r,e)}var lu=Et("Arguments");(function(){lu(arguments)||(lu=function(r){return ar(r,"callee")})})();const du=lu;function a2(r){return!sA(r)&&z5(r)&&!isNaN(parseFloat(r))}function uA(r){return aA(r)&&H5(r)}function pA(r){return function(){return r}}function yA(r){return function(e){var t=r(e);return typeof t=="number"&&t>=0&&t<=Z5}}function hA(r){return function(e){return e==null?void 0:e[r]}}const qo=hA("byteLength"),s2=yA(qo);var o2=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function l2(r){return eA?eA(r)&&!ko(r):s2(r)&&o2.test(Wa.call(r))}const fA=KD?l2:pA(!1),_t=hA("length");function d2(r){for(var e={},t=r.length,n=0;n<t;++n)e[r[n]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,r.push(a)}}}function mA(r,e){e=d2(e);var t=nA.length,n=r.constructor,a=At(n)&&n.prototype||au,s="constructor";for(ar(r,s)&&!e.contains(s)&&e.push(s);t--;)s=nA[t],s in r&&r[s]!==a[s]&&!e.contains(s)&&e.push(s)}function ot(r){if(!ir(r))return[];if(XD)return XD(r);var e=[];for(var t in r)ar(r,t)&&e.push(t);return tA&&mA(r,e),e}function Ya(r){if(r==null)return!0;var e=_t(r);return typeof e=="number"&&(Lr(r)||su(r)||du(r))?e===0:_t(ot(r))===0}function TA(r,e){var t=ot(e),n=t.length;if(r==null)return!n;for(var a=Object(r),s=0;s<n;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function _e(r){if(r instanceof _e)return r;if(!(this instanceof _e))return new _e(r);this._wrapped=r}_e.VERSION=HD,_e.prototype.value=function(){return this._wrapped},_e.prototype.valueOf=_e.prototype.toJSON=_e.prototype.value,_e.prototype.toString=function(){return String(this._wrapped)};function EA(r){return new Uint8Array(r.buffer||r,r.byteOffset||0,qo(r))}var RA="[object DataView]";function cu(r,e,t,n){if(r===e)return r!==0||1/r===1/e;if(r==null||e==null)return!1;if(r!==r)return e!==e;var a=typeof r;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:gA(r,e,t,n)}function gA(r,e,t,n){r instanceof _e&&(r=r._wrapped),e instanceof _e&&(e=e._wrapped);var a=Wa.call(r);if(a!==Wa.call(e))return!1;if(cA&&a=="[object Object]"&&ko(r)){if(!ko(e))return!1;a=RA}switch(a){case"[object RegExp]":case"[object String]":return""+r==""+e;case"[object Number]":return+r!=+r?+e!=+e:+r==0?1/+r===1/e:+r==+e;case"[object Date]":case"[object Boolean]":return+r==+e;case"[object Symbol]":return ZD.valueOf.call(r)===ZD.valueOf.call(e);case"[object ArrayBuffer]":case RA:return gA(EA(r),EA(e),t,n)}var s=a==="[object Array]";if(!s&&fA(r)){var o=qo(r);if(o!==qo(e))return!1;if(r.buffer===e.buffer&&r.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof r!="object"||typeof e!="object")return!1;var l=r.constructor,p=e.constructor;if(l!==p&&!(At(l)&&l instanceof l&&At(p)&&p instanceof p)&&"constructor"in r&&"constructor"in e)return!1}t=t||[],n=n||[];for(var u=t.length;u--;)if(t[u]===r)return n[u]===e;if(t.push(r),n.push(e),s){if(u=r.length,u!==e.length)return!1;for(;u--;)if(!cu(r[u],e[u],t,n))return!1}else{var h=ot(r),f;if(u=h.length,ot(e).length!==u)return!1;for(;u--;)if(f=h[u],!(ar(e,f)&&cu(r[f],e[f],t,n)))return!1}return t.pop(),n.pop(),!0}function c2(r,e){return cu(r,e)}function Ha(r){if(!ir(r))return[];var e=[];for(var t in r)e.push(t);return tA&&mA(r,e),e}function uu(r){var e=_t(r);return function(t){if(t==null)return!1;var n=Ha(t);if(_t(n))return!1;for(var a=0;a<e;a++)if(!At(t[r[a]]))return!1;return r!==IA||!At(t[pu])}}var pu="forEach",bA="has",yu=["clear","delete"],vA=["get",bA,"set"],u2=yu.concat(pu,vA),IA=yu.concat(vA),p2=["add"].concat(yu,pu,bA);const y2=ou?uu(u2):Et("Map"),h2=ou?uu(IA):Et("WeakMap"),f2=ou?uu(p2):Et("Set"),m2=Et("WeakSet");function Ui(r){for(var e=ot(r),t=e.length,n=Array(t),a=0;a<t;a++)n[a]=r[e[a]];return n}function T2(r){for(var e=ot(r),t=e.length,n=Array(t),a=0;a<t;a++)n[a]=[e[a],r[e[a]]];return n}function DA(r){for(var e={},t=ot(r),n=0,a=t.length;n<a;n++)e[r[t[n]]]=t[n];return e}function hu(r){var e=[];for(var t in r)At(r[t])&&e.push(t);return e.sort()}function fu(r,e){return function(t){var n=arguments.length;if(e&&(t=Object(t)),n<2||t==null)return t;for(var a=1;a<n;a++)for(var s=arguments[a],o=r(s),l=o.length,p=0;p<l;p++){var u=o[p];(!e||t[u]===void 0)&&(t[u]=s[u])}return t}}const AA=fu(Ha),Jo=fu(ot),SA=fu(Ha,!0);function E2(){return function(){}}function OA(r){if(!ir(r))return{};if(QD)return QD(r);var e=E2();e.prototype=r;var t=new e;return e.prototype=null,t}function R2(r,e){var t=OA(r);return e&&Jo(t,e),t}function g2(r){return ir(r)?Lr(r)?r.slice():AA({},r):r}function b2(r,e){return e(r),r}function PA(r){return Lr(r)?r:[r]}_e.toPath=PA;function za(r){return _e.toPath(r)}function mu(r,e){for(var t=e.length,n=0;n<t;n++){if(r==null)return;r=r[e[n]]}return t?r:void 0}function CA(r,e,t){var n=mu(r,za(e));return rA(n)?t:n}function v2(r,e){e=za(e);for(var t=e.length,n=0;n<t;n++){var a=e[n];if(!ar(r,a))return!1;r=r[a]}return!!t}function Tu(r){return r}function Za(r){return r=Jo({},r),function(e){return TA(e,r)}}function Eu(r){return r=za(r),function(e){return mu(e,r)}}function Ka(r,e,t){if(e===void 0)return r;switch(t??3){case 1:return function(n){return r.call(e,n)};case 3:return function(n,a,s){return r.call(e,n,a,s)};case 4:return function(n,a,s,o){return r.call(e,n,a,s,o)}}return function(){return r.apply(e,arguments)}}function wA(r,e,t){return r==null?Tu:At(r)?Ka(r,e,t):ir(r)&&!Lr(r)?Za(r):Eu(r)}function Ru(r,e){return wA(r,e,1/0)}_e.iteratee=Ru;function Vt(r,e,t){return _e.iteratee!==Ru?_e.iteratee(r,e):wA(r,e,t)}function I2(r,e,t){e=Vt(e,t);for(var n=ot(r),a=n.length,s={},o=0;o<a;o++){var l=n[o];s[l]=e(r[l],l,r)}return s}function BA(){}function D2(r){return r==null?BA:function(e){return CA(r,e)}}function A2(r,e,t){var n=Array(Math.max(0,r));e=Ka(e,t,1);for(var a=0;a<r;a++)n[a]=e(a);return n}function gu(r,e){return e==null&&(e=r,r=0),r+Math.floor(Math.random()*(e-r+1))}const Xa=Date.now||function(){return new Date().getTime()};function MA(r){var e=function(s){return r[s]},t="(?:"+ot(r).join("|")+")",n=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,n.test(s)?s.replace(a,e):s}}const _A={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},S2=MA(_A),O2=DA(_A),P2=MA(O2),C2=_e.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var bu=/(.)^/,w2={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},B2=/\\|'|\r|\n|\u2028|\u2029/g;function M2(r){return"\\"+w2[r]}var _2=/^\s*(\w|\$)+\s*$/;function V2(r,e,t){!e&&t&&(e=t),e=SA({},e,_e.templateSettings);var n=RegExp([(e.escape||bu).source,(e.interpolate||bu).source,(e.evaluate||bu).source].join("|")+"|$","g"),a=0,s="__p+='";r.replace(n,function(u,h,f,R,v){return s+=r.slice(a,v).replace(B2,M2),a=v+u.length,h?s+=`'+
|
|
24
|
+
LIMIT 10 OFFSET 0;`,_k={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Vk={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},uD={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:i.ValueDescriptor,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",defaultValue:null,dataType:null,required:!0,index:0,parent:Vk},Nk={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},Lk={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:i.OutputMap,version:1,defaultValue:null,declaration:uD,writesValues:[],index:0,parent:Nk},Gk={id:"find-companies-with-multiple-employees-and-bank-account",type:i.Search,version:1,name:"Find companies with multiple employees and a bank account",description:"This search statement finds companies with multiple employees and an existing bank account",inputsDeclarations:[],outputsDeclarations:[uD],inputs:[],outputs:[Lk],query:Mk,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:_k},$k={type:i.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:KI},Fk={type:i.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},pD={id:V8,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:$k,parent:Fk},Uk={type:i.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:zI},xk={type:i.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},yD={id:_8,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:Uk,parent:xk},jk={type:i.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:HI},kk={type:i.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},hD={id:M8,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:jk,parent:kk},qk={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:YI},Jk={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},fD={id:B8,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:qk,parent:Jk},Wk={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:XI},Yk={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:mn},mD={id:w8,type:i.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,index:0,readsValue:Wk,parent:Yk},Hk={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ec},zk={id:KI,type:i.OutputMap,version:1,declaration:Ft.properties[0],defaultValue:null,index:0,writesValues:[pD],parent:Hk},Zk={type:i.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ec},Kk={like:!1,inferred:!1,id:"manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:Zk},Xk={type:i.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:ZI},Qk={type:i.GenericReference,id:"manager-variable-parent-ref-id",entityType:i.Project,entityId:H},TD={constant:!0,required:!0,id:Ec,type:i.VariableDeclaration,version:1,name:"Manager",dataType:Kk,description:"A variable holding an inherited manager for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:Xk,writesValues:[],inputs:[],outputs:[zk],internalCalls:[],parent:Qk,x:0,y:0},e9={type:i.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},t9={id:ZI,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[2],index:3,writesValues:[TD],parent:e9},n9={type:i.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},r9={id:zI,type:i.OutputMap,version:1,defaultValue:null,declaration:Yt.properties[0],index:2,writesValues:[yD],parent:n9},i9={type:i.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},a9={id:HI,type:i.OutputMap,version:1,defaultValue:null,declaration:bt.properties[1],index:1,writesValues:[hD],parent:i9},s9={type:i.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},o9={id:YI,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[fD],parent:s9},l9={type:i.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Ci},d9={like:!1,inferred:!1,id:"random-company-employee-test-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yt,asType:!1,isList:!1,parent:l9},c9={type:i.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:i.Project,entityId:H},u9={constant:!0,required:!0,id:Ci,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:d9,description:"A variable holding a random company employee for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[o9,a9,r9,t9],internalCalls:[],parent:c9,x:0,y:0},p9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:QI},y9={type:i.LiteralValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:C.Date,version:1,valueAsType:null,value:null,autogeneration:{type:ze.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:p9},h9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:Or},f9={id:QI,type:i.InputMap,version:1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:y9,index:5,readsValue:null,parent:h9},m9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",entityType:i.VariableDeclaration,entityId:mn},T9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:mn},E9={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},R9={id:Or,type:i.VariableInstance,version:1,defaultValue:null,declaration:m9,calledByError:[],calledByEntry:[],calledBySuccess:[T9],successCalls:[gc,oD,eD],errorCalls:[],readsValue:null,writesValues:[sD],inputs:[f9],outputs:[],internalCalls:[],parent:E9,x:0,y:0},g9={type:i.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:i.Project,entityId:H},b9={constant:!0,required:!0,id:mn,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[gc,R9],errorCalls:[],readsValue:null,writesValues:[rD],inputs:[mD,fD,hD,yD,pD],outputs:[],internalCalls:[],parent:g9,x:0,y:0},v9={type:i.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:i.VariableDeclaration,entityId:sb},I9={like:!1,inferred:!1,id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Nd,version:1,asType:!1,isList:!1,parent:v9},D9={type:i.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:i.Project,entityId:H},ED={constant:!0,required:!0,id:sb,type:i.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",defaultValue:null,dataType:I9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:D9},A9={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableInstance,entityId:WI},S9={id:XI,type:i.OutputMap,version:1,defaultValue:null,declaration:Ft.properties[0],index:0,writesValues:[mD],parent:A9},O9={type:i.GenericReference,id:"global-user-instance-parent-ref-id",entityType:i.Project,entityId:H},P9={id:WI,type:i.VariableInstance,version:1,defaultValue:null,declaration:ED,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[S9],internalCalls:[],parent:O9,x:0,y:0},C9={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},w9={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:i.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},B9={like:!1,inferred:!1,id:"is-test-environment-variable-dcl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:An,version:1,asType:!1,isList:!1,parent:C9},M9={type:i.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:i.Project,entityId:H},RD={constant:!0,required:!0,id:"is-test-environment-variable-dcl-id",type:i.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:C.Boolean,version:1,value:null,type:i.LiteralValue,autogeneration:{type:ze.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:w9},dataType:B9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:M9},_9={type:i.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},V9={id:"is-test-environment-variable-instance-id",type:i.VariableInstance,version:1,defaultValue:null,declaration:RD,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:_9,x:0,y:0},gD={type:i.Project,id:H,version:1,name:"Mocked project to compile",description:"This project is used to test all sorts of features and edge cases. It is not meant to be used in production. Or to have any functionality that makes sense",projects:[I8],entities:[Vd,Ft,Nd,bt,D0,Yt,so,Db,Ab,vi,nL,Ht,KL,_d,gw,l0,eL],functions:[k4,Zb,tc,K4,sx,uv,nc,Ud,E8,Nb,Hx],events:[r1],variableDeclarations:[RD,ED,oc,u9,TD,b9],variableInstances:[V9,P9],conditions:[],operations:[Si],functionCalls:[tG,d$],loops:[Bk,gc,oD,bk,eD],searches:[Gk]};var E=(r=>(r.Error="error",r.Warning="warning",r))(E||{}),B=(r=>(r.InvalidObjectStructure="invalid-object-structure",r.NameNotUniqueInScope="name-not-unique-in-scope",r.EmptyName="empty-name",r.MissingCaller="missing-caller",r.PropertyOverwrite="property-overwrite",r.MethodOverwrite="method-overwrite",r.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",r.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",r.UnreachableEntity="unreachable-entity",r.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",r.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",r.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",r.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",r.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",r))(B||{}),T=(r=>(r.RootReference="root-reference",r.ReferencedEntityNotFound="referenced-entity-not-found",r.EntityIdNotUnique="entity-id-not-unique",r.BuiltInEntityGenerated="built-in-entity-generated",r.BuiltInEntityUpdated="built-in-entity-updated",r.BuiltInEntityDeleted="built-in-entity-deleted",r.UnknownEntityType="unknown-entity-type",r.MissingTypeProperty="missing-type-property",r.MissingIdProperty="missing-id-property",r.BuiltInEntityParent="built-in-entity-parent",r.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",r.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",r.RecommendedImplementOperationAction="recommended-implement-operation-action",r.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",r.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",r.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",r.RecommendedImplementConditionAction="recommended-implement-condition-action",r.InvalidReferenceObjectStructure="invalid-reference-object-structure",r.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",r.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",r.InvalidParentReference="invalid-parent-reference",r.InvalidImplementsReference="invalid-implements-reference",r.InvalidExtendsReference="invalid-extends-reference",r.InvalidGenerationActionPayload="invalid-generation-action-payload",r.InvalidReference="invalid-reference",r.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",r.InvalidUpdateEntityOperation="invalid-update-entity-operation",r.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",r.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",r.UnrecognizedProperty="unrecognized-property",r.SelfReference="self-reference",r.DuplicateReference="duplicate-reference",r.CallerWithIncompatibleScope="caller-with-incompatible-scope",r.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",r.InvalidInputMapDeclaration="invalid-input-map-declaration",r.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",r.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",r.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",r.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",r.OutputOverwrite="output-overwrite",r.InputOverwrite="input-overwrite",r.IncompatibleScope="incompatible-scope",r.InvalidParentUpdate="invalid-parent-update",r.NonInteractiveEntityReferenced="non-interactive-entity-referenced",r.InvalidParentRelationType="invalid-parent-relation-type",r))(T||{}),G=(r=>(r.NoPrimaryKeyProperty="no-primary-key-property",r.ScopeWithoutLogic="scope-without-logic",r.ExtendingAbstractEntity="extending-abstract-entity",r.ImplementingNonAbstractEntity="implementing-non-abstract-entity",r.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",r.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",r.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",r.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",r.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",r.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",r.IncorrectEntityImplementation="incorrect-entity-implementation",r.IncorrectMethodImplementation="incorrect-method-implementation",r.IncorrectPropertyImplementation="incorrect-property-implementation",r.PropertyImplementsNonAbstact="property-implements-non-abstract",r.NonStaticPropertyImplementsStatic="non-static-property-implements-static",r.StaticPropertyImplementsNonStatic="static-property-implements-non-static",r.PropertyImplementsIncompatibleType="property-implements-incompatible-type",r.MissingPropertyImplementation="missing-property-implementation",r.MissingMethodImplementation="missing-method-implementation",r.NoProperties="no-properties",r.ReadingFromIncompatibleType="reading-from-incompatible-type",r.WritingToIncompatibleType="writing-to-incompatible-type",r.InvalidPropertiesCombination="invalid-properties-combination",r.DisconnectedCallableEntity="disconnected-callable-entity",r.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",r.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",r.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",r.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",r.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",r.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",r))(G||{});class g{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code}toEntityError(e){return this.code in B?new Pr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class Pr{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");c(this,"entity");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code,this.entity=e.entity}clone(){return new Pr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function N9(r){const e=new Set;return r.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function Q(r){const e=r.entity.errors.find(n=>n.id===r.id);return e?{new:!1,error:e}:{new:!0,error:new Pr(r)}}function L9(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 Me(r,e){const t=[];return e.forEach(n=>{const a=r.find(s=>s.id===n.id);a?t.push(a):t.push(n)}),t}const Va=y.union([y.string(),y.number(),y.boolean(),y.date()]),bD=y.enum([ze.CurrentDateAndTime,ze.Random,ze.Unique]),bo=y.object({type:bD,rangeStart:Va.nullable(),rangeEnd:Va.nullable()}),Na=bo.extend({type:y.literal(ze.Random),rangeStart:Va,rangeEnd:Va}),Ac=bo.extend({type:y.literal(ze.Unique),rangeStart:y.null(),rangeEnd:y.null()}),vD=bo.extend({type:y.literal(ze.CurrentDateAndTime),rangeStart:y.null(),rangeEnd:y.null()}),vo=Na.extend({rangeStart:y.number().nullable(),rangeEnd:y.number().nullable()}),ID=vo.extend({rangeStart:y.number(),rangeEnd:y.null()}),DD=vo.extend({rangeStart:y.null(),rangeEnd:y.number()}),AD=vo.extend({rangeStart:y.number(),rangeEnd:y.number()}),Io=Na.extend({rangeStart:y.number().nullable(),rangeEnd:y.number().nullable()}),SD=Io.extend({rangeStart:y.number(),rangeEnd:y.null()}),OD=Io.extend({rangeStart:y.null(),rangeEnd:y.number()}),PD=Io.extend({rangeStart:y.number(),rangeEnd:y.number()}),Do=Na.extend({rangeStart:y.date().nullable(),rangeEnd:y.date().nullable()}),CD=Do.extend({rangeStart:y.date(),rangeEnd:y.null()}),wD=Do.extend({rangeStart:y.null(),rangeEnd:y.date()}),BD=Do.extend({rangeStart:y.date(),rangeEnd:y.date()}),Sc=Na.extend({rangeStart:y.null(),rangeEnd:y.null()}),Oc=y.union([SD,OD,PD]),Pc=y.union([ID,DD,AD]),Cc=y.union([CD,wD,BD,vD]),wc=y.union([Oc,Pc,Cc,Ac,Sc]);function La(){return y.union([y.object({type:y.literal(i.ValueDescriptor)}),y.record(y.string(),y.any())])}function MD(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ValueDescriptor)})}function Bc(){return y.object({id:y.string(),type:y.literal(i.ValueDescriptor),name:y.string(),required:y.boolean()})}function G9(){return Bc().merge(y.object({version:y.number(),index:y.number()}))}function $9(){return Bc().merge(y.object({}))}function F9(){return y.object({dataType:Mr(),parent:wr()})}function U9(){return G9().merge(F9())}function Ao(){return y.union([y.object({type:y.literal(i.PrimitiveEntity)}),y.record(y.string(),y.any())])}function So(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.PrimitiveEntity)})}function Oo(){return y.object({id:y.string(),type:y.literal(i.PrimitiveEntity),name:y.string(),description:y.string().nullable(),static:y.boolean(),abstract:y.boolean()})}function x9(){return Oo().merge(y.object({version:y.number()}))}function j9(){return Oo().merge(y.object({}))}function k9(){return y.object({properties:y.array(Cr()),methods:y.array(xt()),abstractMethods:y.array(Tn()),extends:y.array(y.union([Ao(),wi()]))})}function q9(){return x9().merge(k9())}function Cr(){return y.union([y.object({type:y.literal(i.Property)}),y.record(y.string(),y.any())])}function _D(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Property)})}function Mc(){return y.object({id:y.string(),type:y.literal(i.Property),name:y.string(),description:y.string().nullable(),private:y.boolean(),static:y.boolean(),required:y.boolean(),abstract:y.boolean()})}function J9(){return Mc().merge(y.object({version:y.number(),index:y.number()}))}function W9(){return Mc().merge(y.object({}))}function Y9(){return y.object({dataType:Mr(),implements:Cr().nullable(),parent:y.union([Nr(),So(),Po()])})}function H9(){return J9().merge(Y9())}function z9(){return y.enum([F.CRON_JOB,F.EXECUTION,F.HTTP_ENDPOINT,F.PERSISTED_ENTITY,F.RELATIONAL_DATABASE])}function wi(){return y.union([y.object({type:y.literal(i.BuiltInBaseEntity)}),y.record(y.string(),y.any())])}function Po(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.BuiltInBaseEntity)})}function _c(){return y.object({id:y.string(),version:y.number(),type:y.literal(i.BuiltInBaseEntity),name:z9(),description:y.string().nullable(),abstract:y.boolean(),static:y.boolean()})}function Z9(){return _c()}function K9(){return _c().merge(y.object({}))}function X9(){return y.object({properties:y.array(Cr()),methods:y.array(xt()),abstractMethods:y.array(Tn()),extends:y.array(y.union([wi(),Ao()]))})}function Q9(){return Z9().merge(X9())}function Tn(){return y.union([y.object({type:y.literal(i.ActionDescriptor)}),y.record(y.string(),y.any())])}function wr(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ActionDescriptor)})}function Co(){return y.object({id:y.string(),type:y.literal(i.ActionDescriptor),name:y.string(),description:y.string().nullable()})}function e6(){return Co().merge(y.object({version:y.number()}))}function t6(){return Co().merge(y.object({}))}function n6(){return y.object({inputs:y.array(La()),outputs:y.array(La()),parent:y.union([Bt(),Nr(),Po(),So()]).nullable()})}function VD(){return e6().merge(n6())}function Bi(){return y.union([y.object({type:y.literal(i.Loop)}),y.record(y.string(),y.any())])}function En(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Loop)})}function ND(){return y.object({id:y.string(),type:y.literal(i.Loop)})}function r6(){return ND().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function i6(){return ND().merge(y.object({declaration:y.union([y.string(),xt()])}))}function a6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),declaration:Tn(),inputs:y.array(rn()),outputs:y.array(Dt()),outputsDeclarations:y.array(La()),successCalls:y.array(at()),errorCalls:y.array(at()),error:Dt(),body:xt(),parent:y.union([Gn(),Bt()]),breakStatements:y.array(Ni()),continueStatements:y.array(Mi())})}function s6(){return r6().merge(a6())}function Mi(){return y.union([y.object({type:y.literal(i.ContinueStatement)}),y.record(y.string(),y.any())])}function _i(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ContinueStatement)})}function Vc(){return y.object({id:y.string(),type:y.literal(i.ContinueStatement)})}function o6(){return Vc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function l6(){return Vc().merge(y.object({}))}function d6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),outputs:y.array(Vn()),throws:y.optional(Vn()),parent:En()})}function c6(){return o6().merge(d6())}function Br(){return y.union([y.object({type:y.literal(i.ReturnStatement)}),y.record(y.string(),y.any())])}function Vi(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ReturnStatement)})}function Nc(){return y.object({id:y.string(),type:y.literal(i.ReturnStatement)})}function u6(){return Nc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function p6(){return Nc().merge(y.object({}))}function y6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),outputs:y.array(Vn()),throws:y.optional(Vn()),parent:Gn()})}function h6(){return u6().merge(y6())}function Vn(){return y.union([y.object({type:y.literal(i.ReturnDeclaration)}),y.record(y.string(),y.any())])}function LD(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ReturnDeclaration)})}function Lc(){return y.object({id:y.string(),type:y.literal(i.ReturnDeclaration),name:y.string(),description:y.string().nullable(),isError:y.boolean()})}function f6(){return Lc().merge(y.object({version:y.number(),index:y.number()}))}function m6(){return Lc().merge(y.object({}))}function T6(){return y.object({dataType:Mr().nullable(),readsValue:ja().nullable(),parent:y.union([Vi(),wr(),Nn(),_i()])})}function E6(){return f6().merge(T6())}function Ni(){return y.union([y.object({type:y.literal(i.BreakStatement)}),y.record(y.string(),y.any())])}function Nn(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.BreakStatement)})}function Gc(){return y.object({id:y.string(),type:y.literal(i.BreakStatement)})}function R6(){return Gc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function g6(){return Gc().merge(y.object({}))}function b6(){return y.object({calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),outputs:y.array(Vn()),throws:y.optional(Vn()),parent:En()})}function v6(){return R6().merge(b6())}function Dt(){return y.union([y.object({type:y.literal(i.OutputMap)}),y.record(y.string(),y.any())])}function $c(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.OutputMap)})}function Fc(){return y.object({id:y.string(),type:y.literal(i.OutputMap)})}function I6(){return Fc().merge(y.object({version:y.number(),index:y.number()}))}function D6(){return Fc().merge(y.object({}))}function A6(){return y.object({writesValues:y.array(Ln()),declaration:y.union([Vn(),Cr()]),parent:y.union([$e(),En(),Nn()])})}function S6(){return I6().merge(A6())}function Li(){return y.union([y.object({type:y.literal(i.FunctionCall)}),y.record(y.string(),y.any())])}function Ga(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.FunctionCall)})}function Uc(){return y.object({id:y.string(),type:y.literal(i.FunctionCall)})}function O6(){return Uc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function P6(){return Uc().merge(y.object({}))}function C6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),writesValues:y.array(Ln()),declaration:xt(),inputs:y.array(rn()),outputs:y.array(Dt()),error:y.optional(Dt()),parent:y.union([Gn(),Bt()])})}function w6(){return O6().merge(C6())}function B6(){return y.enum([qe.Equal,qe.NotEqual,qe.MoreThan,qe.MoreThanOrEqual,qe.LessThan,qe.LessThanOrEqual,qe.And,qe.Or,Jt.Empty,Jt.NotEmpty])}function $a(){return y.union([y.object({type:y.literal(i.Condition)}),y.record(y.string(),y.any())])}function wo(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Condition)})}function xc(){return y.object({id:y.string(),type:y.literal(i.Condition)})}function M6(){return xc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function _6(){return xc().merge(y.object({}))}function V6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),leftValue:rn(),rightValue:rn().nullable(),operator:B6(),parent:y.union([Gn(),Bt()])})}function N6(){return M6().merge(V6())}function Fa(){return y.union([y.object({type:y.literal(i.Search)}),y.record(y.string(),y.any())])}function Ua(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Search)})}function jc(){return y.object({id:y.string(),type:y.literal(i.Search),name:y.string(),query:y.any(),description:y.string().nullable()})}function L6(){return jc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function G6(){return jc().merge(y.object({}))}function $6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),inputsDeclarations:y.array(Vr()),inputs:y.array(rn()),outputsDeclarations:y.array(La()),outputs:y.array(Dt()),parent:y.union([Gn(),Bt()]),error:Dt().nullable()})}function F6(){return L6().merge($6())}function xa(){return y.union([y.object({type:y.literal(i.InternalCall)}),y.record(y.string(),y.any())])}function kc(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.InternalCall)})}function qc(){return y.object({id:y.string(),type:y.literal(i.InternalCall),index:y.number()})}function U6(){return qc().merge(y.object({version:y.number(),index:y.number()}))}function x6(){return qc().merge(y.object({declaration:y.union([y.string(),xt()])}))}function j6(){return y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),writesValues:y.array(Ln()),declaration:xt(),inputs:y.array(rn()),outputs:y.array(Dt()),parent:nr(),error:y.optional(Dt())})}function k6(){return U6().merge(j6())}function rn(){return y.union([y.object({type:y.literal(i.InputMap)}),y.record(y.string(),y.any())])}function Bo(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.InputMap)})}function Jc(){return y.object({id:y.string(),type:y.literal(i.InputMap),name:y.string().nullable().optional(),description:y.string().nullable().optional()})}function q6(){return Jc().merge(y.object({version:y.number(),index:y.number()}))}function J6(){return Jc().merge(y.object({}))}function W6(){return y.object({defaultValue:Wc().nullable(),declaration:y.union([Vr(),Cr()]).nullable(),readsValue:ja().nullable(),parent:y.union([$e(),Bo(),En(),Nn()])})}function Y6(){return q6().merge(W6())}function Gi(){return y.union([y.object({type:y.literal(i.Operation)}),y.record(y.string(),y.any())])}function $i(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.Operation)})}function Mo(){return y.object({id:y.string(),type:y.literal(i.Operation)})}function H6(){return Mo().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function z6(){return Mo().merge(y.object({}))}function Z6(){return Mo().merge(y.object({successCalls:y.array(at()),errorCalls:y.array(at()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),writesValues:y.array(Ln()),declaration:Tn(),inputs:y.array(rn()),outputs:y.array(Dt()),error:y.array(Dt()),parent:y.union([Gn(),Bt()])}))}function K6(){return H6().merge(Z6())}function _o(){return y.union([y.string(),y.number(),y.boolean(),y.null(),y.date()])}function GD(){return y.record(y.string(),_o())}function X6(){return y.array(y.union([_o(),GD()]))}function $D(){return y.union([_o(),GD(),X6()])}function FD(){return y.union([_o(),$D()])}function UD(){return y.enum([C.String,C.Number,C.Boolean,C.Null,C.Date,C.KeyValue,C.Enum,C.File,C.UUID,C.EntityTemplate,C.ActionDescriptor])}function Q6(){return y.union([Nr(),$i(),ka()])}function e3(){return y.object({id:y.string(),name:UD(),type:y.literal(i.LiteralValue),value:FD(),autogeneration:wc.nullable()})}function t3(){return e3().merge(y.object({}))}function an(){return y.object({id:y.string(),version:y.number(),name:UD(),type:y.literal(i.LiteralValue),value:FD(),valueAsType:Q6().nullable(),autogeneration:wc.nullable(),parent:y.union([Yc(),Bo()])})}function n3(){return an().extend({name:y.literal(C.String),value:y.string(),autogeneration:Oc.nullable()})}function r3(){return an().extend({name:y.literal(C.Number),value:y.number(),autogeneration:Pc.nullable()})}function i3(){return an().extend({name:y.literal(C.Boolean),value:y.boolean(),autogeneration:Sc.nullable()})}function a3(){return an().extend({name:y.literal(C.Null),value:y.null(),autogeneration:y.null()})}function s3(){return an().extend({name:y.literal(C.Date),value:y.date(),autogeneration:Cc.nullable()})}function o3(){return an().extend({name:y.literal(C.KeyValue),value:$D(),autogeneration:y.null()})}function l3(){return an().extend({name:y.literal(C.Enum),value:y.string(),autogeneration:y.null()})}function d3(){return an().extend({name:y.literal(C.File),value:y.string(),autogeneration:y.null()})}function c3(){return an().extend({name:y.literal(C.UUID),value:y.string(),autogeneration:Ac.nullable()})}function u3(){return an().extend({name:y.literal(C.EntityTemplate),value:Nr(),autogeneration:y.null()})}function p3(){return an().extend({name:y.literal(C.ActionDescriptor),value:ka(),autogeneration:y.null()})}function Wc(){return y.union([n3(),r3(),i3(),a3(),s3(),o3(),l3(),d3(),c3(),u3(),p3()])}function Mr(){return y.union([y.object({type:y.literal(i.DataType)}),y.record(y.string(),y.any())])}function Yc(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.DataType)})}function Hc(){return y.object({id:y.string(),type:y.literal(i.DataType),isNullable:y.boolean(),isList:y.boolean(),constant:y.boolean(),asType:y.boolean(),options:y.array(y.string()).optional()})}function y3(){return Hc().merge(y.object({version:y.number()}))}function h3(){return Hc().merge(y.object({}))}function f3(){return y.object({defaultValue:Wc().nullable(),entity:y.union([Fi(),wi(),Ao(),Tn()]).nullable(),parent:y.union([_D(),kD(),MD()])})}function m3(){return y3().merge(f3())}function zc(){return y.union([y.object({type:y.literal(i.VariableDeclaration)}),y.record(y.string(),y.any())])}function T3(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.VariableDeclaration)})}function Zc(){return y.object({id:y.string(),type:y.literal(i.VariableDeclaration),name:y.string(),description:y.string().nullable()})}function E3(){return Zc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function R3(){return Zc().merge(y.object({}))}function g3(){return y.object({dataType:Mr().nullable(),readsValue:ja().nullable(),writesValues:y.array(Ln()),inputs:y.array(rn()),outputs:y.array(Dt()),successCalls:y.array(at()),errorCalls:y.array(at()),internalCalls:y.array(xa()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),parent:y.union([Gn(),Bt()])})}function b3(){return E3().merge(g3())}function xD(){return y.union([y.object({type:y.literal(i.VariableInstance)}),y.record(y.string(),y.any())])}function v3(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.VariableInstance)})}function Kc(){return y.object({id:y.string(),type:y.literal(i.VariableInstance)})}function I3(){return Kc().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function D3(){return Kc().merge(y.object({}))}function A3(){return y.object({declaration:zc(),dataType:Mr().nullable(),readsValue:ja().nullable(),writesValues:y.array(Ln()),inputs:y.array(rn()),outputs:y.array(Dt()),successCalls:y.array(at()),errorCalls:y.array(at()),internalCalls:y.array(xa()),calledBySuccess:y.array($e()),calledByError:y.array($e()),calledByEntry:y.array(nt()),parent:y.union([Gn(),Bt()])})}function S3(){return I3().merge(A3())}function Xc(){return y.union([y.object({type:y.literal(i.InstalledProject)}),y.record(y.string(),y.any())])}function Vo(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.InstalledProject)})}function O3(){return y.object({id:y.string(),type:y.literal(i.InstalledProject)})}function P3(){return y.object({version:y.number(),x:y.number(),y:y.number()})}function C3(){return y.object({})}function w3(){return y.object({implements:Bt(),description:y.string().nullable(),functions:y.array(xt()),events:y.array(Qc()),parent:Bt()})}function B3(){return P3().merge(w3())}function Qc(){return y.union([y.object({type:y.literal(i.GlobalEvent)}),y.record(y.string(),y.any())])}function M3(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.GlobalEvent)})}function No(){return y.object({id:y.string(),type:y.literal(i.GlobalEvent),name:y.string(),collapsed:y.boolean()})}function _3(){return No().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function V3(){return No().merge(y.object({}))}function N3(){return No().merge(y.object({returnStatements:y.array(Br()),implements:y.array(VD()),inputs:y.array(Vr()),calls:y.array(at()),parent:y.union([Bt(),Vo()])}))}function L3(){return _3().merge(N3())}function _r(){return y.union([zc(),xD()])}function nr(){return y.union([T3(),v3()])}function Ln(){return y.union([_r(),rn(),Vn()])}function jD(){return y.union([nr(),Bo(),LD()])}function ja(){return y.union([_r(),Vr(),Dt(),Gi(),xa(),Li()])}function G3(){return y.union([nr(),eu(),$c(),$i(),kc(),Ga()])}function $3(){return y.union([Vr(),Dt(),Ln()])}function kD(){return y.union([eu(),$c(),jD()])}function Lo(){return Qc()}function Go(){return M3()}function $o(){return y.union([Gi(),Li(),$a(),Fa(),_r(),xa(),Bi()])}function $e(){return y.union([$i(),Ga(),wo(),Ua(),nr(),kc(),En()])}function Fo(){return y.union([Gi(),Li(),$a(),Fa(),_r(),Bi()])}function Uo(){return y.union([$i(),Ga(),wo(),Ua(),nr(),En()])}function qD(){return y.union([$o(),Br(),Ni(),Mi()])}function at(){return y.union([$e(),Vi(),Nn(),_i()])}function JD(){return y.union([Fo(),Br(),Ni(),Mi()])}function WD(){return y.union([Uo(),Vi(),Nn(),_i()])}function rr(){return y.union([xt(),Lo()])}function nt(){return y.union([ka(),Go()])}function F3(){return y.union([$o(),rr()])}function U3(){return y.union([$e(),nt()])}function x3(){return y.union([Fo(),rr()])}function j3(){return y.union([Uo(),nt()])}function k3(){return y.union([qD(),rr()])}function q3(){return y.union([at(),nt()])}function J3(){return y.union([JD(),rr()])}function W3(){return y.union([WD(),nt()])}function Y3(){return y.union([rr(),Bi()])}function Gn(){return y.union([nt(),En()])}function H3(){return y.union([$o(),rr()])}function z3(){return y.union([$e(),nt()])}function Z3(){return y.union([Fo(),rr()])}function K3(){return y.union([Uo(),nt()])}function X3(){return y.union([Br(),Ni(),Mi()])}function Q3(){return y.union([Vi(),Nn(),_i()])}function e5(){return y.union([wi(),p5(),Xc(),Fi(),xt(),Lo(),_r(),rn(),Dt(),$a(),Gi(),Li(),Vn(),Vr(),Ao(),Mr(),Cr(),Tn(),Br(),Mi(),Ni(),Bi(),Fa(),Tn(),Tn(),La(),xa()])}function t5(){return y.union([Po(),Bt(),Vo(),Nr(),ka(),Go(),nr(),Bo(),$c(),wo(),$i(),Ga(),LD(),eu(),So(),Yc(),_D(),wr(),Vi(),_i(),Nn(),En(),Ua(),wr(),wr(),MD(),kc()])}function n5(){return y.union([Xc(),Fi(),xt(),Lo(),_r(),$a(),Gi(),Li(),Br(),Mi(),Ni(),Bi(),Fa()])}function r5(){return y.union([Vo(),Nr(),ka(),Go(),nr(),wo(),$i(),Ga(),Vi(),_i(),Nn(),En(),Ua()])}function Vr(){return y.union([y.object({type:y.literal(i.ArgumentDeclaration)}),y.record(y.string(),y.any())])}function eu(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.ArgumentDeclaration)})}function tu(){return y.object({id:y.string(),type:y.literal(i.ArgumentDeclaration)})}function i5(){return tu().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function a5(){return tu().merge(y.object({}))}function s5(){return y.object({dataType:Mr().nullable(),writesValues:y.array(Ln()),parent:y.union([nt(),wr(),wr(),Ua(),Nn()])})}function o5(){return i5().merge(s5())}function xt(){return y.union([y.object({type:y.literal(i.FunctionDeclaration)}),y.record(y.string(),y.any())])}function ka(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.FunctionDeclaration)})}function nu(){return y.object({id:y.string(),type:y.literal(i.FunctionDeclaration),name:y.string(),description:y.string().nullable()})}function l5(){return nu().merge(y.object({version:y.number(),x:y.number(),y:y.number(),index:y.number().nullable()}))}function d5(){return nu()}function c5(){return y.object({inputs:y.array(Vr()),implements:Tn().nullable(),returnStatements:y.array(Br()),parent:y.union([Bt(),Vo(),Nr(),En(),Po(),So()])})}function u5(){return l5().merge(c5())}function p5(){return y.union([y.object({type:y.literal(i.Project)}),y.record(y.string(),y.any())])}function Bt(){return y.object({entityType:y.literal(i.Project),entityId:y.string(),id:y.string(),type:y.literal(i.GenericReference)})}function ru(){return y.object({id:y.string(),type:y.literal(i.Project),name:y.string(),description:y.string().nullable()})}function y5(){return ru().merge(y.object({version:y.number()}))}function h5(){return ru()}function f5(){return y.object({entities:y.array(Fi()),functions:y.array(xt()),events:y.array(Qc()),projects:y.array(Xc()),variableDeclarations:y.array(zc()),variableInstances:y.array(xD()),conditions:y.array($a()),operations:y.array(Gi()),functionCalls:y.array(Li()),loops:y.array(Bi()),searches:y.array(Fa())})}function m5(){return y5().merge(f5())}function Fi(){return y.union([y.object({type:y.literal(i.DefinitionEntity)}),y.record(y.string(),y.any())])}function Nr(){return y.object({id:y.string(),type:y.literal(i.GenericReference),entityId:y.string(),entityType:y.literal(i.DefinitionEntity)})}function iu(){return y.object({id:y.string(),type:y.literal(i.DefinitionEntity),name:y.string(),description:y.string().nullable(),static:y.boolean(),abstract:y.boolean()})}function T5(){return iu().merge(y.object({version:y.number(),x:y.number(),y:y.number()}))}function E5(){return iu().merge(y.object({}))}function R5(){return y.union([Bt(),Yc()])}function g5(){return y.object({properties:y.array(Cr()),methods:y.array(xt()),abstractMethods:y.array(Tn()),extends:y.array(y.union([Fi(),wi()])),implements:y.array(y.union([Fi(),wi()])),parent:R5()})}function b5(){return T5().merge(g5())}function v5(r){const e=b5(),t=r.toJSON();e.safeParse(t).success;const a=r.implements.flatMap(h=>A5(r,h)),s=r.extends.flatMap(h=>S5(r,h)),o=P5(r),l=O5(r);r.methods.flatMap(h=>h.validate());const p=[...a,...s,...o,...l];return Me(r.errors,p)}function I5(r,e){const t=e.properties.filter(s=>s.abstract),n=[];let a=[...r.properties];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):n.push(s)}),n}function D5(r,e){const t=e.abstractMethods,n=[];let a=[...r.methods];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):n.push(s)}),n}function A5(r,e){const t=[];if(!e.abstract){const h=Q({id:r.id+"--"+G.ImplementingNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:G.ImplementingNonAbstractEntity,entity:r});return t.push(h.error),t}const n=e.properties.filter(h=>h.abstract),a=[];let s=[...r.properties];n.forEach(h=>{const f=s.find(R=>{var v;return((v=R.implements)==null?void 0:v.id)===h.id});f?s=s.filter(R=>R.id!==f.id):a.push(h)}),a.length&&a.forEach(h=>{const f=Q({id:r.id+"--"+G.MissingPropertyImplementation+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:E.Error,code:G.MissingPropertyImplementation,entity:r});t.push(f.error)});const o=[];let l=[...r.methods];e.abstractMethods.forEach(h=>{const f=l.find(R=>{var v;return((v=R.implements)==null?void 0:v.id)===h.id});f?l=l.filter(R=>R.id!==f.id):o.push(h)}),o.length&&o.forEach(h=>{const f=Q({id:r.id+"--"+G.MissingMethodImplementation+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:E.Error,code:G.MissingMethodImplementation,entity:r});t.push(f.error)});const p=[];e.properties.forEach(h=>{const f=s.find(R=>R.name===h.name);f&&p.push([f,h])}),p.length&&p.forEach(([h])=>{const f=Q({id:r.id+"--"+B.PropertyOverwrite+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.PropertyOverwrite,entity:r});t.push(f.error)});const u=[];return e.methods.forEach(h=>{const f=l.find(R=>R.name===h.name);f&&u.push([f,h])}),u.length&&u.forEach(([h])=>{const f=Q({id:r.id+"--"+B.MethodOverwrite+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.MethodOverwrite,entity:r});t.push(f.error)}),t}function S5(r,e){const t=[],n=[];if(e.abstract){const s=Q({id:r.id+"--"+G.ExtendingAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:G.ExtendingAbstractEntity,entity:r});return t.push(s.error),t}r.properties.forEach(s=>{var l;const o=e.properties.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&n.push(s)}),n.length&&n.forEach(s=>{const o=Q({id:r.id+"--"+B.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.PropertyOverwrite,entity:r});t.push(o.error)});const a=[];return r.methods.forEach(s=>{var l;const o=e.methods.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=Q({id:r.id+"--"+B.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:E.Error,code:B.MethodOverwrite,entity:r});t.push(o.error)}),t}function O5(r){const e=[];if(!r.properties.length){const t=Q({id:r.id+"--"+G.NoProperties,message:"No properties implemented",issue:null,severity:E.Warning,code:G.NoProperties,entity:r});e.push(t.error)}return r.properties.forEach(t=>{t.validate()}),e}function P5(r){const e=[];if(r.abstract){if(r.methods.length){const t=Q({id:r.id+"--"+G.AbstractEntityWithNonAbstractMethods,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:E.Error,code:G.AbstractEntityWithNonAbstractMethods,entity:r});e.push(t.error)}if(r.properties.some(t=>!t.abstract)){const t=Q({id:r.id+"--"+G.AbstractEntityWithNonAbstractProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:E.Error,code:G.AbstractEntityWithNonAbstractProperties,entity:r});e.push(t.error),r.properties.forEach(n=>{if(!n.abstract){const a=Q({id:r.id+"--"+G.StaticEntityWithNonStaticProperties+"--"+n.id,message:`Property "${n.name}" with id "${n.id}" of entity "${r.name}" with id "${r.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:E.Error,code:G.StaticEntityWithNonStaticProperties,entity:r});e.push(a.error)}})}}else{if(r.abstractMethods.length){const t=Q({id:r.id+"--"+G.AbstractPropertyInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract methods`,issue:null,severity:E.Error,code:G.AbstractPropertyInNonAbstractEntity,entity:r});e.push(t.error)}if(r.properties.some(t=>t.abstract)){const t=Q({id:r.id+"--"+G.AbstractMethodInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract properties`,issue:null,severity:E.Error,code:G.AbstractMethodInNonAbstractEntity,entity:r});e.push(t.error),r.properties.forEach(n=>{if(n.abstract){const a=Q({id:r.id+"--"+G.AbstractMethodInNonAbstractEntity+"--"+n.id,message:`Property "${n.name}" with id "${n.id}" of entity "${r.name}" with id "${r.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:E.Error,code:G.AbstractMethodInNonAbstractEntity,entity:r});e.push(a.error)}})}}if(r.static&&r.properties.some(t=>!t.static)){const t=Q({id:r.id+"--"+G.StaticEntityWithNonStaticProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as static but has non-static properties`,issue:null,severity:E.Error,code:G.StaticEntityWithNonStaticProperties,entity:r});e.push(t.error),r.properties.forEach(n=>{if(!n.static){const a=Q({id:r.id+"--"+G.NonStaticPropertyInStaticEntity+"--"+n.id,message:`Property "${n.name}" with id "${n.id}" of entity "${r.name}" with id "${r.id}" is not marked as static but the entity is marked as static`,issue:null,severity:E.Error,code:G.NonStaticPropertyInStaticEntity,entity:r});e.push(a.error)}})}return e}function C5(r){return r instanceof Error&&r.name==="ZodError"&&"issues"in r&&Array.isArray(r.issues)}var w5=class extends Error{constructor(e,t){super(e,t);c(this,"name");c(this,"details");this.name="ZodValidationError",this.details=B5(t)}toString(){return this.message}};function B5(r){if(r){const e=r.cause;if(C5(e))return e.issues}return[]}function M5(r){return r.length!==0}var _5=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function V5(r){return r.length===1?r[0].toString():r.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+N5(t)+'"]';if(!_5.test(t))return e+'["'+t+'"]';const n=e.length===0?"":".";return e+n+t},"")}function N5(r){return r.replace(/"/g,'\\"')}var L5="; ",G5=99,YD="Validation error",$5=": ",F5=", or ";function U5(r={}){const{issueSeparator:e=L5,unionSeparator:t=F5,prefixSeparator:n=$5,prefix:a=YD,includePath:s=!0,maxIssuesInMessage:o=G5}=r;return l=>{const p=l.slice(0,o).map(u=>xo({issue:u,issueSeparator:e,unionSeparator:t,includePath:s})).join(e);return x5(p,a,n)}}function xo(r){const{issue:e,issueSeparator:t,unionSeparator:n,includePath:a}=r;if(e.code===N.invalid_union)return e.unionErrors.reduce((s,o)=>{const l=o.issues.map(p=>xo({issue:p,issueSeparator:t,unionSeparator:n,includePath:a})).join(t);return s.includes(l)||s.push(l),s},[]).join(n);if(e.code===N.invalid_arguments)return[e.message,...e.argumentsError.issues.map(s=>xo({issue:s,issueSeparator:t,unionSeparator:n,includePath:a}))].join(t);if(e.code===N.invalid_return_type)return[e.message,...e.returnTypeError.issues.map(s=>xo({issue:s,issueSeparator:t,unionSeparator:n,includePath:a}))].join(t);if(a&&M5(e.path)){if(e.path.length===1){const s=e.path[0];if(typeof s=="number")return`${e.message} at index ${s}`}return`${e.message} at "${V5(e.path)}"`}return e.message}function x5(r,e,t){return e!==null?r.length>0?[e,r].join(t):e:r.length>0?r:YD}function j5(r,e={}){const n=k5(e)([r]);return new w5(n,{cause:new wt([r])})}function k5(r){return"messageBuilder"in r?r.messageBuilder:U5(r)}var HD="1.13.7",zD=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},jo=Array.prototype,au=Object.prototype,ZD=typeof Symbol<"u"?Symbol.prototype:null,q5=jo.push,qa=jo.slice,Ja=au.toString,J5=au.hasOwnProperty,KD=typeof ArrayBuffer<"u",W5=typeof DataView<"u",Y5=Array.isArray,XD=Object.keys,QD=Object.create,eA=KD&&ArrayBuffer.isView,H5=isNaN,z5=isFinite,tA=!{toString:null}.propertyIsEnumerable("toString"),nA=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Z5=Math.pow(2,53)-1;function Mt(r,e){return e=e==null?r.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),n=Array(t),a=0;a<t;a++)n[a]=arguments[a+e];switch(e){case 0:return r.call(this,n);case 1:return r.call(this,arguments[0],n);case 2:return r.call(this,arguments[0],arguments[1],n)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=n,r.apply(this,s)}}function ir(r){var e=typeof r;return e==="function"||e==="object"&&!!r}function K5(r){return r===null}function rA(r){return r===void 0}function iA(r){return r===!0||r===!1||Ja.call(r)==="[object Boolean]"}function X5(r){return!!(r&&r.nodeType===1)}function Et(r){var e="[object "+r+"]";return function(t){return Ja.call(t)===e}}const su=Et("String"),aA=Et("Number"),Q5=Et("Date"),e2=Et("RegExp"),t2=Et("Error"),sA=Et("Symbol"),oA=Et("ArrayBuffer");var lA=Et("Function"),n2=zD.document&&zD.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof n2!="function"&&(lA=function(r){return typeof r=="function"||!1});const At=lA,dA=Et("Object");var cA=W5&&(!/\[native code\]/.test(String(DataView))||dA(new DataView(new ArrayBuffer(8)))),ou=typeof Map<"u"&&dA(new Map),r2=Et("DataView");function i2(r){return r!=null&&At(r.getInt8)&&oA(r.buffer)}const ko=cA?i2:r2,Lr=Y5||Et("Array");function ar(r,e){return r!=null&&J5.call(r,e)}var lu=Et("Arguments");(function(){lu(arguments)||(lu=function(r){return ar(r,"callee")})})();const du=lu;function a2(r){return!sA(r)&&z5(r)&&!isNaN(parseFloat(r))}function uA(r){return aA(r)&&H5(r)}function pA(r){return function(){return r}}function yA(r){return function(e){var t=r(e);return typeof t=="number"&&t>=0&&t<=Z5}}function hA(r){return function(e){return e==null?void 0:e[r]}}const qo=hA("byteLength"),s2=yA(qo);var o2=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function l2(r){return eA?eA(r)&&!ko(r):s2(r)&&o2.test(Ja.call(r))}const fA=KD?l2:pA(!1),_t=hA("length");function d2(r){for(var e={},t=r.length,n=0;n<t;++n)e[r[n]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,r.push(a)}}}function mA(r,e){e=d2(e);var t=nA.length,n=r.constructor,a=At(n)&&n.prototype||au,s="constructor";for(ar(r,s)&&!e.contains(s)&&e.push(s);t--;)s=nA[t],s in r&&r[s]!==a[s]&&!e.contains(s)&&e.push(s)}function ot(r){if(!ir(r))return[];if(XD)return XD(r);var e=[];for(var t in r)ar(r,t)&&e.push(t);return tA&&mA(r,e),e}function Wa(r){if(r==null)return!0;var e=_t(r);return typeof e=="number"&&(Lr(r)||su(r)||du(r))?e===0:_t(ot(r))===0}function TA(r,e){var t=ot(e),n=t.length;if(r==null)return!n;for(var a=Object(r),s=0;s<n;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function _e(r){if(r instanceof _e)return r;if(!(this instanceof _e))return new _e(r);this._wrapped=r}_e.VERSION=HD,_e.prototype.value=function(){return this._wrapped},_e.prototype.valueOf=_e.prototype.toJSON=_e.prototype.value,_e.prototype.toString=function(){return String(this._wrapped)};function EA(r){return new Uint8Array(r.buffer||r,r.byteOffset||0,qo(r))}var RA="[object DataView]";function cu(r,e,t,n){if(r===e)return r!==0||1/r===1/e;if(r==null||e==null)return!1;if(r!==r)return e!==e;var a=typeof r;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:gA(r,e,t,n)}function gA(r,e,t,n){r instanceof _e&&(r=r._wrapped),e instanceof _e&&(e=e._wrapped);var a=Ja.call(r);if(a!==Ja.call(e))return!1;if(cA&&a=="[object Object]"&&ko(r)){if(!ko(e))return!1;a=RA}switch(a){case"[object RegExp]":case"[object String]":return""+r==""+e;case"[object Number]":return+r!=+r?+e!=+e:+r==0?1/+r===1/e:+r==+e;case"[object Date]":case"[object Boolean]":return+r==+e;case"[object Symbol]":return ZD.valueOf.call(r)===ZD.valueOf.call(e);case"[object ArrayBuffer]":case RA:return gA(EA(r),EA(e),t,n)}var s=a==="[object Array]";if(!s&&fA(r)){var o=qo(r);if(o!==qo(e))return!1;if(r.buffer===e.buffer&&r.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof r!="object"||typeof e!="object")return!1;var l=r.constructor,p=e.constructor;if(l!==p&&!(At(l)&&l instanceof l&&At(p)&&p instanceof p)&&"constructor"in r&&"constructor"in e)return!1}t=t||[],n=n||[];for(var u=t.length;u--;)if(t[u]===r)return n[u]===e;if(t.push(r),n.push(e),s){if(u=r.length,u!==e.length)return!1;for(;u--;)if(!cu(r[u],e[u],t,n))return!1}else{var h=ot(r),f;if(u=h.length,ot(e).length!==u)return!1;for(;u--;)if(f=h[u],!(ar(e,f)&&cu(r[f],e[f],t,n)))return!1}return t.pop(),n.pop(),!0}function c2(r,e){return cu(r,e)}function Ya(r){if(!ir(r))return[];var e=[];for(var t in r)e.push(t);return tA&&mA(r,e),e}function uu(r){var e=_t(r);return function(t){if(t==null)return!1;var n=Ya(t);if(_t(n))return!1;for(var a=0;a<e;a++)if(!At(t[r[a]]))return!1;return r!==IA||!At(t[pu])}}var pu="forEach",bA="has",yu=["clear","delete"],vA=["get",bA,"set"],u2=yu.concat(pu,vA),IA=yu.concat(vA),p2=["add"].concat(yu,pu,bA);const y2=ou?uu(u2):Et("Map"),h2=ou?uu(IA):Et("WeakMap"),f2=ou?uu(p2):Et("Set"),m2=Et("WeakSet");function Ui(r){for(var e=ot(r),t=e.length,n=Array(t),a=0;a<t;a++)n[a]=r[e[a]];return n}function T2(r){for(var e=ot(r),t=e.length,n=Array(t),a=0;a<t;a++)n[a]=[e[a],r[e[a]]];return n}function DA(r){for(var e={},t=ot(r),n=0,a=t.length;n<a;n++)e[r[t[n]]]=t[n];return e}function hu(r){var e=[];for(var t in r)At(r[t])&&e.push(t);return e.sort()}function fu(r,e){return function(t){var n=arguments.length;if(e&&(t=Object(t)),n<2||t==null)return t;for(var a=1;a<n;a++)for(var s=arguments[a],o=r(s),l=o.length,p=0;p<l;p++){var u=o[p];(!e||t[u]===void 0)&&(t[u]=s[u])}return t}}const AA=fu(Ya),Jo=fu(ot),SA=fu(Ya,!0);function E2(){return function(){}}function OA(r){if(!ir(r))return{};if(QD)return QD(r);var e=E2();e.prototype=r;var t=new e;return e.prototype=null,t}function R2(r,e){var t=OA(r);return e&&Jo(t,e),t}function g2(r){return ir(r)?Lr(r)?r.slice():AA({},r):r}function b2(r,e){return e(r),r}function PA(r){return Lr(r)?r:[r]}_e.toPath=PA;function Ha(r){return _e.toPath(r)}function mu(r,e){for(var t=e.length,n=0;n<t;n++){if(r==null)return;r=r[e[n]]}return t?r:void 0}function CA(r,e,t){var n=mu(r,Ha(e));return rA(n)?t:n}function v2(r,e){e=Ha(e);for(var t=e.length,n=0;n<t;n++){var a=e[n];if(!ar(r,a))return!1;r=r[a]}return!!t}function Tu(r){return r}function za(r){return r=Jo({},r),function(e){return TA(e,r)}}function Eu(r){return r=Ha(r),function(e){return mu(e,r)}}function Za(r,e,t){if(e===void 0)return r;switch(t??3){case 1:return function(n){return r.call(e,n)};case 3:return function(n,a,s){return r.call(e,n,a,s)};case 4:return function(n,a,s,o){return r.call(e,n,a,s,o)}}return function(){return r.apply(e,arguments)}}function wA(r,e,t){return r==null?Tu:At(r)?Za(r,e,t):ir(r)&&!Lr(r)?za(r):Eu(r)}function Ru(r,e){return wA(r,e,1/0)}_e.iteratee=Ru;function Vt(r,e,t){return _e.iteratee!==Ru?_e.iteratee(r,e):wA(r,e,t)}function I2(r,e,t){e=Vt(e,t);for(var n=ot(r),a=n.length,s={},o=0;o<a;o++){var l=n[o];s[l]=e(r[l],l,r)}return s}function BA(){}function D2(r){return r==null?BA:function(e){return CA(r,e)}}function A2(r,e,t){var n=Array(Math.max(0,r));e=Za(e,t,1);for(var a=0;a<r;a++)n[a]=e(a);return n}function gu(r,e){return e==null&&(e=r,r=0),r+Math.floor(Math.random()*(e-r+1))}const Ka=Date.now||function(){return new Date().getTime()};function MA(r){var e=function(s){return r[s]},t="(?:"+ot(r).join("|")+")",n=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,n.test(s)?s.replace(a,e):s}}const _A={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},S2=MA(_A),O2=DA(_A),P2=MA(O2),C2=_e.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var bu=/(.)^/,w2={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},B2=/\\|'|\r|\n|\u2028|\u2029/g;function M2(r){return"\\"+w2[r]}var _2=/^\s*(\w|\$)+\s*$/;function V2(r,e,t){!e&&t&&(e=t),e=SA({},e,_e.templateSettings);var n=RegExp([(e.escape||bu).source,(e.interpolate||bu).source,(e.evaluate||bu).source].join("|")+"|$","g"),a=0,s="__p+='";r.replace(n,function(u,h,f,R,v){return s+=r.slice(a,v).replace(B2,M2),a=v+u.length,h?s+=`'+
|
|
25
25
|
((__t=(`+h+`))==null?'':_.escape(__t))+
|
|
26
26
|
'`:f?s+=`'+
|
|
27
27
|
((__t=(`+f+`))==null?'':__t)+
|
|
@@ -33,7 +33,7 @@ __p+='`),u}),s+=`';
|
|
|
33
33
|
`,o="obj";s=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
|
|
34
34
|
`+s+`return __p;
|
|
35
35
|
`;var l;try{l=new Function(o,"_",s)}catch(u){throw u.source=s,u}var p=function(u){return l.call(this,u,_e)};return p.source="function("+o+`){
|
|
36
|
-
`+s+"}",p}function N2(r,e,t){e=za(e);var n=e.length;if(!n)return At(t)?t.call(r):t;for(var a=0;a<n;a++){var s=r==null?void 0:r[e[a]];s===void 0&&(s=t,a=n),r=At(s)?s.call(r):s}return r}var L2=0;function G2(r){var e=++L2+"";return r?r+e:e}function $2(r){var e=_e(r);return e._chain=!0,e}function VA(r,e,t,n,a){if(!(n instanceof e))return r.apply(t,a);var s=OA(r.prototype),o=r.apply(s,a);return ir(o)?o:s}var xi=Mt(function(r,e){var t=xi.placeholder,n=function(){for(var a=0,s=e.length,o=Array(s),l=0;l<s;l++)o[l]=e[l]===t?arguments[a++]:e[l];for(;a<arguments.length;)o.push(arguments[a++]);return VA(r,n,this,this,o)};return n});xi.placeholder=_e;const NA=Mt(function(r,e,t){if(!At(r))throw new TypeError("Bind must be called on a function");var n=Mt(function(a){return VA(r,n,e,this,t.concat(a))});return n}),jt=yA(_t);function Gr(r,e,t,n){if(n=n||[],!e&&e!==0)e=1/0;else if(e<=0)return n.concat(r);for(var a=n.length,s=0,o=_t(r);s<o;s++){var l=r[s];if(jt(l)&&(Lr(l)||du(l)))if(e>1)Gr(l,e-1,t,n),a=n.length;else for(var p=0,u=l.length;p<u;)n[a++]=l[p++];else t||(n[a++]=l)}return n}const F2=Mt(function(r,e){e=Gr(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var n=e[t];r[n]=NA(r[n],r)}return r});function U2(r,e){var t=function(n){var a=t.cache,s=""+(e?e.apply(this,arguments):n);return ar(a,s)||(a[s]=r.apply(this,arguments)),a[s]};return t.cache={},t}const LA=Mt(function(r,e,t){return setTimeout(function(){return r.apply(null,t)},e)}),x2=xi(LA,_e,1);function j2(r,e,t){var n,a,s,o,l=0;t||(t={});var p=function(){l=t.leading===!1?0:Xa(),n=null,o=r.apply(a,s),n||(a=s=null)},u=function(){var h=Xa();!l&&t.leading===!1&&(l=h);var f=e-(h-l);return a=this,s=arguments,f<=0||f>e?(n&&(clearTimeout(n),n=null),l=h,o=r.apply(a,s),n||(a=s=null)):!n&&t.trailing!==!1&&(n=setTimeout(p,f)),o};return u.cancel=function(){clearTimeout(n),l=0,n=a=s=null},u}function k2(r,e,t){var n,a,s,o,l,p=function(){var h=Xa()-a;e>h?n=setTimeout(p,e-h):(n=null,t||(o=r.apply(l,s)),n||(s=l=null))},u=Mt(function(h){return l=this,s=h,a=Xa(),n||(n=setTimeout(p,e),t&&(o=r.apply(l,s))),o});return u.cancel=function(){clearTimeout(n),n=s=l=null},u}function q2(r,e){return xi(e,r)}function vu(r){return function(){return!r.apply(this,arguments)}}function J2(){var r=arguments,e=r.length-1;return function(){for(var t=e,n=r[e].apply(this,arguments);t--;)n=r[t].call(this,n);return n}}function W2(r,e){return function(){if(--r<1)return e.apply(this,arguments)}}function GA(r,e){var t;return function(){return--r>0&&(t=e.apply(this,arguments)),r<=1&&(e=null),t}}const Y2=xi(GA,2);function $A(r,e,t){e=Vt(e,t);for(var n=ot(r),a,s=0,o=n.length;s<o;s++)if(a=n[s],e(r[a],a,r))return a}function FA(r){return function(e,t,n){t=Vt(t,n);for(var a=_t(e),s=r>0?0:a-1;s>=0&&s<a;s+=r)if(t(e[s],s,e))return s;return-1}}const Iu=FA(1),UA=FA(-1);function xA(r,e,t,n){t=Vt(t,n,1);for(var a=t(e),s=0,o=_t(r);s<o;){var l=Math.floor((s+o)/2);t(r[l])<a?s=l+1:o=l}return s}function jA(r,e,t){return function(n,a,s){var o=0,l=_t(n);if(typeof s=="number")r>0?o=s>=0?s:Math.max(s+l,o):l=s>=0?Math.min(s+1,l):s+l+1;else if(t&&s&&l)return s=t(n,a),n[s]===a?s:-1;if(a!==a)return s=e(Ja.call(n,o,l),uA),s>=0?s+o:-1;for(s=r>0?o:l-1;s>=0&&s<l;s+=r)if(n[s]===a)return s;return-1}}const kA=jA(1,Iu,xA),H2=jA(-1,UA);function Du(r,e,t){var n=jt(r)?Iu:$A,a=n(r,e,t);if(a!==void 0&&a!==-1)return r[a]}function z2(r,e){return Du(r,Za(e))}function $n(r,e,t){e=Ka(e,t);var n,a;if(jt(r))for(n=0,a=r.length;n<a;n++)e(r[n],n,r);else{var s=ot(r);for(n=0,a=s.length;n<a;n++)e(r[s[n]],s[n],r)}return r}function $r(r,e,t){e=Vt(e,t);for(var n=!jt(r)&&ot(r),a=(n||r).length,s=Array(a),o=0;o<a;o++){var l=n?n[o]:o;s[o]=e(r[l],l,r)}return s}function qA(r){var e=function(t,n,a,s){var o=!jt(t)&&ot(t),l=(o||t).length,p=r>0?0:l-1;for(s||(a=t[o?o[p]:p],p+=r);p>=0&&p<l;p+=r){var u=o?o[p]:p;a=n(a,t[u],u,t)}return a};return function(t,n,a,s){var o=arguments.length>=3;return e(t,Ka(n,s,4),a,o)}}const Au=qA(1),JA=qA(-1);function ji(r,e,t){var n=[];return e=Vt(e,t),$n(r,function(a,s,o){e(a,s,o)&&n.push(a)}),n}function Z2(r,e,t){return ji(r,vu(Vt(e)),t)}function WA(r,e,t){e=Vt(e,t);for(var n=!jt(r)&&ot(r),a=(n||r).length,s=0;s<a;s++){var o=n?n[s]:s;if(!e(r[o],o,r))return!1}return!0}function YA(r,e,t){e=Vt(e,t);for(var n=!jt(r)&&ot(r),a=(n||r).length,s=0;s<a;s++){var o=n?n[s]:s;if(e(r[o],o,r))return!0}return!1}function Fn(r,e,t,n){return jt(r)||(r=Ui(r)),(typeof t!="number"||n)&&(t=0),kA(r,e,t)>=0}const K2=Mt(function(r,e,t){var n,a;return At(e)?a=e:(e=za(e),n=e.slice(0,-1),e=e[e.length-1]),$r(r,function(s){var o=a;if(!o){if(n&&n.length&&(s=mu(s,n)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function Su(r,e){return $r(r,Eu(e))}function X2(r,e){return ji(r,Za(e))}function HA(r,e,t){var n=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=jt(r)?r:Ui(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s>n&&(n=s)}else e=Vt(e,t),$n(r,function(u,h,f){o=e(u,h,f),(o>a||o===-1/0&&n===-1/0)&&(n=u,a=o)});return n}function Q2(r,e,t){var n=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=jt(r)?r:Ui(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s<n&&(n=s)}else e=Vt(e,t),$n(r,function(u,h,f){o=e(u,h,f),(o<a||o===1/0&&n===1/0)&&(n=u,a=o)});return n}var e7=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function zA(r){return r?Lr(r)?Ja.call(r):su(r)?r.match(e7):jt(r)?$r(r,Tu):Ui(r):[]}function ZA(r,e,t){if(e==null||t)return jt(r)||(r=Ui(r)),r[gu(r.length-1)];var n=zA(r),a=_t(n);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var l=gu(o,s),p=n[o];n[o]=n[l],n[l]=p}return n.slice(0,e)}function t7(r){return ZA(r,1/0)}function n7(r,e,t){var n=0;return e=Vt(e,t),Su($r(r,function(a,s,o){return{value:a,index:n++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,l=s.criteria;if(o!==l){if(o>l||o===void 0)return 1;if(o<l||l===void 0)return-1}return a.index-s.index}),"value")}function Wo(r,e){return function(t,n,a){var s=e?[[],[]]:{};return n=Vt(n,a),$n(t,function(o,l){var p=n(o,l,t);r(s,o,p)}),s}}const r7=Wo(function(r,e,t){ar(r,t)?r[t].push(e):r[t]=[e]}),i7=Wo(function(r,e,t){r[t]=e}),a7=Wo(function(r,e,t){ar(r,t)?r[t]++:r[t]=1}),s7=Wo(function(r,e,t){r[t?0:1].push(e)},!0);function o7(r){return r==null?0:jt(r)?r.length:ot(r).length}function l7(r,e,t){return e in t}const KA=Mt(function(r,e){var t={},n=e[0];if(r==null)return t;At(n)?(e.length>1&&(n=Ka(n,e[1])),e=Ha(r)):(n=l7,e=Gr(e,!1,!1),r=Object(r));for(var a=0,s=e.length;a<s;a++){var o=e[a],l=r[o];n(l,o,r)&&(t[o]=l)}return t}),d7=Mt(function(r,e){var t=e[0],n;return At(t)?(t=vu(t),e.length>1&&(n=e[1])):(e=$r(Gr(e,!1,!1),String),t=function(a,s){return!Fn(e,s)}),KA(r,t,n)});function XA(r,e,t){return Ja.call(r,0,Math.max(0,r.length-(e==null||t?1:e)))}function Ou(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[0]:XA(r,r.length-e)}function Yo(r,e,t){return Ja.call(r,e==null||t?1:e)}function c7(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[r.length-1]:Yo(r,Math.max(0,r.length-e))}function u7(r){return ji(r,Boolean)}function p7(r,e){return Gr(r,e,!1)}const QA=Mt(function(r,e){return e=Gr(e,!0,!0),ji(r,function(t){return!Fn(e,t)})}),y7=Mt(function(r,e){return QA(r,e)});function Pu(r,e,t,n){iA(e)||(n=t,t=e,e=!1),t!=null&&(t=Vt(t,n));for(var a=[],s=[],o=0,l=_t(r);o<l;o++){var p=r[o],u=t?t(p,o,r):p;e&&!t?((!o||s!==u)&&a.push(p),s=u):t?Fn(s,u)||(s.push(u),a.push(p)):Fn(a,p)||a.push(p)}return a}const h7=Mt(function(r){return Pu(Gr(r,!0,!0))});function f7(r){for(var e=[],t=arguments.length,n=0,a=_t(r);n<a;n++){var s=r[n];if(!Fn(e,s)){var o;for(o=1;o<t&&Fn(arguments[o],s);o++);o===t&&e.push(s)}}return e}function Cu(r){for(var e=r&&HA(r,_t).length||0,t=Array(e),n=0;n<e;n++)t[n]=Su(r,n);return t}const m7=Mt(Cu);function T7(r,e){for(var t={},n=0,a=_t(r);n<a;n++)e?t[r[n]]=e[n]:t[r[n][0]]=r[n][1];return t}function E7(r,e,t){e==null&&(e=r||0,r=0),t||(t=e<r?-1:1);for(var n=Math.max(Math.ceil((e-r)/t),0),a=Array(n),s=0;s<n;s++,r+=t)a[s]=r;return a}function R7(r,e){if(e==null||e<1)return[];for(var t=[],n=0,a=r.length;n<a;)t.push(Ja.call(r,n,n+=e));return t}function wu(r,e){return r._chain?_e(e).chain():e}function eS(r){return $n(hu(r),function(e){var t=_e[e]=r[e];_e.prototype[e]=function(){var n=[this._wrapped];return q5.apply(n,arguments),wu(this,t.apply(_e,n))}}),_e}$n(["pop","push","reverse","shift","sort","splice","unshift"],function(r){var e=jo[r];_e.prototype[r]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(r==="shift"||r==="splice")&&t.length===0&&delete t[0]),wu(this,t)}}),$n(["concat","join","slice"],function(r){var e=jo[r];_e.prototype[r]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),wu(this,t)}});var tS=eS(Object.freeze(Object.defineProperty({__proto__:null,VERSION:HD,after:W2,all:WA,allKeys:Ha,any:YA,assign:Jo,before:GA,bind:NA,bindAll:F2,chain:$2,chunk:R7,clone:g2,collect:$r,compact:u7,compose:J2,constant:pA,contains:Fn,countBy:a7,create:R2,debounce:k2,default:_e,defaults:SA,defer:x2,delay:LA,detect:Du,difference:QA,drop:Yo,each:$n,escape:S2,every:WA,extend:AA,extendOwn:Jo,filter:ji,find:Du,findIndex:Iu,findKey:$A,findLastIndex:UA,findWhere:z2,first:Ou,flatten:p7,foldl:Au,foldr:JA,forEach:$n,functions:hu,get:CA,groupBy:r7,has:v2,head:Ou,identity:Tu,include:Fn,includes:Fn,indexBy:i7,indexOf:kA,initial:XA,inject:Au,intersection:f7,invert:DA,invoke:K2,isArguments:du,isArray:Lr,isArrayBuffer:oA,isBoolean:iA,isDataView:ko,isDate:Q5,isElement:X5,isEmpty:Ya,isEqual:c2,isError:t2,isFinite:a2,isFunction:At,isMap:y2,isMatch:TA,isNaN:uA,isNull:K5,isNumber:aA,isObject:ir,isRegExp:e2,isSet:f2,isString:su,isSymbol:sA,isTypedArray:fA,isUndefined:rA,isWeakMap:h2,isWeakSet:m2,iteratee:Ru,keys:ot,last:c7,lastIndexOf:H2,map:$r,mapObject:I2,matcher:Za,matches:Za,max:HA,memoize:U2,methods:hu,min:Q2,mixin:eS,negate:vu,noop:BA,now:Xa,object:T7,omit:d7,once:Y2,pairs:T2,partial:xi,partition:s7,pick:KA,pluck:Su,property:Eu,propertyOf:D2,random:gu,range:E7,reduce:Au,reduceRight:JA,reject:Z2,rest:Yo,restArguments:Mt,result:N2,sample:ZA,select:ji,shuffle:t7,size:o7,some:YA,sortBy:n7,sortedIndex:xA,tail:Yo,take:Ou,tap:b2,template:V2,templateSettings:C2,throttle:j2,times:A2,toArray:zA,toPath:PA,transpose:Cu,unescape:P2,union:h7,uniq:Pu,unique:Pu,uniqueId:G2,unzip:Cu,values:Ui,where:X2,without:y7,wrap:q2,zip:m7},Symbol.toStringTag,{value:"Module"})));tS._=tS;function Ho(r){return r.charAt(0).toUpperCase()+r.slice(1)}function zo(r){return r.charAt(0).toLowerCase()+r.slice(1)}function nS(r,e){if(r.type!==i.Property||e.type!==i.Property)throw new Error(`Expected property entities for comparison. But got ${r.type} and ${e.type}.`);return r===e||r.id===e.id?!0:r.name!==e.name||r.static!==e.static||r.abstract!==e.abstract?!1:Zt(r.dataType,e.dataType).compatible}function rS(r,e){if(r.type!==i.DefinitionEntity||e.type!==i.DefinitionEntity)throw new Error(`Expected definition entities for comparison. But got ${r.type} and ${e.type}.`);if(r===e||r.id===e.id)return!0;if(r.properties.length!==e.properties.length)return!1;let t=[...e.properties];const n=[];for(let a=0;a<r.properties.length;a++){const s=r.properties[a];t.find(l=>{const p=nS(s,l);return p&&(t=t.filter(u=>u.id!==l.id)),p})||n.push(s)}return!(n.length>0)}var zt=(r=>(r.BothUnconstrained="both-unconstrained",r.AConstraintBUnconstrained="a-constraint-b-unconstrained",r.BConstraintAUnconstrained="b-constraint-a-unconstrained",r.Same="same",r.AIsListBIsNot="a-is-list-b-is-not",r.BIsListAIsNot="b-is-list-a-is-not",r.AIsNullableBIsNot="a-is-nullable-b-is-not",r.BIsNullableAIsNot="b-is-nullable-a-is-not",r.AIsTemplateBIsNot="a-is-template-b-is-not",r.BIsTemplateAIsNot="b-is-template-a-is-not",r.BothUntyped="both-untyped",r.AIsUntypedBIsNot="a-is-untyped-b-is-not",r.BIsUntypedAIsNot="b-is-untyped-a-is-not",r.TypeEntityMismatch="type-entity-mismatch",r.SameDefinitionEntities="same-definition-entities",r.CompatibleDefinitionEntities="compatible-definition-entities",r.IncompatibleDefinitionEntities="incompatible-definition-entities",r.SamePrimitiveEntities="same-primitive-entities",r.IncompatiblePrimitiveEntities="incompatible-primitive-entities",r.SameBuiltInBaseEntities="same-built-in-base-entities",r.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",r.CheckUnknown="check-unknown",r))(zt||{});function Zt(r,e){var t,n,a,s,o,l,p,u,h,f,R;if(r&&r.type!==i.DataType||e&&e.type!==i.DataType)throw new Error(`Expected data-type entities for comparison. But got ${r==null?void 0:r.type} and ${e==null?void 0:e.type}.`);if(r===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(r===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(r===e)return{compatible:!0,type:"same"};if(r.id===e.id)return{compatible:!0,type:"same"};if(r.isList!==e.isList)return{compatible:!1,type:r.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(r.asType!==e.asType)return{compatible:!1,type:r.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!r.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(r.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!r.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=r.entity)==null?void 0:t.type)!==((n=e.entity)==null?void 0:n.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=r.entity)==null?void 0:a.type)===i.DefinitionEntity){if(((s=r.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-definition-entities"};const v=rS(r.entity,e.entity);return{compatible:v,type:v?"compatible-definition-entities":"incompatible-definition-entities"}}return((l=r.entity)==null?void 0:l.type)===i.PrimitiveEntity?((p=r.entity)==null?void 0:p.id)===((u=e.entity)==null?void 0:u.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((h=r.entity)==null?void 0:h.type)===i.BuiltInBaseEntity?((f=r.entity)==null?void 0:f.id)===((R=e.entity)==null?void 0:R.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function g7(r){const e=r.project.builtInBaseEntities.find(a=>a.id===U.EXECUTION),t={id:r.id+"--"+M.UUID.uuid()+"--infered-data-type",version:1,type:i.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},n=b(t,r.project);return n.inferred=!0,n.sync(t),n.setParent(r),n.entity=e,n}function iS(r){return r.dataType?r.dataType:null}function Bu(r){var t;const e=(t=r.declaration)==null?void 0:t.getDataType();return e&&e.isResolved?e:r.readsValue?Rn(r.readsValue):null}function Mu(r){return r.dataType&&!r.dataType.inferred&&r.dataType.isResolved?r.dataType:r.readsValue?Rn(r.readsValue):null}function aS(r){return Rn(r.declaration)}function sS(r){return r.dataType&&!r.dataType.inferred?r.dataType:(r.dataType&&r.dataType.inferred,r.inferDataTypeAndSyncInstancesInputsAndOutputs(),r.dataType)}function _u(r){var e;return((e=r.declaration)==null?void 0:e.dataType)||null}function oS(r){return(r==null?void 0:r.dataType)||null}function lS(r){return(r==null?void 0:r.dataType)||null}function Rn(r){switch(r.type){case i.VariableDeclaration:return sS(r);case i.ArgumentDeclaration:return iS(r);case i.ReturnDeclaration:return Mu(r);case i.VariableInstance:return aS(r);case i.InputMap:return Bu(r);case i.OutputMap:return _u(r);case i.Property:return oS(r);case i.ValueDescriptor:return lS(r);default:throw new Error(`Cannot infer data type from entity of type ${r.type}.`)}}function Zo(r){switch(r.type){case i.ArgumentDeclaration:return r.getDataType();case i.InputMap:return r.getDataType();case i.VariableDeclaration:return r.getDataType();case i.VariableInstance:return r.getDataType();case i.OutputMap:return r.getDataType();case i.ReturnDeclaration:return r.getDataType();case i.Property:return r.getDataType();case i.ValueDescriptor:return r.getDataType();default:return null}}function A(r){if(r){let e=null;return typeof r=="string"?e=r:r.entityId?e=r.entityId:r.type!==i.GenericReference&&(e=r.id),e}return null}function Fr(r){return r.declaration||r}function b7(r){return r.type===i.VariableDeclaration?r.parent===r.project?"global-declaration":"local-declaration":r.declaration.parent===r.project?"global-instance":"local-instance"}function Vu(r,e){const t=[];if(r.type===i.Project)t.push(...r.variableDeclarations);else{const a=Ot(Ue(r)).filter(s=>s.type===i.VariableDeclaration);t.push(...a),r.parent&&(pt.includes(r.parent.type)||r.parent.type===i.Project)&&t.push(...Vu(r.parent))}return t}function v7(r){return r.split(/[\s-]+/).filter(n=>n.length>0).map((n,a)=>a===0?n.toLowerCase():n[0].toUpperCase()+n.slice(1).toLowerCase()).join("")}function I7(r){return r.split(/[\s-]+/).filter(n=>n.length>0).map(n=>n[0].toUpperCase()+n.slice(1).toLowerCase()).join("")}function dS(r){var e;return(e=r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")}function Ko(r){return dS(r).toLowerCase()}function Qa(r){var e,t;if(!r)return"Any data type";if(!r.entity){const n=r.isList;if(!((e=r.andChildrenGroup)!=null&&e.length)&&!((t=r.orChildrenGroup)!=null&&t.length))return n?"List of an any data type":"Any data type";let a="",s=!1,o=!1;return(r.andChildrenGroup||[]).forEach(l=>{const p=Qa(l),u=zo(p);s&&(a+=" and "),l.isGroup?a+="("+u+")":s?a+=u:a+=p,s=!0,o=!0}),(r.orChildrenGroup||[]).forEach(l=>{const p=Qa(l),u=zo(p);s&&(o&&(a+=","),a+=" or "),l.isGroup?a+="("+u+")":s?a+=u:a+=p,s=!0}),a}if(r.entity.type===i.PrimitiveEntity){let n=r.entity.name;switch(r.entity.name){case C.String:n="Text";break;case C.KeyValue:n="Data structure";break}return r.isList?`List of ${n}s`:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`}else if(r.entity.type===i.DefinitionEntity){const n=w(r.entity,r.project);return r.isList?`List of ${n} entities`:n.slice(0,1).toUpperCase()+n.slice(1)}else if(r.entity.type===i.BuiltInBaseEntity){const n=uS(r.entity);return r.isList?`List of ${n} entities`:n.slice(0,1).toUpperCase()+n.slice(1)}else return r.isList?`List of ${r.entity.name} entities`:`${r.entity.name.slice(0,1).toUpperCase()+r.entity.name.slice(1)} entity`}function D7(r){if(!r)return"Any data type";const e=r.getDataType();return Qa(e)}function Xo(r){switch(r.declaration.id){case qe.Equal:return"is equal to";case qe.NotEqual:return"is not equal to";case qe.MoreThan:return"is greater than";case qe.MoreThanOrEqual:return"is greater than or equal to";case qe.LessThan:return"is less than";case qe.LessThanOrEqual:return"is less than or equal to";case qe.And:return"and";case qe.Or:return"or";case Jt.Empty:return"is empty";case Jt.NotEmpty:return"is not empty"}}function cS(r){return r.includes(U.HTTP_ENDPOINT)?"HTTP endpoint":r.includes(U.PERSISTED_ENTITY)?"Persisted entity":r.includes(U.CRON_JOB)?"Scheduled execution":r.includes(U.RELATIONAL_DATABASE)?"Relational database":"Entity"}function uS(r){switch(r.name){case U.HTTP_ENDPOINT:return"HTTP endpoint";case U.PERSISTED_ENTITY:return"Persisted entity";case U.CRON_JOB:return"Scheduled execution";case U.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function A7(r){const e=dp(r);if(!e){const t=lp(r);return t.includes(U.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(U.PERSISTED_ENTITY)?"Persisted entity":t.includes(U.CRON_JOB)?"Scheduled execution":t.includes(U.RELATIONAL_DATABASE)?"Relational database":w(r,r.project)+" entity"}return w(e,r.project)+" entity"}function pS(r){let e="Find ";return r.outputsDeclarations.forEach((t,n)=>{const a=Zo(t),s=zo(a&&a.entity?w(a.entity,r.project):"unstructured data");n===0?e+=`${s} `:n===r.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function yS(r){switch(r.name){case C.String:return"Text";case C.Number:return"Number";case C.Boolean:return"Boolean";case C.KeyValue:return"Data structure";case C.UUID:return"Unique identifier";case C.Date:return"Date";case C.EntityTemplate:return"Entity as template";case C.Enum:return"Enumeration";case C.File:return"File";case C.Null:return"Empty";case C.ActionDescriptor:return"Action descriptor";case C.Untyped:return"Untyped";default:return r.name}}function hS(r){switch(r.id){case k.List:return"Loop over list items";case k.ManualFlow:return"Manual flow control loop";case k.ObjectKeys:return"Loop over object keys";case k.ObjectValues:return"Loop over object values";case k.Counted:return"Loop given number of times";case k.String:return"Loop over text characters";case Ge.Addition:return"Sum numbers";case Ge.Subtraction:return"Subtract numbers";case Ge.Multiplication:return"Multiply numbers";case Ge.Division:return"Divide numbers";case Ge.Remainder:return"Get remainder of numbers";case Ge.Exponentiation:return"Get exponent of numbers";case re.AddIndex:return"Add at index position";case re.DeleteFirst:return"Delete first character";case re.DeleteLast:return"Delete last character";case re.DeleteIndex:return"Delete at index position";case re.Join:return"Join texts";case re.ReplaceAllMatches:return"Replace all matches";case re.ReplaceFirst:return"Replace first match";case re.ReplaceLast:return"Replace last match";case re.Split:return"Split text";case re.ReplaceIndex:return"Replace at index position";case re.ReplaceSingleMatch:return"Replace single match";case re.GetFirst:return"Get first character";case re.GetLast:return"Get last character";case re.GetIndex:return"Get at index position";case re.Append:return"Add at the end";case re.Prepend:return"Add at the start";case Ne.Wait:return"Wait";case Ne.Parallel:return"Run in parallel";case Ne.Sequential:return"Run in sequence";case dt.HttpRequest:return"HTTP request";case Le.CreateNewInstance:return"Create new copy of entity";case X.AddIndex:return"Add item at index position";case X.DeleteFirst:return"Delete first item";case X.DeleteLast:return"Delete last item";case X.DeleteIndex:return"Delete item at index position";case X.Join:return"Join lists";case X.ReplaceAllMatches:return"Replace all matches";case X.ReplaceFirst:return"Replace first match";case X.ReplaceLast:return"Replace last match";case X.Split:return"Split list";case X.ReplaceIndex:return"Replace at index position";case X.ReplaceSingleMatch:return"Replace single match";case X.GetFirst:return"Get first item";case X.GetLast:return"Get last item";case X.GetIndex:return"Get item at index position";case X.Append:return"Add item at the end";case X.Prepend:return"Add item at the start";case In.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(r.name.slice(0,1).toUpperCase()+r.name.slice(1)).replaceAll("-"," ")}}function w(r,e){var t;if(i.FunctionDeclaration===r.type){const n=r.name;if(Object.values(Gt).includes(n))switch(n){case Gt.AbortExecution:return"Abort execution";case Gt.DeletePersistedEntity:return"Delete persisted entity";case Gt.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Ho(r.type).replaceAll("-"," ")}return n}if(i.BuiltInBaseEntity===r.type)return cS([r.name]);if(gp.includes(r.type)&&r.type!==i.ActionDescriptor)return r.name;switch(r.type){case i.Search:return pS(r);case i.Operation:case i.InternalCall:case i.Loop:const n=Lt(r.declaration,e);return w(n,e);case i.ActionDescriptor:return hS(r);case i.BreakStatement:const a=Lt(r.parent,e);return`Stop loop ${w(a,e)}`;case i.ContinueStatement:const s=Lt(r.parent,e);return`Execute next iteration of ${w(s,e)}`;case i.FunctionCall:return Lt(r.declaration,e).name;case i.Condition:{const l=r;if((t=r.inputs)!=null&&t.length){const p=w(l.inputs[0],l.project);if(l.inputs[1]){const u=l.inputs[1].declaration.name;return`If ${p} ${Xo(l)} ${u}`}return`If ${p} ${Xo(l)}`}else return`If ${Xo(l)}`}case i.ReturnStatement:{const l=Lt(r.parent,e);return`Output of ${w(l,e)}`}case i.InputMap:if(r.declaration){const l=Lt(r.declaration,e);return w(l,e)||""}else return r.name||"";case i.VariableInstance:{const l=Lt(r.declaration,e);return w(l,e)||""}case i.OutputMap:if(r.declaration){const l=Lt(r.declaration,e);return(l==null?void 0:l.name)||""}else return"";case i.PrimitiveEntity:case i.LiteralValue:return yS(r);default:return Ho(r.type).replaceAll("-"," ")}}function Qo(r,e){const t=[];r.name||t.push(new g({id:`${r.id}--${B.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:E.Error,code:B.EmptyName,issue:null}));const n=e.entities.filter(a=>a.name===r.name);return n.length&&t.push(new g({id:`${r.id}--${B.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in the project. Entity with id "${n[0].id}" has the same name.
|
|
36
|
+
`+s+"}",p}function N2(r,e,t){e=Ha(e);var n=e.length;if(!n)return At(t)?t.call(r):t;for(var a=0;a<n;a++){var s=r==null?void 0:r[e[a]];s===void 0&&(s=t,a=n),r=At(s)?s.call(r):s}return r}var L2=0;function G2(r){var e=++L2+"";return r?r+e:e}function $2(r){var e=_e(r);return e._chain=!0,e}function VA(r,e,t,n,a){if(!(n instanceof e))return r.apply(t,a);var s=OA(r.prototype),o=r.apply(s,a);return ir(o)?o:s}var xi=Mt(function(r,e){var t=xi.placeholder,n=function(){for(var a=0,s=e.length,o=Array(s),l=0;l<s;l++)o[l]=e[l]===t?arguments[a++]:e[l];for(;a<arguments.length;)o.push(arguments[a++]);return VA(r,n,this,this,o)};return n});xi.placeholder=_e;const NA=Mt(function(r,e,t){if(!At(r))throw new TypeError("Bind must be called on a function");var n=Mt(function(a){return VA(r,n,e,this,t.concat(a))});return n}),jt=yA(_t);function Gr(r,e,t,n){if(n=n||[],!e&&e!==0)e=1/0;else if(e<=0)return n.concat(r);for(var a=n.length,s=0,o=_t(r);s<o;s++){var l=r[s];if(jt(l)&&(Lr(l)||du(l)))if(e>1)Gr(l,e-1,t,n),a=n.length;else for(var p=0,u=l.length;p<u;)n[a++]=l[p++];else t||(n[a++]=l)}return n}const F2=Mt(function(r,e){e=Gr(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var n=e[t];r[n]=NA(r[n],r)}return r});function U2(r,e){var t=function(n){var a=t.cache,s=""+(e?e.apply(this,arguments):n);return ar(a,s)||(a[s]=r.apply(this,arguments)),a[s]};return t.cache={},t}const LA=Mt(function(r,e,t){return setTimeout(function(){return r.apply(null,t)},e)}),x2=xi(LA,_e,1);function j2(r,e,t){var n,a,s,o,l=0;t||(t={});var p=function(){l=t.leading===!1?0:Ka(),n=null,o=r.apply(a,s),n||(a=s=null)},u=function(){var h=Ka();!l&&t.leading===!1&&(l=h);var f=e-(h-l);return a=this,s=arguments,f<=0||f>e?(n&&(clearTimeout(n),n=null),l=h,o=r.apply(a,s),n||(a=s=null)):!n&&t.trailing!==!1&&(n=setTimeout(p,f)),o};return u.cancel=function(){clearTimeout(n),l=0,n=a=s=null},u}function k2(r,e,t){var n,a,s,o,l,p=function(){var h=Ka()-a;e>h?n=setTimeout(p,e-h):(n=null,t||(o=r.apply(l,s)),n||(s=l=null))},u=Mt(function(h){return l=this,s=h,a=Ka(),n||(n=setTimeout(p,e),t&&(o=r.apply(l,s))),o});return u.cancel=function(){clearTimeout(n),n=s=l=null},u}function q2(r,e){return xi(e,r)}function vu(r){return function(){return!r.apply(this,arguments)}}function J2(){var r=arguments,e=r.length-1;return function(){for(var t=e,n=r[e].apply(this,arguments);t--;)n=r[t].call(this,n);return n}}function W2(r,e){return function(){if(--r<1)return e.apply(this,arguments)}}function GA(r,e){var t;return function(){return--r>0&&(t=e.apply(this,arguments)),r<=1&&(e=null),t}}const Y2=xi(GA,2);function $A(r,e,t){e=Vt(e,t);for(var n=ot(r),a,s=0,o=n.length;s<o;s++)if(a=n[s],e(r[a],a,r))return a}function FA(r){return function(e,t,n){t=Vt(t,n);for(var a=_t(e),s=r>0?0:a-1;s>=0&&s<a;s+=r)if(t(e[s],s,e))return s;return-1}}const Iu=FA(1),UA=FA(-1);function xA(r,e,t,n){t=Vt(t,n,1);for(var a=t(e),s=0,o=_t(r);s<o;){var l=Math.floor((s+o)/2);t(r[l])<a?s=l+1:o=l}return s}function jA(r,e,t){return function(n,a,s){var o=0,l=_t(n);if(typeof s=="number")r>0?o=s>=0?s:Math.max(s+l,o):l=s>=0?Math.min(s+1,l):s+l+1;else if(t&&s&&l)return s=t(n,a),n[s]===a?s:-1;if(a!==a)return s=e(qa.call(n,o,l),uA),s>=0?s+o:-1;for(s=r>0?o:l-1;s>=0&&s<l;s+=r)if(n[s]===a)return s;return-1}}const kA=jA(1,Iu,xA),H2=jA(-1,UA);function Du(r,e,t){var n=jt(r)?Iu:$A,a=n(r,e,t);if(a!==void 0&&a!==-1)return r[a]}function z2(r,e){return Du(r,za(e))}function $n(r,e,t){e=Za(e,t);var n,a;if(jt(r))for(n=0,a=r.length;n<a;n++)e(r[n],n,r);else{var s=ot(r);for(n=0,a=s.length;n<a;n++)e(r[s[n]],s[n],r)}return r}function $r(r,e,t){e=Vt(e,t);for(var n=!jt(r)&&ot(r),a=(n||r).length,s=Array(a),o=0;o<a;o++){var l=n?n[o]:o;s[o]=e(r[l],l,r)}return s}function qA(r){var e=function(t,n,a,s){var o=!jt(t)&&ot(t),l=(o||t).length,p=r>0?0:l-1;for(s||(a=t[o?o[p]:p],p+=r);p>=0&&p<l;p+=r){var u=o?o[p]:p;a=n(a,t[u],u,t)}return a};return function(t,n,a,s){var o=arguments.length>=3;return e(t,Za(n,s,4),a,o)}}const Au=qA(1),JA=qA(-1);function ji(r,e,t){var n=[];return e=Vt(e,t),$n(r,function(a,s,o){e(a,s,o)&&n.push(a)}),n}function Z2(r,e,t){return ji(r,vu(Vt(e)),t)}function WA(r,e,t){e=Vt(e,t);for(var n=!jt(r)&&ot(r),a=(n||r).length,s=0;s<a;s++){var o=n?n[s]:s;if(!e(r[o],o,r))return!1}return!0}function YA(r,e,t){e=Vt(e,t);for(var n=!jt(r)&&ot(r),a=(n||r).length,s=0;s<a;s++){var o=n?n[s]:s;if(e(r[o],o,r))return!0}return!1}function Fn(r,e,t,n){return jt(r)||(r=Ui(r)),(typeof t!="number"||n)&&(t=0),kA(r,e,t)>=0}const K2=Mt(function(r,e,t){var n,a;return At(e)?a=e:(e=Ha(e),n=e.slice(0,-1),e=e[e.length-1]),$r(r,function(s){var o=a;if(!o){if(n&&n.length&&(s=mu(s,n)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function Su(r,e){return $r(r,Eu(e))}function X2(r,e){return ji(r,za(e))}function HA(r,e,t){var n=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=jt(r)?r:Ui(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s>n&&(n=s)}else e=Vt(e,t),$n(r,function(u,h,f){o=e(u,h,f),(o>a||o===-1/0&&n===-1/0)&&(n=u,a=o)});return n}function Q2(r,e,t){var n=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=jt(r)?r:Ui(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s<n&&(n=s)}else e=Vt(e,t),$n(r,function(u,h,f){o=e(u,h,f),(o<a||o===1/0&&n===1/0)&&(n=u,a=o)});return n}var e7=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function zA(r){return r?Lr(r)?qa.call(r):su(r)?r.match(e7):jt(r)?$r(r,Tu):Ui(r):[]}function ZA(r,e,t){if(e==null||t)return jt(r)||(r=Ui(r)),r[gu(r.length-1)];var n=zA(r),a=_t(n);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var l=gu(o,s),p=n[o];n[o]=n[l],n[l]=p}return n.slice(0,e)}function t7(r){return ZA(r,1/0)}function n7(r,e,t){var n=0;return e=Vt(e,t),Su($r(r,function(a,s,o){return{value:a,index:n++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,l=s.criteria;if(o!==l){if(o>l||o===void 0)return 1;if(o<l||l===void 0)return-1}return a.index-s.index}),"value")}function Wo(r,e){return function(t,n,a){var s=e?[[],[]]:{};return n=Vt(n,a),$n(t,function(o,l){var p=n(o,l,t);r(s,o,p)}),s}}const r7=Wo(function(r,e,t){ar(r,t)?r[t].push(e):r[t]=[e]}),i7=Wo(function(r,e,t){r[t]=e}),a7=Wo(function(r,e,t){ar(r,t)?r[t]++:r[t]=1}),s7=Wo(function(r,e,t){r[t?0:1].push(e)},!0);function o7(r){return r==null?0:jt(r)?r.length:ot(r).length}function l7(r,e,t){return e in t}const KA=Mt(function(r,e){var t={},n=e[0];if(r==null)return t;At(n)?(e.length>1&&(n=Za(n,e[1])),e=Ya(r)):(n=l7,e=Gr(e,!1,!1),r=Object(r));for(var a=0,s=e.length;a<s;a++){var o=e[a],l=r[o];n(l,o,r)&&(t[o]=l)}return t}),d7=Mt(function(r,e){var t=e[0],n;return At(t)?(t=vu(t),e.length>1&&(n=e[1])):(e=$r(Gr(e,!1,!1),String),t=function(a,s){return!Fn(e,s)}),KA(r,t,n)});function XA(r,e,t){return qa.call(r,0,Math.max(0,r.length-(e==null||t?1:e)))}function Ou(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[0]:XA(r,r.length-e)}function Yo(r,e,t){return qa.call(r,e==null||t?1:e)}function c7(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[r.length-1]:Yo(r,Math.max(0,r.length-e))}function u7(r){return ji(r,Boolean)}function p7(r,e){return Gr(r,e,!1)}const QA=Mt(function(r,e){return e=Gr(e,!0,!0),ji(r,function(t){return!Fn(e,t)})}),y7=Mt(function(r,e){return QA(r,e)});function Pu(r,e,t,n){iA(e)||(n=t,t=e,e=!1),t!=null&&(t=Vt(t,n));for(var a=[],s=[],o=0,l=_t(r);o<l;o++){var p=r[o],u=t?t(p,o,r):p;e&&!t?((!o||s!==u)&&a.push(p),s=u):t?Fn(s,u)||(s.push(u),a.push(p)):Fn(a,p)||a.push(p)}return a}const h7=Mt(function(r){return Pu(Gr(r,!0,!0))});function f7(r){for(var e=[],t=arguments.length,n=0,a=_t(r);n<a;n++){var s=r[n];if(!Fn(e,s)){var o;for(o=1;o<t&&Fn(arguments[o],s);o++);o===t&&e.push(s)}}return e}function Cu(r){for(var e=r&&HA(r,_t).length||0,t=Array(e),n=0;n<e;n++)t[n]=Su(r,n);return t}const m7=Mt(Cu);function T7(r,e){for(var t={},n=0,a=_t(r);n<a;n++)e?t[r[n]]=e[n]:t[r[n][0]]=r[n][1];return t}function E7(r,e,t){e==null&&(e=r||0,r=0),t||(t=e<r?-1:1);for(var n=Math.max(Math.ceil((e-r)/t),0),a=Array(n),s=0;s<n;s++,r+=t)a[s]=r;return a}function R7(r,e){if(e==null||e<1)return[];for(var t=[],n=0,a=r.length;n<a;)t.push(qa.call(r,n,n+=e));return t}function wu(r,e){return r._chain?_e(e).chain():e}function eS(r){return $n(hu(r),function(e){var t=_e[e]=r[e];_e.prototype[e]=function(){var n=[this._wrapped];return q5.apply(n,arguments),wu(this,t.apply(_e,n))}}),_e}$n(["pop","push","reverse","shift","sort","splice","unshift"],function(r){var e=jo[r];_e.prototype[r]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(r==="shift"||r==="splice")&&t.length===0&&delete t[0]),wu(this,t)}}),$n(["concat","join","slice"],function(r){var e=jo[r];_e.prototype[r]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),wu(this,t)}});var tS=eS(Object.freeze(Object.defineProperty({__proto__:null,VERSION:HD,after:W2,all:WA,allKeys:Ya,any:YA,assign:Jo,before:GA,bind:NA,bindAll:F2,chain:$2,chunk:R7,clone:g2,collect:$r,compact:u7,compose:J2,constant:pA,contains:Fn,countBy:a7,create:R2,debounce:k2,default:_e,defaults:SA,defer:x2,delay:LA,detect:Du,difference:QA,drop:Yo,each:$n,escape:S2,every:WA,extend:AA,extendOwn:Jo,filter:ji,find:Du,findIndex:Iu,findKey:$A,findLastIndex:UA,findWhere:z2,first:Ou,flatten:p7,foldl:Au,foldr:JA,forEach:$n,functions:hu,get:CA,groupBy:r7,has:v2,head:Ou,identity:Tu,include:Fn,includes:Fn,indexBy:i7,indexOf:kA,initial:XA,inject:Au,intersection:f7,invert:DA,invoke:K2,isArguments:du,isArray:Lr,isArrayBuffer:oA,isBoolean:iA,isDataView:ko,isDate:Q5,isElement:X5,isEmpty:Wa,isEqual:c2,isError:t2,isFinite:a2,isFunction:At,isMap:y2,isMatch:TA,isNaN:uA,isNull:K5,isNumber:aA,isObject:ir,isRegExp:e2,isSet:f2,isString:su,isSymbol:sA,isTypedArray:fA,isUndefined:rA,isWeakMap:h2,isWeakSet:m2,iteratee:Ru,keys:ot,last:c7,lastIndexOf:H2,map:$r,mapObject:I2,matcher:za,matches:za,max:HA,memoize:U2,methods:hu,min:Q2,mixin:eS,negate:vu,noop:BA,now:Ka,object:T7,omit:d7,once:Y2,pairs:T2,partial:xi,partition:s7,pick:KA,pluck:Su,property:Eu,propertyOf:D2,random:gu,range:E7,reduce:Au,reduceRight:JA,reject:Z2,rest:Yo,restArguments:Mt,result:N2,sample:ZA,select:ji,shuffle:t7,size:o7,some:YA,sortBy:n7,sortedIndex:xA,tail:Yo,take:Ou,tap:b2,template:V2,templateSettings:C2,throttle:j2,times:A2,toArray:zA,toPath:PA,transpose:Cu,unescape:P2,union:h7,uniq:Pu,unique:Pu,uniqueId:G2,unzip:Cu,values:Ui,where:X2,without:y7,wrap:q2,zip:m7},Symbol.toStringTag,{value:"Module"})));tS._=tS;function Ho(r){return r.charAt(0).toUpperCase()+r.slice(1)}function zo(r){return r.charAt(0).toLowerCase()+r.slice(1)}function nS(r,e){if(r.type!==i.Property||e.type!==i.Property)throw new Error(`Expected property entities for comparison. But got ${r.type} and ${e.type}.`);return r===e||r.id===e.id?!0:r.name!==e.name||r.static!==e.static||r.abstract!==e.abstract?!1:Zt(r.dataType,e.dataType).compatible}function rS(r,e){if(r.type!==i.DefinitionEntity||e.type!==i.DefinitionEntity)throw new Error(`Expected definition entities for comparison. But got ${r.type} and ${e.type}.`);if(r===e||r.id===e.id)return!0;if(r.properties.length!==e.properties.length)return!1;let t=[...e.properties];const n=[];for(let a=0;a<r.properties.length;a++){const s=r.properties[a];t.find(l=>{const p=nS(s,l);return p&&(t=t.filter(u=>u.id!==l.id)),p})||n.push(s)}return!(n.length>0)}var zt=(r=>(r.BothUnconstrained="both-unconstrained",r.AConstraintBUnconstrained="a-constraint-b-unconstrained",r.BConstraintAUnconstrained="b-constraint-a-unconstrained",r.Same="same",r.AIsListBIsNot="a-is-list-b-is-not",r.BIsListAIsNot="b-is-list-a-is-not",r.AIsNullableBIsNot="a-is-nullable-b-is-not",r.BIsNullableAIsNot="b-is-nullable-a-is-not",r.AIsTemplateBIsNot="a-is-template-b-is-not",r.BIsTemplateAIsNot="b-is-template-a-is-not",r.BothUntyped="both-untyped",r.AIsUntypedBIsNot="a-is-untyped-b-is-not",r.BIsUntypedAIsNot="b-is-untyped-a-is-not",r.TypeEntityMismatch="type-entity-mismatch",r.SameDefinitionEntities="same-definition-entities",r.CompatibleDefinitionEntities="compatible-definition-entities",r.IncompatibleDefinitionEntities="incompatible-definition-entities",r.SamePrimitiveEntities="same-primitive-entities",r.IncompatiblePrimitiveEntities="incompatible-primitive-entities",r.SameBuiltInBaseEntities="same-built-in-base-entities",r.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",r.CheckUnknown="check-unknown",r))(zt||{});function Zt(r,e){var t,n,a,s,o,l,p,u,h,f,R;if(r&&r.type!==i.DataType||e&&e.type!==i.DataType)throw new Error(`Expected data-type entities for comparison. But got ${r==null?void 0:r.type} and ${e==null?void 0:e.type}.`);if(r===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(r===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(r===e)return{compatible:!0,type:"same"};if(r.id===e.id)return{compatible:!0,type:"same"};if(r.isList!==e.isList)return{compatible:!1,type:r.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(r.asType!==e.asType)return{compatible:!1,type:r.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!r.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(r.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!r.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=r.entity)==null?void 0:t.type)!==((n=e.entity)==null?void 0:n.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=r.entity)==null?void 0:a.type)===i.DefinitionEntity){if(((s=r.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-definition-entities"};const v=rS(r.entity,e.entity);return{compatible:v,type:v?"compatible-definition-entities":"incompatible-definition-entities"}}return((l=r.entity)==null?void 0:l.type)===i.PrimitiveEntity?((p=r.entity)==null?void 0:p.id)===((u=e.entity)==null?void 0:u.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((h=r.entity)==null?void 0:h.type)===i.BuiltInBaseEntity?((f=r.entity)==null?void 0:f.id)===((R=e.entity)==null?void 0:R.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function g7(r){const e=r.project.builtInBaseEntities.find(a=>a.id===F.EXECUTION),t={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},n=b(t,r.project);return n.inferred=!0,n.sync(t),n.setParent(r),n.entity=e,n}function iS(r){return r.dataType?r.dataType:null}function Bu(r){var t;const e=(t=r.declaration)==null?void 0:t.getDataType();return e&&e.isResolved?e:r.readsValue?Rn(r.readsValue):null}function Mu(r){return r.dataType&&!r.dataType.inferred&&r.dataType.isResolved?r.dataType:r.readsValue?Rn(r.readsValue):null}function aS(r){return Rn(r.declaration)}function sS(r){return r.dataType&&!r.dataType.inferred?r.dataType:(r.dataType&&r.dataType.inferred,r.inferDataTypeAndSyncInstancesInputsAndOutputs(),r.dataType)}function _u(r){var e;return((e=r.declaration)==null?void 0:e.dataType)||null}function oS(r){return(r==null?void 0:r.dataType)||null}function lS(r){return(r==null?void 0:r.dataType)||null}function Rn(r){switch(r.type){case i.VariableDeclaration:return sS(r);case i.ArgumentDeclaration:return iS(r);case i.ReturnDeclaration:return Mu(r);case i.VariableInstance:return aS(r);case i.InputMap:return Bu(r);case i.OutputMap:return _u(r);case i.Property:return oS(r);case i.ValueDescriptor:return lS(r);default:throw new Error(`Cannot infer data type from entity of type ${r.type}.`)}}function Zo(r){switch(r.type){case i.ArgumentDeclaration:return r.getDataType();case i.InputMap:return r.getDataType();case i.VariableDeclaration:return r.getDataType();case i.VariableInstance:return r.getDataType();case i.OutputMap:return r.getDataType();case i.ReturnDeclaration:return r.getDataType();case i.Property:return r.getDataType();case i.ValueDescriptor:return r.getDataType();default:return null}}function A(r){if(r){let e=null;return typeof r=="string"?e=r:r.entityId?e=r.entityId:r.type!==i.GenericReference&&(e=r.id),e}return null}function Fr(r){return r.declaration||r}function b7(r){return r.type===i.VariableDeclaration?r.parent===r.project?"global-declaration":"local-declaration":r.declaration.parent===r.project?"global-instance":"local-instance"}function Vu(r,e){const t=[];if(r.type===i.Project)t.push(...r.variableDeclarations);else{const a=Ot(Ue(r)).filter(s=>s.type===i.VariableDeclaration);t.push(...a),r.parent&&(pt.includes(r.parent.type)||r.parent.type===i.Project)&&t.push(...Vu(r.parent))}return t}function v7(r){return r.split(/[\s-]+/).filter(n=>n.length>0).map((n,a)=>a===0?n.toLowerCase():n[0].toUpperCase()+n.slice(1).toLowerCase()).join("")}function I7(r){return r.split(/[\s-]+/).filter(n=>n.length>0).map(n=>n[0].toUpperCase()+n.slice(1).toLowerCase()).join("")}function dS(r){var e;return(e=r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")}function Ko(r){return dS(r).toLowerCase()}function Xa(r){var e,t;if(!r)return"Any data type";if(!r.entity){const n=r.isList;if(!((e=r.andChildrenGroup)!=null&&e.length)&&!((t=r.orChildrenGroup)!=null&&t.length))return n?"List of an any data type":"Any data type";let a="",s=!1,o=!1;return(r.andChildrenGroup||[]).forEach(l=>{const p=Xa(l),u=zo(p);s&&(a+=" and "),l.isGroup?a+="("+u+")":s?a+=u:a+=p,s=!0,o=!0}),(r.orChildrenGroup||[]).forEach(l=>{const p=Xa(l),u=zo(p);s&&(o&&(a+=","),a+=" or "),l.isGroup?a+="("+u+")":s?a+=u:a+=p,s=!0}),a}if(r.entity.type===i.PrimitiveEntity){let n=r.entity.name;switch(r.entity.name){case C.String:n="Text";break;case C.KeyValue:n="Data structure";break}return r.isList?`List of ${n}s`:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`}else if(r.entity.type===i.DefinitionEntity){const n=w(r.entity,r.project);return r.isList?`List of ${n} entities`:n.slice(0,1).toUpperCase()+n.slice(1)}else if(r.entity.type===i.BuiltInBaseEntity){const n=uS(r.entity);return r.isList?`List of ${n} entities`:n.slice(0,1).toUpperCase()+n.slice(1)}else return r.isList?`List of ${r.entity.name} entities`:`${r.entity.name.slice(0,1).toUpperCase()+r.entity.name.slice(1)} entity`}function D7(r){if(!r)return"Any data type";const e=r.getDataType();return Xa(e)}function Xo(r){switch(r.declaration.id){case qe.Equal:return"is equal to";case qe.NotEqual:return"is not equal to";case qe.MoreThan:return"is greater than";case qe.MoreThanOrEqual:return"is greater than or equal to";case qe.LessThan:return"is less than";case qe.LessThanOrEqual:return"is less than or equal to";case qe.And:return"and";case qe.Or:return"or";case Jt.Empty:return"is empty";case Jt.NotEmpty:return"is not empty"}}function cS(r){return r.includes(F.HTTP_ENDPOINT)?"HTTP endpoint":r.includes(F.PERSISTED_ENTITY)?"Persisted entity":r.includes(F.CRON_JOB)?"Scheduled execution":r.includes(F.RELATIONAL_DATABASE)?"Relational database":"Entity"}function uS(r){switch(r.name){case F.HTTP_ENDPOINT:return"HTTP endpoint";case F.PERSISTED_ENTITY:return"Persisted entity";case F.CRON_JOB:return"Scheduled execution";case F.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function A7(r){const e=dp(r);if(!e){const t=lp(r);return t.includes(F.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(F.PERSISTED_ENTITY)?"Persisted entity":t.includes(F.CRON_JOB)?"Scheduled execution":t.includes(F.RELATIONAL_DATABASE)?"Relational database":w(r,r.project)+" entity"}return w(e,r.project)+" entity"}function pS(r){let e="Find ";return r.outputsDeclarations.forEach((t,n)=>{const a=Zo(t),s=zo(a&&a.entity?w(a.entity,r.project):"unstructured data");n===0?e+=`${s} `:n===r.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function yS(r){switch(r.name){case C.String:return"Text";case C.Number:return"Number";case C.Boolean:return"Boolean";case C.KeyValue:return"Data structure";case C.UUID:return"Unique identifier";case C.Date:return"Date";case C.EntityTemplate:return"Entity as template";case C.Enum:return"Enumeration";case C.File:return"File";case C.Null:return"Empty";case C.ActionDescriptor:return"Action descriptor";case C.Untyped:return"Untyped";default:return r.name}}function hS(r){switch(r.id){case j.List:return"Loop over list items";case j.ManualFlow:return"Manual flow control loop";case j.ObjectKeys:return"Loop over object keys";case j.ObjectValues:return"Loop over object values";case j.Counted:return"Loop given number of times";case j.String:return"Loop over text characters";case Ge.Addition:return"Sum numbers";case Ge.Subtraction:return"Subtract numbers";case Ge.Multiplication:return"Multiply numbers";case Ge.Division:return"Divide numbers";case Ge.Remainder:return"Get remainder of numbers";case Ge.Exponentiation:return"Get exponent of numbers";case re.AddIndex:return"Add at index position";case re.DeleteFirst:return"Delete first character";case re.DeleteLast:return"Delete last character";case re.DeleteIndex:return"Delete at index position";case re.Join:return"Join texts";case re.ReplaceAllMatches:return"Replace all matches";case re.ReplaceFirst:return"Replace first match";case re.ReplaceLast:return"Replace last match";case re.Split:return"Split text";case re.ReplaceIndex:return"Replace at index position";case re.ReplaceSingleMatch:return"Replace single match";case re.GetFirst:return"Get first character";case re.GetLast:return"Get last character";case re.GetIndex:return"Get at index position";case re.Append:return"Add at the end";case re.Prepend:return"Add at the start";case Ne.Wait:return"Wait";case Ne.Parallel:return"Run in parallel";case Ne.Sequential:return"Run in sequence";case dt.HttpRequest:return"HTTP request";case Le.CreateNewInstance:return"Create new copy of entity";case X.AddIndex:return"Add item at index position";case X.DeleteFirst:return"Delete first item";case X.DeleteLast:return"Delete last item";case X.DeleteIndex:return"Delete item at index position";case X.Join:return"Join lists";case X.ReplaceAllMatches:return"Replace all matches";case X.ReplaceFirst:return"Replace first match";case X.ReplaceLast:return"Replace last match";case X.Split:return"Split list";case X.ReplaceIndex:return"Replace at index position";case X.ReplaceSingleMatch:return"Replace single match";case X.GetFirst:return"Get first item";case X.GetLast:return"Get last item";case X.GetIndex:return"Get item at index position";case X.Append:return"Add item at the end";case X.Prepend:return"Add item at the start";case In.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(r.name.slice(0,1).toUpperCase()+r.name.slice(1)).replaceAll("-"," ")}}function w(r,e){var t;if(i.FunctionDeclaration===r.type){const n=r.name;if(Object.values(Gt).includes(n))switch(n){case Gt.AbortExecution:return"Abort execution";case Gt.DeletePersistedEntity:return"Delete persisted entity";case Gt.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Ho(r.type).replaceAll("-"," ")}return n}if(i.BuiltInBaseEntity===r.type)return cS([r.name]);if(gp.includes(r.type)&&r.type!==i.ActionDescriptor)return r.name;switch(r.type){case i.Search:return pS(r);case i.Operation:case i.InternalCall:case i.Loop:const n=Lt(r.declaration,e);return w(n,e);case i.ActionDescriptor:return hS(r);case i.BreakStatement:const a=Lt(r.parent,e);return`Stop loop ${w(a,e)}`;case i.ContinueStatement:const s=Lt(r.parent,e);return`Execute next iteration of ${w(s,e)}`;case i.FunctionCall:return Lt(r.declaration,e).name;case i.Condition:{const l=r;if((t=r.inputs)!=null&&t.length){const p=w(l.inputs[0],l.project);if(l.inputs[1]){const u=l.inputs[1].declaration.name;return`If ${p} ${Xo(l)} ${u}`}return`If ${p} ${Xo(l)}`}else return`If ${Xo(l)}`}case i.ReturnStatement:{const l=Lt(r.parent,e);return`Output of ${w(l,e)}`}case i.InputMap:if(r.declaration){const l=Lt(r.declaration,e);return w(l,e)||""}else return r.name||"";case i.VariableInstance:{const l=Lt(r.declaration,e);return w(l,e)||""}case i.OutputMap:if(r.declaration){const l=Lt(r.declaration,e);return(l==null?void 0:l.name)||""}else return"";case i.PrimitiveEntity:case i.LiteralValue:return yS(r);default:return Ho(r.type).replaceAll("-"," ")}}function Qo(r,e){const t=[];r.name||t.push(new g({id:`${r.id}--${B.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:E.Error,code:B.EmptyName,issue:null}));const n=e.entities.filter(a=>a.name===r.name);return n.length&&t.push(new g({id:`${r.id}--${B.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in the project. Entity with id "${n[0].id}" has the same name.
|
|
37
37
|
Please provide a unique 'name' string.`,severity:E.Error,code:B.NameNotUniqueInScope,issue:null})),t}function Nu(r,e){const t=[];r.name||t.push(new g({id:`${r.id}--${B.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:E.Error,code:B.EmptyName,issue:null}));const n=r.parent?A(r.parent):null;let a=e;n&&(a=e.get(n));const s=[];a.type===i.DefinitionEntity?s.push(...a.methods.map(l=>l)):a.type===i.Project?s.push(...a.functions.map(l=>l)):a.type===i.Loop?a.body&&s.push(a.body):a.type===i.InstalledProject&&s.push(...a.functions.map(l=>l));const o=s.filter(l=>l.name===r.name);return o.length&&t.push(new g({id:`${r.id}--${B.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in ${a.type===i.Project?"the globally declared project scope":"its parent entity"}. Entity with id "${o[0].id}" has the same name.
|
|
38
38
|
Please provide a unique 'name' string.`,severity:E.Error,code:B.NameNotUniqueInScope,issue:null})),t}function Lu(r,e){const t=[];r.name||t.push(new g({id:`${r.id}--${B.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:E.Error,code:B.EmptyName,issue:null}));const n=r.parent&&Lt(r.parent,e)||e;if(!n)t.push(new g({id:`${r.id}--parent-reference--${T.ReferencedEntityNotFound}`,message:`The 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.`,severity:E.Error,code:T.ReferencedEntityNotFound,issue:null}));else{const s=Vu(n).filter(o=>o.name===r.name);s.length&&t.push(new g({id:`${r.id}--${B.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in its scope or higher scopes. Entity with id "${s[0].id}" has the same name.
|
|
39
39
|
Please provide a unique 'name' string.`,severity:E.Error,code:B.NameNotUniqueInScope,issue:null}))}return t}function Gu(r,e){const t=[];r.name||t.push(new g({id:`${r.id}--${B.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:E.Error,code:B.EmptyName,issue:null}));const n=A(r.parent);if(!n)t.push(new g({id:`${r.id}--parent-reference--${T.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${r.id}" and type "${r.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:E.Error,code:T.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(n);if(!a)t.push(new g({id:`${r.id}--parent-reference--${T.ReferencedEntityNotFound}`,message:`The entity with id '${n}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:E.Error,code:T.ReferencedEntityNotFound,issue:null}));else{const o=a.properties.filter(l=>l.name===r.name);o.length&&t.push(new g({id:`${r.id}--${B.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique among all properties in the parent entity. Entity with id "${o[0].id}" has the same name.
|
|
@@ -43,10 +43,10 @@ Please provide a unique 'name' string.`,severity:E.Error,code:B.NameNotUniqueInS
|
|
|
43
43
|
${lr}`,t.push(new g({id:`${r.id}--${T.NonInteractiveEntityReferenced}`,code:T.NonInteractiveEntityReferenced,severity:E.Error,message:p,issue:null}))}else if(r.implements){const p=e.get(r.implements);if(r.id===r.implements)return t.push(new g({id:`${r.id}--${r.implements}--${T.SelfReference}`,code:T.SelfReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to itself at 'implements'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;if(!p)t.push(new g({id:`${r.id}--${r.implements}--${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.implements}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const u=a.properties.find(h=>{var f;return((f=h.implements)==null?void 0:f.id)===r.implements});u?t.push(new g({id:`${r.id}--${B.PropertyOverwrite}`,code:B.PropertyOverwrite,severity:E.Error,message:`The property with id "${r.id}" is trying to implement the property with id "${r.implements}", but the parent entity already has a property with id '${u.id}' that implements the same base property.`,issue:null})):[i.Property].includes(p.type)?p.abstract||t.push(new g({id:`${r.id}--${r.implements}--${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}--${r.implements}--${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 'property'.`,issue:null}))}}}}}const n=tt(r,{},e);return t.push(...n.errors),t}const ce=class ce{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"private");c(this,"abstract");c(this,"index");c(this,"static");c(this,"required");c(this,"constant",!1);c(this,"type",i.Property);c(this,"hidden",!1);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1,this.hidden=e.hidden||!1,this.constant=e.constant||!1}static fromGenerationTarget(e,t){const n=A(e.parent),a=t.get(n);let s=null;if(e.implements){const p=A(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:i.Property,index:a.properties.length,private:e.private||!1,abstract:e.abstract||!1,static:e.static||!1,required:e.required||!1,constant:e.constant||!1,hidden:!1,description:e.description,defaultValue:null,implements:s,dataType:null,parent:a},l=b(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=C7(n,t),o=Gu(n,t);return a.push(...s,...o,...je(n)),{errors:a,modifiedData:n}}get isExtendedProperty(){const e=this.parent.allBasePropertiesFromExtendedAndImplementedEntities.find(t=>t.name===this.name);return!!e&&e.id!==this.id&&!e.abstract}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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
44
44
|
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),(e.readsValue||e.writesValue)&&t.push(new g({id:`${this.id}--${B.InvalidObjectStructure}`,code:B.InvalidObjectStructure,severity:E.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
|
|
45
45
|
${rl}`,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.implements){const a=A(this.initialData.implements),s=this.project.get(a);s&&(this.setImplements(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.addProperty(this),e.push(this.parent),{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.dataType){const e=b(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=b(this.initialData.implements,this.project);this.implements=e}return 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.name=e.name||this.name,this.description=e.description||this.description,this.abstract=e.abstract!==void 0?e.abstract:this.abstract,this.private=e.private!==void 0?e.private:this.private,this.index=e.index||(e.index!==0?this.index:0),this.static=e.static!==void 0?e.static:this.static,this.hidden=e.hidden!==void 0?e.hidden:this.hidden,this.constant=e.constant!==void 0?e.constant:this.constant,this.required=e.required!==void 0?e.required:this.required,this}async load(e=V,...t){return await ce.repository.load(this.id,...t),this}async create(e=V,...t){return await ce.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await ce.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await ce.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return e||this.parent.type===i.DefinitionEntity&&(this.parent.removeProperty(this),n.push(this.parent)),{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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}if(this.dataType){const{affected:n}=this.dataType.restore({seenEntities:e});t.push(...n)}return this.parent.type===i.DefinitionEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...((a=this.dataType)==null?void 0:a.toFlat(e))||[]])}toFlatIds(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...((a=this.dataType)==null?void 0:a.toFlatIds(e))||[]])}toJSON(e=new Set){var t,n,a;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,index:this.index,private:this.private,required:this.required,static:this.static,constant:this.constant,abstract:this.abstract,hidden:this.hidden,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,dataType:((n=this.dataType)==null?void 0:n.toJSON(e))||null,implements:((a=this.implements)==null?void 0:a.toJSON(e))||null,parent:this.parent.toReference()})}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:1,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,constant:this.constant,abstract:this.abstract,hidden:this.hidden,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,dataType:((u=this.dataType)==null?void 0:u.toJSONClone({...e,newId:null}))||null,implements:(()=>{var h;return this.implements&&this.project.getBuiltIn(this.implements.id)?this.implements.toJSON():((h=this.implements)==null?void 0:h.toJSONClone({...e,newId:null}))||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,name:this.name,description:this.description,type:this.type,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,constant:this.constant,hidden:this.hidden,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,dataType:((s=this.dataType)==null?void 0:s.toReference(e))||null,implements:((o=this.implements)==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.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...((a=this.dataType)==null?void 0:a.toFlatJSON(e))||[],...((s=this.implements)==null?void 0:s.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,required:this.required,abstract:this.abstract,static:this.static,implements:((e=this.implements)==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.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e,t;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.dataType)==null||t.clearErrors(),this}validate(){return this.errors=O7(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t,n;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...((n=this.dataType)==null?void 0:n.getErrors())||[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var v,I;let a=He(e,this);const s=t||de(w(this,this.project),i.Property,a),o=s.split("-id"),l=o[o.length-1||0]||s;let p=e||this.parent;const u={hidden:!1,id:s,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,constant:this.constant,required:this.required,abstract:this.abstract,static:this.static,defaultValue:null,dataType:null,implements:this.implements,parent:p},h=ke(u,a);n&&h.subscribe(),h.setParent(p),h.initChildren();const f=((v=this.dataType)==null?void 0:v.clone(h,l+"-data-type-id",n))||null;f&&h.setDataType(f);const R=(I=this.defaultValue)==null?void 0:I.clone(h,l+"-default-value-id",n);return h.defaultValue=R||null,this.implements&&(h.implements=this.implements),h.addSelfToProject(),h}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}};c(ce,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(ce,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),c(ce,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,"index"]),c(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),c(ce,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),c(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),c(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let Ur=ce;function w7(r){const e=u5(),t=r.toJSON();e.safeParse(t).success;const a=B7(r),s=M7(r),o=Nt(r);r.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const l=[...a,...s];if(r.id==="getCompanyByIdEndpointReachedEntityEvent"){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});l.push(p.error)}return Me(r.errors,l)}function B7(r){const e=[];if(!r.calls.length){const t=Q({id:`${r.id}--${G.ScopeWithoutLogic}`,message:`Action "${w(r,r.project)}" with id "${r.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:E.Warning,code:G.ScopeWithoutLogic,entity:r});e.push(t.error)}return Me(r.errors,e)}function M7(r){const e=[];return r.implements,Me(r.errors,e)}const ue=class ue{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,"collapsed");c(this,"private");c(this,"index",null);c(this,"type",i.FunctionDeclaration);c(this,"implements",null);c(this,"inputs",[]);c(this,"returnStatements",[]);c(this,"calls",[]);c(this,"parent");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.collapsed=e.collapsed,this.x=e.x,this.y=e.y,this.index=e.index}static fromGenerationTarget(e,t){let n=t;if(e.parent){const l=A(e.parent);n=t.get(l)}let a=null;if(e.implements){const l=A(e.implements);a=t.get(l)}const s={id:e.id,version:1,name:e.name,type:i.FunctionDeclaration,index:n.type===i.DefinitionEntity?n.methods.length:null,description:e.description,collapsed:!1,private:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:n},o=b(s,t);return o.setParent(n),o.initChildren(),o}static validateGenerationTarget(e,t){var h;let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[i.Project,i.InstalledProject,i.DefinitionEntity,i.Loop],optional:!0},implements:{list:!1,types:[i.ActionDescriptor],optional:!0}},t);n=s.modifiedData;const o=Nu(n,t),l=n.parent?t.get(n.parent):null;if(l&&l.type===i.DefinitionEntity){const f=l,v=cr(f).filter(I=>!I.interactive);if(v.length){let I=v.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${f.id}' because it extends or implements multiple '${i.BuiltInBaseEntity}' entities that are non-interactive ("${q(v.map(D=>w(D,D.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${f.id}' because it extends or implements a '${i.BuiltInBaseEntity}' entity that is non-interactive ("${w(v[0],v[0].project)}").`;I+=`
|
|
46
|
-
${lr}`,a.push(new g({id:`${e.id}--${T.NonInteractiveEntityReferenced}`,code:T.NonInteractiveEntityReferenced,severity:E.Error,message:I,issue:null}))}else{const I=f.methods.find(
|
|
46
|
+
${lr}`,a.push(new g({id:`${e.id}--${T.NonInteractiveEntityReferenced}`,code:T.NonInteractiveEntityReferenced,severity:E.Error,message:I,issue:null}))}else{const I=f.methods.find(x=>{var k;return((k=x.implements)==null?void 0:k.id)===n.implements});I&&a.push(new g({id:`${n.id}--${B.MethodOverwrite}`,code:B.MethodOverwrite,severity:E.Error,message:`The '${i.FunctionDeclaration}' with id "${n.id}" is trying to implement the '${i.ActionDescriptor}' with id "${n.implements}", but the parent definition-entity already has a ${i.FunctionDeclaration} with id '${I.id}' that implements the same base method.
|
|
47
47
|
A ${i.FunctionDeclaration} that has a parent of type '${i.DefinitionEntity}' is considered a method of that entity, and cannot implement the same '${i.ActionDescriptor}' more than once.
|
|
48
48
|
${i.ActionDescriptor} entities inside a ${i.DefinitionEntity} are considered abstract methods that can be implemented by ${i.FunctionDeclaration} entities inside the same parent.
|
|
49
|
-
If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${i.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}));const D=n.implements;f.abstractMethods.find(
|
|
49
|
+
If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${i.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}));const D=n.implements;f.abstractMethods.find(x=>x.id===D)||a.push(new g({id:`${n.id}--${T.InvalidImplementsReference}`,code:T.InvalidImplementsReference,severity:E.Error,message:`The '${i.FunctionDeclaration}' with id "${n.id}" is trying to implement the '${i.ActionDescriptor}' with id "${n.implements}", but the parent definition-entity with id "${f.id}" does not have a action descriptor (abstract method) with that id.
|
|
50
50
|
A ${i.FunctionDeclaration} that has a parent of type '${i.DefinitionEntity}' is considered a method of that entity, and if it implements a action-descriptor, it needs to be one of the parent's action descriptors.
|
|
51
51
|
If you want to implement a new method, you can create a new 'function-declaration' inside the parent definition-entity. But note that often definition-entities already come the boiler plate for all the methods they need from the base entity they implement, which are often auto-generated when the parent definition-entity is first created.
|
|
52
52
|
If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${i.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}))}}else if(l&&l.type===i.Loop){const f=l.body;f&&((h=f.implements)==null?void 0:h.id)===n.implements&&a.push(new g({id:`${n.id}--${B.MethodOverwrite}`,code:B.MethodOverwrite,severity:E.Error,message:`The '${i.FunctionDeclaration}' with id "${n.id}" is being added as the 'body' of the ${i.Loop} with id "${l.id}", but the loop already has a function-declaration body. A loop can only have one function-declaration body at a time. You can edit the existing body instead, but it will have to match the same base signature, otherwise the implementation will have a validation error.`,issue:null}))}const p=n.parent&&t.get(n.parent)||t.getBuiltIn(n.parent),u=p?ur(p):null;return u&&a.push(new g({id:`${e.id}--${T.BuiltInEntityParent}`,code:T.BuiltInEntityParent,severity:E.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${w(u,t)}" with id '${u.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null})),a.push(...s.errors,...o,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];return e.parent&&(this.parent.type===i.Project?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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
@@ -57,7 +57,7 @@ ${lr}`,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
|
${gn({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)||ur(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=_7(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(Qa(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,F)=>S.clone(h,p+"-and-group-data-type-"+F+"-id",n)),R=(I=this.orChildrenGroup)==null?void 0:I.map((S,F)=>S.clone(h,p+"-or-group-data-type-"+F+"-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,M.UUID.uuid(),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,M.UUID.uuid(),!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 N7(r){var l;const e=K6(),t=r.toJSON();e.safeParse(t).success;const a=L7(r),s=jn(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(),Me(r.errors,o)}function L7(r){const e=[];return r.inputs.forEach(t=>{t.validate()}),Me(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=SS(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)||ur(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=_7(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(Xa(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,x)=>S.clone(h,p+"-and-group-data-type-"+x+"-id",n)),R=(I=this.orChildrenGroup)==null?void 0:I.map((S,x)=>S.clone(h,p+"-or-group-data-type-"+x+"-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,M.UUID.uuid(),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,M.UUID.uuid(),!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:M.UUID.uuid(),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 N7(r){var l;const e=K6(),t=r.toJSON();e.safeParse(t).success;const a=L7(r),s=jn(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(),Me(r.errors,o)}function L7(r){const e=[];return r.inputs.forEach(t=>{t.validate()}),Me(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=SS(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
|
- `)}.
|
|
@@ -73,28 +73,28 @@ ${sl(t)}`,issue:null})):a.push(new g({id:`${e.id}--${T.ReferencedEntityNotFound}
|
|
|
73
73
|
${sl(t)}`,issue:null})):a.push(new g({id:`${e.id}--${B.InvalidObjectStructure}`,code:B.InvalidObjectStructure,severity:E.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'declaration' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for '${i.Condition}' entities.
|
|
74
74
|
${sl(t)}`,issue:null})),{errors:a,modifiedData:n}}static fromReturnDeclarationToBodyArgumentDeclarationName(e){return`Previous iteration results of '${w(e,e.project)}'`}static fromBodyArgumentDeclarationToReturnDeclarationName(e){const t=e.name.replace("Previous iteration results of '","");return t.slice(0,t.length-1)}static fromReturnDeclarationToLoopOutputDeclarationName(e){return`Result list of '${w(e,e.project)}'`}static fromLoopOutputDeclarationToReturnDeclarationName(e){const t=e.name.replace("Result list of '","");return t.slice(0,t.length-1)}static fromLoopOutputDeclarationToBodyArgumentDeclarationName(e){return e.name.replace("Result list of '","Previous iteration results of '")}static fromBodyArgumentDeclarationToLoopOutputDeclarationName(e){return e.name.replace("Previous iteration results of '","Result list of '")}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.
|
|
75
75
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
76
|
-
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.syncChildren();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{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)}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(n=>n.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),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}setBody(e){return this.body=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}replaceDetachedChild(e,t){const n=this.detachedChildren.indexOf(e);return n!==-1&&(this.detachedChildren[n]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=b(this.initialData.declaration,this.project),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.outputs=this.initialData.outputs.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.body&&(this.body=b(this.initialData.body,this.project),this.body.setParent(this),this.body.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 Z.repository.load(this.id,...t),this}async create(e=V,...t){return await Z.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Z.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Z.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.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),{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.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.body.restore({seenEntities:e}),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.inputs.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(n=>n.toFlat(e)),...this.errorCalls.flatMap(n=>n.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(n=>n.toFlat(e)),...this.breakStatements.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(n=>n.toFlatIds(e)),...this.outputs.flatMap(n=>n.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(n=>n.toFlatIds(e)),...this.errorCalls.flatMap(n=>n.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(n=>n.toFlatIds(e)),...this.breakStatements.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,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))||null,declaration:this.declaration.toJSON(e),inputs:this.inputs.map(a=>a.toJSON(e)),outputs:this.outputs.map(a=>a.toJSON(e)),outputsDeclarations:this.outputsDeclarations.map(a=>a.toJSON(e)),successCalls:this.successCalls.map(a=>a.toJSON(e)),errorCalls:this.errorCalls.map(a=>a.toJSON(e)),error:((n=this.error)==null?void 0:n.toJSON(e))||null,body:this.body.toJSON(e),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(a=>a.toJSON(e)),continueStatements:this.continueStatements.map(a=>a.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,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}))||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(h=>h.toJSONClone({...e,newId:null})),outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),outputsDeclarations:this.outputsDeclarations.map(h=>h.toJSONClone({...e,newId:null})),successCalls:this.successCalls.map(h=>h.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(h=>h.toJSONClone({...e,newId:null})),error:((u=this.error)==null?void 0:u.toJSONClone({...e,newId:null}))||null,body:this.body.toJSONClone({...e,newId:null}),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),breakStatements:this.breakStatements.map(h=>h.toJSONClone({...e,newId:null})),continueStatements:this.continueStatements.map(h=>h.toJSONClone({...e,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+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n,a,s,o,l;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,declaration:((a=this.declaration)==null?void 0:a.toReference(e))||null,body:((s=this.body)==null?void 0:s.toReference(e))||null,inputs:this.inputs.map(p=>p.toReference(e)),outputs:this.outputs.map(p=>p.toReference(e)),outputsDeclarations:this.outputsDeclarations.map(p=>p.toReference(e)),successCalls:this.successCalls.map(p=>p.toReference(e)),errorCalls:this.errorCalls.map(p=>p.toReference(e)),process:((o=this.process)==null?void 0:o.toReference(e))||null,calledBySuccess:this.calledBySuccess.map(p=>p.toReference(e)),calledByError:this.calledByError.map(p=>p.toReference(e)),calledByEntry:this.calledByEntry.map(p=>p.toReference(e)),continueStatements:this.continueStatements.map(p=>p.toReference(e)),breakStatements:this.breakStatements.map(p=>p.toReference(e)),error:((l=this.error)==null?void 0:l.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.body)==null?void 0:n.toFlatJSON(e))||[],...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.continueStatements.flatMap(a=>a.toFlatJSON(e)),...this.breakStatements.flatMap(a=>a.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[],...this.process?this.process.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,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){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.body)==null?void 0:n.toFlatGenerationTarget(e))||[],...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.continueStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.breakStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[],...this.process?this.process.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()),this.continueStatements.forEach(n=>n.clearErrors()),this.breakStatements.forEach(n=>n.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=$7(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.body?this.body.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.Loop,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.body&&(u.body=this.body.clone(u,p+"-body-id",n,!0)),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}getVariableInstances(){return this.body?Se(this.body).filter(n=>n.type===i.VariableInstance):[]}addReturnStatement(e){return We.includes(this.parent.type)&&this.parent.addReturnStatement(e),this}removeReturnStatement(e){return We.includes(this.parent.type)&&this.parent.removeReturnStatement(e),this}addBreakStatement(e){return this.breakStatements.includes(e)||this.breakStatements.push(e),this}removeBreakStatement(e){const t=this.breakStatements.indexOf(e);return t!==-1&&this.breakStatements.splice(t,1),this}addContinueStatement(e){return this.continueStatements.includes(e)||this.continueStatements.push(e),this}removeContinueStatement(e){const t=this.continueStatements.indexOf(e);return t!==-1&&this.continueStatements.splice(t,1),this}getUniqueReturnDeclarations(){const e=[];return[...this.breakStatements,...this.continueStatements].forEach(n=>{n.outputs.forEach(s=>{e.find(l=>l===s||w(l,this.project)===w(s,this.project)&&Zt(l.dataType,s.dataType))||e.push(s)})}),m(e)}syncTerminationStatements(){const e=[],t=[],n=[],a=this.getUniqueReturnDeclarations();return[...this.breakStatements,...this.continueStatements].forEach(o=>{const l=o.outputs,p=a.filter(u=>!l.find(h=>w(u,this.project)===w(h,this.project)&&Zt(u.dataType,h.dataType)));p.length&&e.push(o),p.forEach(u=>{const h=u.clone(o);h.addSelfToProject(),t.push(h)})}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncBodyInputIndexes(){const e=[],t=[],n=[];return this.body.inputs.sort((s,o)=>s.index-o.index),this.body.inputs.forEach((s,o)=>{s.index!==o&&(s.sync({index:o}),e.push(s))}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncBodyArgumentsDeclarations(){const e=[],t=[],n=[],{updated:a,added:s,removed:o}=this.syncFixedBodyArgumentDeclarations();e.push(...a),t.push(...s),n.push(...o);const l=this.getUniqueReturnDeclarations(),p=this.body.inputs;l.sort((R,v)=>R.index-v.index),l.forEach(R=>{const v=R.getDataType();let D=p.find(ae=>w(ae,this.project)===Z.fromReturnDeclarationToBodyArgumentDeclarationName(R)&&Zt(ae.dataType,R.dataType));if(!D){const ae=Z.fromReturnDeclarationToBodyArgumentDeclarationName(R),Xe={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:ae,description:`Aggretated list of all previously outputted values from each iteration by the output '${w(R,this.project)}'`,defaultValue:null,constant:!0,dataType:null,implements:null,index:R.index,required:R.required,parent:this.body.toReference(),writesValues:[]},Ct=b(Xe,this.project);Ct.setParent(this.body),Ct.initChildren(),Ct.addSelfToProject(),t.push(Ct),D=Ct}const S=this.body.inputs.find(ae=>ae.index===D.index&&ae!==D),F=this.body.inputs.filter(ae=>ae!==D);let j=D.index;S&&(j=Math.max(...F.map(ae=>ae.index))+1),D.index!==j&&(D.sync({index:j}),e.push(D));const K=D.getDataType();let oe=K;if(v)if(!K||!Zt(K,v)){if(!oe){const ae=v.clone(D);ae.addSelfToProject(),oe=ae,t.push(ae),e.push(D)}oe.merge(v),oe.sync({isList:!0})}else oe.isList||(oe.sync({isList:!0}),e.push(oe));if(!v&&!oe){const ae={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},Xe=b(ae,this.project);Xe.sync({isList:!0}),Xe.setParent(D),Xe.initChildren(),Xe.addSelfToProject(),t.push(Xe)}});const{updated:u,added:h,removed:f}=this.removeExtraBodyArgumentDeclarations();return e.push(...u),t.push(...h),n.push(...f),{updated:m(e),added:m(t),removed:m(n),self:this}}syncOutputsDeclarations(){const e=[],t=[],n=[],a=this.getUniqueReturnDeclarations(),s=this.outputsDeclarations;return a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let h=s.find(v=>w(v,this.project)===Z.fromReturnDeclarationToLoopOutputDeclarationName(l)&&Zt(v.dataType,l.dataType));if(!h){const v=Z.fromReturnDeclarationToLoopOutputDeclarationName(l),I={id:M.UUID.uuid(),version:1,type:i.ValueDescriptor,name:v,description:`Aggretated list of all previously outputted values from each iteration by the output '${w(l,this.project)}'`,defaultValue:null,dataType:null,index:l.index,required:l.required,parentRelationType:P.FixedReturns,parent:this.toReference()},D=b(I,this.project);D.setParent(this),D.initChildren(),D.addSelfToProject(),t.push(D),h=D}h.index!==l.index&&(h.sync({index:l.index}),e.push(h));let R=h.getDataType();if(p)if(!R||!Zt(R,p)){if(!R){const v=p.clone(h);v.addSelfToProject(),R=v,t.push(v),e.push(h)}R.merge(p),R.sync({isList:!0})}else R.isList||(R.sync({isList:!0}),e.push(R));if(!p&&!R){const v={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:h.toReference()},I=b(v,this.project);I.sync({isList:!0}),I.setParent(h),I.initChildren(),I.addSelfToProject(),t.push(I)}}),s.filter(l=>!a.find(u=>w(l,this.project)===Z.fromReturnDeclarationToLoopOutputDeclarationName(u))).forEach(l=>{const{affected:p,removed:u}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),n.push(...u)}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncOutputMaps(){const e=[],t=[],n=[],a=this.outputsDeclarations,s=this.outputs;return a.forEach(l=>{var h;let u=s.find(f=>{var R,v;return((R=f.declaration)==null?void 0:R.id)===l.id&&Zt((v=f.declaration)==null?void 0:v.dataType,l.dataType)});if(u)((h=u.declaration)==null?void 0:h.id)!==l.id&&(u.setDeclaration(l),e.push(u));else{const f={id:M.UUID.uuid(),version:1,type:i.OutputMap,defaultValue:null,index:l.index,declaration:l.toJSON(),writesValues:[],parent:this.toReference()},R=b(f,this.project);R.setParent(this),R.initChildren(),R.addSelfToProject(),t.push(R),u=R}u.index!==l.index&&(u.sync({index:l.index}),e.push(u))}),s.filter(l=>!a.find(u=>{var h;return((h=l.declaration)==null?void 0:h.id)===u.id})).forEach(l=>{const{affected:p,removed:u}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),n.push(...u)}),{updated:m(e),added:m(t),removed:m(n),self:this}}createCurrentIterationNumberArgumentDeclaration(){const e=[],t=[],n=[];let s=this.body.inputs.find(u=>{var h;return u.name===Z.CURRENT_ITERATION_NUMBER_ARG_NAME||u.id===((h=this.currentIterationNumberArgumentDeclaration)==null?void 0:h.id)});const o=this.getCurrentIterationNumberBuiltInValueDescriptor();if(!s){const u={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_ITERATION_NUMBER_ARG_NAME,description:"The number of the current iteration",defaultValue:null,constant:!0,dataType:null,implements:o==null?void 0:o.toJSON(),index:this.body.inputs.length,required:!0,parent:this.body.toReference(),writesValues:[]},h=b(u,this.project);h.setParent(this.body),h.initChildren(),h.addSelfToProject(),t.push(h),s=h}!s.index&&s.index!==0&&(s.sync({index:0}),e.push(s)),(!s.implements||s.implements.id!==o.id)&&(s.setImplements(o),e.push(s));let p=s.getDataType();if(!p){const u={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:s.toReference()},h=b(u,this.project);h.setParent(s),h.initChildren(),h.addSelfToProject(),t.push(h),p=h}if(!p.entity||p.entity.type!==i.PrimitiveEntity||p.entity.name!==C.Number||p.entity.id!==_["primitive-entity"].number.id){const u=this.project.getBuiltIn(_["primitive-entity"].number.id);p.setEntity(u),e.push(p)}return this.currentIterationNumberArgumentDeclaration=s,{updated:m(e),added:m(t),removed:m(n),self:this}}removeExtraBodyArgumentDeclarations(){const e=[],t=[],n=[],a=this.body.inputs,s=this.getUniqueReturnDeclarations();return a.filter(l=>l===this.currentIterationNumberArgumentDeclaration||l===this.currentValueArgumentDeclaration?!1:!s.find(u=>w(l,this.project)===Z.fromReturnDeclarationToBodyArgumentDeclarationName(u))).forEach(l=>{const{affected:p,removed:u}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),n.push(...u)}),{updated:m(e),added:m(t),removed:m(n),self:this}}createCurrentValueInputBasedOnInputMap(){var l,p,u,h,f;const e=[],t=[],n=[];switch(this.declaration.id){case k.List:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][k.List].body.inputs.currentValue.id}),v=this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][k.List].inputs.list.id});if(!v)break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop][k.List].inputs.list.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let F=R.getDataType();if(!F){const K={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},oe=b(K,this.project);oe.setParent(D),oe.initChildren(),oe.addSelfToProject(),t.push(oe),F=oe}const j=v.getDataType();F.merge(j),F.sync({isList:!1})}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}case k.ManualFlow:{this.currentValueArgumentDeclaration=null;break}case k.Counted:{this.currentValueArgumentDeclaration=null;break}case k.ObjectKeys:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][k.ObjectKeys].body.inputs.currentValue.id});if(!this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][k.ObjectKeys].inputs.object.id}))break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop][k.ObjectKeys].inputs.object.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let F=R.getDataType();if(F){const j=this.project.getBuiltIn(_["primitive-entity"].string.id);((l=F.entity)==null?void 0:l.id)!==j.id&&(F.setEntity(j),e.push(F))}else{const j={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},K=b(j,this.project);K.setParent(D),K.initChildren(),K.addSelfToProject(),F=K}}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}case k.ObjectValues:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][k.ObjectValues].body.inputs.currentValue.id}),v=this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][k.ObjectValues].inputs.object.id});if(!v)break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop][k.ObjectValues].inputs.object.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let F=R.getDataType();if(F){const j=v.getDataType(),K=((u=j==null?void 0:j.entity)==null?void 0:u.properties)||[];(h=F.orChildrenGroup)==null||h.forEach(oe=>{const{affected:ae,removed:Xe}=oe.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...ae),n.push(...Xe)}),K.forEach(oe=>{const ae=oe.getDataType();if(ae){const Xe=ae.clone(F);Xe.sync({parentRelationType:et.OrDataTypeGroup}),Xe.addSelfToProject(),t.push(Xe)}else{const Xe={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:et.OrDataTypeGroup,parent:F.toReference()},Ct=b(Xe,this.project);Ct.setParent(F),Ct.initChildren(),Ct.addSelfToProject(),t.push(Ct)}})}else{const j={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},K=b(j,this.project);K.setParent(D),K.initChildren(),K.addSelfToProject(),F=K;const oe=v.getDataType();(((p=oe==null?void 0:oe.entity)==null?void 0:p.properties)||[]).forEach(Xe=>{const Ct=Xe.getDataType();if(Ct){const ni=Ct.clone(K);ni.sync({parentRelationType:et.OrDataTypeGroup}),ni.addSelfToProject(),t.push(ni)}else{const ni={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:et.OrDataTypeGroup,parent:K.toReference()},vl=b(ni,this.project);vl.setParent(K),vl.initChildren(),vl.addSelfToProject(),t.push(vl)}})}}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,constant:!0,defaultValue:null,index:this.body.inputs.length,required:!0,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}case k.String:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][k.String].body.inputs.currentValue.id});if(!this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][k.String].inputs.string.id}))break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop]["string-loop"].inputs.string.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let F=R.getDataType();if(F){const j=this.project.getBuiltIn(_["primitive-entity"].string.id);((f=F.entity)==null?void 0:f.id)!==j.id&&(F.setEntity(j),e.push(F))}else{const j={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},K=b(j,this.project);K.setParent(D),K.initChildren(),K.addSelfToProject(),t.push(K),F=K}}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,index:this.body.inputs.length,required:!0,constant:!0,defaultValue:null,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}}const{updated:a,added:s,removed:o}=this.removeExtraBodyArgumentDeclarations();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}syncFixedBodyArgumentDeclarations(){const e=[],t=[],n=[],{updated:a,added:s,removed:o}=this.createCurrentIterationNumberArgumentDeclaration();e.push(...a),t.push(...s),n.push(...o);const{updated:l,added:p,removed:u}=this.createCurrentValueInputBasedOnInputMap();return e.push(...l),t.push(...p),n.push(...u),{updated:m(e),added:m(t),removed:m(n),self:this}}syncInputMaps(){const e=[],t=[],n=[];switch(this.declaration.id){case k.List:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["list-loop"].inputs.list.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["list-loop"].inputs.list.id){const s=this.project.get(_[i.Loop]["list-loop"].inputs.list.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["list-loop"].inputs.list.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case k.ManualFlow:{this.inputs.forEach(a=>{a.remove(),n.push(a)});break}case k.Counted:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["counted-loop"].inputs.number.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["counted-loop"].inputs.number.id){const s=this.project.get(_[i.Loop]["counted-loop"].inputs.number.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["counted-loop"].inputs.number.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case k.ObjectKeys:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["object-keys-loop"].inputs.object.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["object-keys-loop"].inputs.object.id){const s=this.project.get(_[i.Loop]["object-keys-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["object-keys-loop"].inputs.object.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case k.ObjectValues:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["object-values-loop"].inputs.object.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["object-values-loop"].inputs.object.id){const s=this.project.get(_[i.Loop]["object-values-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["object-values-loop"].inputs.object.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case k.String:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["string-loop"].inputs.string.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["string-loop"].inputs.string.id){const s=this.project.get(_[i.Loop]["string-loop"].inputs.string.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["string-loop"].inputs.string.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}}return{updated:m(e),added:m(t),removed:m(n),self:this}}getCurrentValueBuiltInValueDescriptor(){var t;const e=(t=_[i.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:t.id;return e?this.project.get(e):null}getCurrentIterationNumberBuiltInValueDescriptor(){const e=_[i.Loop][this.declaration.id].body.inputs.iterationNumber.id;return this.project.get(e)}syncBody(){var o;const e=[],t=[],n=[],a=_[i.Loop][this.declaration.id].body.id,s=this.project.getBuiltIn(a);if(this.body)((o=this.body.implements)==null?void 0:o.id)!==s.id&&(this.body.setImplements(s),this.body.setParent(this),e.push(this.body));else{const l={id:M.UUID.uuid(),version:1,type:i.FunctionDeclaration,name:s.name,description:null,inputs:[],index:null,returnStatements:[],calls:[],collapsed:!1,private:!1,implements:s.toJSON(),x:0,y:0,parent:this.toReference()},p=b(l,this.project);p.initChildren(),p.setParent(this),p.addSelfToProject(),t.push(p)}return{self:this,updated:m(e),added:m(t),removed:m(n)}}syncChildren(){const e=[],t=[],n=[],{updated:a,added:s,removed:o}=this.syncBody();e.push(...a),t.push(...s),n.push(...o);const{updated:l,added:p,removed:u}=this.syncInputMaps();e.push(...l),t.push(...p),n.push(...u);const{updated:h,added:f,removed:R}=this.syncTerminationStatements();e.push(...h),t.push(...f),n.push(...R);const{updated:v,added:I,removed:D}=this.syncBodyArgumentsDeclarations();e.push(...v),t.push(...I),n.push(...D);const{updated:S,added:F,removed:j}=this.syncBodyInputIndexes();e.push(...S),t.push(...F),n.push(...j);const{updated:K,added:oe,removed:ae}=this.syncOutputsDeclarations();e.push(...K),t.push(...oe),n.push(...ae);const{updated:Xe,added:Ct,removed:ni}=this.syncOutputMaps();return e.push(...Xe),t.push(...Ct),n.push(...ni),{self:this,updated:m(e),added:m(t),removed:m(n)}}};c(Z,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Z,"CURRENT_ITERATION_NUMBER_ARG_NAME","Current iteration number"),c(Z,"CURRENT_VALUE_ARG_NAME","Current value"),c(Z,"MUTABLE_BASE_PROPERTIES",[]),c(Z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Z,"BASE_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"MUTABLE_META_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Z,"INMUTABLE_META_PROPERTIES",[...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"META_PROPERTIES",[...Z.MUTABLE_META_PROPERTIES,...Z.INMUTABLE_META_PROPERTIES]),c(Z,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Z,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(Z,"UPSTREAM_PROPERTIES",[...Z.MUTABLE_UPSTREAM_PROPERTIES,...Z.INMUTABLE_UPSTREAM_PROPERTIES]),c(Z,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","outputsDeclarations","successCalls","errorCalls","error","breakStatements","continueStatements"]),c(Z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Z,"DOWNSTREAM_PROPERTIES",[...Z.MUTABLE_DOWNSTREAM_PROPERTIES,...Z.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Z,"PROPERTIES",[...Z.META_PROPERTIES,...Z.UPSTREAM_PROPERTIES,...Z.DOWNSTREAM_PROPERTIES]);let kr=Z;function F7(r){const e=N6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(o=>o.validate());const s=[...jn(r)];return Me(r.errors,s)}const Oe=class Oe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Condition);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"declaration");c(this,"inputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");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 h=A(e.parent);n=t.get(h)}const a=e.calledByEntry.map(h=>{const f=A(h);return t.get(f)}),s=e.calledBySuccess.map(h=>{const f=A(h);return t.get(f)}),o=e.calledByError.map(h=>{const f=A(h);return t.get(f)});let l;if(e.declaration){const h=A(e.declaration);l=t.get(h)}const p={id:e.id,version:1,type:i.Condition,declaration:l,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:n},u=b(p,t);return u.setParent(n),u.initChildren(),u}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);return n=s.modifiedData,a.push(...s.errors,...je(n)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new g({id:`${e.id}--${T.InvalidImplementsReference}`,code:T.InvalidImplementsReference,severity:E.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${i.Condition}' entities.
|
|
76
|
+
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.syncChildren();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{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)}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(n=>n.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),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}setBody(e){return this.body=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}replaceDetachedChild(e,t){const n=this.detachedChildren.indexOf(e);return n!==-1&&(this.detachedChildren[n]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=b(this.initialData.declaration,this.project),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.outputs=this.initialData.outputs.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.body&&(this.body=b(this.initialData.body,this.project),this.body.setParent(this),this.body.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 Z.repository.load(this.id,...t),this}async create(e=V,...t){return await Z.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Z.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Z.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.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),{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.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.body.restore({seenEntities:e}),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.inputs.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(n=>n.toFlat(e)),...this.errorCalls.flatMap(n=>n.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(n=>n.toFlat(e)),...this.breakStatements.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(n=>n.toFlatIds(e)),...this.outputs.flatMap(n=>n.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(n=>n.toFlatIds(e)),...this.errorCalls.flatMap(n=>n.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(n=>n.toFlatIds(e)),...this.breakStatements.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,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))||null,declaration:this.declaration.toJSON(e),inputs:this.inputs.map(a=>a.toJSON(e)),outputs:this.outputs.map(a=>a.toJSON(e)),outputsDeclarations:this.outputsDeclarations.map(a=>a.toJSON(e)),successCalls:this.successCalls.map(a=>a.toJSON(e)),errorCalls:this.errorCalls.map(a=>a.toJSON(e)),error:((n=this.error)==null?void 0:n.toJSON(e))||null,body:this.body.toJSON(e),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(a=>a.toJSON(e)),continueStatements:this.continueStatements.map(a=>a.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,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}))||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(h=>h.toJSONClone({...e,newId:null})),outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),outputsDeclarations:this.outputsDeclarations.map(h=>h.toJSONClone({...e,newId:null})),successCalls:this.successCalls.map(h=>h.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(h=>h.toJSONClone({...e,newId:null})),error:((u=this.error)==null?void 0:u.toJSONClone({...e,newId:null}))||null,body:this.body.toJSONClone({...e,newId:null}),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),breakStatements:this.breakStatements.map(h=>h.toJSONClone({...e,newId:null})),continueStatements:this.continueStatements.map(h=>h.toJSONClone({...e,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+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n,a,s,o,l;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,declaration:((a=this.declaration)==null?void 0:a.toReference(e))||null,body:((s=this.body)==null?void 0:s.toReference(e))||null,inputs:this.inputs.map(p=>p.toReference(e)),outputs:this.outputs.map(p=>p.toReference(e)),outputsDeclarations:this.outputsDeclarations.map(p=>p.toReference(e)),successCalls:this.successCalls.map(p=>p.toReference(e)),errorCalls:this.errorCalls.map(p=>p.toReference(e)),process:((o=this.process)==null?void 0:o.toReference(e))||null,calledBySuccess:this.calledBySuccess.map(p=>p.toReference(e)),calledByError:this.calledByError.map(p=>p.toReference(e)),calledByEntry:this.calledByEntry.map(p=>p.toReference(e)),continueStatements:this.continueStatements.map(p=>p.toReference(e)),breakStatements:this.breakStatements.map(p=>p.toReference(e)),error:((l=this.error)==null?void 0:l.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.body)==null?void 0:n.toFlatJSON(e))||[],...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.continueStatements.flatMap(a=>a.toFlatJSON(e)),...this.breakStatements.flatMap(a=>a.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[],...this.process?this.process.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,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){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.body)==null?void 0:n.toFlatGenerationTarget(e))||[],...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.continueStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.breakStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[],...this.process?this.process.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()),this.continueStatements.forEach(n=>n.clearErrors()),this.breakStatements.forEach(n=>n.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=$7(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.body?this.body.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.Loop,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.body&&(u.body=this.body.clone(u,p+"-body-id",n,!0)),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}getVariableInstances(){return this.body?Se(this.body).filter(n=>n.type===i.VariableInstance):[]}addReturnStatement(e){return We.includes(this.parent.type)&&this.parent.addReturnStatement(e),this}removeReturnStatement(e){return We.includes(this.parent.type)&&this.parent.removeReturnStatement(e),this}addBreakStatement(e){return this.breakStatements.includes(e)||this.breakStatements.push(e),this}removeBreakStatement(e){const t=this.breakStatements.indexOf(e);return t!==-1&&this.breakStatements.splice(t,1),this}addContinueStatement(e){return this.continueStatements.includes(e)||this.continueStatements.push(e),this}removeContinueStatement(e){const t=this.continueStatements.indexOf(e);return t!==-1&&this.continueStatements.splice(t,1),this}getUniqueReturnDeclarations(){const e=[];return[...this.breakStatements,...this.continueStatements].forEach(n=>{n.outputs.forEach(s=>{e.find(l=>l===s||w(l,this.project)===w(s,this.project)&&Zt(l.dataType,s.dataType))||e.push(s)})}),m(e)}syncTerminationStatements(){const e=[],t=[],n=[],a=this.getUniqueReturnDeclarations();return[...this.breakStatements,...this.continueStatements].forEach(o=>{const l=o.outputs,p=a.filter(u=>!l.find(h=>w(u,this.project)===w(h,this.project)&&Zt(u.dataType,h.dataType)));p.length&&e.push(o),p.forEach(u=>{const h=u.clone(o);h.addSelfToProject(),t.push(h)})}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncBodyInputIndexes(){const e=[],t=[],n=[];return this.body.inputs.sort((s,o)=>s.index-o.index),this.body.inputs.forEach((s,o)=>{s.index!==o&&(s.sync({index:o}),e.push(s))}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncBodyArgumentsDeclarations(){const e=[],t=[],n=[],{updated:a,added:s,removed:o}=this.syncFixedBodyArgumentDeclarations();e.push(...a),t.push(...s),n.push(...o);const l=this.getUniqueReturnDeclarations(),p=this.body.inputs;l.sort((R,v)=>R.index-v.index),l.forEach(R=>{const v=R.getDataType();let D=p.find(ae=>w(ae,this.project)===Z.fromReturnDeclarationToBodyArgumentDeclarationName(R)&&Zt(ae.dataType,R.dataType));if(!D){const ae=Z.fromReturnDeclarationToBodyArgumentDeclarationName(R),Xe={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:ae,description:`Aggretated list of all previously outputted values from each iteration by the output '${w(R,this.project)}'`,defaultValue:null,constant:!0,dataType:null,implements:null,index:R.index,required:R.required,parent:this.body.toReference(),writesValues:[]},Ct=b(Xe,this.project);Ct.setParent(this.body),Ct.initChildren(),Ct.addSelfToProject(),t.push(Ct),D=Ct}const S=this.body.inputs.find(ae=>ae.index===D.index&&ae!==D),x=this.body.inputs.filter(ae=>ae!==D);let k=D.index;S&&(k=Math.max(...x.map(ae=>ae.index))+1),D.index!==k&&(D.sync({index:k}),e.push(D));const K=D.getDataType();let oe=K;if(v)if(!K||!Zt(K,v)){if(!oe){const ae=v.clone(D);ae.addSelfToProject(),oe=ae,t.push(ae),e.push(D)}oe.merge(v),oe.sync({isList:!0})}else oe.isList||(oe.sync({isList:!0}),e.push(oe));if(!v&&!oe){const ae={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},Xe=b(ae,this.project);Xe.sync({isList:!0}),Xe.setParent(D),Xe.initChildren(),Xe.addSelfToProject(),t.push(Xe)}});const{updated:u,added:h,removed:f}=this.removeExtraBodyArgumentDeclarations();return e.push(...u),t.push(...h),n.push(...f),{updated:m(e),added:m(t),removed:m(n),self:this}}syncOutputsDeclarations(){const e=[],t=[],n=[],a=this.getUniqueReturnDeclarations(),s=this.outputsDeclarations;return a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let h=s.find(v=>w(v,this.project)===Z.fromReturnDeclarationToLoopOutputDeclarationName(l)&&Zt(v.dataType,l.dataType));if(!h){const v=Z.fromReturnDeclarationToLoopOutputDeclarationName(l),I={id:M.UUID.uuid(),version:1,type:i.ValueDescriptor,name:v,description:`Aggretated list of all previously outputted values from each iteration by the output '${w(l,this.project)}'`,defaultValue:null,dataType:null,index:l.index,required:l.required,parentRelationType:P.FixedReturns,parent:this.toReference()},D=b(I,this.project);D.setParent(this),D.initChildren(),D.addSelfToProject(),t.push(D),h=D}h.index!==l.index&&(h.sync({index:l.index}),e.push(h));let R=h.getDataType();if(p)if(!R||!Zt(R,p)){if(!R){const v=p.clone(h);v.addSelfToProject(),R=v,t.push(v),e.push(h)}R.merge(p),R.sync({isList:!0})}else R.isList||(R.sync({isList:!0}),e.push(R));if(!p&&!R){const v={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:h.toReference()},I=b(v,this.project);I.sync({isList:!0}),I.setParent(h),I.initChildren(),I.addSelfToProject(),t.push(I)}}),s.filter(l=>!a.find(u=>w(l,this.project)===Z.fromReturnDeclarationToLoopOutputDeclarationName(u))).forEach(l=>{const{affected:p,removed:u}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),n.push(...u)}),{updated:m(e),added:m(t),removed:m(n),self:this}}syncOutputMaps(){const e=[],t=[],n=[],a=this.outputsDeclarations,s=this.outputs;return a.forEach(l=>{var h;let u=s.find(f=>{var R,v;return((R=f.declaration)==null?void 0:R.id)===l.id&&Zt((v=f.declaration)==null?void 0:v.dataType,l.dataType)});if(u)((h=u.declaration)==null?void 0:h.id)!==l.id&&(u.setDeclaration(l),e.push(u));else{const f={id:M.UUID.uuid(),version:1,type:i.OutputMap,defaultValue:null,index:l.index,declaration:l.toJSON(),writesValues:[],parent:this.toReference()},R=b(f,this.project);R.setParent(this),R.initChildren(),R.addSelfToProject(),t.push(R),u=R}u.index!==l.index&&(u.sync({index:l.index}),e.push(u))}),s.filter(l=>!a.find(u=>{var h;return((h=l.declaration)==null?void 0:h.id)===u.id})).forEach(l=>{const{affected:p,removed:u}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),n.push(...u)}),{updated:m(e),added:m(t),removed:m(n),self:this}}createCurrentIterationNumberArgumentDeclaration(){const e=[],t=[],n=[];let s=this.body.inputs.find(u=>{var h;return u.name===Z.CURRENT_ITERATION_NUMBER_ARG_NAME||u.id===((h=this.currentIterationNumberArgumentDeclaration)==null?void 0:h.id)});const o=this.getCurrentIterationNumberBuiltInValueDescriptor();if(!s){const u={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_ITERATION_NUMBER_ARG_NAME,description:"The number of the current iteration",defaultValue:null,constant:!0,dataType:null,implements:o==null?void 0:o.toJSON(),index:this.body.inputs.length,required:!0,parent:this.body.toReference(),writesValues:[]},h=b(u,this.project);h.setParent(this.body),h.initChildren(),h.addSelfToProject(),t.push(h),s=h}!s.index&&s.index!==0&&(s.sync({index:0}),e.push(s)),(!s.implements||s.implements.id!==o.id)&&(s.setImplements(o),e.push(s));let p=s.getDataType();if(!p){const u={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:s.toReference()},h=b(u,this.project);h.setParent(s),h.initChildren(),h.addSelfToProject(),t.push(h),p=h}if(!p.entity||p.entity.type!==i.PrimitiveEntity||p.entity.name!==C.Number||p.entity.id!==_["primitive-entity"].number.id){const u=this.project.getBuiltIn(_["primitive-entity"].number.id);p.setEntity(u),e.push(p)}return this.currentIterationNumberArgumentDeclaration=s,{updated:m(e),added:m(t),removed:m(n),self:this}}removeExtraBodyArgumentDeclarations(){const e=[],t=[],n=[],a=this.body.inputs,s=this.getUniqueReturnDeclarations();return a.filter(l=>l===this.currentIterationNumberArgumentDeclaration||l===this.currentValueArgumentDeclaration?!1:!s.find(u=>w(l,this.project)===Z.fromReturnDeclarationToBodyArgumentDeclarationName(u))).forEach(l=>{const{affected:p,removed:u}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),n.push(...u)}),{updated:m(e),added:m(t),removed:m(n),self:this}}createCurrentValueInputBasedOnInputMap(){var l,p,u,h,f;const e=[],t=[],n=[];switch(this.declaration.id){case j.List:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][j.List].body.inputs.currentValue.id}),v=this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][j.List].inputs.list.id});if(!v)break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop][j.List].inputs.list.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let x=R.getDataType();if(!x){const K={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},oe=b(K,this.project);oe.setParent(D),oe.initChildren(),oe.addSelfToProject(),t.push(oe),x=oe}const k=v.getDataType();x.merge(k),x.sync({isList:!1})}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}case j.ManualFlow:{this.currentValueArgumentDeclaration=null;break}case j.Counted:{this.currentValueArgumentDeclaration=null;break}case j.ObjectKeys:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][j.ObjectKeys].body.inputs.currentValue.id});if(!this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][j.ObjectKeys].inputs.object.id}))break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop][j.ObjectKeys].inputs.object.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let x=R.getDataType();if(x){const k=this.project.getBuiltIn(_["primitive-entity"].string.id);((l=x.entity)==null?void 0:l.id)!==k.id&&(x.setEntity(k),e.push(x))}else{const k={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},K=b(k,this.project);K.setParent(D),K.initChildren(),K.addSelfToProject(),x=K}}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}case j.ObjectValues:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][j.ObjectValues].body.inputs.currentValue.id}),v=this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][j.ObjectValues].inputs.object.id});if(!v)break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop][j.ObjectValues].inputs.object.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let x=R.getDataType();if(x){const k=v.getDataType(),K=((u=k==null?void 0:k.entity)==null?void 0:u.properties)||[];(h=x.orChildrenGroup)==null||h.forEach(oe=>{const{affected:ae,removed:Xe}=oe.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...ae),n.push(...Xe)}),K.forEach(oe=>{const ae=oe.getDataType();if(ae){const Xe=ae.clone(x);Xe.sync({parentRelationType:et.OrDataTypeGroup}),Xe.addSelfToProject(),t.push(Xe)}else{const Xe={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:et.OrDataTypeGroup,parent:x.toReference()},Ct=b(Xe,this.project);Ct.setParent(x),Ct.initChildren(),Ct.addSelfToProject(),t.push(Ct)}})}else{const k={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},K=b(k,this.project);K.setParent(D),K.initChildren(),K.addSelfToProject(),x=K;const oe=v.getDataType();(((p=oe==null?void 0:oe.entity)==null?void 0:p.properties)||[]).forEach(Xe=>{const Ct=Xe.getDataType();if(Ct){const ni=Ct.clone(K);ni.sync({parentRelationType:et.OrDataTypeGroup}),ni.addSelfToProject(),t.push(ni)}else{const ni={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:et.OrDataTypeGroup,parent:K.toReference()},vl=b(ni,this.project);vl.setParent(K),vl.initChildren(),vl.addSelfToProject(),t.push(vl)}})}}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,constant:!0,defaultValue:null,index:this.body.inputs.length,required:!0,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}case j.String:{const R=this.body.inputs.find(D=>{var S;return((S=D.implements)==null?void 0:S.id)===_[i.Loop][j.String].body.inputs.currentValue.id});if(!this.inputs.find(D=>{var S;return((S=D.declaration)==null?void 0:S.id)===_[i.Loop][j.String].inputs.string.id}))break;const I=this.getCurrentValueBuiltInValueDescriptor();if(R){this.currentValueArgumentDeclaration=R;const D=this.project.get(_[i.Loop]["string-loop"].inputs.string.id);I&&(!R.implements||R.implements.id!==I.id)&&(R.setImplements(I),e.push(R));let x=R.getDataType();if(x){const k=this.project.getBuiltIn(_["primitive-entity"].string.id);((f=x.entity)==null?void 0:f.id)!==k.id&&(x.setEntity(k),e.push(x))}else{const k={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:D.toReference()},K=b(k,this.project);K.setParent(D),K.initChildren(),K.addSelfToProject(),t.push(K),x=K}}else{const D={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:Z.CURRENT_VALUE_ARG_NAME,description:null,index:this.body.inputs.length,required:!0,constant:!0,defaultValue:null,implements:I,writesValues:[],dataType:null,parent:this.body.toReference()},S=b(D,this.project);S.initChildren(),S.setParent(this.body),S.addSelfToProject(),I&&(!S.implements||S.implements.id!==I.id)&&(S.setImplements(I),e.push(S)),t.push(S),this.currentValueArgumentDeclaration=S}break}}const{updated:a,added:s,removed:o}=this.removeExtraBodyArgumentDeclarations();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}syncFixedBodyArgumentDeclarations(){const e=[],t=[],n=[],{updated:a,added:s,removed:o}=this.createCurrentIterationNumberArgumentDeclaration();e.push(...a),t.push(...s),n.push(...o);const{updated:l,added:p,removed:u}=this.createCurrentValueInputBasedOnInputMap();return e.push(...l),t.push(...p),n.push(...u),{updated:m(e),added:m(t),removed:m(n),self:this}}syncInputMaps(){const e=[],t=[],n=[];switch(this.declaration.id){case j.List:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["list-loop"].inputs.list.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["list-loop"].inputs.list.id){const s=this.project.get(_[i.Loop]["list-loop"].inputs.list.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["list-loop"].inputs.list.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case j.ManualFlow:{this.inputs.forEach(a=>{a.remove(),n.push(a)});break}case j.Counted:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["counted-loop"].inputs.number.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["counted-loop"].inputs.number.id){const s=this.project.get(_[i.Loop]["counted-loop"].inputs.number.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["counted-loop"].inputs.number.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case j.ObjectKeys:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["object-keys-loop"].inputs.object.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["object-keys-loop"].inputs.object.id){const s=this.project.get(_[i.Loop]["object-keys-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["object-keys-loop"].inputs.object.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case j.ObjectValues:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["object-values-loop"].inputs.object.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["object-values-loop"].inputs.object.id){const s=this.project.get(_[i.Loop]["object-values-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["object-values-loop"].inputs.object.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case j.String:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===_[i.Loop]["string-loop"].inputs.string.id?a=s:(s.remove(),n.push(s))}),a){if(a.declaration.id!==_[i.Loop]["string-loop"].inputs.string.id){const s=this.project.get(_[i.Loop]["string-loop"].inputs.string.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(_[i.Loop]["string-loop"].inputs.string.id),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=b(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}}return{updated:m(e),added:m(t),removed:m(n),self:this}}getCurrentValueBuiltInValueDescriptor(){var t;const e=(t=_[i.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:t.id;return e?this.project.get(e):null}getCurrentIterationNumberBuiltInValueDescriptor(){const e=_[i.Loop][this.declaration.id].body.inputs.iterationNumber.id;return this.project.get(e)}syncBody(){var o;const e=[],t=[],n=[],a=_[i.Loop][this.declaration.id].body.id,s=this.project.getBuiltIn(a);if(this.body)((o=this.body.implements)==null?void 0:o.id)!==s.id&&(this.body.setImplements(s),this.body.setParent(this),e.push(this.body));else{const l={id:M.UUID.uuid(),version:1,type:i.FunctionDeclaration,name:s.name,description:null,inputs:[],index:null,returnStatements:[],calls:[],collapsed:!1,private:!1,implements:s.toJSON(),x:0,y:0,parent:this.toReference()},p=b(l,this.project);p.initChildren(),p.setParent(this),p.addSelfToProject(),t.push(p)}return{self:this,updated:m(e),added:m(t),removed:m(n)}}syncChildren(){const e=[],t=[],n=[],{updated:a,added:s,removed:o}=this.syncBody();e.push(...a),t.push(...s),n.push(...o);const{updated:l,added:p,removed:u}=this.syncInputMaps();e.push(...l),t.push(...p),n.push(...u);const{updated:h,added:f,removed:R}=this.syncTerminationStatements();e.push(...h),t.push(...f),n.push(...R);const{updated:v,added:I,removed:D}=this.syncBodyArgumentsDeclarations();e.push(...v),t.push(...I),n.push(...D);const{updated:S,added:x,removed:k}=this.syncBodyInputIndexes();e.push(...S),t.push(...x),n.push(...k);const{updated:K,added:oe,removed:ae}=this.syncOutputsDeclarations();e.push(...K),t.push(...oe),n.push(...ae);const{updated:Xe,added:Ct,removed:ni}=this.syncOutputMaps();return e.push(...Xe),t.push(...Ct),n.push(...ni),{self:this,updated:m(e),added:m(t),removed:m(n)}}};c(Z,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Z,"CURRENT_ITERATION_NUMBER_ARG_NAME","Current iteration number"),c(Z,"CURRENT_VALUE_ARG_NAME","Current value"),c(Z,"MUTABLE_BASE_PROPERTIES",[]),c(Z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Z,"BASE_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"MUTABLE_META_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Z,"INMUTABLE_META_PROPERTIES",[...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"META_PROPERTIES",[...Z.MUTABLE_META_PROPERTIES,...Z.INMUTABLE_META_PROPERTIES]),c(Z,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Z,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(Z,"UPSTREAM_PROPERTIES",[...Z.MUTABLE_UPSTREAM_PROPERTIES,...Z.INMUTABLE_UPSTREAM_PROPERTIES]),c(Z,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","outputsDeclarations","successCalls","errorCalls","error","breakStatements","continueStatements"]),c(Z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Z,"DOWNSTREAM_PROPERTIES",[...Z.MUTABLE_DOWNSTREAM_PROPERTIES,...Z.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Z,"PROPERTIES",[...Z.META_PROPERTIES,...Z.UPSTREAM_PROPERTIES,...Z.DOWNSTREAM_PROPERTIES]);let kr=Z;function F7(r){const e=N6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(o=>o.validate());const s=[...jn(r)];return Me(r.errors,s)}const Oe=class Oe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Condition);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"declaration");c(this,"inputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");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 h=A(e.parent);n=t.get(h)}const a=e.calledByEntry.map(h=>{const f=A(h);return t.get(f)}),s=e.calledBySuccess.map(h=>{const f=A(h);return t.get(f)}),o=e.calledByError.map(h=>{const f=A(h);return t.get(f)});let l;if(e.declaration){const h=A(e.declaration);l=t.get(h)}const p={id:e.id,version:1,type:i.Condition,declaration:l,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:n},u=b(p,t);return u.setParent(n),u.initChildren(),u}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);return n=s.modifiedData,a.push(...s.errors,...je(n)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new g({id:`${e.id}--${T.InvalidImplementsReference}`,code:T.InvalidImplementsReference,severity:E.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${i.Condition}' entities.
|
|
77
77
|
${ol(t)}`,issue:null})):a.push(new g({id:`${e.id}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't found in the project. The 'declaration' property must point to one of the built-in action descriptors reserved for '${i.Condition}' entities.
|
|
78
78
|
${ol(t)}`,issue:null})):a.push(new g({id:`${e.id}--${B.InvalidObjectStructure}`,code:B.InvalidObjectStructure,severity:E.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'declaration' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for '${i.Condition}' entities.
|
|
79
79
|
${ol(t)}`,issue:null})),{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.
|
|
80
|
-
If an entity is called by another, they must be in the same scope, which means they have the same parent.`,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();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{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}removeOutput(e){return 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(){return this.initialized?this:(this.initialized=!0,this.declaration=b(this.initialData.declaration,this.project),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.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 Oe.repository.load(this.id,...t),this}async create(e=V,...t){return await Oe.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Oe.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Oe.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.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),{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.inputs.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:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(n=>n.toFlat(e)),...this.successCalls.flatMap(n=>n.toFlat(e)),...this.errorCalls.flatMap(n=>n.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.inputs.flatMap(n=>n.toFlatIds(e)),...this.successCalls.flatMap(n=>n.toFlatIds(e)),...this.errorCalls.flatMap(n=>n.toFlatIds(e)),...this.calledBy.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,x:this.x,y:this.y,declaration:this.declaration.toJSON(e),successCalls:this.successCalls.map(t=>t.toJSON(e)),errorCalls:this.errorCalls.map(t=>t.toJSON(e)),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputs:this.inputs.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:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(p=>p.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(p=>p.toJSONClone({...e,newId:null})),calledBySuccess:this.calledBySuccess.map(p=>p.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(p=>p.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(p=>p.toReference({seenEntityMaps:e.seenEntityMaps})),inputs:this.inputs.map(p=>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,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(e),inputs:this.inputs.map(a=>a.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)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(n=>n.toFlatJSON(e)),...this.successCalls.flatMap(n=>n.toFlatJSON(e)),...this.errorCalls.flatMap(n=>n.toFlatJSON(e)),...this.calledBy.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.successCalls.flatMap(n=>n.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this}validate(){const e=F7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var f;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.Condition,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=(f=this.inputs)==null?void 0:f.map((R,v)=>R.clone(u,p+"-input-map-"+v+"-id",n));return u.inputs=h,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}}syncMissingFixedInputs(){const e=[],t=[],n=[],a=this.declaration.inputs.filter(p=>p.parentRelationType===P.FixedArguments&&!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()}),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}}};c(Oe,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Oe,"MUTABLE_BASE_PROPERTIES",["operator"]),c(Oe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Oe,"BASE_PROPERTIES",[...Oe.MUTABLE_BASE_PROPERTIES,...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"MUTABLE_META_PROPERTIES",["x","y"]),c(Oe,"INMUTABLE_META_PROPERTIES",[...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"META_PROPERTIES",[...Oe.MUTABLE_META_PROPERTIES,...Oe.INMUTABLE_META_PROPERTIES]),c(Oe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Oe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Oe,"UPSTREAM_PROPERTIES",[...Oe.MUTABLE_UPSTREAM_PROPERTIES,...Oe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),c(Oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Oe,"DOWNSTREAM_PROPERTIES",[...Oe.MUTABLE_DOWNSTREAM_PROPERTIES,...Oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Oe,"PROPERTIES",[...Oe.META_PROPERTIES,...Oe.UPSTREAM_PROPERTIES,...Oe.DOWNSTREAM_PROPERTIES]);let qr=Oe;function U7(r){var l;const e=b3(),t=r.toJSON();e.safeParse(t).success,(l=r.dataType)==null||l.validate(),r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),r.internalCalls.forEach(p=>p.validate());const s=[...jn(r)];if(r.id==="random-company-employee-test-variable-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});s.push(p.error)}if(r.id==="company-dto-variable-one-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});s.push(p.error)}const o=Zu(r);return s.push(...o),Me(r.errors,s)}const fe=class fe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"required",!1);c(this,"constant",!1);c(this,"x");c(this,"y");c(this,"type",i.VariableDeclaration);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"parent");c(this,"variableInstances",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.constant=e.constant,this.required=e.required,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let n=t;if(e.parent){const h=A(e.parent);n=t.get(h)}const a=e.calledByEntry.map(h=>{const f=A(h);return t.get(f)}),s=e.calledBySuccess.map(h=>{const f=A(h);return t.get(f)}),o=e.calledByError.map(h=>{const f=A(h);return t.get(f)});let l=null;if(e.readsValue){const h=A(e.readsValue);l=t.get(h)}const p={id:e.id,version:1,type:i.VariableDeclaration,name:e.name,defaultValue:null,description:e.description,constant:e.constant||!1,required:e.required||!1,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:l,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:n},u=b(p,t);return u.setParent(n),u.initChildren(),u}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;const o=Lu(n,t);return a.push(...s.errors,...o,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];let n=JSON.parse(JSON.stringify(e));const a=ts(n,this);return n=a.modifiedData,t.push(...a.errors),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.
|
|
80
|
+
If an entity is called by another, they must be in the same scope, which means they have the same parent.`,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();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{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}removeOutput(e){return 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(){return this.initialized?this:(this.initialized=!0,this.declaration=b(this.initialData.declaration,this.project),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.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 Oe.repository.load(this.id,...t),this}async create(e=V,...t){return await Oe.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Oe.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Oe.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.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),{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.inputs.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:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(n=>n.toFlat(e)),...this.successCalls.flatMap(n=>n.toFlat(e)),...this.errorCalls.flatMap(n=>n.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.inputs.flatMap(n=>n.toFlatIds(e)),...this.successCalls.flatMap(n=>n.toFlatIds(e)),...this.errorCalls.flatMap(n=>n.toFlatIds(e)),...this.calledBy.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,x:this.x,y:this.y,declaration:this.declaration.toJSON(e),successCalls:this.successCalls.map(t=>t.toJSON(e)),errorCalls:this.errorCalls.map(t=>t.toJSON(e)),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputs:this.inputs.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:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(p=>p.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(p=>p.toJSONClone({...e,newId:null})),calledBySuccess:this.calledBySuccess.map(p=>p.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(p=>p.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(p=>p.toReference({seenEntityMaps:e.seenEntityMaps})),inputs:this.inputs.map(p=>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,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(e),inputs:this.inputs.map(a=>a.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)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(n=>n.toFlatJSON(e)),...this.successCalls.flatMap(n=>n.toFlatJSON(e)),...this.errorCalls.flatMap(n=>n.toFlatJSON(e)),...this.calledBy.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.successCalls.flatMap(n=>n.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this}validate(){const e=F7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var f;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.Condition,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=(f=this.inputs)==null?void 0:f.map((R,v)=>R.clone(u,p+"-input-map-"+v+"-id",n));return u.inputs=h,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}}syncMissingFixedInputs(){const e=[],t=[],n=[],a=this.declaration.inputs.filter(p=>p.parentRelationType===P.FixedArguments&&!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()}),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}}};c(Oe,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Oe,"MUTABLE_BASE_PROPERTIES",["operator"]),c(Oe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Oe,"BASE_PROPERTIES",[...Oe.MUTABLE_BASE_PROPERTIES,...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"MUTABLE_META_PROPERTIES",["x","y"]),c(Oe,"INMUTABLE_META_PROPERTIES",[...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"META_PROPERTIES",[...Oe.MUTABLE_META_PROPERTIES,...Oe.INMUTABLE_META_PROPERTIES]),c(Oe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Oe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Oe,"UPSTREAM_PROPERTIES",[...Oe.MUTABLE_UPSTREAM_PROPERTIES,...Oe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),c(Oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Oe,"DOWNSTREAM_PROPERTIES",[...Oe.MUTABLE_DOWNSTREAM_PROPERTIES,...Oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Oe,"PROPERTIES",[...Oe.META_PROPERTIES,...Oe.UPSTREAM_PROPERTIES,...Oe.DOWNSTREAM_PROPERTIES]);let qr=Oe;function U7(r){var l;const e=b3(),t=r.toJSON();e.safeParse(t).success,(l=r.dataType)==null||l.validate(),r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),r.internalCalls.forEach(p=>p.validate());const s=[...jn(r)];if(r.id==="random-company-employee-test-variable-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});s.push(p.error)}if(r.id==="company-dto-variable-one-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});s.push(p.error)}const o=Zu(r);return s.push(...o),Me(r.errors,s)}const fe=class fe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"required",!1);c(this,"constant",!1);c(this,"x");c(this,"y");c(this,"type",i.VariableDeclaration);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"parent");c(this,"variableInstances",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.constant=e.constant,this.required=e.required,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let n=t;if(e.parent){const h=A(e.parent);n=t.get(h)}const a=e.calledByEntry.map(h=>{const f=A(h);return t.get(f)}),s=e.calledBySuccess.map(h=>{const f=A(h);return t.get(f)}),o=e.calledByError.map(h=>{const f=A(h);return t.get(f)});let l=null;if(e.readsValue){const h=A(e.readsValue);l=t.get(h)}const p={id:e.id,version:1,type:i.VariableDeclaration,name:e.name,defaultValue:null,description:e.description,constant:e.constant||!1,required:e.required||!1,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:l,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:n},u=b(p,t);return u.setParent(n),u.initChildren(),u}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;const o=Lu(n,t);return a.push(...s.errors,...o,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];let n=JSON.parse(JSON.stringify(e));const a=es(n,this);return n=a.modifiedData,t.push(...a.errors),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.
|
|
81
81
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
82
82
|
Specifically for variables, their scope is also calculated from their value readers and value writters.
|
|
83
|
-
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(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))}),kn.hydrateReadsValue(this),{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];return this.initialized=!0,this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:m(e),added:m(t),removed:m(n),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){return this.internalCalls.filter(e=>!e.calledBy.length)}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}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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.dataType&&(this.dataType=b(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),ss.initWritesValues(this,this.parent),kn.initReadsValue(this),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.initialData.inputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),this.initialData.internalCalls.forEach(e=>{if(e.type===i.GenericReference){const n=this.project.findSubscribedInstanceFromReference(e);if(!n)return;n.setParent(this),n.initChildren(),this.addInternalCall(n);return}const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addInternalCall(t),t}),this.afterAllChildrenInitialized(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}subscribeInstance(e){return this.variableInstances.includes(e)?this:(this.variableInstances.push(e),this)}removeInstance(e){return this.variableInstances=this.variableInstances.filter(t=>t.id!==e.id),this}getMasterInputWithValueWritterFromAllInstances(e){return m([...this.inputs,...this.variableInstances.flatMap(a=>a.inputs)]).find(a=>w(a,this.project)===w(e,this.project)&&!!a.readsValue)||e}inferDataTypeAndSyncInstancesInputsAndOutputs(){var n,a;if(!this.dataType){const s=b({id:this.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:this.toReference()},this.project);s.setParent(this),s.initChildren(),s.sync({inferred:!0,like:!0}),this.setDataType(s)}if(this.readsValue){const s=(n=this.readsValue.getDataType())==null?void 0:n.clone(this);return s&&(s.sync({inferred:!0,like:!0}),this.setDataType(s)),this}const e=m([...this.inputs,...this.variableInstances.flatMap(s=>s.inputs)]),t=[];return e.forEach(s=>{t.find(l=>w(l,this.project)===w(s,this.project))||t.push(s)}),t.length?((a=this.dataType)==null||a.inferFromInputs(t),this.dataType?(this.generateUnusedInputs(),this.generateUnusedOutputs(),this.variableInstances.forEach(s=>{s.generateUnusedInputs(),s.generateUnusedOutputs()}),this):this):this}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.constant=e.constant!==void 0?e.constant:this.constant,this.required=e.required!==void 0?e.required:this.required,this}async load(e=V,...t){return await fe.repository.load(this.id,...t),this}async create(e=V,...t){return await fe.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await fe.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await fe.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(this.readsValue&&(n.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{n.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{n.push(s),s.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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(n=>{t.push(n),n.setValueWriter(this)}),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.internalCalls.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:n}=this.dataType.restore({seenEntities:e});t.push(...n)}return 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){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...((a=this.dataType)==null?void 0:a.toFlat(e))||[],...((s=this.readsValue)==null?void 0:s.toFlat(e))||[],...this.writesValues.flatMap(o=>o.toFlat(e)),...this.successCalls.flatMap(o=>o.toFlat(e)),...this.errorCalls.flatMap(o=>o.toFlat(e)),...this.inputs.flatMap(o=>o.toFlat(e)),...this.outputs.flatMap(o=>o.toFlat(e)),...this.internalCalls.flatMap(o=>o.toFlat(e)),...this.calledBy.flatMap(o=>o.toFlat(e))])}toFlatIds(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...((a=this.dataType)==null?void 0:a.toFlatIds(e))||[],...this.writesValues.flatMap(s=>s.toFlatIds(e)),...this.successCalls.flatMap(s=>s.toFlatIds(e)),...this.errorCalls.flatMap(s=>s.toFlatIds(e)),...this.inputs.flatMap(s=>s.toFlatIds(e)),...this.outputs.flatMap(s=>s.toFlatIds(e)),...this.internalCalls.flatMap(s=>s.toFlatIds(e))])}toJSON(e=new Set){var t,n,a;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,constant:this.constant,required:this.required,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,dataType:((n=this.dataType)==null?void 0:n.toJSON(e))||null,readsValue:((a=this.readsValue)==null?void 0:a.toReference())||null,writesValues:this.writesValues.map(s=>s.toJSON(e)),inputs:this.inputs.map(s=>s.toJSON(e)),outputs:this.outputs.map(s=>s.toJSON(e)),successCalls:this.successCalls.map(s=>s.toJSON(e)),errorCalls:this.errorCalls.map(s=>s.toJSON(e)),internalCalls:this.internalCalls.map(s=>s.toJSON(e)),calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y})}toJSONClone(e=L){var n,a,s,o,l,p,u,h;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,name:this.name,description:this.description,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,dataType:((u=this.dataType)==null?void 0:u.toJSONClone({...e,newId:null}))||null,readsValue:((h=this.readsValue)==null?void 0:h.toReference({seenEntityMaps:e.seenEntityMaps}))||null,writesValues:this.writesValues.map(f=>f.toJSONClone({...e,newId:null})),inputs:this.inputs.map(f=>f.toJSONClone({...e,newId:null})),outputs:this.outputs.map(f=>f.toJSONClone({...e,newId:null})),successCalls:this.successCalls.map(f=>f.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(f=>f.toJSONClone({...e,newId:null})),internalCalls:this.internalCalls.map(f=>this.calledBy.length||this.readsValue?f.toJSONClone({...e,newId:null}):f.toReference({seenEntityMaps:e.seenEntityMaps})),calledBySuccess:this.calledBySuccess.map(f=>f.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(f=>f.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(f=>f.toReference({seenEntityMaps:e.seenEntityMaps})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),x:this.x,y:this.y})}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,name:this.name,description:this.description,required:this.required,constant:this.constant,x:this.x,y:this.y,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,dataType:((s=this.dataType)==null?void 0:s.toReference(e))||null,readsValue:((o=this.readsValue)==null?void 0:o.toReference(e))||null,writesValues:this.writesValues.map(l=>l.toReference(e)),inputs:this.inputs.map(l=>l.toReference(e)),outputs:this.outputs.map(l=>l.toReference(e)),successCalls:this.successCalls.map(l=>l.toReference(e)),errorCalls:this.errorCalls.map(l=>l.toReference(e)),calledBySuccess:this.calledBySuccess.map(l=>l.toReference(e)),calledByError:this.calledByError.map(l=>l.toReference(e)),calledByEntry:this.calledByEntry.map(l=>l.toReference(e)),internalCalls:this.internalCalls.map(l=>l.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...((a=this.dataType)==null?void 0:a.toFlatJSON(e))||[],...this.writesValues.flatMap(s=>s.toFlatJSON(e)),...this.successCalls.flatMap(s=>s.toFlatJSON(e)),...this.errorCalls.flatMap(s=>s.toFlatJSON(e)),...this.inputs.flatMap(s=>s.toFlatJSON(e)),...this.outputs.flatMap(s=>s.toFlatJSON(e)),...this.internalCalls.flatMap(s=>s.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,name:this.name,description:this.description,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(s=>s.toFlatGenerationTarget(e)),...this.successCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.inputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.outputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(s=>s.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()),this.internalCalls.forEach(n=>n.clearErrors()),(e=this.dataType)==null||e.clearErrors(),(t=this.defaultValue)==null||t.clearErrors(),this}validate(){const e=U7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,n,a;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...((n=this.dataType)==null?void 0:n.getErrors())||[],...this.inputs.flatMap(s=>s.getErrors()),...this.internalCalls.flatMap(s=>s.getErrors()),...this.outputs.flatMap(s=>s.getErrors()),...((a=this.readsValue)==null?void 0:a.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){return this.defaultValue||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e=null,t=null,n=!0){var D,S,F,j,K;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.VariableDeclaration,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=(D=this.dataType)==null?void 0:D.clone(u,p+"--data-type-id",n);u.dataType=h||null;const f=(S=this.defaultValue)==null?void 0:S.clone(u,p+"-default-value-id",n);u.defaultValue=f||null;const R=(F=this.inputs)==null?void 0:F.map((oe,ae)=>oe.clone(u,p+"-input-map-"+ae+"-id",n));u.inputs=R;const v=(j=this.outputs)==null?void 0:j.map((oe,ae)=>oe.clone(u,p+"-output-map-"+ae+"-id",n));u.outputs=v;const I=(K=this.internalCalls)==null?void 0:K.map((oe,ae)=>oe.clone(u,p+"-internal-call-"+ae+"-id",n));return u.internalCalls=I,u}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const n={id:t.id||M.UUID.uuid(),version:t.version||1,type:i.VariableInstance,parent:e.toReference(),defaultValue:t.defaultValue||null,successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],writesValues:t.writesValues||[],internalCalls:t.internalCalls||[],readsValue:t.readsValue||null,calledByEntry:t.calledByEntry||[],calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],declaration:this.toJSON(),x:0,y:0},a=b(n,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addVariableInstance(a),a}generateUnusedInputs(){if(this.dataType)if(this.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type)){const e=[...this.dataType.entity.properties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(u=>w(u,this.project)===w(s,this.project));if(!o)return;const l=this.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=Rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:M.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=b(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>w(l,this.project)===w(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.properties].filter(n=>!this.outputs.find(a=>a.declaration===n)).map(n=>{const a={id:M.UUID.uuid(),version:1,type:i.OutputMap,defaultValue:null,parent:this.toReference(),declaration:n,index:n.index,writesValues:[]},s=b(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.dataType)if(this.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.getAllInteractiveMethods()].filter(n=>!this.internalCalls.find(s=>{var l,p,u,h,f;return(((l=s.declaration)==null?void 0:l.id)||((u=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:u.entityId)||((f=(h=s.initialData)==null?void 0:h.declaration)==null?void 0:f.id))===n.id})).map(n=>{const a=n.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this.dataType||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(fe,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(fe,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(fe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"MUTABLE_META_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,"x","y"]),c(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),c(fe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(fe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUTABLE_UPSTREAM_PROPERTIES]),c(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(fe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let Jr=fe;function x7(r){const e=S3(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),r.internalCalls.forEach(l=>l.validate());const s=[...jn(r)];if(r.id==="exec-sequentially-result-variable-id"){const l=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});s.push(l.error)}const o=Zu(r);return s.push(...o),Me(r.errors,s)}const me=class me{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.VariableInstance);c(this,"defaultValue",null);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!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 R=A(e.parent);n=t.get(R)}const a=A(e.declaration),s=t.get(a),o=e.calledByEntry.map(R=>{const v=A(R);return t.get(v)}),l=e.calledBySuccess.map(R=>{const v=A(R);return t.get(v)}),p=e.calledByError.map(R=>{const v=A(R);return t.get(v)});let u=null;if(e.readsValue){const R=A(e.readsValue);u=t.get(R)}const h={id:e.id,version:1,type:i.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,defaultValue:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:u,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:n},f=b(h,t);return f.setParent(n),f.initChildren(),f}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},declaration:{list:!1,types:[i.VariableDeclaration]}},t);return n=s.modifiedData,a.push(...s.errors,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];let n=JSON.parse(JSON.stringify(e));const a=ts(n,this);return n=a.modifiedData,t.push(...a.errors),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.
|
|
83
|
+
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(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))}),kn.hydrateReadsValue(this),{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){const e=[],t=[],n=[];return this.initialized=!0,this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:m(e),added:m(t),removed:m(n),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){return this.internalCalls.filter(e=>!e.calledBy.length)}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}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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.dataType&&(this.dataType=b(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),as.initWritesValues(this,this.parent),kn.initReadsValue(this),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.initialData.inputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),this.initialData.internalCalls.forEach(e=>{if(e.type===i.GenericReference){const n=this.project.findSubscribedInstanceFromReference(e);if(!n)return;n.setParent(this),n.initChildren(),this.addInternalCall(n);return}const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addInternalCall(t),t}),this.afterAllChildrenInitialized(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}subscribeInstance(e){return this.variableInstances.includes(e)?this:(this.variableInstances.push(e),this)}removeInstance(e){return this.variableInstances=this.variableInstances.filter(t=>t.id!==e.id),this}getMasterInputWithValueWritterFromAllInstances(e){return m([...this.inputs,...this.variableInstances.flatMap(a=>a.inputs)]).find(a=>w(a,this.project)===w(e,this.project)&&!!a.readsValue)||e}inferDataTypeAndSyncInstancesInputsAndOutputs(){var n,a;if(!this.dataType){const s=b({id:this.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:this.toReference()},this.project);s.setParent(this),s.initChildren(),s.sync({inferred:!0,like:!0}),this.setDataType(s)}if(this.readsValue){const s=(n=this.readsValue.getDataType())==null?void 0:n.clone(this);return s&&(s.sync({inferred:!0,like:!0}),this.setDataType(s)),this}const e=m([...this.inputs,...this.variableInstances.flatMap(s=>s.inputs)]),t=[];return e.forEach(s=>{t.find(l=>w(l,this.project)===w(s,this.project))||t.push(s)}),t.length?((a=this.dataType)==null||a.inferFromInputs(t),this.dataType?(this.generateUnusedInputs(),this.generateUnusedOutputs(),this.variableInstances.forEach(s=>{s.generateUnusedInputs(),s.generateUnusedOutputs()}),this):this):this}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.constant=e.constant!==void 0?e.constant:this.constant,this.required=e.required!==void 0?e.required:this.required,this}async load(e=V,...t){return await fe.repository.load(this.id,...t),this}async create(e=V,...t){return await fe.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await fe.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await fe.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(this.readsValue&&(n.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{n.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{n.push(s),s.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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(n=>{t.push(n),n.setValueWriter(this)}),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.internalCalls.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:n}=this.dataType.restore({seenEntities:e});t.push(...n)}return 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){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...((a=this.dataType)==null?void 0:a.toFlat(e))||[],...((s=this.readsValue)==null?void 0:s.toFlat(e))||[],...this.writesValues.flatMap(o=>o.toFlat(e)),...this.successCalls.flatMap(o=>o.toFlat(e)),...this.errorCalls.flatMap(o=>o.toFlat(e)),...this.inputs.flatMap(o=>o.toFlat(e)),...this.outputs.flatMap(o=>o.toFlat(e)),...this.internalCalls.flatMap(o=>o.toFlat(e)),...this.calledBy.flatMap(o=>o.toFlat(e))])}toFlatIds(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...((a=this.dataType)==null?void 0:a.toFlatIds(e))||[],...this.writesValues.flatMap(s=>s.toFlatIds(e)),...this.successCalls.flatMap(s=>s.toFlatIds(e)),...this.errorCalls.flatMap(s=>s.toFlatIds(e)),...this.inputs.flatMap(s=>s.toFlatIds(e)),...this.outputs.flatMap(s=>s.toFlatIds(e)),...this.internalCalls.flatMap(s=>s.toFlatIds(e))])}toJSON(e=new Set){var t,n,a;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,constant:this.constant,required:this.required,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,dataType:((n=this.dataType)==null?void 0:n.toJSON(e))||null,readsValue:((a=this.readsValue)==null?void 0:a.toReference())||null,writesValues:this.writesValues.map(s=>s.toJSON(e)),inputs:this.inputs.map(s=>s.toJSON(e)),outputs:this.outputs.map(s=>s.toJSON(e)),successCalls:this.successCalls.map(s=>s.toJSON(e)),errorCalls:this.errorCalls.map(s=>s.toJSON(e)),internalCalls:this.internalCalls.map(s=>s.toJSON(e)),calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y})}toJSONClone(e=L){var n,a,s,o,l,p,u,h;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,name:this.name,description:this.description,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,dataType:((u=this.dataType)==null?void 0:u.toJSONClone({...e,newId:null}))||null,readsValue:((h=this.readsValue)==null?void 0:h.toReference({seenEntityMaps:e.seenEntityMaps}))||null,writesValues:this.writesValues.map(f=>f.toJSONClone({...e,newId:null})),inputs:this.inputs.map(f=>f.toJSONClone({...e,newId:null})),outputs:this.outputs.map(f=>f.toJSONClone({...e,newId:null})),successCalls:this.successCalls.map(f=>f.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(f=>f.toJSONClone({...e,newId:null})),internalCalls:this.internalCalls.map(f=>this.calledBy.length||this.readsValue?f.toJSONClone({...e,newId:null}):f.toReference({seenEntityMaps:e.seenEntityMaps})),calledBySuccess:this.calledBySuccess.map(f=>f.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(f=>f.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(f=>f.toReference({seenEntityMaps:e.seenEntityMaps})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),x:this.x,y:this.y})}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,name:this.name,description:this.description,required:this.required,constant:this.constant,x:this.x,y:this.y,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,dataType:((s=this.dataType)==null?void 0:s.toReference(e))||null,readsValue:((o=this.readsValue)==null?void 0:o.toReference(e))||null,writesValues:this.writesValues.map(l=>l.toReference(e)),inputs:this.inputs.map(l=>l.toReference(e)),outputs:this.outputs.map(l=>l.toReference(e)),successCalls:this.successCalls.map(l=>l.toReference(e)),errorCalls:this.errorCalls.map(l=>l.toReference(e)),calledBySuccess:this.calledBySuccess.map(l=>l.toReference(e)),calledByError:this.calledByError.map(l=>l.toReference(e)),calledByEntry:this.calledByEntry.map(l=>l.toReference(e)),internalCalls:this.internalCalls.map(l=>l.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...((a=this.dataType)==null?void 0:a.toFlatJSON(e))||[],...this.writesValues.flatMap(s=>s.toFlatJSON(e)),...this.successCalls.flatMap(s=>s.toFlatJSON(e)),...this.errorCalls.flatMap(s=>s.toFlatJSON(e)),...this.inputs.flatMap(s=>s.toFlatJSON(e)),...this.outputs.flatMap(s=>s.toFlatJSON(e)),...this.internalCalls.flatMap(s=>s.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,name:this.name,description:this.description,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(s=>s.toFlatGenerationTarget(e)),...this.successCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.inputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.outputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(s=>s.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()),this.internalCalls.forEach(n=>n.clearErrors()),(e=this.dataType)==null||e.clearErrors(),(t=this.defaultValue)==null||t.clearErrors(),this}validate(){const e=U7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,n,a;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...((n=this.dataType)==null?void 0:n.getErrors())||[],...this.inputs.flatMap(s=>s.getErrors()),...this.internalCalls.flatMap(s=>s.getErrors()),...this.outputs.flatMap(s=>s.getErrors()),...((a=this.readsValue)==null?void 0:a.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){return this.defaultValue||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e=null,t=null,n=!0){var D,S,x,k,K;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.VariableDeclaration,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=(D=this.dataType)==null?void 0:D.clone(u,M.UUID.uuid(),n);u.dataType=h||null;const f=(S=this.defaultValue)==null?void 0:S.clone(u,p+"-default-value-id",n);u.defaultValue=f||null;const R=(x=this.inputs)==null?void 0:x.map((oe,ae)=>oe.clone(u,p+"-input-map-"+ae+"-id",n));u.inputs=R;const v=(k=this.outputs)==null?void 0:k.map((oe,ae)=>oe.clone(u,p+"-output-map-"+ae+"-id",n));u.outputs=v;const I=(K=this.internalCalls)==null?void 0:K.map((oe,ae)=>oe.clone(u,p+"-internal-call-"+ae+"-id",n));return u.internalCalls=I,u}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const n={id:t.id||M.UUID.uuid(),version:t.version||1,type:i.VariableInstance,parent:e.toReference(),defaultValue:t.defaultValue||null,successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],writesValues:t.writesValues||[],internalCalls:t.internalCalls||[],readsValue:t.readsValue||null,calledByEntry:t.calledByEntry||[],calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],declaration:this.toJSON(),x:0,y:0},a=b(n,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addVariableInstance(a),a}generateUnusedInputs(){if(this.dataType)if(this.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type)){const e=[...this.dataType.entity.properties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(u=>w(u,this.project)===w(s,this.project));if(!o)return;const l=this.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=Rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:M.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=b(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>w(l,this.project)===w(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.properties].filter(n=>!this.outputs.find(a=>a.declaration===n)).map(n=>{const a={id:M.UUID.uuid(),version:1,type:i.OutputMap,defaultValue:null,parent:this.toReference(),declaration:n,index:n.index,writesValues:[]},s=b(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.dataType)if(this.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.getAllInteractiveMethods()].filter(n=>!this.internalCalls.find(s=>{var l,p,u,h,f;return(((l=s.declaration)==null?void 0:l.id)||((u=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:u.entityId)||((f=(h=s.initialData)==null?void 0:h.declaration)==null?void 0:f.id))===n.id})).map(n=>{const a=n.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this.dataType||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(fe,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(fe,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(fe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"MUTABLE_META_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,"x","y"]),c(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),c(fe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(fe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUTABLE_UPSTREAM_PROPERTIES]),c(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(fe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let Jr=fe;function x7(r){const e=S3(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),r.internalCalls.forEach(l=>l.validate());const s=[...jn(r)];if(r.id==="exec-sequentially-result-variable-id"){const l=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});s.push(l.error)}const o=Zu(r);return s.push(...o),Me(r.errors,s)}const me=class me{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.VariableInstance);c(this,"defaultValue",null);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!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 R=A(e.parent);n=t.get(R)}const a=A(e.declaration),s=t.get(a),o=e.calledByEntry.map(R=>{const v=A(R);return t.get(v)}),l=e.calledBySuccess.map(R=>{const v=A(R);return t.get(v)}),p=e.calledByError.map(R=>{const v=A(R);return t.get(v)});let u=null;if(e.readsValue){const R=A(e.readsValue);u=t.get(R)}const h={id:e.id,version:1,type:i.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,defaultValue:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:u,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:n},f=b(h,t);return f.setParent(n),f.initChildren(),f}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},declaration:{list:!1,types:[i.VariableDeclaration]}},t);return n=s.modifiedData,a.push(...s.errors,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];let n=JSON.parse(JSON.stringify(e));const a=es(n,this);return n=a.modifiedData,t.push(...a.errors),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.
|
|
84
84
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
85
85
|
Specifically for variables, their scope is also calculated from their value readers and value writters.
|
|
86
|
-
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(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))}),kn.hydrateReadsValue(this),{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){var a;const e=[],t=[],n=[];return this.initialized=!0,this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),this.declaration.subscribeInstance(this),(!this.declaration.dataType||(a=this.declaration.dataType)!=null&&a.inferred)&&this.declaration.inferDataTypeAndSyncInstancesInputsAndOutputs(),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:m(e),added:m(t),removed:m(n),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){const e=this.usedInternalCalls;return this.internalCalls.filter(n=>!(e.find(o=>o.id===n.id)||e.find(o=>o.declaration===n.declaration)))}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}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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration.type===i.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!e)return this;this.declaration=e}else this.declaration=b(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return ss.initWritesValues(this,this.parent),kn.initReadsValue(this),this.initialData.inputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),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.internalCalls=this.initialData.internalCalls.reduce((e,t)=>{if(t.type===i.GenericReference){const n=this.project.findSubscribedInstanceFromReference(t);if(!n)return e;const a=n;return a.setParent(this),[...e,a]}else{const n=b(t,this.project);return n.setParent(this),n.initChildren(),[...e,n]}},[]),this.afterAllChildrenInitialized(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),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 me.repository.load(this.id,...t),this}async create(e=V,...t){return await me.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await me.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await me.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.readsValue&&(n.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{n.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),this.declaration.removeInstance(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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(n=>{t.push(n),n.setValueWriter(this)}),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.internalCalls.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),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)}),this.declaration.subscribeInstance(this),{affected:m(t),self:this}}toFlat(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...this.writesValues.flatMap(s=>s.toFlat(e)),...((a=this.readsValue)==null?void 0:a.toFlat(e))||[],...this.successCalls.flatMap(s=>s.toFlat(e)),...this.errorCalls.flatMap(s=>s.toFlat(e)),...this.inputs.flatMap(s=>s.toFlat(e)),...this.outputs.flatMap(s=>s.toFlat(e)),...this.internalCalls.flatMap(s=>s.toFlat(e))])}toFlatIds(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.toFlatIds(e)),...this.successCalls.flatMap(a=>a.toFlatIds(e)),...this.errorCalls.flatMap(a=>a.toFlatIds(e)),...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.outputs.flatMap(a=>a.toFlatIds(e)),...this.internalCalls.flatMap(a=>a.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,declaration:this.declaration.toJSON(e),defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,readsValue:((n=this.readsValue)==null?void 0:n.toReference())||null,writesValues:this.writesValues.map(a=>a.toJSON(e)),inputs:this.inputs.map(a=>a.toJSON(e)),outputs:this.outputs.map(a=>a.toJSON(e)),successCalls:this.successCalls.map(a=>a.toJSON(e)),errorCalls:this.errorCalls.map(a=>a.toJSON(e)),internalCalls:this.internalCalls.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()),parent:this.parent.toReference(),x:this.x,y:this.y})}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,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,declaration:this.declaration.toReference({seenEntityMaps:e.seenEntityMaps}),readsValue:((u=this.readsValue)==null?void 0:u.toReference({seenEntityMaps:e.seenEntityMaps}))||null,writesValues:this.writesValues.map(h=>h.toJSONClone({...e,newId:null})),inputs:[],outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),successCalls:this.successCalls.map(h=>h.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(h=>h.toJSONClone({...e,newId:null})),internalCalls:this.internalCalls.map(h=>this.calledBy.length||this.readsValue?h.toJSONClone({...e,newId:null}):h.toReference({seenEntityMaps:e.seenEntityMaps})),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})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),x:this.x,y:this.y})}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,x:this.x,y:this.y,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,declaration:((s=this.declaration)==null?void 0:s.toReference(e))||null,readsValue:((o=this.readsValue)==null?void 0:o.toReference(e))||null,writesValues:this.writesValues.map(l=>l.toReference(e)),inputs:this.inputs.map(l=>l.toReference(e)),outputs:this.outputs.map(l=>l.toReference(e)),successCalls:this.successCalls.map(l=>l.toReference(e)),errorCalls:this.errorCalls.map(l=>l.toReference(e)),calledBySuccess:this.calledBySuccess.map(l=>l.toReference(e)),calledByError:this.calledByError.map(l=>l.toReference(e)),calledByEntry:this.calledByEntry.map(l=>l.toReference(e)),internalCalls:this.internalCalls.map(l=>l.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...((a=this.declaration)==null?void 0:a.toFlatJSON(e))||[],...this.writesValues.flatMap(s=>s.toFlatJSON(e)),...this.successCalls.flatMap(s=>s.toFlatJSON(e)),...this.errorCalls.flatMap(s=>s.toFlatJSON(e)),...this.inputs.flatMap(s=>s.toFlatJSON(e)),...this.outputs.flatMap(s=>s.toFlatJSON(e)),...this.internalCalls.flatMap(s=>s.toFlatJSON(e)),...this.calledBy.flatMap(s=>s.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...((a=this.declaration)==null?void 0:a.toFlatGenerationTarget(e))||[],...((s=this.readsValue)==null?void 0:s.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(o=>o.toFlatGenerationTarget(e)),...this.successCalls.flatMap(o=>o.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(o=>o.toFlatGenerationTarget(e)),...this.inputs.flatMap(o=>o.toFlatGenerationTarget(e)),...this.outputs.flatMap(o=>o.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(o=>o.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),this.internalCalls.forEach(t=>t.clearErrors()),this}validate(){const e=x7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,n;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((n=this.readsValue)==null?void 0:n.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return this.defaultValue||((e=this.declaration)==null?void 0:e.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e=null,t=null,n=!0){var I,D,S,F;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.VariableInstance,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=(I=this.defaultValue)==null?void 0:I.clone(u,p+"-default-value-id",n);u.defaultValue=h||null;const f=(D=this.inputs)==null?void 0:D.map((j,K)=>j.clone(u,p+"-input-map-"+K+"-id",n));u.inputs=f;const R=(S=this.outputs)==null?void 0:S.map((j,K)=>j.clone(u,p+"-output-map-"+K+"-id",n));u.outputs=R;const v=(F=this.internalCalls)==null?void 0:F.map((j,K)=>j.clone(u,p+"-internal-call-"+K+"-id",n));return u.internalCalls=v,u}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}setDeclaration(e){return this.declaration!==e&&(this.declaration=e),this}generateUnusedInputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type)){const e=[...this.declaration.dataType.entity.properties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(u=>w(u,this.project)===w(s,this.project));if(!o)return;const l=this.declaration.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=Rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:M.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=b(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>w(l,this.project)===w(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.properties].filter(n=>!this.outputs.find(a=>a.declaration===n)).map(n=>{const a={id:M.UUID.uuid(),version:1,type:i.OutputMap,parent:this.toReference(),defaultValue:null,declaration:n,index:n.index,writesValues:[]},s=b(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.getAllInteractiveMethods()].filter(n=>!this.internalCalls.find(s=>{var l,p,u,h,f;return(((l=s.declaration)==null?void 0:l.id)||((u=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:u.entityId)||((f=(h=s.initialData)==null?void 0:h.declaration)==null?void 0:f.id))===n.id})).map(n=>{const a=n.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(me,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(me,"MUTABLE_BASE_PROPERTIES",[]),c(me,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),c(me,"MUTABLE_META_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,"x","y"]),c(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),c(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),c(me,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(me,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),c(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let Wr=me;function j7(r){var s;const e=E6(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=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});a.push(o.error)}return Me(r.errors,a)}const Te=class Te{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"constant",!0);c(this,"isError");c(this,"type",i.ReturnDeclaration);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"readsValue",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.constant=!0,this.isError=e.isError}static fromGenerationTarget(e,t){const n=A(e.parent),a=t.get(n);let s=null;if(e.readsValue){const p=A(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:i.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,defaultValue:null,implements:null,required:e.required,constant:!0,readsValue:s,dataType:null,parent:a},l=b(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l,p;let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[i.ReturnStatement,i.Search,i.BreakStatement,i.ContinueStatement]}},t),o=Fu(n,t);if(n=s.modifiedData,n.parent){const u=t.get(A(n.parent));if(u&&[i.BreakStatement,i.ContinueStatement].includes(u.type)){const h=u,f=h.parent,R=[...f.breakStatements.filter(I=>I.id!==u.id),...f.continueStatements.filter(I=>I.id!==u.id)];if(h.outputs.length)a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${n.id}' cannot be added to the parent entity of type '${h.type}' with id '${h.id}'. This '${h.type}' already has return declarations.
|
|
86
|
+
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(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))}),kn.hydrateReadsValue(this),{updated:m(e),added:m(t),removed:m(n),self:this}}afterAllChildrenInitialized(){var a;const e=[],t=[],n=[];return this.initialized=!0,this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),this.declaration.subscribeInstance(this),(!this.declaration.dataType||(a=this.declaration.dataType)!=null&&a.inferred)&&this.declaration.inferDataTypeAndSyncInstancesInputsAndOutputs(),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:m(e),added:m(t),removed:m(n),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){const e=this.usedInternalCalls;return this.internalCalls.filter(n=>!(e.find(o=>o.id===n.id)||e.find(o=>o.declaration===n.declaration)))}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}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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration.type===i.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!e)return this;this.declaration=e}else this.declaration=b(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return as.initWritesValues(this,this.parent),kn.initReadsValue(this),this.initialData.inputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),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.internalCalls=this.initialData.internalCalls.reduce((e,t)=>{if(t.type===i.GenericReference){const n=this.project.findSubscribedInstanceFromReference(t);if(!n)return e;const a=n;return a.setParent(this),[...e,a]}else{const n=b(t,this.project);return n.setParent(this),n.initChildren(),[...e,n]}},[]),this.afterAllChildrenInitialized(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),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 me.repository.load(this.id,...t),this}async create(e=V,...t){return await me.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await me.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await me.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.readsValue&&(n.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{n.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),this.declaration.removeInstance(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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(n=>{t.push(n),n.setValueWriter(this)}),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.internalCalls.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),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)}),this.declaration.subscribeInstance(this),{affected:m(t),self:this}}toFlat(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...this.writesValues.flatMap(s=>s.toFlat(e)),...((a=this.readsValue)==null?void 0:a.toFlat(e))||[],...this.successCalls.flatMap(s=>s.toFlat(e)),...this.errorCalls.flatMap(s=>s.toFlat(e)),...this.inputs.flatMap(s=>s.toFlat(e)),...this.outputs.flatMap(s=>s.toFlat(e)),...this.internalCalls.flatMap(s=>s.toFlat(e))])}toFlatIds(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.toFlatIds(e)),...this.successCalls.flatMap(a=>a.toFlatIds(e)),...this.errorCalls.flatMap(a=>a.toFlatIds(e)),...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.outputs.flatMap(a=>a.toFlatIds(e)),...this.internalCalls.flatMap(a=>a.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,declaration:this.declaration.toJSON(e),defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,readsValue:((n=this.readsValue)==null?void 0:n.toReference())||null,writesValues:this.writesValues.map(a=>a.toJSON(e)),inputs:this.inputs.map(a=>a.toJSON(e)),outputs:this.outputs.map(a=>a.toJSON(e)),successCalls:this.successCalls.map(a=>a.toJSON(e)),errorCalls:this.errorCalls.map(a=>a.toJSON(e)),internalCalls:this.internalCalls.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()),parent:this.parent.toReference(),x:this.x,y:this.y})}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,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,declaration:this.declaration.toReference({seenEntityMaps:e.seenEntityMaps}),readsValue:((u=this.readsValue)==null?void 0:u.toReference({seenEntityMaps:e.seenEntityMaps}))||null,writesValues:this.writesValues.map(h=>h.toJSONClone({...e,newId:null})),inputs:[],outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),successCalls:this.successCalls.map(h=>h.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(h=>h.toJSONClone({...e,newId:null})),internalCalls:this.internalCalls.map(h=>this.calledBy.length||this.readsValue?h.toJSONClone({...e,newId:null}):h.toReference({seenEntityMaps:e.seenEntityMaps})),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})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),x:this.x,y:this.y})}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,x:this.x,y:this.y,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,declaration:((s=this.declaration)==null?void 0:s.toReference(e))||null,readsValue:((o=this.readsValue)==null?void 0:o.toReference(e))||null,writesValues:this.writesValues.map(l=>l.toReference(e)),inputs:this.inputs.map(l=>l.toReference(e)),outputs:this.outputs.map(l=>l.toReference(e)),successCalls:this.successCalls.map(l=>l.toReference(e)),errorCalls:this.errorCalls.map(l=>l.toReference(e)),calledBySuccess:this.calledBySuccess.map(l=>l.toReference(e)),calledByError:this.calledByError.map(l=>l.toReference(e)),calledByEntry:this.calledByEntry.map(l=>l.toReference(e)),internalCalls:this.internalCalls.map(l=>l.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...((a=this.declaration)==null?void 0:a.toFlatJSON(e))||[],...this.writesValues.flatMap(s=>s.toFlatJSON(e)),...this.successCalls.flatMap(s=>s.toFlatJSON(e)),...this.errorCalls.flatMap(s=>s.toFlatJSON(e)),...this.inputs.flatMap(s=>s.toFlatJSON(e)),...this.outputs.flatMap(s=>s.toFlatJSON(e)),...this.internalCalls.flatMap(s=>s.toFlatJSON(e)),...this.calledBy.flatMap(s=>s.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...((a=this.declaration)==null?void 0:a.toFlatGenerationTarget(e))||[],...((s=this.readsValue)==null?void 0:s.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(o=>o.toFlatGenerationTarget(e)),...this.successCalls.flatMap(o=>o.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(o=>o.toFlatGenerationTarget(e)),...this.inputs.flatMap(o=>o.toFlatGenerationTarget(e)),...this.outputs.flatMap(o=>o.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(o=>o.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),this.internalCalls.forEach(t=>t.clearErrors()),this}validate(){const e=x7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,n;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((n=this.readsValue)==null?void 0:n.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return this.defaultValue||((e=this.declaration)==null?void 0:e.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e=null,t=null,n=!0){var I,D,S,x;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.VariableInstance,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=(I=this.defaultValue)==null?void 0:I.clone(u,p+"-default-value-id",n);u.defaultValue=h||null;const f=(D=this.inputs)==null?void 0:D.map((k,K)=>k.clone(u,p+"-input-map-"+K+"-id",n));u.inputs=f;const R=(S=this.outputs)==null?void 0:S.map((k,K)=>k.clone(u,p+"-output-map-"+K+"-id",n));u.outputs=R;const v=(x=this.internalCalls)==null?void 0:x.map((k,K)=>k.clone(u,p+"-internal-call-"+K+"-id",n));return u.internalCalls=v,u}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}setDeclaration(e){return this.declaration!==e&&(this.declaration=e),this}generateUnusedInputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type)){const e=[...this.declaration.dataType.entity.properties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(u=>w(u,this.project)===w(s,this.project));if(!o)return;const l=this.declaration.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=Rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:M.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=b(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>w(l,this.project)===w(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.properties].filter(n=>!this.outputs.find(a=>a.declaration===n)).map(n=>{const a={id:M.UUID.uuid(),version:1,type:i.OutputMap,parent:this.toReference(),defaultValue:null,declaration:n,index:n.index,writesValues:[]},s=b(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.DefinitionEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.getAllInteractiveMethods()].filter(n=>!this.internalCalls.find(s=>{var l,p,u,h,f;return(((l=s.declaration)==null?void 0:l.id)||((u=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:u.entityId)||((f=(h=s.initialData)==null?void 0:h.declaration)==null?void 0:f.id))===n.id})).map(n=>{const a=n.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(me,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(me,"MUTABLE_BASE_PROPERTIES",[]),c(me,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),c(me,"MUTABLE_META_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,"x","y"]),c(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),c(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),c(me,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(me,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),c(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let Wr=me;function j7(r){var s;const e=E6(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=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});a.push(o.error)}return Me(r.errors,a)}const Te=class Te{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"constant",!0);c(this,"isError");c(this,"type",i.ReturnDeclaration);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"readsValue",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.constant=!0,this.isError=e.isError}static fromGenerationTarget(e,t){const n=A(e.parent),a=t.get(n);let s=null;if(e.readsValue){const p=A(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:i.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,defaultValue:null,implements:null,required:e.required,constant:!0,readsValue:s,dataType:null,parent:a},l=b(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l,p;let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[i.ReturnStatement,i.Search,i.BreakStatement,i.ContinueStatement]}},t),o=Fu(n,t);if(n=s.modifiedData,n.parent){const u=t.get(A(n.parent));if(u&&[i.BreakStatement,i.ContinueStatement].includes(u.type)){const h=u,f=h.parent,R=[...f.breakStatements.filter(I=>I.id!==u.id),...f.continueStatements.filter(I=>I.id!==u.id)];if(h.outputs.length)a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${n.id}' cannot be added to the parent entity of type '${h.type}' with id '${h.id}'. This '${h.type}' already has return declarations.
|
|
87
87
|
${qu}`,issue:null}));else{const I=(p=(l=R[0])==null?void 0:l.outputs[0])==null?void 0:p.name;I!==n.name&&a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${n.id}' cannot be added to the parent entity of type '${h.type}' with id '${h.id}'. This new 'return-declaration' doesn't have the same name "${I}" as the return declarations on the other statements in the same scope.
|
|
88
|
-
${qu}`,issue:null}))}}else if(u&&u.type===i.ReturnStatement){const h=u.parent;if(h&&We.includes(h.type)){const f=h.implements;if(f){const R=f.outputs.find(
|
|
88
|
+
${qu}`,issue:null}))}}else if(u&&u.type===i.ReturnStatement){const h=u.parent;if(h&&We.includes(h.type)){const f=h.implements;if(f){const R=f.outputs.find(k=>k.name===n.name),v=f.outputs.filter(k=>!u.outputs.find(oe=>oe.type===i.ReturnDeclaration&&oe.name===k.name)),I=u.outputs.filter(k=>k.type===i.ReturnDeclaration),D=I.find(k=>k.name===n.name),S=I.length?`The parent entity already implements the following return declarations: ${q(I.map(k=>`'${k.id}' (${k.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented return declarations.",x=v.length?`The parent entity is still missing the following returns in the implementation: ${q(v.map(k=>`'${k.id}' (${k.name})`),", "," and ")}.`:"The parent entity has all the returns it needs implemented.";R?D&&a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${n.id}' should not exist in a parent entity of type '${u.type}' with id '${u.id}' that implements a ${i.ActionDescriptor} with fixed outputs.
|
|
89
89
|
Adding a new return would make the implementation invalid. An return with the same name already exists in the parent entity.
|
|
90
90
|
${S}
|
|
91
|
-
${
|
|
91
|
+
${x}`,issue:null})):a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${n.id}' should not exist in a parent entity of type '${u.type}' with id '${u.id}' that implements a ${i.ActionDescriptor} with fixed outputs.
|
|
92
92
|
Adding a new return would make the implementation invalid. There are no returns in the descriptor with the same name.
|
|
93
93
|
${S}
|
|
94
|
-
${
|
|
95
|
-
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(s),e.push(s))}if(this.initialData.implements){const a=A(this.initialData.implements),s=this.project.get(a);s&&(this.setImplements(s),e.push(s))}return kn.hydrateReadsValue(this),{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(){var a;const e=[this],t=[],n=[];return this.isError?this.parent.throws=this:this.parent.addOutputDeclaration(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),{updated:m(e),added:m(t),removed:m(n),self:this}}propagateChanges(){const e=[this],t=[],n=[];if(this.parent&&[i.BreakStatement,i.ContinueStatement].includes(this.parent.type)){const a=this.parent.parent,{updated:s,added:o,removed:l}=a.syncChildren();e.push(...s),t.push(...o),n.push(...l)}return{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.dataType&&(this.dataType=b(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=b(this.initialData.implements,this.project);this.implements=e}return kn.initReadsValue(this),this.afterAllChildrenInitialized(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||(e.index!==0?this.index:0),this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this.isError=e.isError||this.isError,this.constant=e.constant!==void 0?e.constant:this.constant,this.required=e.required!==void 0?e.required:this.required,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,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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s.affected),a.push(...s.removed)}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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}if(this.dataType){const n=this.dataType.restore({seenEntities:e});t.push(...n.affected)}return{affected:[],self:this}}toFlat(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...((a=this.readsValue)==null?void 0:a.toFlat(e))||[],...((s=this.dataType)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...((a=this.dataType)==null?void 0:a.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,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,constant:!0,isError:this.isError,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,dataType:((n=this.dataType)==null?void 0:n.toJSON(e))||null,implements:((a=this.implements)==null?void 0:a.toJSON(e))||null,readsValue:((s=this.readsValue)==null?void 0:s.toJSON(e))||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,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,constant:!0,isError:this.isError,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,dataType:((u=this.dataType)==null?void 0:u.toJSONClone({...e,newId:null}))||null,implements:((h=this.implements)==null?void 0:h.toJSONClone({...e,newId:null}))||null,readsValue:((f=this.readsValue)==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,l;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,index:this.index,required:this.required,constant:!0,isError:this.isError,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,readsValue:((s=this.readsValue)==null?void 0:s.toReference(e))||null,implements:((o=this.implements)==null?void 0:o.toReference(e))||null,dataType:((l=this.dataType)==null?void 0:l.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...((a=this.dataType)==null?void 0:a.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,isError:this.isError,readsValue:(e=this.readsValue)==null?void 0:e.id,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e,t;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.dataType)==null||t.clearErrors(),this}validate(){const e=j7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,n;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...((n=this.dataType)==null?void 0:n.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){return this.defaultValue||null}setDefaultValue(e){return this.defaultValue=e,this}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.ReturnDeclaration,a);s.dataType=null;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.dataType)==null?void 0:R.clone(u,p+"--data-type-id",n);u.dataType=h||null;const f=(v=this.defaultValue)==null?void 0:v.clone(u,p+"-default-value-id",n);return u.defaultValue=f||null,u}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}inferDataType(){const e=Mu(this);if(e){const t=e.clone(this);t&&(t.inferred=!0,this.setDataType(t))}return this}getCounterparts(){let e=[];if([i.BreakStatement,i.ContinueStatement].includes(this.parent.type)){const t=this.parent.parent;e=[...t.breakStatements,...t.continueStatements].flatMap(s=>s.outputs).filter(s=>w(s,this.project)===w(this,this.project)&&s.id!==this.id)}else if(this.parent.type===i.ReturnStatement&&[i.FunctionDeclaration,i.GlobalEvent].includes(this.parent.parent.type)&&this.parent.parent.implements){const n=this.parent.parent.returnStatements.flatMap(a=>a.outputs);this.implements?e=n.filter(s=>{var o;return this.implements.id===((o=s.implements)==null?void 0:o.id)}):e=n.filter(s=>w(s,this.project)===w(this,this.project)&&s.id!==this.id)}return e}inferDataTypeFromCounterparts(){var n,a;const e=this.getCounterparts(),t=e.find(s=>{var o;return(o=s.dataType)==null?void 0:o.isResolved});if(t)this.setDataType(t.dataType);else for(let s=0;s<e.length;s++){const o=e[s];if((!o.dataType||!o.dataType.isResolved||(n=o.dataType)!=null&&n.inferred)&&o.readsValue&&o.inferDataType(),(a=o.dataType)!=null&&a.isResolved){this.setDataType(o.dataType);break}}return this}getDataType(){var e;return(!this.dataType||!this.dataType.isResolved||(e=this.dataType)!=null&&e.inferred)&&this.readsValue?this.inferDataType():this.inferDataTypeFromCounterparts(),this.dataType}};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","required","isError"]),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,"index"]),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",["readsValue"]),c(Te,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),c(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType","defaultValue"]),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 kt=Te;function k7(r){var o;const e=F6(),t=r.toJSON();e.safeParse(t).success,r.inputsDeclarations.forEach(l=>l.validate()),r.inputs.forEach(l=>l.validate()),r.outputsDeclarations.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),(o=r.error)==null||o.validate();const s=[...jn(r)];if(r.id==="search-person-by-id-id"){const l=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});s.push(l.error)}return Me(r.errors,s)}const Ve=class Ve{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,"query","");c(this,"type",i.Search);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"inputsDeclarations",[]);c(this,"inputs",[]);c(this,"outputsDeclarations",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);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,this.name=e.name,this.query=e.query,this.description=e.description}static fromGenerationTarget(e,t){let n=t;if(e.parent){const u=A(e.parent);n=t.get(u)}const a=e.calledByEntry.map(u=>{const h=A(u);return t.get(h)}),s=e.calledBySuccess.map(u=>{const h=A(u);return t.get(h)}),o=e.calledByError.map(u=>{const h=A(u);return t.get(h)}),l={id:e.id,version:1,type:i.Search,name:e.name,description:e.description,query:e.query,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputsDeclarations:[],inputs:[],outputsDeclarations:[],outputs:[],error:null,x:0,y:0,parent:n},p=b(l,t);return p.setParent(n),p.initChildren(),p}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);return n=s.modifiedData,a.push(...s.errors,...je(n)),{errors:a,modifiedData:n}}get resultsAsList(){const e=this.outputsDeclarations[0];if(e){const t=e.getDataType();return t?t.isList===!0:!0}return!0}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.
|
|
94
|
+
${x}`,issue:null}))}}}}return a.push(...s.errors,...o,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];let n=JSON.parse(JSON.stringify(e));const a=es(n,this);return n=a.modifiedData,t.push(...a.errors),n.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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
95
|
+
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(s),e.push(s))}if(this.initialData.implements){const a=A(this.initialData.implements),s=this.project.get(a);s&&(this.setImplements(s),e.push(s))}return kn.hydrateReadsValue(this),{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(){var a;const e=[this],t=[],n=[];return this.isError?this.parent.throws=this:this.parent.addOutputDeclaration(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),{updated:m(e),added:m(t),removed:m(n),self:this}}propagateChanges(){const e=[this],t=[],n=[];if(this.parent&&[i.BreakStatement,i.ContinueStatement].includes(this.parent.type)){const a=this.parent.parent,{updated:s,added:o,removed:l}=a.syncChildren();e.push(...s),t.push(...o),n.push(...l)}return{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.dataType&&(this.dataType=b(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=b(this.initialData.implements,this.project);this.implements=e}return kn.initReadsValue(this),this.afterAllChildrenInitialized(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||(e.index!==0?this.index:0),this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this.isError=e.isError||this.isError,this.constant=e.constant!==void 0?e.constant:this.constant,this.required=e.required!==void 0?e.required:this.required,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,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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s.affected),a.push(...s.removed)}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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}if(this.dataType){const n=this.dataType.restore({seenEntities:e});t.push(...n.affected)}return{affected:[],self:this}}toFlat(e=new Set){var n,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...((a=this.readsValue)==null?void 0:a.toFlat(e))||[],...((s=this.dataType)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...((a=this.dataType)==null?void 0:a.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,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,constant:!0,isError:this.isError,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,dataType:((n=this.dataType)==null?void 0:n.toJSON(e))||null,implements:((a=this.implements)==null?void 0:a.toJSON(e))||null,readsValue:((s=this.readsValue)==null?void 0:s.toJSON(e))||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,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,constant:!0,isError:this.isError,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,dataType:((u=this.dataType)==null?void 0:u.toJSONClone({...e,newId:null}))||null,implements:((h=this.implements)==null?void 0:h.toJSONClone({...e,newId:null}))||null,readsValue:((f=this.readsValue)==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,l;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,index:this.index,required:this.required,constant:!0,isError:this.isError,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,readsValue:((s=this.readsValue)==null?void 0:s.toReference(e))||null,implements:((o=this.implements)==null?void 0:o.toReference(e))||null,dataType:((l=this.dataType)==null?void 0:l.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...((a=this.dataType)==null?void 0:a.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,isError:this.isError,readsValue:(e=this.readsValue)==null?void 0:e.id,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e,t;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.dataType)==null||t.clearErrors(),this}validate(){const e=j7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,n;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...((n=this.dataType)==null?void 0:n.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){return this.defaultValue||null}setDefaultValue(e){return this.defaultValue=e,this}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.ReturnDeclaration,a);s.dataType=null;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.dataType)==null?void 0:R.clone(u,M.UUID.uuid(),n);u.dataType=h||null;const f=(v=this.defaultValue)==null?void 0:v.clone(u,p+"-default-value-id",n);return u.defaultValue=f||null,u}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}inferDataType(){const e=Mu(this);if(e){const t=e.clone(this);t&&(t.inferred=!0,this.setDataType(t))}return this}getCounterparts(){let e=[];if([i.BreakStatement,i.ContinueStatement].includes(this.parent.type)){const t=this.parent.parent;e=[...t.breakStatements,...t.continueStatements].flatMap(s=>s.outputs).filter(s=>w(s,this.project)===w(this,this.project)&&s.id!==this.id)}else if(this.parent.type===i.ReturnStatement&&[i.FunctionDeclaration,i.GlobalEvent].includes(this.parent.parent.type)&&this.parent.parent.implements){const n=this.parent.parent.returnStatements.flatMap(a=>a.outputs);this.implements?e=n.filter(s=>{var o;return this.implements.id===((o=s.implements)==null?void 0:o.id)}):e=n.filter(s=>w(s,this.project)===w(this,this.project)&&s.id!==this.id)}return e}inferDataTypeFromCounterparts(){var n,a;const e=this.getCounterparts(),t=e.find(s=>{var o;return(o=s.dataType)==null?void 0:o.isResolved});if(t)this.setDataType(t.dataType);else for(let s=0;s<e.length;s++){const o=e[s];if((!o.dataType||!o.dataType.isResolved||(n=o.dataType)!=null&&n.inferred)&&o.readsValue&&o.inferDataType(),(a=o.dataType)!=null&&a.isResolved){this.setDataType(o.dataType);break}}return this}getDataType(){var e;return(!this.dataType||!this.dataType.isResolved||(e=this.dataType)!=null&&e.inferred)&&this.readsValue?this.inferDataType():this.inferDataTypeFromCounterparts(),this.dataType}};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","required","isError"]),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,"index"]),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",["readsValue"]),c(Te,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),c(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType","defaultValue"]),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 kt=Te;function k7(r){var o;const e=F6(),t=r.toJSON();e.safeParse(t).success,r.inputsDeclarations.forEach(l=>l.validate()),r.inputs.forEach(l=>l.validate()),r.outputsDeclarations.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),(o=r.error)==null||o.validate();const s=[...jn(r)];if(r.id==="search-person-by-id-id"){const l=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});s.push(l.error)}return Me(r.errors,s)}const Ve=class Ve{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,"query","");c(this,"type",i.Search);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"inputsDeclarations",[]);c(this,"inputs",[]);c(this,"outputsDeclarations",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);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,this.name=e.name,this.query=e.query,this.description=e.description}static fromGenerationTarget(e,t){let n=t;if(e.parent){const u=A(e.parent);n=t.get(u)}const a=e.calledByEntry.map(u=>{const h=A(u);return t.get(h)}),s=e.calledBySuccess.map(u=>{const h=A(u);return t.get(h)}),o=e.calledByError.map(u=>{const h=A(u);return t.get(h)}),l={id:e.id,version:1,type:i.Search,name:e.name,description:e.description,query:e.query,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputsDeclarations:[],inputs:[],outputsDeclarations:[],outputs:[],error:null,x:0,y:0,parent:n},p=b(l,t);return p.setParent(n),p.initChildren(),p}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);return n=s.modifiedData,a.push(...s.errors,...je(n)),{errors:a,modifiedData:n}}get resultsAsList(){const e=this.outputsDeclarations[0];if(e){const t=e.getDataType();return t?t.isList===!0:!0}return!0}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.
|
|
96
96
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
97
|
-
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))}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.syncInputMaps();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{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(a=>a.id===e.id);t>-1&&this.inputs.splice(t,1);const n=this.inputsDeclarations.findIndex(a=>{var s;return a.id===((s=e.declaration)==null?void 0:s.id)});return n>-1&&this.inputsDeclarations.splice(n,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addInputDeclaration(e){return this.inputsDeclarations.includes(e)?this:(this.inputsDeclarations.push(e),this.syncInputMaps(),this)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(n=>n.id===e.id);return t>-1&&this.inputsDeclarations.splice(t,1),this}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(n=>n.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),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}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}initChildren(){return this.initialized?this:(this.initialized=!0,this.successCalls=this.initialData.successCalls.map(e=>{const t=b(e,this.project);return[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.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),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.name=e.name||this.name,this.description=e.description||this.description,e.query!==void 0&&(this.query=e.query),this}async load(e=V,...t){return await Ve.repository.load(this.id,...t),this}async create(e=V,...t){return await Ve.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Ve.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Ve.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.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),{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.inputsDeclarations.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.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.inputsDeclarations.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e)),...this.outputsDeclarations.flatMap(n=>n.toFlat(e)),...this.calledBy.flatMap(n=>n.toFlat(e)),...this.error?this.error.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.inputsDeclarations.flatMap(n=>n.toFlatIds(e)),...this.outputs.flatMap(n=>n.toFlatIds(e)),...this.outputsDeclarations.flatMap(n=>n.toFlatIds(e)),...this.calledBy.flatMap(n=>n.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(e=new Set){var t;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(n=>n.toJSON()),errorCalls:this.errorCalls.map(n=>n.toJSON()),calledBySuccess:this.calledBySuccess.map(n=>n.toReference()),calledByError:this.calledByError.map(n=>n.toReference()),calledByEntry:this.calledByEntry.map(n=>n.toReference()),inputsDeclarations:this.inputsDeclarations.map(n=>n.toJSON()),inputs:this.inputs.map(n=>n.toJSON()),outputsDeclarations:this.outputsDeclarations.map(n=>n.toJSON()),outputs:this.outputs.map(n=>n.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p;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:i.Search,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(u=>u.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(u=>u.toJSONClone({...e,newId:null})),calledBySuccess:this.calledBySuccess.map(u=>u.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(u=>u.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(u=>u.toReference({seenEntityMaps:e.seenEntityMaps})),inputsDeclarations:this.inputsDeclarations.map(u=>u.toJSONClone({...e,newId:null})),inputs:this.inputs.map(u=>u.toJSONClone({...e,newId:null})),outputsDeclarations:this.outputsDeclarations.map(u=>u.toJSONClone({...e,newId:null})),outputs:this.outputs.map(u=>u.toJSONClone({...e,newId:null})),error:((p=this.error)==null?void 0:p.toJSONClone({...e,newId:null}))||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,name:this.name,description:this.description,query:this.query,x:this.x,y:this.y,inputs:this.inputs.map(a=>a.toReference(e)),inputsDeclarations:this.inputsDeclarations.map(a=>a.toReference(e)),outputs:this.outputs.map(a=>a.toReference(e)),outputsDeclarations:this.outputsDeclarations.map(a=>a.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.inputsDeclarations.flatMap(n=>n.toFlatJSON(e)),...this.outputs.flatMap(n=>n.toFlatJSON(e)),...this.outputsDeclarations.flatMap(n=>n.toFlatJSON(e)),...this.calledBy.flatMap(n=>n.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,name:this.name,description:this.description,type:this.type,query:this.query,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.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.inputsDeclarations.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(n=>n.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.inputsDeclarations.forEach(t=>t.clearErrors()),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=k7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputsDeclarations.flatMap(t=>t.getErrors()),...this.inputs.flatMap(t=>t.getErrors()),...this.outputsDeclarations.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var I,D,S,F;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.Search,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=(I=this.inputsDeclarations)==null?void 0:I.map((j,K)=>j.clone(this,p+"-input-declaration-"+K+"-id",n));u.inputsDeclarations=h;const f=(D=this.outputsDeclarations)==null?void 0:D.map((j,K)=>j.clone(this,p+"-output-declaration-"+K+"-id",n));u.outputsDeclarations=f;const R=(S=this.inputs)==null?void 0:S.map((j,K)=>j.clone(u,p+"-input-map-"+K+"-id",n));u.inputs=R;const v=(F=this.outputs)==null?void 0:F.map((j,K)=>j.clone(u,p+"-output-map-"+K+"-id",n));return u.outputs=v,this.error&&(u.error=this.error.clone(u,p+"-error-map-id",n)),u}syncInputMaps(){const e=[],t=[],n=[];return this.inputsDeclarations.forEach(a=>{if(!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===a.id})){const o={id:this.id+"--"+M.UUID.uuid(),version:1,type:i.InputMap,declaration:a.toJSON(),readsValue:null,defaultValue:null,index:this.inputs.length,name:null,description:null,parent:this.toReference()},l=b(o,this.project);l.setParent(this),l.initChildren(),l.addSelfToProject(),e.push(this),t.push(l)}}),this.inputs.forEach(a=>{if(!this.inputsDeclarations.find(o=>{var l;return o.id===((l=a.declaration)==null?void 0:l.id)})){const{affected:o,removed:l}=a.remove();e.push(...o),n.push(...l)}}),{updated:m(e),added:m(t),removed:m(n),self:this}}};c(Ve,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Ve,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),c(Ve,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ve,"BASE_PROPERTIES",[...Ve.MUTABLE_BASE_PROPERTIES,...Ve.INMUTABLE_BASE_PROPERTIES]),c(Ve,"MUTABLE_META_PROPERTIES",[...Ve.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ve,"INMUTABLE_META_PROPERTIES",[...Ve.INMUTABLE_BASE_PROPERTIES]),c(Ve,"META_PROPERTIES",[...Ve.MUTABLE_META_PROPERTIES,...Ve.INMUTABLE_META_PROPERTIES]),c(Ve,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Ve,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ve,"UPSTREAM_PROPERTIES",[...Ve.MUTABLE_UPSTREAM_PROPERTIES,...Ve.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ve,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),c(Ve,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ve,"DOWNSTREAM_PROPERTIES",[...Ve.MUTABLE_DOWNSTREAM_PROPERTIES,...Ve.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ve,"PROPERTIES",[...kt.META_PROPERTIES,...kt.UPSTREAM_PROPERTIES,...kt.DOWNSTREAM_PROPERTIES]);let Yr=Ve;function q7(r){const e=B3(),t=r.toJSON();e.safeParse(t).success,r.functions.forEach(s=>s.validate()),r.events.forEach(s=>s.validate());const a=[];return Me(r.errors,a)}const Pe=class Pe{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,"type",i.InstalledProject);c(this,"implements");c(this,"functions",[]);c(this,"events",[]);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.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.implements=e.implements}static fromGenerationTarget(e,t){const n=t,a={id:e.id,version:1,name:e.name,type:i.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:i.Project,type:i.GenericReference,id:M.UUID.uuid()},x:0,y:0,parent:n},s=b(a,t);return s.setParent(n),s.initChildren(),s}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[];return a.push(...je(n)),{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 an installed project, 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{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{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.functions=this.initialData.functions.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.afterAllChildrenInitialized(),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.x=e.x||this.x,this.y=e.y||this.y,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=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.functions.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});n.push(...o),a.push(...l)}),this.events.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});n.push(...o),a.push(...l)}),{affected:[],removed:[]})}restore({seenEntities:e}={seenEntities:new Set}){return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.functions.forEach(t=>{t.restore({seenEntities:e})}),this.events.forEach(t=>{t.restore({seenEntities:e})}),{affected:[],self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.functions.flatMap(n=>n.toFlat(e)),...this.events.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(n=>n.toFlatIds(e)),...this.events.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,implements:this.implements,functions:this.functions.map(t=>t.toJSON(e)),events:this.events.map(t=>t.toJSON(e)),parent:this.parent.toReference(),x:this.x,y:this.y})}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:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(p=>p.toJSONClone({...e,newId:null})),events:this.events.map(p=>p.toJSONClone({...e,newId:null})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),x:this.x,y:this.y})}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,name:this.name,description:this.description,x:this.x,y:this.y,implements:this.implements,functions:this.functions.map(a=>a.toReference(e)),events:this.events.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.functions.flatMap(n=>n.toFlatJSON(e)),...this.events.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.functions.flatMap(n=>n.toFlatGenerationTarget(e)),...this.events.flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=q7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.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.InstalledProject,a);s.functions=[],s.events=[];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=(R=this.functions)==null?void 0:R.map((I,D)=>I.clone(u,p+"-exported-function-declaration-"+D+"-id",n));u.functions=h;const f=(v=this.events)==null?void 0:v.map((I,D)=>I.clone(u,p+"-exported-event-"+D+"-id",n));return u.events=f,u}};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",[]),c(Pe,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),c(Pe,"BASE_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,...Pe.INMUTABLE_BASE_PROPERTIES]),c(Pe,"MUTABLE_META_PROPERTIES",["x","y"]),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",[]),c(Pe,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),c(Pe,"UPSTREAM_PROPERTIES",[...Pe.MUTABLE_UPSTREAM_PROPERTIES,...Pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),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 Hr=Pe;function J7(r){var l;const e=k6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate();const a=jn(r),s=W7(r),o=[...a,...s];return Me(r.errors,o)}function W7(r){const e=[],t=Zo(r.parent),n=t==null?void 0:t.entity;if(!n)e.push(Q({id:`${r.id}--${B.InternalCallParentMissingDataType}`,code:B.InternalCallParentMissingDataType,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${r.declaration}".`,issue:null,entity:r}).error);else if(![i.DefinitionEntity,i.BuiltInBaseEntity,i.PrimitiveEntity].includes(n.type))e.push(Q({id:`${r.id}--${B.InternalCallParentDeclarationEntityInvalidType}`,code:B.InternalCallParentDeclarationEntityInvalidType,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type 'entity' is not a definition entity, built-in base entity or primitive entity.
|
|
97
|
+
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))}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.syncInputMaps();return e.push(...a),t.push(...s),n.push(...o),{updated:m(e),added:m(t),removed:m(n),self:this}}addSelfToProject(){const e=[this],t=[],n=[];return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{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(a=>a.id===e.id);t>-1&&this.inputs.splice(t,1);const n=this.inputsDeclarations.findIndex(a=>{var s;return a.id===((s=e.declaration)==null?void 0:s.id)});return n>-1&&this.inputsDeclarations.splice(n,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addInputDeclaration(e){return this.inputsDeclarations.includes(e)?this:(this.inputsDeclarations.push(e),this.syncInputMaps(),this)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(n=>n.id===e.id);return t>-1&&this.inputsDeclarations.splice(t,1),this}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(n=>n.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),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}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}initChildren(){return this.initialized?this:(this.initialized=!0,this.successCalls=this.initialData.successCalls.map(e=>{const t=b(e,this.project);return[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.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),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.name=e.name||this.name,this.description=e.description||this.description,e.query!==void 0&&(this.query=e.query),this}async load(e=V,...t){return await Ve.repository.load(this.id,...t),this}async create(e=V,...t){return await Ve.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Ve.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Ve.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.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o),a.push(...l)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{n.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{n.push(s),s.removeCall(this)}),{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.inputsDeclarations.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(n=>{const{affected:a}=n.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.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.inputsDeclarations.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e)),...this.outputsDeclarations.flatMap(n=>n.toFlat(e)),...this.calledBy.flatMap(n=>n.toFlat(e)),...this.error?this.error.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.inputsDeclarations.flatMap(n=>n.toFlatIds(e)),...this.outputs.flatMap(n=>n.toFlatIds(e)),...this.outputsDeclarations.flatMap(n=>n.toFlatIds(e)),...this.calledBy.flatMap(n=>n.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(e=new Set){var t;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(n=>n.toJSON()),errorCalls:this.errorCalls.map(n=>n.toJSON()),calledBySuccess:this.calledBySuccess.map(n=>n.toReference()),calledByError:this.calledByError.map(n=>n.toReference()),calledByEntry:this.calledByEntry.map(n=>n.toReference()),inputsDeclarations:this.inputsDeclarations.map(n=>n.toJSON()),inputs:this.inputs.map(n=>n.toJSON()),outputsDeclarations:this.outputsDeclarations.map(n=>n.toJSON()),outputs:this.outputs.map(n=>n.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p;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:i.Search,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(u=>u.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(u=>u.toJSONClone({...e,newId:null})),calledBySuccess:this.calledBySuccess.map(u=>u.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(u=>u.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(u=>u.toReference({seenEntityMaps:e.seenEntityMaps})),inputsDeclarations:this.inputsDeclarations.map(u=>u.toJSONClone({...e,newId:null})),inputs:this.inputs.map(u=>u.toJSONClone({...e,newId:null})),outputsDeclarations:this.outputsDeclarations.map(u=>u.toJSONClone({...e,newId:null})),outputs:this.outputs.map(u=>u.toJSONClone({...e,newId:null})),error:((p=this.error)==null?void 0:p.toJSONClone({...e,newId:null}))||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,name:this.name,description:this.description,query:this.query,x:this.x,y:this.y,inputs:this.inputs.map(a=>a.toReference(e)),inputsDeclarations:this.inputsDeclarations.map(a=>a.toReference(e)),outputs:this.outputs.map(a=>a.toReference(e)),outputsDeclarations:this.outputsDeclarations.map(a=>a.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.inputsDeclarations.flatMap(n=>n.toFlatJSON(e)),...this.outputs.flatMap(n=>n.toFlatJSON(e)),...this.outputsDeclarations.flatMap(n=>n.toFlatJSON(e)),...this.calledBy.flatMap(n=>n.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,name:this.name,description:this.description,type:this.type,query:this.query,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.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.inputsDeclarations.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(n=>n.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.inputsDeclarations.forEach(t=>t.clearErrors()),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=k7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputsDeclarations.flatMap(t=>t.getErrors()),...this.inputs.flatMap(t=>t.getErrors()),...this.outputsDeclarations.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,n=!0){var I,D,S,x;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.Search,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=(I=this.inputsDeclarations)==null?void 0:I.map((k,K)=>k.clone(this,p+"-input-declaration-"+K+"-id",n));u.inputsDeclarations=h;const f=(D=this.outputsDeclarations)==null?void 0:D.map((k,K)=>k.clone(this,p+"-output-declaration-"+K+"-id",n));u.outputsDeclarations=f;const R=(S=this.inputs)==null?void 0:S.map((k,K)=>k.clone(u,p+"-input-map-"+K+"-id",n));u.inputs=R;const v=(x=this.outputs)==null?void 0:x.map((k,K)=>k.clone(u,p+"-output-map-"+K+"-id",n));return u.outputs=v,this.error&&(u.error=this.error.clone(u,p+"-error-map-id",n)),u}syncInputMaps(){const e=[],t=[],n=[];return this.inputsDeclarations.forEach(a=>{if(!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===a.id})){const o={id:this.id+"--"+M.UUID.uuid(),version:1,type:i.InputMap,declaration:a.toJSON(),readsValue:null,defaultValue:null,index:this.inputs.length,name:null,description:null,parent:this.toReference()},l=b(o,this.project);l.setParent(this),l.initChildren(),l.addSelfToProject(),e.push(this),t.push(l)}}),this.inputs.forEach(a=>{if(!this.inputsDeclarations.find(o=>{var l;return o.id===((l=a.declaration)==null?void 0:l.id)})){const{affected:o,removed:l}=a.remove();e.push(...o),n.push(...l)}}),{updated:m(e),added:m(t),removed:m(n),self:this}}};c(Ve,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Ve,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),c(Ve,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ve,"BASE_PROPERTIES",[...Ve.MUTABLE_BASE_PROPERTIES,...Ve.INMUTABLE_BASE_PROPERTIES]),c(Ve,"MUTABLE_META_PROPERTIES",[...Ve.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ve,"INMUTABLE_META_PROPERTIES",[...Ve.INMUTABLE_BASE_PROPERTIES]),c(Ve,"META_PROPERTIES",[...Ve.MUTABLE_META_PROPERTIES,...Ve.INMUTABLE_META_PROPERTIES]),c(Ve,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Ve,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ve,"UPSTREAM_PROPERTIES",[...Ve.MUTABLE_UPSTREAM_PROPERTIES,...Ve.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ve,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),c(Ve,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ve,"DOWNSTREAM_PROPERTIES",[...Ve.MUTABLE_DOWNSTREAM_PROPERTIES,...Ve.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ve,"PROPERTIES",[...kt.META_PROPERTIES,...kt.UPSTREAM_PROPERTIES,...kt.DOWNSTREAM_PROPERTIES]);let Yr=Ve;function q7(r){const e=B3(),t=r.toJSON();e.safeParse(t).success,r.functions.forEach(s=>s.validate()),r.events.forEach(s=>s.validate());const a=[];return Me(r.errors,a)}const Pe=class Pe{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,"type",i.InstalledProject);c(this,"implements");c(this,"functions",[]);c(this,"events",[]);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.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.implements=e.implements}static fromGenerationTarget(e,t){const n=t,a={id:e.id,version:1,name:e.name,type:i.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:i.Project,type:i.GenericReference,id:M.UUID.uuid()},x:0,y:0,parent:n},s=b(a,t);return s.setParent(n),s.initChildren(),s}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[];return a.push(...je(n)),{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 an installed project, 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{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{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.functions=this.initialData.functions.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.afterAllChildrenInitialized(),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.x=e.x||this.x,this.y=e.y||this.y,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=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.functions.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});n.push(...o),a.push(...l)}),this.events.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});n.push(...o),a.push(...l)}),{affected:[],removed:[]})}restore({seenEntities:e}={seenEntities:new Set}){return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.functions.forEach(t=>{t.restore({seenEntities:e})}),this.events.forEach(t=>{t.restore({seenEntities:e})}),{affected:[],self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.functions.flatMap(n=>n.toFlat(e)),...this.events.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(n=>n.toFlatIds(e)),...this.events.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,implements:this.implements,functions:this.functions.map(t=>t.toJSON(e)),events:this.events.map(t=>t.toJSON(e)),parent:this.parent.toReference(),x:this.x,y:this.y})}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:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(p=>p.toJSONClone({...e,newId:null})),events:this.events.map(p=>p.toJSONClone({...e,newId:null})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps}),x:this.x,y:this.y})}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,name:this.name,description:this.description,x:this.x,y:this.y,implements:this.implements,functions:this.functions.map(a=>a.toReference(e)),events:this.events.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.functions.flatMap(n=>n.toFlatJSON(e)),...this.events.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.functions.flatMap(n=>n.toFlatGenerationTarget(e)),...this.events.flatMap(n=>n.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=q7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.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.InstalledProject,a);s.functions=[],s.events=[];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=(R=this.functions)==null?void 0:R.map((I,D)=>I.clone(u,p+"-exported-function-declaration-"+D+"-id",n));u.functions=h;const f=(v=this.events)==null?void 0:v.map((I,D)=>I.clone(u,p+"-exported-event-"+D+"-id",n));return u.events=f,u}};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",[]),c(Pe,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),c(Pe,"BASE_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,...Pe.INMUTABLE_BASE_PROPERTIES]),c(Pe,"MUTABLE_META_PROPERTIES",["x","y"]),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",[]),c(Pe,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),c(Pe,"UPSTREAM_PROPERTIES",[...Pe.MUTABLE_UPSTREAM_PROPERTIES,...Pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),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 Hr=Pe;function J7(r){var l;const e=k6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate();const a=jn(r),s=W7(r),o=[...a,...s];return Me(r.errors,o)}function W7(r){const e=[],t=Zo(r.parent),n=t==null?void 0:t.entity;if(!n)e.push(Q({id:`${r.id}--${B.InternalCallParentMissingDataType}`,code:B.InternalCallParentMissingDataType,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${r.declaration}".`,issue:null,entity:r}).error);else if(![i.DefinitionEntity,i.BuiltInBaseEntity,i.PrimitiveEntity].includes(n.type))e.push(Q({id:`${r.id}--${B.InternalCallParentDeclarationEntityInvalidType}`,code:B.InternalCallParentDeclarationEntityInvalidType,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type 'entity' is not a definition entity, built-in base entity or primitive entity.
|
|
98
98
|
This variable's data-type has an 'entity' field that references an entity with id '${n.id}' and of type '${n.type}'.`,issue:null,entity:r}).error);else{const a=cp(n),s=[];[i.DefinitionEntity,i.BuiltInBaseEntity,i.PrimitiveEntity].includes(n.type)&&s.push(...n.getAllInteractiveMethods());let o="";a?n.methods.length?o=`
|
|
99
99
|
All 'function-declaration' entities attached as methods to the parent data-type 'entity' field, available to be called as 'internal-calls' in this variable are:
|
|
100
100
|
- ${n.methods.map(u=>u.id).join(`
|
|
@@ -140,8 +140,8 @@ This means it can hold a function-call or operation as its value, to be executed
|
|
|
140
140
|
Input maps can only be added to variables which hold an entity with properties.`,issue:null})):v&&!(R!=null&&R.inferred)&&(v.properties.find(D=>D.id===l.id)||a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.InputMap}' with id '${n.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${l.id}' of the 'input-map' does not exist in the entity of the 'data-type'.
|
|
141
141
|
The entity of the data-type has the following properties that can be reads as input maps, ids: '${q(v.properties.map(D=>D.id),"', '","' and '")}'`,issue:null})))}else if(Je.filter(h=>Fe.includes(h)).includes(o.type)){const f=ap(o),R=f.find(I=>I.id===n.declaration),v=`The parent entity has the following argument declarations that can be referenced by input-maps, ids: '${q(f.map(I=>I.id),"', '","' and '")}'`;R||a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.InputMap}' with id '${n.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent entity does not have an 'argument-declaration' with id '${n.declaration}'.
|
|
142
142
|
You can't add an input-map to an entity that doesn't have a matching 'argument-declaration'.
|
|
143
|
-
${v}`,issue:null}))}}return a.push(...s.errors,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];let n=JSON.parse(JSON.stringify(e));const a=
|
|
144
|
-
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(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 kn.hydrateReadsValue(this),{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(){var a,s;const e=[this],t=[],n=[];if(this.parent.addInput(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),Fe.includes(this.parent.type)&&((s=this.parent.getDataType())!=null&&s.inferred)){const o=this.parent.type===i.VariableDeclaration?this.parent:this.parent.declaration;o.inferDataTypeAndSyncInstancesInputsAndOutputs(),e.push(o,...o.variableInstances)}return{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=b(this.initialData.declaration,this.project)),kn.initReadsValue(this),this.afterAllChildrenInitialized(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||(e.index!==0?this.index:0),this.name=e.name||this.name,this.description=e.description||this.description,this}async load(e=V,...t){return await Re.repository.load(this.id,...t),this}async create(e=V,...t){return await Re.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Re.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Re.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.readsValue&&(n.push(this.readsValue),this.readsValue.removeValueReader(this)),this.defaultValue&&(n.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(n.push(this.parent),this.parent.removeInput(this)),{affected:n,removed: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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.defaultValue&&(t.push(this.defaultValue),this.defaultValue.restore({seenEntities:e})),t.push(this.parent),this.parent.addInput(this),{affected:t,self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.defaultValue?this.defaultValue.toFlat(e):[],...this.declaration?this.declaration.toFlat(e):[],...this.readsValue?this.readsValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.defaultValue?this.defaultValue.toFlatIds(e):[],...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(e=new Set){var t,n,a;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,declaration:((n=this.declaration)==null?void 0:n.toJSON(e))||null,readsValue:((a=this.readsValue)==null?void 0:a.toReference())||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p,u,h,f,R,v;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,index:this.index,name:this.name,description:this.description,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,declaration:(u=this.declaration)!=null&&u.id&&this.project.getBuiltIn((h=this.declaration)==null?void 0:h.id)?(f=this.declaration)==null?void 0:f.toJSON(e.seenEntities):((R=this.declaration)==null?void 0:R.toJSONClone({...e,newId:null}))||null,readsValue:((v=this.readsValue)==null?void 0:v.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,name:this.name,description:this.description,index:this.index,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,declaration:((s=this.declaration)==null?void 0:s.toReference(e))||null,readsValue:((o=this.readsValue)==null?void 0:o.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.defaultValue?this.defaultValue.toFlatJSON(e):[],...this.defaultValue?this.defaultValue.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name||void 0,description:this.description||void 0,type:this.type,declaration:((e=this.declaration)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[],...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=Y7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return this.defaultValue||((e=this.declaration)==null?void 0:e.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e=null,t=null,n=!0){var f;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.InputMap,a);s.defaultValue=null;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=(f=this.defaultValue)==null?void 0:f.clone(u,p+"--default-value-id",n);return u.defaultValue=h||null,u}getDataType(){var t;if(this.parent.type===i.Operation)return this.parent.declaration.inferInputMapDataType(this);if(Fe.includes(this.parent.type)){const n=Fr(this.parent),a=n.getDataType();(!a||a.inferred)&&n.inferDataTypeAndSyncInstancesInputsAndOutputs()}const e=(t=this.declaration)==null?void 0:t.getDataType();if(!e){const n=Rn(this);if(n)return n}return e||null}};c(Re,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Re,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"MUTABLE_META_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,"index"]),c(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),c(Re,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(Re,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),c(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let Un=Re;class H7 extends Un{constructor(t,n){super(t,n);c(this,"declaration",null);c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}class z7 extends Un{constructor(t,n){super(t,n);c(this,"name",null);c(this,"description",null);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}function Z7(r){const e=S6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.id==="exec-sequentially-return-map-id"){const s=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});a.push(s.error)}return Me(r.errors,a)}const ge=class ge{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"type",i.OutputMap);c(this,"parentRelationType");c(this,"defaultValue",null);c(this,"declaration");c(this,"writesValues",[]);c(this,"dataType");c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const n=A(e.parent),a=t.get(n);let s;if(e.declaration){const p=A(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:i.OutputMap,index:(a.outputs||[]).length,defaultValue:null,declaration:s,writesValues:[],parent:a},l=b(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l;let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:Je.filter(p=>p!==i.Condition)},declaration:{list:!1,types:[i.ReturnDeclaration,i.Property]}},t);n=s.modifiedData;const o=t.get(n.parent);if(o&&Je.filter(p=>p!==i.Condition).includes(o.type)){const p=o.outputs.find(u=>u.declaration.id===(n.declaration?A(n.declaration):null));if(p)a.push(new g({id:`${n.id}--${T.OutputOverwrite}`,code:T.OutputOverwrite,severity:E.Error,message:`Entity of type '${i.OutputMap}' with id '${n.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${p.id}' that points to the same base 'return-declaration'.
|
|
143
|
+
${v}`,issue:null}))}}return a.push(...s.errors,...je(n)),{errors:a,modifiedData:n}}validateGeneratedUpdate(e){const t=[];let n=JSON.parse(JSON.stringify(e));const a=es(n,this);return n=a.modifiedData,t.push(...a.errors),n.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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
144
|
+
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:n}}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.readsValue){const a=A(this.initialData.readsValue),s=this.project.get(a);s&&(this.setValueWriter(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 kn.hydrateReadsValue(this),{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(){var a,s;const e=[this],t=[],n=[];if(this.parent.addInput(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),Fe.includes(this.parent.type)&&((s=this.parent.getDataType())!=null&&s.inferred)){const o=this.parent.type===i.VariableDeclaration?this.parent:this.parent.declaration;o.inferDataTypeAndSyncInstancesInputsAndOutputs(),e.push(o,...o.variableInstances)}return{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=b(this.initialData.declaration,this.project)),kn.initReadsValue(this),this.afterAllChildrenInitialized(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||(e.index!==0?this.index:0),this.name=e.name||this.name,this.description=e.description||this.description,this}async load(e=V,...t){return await Re.repository.load(this.id,...t),this}async create(e=V,...t){return await Re.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Re.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Re.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.readsValue&&(n.push(this.readsValue),this.readsValue.removeValueReader(this)),this.defaultValue&&(n.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(n.push(this.parent),this.parent.removeInput(this)),{affected:n,removed: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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.defaultValue&&(t.push(this.defaultValue),this.defaultValue.restore({seenEntities:e})),t.push(this.parent),this.parent.addInput(this),{affected:t,self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.defaultValue?this.defaultValue.toFlat(e):[],...this.declaration?this.declaration.toFlat(e):[],...this.readsValue?this.readsValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.defaultValue?this.defaultValue.toFlatIds(e):[],...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(e=new Set){var t,n,a;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,declaration:((n=this.declaration)==null?void 0:n.toJSON(e))||null,readsValue:((a=this.readsValue)==null?void 0:a.toReference())||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p,u,h,f,R,v;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,index:this.index,name:this.name,description:this.description,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,declaration:(u=this.declaration)!=null&&u.id&&this.project.getBuiltIn((h=this.declaration)==null?void 0:h.id)?(f=this.declaration)==null?void 0:f.toJSON(e.seenEntities):((R=this.declaration)==null?void 0:R.toJSONClone({...e,newId:null}))||null,readsValue:((v=this.readsValue)==null?void 0:v.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,name:this.name,description:this.description,index:this.index,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,declaration:((s=this.declaration)==null?void 0:s.toReference(e))||null,readsValue:((o=this.readsValue)==null?void 0:o.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.defaultValue?this.defaultValue.toFlatJSON(e):[],...this.defaultValue?this.defaultValue.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name||void 0,description:this.description||void 0,type:this.type,declaration:((e=this.declaration)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[],...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=Y7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return this.defaultValue||((e=this.declaration)==null?void 0:e.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e=null,t=null,n=!0){var u;let a=He(e,this);const s=this.toJSON(),o=t||de(w(this,this.project),i.InputMap,a);s.defaultValue=null,s.id=o;const l=ke(s,a);e?l.setParent(e):l.setParent(this.parent),n&&l.subscribe(),l.initChildren();const p=(u=this.defaultValue)==null?void 0:u.clone(l,M.UUID.uuid(),n);return l.defaultValue=p||null,l}getDataType(){var t;if(this.parent.type===i.Operation)return this.parent.declaration.inferInputMapDataType(this);if(Fe.includes(this.parent.type)){const n=Fr(this.parent),a=n.getDataType();(!a||a.inferred)&&n.inferDataTypeAndSyncInstancesInputsAndOutputs()}const e=(t=this.declaration)==null?void 0:t.getDataType();if(!e){const n=Rn(this);if(n)return n}return e||null}};c(Re,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Re,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"MUTABLE_META_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,"index"]),c(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),c(Re,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(Re,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),c(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let Un=Re;class H7 extends Un{constructor(t,n){super(t,n);c(this,"declaration",null);c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}class z7 extends Un{constructor(t,n){super(t,n);c(this,"name",null);c(this,"description",null);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}function Z7(r){const e=S6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.id==="exec-sequentially-return-map-id"){const s=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});a.push(s.error)}return Me(r.errors,a)}const ge=class ge{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"type",i.OutputMap);c(this,"parentRelationType");c(this,"defaultValue",null);c(this,"declaration");c(this,"writesValues",[]);c(this,"dataType");c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const n=A(e.parent),a=t.get(n);let s;if(e.declaration){const p=A(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:i.OutputMap,index:(a.outputs||[]).length,defaultValue:null,declaration:s,writesValues:[],parent:a},l=b(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l;let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:Je.filter(p=>p!==i.Condition)},declaration:{list:!1,types:[i.ReturnDeclaration,i.Property]}},t);n=s.modifiedData;const o=t.get(n.parent);if(o&&Je.filter(p=>p!==i.Condition).includes(o.type)){const p=o.outputs.find(u=>u.declaration.id===(n.declaration?A(n.declaration):null));if(p)a.push(new g({id:`${n.id}--${T.OutputOverwrite}`,code:T.OutputOverwrite,severity:E.Error,message:`Entity of type '${i.OutputMap}' with id '${n.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${p.id}' that points to the same base 'return-declaration'.
|
|
145
145
|
Any value reads can be done with that output-map instead.
|
|
146
146
|
You can't edit output-map entities as they need to match their return declarations, so you can only choose to read their outputted value if you need it.`,issue:null}));else{const u=n.declaration?t.get(n.declaration):null;if(u&&Fe.includes(o.type)){const h=Fr(o),f=h.dataType,R=(l=h.dataType)==null?void 0:l.entity;f?R?R.type===i.ActionDescriptor?a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.OutputMap}' with id '${n.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is a 'action-descriptor' entity.
|
|
147
147
|
This means it can hold a function-call or operation as its value, to be executed programatically.
|
|
@@ -151,14 +151,14 @@ ${Ju}`,issue:null})):a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSign
|
|
|
151
151
|
${Ju}`,issue:null}))}else if(u){const h=o.outputs.find(f=>f.declaration.id===n.declaration);h&&a.push(new g({id:`${n.id}--${T.OutputOverwrite}`,code:T.OutputOverwrite,severity:E.Error,message:`Entity of type '${i.OutputMap}' with id '${n.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${h.id}' that points to the same declaration.
|
|
152
152
|
Any value reads can be done with that output-map instead.
|
|
153
153
|
You can't edit output-map entities as they need to match their return declarations, so you can only choose to read their outputted value if you need it.`,issue:null}))}}}return a.push(...s.errors,...je(n)),{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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
154
|
-
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,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{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(){var a;const e=[this],t=[],n=[];return this.parentRelationType===ri.Error?Fe.includes(this.parent.type)||(this.parent.error=this):((a=this.declaration)==null?void 0:a.id)===_["value-descriptor"][ds.ActionOngoingProcessOutputValue].id?this.parent.process=this:this.parent.addOutput(this),this.writesValues.forEach(s=>{s.setValueWriter(this),e.push(s)}),{updated:m(e),added:m(t),removed:m(n),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),ss.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=b(this.initialData.declaration,this.project)),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.index=e.index||(e.index!==0?this.index:0),this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(e=V,...t){return await ge.repository.load(this.id,...t),this}async create(e=V,...t){return await ge.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await ge.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await ge.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.writesValues.forEach(s=>{n.push(s),s.readsValue=null}),e||(n.push(this.parent),this.parentRelationType===ri.Error?Fe.includes(this.parent.type)||(this.parent.error=null):this.parent.removeOutput(this)),{affected:n,removed: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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}return this.writesValues.forEach(n=>{t.push(n),n.setValueWriter(this)}),t.push(this.parent),this.parentRelationType===ri.Error?Fe.includes(this.parent.type)||(this.parent.error=this):this.parent.addOutput(this),{affected:t,self:this}}toFlat(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.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,index:this.index,parentRelationType:this.parentRelationType,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,writesValues:this.writesValues.map(a=>a.toJSON(e)),declaration:((n=this.declaration)==null?void 0:n.toJSON(e))||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p,u,h,f,R;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,index:this.index,parentRelationType:this.parentRelationType,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,writesValues:this.writesValues.map(v=>v.toJSONClone({...e,newId:null})),declaration:(u=this.declaration)!=null&&u.id&&this.project.getBuiltIn((h=this.declaration)==null?void 0:h.id)?(f=this.declaration)==null?void 0:f.toJSON(e.seenEntities):((R=this.declaration)==null?void 0:R.toJSONClone({...e,newId:null}))||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;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,index:this.index,parentRelationType:this.parentRelationType,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,declaration:(s=this.declaration)==null?void 0:s.toReference(e),writesValues:this.writesValues.map(o=>o.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){var e;return{id:this.id,type:this.type,declaration:((e=this.declaration)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=Z7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return this.defaultValue||((e=this.declaration)==null?void 0:e.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}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.OutputMap,a),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.dataType)==null?void 0:R.clone(u,p+"--data-type-id",n);u.dataType=h||null;const f=(v=this.defaultValue)==null?void 0:v.clone(u,p+"-default-value-id",n);return u.defaultValue=f||null,u}getDataType(){var t;return this.parent.type===i.Operation?this.parent.declaration.inferOutputMapDataType(this):((t=this.declaration)==null?void 0:t.getDataType())||null}};c(ge,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(ge,"MUTABLE_BASE_PROPERTIES",[]),c(ge,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"MUTABLE_META_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,"index"]),c(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),c(ge,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),c(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),c(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let xn=ge;class K7 extends xn{constructor(t,n){super(t,n);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}class X7 extends xn{constructor(t,n){super(t,n);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}function Q7(r){var s;const e=o5(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="company-dto-func-declaration-argument-dcl-id"){const o=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});a.push(o.error)}if(r.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=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});a.push(o.error)}return Me(r.errors,a)}const be=class be{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"constant",!0);c(this,"type",i.ArgumentDeclaration);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"writesValues",[]);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.constant=!0}static fromGenerationTarget(e,t){const n=A(e.parent),a=t.get(n),s={id:e.id,version:1,name:e.name,type:i.ArgumentDeclaration,index:a.inputs.length,defaultValue:null,description:e.description,required:e.required,constant:!0,implements:null,dataType:null,writesValues:[],parent:a},o=b(s,t);return o.setParent(a),o.initChildren(),o}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[i.FunctionDeclaration,i.Search,i.Condition]}},t);n=s.modifiedData;const o=$u(n,t);if(n.parent){const l=t.get(A(n.parent));if(l&&We.includes(l.type)){const p=l.implements;if(p){const u=p.inputs.find(D=>D.name===n.name),h=p.inputs.filter(D=>!l.inputs.find(F=>F.type===i.ArgumentDeclaration&&F.name===D.name)),f=l.inputs.filter(D=>D.type===i.ArgumentDeclaration),R=f.find(D=>D.name===n.name),v=f.length?`The parent entity already implements the following arguments: ${q(f.map(D=>`'${D.id}' (${D.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",I=h.length?`The parent entity is still missing the following arguments in the implementation: ${q(h.map(D=>`'${D.id}' (${D.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";u?R&&a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ArgumentDeclaration}' with id '${n.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${i.ActionDescriptor} with fixed arguments.
|
|
154
|
+
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,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{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(){var a;const e=[this],t=[],n=[];return this.parentRelationType===ri.Error?Fe.includes(this.parent.type)||(this.parent.error=this):((a=this.declaration)==null?void 0:a.id)===_["value-descriptor"][ls.ActionOngoingProcessOutputValue].id?this.parent.process=this:this.parent.addOutput(this),this.writesValues.forEach(s=>{s.setValueWriter(this),e.push(s)}),{updated:m(e),added:m(t),removed:m(n),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),as.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=b(this.initialData.declaration,this.project)),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.index=e.index||(e.index!==0?this.index:0),this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(e=V,...t){return await ge.repository.load(this.id,...t),this}async create(e=V,...t){return await ge.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await ge.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await ge.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}return this.writesValues.forEach(s=>{n.push(s),s.readsValue=null}),e||(n.push(this.parent),this.parentRelationType===ri.Error?Fe.includes(this.parent.type)||(this.parent.error=null):this.parent.removeOutput(this)),{affected:n,removed: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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}return this.writesValues.forEach(n=>{t.push(n),n.setValueWriter(this)}),t.push(this.parent),this.parentRelationType===ri.Error?Fe.includes(this.parent.type)||(this.parent.error=this):this.parent.addOutput(this),{affected:t,self:this}}toFlat(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.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,index:this.index,parentRelationType:this.parentRelationType,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,writesValues:this.writesValues.map(a=>a.toJSON(e)),declaration:((n=this.declaration)==null?void 0:n.toJSON(e))||null,parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p,u,h,f,R;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,index:this.index,parentRelationType:this.parentRelationType,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,writesValues:this.writesValues.map(v=>v.toJSONClone({...e,newId:null})),declaration:(u=this.declaration)!=null&&u.id&&this.project.getBuiltIn((h=this.declaration)==null?void 0:h.id)?(f=this.declaration)==null?void 0:f.toJSON(e.seenEntities):((R=this.declaration)==null?void 0:R.toJSONClone({...e,newId:null}))||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;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,index:this.index,parentRelationType:this.parentRelationType,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,declaration:(s=this.declaration)==null?void 0:s.toReference(e),writesValues:this.writesValues.map(o=>o.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){var e;return{id:this.id,type:this.type,declaration:((e=this.declaration)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var n;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=Z7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return this.defaultValue||((e=this.declaration)==null?void 0:e.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}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.OutputMap,a),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.dataType)==null?void 0:R.clone(u,M.UUID.uuid(),n);u.dataType=h||null;const f=(v=this.defaultValue)==null?void 0:v.clone(u,p+"-default-value-id",n);return u.defaultValue=f||null,u}getDataType(){var t;return this.parent.type===i.Operation?this.parent.declaration.inferOutputMapDataType(this):((t=this.declaration)==null?void 0:t.getDataType())||null}};c(ge,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(ge,"MUTABLE_BASE_PROPERTIES",[]),c(ge,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"MUTABLE_META_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,"index"]),c(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),c(ge,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),c(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),c(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let xn=ge;class K7 extends xn{constructor(t,n){super(t,n);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}class X7 extends xn{constructor(t,n){super(t,n);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(t=new Set){return super.toJSON(t)}}function Q7(r){var s;const e=o5(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="company-dto-func-declaration-argument-dcl-id"){const o=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});a.push(o.error)}if(r.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=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});a.push(o.error)}return Me(r.errors,a)}const be=class be{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"constant",!0);c(this,"type",i.ArgumentDeclaration);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"writesValues",[]);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.constant=!0}static fromGenerationTarget(e,t){const n=A(e.parent),a=t.get(n),s={id:e.id,version:1,name:e.name,type:i.ArgumentDeclaration,index:a.inputs.length,defaultValue:null,description:e.description,required:e.required,constant:!0,implements:null,dataType:null,writesValues:[],parent:a},o=b(s,t);return o.setParent(a),o.initChildren(),o}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[i.FunctionDeclaration,i.Search,i.Condition]}},t);n=s.modifiedData;const o=$u(n,t);if(n.parent){const l=t.get(A(n.parent));if(l&&We.includes(l.type)){const p=l.implements;if(p){const u=p.inputs.find(D=>D.name===n.name),h=p.inputs.filter(D=>!l.inputs.find(x=>x.type===i.ArgumentDeclaration&&x.name===D.name)),f=l.inputs.filter(D=>D.type===i.ArgumentDeclaration),R=f.find(D=>D.name===n.name),v=f.length?`The parent entity already implements the following arguments: ${q(f.map(D=>`'${D.id}' (${D.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",I=h.length?`The parent entity is still missing the following arguments in the implementation: ${q(h.map(D=>`'${D.id}' (${D.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";u?R&&a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ArgumentDeclaration}' with id '${n.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${i.ActionDescriptor} with fixed arguments.
|
|
155
155
|
Adding a new argument would make the implementation invalid. An argument with the same name already exists in the parent entity.
|
|
156
156
|
${v}
|
|
157
157
|
${I}`,issue:null})):a.push(new g({id:`${n.id}--${B.NoOverlapWithImplementedSignature}`,code:B.NoOverlapWithImplementedSignature,severity:E.Error,message:`Entity of type '${i.ArgumentDeclaration}' with id '${n.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${i.ActionDescriptor} with fixed arguments.
|
|
158
158
|
Adding a new argument would make the implementation invalid. There are no arguments in the descriptor with the same name.
|
|
159
159
|
${v}
|
|
160
160
|
${I}`,issue:null}))}}}return a.push(...s.errors,...o,...je(n)),{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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
161
|
-
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,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.implements){const a=A(this.initialData.implements),s=this.project.get(a);s&&(this.setImplements(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.addInputDeclaration(this),e.push(this.parent),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),{updated:m(e),added:m(t),removed:m(n),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.dataType&&(this.dataType=b(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=b(this.initialData.implements,this.project);this.implements=e}return
|
|
161
|
+
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,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.implements){const a=A(this.initialData.implements),s=this.project.get(a);s&&(this.setImplements(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.addInputDeclaration(this),e.push(this.parent),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),{updated:m(e),added:m(t),removed:m(n),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=b(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.dataType&&(this.dataType=b(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=b(this.initialData.implements,this.project);this.implements=e}return as.initWritesValues(this,this.parent),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.index=e.index||(e.index!==0?this.index:0),this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this}async load(e=V,...t){return await be.repository.load(this.id,...t),this}async create(e=V,...t){return await be.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await be.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await be.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.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s),a.push(...o)}if(this.writesValues.forEach(s=>{n.push(s),s.readsValue=null}),e||(n.push(this.parent),this.parent.removeInputDeclaration(this)),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s.affected),a.push(...s.removed)}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.defaultValue){const{affected:n}=this.defaultValue.restore({seenEntities:e});t.push(...n)}if(this.writesValues.forEach(n=>{t.push(n),n.setValueWriter(this)}),t.push(this.parent),this.parent.addInputDeclaration(this),this.dataType){const{affected:n}=this.dataType.restore({seenEntities:e});t.push(...n)}return{affected:m(t),self:this}}toFlat(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this,...((n=this.defaultValue)==null?void 0:n.toFlat(e))||[],...this.writesValues.flatMap(s=>s.toFlat(e)),...((a=this.dataType)==null?void 0:a.toFlat(e))||[]])}toFlatIds(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((n=this.defaultValue)==null?void 0:n.toFlatIds(e))||[],...this.writesValues.flatMap(s=>s.toFlatIds(e)),...((a=this.dataType)==null?void 0:a.toFlatIds(e))||[]])}toJSON(e=new Set){var t,n,a;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,constant:!0,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,dataType:((n=this.dataType)==null?void 0:n.toJSON(e))||null,implements:((a=this.implements)==null?void 0:a.toJSON(e))||null,writesValues:this.writesValues.map(s=>s.toJSON(e)),parent:this.parent.toReference()})}toJSONClone(e=L){var n,a,s,o,l,p,u,h;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,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,constant:!0,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,dataType:((u=this.dataType)==null?void 0:u.toJSONClone({...e,newId:null}))||null,implements:((h=this.implements)==null?void 0:h.toJSONClone({...e,newId:null}))||null,writesValues:this.writesValues.map(f=>f.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,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,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,constant:!0,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,writesValues:this.writesValues.map(l=>l.toReference(e)),implements:((s=this.implements)==null?void 0:s.toReference(e))||null,dataType:((o=this.dataType)==null?void 0:o.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((n=this.defaultValue)==null?void 0:n.toFlatJSON(e))||[],...this.writesValues.flatMap(s=>s.toFlatJSON(e)),...((a=this.dataType)==null?void 0:a.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,constant:!0,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var n,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((n=this.defaultValue)==null?void 0:n.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(s=>s.toFlatGenerationTarget(e)),...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e,t;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.dataType)==null||t.clearErrors(),this}validate(){const e=Q7(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,n;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...((n=this.dataType)==null?void 0:n.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){return(this==null?void 0:this.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}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.ArgumentDeclaration,a);s.dataType=null;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.dataType)==null?void 0:R.clone(u,M.UUID.uuid(),n);u.dataType=h||null;const f=(v=this.defaultValue)==null?void 0:v.clone(u,p+"-default-value-id",n);return u.defaultValue=f||null,u}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};c(be,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(be,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),c(be,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(be,"BASE_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,...be.INMUTABLE_BASE_PROPERTIES]),c(be,"MUTABLE_META_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,"index"]),c(be,"INMUTABLE_META_PROPERTIES",[...be.INMUTABLE_BASE_PROPERTIES]),c(be,"META_PROPERTIES",[...be.MUTABLE_META_PROPERTIES,...be.INMUTABLE_META_PROPERTIES]),c(be,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(be,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(be,"UPSTREAM_PROPERTIES",[...be.MUTABLE_UPSTREAM_PROPERTIES,...be.INMUTABLE_UPSTREAM_PROPERTIES]),c(be,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType","defaultValue"]),c(be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(be,"DOWNSTREAM_PROPERTIES",[...be.MUTABLE_DOWNSTREAM_PROPERTIES,...be.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(be,"PROPERTIES",[...be.META_PROPERTIES,...be.UPSTREAM_PROPERTIES,...be.DOWNSTREAM_PROPERTIES]);let zr=be;function eq(r){const e=Wc(),t=r.toJSON();e.safeParse(t).success;const a=[];return Me(r.errors,a)}function tq(r,e){var n,a;const t=[];if(r.parent)if(r.parent){const s=e.get(r.parent);s?[i.InputMap,i.DataType].includes(s.type)?s.type===i.DataType&&s.entity?t.push(new g({id:`${r.id}--${r.parent}--${T.NewEntityWouldOverriteExisting}`,code:T.NewEntityWouldOverriteExisting,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${s.entity.id}".
|
|
162
162
|
Data types can only have one 'literal-value' entity as 'entity'.
|
|
163
163
|
You can update the existing 'literal-value' with the 'update' action, for example, like so:
|
|
164
164
|
\`\`\`json
|
|
@@ -197,7 +197,7 @@ ${lr}`,a.push(new g({id:`${e.id}--${T.NonInteractiveEntityReferenced}`,code:T.No
|
|
|
197
197
|
You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
|
|
198
198
|
${gn({describe_entity:l.entity.id})}
|
|
199
199
|
Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return a.push(...s.errors,...je(n)),{errors:a,modifiedData:n}}syncOperationInstance(e){return e}inferInputMapDataType(e){return Bu(e)}inferOutputMapDataType(e){return _u(e)}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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
200
|
-
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,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{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?(this.parent.type===i.DefinitionEntity?(this.parent.addAbstractMethod(this),e.push(this.parent)):this.parent.type===i.DataType&&(this.parent.setEntity(this),e.push(this.parent)),{updated:m(e),added:m(t),removed:m(n),self:this}):{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),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.name=e.name||this.name,this.description=e.description||this.description,this}async load(e=V,...t){return await Ie.repository.load(this.id,...t),this}async create(e=V,...t){return await Ie.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Ie.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Ie.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.inputs.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o.affected),a.push(...o.removed)}),this.outputs.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o.affected),a.push(...o.removed)}),this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s.affected),a.push(...s.removed)}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.inputs.forEach(n=>{const a=n.restore({seenEntities:e});t.push(...a.affected)}),this.outputs.forEach(n=>{const a=n.restore({seenEntities:e});t.push(...a.affected)}),this.error){const n=this.error.restore({seenEntities:e});t.push(...n.affected)}return{affected:m(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...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,name:this.name,description:this.description,error:((t=this.error)==null?void 0:t.toJSON())||null,inputs:this.inputs.map(a=>a.toJSON()),outputs:this.outputs.map(a=>a.toJSON()),parent:((n=this.parent)==null?void 0:n.toReference())||null})}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,name:this.name,description:this.description,error:((p=this.error)==null?void 0:p.toJSONClone({...e,newId:null}))||null,inputs:this.inputs.map(h=>h.toJSONClone({...e,newId:null})),outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),parent:((u=this.parent)==null?void 0:u.toReference({seenEntityMaps:e.seenEntityMaps}))||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+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n,a,s;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,error:((a=this.error)==null?void 0:a.toReference(e))||null,inputs:this.inputs.map(o=>o.toReference(e)),outputs:this.outputs.map(o=>o.toReference(e)),parent:((s=this.parent)==null?void 0:s.toReference(e))||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(n=>n.toFlatJSON(e)),...this.outputs.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,parent:((e=this.parent)==null?void 0:e.id)||void 0}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputs.flatMap(n=>n.toFlatGenerationTarget(e))])}implementAsFunctionDeclaration(e){var s;const t=this.inputs.map((o,l)=>{var u;const p={id:e+"--"+o.id+"--parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:i.ArgumentDeclaration,name:o.name,required:o.required,implements:o.toJSON(),constant:!0,writesValues:[],defaultValue:null,description:o.description,index:l,dataType:((u=o.dataType)==null?void 0:u.toJSON())||null,parent:p}}),n=[],a=[];if(this.outputs.length){const o=this.outputs.map((h,f)=>{var v;const R={id:e+"--return-statement--"+h.id+"--parent-ref",type:i.GenericReference,entityId:e,entityType:i.ReturnStatement};return{id:e+"--"+h.id,version:h.version,type:i.ReturnDeclaration,name:h.name,description:h.description,readsValue:null,constant:!0,required:h.required,defaultValue:null,implements:h.toJSON(),isError:!1,index:f,dataType:((v=h.dataType)==null?void 0:v.toJSON())||null,parent:R}}),l={id:e+"--return-statement-parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},u={id:e+"--return-statement",version:this.version,type:i.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:l,x:0,y:0};n.push(u),a.push(u)}return{id:e,version:this.version,type:i.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:n,calls:a,collapsed:!1,private:!1,implements:this.toJSON(),index:0,parent:((s=this.parent)==null?void 0:s.toReference())||null,x:0,y:0}}implementAsLoop(e){const t=e||this.project,n=this.id+"--instance-"+M.UUID.fromUUID(M.UUID.uuid()),a={id:n,version:this.version,type:i.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],outputsDeclarations:[],body:null,x:0,y:0,parent:t.toReference()};this.inputs.forEach((l,p)=>{const h={id:l.toReference().id+"--input-map-id",version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Loop}};a.inputs.push(h)}),this.outputs.forEach((l,p)=>{const h={id:l.toReference().id+"--output-map-id",version:this.version,type:i.OutputMap,declaration:l,defaultValue:null,writesValues:[],index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Loop}};a.outputs.push(h)});const s={id:n+"--body-function-declaration-id",version:this.version,type:i.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Loop}};s.inputs=[{id:M.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,constant:!0,defaultValue:null,writesValues:[],implements:null,index:0,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}},{id:M.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,constant:!0,required:!0,defaultValue:null,writesValues:[],implements:null,index:1,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}}],a.body=s;const o=b(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const n=e||this.project,a=t||this.id+"--instance-"+M.UUID.fromUUID(M.UUID.uuid()),s={id:a,version:this.version,type:i.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:n.toReference()};if(this.inputs.forEach((l,p)=>{const u={id:a+de(l.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.inputs.push(u)}),this.outputs.forEach((l,p)=>{const u={id:a+de(l.name,i.OutputMap,this.project),version:this.version,type:i.OutputMap,declaration:l,defaultValue:null,writesValues:[],index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.outputs.push(u)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:i.OutputMap,declaration:this.error,writesValues:[],defaultValue:null,index:-1,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.error=p}const o=b(s,this.project);return o.setParent(n),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,n=this.id+"--instance-"+M.UUID.fromUUID(M.UUID.uuid()),a={id:n,version:this.version,type:i.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.inputs.forEach((o,l)=>{const p={id:n+de(o.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:l,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Condition}};a.inputs.push(p)});const s=b(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e;return this.errors=[],this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=aq(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())]}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.ActionDescriptor,a);s.inputs=[],s.outputs=[],s.error=null;const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const u=ke(s,a);e?u.setParent(e):this.parent&&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+"-argument-value-descriptor-"+D+"-id",n));u.inputs=h;const f=(v=this.outputs)==null?void 0:v.map((I,D)=>I.clone(u,p+"-return-value-descriptor-"+D+"-id",n));return u.outputs=f,this.error&&(u.error=this.error.clone(u,p+"-error-action-descriptor-id",n)),u}addInput(e){return this.inputs.find(t=>t.id===e.id)||this.inputs.push(e),this}removeInput(e){return this.inputs=this.inputs.filter(t=>t.id!==e.id),this}addOutput(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutput(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}};c(Ie,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Ie,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Ie,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ie,"BASE_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"MUTABLE_META_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES]),c(Ie,"INMUTABLE_META_PROPERTIES",[...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"META_PROPERTIES",[...Ie.MUTABLE_META_PROPERTIES,...Ie.INMUTABLE_META_PROPERTIES]),c(Ie,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ie,"UPSTREAM_PROPERTIES",[...Ie.MUTABLE_UPSTREAM_PROPERTIES,...Ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs"]),c(Ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ie,"DOWNSTREAM_PROPERTIES",[...Ie.MUTABLE_DOWNSTREAM_PROPERTIES,...Ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ie,"PROPERTIES",[...Ie.META_PROPERTIES,...Ie.UPSTREAM_PROPERTIES,...Ie.DOWNSTREAM_PROPERTIES]);let se=Ie;function sq(r){var s;const e=U9(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];return Me(r.errors,a)}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,"index");c(this,"required");c(this,"parentRelationType");c(this,"type",i.ValueDescriptor);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.index=e.index,this.required=e.required,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const n=e.parent?A(e.parent):null,a=n?t.get(n):null,s=e.parentRelationType===P.FixedArguments?a==null?void 0:a.inputs.length:a==null?void 0:a.outputs.length,o={id:e.id,version:1,name:e.name,type:i.ValueDescriptor,index:s||0,description:e.description,required:e.required,defaultValue:null,parentRelationType:e.parentRelationType,dataType:null,parent:a},l=b(o,t);return a&&l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[i.ActionDescriptor]}},t);n=s.modifiedData,a.push(...s.errors,...je(n));const o=n.parent&&t.get(n.parent),l=o&&ur(o);return l&&l.type===i.ActionDescriptor&&a.push(new g({id:`${e.id}--${T.BuiltInEntityParent}`,code:T.BuiltInEntityParent,severity:E.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${l.name}" of type '${l.type}' with id '${l.id}'.
|
|
200
|
+
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,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{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?(this.parent.type===i.DefinitionEntity?(this.parent.addAbstractMethod(this),e.push(this.parent)):this.parent.type===i.DataType&&(this.parent.setEntity(this),e.push(this.parent)),{updated:m(e),added:m(t),removed:m(n),self:this}):{updated:m(e),added:m(t),removed:m(n),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=b(e,this.project);return t.setParent(this),t.initChildren(),t}),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.name=e.name||this.name,this.description=e.description||this.description,this}async load(e=V,...t){return await Ie.repository.load(this.id,...t),this}async create(e=V,...t){return await Ie.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Ie.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Ie.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.inputs.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o.affected),a.push(...o.removed)}),this.outputs.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});n.push(...o.affected),a.push(...o.removed)}),this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});n.push(...s.affected),a.push(...s.removed)}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.inputs.forEach(n=>{const a=n.restore({seenEntities:e});t.push(...a.affected)}),this.outputs.forEach(n=>{const a=n.restore({seenEntities:e});t.push(...a.affected)}),this.error){const n=this.error.restore({seenEntities:e});t.push(...n.affected)}return{affected:m(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(n=>n.toFlat(e)),...this.outputs.flatMap(n=>n.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...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,name:this.name,description:this.description,error:((t=this.error)==null?void 0:t.toJSON())||null,inputs:this.inputs.map(a=>a.toJSON()),outputs:this.outputs.map(a=>a.toJSON()),parent:((n=this.parent)==null?void 0:n.toReference())||null})}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,name:this.name,description:this.description,error:((p=this.error)==null?void 0:p.toJSONClone({...e,newId:null}))||null,inputs:this.inputs.map(h=>h.toJSONClone({...e,newId:null})),outputs:this.outputs.map(h=>h.toJSONClone({...e,newId:null})),parent:((u=this.parent)==null?void 0:u.toReference({seenEntityMaps:e.seenEntityMaps}))||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+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:t,entityType:this.type}}toShallowJSON(e=L){var n,a,s;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,error:((a=this.error)==null?void 0:a.toReference(e))||null,inputs:this.inputs.map(o=>o.toReference(e)),outputs:this.outputs.map(o=>o.toReference(e)),parent:((s=this.parent)==null?void 0:s.toReference(e))||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(n=>n.toFlatJSON(e)),...this.outputs.flatMap(n=>n.toFlatJSON(e))])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,parent:((e=this.parent)==null?void 0:e.id)||void 0}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(n=>n.toFlatGenerationTarget(e)),...this.outputs.flatMap(n=>n.toFlatGenerationTarget(e))])}implementAsFunctionDeclaration(e){var s;const t=this.inputs.map((o,l)=>{var u;const p={id:e+"--"+o.id+"--parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e};return{id:M.UUID.uuid(),version:o.version,type:i.ArgumentDeclaration,name:o.name,required:o.required,implements:o.toJSON(),constant:!0,writesValues:[],defaultValue:null,description:o.description,index:l,dataType:((u=o.dataType)==null?void 0:u.toJSON())||null,parent:p}}),n=[],a=[];if(this.outputs.length){const o=this.outputs.map((h,f)=>{var v;const R={id:e+"--return-statement--"+h.id+"--parent-ref",type:i.GenericReference,entityId:e,entityType:i.ReturnStatement};return{id:M.UUID.uuid(),version:h.version,type:i.ReturnDeclaration,name:h.name,description:h.description,readsValue:null,constant:!0,required:h.required,defaultValue:null,implements:h.toJSON(),isError:!1,index:f,dataType:((v=h.dataType)==null?void 0:v.toJSON())||null,parent:R}}),l={id:e+"--return-statement-parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},u={id:M.UUID.uuid(),version:this.version,type:i.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:l,x:0,y:0};n.push(u),a.push(u)}return{id:e,version:this.version,type:i.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:n,calls:a,collapsed:!1,private:!1,implements:this.toJSON(),index:0,parent:((s=this.parent)==null?void 0:s.toReference())||null,x:0,y:0}}implementAsLoop(e){const t=e||this.project,n=M.UUID.uuid(),a={id:n,version:this.version,type:i.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],outputsDeclarations:[],body:null,x:0,y:0,parent:t.toReference()};this.inputs.forEach((l,p)=>{const u={id:M.UUID.uuid(),version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Loop}};a.inputs.push(u)}),this.outputs.forEach((l,p)=>{const u={id:M.UUID.uuid(),version:this.version,type:i.OutputMap,declaration:l,defaultValue:null,writesValues:[],index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Loop}};a.outputs.push(u)});const s={id:M.UUID.uuid(),version:this.version,type:i.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Loop}};s.inputs=[{id:M.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,constant:!0,defaultValue:null,writesValues:[],implements:null,index:0,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}},{id:M.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,constant:!0,required:!0,defaultValue:null,writesValues:[],implements:null,index:1,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}}],a.body=s;const o=b(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const n=e||this.project,a=t||M.UUID.uuid(),s={id:a,version:this.version,type:i.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:n.toReference()};if(this.inputs.forEach((l,p)=>{const u={id:a+de(l.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.inputs.push(u)}),this.outputs.forEach((l,p)=>{const u={id:a+de(l.name,i.OutputMap,this.project),version:this.version,type:i.OutputMap,declaration:l,defaultValue:null,writesValues:[],index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.outputs.push(u)}),this.error){const l={id:M.UUID.uuid(),version:this.version,type:i.OutputMap,declaration:this.error,writesValues:[],defaultValue:null,index:-1,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.error=l}const o=b(s,this.project);return o.setParent(n),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,n=M.UUID.uuid(),a={id:n,version:this.version,type:i.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.inputs.forEach((o,l)=>{const p={id:n+de(o.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:l,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:n,entityType:i.Condition}};a.inputs.push(p)});const s=b(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e;return this.errors=[],this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=aq(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())]}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.ActionDescriptor,a);s.inputs=[],s.outputs=[],s.error=null;const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const u=ke(s,a);e?u.setParent(e):this.parent&&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+"-argument-value-descriptor-"+D+"-id",n));u.inputs=h;const f=(v=this.outputs)==null?void 0:v.map((I,D)=>I.clone(u,p+"-return-value-descriptor-"+D+"-id",n));return u.outputs=f,this.error&&(u.error=this.error.clone(u,p+"-error-action-descriptor-id",n)),u}addInput(e){return this.inputs.find(t=>t.id===e.id)||this.inputs.push(e),this}removeInput(e){return this.inputs=this.inputs.filter(t=>t.id!==e.id),this}addOutput(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutput(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}};c(Ie,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Ie,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Ie,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ie,"BASE_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"MUTABLE_META_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES]),c(Ie,"INMUTABLE_META_PROPERTIES",[...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"META_PROPERTIES",[...Ie.MUTABLE_META_PROPERTIES,...Ie.INMUTABLE_META_PROPERTIES]),c(Ie,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ie,"UPSTREAM_PROPERTIES",[...Ie.MUTABLE_UPSTREAM_PROPERTIES,...Ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs"]),c(Ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ie,"DOWNSTREAM_PROPERTIES",[...Ie.MUTABLE_DOWNSTREAM_PROPERTIES,...Ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ie,"PROPERTIES",[...Ie.META_PROPERTIES,...Ie.UPSTREAM_PROPERTIES,...Ie.DOWNSTREAM_PROPERTIES]);let se=Ie;function sq(r){var s;const e=U9(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];return Me(r.errors,a)}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,"index");c(this,"required");c(this,"parentRelationType");c(this,"type",i.ValueDescriptor);c(this,"defaultValue",null);c(this,"dataType",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.index=e.index,this.required=e.required,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const n=e.parent?A(e.parent):null,a=n?t.get(n):null,s=e.parentRelationType===P.FixedArguments?a==null?void 0:a.inputs.length:a==null?void 0:a.outputs.length,o={id:e.id,version:1,name:e.name,type:i.ValueDescriptor,index:s||0,description:e.description,required:e.required,defaultValue:null,parentRelationType:e.parentRelationType,dataType:null,parent:a},l=b(o,t);return a&&l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let n=JSON.parse(JSON.stringify(e));const a=[],s=tt(n,{parent:{list:!1,types:[i.ActionDescriptor]}},t);n=s.modifiedData,a.push(...s.errors,...je(n));const o=n.parent&&t.get(n.parent),l=o&&ur(o);return l&&l.type===i.ActionDescriptor&&a.push(new g({id:`${e.id}--${T.BuiltInEntityParent}`,code:T.BuiltInEntityParent,severity:E.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${l.name}" of type '${l.type}' with id '${l.id}'.
|
|
201
201
|
You can't modify system entities that are built-in.`,issue:null})),o&&o.type===i.ActionDescriptor&&(!n.parentRelationType||!(n.parentRelationType===P.FixedArguments||n.parentRelationType===P.FixedReturns||n.parentRelationType===P.ReturnedError||n.parentRelationType===P.DynamicArgument||n.parentRelationType===P.DynamicReturn)?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 '${P.FixedArguments}', '${P.FixedReturns}', or '${P.ReturnedError}' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})):n.parentRelationType===P.ReturnedError&&o.error&&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}', is being added as an error value-descriptor to an entity of type 'action-descriptor' with id '${o.id}', which already has an error value descriptor with id '${o.error.id}'.
|
|
202
202
|
An action descriptor can only have one error value descriptor child.
|
|
203
203
|
Either remove the existing error value descriptor or update it with the 'update' action.
|
|
@@ -218,14 +218,14 @@ ${or}`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null}))),X
|
|
|
218
218
|
${or}`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null})),r.calledByEntry&&t.push(new g({id:`${e.id}--${T.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledByEntry" updated.
|
|
219
219
|
${or}`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null})),r.calledBySuccess&&t.push(new g({id:`${e.id}--${T.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledBySuccess" updated.
|
|
220
220
|
${or}`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null})),r.calledByError&&t.push(new g({id:`${e.id}--${T.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledByError" updated.
|
|
221
|
-
${or}`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null}))),t.length)return{errors:t,modifiedData:null,messageAddition:""};const a=Tl(e.type);if(a){(a.INMUTABLE_META_PROPERTIES||[]).forEach(S=>{["type","id"].includes(S)||r[S]&&!
|
|
222
|
-
If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null})),n=!0)}),(a.DOWNSTREAM_PROPERTIES||[]).forEach(S=>{r[S]&&!
|
|
221
|
+
${or}`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null}))),t.length)return{errors:t,modifiedData:null,messageAddition:""};const a=Tl(e.type);if(a){(a.INMUTABLE_META_PROPERTIES||[]).forEach(S=>{["type","id"].includes(S)||r[S]&&!Wa(r[S])&&(t.push(new g({id:`${e.id}--${T.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${S}" updated. It is an inmutable property that is set only when the entity is created.
|
|
222
|
+
If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null})),n=!0)}),(a.DOWNSTREAM_PROPERTIES||[]).forEach(S=>{r[S]&&!Wa(r[S])&&(t.push(new g({id:`${e.id}--${T.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${S}" set directly. It is a downstream property that points to a downstream nested entity.
|
|
223
223
|
All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
|
|
224
|
-
To modify '${S}', target the entity that it points to and its equivalent property.`,severity:E.Error,code:T.InvalidDownstreamPropertyOverride,issue:null})),n=!0)}),(a.INMUTABLE_UPSTREAM_PROPERTIES||[]).forEach(S=>{r[S]&&!
|
|
225
|
-
If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null})),n=!0)});const D=a.PROPERTIES||[];D.length>0&&Object.keys(r).forEach(S=>{D.includes(S)||t.push(new g({id:`${e.id}--${T.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${S}" that will be ignored.`,severity:E.Warning,code:T.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:n?el(e):""};const s=mS(e),o=s==null?void 0:s.partial(),l=o==null?void 0:o.safeParse(r),p={...r,id:e.id,type:e.type},u=xu(p,l);if(t.push(...u),t.length)return{errors:t,modifiedData:null,messageAddition:n?el(e):""};const f=e.validateGeneratedUpdate(r);return{errors:[...t,...f.errors],modifiedData:f.modifiedData,messageAddition:n?el(e):""}}function mS(r){switch(r.type){case i.LiteralValue:return Oo();case i.DefinitionEntity:return iu();case i.PrimitiveEntity:return Oo();case i.FunctionDeclaration:return nu();case i.GlobalEvent:return No();case i.DataType:return Hc();case i.Property:return Mc();case i.FunctionCall:return Uc();case i.Condition:return xc();case i.Operation:return Mo();case i.VariableDeclaration:return Zc();case i.VariableInstance:return Kc();case i.OutputMap:return Fc();case i.ReturnDeclaration:return Lc();case i.ArgumentDeclaration:return tu();case i.InputMap:return Jc();case i.Project:return ru();case i.InstalledProject:return O3();case i.ActionDescriptor:return Co();case i.ReturnStatement:return Nc();case i.Loop:return Co();case i.Search:return jc();case i.ValueDescriptor:return Bc();case i.BuiltInBaseEntity:return _c();case i.InternalCall:return qc();case i.ContinueStatement:return Vc();case i.BreakStatement:return Gc();default:return null}}function TS(r){switch(r.type){case i.LiteralValue:return t3();case i.DefinitionEntity:return E5();case i.PrimitiveEntity:return j9();case i.FunctionDeclaration:return d5();case i.GlobalEvent:return V3();case i.DataType:return h3();case i.Property:return W9();case i.FunctionCall:return P6();case i.Condition:return _6();case i.Operation:return z6();case i.VariableDeclaration:return R3();case i.VariableInstance:return D3();case i.OutputMap:return D6();case i.ReturnDeclaration:return m6();case i.ArgumentDeclaration:return a5();case i.InputMap:return J6();case i.Project:return h5();case i.InstalledProject:return C3();case i.ActionDescriptor:return t6();case i.ReturnStatement:return p6();case i.Loop:return i6();case i.Search:return G6();case i.ValueDescriptor:return $9();case i.BuiltInBaseEntity:return K9();case i.InternalCall:return x6();case i.ContinueStatement:return l6();case i.BreakStatement:return g6();default:return null}}function tl(r){const e=[];ir(r)||e.push(new g({id:`${r}--${T.InvalidReferenceObjectStructure}`,message:`Reference object with id "${r}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:E.Error,code:T.InvalidReferenceObjectStructure,issue:null}));const t=r.id||"reference-to--"+(r.entityId||"unknown"),n=`Reference object ${r.id?`with id "${r.id}"`:`to entity with id "${r.entityId}" and type "${r.entityType}"`}`;return r.entityId||e.push(new g({id:`${t}--${T.InvalidReferenceObjectStructure}`,message:`${n} is missing an 'entityId' property.`,severity:E.Error,code:T.InvalidReferenceObjectStructure,issue:null})),r.entityType||e.push(new g({id:`${t}--${T.InvalidReferenceObjectStructure}`,message:`${n} is missing an 'entityType' property.`,severity:E.Error,code:T.InvalidReferenceObjectStructure,issue:null})),r.id||e.push(new g({id:`${t}--${T.MissingIdProperty}`,message:`${n} is missing an 'id' property.`,severity:E.Error,code:T.MissingIdProperty,issue:null})),r.type||e.push(new g({id:`${t}--${T.MissingTypeProperty}`,message:`${n} is missing a 'type' property.`,severity:E.Error,code:T.MissingTypeProperty,issue:null})),e}function xu(r,e){return e.success?[]:e.error.issues.map(t=>new g({id:`${r.id}--${B.InvalidObjectStructure}`,message:`Entity of type "${r.type}" and with id "${r.id}", has an invalid structure: ${j5(t).toString().replace("Validation error: ","")}`,severity:E.Error,code:B.InvalidObjectStructure,issue:t}))}function je(r,e){const t=[],n=TS(r);if(n){const s=n.safeParse(r);t.push(...xu(r,s))}const a=Tl(r.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(l=>{r[l]&&!
|
|
224
|
+
To modify '${S}', target the entity that it points to and its equivalent property.`,severity:E.Error,code:T.InvalidDownstreamPropertyOverride,issue:null})),n=!0)}),(a.INMUTABLE_UPSTREAM_PROPERTIES||[]).forEach(S=>{r[S]&&!Wa(r[S])&&(t.push(new g({id:`${e.id}--${T.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${S}" updated. It is an inmutable property that is set only when the entity is created.
|
|
225
|
+
If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:E.Error,code:T.InvalidInmutablePropertyOverride,issue:null})),n=!0)});const D=a.PROPERTIES||[];D.length>0&&Object.keys(r).forEach(S=>{D.includes(S)||t.push(new g({id:`${e.id}--${T.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${S}" that will be ignored.`,severity:E.Warning,code:T.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:n?el(e):""};const s=mS(e),o=s==null?void 0:s.partial(),l=o==null?void 0:o.safeParse(r),p={...r,id:e.id,type:e.type},u=xu(p,l);if(t.push(...u),t.length)return{errors:t,modifiedData:null,messageAddition:n?el(e):""};const f=e.validateGeneratedUpdate(r);return{errors:[...t,...f.errors],modifiedData:f.modifiedData,messageAddition:n?el(e):""}}function mS(r){switch(r.type){case i.LiteralValue:return Oo();case i.DefinitionEntity:return iu();case i.PrimitiveEntity:return Oo();case i.FunctionDeclaration:return nu();case i.GlobalEvent:return No();case i.DataType:return Hc();case i.Property:return Mc();case i.FunctionCall:return Uc();case i.Condition:return xc();case i.Operation:return Mo();case i.VariableDeclaration:return Zc();case i.VariableInstance:return Kc();case i.OutputMap:return Fc();case i.ReturnDeclaration:return Lc();case i.ArgumentDeclaration:return tu();case i.InputMap:return Jc();case i.Project:return ru();case i.InstalledProject:return O3();case i.ActionDescriptor:return Co();case i.ReturnStatement:return Nc();case i.Loop:return Co();case i.Search:return jc();case i.ValueDescriptor:return Bc();case i.BuiltInBaseEntity:return _c();case i.InternalCall:return qc();case i.ContinueStatement:return Vc();case i.BreakStatement:return Gc();default:return null}}function TS(r){switch(r.type){case i.LiteralValue:return t3();case i.DefinitionEntity:return E5();case i.PrimitiveEntity:return j9();case i.FunctionDeclaration:return d5();case i.GlobalEvent:return V3();case i.DataType:return h3();case i.Property:return W9();case i.FunctionCall:return P6();case i.Condition:return _6();case i.Operation:return z6();case i.VariableDeclaration:return R3();case i.VariableInstance:return D3();case i.OutputMap:return D6();case i.ReturnDeclaration:return m6();case i.ArgumentDeclaration:return a5();case i.InputMap:return J6();case i.Project:return h5();case i.InstalledProject:return C3();case i.ActionDescriptor:return t6();case i.ReturnStatement:return p6();case i.Loop:return i6();case i.Search:return G6();case i.ValueDescriptor:return $9();case i.BuiltInBaseEntity:return K9();case i.InternalCall:return x6();case i.ContinueStatement:return l6();case i.BreakStatement:return g6();default:return null}}function tl(r){const e=[];ir(r)||e.push(new g({id:`${r}--${T.InvalidReferenceObjectStructure}`,message:`Reference object with id "${r}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:E.Error,code:T.InvalidReferenceObjectStructure,issue:null}));const t=r.id||"reference-to--"+(r.entityId||"unknown"),n=`Reference object ${r.id?`with id "${r.id}"`:`to entity with id "${r.entityId}" and type "${r.entityType}"`}`;return r.entityId||e.push(new g({id:`${t}--${T.InvalidReferenceObjectStructure}`,message:`${n} is missing an 'entityId' property.`,severity:E.Error,code:T.InvalidReferenceObjectStructure,issue:null})),r.entityType||e.push(new g({id:`${t}--${T.InvalidReferenceObjectStructure}`,message:`${n} is missing an 'entityType' property.`,severity:E.Error,code:T.InvalidReferenceObjectStructure,issue:null})),r.id||e.push(new g({id:`${t}--${T.MissingIdProperty}`,message:`${n} is missing an 'id' property.`,severity:E.Error,code:T.MissingIdProperty,issue:null})),r.type||e.push(new g({id:`${t}--${T.MissingTypeProperty}`,message:`${n} is missing a 'type' property.`,severity:E.Error,code:T.MissingTypeProperty,issue:null})),e}function xu(r,e){return e.success?[]:e.error.issues.map(t=>new g({id:`${r.id}--${B.InvalidObjectStructure}`,message:`Entity of type "${r.type}" and with id "${r.id}", has an invalid structure: ${j5(t).toString().replace("Validation error: ","")}`,severity:E.Error,code:B.InvalidObjectStructure,issue:t}))}function je(r,e){const t=[],n=TS(r);if(n){const s=n.safeParse(r);t.push(...xu(r,s))}const a=Tl(r.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(l=>{r[l]&&!Wa(r[l])&&t.push(new g({id:`${r.id}--${T.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${r.type}" with id "${r.id}" cannot have the property "${l}" set directly. It is a downstream property that points to a downstream nested entity.
|
|
226
226
|
All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
|
|
227
227
|
To modify '${l}', target the entity that it points to and its equivalent property.`,severity:E.Error,code:T.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(r).forEach(l=>{o.includes(l)||t.push(new g({id:`${r.id}--${T.UnrecognizedProperty}`,message:`Entity of type "${r.type}" with id "${r.id}" has an unrecognized property "${l}" that will be ignored.`,severity:E.Warning,code:T.UnrecognizedProperty,issue:null}))})}return t}function dq(r,e){const t=[];if(!r.parent)return t;const n=e.get(r.parent);return n?(qn.includes(n==null?void 0:n.type)?t.push(new g({id:`${r.id}--${T.BuiltInEntityParent}`,message:`Entity of type "${r.type}" with id "${r.id}" cannot have the parent with id "${n.id}", because it is a built in entity. Built in entities cannot be modified.`,severity:E.Error,code:T.BuiltInEntityParent,issue:null})):n.type===i.ActionDescriptor&&e.get(r.parent)&&t.push(new g({id:`${r.id}--${T.BuiltInEntityParent}`,message:`Entity of type "${r.type}" with id "${r.id}" cannot have the parent with id "${n.id}", because it is a built in entity. Built in entities cannot be modified. Action descriptors are only sometimes built in, other times they are managed by the user.`,severity:E.Error,code:T.BuiltInEntityParent,issue:null})),t):[]}function ju(r,e,t){const n=[],a=r[e.key];if(!a)return n.push(new g({id:`${r.id}--${e.key}--${B.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${r.type}" entity can be ${q(e.types,", "," or ")}.`,severity:E.Error,code:B.InvalidObjectStructure,issue:null})),{entityState:null,errors:n};let s=null;if(typeof a=="string")s=a;else{const l=tl(a);n.push(...l),l.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:n};if(r.id===s)return n.push(new g({id:`${r.id}--${s}--${T.SelfReference}`,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,severity:E.Error,code:T.SelfReference,issue:null})),{entityState:null,errors:n};const o=t.get(s)||t.getBuiltIn(s);return o?e.types.includes(o.type)||n.push(new g({id:`${r.id}--${s}--${T.InvalidReference}`,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${q(e.types,"', '","' or '")}'.`,severity:E.Error,code:T.InvalidReference,issue:null})):n.push(new g({id:`${r.id}--${s}--${T.ReferencedEntityNotFound}`,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${s}" at '${e.key}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:E.Error,code:T.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:n}}function nl(r,e,t){const n=[],a=r[e];return a?Array.isArray(a)?{entities:a.map(o=>{let l=null;if(typeof o=="string")l=o;else{const u=tl(o);n.push(...u),u.length===0&&(l=o.entityId)}if(!l)return{entityState:null,errors:[new g({id:`${r.id}--${e}--${T.InvalidReference}`,message:`Entity of type "${r.type}" with id "${r.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:E.Error,code:T.InvalidReference,issue:null})]};const p=t.get(l)||t.getBuiltIn(l);return p?{entityState:p,errors:[]}:(n.push(new g({id:`${r.id}--${l}--${T.ReferencedEntityNotFound}`,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${l}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:E.Error,code:T.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:n})}),errors:[]}:(n.push(new g({id:`${r.id}--${e}--${B.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:E.Error,code:B.InvalidObjectStructure,issue:null})),{entities:[],errors:n}):(n.push(new g({id:`${r.id}--${e}--${B.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" is missing a list of references to "${e}" entities.`,severity:E.Error,code:B.InvalidObjectStructure,issue:null})),{entities:[],errors:n})}function ku(r,e,t){const n=[],a=ju(r,e,t);if(a.errors.length>0)return a.errors;if(a.entityState){const s=a.entityState;e.types.includes(s.type)||n.push(new g({id:`${r.id}--${s.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${q(e.types,"', '","' or '")}'.`,issue:null})),r.id===s.id&&n.push(new g({id:`${r.id}--${s.id}--${T.SelfReference}`,code:T.SelfReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}))}return n}function q(r,e,t){const n=[...r||[]].filter(a=>!!a);if(n.length===1)return n[0];if(n.length===2)return n.join(t);{const a=n.pop();return`${n.join(e)}${t}${a}`}}const sr=`Pass-through callable entities are entities that need to be called by another caller, then they execute some internal logic and when finished, it can call other callable entities with the "calledBySuccess" property or "calledByError" property based on whether their internal execution was successful or an error ocurred respectively.
|
|
228
|
-
All pass-through callable entities are: ${q(Je,", "," and ")}.`,
|
|
228
|
+
All pass-through callable entities are: ${q(Je,", "," and ")}.`,Qa=`Entry point entities are the entities which start the execution of a logic chain. They are ${q(We,", "," and ")}. They aren't explicitly called by any entities. Rather, they can be called implicitly by the system, or as a function-call somewhere else in the case of a function-declaration. `,ES=`Caller entities are entities that can call other entities. Regarless of whether they are entry-point entities or pass-through callable entities. All caller entity types are: ${q(sn,", "," and ")}.`,cq=`Callable entities are entities that can be called by other entities. They can be called by an entry-point, a success caller, or an error caller.
|
|
229
229
|
All callable entity types are: ${q(Xt,", "," and ")}.`,or=`Caller to callee relationships can be updated with the 'add_caller' and 'remove_caller' generation action with the properties: 'callerEntityId', a 'calleeEntityId'. For adding a caller, you can optionally add a boolean property 'fromError' (if the caller calls when an error occured in its execution).
|
|
230
230
|
Either of these two actions will only affect the one relationship between the given caller and callee and ignore any others present in either entity.`,qu=`Break and continue statements need to have exactly one 'return-declaration' entity each. It represents the result of the current iteration of the loop. It can have any name and have any 'data-type' but it needs to be identical among all statements in the same loop.
|
|
231
231
|
Meaning, if the return declaration in one 'break-statement' is named 'result' and has a 'data-type' of 'number', all other 'break-statements' and 'continue-statements' in the same loop need to have a 'return-declaration' with the same name and 'data-type'.`,uq=`Return statements need to be identical inside the same scope. For example if a 'return-statement' belongs to a function, with multiple branches of logic, leading to multiple 'return-statement' entities, all of them need to have the exact same amount of 'return-declaration' entities, sharing the same name and an equivalent 'data-type' entity.
|
|
@@ -258,7 +258,7 @@ ${typeof r=="string"?r:JSON.stringify(r,null,2)}
|
|
|
258
258
|
}
|
|
259
259
|
}`;return gn(n)}default:return""}}function gS(r,e){const t=JSON.parse(JSON.stringify(r)),n=[];if(We.includes(e.type))n.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Warning,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to an entry-point entity at 'calledBySuccess' with id "${e.id}".
|
|
260
260
|
Entry-point entities can only be referenced as 'calledByEntry'.
|
|
261
|
-
${
|
|
261
|
+
${Qa}
|
|
262
262
|
We have moved the reference to 'calledByEntry' for you.`,issue:null})),t.calledByEntry.push(e.id),t.calledBySuccess=t.calledBySuccess.filter(a=>a!==e.id);else if(xe.includes(e.type)){const a=e.calledBy||[],s=a.length?`
|
|
263
263
|
|
|
264
264
|
This ${e.type} is called by ${q(a.map(o=>`${o.type} with id "${o.id}"`),", "," and ")} entities. You can reference ${a.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";n.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a '${e.type}' entity at 'calledBySuccess' with id "${e.id}".
|
|
@@ -269,7 +269,7 @@ All caller entity types are: ${q(sn,", "," and ")}.
|
|
|
269
269
|
For the 'calledBySuccess' property, you specifically need to reference a pass-through callable entity.
|
|
270
270
|
${sr}`,issue:null})),{errors:n,modifiedData:t};return{errors:n,modifiedData:t}}function bS(r,e){const t=[];if(We.includes(e.type))t.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to an entry-point entity at 'calledByError' with id "${e.id}".
|
|
271
271
|
Entry-point entities can only be referenced as 'calledByEntry'.
|
|
272
|
-
${
|
|
272
|
+
${Qa}`,issue:null}));else if(xe.includes(e.type)){const n=e.calledBy||[],a=n.length?`
|
|
273
273
|
|
|
274
274
|
This ${e.type} is called by ${q(n.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${n.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a '${e.type}' entity at 'calledByError' with id "${e.id}".
|
|
275
275
|
${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
@@ -283,15 +283,15 @@ This ${e.type} is called by ${q(n.map(s=>`${s.type} with id "${s.id}"`),", "," a
|
|
|
283
283
|
${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
284
284
|
Termination entities are ${q(xe,", "," and ")}.${a}`,issue:null}))}else if(Je.includes(e.type))t.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Warning,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that is a pass-through callable entity, not an entry-point entity.
|
|
285
285
|
${sr}.
|
|
286
|
-
${
|
|
286
|
+
${Qa}.
|
|
287
287
|
|
|
288
288
|
We have moved the reference to 'calledBySuccess' for you.`,issue:null}));else if(!sn.includes(e.type))return t.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that isn't a caller entity.
|
|
289
289
|
All caller entity types are: ${q(sn,", "," and ")}.
|
|
290
290
|
For the 'calledByEntry' property, you specifically need to reference a pass-through callable entity.
|
|
291
|
-
${sr}`,issue:null})),t;return t}function IS(r,e){const t=[];let n=JSON.parse(JSON.stringify(r));if(Xt.includes(n.type)){if(n.calledBySuccess){const s=nl(n,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=gS(n,o.entityState);n=l.modifiedData,t.push(...l.errors)}):t.push(...s.errors)}if(n.calledByError){const s=nl(n,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=bS(n,o.entityState);t.push(...l)}):t.push(...s.errors)}if(n.calledByEntry){const s=nl(n,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=vS(n,o.entityState);t.push(...l)}),t.push(...t)):t.push(...s.errors)}const a=[...n.calledBySuccess||[],...n.calledByError||[],...n.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new g({id:`${n.id}--${T.DuplicateReference}`,code:T.DuplicateReference,severity:E.Warning,message:`Entity of type "${n.type}" with id "${n.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=Pt(n,e);n.type===i.ReturnStatement&&o&&!We.includes(o.type)?t.push(new g({id:`${n.id}--${T.IncompatibleScope}`,code:T.IncompatibleScope,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" has an explicitly set parent, but it isn't a '${q(We,"', '","' or '")}' entity. A return statement's parent should always be resolved to a function declaration or global event.${il}`,issue:null})):n.type===i.ContinueStatement&&o&&o.type!==i.Loop?t.push(new g({id:`${n.id}--${T.IncompatibleScope}`,code:T.IncompatibleScope,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" has an explicitly set parent, but it isn't a '${i.Loop}' entity. A continue statement's parent should always be resolved to a loop entity.${il}`,issue:null})):n.type===i.BreakStatement&&o&&o.type!==i.Loop&&t.push(new g({id:`${n.id}--${T.IncompatibleScope}`,code:T.IncompatibleScope,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" has an explicitly set parent, but it isn't a '${i.Loop}' entity. A break statement's parent should always be resolved to a loop entity.${il}`,issue:null}));const l=[],p=[];let u=null;if(s.forEach(h=>{const f=e.get(h);if(!f){t.push(new g({id:`${n.id}--${h}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a caller entity with id "${h}" that doesn't exist in the project.`,issue:null}));return}const R=Pt(f,e);if(o)
|
|
291
|
+
${sr}`,issue:null})),t;return t}function IS(r,e){const t=[];let n=JSON.parse(JSON.stringify(r));if(Xt.includes(n.type)){if(n.calledBySuccess){const s=nl(n,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=gS(n,o.entityState);n=l.modifiedData,t.push(...l.errors)}):t.push(...s.errors)}if(n.calledByError){const s=nl(n,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=bS(n,o.entityState);t.push(...l)}):t.push(...s.errors)}if(n.calledByEntry){const s=nl(n,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=vS(n,o.entityState);t.push(...l)}),t.push(...t)):t.push(...s.errors)}const a=[...n.calledBySuccess||[],...n.calledByError||[],...n.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new g({id:`${n.id}--${T.DuplicateReference}`,code:T.DuplicateReference,severity:E.Warning,message:`Entity of type "${n.type}" with id "${n.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=Pt(n,e);n.type===i.ReturnStatement&&o&&!We.includes(o.type)?t.push(new g({id:`${n.id}--${T.IncompatibleScope}`,code:T.IncompatibleScope,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" has an explicitly set parent, but it isn't a '${q(We,"', '","' or '")}' entity. A return statement's parent should always be resolved to a function declaration or global event.${il}`,issue:null})):n.type===i.ContinueStatement&&o&&o.type!==i.Loop?t.push(new g({id:`${n.id}--${T.IncompatibleScope}`,code:T.IncompatibleScope,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" has an explicitly set parent, but it isn't a '${i.Loop}' entity. A continue statement's parent should always be resolved to a loop entity.${il}`,issue:null})):n.type===i.BreakStatement&&o&&o.type!==i.Loop&&t.push(new g({id:`${n.id}--${T.IncompatibleScope}`,code:T.IncompatibleScope,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" has an explicitly set parent, but it isn't a '${i.Loop}' entity. A break statement's parent should always be resolved to a loop entity.${il}`,issue:null}));const l=[],p=[];let u=null;if(s.forEach(h=>{const f=e.get(h);if(!f){t.push(new g({id:`${n.id}--${h}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a caller entity with id "${h}" that doesn't exist in the project.`,issue:null}));return}const R=Pt(f,e);if(o)rs(o,R,e)?(xe.includes(n.type)&&((n.calledBySuccess||[]).find(I=>I===f.id)?(f.successCalls||[]).find(S=>xe.includes(S.type))&&t.push(new g({id:`${n.id}--${f.id}--${B.UnreachableEntity}`,code:B.UnreachableEntity,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that already calls a termination statement.
|
|
292
292
|
The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(n.calledByError||[]).find(I=>I===f.id)?(f.errorCalls||[]).find(S=>xe.includes(S.type))&&t.push(new g({id:`${n.id}--${f.id}--${B.UnreachableEntity}`,code:B.UnreachableEntity,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that already calls a termination statement.
|
|
293
293
|
The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(n.calledByEntry||[]).find(I=>I===f.id)&&(f.calls||[]).find(S=>xe.includes(S.type))&&t.push(new g({id:`${n.id}--${f.id}--${B.UnreachableEntity}`,code:B.UnreachableEntity,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that already calls a termination statement.
|
|
294
|
-
The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),l.push({caller:f,scope:R})):p.push({caller:f,scope:R,errors:[new g({id:`${n.id}--${f.id}--${T.CallerWithIncompatibleScope}`,code:T.CallerWithIncompatibleScope,severity:E.Warning,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that is in a different scope. The caller entity should be in the same scope or a higher valid scope. Or all callers should share the global project scope with the entity they call.`,issue:null})]});else if(!u)u=R;else{const{compatible:v}=
|
|
294
|
+
The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),l.push({caller:f,scope:R})):p.push({caller:f,scope:R,errors:[new g({id:`${n.id}--${f.id}--${T.CallerWithIncompatibleScope}`,code:T.CallerWithIncompatibleScope,severity:E.Warning,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that is in a different scope. The caller entity should be in the same scope or a higher valid scope. Or all callers should share the global project scope with the entity they call.`,issue:null})]});else if(!u)u=R;else{const{compatible:v}=rs(u,R,e);v?(xe.includes(n.type)&&((n.calledBySuccess||[]).find(I=>I===f.id)?(f.successCalls||[]).find(S=>xe.includes(S.type))&&t.push(new g({id:`${n.id}--${f.id}--${B.UnreachableEntity}`,code:B.UnreachableEntity,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that already calls a termination statement.
|
|
295
295
|
The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(n.calledByError||[]).find(I=>I===f.id)?(f.errorCalls||[]).find(S=>xe.includes(S.type))&&t.push(new g({id:`${n.id}--${f.id}--${B.UnreachableEntity}`,code:B.UnreachableEntity,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that already calls a termination statement.
|
|
296
296
|
The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(n.calledByEntry||[]).find(I=>I===f.id)&&(f.calls||[]).find(S=>xe.includes(S.type))&&t.push(new g({id:`${n.id}--${f.id}--${B.UnreachableEntity}`,code:B.UnreachableEntity,severity:E.Error,message:`Entity of type "${n.type}" with id "${n.id}" is being called by an entity of type "${f.type}" with id "${f.id}" that already calls a termination statement.
|
|
297
297
|
The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),l.push({caller:f,scope:R})):p.push({caller:f,scope:R,errors:[new g({id:`${n.id}--${f.id}--${T.CallerWithIncompatibleScope}`,code:T.CallerWithIncompatibleScope,severity:E.Warning,message:`Entity of type "${n.type}" with id "${n.id}" has multiple caller, but not all of them have compatible scopes. Caller of type "${f.type}" with id "${f.id}" is in a different scope than caller of type "${u.type}" with id "${u.id}". All callers should be in the same scope or a higher valid scope. Or all callers should share the global project scope.`,issue:null})]})}}),p.length)p.forEach(h=>{t.push(...h.errors)});else if(l.length&&!o&&Al.includes(n.type)){const h=l.filter(f=>f.scope!==e);if(h.length){const f=MO(h.map(R=>R.scope));n.parent=f.id}else n.parent=e.id}}else{let s=`Entity of type "${n.type}" with id "${n.id}" isn't called by any other entity. Callable entities only get executed if they have a list of references from either 'calledByEntry', 'calledBySuccess' or 'calledByError'.
|
|
@@ -312,7 +312,7 @@ All value writting entity types are: ${q(Ze,", "," and ")}.
|
|
|
312
312
|
|
|
313
313
|
This data type entity belongs to a ${o.type} entity with id "${o.id}". ${o.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):t.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a literal value entity. Literal value entities can't be referenced as value writting entities.
|
|
314
314
|
All value writting entity types are: ${q(Ze,", "," and ")}.`,issue:null}))}else Ze.includes(e.type)||t.push(new g({id:`${r.id}--${e.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that isn't a value writting entity.
|
|
315
|
-
All value writting entity types are: ${q(Ze,", "," and ")}.`,issue:null}));const n=Pt(r,e.project),a=Pt(e,e.project);if(n){const s=
|
|
315
|
+
All value writting entity types are: ${q(Ze,", "," and ")}.`,issue:null}));const n=Pt(r,e.project),a=Pt(e,e.project);if(n){const s=rs(n,e,e.project);if(!s.compatible){const{type:o}=s;let l="";const p=`But they are nested under different subscopes. The reader is in the scope of the '${n.type}' (${w(n,e.project)}) with id '${n.id}', and the writter is in the scope of the '${a.type}' (${w(a,e.project)}) with id '${a.id}'.`;o===Rl.ParallelInCommonParent?(l=`The reader and the writter entities are both in the scope of the '${s.commonAncestorScope.type}' (${w(s.commonAncestorScope,e.project)}) with id '${s.commonAncestorScope.id}'.`,l+=`
|
|
316
316
|
${p}`):o===Rl.ParallelInProject&&(l="The reader and the writter entities are both in separate scopes in the project that have no common ancestor.",l+=`
|
|
317
317
|
${p}`),l+=`
|
|
318
318
|
Two value holding entities need to be in the same scope or in scopes nested inside of eachother to be able to read and write to each other.`,t.push(new g({id:`${r.id}--${e.id}--${T.IncompatibleScope}`,code:T.IncompatibleScope,severity:E.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" with an incompatible scope.
|
|
@@ -332,7 +332,7 @@ All caller entity types are: ${q(sn,", "," and ")}.`,issue:null}));return n}func
|
|
|
332
332
|
This ${a.type} is called by ${q(s.map(l=>`${l.type} with id "${l.id}"`),", "," and ")} entities. You can reference ${s.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";n.push(new g({id:`last-action--${a.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}'.
|
|
333
333
|
${a.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
334
334
|
Termination entities are ${q(xe,", "," and ")}.${o}`,issue:null}))}else We.includes(a.type)?n.push(new g({id:`last-action--${a.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is an entry-point entity and doesn't thrown errors.
|
|
335
|
-
${
|
|
335
|
+
${Qa}`,issue:null})):n.push(new g({id:`last-action--${a.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
|
|
336
336
|
For any error branch caller, for the 'calledByError' property of an entity, you specifically need to reference a pass-through callable entity.
|
|
337
337
|
${sr}`,issue:null}));return n}function fq(r,e){const t=[],n=e.get(r);if(!n)t.push(new g({id:`last-action--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`The 'readsValue' property references an entity with id '${r}' that was not found in the project. Perhaps it should be created? Perhaps the ID is incorrect?`,issue:null}));else if(n.type===i.LiteralValue){const s=n.parent;let o=!1;if(s.type===i.InputMap)t.push(new g({id:`last-action--${n.id}--${T.InvalidReference}`,code:T.InvalidReference,severity:E.Error,message:`The 'readsValue' property references an entity with id "${n.id}" that is a literal value entity. Literal value entities aren't value writting entities.
|
|
338
338
|
All value writting entity types are: ${q(Ze,", "," and ")}.
|
|
@@ -386,11 +386,11 @@ ${a} is not a template, but ${o} is. A data type that provides an entity as a "t
|
|
|
386
386
|
Their 'entity' property is of different types. They must be of the same type to be connected. For example, the 'entity' can be a '${i.DefinitionEntity}' or a '${i.PrimitiveEntity}'.`:t.type===zt.IncompatibleDefinitionEntities?`${l}
|
|
387
387
|
Both point to definition entities, but they are not compatible to be connected. They must be either the same definition entity, or a definition entity that has equivalent shape, which includes the same properties all with compatible data types with the properties in the counterpart entity.`:t.type===zt.IncompatiblePrimitiveEntities?`${l}
|
|
388
388
|
${a} is of primitive type '${((p=r.getDataType())==null?void 0:p.entity).name}' and ${o} is of primitive type '${((u=e.getDataType())==null?void 0:u.entity).name}'. They must be of the same primitive type to be connected.`:t.type===zt.IncompatibleBuiltInBaseEntities?`${l}
|
|
389
|
-
Both point to a built-in-base-entity. But${a} is of built-in base type '${((h=r.getDataType())==null?void 0:h.entity).name}' and ${o} is of built-in base type '${((f=e.getDataType())==null?void 0:f.entity).name}'. They must be of the same built-in base type to be connected.`:l}function
|
|
389
|
+
Both point to a built-in-base-entity. But${a} is of built-in base type '${((h=r.getDataType())==null?void 0:h.entity).name}' and ${o} is of built-in base type '${((f=e.getDataType())==null?void 0:f.entity).name}'. They must be of the same built-in base type to be connected.`:l}function es(r,e){const t=[];if(r.readsValue){const n=e.project.get(A(r.readsValue));if(e.project.getBuiltIn(A(r.readsValue)))t.push(new g({id:`${e.id}--${T.InvalidBuiltInEntityReference}`,code:T.InvalidBuiltInEntityReference,severity:E.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to a built-in entity with id '${r.readsValue}'. Only user-created entities can be referenced.`,issue:null}));else if(!n)t.push(new g({id:`${e.id}--${T.ReferencedEntityNotFound}`,code:T.ReferencedEntityNotFound,severity:E.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${r.readsValue}' because the entity was not found in the project state.`,issue:null}));else{const s=ur(n);if(s)t.push(new g({id:`${e.id}--${T.InvalidBuiltInEntityReference}`,code:T.InvalidBuiltInEntityReference,severity:E.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${r.readsValue}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${w(s,e.project)}) higher up in the tree.`,issue:null}));else{const o=zu({...e.toGenerationTarget(),...r},n);t.push(...o);const l=Zt(e.getDataType(),n.getDataType());l.compatible||t.push(new g({id:`${e.id}--${B.ReaderWriterIncompatibleDataType}`,code:B.ReaderWriterIncompatibleDataType,severity:E.Error,message:OS(e,n,l),issue:null}))}}}return{errors:t,modifiedData:r}}function jn(r){const e=[];if(r.parent===r.project)!r.calledBy.length&&r.type!==i.VariableDeclaration&&e.push(new Pr({id:`${r.id}--${G.DisconnectedCallableEntity}`,code:G.DisconnectedCallableEntity,severity:E.Warning,message:`This '${r.type}' entity "${w(r,r.project)}" with id "${r.id}" is globally declared and isn't called by any other entity.
|
|
390
390
|
Globally declared callable entities will not be part of any logic execution when the project is published.
|
|
391
391
|
To useful to the project when it is published, entities need to be called by a chain of logic that traces itself back to an entry point. Entry points can be either '${i.GlobalEvent}' or '${i.FunctionDeclaration}'.
|
|
392
392
|
The only use for declaring global callable entities is for a 'variable-declaration' entity to be available globally in the project's scope, since its instances can be used inside lower scopes.
|
|
393
|
-
Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:r}));else{const t=
|
|
393
|
+
Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:r}));else{const t=is(r);if(!t.reachable){let n=`This '${r.type}' entity "${w(r,r.project)}" with id "${r.id}" is not reachable from the project's closest entry point '${t.entryPoint.type}' "${w(t.entryPoint,r.project)}".`;n+=`
|
|
394
394
|
This is because there are termination statements in the call chain before reaching this '${r.type}'.
|
|
395
395
|
If a caller entity calls a termination statement, it will always prevent all other calls from executing.`;let a=`
|
|
396
396
|
This '${r.type}' is blocked `;t.blocks.forEach((s,o)=>{const l=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${w(l,r.project)}" with id "${l.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new Pr({id:`${r.id}--${B.UnreachableEntity}`,code:B.UnreachableEntity,severity:E.Warning,message:`${n}${a}`,issue:null,entity:r}))}}return Me(r.errors,e)}function Zu(r){const e=[];if(!r.internalCalls.length)return e;if(r.readsValue){const t=Q({id:`${r.id}--${G.VariableReadsValueAndInternalCall}`,message:`Variable "${w(r,r.project)}" with id "${r.id}" reads a value. A variable with internal calls can't read a value.`,issue:null,severity:E.Error,code:G.VariableReadsValueAndInternalCall,entity:r});e.push(t.error)}if(r.writesValues.length){const t=Q({id:`${r.id}--${G.VariableWritesValuesAndInternalCall}`,message:`Variable "${w(r,r.project)}" with id "${r.id}" writes values. A variable with internal calls can't write a value.`,issue:null,severity:E.Error,code:G.VariableWritesValuesAndInternalCall,entity:r});e.push(t.error)}if(r.getUsedInputs().length){const t=Q({id:`${r.id}--${G.VariableHasInputsAndInternalCall}`,message:`Variable "${w(r,r.project)}" with id "${r.id}" has inputs. A variable with internal calls can't have inputs.`,issue:null,severity:E.Error,code:G.VariableHasInputsAndInternalCall,entity:r});e.push(t.error)}if(r.getUsedOutputs().length){const t=Q({id:`${r.id}--${G.VariableHasOutputsAndInternalCall}`,message:`Variable "${w(r,r.project)}" with id "${r.id}" has outputs. A variable with internal calls can't have outputs.`,issue:null,severity:E.Error,code:G.VariableHasOutputsAndInternalCall,entity:r});e.push(t.error)}if(r.calledBy.length){const t=Q({id:`${r.id}--${G.VariableIsCalledAndHasInternalCall}`,message:`Variable "${w(r,r.project)}" with id "${r.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,issue:null,severity:E.Error,code:G.VariableIsCalledAndHasInternalCall,entity:r});e.push(t.error)}if([...r.successCalls,...r.errorCalls].length){const t=Q({id:`${r.id}--${G.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${w(r,r.project)}" with id "${r.id}" calls other entities. A variable with internal calls can't call other entities.`,issue:null,severity:E.Error,code:G.VariableCallsOthersAndHasInternalCall,entity:r});e.push(t.error)}return e}function Rq(r){var o;const e=w6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),(o=r.error)==null||o.validate();const s=[...jn(r)];return Me(r.errors,s)}const Be=class Be{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.FunctionCall);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"process",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);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.FunctionCall,declaration:s.toReference(),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=t.functions.length?`
|
|
@@ -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 Be.repository.load(this.id,...t),this}async create(e=V,...t){return await Be.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Be.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Be.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=Rq(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(Be,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Be,"MUTABLE_BASE_PROPERTIES",[]),c(Be,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Be,"BASE_PROPERTIES",[...Be.MUTABLE_BASE_PROPERTIES,...Be.INMUTABLE_BASE_PROPERTIES]),c(Be,"MUTABLE_META_PROPERTIES",["x","y"]),c(Be,"INMUTABLE_META_PROPERTIES",[...Be.INMUTABLE_BASE_PROPERTIES]),c(Be,"META_PROPERTIES",[...Be.MUTABLE_META_PROPERTIES,...Be.INMUTABLE_META_PROPERTIES]),c(Be,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Be,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(Be,"UPSTREAM_PROPERTIES",[...Be.MUTABLE_UPSTREAM_PROPERTIES,...Be.INMUTABLE_UPSTREAM_PROPERTIES]),c(Be,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(Be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Be,"DOWNSTREAM_PROPERTIES",[...Be.MUTABLE_DOWNSTREAM_PROPERTIES,...Be.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Be,"PROPERTIES",[...Be.META_PROPERTIES,...Be.UPSTREAM_PROPERTIES,...Be.DOWNSTREAM_PROPERTIES]);let Xr=Be;function Ku(r){return r&&typeof r.then=="function"}class Xu{constructor(e){c(this,"order",[]);c(this,"flatRecord",{});c(this,"onGoingVisits",{});this.flatten(e),this.orderEntities()}flatten(e){const t=new Set(ip()),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=yl(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=yl(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(yl(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);Ku(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);Ku(o)&&(this.onGoingVisits[n][a]=o)}return await this.settlePromises(this.onGoingVisits[n],n),this.onGoingVisits[n]={},this}}function PS(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=ll(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 CS(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 ll(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=Qo(o,r.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=PS(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},F={...D,implements:v,parent:S},j=b(F,r.project);return u.addMethod(j),j.setParent(u),j.initChildren(),j.implements=v,j});o.properties=h,o.methods=f;const R=CS(u);return{implemented:u,errors:[],entitiesChanges:{new:[u,...p.newEntities,...R.newEntities],updated:[u],deleted:[]}}}function Qu(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 wS(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 ep(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=dl(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=Qu(Object.keys(I),e.project);if(S){const F=wS(S||v[0],e,et.OrDataTypeGroup);a.push(...F.updated),s.push(...F.added),o.push(...F.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()},F=b(S,e.project);F.setParent(e),F.initChildren(),F.addSelfToProject();const j=ep(I,F,{...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=dl(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=dl(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 dl(r,e,t,n){const a=[],s=[],o=[],l=Object.keys(r),p=Qu(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()},F=b(S,e);F.setParent(R),F.initChildren(),F.addSelfToProject(),s.push(F);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:F.toReference()},ae=b(oe,e);ae.setParent(F),ae.initChildren(),ae.addSelfToProject(),s.push(ae);const Xe=ep(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 cl(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=cl(s,e);return o.last&&(n=o.last),[s,...o.list]}),last:n}}function BS(r,e,t=new Set){const n=dr(r),a=dr(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,...BS(u,e,t)])),[]);return m([...o,...l])}function ns(r,e){const t=cl(r,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function gq(r,e){return!!cl(r,e).last}function bq(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 tp(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 tp(t,n)}function lt(r){if(ls.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 ul(r,e){const t=rs(r,e);if(!t)return null;if(ls.includes(t.type)){if(t.type===i.FunctionDeclaration){const n=rs(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?rs(t.parent,e):null;return n?ul(n,e):null}}function MS(r){if(!r)return null;if(Xt.includes(r.type))return r;const e=r.parent;return e?MS(e):null}function _S(r){if(!r)return null;if(Je.includes(r.type))return r;const e=r.parent;return e?_S(e):null}function VS(r){if(!r)return null;if(sn.includes(r.type))return r;const e=r.parent;return e?VS(e):null}function vq(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 Iq(r){const e=dr(r),t=[],n=[];Rp.includes(r.type)&&t.push(...np(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)=>ns(o,s)?-1:0),n.sort((s,o)=>ns(o,s)?-1:0),[...t,...n,...a]}function NS(r){return[...r].sort((e,t)=>ns(t,e)?-1:0)}function Dq(r){const e=NS(r),t=[];return e.forEach(n=>{const a=t[t.length-1];if(a){const s=a[a.length-1];ns(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 np(r){return Je.includes(r.type)?[...Ot(r.successCalls),...Ot(r.errorCalls)]:We.includes(r.type)?Ot(r.calls):[]}function Aq(r,e){return np(r).includes(e)}function rp(r){return r.writesValues||[]}function Sq(r,e){return rp(r).includes(e)}function LS(r){var e;return Fe.includes((e=r==null?void 0:r.readsValue)==null?void 0:e.type)?r.readsValue:null}function Oq(r){return r.writesValues}function GS(r=[]){return r.map(LS).filter(e=>!!e)}function pl(r=[]){return r.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function $S(r=[]){return r.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function FS(r){return Fe.includes(r.type)?r:null}function US(r){return r.writesValues.map(FS).filter(e=>!!e)}function xS(r=[]){return r.reduce((e,t)=>t.type===i.OutputMap?[...e,...US(t)]:e,[])}function Ue(r){return Je.includes(r.type)?[...bn(Ot(r.successCalls)),...bn(Ot(r.errorCalls))]:We.includes(r.type)?bn(Ot(r.calls)):[]}function Pq(r){return Je.includes(r.type)?[...bn(Ot(r.successCalls)),...bn(Ot(r.errorCalls))]:We.includes(r.type)?bn(Ot(r.calls)):[]}function jS(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,...Se(a,e)],[])}function kS(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,...Se(s,e)],[])}function Se(r,e=new Set){if(e.has(r.id))return[];if(r.type===i.ReturnStatement)return $S(r.outputs).reduce((n,a)=>[...n,...Se(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,...Se(l||o,e)]},[]),...GS(r.inputs),...xS(r.outputs)].reduce((s,o)=>[...s,...Se(o,e)],[]);if(ii.includes(r.type)){const t=pl(r.inputs),a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Se(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Se(o,e)],[])}if(r.type===i.FunctionDeclaration){const t=[...pl(r.inputs)],a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Se(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Se(o)],[])}if(Fe.includes(r.type)){e.add(r.id);const n=Ue(r).reduce((a,s)=>{const o=lt(s);return[...a,...Se(o||s,e)]},[]);return[r,...n,...kS(r,e),...jS(r,e)]}return[]}function Nt(r,e=new Set){return e.has(r.id)?[]:(e.add(r.id),[...dr(r).reduce((a,s)=>[...a,s,...Nt(s,e)],[])])}function bn(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 qS(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,...pl(u.inputs),...bn(Ot(u.calls)),...u.returnStatements],[]),o=r.functions.reduce((p,u)=>[...p,...bn(Ot(u.calls)),...u.returnStatements],[]),l=r.events.reduce((p,u)=>[...p,...bn(Ot(u.calls)),...u.returnStatements],[]);return[...t,...n,...a,...s,...o,...l]}function JS(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)?gO(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 Cq(r){const e=qS(r.project);return JS(r,e)}function rs(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 WS(r,e){const t=[];if(Xt.includes(r.type)){qt(r).forEach(s=>{const o=ul(s,e);o&&t.push(o)});const a=[...r.inputs||[],...r.outputs||[]].map(s=>{const o=rs(s,e);return o?vO(o,e):null}).filter(s=>s!==null);t.push(...m(a))}if(Fe.includes(r.type)){const n=hl(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=>hl(a)).filter(a=>a!==null);e.push(...m(n))}if(Fe.includes(r.type)){const t=hl(r);t&&e.push(t)}return m(e)}function qt(r){return[...r.calledByEntry||[],...r.calledByError||[],...r.calledBySuccess||[]]}function YS(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 HS(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 zS(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 KS(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 XS(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 QS(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 eO(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 tO(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 nO(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 rO(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 iO(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 aO(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 sO(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 oO(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 lO(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 dO(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 cO(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 uO(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 pO(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 yO(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 hO(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 fO(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 mO(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 TO(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 EO(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 RO(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 ip(){const r=new Set;return Tg.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&&(qn.includes(r.type)||ip().includes(r.id)))return[];if(e.has(r.id))return[];switch(r.type){case i.FunctionCall:return tO(r,e,t);case i.Operation:return dO(r,e,t);case i.Condition:return KS(r,e,t);case i.Loop:return lO(r,e,t);case i.Search:return mO(r,e,t);case i.GlobalEvent:return rO(r,e,t);case i.ReturnStatement:return fO(r,e,t);case i.ContinueStatement:return XS(r,e,t);case i.BreakStatement:return zS(r,e,t);case i.VariableDeclaration:return EO(r,e,t);case i.DefinitionEntity:return QS(r,e,t);case i.FunctionDeclaration:return nO(r,e,t);case i.Project:return pO(r,e,t);case i.ActionDescriptor:return YS(r,e,t);case i.ArgumentDeclaration:return HS(r,e,t);case i.ReturnDeclaration:return hO(r,e,t);case i.ValueDescriptor:return TO(r,e,t);case i.InputMap:return iO(r,e,t);case i.OutputMap:return cO(r,e,t);case i.DataType:return eO(r,e,t);case i.InstalledProject:return aO(r,e,t);case i.InternalCall:return sO(r,e,t);case i.LiteralValue:return oO(r,e,t);case i.Property:return yO(r,e,t);case i.VariableInstance:return RO(r,e,t);case i.BuiltInBaseEntity:return t.ignoreBuiltInBaseEntities?[]:ZS(r,e,t);case i.PrimitiveEntity:return t.ignoreBuiltInBaseEntities?[]:uO(r,e,t)}return[]}function yl(r,e){if(qn.includes(r.type))return new Set;const t=WS(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)),Tp.includes(r.type)){const a=r.parent;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Ep.includes(r.type)){const a=r.implements;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Il.includes(r.type)){const a=r.declaration;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Dn.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 ap(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 wq(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 gO(r){return Je.includes(r.type)?r.inputs:[]}function bO(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 Bq(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 Mq(r){return r.type===i.Condition?[]:Je.includes(r.type)?r.outputs:[]}function hl(r){const e=r.readsValue;return e?lt(e):null}function vO(r,e){const t=r.readsValue;return t?ul(t,e):null}function IO(r){const e=r.internalCalls||[];return m(Ot(m(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function Hi(r){const e=rp(r),t=[];return e.forEach(n=>{if(Fe.includes(n.type))t.push(n);else if(Dn.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 dr(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?[]:dr(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=IO(r);t.push(...n,...a)}if(r.type===i.Loop){const n=r.outputs.map(o=>Hi(o)).flat();if(r.body){const o=dr(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 DO(r,e=!1){const t=dr(r,e),n=[...t,...t.reduce((a,s)=>[...a,...DO(s,e)],[])];return m(n)}function AO(r){const e=Qr(r),t=[...e,...e.reduce((n,a)=>[...n,...AO(a)],[])];return m(t)}function fl(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...fl(t),...ml(t)]:[...e,t.name],[])}function ml(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...ml(t),...fl(t)]:[...e,t.name],[])}function sp(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...sp(t),...op(t)]:[...e,t],[])}function op(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...op(t),...sp(t)]:[...e,t],[])}function lp(r){return[...ml(r),...fl(r)].filter((t,n,a)=>a.indexOf(t)===n)}function SO(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=SO(a);if(s)return s}return n},null)}function _q(r){const e=r.extends.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function Vq(r){const e=r.implements.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function dp(r){const e=r.extends.find(t=>t.type===i.DefinitionEntity);return e&&e.type===i.DefinitionEntity?e:null}function cr(r){const e=[...r.implements,...r.extends].reduce((t,n)=>n.type===i.BuiltInBaseEntity?[...t,n]:n.type===i.DefinitionEntity?[...t,...cr(n)]:t,[]);return m(e)}function cp(r){return r.type===i.PrimitiveEntity?!0:r.type===i.BuiltInBaseEntity?r.interactive:!cr(r).find(n=>!n.interactive)}function Nq(r){return r.parent===r.project&&r.project.variableDeclarations.includes(r)}function up(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 OO(r){if([...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||up(r))return!1;const e=Qr(r);return e.length===0?!0:e.some(t=>OO(t))}function pp(r){return[...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||up(r)?!1:Qr(r).length===0}function PO(r,e=0){if(pp(r)){const t=Qr(r);return t.length===0?r:t.map(a=>PO(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function CO(r){const e=[];if(pp(r))e.push(r);else return[];return Qr(r).forEach(n=>{e.push(...CO(n))}),e}function wO(r){return r.type===i.FunctionDeclaration&&r.parent!==r.project&&!![i.DefinitionEntity,i.Loop,i.InstalledProject].includes(r.parent.type)}function Lq(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 Tl(r){switch(r){case i.DefinitionEntity:return ei;case i.FunctionDeclaration:return xr;case i.VariableDeclaration:return Jr;case i.VariableInstance:return Wr;case i.FunctionCall:return Xr;case i.Operation:return jr;case i.Condition:return qr;case i.ReturnStatement:return Zr;case i.Loop:return kr;case i.Search:return Yr;case i.InputMap:return Un;case i.OutputMap:return xn;case i.ArgumentDeclaration:return zr;case i.ReturnDeclaration:return kt;case i.Property:return Ur;case i.InstalledProject:return Hr;case i.Project:return M;case i.BuiltInBaseEntity:return vn;default:return null}}function Pt(r,e){if(pt.includes(r.type))return r;if(qn.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 yp(r,e){if(qn.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:yp(t,e):null}function El(r,e,t){if(r===e||e===t||r===t)return!1;const n=Pt(e.parent,t);return n===r?!0:El(n,e,t)}var Rl=(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))(Rl||{});function is(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(El(n,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:n};if(El(a,n,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=tp(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 BO(r,e,t){const n=is(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 MO(r){return r.length===0?null:r.length===1?r[0]:r.reduce((t,n)=>{const a=BO(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 ur(r){if(!r)return null;if(qn.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:ur(e)}function Gq(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 as(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=yp(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=as(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=as(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=as(l);p.reachable||p.blocks.forEach(u=>{n(s,u.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function $q(r){return ls.includes(r.type)?r.type===i.FunctionDeclaration?!wO(r):!0:!1}function Fq(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=dp(r)||r;return!!lp(t).includes(e)}function Uq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,U.PERSISTED_ENTITY)){e.push(t);return}}),m(e)}function xq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,U.RELATIONAL_DATABASE)){e.push(t);return}}),m(e)}function jq(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 kq(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 qq(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(!bp.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 Jq(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 Ae=class Ae{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=Jq(n,t),o=Qo(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 Be.repository.load(this.id,...t),this}async create(e=V,...t){return await Be.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Be.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Be.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=Rq(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(Be,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Be,"MUTABLE_BASE_PROPERTIES",[]),c(Be,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Be,"BASE_PROPERTIES",[...Be.MUTABLE_BASE_PROPERTIES,...Be.INMUTABLE_BASE_PROPERTIES]),c(Be,"MUTABLE_META_PROPERTIES",["x","y"]),c(Be,"INMUTABLE_META_PROPERTIES",[...Be.INMUTABLE_BASE_PROPERTIES]),c(Be,"META_PROPERTIES",[...Be.MUTABLE_META_PROPERTIES,...Be.INMUTABLE_META_PROPERTIES]),c(Be,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Be,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(Be,"UPSTREAM_PROPERTIES",[...Be.MUTABLE_UPSTREAM_PROPERTIES,...Be.INMUTABLE_UPSTREAM_PROPERTIES]),c(Be,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(Be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Be,"DOWNSTREAM_PROPERTIES",[...Be.MUTABLE_DOWNSTREAM_PROPERTIES,...Be.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Be,"PROPERTIES",[...Be.META_PROPERTIES,...Be.UPSTREAM_PROPERTIES,...Be.DOWNSTREAM_PROPERTIES]);let Xr=Be;function Ku(r){return r&&typeof r.then=="function"}class Xu{constructor(e){c(this,"order",[]);c(this,"flatRecord",{});c(this,"onGoingVisits",{});this.flatten(e),this.orderEntities()}flatten(e){const t=new Set(ip()),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=yl(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=yl(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(yl(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);Ku(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);Ku(o)&&(this.onGoingVisits[n][a]=o)}return await this.settlePromises(this.onGoingVisits[n],n),this.onGoingVisits[n]={},this}}function PS(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=ll(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 CS(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 ll(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=Qo(o,r.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=PS(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},x={...D,implements:v,parent:S},k=b(x,r.project);return u.addMethod(k),k.setParent(u),k.initChildren(),k.implements=v,k});o.properties=h,o.methods=f;const R=CS(u);return{implemented:u,errors:[],entitiesChanges:{new:[u,...p.newEntities,...R.newEntities],updated:[u],deleted:[]}}}function Qu(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 wS(r,e,t=et.OrDataTypeGroup){const n=[],a=[],s=[],l={id:M.UUID.uuid(),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 ep(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=>{if(Array.isArray(I)&&(R=!0),typeof I=="object"&&!Array.isArray(I)&&I!==null){const D=dl(I,e.project,{...t,id:M.UUID.uuid()},n);D.hasCreated&&f.push(D.changeSet.self),a.push(...D.changeSet.updated),s.push(...D.changeSet.added),o.push(...D.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=>{if(typeof I=="object"&&!Array.isArray(I)&&I!==null){const D=Qu(Object.keys(I),e.project);if(D){const S=wS(D||v[0],e,et.OrDataTypeGroup);a.push(...S.updated),s.push(...S.added),o.push(...S.removed)}}else{const D={id:M.UUID.uuid(),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()},S=b(D,e.project);S.setParent(e),S.initChildren(),S.addSelfToProject();const x=ep(I,S,{...t,id:M.UUID.uuid()},n);a.push(...x.updated),s.push(...x.added),o.push(...x.removed)}})}}else{const u=dl(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=dl(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 dl(r,e,t,n){const a=[],s=[],o=[],l=Object.keys(r),p=Qu(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 S={id:de(u+" "+v,i.Property,e),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()},x=b(S,e);x.setParent(R),x.initChildren(),x.addSelfToProject(),s.push(x);const k=r[v],oe={id:M.UUID.uuid(),version:1,type:i.DataType,entity:null,isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parent:x.toReference()},ae=b(oe,e);ae.setParent(x),ae.initChildren(),ae.addSelfToProject(),s.push(ae);const Xe=ep(k,ae,{...t,name:v,id:M.UUID.uuid()},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 cl(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=cl(s,e);return o.last&&(n=o.last),[s,...o.list]}),last:n}}function BS(r,e,t=new Set){const n=dr(r),a=dr(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,...BS(u,e,t)])),[]);return m([...o,...l])}function ts(r,e){const t=cl(r,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function gq(r,e){return!!cl(r,e).last}function bq(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 tp(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 tp(t,n)}function lt(r){if(os.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 ul(r,e){const t=ns(r,e);if(!t)return null;if(os.includes(t.type)){if(t.type===i.FunctionDeclaration){const n=ns(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?ns(t.parent,e):null;return n?ul(n,e):null}}function MS(r){if(!r)return null;if(Xt.includes(r.type))return r;const e=r.parent;return e?MS(e):null}function _S(r){if(!r)return null;if(Je.includes(r.type))return r;const e=r.parent;return e?_S(e):null}function VS(r){if(!r)return null;if(sn.includes(r.type))return r;const e=r.parent;return e?VS(e):null}function vq(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 Iq(r){const e=dr(r),t=[],n=[];Rp.includes(r.type)&&t.push(...np(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)=>ts(o,s)?-1:0),n.sort((s,o)=>ts(o,s)?-1:0),[...t,...n,...a]}function NS(r){return[...r].sort((e,t)=>ts(t,e)?-1:0)}function Dq(r){const e=NS(r),t=[];return e.forEach(n=>{const a=t[t.length-1];if(a){const s=a[a.length-1];ts(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 np(r){return Je.includes(r.type)?[...Ot(r.successCalls),...Ot(r.errorCalls)]:We.includes(r.type)?Ot(r.calls):[]}function Aq(r,e){return np(r).includes(e)}function rp(r){return r.writesValues||[]}function Sq(r,e){return rp(r).includes(e)}function LS(r){var e;return Fe.includes((e=r==null?void 0:r.readsValue)==null?void 0:e.type)?r.readsValue:null}function Oq(r){return r.writesValues}function GS(r=[]){return r.map(LS).filter(e=>!!e)}function pl(r=[]){return r.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function $S(r=[]){return r.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function FS(r){return Fe.includes(r.type)?r:null}function US(r){return r.writesValues.map(FS).filter(e=>!!e)}function xS(r=[]){return r.reduce((e,t)=>t.type===i.OutputMap?[...e,...US(t)]:e,[])}function Ue(r){return Je.includes(r.type)?[...bn(Ot(r.successCalls)),...bn(Ot(r.errorCalls))]:We.includes(r.type)?bn(Ot(r.calls)):[]}function Pq(r){return Je.includes(r.type)?[...bn(Ot(r.successCalls)),...bn(Ot(r.errorCalls))]:We.includes(r.type)?bn(Ot(r.calls)):[]}function jS(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,...Se(a,e)],[])}function kS(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,...Se(s,e)],[])}function Se(r,e=new Set){if(e.has(r.id))return[];if(r.type===i.ReturnStatement)return $S(r.outputs).reduce((n,a)=>[...n,...Se(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,...Se(l||o,e)]},[]),...GS(r.inputs),...xS(r.outputs)].reduce((s,o)=>[...s,...Se(o,e)],[]);if(ii.includes(r.type)){const t=pl(r.inputs),a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Se(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Se(o,e)],[])}if(r.type===i.FunctionDeclaration){const t=[...pl(r.inputs)],a=Ue(r).reduce((s,o)=>{const l=lt(o);return[...s,...Se(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Se(o)],[])}if(Fe.includes(r.type)){e.add(r.id);const n=Ue(r).reduce((a,s)=>{const o=lt(s);return[...a,...Se(o||s,e)]},[]);return[r,...n,...kS(r,e),...jS(r,e)]}return[]}function Nt(r,e=new Set){return e.has(r.id)?[]:(e.add(r.id),[...dr(r).reduce((a,s)=>[...a,s,...Nt(s,e)],[])])}function bn(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 qS(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,...pl(u.inputs),...bn(Ot(u.calls)),...u.returnStatements],[]),o=r.functions.reduce((p,u)=>[...p,...bn(Ot(u.calls)),...u.returnStatements],[]),l=r.events.reduce((p,u)=>[...p,...bn(Ot(u.calls)),...u.returnStatements],[]);return[...t,...n,...a,...s,...o,...l]}function JS(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)?gO(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 Cq(r){const e=qS(r.project);return JS(r,e)}function ns(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 WS(r,e){const t=[];if(Xt.includes(r.type)){qt(r).forEach(s=>{const o=ul(s,e);o&&t.push(o)});const a=[...r.inputs||[],...r.outputs||[]].map(s=>{const o=ns(s,e);return o?vO(o,e):null}).filter(s=>s!==null);t.push(...m(a))}if(Fe.includes(r.type)){const n=hl(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=>hl(a)).filter(a=>a!==null);e.push(...m(n))}if(Fe.includes(r.type)){const t=hl(r);t&&e.push(t)}return m(e)}function qt(r){return[...r.calledByEntry||[],...r.calledByError||[],...r.calledBySuccess||[]]}function YS(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 HS(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 zS(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 KS(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 XS(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 QS(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 eO(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 tO(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 nO(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 rO(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 iO(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 aO(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 sO(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 oO(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 lO(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 dO(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 cO(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 uO(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 pO(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 yO(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 hO(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 fO(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 mO(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 TO(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 EO(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 RO(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 ip(){const r=new Set;return Tg.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&&(qn.includes(r.type)||ip().includes(r.id)))return[];if(e.has(r.id))return[];switch(r.type){case i.FunctionCall:return tO(r,e,t);case i.Operation:return dO(r,e,t);case i.Condition:return KS(r,e,t);case i.Loop:return lO(r,e,t);case i.Search:return mO(r,e,t);case i.GlobalEvent:return rO(r,e,t);case i.ReturnStatement:return fO(r,e,t);case i.ContinueStatement:return XS(r,e,t);case i.BreakStatement:return zS(r,e,t);case i.VariableDeclaration:return EO(r,e,t);case i.DefinitionEntity:return QS(r,e,t);case i.FunctionDeclaration:return nO(r,e,t);case i.Project:return pO(r,e,t);case i.ActionDescriptor:return YS(r,e,t);case i.ArgumentDeclaration:return HS(r,e,t);case i.ReturnDeclaration:return hO(r,e,t);case i.ValueDescriptor:return TO(r,e,t);case i.InputMap:return iO(r,e,t);case i.OutputMap:return cO(r,e,t);case i.DataType:return eO(r,e,t);case i.InstalledProject:return aO(r,e,t);case i.InternalCall:return sO(r,e,t);case i.LiteralValue:return oO(r,e,t);case i.Property:return yO(r,e,t);case i.VariableInstance:return RO(r,e,t);case i.BuiltInBaseEntity:return t.ignoreBuiltInBaseEntities?[]:ZS(r,e,t);case i.PrimitiveEntity:return t.ignoreBuiltInBaseEntities?[]:uO(r,e,t)}return[]}function yl(r,e){if(qn.includes(r.type))return new Set;const t=WS(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)),Tp.includes(r.type)){const a=r.parent;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Ep.includes(r.type)){const a=r.implements;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Il.includes(r.type)){const a=r.declaration;a&&(a.type===i.GenericReference?n.add(a.entityId):n.add(a.id))}if(Dn.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 ap(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 wq(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 gO(r){return Je.includes(r.type)?r.inputs:[]}function bO(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 Bq(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 Mq(r){return r.type===i.Condition?[]:Je.includes(r.type)?r.outputs:[]}function hl(r){const e=r.readsValue;return e?lt(e):null}function vO(r,e){const t=r.readsValue;return t?ul(t,e):null}function IO(r){const e=r.internalCalls||[];return m(Ot(m(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function Hi(r){const e=rp(r),t=[];return e.forEach(n=>{if(Fe.includes(n.type))t.push(n);else if(Dn.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 dr(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?[]:dr(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=IO(r);t.push(...n,...a)}if(r.type===i.Loop){const n=r.outputs.map(o=>Hi(o)).flat();if(r.body){const o=dr(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 DO(r,e=!1){const t=dr(r,e),n=[...t,...t.reduce((a,s)=>[...a,...DO(s,e)],[])];return m(n)}function AO(r){const e=Qr(r),t=[...e,...e.reduce((n,a)=>[...n,...AO(a)],[])];return m(t)}function fl(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...fl(t),...ml(t)]:[...e,t.name],[])}function ml(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,i.DefinitionEntity,...ml(t),...fl(t)]:[...e,t.name],[])}function sp(r){return r.extends.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...sp(t),...op(t)]:[...e,t],[])}function op(r){return r.implements.reduce((e,t)=>t.type===i.DefinitionEntity?[...e,t,...op(t),...sp(t)]:[...e,t],[])}function lp(r){return[...ml(r),...fl(r)].filter((t,n,a)=>a.indexOf(t)===n)}function SO(r){return r.implements.length===0&&r.extends.length===0?null:r.implements.find(n=>n.type===i.BuiltInBaseEntity&&n.name===F.PERSISTED_ENTITY)?r:[...r.implements,...r.extends].reduce((n,a)=>{if(a.type===i.DefinitionEntity){const s=SO(a);if(s)return s}return n},null)}function _q(r){const e=r.extends.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function Vq(r){const e=r.implements.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function dp(r){const e=r.extends.find(t=>t.type===i.DefinitionEntity);return e&&e.type===i.DefinitionEntity?e:null}function cr(r){const e=[...r.implements,...r.extends].reduce((t,n)=>n.type===i.BuiltInBaseEntity?[...t,n]:n.type===i.DefinitionEntity?[...t,...cr(n)]:t,[]);return m(e)}function cp(r){return r.type===i.PrimitiveEntity?!0:r.type===i.BuiltInBaseEntity?r.interactive:!cr(r).find(n=>!n.interactive)}function Nq(r){return r.parent===r.project&&r.project.variableDeclarations.includes(r)}function up(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 OO(r){if([...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||up(r))return!1;const e=Qr(r);return e.length===0?!0:e.some(t=>OO(t))}function pp(r){return[...We,i.DefinitionEntity,i.InstalledProject,i.Project].includes(r.type)||up(r)?!1:Qr(r).length===0}function PO(r,e=0){if(pp(r)){const t=Qr(r);return t.length===0?r:t.map(a=>PO(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function CO(r){const e=[];if(pp(r))e.push(r);else return[];return Qr(r).forEach(n=>{e.push(...CO(n))}),e}function wO(r){return r.type===i.FunctionDeclaration&&r.parent!==r.project&&!![i.DefinitionEntity,i.Loop,i.InstalledProject].includes(r.parent.type)}function Lq(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 Tl(r){switch(r){case i.DefinitionEntity:return ei;case i.FunctionDeclaration:return xr;case i.VariableDeclaration:return Jr;case i.VariableInstance:return Wr;case i.FunctionCall:return Xr;case i.Operation:return jr;case i.Condition:return qr;case i.ReturnStatement:return Zr;case i.Loop:return kr;case i.Search:return Yr;case i.InputMap:return Un;case i.OutputMap:return xn;case i.ArgumentDeclaration:return zr;case i.ReturnDeclaration:return kt;case i.Property:return Ur;case i.InstalledProject:return Hr;case i.Project:return M;case i.BuiltInBaseEntity:return vn;default:return null}}function Pt(r,e){if(pt.includes(r.type))return r;if(qn.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 yp(r,e){if(qn.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:yp(t,e):null}function El(r,e,t){if(r===e||e===t||r===t)return!1;const n=Pt(e.parent,t);return n===r?!0:El(n,e,t)}var Rl=(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))(Rl||{});function rs(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(El(n,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:n};if(El(a,n,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=tp(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 BO(r,e,t){const n=rs(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 MO(r){return r.length===0?null:r.length===1?r[0]:r.reduce((t,n)=>{const a=BO(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 ur(r){if(!r)return null;if(qn.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:ur(e)}function Gq(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 is(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=yp(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=is(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=is(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=is(l);p.reachable||p.blocks.forEach(u=>{n(s,u.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function $q(r){return os.includes(r.type)?r.type===i.FunctionDeclaration?!wO(r):!0:!1}function Fq(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=dp(r)||r;return!!lp(t).includes(e)}function Uq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,F.PERSISTED_ENTITY)){e.push(t);return}}),m(e)}function xq(r){const e=[];return r.entities.forEach(t=>{if(zi(t,F.RELATIONAL_DATABASE)){e.push(t);return}}),m(e)}function jq(r){return r.type!==i.DefinitionEntity||r.abstract||!zi(r,F.PERSISTED_ENTITY)?null:(r==null?void 0:r.properties.find(t=>{var n;return((n=t.implements)==null?void 0:n.id)===_[i.BuiltInBaseEntity][F.PERSISTED_ENTITY].properties.primaryKey.id&&!t.abstract}))||null}function kq(r){if(r.type!==i.DefinitionEntity)return[];if(r.abstract)return[];if(!zi(r,F.PERSISTED_ENTITY))return[];const e=[],t=r.properties.filter(n=>{var a;return((a=n.implements)==null?void 0:a.id)!==_[i.BuiltInBaseEntity][F.PERSISTED_ENTITY].properties.database.id&&!n.abstract});return e.push(...t),e}function qq(r){var t;if(!r||r.type!==i.DefinitionEntity||!zi(r,F.PERSISTED_ENTITY))return null;const e=r.properties.find(n=>{var a;return((a=n.implements)==null?void 0:a.id)===_[i.BuiltInBaseEntity][F.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(!bp.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 Jq(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 Ae=class Ae{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=Jq(n,t),o=Qo(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
|
${gn({describe_entity:p.entity.id})}
|
|
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=>{I5(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)}),D5(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 Ae.repository.load(this.id,...t),this}async create(e=V,...t){return await Ae.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Ae.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Ae.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=v5(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,M.UUID.uuid(),n));u.properties=h;const f=(I=this.methods)==null?void 0:I.map((S,F)=>S.clone(u,p+"-method-"+F+"-id",n));u.methods=f;const R=(D=this.abstractMethods)==null?void 0:D.map((S,F)=>S.clone(u,p+"-abstract-method-"+F+"-id",n));return u.abstractMethods=R,u}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return ll(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=Fr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),u=Rn(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=Fr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),D=Rn(I),S=D==null?void 0:D.clone(o,M.UUID.uuid(),!0);S&&o.setDataType(S)}return}const l={id:M.UUID.uuid(),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=Fr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),f=Rn(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(Ae,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Ae,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),c(Ae,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ae,"BASE_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"MUTABLE_META_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ae,"INMUTABLE_META_PROPERTIES",[...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"META_PROPERTIES",[...Ae.MUTABLE_META_PROPERTIES,...Ae.INMUTABLE_META_PROPERTIES]),c(Ae,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),c(Ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ae,"UPSTREAM_PROPERTIES",[...Ae.MUTABLE_UPSTREAM_PROPERTIES,...Ae.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),c(Ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ae,"DOWNSTREAM_PROPERTIES",[...Ae.MUTABLE_DOWNSTREAM_PROPERTIES,...Ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ae,"PROPERTIES",[...Ae.META_PROPERTIES,...Ae.UPSTREAM_PROPERTIES,...Ae.DOWNSTREAM_PROPERTIES]);let ei=Ae;function Wq(r){const e=Q9(),t=r.toJSON();e.safeParse(t).success;const a=[];return Me(r.errors,a)}const os=class os{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 os.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=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}implement(e,t){return ll(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 os&&e.push(...n.getAllInteractiveMethods())})),m(e)}};c(os,"repository",{load:async(e,...t)=>null});let vn=os;function Yq(r){const e=q9(),t=r.toJSON();e.safeParse(t).success;const a=[];return Me(r.errors,a)}const bl=class bl{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 bl.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=Yq(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 vn&&e.push(...n.getAllInteractiveMethods())}),m(e)}};c(bl,"repository",{load:async(e,...t)=>null});let Kt=bl;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 xr(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 Ur(r,e);case i.FunctionCall:return t||new Xr(r,e);case i.Condition:return t||new qr(r,e);case i.Operation:return t||new jr(r,e);case i.VariableDeclaration:return t||new Jr(r,e);case i.VariableInstance:return t||new Wr(r,e);case i.OutputMap:return t||new xn(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 Un(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 kr(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 vn(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 Hq(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 xr.fromGenerationTarget(r,e);case i.GlobalEvent:return qi.fromGenerationTarget(r,e);case i.DataType:return ki.fromGenerationTarget(r,e);case i.Property:return Ur.fromGenerationTarget(r,e);case i.FunctionCall:return Xr.fromGenerationTarget(r,e);case i.Condition:return qr.fromGenerationTarget(r,e);case i.Operation:return jr.fromGenerationTarget(r,e);case i.VariableDeclaration:return Jr.fromGenerationTarget(r,e);case i.VariableInstance:return Wr.fromGenerationTarget(r,e);case i.OutputMap:return xn.fromGenerationTarget(r,e);case i.ReturnDeclaration:return kt.fromGenerationTarget(r,e);case i.ArgumentDeclaration:return zr.fromGenerationTarget(r,e);case i.InputMap:return Un.fromGenerationTarget(r,e);case i.InstalledProject:return Hr.fromGenerationTarget(r,e);case i.ReturnStatement:return Zr.fromGenerationTarget(r,e);case i.Loop:return kr.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 _O{constructor(){c(this,"initialData")}}const V={cascade:!1},VO={load:async(r,...e)=>null},zq={create:async(r,...e)=>r,update:async(r,...e)=>r,delete:async(r,...e)=>{},...VO};class Zq{}class Kq extends _O{}class Xq{}class Qq{}class eJ{}class hp{}class tJ extends hp{}class nJ extends hp{}class rJ{}class kn{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 ss{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 iJ{}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=ro==null?void 0:ro()),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=m5(),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=Se(n);return[...t,...a]},[]),...this.functionCalls.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.conditions.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.operations.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.loops.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.searches.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return m([...this.variableDeclarations,...this.getEntryPoints().reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,n)=>{const s=Se(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 NO extends se{constructor(t){super(Qt,t);c(this,"id",Ne.Parallel);c(this,"name",Ne.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 LO 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 GO extends se{constructor(t){super(Cn,t);c(this,"id",Ne.Sequential);c(this,"name",Ne.Sequential);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",Cn);c(this,"type",i.ActionDescriptor);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"error",null);c(this,"project");this.project=t,this.inputs=Cn.inputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.outputs=Cn.outputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Cn.error?b(Cn.error,this.project):null}}class aJ extends se{constructor(e){super(Xi,e)}}class sJ extends se{constructor(e){super(yr,e)}}class oJ extends se{constructor(t){super(hr,t);c(this,"autoexecutable",!0)}getEntityToMatchInputMap(t){return t.inputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Le.Validate].inputs.entityToMatch.id})||null}getDataToValidateInputMap(t){return t.inputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Le.Validate].inputs.dataToValidate.id})||null}getOutputDataOutputMap(t){return t.outputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Le.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[Le.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[Le.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[Le.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[Le.Validate].inputs.entityToMatch.id?this.syncEntityToMatchInputMapDataType(t):((a=t.declaration)==null?void 0:a.id)===_.operation[Le.Validate].inputs.dataToValidate.id?this.syncDataToValidateInputMapDataType(t):null}inferOutputMapDataType(t){var n;return((n=t.declaration)==null?void 0:n.id)===_.operation[Le.Validate].outputs.outputEntity.id?this.syncOutputDataOutputMapDataType(t):null}}class lJ extends se{constructor(e){super(_l,e)}}class dJ extends se{constructor(e){super(Nl,e)}}class cJ extends se{constructor(e){super(Ll,e)}}class uJ extends se{constructor(e){super(ys,e)}}class pJ extends se{constructor(e){super(cs,e)}}class yJ extends se{constructor(e){super(Ki,e)}}function hJ(r){const e=[new GO(r),new NO(r),new LO(r),new aJ(r),new sJ(r),new oJ(r),new uJ(r),new lJ(r),new cJ(r),new dJ(r),new pJ(r),new yJ(r),new se(Ml,r),new se(Bl,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}class $O extends vn{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 fJ(r){const e=[new $O(r),new vn(ia,r),new vn(cn,r),new vn(ws,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.builtInBaseEntities=e,e}function mJ(r){const e=[new Kt(J,r),new Kt(An,r),new Kt(ee,r),new Kt(it,r),new Kt(Sn,r),new Kt(on,r),new Kt(On,r),new Kt(ai,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.primitives=e,e}function TJ(r){const e=[new se(Ms,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.globalEventActionDescriptors=e,e}function EJ(r){const e=[new se(na,r),new se(Jn,r),new se(ea,r),new se(li,r),new se(di,r),new se(bs,r)];e.forEach(n=>{n.initChildren(),r.subscribeBuiltInInstance(n)}),r.loopDeclarations=e;const t=[new se(As,r),new se(ta,r),new se(Is,r),new se(zl,r),new se(Kl,r),new se(vs,r)];return t.forEach(n=>{n.initChildren(),r.subscribeBuiltInInstance(n)}),r.loopDeclarationsBodies=t,e}function RJ(r){const e=[new Kr(aa,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.valueDescriptors=e,e}function gJ(r){const e=[new se(Rr,r),new se(hi,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}const ti={},gl={};async function bJ(r,e={}){const t={...gD};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 fp(r){const e=new M(r);return mJ(e),fJ(e),hJ(e),TJ(e),EJ(e),RJ(e),gJ(e),e.getAllBuiltIn().forEach(n=>{e.builtInInstances[n.id]||(e.builtInInstances[n.id]=n,delete e.instances[n.id])}),e}function vJ(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=fp(r.toShallowJSON({seenEntityMaps:e}));return new Xu(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 FO(r){const e=fp(r);return new Xu(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 IJ(r,e={}){if(r.id&&ti[r.id])return ti[r.id];if(r.id&&gl[r.id])return await gl[r.id],ti[r.id];const t=bJ(r,e);r.id&&(gl[r.id]=t);const n=await t;if(n.data){const a=FO(n.data);return ti[r.id]=a,r.id&&delete gl[r.id],a}return null}function DJ(r){return ti[r.id]&&delete ti[r.id],null}const AJ="test_primitive_entities_export";d.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=Hu,d.ALL_BUILT_IN_BASE_ENTITIES=KR,d.ALL_BUILT_IN_CONDITION_ENTITIES=ug,d.ALL_BUILT_IN_GLOBAL_EVENT_ENTITIES=yg,d.ALL_BUILT_IN_LOOP_BODY_ENTITIES=OE,d.ALL_BUILT_IN_LOOP_ENTITIES=SE,d.ALL_BUILT_IN_OPERATION_ENTITIES=$m,d.ALL_BUILT_IN_PRIMITIVE_ENTITIES=Pp,d.ALL_BUILT_IN_TOP_LEVEL_ENTITIES=Tg,d.ALL_BUILT_IN_VALUE_DESCRIPTORS=mg,d.ActionDescriptorState=se,d.ActionInputMapState=z7,d.ActionOutputMapState=X7,d.AppendToListOperationInputIds=Lh,d.AppendToListOperationOutputIds=Gh,d.ArgumentDeclarationState=zr,d.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=qu,d.BUILT_IN_BASE_ENTITY_IDS=_,d.BUILT_IN_ENTITY_TYPES=qn,d.BaseCanvasDraggableState=Xq,d.BaseEntityNames=U,d.BaseState=Kq,d.BaseValueDescriptorIds=ds,d.BreakStatementState=Yi,d.BuiltInBaseEntityState=vn,d.CACHED_PROJECTS_BY_ID=ti,d.CALLABLE_ENTITIES_EXPLANATION=cq,d.CALLABLE_TYPES=Xt,d.CALLER_ENTITIES_EXPLANATION=ES,d.CALLER_TYPES=sn,d.CALLS_UPDATE_EXPLANATION=or,d.COMPARISON_CONDITIONS=dg,d.CONDITIONS=cg,d.CUSTOM_ENTITY_OPERATIONS=nm,d.CallableEntityClass=eJ,d.CallerEntityClass=hp,d.ChildEntityState=Qq,d.ComparisonOperatorTypes=qe,d.ConditionState=qr,d.ContinueStatementState=St,d.CreateNewInputIds=wf,d.CreateNewOutputIds=Bf,d.DRAGGABLE_CALLABLE_TYPES=Al,d.DRAGGABLE_CALLER_TYPES=Rp,d.DRAGGABLE_ELEMENT_TYPES=ls,d.DRAGGABLE_EXECUTABLE_TYPES=jO,d.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=Dl,d.DataTypeCompatibilityTypes=zt,d.DataTypeParentChildRelation=et,d.DataTypeState=ki,d.DefinitionEntityState=ei,d.EDITABLE_PERSISTANCE_REPOSITORY_DEFAULTS=zq,d.ENTITIES_WITH_VALLUES_EXPLANATION=rl,d.ENTITY_PERSISTANCE_OPTIONS_DEFAULTS=V,d.ENTITY_RECUSION_OPTIONS_DEFAULTS=L,d.ENTITY_TYPES=kO,d.ENTITY_WITH_DECLARATION_TYPES=UO,d.ENTITY_WITH_LOGIC_SCOPE_TYPES=pt,d.ENTITY_WITH_NAMES_TYPES=gp,d.ENTITY_WITH_PARENT_TYPES=Tp,d.ENTITY_WITH_USER_MANAGED_DECLARATION_TYPES=Il,d.ENTITY_WITH_USER_MANAGED_SINGLE_IMPLEMENTS_TYPES=Ep,d.ENTITY_WITH_VALUE_TYPES=mp,d.ENTRY_POINT_ENTITIES_EXPLANATION=es,d.ENTRY_POINT_TYPES=We,d.EVENT_TYPES=ii,d.EXECUTABLE_TYPES=xO,d.EXECUTION_OPERATIONS=Cf,d.EntityError=Pr,d.EntityErrorSeverity=E,d.EntityGenerationError=g,d.EntityGenerationErrorCode=T,d.EntityInstanceErrorCode=G,d.EntityOperations=Le,d.EntityType=i,d.EntityWithLogicScopeClass=iJ,d.EntityWithValueClass=rJ,d.EntryPointEntityClass=tJ,d.ExecutionOperations=Ne,d.ExecutionTerminationType=fS,d.FunctionCallState=Xr,d.FunctionDeclarationState=xr,d.GLOBAL_EVENT_DECLARATIONS=pg,d.GetLastInListOperationInputIds=Dh,d.GetLastInListOperationOutputIds=Ah,d.GlobalEventNames=In,d.GlobalEventState=qi,d.HTTPOperations=dt,d.HTTP_OPERATIONS=Lm,d.InputMapState=Un,d.InstalledProjectState=Hr,d.InternalCallState=Ji,d.JoinListOperationInputIds=qy,d.JoinListOperationOutputIds=Jy,d.LIST_OPERATIONS=Zh,d.ListOperations=X,d.LiteralValueState=Wi,d.LoopState=kr,d.LoopTypes=k,d.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=lr,d.NUMBER_OPERATIONS=iy,d.NumberOperations=Ge,d.OPERATION_DECLARATIONS=Gm,d.OperationState=jr,d.OutputMapParentChildRelation=ri,d.OutputMapState=xn,d.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=il,d.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=sr,d.PASS_THROUGH_CALLABLE_TYPES=Je,d.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=Yu,d.ParallelExecutionOperation=NO,d.PassThroughCallableEntityClass=nJ,d.PersistedEntity=$O,d.PersistedEntityMethods=Gt,d.PrimitiveEntityState=Kt,d.PrimitiveTypes=C,d.ProjectState=M,d.PropertyState=Ur,d.READ_ONLY_ENTITY_PERSISTANCE_REPOSITORY=VO,d.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=uq,d.ReturnDeclarationState=kt,d.ReturnStatementState=Zr,d.STANDALONE_CONDITIONS=eg,d.STRING_OPERATIONS=ky,d.ScopeCompatibilityType=Rl,d.SearchState=Yr,d.SequentialExecutionOperation=GO,d.SequentialExecutionOperationInputIds=mf,d.SequentialExecutionOperationOutputIds=Tf,d.SharedEntityErrorCode=B,d.SharedStateFunctionality=_O,d.SplitListOperationInputIds=sh,d.SplitListOperationOutputIds=oh,d.StandaloneOperatorTypes=Jt,d.StringOperations=re,d.TERMINATION_TYPES=xe,d.Traverser=Xu,d.USER_MANAGED_ENTITY_TYPES=bp,d.UserManagedEntityStateFunctionality=Zq,d.VALUE_READING_ENTITIES_EXPLANATION=Wu,d.VALUE_READING_TYPES=Dn,d.VALUE_WRITING_ENTITIES_EXPLANATION=RS,d.VALUE_WRITING_TYPES=Ze,d.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=Ju,d.VARIABLE_TYPES=Fe,d.ValueAutogenerationType=ze,d.ValueDescriptorParentChildRelation=P,d.ValueDescriptorState=Kr,d.ValueReadingEntityClass=kn,d.ValueWritingEntityClass=ss,d.VariableDeclarationState=Jr,d.VariableInputMapState=H7,d.VariableInstanceState=Wr,d.VariableOutputMapState=K7,d.WaitOperation=LO,d.WaitOperationInputIds=df,d.WaitOperationOutputIds=cf,d.appendToListOperation=ys,d.appendToListOperationElementToAppendArgument=$l,d.appendToListOperationElementToAppendArgumentParentRef=Jh,d.appendToListOperationElementToAppendArgumentRef=Uh,d.appendToListOperationError=zh,d.appendToListOperationErrorParentRef=Hh,d.appendToListOperationListArgument=Gl,d.appendToListOperationListArgumentParentRef=qh,d.appendToListOperationListArgumentRef=$h,d.appendToListOperationListDataType=Fh,d.appendToListOperationResultListDataType=kh,d.appendToListOperationResultListReturn=Yh,d.appendToListOperationResultListReturnParentRef=Wh,d.appendToListOperationResultListReturnRef=jh,d.appendToListOperationSecondListDataType=xh,d.asGenerationActionExample=gn,d.booleanPrototype=An,d.capitalizeFirstLetter=Ho,d.checkAreDataTypesCompatible=Zt,d.checkAreDefinitionEntitiesCompatibleAsDataType=rS,d.checkArePropertiesCompatibleAsDataType=nS,d.checkIsBranchDependentButNotDirectlyOnBranch=ns,d.checkIsBranchDependentOnBranch=gq,d.checkIsCallableEntityReachable=as,d.checkIsCanvasEntity=$q,d.checkIsDetachedBranch=OO,d.checkIsDetachedBranchShallow=pp,d.checkIsGlobalVariable=Nq,d.checkIsGloballyDeclared=up,d.checkIsMethod=wO,d.checkIsNestedScope=El,d.checkScopeCompatibility=is,d.cloneProject=vJ,d.countedLoopActionDescriptor=na,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=As,d.countedLoopBodyActionDescriptorAnyDynamicArgument=IE,d.countedLoopBodyActionDescriptorAnyDynamicArgumentParentRef=vE,d.countedLoopBodyActionDescriptorAnyDynamicReturn=AE,d.countedLoopBodyActionDescriptorAnyDynamicReturnParentRef=DE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Ql,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=gE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=RE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=bE,d.createDefinitionEntityFromJSONObject=dl,d.createEntityError=Q,d.createNestedDataTypeForEntity=wS,d.createNewInstanceOperation=yr,d.createNewInstanceOperationEntityToInstanciateArgument=Ff,d.createNewInstanceOperationEntityToInstanciateArgumentRef=Lf,d.createNewInstanceOperationEntityToInstanciateDataType=Gf,d.createNewInstanceOperationError=kf,d.createNewInstanceOperationErrorParentRef=jf,d.createNewInstanceOperationNewEntityDataArgument=Nf,d.createNewInstanceOperationNewEntityDataArgumentDataType=Vf,d.createNewInstanceOperationNewEntityDataArgumentDataTypeParentRef=_f,d.createNewInstanceOperationNewEntityDataArgumentParentRef=Mf,d.createNewInstanceOperationOutputEntityDeclaration=xf,d.createNewInstanceOperationOutputEntityDeclarationParentRef=Uf,d.createNewInstanceOperationRef=$f,d.createSemanticId=de,d.createStateFromGenerationTargetType=Hq,d.createStateFromType=ke,d.createStateFromTypeAndSubscribe=b,d.cronJobBuiltInBaseEntity=ws,d.cronJobBuiltInBaseEntityExpressionProperty=zR,d.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=ZO,d.cronJobBuiltInBaseEntityExpressionPropertyRef=YR,d.cronJobBuiltInBaseEntityRef=HR,d.cronJobTriggeredFunctionDeclarationBlueprint=yd,d.cronJobTriggeredFunctionDeclarationBlueprintParentRef=JR,d.dataTypeCompatibilityToErrorExplanation=OS,d.datePrototype=on,d.dateValueAutogenerationSchema=Cc,d.definitionEntityToZodSchema=_g,d.deletePersistedEntityMethod=pd,d.deletePersistedEntityMethodParentRef=wR,d.deleteRootProject=DJ,d.endpointBuiltInBaseEntity=ia,d.endpointBuiltInBaseEntityRef=BE,d.endpointBuiltInBaseEntityRefFour=pR,d.endpointBuiltInBaseEntityRefThree=UE,d.endpointBuiltInBaseEntityRefTwo=LE,d.endpointBuiltInCorsProperty=ME,d.endpointBuiltInCorsPropertyDataType=wE,d.endpointBuiltInCorsPropertyDataTypeRef=PE,d.endpointBuiltInCorsPropertyRef=CE,d.endpointBuiltInMethodProperty=td,d.endpointBuiltInMethodPropertyDataType=FE,d.endpointBuiltInMethodPropertyDataTypeRef=GE,d.endpointBuiltInMethodPropertyRef=$E,d.endpointBuiltInPathProperty=ed,d.endpointBuiltInPathPropertyDataType=NE,d.endpointBuiltInPathPropertyDataTypeRef=_E,d.endpointBuiltInPathPropertyRef=VE,d.endpointPathParamsArgumentDeclaration=rd,d.endpointPathParamsArgumentDeclarationRef=ZE,d.endpointPathParamsVariableDataType=KE,d.endpointPathParamsVariableDataTypeRef=zE,d.endpointReachedTriggerActionDescriptor=dd,d.endpointReachedTriggerActionDescriptorRef=XE,d.endpointReachedTriggerActionDescriptorRefFour=tR,d.endpointReachedTriggerActionDescriptorRefThree=eR,d.endpointReachedTriggerActionDescriptorRefTwo=QE,d.endpointRequestBodyArgumentDeclaration=ad,d.endpointRequestBodyArgumentDeclarationRef=qE,d.endpointRequestBodyVariableDataType=JE,d.endpointRequestHeadersArgumentDeclaration=nd,d.endpointRequestHeadersArgumentDeclarationRef=jE,d.endpointRequestHeadersVariableDataType=kE,d.endpointRequestHeadersVariableDataTypeRef=xE,d.endpointRequestQueryParamsArgumentDeclaration=id,d.endpointRequestQueryParamsArgumentDeclarationRef=YE,d.endpointRequestQueryParamsVariableDataType=HE,d.endpointRequestQueryParamsVariableDataTypeRef=WE,d.endpointResponseBodyDataType=cR,d.endpointResponseBodyReturnDeclaration=ld,d.endpointResponseBodyReturnDeclarationRef=dR,d.endpointResponseCodeDataType=rR,d.endpointResponseCodeReturnDeclaration=sd,d.endpointResponseCodeReturnDeclarationRef=nR,d.endpointResponseHeadersDataType=oR,d.endpointResponseHeadersDataTypeRef=aR,d.endpointResponseHeadersReturnDeclaration=od,d.endpointResponseHeadersReturnDeclarationRef=sR,d.endpointReturnStatementRef=iR,d.endpointReturnStatementRefThree=uR,d.endpointReturnStatementRefTwo=lR,d.enrichFromKnownEntities=rs,d.enumOptionsProperty=Op,d.enumOptionsPropertyDataType=Ap,d.enumOptionsPropertyDataTypeRef=Ip,d.enumOptionsPropertyRef=Dp,d.enumPrototype=Sn,d.enumPrototypeRef=Sp,d.executionBuiltInBaseEntity=Bs,d.executionBuiltInEntityAbortMethod=hd,d.executionBuiltInEntityAbortMethodParentRef=ZR,d.filterOutDuplicateEntities=m,d.filterOutDuplicateErrors=N9,d.findEntityFromKeys=Qu,d.findReferenceToSelfInList=JS,d.findReferencesToSelfInProject=Cq,d.flattenActionDescriptor=YS,d.flattenArgumentDeclaration=HS,d.flattenBreakStatement=zS,d.flattenBuiltInBaseEntity=ZS,d.flattenCalls=bn,d.flattenCanvasAncestorsUntil=cl,d.flattenCondition=KS,d.flattenContinueStatement=XS,d.flattenDataType=eO,d.flattenDefinitionEntity=QS,d.flattenDefinitionEntityExtensionAndImplementationTypes=lp,d.flattenDefinitionEntityExtensionTypes=ml,d.flattenDefinitionEntityExtensions=sp,d.flattenDefinitionEntityImplementations=op,d.flattenDefinitionEntityImplementionTypes=fl,d.flattenDerivedCanvasEntities=Nt,d.flattenDetachedBranch=CO,d.flattenElementCalls=Ue,d.flattenElementCallsOnTheSameScope=Pq,d.flattenEntity=O,d.flattenFunctionCall=tO,d.flattenFunctionDeclaration=nO,d.flattenGlobalEvent=rO,d.flattenInputMap=iO,d.flattenInstalledProject=aO,d.flattenInternalCall=sO,d.flattenLiteralValue=oO,d.flattenLoop=lO,d.flattenOperation=dO,d.flattenOutputMap=cO,d.flattenPrimitiveEntity=uO,d.flattenProject=pO,d.flattenProjectElements=qS,d.flattenProperty=yO,d.flattenRelatedCanvasElementsOnTheLeft=AO,d.flattenRelatedCanvasElementsOnTheRight=DO,d.flattenReturnDeclaration=hO,d.flattenReturnStatement=fO,d.flattenSearch=mO,d.flattenValueDescriptor=TO,d.flattenVariableDeclaration=EO,d.flattenVariableInstance=RO,d.flattenVariableReads=kS,d.flattenVariableWrites=jS,d.flattenVariables=Se,d.fromZodParseToEntityGenerationErrors=xu,d.generate=HC,d.generateActionExample=pq,d.generateExecutionDataType=g7,d.generateIdFromStrategy=Ye,d.generateMutablePropertiesExplanation=el,d.generateRandomBoolean=ab,d.generateRandomDate=Gg,d.generateRandomDateAfter=Vg,d.generateRandomDateBefore=Ng,d.generateRandomDateBetweenRange=Lg,d.generateRandomNumber=eb,d.generateRandomNumberAfter=Kg,d.generateRandomNumberBefore=Xg,d.generateRandomNumberBetweenRange=Qg,d.generateRandomText=ib,d.generateRandomTextAfter=tb,d.generateRandomTextBefore=nb,d.generateRandomTextBetweenRange=rb,d.generateUniqueUUID=Zg,d.getAllActionDescriptorsForConditions=ol,d.getAllActionDescriptorsForGlobalEvents=al,d.getAllActionDescriptorsForLoops=sl,d.getAllActionDescriptorsForOperations=mq,d.getAllBuiltInEntityIds=ip,d.getAllGloballyDeclaredFunctionDeclarationsExplanation=DS,d.getBaseBuiltInEntities=cr,d.getBaseSchemaBasedOnType=mS,d.getBuiltInEntityOwner=ur,d.getCallableEntityReferenceSchema=at,d.getCallableEntityTypeSchema=qD,d.getCalledBy=qt,d.getCallerEntityReferenceSchema=U3,d.getCallerEntityTypeSchema=F3,d.getCalls=np,d.getCanvasEntitiesDerivedFromInternalCalls=IO,d.getCanvasEntitiesDerivedFromWrites=Hi,d.getCanvasEntityDerivedFromValueReadingEntity=hl,d.getCanvasEntityDerivedFromValueReadingEntityFromTransfer=vO,d.getCanvasEntityReferenceSchema=r5,d.getCanvasEntityTypeSchema=n5,d.getChildrenEntityWithValues=vq,d.getColumnProperties=kq,d.getCommonAncestor=tp,d.getCommonChildren=BS,d.getDatabaseEntities=xq,d.getDatabaseEntity=qq,d.getDeclaration=Fr,d.getDeepestScope=MO,d.getDefinitionEntityExtends=zi,d.getDraggableCallableEntityReferenceSchema=WD,d.getDraggableCallableEntityTypeSchema=JD,d.getDraggableCallerEntityReferenceSchema=j3,d.getDraggableCallerEntityTypeSchema=x3,d.getDraggableExecutableEntityReferenceSchema=W3,d.getDraggableExecutableEntityTypeSchema=J3,d.getDraggablePassThroughCallableEntityReferenceSchema=Uo,d.getDraggablePassThroughCallableEntityTypeSchema=Fo,d.getDraggablePlayableEntityReferenceSchema=K3,d.getDraggablePlayableEntityTypeSchema=Z3,d.getEntityArgumentDeclarations=ap,d.getEntityInputMaps=gO,d.getEntityOutputMaps=Mq,d.getEntityReferenceSchema=t5,d.getEntityReturnDeclarations=bO,d.getEntityTypeSchema=e5,d.getEntityWithLogicScopeReferenceSchema=Gn,d.getEntityWithLogicScopeTypeSchema=Y3,d.getEntityWithValueReferenceSchema=kD,d.getEntityWithValueTypeSchema=$3,d.getEntryPointEntityReferenceSchema=nt,d.getEntryPointEntityTypeSchema=rr,d.getEventEntityReferenceSchema=Go,d.getEventEntityTypeSchema=Lo,d.getExecutableEntityReferenceSchema=q3,d.getExecutableEntityTypeSchema=k3,d.getExtendedBuiltInEntity=_q,d.getExtendedDefinitionEntity=dp,d.getGenerationTargetSchemaBasedOnType=TS,d.getHeadIfPartOfDetachedBranch=PO,d.getHighestScope=BO,d.getImplementedBuiltInEntity=Vq,d.getIsInteractive=cp,d.getLastInListOperation=Ll,d.getLastInListOperationError=Nh,d.getLastInListOperationErrorParentRef=Vh,d.getLastInListOperationInputListArgument=Bh,d.getLastInListOperationInputListArgumentParentRef=wh,d.getLastInListOperationInputListArgumentRef=Sh,d.getLastInListOperationInputListDataType=Oh,d.getLastInListOperationOutputElementDataType=Ch,d.getLastInListOperationOutputElementReturn=_h,d.getLastInListOperationOutputElementReturnParentRef=Mh,d.getLastInListOperationOutputElementReturnRef=Ph,d.getLinkedEntitiesFromArgumentDeclaration=Oq,d.getLowestPersistedEntityImplementation=SO,d.getParentCallableEntity=MS,d.getParentCallerEntity=VS,d.getParentCanvasEntities=Ot,d.getParentCanvasEntity=lt,d.getParentCanvasEntityFromTransfer=ul,d.getParentEntryPoint=bq,d.getParentPassthroughCallableEntity=_S,d.getPassThroughCallableEntityReferenceSchema=$e,d.getPassThroughCallableEntityTypeSchema=$o,d.getPeristedEntities=Uq,d.getPlayableEntityReferenceSchema=z3,d.getPlayableEntityTypeSchema=H3,d.getProject=IJ,d.getPrototypeByType=Tl,d.getReferenceEntityId=A,d.getReferencedEntitiesStateOrErrors=nl,d.getReferencedEntityStateOrErrors=ju,d.getRelatedCanvasElementsOnTheLeft=Qr,d.getRelatedCanvasElementsOnTheLeftFromTransfer=WS,d.getRelatedCanvasElementsOnTheRight=dr,d.getRootEntryPointScopeOwner=yp,d.getScopeOwner=Pt,d.getTerminationReferenceSchema=Q3,d.getTerminationTypeSchema=X3,d.getUpstreamDependencyIds=yl,d.getUsedArgFromDeclaration=wq,d.getUsedReturnFromDeclaration=Bq,d.getValueReadingEntityReferenceSchema=jD,d.getValueReadingEntityTypeSchema=Ln,d.getValueWritingEntityReferenceSchema=G3,d.getValueWritingEntityTypeSchema=ka,d.getVariableFromInputMapping=LS,d.getVariableFromReturnVariablePointer=FS,d.getVariableReferenceSchema=nr,d.getVariableTypeSchema=_r,d.getVariablesFromArgumentDeclarations=pl,d.getVariablesFromInputMaps=GS,d.getVariablesFromOutputMapping=US,d.getVariablesFromOutputMaps=xS,d.getVariablesFromReturnDeclarations=$S,d.getVariablesInSameOrHigherScope=Vu,d.getWrites=rp,d.groupCallsBasedOnParallelizableExecution=Dq,d.handleAfterEntityImplementationSideEffects=CS,d.handleBeforeEntityImplementationSideEffects=PS,d.httpRequestBodyArgument=Ts,d.httpRequestBodyArgumentRef=fm,d.httpRequestBodyDataType=mm,d.httpRequestHeadersArgument=ms,d.httpRequestHeadersArgumentRef=ym,d.httpRequestHeadersDataType=hm,d.httpRequestMethodArgument=hs,d.httpRequestMethodArgumentRef=um,d.httpRequestMethodDataType=pm,d.httpRequestMethodDataTypeRef=dm,d.httpRequestOperation=Xi,d.httpRequestOperationErrorValueDescriptor=ql,d.httpRequestOperationErrorValueDescriptorDatatype=Nm,d.httpRequestOperationErrorValueDescriptorRef=Vm,d.httpRequestOperationRef=wm,d.httpRequestOperationRefEight=Mm,d.httpRequestOperationRefFive=Pm,d.httpRequestOperationRefFour=Om,d.httpRequestOperationRefNine=_m,d.httpRequestOperationRefSeven=Bm,d.httpRequestOperationRefSix=Cm,d.httpRequestOperationRefThree=Sm,d.httpRequestOperationRefTwo=Am,d.httpRequestQueryParamsArgument=kl,d.httpRequestQueryParamsArgumentRef=om,d.httpRequestQueryParamsDataType=lm,d.httpRequestVariableURLArgument=fs,d.httpRequestVariableURLArgumentRef=am,d.httpRequestVariableURLDataType=sm,d.httpRequestVariableURLDataTypeRef=rm,d.httpResponseBodyReturnDataType=Dm,d.httpResponseBodyReturnDataTypeRef=vm,d.httpResponseBodyReturnReturn=gs,d.httpResponseBodyReturnReturnRef=Im,d.httpResponseCodeDataType=Em,d.httpResponseCodeReturn=Es,d.httpResponseCodeReturnRef=Tm,d.httpResponseHeadersDataType=bm,d.httpResponseHeadersDataTypeRef=Rm,d.httpResponseHeadersReturn=Rs,d.httpResponseHeadersReturnRef=gm,d.implement=ll,d.inferArgumentDeclarationDataType=iS,d.inferDataType=Rn,d.inferInputMapDataType=Bu,d.inferOutputMapDataType=_u,d.inferPropertyDataType=oS,d.inferReturnDeclarationDataType=Mu,d.inferValueDescriptorDataType=lS,d.inferVariableDeclarationDataType=sS,d.inferVariableInstanceDataType=aS,d.initBaseProjectEntity=fp,d.initProject=FO,d.isPromise=Ku,d.iterateOverListActionDescriptorListArgumentDeclaration=fT,d.iterateOverListActionDescriptorListArgumentDeclarationDataType=yT,d.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=pT,d.iterateOverListActionDescriptorListArgumentDeclarationParentRef=hT,d.iterateOverListLoopActionDescriptor=Jn,d.iterateOverListLoopActionDescriptorDynamicReturnDeclaration=TT,d.iterateOverListLoopActionDescriptorDynamicReturnDeclarationParentRef=mT,d.iterateOverListLoopBodyActionDescriptor=ta,d.iterateOverListLoopBodyActionDescriptorAnyDynamicArgument=ST,d.iterateOverListLoopBodyActionDescriptorAnyDynamicArgumentParentRef=AT,d.iterateOverListLoopBodyActionDescriptorAnyDynamicReturn=PT,d.iterateOverListLoopBodyActionDescriptorAnyDynamicReturnParentRef=OT,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Ds,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=RT,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=ET,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=gT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclaration=DT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=vT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=bT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=IT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclaration=_T,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataType=BT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataTypeParentRef=wT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationParentRef=MT,d.iterateOverObjectKeysLoopActionDescriptor=li,d.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclaration=NT,d.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclarationParentRef=VT,d.iterateOverObjectKeysLoopBodyActionDescriptor=zl,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgument=qT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgumentParentRef=kT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturn=WT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturnParentRef=JT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Hl,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=GT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=LT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=$T,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclaration=jT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=UT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=FT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=xT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclaration=KT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataType=zT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataTypeParentRef=HT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationParentRef=ZT,d.iterateOverObjectValuesLoopActionDescriptor=di,d.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclaration=QT,d.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclarationParentRef=XT,d.iterateOverObjectValuesLoopBodyActionDescriptor=Kl,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgument=lE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgumentParentRef=oE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturn=cE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturnParentRef=dE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Zl,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=tE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=eE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=nE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclaration=sE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=iE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=rE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=aE,d.iterateOverStringActionDescriptorDynamicReturnDeclaration=eT,d.iterateOverStringActionDescriptorDynamicReturnDeclarationParentRef=Qm,d.iterateOverStringActionDescriptorStringArgumentDeclaration=Xm,d.iterateOverStringActionDescriptorStringArgumentDeclarationDataType=Zm,d.iterateOverStringActionDescriptorStringArgumentDeclarationDataTypeParentRef=zm,d.iterateOverStringActionDescriptorStringArgumentDeclarationParentRef=Km,d.iterateOverStringLoopActionDescriptor=ea,d.iterateOverStringLoopBodyActionDescriptor=Is,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgument=lT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgumentParentRef=oT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturn=cT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturnParentRef=dT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Wl,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=nT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=tT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=rT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Yl,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=aT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=iT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=sT,d.joinListOperation=_l,d.joinListOperationError=ah,d.joinListOperationErrorParentRef=ih,d.joinListOperationFirstListArgument=Qy,d.joinListOperationFirstListArgumentParentRef=Xy,d.joinListOperationFirstListArgumentRef=Wy,d.joinListOperationFirstListDataType=Yy,d.joinListOperationResultListDataType=Ky,d.joinListOperationResultListReturn=rh,d.joinListOperationResultListReturnParentRef=nh,d.joinListOperationResultListReturnRef=Zy,d.joinListOperationSecondListArgument=th,d.joinListOperationSecondListArgumentParentRef=eh,d.joinListOperationSecondListArgumentRef=Hy,d.joinListOperationSecondListDataType=zy,d.joinListWithLastSeparator=q,d.joinStringsOperation=Ki,d.joinStringsOperationDynamicStringArgument=Ay,d.joinStringsOperationDynamicStringArgumentParentRef=Dy,d.joinStringsOperationDynamicStringArgumentRef=vy,d.joinStringsOperationDynamicStringDataType=Iy,d.joinStringsOperationError=by,d.joinStringsOperationErrorParentRef=gy,d.joinStringsOperationFirstStringArgument=us,d.joinStringsOperationFirstStringArgumentParentRef=uy,d.joinStringsOperationFirstStringArgumentRef=ay,d.joinStringsOperationFirstStringDataType=sy,d.joinStringsOperationResultStringDataType=cy,d.joinStringsOperationResultStringReturn=Zi,d.joinStringsOperationResultStringReturnParentRef=Ry,d.joinStringsOperationResultStringReturnRef=dy,d.joinStringsOperationSecondStringArgument=ps,d.joinStringsOperationSecondStringArgumentParentRef=Ey,d.joinStringsOperationSecondStringArgumentRef=oy,d.joinStringsOperationSecondStringDataType=ly,d.joinStringsOperationSeparatorStringArgument=Ty,d.joinStringsOperationSeparatorStringArgumentParentRef=my,d.joinStringsOperationSeparatorStringArgumentRef=py,d.joinStringsOperationSeparatorStringDataType=fy,d.joinStringsOperationSeparatorStringDataTypeDefaultValue=hy,d.joinStringsOperationSeparatorStringDataTypeDefaultValueParentRef=yy,d.keyValuePrototype=ai,d.lowercaseFirstLetter=zo,d.manualFlowActionDescriptorDeclarationArgumentDeclaration=Jl,d.manualFlowActionDescriptorDeclarationArgumentDeclarationDataType=jm,d.manualFlowActionDescriptorDeclarationArgumentDeclarationDataTypeParentRef=xm,d.manualFlowActionDescriptorDeclarationArgumentDeclarationParentRef=km,d.manualFlowLoopActionDescriptor=bs,d.manualFlowLoopActionDescriptorDynamicReturnDeclaration=Um,d.manualFlowLoopActionDescriptorDynamicReturnDeclarationParentRef=Fm,d.manualFlowLoopBodyActionDescriptor=vs,d.manualFlowLoopBodyActionDescriptorAnyDynamicArgument=Jm,d.manualFlowLoopBodyActionDescriptorAnyDynamicArgumentParentRef=qm,d.manualFlowLoopBodyActionDescriptorAnyDynamicReturn=Ym,d.manualFlowLoopBodyActionDescriptorAnyDynamicReturnParentRef=Wm,d.mapActionDescriptorToTypeItRepresents=Fq,d.mergeEntityErrorsList=L9,d.mergeListOfEntities=Lq,d.methodDefaultValue=cm,d.mockClientProject=gD,d.moreThanOrEqualCondition=hi,d.moreThanOrEqualConditionLeftHandArgument=ig,d.moreThanOrEqualConditionLeftHandArgumentDataType=ng,d.moreThanOrEqualConditionLeftHandArgumentDataTypeParentRef=tg,d.moreThanOrEqualConditionLeftHandArgumentParentRef=rg,d.moreThanOrEqualConditionRightHandArgument=lg,d.moreThanOrEqualConditionRightHandArgumentDataType=sg,d.moreThanOrEqualConditionRightHandArgumentDataTypeParentRef=ag,d.moreThanOrEqualConditionRightHandArgumentParentRef=og,d.notEmptyCondition=Rr,d.notEmptyConditionArgument=QR,d.notEmptyConditionRef=XR,d.nullPrototype=vp,d.numberAdditionOperation=cs,d.numberAdditionOperationDynamicSummandArgument=xp,d.numberAdditionOperationDynamicSummandArgumentType=Up,d.numberAdditionOperationDynamicSummandArgumentTypeParentRef=Fp,d.numberAdditionOperationError=$p,d.numberAdditionOperationErrorParentRef=Gp,d.numberAdditionOperationFirstNumberArgument=Sl,d.numberAdditionOperationFirstNumberArgumentRef=Cp,d.numberAdditionOperationFirstNumberDataType=wp,d.numberAdditionOperationRef=Np,d.numberAdditionOperationRefThree=Pl,d.numberAdditionOperationRefTwo=Lp,d.numberAdditionOperationResultNumberDataType=Vp,d.numberAdditionOperationResultNumberReturn=Cl,d.numberAdditionOperationResultNumberReturnRef=_p,d.numberAdditionOperationSecondNumberArgument=Ol,d.numberAdditionOperationSecondNumberArgumentRef=Bp,d.numberAdditionOperationSecondNumberDataType=Mp,d.numberPrototype=ee,d.numberSubtractionOperation=Bl,d.numberSubtractionOperationDynamicSubtrahendArgument=ry,d.numberSubtractionOperationDynamicSubtrahendArgumentType=ny,d.numberSubtractionOperationDynamicSubtrahendArgumentTypeParentRef=ty,d.numberSubtractionOperationError=ey,d.numberSubtractionOperationErrorParentRef=Qp,d.numberSubtractionOperationFirstNumberArgument=Hp,d.numberSubtractionOperationFirstNumberArgumentRef=jp,d.numberSubtractionOperationFirstNumberDataType=kp,d.numberSubtractionOperationRef=wl,d.numberSubtractionOperationRefThree=Kp,d.numberSubtractionOperationRefTwo=zp,d.numberSubtractionOperationResultNumberDataType=Yp,d.numberSubtractionOperationResultNumberReturn=Xp,d.numberSubtractionOperationResultNumberReturnRef=Wp,d.numberSubtractionOperationSecondNumberArgument=Zp,d.numberSubtractionOperationSecondNumberArgumentRef=qp,d.numberSubtractionOperationSecondNumberDataType=Jp,d.numberValueAutogenerationSchema=Pc,d.parallelExecutionOperation=Qt,d.parallelExecutionOperationError=lf,d.parallelExecutionOperationErrorParentRef=of,d.parallelExecutionOperationListOfExecutionResultsDataType=rf,d.parallelExecutionOperationListOfExecutionResultsReturn=Ul,d.parallelExecutionOperationListOfExecutionResultsReturnRef=nf,d.parallelExecutionOperationListOfFunctionsArgument=Fl,d.parallelExecutionOperationListOfFunctionsArgumentDatatype=tf,d.parallelExecutionOperationListOfFunctionsArgumentRef=ef,d.parallelExecutionOperationListOfFunctionsBlueprint=Qh,d.parallelExecutionOperationListOfFunctionsBlueprintDynamicInput=Xh,d.parallelExecutionOperationListOfFunctionsBlueprintDynamicOutput=Kh,d.parallelExecutionOperationRef=af,d.parallelExecutionOperationRefThree=sf,d.persistedBuiltInBaseEntity=st,d.persistedBuiltInBaseEntityDatabaseProperty=ui,d.persistedBuiltInBaseEntityDatabasePropertyDataType=_R,d.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=HO,d.persistedBuiltInBaseEntityDatabasePropertyParentRef=VR,d.persistedBuiltInBaseEntityDatabasePropertyRef=MR,d.persistedBuiltInBaseEntityPrimaryKeyProperty=pi,d.persistedBuiltInBaseEntityPrimaryKeyPropertyDataType=jR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOption=LR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOptionParentRef=NR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyParentRef=kR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyRef=xR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOption=$R,d.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOptionParentRef=GR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOption=UR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOptionParentRef=FR,d.processOutputGlobalValueDescriptorDataType=fg,d.processOutputGlobalValueDescriptorReturn=aa,d.processOutputGlobalValueDescriptorReturnRef=hg,d.projectPublicationCompletedGlobalEvent=Ms,d.propertyToZodSchema=Mg,d.relationalDatabaseBuiltInBaseEntity=cn,d.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=ud,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataType=PR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=OR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=CR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=SR,d.relationalDatabaseBuiltInBaseEntityDefaultProperty=cd,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataType=AR,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=IR,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=DR,d.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Ss,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataType=fR,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=yR,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=hR,d.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Cs,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataType=vR,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=gR,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=bR,d.relationalDatabaseBuiltInBaseEntityPasswordProperty=Ps,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataType=RR,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=YO,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=ER,d.relationalDatabaseBuiltInBaseEntityRef=ci,d.relationalDatabaseBuiltInBaseEntityUsernameProperty=Os,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataType=TR,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=WO,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=mR,d.resolveActionDescriptorName=hS,d.resolveBaseEntityName=cS,d.resolveBuiltInBaseEntityDataTypeLabel=uS,d.resolveClonedEntityProject=He,d.resolveConditionOperatorLabel=Xo,d.resolveDataType=Zo,d.resolveDataTypeEntityOrNestedChildrenFromLiteralValue=ep,d.resolveDataTypeLabel=Qa,d.resolveDefinitionEntityDataTypeLabel=A7,d.resolveEntityDataTypeLabel=D7,d.resolveEntityName=w,d.resolveFirstCallsSecond=Aq,d.resolveFirstWritesSecond=Sq,d.resolvePrimaryKeyProperty=jq,d.resolvePrimitiveEntityName=yS,d.resolveSearchName=pS,d.resolveVariableScope=b7,d.sequentialExecutionOperation=Cn,d.sequentialExecutionOperationError=Pf,d.sequentialExecutionOperationErrorParentRef=Of,d.sequentialExecutionOperationListOfExecutionResultsDataType=Df,d.sequentialExecutionOperationListOfExecutionResultsReturn=jl,d.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Sf,d.sequentialExecutionOperationListOfExecutionResultsReturnRef=If,d.sequentialExecutionOperationListOfFunctionsArgument=xl,d.sequentialExecutionOperationListOfFunctionsArgumentDatatype=vf,d.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Af,d.sequentialExecutionOperationListOfFunctionsArgumentRef=bf,d.sequentialExecutionOperationListOfFunctionsBlueprint=gf,d.sequentialExecutionOperationListOfFunctionsBlueprintDynamicInput=Rf,d.sequentialExecutionOperationListOfFunctionsBlueprintDynamicOutput=Ef,d.softDeletePersistedEntityMethod=zO,d.softDeletePersistedEntityMethodParentRef=qR,d.sortCallsBasedOnExecutionDependencies=NS,d.sortChildrenEntitiesBasedOnExecutionDependencies=Iq,d.splitListOperation=Nl,d.splitListOperationError=Ih,d.splitListOperationErrorParentRef=vh,d.splitListOperationFirstOutputListDataType=ph,d.splitListOperationFirstOutputListReturn=Eh,d.splitListOperationFirstOutputListReturnParentRef=Th,d.splitListOperationFirstOutputListReturnRef=Vl,d.splitListOperationInputListArgument=hh,d.splitListOperationInputListArgumentParentRef=yh,d.splitListOperationInputListArgumentRef=lh,d.splitListOperationInputListDataType=dh,d.splitListOperationSecondOutputListDataType=Rh,d.splitListOperationSecondOutputListReturn=bh,d.splitListOperationSecondOutputListReturnParentRef=gh,d.splitListOperationSplitIndexArgument=mh,d.splitListOperationSplitIndexArgumentParentRef=fh,d.splitListOperationSplitIndexArgumentRef=ch,d.splitListOperationSplitIndexDataType=uh,d.splitStringOperation=Ml,d.splitStringOperationError=jy,d.splitStringOperationErrorParentRef=xy,d.splitStringOperationFirstPartResultStringDataType=By,d.splitStringOperationFirstPartResultStringReturn=Uy,d.splitStringOperationFirstPartResultStringReturnParentRef=Fy,d.splitStringOperationFirstPartResultStringReturnRef=wy,d.splitStringOperationIndexArgument=Gy,d.splitStringOperationIndexArgumentParentRef=Ly,d.splitStringOperationIndexArgumentRef=Py,d.splitStringOperationIndexDataType=Cy,d.splitStringOperationSecondPartResultStringDataType=_y,d.splitStringOperationSecondPartResultStringReturn=qO,d.splitStringOperationSecondPartResultStringReturnParentRef=$y,d.splitStringOperationSecondPartResultStringReturnRef=My,d.splitStringOperationStringArgument=Ny,d.splitStringOperationStringArgumentParentRef=Vy,d.splitStringOperationStringArgumentRef=Sy,d.splitStringOperationStringDataType=Oy,d.stringPrototype=J,d.stringValueAutogenerationSchema=Oc,d.suggestNewIdForEntity=Uu,d.test_primitive_entities_export=AJ,d.toCamelCase=v7,d.toEntityState=Lt,d.toKebabCase=dS,d.toLowerCaseKebabCase=Ko,d.toPascalCase=I7,d.untypedDataPrototype=it,d.updateErrorsList=Me,d.updateValueReader=Gq,d.urlDefaultValue=im,d.uuidPrototype=On,d.validateArgumentDeclarationName=$u,d.validateCalledByErrorIdInAction=hq,d.validateCalledByIdInAction=yq,d.validateCallers=IS,d.validateConditionEntityDeclaration=Tq,d.validateDataOperation=hr,d.validateDataOperationDataToValidateArgument=Yf,d.validateDataOperationDataToValidateArgumentParentRef=Wf,d.validateDataOperationDataToValidateArgumentRef=qf,d.validateDataOperationDataToValidateDataType=Jf,d.validateDataOperationEntityToMatchTypeArgument=Kf,d.validateDataOperationEntityToMatchTypeArgumentParentRef=Zf,d.validateDataOperationEntityToMatchTypeArgumentRef=Hf,d.validateDataOperationEntityToMatchTypeDataType=zf,d.validateDataOperationError=tm,d.validateDataOperationErrorParentRef=em,d.validateDataOperationOutputEntityDeclaration=Qf,d.validateDataOperationOutputEntityDeclarationParentRef=Xf,d.validateDefinitionEntityName=Qo,d.validateEntryCaller=vS,d.validateErrorCaller=bS,d.validateFunctionCallDeclaration=AS,d.validateFunctionDeclarationName=Nu,d.validateGeneratedEntityParentIsNotBuiltInEntity=dq,d.validateGeneration=oq,d.validateGenerationTarget=je,d.validateGenerationUpdate=lq,d.validateLoopEntityDeclaration=Eq,d.validateName=S7,d.validateOperationEntityDeclaration=SS,d.validatePropertyName=Gu,d.validateReachability=jn,d.validateReadsValueInActionPayload=fq,d.validateReferenceObject=tl,d.validateReferenceToOne=ku,d.validateReferences=tt,d.validateReturnDeclarationName=Fu,d.validateSuccessCaller=gS,d.validateValueReaderGenerationUpdate=ts,d.validateValueWritter=zu,d.validateVariableDeclarationName=Lu,d.validateVariableInternalCallUse=Zu,d.valueAutogenerationCurrentDateAndTimeSchema=vD,d.valueAutogenerationGenericSchema=bo,d.valueAutogenerationOptions=wc,d.valueAutogenerationOptionsSchema=bD,d.valueAutogenerationRandomBooleanSchema=Sc,d.valueAutogenerationRandomDateBetweenSchema=BD,d.valueAutogenerationRandomDateFromSchema=CD,d.valueAutogenerationRandomDateSchema=Do,d.valueAutogenerationRandomDateUntilSchema=wD,d.valueAutogenerationRandomNumberBetweenSchema=AD,d.valueAutogenerationRandomNumberFromSchema=ID,d.valueAutogenerationRandomNumberSchema=vo,d.valueAutogenerationRandomNumberUntilSchema=DD,d.valueAutogenerationRandomSchema=La,d.valueAutogenerationRandomTextBetweenSchema=PD,d.valueAutogenerationRandomTextFromSchema=SD,d.valueAutogenerationRandomTextSchema=Io,d.valueAutogenerationRandomTextUntilSchema=OD,d.valueAutogenerationRangeValueTypesSchema=Na,d.valueAutogenerationUniqueSchema=Ac,d.waitOperation=Rt,d.waitOperationMillisecondsNumberArgument=pr,d.waitOperationMillisecondsNumberArgumentRef=uf,d.waitOperationMillisecondsNumberDataType=pf,d.waitOperationOperationError=ff,d.waitOperationOperationErrorParentRef=hf,d.waitOperationRef=yf,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
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=>{I5(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)}),D5(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 Ae.repository.load(this.id,...t),this}async create(e=V,...t){return await Ae.repository.create(this.toShallowJSON(),...t),this}async update(e=V,...t){return await Ae.repository.update(this.toShallowJSON(),...t),this}async delete(e=V,...t){return await Ae.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=v5(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,M.UUID.uuid(),n));u.properties=h;const f=(I=this.methods)==null?void 0:I.map((S,x)=>S.clone(u,p+"-method-"+x+"-id",n));u.methods=f;const R=(D=this.abstractMethods)==null?void 0:D.map((S,x)=>S.clone(u,p+"-abstract-method-"+x+"-id",n));return u.abstractMethods=R,u}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return ll(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=Fr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),u=Rn(p),h=u==null?void 0:u.clone(o,M.UUID.uuid(),!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=Fr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),D=Rn(I),S=D==null?void 0:D.clone(o,M.UUID.uuid(),!0);S&&o.setDataType(S)}return}const l={id:M.UUID.uuid(),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=Fr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),f=Rn(h),R=f==null?void 0:f.clone(p,M.UUID.uuid(),!0);return R&&p.setDataType(R),this.addProperty(p),s.setDeclaration(p),p}),this)}};c(Ae,"repository",{create:async(e,...t)=>e,update:async(e,...t)=>e,delete:async(e,...t)=>{},load:async(e,...t)=>null}),c(Ae,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),c(Ae,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ae,"BASE_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"MUTABLE_META_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ae,"INMUTABLE_META_PROPERTIES",[...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"META_PROPERTIES",[...Ae.MUTABLE_META_PROPERTIES,...Ae.INMUTABLE_META_PROPERTIES]),c(Ae,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),c(Ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ae,"UPSTREAM_PROPERTIES",[...Ae.MUTABLE_UPSTREAM_PROPERTIES,...Ae.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),c(Ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ae,"DOWNSTREAM_PROPERTIES",[...Ae.MUTABLE_DOWNSTREAM_PROPERTIES,...Ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ae,"PROPERTIES",[...Ae.META_PROPERTIES,...Ae.UPSTREAM_PROPERTIES,...Ae.DOWNSTREAM_PROPERTIES]);let ei=Ae;function Wq(r){const e=Q9(),t=r.toJSON();e.safeParse(t).success;const a=[];return Me(r.errors,a)}const ss=class ss{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 ss.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=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}implement(e,t){return ll(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 ss&&e.push(...n.getAllInteractiveMethods())})),m(e)}};c(ss,"repository",{load:async(e,...t)=>null});let vn=ss;function Yq(r){const e=q9(),t=r.toJSON();e.safeParse(t).success;const a=[];return Me(r.errors,a)}const bl=class bl{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 bl.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=Yq(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 vn&&e.push(...n.getAllInteractiveMethods())}),m(e)}};c(bl,"repository",{load:async(e,...t)=>null});let Kt=bl;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 xr(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 Ur(r,e);case i.FunctionCall:return t||new Xr(r,e);case i.Condition:return t||new qr(r,e);case i.Operation:return t||new jr(r,e);case i.VariableDeclaration:return t||new Jr(r,e);case i.VariableInstance:return t||new Wr(r,e);case i.OutputMap:return t||new xn(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 Un(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 kr(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 vn(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 Hq(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 xr.fromGenerationTarget(r,e);case i.GlobalEvent:return qi.fromGenerationTarget(r,e);case i.DataType:return ki.fromGenerationTarget(r,e);case i.Property:return Ur.fromGenerationTarget(r,e);case i.FunctionCall:return Xr.fromGenerationTarget(r,e);case i.Condition:return qr.fromGenerationTarget(r,e);case i.Operation:return jr.fromGenerationTarget(r,e);case i.VariableDeclaration:return Jr.fromGenerationTarget(r,e);case i.VariableInstance:return Wr.fromGenerationTarget(r,e);case i.OutputMap:return xn.fromGenerationTarget(r,e);case i.ReturnDeclaration:return kt.fromGenerationTarget(r,e);case i.ArgumentDeclaration:return zr.fromGenerationTarget(r,e);case i.InputMap:return Un.fromGenerationTarget(r,e);case i.InstalledProject:return Hr.fromGenerationTarget(r,e);case i.ReturnStatement:return Zr.fromGenerationTarget(r,e);case i.Loop:return kr.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 _O{constructor(){c(this,"initialData")}}const V={cascade:!1},VO={load:async(r,...e)=>null},zq={create:async(r,...e)=>r,update:async(r,...e)=>r,delete:async(r,...e)=>{},...VO};class Zq{}class Kq extends _O{}class Xq{}class Qq{}class eJ{}class hp{}class tJ extends hp{}class nJ extends hp{}class rJ{}class kn{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 as{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 iJ{}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=ro==null?void 0:ro()),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=m5(),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=Se(n);return[...t,...a]},[]),...this.functionCalls.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.conditions.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.operations.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.loops.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[]),...this.searches.reduce((t,n)=>{const a=Se(n);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return m([...this.variableDeclarations,...this.getEntryPoints().reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,n)=>{const s=Se(n).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,n)=>{const s=Se(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===F.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 NO extends se{constructor(t){super(Qt,t);c(this,"id",Ne.Parallel);c(this,"name",Ne.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 LO 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 GO extends se{constructor(t){super(Cn,t);c(this,"id",Ne.Sequential);c(this,"name",Ne.Sequential);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",Cn);c(this,"type",i.ActionDescriptor);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"error",null);c(this,"project");this.project=t,this.inputs=Cn.inputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.outputs=Cn.outputs.map(n=>{const a=b(n,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Cn.error?b(Cn.error,this.project):null}}class aJ extends se{constructor(e){super(Xi,e)}}class sJ extends se{constructor(e){super(yr,e)}}class oJ extends se{constructor(t){super(hr,t);c(this,"autoexecutable",!0)}getEntityToMatchInputMap(t){return t.inputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Le.Validate].inputs.entityToMatch.id})||null}getDataToValidateInputMap(t){return t.inputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Le.Validate].inputs.dataToValidate.id})||null}getOutputDataOutputMap(t){return t.outputs.find(n=>{var a;return((a=n.declaration)==null?void 0:a.id)===_.operation[Le.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[Le.Validate].inputs.entityToMatch.id)return null;if(!t.dataType){const l={id:M.UUID.uuid(),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[Le.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:M.UUID.uuid(),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[Le.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:M.UUID.uuid(),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[Le.Validate].inputs.entityToMatch.id?this.syncEntityToMatchInputMapDataType(t):((a=t.declaration)==null?void 0:a.id)===_.operation[Le.Validate].inputs.dataToValidate.id?this.syncDataToValidateInputMapDataType(t):null}inferOutputMapDataType(t){var n;return((n=t.declaration)==null?void 0:n.id)===_.operation[Le.Validate].outputs.outputEntity.id?this.syncOutputDataOutputMapDataType(t):null}}class lJ extends se{constructor(e){super(_l,e)}}class dJ extends se{constructor(e){super(Nl,e)}}class cJ extends se{constructor(e){super(Ll,e)}}class uJ extends se{constructor(e){super(ps,e)}}class pJ extends se{constructor(e){super(ds,e)}}class yJ extends se{constructor(e){super(Ki,e)}}function hJ(r){const e=[new GO(r),new NO(r),new LO(r),new aJ(r),new sJ(r),new oJ(r),new uJ(r),new lJ(r),new cJ(r),new dJ(r),new pJ(r),new yJ(r),new se(Ml,r),new se(Bl,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}class $O extends vn{constructor(t){super(st,t);c(this,"initialData");c(this,"id",F.PERSISTED_ENTITY);c(this,"version",1);c(this,"name",F.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 fJ(r){const e=[new $O(r),new vn(ia,r),new vn(cn,r),new vn(Cs,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.builtInBaseEntities=e,e}function mJ(r){const e=[new Kt(J,r),new Kt(An,r),new Kt(ee,r),new Kt(it,r),new Kt(Sn,r),new Kt(on,r),new Kt(On,r),new Kt(ai,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.primitives=e,e}function TJ(r){const e=[new se(Bs,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.globalEventActionDescriptors=e,e}function EJ(r){const e=[new se(na,r),new se(Jn,r),new se(ea,r),new se(li,r),new se(di,r),new se(gs,r)];e.forEach(n=>{n.initChildren(),r.subscribeBuiltInInstance(n)}),r.loopDeclarations=e;const t=[new se(Ds,r),new se(ta,r),new se(vs,r),new se(zl,r),new se(Kl,r),new se(bs,r)];return t.forEach(n=>{n.initChildren(),r.subscribeBuiltInInstance(n)}),r.loopDeclarationsBodies=t,e}function RJ(r){const e=[new Kr(Ms,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.valueDescriptors=e,e}function gJ(r){const e=[new se(Rr,r),new se(hi,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}const ti={},gl={};async function bJ(r,e={}){const t={...gD};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 fp(r){const e=new M(r);return mJ(e),fJ(e),hJ(e),TJ(e),EJ(e),RJ(e),gJ(e),e.getAllBuiltIn().forEach(n=>{e.builtInInstances[n.id]||(e.builtInInstances[n.id]=n,delete e.instances[n.id])}),e}function vJ(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=fp(r.toShallowJSON({seenEntityMaps:e}));return new Xu(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 FO(r){const e=fp(r);return new Xu(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 IJ(r,e={}){if(r.id&&ti[r.id])return ti[r.id];if(r.id&&gl[r.id])return await gl[r.id],ti[r.id];const t=bJ(r,e);r.id&&(gl[r.id]=t);const n=await t;if(n.data){const a=FO(n.data);return ti[r.id]=a,r.id&&delete gl[r.id],a}return null}function DJ(r){return ti[r.id]&&delete ti[r.id],null}const AJ="test_primitive_entities_export";d.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=Hu,d.ALL_BUILT_IN_BASE_ENTITIES=KR,d.ALL_BUILT_IN_CONDITION_ENTITIES=ug,d.ALL_BUILT_IN_GLOBAL_EVENT_ENTITIES=yg,d.ALL_BUILT_IN_LOOP_BODY_ENTITIES=OE,d.ALL_BUILT_IN_LOOP_ENTITIES=SE,d.ALL_BUILT_IN_OPERATION_ENTITIES=$m,d.ALL_BUILT_IN_PRIMITIVE_ENTITIES=Pp,d.ALL_BUILT_IN_TOP_LEVEL_ENTITIES=Tg,d.ALL_BUILT_IN_VALUE_DESCRIPTORS=mg,d.ActionDescriptorState=se,d.ActionInputMapState=z7,d.ActionOutputMapState=X7,d.AppendToListOperationInputIds=Lh,d.AppendToListOperationOutputIds=Gh,d.ArgumentDeclarationState=zr,d.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=qu,d.BUILT_IN_BASE_ENTITY_IDS=_,d.BUILT_IN_ENTITY_TYPES=qn,d.BaseCanvasDraggableState=Xq,d.BaseEntityNames=F,d.BaseState=Kq,d.BaseValueDescriptorIds=ls,d.BreakStatementState=Yi,d.BuiltInBaseEntityState=vn,d.CACHED_PROJECTS_BY_ID=ti,d.CALLABLE_ENTITIES_EXPLANATION=cq,d.CALLABLE_TYPES=Xt,d.CALLER_ENTITIES_EXPLANATION=ES,d.CALLER_TYPES=sn,d.CALLS_UPDATE_EXPLANATION=or,d.COMPARISON_CONDITIONS=dg,d.CONDITIONS=cg,d.CUSTOM_ENTITY_OPERATIONS=nm,d.CallableEntityClass=eJ,d.CallerEntityClass=hp,d.ChildEntityState=Qq,d.ComparisonOperatorTypes=qe,d.ConditionState=qr,d.ContinueStatementState=St,d.CreateNewInputIds=wf,d.CreateNewOutputIds=Bf,d.DRAGGABLE_CALLABLE_TYPES=Al,d.DRAGGABLE_CALLER_TYPES=Rp,d.DRAGGABLE_ELEMENT_TYPES=os,d.DRAGGABLE_EXECUTABLE_TYPES=jO,d.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=Dl,d.DataTypeCompatibilityTypes=zt,d.DataTypeParentChildRelation=et,d.DataTypeState=ki,d.DefinitionEntityState=ei,d.EDITABLE_PERSISTANCE_REPOSITORY_DEFAULTS=zq,d.ENTITIES_WITH_VALLUES_EXPLANATION=rl,d.ENTITY_PERSISTANCE_OPTIONS_DEFAULTS=V,d.ENTITY_RECUSION_OPTIONS_DEFAULTS=L,d.ENTITY_TYPES=kO,d.ENTITY_WITH_DECLARATION_TYPES=UO,d.ENTITY_WITH_LOGIC_SCOPE_TYPES=pt,d.ENTITY_WITH_NAMES_TYPES=gp,d.ENTITY_WITH_PARENT_TYPES=Tp,d.ENTITY_WITH_USER_MANAGED_DECLARATION_TYPES=Il,d.ENTITY_WITH_USER_MANAGED_SINGLE_IMPLEMENTS_TYPES=Ep,d.ENTITY_WITH_VALUE_TYPES=mp,d.ENTRY_POINT_ENTITIES_EXPLANATION=Qa,d.ENTRY_POINT_TYPES=We,d.EVENT_TYPES=ii,d.EXECUTABLE_TYPES=xO,d.EXECUTION_OPERATIONS=Cf,d.EntityError=Pr,d.EntityErrorSeverity=E,d.EntityGenerationError=g,d.EntityGenerationErrorCode=T,d.EntityInstanceErrorCode=G,d.EntityOperations=Le,d.EntityType=i,d.EntityWithLogicScopeClass=iJ,d.EntityWithValueClass=rJ,d.EntryPointEntityClass=tJ,d.ExecutionOperations=Ne,d.ExecutionTerminationType=fS,d.FunctionCallState=Xr,d.FunctionDeclarationState=xr,d.GLOBAL_EVENT_DECLARATIONS=pg,d.GetLastInListOperationInputIds=Dh,d.GetLastInListOperationOutputIds=Ah,d.GlobalEventNames=In,d.GlobalEventState=qi,d.HTTPOperations=dt,d.HTTP_OPERATIONS=Lm,d.InputMapState=Un,d.InstalledProjectState=Hr,d.InternalCallState=Ji,d.JoinListOperationInputIds=qy,d.JoinListOperationOutputIds=Jy,d.LIST_OPERATIONS=Zh,d.ListOperations=X,d.LiteralValueState=Wi,d.LoopState=kr,d.LoopTypes=j,d.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=lr,d.NUMBER_OPERATIONS=iy,d.NumberOperations=Ge,d.OPERATION_DECLARATIONS=Gm,d.OperationState=jr,d.OutputMapParentChildRelation=ri,d.OutputMapState=xn,d.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=il,d.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=sr,d.PASS_THROUGH_CALLABLE_TYPES=Je,d.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=Yu,d.ParallelExecutionOperation=NO,d.PassThroughCallableEntityClass=nJ,d.PersistedEntity=$O,d.PersistedEntityMethods=Gt,d.PrimitiveEntityState=Kt,d.PrimitiveTypes=C,d.ProjectState=M,d.PropertyState=Ur,d.READ_ONLY_ENTITY_PERSISTANCE_REPOSITORY=VO,d.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=uq,d.ReturnDeclarationState=kt,d.ReturnStatementState=Zr,d.STANDALONE_CONDITIONS=eg,d.STRING_OPERATIONS=ky,d.ScopeCompatibilityType=Rl,d.SearchState=Yr,d.SequentialExecutionOperation=GO,d.SequentialExecutionOperationInputIds=mf,d.SequentialExecutionOperationOutputIds=Tf,d.SharedEntityErrorCode=B,d.SharedStateFunctionality=_O,d.SplitListOperationInputIds=sh,d.SplitListOperationOutputIds=oh,d.StandaloneOperatorTypes=Jt,d.StringOperations=re,d.TERMINATION_TYPES=xe,d.Traverser=Xu,d.USER_MANAGED_ENTITY_TYPES=bp,d.UserManagedEntityStateFunctionality=Zq,d.VALUE_READING_ENTITIES_EXPLANATION=Wu,d.VALUE_READING_TYPES=Dn,d.VALUE_WRITING_ENTITIES_EXPLANATION=RS,d.VALUE_WRITING_TYPES=Ze,d.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=Ju,d.VARIABLE_TYPES=Fe,d.ValueAutogenerationType=ze,d.ValueDescriptorParentChildRelation=P,d.ValueDescriptorState=Kr,d.ValueReadingEntityClass=kn,d.ValueWritingEntityClass=as,d.VariableDeclarationState=Jr,d.VariableInputMapState=H7,d.VariableInstanceState=Wr,d.VariableOutputMapState=K7,d.WaitOperation=LO,d.WaitOperationInputIds=df,d.WaitOperationOutputIds=cf,d.appendToListOperation=ps,d.appendToListOperationElementToAppendArgument=$l,d.appendToListOperationElementToAppendArgumentParentRef=Jh,d.appendToListOperationElementToAppendArgumentRef=Uh,d.appendToListOperationError=zh,d.appendToListOperationErrorParentRef=Hh,d.appendToListOperationListArgument=Gl,d.appendToListOperationListArgumentParentRef=qh,d.appendToListOperationListArgumentRef=$h,d.appendToListOperationListDataType=Fh,d.appendToListOperationResultListDataType=kh,d.appendToListOperationResultListReturn=Yh,d.appendToListOperationResultListReturnParentRef=Wh,d.appendToListOperationResultListReturnRef=jh,d.appendToListOperationSecondListDataType=xh,d.asGenerationActionExample=gn,d.booleanPrototype=An,d.capitalizeFirstLetter=Ho,d.checkAreDataTypesCompatible=Zt,d.checkAreDefinitionEntitiesCompatibleAsDataType=rS,d.checkArePropertiesCompatibleAsDataType=nS,d.checkIsBranchDependentButNotDirectlyOnBranch=ts,d.checkIsBranchDependentOnBranch=gq,d.checkIsCallableEntityReachable=is,d.checkIsCanvasEntity=$q,d.checkIsDetachedBranch=OO,d.checkIsDetachedBranchShallow=pp,d.checkIsGlobalVariable=Nq,d.checkIsGloballyDeclared=up,d.checkIsMethod=wO,d.checkIsNestedScope=El,d.checkScopeCompatibility=rs,d.cloneProject=vJ,d.countedLoopActionDescriptor=na,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=Ds,d.countedLoopBodyActionDescriptorAnyDynamicArgument=IE,d.countedLoopBodyActionDescriptorAnyDynamicArgumentParentRef=vE,d.countedLoopBodyActionDescriptorAnyDynamicReturn=AE,d.countedLoopBodyActionDescriptorAnyDynamicReturnParentRef=DE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Ql,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=gE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=RE,d.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=bE,d.createDefinitionEntityFromJSONObject=dl,d.createEntityError=Q,d.createNestedDataTypeForEntity=wS,d.createNewInstanceOperation=yr,d.createNewInstanceOperationEntityToInstanciateArgument=Ff,d.createNewInstanceOperationEntityToInstanciateArgumentRef=Lf,d.createNewInstanceOperationEntityToInstanciateDataType=Gf,d.createNewInstanceOperationError=kf,d.createNewInstanceOperationErrorParentRef=jf,d.createNewInstanceOperationNewEntityDataArgument=Nf,d.createNewInstanceOperationNewEntityDataArgumentDataType=Vf,d.createNewInstanceOperationNewEntityDataArgumentDataTypeParentRef=_f,d.createNewInstanceOperationNewEntityDataArgumentParentRef=Mf,d.createNewInstanceOperationOutputEntityDeclaration=xf,d.createNewInstanceOperationOutputEntityDeclarationParentRef=Uf,d.createNewInstanceOperationRef=$f,d.createSemanticId=de,d.createStateFromGenerationTargetType=Hq,d.createStateFromType=ke,d.createStateFromTypeAndSubscribe=b,d.cronJobBuiltInBaseEntity=Cs,d.cronJobBuiltInBaseEntityExpressionProperty=zR,d.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=ZO,d.cronJobBuiltInBaseEntityExpressionPropertyRef=YR,d.cronJobBuiltInBaseEntityRef=HR,d.cronJobTriggeredFunctionDeclarationBlueprint=yd,d.cronJobTriggeredFunctionDeclarationBlueprintParentRef=JR,d.dataTypeCompatibilityToErrorExplanation=OS,d.datePrototype=on,d.dateValueAutogenerationSchema=Cc,d.definitionEntityToZodSchema=_g,d.deletePersistedEntityMethod=pd,d.deletePersistedEntityMethodParentRef=wR,d.deleteRootProject=DJ,d.endpointBuiltInBaseEntity=ia,d.endpointBuiltInBaseEntityRef=BE,d.endpointBuiltInBaseEntityRefFour=pR,d.endpointBuiltInBaseEntityRefThree=UE,d.endpointBuiltInBaseEntityRefTwo=LE,d.endpointBuiltInCorsProperty=ME,d.endpointBuiltInCorsPropertyDataType=wE,d.endpointBuiltInCorsPropertyDataTypeRef=PE,d.endpointBuiltInCorsPropertyRef=CE,d.endpointBuiltInMethodProperty=td,d.endpointBuiltInMethodPropertyDataType=FE,d.endpointBuiltInMethodPropertyDataTypeRef=GE,d.endpointBuiltInMethodPropertyRef=$E,d.endpointBuiltInPathProperty=ed,d.endpointBuiltInPathPropertyDataType=NE,d.endpointBuiltInPathPropertyDataTypeRef=_E,d.endpointBuiltInPathPropertyRef=VE,d.endpointPathParamsArgumentDeclaration=rd,d.endpointPathParamsArgumentDeclarationRef=ZE,d.endpointPathParamsVariableDataType=KE,d.endpointPathParamsVariableDataTypeRef=zE,d.endpointReachedTriggerActionDescriptor=dd,d.endpointReachedTriggerActionDescriptorRef=XE,d.endpointReachedTriggerActionDescriptorRefFour=tR,d.endpointReachedTriggerActionDescriptorRefThree=eR,d.endpointReachedTriggerActionDescriptorRefTwo=QE,d.endpointRequestBodyArgumentDeclaration=ad,d.endpointRequestBodyArgumentDeclarationRef=qE,d.endpointRequestBodyVariableDataType=JE,d.endpointRequestHeadersArgumentDeclaration=nd,d.endpointRequestHeadersArgumentDeclarationRef=jE,d.endpointRequestHeadersVariableDataType=kE,d.endpointRequestHeadersVariableDataTypeRef=xE,d.endpointRequestQueryParamsArgumentDeclaration=id,d.endpointRequestQueryParamsArgumentDeclarationRef=YE,d.endpointRequestQueryParamsVariableDataType=HE,d.endpointRequestQueryParamsVariableDataTypeRef=WE,d.endpointResponseBodyDataType=cR,d.endpointResponseBodyReturnDeclaration=ld,d.endpointResponseBodyReturnDeclarationRef=dR,d.endpointResponseCodeDataType=rR,d.endpointResponseCodeReturnDeclaration=sd,d.endpointResponseCodeReturnDeclarationRef=nR,d.endpointResponseHeadersDataType=oR,d.endpointResponseHeadersDataTypeRef=aR,d.endpointResponseHeadersReturnDeclaration=od,d.endpointResponseHeadersReturnDeclarationRef=sR,d.endpointReturnStatementRef=iR,d.endpointReturnStatementRefThree=uR,d.endpointReturnStatementRefTwo=lR,d.enrichFromKnownEntities=ns,d.enumOptionsProperty=Op,d.enumOptionsPropertyDataType=Ap,d.enumOptionsPropertyDataTypeRef=Ip,d.enumOptionsPropertyRef=Dp,d.enumPrototype=Sn,d.enumPrototypeRef=Sp,d.executionBuiltInBaseEntity=ws,d.executionBuiltInEntityAbortMethod=hd,d.executionBuiltInEntityAbortMethodParentRef=ZR,d.filterOutDuplicateEntities=m,d.filterOutDuplicateErrors=N9,d.findEntityFromKeys=Qu,d.findReferenceToSelfInList=JS,d.findReferencesToSelfInProject=Cq,d.flattenActionDescriptor=YS,d.flattenArgumentDeclaration=HS,d.flattenBreakStatement=zS,d.flattenBuiltInBaseEntity=ZS,d.flattenCalls=bn,d.flattenCanvasAncestorsUntil=cl,d.flattenCondition=KS,d.flattenContinueStatement=XS,d.flattenDataType=eO,d.flattenDefinitionEntity=QS,d.flattenDefinitionEntityExtensionAndImplementationTypes=lp,d.flattenDefinitionEntityExtensionTypes=ml,d.flattenDefinitionEntityExtensions=sp,d.flattenDefinitionEntityImplementations=op,d.flattenDefinitionEntityImplementionTypes=fl,d.flattenDerivedCanvasEntities=Nt,d.flattenDetachedBranch=CO,d.flattenElementCalls=Ue,d.flattenElementCallsOnTheSameScope=Pq,d.flattenEntity=O,d.flattenFunctionCall=tO,d.flattenFunctionDeclaration=nO,d.flattenGlobalEvent=rO,d.flattenInputMap=iO,d.flattenInstalledProject=aO,d.flattenInternalCall=sO,d.flattenLiteralValue=oO,d.flattenLoop=lO,d.flattenOperation=dO,d.flattenOutputMap=cO,d.flattenPrimitiveEntity=uO,d.flattenProject=pO,d.flattenProjectElements=qS,d.flattenProperty=yO,d.flattenRelatedCanvasElementsOnTheLeft=AO,d.flattenRelatedCanvasElementsOnTheRight=DO,d.flattenReturnDeclaration=hO,d.flattenReturnStatement=fO,d.flattenSearch=mO,d.flattenValueDescriptor=TO,d.flattenVariableDeclaration=EO,d.flattenVariableInstance=RO,d.flattenVariableReads=kS,d.flattenVariableWrites=jS,d.flattenVariables=Se,d.fromZodParseToEntityGenerationErrors=xu,d.generate=HC,d.generateActionExample=pq,d.generateExecutionDataType=g7,d.generateIdFromStrategy=Ye,d.generateMutablePropertiesExplanation=el,d.generateRandomBoolean=ab,d.generateRandomDate=Gg,d.generateRandomDateAfter=Vg,d.generateRandomDateBefore=Ng,d.generateRandomDateBetweenRange=Lg,d.generateRandomNumber=eb,d.generateRandomNumberAfter=Kg,d.generateRandomNumberBefore=Xg,d.generateRandomNumberBetweenRange=Qg,d.generateRandomText=ib,d.generateRandomTextAfter=tb,d.generateRandomTextBefore=nb,d.generateRandomTextBetweenRange=rb,d.generateUniqueUUID=Zg,d.getAllActionDescriptorsForConditions=ol,d.getAllActionDescriptorsForGlobalEvents=al,d.getAllActionDescriptorsForLoops=sl,d.getAllActionDescriptorsForOperations=mq,d.getAllBuiltInEntityIds=ip,d.getAllGloballyDeclaredFunctionDeclarationsExplanation=DS,d.getBaseBuiltInEntities=cr,d.getBaseSchemaBasedOnType=mS,d.getBuiltInEntityOwner=ur,d.getCallableEntityReferenceSchema=at,d.getCallableEntityTypeSchema=qD,d.getCalledBy=qt,d.getCallerEntityReferenceSchema=U3,d.getCallerEntityTypeSchema=F3,d.getCalls=np,d.getCanvasEntitiesDerivedFromInternalCalls=IO,d.getCanvasEntitiesDerivedFromWrites=Hi,d.getCanvasEntityDerivedFromValueReadingEntity=hl,d.getCanvasEntityDerivedFromValueReadingEntityFromTransfer=vO,d.getCanvasEntityReferenceSchema=r5,d.getCanvasEntityTypeSchema=n5,d.getChildrenEntityWithValues=vq,d.getColumnProperties=kq,d.getCommonAncestor=tp,d.getCommonChildren=BS,d.getDatabaseEntities=xq,d.getDatabaseEntity=qq,d.getDeclaration=Fr,d.getDeepestScope=MO,d.getDefinitionEntityExtends=zi,d.getDraggableCallableEntityReferenceSchema=WD,d.getDraggableCallableEntityTypeSchema=JD,d.getDraggableCallerEntityReferenceSchema=j3,d.getDraggableCallerEntityTypeSchema=x3,d.getDraggableExecutableEntityReferenceSchema=W3,d.getDraggableExecutableEntityTypeSchema=J3,d.getDraggablePassThroughCallableEntityReferenceSchema=Uo,d.getDraggablePassThroughCallableEntityTypeSchema=Fo,d.getDraggablePlayableEntityReferenceSchema=K3,d.getDraggablePlayableEntityTypeSchema=Z3,d.getEntityArgumentDeclarations=ap,d.getEntityInputMaps=gO,d.getEntityOutputMaps=Mq,d.getEntityReferenceSchema=t5,d.getEntityReturnDeclarations=bO,d.getEntityTypeSchema=e5,d.getEntityWithLogicScopeReferenceSchema=Gn,d.getEntityWithLogicScopeTypeSchema=Y3,d.getEntityWithValueReferenceSchema=kD,d.getEntityWithValueTypeSchema=$3,d.getEntryPointEntityReferenceSchema=nt,d.getEntryPointEntityTypeSchema=rr,d.getEventEntityReferenceSchema=Go,d.getEventEntityTypeSchema=Lo,d.getExecutableEntityReferenceSchema=q3,d.getExecutableEntityTypeSchema=k3,d.getExtendedBuiltInEntity=_q,d.getExtendedDefinitionEntity=dp,d.getGenerationTargetSchemaBasedOnType=TS,d.getHeadIfPartOfDetachedBranch=PO,d.getHighestScope=BO,d.getImplementedBuiltInEntity=Vq,d.getIsInteractive=cp,d.getLastInListOperation=Ll,d.getLastInListOperationError=Nh,d.getLastInListOperationErrorParentRef=Vh,d.getLastInListOperationInputListArgument=Bh,d.getLastInListOperationInputListArgumentParentRef=wh,d.getLastInListOperationInputListArgumentRef=Sh,d.getLastInListOperationInputListDataType=Oh,d.getLastInListOperationOutputElementDataType=Ch,d.getLastInListOperationOutputElementReturn=_h,d.getLastInListOperationOutputElementReturnParentRef=Mh,d.getLastInListOperationOutputElementReturnRef=Ph,d.getLinkedEntitiesFromArgumentDeclaration=Oq,d.getLowestPersistedEntityImplementation=SO,d.getParentCallableEntity=MS,d.getParentCallerEntity=VS,d.getParentCanvasEntities=Ot,d.getParentCanvasEntity=lt,d.getParentCanvasEntityFromTransfer=ul,d.getParentEntryPoint=bq,d.getParentPassthroughCallableEntity=_S,d.getPassThroughCallableEntityReferenceSchema=$e,d.getPassThroughCallableEntityTypeSchema=$o,d.getPeristedEntities=Uq,d.getPlayableEntityReferenceSchema=z3,d.getPlayableEntityTypeSchema=H3,d.getProject=IJ,d.getPrototypeByType=Tl,d.getReferenceEntityId=A,d.getReferencedEntitiesStateOrErrors=nl,d.getReferencedEntityStateOrErrors=ju,d.getRelatedCanvasElementsOnTheLeft=Qr,d.getRelatedCanvasElementsOnTheLeftFromTransfer=WS,d.getRelatedCanvasElementsOnTheRight=dr,d.getRootEntryPointScopeOwner=yp,d.getScopeOwner=Pt,d.getTerminationReferenceSchema=Q3,d.getTerminationTypeSchema=X3,d.getUpstreamDependencyIds=yl,d.getUsedArgFromDeclaration=wq,d.getUsedReturnFromDeclaration=Bq,d.getValueReadingEntityReferenceSchema=jD,d.getValueReadingEntityTypeSchema=Ln,d.getValueWritingEntityReferenceSchema=G3,d.getValueWritingEntityTypeSchema=ja,d.getVariableFromInputMapping=LS,d.getVariableFromReturnVariablePointer=FS,d.getVariableReferenceSchema=nr,d.getVariableTypeSchema=_r,d.getVariablesFromArgumentDeclarations=pl,d.getVariablesFromInputMaps=GS,d.getVariablesFromOutputMapping=US,d.getVariablesFromOutputMaps=xS,d.getVariablesFromReturnDeclarations=$S,d.getVariablesInSameOrHigherScope=Vu,d.getWrites=rp,d.groupCallsBasedOnParallelizableExecution=Dq,d.handleAfterEntityImplementationSideEffects=CS,d.handleBeforeEntityImplementationSideEffects=PS,d.httpRequestBodyArgument=ms,d.httpRequestBodyArgumentRef=fm,d.httpRequestBodyDataType=mm,d.httpRequestHeadersArgument=fs,d.httpRequestHeadersArgumentRef=ym,d.httpRequestHeadersDataType=hm,d.httpRequestMethodArgument=ys,d.httpRequestMethodArgumentRef=um,d.httpRequestMethodDataType=pm,d.httpRequestMethodDataTypeRef=dm,d.httpRequestOperation=Xi,d.httpRequestOperationErrorValueDescriptor=ql,d.httpRequestOperationErrorValueDescriptorDatatype=Nm,d.httpRequestOperationErrorValueDescriptorRef=Vm,d.httpRequestOperationRef=wm,d.httpRequestOperationRefEight=Mm,d.httpRequestOperationRefFive=Pm,d.httpRequestOperationRefFour=Om,d.httpRequestOperationRefNine=_m,d.httpRequestOperationRefSeven=Bm,d.httpRequestOperationRefSix=Cm,d.httpRequestOperationRefThree=Sm,d.httpRequestOperationRefTwo=Am,d.httpRequestQueryParamsArgument=kl,d.httpRequestQueryParamsArgumentRef=om,d.httpRequestQueryParamsDataType=lm,d.httpRequestVariableURLArgument=hs,d.httpRequestVariableURLArgumentRef=am,d.httpRequestVariableURLDataType=sm,d.httpRequestVariableURLDataTypeRef=rm,d.httpResponseBodyReturnDataType=Dm,d.httpResponseBodyReturnDataTypeRef=vm,d.httpResponseBodyReturnReturn=Rs,d.httpResponseBodyReturnReturnRef=Im,d.httpResponseCodeDataType=Em,d.httpResponseCodeReturn=Ts,d.httpResponseCodeReturnRef=Tm,d.httpResponseHeadersDataType=bm,d.httpResponseHeadersDataTypeRef=Rm,d.httpResponseHeadersReturn=Es,d.httpResponseHeadersReturnRef=gm,d.implement=ll,d.inferArgumentDeclarationDataType=iS,d.inferDataType=Rn,d.inferInputMapDataType=Bu,d.inferOutputMapDataType=_u,d.inferPropertyDataType=oS,d.inferReturnDeclarationDataType=Mu,d.inferValueDescriptorDataType=lS,d.inferVariableDeclarationDataType=sS,d.inferVariableInstanceDataType=aS,d.initBaseProjectEntity=fp,d.initProject=FO,d.isPromise=Ku,d.iterateOverListActionDescriptorListArgumentDeclaration=fT,d.iterateOverListActionDescriptorListArgumentDeclarationDataType=yT,d.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=pT,d.iterateOverListActionDescriptorListArgumentDeclarationParentRef=hT,d.iterateOverListLoopActionDescriptor=Jn,d.iterateOverListLoopActionDescriptorDynamicReturnDeclaration=TT,d.iterateOverListLoopActionDescriptorDynamicReturnDeclarationParentRef=mT,d.iterateOverListLoopBodyActionDescriptor=ta,d.iterateOverListLoopBodyActionDescriptorAnyDynamicArgument=ST,d.iterateOverListLoopBodyActionDescriptorAnyDynamicArgumentParentRef=AT,d.iterateOverListLoopBodyActionDescriptorAnyDynamicReturn=PT,d.iterateOverListLoopBodyActionDescriptorAnyDynamicReturnParentRef=OT,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Is,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=RT,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=ET,d.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=gT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclaration=DT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=vT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=bT,d.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=IT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclaration=_T,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataType=BT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataTypeParentRef=wT,d.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationParentRef=MT,d.iterateOverObjectKeysLoopActionDescriptor=li,d.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclaration=NT,d.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclarationParentRef=VT,d.iterateOverObjectKeysLoopBodyActionDescriptor=zl,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgument=qT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgumentParentRef=kT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturn=WT,d.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturnParentRef=JT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Hl,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=GT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=LT,d.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=$T,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclaration=jT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=UT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=FT,d.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=xT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclaration=KT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataType=zT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataTypeParentRef=HT,d.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationParentRef=ZT,d.iterateOverObjectValuesLoopActionDescriptor=di,d.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclaration=QT,d.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclarationParentRef=XT,d.iterateOverObjectValuesLoopBodyActionDescriptor=Kl,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgument=lE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgumentParentRef=oE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturn=cE,d.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturnParentRef=dE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Zl,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=tE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=eE,d.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=nE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclaration=sE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=iE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=rE,d.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=aE,d.iterateOverStringActionDescriptorDynamicReturnDeclaration=eT,d.iterateOverStringActionDescriptorDynamicReturnDeclarationParentRef=Qm,d.iterateOverStringActionDescriptorStringArgumentDeclaration=Xm,d.iterateOverStringActionDescriptorStringArgumentDeclarationDataType=Zm,d.iterateOverStringActionDescriptorStringArgumentDeclarationDataTypeParentRef=zm,d.iterateOverStringActionDescriptorStringArgumentDeclarationParentRef=Km,d.iterateOverStringLoopActionDescriptor=ea,d.iterateOverStringLoopBodyActionDescriptor=vs,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgument=lT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgumentParentRef=oT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturn=cT,d.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturnParentRef=dT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Wl,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=nT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=tT,d.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=rT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Yl,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=aT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=iT,d.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=sT,d.joinListOperation=_l,d.joinListOperationError=ah,d.joinListOperationErrorParentRef=ih,d.joinListOperationFirstListArgument=Qy,d.joinListOperationFirstListArgumentParentRef=Xy,d.joinListOperationFirstListArgumentRef=Wy,d.joinListOperationFirstListDataType=Yy,d.joinListOperationResultListDataType=Ky,d.joinListOperationResultListReturn=rh,d.joinListOperationResultListReturnParentRef=nh,d.joinListOperationResultListReturnRef=Zy,d.joinListOperationSecondListArgument=th,d.joinListOperationSecondListArgumentParentRef=eh,d.joinListOperationSecondListArgumentRef=Hy,d.joinListOperationSecondListDataType=zy,d.joinListWithLastSeparator=q,d.joinStringsOperation=Ki,d.joinStringsOperationDynamicStringArgument=Ay,d.joinStringsOperationDynamicStringArgumentParentRef=Dy,d.joinStringsOperationDynamicStringArgumentRef=vy,d.joinStringsOperationDynamicStringDataType=Iy,d.joinStringsOperationError=by,d.joinStringsOperationErrorParentRef=gy,d.joinStringsOperationFirstStringArgument=cs,d.joinStringsOperationFirstStringArgumentParentRef=uy,d.joinStringsOperationFirstStringArgumentRef=ay,d.joinStringsOperationFirstStringDataType=sy,d.joinStringsOperationResultStringDataType=cy,d.joinStringsOperationResultStringReturn=Zi,d.joinStringsOperationResultStringReturnParentRef=Ry,d.joinStringsOperationResultStringReturnRef=dy,d.joinStringsOperationSecondStringArgument=us,d.joinStringsOperationSecondStringArgumentParentRef=Ey,d.joinStringsOperationSecondStringArgumentRef=oy,d.joinStringsOperationSecondStringDataType=ly,d.joinStringsOperationSeparatorStringArgument=Ty,d.joinStringsOperationSeparatorStringArgumentParentRef=my,d.joinStringsOperationSeparatorStringArgumentRef=py,d.joinStringsOperationSeparatorStringDataType=fy,d.joinStringsOperationSeparatorStringDataTypeDefaultValue=hy,d.joinStringsOperationSeparatorStringDataTypeDefaultValueParentRef=yy,d.keyValuePrototype=ai,d.lowercaseFirstLetter=zo,d.manualFlowActionDescriptorDeclarationArgumentDeclaration=Jl,d.manualFlowActionDescriptorDeclarationArgumentDeclarationDataType=jm,d.manualFlowActionDescriptorDeclarationArgumentDeclarationDataTypeParentRef=xm,d.manualFlowActionDescriptorDeclarationArgumentDeclarationParentRef=km,d.manualFlowLoopActionDescriptor=gs,d.manualFlowLoopActionDescriptorDynamicReturnDeclaration=Um,d.manualFlowLoopActionDescriptorDynamicReturnDeclarationParentRef=Fm,d.manualFlowLoopBodyActionDescriptor=bs,d.manualFlowLoopBodyActionDescriptorAnyDynamicArgument=Jm,d.manualFlowLoopBodyActionDescriptorAnyDynamicArgumentParentRef=qm,d.manualFlowLoopBodyActionDescriptorAnyDynamicReturn=Ym,d.manualFlowLoopBodyActionDescriptorAnyDynamicReturnParentRef=Wm,d.mapActionDescriptorToTypeItRepresents=Fq,d.mergeEntityErrorsList=L9,d.mergeListOfEntities=Lq,d.methodDefaultValue=cm,d.mockClientProject=gD,d.moreThanOrEqualCondition=hi,d.moreThanOrEqualConditionLeftHandArgument=ig,d.moreThanOrEqualConditionLeftHandArgumentDataType=ng,d.moreThanOrEqualConditionLeftHandArgumentDataTypeParentRef=tg,d.moreThanOrEqualConditionLeftHandArgumentParentRef=rg,d.moreThanOrEqualConditionRightHandArgument=lg,d.moreThanOrEqualConditionRightHandArgumentDataType=sg,d.moreThanOrEqualConditionRightHandArgumentDataTypeParentRef=ag,d.moreThanOrEqualConditionRightHandArgumentParentRef=og,d.notEmptyCondition=Rr,d.notEmptyConditionArgument=QR,d.notEmptyConditionRef=XR,d.nullPrototype=vp,d.numberAdditionOperation=ds,d.numberAdditionOperationDynamicSummandArgument=xp,d.numberAdditionOperationDynamicSummandArgumentType=Up,d.numberAdditionOperationDynamicSummandArgumentTypeParentRef=Fp,d.numberAdditionOperationError=$p,d.numberAdditionOperationErrorParentRef=Gp,d.numberAdditionOperationFirstNumberArgument=Sl,d.numberAdditionOperationFirstNumberArgumentRef=Cp,d.numberAdditionOperationFirstNumberDataType=wp,d.numberAdditionOperationRef=Np,d.numberAdditionOperationRefThree=Pl,d.numberAdditionOperationRefTwo=Lp,d.numberAdditionOperationResultNumberDataType=Vp,d.numberAdditionOperationResultNumberReturn=Cl,d.numberAdditionOperationResultNumberReturnRef=_p,d.numberAdditionOperationSecondNumberArgument=Ol,d.numberAdditionOperationSecondNumberArgumentRef=Bp,d.numberAdditionOperationSecondNumberDataType=Mp,d.numberPrototype=ee,d.numberSubtractionOperation=Bl,d.numberSubtractionOperationDynamicSubtrahendArgument=ry,d.numberSubtractionOperationDynamicSubtrahendArgumentType=ny,d.numberSubtractionOperationDynamicSubtrahendArgumentTypeParentRef=ty,d.numberSubtractionOperationError=ey,d.numberSubtractionOperationErrorParentRef=Qp,d.numberSubtractionOperationFirstNumberArgument=Hp,d.numberSubtractionOperationFirstNumberArgumentRef=jp,d.numberSubtractionOperationFirstNumberDataType=kp,d.numberSubtractionOperationRef=wl,d.numberSubtractionOperationRefThree=Kp,d.numberSubtractionOperationRefTwo=zp,d.numberSubtractionOperationResultNumberDataType=Yp,d.numberSubtractionOperationResultNumberReturn=Xp,d.numberSubtractionOperationResultNumberReturnRef=Wp,d.numberSubtractionOperationSecondNumberArgument=Zp,d.numberSubtractionOperationSecondNumberArgumentRef=qp,d.numberSubtractionOperationSecondNumberDataType=Jp,d.numberValueAutogenerationSchema=Pc,d.parallelExecutionOperation=Qt,d.parallelExecutionOperationError=lf,d.parallelExecutionOperationErrorParentRef=of,d.parallelExecutionOperationListOfExecutionResultsDataType=rf,d.parallelExecutionOperationListOfExecutionResultsReturn=Ul,d.parallelExecutionOperationListOfExecutionResultsReturnRef=nf,d.parallelExecutionOperationListOfFunctionsArgument=Fl,d.parallelExecutionOperationListOfFunctionsArgumentDatatype=tf,d.parallelExecutionOperationListOfFunctionsArgumentRef=ef,d.parallelExecutionOperationListOfFunctionsBlueprint=Qh,d.parallelExecutionOperationListOfFunctionsBlueprintDynamicInput=Xh,d.parallelExecutionOperationListOfFunctionsBlueprintDynamicOutput=Kh,d.parallelExecutionOperationRef=af,d.parallelExecutionOperationRefThree=sf,d.persistedBuiltInBaseEntity=st,d.persistedBuiltInBaseEntityDatabaseProperty=ui,d.persistedBuiltInBaseEntityDatabasePropertyDataType=_R,d.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=HO,d.persistedBuiltInBaseEntityDatabasePropertyParentRef=VR,d.persistedBuiltInBaseEntityDatabasePropertyRef=MR,d.persistedBuiltInBaseEntityPrimaryKeyProperty=pi,d.persistedBuiltInBaseEntityPrimaryKeyPropertyDataType=jR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOption=LR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOptionParentRef=NR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyParentRef=kR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyRef=xR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOption=$R,d.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOptionParentRef=GR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOption=UR,d.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOptionParentRef=FR,d.processOutputGlobalValueDescriptorDataType=fg,d.processOutputGlobalValueDescriptorReturn=Ms,d.processOutputGlobalValueDescriptorReturnRef=hg,d.projectPublicationCompletedGlobalEvent=Bs,d.propertyToZodSchema=Mg,d.relationalDatabaseBuiltInBaseEntity=cn,d.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=ud,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataType=PR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=OR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=CR,d.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=SR,d.relationalDatabaseBuiltInBaseEntityDefaultProperty=cd,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataType=AR,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=IR,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=DR,d.relationalDatabaseBuiltInBaseEntityIdentifierProperty=As,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataType=fR,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=yR,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=hR,d.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Ps,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataType=vR,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=gR,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=bR,d.relationalDatabaseBuiltInBaseEntityPasswordProperty=Os,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataType=RR,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=YO,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=ER,d.relationalDatabaseBuiltInBaseEntityRef=ci,d.relationalDatabaseBuiltInBaseEntityUsernameProperty=Ss,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataType=TR,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=WO,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=mR,d.resolveActionDescriptorName=hS,d.resolveBaseEntityName=cS,d.resolveBuiltInBaseEntityDataTypeLabel=uS,d.resolveClonedEntityProject=He,d.resolveConditionOperatorLabel=Xo,d.resolveDataType=Zo,d.resolveDataTypeEntityOrNestedChildrenFromLiteralValue=ep,d.resolveDataTypeLabel=Xa,d.resolveDefinitionEntityDataTypeLabel=A7,d.resolveEntityDataTypeLabel=D7,d.resolveEntityName=w,d.resolveFirstCallsSecond=Aq,d.resolveFirstWritesSecond=Sq,d.resolvePrimaryKeyProperty=jq,d.resolvePrimitiveEntityName=yS,d.resolveSearchName=pS,d.resolveVariableScope=b7,d.sequentialExecutionOperation=Cn,d.sequentialExecutionOperationError=Pf,d.sequentialExecutionOperationErrorParentRef=Of,d.sequentialExecutionOperationListOfExecutionResultsDataType=Df,d.sequentialExecutionOperationListOfExecutionResultsReturn=jl,d.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Sf,d.sequentialExecutionOperationListOfExecutionResultsReturnRef=If,d.sequentialExecutionOperationListOfFunctionsArgument=xl,d.sequentialExecutionOperationListOfFunctionsArgumentDatatype=vf,d.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Af,d.sequentialExecutionOperationListOfFunctionsArgumentRef=bf,d.sequentialExecutionOperationListOfFunctionsBlueprint=gf,d.sequentialExecutionOperationListOfFunctionsBlueprintDynamicInput=Rf,d.sequentialExecutionOperationListOfFunctionsBlueprintDynamicOutput=Ef,d.softDeletePersistedEntityMethod=zO,d.softDeletePersistedEntityMethodParentRef=qR,d.sortCallsBasedOnExecutionDependencies=NS,d.sortChildrenEntitiesBasedOnExecutionDependencies=Iq,d.splitListOperation=Nl,d.splitListOperationError=Ih,d.splitListOperationErrorParentRef=vh,d.splitListOperationFirstOutputListDataType=ph,d.splitListOperationFirstOutputListReturn=Eh,d.splitListOperationFirstOutputListReturnParentRef=Th,d.splitListOperationFirstOutputListReturnRef=Vl,d.splitListOperationInputListArgument=hh,d.splitListOperationInputListArgumentParentRef=yh,d.splitListOperationInputListArgumentRef=lh,d.splitListOperationInputListDataType=dh,d.splitListOperationSecondOutputListDataType=Rh,d.splitListOperationSecondOutputListReturn=bh,d.splitListOperationSecondOutputListReturnParentRef=gh,d.splitListOperationSplitIndexArgument=mh,d.splitListOperationSplitIndexArgumentParentRef=fh,d.splitListOperationSplitIndexArgumentRef=ch,d.splitListOperationSplitIndexDataType=uh,d.splitStringOperation=Ml,d.splitStringOperationError=jy,d.splitStringOperationErrorParentRef=xy,d.splitStringOperationFirstPartResultStringDataType=By,d.splitStringOperationFirstPartResultStringReturn=Uy,d.splitStringOperationFirstPartResultStringReturnParentRef=Fy,d.splitStringOperationFirstPartResultStringReturnRef=wy,d.splitStringOperationIndexArgument=Gy,d.splitStringOperationIndexArgumentParentRef=Ly,d.splitStringOperationIndexArgumentRef=Py,d.splitStringOperationIndexDataType=Cy,d.splitStringOperationSecondPartResultStringDataType=_y,d.splitStringOperationSecondPartResultStringReturn=qO,d.splitStringOperationSecondPartResultStringReturnParentRef=$y,d.splitStringOperationSecondPartResultStringReturnRef=My,d.splitStringOperationStringArgument=Ny,d.splitStringOperationStringArgumentParentRef=Vy,d.splitStringOperationStringArgumentRef=Sy,d.splitStringOperationStringDataType=Oy,d.stringPrototype=J,d.stringValueAutogenerationSchema=Oc,d.suggestNewIdForEntity=Uu,d.test_primitive_entities_export=AJ,d.toCamelCase=v7,d.toEntityState=Lt,d.toKebabCase=dS,d.toLowerCaseKebabCase=Ko,d.toPascalCase=I7,d.untypedDataPrototype=it,d.updateErrorsList=Me,d.updateValueReader=Gq,d.urlDefaultValue=im,d.uuidPrototype=On,d.validateArgumentDeclarationName=$u,d.validateCalledByErrorIdInAction=hq,d.validateCalledByIdInAction=yq,d.validateCallers=IS,d.validateConditionEntityDeclaration=Tq,d.validateDataOperation=hr,d.validateDataOperationDataToValidateArgument=Yf,d.validateDataOperationDataToValidateArgumentParentRef=Wf,d.validateDataOperationDataToValidateArgumentRef=qf,d.validateDataOperationDataToValidateDataType=Jf,d.validateDataOperationEntityToMatchTypeArgument=Kf,d.validateDataOperationEntityToMatchTypeArgumentParentRef=Zf,d.validateDataOperationEntityToMatchTypeArgumentRef=Hf,d.validateDataOperationEntityToMatchTypeDataType=zf,d.validateDataOperationError=tm,d.validateDataOperationErrorParentRef=em,d.validateDataOperationOutputEntityDeclaration=Qf,d.validateDataOperationOutputEntityDeclarationParentRef=Xf,d.validateDefinitionEntityName=Qo,d.validateEntryCaller=vS,d.validateErrorCaller=bS,d.validateFunctionCallDeclaration=AS,d.validateFunctionDeclarationName=Nu,d.validateGeneratedEntityParentIsNotBuiltInEntity=dq,d.validateGeneration=oq,d.validateGenerationTarget=je,d.validateGenerationUpdate=lq,d.validateLoopEntityDeclaration=Eq,d.validateName=S7,d.validateOperationEntityDeclaration=SS,d.validatePropertyName=Gu,d.validateReachability=jn,d.validateReadsValueInActionPayload=fq,d.validateReferenceObject=tl,d.validateReferenceToOne=ku,d.validateReferences=tt,d.validateReturnDeclarationName=Fu,d.validateSuccessCaller=gS,d.validateValueReaderGenerationUpdate=es,d.validateValueWritter=zu,d.validateVariableDeclarationName=Lu,d.validateVariableInternalCallUse=Zu,d.valueAutogenerationCurrentDateAndTimeSchema=vD,d.valueAutogenerationGenericSchema=bo,d.valueAutogenerationOptions=wc,d.valueAutogenerationOptionsSchema=bD,d.valueAutogenerationRandomBooleanSchema=Sc,d.valueAutogenerationRandomDateBetweenSchema=BD,d.valueAutogenerationRandomDateFromSchema=CD,d.valueAutogenerationRandomDateSchema=Do,d.valueAutogenerationRandomDateUntilSchema=wD,d.valueAutogenerationRandomNumberBetweenSchema=AD,d.valueAutogenerationRandomNumberFromSchema=ID,d.valueAutogenerationRandomNumberSchema=vo,d.valueAutogenerationRandomNumberUntilSchema=DD,d.valueAutogenerationRandomSchema=Na,d.valueAutogenerationRandomTextBetweenSchema=PD,d.valueAutogenerationRandomTextFromSchema=SD,d.valueAutogenerationRandomTextSchema=Io,d.valueAutogenerationRandomTextUntilSchema=OD,d.valueAutogenerationRangeValueTypesSchema=Va,d.valueAutogenerationUniqueSchema=Ac,d.waitOperation=Rt,d.waitOperationMillisecondsNumberArgument=pr,d.waitOperationMillisecondsNumberArgumentRef=uf,d.waitOperationMillisecondsNumberDataType=pf,d.waitOperationOperationError=ff,d.waitOperationOperationErrorParentRef=hf,d.waitOperationRef=yf,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|