@elyx-code/project-logic-tree 0.0.1 → 0.0.2

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.
@@ -1,179 +1,179 @@
1
- (function(u,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(u=typeof globalThis<"u"?globalThis:u||self,n(u["@elyx-code/project-logic-tree"]={}))})(this,function(u){"use strict";var G8=Object.defineProperty;var F8=(u,n,M)=>n in u?G8(u,n,{enumerable:!0,configurable:!0,writable:!0,value:M}):u[n]=M;var l=(u,n,M)=>(F8(u,typeof n!="symbol"?n+"":n,M),M);var n=(i=>(i.CustomEntity="custom-entity",i.BuiltInBaseEntity="built-in-base-entity",i.Project="project",i.InstalledProject="installed-project",i.GlobalEvent="global-event",i.DataType="data-type",i.FunctionCall="function-call",i.FunctionDeclaration="function-declaration",i.ActionDescriptor="action-descriptor",i.ValueDescriptor="value-descriptor",i.ArgumentDeclaration="argument-declaration",i.InputMap="input-map",i.ReturnStatement="return-statement",i.BreakStatement="break-statement",i.ContinueStatement="continue-statement",i.ReturnDeclaration="return-declaration",i.OutputMap="output-map",i.PrimitiveEntity="primitive-entity",i.PrimitiveValue="primitive-value",i.Property="property",i.Operation="operation",i.Condition="condition",i.VariableDeclaration="variable-declaration",i.VariableInstance="variable-instance",i.Search="search",i.Loop="loop",i.InternalCall="internal-call",i.GenericReference="generic-reference",i))(n||{}),M=(i=>(i.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",i.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",i.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",i.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",i.EXECUTION="BUILT_IN_EXECUTION_ENTITY",i.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",i))(M||{}),Le=(i=>(i.CurrentDateAndTime="current-date-and-time",i.Unique="unique",i.Random="random",i))(Le||{}),Et=(i=>(i.DeletePersistedEntity="base-delete-persisted-entity",i.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",i.AbortExecution="base-abort-execution",i))(Et||{}),V=(i=>(i.Fixed="fixed",i.None="none",i.Dynamic="dynamic",i))(V||{}),A=(i=>(i.FixedArguments="fixed-arguments",i.FixedReturns="fixed-returns",i.ReturnedError="returned-error",i.OngoingProcessExecution="ongoing-process-execution",i))(A||{}),g=(i=>(i.EntityTemplate="entity-template",i.ActionDescriptor="action-descriptor",i.String="string",i.Number="number",i.Boolean="boolean",i.Null="null",i.Enum="enum",i.JSON="json",i.Date="date",i.UUID="uuid",i.File="file",i))(g||{}),nt=(i=>(i.Addition="addition",i.Substraction="substraction",i.Multiplication="multiplication",i.Division="division",i.Remainder="remainder",i.Exponentiation="exponentiation",i))(nt||{}),be=(i=>(i.Join="string-join",i.Split="stringSsplit",i.DeleteLast="string-delete-last",i.DeleteFirst="string-delete-first",i.DeleteIndex="string-delete-index",i.AddIndex="string-add-index",i.ReplaceFirst="string-replace-first",i.ReplaceLast="string-replace-last",i.ReplaceIndex="string-replace-index",i.ReplaceSingleMatch="string-replace-single-match",i.ReplaceAllMatches="string-replace-all-matches",i.GetIndex="string-get-index",i.GetFirst="string-get-first",i.GetLast="string-get-last",i.Append="string-append",i.Prepend="string-prepend",i))(be||{}),U=(i=>(i.Join="list-join",i.Split="list-split",i.DeleteLast="list-delete-last",i.DeleteFirst="list-delete-first",i.DeleteIndex="list-delete-index",i.AddIndex="list-add-index",i.ReplaceFirst="list-replace-first",i.ReplaceLast="list-replace-last",i.ReplaceIndex="list-replace-index",i.ReplaceSingleMatch="list-replace-single-match",i.ReplaceAllMatches="list-replace-all-matches",i.GetIndex="list-get-index",i.GetFirst="list-get-first",i.GetLast="list-get-last",i.Append="list-append",i.Prepend="list-prepend",i))(U||{}),Ie=(i=>(i.Parallel="parallel",i.Sequential="sequential",i.Wait="wait",i))(Ie||{}),He=(i=>(i.CreateNewInstance="create-new-instance",i.Validate="validate",i))(He||{}),qe=(i=>(i.HttpRequest="base-http-request",i))(qe||{}),De=(i=>(i.Equal="equal",i.NotEqual="not-equal",i.And="and",i.Or="or",i.LessThan="less-than",i.MoreThan="more-than",i.LessThanOrEqual="less-than-or-equal",i.MoreThanOrEqual="more-than-or-equal",i))(De||{}),St=(i=>(i.Empty="empty",i.NotEmpty="not-empty",i))(St||{}),$e=(i=>(i.ManualFlow="manual-flow-loop",i.Counted="counted-loop",i.List="list-loop",i.ObjectKeys="object-keys-loop",i.ObjectValues="object-values-loop",i.String="string-loop",i))($e||{}),xe=(i=>(i.OrDataTypeGroup="or-data-type-group",i.AndDataTypeGroup="and-data-type-group",i.DynamicArgumentTypes="dynamic-argument-types",i.DynamicReturnTypes="dynamic-return-types",i))(xe||{}),Jt=(i=>(i.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",i))(Jt||{}),_l=(i=>(i.Error="error",i.Task="task",i))(_l||{});const Tn=[n.VariableDeclaration,n.VariableInstance,n.InputMap,n.ReturnDeclaration],rt=[n.VariableDeclaration,n.VariableInstance,n.ArgumentDeclaration,n.OutputMap],Nl=[...Tn,...rt],_e=[n.VariableDeclaration,n.VariableInstance],Un=[n.GlobalEvent],Ge=[n.Operation,n.FunctionCall,n.Condition,n.Search,n.VariableDeclaration,n.VariableInstance,n.InternalCall,n.Loop],Wa=[n.Operation,n.FunctionCall,n.Condition,n.Search,n.VariableDeclaration,n.VariableInstance,n.Loop],Fe=[n.FunctionDeclaration,...Un],En=[...Ge,n.ReturnStatement,n.BreakStatement,n.ContinueStatement],Ha=[...Wa,n.ReturnStatement,n.BreakStatement,n.ContinueStatement],tn=[...Ge,...Fe],Vl=[...Wa,...Fe],Wb=[...En,...Fe],Hb=[...Ha,...Fe],it=[...Fe,n.Loop],Ne=[n.ReturnStatement,n.BreakStatement,n.ContinueStatement],Yb=[n.CustomEntity,n.BuiltInBaseEntity,n.Project,n.InstalledProject,n.GlobalEvent,n.DataType,n.FunctionCall,n.FunctionDeclaration,n.ActionDescriptor,n.ValueDescriptor,n.ArgumentDeclaration,n.InputMap,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.ReturnDeclaration,n.OutputMap,n.PrimitiveEntity,n.PrimitiveValue,n.Property,n.Operation,n.Condition,n.VariableDeclaration,n.VariableInstance,n.Search,n.Loop,n.InternalCall],Ya=[n.CustomEntity,n.GlobalEvent,n.FunctionDeclaration,n.FunctionCall,n.VariableDeclaration,n.VariableInstance,n.Operation,n.Condition,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.InstalledProject,n.Loop,n.Search],Ll=[n.CustomEntity,n.FunctionDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.Property,n.VariableDeclaration,n.Search,n.Project,n.InstalledProject,n.ActionDescriptor,n.ValueDescriptor],Di=[n.BuiltInBaseEntity,n.PrimitiveEntity],zb=[n.CustomEntity,n.FunctionDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.Property,n.VariableDeclaration,n.GlobalEvent,n.Search,n.Project,n.InstalledProject,n.ActionDescriptor,n.ValueDescriptor,n.InputMap,n.OutputMap,n.FunctionCall,n.Operation,n.Condition,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.VariableInstance,n.PrimitiveValue,n.InternalCall],G={type:n.PrimitiveEntity,id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",description:"A string of characters.",version:1,name:g.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},jn={type:n.PrimitiveEntity,id:"f596545d-1565-4faa-9969-d95fa5edfea4",description:"A 'true' or 'false' value.",version:1,name:g.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ce={type:n.PrimitiveEntity,id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",description:"A number value.",version:1,name:g.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},at={type:n.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:g.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},$l={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:n.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:n.DataType},Gl={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:n.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:n.Property},Fl={id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:{id:"enum-options-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.JSON,autogeneration:null,value:[],valueAsType:null,parent:$l},parent:Gl},xl={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:n.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:n.PrimitiveEntity},Ul={required:!0,id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",name:"Options",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Fl,description:"Options for the enum. Each option is a text value.",parent:xl},Rn={type:n.PrimitiveEntity,id:"9542b8b4-2642-4eee-9db9-def7963a17a0",description:"A set of text options to choose from.",version:1,name:g.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[Ul],methods:[]},fr={type:n.PrimitiveEntity,id:"dc58f38b-d574-4956-aac6-32ce9529b937",description:"A date and time value.",version:1,name:g.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},za={type:n.PrimitiveEntity,id:"4a6234aa-c0f6-4731-b4dd-750388029226",description:"A unique identifier in the form of a 36-character string.",version:1,name:g.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[G],properties:[],methods:[]},jl={type:n.PrimitiveEntity,id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",description:"A complex data structure with any combination of properties with names and values.",version:1,name:g.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var kl=(i=>(i.FirstInputNumber="number-addition-first-number-argument-declaration",i.SecondInputNumber="number-addition-second-number-argument-declaration",i))(kl||{}),ql=(i=>(i.ResultNumber="number-addition-result-number-return-delaration",i.Error="number-addition-error-return-delaration",i))(ql||{});const Jl={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:n.ValueDescriptor},Wl={id:"number-addition-first-number-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Jl},Hl={type:n.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:n.ValueDescriptor},Yl={id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Hl},zl={type:n.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:n.ValueDescriptor},Zl={id:"b761acec-0755-4582-a68b-76267038bbe1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zl},Xl={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:nt.Addition,entityType:n.ActionDescriptor},Za={id:"number-addition-first-number-argument-declaration",type:n.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:Wl,required:!0,parentRelationType:A.FixedArguments,index:0,parent:Xl},Ql={type:n.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:nt.Addition,entityType:n.ActionDescriptor},Xa={id:"number-addition-second-number-argument-declaration",type:n.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:Yl,required:!0,parentRelationType:A.FixedArguments,index:1,parent:Ql},Kl={type:n.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:nt.Addition,entityType:n.ActionDescriptor},Qa={parentRelationType:A.FixedReturns,id:"number-addition-result-number-return-delaration",type:n.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:Zl,required:!0,index:0,parent:Kl},ec={type:n.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:nt.Addition,entityType:n.ActionDescriptor},tc={parentRelationType:A.FixedReturns,id:"number-addition-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ec},Ka={id:nt.Addition,type:n.ActionDescriptor,description:"Add two numbers together",version:1,name:nt.Addition,fixedArguments:[Za,Xa],error:tc,fixedReturns:[Qa],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},nc={[nt.Addition]:Ka};var rc=(i=>(i.FirstInputString="join-string-first-string-argument-declaration",i.SecondInputString="join-string-second-string-argument-declaration",i))(rc||{}),ic=(i=>(i.ResultString="join-string-result-string-return-delaration",i.Error="join-string-error-return-delaration",i))(ic||{});const ac={type:n.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:n.ValueDescriptor},sc={id:"join-string-first-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ac},oc={type:n.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:n.ValueDescriptor},lc={id:"join-string-second-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:oc},cc={type:n.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:n.ValueDescriptor},dc={id:"join-string-result-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cc},uc={type:n.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:be.Join,entityType:n.ActionDescriptor},Si={id:"join-string-first-string-argument-declaration",type:n.ValueDescriptor,version:1,name:"First value",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",dataType:sc,parentRelationType:A.FixedArguments,required:!0,index:0,parent:uc},pc={type:n.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:be.Join,entityType:n.ActionDescriptor},Ai={id:"join-string-second-string-argument-declaration",type:n.ValueDescriptor,version:1,name:"Second value",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",dataType:lc,parentRelationType:A.FixedArguments,required:!0,index:1,parent:pc},yc={type:n.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:be.Join,entityType:n.ActionDescriptor},mr={parentRelationType:A.FixedReturns,id:"join-string-result-string-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:dc,required:!0,index:0,parent:yc},hc={type:n.GenericReference,id:"join-string-operation-error-parent-ref",entityId:be.Join,entityType:n.ActionDescriptor},fc={parentRelationType:A.FixedReturns,id:"join-string-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:hc},Oi={id:be.Join,type:n.ActionDescriptor,version:1,name:be.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Si,Ai],fixedReturns:[mr],error:fc,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},mc={[be.Join]:Oi};var Tc=(i=>(i.FirstInputList="join-list-first-list-argument-declaration",i.SecondInputList="join-list-second-list-argument-declaration",i))(Tc||{}),Ec=(i=>(i.ResultList="join-list-result-list-return-delaration",i.Error="join-list-error-return-delaration",i))(Ec||{});const Rc={type:n.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:n.ValueDescriptor},bc={id:"join-list-first-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Rc},vc={type:n.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:n.ValueDescriptor},gc={id:"join-list-second-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:vc},Ic={type:n.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:n.ValueDescriptor},Pc={id:"join-list-result-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ic},Dc={type:n.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:U.Join,entityType:n.ActionDescriptor},Sc={id:"join-list-first-list-argument-declaration",type:n.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.",dataType:bc,parentRelationType:A.FixedArguments,required:!0,index:0,parent:Dc},Ac={type:n.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:U.Join,entityType:n.ActionDescriptor},Oc={id:"join-list-second-list-argument-declaration",type:n.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.",dataType:gc,parentRelationType:A.FixedArguments,required:!0,index:1,parent:Ac},Cc={type:n.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:U.Join,entityType:n.ActionDescriptor},Bc={parentRelationType:A.FixedReturns,id:"join-list-result-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:Pc,required:!0,index:0,parent:Cc},wc={type:n.GenericReference,id:"join-list-operation-error-parent-ref",entityId:U.Join,entityType:n.ActionDescriptor},Mc={parentRelationType:A.FixedReturns,id:"join-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:wc},_c={id:U.Join,type:n.ActionDescriptor,version:1,name:U.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[Sc,Oc],error:Mc,fixedReturns:[Bc],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Nc=(i=>(i.InputList="list-to-split-argument-declaration",i.SplitIndex="split-list-index-argument-declaration",i))(Nc||{}),Vc=(i=>(i.FirstOutputList="split-list-first-output-list-return-delaration",i.SecondOutputList="split-list-second-output-list-return-delaration",i.Error="split-list-error-return-delaration",i))(Vc||{});const Lc={type:n.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:n.ValueDescriptor},$c={id:"split-list-operation-input-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Lc},Gc={type:n.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:n.ValueDescriptor},Fc={id:"split-list-operation-split-index-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Gc},es={type:n.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:n.ValueDescriptor},xc={id:"split-list-operation-first-output-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:es},Uc={type:n.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:U.Split,entityType:n.ActionDescriptor},jc={id:"list-to-split-argument-declaration",type:n.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:$c,parentRelationType:A.FixedArguments,required:!0,index:0,parent:Uc},kc={type:n.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:U.Split,entityType:n.ActionDescriptor},qc={id:"split-list-index-argument-declaration",type:n.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.",dataType:Fc,parentRelationType:A.FixedArguments,required:!0,index:1,parent:kc},Jc={type:n.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:U.Split,entityType:n.ActionDescriptor},Wc={parentRelationType:A.FixedReturns,id:"split-list-first-output-list-return-delaration",type:n.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:xc,required:!0,index:0,parent:Jc},Hc={id:"split-list-operation-second-output-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:es},Yc={type:n.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:U.Split,entityType:n.ActionDescriptor},zc={parentRelationType:A.FixedReturns,id:"split-list-second-output-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:Hc,required:!0,index:0,parent:Yc},Zc={type:n.GenericReference,id:"split-list-operation-error-parent-ref",entityId:U.Split,entityType:n.ActionDescriptor},Xc={parentRelationType:A.FixedReturns,id:"split-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Zc},Qc={id:U.Split,type:n.ActionDescriptor,version:1,name:U.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",fixedArguments:[jc,qc],fixedReturns:[Wc,zc],error:Xc,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Kc=(i=>(i.InputList="get-last-in-list-input-list-argument-declaration",i))(Kc||{}),ed=(i=>(i.OutputElement="get-last-in-list-output-element-return-delaration",i.Error="get-last-in-list-error-return-delaration",i))(ed||{});const td={type:n.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:n.ValueDescriptor},nd={id:"get-last-in-list-input-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:td},rd={type:n.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:n.ValueDescriptor},id={id:"get-last-in-list-output-element-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:rd},ad={type:n.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:U.GetLast,entityType:n.ActionDescriptor},sd={id:"get-last-in-list-input-list-argument-declaration",type:n.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:nd,parentRelationType:A.FixedArguments,required:!0,index:0,parent:ad},od={type:n.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:U.GetLast,entityType:n.ActionDescriptor},ld={parentRelationType:A.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:n.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:id,required:!0,index:0,parent:od},cd={type:n.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:U.GetLast,entityType:n.ActionDescriptor},dd={parentRelationType:A.FixedReturns,id:"get-last-in-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:cd},ud={id:U.GetLast,type:n.ActionDescriptor,version:1,name:U.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[sd],fixedReturns:[ld],error:dd,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var pd=(i=>(i.List="append-to-list-lsit-argument-declaration",i.ElementToAppend="append-to-list-element-to-append-argument-declaration",i))(pd||{}),yd=(i=>(i.ResultList="append-to-list-result-list-return-delaration",i.Error="append-to-list-error-return-delaration",i))(yd||{});const hd={type:n.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:n.ValueDescriptor},fd={id:"append-to-list-lsit-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:hd},md={type:n.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:n.ValueDescriptor},Td={id:"append-to-list-second-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:md},Ed={type:n.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:n.ValueDescriptor},Rd={id:"append-to-list-result-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ed},bd={type:n.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:U.Append,entityType:n.ActionDescriptor},ts={id:"append-to-list-lsit-argument-declaration",type:n.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:fd,parentRelationType:A.FixedArguments,required:!0,index:0,parent:bd},vd={type:n.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:U.Append,entityType:n.ActionDescriptor},ns={id:"append-to-list-element-to-append-argument-declaration",type:n.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:Td,parentRelationType:A.FixedArguments,required:!0,index:1,parent:vd},gd={type:n.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:U.Append,entityType:n.ActionDescriptor},Id={parentRelationType:A.FixedReturns,id:"append-to-list-result-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:Rd,required:!0,index:0,parent:gd},Pd={type:n.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:U.Append,entityType:n.ActionDescriptor},Dd={parentRelationType:A.FixedReturns,id:"append-to-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Pd},rs={id:U.Append,type:n.ActionDescriptor,version:1,name:U.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[ts,ns],error:Dd,fixedReturns:[Id],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Sd={[U.Join]:_c,[U.Split]:Qc,[U.GetLast]:ud,[U.Append]:rs};var Ad=(i=>(i.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",i))(Ad||{}),Od=(i=>(i.ListOfExecutionResults="parallel-execution-result-return-delaration",i.Error="parallel-execution-error-return-delaration",i))(Od||{});const Cd={id:"parallel-execution-list-of-functions-blueprint-id",type:n.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.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},Bd={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:n.ValueDescriptor},wd={id:"parallel-execution-list-of-functions-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cd,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Bd},Md={type:n.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:n.ValueDescriptor},_d={id:"b761acec-0755-4582-a68b-76267038bbe1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Md},Nd={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ie.Parallel,entityType:n.ActionDescriptor},is={id:"parallel-execution-list-of-functions-argument-declaration",type:n.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:wd,required:!0,index:0,parent:Nd,parentRelationType:A.FixedArguments},Vd={type:n.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ie.Parallel,entityType:n.ActionDescriptor},as={id:"parallel-execution-result-return-delaration",type:n.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:_d,required:!0,index:0,parent:Vd,parentRelationType:A.FixedReturns},Ld={type:n.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ie.Parallel,entityType:n.ActionDescriptor},$d={id:"parallel-execution-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Ld,parentRelationType:A.ReturnedError},wt={id:Ie.Parallel,type:n.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ie.Parallel,fixedArguments:[is],fixedReturns:[as],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:$d,parent:null};var Gd=(i=>(i.MillisecondsNumber="wait-milliseconds-number-argument-declaration",i))(Gd||{}),Fd=(i=>(i.Error="wait-operation-error-return-delaration",i))(Fd||{});const xd={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:n.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},Ud={id:"wait-milliseconds-number-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xd},jd={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:n.ActionDescriptor,entityId:Ie.Wait},bn={id:"wait-milliseconds-number-argument-declaration",type:n.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:Ud,required:!0,index:0,parent:jd,parentRelationType:A.FixedArguments},kd={type:n.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ie.Wait,entityType:n.ActionDescriptor},qd={id:"wait-operation-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:kd,parentRelationType:A.ReturnedError},st={id:Ie.Wait,type:n.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ie.Wait,fixedArguments:[bn],fixedReturns:[],error:qd,argumentsType:V.Fixed,returnsType:V.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Jd=(i=>(i.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",i))(Jd||{}),Wd=(i=>(i.ListOfExecutionResults="sequential-execution-result-return-delaration",i.Error="sequential-execution-error-return-delaration",i))(Wd||{});const Hd={id:"sequential-execution-list-of-functions-blueprint-id",type:n.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.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},Yd={type:n.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:n.ValueDescriptor},zd={id:"sequential-execution-list-of-functions-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Hd,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Yd},Zd={type:n.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:n.ValueDescriptor},Xd={id:"sequential-execution-list-of-execution-results-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zd},Qd={type:n.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ie.Sequential,entityType:n.ActionDescriptor},ss={id:"sequential-execution-list-of-functions-argument-declaration",type:n.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:zd,required:!0,index:0,parent:Qd,parentRelationType:A.FixedArguments},Kd={type:n.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ie.Sequential,entityType:n.ActionDescriptor},os={id:"sequential-execution-result-return-delaration",type:n.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:Xd,required:!0,index:0,parent:Kd,parentRelationType:A.FixedReturns},eu={type:n.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ie.Sequential,entityType:n.ActionDescriptor},tu={id:"sequential-execution-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:eu,parentRelationType:A.ReturnedError},Wt={id:Ie.Sequential,type:n.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ie.Sequential,fixedArguments:[ss],fixedReturns:[os],error:tu,returnsType:V.Fixed,argumentsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},nu={[Ie.Parallel]:wt,[Ie.Wait]:st,[Ie.Sequential]:Wt};var ru=(i=>(i.EntityToInstanciate="entity-to-instanciate-argument-declaration",i))(ru||{}),iu=(i=>(i.Error="create-new-instance-error-return-delaration",i))(iu||{});const au={type:n.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},su={id:"entity-to-instanciate-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:au},ou={type:n.GenericReference,id:"create-new-instance-operation-ref",entityType:n.ActionDescriptor,entityId:He.CreateNewInstance},lu={id:"entity-to-instanciate-argument-declaration",type:n.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:su,required:!0,parentRelationType:A.FixedArguments,index:0,parent:ou},cu={type:n.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:He.CreateNewInstance,entityType:n.ActionDescriptor},du={parentRelationType:A.FixedReturns,id:"create-new-instance-output-entity-declaration",type:n.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:cu,required:!0,index:0},uu={type:n.GenericReference,id:"create-new-instance-error-parent-ref",entityId:He.CreateNewInstance,entityType:n.ActionDescriptor},pu={parentRelationType:A.FixedReturns,id:"create-new-instance-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:uu},Tr={id:He.CreateNewInstance,type:n.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:He.CreateNewInstance,fixedArguments:[lu],fixedReturns:[du],error:pu,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var yu=(i=>(i.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",i.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",i))(yu||{}),hu=(i=>(i.Error="validate-data-error-return-delaration",i.OutputEntity="validate-data-output-entity-declaration",i))(hu||{});const fu={type:n.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},mu={id:"validate-data-operation-data-to-validate-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:fu},Tu={type:n.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:n.ActionDescriptor,entityId:He.Validate},Eu={id:"validate-data-operation-data-to-validate-argument-declaration",type:n.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:mu,required:!0,parentRelationType:A.FixedArguments,index:0,parent:Tu},Ru={type:n.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},bu={id:"validate-data-operation-entity-to-match-type-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ru},vu={type:n.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:n.ActionDescriptor,entityId:He.Validate},gu={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:n.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:bu,required:!0,index:0,parentRelationType:A.FixedArguments,parent:vu},Iu={type:n.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:He.Validate,entityType:n.ActionDescriptor},Pu={id:"validate-data-output-entity-declaration",type:n.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:Iu,required:!0,index:0,parentRelationType:A.FixedReturns},Du={type:n.GenericReference,id:"wait-operation-error-parent-ref",entityId:He.Validate,entityType:n.ActionDescriptor},Su={id:"validate-data-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Du,parentRelationType:A.ReturnedError},kn={id:He.Validate,type:n.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:He.Validate,fixedArguments:[gu,Eu],fixedReturns:[Pu],error:Su,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Au={[He.CreateNewInstance]:Tr,[He.Validate]:kn};var ls=(i=>(i.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",i))(ls||{});const Me={[n.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[n.BuiltInBaseEntity]:{[M.KEY_VALUE_PARAM]:{id:M.KEY_VALUE_PARAM},[M.HTTP_ENDPOINT]:{id:M.HTTP_ENDPOINT,properties:{method:"http-endpoint-built-in-method-property-id",path:"http-endpoint-built-in-path-property-id",cors:"http-endpoint-built-in-cors-property-id"}},[M.PERSISTED_ENTITY]:{id:M.PERSISTED_ENTITY,properties:{database:"persisted-built-in-base-entity-database-property-id",identifier:"persisted-built-in-base-entity-identifier-property-id"}},[M.RELATIONAL_DATABASE]:{id:M.RELATIONAL_DATABASE,properties:{identifier:"relational-database-built-in-base-entity-identifier-property-id",username:"relational-database-built-in-base-entity-username-property-id",password:"relational-database-built-in-base-entity-password-property-id",minSize:"relational-database-built-in-base-entity-min-size-property-id",default:"relational-database-built-in-base-entity-default-property-id"}},[M.CRON_JOB]:{id:M.CRON_JOB,properties:{expression:"cron-job-built-in-base-entity-expression-property-id"}}},[n.Operation]:{[be.Join]:{id:be.Join,inputs:{first:"join-string-first-string-input-id",second:"join-string-second-string-input-id"},outputs:{result:"join-string-result-string-return-delaration-id",error:"join-string-error-return-delaration-id"}},[qe.HttpRequest]:{id:qe.HttpRequest,inputs:{url:"http-request-url-input-id",query:"http-request-query-input-id",method:"http-request-method-input-id",headers:"http-request-headers-input-id",body:"http-request-body-string-input-id"},outputs:{code:"http-response-code-return-delaration-id",body:"http-response-body-return-delaration-id",headers:"http-response-headers-return-delaration-id",error:"http-request-error-return-delaration-id"}}},[n.Loop]:{[$e.List]:{id:$e.List,inputs:{list:"iterate-over-list-loop-list-input-id"},outputs:{results:"iterate-over-list-loop-output-id"}},[$e.ManualFlow]:{id:$e.ManualFlow,inputs:{},outputs:{results:"manual-flow-loop-output-id"}}},[n.Condition]:{[De.MoreThanOrEqual]:{id:De.MoreThanOrEqual,inputs:{leftHand:"condition-more-than-or-equal-left-hand-input-id",rightHand:"condition-more-than-or-equal-right-hand-input-id"}},[St.NotEmpty]:{id:St.NotEmpty,inputs:{leftHand:"condition-not-empty-input-id"}}},[n.GlobalEvent]:{[Jt.PROJECT_PUBLICATION_COMPLETED]:{id:Jt.PROJECT_PUBLICATION_COMPLETED}}},Ue=Me[n.Operation]["base-http-request"],Ou={type:n.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:n.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},Cu={id:"http-request-url-default-value-id",type:n.PrimitiveValue,version:1,value:"https://some-url.com",name:g.String,valueAsType:null,parent:Ou,autogeneration:null},Bu={type:n.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Ue.inputs.url,entityType:n.ValueDescriptor},wu={id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:Cu,constant:!1,parent:Bu},Mu={type:n.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Ue.inputs.query,entityType:n.ValueDescriptor},_u={id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Mu},Nu={type:n.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:n.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},Vu={id:"http-request-method-default-value-id",type:n.PrimitiveValue,version:1,value:"GET",name:g.Enum,valueAsType:null,parent:Nu,autogeneration:null},Lu={type:n.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Ue.inputs.method,entityType:n.ValueDescriptor},$u={id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:Vu,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:Lu},Gu={type:n.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Ue.inputs.headers,entityType:n.ValueDescriptor},Fu={id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Gu},xu={type:n.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Ue.inputs.body,entityType:n.ValueDescriptor},Uu={id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xu},ju={type:n.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:n.ValueDescriptor,entityId:Ue.outputs.code},ku={id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ju},qu={type:n.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:n.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},Ju={type:n.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:n.ValueDescriptor,entityId:Ue.outputs.headers},Wu={id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:n.PrimitiveValue,version:1,value:{},name:g.JSON,parent:qu,valueAsType:null,autogeneration:null},constant:!1,parent:Ju},Hu={type:n.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:n.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},Yu={type:n.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:n.ValueDescriptor,entityId:Ue.outputs.body},zu={id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:n.PrimitiveValue,version:1,value:{},name:g.JSON,parent:Hu,valueAsType:null,autogeneration:null},constant:!1,parent:Yu},Zu={type:n.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},Ci={id:Ue.inputs.method,type:n.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",dataType:$u,required:!1,index:0,parentRelationType:A.FixedArguments,parent:Zu},Xu={type:n.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},Bi={id:Ue.inputs.url,type:n.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:wu,required:!1,index:1,parentRelationType:A.FixedArguments,parent:Xu},Qu={type:n.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},cs={id:Ue.inputs.query,type:n.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",dataType:_u,required:!1,index:2,parentRelationType:A.FixedArguments,parent:Qu},Ku={type:n.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},wi={id:Ue.inputs.headers,type:n.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",dataType:Fu,required:!1,index:3,parent:Ku,parentRelationType:A.FixedArguments},ep={type:n.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},Mi={id:Ue.inputs.body,type:n.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 JSON data structure or a text value.",version:1,name:"Body",dataType:Uu,required:!1,index:4,parentRelationType:A.FixedArguments,parent:ep},tp={type:n.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},ds={id:Ue.outputs.code,type:n.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",dataType:ku,required:!0,index:0,parentRelationType:A.FixedReturns,parent:tp},np={type:n.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},_i={parentRelationType:A.FixedReturns,id:Ue.outputs.headers,type:n.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",dataType:Wu,required:!0,index:1,parent:np},rp={type:n.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},Er={parentRelationType:A.FixedReturns,id:Ue.outputs.body,type:n.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 JSON data structure or a text value.",version:1,name:"Body",dataType:zu,required:!0,index:2,parent:rp},ip={type:n.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:n.ActionDescriptor,entityId:qe.HttpRequest},ap={type:n.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:n.ValueDescriptor,entityId:Ue.outputs.error},sp={id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:ap},us={parentRelationType:A.ReturnedError,id:Ue.outputs.error,type:n.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:sp,required:!0,index:0,parent:ip},Ni={type:n.ActionDescriptor,id:qe.HttpRequest,name:qe.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,fixedArguments:[Ci,Bi,cs,wi,Mi],fixedReturns:[ds,_i,Er],argumentsType:V.Fixed,returnsType:V.Fixed,error:us,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},op={[qe.HttpRequest]:Ni},Zb={...mc,...nc,...Sd,...nu,...Au,...op},lp=Me[n.Loop]["list-loop"],cp={id:"iterate-over-list-loop-return-declaration-parent-ref-id",type:n.GenericReference,entityId:$e.List,entityType:n.ActionDescriptor},dp={id:lp.outputs.results,type:n.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:null,required:!0,index:0,parent:cp,parentRelationType:A.FixedReturns},up={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:n.ArgumentDeclaration},pp={id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:up},yp={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:$e.List,entityType:n.ActionDescriptor},hp={id:lp.inputs.list,type:n.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:pp,index:0,parent:yp,parentRelationType:A.FixedArguments},qn={id:$e.List,type:n.ActionDescriptor,version:1,name:$e.List,description:"Iterates over a list of entities",fixedArguments:[hp],fixedReturns:[dp],error:null,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Xb=Me[n.Loop]["list-loop"],fp={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"manual-flow-loop-previous-iterations-results-declaration-id",entityType:n.ReturnDeclaration},mp={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:fp},Tp={id:"manual-flow-loop-previous-iterations-results-declaration-parent-ref-id",type:n.GenericReference,entityId:$e.ManualFlow,entityType:n.ActionDescriptor},Ep={id:Xb.outputs.results,type:n.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:mp,required:!0,index:1,parentRelationType:A.FixedReturns,parent:Tp},Rp={id:$e.ManualFlow,type:n.ActionDescriptor,version:1,name:$e.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.",fixedArguments:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[Ep],argumentsType:V.None,returnsType:V.Fixed,error:null,parent:null},Vi=Me[n.BuiltInBaseEntity][M.KEY_VALUE_PARAM],Qb={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:n.DataType},bp={id:"key-value-param-built-in-base-entity-name-property-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:n.Property},Kb={id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:null,parent:bp},vp={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:n.GenericReference,entityId:Vi.id,entityType:n.BuiltInBaseEntity},gp={required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Kb,description:"The name of the path parameter",parent:vp},ev={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:n.DataType},Ip={id:"key-value-param-built-in-base-entity-value-property-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:n.Property},tv={id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:null,parent:Ip},Pp={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:n.GenericReference,entityId:Vi.id,entityType:n.BuiltInBaseEntity},Dp={required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:tv,description:"The value of the path parameter",parent:Pp},ps={id:Vi.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:Vi.id,type:n.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[gp,Dp],abstractMethods:[],methods:[],extends:[]},Rr=Me[n.BuiltInBaseEntity][M.HTTP_ENDPOINT].properties,Sp={id:"endpointBuiltInCorsPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},Ap={id:"endpointBuiltInCorsPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:Rr.cors},Op={id:"endpointBuiltInCorsPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:["*"],parent:Sp,autogeneration:null,valueAsType:null},parent:Ap},Cp={id:"endpointBuiltInBaseEntityRef",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:M.HTTP_ENDPOINT},Bp={required:!0,id:Rr.cors,name:"Allowed origins",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:Op,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:Cp},wp={id:"endpointBuiltInPathPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInPathPropertyDataType"},Mp={id:"endpointBuiltInPathPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:Rr.path},_p={id:"endpointBuiltInPathPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.String,value:"/",parent:wp,autogeneration:null,valueAsType:null},parent:Mp},Np={id:"endpointBuiltInBaseEntityRefTwo",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:M.HTTP_ENDPOINT},ys={required:!0,id:Rr.path,name:"Path",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:_p,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:Np},Vp={id:"endpointBuiltInMethodPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},Lp={id:"endpointBuiltInMethodPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"endpointBuiltInMethodProperty"},$p={id:"endpointBuiltInMethodPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Rn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,value:"GET",name:g.Enum,parent:Vp,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Lp},Gp={id:"endpointBuiltInBaseEntityRefThree",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:M.HTTP_ENDPOINT},hs={required:!0,id:Rr.method,name:"Method",version:1,type:n.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:$p,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:Gp},Fp={id:"endpointRequestHeadersVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointRequestHeadersVariableDataType"},xp={id:"endpointRequestHeadersArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},Up={id:"endpointRequestHeadersVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:{},parent:Fp,autogeneration:null,valueAsType:null},parent:xp},jp={id:"endpointRequestBodyArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},kp={id:"endpointRequestBodyVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:jp},qp={id:"endpointRequestQueryParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},Jp={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},Wp={id:"endpointRequestQueryParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:ps,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:[],parent:qp,autogeneration:null,valueAsType:null},parent:Jp},Hp={id:"endpointPathParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointPathParamsVariableDataType"},Yp={id:"endpointPathParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},zp={id:"endpointPathParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:ps,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:[],parent:Hp,autogeneration:null,valueAsType:null},parent:Yp},Zp={id:"endpointReachedTriggerActionDescriptorRef",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Xp={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:n.ValueDescriptor,name:"Request headers",dataType:Up,required:!0,index:0,parentRelationType:A.FixedArguments,parent:Zp},Qp={id:"endpointReachedTriggerActionDescriptorRefTwo",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Kp={id:"endpointPathParamsArgumentDeclaration",type:n.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:zp,required:!0,index:1,parentRelationType:A.FixedArguments,parent:Qp},ey={id:"endpointReachedTriggerActionDescriptorRefThree",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},ty={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:n.ValueDescriptor,name:"Request query params",dataType:Wp,required:!0,index:2,parentRelationType:A.FixedArguments,parent:ey},ny={id:"endpointReachedTriggerActionDescriptorRefFour",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},ry={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:n.ValueDescriptor,name:"Request body",dataType:kp,index:3,required:!0,parentRelationType:A.FixedArguments,parent:ny},iy={id:"endpointResponseCodeReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},ay={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:iy},sy={id:"endpointReturnStatementRef",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},oy={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:n.ValueDescriptor,name:"Response code",dataType:ay,required:!0,index:0,parentRelationType:A.FixedReturns,parent:sy},ly={id:"endpointResponseHeadersDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointResponseHeadersDataType"},cy={id:"endpointResponseHeadersReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},dy={id:"endpointResponseHeadersDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:{},parent:ly,autogeneration:null,valueAsType:null},parent:cy},uy={id:"endpointReturnStatementRefTwo",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},py={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:n.ValueDescriptor,name:"Response headers",dataType:dy,required:!1,index:1,parentRelationType:A.FixedReturns,parent:uy},yy={id:"endpointResponseBodyReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},hy={id:"endpointResponseBodyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:yy},fy={id:"endpointReturnStatementRefThree",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},my={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:n.ValueDescriptor,name:"Response body",dataType:hy,required:!1,index:2,parentRelationType:A.FixedReturns,parent:fy},Ty={id:"endpointBuiltInBaseEntityRefFour",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:M.HTTP_ENDPOINT},fs={id:"endpointReachedTriggerActionDescriptor",type:n.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:V.Fixed,dynamicArgumentTypes:null,fixedArguments:[Xp,Kp,ty,ry],returnsType:V.Fixed,fixedReturns:[oy,py,my],error:null,dynamicReturnTypes:null,parent:Ty},ms={id:M.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:M.HTTP_ENDPOINT,type:n.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[Bp,ys,hs],abstractMethods:[fs],extends:[],methods:[]},Gt=Me[n.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,Ey={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:n.DataType},Ry={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:n.GenericReference,entityId:Gt.properties.identifier,entityType:n.Property},nv={id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:n.PrimitiveValue,version:1,name:g.String,value:null,parent:Ey,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Ry},Jn={id:"relational-database-built-in-base-entity-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},Li={required:!0,id:Gt.properties.identifier,name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:nv,description:"The name of the main database inside of the server instance where the data will be stored.",parent:Jn},rv={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:n.DataType},by={id:"relational-database-built-in-base-entity-username-property-ref-id",type:n.GenericReference,entityId:Gt.properties.username,entityType:n.Property},iv={id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:n.PrimitiveValue,version:1,name:g.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:n.DataType},autogeneration:null,valueAsType:null},parent:by},$i={required:!0,id:Gt.properties.username,name:"Username",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:iv,description:"The username that will be used to connect to the database.",parent:Jn},av={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:n.DataType},vy={id:"relational-database-built-in-base-entity-password-property-ref-id",type:n.GenericReference,entityId:Gt.properties.password,entityType:n.Property},sv={id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:vy},Gi={required:!0,id:Gt.properties.password,name:"Password",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:sv,description:"The password that will be used to connect to the database.",parent:Jn},gy={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:n.DataType},Iy={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:n.GenericReference,entityId:Gt.properties.minSize,entityType:n.Property},ov={id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:n.PrimitiveValue,version:1,name:g.Number,value:6,parent:gy,autogeneration:null,valueAsType:null},parent:Iy},Fi={required:!0,id:Gt.properties.minSize,name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:ov,description:"The minimum size of the database in GB.",parent:Jn},Py={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:n.DataType},Dy={id:"relational-database-built-in-base-entity-default-property-ref-id",type:n.GenericReference,entityId:Gt.properties.default,entityType:n.Property},lv={id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:jn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:n.PrimitiveValue,version:1,name:g.Boolean,value:!1,parent:Py,autogeneration:null,valueAsType:null},parent:Dy},Sy={required:!0,id:Gt.properties.default,name:"Default",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:lv,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:Jn},vn={id:M.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:M.RELATIONAL_DATABASE,type:n.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Li,$i,Gi,Fi,Sy],abstractMethods:[],methods:[],extends:[]},Ay={type:n.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:n.BuiltInBaseEntity,id:Et.DeletePersistedEntity},Ts={type:n.FunctionDeclaration,id:Et.DeletePersistedEntity,name:Et.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:Ay,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},Oy={type:n.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:n.BuiltInBaseEntity,id:Et.SoftDeletePersistedEntity},Cy={type:n.FunctionDeclaration,id:Et.SoftDeletePersistedEntity,name:Et.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:Oy,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},By=Me[n.BuiltInBaseEntity][M.PERSISTED_ENTITY].properties,cv={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:n.DataType},wy={id:"persisted-built-in-base-entity-database-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:n.Property},dv={id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:null,parent:wy},My={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},br={required:!0,id:By.database,name:"Database",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:dv,description:"The database that the entity belongs to.",parent:My},_y={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:n.DataType},Ny={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:n.Property},uv={id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:za,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.UUID,value:null,parent:_y,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Ny},Vy={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},Ly={required:!0,id:By.identifier,name:"Identifier",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:uv,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:Vy},pv={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:n.DataType},$y={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:n.Property},Gy={id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:null,asType:!1,defaultValue:null,parent:$y},Fy={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},xy={required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Gy,description:"The date and time when the entity was deleted.",parent:Fy},yv={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:n.DataType},Uy={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:n.Property},jy={id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Uy},ky={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},qy={required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:jy,description:"The date and time when the entity was created.",parent:ky},hv={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:n.DataType},Jy={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:n.Property},Wy={id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Jy},Hy={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},Yy={required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:n.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:Wy,description:"The date and time when the entity was last updated.",parent:Hy},Oe={id:M.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:M.PERSISTED_ENTITY,type:n.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[br,Ly,xy,qy,Yy],methods:[Ts,Cy],extends:[]},zy={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:M.HTTP_ENDPOINT},Es={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:n.ActionDescriptor,argumentsType:V.None,returnsType:V.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:zy},Zy=Me[n.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,fv={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:n.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:n.DataType},Xy={id:"cron-job-built-in-base-entity-expression-property-ref",type:n.GenericReference,entityId:Zy.properties.expression,entityType:n.Property},mv={id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:Xy},Qy={id:"cron-job-built-in-base-entity-ref",type:n.GenericReference,entityId:M.CRON_JOB,entityType:n.BuiltInBaseEntity},Ky={required:!0,id:Zy.properties.expression,name:"Cron expression",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:mv,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:Qy},eh={id:M.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:M.CRON_JOB,type:n.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Ky],methods:[],abstractMethods:[Es],extends:[]},th={type:n.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:n.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},Rs={id:"execution-built-in-entity-abort-method-id",type:n.FunctionDeclaration,version:1,name:Et.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:th},bs={id:M.EXECUTION,type:n.BuiltInBaseEntity,version:1,name:M.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:[Rs],abstractMethods:[]},Tv=Me[n.Condition]["not-empty"],nh={type:n.GenericReference,id:"not-empty-condition-ref",entityType:n.ActionDescriptor,entityId:St.NotEmpty},rh={id:Tv.inputs.leftHand,type:n.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:A.FixedArguments,index:0,parent:nh},Wn={type:n.ActionDescriptor,id:St.NotEmpty,version:1,name:St.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[rh],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.Fixed,returnsType:V.None,error:null},ih={[St.NotEmpty]:Wn},ah=Me[n.Condition]["more-than-or-equal"],sh={type:n.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:n.ActionDescriptor,entityId:De.MoreThanOrEqual},oh={id:ah.inputs.leftHand,type:n.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:A.FixedArguments,index:0,parent:sh},lh={type:n.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:n.ActionDescriptor,entityId:De.MoreThanOrEqual},ch={id:ah.inputs.rightHand,type:n.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:A.FixedArguments,index:1,parent:lh},vr={type:n.ActionDescriptor,id:De.MoreThanOrEqual,version:1,name:De.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[oh,ch],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.Fixed,returnsType:V.None,error:null},dh={[De.MoreThanOrEqual]:vr},Ev={...ih,...dh},vs={type:n.ActionDescriptor,id:Jt.PROJECT_PUBLICATION_COMPLETED,version:1,name:Jt.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,fixedArguments:[],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.None,returnsType:V.None,error:null},Rv={[Jt.PROJECT_PUBLICATION_COMPLETED]:vs},gs=Me[n.ValueDescriptor][ls.ActionOngoingProcessOutputValue],uh={type:n.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:n.ValueDescriptor,entityId:gs.id},ph={id:gs.dataType.id,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bs,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uh},yh={id:gs.id,type:n.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:ph,required:!0,index:0,parent:null,parentRelationType:A.OngoingProcessExecution};var H;(function(i){i.assertEqual=a=>a;function e(a){}i.assertIs=e;function t(a){throw new Error}i.assertNever=t,i.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},i.getValidEnumValues=a=>{const s=i.objectKeys(a).filter(d=>typeof a[a[d]]!="number"),o={};for(const d of s)o[d]=a[d];return i.objectValues(o)},i.objectValues=a=>i.objectKeys(a).map(function(s){return a[s]}),i.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},i.find=(a,s)=>{for(const o of a)if(s(o))return o},i.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}i.joinValues=r,i.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(H||(H={}));var Is;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(Is||(Is={}));const w=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nn=i=>{switch(typeof i){case"undefined":return w.undefined;case"string":return w.string;case"number":return isNaN(i)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(i)?w.array:i===null?w.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?w.promise:typeof Map<"u"&&i instanceof Map?w.map:typeof Set<"u"&&i instanceof Set?w.set:typeof Date<"u"&&i instanceof Date?w.date:w.object;default:return w.unknown}},I=H.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"]),bv=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class pt extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};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},r={_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)r._errors.push(t(o));else{let d=r,p=0;for(;p<o.path.length;){const y=o.path[p];p===o.path.length-1?(d[y]=d[y]||{_errors:[]},d[y]._errors.push(t(o))):d[y]=d[y]||{_errors:[]},d=d[y],p++}}};return a(this),r}static assert(e){if(!(e instanceof pt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];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))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}pt.create=i=>new pt(i);const Hn=(i,e)=>{let t;switch(i.code){case I.invalid_type:i.received===w.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case I.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,H.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:t=`Unrecognized key(s) in object: ${H.joinValues(i.keys,", ")}`;break;case I.invalid_union:t="Invalid input";break;case I.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${H.joinValues(i.options)}`;break;case I.invalid_enum_value:t=`Invalid enum value. Expected ${H.joinValues(i.options)}, received '${i.received}'`;break;case I.invalid_arguments:t="Invalid function arguments";break;case I.invalid_return_type:t="Invalid function return type";break;case I.invalid_date:t="Invalid date";break;case I.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:H.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case I.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case I.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case I.custom:t="Invalid input";break;case I.invalid_intersection_types:t="Intersection results could not be merged";break;case I.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case I.not_finite:t="Number must be finite";break;default:t=e.defaultError,H.assertNever(i)}return{message:t}};let hh=Hn;function vv(i){hh=i}function xi(){return hh}const Ui=i=>{const{data:e,path:t,errorMaps:r,issueData:a}=i,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let d="";const p=r.filter(y=>!!y).slice().reverse();for(const y of p)d=y(o,{data:e,defaultError:d}).message;return{...a,path:s,message:d}},gv=[];function C(i,e){const t=xi(),r=Ui({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===Hn?void 0:Hn].filter(a=>!!a)});i.common.issues.push(r)}class Ye{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return x;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const s=await a.key,o=await a.value;r.push({key:s,value:o})}return Ye.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return x;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const x=Object.freeze({status:"aborted"}),Yn=i=>({status:"dirty",value:i}),ot=i=>({status:"valid",value:i}),Ps=i=>i.status==="aborted",Ds=i=>i.status==="dirty",gr=i=>i.status==="valid",Ir=i=>typeof Promise<"u"&&i instanceof Promise;function ji(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)}function fh(i,e,t,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(i,t):a?a.value=t:e.set(i,t),t}typeof SuppressedError=="function"&&SuppressedError;var N;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(N||(N={}));var Pr,Dr;class Ft{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,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 mh=(i,e)=>{if(gr(e))return{success:!0,data:e.value};if(!i.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 pt(i.common.issues);return this._error=t,this._error}}};function k(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=i;if(e&&(t||r))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,d)=>{var p,y;const{message:f}=i;return o.code==="invalid_enum_value"?{message:f??d.defaultError}:typeof d.data>"u"?{message:(p=f??r)!==null&&p!==void 0?p:d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:(y=f??t)!==null&&y!==void 0?y:d.defaultError}},description:a}}class J{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 nn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ye,ctx:{common:e.parent.common,data:e.data,parsedType:nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ir(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 r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return mh(a,s)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={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:nn(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(Ir(a)?a:Promise.resolve(a));return mh(r,s)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),d=()=>s.addIssue({code:I.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new Nt({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ut.create(this,this._def)}nullable(){return on.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _t.create(this,this._def)}promise(){return Qn.create(this,this._def)}or(e){return Cr.create([this,e],this._def)}and(e){return Br.create(this,e,this._def)}transform(e){return new Nt({...k(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Vr({...k(this._def),innerType:this,defaultValue:t,typeName:F.ZodDefault})}brand(){return new Os({typeName:F.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Lr({...k(this._def),innerType:this,catchValue:t,typeName:F.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return $r.create(this,e)}readonly(){return Gr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Iv=/^c[^\s-]{8,}$/i,Pv=/^[0-9a-z]+$/,Dv=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sv=/^[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,Av=/^[a-z0-9_-]{21}$/i,Ov=/^[-+]?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)?)??$/,Cv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ss;const wv=/^(?:(?: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])$/,Mv=/^(([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})))$/,_v=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Th="((\\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])))",Nv=new RegExp(`^${Th}$`);function Eh(i){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Vv(i){return new RegExp(`^${Eh(i)}$`)}function Rh(i){let e=`${Th}T${Eh(i)}`;const t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Lv(i,e){return!!((e==="v4"||!e)&&wv.test(i)||(e==="v6"||!e)&&Mv.test(i))}class Mt extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){const s=this._getOrReturnCtx(e);return C(s,{code:I.invalid_type,expected:w.string,received:s.parsedType}),x}const r=new Ye;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),C(a,{code:I.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),C(a,{code:I.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,d=e.data.length<s.value;(o||d)&&(a=this._getOrReturnCtx(e,a),o?C(a,{code:I.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):d&&C(a,{code:I.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Cv.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"email",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Ss||(Ss=new RegExp(Bv,"u")),Ss.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"emoji",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Sv.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"uuid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Av.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"nanoid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Iv.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"cuid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Pv.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"cuid2",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Dv.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"ulid",code:I.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),C(a,{validation:"url",code:I.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"regex",code:I.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),C(a,{code:I.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.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),C(a,{code:I.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),C(a,{code:I.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Rh(s).test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{code:I.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Nv.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{code:I.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Vv(s).test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{code:I.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?Ov.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"duration",code:I.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Lv(e.data,s.version)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"ip",code:I.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?_v.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"base64",code:I.invalid_string,message:s.message}),r.dirty()):H.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:I.invalid_string,...N.errToObj(r)})}_addCheck(e){return new Mt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}datetime(e){var t,r;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:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...N.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,...N.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...N.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...N.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...N.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...N.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...N.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...N.errToObj(t)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new Mt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Mt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Mt({...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}}Mt.create=i=>{var e;return new Mt({checks:[],typeName:F.ZodString,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...k(i)})};function $v(i,e){const t=(i.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,s=parseInt(i.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class rn extends J{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)!==w.number){const s=this._getOrReturnCtx(e);return C(s,{code:I.invalid_type,expected:w.number,received:s.parsedType}),x}let r;const a=new Ye;for(const s of this._def.checks)s.kind==="int"?H.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{code:I.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),C(r,{code:I.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)&&(r=this._getOrReturnCtx(e,r),C(r,{code:I.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?$v(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),C(r,{code:I.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{code:I.not_finite,message:s.message}),a.dirty()):H.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,r,a){return new rn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:N.toString(a)}]})}_addCheck(e){return new rn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.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"&&H.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}rn.create=i=>new rn({checks:[],typeName:F.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...k(i)});class an extends J{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)!==w.bigint){const s=this._getOrReturnCtx(e);return C(s,{code:I.invalid_type,expected:w.bigint,received:s.parsedType}),x}let r;const a=new Ye;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),C(r,{code:I.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)&&(r=this._getOrReturnCtx(e,r),C(r,{code:I.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),C(r,{code:I.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):H.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,r,a){return new an({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:N.toString(a)}]})}_addCheck(e){return new an({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.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}}an.create=i=>{var e;return new an({checks:[],typeName:F.ZodBigInt,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...k(i)})};class Sr extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){const r=this._getOrReturnCtx(e);return C(r,{code:I.invalid_type,expected:w.boolean,received:r.parsedType}),x}return ot(e.data)}}Sr.create=i=>new Sr({typeName:F.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...k(i)});class gn extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){const s=this._getOrReturnCtx(e);return C(s,{code:I.invalid_type,expected:w.date,received:s.parsedType}),x}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return C(s,{code:I.invalid_date}),x}const r=new Ye;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),C(a,{code:I.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),C(a,{code:I.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):H.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new gn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:N.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}}gn.create=i=>new gn({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:F.ZodDate,...k(i)});class ki extends J{_parse(e){if(this._getType(e)!==w.symbol){const r=this._getOrReturnCtx(e);return C(r,{code:I.invalid_type,expected:w.symbol,received:r.parsedType}),x}return ot(e.data)}}ki.create=i=>new ki({typeName:F.ZodSymbol,...k(i)});class Ar extends J{_parse(e){if(this._getType(e)!==w.undefined){const r=this._getOrReturnCtx(e);return C(r,{code:I.invalid_type,expected:w.undefined,received:r.parsedType}),x}return ot(e.data)}}Ar.create=i=>new Ar({typeName:F.ZodUndefined,...k(i)});class Or extends J{_parse(e){if(this._getType(e)!==w.null){const r=this._getOrReturnCtx(e);return C(r,{code:I.invalid_type,expected:w.null,received:r.parsedType}),x}return ot(e.data)}}Or.create=i=>new Or({typeName:F.ZodNull,...k(i)});class zn extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return ot(e.data)}}zn.create=i=>new zn({typeName:F.ZodAny,...k(i)});class In extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ot(e.data)}}In.create=i=>new In({typeName:F.ZodUnknown,...k(i)});class Ht extends J{_parse(e){const t=this._getOrReturnCtx(e);return C(t,{code:I.invalid_type,expected:w.never,received:t.parsedType}),x}}Ht.create=i=>new Ht({typeName:F.ZodNever,...k(i)});class qi extends J{_parse(e){if(this._getType(e)!==w.undefined){const r=this._getOrReturnCtx(e);return C(r,{code:I.invalid_type,expected:w.void,received:r.parsedType}),x}return ot(e.data)}}qi.create=i=>new qi({typeName:F.ZodVoid,...k(i)});class _t extends J{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==w.array)return C(t,{code:I.invalid_type,expected:w.array,received:t.parsedType}),x;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,d=t.data.length<a.exactLength.value;(o||d)&&(C(t,{code:o?I.too_big:I.too_small,minimum:d?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(C(t,{code:I.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(C(t,{code:I.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,d)=>a.type._parseAsync(new Ft(t,o,t.path,d)))).then(o=>Ye.mergeArray(r,o));const s=[...t.data].map((o,d)=>a.type._parseSync(new Ft(t,o,t.path,d)));return Ye.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new _t({...this._def,minLength:{value:e,message:N.toString(t)}})}max(e,t){return new _t({...this._def,maxLength:{value:e,message:N.toString(t)}})}length(e,t){return new _t({...this._def,exactLength:{value:e,message:N.toString(t)}})}nonempty(e){return this.min(1,e)}}_t.create=(i,e)=>new _t({type:i,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...k(e)});function Zn(i){if(i instanceof Be){const e={};for(const t in i.shape){const r=i.shape[t];e[t]=Ut.create(Zn(r))}return new Be({...i._def,shape:()=>e})}else return i instanceof _t?new _t({...i._def,type:Zn(i.element)}):i instanceof Ut?Ut.create(Zn(i.unwrap())):i instanceof on?on.create(Zn(i.unwrap())):i instanceof xt?xt.create(i.items.map(e=>Zn(e))):i}class Be extends J{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=H.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==w.object){const y=this._getOrReturnCtx(e);return C(y,{code:I.invalid_type,expected:w.object,received:y.parsedType}),x}const{status:r,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof Ht&&this._def.unknownKeys==="strip"))for(const y in a.data)o.includes(y)||d.push(y);const p=[];for(const y of o){const f=s[y],m=a.data[y];p.push({key:{status:"valid",value:y},value:f._parse(new Ft(a,m,a.path,y)),alwaysSet:y in a.data})}if(this._def.catchall instanceof Ht){const y=this._def.unknownKeys;if(y==="passthrough")for(const f of d)p.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(y==="strict")d.length>0&&(C(a,{code:I.unrecognized_keys,keys:d}),r.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const f of d){const m=a.data[f];p.push({key:{status:"valid",value:f},value:y._parse(new Ft(a,m,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const y=[];for(const f of p){const m=await f.key,b=await f.value;y.push({key:m,value:b,alwaysSet:f.alwaysSet})}return y}).then(y=>Ye.mergeObjectSync(r,y)):Ye.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new Be({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,s,o,d;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(d=N.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(e){return new Be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:F.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Be({...this._def,catchall:e})}pick(e){const t={};return H.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Be({...this._def,shape:()=>t})}omit(e){const t={};return H.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Be({...this._def,shape:()=>t})}deepPartial(){return Zn(this)}partial(e){const t={};return H.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}),new Be({...this._def,shape:()=>t})}required(e){const t={};return H.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Ut;)s=s._def.innerType;t[r]=s}}),new Be({...this._def,shape:()=>t})}keyof(){return bh(H.objectKeys(this.shape))}}Be.create=(i,e)=>new Be({shape:()=>i,unknownKeys:"strip",catchall:Ht.create(),typeName:F.ZodObject,...k(e)}),Be.strictCreate=(i,e)=>new Be({shape:()=>i,unknownKeys:"strict",catchall:Ht.create(),typeName:F.ZodObject,...k(e)}),Be.lazycreate=(i,e)=>new Be({shape:i,unknownKeys:"strip",catchall:Ht.create(),typeName:F.ZodObject,...k(e)});class Cr extends J{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(s){for(const d of s)if(d.result.status==="valid")return d.result;for(const d of s)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const o=s.map(d=>new pt(d.ctx.common.issues));return C(t,{code:I.invalid_union,unionErrors:o}),x}if(t.common.async)return Promise.all(r.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 r){const y={...t,common:{...t.common,issues:[]},parent:null},f=p._parseSync({data:t.data,path:t.path,parent:y});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:y}),y.common.issues.length&&o.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const d=o.map(p=>new pt(p));return C(t,{code:I.invalid_union,unionErrors:d}),x}}get options(){return this._def.options}}Cr.create=(i,e)=>new Cr({options:i,typeName:F.ZodUnion,...k(e)});const Yt=i=>i instanceof Mr?Yt(i.schema):i instanceof Nt?Yt(i.innerType()):i instanceof _r?[i.value]:i instanceof sn?i.options:i instanceof Nr?H.objectValues(i.enum):i instanceof Vr?Yt(i._def.innerType):i instanceof Ar?[void 0]:i instanceof Or?[null]:i instanceof Ut?[void 0,...Yt(i.unwrap())]:i instanceof on?[null,...Yt(i.unwrap())]:i instanceof Os||i instanceof Gr?Yt(i.unwrap()):i instanceof Lr?Yt(i._def.innerType):[];class Ji extends J{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.object)return C(t,{code:I.invalid_type,expected:w.object,received:t.parsedType}),x;const r=this.discriminator,a=t.data[r],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}):(C(t,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const s of t){const o=Yt(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 d of o){if(a.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);a.set(d,s)}}return new Ji({typeName:F.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...k(r)})}}function As(i,e){const t=nn(i),r=nn(e);if(i===e)return{valid:!0,data:i};if(t===w.object&&r===w.object){const a=H.objectKeys(e),s=H.objectKeys(i).filter(d=>a.indexOf(d)!==-1),o={...i,...e};for(const d of s){const p=As(i[d],e[d]);if(!p.valid)return{valid:!1};o[d]=p.data}return{valid:!0,data:o}}else if(t===w.array&&r===w.array){if(i.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<i.length;s++){const o=i[s],d=e[s],p=As(o,d);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===w.date&&r===w.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}class Br extends J{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(s,o)=>{if(Ps(s)||Ps(o))return x;const d=As(s.value,o.value);return d.valid?((Ds(s)||Ds(o))&&t.dirty(),{status:t.value,value:d.data}):(C(r,{code:I.invalid_intersection_types}),x)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Br.create=(i,e,t)=>new Br({left:i,right:e,typeName:F.ZodIntersection,...k(t)});class xt extends J{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.array)return C(r,{code:I.invalid_type,expected:w.array,received:r.parsedType}),x;if(r.data.length<this._def.items.length)return C(r,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&r.data.length>this._def.items.length&&(C(r,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((o,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new Ft(r,o,r.path,d)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Ye.mergeArray(t,o)):Ye.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new xt({...this._def,rest:e})}}xt.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xt({items:i,typeName:F.ZodTuple,rest:null,...k(e)})};class wr extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.object)return C(r,{code:I.invalid_type,expected:w.object,received:r.parsedType}),x;const a=[],s=this._def.keyType,o=this._def.valueType;for(const d in r.data)a.push({key:s._parse(new Ft(r,d,r.path,d)),value:o._parse(new Ft(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?Ye.mergeObjectAsync(t,a):Ye.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof J?new wr({keyType:e,valueType:t,typeName:F.ZodRecord,...k(r)}):new wr({keyType:Mt.create(),valueType:e,typeName:F.ZodRecord,...k(t)})}}class Wi extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.map)return C(r,{code:I.invalid_type,expected:w.map,received:r.parsedType}),x;const a=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([d,p],y)=>({key:a._parse(new Ft(r,d,r.path,[y,"key"])),value:s._parse(new Ft(r,p,r.path,[y,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of o){const y=await p.key,f=await p.value;if(y.status==="aborted"||f.status==="aborted")return x;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),d.set(y.value,f.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const p of o){const y=p.key,f=p.value;if(y.status==="aborted"||f.status==="aborted")return x;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),d.set(y.value,f.value)}return{status:t.value,value:d}}}}Wi.create=(i,e,t)=>new Wi({valueType:e,keyType:i,typeName:F.ZodMap,...k(t)});class Pn extends J{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.set)return C(r,{code:I.invalid_type,expected:w.set,received:r.parsedType}),x;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(C(r,{code:I.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(C(r,{code:I.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 y=new Set;for(const f of p){if(f.status==="aborted")return x;f.status==="dirty"&&t.dirty(),y.add(f.value)}return{status:t.value,value:y}}const d=[...r.data.values()].map((p,y)=>s._parse(new Ft(r,p,r.path,y)));return r.common.async?Promise.all(d).then(p=>o(p)):o(d)}min(e,t){return new Pn({...this._def,minSize:{value:e,message:N.toString(t)}})}max(e,t){return new Pn({...this._def,maxSize:{value:e,message:N.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Pn.create=(i,e)=>new Pn({valueType:i,minSize:null,maxSize:null,typeName:F.ZodSet,...k(e)});class Xn extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.function)return C(t,{code:I.invalid_type,expected:w.function,received:t.parsedType}),x;function r(d,p){return Ui({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xi(),Hn].filter(y=>!!y),issueData:{code:I.invalid_arguments,argumentsError:p}})}function a(d,p){return Ui({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xi(),Hn].filter(y=>!!y),issueData:{code:I.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Qn){const d=this;return ot(async function(...p){const y=new pt([]),f=await d._def.args.parseAsync(p,s).catch(P=>{throw y.addIssue(r(p,P)),y}),m=await Reflect.apply(o,this,f);return await d._def.returns._def.type.parseAsync(m,s).catch(P=>{throw y.addIssue(a(m,P)),y})})}else{const d=this;return ot(function(...p){const y=d._def.args.safeParse(p,s);if(!y.success)throw new pt([r(p,y.error)]);const f=Reflect.apply(o,this,y.data),m=d._def.returns.safeParse(f,s);if(!m.success)throw new pt([a(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xn({...this._def,args:xt.create(e).rest(In.create())})}returns(e){return new Xn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Xn({args:e||xt.create([]).rest(In.create()),returns:t||In.create(),typeName:F.ZodFunction,...k(r)})}}class Mr extends J{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})}}Mr.create=(i,e)=>new Mr({getter:i,typeName:F.ZodLazy,...k(e)});class _r extends J{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return C(t,{received:t.data,code:I.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}_r.create=(i,e)=>new _r({value:i,typeName:F.ZodLiteral,...k(e)});function bh(i,e){return new sn({values:i,typeName:F.ZodEnum,...k(e)})}class sn extends J{constructor(){super(...arguments),Pr.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return C(t,{expected:H.joinValues(r),received:t.parsedType,code:I.invalid_type}),x}if(ji(this,Pr,"f")||fh(this,Pr,new Set(this._def.values),"f"),!ji(this,Pr,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return C(t,{received:t.data,code:I.invalid_enum_value,options:r}),x}return ot(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 sn.create(e,{...this._def,...t})}exclude(e,t=this._def){return sn.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}Pr=new WeakMap,sn.create=bh;class Nr extends J{constructor(){super(...arguments),Dr.set(this,void 0)}_parse(e){const t=H.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==w.string&&r.parsedType!==w.number){const a=H.objectValues(t);return C(r,{expected:H.joinValues(a),received:r.parsedType,code:I.invalid_type}),x}if(ji(this,Dr,"f")||fh(this,Dr,new Set(H.getValidEnumValues(this._def.values)),"f"),!ji(this,Dr,"f").has(e.data)){const a=H.objectValues(t);return C(r,{received:r.data,code:I.invalid_enum_value,options:a}),x}return ot(e.data)}get enum(){return this._def.values}}Dr=new WeakMap,Nr.create=(i,e)=>new Nr({values:i,typeName:F.ZodNativeEnum,...k(e)});class Qn extends J{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&t.common.async===!1)return C(t,{code:I.invalid_type,expected:w.promise,received:t.parsedType}),x;const r=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return ot(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Qn.create=(i,e)=>new Qn({type:i,typeName:F.ZodPromise,...k(e)});class Nt extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{C(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async d=>{if(t.value==="aborted")return x;const p=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return p.status==="aborted"?x:p.status==="dirty"||t.value==="dirty"?Yn(p.value):p});{if(t.value==="aborted")return x;const d=this._def.schema._parseSync({data:o,path:r.path,parent:r});return d.status==="aborted"?x:d.status==="dirty"||t.value==="dirty"?Yn(d.value):d}}if(a.type==="refinement"){const o=d=>{const p=a.refinement(d,s);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?x:(d.status==="dirty"&&t.dirty(),o(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?x:(d.status==="dirty"&&t.dirty(),o(d.value).then(()=>({status:t.value,value:d.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!gr(o))return o;const d=a.transform(o.value,s);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>gr(o)?Promise.resolve(a.transform(o.value,s)).then(d=>({status:t.value,value:d})):o);H.assertNever(a)}}Nt.create=(i,e,t)=>new Nt({schema:i,typeName:F.ZodEffects,effect:e,...k(t)}),Nt.createWithPreprocess=(i,e,t)=>new Nt({schema:e,effect:{type:"preprocess",transform:i},typeName:F.ZodEffects,...k(t)});class Ut extends J{_parse(e){return this._getType(e)===w.undefined?ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ut.create=(i,e)=>new Ut({innerType:i,typeName:F.ZodOptional,...k(e)});class on extends J{_parse(e){return this._getType(e)===w.null?ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}on.create=(i,e)=>new on({innerType:i,typeName:F.ZodNullable,...k(e)});class Vr extends J{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===w.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Vr.create=(i,e)=>new Vr({innerType:i,typeName:F.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class Lr extends J{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ir(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new pt(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new pt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Lr.create=(i,e)=>new Lr({innerType:i,typeName:F.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class Hi extends J{_parse(e){if(this._getType(e)!==w.nan){const r=this._getOrReturnCtx(e);return C(r,{code:I.invalid_type,expected:w.nan,received:r.parsedType}),x}return{status:"valid",value:e.data}}}Hi.create=i=>new Hi({typeName:F.ZodNaN,...k(i)});const Gv=Symbol("zod_brand");class Os extends J{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class $r extends J{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?x:s.status==="dirty"?(t.dirty(),Yn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?x:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new $r({in:e,out:t,typeName:F.ZodPipeline})}}class Gr extends J{_parse(e){const t=this._def.innerType._parse(e),r=a=>(gr(a)&&(a.value=Object.freeze(a.value)),a);return Ir(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}Gr.create=(i,e)=>new Gr({innerType:i,typeName:F.ZodReadonly,...k(e)});function vh(i,e={},t){return i?zn.create().superRefine((r,a)=>{var s,o;if(!i(r)){const d=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,p=(o=(s=d.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,y=typeof d=="string"?{message:d}:d;a.addIssue({code:"custom",...y,fatal:p})}}):zn.create()}const Fv={object:Be.lazycreate};var F;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(F||(F={}));const xv=(i,e={message:`Input not instance of ${i.name}`})=>vh(t=>t instanceof i,e),Yi=Mt.create,Cs=rn.create,Uv=Hi.create,jv=an.create,Bs=Sr.create,gh=gn.create,kv=ki.create,qv=Ar.create,Ih=Or.create,Jv=zn.create,zi=In.create,Wv=Ht.create,Hv=qi.create,Yv=_t.create,Ph=Be.create,zv=Be.strictCreate,Zv=Cr.create,Xv=Ji.create,Qv=Br.create,Kv=xt.create,Dh=wr.create,eg=Wi.create,tg=Pn.create,ng=Xn.create,rg=Mr.create,ig=_r.create,Sh=sn.create,ag=Nr.create,sg=Qn.create,Ah=Nt.create,og=Ut.create,lg=on.create,cg=Nt.createWithPreprocess,dg=$r.create;var c=Object.freeze({__proto__:null,defaultErrorMap:Hn,setErrorMap:vv,getErrorMap:xi,makeIssue:Ui,EMPTY_PATH:gv,addIssueToContext:C,ParseStatus:Ye,INVALID:x,DIRTY:Yn,OK:ot,isAborted:Ps,isDirty:Ds,isValid:gr,isAsync:Ir,get util(){return H},get objectUtil(){return Is},ZodParsedType:w,getParsedType:nn,ZodType:J,datetimeRegex:Rh,ZodString:Mt,ZodNumber:rn,ZodBigInt:an,ZodBoolean:Sr,ZodDate:gn,ZodSymbol:ki,ZodUndefined:Ar,ZodNull:Or,ZodAny:zn,ZodUnknown:In,ZodNever:Ht,ZodVoid:qi,ZodArray:_t,ZodObject:Be,ZodUnion:Cr,ZodDiscriminatedUnion:Ji,ZodIntersection:Br,ZodTuple:xt,ZodRecord:wr,ZodMap:Wi,ZodSet:Pn,ZodFunction:Xn,ZodLazy:Mr,ZodLiteral:_r,ZodEnum:sn,ZodNativeEnum:Nr,ZodPromise:Qn,ZodEffects:Nt,ZodTransformer:Nt,ZodOptional:Ut,ZodNullable:on,ZodDefault:Vr,ZodCatch:Lr,ZodNaN:Hi,BRAND:Gv,ZodBranded:Os,ZodPipeline:$r,ZodReadonly:Gr,custom:vh,Schema:J,ZodSchema:J,late:Fv,get ZodFirstPartyTypeKind(){return F},coerce:{string:i=>Mt.create({...i,coerce:!0}),number:i=>rn.create({...i,coerce:!0}),boolean:i=>Sr.create({...i,coerce:!0}),bigint:i=>an.create({...i,coerce:!0}),date:i=>gn.create({...i,coerce:!0})},any:Jv,array:Yv,bigint:jv,boolean:Bs,date:gh,discriminatedUnion:Xv,effect:Ah,enum:Sh,function:ng,instanceof:xv,intersection:Qv,lazy:rg,literal:ig,map:eg,nan:Uv,nativeEnum:ag,never:Wv,null:Ih,nullable:lg,number:Cs,object:Ph,oboolean:()=>Bs().optional(),onumber:()=>Cs().optional(),optional:og,ostring:()=>Yi().optional(),pipeline:dg,preprocess:cg,promise:sg,record:Dh,set:tg,strictObject:zv,string:Yi,symbol:kv,transformer:Ah,tuple:Kv,undefined:qv,union:Zv,unknown:zi,void:Hv,NEVER:x,ZodIssueCode:I,quotelessJson:bv,ZodError:pt});function Oh(i){var a,s,o;if(!(i!=null&&i.dataType))return zi();const e=i.dataType.isNullable||!1,t=i.dataType.isList||!1;let r=zi();if(((a=i.dataType.entity)==null?void 0:a.type)===n.PrimitiveEntity)switch(i.dataType.entity.name){case g.String:r=Yi();break;case g.JSON:r=Dh(zi());break;case g.Number:r=Cs();break;case g.Boolean:r=Bs();break;case g.Date:r=gh();break;case g.Enum:{const d=i.dataType.options||[];if(d.length===0)throw new Error(`Enum property ${i.name} has no options`);r=Sh(d);break}case g.Null:r=Ih();break;case g.UUID:r=Yi().uuid();break}else if(((s=i.dataType.entity)==null?void 0:s.type)===n.CustomEntity)r=Ch(i.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=i.dataType.entity)==null?void 0:o.type}`);return e&&(r=r.nullable()),t&&(r=r.array()),r}function Ch(i){const e=Ph({});for(const t of i.properties){const r=Oh(t);e.shape[t.name]=r}return e}function Bh(i){const e=i.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function wh(i){const e=i.rangeEnd;return new Date(Math.random()*e.getTime())}function Mh(i){const e=i.rangeStart,t=i.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function _h(i){return i.rangeStart&&i.rangeEnd?Mh(i):i.rangeStart?Bh(i):i.rangeEnd?wh(i):new Date}function ug(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function pg(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var a=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return i[r]}})}),t}var Zi,yg=new Uint8Array(16);function Nh(){if(!Zi&&(Zi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Zi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zi(yg)}const hg=/^(?:[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;function Xi(i){return typeof i=="string"&&hg.test(i)}for(var Je=[],ws=0;ws<256;++ws)Je.push((ws+256).toString(16).substr(1));function Qi(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Je[i[e+0]]+Je[i[e+1]]+Je[i[e+2]]+Je[i[e+3]]+"-"+Je[i[e+4]]+Je[i[e+5]]+"-"+Je[i[e+6]]+Je[i[e+7]]+"-"+Je[i[e+8]]+Je[i[e+9]]+"-"+Je[i[e+10]]+Je[i[e+11]]+Je[i[e+12]]+Je[i[e+13]]+Je[i[e+14]]+Je[i[e+15]]).toLowerCase();if(!Xi(t))throw TypeError("Stringified UUID is invalid");return t}var Vh,Ms,_s=0,Ns=0;function fg(i,e,t){var r=e&&t||0,a=e||new Array(16);i=i||{};var s=i.node||Vh,o=i.clockseq!==void 0?i.clockseq:Ms;if(s==null||o==null){var d=i.random||(i.rng||Nh)();s==null&&(s=Vh=[d[0]|1,d[1],d[2],d[3],d[4],d[5]]),o==null&&(o=Ms=(d[6]<<8|d[7])&16383)}var p=i.msecs!==void 0?i.msecs:Date.now(),y=i.nsecs!==void 0?i.nsecs:Ns+1,f=p-_s+(y-Ns)/1e4;if(f<0&&i.clockseq===void 0&&(o=o+1&16383),(f<0||p>_s)&&i.nsecs===void 0&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_s=p,Ns=y,Ms=o,p+=122192928e5;var m=((p&268435455)*1e4+y)%4294967296;a[r++]=m>>>24&255,a[r++]=m>>>16&255,a[r++]=m>>>8&255,a[r++]=m&255;var b=p/4294967296*1e4&268435455;a[r++]=b>>>8&255,a[r++]=b&255,a[r++]=b>>>24&15|16,a[r++]=b>>>16&255,a[r++]=o>>>8|128,a[r++]=o&255;for(var P=0;P<6;++P)a[r+P]=s[P];return e||Qi(a)}function Lh(i){if(!Xi(i))throw TypeError("Invalid UUID");var e,t=new Uint8Array(16);return t[0]=(e=parseInt(i.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(i.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(i.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(i.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(i.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}function mg(i){i=unescape(encodeURIComponent(i));for(var e=[],t=0;t<i.length;++t)e.push(i.charCodeAt(t));return e}var Tg="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Eg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function $h(i,e,t){function r(a,s,o,d){if(typeof a=="string"&&(a=mg(a)),typeof s=="string"&&(s=Lh(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var p=new Uint8Array(16+a.length);if(p.set(s),p.set(a,s.length),p=t(p),p[6]=p[6]&15|e,p[8]=p[8]&63|128,o){d=d||0;for(var y=0;y<16;++y)o[d+y]=p[y];return o}return Qi(p)}try{r.name=i}catch{}return r.DNS=Tg,r.URL=Eg,r}function Rg(i){if(typeof i=="string"){var e=unescape(encodeURIComponent(i));i=new Uint8Array(e.length);for(var t=0;t<e.length;++t)i[t]=e.charCodeAt(t)}return bg(vg(gg(i),i.length*8))}function bg(i){for(var e=[],t=i.length*32,r="0123456789abcdef",a=0;a<t;a+=8){var s=i[a>>5]>>>a%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);e.push(o)}return e}function Gh(i){return(i+64>>>9<<4)+14+1}function vg(i,e){i[e>>5]|=128<<e%32,i[Gh(e)-1]=e;for(var t=1732584193,r=-271733879,a=-1732584194,s=271733878,o=0;o<i.length;o+=16){var d=t,p=r,y=a,f=s;t=ze(t,r,a,s,i[o],7,-680876936),s=ze(s,t,r,a,i[o+1],12,-389564586),a=ze(a,s,t,r,i[o+2],17,606105819),r=ze(r,a,s,t,i[o+3],22,-1044525330),t=ze(t,r,a,s,i[o+4],7,-176418897),s=ze(s,t,r,a,i[o+5],12,1200080426),a=ze(a,s,t,r,i[o+6],17,-1473231341),r=ze(r,a,s,t,i[o+7],22,-45705983),t=ze(t,r,a,s,i[o+8],7,1770035416),s=ze(s,t,r,a,i[o+9],12,-1958414417),a=ze(a,s,t,r,i[o+10],17,-42063),r=ze(r,a,s,t,i[o+11],22,-1990404162),t=ze(t,r,a,s,i[o+12],7,1804603682),s=ze(s,t,r,a,i[o+13],12,-40341101),a=ze(a,s,t,r,i[o+14],17,-1502002290),r=ze(r,a,s,t,i[o+15],22,1236535329),t=Ze(t,r,a,s,i[o+1],5,-165796510),s=Ze(s,t,r,a,i[o+6],9,-1069501632),a=Ze(a,s,t,r,i[o+11],14,643717713),r=Ze(r,a,s,t,i[o],20,-373897302),t=Ze(t,r,a,s,i[o+5],5,-701558691),s=Ze(s,t,r,a,i[o+10],9,38016083),a=Ze(a,s,t,r,i[o+15],14,-660478335),r=Ze(r,a,s,t,i[o+4],20,-405537848),t=Ze(t,r,a,s,i[o+9],5,568446438),s=Ze(s,t,r,a,i[o+14],9,-1019803690),a=Ze(a,s,t,r,i[o+3],14,-187363961),r=Ze(r,a,s,t,i[o+8],20,1163531501),t=Ze(t,r,a,s,i[o+13],5,-1444681467),s=Ze(s,t,r,a,i[o+2],9,-51403784),a=Ze(a,s,t,r,i[o+7],14,1735328473),r=Ze(r,a,s,t,i[o+12],20,-1926607734),t=Xe(t,r,a,s,i[o+5],4,-378558),s=Xe(s,t,r,a,i[o+8],11,-2022574463),a=Xe(a,s,t,r,i[o+11],16,1839030562),r=Xe(r,a,s,t,i[o+14],23,-35309556),t=Xe(t,r,a,s,i[o+1],4,-1530992060),s=Xe(s,t,r,a,i[o+4],11,1272893353),a=Xe(a,s,t,r,i[o+7],16,-155497632),r=Xe(r,a,s,t,i[o+10],23,-1094730640),t=Xe(t,r,a,s,i[o+13],4,681279174),s=Xe(s,t,r,a,i[o],11,-358537222),a=Xe(a,s,t,r,i[o+3],16,-722521979),r=Xe(r,a,s,t,i[o+6],23,76029189),t=Xe(t,r,a,s,i[o+9],4,-640364487),s=Xe(s,t,r,a,i[o+12],11,-421815835),a=Xe(a,s,t,r,i[o+15],16,530742520),r=Xe(r,a,s,t,i[o+2],23,-995338651),t=Qe(t,r,a,s,i[o],6,-198630844),s=Qe(s,t,r,a,i[o+7],10,1126891415),a=Qe(a,s,t,r,i[o+14],15,-1416354905),r=Qe(r,a,s,t,i[o+5],21,-57434055),t=Qe(t,r,a,s,i[o+12],6,1700485571),s=Qe(s,t,r,a,i[o+3],10,-1894986606),a=Qe(a,s,t,r,i[o+10],15,-1051523),r=Qe(r,a,s,t,i[o+1],21,-2054922799),t=Qe(t,r,a,s,i[o+8],6,1873313359),s=Qe(s,t,r,a,i[o+15],10,-30611744),a=Qe(a,s,t,r,i[o+6],15,-1560198380),r=Qe(r,a,s,t,i[o+13],21,1309151649),t=Qe(t,r,a,s,i[o+4],6,-145523070),s=Qe(s,t,r,a,i[o+11],10,-1120210379),a=Qe(a,s,t,r,i[o+2],15,718787259),r=Qe(r,a,s,t,i[o+9],21,-343485551),t=ln(t,d),r=ln(r,p),a=ln(a,y),s=ln(s,f)}return[t,r,a,s]}function gg(i){if(i.length===0)return[];for(var e=i.length*8,t=new Uint32Array(Gh(e)),r=0;r<e;r+=8)t[r>>5]|=(i[r/8]&255)<<r%32;return t}function ln(i,e){var t=(i&65535)+(e&65535),r=(i>>16)+(e>>16)+(t>>16);return r<<16|t&65535}function Ig(i,e){return i<<e|i>>>32-e}function Ki(i,e,t,r,a,s){return ln(Ig(ln(ln(e,i),ln(r,s)),a),t)}function ze(i,e,t,r,a,s,o){return Ki(e&t|~e&r,i,e,a,s,o)}function Ze(i,e,t,r,a,s,o){return Ki(e&r|t&~r,i,e,a,s,o)}function Xe(i,e,t,r,a,s,o){return Ki(e^t^r,i,e,a,s,o)}function Qe(i,e,t,r,a,s,o){return Ki(t^(e|~r),i,e,a,s,o)}var Pg=$h("v3",48,Rg);const Dg=Pg;function Sg(i,e,t){i=i||{};var r=i.random||(i.rng||Nh)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(var a=0;a<16;++a)e[t+a]=r[a];return e}return Qi(r)}function Ag(i,e,t,r){switch(i){case 0:return e&t^~e&r;case 1:return e^t^r;case 2:return e&t^e&r^t&r;case 3:return e^t^r}}function Vs(i,e){return i<<e|i>>>32-e}function Og(i){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){var r=unescape(encodeURIComponent(i));i=[];for(var a=0;a<r.length;++a)i.push(r.charCodeAt(a))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);for(var s=i.length/4+2,o=Math.ceil(s/16),d=new Array(o),p=0;p<o;++p){for(var y=new Uint32Array(16),f=0;f<16;++f)y[f]=i[p*64+f*4]<<24|i[p*64+f*4+1]<<16|i[p*64+f*4+2]<<8|i[p*64+f*4+3];d[p]=y}d[o-1][14]=(i.length-1)*8/Math.pow(2,32),d[o-1][14]=Math.floor(d[o-1][14]),d[o-1][15]=(i.length-1)*8&4294967295;for(var m=0;m<o;++m){for(var b=new Uint32Array(80),P=0;P<16;++P)b[P]=d[m][P];for(var O=16;O<80;++O)b[O]=Vs(b[O-3]^b[O-8]^b[O-14]^b[O-16],1);for(var $=t[0],ve=t[1],tt=t[2],ge=t[3],Ja=t[4],xn=0;xn<80;++xn){var Jb=Math.floor(xn/20),$8=Vs($,5)+Ag(Jb,ve,tt,ge)+Ja+e[Jb]+b[xn]>>>0;Ja=ge,ge=tt,tt=Vs(ve,30)>>>0,ve=$,$=$8}t[0]=t[0]+$>>>0,t[1]=t[1]+ve>>>0,t[2]=t[2]+tt>>>0,t[3]=t[3]+ge>>>0,t[4]=t[4]+Ja>>>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 Cg=$h("v5",80,Og);const Bg=Cg,wg="00000000-0000-0000-0000-000000000000";function Mg(i){if(!Xi(i))throw TypeError("Invalid UUID");return parseInt(i.substr(14,1),16)}const _g=pg(Object.freeze(Object.defineProperty({__proto__:null,NIL:wg,parse:Lh,stringify:Qi,v1:fg,v3:Dg,v4:Sg,v5:Bg,validate:Xi,version:Mg},Symbol.toStringTag,{value:"Module"})));function Ls(i,e){if(!i||!e||!i.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=i,this.dstAlphabet=e}Ls.prototype.convert=function(i){var e,t,r,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,d=i.length,p=typeof i=="string"?"":[];if(!this.isValid(i))throw new Error('Number "'+i+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return i;for(e=0;e<d;e++)a[e]=this.srcAlphabet.indexOf(i[e]);do{for(t=0,r=0,e=0;e<d;e++)t=t*s+a[e],t>=o?(a[r++]=parseInt(t/o,10),t=t%o):r>0&&(a[r++]=0);d=r,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(r!==0);return p},Ls.prototype.isValid=function(i){for(var e=0;e<i.length;++e)if(this.srcAlphabet.indexOf(i[e])===-1)return!1;return!0};var Ng=Ls,Vg=Ng;function Fr(i,e){var t=new Vg(i,e);return function(r){return t.convert(r)}}Fr.BIN="01",Fr.OCT="01234567",Fr.DEC="0123456789",Fr.HEX="0123456789abcdef";var Lg=Fr;const{v4:$s}=_g,ea=Lg,Gs="123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",$g="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",Gg={consistentLength:!0};let Fs;const Fh=(i,e,t)=>{const r=e(i.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?r:r.padStart(t.shortIdLength,t.paddingChar)},Fg=(i,e)=>{const r=e(i).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[r[1],r[2],r[3],r[4],r[5]].join("-")},xg=i=>Math.ceil(Math.log(2**128)/Math.log(i));var Ug=(()=>{const i=(e,t)=>{const r=e||Gs,a={...Gg,...t};if([...new Set(Array.from(r))].length!==r.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=xg(r.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:r[0]},d=ea(ea.HEX,r),p=ea(r,ea.HEX),y=()=>Fh($s(),d,o),f={new:y,generate:y,uuid:$s,fromUUID:m=>Fh(m,d,o),toUUID:m=>Fg(m,p),alphabet:r,maxLength:s};return Object.freeze(f),f};return i.constants={flickrBase58:Gs,cookieBase90:$g},i.uuid=$s,i.generate=()=>(Fs||(Fs=i(Gs).generate),Fs()),i})();const xh=ug(Ug),jg=xh();function Uh(){return jg.uuid()}function jh(i){return i.rangeStart+Math.random()}function kh(i){const e=i.rangeEnd;return Math.random()*e}function qh(i){const e=i.rangeStart,t=i.rangeEnd;return Math.random()*(t-e)+e}function Jh(i){return i.rangeStart&&i.rangeEnd?qh(i):i.rangeStart?jh(i):i.rangeEnd?kh(i):Math.random()}function Wh(i){const e=i.rangeStart;return Math.random().toString(36).substring(e)}function Hh(i){const e=i.rangeEnd;return Math.random().toString(36).substring(0,e)}function Yh(i){const e=i.rangeStart,t=i.rangeEnd;return Math.random().toString(36).substring(e,t)}function zh(i){return i.rangeStart&&i.rangeEnd?Yh(i):i.rangeStart?Wh(i):i.rangeEnd?Hh(i):Math.random().toString(36)}function Zh(i){return Math.random()>=.5}function kg(i){if(!i||!i.autogeneration)return null;switch(i.autogeneration.type){case Le.CurrentDateAndTime:if(i.name===g.Date)return new Date;case Le.Random:{if(i.name===g.Date)return _h(i.autogeneration);if(i.name===g.Number)return Jh(i.autogeneration);if(i.name===g.String)return zh(i.autogeneration);if(i.name===g.Boolean)return Zh(i.autogeneration)}case Le.Unique:if(i.name===g.UUID)return Uh();default:throw new Error(`Generating a ${i.autogeneration.type} value for a ${i.name} is not supported`)}}const q="e7eb5382-3d99-44fd-972a-b8b1e819f6be",xs="global-user-variable-id",Xh="last-executed-timestamp-variable-id",qg={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:n.DataType},Jg={id:"alternative-relational-database-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:n.Property},Wg={id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.String,value:null,parent:qg,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Jg},ta={id:"alternative-relational-database-entity-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},Hg={required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!1,implements:Li,static:!0,index:0,dataType:Wg,description:"The name of the main database inside of the server instance where the data will be stored.",parent:ta};n.GenericReference,n.DataType;const Yg={id:"alternative-relational-database-entity-username-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:n.Property},zg={id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:Yg},Zg={required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:n.Property,private:!1,abstract:!1,implements:$i,static:!0,index:1,dataType:zg,description:"The username that will be used to connect to the database.",parent:ta};n.GenericReference,n.DataType;const Xg={id:"alternative-relational-database-entity-password-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:n.Property},Qg={id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:Xg},Kg={required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:n.Property,private:!1,abstract:!1,implements:Gi,static:!0,index:2,dataType:Qg,description:"The password that will be used to connect to the database.",parent:ta},eI={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:n.DataType},tI={id:"alternative-relational-database-entity-min-size-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:n.Property},nI={id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.Number,value:6,parent:eI,autogeneration:null,valueAsType:null},parent:tI},rI={required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!1,implements:Fi,static:!0,index:3,dataType:nI,description:"The minimum size of the database in GB.",parent:ta},iI={id:"alternative-relational-database-entity-parent-ref-id",type:n.GenericReference,entityId:q,entityType:n.Project},Qh={id:"alternative-relational-database-entity-id",type:n.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[Hg,Zg,Kg,rI],methods:[],abstractMethods:[],extends:[],implements:[vn],x:0,y:0,parent:iI},aI={id:"animal-prototype-database-property-ref-id",type:n.GenericReference,entityId:"animal-prototype-database-property-id",entityType:n.Property},sI={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:n.DataType},oI={id:"animal-prototype-database-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:Qh,autogeneration:null,parent:sI},parent:aI},lI={id:"animal-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},cI={required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:br,static:!0,index:0,dataType:oI,description:"The database that the entity belongs to.",parent:lI},dI={type:n.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:n.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},uI={id:"c1930577-9e79-48a6-8905-be24611015c1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:dI},pI={type:n.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},yI={required:!0,type:n.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",implements:null,static:!1,private:!1,index:0,dataType:uI,abstract:!1,parent:pI},hI={type:n.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:n.Project,entityId:q},fI={type:n.CustomEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[cI,yI],methods:[],extends:[],implements:[Oe],x:0,y:0,parent:hI},mI={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:n.DataType},TI={id:"default-relational-database-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:n.Property},EI={id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.String,value:null,parent:mI,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:TI},na={id:"default-relational-database-entity-ref-id",type:n.GenericReference,entityId:M.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},RI={required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!1,implements:Li,static:!0,index:0,dataType:EI,description:"The name of the main database inside of the server instance where the data will be stored.",parent:na};n.GenericReference,n.DataType;const bI={id:"default-relational-database-entity-username-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:n.Property},vI={id:"default-relational-database-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:bI},gI={required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:n.Property,private:!1,abstract:!1,implements:$i,static:!0,index:1,dataType:vI,description:"The username that will be used to connect to the database.",parent:na};n.GenericReference,n.DataType;const II={id:"default-relational-database-entity-password-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:n.Property},PI={id:"default-relational-database-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:II},DI={required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:n.Property,private:!1,abstract:!1,implements:Gi,static:!0,index:2,dataType:PI,description:"The password that will be used to connect to the database.",parent:na},SI={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:n.DataType},AI={id:"default-relational-database-entity-min-size-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:n.Property},OI={id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.Number,value:6,parent:SI,autogeneration:null,valueAsType:null},parent:AI},CI={required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!1,implements:Fi,static:!0,index:3,dataType:OI,description:"The minimum size of the database in GB.",parent:na},BI={id:"default-relational-database-entity-parent-ref-id",type:n.GenericReference,entityId:q,entityType:n.Project},Us={id:"default-relational-database-entity-id",type:n.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[RI,gI,DI,CI],methods:[],abstractMethods:[],extends:[],implements:[vn],x:0,y:0,parent:BI},wI={id:"user-prototype-database-property-data-type-ref-id",type:n.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:n.DataType},MI={id:"user-prototype-database-property-ref-id",type:n.GenericReference,entityId:"user-prototype-database-property-id",entityType:n.Property},_I={id:"user-prototype-database-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:Us,autogeneration:null,parent:wI},parent:MI},NI={id:"user-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},VI={required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:br,static:!0,index:0,dataType:_I,description:"The database that the entity belongs to.",parent:NI},LI={type:n.GenericReference,id:"user-prototype-parent-ref-id",entityType:n.Project,entityId:q},js={type:n.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Oe],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[VI],methods:[],x:0,y:0,parent:LI},$I={type:n.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:n.Property,entityId:"person-date-of-birth-property-id"},GI={id:"person-date-of-birth-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:fr,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:$I},FI={type:n.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},xI={required:!0,type:n.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,dataType:GI,abstract:!1,parent:FI},UI={type:n.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:n.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},jI={id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:UI},kI={type:n.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},qI={required:!0,type:n.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,dataType:jI,abstract:!1,parent:kI},JI={type:n.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:n.Project,entityId:q},lt={type:n.CustomEntity,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:[qI,xI],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[js],x:0,y:0,parent:JI},WI={type:n.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},HI={type:n.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:n.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},YI={type:n.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:n.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},zI={type:n.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:n.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},ZI={id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zI},ks={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:n.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:ZI,readsValue:YI,required:!0,index:0,parent:HI},XI={type:n.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},QI={type:n.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},Kh={type:n.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[ks],calledByError:[],calledByEntry:[XI],calledBySuccess:[],throws:null,x:0,y:0,parent:QI},KI={type:n.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:n.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},eP={id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:KI},ef={id:"500dee3a-3435-4453-9699-0d053f646523",type:n.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:eP,required:!0,writesValues:[ks],index:0,parent:WI},tP={type:n.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},tf={type:n.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[ef],calls:[Kh],returnStatements:[Kh],index:0,collapsed:!1,private:!1,x:0,y:0,parent:tP},nP={type:n.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:n.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},rP={id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:nP},iP={type:n.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:n.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},aP={type:n.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},sP={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:n.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:rP,readsValue:iP,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:aP},oP={type:n.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:n.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},lP={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:n.OutputMap,version:1,declaration:ks,writesValues:[sP],index:0,parent:oP},cP={type:n.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},dP={type:n.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},uP={type:n.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:n.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},pP={id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uP},yP={type:n.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:n.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},hP={type:n.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},fP={type:n.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:n.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},mP={type:n.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:n.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},nf={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:n.InputMap,version:1,declaration:ef,name:null,description:null,readsValue:mP,dynamicArguments:[],defaultValue:null,index:0,parent:fP},TP={type:n.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:pP,readsValue:yP,writesValues:[nf],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:hP},EP={type:n.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:tf,inputs:[nf],outputs:[lP],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[cP],calledBySuccess:[],parent:dP,error:null,x:0,y:0},RP={type:n.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:n.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},bP={id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:RP},vP={type:n.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},gP={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:n.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:bP,required:!0,index:0,writesValues:[TP],parent:vP},IP={type:n.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},PP={type:n.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[gP],collapsed:!0,returnStatements:[],calls:[EP],private:!1,index:0,implements:null,x:0,y:0,parent:IP},DP={type:n.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:n.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},SP={id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DP},AP={type:n.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},rf={required:!0,type:n.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:SP,abstract:!1,parent:AP},OP={type:n.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:n.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},CP={id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:OP},BP={type:n.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},af={required:!0,type:n.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:CP,implements:null,static:!1,private:!0,abstract:!1,parent:BP},wP={type:n.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:n.Project,entityId:q},Kn={type:n.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[rf,af],methods:[tf,PP],extends:[],implements:[Oe],x:0,y:0,parent:wP},xr="bitcoin-api-response-id",sf="time-property-id",of="disclamer-property-id",lf="chart-name-property-id",cf="bpi-property-id",ra="bpi-entity-id",df="usd-property-id",uf="gbp-property-id",pf="eur-property-id",er="currency-entity-id",yf="currency-code-property-id",hf="currency-symbol-property-id",ff="currency-rate-property-id",mf="currency-description-property-id",Tf="currency-rate-number-property-id",MP={type:n.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:n.Property,entityId:yf},_P={id:"code-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:MP},NP={type:n.GenericReference,id:"code-property-parent-ref-id",entityType:n.CustomEntity,entityId:er},VP={required:!0,type:n.Property,id:yf,version:1,name:"code",description:null,dataType:_P,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:NP},LP={type:n.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:n.Property,entityId:hf},$P={id:"symbol-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["&#36;","&pound;","&euro;"],constant:!1,parent:LP},GP={type:n.GenericReference,id:"symbol-property-parent-ref-id",entityType:n.CustomEntity,entityId:er},FP={required:!0,type:n.Property,id:hf,version:1,name:"symbol",description:null,index:0,dataType:$P,implements:null,static:!1,private:!1,abstract:!1,parent:GP},xP={type:n.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:n.Property,entityId:ff},UP={id:"rate-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xP},jP={type:n.GenericReference,id:"rate-property-parent-ref-id",entityType:n.CustomEntity,entityId:er},kP={required:!0,type:n.Property,id:ff,version:1,name:"rate",description:null,index:0,dataType:UP,implements:null,static:!1,private:!1,abstract:!1,parent:jP},qP={type:n.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:n.Property,entityId:mf},JP={id:"description-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qP},WP={type:n.GenericReference,id:"description-property-parent-ref-id",entityType:n.CustomEntity,entityId:er},HP={required:!0,type:n.Property,id:mf,version:1,name:"description",description:null,dataType:JP,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:WP},YP={type:n.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:n.Property,entityId:Tf},zP={id:"rate-number-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YP},ZP={type:n.GenericReference,id:"rate-number-property-parent-ref-id",entityType:n.CustomEntity,entityId:er},XP={required:!0,type:n.Property,id:Tf,version:1,name:"rate_float",description:null,dataType:zP,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:ZP},QP={type:n.GenericReference,id:"currency-prototype-parent-ref-id",entityType:n.Project,entityId:q},ia={type:n.CustomEntity,id:er,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[VP,FP,kP,HP,XP],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:QP},KP={type:n.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:n.Property,entityId:df},eD={id:"usd-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ia,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:KP},tD={type:n.GenericReference,id:"usd-property-parent-ref-id",entityType:n.CustomEntity,entityId:ra},nD={required:!0,id:df,type:n.Property,version:1,name:"USD",description:null,index:0,dataType:eD,implements:null,static:!1,private:!1,abstract:!1,parent:tD},rD={type:n.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:n.Property,entityId:uf},iD={id:"gbp-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ia,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:rD},aD={type:n.GenericReference,id:"gbp-property-parent-ref-id",entityType:n.CustomEntity,entityId:ra},sD={required:!0,id:uf,type:n.Property,version:1,name:"GBP",description:null,index:0,dataType:iD,implements:null,static:!1,private:!1,abstract:!1,parent:aD},oD={type:n.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:n.Property,entityId:pf},lD={id:"eur-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ia,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:oD},cD={type:n.GenericReference,id:"eur-property-parent-ref-id",entityType:n.CustomEntity,entityId:ra},dD={required:!0,id:pf,type:n.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:lD,private:!1,abstract:!1,parent:cD},uD={type:n.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:n.Project,entityId:q},Ef={type:n.CustomEntity,id:ra,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[nD,sD,dD],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:uD},pD={type:n.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:n.Property,entityId:sf},yD={id:"time-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:jl,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:pD},hD={type:n.GenericReference,id:"time-property-parent-ref-id",entityType:n.CustomEntity,entityId:xr},fD={required:!0,type:n.Property,id:sf,version:1,name:"time",description:null,index:0,dataType:yD,implements:null,static:!1,private:!1,abstract:!1,parent:hD},mD={type:n.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:n.Property,entityId:of},TD={id:"disclamer-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:mD},ED={type:n.GenericReference,id:"disclamer-property-parent-ref-id",entityType:n.CustomEntity,entityId:xr},RD={required:!0,type:n.Property,id:of,version:1,name:"disclamer",description:null,index:0,dataType:TD,implements:null,static:!1,private:!1,abstract:!1,parent:ED},bD={type:n.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:n.Property,entityId:lf},vD={id:"chart-name-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:bD},gD={type:n.GenericReference,id:"chart-name-property-parent-ref-id",entityType:n.CustomEntity,entityId:xr},ID={required:!0,type:n.Property,id:lf,version:1,name:"chartName",description:null,index:0,dataType:vD,implements:null,static:!1,private:!1,abstract:!1,parent:gD},PD={type:n.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:n.Property,entityId:cf},DD={id:"bpi-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ef,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:PD},SD={type:n.GenericReference,id:"bpi-property-parent-ref-id",entityType:n.CustomEntity,entityId:xr},AD={required:!0,type:n.Property,id:cf,version:1,name:"bpi",description:null,implements:null,index:0,dataType:DD,static:!1,private:!1,abstract:!1,parent:SD},OD={type:n.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:n.Project,entityId:q},Rf={type:n.CustomEntity,id:xr,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[fD,RD,ID,AD],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:OD},CD={type:n.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:n.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},BD={id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:CD},wD={type:n.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:n.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},MD={type:n.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:n.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},_D={id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MD},ND={type:n.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:n.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},bf={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",dataType:_D,readsValue:ND,required:!0,index:0,parent:wD},VD={type:n.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},LD={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:n.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,dataType:BD,writesValues:[bf],required:!0,index:0,parent:VD},$D={type:n.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},GD={type:n.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},FD={type:n.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},vf={type:n.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[bf],calledByError:[],calledByEntry:[GD],calledBySuccess:[],throws:null,x:0,y:0,parent:FD},xD={type:n.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:[LD],calls:[vf],index:0,collapsed:!1,implements:null,returnStatements:[vf],private:!1,x:0,y:0,parent:$D},UD={type:n.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},jD={type:n.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},kD={type:n.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:n.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},qD={type:n.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},JD={type:n.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:n.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},WD={id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:jn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:JD},qs={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:n.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:WD,readsValue:qD,required:!0,index:0,parent:kD},gf={type:n.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[qs],calledByError:[],calledByEntry:[],calledBySuccess:[UD],throws:null,x:0,y:0,parent:jD},HD={type:n.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},YD={type:n.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:n.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},If={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:n.InputMap,version:1,declaration:cs,name:null,description:null,dynamicArguments:[],readsValue:YD,defaultValue:null,parent:HD,index:2},zD={type:n.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},ZD={id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:jn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zD},XD={type:n.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},QD={type:n.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:n.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},KD={type:n.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:n.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},Pf={type:n.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",dataType:ZD,readsValue:QD,writesValues:[qs],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[KD],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:XD},eS={type:n.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:n.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},tS={type:n.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},nS={type:n.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:Bi,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:n.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:g.String,valueAsType:null,parent:eS,autogeneration:null},index:1,dynamicArguments:[],parent:tS},rS={type:n.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},iS={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:n.OutputMap,version:1,declaration:Er,index:2,writesValues:[Pf],parent:rS},aS={type:n.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},sS={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:n.InputMap,version:1,declaration:Ci,name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:null,parent:aS},oS={type:n.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},lS={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:n.InputMap,version:1,name:null,description:null,declaration:wi,dynamicArguments:[],index:3,readsValue:null,defaultValue:null,parent:oS},cS={type:n.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},dS={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:n.InputMap,version:1,declaration:Mi,name:null,description:null,dynamicArguments:[],readsValue:null,index:4,defaultValue:null,parent:cS},uS={type:n.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},pS={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:n.OutputMap,version:1,declaration:_i,index:1,writesValues:[],parent:uS},yS={type:n.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},hS={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:n.OutputMap,version:1,declaration:Er,index:0,writesValues:[],parent:yS},fS={type:n.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},mS={type:n.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},TS={type:n.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},ES={type:n.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:n.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},RS={type:n.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:n.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},bS={id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:RS},vS={type:n.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:n.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},Df={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:n.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:bS,required:!0,readsValue:null,index:0,parent:vS},gS={type:n.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[ES],throws:Df,x:0,y:0,parent:TS},IS={type:n.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},PS={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:n.OutputMap,declaration:us,version:1,writesValues:[Df],index:0,parent:IS},DS={type:n.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Ni,inputs:[sS,nS,If,lS,dS],outputs:[hS,pS,iS],process:null,calledByError:[],calledByEntry:[fS],calledBySuccess:[],successCalls:[gf,Pf],errorCalls:[gS],error:PS,dynamicArguments:[],x:0,y:0,parent:mS},SS={type:n.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:n.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},AS={type:n.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},OS={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:n.InputMap,version:1,declaration:Si,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:n.PrimitiveValue,version:1,value:"?name=",name:g.String,parent:SS,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:AS},CS={type:n.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},BS={type:n.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},wS={type:n.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:n.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},MS={id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:wS},_S={type:n.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:n.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},NS={type:n.GenericReference,id:"assembled-query-string-called-by-ref",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Sf={type:n.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",dataType:MS,readsValue:_S,writesValues:[If],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[NS],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:BS},VS={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:n.OutputMap,version:1,writesValues:[Sf],declaration:mr,index:0,parent:CS},LS={type:n.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},$S={type:n.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},GS={type:n.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:n.ArgumentDeclaration},FS={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Af={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:n.InputMap,declaration:Ai,name:null,description:null,readsValue:GS,dynamicArguments:[],defaultValue:null,index:1,parent:FS},xS={type:n.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:Oi,version:1,inputs:[OS,Af],outputs:[VS],process:null,calledByError:[],calledByEntry:[LS],calledBySuccess:[],dynamicArguments:[],successCalls:[Sf],errorCalls:[],error:null,x:0,y:0,parent:$S},US={type:n.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:n.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},jS={id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:US},kS={type:n.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},Of={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:n.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:jS,required:!1,writesValues:[Af],index:0,parent:kS},qS={type:n.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:n.Project,entityId:q},Cf={type:n.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:[Of],calls:[xS,DS],returnStatements:[gf],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:qS},JS={type:n.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:n.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},WS={type:n.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},HS={type:n.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},YS={type:n.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Bf={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:n.InputMap,declaration:Of,name:null,description:null,readsValue:HS,dynamicArguments:[],defaultValue:null,index:0,parent:YS},zS={type:n.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},ZS={type:n.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:n.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},XS={id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:jn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ZS},QS={type:n.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:n.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},KS={type:n.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},eA={type:n.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},wf={type:n.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:XS,readsValue:QS,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[eA],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:KS},tA={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.OutputMap,version:1,declaration:qs,writesValues:[wf],index:0,parent:zS},nA={type:n.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:Cf,inputs:[Bf],outputs:[tA],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[JS],successCalls:[wf],errorCalls:[],error:null,x:0,y:0,parent:WS},rA={type:n.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},iA={type:n.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},aA={type:n.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},sA={type:n.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:n.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},Mf={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:n.InputMap,declaration:Wn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:aA,defaultValue:null,index:0,parent:sA},oA={type:n.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:Wn,inputs:[Mf],calledByError:[],calledByEntry:[rA],calledBySuccess:[],successCalls:[nA],errorCalls:[],x:0,y:0,parent:iA},lA={type:n.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},cA={type:n.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:n.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},dA={id:"d64152ea-831f-4426-9506-a39bfa170513",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Kn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cA},uA={type:n.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},pA={type:n.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:n.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},yA={type:n.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},_f={type:n.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",dataType:dA,readsValue:pA,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[yA],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:uA},hA={type:n.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:n.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},fA={id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Kn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:hA},mA={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:n.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:fA,required:!0,index:1,writesValues:[_f],parent:lA},TA={type:n.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},EA={type:n.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},RA={type:n.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},bA={id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:RA},vA={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:n.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:bA,required:!0,index:0,writesValues:[Mf,Bf],parent:EA},gA={type:n.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:[vA,mA],calls:[oA,_f],index:1,private:!1,implements:null,x:0,y:0,parent:TA},IA={type:n.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},PA={type:n.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:n.Property,entityId:"employee-manager-property-id"},DA={id:"employee-manager-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:IA,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:PA},SA={type:n.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},AA={required:!0,type:n.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,dataType:DA,abstract:!1,parent:SA},OA={type:n.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:n.Property,entityId:"employee-start-date-property-id"},CA={id:"employee-start-date-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:fr,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:OA},BA={type:n.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},wA={required:!0,type:n.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,implements:null,dataType:CA,abstract:!1,parent:BA},MA={type:n.GenericReference,id:"employee-department-property-ref-id",entityType:n.Property,entityId:"employee-department-property-id"},_A={id:"employee-department-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:MA},NA={type:n.GenericReference,id:"employee-department-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},VA={required:!0,type:n.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,implements:null,static:!1,private:!1,dataType:_A,abstract:!1,parent:NA},LA={type:n.GenericReference,id:"employee-prototype-parent-ref-id",entityType:n.Project,entityId:q},Rt={type:n.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[VA,wA,AA],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[lt],x:0,y:0,parent:LA},$A={type:n.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:n.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},GA={id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:$A},FA={type:n.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},xA={required:!0,type:n.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,implements:null,dataType:GA,abstract:!1,parent:FA},UA={type:n.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:n.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},jA={id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Kn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:UA},kA={type:n.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},Js={required:!0,type:n.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,dataType:jA,abstract:!1,parent:kA},qA={type:n.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:n.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},JA={id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qA},WA={type:n.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},HA={required:!0,type:n.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,dataType:JA,private:!0,abstract:!1,parent:WA},YA={type:n.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:n.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},zA={id:"ad44250b-40c2-48f7-a480-381fa938f562",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YA},ZA={type:n.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},XA={required:!0,type:n.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:zA,implements:null,private:!0,static:!1,abstract:!1,parent:ZA},QA={type:n.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:n.Project,entityId:q},yt={type:n.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[xA,Js,HA,XA],static:!1,abstract:!1,abstractMethods:[],methods:[xD,gA],extends:[],implements:[Oe],x:0,y:0,parent:QA},KA={type:n.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:n.Project,entityId:q},Ws={type:n.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:KA};n.GenericReference,n.DataType;const eO={id:"cron-job-entity-expression-property-ref-id",type:n.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:n.Property},tO={id:"cron-job-entity-expression-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:eO},nO={id:"cron-job-entity-ref-id",type:n.GenericReference,entityId:"cron-job-entity-id",entityType:n.CustomEntity},rO={required:!0,id:"cron-job-entity-expression-property-id",type:n.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:tO,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:nO},iO={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:n.GenericReference,entityId:"show-popup-func-decl-id",entityType:n.FunctionDeclaration},aO={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:n.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:n.FunctionDeclaration},sO={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:n.FunctionCall,declaration:Ws,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[iO],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:aO},oO={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:n.GenericReference,entityId:"cron-job-entity-id",entityType:n.CustomEntity},lO={id:"cron-job-entity-trigger-func-decl-id",version:1,type:n.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:Es,calls:[sO],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:oO},cO={id:"cron-job-entity-parent-ref-id",type:n.GenericReference,entityId:q,entityType:n.Project},dO={id:"cron-job-entity-id",version:1,type:n.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[rO],static:!0,abstract:!1,abstractMethods:[],extends:[eh],implements:[],methods:[lO],x:0,y:0,parent:cO},uO={type:n.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:n.Project,entityId:q},pO={type:n.CustomEntity,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:[ms],x:0,y:0,parent:uO},Nf="f558fbf8-67de-4545-9804-6ae621e0b2d4",yO={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},hO={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},fO={id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:{},parent:yO,autogeneration:null,valueAsType:null},parent:hO},mO={id:"getCompanyByIdEndpointReachedEntityEventRef",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},TO={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},EO={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},RO={id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:{},parent:TO,autogeneration:null,valueAsType:null},parent:EO},bO={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:n.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:RO,required:!0,index:0,parent:mO},vO={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},gO={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:n.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:[],dataType:fO,required:!0,index:1,parent:vO},IO={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},PO={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},DO={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},SO={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:G,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:{},parent:PO,autogeneration:null,valueAsType:null},parent:DO},AO={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:n.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:SO,required:!0,index:2,parent:IO},OO={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},CO={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},BO={id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:CO},wO={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:n.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:BO,index:3,required:!0,parent:OO},MO={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},_O={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MO},NO={id:"getCompanyByIdEndpointReturnStatementRef",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},VO={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:n.ReturnDeclaration,name:"Response code",dataType:_O,readsValue:null,required:!0,index:0,parent:NO},LO={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},$O={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},GO={id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.JSON,value:{},parent:LO,autogeneration:null,valueAsType:null},parent:$O},FO={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},xO={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:n.ReturnDeclaration,name:"Response headers",dataType:GO,readsValue:null,required:!0,index:1,parent:FO},UO={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},jO={id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:UO},kO={id:"getCompanyByIdEndpointReturnStatementRefThree",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},qO={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:n.ReturnDeclaration,name:"Response body",dataType:jO,readsValue:null,required:!0,index:2,parent:kO},JO={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:n.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:n.FunctionDeclaration},WO={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},HO={id:"getCompanyByIdEndpointReturnStatement",type:n.ReturnStatement,version:1,outputs:[VO,xO,qO],calledByError:[],calledByEntry:[JO],calledBySuccess:[],throws:null,x:0,y:0,parent:WO},YO={id:"endpointBuiltInBaseEntityRefFour",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:Nf},zO={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:n.FunctionDeclaration,inputs:[bO,gO,AO,wO],returnStatements:[HO],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:fs,index:0,private:!1,x:0,y:0,parent:YO},ZO={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},XO={id:"getCompanyByIdEndpointPathPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"getCompanyByIdEndpointPathProperty"},QO={id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:g.String,value:"/company/{id}",parent:ZO,valueAsType:null,autogeneration:null},parent:XO},KO={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:M.HTTP_ENDPOINT},eC={required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:n.Property,private:!1,abstract:!1,static:!0,implements:ys,dataType:QO,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:KO},tC={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},nC={id:"getCompanyByIdEndpointMethodPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"getCompanyByIdEndpointMethodProperty"},rC={id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Rn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,value:"GET",name:g.Enum,parent:tC,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:nC},iC={id:"getCompanyByIdEndpointBaseEntityRefThree",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:M.HTTP_ENDPOINT},aC={required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:n.Property,private:!1,abstract:!1,static:!0,implements:hs,index:0,dataType:rC,description:null,parent:iC},sC={type:n.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:n.Project,entityId:q},oC={type:n.CustomEntity,id:Nf,version:1,name:"Get given company data by id",description:null,properties:[eC,aC],methods:[zO],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[ms],x:0,y:0,parent:sC},lC={id:"product-prototype-database-property-ref-id",type:n.GenericReference,entityId:"product-prototype-database-property-id",entityType:n.Property},cC={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:n.DataType},dC={id:"product-prototype-database-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:Us,autogeneration:null,parent:cC},parent:lC},uC={id:"product-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},pC={required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:br,static:!0,index:0,dataType:dC,description:"The database that the entity belongs to.",parent:uC},yC={type:n.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:n.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},hC={id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:yC},fC={type:n.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:n.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},mC={required:!0,type:n.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,dataType:hC,abstract:!1,parent:fC},TC={type:n.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:n.Project,entityId:q},EC={type:n.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Oe],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[pC,mC],methods:[],x:0,y:0,parent:TC},Ur="project-loaded-event-id",jt="get-bitcoin-price-http-call-operation-id",Vf="get-bitcoin-price-http-call-response-body-id",aa="validate-bitcoin-price-response-operation-ids",RC={type:n.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Vf},bC={type:n.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:n.Operation,entityId:aa},Lf={id:"validate-bitcoin-data-to-validate-input-map-id",type:n.InputMap,version:1,declaration:kn.fixedArguments[1],name:null,description:null,readsValue:RC,defaultValue:null,dynamicArguments:[],index:0,parent:bC},vC={type:n.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},gC={type:n.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:n.Operation,entityId:aa},IC={id:"validate-bitcoin-type-to-match-input-map-id",type:n.InputMap,version:1,declaration:kn.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:n.PrimitiveValue,version:1,name:g.EntityTemplate,valueAsType:Rf,value:null,parent:vC,autogeneration:null},dynamicArguments:[],index:0,parent:gC},PC={type:n.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:n.Operation,entityId:aa},DC={id:"validate-bitcoin-validated-entity-output-map-id",type:n.OutputMap,version:1,declaration:kn.fixedReturns[0],writesValues:[],index:0,parent:PC},SC={type:n.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:n.GlobalEvent,entityId:Ur},AC={type:n.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:n.Operation,entityId:jt},OC={type:n.Operation,id:aa,version:1,declaration:kn,inputs:[IC,Lf],outputs:[DC],process:null,dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[AC],parent:SC},CC={type:n.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:n.FunctionCall,entityId:jt},BC={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:n.InputMap,declaration:Ci,name:null,description:null,readsValue:null,defaultValue:null,dynamicArguments:[],index:0,parent:CC},wC={type:n.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:n.FunctionCall,entityId:jt},MC={type:n.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:n.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},_C={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:n.InputMap,declaration:Bi,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:n.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:g.String,parent:MC,valueAsType:null,autogeneration:null},index:1,dynamicArguments:[],parent:wC},NC={type:n.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:n.FunctionCall,entityId:jt},VC={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:n.InputMap,declaration:wi,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:2,parent:NC},LC={type:n.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:n.FunctionCall,entityId:jt},$C={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:n.InputMap,declaration:Mi,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:3,parent:LC},GC={type:n.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:n.FunctionCall,entityId:jt},FC={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:n.OutputMap,declaration:_i,writesValues:[],index:1,parent:GC},xC={type:n.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:n.FunctionCall,entityId:jt},UC={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:n.OutputMap,declaration:ds,writesValues:[],index:0,parent:xC},jC={type:n.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:n.FunctionCall,entityId:jt},kC={id:Vf,type:n.OutputMap,version:1,declaration:Er,writesValues:[Lf],index:2,parent:jC},qC={type:n.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:n.FunctionDeclaration,entityId:jt},JC={type:n.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:n.GlobalEvent,entityId:Ur},WC={type:n.Operation,id:jt,version:1,declaration:Ni,inputs:[BC,_C,VC,$C],outputs:[UC,FC,kC],process:null,parent:JC,calledByError:[],calledByEntry:[qC],calledBySuccess:[],dynamicArguments:[],successCalls:[OC],errorCalls:[],error:null,x:0,y:0},HC={type:n.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:n.GlobalEvent,entityId:Ur},YC={type:n.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:n.GlobalEvent,entityId:Ur},zC={process:null,type:n.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:Ws,inputs:[],outputs:[],calledByError:[],calledByEntry:[HC],calledBySuccess:[],parent:YC,successCalls:[],errorCalls:[],error:null,x:0,y:0},ZC={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:n.GenericReference,entityType:n.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},XC={type:n.GlobalEvent,id:Ur,version:1,name:Jt.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:vs,parent:ZC,inputs:[],calls:[zC,WC],x:0,y:0},At="abort-execution-func-declaration-id",jr="abort-execution-func-exec-var-declaration-id",sa="abort-execution-func-small-wait-op-id",Hs="abort-execution-func-long-wait-op-id",$f="abort-execution-func-long-wait-process-output-id",Gf="abort-execution-func-exec-var-instance-write-id",Ff="abort-execution-func-long-wait-return-stmt-id",xf="abort-execution-func-small-wait-return-stmt-id",QC="abort-execution-func-exec-var-instance-abort-call-id",Ys="abort-execution-func-exec-var-instance-abort-internal-call-id",Uf="abort-execution-func-exec-second-wait-op-id",KC={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},eB={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:n.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},tB={id:"short-wait-return-statement-returned-hello-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:eB},constant:!1,parent:KC},nB={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:n.ReturnStatement,entityId:xf},rB={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:tB,readsValue:null,required:!0,index:0,parent:nB},iB={type:n.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:sa},aB={type:n.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:At},jf={type:n.ReturnStatement,id:xf,version:1,outputs:[rB],calledByError:[],calledByEntry:[],calledBySuccess:[iB],throws:null,x:0,y:0,parent:aB},sB={type:n.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"second-wait-argument-map-id"},oB={type:n.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:n.Operation,entityId:Uf},lB={id:"second-wait-argument-map-id",type:n.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:n.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:g.Number,parent:sB},index:0,parent:oB},cB={type:n.GenericReference,id:"small-wait-parent-ref-id",entityType:n.FunctionDeclaration,entityId:At},dB={type:n.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:n.InternalCall,entityId:Ys},uB={id:Uf,type:n.Operation,version:1,declaration:st,inputs:[lB],dynamicArguments:[],outputs:[],process:null,successCalls:[jf],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[dB],error:null,parent:cB},pB={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:n.VariableInstance,entityId:Gf},yB={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:n.Operation,entityId:sa},hB={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:At},fB={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:jr},mB={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:n.InternalCall,entityId:Ys},TB={id:QC,type:n.VariableInstance,version:1,declaration:fB,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[mB],parent:hB},kf={id:Ys,type:n.InternalCall,version:1,inputs:[],outputs:[],declaration:Rs,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[pB,yB],successCalls:[uB],errorCalls:[],error:null,index:0,parent:TB},EB={type:n.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:At},RB={type:n.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:n.VariableDeclaration,entityId:jr},bB={type:n.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:n.FunctionDeclaration,entityId:At},vB={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:jr},gB={type:n.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:n.OutputMap,entityId:$f},zs={id:Gf,type:n.VariableInstance,version:1,declaration:vB,inputs:[],outputs:[],calledByError:[],calledByEntry:[bB],calledBySuccess:[RB],successCalls:[kf],errorCalls:[],x:0,y:0,readsValue:gB,writesValues:[],internalCalls:[],parent:EB},IB={type:n.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:jr};n.GenericReference,n.DataType;const PB={id:"abort-exec-func-var-decl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:bs,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:IB,defaultValue:null},DB={type:n.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:At},SB={type:n.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:At},AB={id:jr,type:n.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:PB,inputs:[],outputs:[],calledByError:[],calledByEntry:[SB],calledBySuccess:[],successCalls:[zs],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:DB},OB={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},CB={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:n.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},BB={id:"long-wait-return-statement-returned-hello-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:CB},constant:!1,parent:OB},wB={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:n.ReturnStatement,entityId:Ff},MB={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:BB,readsValue:null,required:!0,index:0,parent:wB},_B={type:n.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:Hs},NB={type:n.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:At},qf={type:n.ReturnStatement,id:Ff,version:1,outputs:[MB],calledByError:[],calledByEntry:[],calledBySuccess:[_B],throws:null,x:0,y:0,parent:NB},VB={type:n.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"long-argument-map-id"},Jf={type:n.GenericReference,id:"long-argument-map-parent-ref-id",entityType:n.Operation,entityId:Hs},LB={id:"long-argument-map-id",type:n.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:n.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:g.Number,parent:VB},index:0,parent:Jf},$B={type:n.GenericReference,id:"long-parent-ref-id",entityType:n.FunctionDeclaration,entityId:At},GB={type:n.GenericReference,id:"long-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:At},FB={id:$f,type:n.OutputMap,version:1,declaration:yh,writesValues:[zs],index:0,parent:Jf},xB={id:Hs,type:n.Operation,version:1,declaration:st,inputs:[LB],dynamicArguments:[],outputs:[],process:FB,successCalls:[qf],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[GB],calledBySuccess:[],error:null,parent:$B},UB={type:n.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"small-wait-argument-map-id"},jB={type:n.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:n.Operation,entityId:sa},kB={id:"small-wait-argument-map-id",type:n.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:n.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:g.Number,parent:UB},index:0,parent:jB},qB={type:n.GenericReference,id:"small-wait-parent-ref-id",entityType:n.FunctionDeclaration,entityId:At},JB={type:n.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:At},WB={id:sa,type:n.Operation,version:1,declaration:st,inputs:[kB],dynamicArguments:[],outputs:[],process:null,successCalls:[kf],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[JB],calledBySuccess:[],error:null,parent:qB},HB={type:n.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:n.Project,entityId:q},Wf={id:"abort-execution-func-decl-id",type:n.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[qf,jf],calls:[WB,AB,zs,xB],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:HB},YB={type:n.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:n.Project,entityId:q},zB={id:"call-execution-abort-func-id",type:n.FunctionCall,version:1,declaration:Wf,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:YB},Zs="manual-hello-world-loop-func-decl-id",Hf="manual-hello-world-loop-func-return-statement-id",zt="manual-hello-world-loop-id",kr="manual-hello-world-loop-body-id",Yf="manual-hello-world-loop-break-statement-id",oa="manual-hello-world-loop-current-iteration-number-output-map-id",Xs="manual-hello-world-loop-previous-iterations-results-output-map-id",Qs="assembled-hello-world-text-output-id",zf="assembled-hello-world-list-output-id",qr="iteration-number-is-equal-or-greater-than-10-condition-id",la="join-hello-world-and-number-operation-id",ca="append-string-to-list-operation-id",Zf="hello-world-loop-output-map-id",ZB={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:n.ReturnStatement,entityId:Hf},XB={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:n.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},QB={id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:XB},KB={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:n.OutputMap,entityId:Zf},Xf={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:n.ReturnDeclaration,name:"Results",description:null,dataType:QB,readsValue:KB,required:!0,index:0,parent:ZB},ew={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:n.Loop,entityId:zt},tw={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:n.FunctionDeclaration,entityId:Zs},Qf={type:n.ReturnStatement,id:Hf,version:1,outputs:[Xf],calledByError:[],calledByEntry:[],calledBySuccess:[ew],parent:tw,throws:null,x:0,y:0},nw={type:n.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:n.BreakStatement,entityId:Yf},rw={type:n.GenericReference,id:"hello-world-loop-break-statement-output-data-type-ref-id",entityType:n.ReturnDeclaration,entityId:"hello-world-loop-break-statement-output-id"},iw={id:"hello-world-loop-break-statement-output-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:rw},aw={type:n.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:n.OutputMap,entityId:Qs},Ks={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration result",description:null,dataType:iw,readsValue:aw,required:!0,index:0,parent:nw},sw={type:n.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:n.Condition,entityId:qr},ow={type:n.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:n.Loop,entityId:zt},Kf={type:n.BreakStatement,id:Yf,version:1,outputs:[Ks],calledByError:[],calledByEntry:[],calledBySuccess:[sw],parent:ow,throws:null,x:0,y:0},lw={type:n.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:n.ContinueStatement,entityId:"hello-world-loop-continue-statement"},cw={type:n.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:n.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},dw={id:"hello-world-loop-continue-statement-output-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cw},uw={type:n.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:n.OutputMap,entityId:Qs},em={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration result",description:null,dataType:dw,readsValue:uw,required:!0,index:0,parent:lw},pw={type:n.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:n.Condition,entityId:qr},yw={type:n.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:n.Loop,entityId:zt},tm={type:n.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[em],calledBySuccess:[],calledByError:[pw],calledByEntry:[],parent:yw,throws:null,x:0,y:0};n.GenericReference,n.InputMap;const hw={type:n.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:n.Operation,entityId:ca},fw={type:n.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Xs},nm={id:"append-string-to-list-base-string-map-id",type:n.InputMap,version:1,declaration:ts,name:null,description:null,readsValue:fw,defaultValue:null,dynamicArguments:[],index:0,parent:hw},mw={type:n.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:n.Operation,entityId:ca},Tw={id:zf,type:n.OutputMap,version:1,writesValues:[Ks],declaration:mr,index:0,parent:mw},Ew={type:n.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:n.Condition,entityId:qr},Rw={type:n.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:zf},bw={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:ca},rm={id:"latest-string-to-add-input-map-id",version:1,type:n.InputMap,declaration:ns,name:null,description:null,readsValue:Rw,dynamicArguments:[],defaultValue:null,index:1,parent:bw},vw={type:n.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:n.FunctionDeclaration,entityId:zt},gw={type:n.Operation,id:ca,declaration:rs,version:1,inputs:[nm,rm],outputs:[Tw],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[Ew],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:vw},Iw={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:kr},Pw={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:n.Loop,entityId:zt},Dw={type:n.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:n.OutputMap,entityId:oa},im={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:n.Condition,entityId:qr},Sw={id:"current-iteration-number-to-check-map-id",version:1,type:n.InputMap,declaration:vr.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:Dw,index:1,defaultValue:null,parent:im},Aw={type:n.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:"max-num-iterations-value-map-id"},Ow={id:"max-num-iterations-value-map-id",version:1,type:n.InputMap,declaration:vr.fixedArguments[1],name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:n.PrimitiveValue,version:1,name:g.Number,value:10,autogeneration:null,valueAsType:null,parent:Aw},parent:im},Cw={type:n.Condition,id:qr,version:1,declaration:vr,inputs:[Ow,Sw],calledByError:[],calledByEntry:[Iw],calledBySuccess:[],successCalls:[Kf,gw],errorCalls:[tm],x:0,y:0,parent:Pw},Bw={type:n.GenericReference,id:"base-string-map-ref-id",entityType:n.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},ww={type:n.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:n.Operation,entityId:la},Mw={id:"join-hello-world-and-number-base-string-map-id",type:n.InputMap,version:1,declaration:Si,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:n.PrimitiveValue,version:1,value:"Hello world ",name:g.String,parent:Bw,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:ww},_w={type:n.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:n.Operation,entityId:la},Nw={id:Qs,type:n.OutputMap,version:1,writesValues:[rm,em],declaration:mr,index:0,parent:_w},Vw={type:n.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:kr},Lw={type:n.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:oa},$w={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:la},am={id:"current-iteration-number-input-map-id",version:1,type:n.InputMap,declaration:Ai,name:null,description:null,readsValue:Lw,dynamicArguments:[],defaultValue:null,index:1,parent:$w},Gw={type:n.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:n.FunctionDeclaration,entityId:zt},Fw={type:n.Operation,id:la,declaration:Oi,version:1,inputs:[Mw,am],outputs:[Nw],process:null,calledByError:[],calledByEntry:[Vw],calledBySuccess:[],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:Gw},xw={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:Xs,entityType:n.ArgumentDeclaration},Uw={id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:xw},jw={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:n.GenericReference,entityId:kr,entityType:n.FunctionDeclaration},kw={id:Xs,type:n.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:Uw,writesValues:[nm],index:1,parent:jw},qw={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:n.GenericReference,entityId:kr,entityType:n.FunctionDeclaration},Jw={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:oa,entityType:n.ArgumentDeclaration};n.DataType;const Ww={id:oa,type:n.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,dataType:null,writesValues:[am],index:0,parent:qw},Hw={id:"manual-flow-loop-body-parent-ref-id",type:n.GenericReference,entityId:zt,entityType:n.Loop},Yw={id:kr,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[Ww,kw],calls:[Cw,Fw],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:Hw},zw={type:n.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:n.Loop,entityId:zt},Zw={type:n.OutputMap,id:Zf,version:1,declaration:Ks,writesValues:[Xf],index:0,parent:zw},Xw={id:"manual-hello-world-loop-parent-ref-id",type:n.GenericReference,entityId:q,entityType:n.Project},Qw={id:"manual-hello-world-loop-called-by-ref-id",type:n.GenericReference,entityId:Zs,entityType:n.FunctionDeclaration},Kw={id:zt,type:n.Loop,version:1,declaration:Rp,inputs:[],outputs:[Zw],body:Yw,successCalls:[Qf],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[Qw],calledBySuccess:[],breakStatements:[Kf],continueStatements:[tm],x:0,y:0,parent:Xw},eM={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:n.Project,entityId:q},sm={type:n.FunctionDeclaration,id:Zs,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[Kw],returnStatements:[Qf],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:eM},tM={type:n.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:n.Project,entityId:q},nM={id:"call-hello-world-loop-id",type:n.FunctionCall,version:1,declaration:sm,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:tM},Zt="company-dto-function-declaration-id",eo="company-dto-func-declaration-argument-dcl-id",kt="company-dto-function-company-variable-id",cn="company-dto-function-company-dto-variable-id",tr="iterate-over-employee-list-loop-id",om="iterate-over-employee-list-loop-employee-dto-output-map-id",to="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",Jr="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",lm="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",rM="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",cm="iterate-over-employee-list-continue-statement-id",da="iterate-over-employee-list-loop-body-id",dm="company-dto-func-declaration-return-statement-id",um="company-dto-func-declaration-return-decl-id",pm="company-dto-func-declaration-company-variable-id-output-map-id",ym="company-dto-func-declaration-company-variable-employess-output-map-id",hm="company-dto-func-declaration-company-variable-name-output-map-id",iM="company-dto-func-declaration-company-dto-variable-input-map-id",aM="company-dto-func-declaration-company-dto-variable-employess-input-map-id",sM="company-dto-func-declaration-company-dto-variable-name-input-map-id",ua="company-dto-func-declaration-owner-variable-id",oM="company-dto-func-declaration-company-dto-variable-owner-input-map-id",fm="company-dto-func-declaration-company-variable-owner-output-map-id",mm="company-dto-func-declaration-owner-variable-id-output-map-id",pa="company-dto-func-declaration-bank-account-variable-id",lM="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",Tm="company-dto-func-declaration-company-variable-bank-account-output-map-id",Em="company-dto-func-declaration-bank-account-variable-id-output-map-id",cM={type:n.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:um},dM={id:"company-dto-func-returned-company-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cM},uM={type:n.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:dm},pM={type:n.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:cn},Rm={isError:!1,id:um,type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:dM,readsValue:pM,required:!0,index:0,parent:uM},yM={type:n.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:n.Operation,entityId:cn},hM={type:n.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Zt},no={type:n.ReturnStatement,id:dm,version:1,outputs:[Rm],calledByError:[],calledByEntry:[],calledBySuccess:[yM],throws:null,x:0,y:0,parent:hM},fM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:mm},mM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cn},bm={id:oM,type:n.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,dynamicArguments:[],index:5,readsValue:fM,parent:mM},TM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Em},EM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cn},vm={id:lM,type:n.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:TM,parent:EM},RM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:hm},bM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cn},gm={id:sM,type:n.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:RM,parent:bM},vM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:om},gM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cn},Im={id:aM,type:n.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:vM,parent:gM},IM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:pm},PM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cn},Pm={id:iM,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,dynamicArguments:[],index:1,readsValue:IM,parent:PM},DM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Zt},SM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:n.VariableDeclaration,entityId:pa},AM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:n.VariableDeclaration,entityId:ua},OM={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:n.VariableDeclaration,entityId:tr},ro={id:cn,type:n.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[SM,AM,OM],successCalls:[no],errorCalls:[],readsValue:null,writesValues:[Rm],inputs:[Pm,gm,vm,bm,Im],outputs:[],internalCalls:[],parent:DM,x:0,y:0},Dn="employee-dto-func-declaration-id",io="employee-dto-func-declaration-argument-dcl-id",Dm="employee-dto-func-declaration-return-statement-id",Sm="employee-dto-func-declaration-return-decl-id",Sn="employee-dto-func-declaration-employee-variable-id",An="employee-dto-func-declaration-employee-dto-variable-id",ya="employee-dto-func-declaration-manager-variable-id",Am="employee-dto-func-declaration-employee-variable-id-output-map-id",Om="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",Cm="employee-dto-func-declaration-employee-variable-department-output-map-id",Bm="employee-dto-func-declaration-employee-variable-manager-output-map-id",wm="employee-dto-func-declaration-manager-variable-id-output-map-id",CM="employee-dto-func-declaration-employee-dto-variable-input-map-id",BM="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",wM="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",MM="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",_M={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:Sm},NM={id:"employee-dto-func-returned-employee-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_M},VM={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:Dm},LM={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:An},Mm={isError:!1,id:Sm,type:n.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:NM,readsValue:LM,required:!0,index:0,parent:VM},$M={type:n.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:n.Operation,entityId:An},GM={type:n.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Dn},ao={type:n.ReturnStatement,id:Dm,version:1,outputs:[Mm],calledByError:[],calledByEntry:[],calledBySuccess:[$M],throws:null,x:0,y:0,parent:GM},FM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:wm},xM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:An},_m={id:MM,type:n.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:FM,parent:xM},UM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Cm},jM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:An},Nm={id:wM,type:n.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:UM,parent:jM},kM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Om},qM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:An},Vm={id:BM,type:n.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:kM,parent:qM},JM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Am},WM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:An},Lm={id:CM,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:JM,parent:WM},HM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Dn},YM={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:n.VariableDeclaration,entityId:ya},zM={id:An,type:n.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[YM],successCalls:[ao],errorCalls:[],readsValue:null,writesValues:[Mm],inputs:[Lm,Vm,Nm,_m],outputs:[],internalCalls:[],parent:HM,x:0,y:0},ZM={type:n.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ya},XM={id:wm,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[_m],parent:ZM},QM={type:n.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ya},KM={id:"employee-dto-func-manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:QM,defaultValue:null},e_={type:n.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:Bm},t_={type:n.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Dn};n.GenericReference,n.VariableDeclaration;const $m={id:ya,type:n.VariableDeclaration,version:1,name:"Manager",dataType:KM,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[zM],errorCalls:[],readsValue:e_,writesValues:[],inputs:[],outputs:[XM],internalCalls:[],parent:t_,x:0,y:0},n_={type:n.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Sn},r_={id:Bm,type:n.OutputMap,version:1,declaration:Rt.properties[2],index:3,writesValues:[$m],parent:n_},i_={type:n.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Sn},a_={id:Cm,type:n.OutputMap,version:1,declaration:Rt.properties[0],index:2,writesValues:[Nm],parent:i_},s_={type:n.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Sn},o_={id:Om,type:n.OutputMap,version:1,declaration:lt.properties[1],index:1,writesValues:[Vm],parent:s_},l_={type:n.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Sn},c_={id:Am,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[Lm],parent:l_},d_={type:n.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Sn},u_={id:"employee-dto-func-employee-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:d_,defaultValue:null},p_={type:n.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Dn},y_={type:n.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:io},h_={type:n.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:n.FunctionDeclaration,entityId:Dn},Gm={id:Sn,type:n.VariableDeclaration,version:1,name:"Company employee",dataType:u_,description:"A variable holding a company employee",calledByError:[],calledByEntry:[h_],calledBySuccess:[],successCalls:[$m],errorCalls:[],readsValue:y_,writesValues:[],inputs:[],outputs:[c_,o_,a_,r_],internalCalls:[],parent:p_,x:0,y:0},f_={type:n.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:io,entityType:n.ArgumentDeclaration},m_={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:Rt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:f_,defaultValue:null},T_={type:n.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:Dn,entityType:n.FunctionDeclaration},E_={type:n.ArgumentDeclaration,id:io,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,dataType:m_,index:0,writesValues:[Gm],parent:T_},R_={type:n.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:n.Project,entityId:q},so={type:n.FunctionDeclaration,id:Dn,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[E_],calls:[Gm],implements:null,returnStatements:[ao],collapsed:!1,private:!1,x:0,y:0,parent:R_},b_={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:lm,entityType:n.ReturnDeclaration},v_={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Rt,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:b_},g_={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:n.GenericReference,entityId:Jr,entityType:n.OutputMap},I_={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:n.GenericReference,entityId:cm,entityType:n.ContinueStatement},Fm={isError:!1,id:lm,type:n.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:g_,dataType:v_,required:!0,index:0,parent:I_},P_={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:n.GenericReference,entityId:Jr,entityType:n.FunctionCall},D_={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:n.GenericReference,entityId:tr,entityType:n.Loop},xm={id:cm,type:n.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[P_],outputs:[Fm],throws:null,x:0,y:0,parent:D_},S_={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:n.GenericReference,entityId:Jr,entityType:n.FunctionCall},A_={id:rM,type:n.OutputMap,version:1,declaration:ao.outputs[0],writesValues:[Fm],index:0,parent:S_},O_={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:n.GenericReference,entityId:to,entityType:n.ArgumentDeclaration},C_={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:n.GenericReference,entityId:Jr,entityType:n.FunctionCall},Um={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:so.inputs[0],readsValue:O_,index:0,defaultValue:null,dynamicArguments:[],parent:C_},B_={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:n.GenericReference,entityId:da,entityType:n.FunctionDeclaration},w_={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:n.GenericReference,entityId:da,entityType:n.FunctionDeclaration},M_={id:Jr,type:n.FunctionCall,version:1,declaration:so,inputs:[Um],process:null,outputs:[A_],calledByError:[],calledByEntry:[B_],calledBySuccess:[],successCalls:[xm],errorCalls:[],error:null,x:0,y:0,parent:w_},__={type:n.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:to,entityType:n.ArgumentDeclaration},N_={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Rt,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:__},V_={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:da,entityType:n.FunctionDeclaration},L_={id:to,type:n.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:N_,required:!0,index:0,writesValues:[Um],parent:V_},$_={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:n.GenericReference,entityId:tr,entityType:n.Loop},G_={id:da,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[L_],calls:[M_],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:$_},F_={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:tr,entityType:n.Loop},x_={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:n.GenericReference,entityId:ym,entityType:n.OutputMap},jm={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:qn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:x_,index:0,parent:F_},U_={id:"iterate-over-employee-list-loop-parent-ref-id",type:n.GenericReference,entityId:Zt,entityType:n.FunctionDeclaration},j_={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:n.GenericReference,entityId:tr,entityType:n.Loop},k_={id:om,type:n.OutputMap,version:1,declaration:qn.fixedReturns[0],writesValues:[Im],index:0,parent:j_},q_={type:n.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:n.VariableDeclaration,entityId:kt},J_={id:tr,type:n.Loop,version:1,declaration:qn,inputs:[jm],successCalls:[ro],errorCalls:[],outputs:[k_],body:G_,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[q_],breakStatements:[],continueStatements:[xm],error:null,x:0,y:0,parent:U_},W_={type:n.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:pa},H_={id:Em,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[vm],parent:W_},Y_={type:n.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:pa},z_={id:"company-dto-func-bank-account-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:Y_,defaultValue:null},Z_={type:n.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:Tm},X_={type:n.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Zt};n.GenericReference,n.VariableDeclaration;const km={id:pa,type:n.VariableDeclaration,version:1,name:"Bank account",dataType:z_,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[ro],errorCalls:[],readsValue:Z_,writesValues:[],inputs:[],outputs:[H_],internalCalls:[],parent:X_,x:0,y:0},Q_={type:n.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ua},K_={id:mm,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[bm],parent:Q_},eN={type:n.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ua},tN={id:"company-dto-func-owner-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:eN,defaultValue:null},nN={type:n.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:fm},rN={type:n.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Zt};n.GenericReference,n.VariableDeclaration;const qm={id:ua,type:n.VariableDeclaration,version:1,name:"Owner",dataType:tN,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[ro],errorCalls:[],readsValue:nN,writesValues:[],inputs:[],outputs:[K_],internalCalls:[],parent:rN,x:0,y:0},iN={type:n.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:kt},aN={id:fm,type:n.OutputMap,version:1,declaration:yt.properties[2],index:4,writesValues:[qm],parent:iN},sN={type:n.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:kt},oN={id:Tm,type:n.OutputMap,version:1,declaration:yt.properties[2],index:3,writesValues:[km],parent:sN},lN={type:n.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:kt},cN={id:hm,type:n.OutputMap,version:1,declaration:yt.properties[0],index:2,writesValues:[gm],parent:lN},dN={type:n.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:kt},uN={id:ym,type:n.OutputMap,version:1,declaration:yt.properties[3],index:1,writesValues:[jm],parent:dN},pN={type:n.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:kt},yN={id:pm,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[Pm],parent:pN},hN={type:n.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:kt},fN={id:"company-dto-func-company-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:hN,defaultValue:null},mN={type:n.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Zt},TN={type:n.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:eo},EN={type:n.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:n.FunctionDeclaration,entityId:Zt},Jm={id:kt,type:n.VariableDeclaration,version:1,name:"Company",dataType:fN,description:"A variable holding a company",calledByError:[],calledByEntry:[EN],calledBySuccess:[],successCalls:[km,qm,J_],errorCalls:[],readsValue:TN,writesValues:[],inputs:[],outputs:[yN,uN,cN,oN,aN],internalCalls:[],parent:mN,x:0,y:0},RN={type:n.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:eo,entityType:n.ArgumentDeclaration},bN={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:RN,defaultValue:null},vN={type:n.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:Zt,entityType:n.FunctionDeclaration},gN={type:n.ArgumentDeclaration,id:eo,version:1,name:"Company",description:"The company to create a DTO for",required:!0,dataType:bN,index:0,writesValues:[Jm],parent:vN},IN={type:n.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:n.Project,entityId:q},oo={type:n.FunctionDeclaration,id:Zt,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[gN],calls:[Jm],implements:null,index:null,returnStatements:[no],collapsed:!1,private:!1,x:0,y:0,parent:IN},Wr="exec-in-parallel-operation-call-id",Hr="exec-sequentially-operation-call-id",ct="concurrency-and-wait-function-declaration-id",Wm="concurrency-and-wait-return-statement-id",Hm="concurrency-and-wait-return-declaration-id",lo="exec-in-parallel-argument-map-id",Ym="exec-sequentially-argument-map-id",co="wait-for-2-seconds-operation-id",zm="wait-for-2-seconds-argument-map-id",uo="map-company-dto-function-call-id",Zm="map-company-dto-function-call-company-dto-output-map-id",Yr="company-dto-variable-one-id",po="company-dto-variable-one-instance-id",PN="company-dto-variable-two-id",DN={type:n.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:Hm},SN={id:"returned-company-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DN},AN={type:n.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:Wm},ON={type:n.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:Yr},Xm={isError:!1,id:Hm,type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:SN,readsValue:ON,required:!0,index:0,parent:AN},CN={type:n.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:co},BN={type:n.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},Qm={type:n.ReturnStatement,id:Wm,version:1,outputs:[Xm],calledByError:[],calledByEntry:[],calledBySuccess:[CN],throws:null,x:0,y:0,parent:BN},wN={type:n.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:n.VariableInstance,entityId:po},MN={type:n.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:n.VariableInstance,entityId:po},_N={type:n.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},Km={id:PN,type:n.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[wN],internalCalls:[],writesValues:[Xm],readsValue:MN,x:0,y:0,parent:_N},NN={type:n.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:n.VariableDeclaration,entityId:Yr},VN={type:n.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:Yr},LN={type:n.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},$N={type:n.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:Yr},eT={id:po,type:n.VariableInstance,version:1,declaration:$N,inputs:[],outputs:[],successCalls:[Km],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[NN],internalCalls:[],writesValues:[Km],readsValue:VN,x:0,y:0,parent:LN},GN={type:n.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:n.FunctionCall,entityId:uo},FN={type:n.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:n.OutputMap,entityId:Zm},xN={type:n.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},tT={id:Yr,type:n.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[eT],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[GN],internalCalls:[],writesValues:[eT],readsValue:FN,x:0,y:0,parent:xN},nT={type:n.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:n.FunctionCall,entityId:uo},UN={id:"map-company-dto-function-call-company-input-map-id",type:n.InputMap,version:1,declaration:oo.inputs[0],name:null,description:null,defaultValue:null,dynamicArguments:[],index:0,readsValue:null,parent:nT},jN={id:Zm,type:n.OutputMap,version:1,declaration:no.outputs[0],writesValues:[tT],index:0,parent:nT},kN={id:"map-company-dto-function-call-called-by-ref-id",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:ct},qN={id:"map-company-dto-function-call-parent-ref-id",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:ct},JN={id:uo,type:n.FunctionCall,version:1,declaration:oo,successCalls:[tT],process:null,errorCalls:[],inputs:[UN],outputs:[jN],calledByError:[],calledByEntry:[kN],calledBySuccess:[],parent:qN,x:0,y:0,error:null},WN={type:n.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:Xh},HN={type:n.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:n.DataType,entityId:"last-timestamp-variable-datatype-id"},YN={id:"last-timestamp-variable-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:fr,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:WN,defaultValue:{id:"last-timestamp-variable-default-value-id",type:n.PrimitiveValue,version:1,name:g.Date,value:null,autogeneration:{type:Le.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:HN,valueAsType:null}},zN={type:n.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:n.Project,entityId:q},yo={id:Xh,type:n.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:YN,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:zN},ZN={type:n.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:zm},XN={type:n.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:n.Operation,entityId:co},QN={id:zm,type:n.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:n.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:g.Number,parent:ZN},index:0,parent:XN},KN={type:n.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},e0={type:n.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:Hr},t0={type:n.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:n.FunctionDeclaration,entityId:Wr},rT={id:co,type:n.Operation,version:1,declaration:wt,inputs:[QN],dynamicArguments:[],outputs:[],process:null,successCalls:[Qm],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[e0,t0],calledBySuccess:[],error:null,parent:KN},n0={type:n.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"wait-for-random-amount-input-map-id"},r0={type:n.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:n.Operation,entityId:"wait-for-random-amount-id"},i0={id:"wait-for-random-amount-input-map-id",type:n.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:n.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:Le.Random,rangeStart:1e3,rangeEnd:4e3},name:g.Number,parent:n0},index:0,parent:r0},a0={type:n.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:n.Project,entityId:q},nr={id:"wait-for-random-amount-id",type:n.Operation,version:1,declaration:wt,inputs:[i0],dynamicArguments:[],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:a0},iT="list-of-functions-variable-id",s0={type:n.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:iT},o0={id:"list-of-functions-variable-action-descriptor-id",type:n.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.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},l0={type:n.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:n.DataType,entityId:"list-of-functions-variable-data-type-id"},c0={id:"list-of-functions-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:o0,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:g.ActionDescriptor,value:null,valueAsType:[nr,nr,nr,nr,nr],autogeneration:null,parent:l0},constant:!1,parent:s0},d0={type:n.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct};n.GenericReference,n.InputMap;const u0={type:n.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:n.InputMap,entityId:Ym},p0={type:n.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:n.InputMap,entityId:lo},aT={id:iT,type:n.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:c0,parent:d0,readsValue:null,writesValues:[u0,p0],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},y0={type:n.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:n.Operation,entityId:Wr},h0={type:n.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},f0={type:n.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:"exec-in-parallel-return-map-id"},m0={type:n.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:n.Operation,entityId:Wr},sT={id:"exec-in-parallel-result-variable-id",type:n.VariableInstance,version:1,declaration:yo,readsValue:f0,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[m0],successCalls:[],errorCalls:[],internalCalls:[],parent:h0,x:0,y:0},T0={id:"exec-in-parallel-return-map-id",type:n.OutputMap,version:1,declaration:as,writesValues:[sT],index:0,parent:y0},E0={type:n.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:n.Operation,entityId:Wr},R0={id:lo,type:n.InputMap,version:1,declaration:is,name:null,description:null,dynamicArguments:[],readsValue:aT,defaultValue:null,index:0,parent:E0},b0={type:n.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},v0={type:n.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ct},g0={process:null,id:Wr,type:n.Operation,version:1,declaration:wt,inputs:[R0],dynamicArguments:[],outputs:[T0],successCalls:[rT,sT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[v0],calledBySuccess:[],error:null,parent:b0},I0={type:n.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:n.Operation,entityId:Hr},P0={type:n.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},D0={type:n.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:"exec-sequentially-return-map-id"},S0={type:n.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:n.Operation,entityId:Hr},oT={id:"exec-sequentially-result-variable-id",type:n.VariableInstance,version:1,declaration:yo,readsValue:D0,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[S0],successCalls:[],errorCalls:[],internalCalls:[],parent:P0,x:0,y:0},A0={id:"exec-sequentially-return-map-id",type:n.OutputMap,version:1,declaration:os,writesValues:[oT],index:0,parent:I0},O0={type:n.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:n.Operation,entityId:Hr},C0={id:Ym,type:n.InputMap,version:1,declaration:ss,name:null,description:null,dynamicArguments:[],readsValue:aT,defaultValue:null,index:0,parent:O0},B0={type:n.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ct},w0={type:n.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ct},M0={id:Hr,type:n.Operation,version:1,declaration:Wt,inputs:[C0],process:null,dynamicArguments:[],outputs:[A0],successCalls:[rT,oT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[w0],calledBySuccess:[],error:null,parent:B0},_0={type:n.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:n.Project,entityId:q},N0={type:n.FunctionDeclaration,id:ct,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:[M0,g0,JN],returnStatements:[Qm],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:_0},V0={type:n.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:n.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},L0={id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:V0},$0={type:n.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:n.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},G0={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",dataType:L0,readsValue:null,required:!0,index:0,parent:$0},F0={type:n.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},x0={type:n.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},lT={type:n.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[G0],calledByError:[],calledByEntry:[x0],calledBySuccess:[],throws:null,x:0,y:0,parent:F0},U0={type:n.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:n.Project,entityId:q},j0={type:n.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[lT],index:null,implements:null,returnStatements:[lT],collapsed:!1,private:!1,x:0,y:0,parent:U0},ho="get-current-date-and-time-func-decl-id",cT="get-current-date-and-time-return-statement-id",dT="get-current-date-and-time-return-declaration-id",uT="get-current-date-and-time-return-declaration-data-type-id",k0={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:n.DataType,entityId:uT},q0={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:dT},J0={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:uT,version:1,entity:fr,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:n.PrimitiveValue,version:1,value:null,name:g.Date,valueAsType:null,autogeneration:{type:Le.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:k0},constant:!1,parent:q0},W0={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:n.ReturnStatement,entityId:cT};n.ReturnDeclaration;const H0={type:n.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ho},Y0={type:n.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ho};n.ReturnStatement;const z0={type:n.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:n.Project,entityId:q},Z0={type:n.FunctionDeclaration,id:ho,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:z0},pT="do-math-return-statement-id",yT="do-math-return-declaration-id",X0={type:n.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:n.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},Q0={id:"do-math-func-var-to-return-one-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:X0},K0={type:n.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},e1={type:n.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:n.ReturnDeclaration,entityId:yT},t1={type:n.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:Q0,readsValue:null,writesValues:[e1],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:K0},n1={type:n.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:n.ReturnStatement,entityId:pT},r1={type:n.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:n.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},i1={id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:r1},a1={isError:!1,id:yT,version:1,type:n.ReturnDeclaration,name:"Result",description:null,dataType:i1,readsValue:t1,required:!0,index:0,parent:n1},s1={type:n.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},o1={type:n.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},hT={type:n.ReturnStatement,id:pT,version:1,outputs:[a1],calledByError:[],calledByEntry:[],calledBySuccess:[s1],parent:o1,throws:null,x:0,y:0},l1={type:n.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:n.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},c1={id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:l1},d1={type:n.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},u1={type:n.GenericReference,id:"do-math-func-return-one-called-by",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},p1={type:n.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:n.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},fT={type:n.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:c1,description:null,readsValue:p1,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[u1],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:d1},y1={type:n.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},h1={type:n.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:n.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},f1={type:n.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:n.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},m1={id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:f1},T1={type:n.GenericReference,id:"do-math-func-return-two-called-by",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},mT={type:n.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[T1],successCalls:[],errorCalls:[],dataType:m1,readsValue:h1,writesValues:[],internalCalls:[],parent:y1,x:0,y:0},TT={type:n.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},E1={type:n.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},R1={type:n.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},b1={type:n.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:n.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},ET={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:n.InputMap,declaration:Za,name:null,description:null,dynamicArguments:[],readsValue:b1,defaultValue:null,index:0,parent:R1},v1={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:n.OutputMap,version:1,declaration:Qa,writesValues:[fT,mT],index:0,parent:E1},g1={type:n.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},I1={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:n.GenericReference,entityType:n.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},RT={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:n.InputMap,declaration:Xa,name:null,description:null,dynamicArguments:[],readsValue:I1,defaultValue:null,index:1,parent:g1},P1={type:n.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:Ka,version:1,inputs:[ET,RT],dynamicArguments:[],outputs:[v1],calledByError:[],calledByEntry:[TT],calledBySuccess:[],process:null,successCalls:[hT,fT,mT],errorCalls:[],parent:TT,error:null,x:0,y:0},D1={type:n.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:n.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},S1={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:n.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:n.ArgumentDeclaration},bT={id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:n.PrimitiveValue,version:1,value:1,name:g.Number,parent:D1,valueAsType:null,autogeneration:null},constant:!1,parent:S1},A1={type:n.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:n.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},O1={type:n.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},C1={type:n.GenericReference,id:"do-math-func-var-called-by-ref",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},vT={type:n.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:bT,inputs:[],outputs:[],calledByError:[],calledByEntry:[C1],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:A1,writesValues:[RT],internalCalls:[],x:0,y:0,parent:O1},B1={entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:n.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},w1={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:n.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:bT,writesValues:[vT],required:!0,index:1,parent:B1},M1={type:n.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:n.Project,entityId:q},_1={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},N1={type:n.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:n.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},V1={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:n.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:n.ArgumentDeclaration},L1={id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:n.PrimitiveValue,version:1,value:5,name:g.Number,parent:N1,valueAsType:null,autogeneration:null},constant:!1,parent:V1},$1={id:"d8895765-f705-457e-85fa-25d130926769",type:n.ArgumentDeclaration,version:1,name:"N",dataType:L1,description:"The number to add",writesValues:[ET],required:!0,index:0,parent:_1},G1={type:n.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[$1,w1],calls:[P1,vT],implements:null,index:null,collapsed:!1,returnStatements:[hT],private:!1,x:0,y:0,parent:M1},bt="replace-bank-account-in-company-func-declaration-id",fo="company-entity-to-modify-arg-declaration-id",F1="account-number-to-create-arg-decl-id",rr="company-variable-id",ir="search-person-by-id-id",gT="new-bank-account-owner-arg-decl-id",IT="search-person-by-id-output-declaration-id",mo="search-person-by-id-output-entity-map-id",ha="person-not-empty-condition-id",fa="create-new-bank-account-instance-operation-id",PT="create-new-bank-account-instance-operation-output-entity-map-id",DT="company-bank-account-output-map-id",ST="old-bank-account-var-declaration-id",AT="company-variable-instance-id",x1="delete-bank-account-internal-call-id",U1={type:n.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:n.FunctionDeclaration,entityId:bt},j1={type:n.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:n.InternalCall,entityId:x1},k1={type:n.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:rr},q1={type:n.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:n.VariableInstance,entityId:AT},J1={type:n.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:PT},OT={type:n.InputMap,id:"bank-account-input-map-id",version:1,readsValue:J1,declaration:Js,name:null,description:null,index:0,defaultValue:null,dynamicArguments:[],parent:q1},W1={type:n.VariableInstance,id:AT,version:1,declaration:k1,inputs:[OT],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[j1],successCalls:[],errorCalls:[],internalCalls:[],parent:U1,readsValue:null,writesValues:[],x:0,y:0},H1={type:n.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:rr},Y1={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:Kn,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:H1},z1={type:n.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:DT},Z1={type:n.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:bt},X1={type:n.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:n.VariableDeclaration,entityId:rr},Q1={type:n.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:n.Operation,entityId:fa},K1={type:n.GenericReference,id:"delete-bank-account-internal-call-parent-ref-id",entityType:n.VariableDeclaration,entityId:ST},CT={process:null,type:n.InternalCall,id:"delete-bank-account-internal-call-id",version:1,declaration:Ts,index:0,successCalls:[W1],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[Q1],parent:K1},BT={type:n.VariableDeclaration,id:ST,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:Y1,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[X1],successCalls:[],internalCalls:[CT],errorCalls:[],parent:Z1,readsValue:z1,writesValues:[],x:0,y:0},eV={type:n.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:rr},tV={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:eV},nV={type:n.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:fo},rV={type:n.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:n.FunctionDeclaration,entityId:bt},iV={type:n.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:bt},aV={type:n.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:rr},sV={id:DT,version:1,type:n.OutputMap,declaration:Js,index:0,parent:aV,writesValues:[BT]},wT={type:n.VariableDeclaration,id:rr,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:tV,inputs:[],outputs:[sV],calledByError:[],calledByEntry:[iV],calledBySuccess:[],successCalls:[BT],errorCalls:[],parent:rV,internalCalls:[],readsValue:nV,writesValues:[],x:0,y:0},oV={type:n.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:n.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},lV={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:n.GenericReference,entityType:n.OutputMap,entityId:mo},MT={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:n.InputMap,declaration:af,name:null,description:null,dynamicArguments:[],readsValue:lV,index:1,defaultValue:null,parent:oV},cV={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:F1},dV={type:n.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:n.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},_T={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:n.InputMap,declaration:rf,name:null,description:null,dynamicArguments:[],readsValue:cV,defaultValue:null,index:0,parent:dV},uV={type:n.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:n.Operation,entityId:fa},pV={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:n.InputMap,declaration:Tr.fixedArguments[0],name:null,description:null,dynamicArguments:[_T,MT],index:0,readsValue:null,defaultValue:{type:n.PrimitiveValue,name:g.EntityTemplate,value:null,valueAsType:Kn,autogeneration:null},parent:uV},yV={type:n.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:n.Operation,entityId:fa},hV={id:PT,version:1,type:n.OutputMap,declaration:Tr.fixedReturns[0],index:0,writesValues:[OT],parent:yV},fV={type:n.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:n.Condition,entityId:ha},mV={type:n.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:n.FunctionDeclaration,entityId:bt},TV={process:null,id:fa,type:n.Operation,version:1,declaration:Tr,inputs:[pV],dynamicArguments:[],error:null,outputs:[hV],successCalls:[CT],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[fV],parent:mV,x:0,y:0},EV={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:n.DataType},RV={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:n.ReturnDeclaration};n.DataType,n.PrimitiveValue,g.String;const bV={id:"person-not-found-thrown-error-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:n.ReturnStatement},vV={isError:!0,id:"person-not-found-thrown-error-id",type:n.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:bV,required:!0,index:0,readsValue:null},gV={id:"person-not-found-error-return-statement-called-by-ref-id",type:n.GenericReference,entityId:ha,entityType:n.Condition},IV={id:"person-not-found-error-return-statement-parent-ref-id",type:n.GenericReference,entityId:bt,entityType:n.FunctionDeclaration},PV={id:"person-not-found-error-return-statement-id",type:n.ReturnStatement,version:1,throws:vV,outputs:[],calledBySuccess:[],calledByError:[gV],calledByEntry:[],x:0,y:0,parent:IV},DV={type:n.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:n.Search,entityId:ir},SV={type:n.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:n.FunctionDeclaration,entityId:bt},AV={type:n.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:n.OutputMap,entityId:mo},OV={type:n.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:n.Condition,entityId:ha},NT={id:"person-entity-to-check-map-id",version:1,type:n.InputMap,declaration:Wn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:AV,index:0,defaultValue:null,parent:OV},CV={type:n.Condition,id:ha,version:1,declaration:Wn,inputs:[NT],calledByError:[],calledByEntry:[],calledBySuccess:[DV],successCalls:[TV],errorCalls:[PV],x:0,y:0,parent:SV},BV={type:n.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:n.ReturnDeclaration,entityId:IT},wV={id:"search-person-by-id-output-entity-declaration-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:lt,defaultValue:null,parent:BV},MV={type:n.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:n.Search,entityId:ir},VT={isError:!1,id:IT,type:n.ReturnDeclaration,version:1,dataType:wV,name:"Found person",description:"The person entity that was found",parent:MV,required:!0,index:0,readsValue:null},_V={type:n.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:n.Search,entityId:ir},NV={type:n.OutputMap,id:mo,version:1,declaration:VT,parent:_V,writesValues:[NT,MT],index:0},VV={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:n.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:n.ArgumentDeclaration};n.DataType;const LV={type:n.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:n.Search,entityId:ir},LT={id:"search-person-by-id-input-declaration-id",type:n.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",index:0,required:!0,parent:LV,writesValues:[]},$V={type:n.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:n.Search,entityId:ir},GV={id:"search-person-by-id-input-map-reads-value-ref-id",type:n.GenericReference,entityId:gT,entityType:n.ArgumentDeclaration},$T={type:n.InputMap,id:"search-person-by-id-input-map",version:1,declaration:LT,name:null,description:null,readsValue:GV,defaultValue:null,parent:$V,dynamicArguments:[],index:0},FV={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},xV={type:n.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:n.FunctionDeclaration,entityId:bt},UV={type:n.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:bt},jV={type:n.Search,id:ir,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:FV,inputsDeclarations:[LT],inputs:[$T],outputsDeclarations:[VT],outputs:[NV],calledByError:[],calledByEntry:[UV],calledBySuccess:[],error:null,successCalls:[CV],errorCalls:[],parent:xV,x:0,y:0};n.GenericReference,n.DataType;const kV={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:"account-number-to-create-arg-decl-id",entityType:n.ArgumentDeclaration},qV={id:"account-number-to-create-arg-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:kV},JV={entityType:n.FunctionDeclaration,entityId:bt,type:n.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},WV={id:"account-number-to-create-arg-decl-id",type:n.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:qV,writesValues:[_T],required:!0,index:1,parent:JV};n.GenericReference,n.DataType;const HV={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:n.ArgumentDeclaration},YV={id:"new-bank-account-owner-arg-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:za,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:HV},zV={entityType:n.FunctionDeclaration,entityId:bt,type:n.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},ZV={id:gT,type:n.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",dataType:YV,writesValues:[$T],required:!1,index:1,parent:zV},XV={type:n.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:n.Project,entityId:q},QV={type:n.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:n.FunctionDeclaration,entityId:bt};n.GenericReference,n.DataType;const KV={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:n.GenericReference,entityId:fo,entityType:n.ArgumentDeclaration},eL={id:"company-entity-to-modify-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:KV},tL={id:fo,type:n.ArgumentDeclaration,version:1,name:"Company",dataType:eL,description:"The company to replace the bank account for",writesValues:[wT],required:!0,index:0,parent:QV},nL={type:n.FunctionDeclaration,id:bt,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:[tL,WV,ZV],index:null,implements:null,calls:[jV,wT],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:XV},rL={type:n.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:n.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},iL={type:n.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:rL,x:0,y:0},aL={type:n.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:n.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},sL={type:n.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:n.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},oL={type:n.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[iL],events:[],implements:sL,parent:aL,x:0,y:0},To="iterate-over-list-loop-id",GT="iterate-over-list-loop-body-id",FT="iterate-over-list-loop-body-current-iteration-argument-declaration-id",lL={type:n.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:FT,entityType:n.ArgumentDeclaration},cL={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:lL},dL={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:GT,entityType:n.FunctionDeclaration},uL={id:FT,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:cL,required:!0,index:0,writesValues:[],parent:dL},pL={id:"iterate-over-list-loop-body-parent-ref-id",type:n.GenericReference,entityId:To,entityType:n.Loop},yL={id:GT,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[uL],calls:[],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:pL},hL={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:To,entityType:n.Loop},fL={id:"iterate-over-list-loop-iteration-list-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:qn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:null,index:0,parent:hL},mL={id:"iterate-over-list-loop-parent-ref-id",type:n.GenericReference,entityId:q,entityType:n.Project},TL={id:To,type:n.Loop,version:1,declaration:qn,inputs:[fL],successCalls:[],errorCalls:[],outputs:[],process:null,body:yL,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:mL};var Eo=(i=>(i.EQ="eq",i.NEQ="neq",i.GT="gt",i.GTE="gte",i.LT="lt",i.LTE="lte",i.LIKE="like",i.ILIKE="ilike",i))(Eo||{}),xT=(i=>(i.COUNT="count",i.SUM="sum",i.AVG="avg",i.MIN="min",i.MAX="max",i))(xT||{});const EL={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:xT.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:Eo.NEQ,value:null}]},where:[{name:"employee_count",operation:Eo.GT,value:1}]},RL={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:n.GenericReference,entityId:q,entityType:n.Project},bL={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:n.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:n.Search},UT={isError:!1,id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:n.ReturnDeclaration,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,readsValue:null,required:!0,index:0,parent:bL},vL={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:n.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:n.Search},gL={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:n.OutputMap,version:1,declaration:UT,writesValues:[],index:0,parent:vL},IL={id:"find-companies-with-multiple-employees-and-bank-account",type:n.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:[UT],inputs:[],outputs:[gL],query:EL,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:RL},ar="random-company-employee-test-variable-id",Ro="manager-global-variable-id",jT="global-user-instance-id",sr="employee-mapped-dto-variable-id",kT="random-employee-id-output-map-id",qT="random-employee-birth-date-output-map-id",JT="random-employee-department-output-map-id",WT="random-employee-manager-output-map-id",HT="manager-global-id-output-map-id",YT="global-user-instance-id-output-map-id",PL="employee-mapped-dto-requester-id-input-map-id",DL="employee-mapped-dto-id-input-map-id",SL="employee-mapped-dto-birth-date-input-map-id",AL="employee-mapped-dto-department-input-map-id",OL="employee-mapped-dto-manager-input-map-id",CL={type:n.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:HT},BL={type:n.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:sr},zT={id:OL,type:n.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:CL,parent:BL},wL={type:n.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:JT},ML={type:n.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:sr},ZT={id:AL,type:n.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:wL,parent:ML},_L={type:n.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:qT},NL={type:n.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:sr},XT={id:SL,type:n.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:_L,parent:NL},VL={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:kT},LL={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:sr},QT={id:DL,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:VL,parent:LL},$L={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:YT},GL={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:sr},KT={id:PL,type:n.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,dynamicArguments:[],index:0,readsValue:$L,parent:GL},FL={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Ro},xL={id:HT,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[zT],parent:FL},UL={type:n.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Ro},jL={id:"manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:UL,defaultValue:null},kL={type:n.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:WT},qL={type:n.GenericReference,id:"manager-variable-parent-ref-id",entityType:n.Project,entityId:q},eE={id:Ro,type:n.VariableDeclaration,version:1,name:"Manager",dataType:jL,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:kL,writesValues:[],inputs:[],outputs:[xL],internalCalls:[],parent:qL,x:0,y:0},JL={type:n.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ar},WL={id:WT,type:n.OutputMap,version:1,declaration:Rt.properties[2],index:3,writesValues:[eE],parent:JL},HL={type:n.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ar},YL={id:JT,type:n.OutputMap,version:1,declaration:Rt.properties[0],index:2,writesValues:[ZT],parent:HL},zL={type:n.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ar},ZL={id:qT,type:n.OutputMap,version:1,declaration:lt.properties[1],index:1,writesValues:[XT],parent:zL},XL={type:n.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ar},QL={id:kT,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[QT],parent:XL},KL={type:n.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ar},e$={id:"random-company-employee-test-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:KL,defaultValue:null},t$={type:n.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:n.Project,entityId:q},n$={id:ar,type:n.VariableDeclaration,version:1,name:"Company employee",dataType:e$,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[QL,ZL,YL,WL],internalCalls:[],parent:t$,x:0,y:0},r$={type:n.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:n.Project,entityId:q},i$={id:sr,type:n.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[KT,QT,XT,ZT,zT],outputs:[],internalCalls:[],parent:r$,x:0,y:0},a$={type:n.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:n.VariableDeclaration,entityId:xs},s$={id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:js,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:a$,defaultValue:null},o$={type:n.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:n.Project,entityId:q},tE={id:xs,type:n.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:s$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:o$},l$={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:n.VariableInstance,entityId:jT},c$={id:YT,type:n.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[KT],parent:l$},d$={type:n.GenericReference,id:"global-user-instance-parent-ref-id",entityType:n.Project,entityId:q},u$={id:jT,type:n.VariableInstance,version:1,declaration:tE,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[c$],internalCalls:[],parent:d$,x:0,y:0},p$={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:xs},y$={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:n.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},h$={id:"is-test-environment-variable-dcl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:jn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:p$,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:g.Boolean,version:1,value:null,type:n.PrimitiveValue,autogeneration:{type:Le.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:y$}},f$={type:n.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:n.Project,entityId:q},nE={id:"is-test-environment-variable-dcl-id",type:n.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:h$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:f$},m$={type:n.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:n.Project,entityId:q},T$={id:"is-test-environment-variable-instance-id",type:n.VariableInstance,version:1,declaration:nE,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:m$,x:0,y:0},E$={type:n.Project,id:q,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:[oL],entities:[Us,js,lt,EC,Rt,ia,Ef,Rf,Kn,pO,yt,oC,Qh,fI,dO],functions:[N0,Wf,so,j0,Z0,sm,oo,Ws,nL,Cf,G1],events:[XC],variableDeclarations:[nE,tE,yo,n$,eE,i$],variableInstances:[T$,u$],conditions:[],operations:[nr],functionCalls:[zB,nM],loops:[TL],searches:[IL]};function bo(i){return i.charAt(0).toUpperCase()+i.slice(1)}function R$(i){return i.charAt(0).toLowerCase()+i.slice(1)}function b$(i,e){if(i.type!==n.Property||e.type!==n.Property)throw new Error(`Expected property entities for comparison. But got ${i.type} and ${e.type}.`);return i===e||i.id===e.id?!0:i.name!==e.name||i.static!==e.static||i.abstract!==e.abstract?!1:vo(i.dataType,e.dataType).compatible}function v$(i,e){if(i.type!==n.CustomEntity||e.type!==n.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${i.type} and ${e.type}.`);if(i===e||i.id===e.id)return!0;if(i.properties.length!==e.properties.length)return!1;let t=[...e.properties];const r=[];for(let a=0;a<i.properties.length;a++){const s=i.properties[a];t.find(d=>{const p=b$(s,d);return p&&(t=t.filter(y=>y.id!==d.id)),p})||r.push(s)}return!(r.length>0)}var Vt=(i=>(i.BothUnconstrained="both-unconstrained",i.AConstraintBUnconstrained="a-constraint-b-unconstrained",i.BConstraintAUnconstrained="b-constraint-a-unconstrained",i.Same="same",i.AIsListBIsNot="a-is-list-b-is-not",i.BIsListAIsNot="b-is-list-a-is-not",i.AIsNullableBIsNot="a-is-nullable-b-is-not",i.BIsNullableAIsNot="b-is-nullable-a-is-not",i.AIsTemplateBIsNot="a-is-template-b-is-not",i.BIsTemplateAIsNot="b-is-template-a-is-not",i.BothUntyped="both-untyped",i.AIsUntypedBIsNot="a-is-untyped-b-is-not",i.BIsUntypedAIsNot="b-is-untyped-a-is-not",i.TypeEntityMismatch="type-entity-mismatch",i.SameCustomEntities="same-custom-entities",i.CompatibleCustomEntities="compatible-custom-entities",i.IncompatibleCustomEntities="incompatible-custom-entities",i.SamePrimitiveEntities="same-primitive-entities",i.IncompatiblePrimitiveEntities="incompatible-primitive-entities",i.SameBuiltInBaseEntities="same-built-in-base-entities",i.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",i.CheckUnknown="check-unknown",i))(Vt||{});function vo(i,e){var t,r,a,s,o,d,p,y,f,m,b;if(i&&i.type!==n.DataType||e&&e.type!==n.DataType)throw new Error(`Expected data-type entities for comparison. But got ${i==null?void 0:i.type} and ${e==null?void 0:e.type}.`);if(i===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(i===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(i===e)return{compatible:!0,type:"same"};if(i.id===e.id)return{compatible:!0,type:"same"};if(i.isList!==e.isList)return{compatible:!1,type:i.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(i.isNullable!==e.isNullable)return{compatible:!1,type:i.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(i.asType!==e.asType)return{compatible:!1,type:i.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!i.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(i.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!i.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=i.entity)==null?void 0:t.type)!==((r=e.entity)==null?void 0:r.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=i.entity)==null?void 0:a.type)===n.CustomEntity){if(((s=i.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const P=v$(i.entity,e.entity);return{compatible:P,type:P?"compatible-custom-entities":"incompatible-custom-entities"}}return((d=i.entity)==null?void 0:d.type)===n.PrimitiveEntity?((p=i.entity)==null?void 0:p.id)===((y=e.entity)==null?void 0:y.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((f=i.entity)==null?void 0:f.type)===n.BuiltInBaseEntity?((m=i.entity)==null?void 0:m.id)===((b=e.entity)==null?void 0:b.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function rE(i){var e;switch(i.type){case n.ArgumentDeclaration:return i.dataType;case n.InputMap:return((e=i.declaration)==null?void 0:e.dataType)||null;case n.VariableDeclaration:return i.dataType;case n.VariableInstance:return i.declaration.dataType;case n.OutputMap:return i.declaration.dataType;case n.ReturnDeclaration:return i.dataType;default:return null}}var T=(i=>(i.Error="error",i.Warning="warning",i))(T||{}),v=(i=>(i.InvalidObjectStructure="invalid-object-structure",i.NameNotUniqueInScope="name-not-unique-in-scope",i.EmptyName="empty-name",i.MissingCaller="missing-caller",i.PropertyOverwrite="property-overwrite",i.MethodOverwrite="method-overwrite",i.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",i.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",i.UnreachableEntity="unreachable-entity",i))(v||{}),h=(i=>(i.RootReference="root-reference",i.ReferencedEntityNotFound="referenced-entity-not-found",i.EntityIdNotUnique="entity-id-not-unique",i.BuiltInEntityGenerated="built-in-entity-generated",i.BuiltInEntityUpdated="built-in-entity-updated",i.BuiltInEntityDeleted="built-in-entity-deleted",i.UnknownEntityType="unknown-entity-type",i.MissingTypeProperty="missing-type-property",i.MissingIdProperty="missing-id-property",i.BuiltInEntityParent="built-in-entity-parent",i.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",i.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",i.RecommendedImplementOperationAction="recommended-implement-operation-action",i.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",i.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",i.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",i.RecommendedImplementConditionAction="recommended-implement-condition-action",i.InvalidReferenceObjectStructure="invalid-reference-object-structure",i.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",i.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",i.InvalidParentReference="invalid-parent-reference",i.InvalidImplementsReference="invalid-implements-reference",i.InvalidExtendsReference="invalid-extends-reference",i.InvalidGenerationActionPayload="invalid-generation-action-payload",i.InvalidReference="invalid-reference",i.InvalidInternalCallParentDeclarationRelation="invalid-internal-call-parent-declaration-relation",i.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",i.InvalidUpdateEntityOperation="invalid-update-entity-operation",i.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",i.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",i.UnrecognizedProperty="unrecognized-property",i.SelfReference="self-reference",i.DuplicateReference="duplicate-reference",i.CallerWithIncompatibleScope="caller-with-incompatible-scope",i.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",i.InvalidInputMapDeclaration="invalid-input-map-declaration",i.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",i.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",i.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",i.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",i.OutputOverwrite="output-overwrite",i.InputOverwrite="input-overwrite",i.IncompatibleScope="incompatible-scope",i.InvalidParentUpdate="invalid-parent-update",i.NonInteractiveEntityReferenced="non-interactive-entity-referenced",i.InvalidParentRelationType="invalid-parent-relation-type",i))(h||{}),_=(i=>(i.ScopeWithoutLogic="scope-without-logic",i.ExtendingAbstractEntity="extending-abstract-entity",i.ImplementingNonAbstractEntity="implementing-non-abstract-entity",i.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",i.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",i.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",i.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",i.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",i.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",i.IncorrectEntityImplementation="incorrect-entity-implementation",i.IncorrectMethodImplementation="incorrect-method-implementation",i.IncorrectPropertyImplementation="incorrect-property-implementation",i.PropertyImplementsNonAbstact="property-implements-non-abstract",i.NonStaticPropertyImplementsStatic="non-static-property-implements-static",i.StaticPropertyImplementsNonStatic="static-property-implements-non-static",i.PropertyImplementsIncompatibleType="property-implements-incompatible-type",i.MissingPropertyImplementation="missing-property-implementation",i.MissingMethodImplementation="missing-method-implementation",i.NoProperties="no-properties",i.ReadingFromIncompatibleType="reading-from-incompatible-type",i.WritingToIncompatibleType="writing-to-incompatible-type",i.InvalidPropertiesCombination="invalid-properties-combination",i.DisconnectedCallableEntity="disconnected-callable-entity",i))(_||{});class E{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(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 v?new or({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class or{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(this,"code");l(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 or({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function W(i){const e=i.entity.errors.find(r=>r.id===i.id);return e?{new:!1,error:e}:{new:!0,error:new or(i)}}function z(i,e){const t=[];return e.forEach(r=>{const a=i.find(s=>s.id===r.id);a?t.push(a):t.push(r)}),t}function D(i){if(i){let e=null;return typeof i=="string"?e=i:i.entityId?e=i.entityId:i.type!==n.GenericReference&&(e=i.id),e}return null}function iE(i){return i.declaration||i}function aE(i,e){const t=[];if(i.type===n.Project)t.push(...i.variableDeclarations);else{const a=Ct(we(i)).filter(s=>s.type===n.VariableDeclaration);t.push(...a),i.parent&&(it.includes(i.parent.type)||i.parent.type===n.Project)&&t.push(...aE(i.parent))}return t}function g$(i){var e;return(e=i.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 I$(i){return g$(i).toLowerCase()}function P$(i){if(!i)return"Any data type";if(!i.entity)return"Inherited";if(i.entity.type===n.PrimitiveEntity){const e=i.entity.name===g.String?"Text":i.entity.name;return i.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(i.entity.type===n.CustomEntity){const e=A$(i.entity);return i.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(i.entity.type===n.BuiltInBaseEntity){const e=S$(i.entity);return i.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return i.isList?`List of ${i.entity.name} entities`:`${i.entity.name.slice(0,1).toUpperCase()+i.entity.name.slice(1)} entity`}function go(i){switch(i.declaration.id){case De.Equal:return"is equal to";case De.NotEqual:return"is not equal to";case De.MoreThan:return"is greater than";case De.MoreThanOrEqual:return"is greater than or equal to";case De.LessThan:return"is less than";case De.LessThanOrEqual:return"is less than or equal to";case De.And:return"and";case De.Or:return"or";case St.Empty:return"is empty";case St.NotEmpty:return"is not empty"}}function D$(i){return i.includes(M.HTTP_ENDPOINT)?"HTTP endpoint":i.includes(M.PERSISTED_ENTITY)?"Persisted entity":i.includes(M.CRON_JOB)?"Scheduled execution":i.includes(M.RELATIONAL_DATABASE)?"Relational database":"Entity"}function S$(i){switch(i.name){case M.HTTP_ENDPOINT:return"HTTP endpoint";case M.PERSISTED_ENTITY:return"Persisted entity";case M.CRON_JOB:return"Scheduled execution";case M.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function A$(i){const e=Lb(i);if(!e){const t=Nb(i);return t.includes(M.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(M.PERSISTED_ENTITY)?"Persisted entity":t.includes(M.CRON_JOB)?"Scheduled execution":t.includes(M.RELATIONAL_DATABASE)?"Relational database":B(i,i.project)+" entity"}return B(e,i.project)+" entity"}function O$(i){let e="Find ";return i.outputsDeclarations.forEach((t,r)=>{const a=rE(t),s=R$(a&&a.entity?B(a.entity,i.project):"unstructured data");r===0?e+=`${s} `:r===i.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function C$(i){switch(i.name){case g.String:return"Text";case g.Number:return"Number";case g.Boolean:return"Boolean";case g.JSON:return"Data structure";case g.UUID:return"Unique identifier";case g.Date:return"Date";case g.EntityTemplate:return"Entity as template";case g.Enum:return"Enumeration";case g.File:return"File";case g.Null:return"Empty";case g.ActionDescriptor:return"Action descriptor";default:return i.name}}function B$(i){switch(i.id){case $e.List:return"Loop over list items";case $e.ManualFlow:return"Manual flow control loop";case $e.ObjectKeys:return"Loop over object keys";case $e.ObjectValues:return"Loop over object values";case $e.Counted:return"Loop given number of times";case $e.String:return"Loop over text characters";case nt.Addition:return"Sum numbers";case nt.Substraction:return"Subtract numbers";case nt.Multiplication:return"Multiply numbers";case nt.Division:return"Divide numbers";case nt.Remainder:return"Get remainder of numbers";case nt.Exponentiation:return"Get exponent of numbers";case be.AddIndex:return"Add at index position";case be.DeleteFirst:return"Delete first character";case be.DeleteLast:return"Delete last character";case be.DeleteIndex:return"Delete at index position";case be.Join:return"Join texts";case be.ReplaceAllMatches:return"Replace all matches";case be.ReplaceFirst:return"Replace first match";case be.ReplaceLast:return"Replace last match";case be.Split:return"Split text";case be.ReplaceIndex:return"Replace at index position";case be.ReplaceSingleMatch:return"Replace single match";case be.GetFirst:return"Get first character";case be.GetLast:return"Get last character";case be.GetIndex:return"Get at index position";case be.Append:return"Add at the end";case be.Prepend:return"Add at the start";case Ie.Wait:return"Wait";case Ie.Parallel:return"Run in parallel";case Ie.Sequential:return"Run in sequence";case qe.HttpRequest:return"HTTP request";case He.CreateNewInstance:return"Create new copy of entity";case U.AddIndex:return"Add item at index position";case U.DeleteFirst:return"Delete first item";case U.DeleteLast:return"Delete last item";case U.DeleteIndex:return"Delete item at index position";case U.Join:return"Join lists";case U.ReplaceAllMatches:return"Replace all matches";case U.ReplaceFirst:return"Replace first match";case U.ReplaceLast:return"Replace last match";case U.Split:return"Split list";case U.ReplaceIndex:return"Replace at index position";case U.ReplaceSingleMatch:return"Replace single match";case U.GetFirst:return"Get first item";case U.GetLast:return"Get last item";case U.GetIndex:return"Get item at index position";case U.Append:return"Add item at the end";case U.Prepend:return"Add item at the start";case Jt.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(i.name.slice(0,1).toUpperCase()+i.name.slice(1)).replaceAll("-"," ")}}function B(i,e){var t;if(n.FunctionDeclaration===i.type){const r=i.name;if(Object.values(Et).includes(r))switch(r){case Et.AbortExecution:return"Abort execution";case Et.DeletePersistedEntity:return"Delete persisted entity";case Et.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return bo(i.type).replaceAll("-"," ")}return r}if(n.BuiltInBaseEntity===i.type)return D$([i.name]);if(Ll.includes(i.type)&&i.type!==n.ActionDescriptor)return i.name;switch(i.type){case n.Search:return O$(i);case n.Operation:case n.InternalCall:case n.Loop:const r=Bt(i.declaration,e);return B(r,e);case n.ActionDescriptor:return B$(i);case n.BreakStatement:const a=Bt(i.parent,e);return`Stop loop ${B(a,e)}`;case n.ContinueStatement:const s=Bt(i.parent,e);return`Execute next iteration of ${B(s,e)}`;case n.FunctionCall:return Bt(i.declaration,e).name;case n.Condition:{const d=i;if((t=i.inputs)!=null&&t.length){const p=B(d.inputs[0],d.project);if(d.inputs[1]){const y=d.inputs[1].declaration.name;return`If ${p} ${go(d)} ${y}`}return`If ${p} ${go(d)}`}else return`If ${go(d)}`}case n.ReturnStatement:{const d=Bt(i.parent,e);return`Output of ${B(d,e)}`}case n.InputMap:if(i.declaration){const d=Bt(i.declaration,e);return B(d,e)||""}else return i.name||"";case n.VariableInstance:{const d=Bt(i.declaration,e);return B(d,e)||""}case n.OutputMap:if(i.declaration){const d=Bt(i.declaration,e);return(d==null?void 0:d.name)||""}else return"";case n.PrimitiveEntity:case n.PrimitiveValue:return C$(i);default:return bo(i.type).replaceAll("-"," ")}}function sE(i,e){const t=[];i.name||t.push(new E({id:`${i.id}--${v.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:v.EmptyName,issue:null}));const r=e.entities.filter(a=>a.name===i.name);return r.length&&t.push(new E({id:`${i.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${i.id}" and type "${i.type}" has a name "${i.name}" that is not unique in the project. Entity with id "${r[0].id}" has the same name.
2
- Please provide a unique 'name' string.`,severity:T.Error,code:v.NameNotUniqueInScope,issue:null})),t}function w$(i,e){const t=[];i.name||t.push(new E({id:`${i.id}--${v.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:v.EmptyName,issue:null}));const r=i.parent?D(i.parent):null;let a=e;r&&(a=e.get(r));const s=[];a.type===n.CustomEntity?s.push(...a.methods.map(d=>d)):a.type===n.Project?s.push(...a.functions.map(d=>d)):a.type===n.Loop?a.body&&s.push(a.body):a.type===n.InstalledProject&&s.push(...a.functions.map(d=>d));const o=s.filter(d=>d.name===i.name);return o.length&&t.push(new E({id:`${i.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${i.id}" and type "${i.type}" has a name "${i.name}" that is not unique in ${a.type===n.Project?"the globally declared project scope":"its parent entity"}. Entity with id "${o[0].id}" has the same name.
3
- Please provide a unique 'name' string.`,severity:T.Error,code:v.NameNotUniqueInScope,issue:null})),t}function M$(i,e){const t=[];i.name||t.push(new E({id:`${i.id}--${v.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:v.EmptyName,issue:null}));const r=i.parent&&Bt(i.parent,e)||e;if(!r)t.push(new E({id:`${i.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${i.parent}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const s=aE(r).filter(o=>o.name===i.name);s.length&&t.push(new E({id:`${i.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${i.id}" and type "${i.type}" has a name "${i.name}" that is not unique in its scope or higher scopes. Entity with id "${s[0].id}" has the same name.
4
- Please provide a unique 'name' string.`,severity:T.Error,code:v.NameNotUniqueInScope,issue:null}))}return t}function _$(i,e){const t=[];i.name||t.push(new E({id:`${i.id}--${v.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:v.EmptyName,issue:null}));const r=D(i.parent);if(!r)t.push(new E({id:`${i.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${i.id}" and type "${i.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(r);if(!a)t.push(new E({id:`${i.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=a.properties.filter(d=>d.name===i.name);o.length&&t.push(new E({id:`${i.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${i.id}" and type "${i.type}" has a name "${i.name}" that is not unique among all properties in the parent entity. Entity with id "${o[0].id}" has the same name.
5
- Please provide a unique 'name' string.`,severity:T.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function N$(i,e){const t=[];i.name||t.push(new E({id:`${i.id}--${v.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:v.EmptyName,issue:null}));const r=D(i.parent);if(!r)t.push(new E({id:`${i.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${i.id}" and type "${i.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(r);if(!a)t.push(new E({id:`${i.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=Pl(a).filter(d=>d.name===i.name);o.length&&t.push(new E({id:`${i.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${i.id}" and type "${i.type}" has a name "${i.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
6
- Please provide a unique 'name' string.`,severity:T.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function V$(i,e){const t=[];i.name||t.push(new E({id:`${i.id}--${v.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:v.EmptyName,issue:null}));const r=D(i.parent);if(!r)t.push(new E({id:`${i.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${i.id}" and type "${i.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(r);if(!a)t.push(new E({id:`${i.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=Dl(a).filter(d=>d.name===i.name);o.length&&t.push(new E({id:`${i.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${i.id}" and type "${i.type}" has a name "${i.name}" that is not unique among all outputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
7
- Please provide a unique 'name' string.`,severity:T.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}const L=xh();function Xt(i,e,t){const a=`${I$(i)}-${e}-id`;return t.instances[a]?L.uuid():a}function L$(i){return i instanceof Error&&i.name==="ZodError"&&"issues"in i&&Array.isArray(i.issues)}var $$=class extends Error{constructor(e,t){super(e,t);l(this,"name");l(this,"details");this.name="ZodValidationError",this.details=G$(t)}toString(){return this.message}};function G$(i){if(i){const e=i.cause;if(L$(e))return e.issues}return[]}var F$="; ",oE="Validation error",x$=": ",U$=", or ";function j$(i,e,t){return e!==null?i.length>0?[e,i].join(t):e:i.length>0?i:oE}var k$=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function q$(i){return i.length===1?i[0].toString():i.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+J$(t)+'"]';if(!k$.test(t))return e+'["'+t+'"]';const r=e.length===0?"":".";return e+r+t},"")}function J$(i){return i.replace(/"/g,'\\"')}function W$(i){return i.length!==0}function ma(i){const{issue:e,issueSeparator:t,unionSeparator:r,includePath:a}=i;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const d=o.issues.map(p=>ma({issue:p,issueSeparator:t,unionSeparator:r,includePath:a})).join(t);return s.includes(d)||s.push(d),s},[]).join(r);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>ma({issue:s,issueSeparator:t,unionSeparator:r,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>ma({issue:s,issueSeparator:t,unionSeparator:r,includePath:a}))].join(t);if(a&&W$(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 "${q$(e.path)}"`}return e.message}function H$(i,e={}){const{issueSeparator:t=F$,unionSeparator:r=U$,prefixSeparator:a=x$,prefix:s=oE,includePath:o=!0}=e,d=ma({issue:i,issueSeparator:t,unionSeparator:r,includePath:o}),p=j$(d,s,a);return new $$(p,{cause:new pt([i])})}var lE="1.13.7",cE=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Ta=Array.prototype,Io=Object.prototype,dE=typeof Symbol<"u"?Symbol.prototype:null,Y$=Ta.push,zr=Ta.slice,Zr=Io.toString,z$=Io.hasOwnProperty,uE=typeof ArrayBuffer<"u",Z$=typeof DataView<"u",X$=Array.isArray,pE=Object.keys,yE=Object.create,hE=uE&&ArrayBuffer.isView,Q$=isNaN,K$=isFinite,fE=!{toString:null}.propertyIsEnumerable("toString"),mE=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],eG=Math.pow(2,53)-1;function ht(i,e){return e=e==null?i.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),r=Array(t),a=0;a<t;a++)r[a]=arguments[a+e];switch(e){case 0:return i.call(this,r);case 1:return i.call(this,arguments[0],r);case 2:return i.call(this,arguments[0],arguments[1],r)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=r,i.apply(this,s)}}function dn(i){var e=typeof i;return e==="function"||e==="object"&&!!i}function tG(i){return i===null}function TE(i){return i===void 0}function EE(i){return i===!0||i===!1||Zr.call(i)==="[object Boolean]"}function nG(i){return!!(i&&i.nodeType===1)}function Ke(i){var e="[object "+i+"]";return function(t){return Zr.call(t)===e}}const Po=Ke("String"),RE=Ke("Number"),rG=Ke("Date"),iG=Ke("RegExp"),aG=Ke("Error"),bE=Ke("Symbol"),vE=Ke("ArrayBuffer");var gE=Ke("Function"),sG=cE.document&&cE.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof sG!="function"&&(gE=function(i){return typeof i=="function"||!1});const dt=gE,IE=Ke("Object");var PE=Z$&&(!/\[native code\]/.test(String(DataView))||IE(new DataView(new ArrayBuffer(8)))),Do=typeof Map<"u"&&IE(new Map),oG=Ke("DataView");function lG(i){return i!=null&&dt(i.getInt8)&&vE(i.buffer)}const Ea=PE?lG:oG,On=X$||Ke("Array");function un(i,e){return i!=null&&z$.call(i,e)}var So=Ke("Arguments");(function(){So(arguments)||(So=function(i){return un(i,"callee")})})();const Ao=So;function cG(i){return!bE(i)&&K$(i)&&!isNaN(parseFloat(i))}function DE(i){return RE(i)&&Q$(i)}function SE(i){return function(){return i}}function AE(i){return function(e){var t=i(e);return typeof t=="number"&&t>=0&&t<=eG}}function OE(i){return function(e){return e==null?void 0:e[i]}}const Ra=OE("byteLength"),dG=AE(Ra);var uG=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function pG(i){return hE?hE(i)&&!Ea(i):dG(i)&&uG.test(Zr.call(i))}const CE=uE?pG:SE(!1),ft=OE("length");function yG(i){for(var e={},t=i.length,r=0;r<t;++r)e[i[r]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,i.push(a)}}}function BE(i,e){e=yG(e);var t=mE.length,r=i.constructor,a=dt(r)&&r.prototype||Io,s="constructor";for(un(i,s)&&!e.contains(s)&&e.push(s);t--;)s=mE[t],s in i&&i[s]!==a[s]&&!e.contains(s)&&e.push(s)}function je(i){if(!dn(i))return[];if(pE)return pE(i);var e=[];for(var t in i)un(i,t)&&e.push(t);return fE&&BE(i,e),e}function wE(i){if(i==null)return!0;var e=ft(i);return typeof e=="number"&&(On(i)||Po(i)||Ao(i))?e===0:ft(je(i))===0}function ME(i,e){var t=je(e),r=t.length;if(i==null)return!r;for(var a=Object(i),s=0;s<r;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function Z(i){if(i instanceof Z)return i;if(!(this instanceof Z))return new Z(i);this._wrapped=i}Z.VERSION=lE,Z.prototype.value=function(){return this._wrapped},Z.prototype.valueOf=Z.prototype.toJSON=Z.prototype.value,Z.prototype.toString=function(){return String(this._wrapped)};function _E(i){return new Uint8Array(i.buffer||i,i.byteOffset||0,Ra(i))}var NE="[object DataView]";function Oo(i,e,t,r){if(i===e)return i!==0||1/i===1/e;if(i==null||e==null)return!1;if(i!==i)return e!==e;var a=typeof i;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:VE(i,e,t,r)}function VE(i,e,t,r){i instanceof Z&&(i=i._wrapped),e instanceof Z&&(e=e._wrapped);var a=Zr.call(i);if(a!==Zr.call(e))return!1;if(PE&&a=="[object Object]"&&Ea(i)){if(!Ea(e))return!1;a=NE}switch(a){case"[object RegExp]":case"[object String]":return""+i==""+e;case"[object Number]":return+i!=+i?+e!=+e:+i==0?1/+i===1/e:+i==+e;case"[object Date]":case"[object Boolean]":return+i==+e;case"[object Symbol]":return dE.valueOf.call(i)===dE.valueOf.call(e);case"[object ArrayBuffer]":case NE:return VE(_E(i),_E(e),t,r)}var s=a==="[object Array]";if(!s&&CE(i)){var o=Ra(i);if(o!==Ra(e))return!1;if(i.buffer===e.buffer&&i.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof i!="object"||typeof e!="object")return!1;var d=i.constructor,p=e.constructor;if(d!==p&&!(dt(d)&&d instanceof d&&dt(p)&&p instanceof p)&&"constructor"in i&&"constructor"in e)return!1}t=t||[],r=r||[];for(var y=t.length;y--;)if(t[y]===i)return r[y]===e;if(t.push(i),r.push(e),s){if(y=i.length,y!==e.length)return!1;for(;y--;)if(!Oo(i[y],e[y],t,r))return!1}else{var f=je(i),m;if(y=f.length,je(e).length!==y)return!1;for(;y--;)if(m=f[y],!(un(e,m)&&Oo(i[m],e[m],t,r)))return!1}return t.pop(),r.pop(),!0}function hG(i,e){return Oo(i,e)}function Xr(i){if(!dn(i))return[];var e=[];for(var t in i)e.push(t);return fE&&BE(i,e),e}function Co(i){var e=ft(i);return function(t){if(t==null)return!1;var r=Xr(t);if(ft(r))return!1;for(var a=0;a<e;a++)if(!dt(t[i[a]]))return!1;return i!==GE||!dt(t[Bo])}}var Bo="forEach",LE="has",wo=["clear","delete"],$E=["get",LE,"set"],fG=wo.concat(Bo,$E),GE=wo.concat($E),mG=["add"].concat(wo,Bo,LE);const TG=Do?Co(fG):Ke("Map"),EG=Do?Co(GE):Ke("WeakMap"),RG=Do?Co(mG):Ke("Set"),bG=Ke("WeakSet");function lr(i){for(var e=je(i),t=e.length,r=Array(t),a=0;a<t;a++)r[a]=i[e[a]];return r}function vG(i){for(var e=je(i),t=e.length,r=Array(t),a=0;a<t;a++)r[a]=[e[a],i[e[a]]];return r}function FE(i){for(var e={},t=je(i),r=0,a=t.length;r<a;r++)e[i[t[r]]]=t[r];return e}function Mo(i){var e=[];for(var t in i)dt(i[t])&&e.push(t);return e.sort()}function _o(i,e){return function(t){var r=arguments.length;if(e&&(t=Object(t)),r<2||t==null)return t;for(var a=1;a<r;a++)for(var s=arguments[a],o=i(s),d=o.length,p=0;p<d;p++){var y=o[p];(!e||t[y]===void 0)&&(t[y]=s[y])}return t}}const xE=_o(Xr),ba=_o(je),UE=_o(Xr,!0);function gG(){return function(){}}function jE(i){if(!dn(i))return{};if(yE)return yE(i);var e=gG();e.prototype=i;var t=new e;return e.prototype=null,t}function IG(i,e){var t=jE(i);return e&&ba(t,e),t}function PG(i){return dn(i)?On(i)?i.slice():xE({},i):i}function DG(i,e){return e(i),i}function kE(i){return On(i)?i:[i]}Z.toPath=kE;function Qr(i){return Z.toPath(i)}function No(i,e){for(var t=e.length,r=0;r<t;r++){if(i==null)return;i=i[e[r]]}return t?i:void 0}function qE(i,e,t){var r=No(i,Qr(e));return TE(r)?t:r}function SG(i,e){e=Qr(e);for(var t=e.length,r=0;r<t;r++){var a=e[r];if(!un(i,a))return!1;i=i[a]}return!!t}function Vo(i){return i}function Kr(i){return i=ba({},i),function(e){return ME(e,i)}}function Lo(i){return i=Qr(i),function(e){return No(e,i)}}function ei(i,e,t){if(e===void 0)return i;switch(t??3){case 1:return function(r){return i.call(e,r)};case 3:return function(r,a,s){return i.call(e,r,a,s)};case 4:return function(r,a,s,o){return i.call(e,r,a,s,o)}}return function(){return i.apply(e,arguments)}}function JE(i,e,t){return i==null?Vo:dt(i)?ei(i,e,t):dn(i)&&!On(i)?Kr(i):Lo(i)}function $o(i,e){return JE(i,e,1/0)}Z.iteratee=$o;function mt(i,e,t){return Z.iteratee!==$o?Z.iteratee(i,e):JE(i,e,t)}function AG(i,e,t){e=mt(e,t);for(var r=je(i),a=r.length,s={},o=0;o<a;o++){var d=r[o];s[d]=e(i[d],d,i)}return s}function WE(){}function OG(i){return i==null?WE:function(e){return qE(i,e)}}function CG(i,e,t){var r=Array(Math.max(0,i));e=ei(e,t,1);for(var a=0;a<i;a++)r[a]=e(a);return r}function Go(i,e){return e==null&&(e=i,i=0),i+Math.floor(Math.random()*(e-i+1))}const ti=Date.now||function(){return new Date().getTime()};function HE(i){var e=function(s){return i[s]},t="(?:"+je(i).join("|")+")",r=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,r.test(s)?s.replace(a,e):s}}const YE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},BG=HE(YE),wG=FE(YE),MG=HE(wG),_G=Z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Fo=/(.)^/,NG={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},VG=/\\|'|\r|\n|\u2028|\u2029/g;function LG(i){return"\\"+NG[i]}var $G=/^\s*(\w|\$)+\s*$/;function GG(i,e,t){!e&&t&&(e=t),e=UE({},e,Z.templateSettings);var r=RegExp([(e.escape||Fo).source,(e.interpolate||Fo).source,(e.evaluate||Fo).source].join("|")+"|$","g"),a=0,s="__p+='";i.replace(r,function(y,f,m,b,P){return s+=i.slice(a,P).replace(VG,LG),a=P+y.length,f?s+=`'+
1
+ (function(u,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(u=typeof globalThis<"u"?globalThis:u||self,r(u["@elyx-code/project-logic-tree"]={}))})(this,function(u){"use strict";var t9=Object.defineProperty;var n9=(u,r,w)=>r in u?t9(u,r,{enumerable:!0,configurable:!0,writable:!0,value:w}):u[r]=w;var l=(u,r,w)=>(n9(u,typeof r!="symbol"?r+"":r,w),w);var r=(n=>(n.CustomEntity="custom-entity",n.BuiltInBaseEntity="built-in-base-entity",n.Project="project",n.InstalledProject="installed-project",n.GlobalEvent="global-event",n.DataType="data-type",n.FunctionCall="function-call",n.FunctionDeclaration="function-declaration",n.ActionDescriptor="action-descriptor",n.ValueDescriptor="value-descriptor",n.ArgumentDeclaration="argument-declaration",n.InputMap="input-map",n.ReturnStatement="return-statement",n.BreakStatement="break-statement",n.ContinueStatement="continue-statement",n.ReturnDeclaration="return-declaration",n.OutputMap="output-map",n.PrimitiveEntity="primitive-entity",n.PrimitiveValue="primitive-value",n.Property="property",n.Operation="operation",n.Condition="condition",n.VariableDeclaration="variable-declaration",n.VariableInstance="variable-instance",n.Search="search",n.Loop="loop",n.InternalCall="internal-call",n.GenericReference="generic-reference",n))(r||{}),w=(n=>(n.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",n.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",n.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",n.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",n.EXECUTION="BUILT_IN_EXECUTION_ENTITY",n.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",n))(w||{}),Le=(n=>(n.CurrentDateAndTime="current-date-and-time",n.Unique="unique",n.Random="random",n))(Le||{}),Et=(n=>(n.DeletePersistedEntity="base-delete-persisted-entity",n.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",n.AbortExecution="base-abort-execution",n))(Et||{}),V=(n=>(n.Fixed="fixed",n.None="none",n.Dynamic="dynamic",n))(V||{}),O=(n=>(n.FixedArguments="fixed-arguments",n.FixedReturns="fixed-returns",n.ReturnedError="returned-error",n.OngoingProcessExecution="ongoing-process-execution",n))(O||{}),v=(n=>(n.EntityTemplate="entity-template",n.ActionDescriptor="action-descriptor",n.String="string",n.Number="number",n.Boolean="boolean",n.Null="null",n.Enum="enum",n.JSON="json",n.Date="date",n.UUID="uuid",n.File="file",n))(v||{}),nt=(n=>(n.Addition="addition",n.Substraction="substraction",n.Multiplication="multiplication",n.Division="division",n.Remainder="remainder",n.Exponentiation="exponentiation",n))(nt||{}),be=(n=>(n.Join="string-join",n.Split="stringSsplit",n.DeleteLast="string-delete-last",n.DeleteFirst="string-delete-first",n.DeleteIndex="string-delete-index",n.AddIndex="string-add-index",n.ReplaceFirst="string-replace-first",n.ReplaceLast="string-replace-last",n.ReplaceIndex="string-replace-index",n.ReplaceSingleMatch="string-replace-single-match",n.ReplaceAllMatches="string-replace-all-matches",n.GetIndex="string-get-index",n.GetFirst="string-get-first",n.GetLast="string-get-last",n.Append="string-append",n.Prepend="string-prepend",n))(be||{}),U=(n=>(n.Join="list-join",n.Split="list-split",n.DeleteLast="list-delete-last",n.DeleteFirst="list-delete-first",n.DeleteIndex="list-delete-index",n.AddIndex="list-add-index",n.ReplaceFirst="list-replace-first",n.ReplaceLast="list-replace-last",n.ReplaceIndex="list-replace-index",n.ReplaceSingleMatch="list-replace-single-match",n.ReplaceAllMatches="list-replace-all-matches",n.GetIndex="list-get-index",n.GetFirst="list-get-first",n.GetLast="list-get-last",n.Append="list-append",n.Prepend="list-prepend",n))(U||{}),Ie=(n=>(n.Parallel="parallel",n.Sequential="sequential",n.Wait="wait",n))(Ie||{}),He=(n=>(n.CreateNewInstance="create-new-instance",n.Validate="validate",n))(He||{}),qe=(n=>(n.HttpRequest="base-http-request",n))(qe||{}),De=(n=>(n.Equal="equal",n.NotEqual="not-equal",n.And="and",n.Or="or",n.LessThan="less-than",n.MoreThan="more-than",n.LessThanOrEqual="less-than-or-equal",n.MoreThanOrEqual="more-than-or-equal",n))(De||{}),St=(n=>(n.Empty="empty",n.NotEmpty="not-empty",n))(St||{}),$e=(n=>(n.ManualFlow="manual-flow-loop",n.Counted="counted-loop",n.List="list-loop",n.ObjectKeys="object-keys-loop",n.ObjectValues="object-values-loop",n.String="string-loop",n))($e||{}),xe=(n=>(n.OrDataTypeGroup="or-data-type-group",n.AndDataTypeGroup="and-data-type-group",n.DynamicArgumentTypes="dynamic-argument-types",n.DynamicReturnTypes="dynamic-return-types",n))(xe||{}),Wt=(n=>(n.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",n))(Wt||{}),Hl=(n=>(n.Error="error",n.Task="task",n))(Hl||{});const Tn=[r.VariableDeclaration,r.VariableInstance,r.InputMap,r.ReturnDeclaration],rt=[r.VariableDeclaration,r.VariableInstance,r.ArgumentDeclaration,r.OutputMap],Yl=[...Tn,...rt],_e=[r.VariableDeclaration,r.VariableInstance],jn=[r.GlobalEvent],Ge=[r.Operation,r.FunctionCall,r.Condition,r.Search,r.VariableDeclaration,r.VariableInstance,r.InternalCall,r.Loop],es=[r.Operation,r.FunctionCall,r.Condition,r.Search,r.VariableDeclaration,r.VariableInstance,r.Loop],Fe=[r.FunctionDeclaration,...jn],En=[...Ge,r.ReturnStatement,r.BreakStatement,r.ContinueStatement],ts=[...es,r.ReturnStatement,r.BreakStatement,r.ContinueStatement],tn=[...Ge,...Fe],zl=[...es,...Fe],Iv=[...En,...Fe],Pv=[...ts,...Fe],it=[...Fe,r.Loop],Ne=[r.ReturnStatement,r.BreakStatement,r.ContinueStatement],Dv=[r.CustomEntity,r.BuiltInBaseEntity,r.Project,r.InstalledProject,r.GlobalEvent,r.DataType,r.FunctionCall,r.FunctionDeclaration,r.ActionDescriptor,r.ValueDescriptor,r.ArgumentDeclaration,r.InputMap,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.ReturnDeclaration,r.OutputMap,r.PrimitiveEntity,r.PrimitiveValue,r.Property,r.Operation,r.Condition,r.VariableDeclaration,r.VariableInstance,r.Search,r.Loop,r.InternalCall],ns=[r.CustomEntity,r.GlobalEvent,r.FunctionDeclaration,r.FunctionCall,r.VariableDeclaration,r.VariableInstance,r.Operation,r.Condition,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.InstalledProject,r.Loop,r.Search],Zl=[r.CustomEntity,r.FunctionDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.Property,r.VariableDeclaration,r.Search,r.Project,r.InstalledProject,r.ActionDescriptor,r.ValueDescriptor],Si=[r.BuiltInBaseEntity,r.PrimitiveEntity],Sv=[r.CustomEntity,r.FunctionDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.Property,r.VariableDeclaration,r.GlobalEvent,r.Search,r.Project,r.InstalledProject,r.ActionDescriptor,r.ValueDescriptor,r.InputMap,r.OutputMap,r.FunctionCall,r.Operation,r.Condition,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.VariableInstance,r.PrimitiveValue,r.InternalCall],G={type:r.PrimitiveEntity,id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",description:"A string of characters.",version:1,name:v.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},kn={type:r.PrimitiveEntity,id:"f596545d-1565-4faa-9969-d95fa5edfea4",description:"A 'true' or 'false' value.",version:1,name:v.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ce={type:r.PrimitiveEntity,id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",description:"A number value.",version:1,name:v.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},at={type:r.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:v.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Xl={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:r.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:r.DataType},Ql={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:r.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:r.Property},Kl={id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:{id:"enum-options-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.JSON,autogeneration:null,value:[],valueAsType:null,parent:Xl},parent:Ql},ec={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:r.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:r.PrimitiveEntity},tc={required:!0,id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",name:"Options",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Kl,description:"Options for the enum. Each option is a text value.",parent:ec},Rn={type:r.PrimitiveEntity,id:"9542b8b4-2642-4eee-9db9-def7963a17a0",description:"A set of text options to choose from.",version:1,name:v.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[tc],methods:[]},mr={type:r.PrimitiveEntity,id:"dc58f38b-d574-4956-aac6-32ce9529b937",description:"A date and time value.",version:1,name:v.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},rs={type:r.PrimitiveEntity,id:"4a6234aa-c0f6-4731-b4dd-750388029226",description:"A unique identifier in the form of a 36-character string.",version:1,name:v.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[G],properties:[],methods:[]},nc={type:r.PrimitiveEntity,id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",description:"A complex data structure with any combination of properties with names and values.",version:1,name:v.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var rc=(n=>(n.FirstInputNumber="number-addition-first-number-argument-declaration",n.SecondInputNumber="number-addition-second-number-argument-declaration",n))(rc||{}),ic=(n=>(n.ResultNumber="number-addition-result-number-return-delaration",n.Error="number-addition-error-return-delaration",n))(ic||{});const ac={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:r.ValueDescriptor},sc={id:"number-addition-first-number-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ac},oc={type:r.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:r.ValueDescriptor},lc={id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:oc},cc={type:r.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:r.ValueDescriptor},dc={id:"b761acec-0755-4582-a68b-76267038bbe1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cc},uc={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:nt.Addition,entityType:r.ActionDescriptor},is={id:"number-addition-first-number-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:sc,required:!0,parentRelationType:O.FixedArguments,index:0,parent:uc},pc={type:r.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:nt.Addition,entityType:r.ActionDescriptor},as={id:"number-addition-second-number-argument-declaration",type:r.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:lc,required:!0,parentRelationType:O.FixedArguments,index:1,parent:pc},yc={type:r.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:nt.Addition,entityType:r.ActionDescriptor},ss={parentRelationType:O.FixedReturns,id:"number-addition-result-number-return-delaration",type:r.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:dc,required:!0,index:0,parent:yc},hc={type:r.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:nt.Addition,entityType:r.ActionDescriptor},fc={parentRelationType:O.FixedReturns,id:"number-addition-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:hc},os={id:nt.Addition,type:r.ActionDescriptor,description:"Add two numbers together",version:1,name:nt.Addition,fixedArguments:[is,as],error:fc,fixedReturns:[ss],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},mc={[nt.Addition]:os};var Tc=(n=>(n.FirstInputString="join-string-first-string-argument-declaration",n.SecondInputString="join-string-second-string-argument-declaration",n))(Tc||{}),Ec=(n=>(n.ResultString="join-string-result-string-return-delaration",n.Error="join-string-error-return-delaration",n))(Ec||{});const Rc={type:r.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:r.ValueDescriptor},bc={id:"join-string-first-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Rc},vc={type:r.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:r.ValueDescriptor},gc={id:"join-string-second-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vc},Ic={type:r.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:r.ValueDescriptor},Pc={id:"join-string-result-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Ic},Dc={type:r.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:be.Join,entityType:r.ActionDescriptor},Ai={id:"join-string-first-string-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",dataType:bc,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Dc},Sc={type:r.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:be.Join,entityType:r.ActionDescriptor},Oi={id:"join-string-second-string-argument-declaration",type:r.ValueDescriptor,version:1,name:"Second value",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",dataType:gc,parentRelationType:O.FixedArguments,required:!0,index:1,parent:Sc},Ac={type:r.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:be.Join,entityType:r.ActionDescriptor},Tr={parentRelationType:O.FixedReturns,id:"join-string-result-string-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:Pc,required:!0,index:0,parent:Ac},Oc={type:r.GenericReference,id:"join-string-operation-error-parent-ref",entityId:be.Join,entityType:r.ActionDescriptor},Cc={parentRelationType:O.FixedReturns,id:"join-string-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Oc},Ci={id:be.Join,type:r.ActionDescriptor,version:1,name:be.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Ai,Oi],fixedReturns:[Tr],error:Cc,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Bc={[be.Join]:Ci};var wc=(n=>(n.FirstInputList="join-list-first-list-argument-declaration",n.SecondInputList="join-list-second-list-argument-declaration",n))(wc||{}),Mc=(n=>(n.ResultList="join-list-result-list-return-delaration",n.Error="join-list-error-return-delaration",n))(Mc||{});const _c={type:r.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:r.ValueDescriptor},Nc={id:"join-list-first-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:_c},Vc={type:r.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:r.ValueDescriptor},Lc={id:"join-list-second-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Vc},$c={type:r.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:r.ValueDescriptor},Gc={id:"join-list-result-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:$c},Fc={type:r.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:U.Join,entityType:r.ActionDescriptor},xc={id:"join-list-first-list-argument-declaration",type:r.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.",dataType:Nc,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Fc},Uc={type:r.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:U.Join,entityType:r.ActionDescriptor},jc={id:"join-list-second-list-argument-declaration",type:r.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.",dataType:Lc,parentRelationType:O.FixedArguments,required:!0,index:1,parent:Uc},kc={type:r.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:U.Join,entityType:r.ActionDescriptor},qc={parentRelationType:O.FixedReturns,id:"join-list-result-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:Gc,required:!0,index:0,parent:kc},Jc={type:r.GenericReference,id:"join-list-operation-error-parent-ref",entityId:U.Join,entityType:r.ActionDescriptor},Wc={parentRelationType:O.FixedReturns,id:"join-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Jc},Hc={id:U.Join,type:r.ActionDescriptor,version:1,name:U.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[xc,jc],error:Wc,fixedReturns:[qc],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Yc=(n=>(n.InputList="list-to-split-argument-declaration",n.SplitIndex="split-list-index-argument-declaration",n))(Yc||{}),zc=(n=>(n.FirstOutputList="split-list-first-output-list-return-delaration",n.SecondOutputList="split-list-second-output-list-return-delaration",n.Error="split-list-error-return-delaration",n))(zc||{});const Zc={type:r.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:r.ValueDescriptor},Xc={id:"split-list-operation-input-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zc},Qc={type:r.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:r.ValueDescriptor},Kc={id:"split-list-operation-split-index-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Qc},ls={type:r.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:r.ValueDescriptor},ed={id:"split-list-operation-first-output-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ls},td={type:r.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:U.Split,entityType:r.ActionDescriptor},nd={id:"list-to-split-argument-declaration",type:r.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:Xc,parentRelationType:O.FixedArguments,required:!0,index:0,parent:td},rd={type:r.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:U.Split,entityType:r.ActionDescriptor},id={id:"split-list-index-argument-declaration",type:r.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.",dataType:Kc,parentRelationType:O.FixedArguments,required:!0,index:1,parent:rd},ad={type:r.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:U.Split,entityType:r.ActionDescriptor},sd={parentRelationType:O.FixedReturns,id:"split-list-first-output-list-return-delaration",type:r.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:ed,required:!0,index:0,parent:ad},od={id:"split-list-operation-second-output-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ls},ld={type:r.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:U.Split,entityType:r.ActionDescriptor},cd={parentRelationType:O.FixedReturns,id:"split-list-second-output-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:od,required:!0,index:0,parent:ld},dd={type:r.GenericReference,id:"split-list-operation-error-parent-ref",entityId:U.Split,entityType:r.ActionDescriptor},ud={parentRelationType:O.FixedReturns,id:"split-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:dd},pd={id:U.Split,type:r.ActionDescriptor,version:1,name:U.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",fixedArguments:[nd,id],fixedReturns:[sd,cd],error:ud,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var yd=(n=>(n.InputList="get-last-in-list-input-list-argument-declaration",n))(yd||{}),hd=(n=>(n.OutputElement="get-last-in-list-output-element-return-delaration",n.Error="get-last-in-list-error-return-delaration",n))(hd||{});const fd={type:r.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:r.ValueDescriptor},md={id:"get-last-in-list-input-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:fd},Td={type:r.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:r.ValueDescriptor},Ed={id:"get-last-in-list-output-element-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Td},Rd={type:r.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:U.GetLast,entityType:r.ActionDescriptor},bd={id:"get-last-in-list-input-list-argument-declaration",type:r.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:md,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Rd},vd={type:r.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:U.GetLast,entityType:r.ActionDescriptor},gd={parentRelationType:O.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:r.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:Ed,required:!0,index:0,parent:vd},Id={type:r.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:U.GetLast,entityType:r.ActionDescriptor},Pd={parentRelationType:O.FixedReturns,id:"get-last-in-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Id},Dd={id:U.GetLast,type:r.ActionDescriptor,version:1,name:U.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[bd],fixedReturns:[gd],error:Pd,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Sd=(n=>(n.List="append-to-list-lsit-argument-declaration",n.ElementToAppend="append-to-list-element-to-append-argument-declaration",n))(Sd||{}),Ad=(n=>(n.ResultList="append-to-list-result-list-return-delaration",n.Error="append-to-list-error-return-delaration",n))(Ad||{});const Od={type:r.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:r.ValueDescriptor},Cd={id:"append-to-list-lsit-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Od},Bd={type:r.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:r.ValueDescriptor},wd={id:"append-to-list-second-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Bd},Md={type:r.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:r.ValueDescriptor},_d={id:"append-to-list-result-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Md},Nd={type:r.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:U.Append,entityType:r.ActionDescriptor},cs={id:"append-to-list-lsit-argument-declaration",type:r.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:Cd,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Nd},Vd={type:r.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:U.Append,entityType:r.ActionDescriptor},ds={id:"append-to-list-element-to-append-argument-declaration",type:r.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:wd,parentRelationType:O.FixedArguments,required:!0,index:1,parent:Vd},Ld={type:r.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:U.Append,entityType:r.ActionDescriptor},$d={parentRelationType:O.FixedReturns,id:"append-to-list-result-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:_d,required:!0,index:0,parent:Ld},Gd={type:r.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:U.Append,entityType:r.ActionDescriptor},Fd={parentRelationType:O.FixedReturns,id:"append-to-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Gd},us={id:U.Append,type:r.ActionDescriptor,version:1,name:U.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[cs,ds],error:Fd,fixedReturns:[$d],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},xd={[U.Join]:Hc,[U.Split]:pd,[U.GetLast]:Dd,[U.Append]:us};var Ud=(n=>(n.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",n))(Ud||{}),jd=(n=>(n.ListOfExecutionResults="parallel-execution-result-return-delaration",n.Error="parallel-execution-error-return-delaration",n))(jd||{});const kd={id:"parallel-execution-list-of-functions-blueprint-id",type:r.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.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},qd={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:r.ValueDescriptor},Jd={id:"parallel-execution-list-of-functions-argument-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kd,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:qd},Wd={type:r.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:r.ValueDescriptor},Hd={id:"b761acec-0755-4582-a68b-76267038bbe1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Wd},Yd={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ie.Parallel,entityType:r.ActionDescriptor},ps={id:"parallel-execution-list-of-functions-argument-declaration",type:r.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Jd,required:!0,index:0,parent:Yd,parentRelationType:O.FixedArguments},zd={type:r.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ie.Parallel,entityType:r.ActionDescriptor},ys={id:"parallel-execution-result-return-delaration",type:r.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:Hd,required:!0,index:0,parent:zd,parentRelationType:O.FixedReturns},Zd={type:r.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ie.Parallel,entityType:r.ActionDescriptor},Xd={id:"parallel-execution-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Zd,parentRelationType:O.ReturnedError},Mt={id:Ie.Parallel,type:r.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ie.Parallel,fixedArguments:[ps],fixedReturns:[ys],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:Xd,parent:null};var Qd=(n=>(n.MillisecondsNumber="wait-milliseconds-number-argument-declaration",n))(Qd||{}),Kd=(n=>(n.Error="wait-operation-error-return-delaration",n))(Kd||{});const eu={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:r.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},tu={id:"wait-milliseconds-number-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:eu},nu={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:r.ActionDescriptor,entityId:Ie.Wait},bn={id:"wait-milliseconds-number-argument-declaration",type:r.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:tu,required:!0,index:0,parent:nu,parentRelationType:O.FixedArguments},ru={type:r.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ie.Wait,entityType:r.ActionDescriptor},iu={id:"wait-operation-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ru,parentRelationType:O.ReturnedError},st={id:Ie.Wait,type:r.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ie.Wait,fixedArguments:[bn],fixedReturns:[],error:iu,argumentsType:V.Fixed,returnsType:V.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var au=(n=>(n.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",n))(au||{}),su=(n=>(n.ListOfExecutionResults="sequential-execution-result-return-delaration",n.Error="sequential-execution-error-return-delaration",n))(su||{});const ou={id:"sequential-execution-list-of-functions-blueprint-id",type:r.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.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},lu={type:r.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:r.ValueDescriptor},cu={id:"sequential-execution-list-of-functions-argument-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ou,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:lu},du={type:r.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:r.ValueDescriptor},uu={id:"sequential-execution-list-of-execution-results-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:du},pu={type:r.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},hs={id:"sequential-execution-list-of-functions-argument-declaration",type:r.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:cu,required:!0,index:0,parent:pu,parentRelationType:O.FixedArguments},yu={type:r.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},fs={id:"sequential-execution-result-return-delaration",type:r.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:uu,required:!0,index:0,parent:yu,parentRelationType:O.FixedReturns},hu={type:r.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},fu={id:"sequential-execution-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:hu,parentRelationType:O.ReturnedError},Ht={id:Ie.Sequential,type:r.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ie.Sequential,fixedArguments:[hs],fixedReturns:[fs],error:fu,returnsType:V.Fixed,argumentsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},mu={[Ie.Parallel]:Mt,[Ie.Wait]:st,[Ie.Sequential]:Ht};var Tu=(n=>(n.EntityToInstanciate="entity-to-instanciate-argument-declaration",n))(Tu||{}),Eu=(n=>(n.Error="create-new-instance-error-return-delaration",n))(Eu||{});const Ru={type:r.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},bu={id:"entity-to-instanciate-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ru},vu={type:r.GenericReference,id:"create-new-instance-operation-ref",entityType:r.ActionDescriptor,entityId:He.CreateNewInstance},gu={id:"entity-to-instanciate-argument-declaration",type:r.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:bu,required:!0,parentRelationType:O.FixedArguments,index:0,parent:vu},Iu={type:r.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:He.CreateNewInstance,entityType:r.ActionDescriptor},Pu={parentRelationType:O.FixedReturns,id:"create-new-instance-output-entity-declaration",type:r.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:Iu,required:!0,index:0},Du={type:r.GenericReference,id:"create-new-instance-error-parent-ref",entityId:He.CreateNewInstance,entityType:r.ActionDescriptor},Su={parentRelationType:O.FixedReturns,id:"create-new-instance-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Du},Er={id:He.CreateNewInstance,type:r.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:He.CreateNewInstance,fixedArguments:[gu],fixedReturns:[Pu],error:Su,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Au=(n=>(n.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",n.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",n))(Au||{}),Ou=(n=>(n.Error="validate-data-error-return-delaration",n.OutputEntity="validate-data-output-entity-declaration",n))(Ou||{});const Cu={type:r.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},Bu={id:"validate-data-operation-data-to-validate-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Cu},wu={type:r.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:r.ActionDescriptor,entityId:He.Validate},Mu={id:"validate-data-operation-data-to-validate-argument-declaration",type:r.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:Bu,required:!0,parentRelationType:O.FixedArguments,index:0,parent:wu},_u={type:r.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},Nu={id:"validate-data-operation-entity-to-match-type-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:_u},Vu={type:r.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:r.ActionDescriptor,entityId:He.Validate},Lu={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:r.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:Nu,required:!0,index:0,parentRelationType:O.FixedArguments,parent:Vu},$u={type:r.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:He.Validate,entityType:r.ActionDescriptor},Gu={id:"validate-data-output-entity-declaration",type:r.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:$u,required:!0,index:0,parentRelationType:O.FixedReturns},Fu={type:r.GenericReference,id:"wait-operation-error-parent-ref",entityId:He.Validate,entityType:r.ActionDescriptor},xu={id:"validate-data-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Fu,parentRelationType:O.ReturnedError},qn={id:He.Validate,type:r.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:He.Validate,fixedArguments:[Lu,Mu],fixedReturns:[Gu],error:xu,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Uu={[He.CreateNewInstance]:Er,[He.Validate]:qn};var ms=(n=>(n.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",n))(ms||{});const Me={[r.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[r.BuiltInBaseEntity]:{[w.KEY_VALUE_PARAM]:{id:w.KEY_VALUE_PARAM},[w.HTTP_ENDPOINT]:{id:w.HTTP_ENDPOINT,properties:{method:"http-endpoint-built-in-method-property-id",path:"http-endpoint-built-in-path-property-id",cors:"http-endpoint-built-in-cors-property-id"}},[w.PERSISTED_ENTITY]:{id:w.PERSISTED_ENTITY,properties:{database:"persisted-built-in-base-entity-database-property-id",identifier:"persisted-built-in-base-entity-identifier-property-id"}},[w.RELATIONAL_DATABASE]:{id:w.RELATIONAL_DATABASE,properties:{identifier:"relational-database-built-in-base-entity-identifier-property-id",username:"relational-database-built-in-base-entity-username-property-id",password:"relational-database-built-in-base-entity-password-property-id",minSize:"relational-database-built-in-base-entity-min-size-property-id",default:"relational-database-built-in-base-entity-default-property-id"}},[w.CRON_JOB]:{id:w.CRON_JOB,properties:{expression:"cron-job-built-in-base-entity-expression-property-id"}}},[r.Operation]:{[be.Join]:{id:be.Join,inputs:{first:"join-string-first-string-input-id",second:"join-string-second-string-input-id"},outputs:{result:"join-string-result-string-return-delaration-id",error:"join-string-error-return-delaration-id"}},[qe.HttpRequest]:{id:qe.HttpRequest,inputs:{url:"http-request-url-input-id",query:"http-request-query-input-id",method:"http-request-method-input-id",headers:"http-request-headers-input-id",body:"http-request-body-string-input-id"},outputs:{code:"http-response-code-return-delaration-id",body:"http-response-body-return-delaration-id",headers:"http-response-headers-return-delaration-id",error:"http-request-error-return-delaration-id"}}},[r.Loop]:{[$e.List]:{id:$e.List,inputs:{list:"iterate-over-list-loop-list-input-id"},outputs:{results:"iterate-over-list-loop-output-id"}},[$e.ManualFlow]:{id:$e.ManualFlow,inputs:{},outputs:{results:"manual-flow-loop-output-id"}}},[r.Condition]:{[De.MoreThanOrEqual]:{id:De.MoreThanOrEqual,inputs:{leftHand:"condition-more-than-or-equal-left-hand-input-id",rightHand:"condition-more-than-or-equal-right-hand-input-id"}},[St.NotEmpty]:{id:St.NotEmpty,inputs:{leftHand:"condition-not-empty-input-id"}}},[r.GlobalEvent]:{[Wt.PROJECT_PUBLICATION_COMPLETED]:{id:Wt.PROJECT_PUBLICATION_COMPLETED}}},Ue=Me[r.Operation]["base-http-request"],ju={type:r.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:r.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},ku={id:"http-request-url-default-value-id",type:r.PrimitiveValue,version:1,value:"https://some-url.com",name:v.String,valueAsType:null,parent:ju,autogeneration:null},qu={type:r.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Ue.inputs.url,entityType:r.ValueDescriptor},Ju={id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:ku,constant:!1,parent:qu},Wu={type:r.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Ue.inputs.query,entityType:r.ValueDescriptor},Hu={id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Wu},Yu={type:r.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:r.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},zu={id:"http-request-method-default-value-id",type:r.PrimitiveValue,version:1,value:"GET",name:v.Enum,valueAsType:null,parent:Yu,autogeneration:null},Zu={type:r.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Ue.inputs.method,entityType:r.ValueDescriptor},Xu={id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:zu,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:Zu},Qu={type:r.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Ue.inputs.headers,entityType:r.ValueDescriptor},Ku={id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Qu},ep={type:r.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Ue.inputs.body,entityType:r.ValueDescriptor},tp={id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ep},np={type:r.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:r.ValueDescriptor,entityId:Ue.outputs.code},rp={id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:np},ip={type:r.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:r.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},ap={type:r.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:r.ValueDescriptor,entityId:Ue.outputs.headers},sp={id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:r.PrimitiveValue,version:1,value:{},name:v.JSON,parent:ip,valueAsType:null,autogeneration:null},constant:!1,parent:ap},op={type:r.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:r.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},lp={type:r.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:r.ValueDescriptor,entityId:Ue.outputs.body},cp={id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:r.PrimitiveValue,version:1,value:{},name:v.JSON,parent:op,valueAsType:null,autogeneration:null},constant:!1,parent:lp},dp={type:r.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},Bi={id:Ue.inputs.method,type:r.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",dataType:Xu,required:!1,index:0,parentRelationType:O.FixedArguments,parent:dp},up={type:r.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},wi={id:Ue.inputs.url,type:r.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:Ju,required:!1,index:1,parentRelationType:O.FixedArguments,parent:up},pp={type:r.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},Ts={id:Ue.inputs.query,type:r.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",dataType:Hu,required:!1,index:2,parentRelationType:O.FixedArguments,parent:pp},yp={type:r.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},Mi={id:Ue.inputs.headers,type:r.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",dataType:Ku,required:!1,index:3,parent:yp,parentRelationType:O.FixedArguments},hp={type:r.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},_i={id:Ue.inputs.body,type:r.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 JSON data structure or a text value.",version:1,name:"Body",dataType:tp,required:!1,index:4,parentRelationType:O.FixedArguments,parent:hp},fp={type:r.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},Es={id:Ue.outputs.code,type:r.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",dataType:rp,required:!0,index:0,parentRelationType:O.FixedReturns,parent:fp},mp={type:r.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},Ni={parentRelationType:O.FixedReturns,id:Ue.outputs.headers,type:r.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",dataType:sp,required:!0,index:1,parent:mp},Tp={type:r.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},Rr={parentRelationType:O.FixedReturns,id:Ue.outputs.body,type:r.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 JSON data structure or a text value.",version:1,name:"Body",dataType:cp,required:!0,index:2,parent:Tp},Ep={type:r.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:r.ActionDescriptor,entityId:qe.HttpRequest},Rp={type:r.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:r.ValueDescriptor,entityId:Ue.outputs.error},bp={id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:Rp},Rs={parentRelationType:O.ReturnedError,id:Ue.outputs.error,type:r.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:bp,required:!0,index:0,parent:Ep},Vi={type:r.ActionDescriptor,id:qe.HttpRequest,name:qe.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,fixedArguments:[Bi,wi,Ts,Mi,_i],fixedReturns:[Es,Ni,Rr],argumentsType:V.Fixed,returnsType:V.Fixed,error:Rs,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},vp={[qe.HttpRequest]:Vi},Av={...Bc,...mc,...xd,...mu,...Uu,...vp},gp=Me[r.Loop]["list-loop"],Ip={id:"iterate-over-list-loop-return-declaration-parent-ref-id",type:r.GenericReference,entityId:$e.List,entityType:r.ActionDescriptor},Pp={id:gp.outputs.results,type:r.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:null,required:!0,index:0,parent:Ip,parentRelationType:O.FixedReturns},Dp={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:r.ArgumentDeclaration},Sp={id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Dp},Ap={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:$e.List,entityType:r.ActionDescriptor},Op={id:gp.inputs.list,type:r.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:Sp,index:0,parent:Ap,parentRelationType:O.FixedArguments},Jn={id:$e.List,type:r.ActionDescriptor,version:1,name:$e.List,description:"Iterates over a list of entities",fixedArguments:[Op],fixedReturns:[Pp],error:null,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ov=Me[r.Loop]["list-loop"],Cp={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:"manual-flow-loop-previous-iterations-results-declaration-id",entityType:r.ReturnDeclaration},Bp={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Cp},wp={id:"manual-flow-loop-previous-iterations-results-declaration-parent-ref-id",type:r.GenericReference,entityId:$e.ManualFlow,entityType:r.ActionDescriptor},Mp={id:Ov.outputs.results,type:r.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:Bp,required:!0,index:1,parentRelationType:O.FixedReturns,parent:wp},_p={id:$e.ManualFlow,type:r.ActionDescriptor,version:1,name:$e.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.",fixedArguments:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[Mp],argumentsType:V.None,returnsType:V.Fixed,error:null,parent:null},Li=Me[r.BuiltInBaseEntity][w.KEY_VALUE_PARAM],Cv={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:r.DataType},Np={id:"key-value-param-built-in-base-entity-name-property-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:r.Property},Bv={id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:null,parent:Np},Vp={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:r.GenericReference,entityId:Li.id,entityType:r.BuiltInBaseEntity},Lp={required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Bv,description:"The name of the path parameter",parent:Vp},wv={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:r.DataType},$p={id:"key-value-param-built-in-base-entity-value-property-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:r.Property},Mv={id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:null,parent:$p},Gp={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:r.GenericReference,entityId:Li.id,entityType:r.BuiltInBaseEntity},Fp={required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:Mv,description:"The value of the path parameter",parent:Gp},bs={id:Li.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:Li.id,type:r.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[Lp,Fp],abstractMethods:[],methods:[],extends:[]},br=Me[r.BuiltInBaseEntity][w.HTTP_ENDPOINT].properties,xp={id:"endpointBuiltInCorsPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},Up={id:"endpointBuiltInCorsPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:br.cors},jp={id:"endpointBuiltInCorsPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:["*"],parent:xp,autogeneration:null,valueAsType:null},parent:Up},kp={id:"endpointBuiltInBaseEntityRef",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},qp={required:!0,id:br.cors,name:"Allowed origins",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:jp,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:kp},Jp={id:"endpointBuiltInPathPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInPathPropertyDataType"},Wp={id:"endpointBuiltInPathPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:br.path},Hp={id:"endpointBuiltInPathPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.String,value:"/",parent:Jp,autogeneration:null,valueAsType:null},parent:Wp},Yp={id:"endpointBuiltInBaseEntityRefTwo",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},vs={required:!0,id:br.path,name:"Path",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:Hp,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:Yp},zp={id:"endpointBuiltInMethodPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},Zp={id:"endpointBuiltInMethodPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"endpointBuiltInMethodProperty"},Xp={id:"endpointBuiltInMethodPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Rn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,value:"GET",name:v.Enum,parent:zp,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Zp},Qp={id:"endpointBuiltInBaseEntityRefThree",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},gs={required:!0,id:br.method,name:"Method",version:1,type:r.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:Xp,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:Qp},Kp={id:"endpointRequestHeadersVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointRequestHeadersVariableDataType"},ey={id:"endpointRequestHeadersArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},ty={id:"endpointRequestHeadersVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:{},parent:Kp,autogeneration:null,valueAsType:null},parent:ey},ny={id:"endpointRequestBodyArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},ry={id:"endpointRequestBodyVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:ny},iy={id:"endpointRequestQueryParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},ay={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},sy={id:"endpointRequestQueryParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:bs,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:[],parent:iy,autogeneration:null,valueAsType:null},parent:ay},oy={id:"endpointPathParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointPathParamsVariableDataType"},ly={id:"endpointPathParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},cy={id:"endpointPathParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:bs,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:[],parent:oy,autogeneration:null,valueAsType:null},parent:ly},dy={id:"endpointReachedTriggerActionDescriptorRef",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},uy={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:r.ValueDescriptor,name:"Request headers",dataType:ty,required:!0,index:0,parentRelationType:O.FixedArguments,parent:dy},py={id:"endpointReachedTriggerActionDescriptorRefTwo",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},yy={id:"endpointPathParamsArgumentDeclaration",type:r.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:cy,required:!0,index:1,parentRelationType:O.FixedArguments,parent:py},hy={id:"endpointReachedTriggerActionDescriptorRefThree",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},fy={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:r.ValueDescriptor,name:"Request query params",dataType:sy,required:!0,index:2,parentRelationType:O.FixedArguments,parent:hy},my={id:"endpointReachedTriggerActionDescriptorRefFour",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Ty={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:r.ValueDescriptor,name:"Request body",dataType:ry,index:3,required:!0,parentRelationType:O.FixedArguments,parent:my},Ey={id:"endpointResponseCodeReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},Ry={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Ey},by={id:"endpointReturnStatementRef",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},vy={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:r.ValueDescriptor,name:"Response code",dataType:Ry,required:!0,index:0,parentRelationType:O.FixedReturns,parent:by},gy={id:"endpointResponseHeadersDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointResponseHeadersDataType"},Iy={id:"endpointResponseHeadersReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},Py={id:"endpointResponseHeadersDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:{},parent:gy,autogeneration:null,valueAsType:null},parent:Iy},Dy={id:"endpointReturnStatementRefTwo",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},Sy={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:r.ValueDescriptor,name:"Response headers",dataType:Py,required:!1,index:1,parentRelationType:O.FixedReturns,parent:Dy},Ay={id:"endpointResponseBodyReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},Oy={id:"endpointResponseBodyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:Ay},Cy={id:"endpointReturnStatementRefThree",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},By={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:r.ValueDescriptor,name:"Response body",dataType:Oy,required:!1,index:2,parentRelationType:O.FixedReturns,parent:Cy},wy={id:"endpointBuiltInBaseEntityRefFour",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Is={id:"endpointReachedTriggerActionDescriptor",type:r.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:V.Fixed,dynamicArgumentTypes:null,fixedArguments:[uy,yy,fy,Ty],returnsType:V.Fixed,fixedReturns:[vy,Sy,By],error:null,dynamicReturnTypes:null,parent:wy},Ps={id:w.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:w.HTTP_ENDPOINT,type:r.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[qp,vs,gs],abstractMethods:[Is],extends:[],methods:[]},Gt=Me[r.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,My={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:r.DataType},_y={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:r.GenericReference,entityId:Gt.properties.identifier,entityType:r.Property},_v={id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:r.PrimitiveValue,version:1,name:v.String,value:null,parent:My,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:_y},Wn={id:"relational-database-built-in-base-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},$i={required:!0,id:Gt.properties.identifier,name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:_v,description:"The name of the main database inside of the server instance where the data will be stored.",parent:Wn},Nv={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:r.DataType},Ny={id:"relational-database-built-in-base-entity-username-property-ref-id",type:r.GenericReference,entityId:Gt.properties.username,entityType:r.Property},Vv={id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:r.PrimitiveValue,version:1,name:v.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:r.DataType},autogeneration:null,valueAsType:null},parent:Ny},Gi={required:!0,id:Gt.properties.username,name:"Username",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:Vv,description:"The username that will be used to connect to the database.",parent:Wn},Lv={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:r.DataType},Vy={id:"relational-database-built-in-base-entity-password-property-ref-id",type:r.GenericReference,entityId:Gt.properties.password,entityType:r.Property},$v={id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:Vy},Fi={required:!0,id:Gt.properties.password,name:"Password",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:$v,description:"The password that will be used to connect to the database.",parent:Wn},Ly={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:r.DataType},$y={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:r.GenericReference,entityId:Gt.properties.minSize,entityType:r.Property},Gv={id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:r.PrimitiveValue,version:1,name:v.Number,value:6,parent:Ly,autogeneration:null,valueAsType:null},parent:$y},xi={required:!0,id:Gt.properties.minSize,name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:Gv,description:"The minimum size of the database in GB.",parent:Wn},Gy={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:r.DataType},Fy={id:"relational-database-built-in-base-entity-default-property-ref-id",type:r.GenericReference,entityId:Gt.properties.default,entityType:r.Property},Fv={id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:kn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:r.PrimitiveValue,version:1,name:v.Boolean,value:!1,parent:Gy,autogeneration:null,valueAsType:null},parent:Fy},xy={required:!0,id:Gt.properties.default,name:"Default",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:Fv,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:Wn},vn={id:w.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:w.RELATIONAL_DATABASE,type:r.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[$i,Gi,Fi,xi,xy],abstractMethods:[],methods:[],extends:[]},Uy={type:r.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:r.BuiltInBaseEntity,id:Et.DeletePersistedEntity},Ds={type:r.FunctionDeclaration,id:Et.DeletePersistedEntity,name:Et.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:Uy,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},jy={type:r.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:r.BuiltInBaseEntity,id:Et.SoftDeletePersistedEntity},ky={type:r.FunctionDeclaration,id:Et.SoftDeletePersistedEntity,name:Et.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:jy,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},qy=Me[r.BuiltInBaseEntity][w.PERSISTED_ENTITY].properties,xv={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:r.DataType},Jy={id:"persisted-built-in-base-entity-database-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:r.Property},Uv={id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:null,parent:Jy},Wy={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},vr={required:!0,id:qy.database,name:"Database",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:Uv,description:"The database that the entity belongs to.",parent:Wy},Hy={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:r.DataType},Yy={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:r.Property},jv={id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:rs,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.UUID,value:null,parent:Hy,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Yy},zy={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},Zy={required:!0,id:qy.identifier,name:"Identifier",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:jv,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:zy},kv={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:r.DataType},Xy={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:r.Property},Qy={id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Xy},Ky={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},eh={required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Qy,description:"The date and time when the entity was deleted.",parent:Ky},qv={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:r.DataType},th={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:r.Property},nh={id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:th},rh={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},ih={required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:nh,description:"The date and time when the entity was created.",parent:rh},Jv={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:r.DataType},ah={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:r.Property},sh={id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:ah},oh={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},lh={required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:r.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:sh,description:"The date and time when the entity was last updated.",parent:oh},Oe={id:w.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:w.PERSISTED_ENTITY,type:r.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[vr,Zy,eh,ih,lh],methods:[Ds,ky],extends:[]},ch={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Ss={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:r.ActionDescriptor,argumentsType:V.None,returnsType:V.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:ch},dh=Me[r.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,Wv={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:r.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:r.DataType},uh={id:"cron-job-built-in-base-entity-expression-property-ref",type:r.GenericReference,entityId:dh.properties.expression,entityType:r.Property},Hv={id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:uh},ph={id:"cron-job-built-in-base-entity-ref",type:r.GenericReference,entityId:w.CRON_JOB,entityType:r.BuiltInBaseEntity},yh={required:!0,id:dh.properties.expression,name:"Cron expression",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:Hv,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:ph},hh={id:w.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:w.CRON_JOB,type:r.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[yh],methods:[],abstractMethods:[Ss],extends:[]},fh={type:r.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:r.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},As={id:"execution-built-in-entity-abort-method-id",type:r.FunctionDeclaration,version:1,name:Et.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:fh},Os={id:w.EXECUTION,type:r.BuiltInBaseEntity,version:1,name:w.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:[As],abstractMethods:[]},Yv=Me[r.Condition]["not-empty"],mh={type:r.GenericReference,id:"not-empty-condition-ref",entityType:r.ActionDescriptor,entityId:St.NotEmpty},Th={id:Yv.inputs.leftHand,type:r.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:0,parent:mh},Hn={type:r.ActionDescriptor,id:St.NotEmpty,version:1,name:St.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[Th],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.Fixed,returnsType:V.None,error:null},Eh={[St.NotEmpty]:Hn},Rh=Me[r.Condition]["more-than-or-equal"],bh={type:r.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:r.ActionDescriptor,entityId:De.MoreThanOrEqual},vh={id:Rh.inputs.leftHand,type:r.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:0,parent:bh},gh={type:r.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:r.ActionDescriptor,entityId:De.MoreThanOrEqual},Ih={id:Rh.inputs.rightHand,type:r.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:1,parent:gh},gr={type:r.ActionDescriptor,id:De.MoreThanOrEqual,version:1,name:De.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[vh,Ih],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.Fixed,returnsType:V.None,error:null},Ph={[De.MoreThanOrEqual]:gr},zv={...Eh,...Ph},Cs={type:r.ActionDescriptor,id:Wt.PROJECT_PUBLICATION_COMPLETED,version:1,name:Wt.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,fixedArguments:[],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.None,returnsType:V.None,error:null},Zv={[Wt.PROJECT_PUBLICATION_COMPLETED]:Cs},Bs=Me[r.ValueDescriptor][ms.ActionOngoingProcessOutputValue],Dh={type:r.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:r.ValueDescriptor,entityId:Bs.id},Sh={id:Bs.dataType.id,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Os,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Dh},Ah={id:Bs.id,type:r.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:Sh,required:!0,index:0,parent:null,parentRelationType:O.OngoingProcessExecution};var H;(function(n){n.assertEqual=a=>a;function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},n.getValidEnumValues=a=>{const s=n.objectKeys(a).filter(d=>typeof a[a[d]]!="number"),o={};for(const d of s)o[d]=a[d];return n.objectValues(o)},n.objectValues=a=>n.objectKeys(a).map(function(s){return a[s]}),n.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},n.find=(a,s)=>{for(const o of a)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function i(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=i,n.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(H||(H={}));var ws;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(ws||(ws={}));const M=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nn=n=>{switch(typeof n){case"undefined":return M.undefined;case"string":return M.string;case"number":return isNaN(n)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(n)?M.array:n===null?M.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?M.promise:typeof Map<"u"&&n instanceof Map?M.map:typeof Set<"u"&&n instanceof Set?M.set:typeof Date<"u"&&n instanceof Date?M.date:M.object;default:return M.unknown}},I=H.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"]),Xv=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class pt extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_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)i._errors.push(t(o));else{let d=i,p=0;for(;p<o.path.length;){const y=o.path[p];p===o.path.length-1?(d[y]=d[y]||{_errors:[]},d[y]._errors.push(t(o))):d[y]=d[y]||{_errors:[]},d=d[y],p++}}};return a(this),i}static assert(e){if(!(e instanceof pt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];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))):i.push(e(a));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}pt.create=n=>new pt(n);const Yn=(n,e)=>{let t;switch(n.code){case I.invalid_type:n.received===M.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case I.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,H.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:t=`Unrecognized key(s) in object: ${H.joinValues(n.keys,", ")}`;break;case I.invalid_union:t="Invalid input";break;case I.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${H.joinValues(n.options)}`;break;case I.invalid_enum_value:t=`Invalid enum value. Expected ${H.joinValues(n.options)}, received '${n.received}'`;break;case I.invalid_arguments:t="Invalid function arguments";break;case I.invalid_return_type:t="Invalid function return type";break;case I.invalid_date:t="Invalid date";break;case I.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:H.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case I.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case I.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case I.custom:t="Invalid input";break;case I.invalid_intersection_types:t="Intersection results could not be merged";break;case I.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case I.not_finite:t="Number must be finite";break;default:t=e.defaultError,H.assertNever(n)}return{message:t}};let Oh=Yn;function Qv(n){Oh=n}function Ui(){return Oh}const ji=n=>{const{data:e,path:t,errorMaps:i,issueData:a}=n,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let d="";const p=i.filter(y=>!!y).slice().reverse();for(const y of p)d=y(o,{data:e,defaultError:d}).message;return{...a,path:s,message:d}},Kv=[];function B(n,e){const t=Ui(),i=ji({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Yn?void 0:Yn].filter(a=>!!a)});n.common.issues.push(i)}class Ye{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const a of t){if(a.status==="aborted")return x;a.status==="dirty"&&e.dirty(),i.push(a.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const a of t){const s=await a.key,o=await a.value;i.push({key:s,value:o})}return Ye.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return x;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const x=Object.freeze({status:"aborted"}),zn=n=>({status:"dirty",value:n}),ot=n=>({status:"valid",value:n}),Ms=n=>n.status==="aborted",_s=n=>n.status==="dirty",Ir=n=>n.status==="valid",Pr=n=>typeof Promise<"u"&&n instanceof Promise;function ki(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function Ch(n,e,t,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(n,t):a?a.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var N;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(N||(N={}));var Dr,Sr;class Ft{constructor(e,t,i,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,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 Bh=(n,e)=>{if(Ir(e))return{success:!0,data:e.value};if(!n.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 pt(n.common.issues);return this._error=t,this._error}}};function k(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:a}=n;if(e&&(t||i))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,d)=>{var p,y;const{message:f}=n;return o.code==="invalid_enum_value"?{message:f??d.defaultError}:typeof d.data>"u"?{message:(p=f??i)!==null&&p!==void 0?p:d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:(y=f??t)!==null&&y!==void 0?y:d.defaultError}},description:a}}class J{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 nn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ye,ctx:{common:e.parent.common,data:e.data,parsedType:nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Pr(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 i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const a={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return Bh(a,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={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:nn(e)},a=this._parse({data:e,path:i.path,parent:i}),s=await(Pr(a)?a:Promise.resolve(a));return Bh(i,s)}refine(e,t){const i=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),d=()=>s.addIssue({code:I.custom,...i(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,t){return this._refinement((i,a)=>e(i)?!0:(a.addIssue(typeof t=="function"?t(i,a):t),!1))}_refinement(e){return new Vt({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ut.create(this,this._def)}nullable(){return on.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return Kn.create(this,this._def)}or(e){return Br.create([this,e],this._def)}and(e){return wr.create(this,e,this._def)}transform(e){return new Vt({...k(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Lr({...k(this._def),innerType:this,defaultValue:t,typeName:F.ZodDefault})}brand(){return new Ls({typeName:F.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new $r({...k(this._def),innerType:this,catchValue:t,typeName:F.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Gr.create(this,e)}readonly(){return Fr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const eg=/^c[^\s-]{8,}$/i,tg=/^[0-9a-z]+$/,ng=/^[0-9A-HJKMNP-TV-Z]{26}$/,rg=/^[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,ig=/^[a-z0-9_-]{21}$/i,ag=/^[-+]?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)?)??$/,sg=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,og="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ns;const lg=/^(?:(?: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])$/,cg=/^(([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})))$/,dg=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wh="((\\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])))",ug=new RegExp(`^${wh}$`);function Mh(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function pg(n){return new RegExp(`^${Mh(n)}$`)}function _h(n){let e=`${wh}T${Mh(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function yg(n,e){return!!((e==="v4"||!e)&&lg.test(n)||(e==="v6"||!e)&&cg.test(n))}class _t extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){const s=this._getOrReturnCtx(e);return B(s,{code:I.invalid_type,expected:M.string,received:s.parsedType}),x}const i=new Ye;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:I.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:I.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,d=e.data.length<s.value;(o||d)&&(a=this._getOrReturnCtx(e,a),o?B(a,{code:I.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):d&&B(a,{code:I.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")sg.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"email",code:I.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Ns||(Ns=new RegExp(og,"u")),Ns.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"emoji",code:I.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")rg.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"uuid",code:I.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")ig.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"nanoid",code:I.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")eg.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"cuid",code:I.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")tg.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"cuid2",code:I.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")ng.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"ulid",code:I.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),B(a,{validation:"url",code:I.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"regex",code:I.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),B(a,{code:I.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.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),B(a,{code:I.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),B(a,{code:I.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?_h(s).test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:I.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?ug.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:I.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?pg(s).test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:I.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?ag.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"duration",code:I.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?yg(e.data,s.version)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"ip",code:I.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?dg.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"base64",code:I.invalid_string,message:s.message}),i.dirty()):H.assertNever(s);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(a=>e.test(a),{validation:t,code:I.invalid_string,...N.errToObj(i)})}_addCheck(e){return new _t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}datetime(e){var t,i;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:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...N.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,...N.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...N.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...N.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...N.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...N.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...N.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...N.errToObj(t)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new _t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _t({...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}}_t.create=n=>{var e;return new _t({checks:[],typeName:F.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...k(n)})};function hg(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,a=t>i?t:i,s=parseInt(n.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class rn extends J{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)!==M.number){const s=this._getOrReturnCtx(e);return B(s,{code:I.invalid_type,expected:M.number,received:s.parsedType}),x}let i;const a=new Ye;for(const s of this._def.checks)s.kind==="int"?H.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:I.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:I.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)&&(i=this._getOrReturnCtx(e,i),B(i,{code:I.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?hg(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),B(i,{code:I.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:I.not_finite,message:s.message}),a.dirty()):H.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,i,a){return new rn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:N.toString(a)}]})}_addCheck(e){return new rn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.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"&&H.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}rn.create=n=>new rn({checks:[],typeName:F.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...k(n)});class an extends J{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)!==M.bigint){const s=this._getOrReturnCtx(e);return B(s,{code:I.invalid_type,expected:M.bigint,received:s.parsedType}),x}let i;const a=new Ye;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:I.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)&&(i=this._getOrReturnCtx(e,i),B(i,{code:I.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),B(i,{code:I.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):H.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,i,a){return new an({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:N.toString(a)}]})}_addCheck(e){return new an({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.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}}an.create=n=>{var e;return new an({checks:[],typeName:F.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...k(n)})};class Ar extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){const i=this._getOrReturnCtx(e);return B(i,{code:I.invalid_type,expected:M.boolean,received:i.parsedType}),x}return ot(e.data)}}Ar.create=n=>new Ar({typeName:F.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...k(n)});class gn extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){const s=this._getOrReturnCtx(e);return B(s,{code:I.invalid_type,expected:M.date,received:s.parsedType}),x}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return B(s,{code:I.invalid_date}),x}const i=new Ye;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:I.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:I.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):H.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new gn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:N.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}}gn.create=n=>new gn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:F.ZodDate,...k(n)});class qi extends J{_parse(e){if(this._getType(e)!==M.symbol){const i=this._getOrReturnCtx(e);return B(i,{code:I.invalid_type,expected:M.symbol,received:i.parsedType}),x}return ot(e.data)}}qi.create=n=>new qi({typeName:F.ZodSymbol,...k(n)});class Or extends J{_parse(e){if(this._getType(e)!==M.undefined){const i=this._getOrReturnCtx(e);return B(i,{code:I.invalid_type,expected:M.undefined,received:i.parsedType}),x}return ot(e.data)}}Or.create=n=>new Or({typeName:F.ZodUndefined,...k(n)});class Cr extends J{_parse(e){if(this._getType(e)!==M.null){const i=this._getOrReturnCtx(e);return B(i,{code:I.invalid_type,expected:M.null,received:i.parsedType}),x}return ot(e.data)}}Cr.create=n=>new Cr({typeName:F.ZodNull,...k(n)});class Zn extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return ot(e.data)}}Zn.create=n=>new Zn({typeName:F.ZodAny,...k(n)});class In extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ot(e.data)}}In.create=n=>new In({typeName:F.ZodUnknown,...k(n)});class Yt extends J{_parse(e){const t=this._getOrReturnCtx(e);return B(t,{code:I.invalid_type,expected:M.never,received:t.parsedType}),x}}Yt.create=n=>new Yt({typeName:F.ZodNever,...k(n)});class Ji extends J{_parse(e){if(this._getType(e)!==M.undefined){const i=this._getOrReturnCtx(e);return B(i,{code:I.invalid_type,expected:M.void,received:i.parsedType}),x}return ot(e.data)}}Ji.create=n=>new Ji({typeName:F.ZodVoid,...k(n)});class Nt extends J{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),a=this._def;if(t.parsedType!==M.array)return B(t,{code:I.invalid_type,expected:M.array,received:t.parsedType}),x;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,d=t.data.length<a.exactLength.value;(o||d)&&(B(t,{code:o?I.too_big:I.too_small,minimum:d?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),i.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(B(t,{code:I.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),i.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(B(t,{code:I.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((o,d)=>a.type._parseAsync(new Ft(t,o,t.path,d)))).then(o=>Ye.mergeArray(i,o));const s=[...t.data].map((o,d)=>a.type._parseSync(new Ft(t,o,t.path,d)));return Ye.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new Nt({...this._def,minLength:{value:e,message:N.toString(t)}})}max(e,t){return new Nt({...this._def,maxLength:{value:e,message:N.toString(t)}})}length(e,t){return new Nt({...this._def,exactLength:{value:e,message:N.toString(t)}})}nonempty(e){return this.min(1,e)}}Nt.create=(n,e)=>new Nt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...k(e)});function Xn(n){if(n instanceof Be){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=Ut.create(Xn(i))}return new Be({...n._def,shape:()=>e})}else return n instanceof Nt?new Nt({...n._def,type:Xn(n.element)}):n instanceof Ut?Ut.create(Xn(n.unwrap())):n instanceof on?on.create(Xn(n.unwrap())):n instanceof xt?xt.create(n.items.map(e=>Xn(e))):n}class Be extends J{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=H.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==M.object){const y=this._getOrReturnCtx(e);return B(y,{code:I.invalid_type,expected:M.object,received:y.parsedType}),x}const{status:i,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof Yt&&this._def.unknownKeys==="strip"))for(const y in a.data)o.includes(y)||d.push(y);const p=[];for(const y of o){const f=s[y],m=a.data[y];p.push({key:{status:"valid",value:y},value:f._parse(new Ft(a,m,a.path,y)),alwaysSet:y in a.data})}if(this._def.catchall instanceof Yt){const y=this._def.unknownKeys;if(y==="passthrough")for(const f of d)p.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(y==="strict")d.length>0&&(B(a,{code:I.unrecognized_keys,keys:d}),i.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const f of d){const m=a.data[f];p.push({key:{status:"valid",value:f},value:y._parse(new Ft(a,m,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const y=[];for(const f of p){const m=await f.key,b=await f.value;y.push({key:m,value:b,alwaysSet:f.alwaysSet})}return y}).then(y=>Ye.mergeObjectSync(i,y)):Ye.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new Be({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var a,s,o,d;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,i).message)!==null&&o!==void 0?o:i.defaultError;return t.code==="unrecognized_keys"?{message:(d=N.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(e){return new Be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:F.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Be({...this._def,catchall:e})}pick(e){const t={};return H.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new Be({...this._def,shape:()=>t})}omit(e){const t={};return H.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new Be({...this._def,shape:()=>t})}deepPartial(){return Xn(this)}partial(e){const t={};return H.objectKeys(this.shape).forEach(i=>{const a=this.shape[i];e&&!e[i]?t[i]=a:t[i]=a.optional()}),new Be({...this._def,shape:()=>t})}required(e){const t={};return H.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Ut;)s=s._def.innerType;t[i]=s}}),new Be({...this._def,shape:()=>t})}keyof(){return Nh(H.objectKeys(this.shape))}}Be.create=(n,e)=>new Be({shape:()=>n,unknownKeys:"strip",catchall:Yt.create(),typeName:F.ZodObject,...k(e)}),Be.strictCreate=(n,e)=>new Be({shape:()=>n,unknownKeys:"strict",catchall:Yt.create(),typeName:F.ZodObject,...k(e)}),Be.lazycreate=(n,e)=>new Be({shape:n,unknownKeys:"strip",catchall:Yt.create(),typeName:F.ZodObject,...k(e)});class Br extends J{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function a(s){for(const d of s)if(d.result.status==="valid")return d.result;for(const d of s)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const o=s.map(d=>new pt(d.ctx.common.issues));return B(t,{code:I.invalid_union,unionErrors:o}),x}if(t.common.async)return Promise.all(i.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 i){const y={...t,common:{...t.common,issues:[]},parent:null},f=p._parseSync({data:t.data,path:t.path,parent:y});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:y}),y.common.issues.length&&o.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const d=o.map(p=>new pt(p));return B(t,{code:I.invalid_union,unionErrors:d}),x}}get options(){return this._def.options}}Br.create=(n,e)=>new Br({options:n,typeName:F.ZodUnion,...k(e)});const zt=n=>n instanceof _r?zt(n.schema):n instanceof Vt?zt(n.innerType()):n instanceof Nr?[n.value]:n instanceof sn?n.options:n instanceof Vr?H.objectValues(n.enum):n instanceof Lr?zt(n._def.innerType):n instanceof Or?[void 0]:n instanceof Cr?[null]:n instanceof Ut?[void 0,...zt(n.unwrap())]:n instanceof on?[null,...zt(n.unwrap())]:n instanceof Ls||n instanceof Fr?zt(n.unwrap()):n instanceof $r?zt(n._def.innerType):[];class Wi extends J{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.object)return B(t,{code:I.invalid_type,expected:M.object,received:t.parsedType}),x;const i=this.discriminator,a=t.data[i],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}):(B(t,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const a=new Map;for(const s of t){const o=zt(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 d of o){if(a.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);a.set(d,s)}}return new Wi({typeName:F.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...k(i)})}}function Vs(n,e){const t=nn(n),i=nn(e);if(n===e)return{valid:!0,data:n};if(t===M.object&&i===M.object){const a=H.objectKeys(e),s=H.objectKeys(n).filter(d=>a.indexOf(d)!==-1),o={...n,...e};for(const d of s){const p=Vs(n[d],e[d]);if(!p.valid)return{valid:!1};o[d]=p.data}return{valid:!0,data:o}}else if(t===M.array&&i===M.array){if(n.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<n.length;s++){const o=n[s],d=e[s],p=Vs(o,d);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===M.date&&i===M.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class wr extends J{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=(s,o)=>{if(Ms(s)||Ms(o))return x;const d=Vs(s.value,o.value);return d.valid?((_s(s)||_s(o))&&t.dirty(),{status:t.value,value:d.data}):(B(i,{code:I.invalid_intersection_types}),x)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}wr.create=(n,e,t)=>new wr({left:n,right:e,typeName:F.ZodIntersection,...k(t)});class xt extends J{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==M.array)return B(i,{code:I.invalid_type,expected:M.array,received:i.parsedType}),x;if(i.data.length<this._def.items.length)return B(i,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&i.data.length>this._def.items.length&&(B(i,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((o,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new Ft(i,o,i.path,d)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Ye.mergeArray(t,o)):Ye.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new xt({...this._def,rest:e})}}xt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xt({items:n,typeName:F.ZodTuple,rest:null,...k(e)})};class Mr extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==M.object)return B(i,{code:I.invalid_type,expected:M.object,received:i.parsedType}),x;const a=[],s=this._def.keyType,o=this._def.valueType;for(const d in i.data)a.push({key:s._parse(new Ft(i,d,i.path,d)),value:o._parse(new Ft(i,i.data[d],i.path,d)),alwaysSet:d in i.data});return i.common.async?Ye.mergeObjectAsync(t,a):Ye.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof J?new Mr({keyType:e,valueType:t,typeName:F.ZodRecord,...k(i)}):new Mr({keyType:_t.create(),valueType:e,typeName:F.ZodRecord,...k(t)})}}class Hi extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==M.map)return B(i,{code:I.invalid_type,expected:M.map,received:i.parsedType}),x;const a=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([d,p],y)=>({key:a._parse(new Ft(i,d,i.path,[y,"key"])),value:s._parse(new Ft(i,p,i.path,[y,"value"]))}));if(i.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of o){const y=await p.key,f=await p.value;if(y.status==="aborted"||f.status==="aborted")return x;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),d.set(y.value,f.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const p of o){const y=p.key,f=p.value;if(y.status==="aborted"||f.status==="aborted")return x;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),d.set(y.value,f.value)}return{status:t.value,value:d}}}}Hi.create=(n,e,t)=>new Hi({valueType:e,keyType:n,typeName:F.ZodMap,...k(t)});class Pn extends J{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==M.set)return B(i,{code:I.invalid_type,expected:M.set,received:i.parsedType}),x;const a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(B(i,{code:I.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&i.data.size>a.maxSize.value&&(B(i,{code:I.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 y=new Set;for(const f of p){if(f.status==="aborted")return x;f.status==="dirty"&&t.dirty(),y.add(f.value)}return{status:t.value,value:y}}const d=[...i.data.values()].map((p,y)=>s._parse(new Ft(i,p,i.path,y)));return i.common.async?Promise.all(d).then(p=>o(p)):o(d)}min(e,t){return new Pn({...this._def,minSize:{value:e,message:N.toString(t)}})}max(e,t){return new Pn({...this._def,maxSize:{value:e,message:N.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Pn.create=(n,e)=>new Pn({valueType:n,minSize:null,maxSize:null,typeName:F.ZodSet,...k(e)});class Qn extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.function)return B(t,{code:I.invalid_type,expected:M.function,received:t.parsedType}),x;function i(d,p){return ji({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ui(),Yn].filter(y=>!!y),issueData:{code:I.invalid_arguments,argumentsError:p}})}function a(d,p){return ji({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ui(),Yn].filter(y=>!!y),issueData:{code:I.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Kn){const d=this;return ot(async function(...p){const y=new pt([]),f=await d._def.args.parseAsync(p,s).catch(P=>{throw y.addIssue(i(p,P)),y}),m=await Reflect.apply(o,this,f);return await d._def.returns._def.type.parseAsync(m,s).catch(P=>{throw y.addIssue(a(m,P)),y})})}else{const d=this;return ot(function(...p){const y=d._def.args.safeParse(p,s);if(!y.success)throw new pt([i(p,y.error)]);const f=Reflect.apply(o,this,y.data),m=d._def.returns.safeParse(f,s);if(!m.success)throw new pt([a(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Qn({...this._def,args:xt.create(e).rest(In.create())})}returns(e){return new Qn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Qn({args:e||xt.create([]).rest(In.create()),returns:t||In.create(),typeName:F.ZodFunction,...k(i)})}}class _r extends J{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})}}_r.create=(n,e)=>new _r({getter:n,typeName:F.ZodLazy,...k(e)});class Nr extends J{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return B(t,{received:t.data,code:I.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}Nr.create=(n,e)=>new Nr({value:n,typeName:F.ZodLiteral,...k(e)});function Nh(n,e){return new sn({values:n,typeName:F.ZodEnum,...k(e)})}class sn extends J{constructor(){super(...arguments),Dr.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return B(t,{expected:H.joinValues(i),received:t.parsedType,code:I.invalid_type}),x}if(ki(this,Dr,"f")||Ch(this,Dr,new Set(this._def.values),"f"),!ki(this,Dr,"f").has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return B(t,{received:t.data,code:I.invalid_enum_value,options:i}),x}return ot(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 sn.create(e,{...this._def,...t})}exclude(e,t=this._def){return sn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}Dr=new WeakMap,sn.create=Nh;class Vr extends J{constructor(){super(...arguments),Sr.set(this,void 0)}_parse(e){const t=H.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==M.string&&i.parsedType!==M.number){const a=H.objectValues(t);return B(i,{expected:H.joinValues(a),received:i.parsedType,code:I.invalid_type}),x}if(ki(this,Sr,"f")||Ch(this,Sr,new Set(H.getValidEnumValues(this._def.values)),"f"),!ki(this,Sr,"f").has(e.data)){const a=H.objectValues(t);return B(i,{received:i.data,code:I.invalid_enum_value,options:a}),x}return ot(e.data)}get enum(){return this._def.values}}Sr=new WeakMap,Vr.create=(n,e)=>new Vr({values:n,typeName:F.ZodNativeEnum,...k(e)});class Kn extends J{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.promise&&t.common.async===!1)return B(t,{code:I.invalid_type,expected:M.promise,received:t.parsedType}),x;const i=t.parsedType===M.promise?t.data:Promise.resolve(t.data);return ot(i.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Kn.create=(n,e)=>new Kn({type:n,typeName:F.ZodPromise,...k(e)});class Vt extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{B(i,o),o.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async d=>{if(t.value==="aborted")return x;const p=await this._def.schema._parseAsync({data:d,path:i.path,parent:i});return p.status==="aborted"?x:p.status==="dirty"||t.value==="dirty"?zn(p.value):p});{if(t.value==="aborted")return x;const d=this._def.schema._parseSync({data:o,path:i.path,parent:i});return d.status==="aborted"?x:d.status==="dirty"||t.value==="dirty"?zn(d.value):d}}if(a.type==="refinement"){const o=d=>{const p=a.refinement(d,s);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(i.common.async===!1){const d=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return d.status==="aborted"?x:(d.status==="dirty"&&t.dirty(),o(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(d=>d.status==="aborted"?x:(d.status==="dirty"&&t.dirty(),o(d.value).then(()=>({status:t.value,value:d.value}))))}if(a.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Ir(o))return o;const d=a.transform(o.value,s);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Ir(o)?Promise.resolve(a.transform(o.value,s)).then(d=>({status:t.value,value:d})):o);H.assertNever(a)}}Vt.create=(n,e,t)=>new Vt({schema:n,typeName:F.ZodEffects,effect:e,...k(t)}),Vt.createWithPreprocess=(n,e,t)=>new Vt({schema:e,effect:{type:"preprocess",transform:n},typeName:F.ZodEffects,...k(t)});class Ut extends J{_parse(e){return this._getType(e)===M.undefined?ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ut.create=(n,e)=>new Ut({innerType:n,typeName:F.ZodOptional,...k(e)});class on extends J{_parse(e){return this._getType(e)===M.null?ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}on.create=(n,e)=>new on({innerType:n,typeName:F.ZodNullable,...k(e)});class Lr extends J{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===M.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Lr.create=(n,e)=>new Lr({innerType:n,typeName:F.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class $r extends J{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Pr(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new pt(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new pt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}$r.create=(n,e)=>new $r({innerType:n,typeName:F.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class Yi extends J{_parse(e){if(this._getType(e)!==M.nan){const i=this._getOrReturnCtx(e);return B(i,{code:I.invalid_type,expected:M.nan,received:i.parsedType}),x}return{status:"valid",value:e.data}}}Yi.create=n=>new Yi({typeName:F.ZodNaN,...k(n)});const fg=Symbol("zod_brand");class Ls extends J{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class Gr extends J{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?x:s.status==="dirty"?(t.dirty(),zn(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?x:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}static create(e,t){return new Gr({in:e,out:t,typeName:F.ZodPipeline})}}class Fr extends J{_parse(e){const t=this._def.innerType._parse(e),i=a=>(Ir(a)&&(a.value=Object.freeze(a.value)),a);return Pr(t)?t.then(a=>i(a)):i(t)}unwrap(){return this._def.innerType}}Fr.create=(n,e)=>new Fr({innerType:n,typeName:F.ZodReadonly,...k(e)});function Vh(n,e={},t){return n?Zn.create().superRefine((i,a)=>{var s,o;if(!n(i)){const d=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(o=(s=d.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,y=typeof d=="string"?{message:d}:d;a.addIssue({code:"custom",...y,fatal:p})}}):Zn.create()}const mg={object:Be.lazycreate};var F;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(F||(F={}));const Tg=(n,e={message:`Input not instance of ${n.name}`})=>Vh(t=>t instanceof n,e),zi=_t.create,$s=rn.create,Eg=Yi.create,Rg=an.create,Gs=Ar.create,Lh=gn.create,bg=qi.create,vg=Or.create,$h=Cr.create,gg=Zn.create,Zi=In.create,Ig=Yt.create,Pg=Ji.create,Dg=Nt.create,Gh=Be.create,Sg=Be.strictCreate,Ag=Br.create,Og=Wi.create,Cg=wr.create,Bg=xt.create,Fh=Mr.create,wg=Hi.create,Mg=Pn.create,_g=Qn.create,Ng=_r.create,Vg=Nr.create,xh=sn.create,Lg=Vr.create,$g=Kn.create,Uh=Vt.create,Gg=Ut.create,Fg=on.create,xg=Vt.createWithPreprocess,Ug=Gr.create;var c=Object.freeze({__proto__:null,defaultErrorMap:Yn,setErrorMap:Qv,getErrorMap:Ui,makeIssue:ji,EMPTY_PATH:Kv,addIssueToContext:B,ParseStatus:Ye,INVALID:x,DIRTY:zn,OK:ot,isAborted:Ms,isDirty:_s,isValid:Ir,isAsync:Pr,get util(){return H},get objectUtil(){return ws},ZodParsedType:M,getParsedType:nn,ZodType:J,datetimeRegex:_h,ZodString:_t,ZodNumber:rn,ZodBigInt:an,ZodBoolean:Ar,ZodDate:gn,ZodSymbol:qi,ZodUndefined:Or,ZodNull:Cr,ZodAny:Zn,ZodUnknown:In,ZodNever:Yt,ZodVoid:Ji,ZodArray:Nt,ZodObject:Be,ZodUnion:Br,ZodDiscriminatedUnion:Wi,ZodIntersection:wr,ZodTuple:xt,ZodRecord:Mr,ZodMap:Hi,ZodSet:Pn,ZodFunction:Qn,ZodLazy:_r,ZodLiteral:Nr,ZodEnum:sn,ZodNativeEnum:Vr,ZodPromise:Kn,ZodEffects:Vt,ZodTransformer:Vt,ZodOptional:Ut,ZodNullable:on,ZodDefault:Lr,ZodCatch:$r,ZodNaN:Yi,BRAND:fg,ZodBranded:Ls,ZodPipeline:Gr,ZodReadonly:Fr,custom:Vh,Schema:J,ZodSchema:J,late:mg,get ZodFirstPartyTypeKind(){return F},coerce:{string:n=>_t.create({...n,coerce:!0}),number:n=>rn.create({...n,coerce:!0}),boolean:n=>Ar.create({...n,coerce:!0}),bigint:n=>an.create({...n,coerce:!0}),date:n=>gn.create({...n,coerce:!0})},any:gg,array:Dg,bigint:Rg,boolean:Gs,date:Lh,discriminatedUnion:Og,effect:Uh,enum:xh,function:_g,instanceof:Tg,intersection:Cg,lazy:Ng,literal:Vg,map:wg,nan:Eg,nativeEnum:Lg,never:Ig,null:$h,nullable:Fg,number:$s,object:Gh,oboolean:()=>Gs().optional(),onumber:()=>$s().optional(),optional:Gg,ostring:()=>zi().optional(),pipeline:Ug,preprocess:xg,promise:$g,record:Fh,set:Mg,strictObject:Sg,string:zi,symbol:bg,transformer:Uh,tuple:Bg,undefined:vg,union:Ag,unknown:Zi,void:Pg,NEVER:x,ZodIssueCode:I,quotelessJson:Xv,ZodError:pt});function jh(n){var a,s,o;if(!(n!=null&&n.dataType))return Zi();const e=n.dataType.isNullable||!1,t=n.dataType.isList||!1;let i=Zi();if(((a=n.dataType.entity)==null?void 0:a.type)===r.PrimitiveEntity)switch(n.dataType.entity.name){case v.String:i=zi();break;case v.JSON:i=Fh(Zi());break;case v.Number:i=$s();break;case v.Boolean:i=Gs();break;case v.Date:i=Lh();break;case v.Enum:{const d=n.dataType.options||[];if(d.length===0)throw new Error(`Enum property ${n.name} has no options`);i=xh(d);break}case v.Null:i=$h();break;case v.UUID:i=zi().uuid();break}else if(((s=n.dataType.entity)==null?void 0:s.type)===r.CustomEntity)i=kh(n.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=n.dataType.entity)==null?void 0:o.type}`);return e&&(i=i.nullable()),t&&(i=i.array()),i}function kh(n){const e=Gh({});for(const t of n.properties){const i=jh(t);e.shape[t.name]=i}return e}function qh(n){const e=n.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function Jh(n){const e=n.rangeEnd;return new Date(Math.random()*e.getTime())}function Wh(n){const e=n.rangeStart,t=n.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function Hh(n){return n.rangeStart&&n.rangeEnd?Wh(n):n.rangeStart?qh(n):n.rangeEnd?Jh(n):new Date}function jg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function kg(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var a=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:function(){return n[i]}})}),t}var Xi,qg=new Uint8Array(16);function Yh(){if(!Xi&&(Xi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Xi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xi(qg)}const Jg=/^(?:[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;function Qi(n){return typeof n=="string"&&Jg.test(n)}for(var Je=[],Fs=0;Fs<256;++Fs)Je.push((Fs+256).toString(16).substr(1));function Ki(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Je[n[e+0]]+Je[n[e+1]]+Je[n[e+2]]+Je[n[e+3]]+"-"+Je[n[e+4]]+Je[n[e+5]]+"-"+Je[n[e+6]]+Je[n[e+7]]+"-"+Je[n[e+8]]+Je[n[e+9]]+"-"+Je[n[e+10]]+Je[n[e+11]]+Je[n[e+12]]+Je[n[e+13]]+Je[n[e+14]]+Je[n[e+15]]).toLowerCase();if(!Qi(t))throw TypeError("Stringified UUID is invalid");return t}var zh,xs,Us=0,js=0;function Wg(n,e,t){var i=e&&t||0,a=e||new Array(16);n=n||{};var s=n.node||zh,o=n.clockseq!==void 0?n.clockseq:xs;if(s==null||o==null){var d=n.random||(n.rng||Yh)();s==null&&(s=zh=[d[0]|1,d[1],d[2],d[3],d[4],d[5]]),o==null&&(o=xs=(d[6]<<8|d[7])&16383)}var p=n.msecs!==void 0?n.msecs:Date.now(),y=n.nsecs!==void 0?n.nsecs:js+1,f=p-Us+(y-js)/1e4;if(f<0&&n.clockseq===void 0&&(o=o+1&16383),(f<0||p>Us)&&n.nsecs===void 0&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Us=p,js=y,xs=o,p+=122192928e5;var m=((p&268435455)*1e4+y)%4294967296;a[i++]=m>>>24&255,a[i++]=m>>>16&255,a[i++]=m>>>8&255,a[i++]=m&255;var b=p/4294967296*1e4&268435455;a[i++]=b>>>8&255,a[i++]=b&255,a[i++]=b>>>24&15|16,a[i++]=b>>>16&255,a[i++]=o>>>8|128,a[i++]=o&255;for(var P=0;P<6;++P)a[i+P]=s[P];return e||Ki(a)}function Zh(n){if(!Qi(n))throw TypeError("Invalid UUID");var e,t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.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}function Hg(n){n=unescape(encodeURIComponent(n));for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}var Yg="6ba7b810-9dad-11d1-80b4-00c04fd430c8",zg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Xh(n,e,t){function i(a,s,o,d){if(typeof a=="string"&&(a=Hg(a)),typeof s=="string"&&(s=Zh(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var p=new Uint8Array(16+a.length);if(p.set(s),p.set(a,s.length),p=t(p),p[6]=p[6]&15|e,p[8]=p[8]&63|128,o){d=d||0;for(var y=0;y<16;++y)o[d+y]=p[y];return o}return Ki(p)}try{i.name=n}catch{}return i.DNS=Yg,i.URL=zg,i}function Zg(n){if(typeof n=="string"){var e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(var t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return Xg(Qg(Kg(n),n.length*8))}function Xg(n){for(var e=[],t=n.length*32,i="0123456789abcdef",a=0;a<t;a+=8){var s=n[a>>5]>>>a%32&255,o=parseInt(i.charAt(s>>>4&15)+i.charAt(s&15),16);e.push(o)}return e}function Qh(n){return(n+64>>>9<<4)+14+1}function Qg(n,e){n[e>>5]|=128<<e%32,n[Qh(e)-1]=e;for(var t=1732584193,i=-271733879,a=-1732584194,s=271733878,o=0;o<n.length;o+=16){var d=t,p=i,y=a,f=s;t=ze(t,i,a,s,n[o],7,-680876936),s=ze(s,t,i,a,n[o+1],12,-389564586),a=ze(a,s,t,i,n[o+2],17,606105819),i=ze(i,a,s,t,n[o+3],22,-1044525330),t=ze(t,i,a,s,n[o+4],7,-176418897),s=ze(s,t,i,a,n[o+5],12,1200080426),a=ze(a,s,t,i,n[o+6],17,-1473231341),i=ze(i,a,s,t,n[o+7],22,-45705983),t=ze(t,i,a,s,n[o+8],7,1770035416),s=ze(s,t,i,a,n[o+9],12,-1958414417),a=ze(a,s,t,i,n[o+10],17,-42063),i=ze(i,a,s,t,n[o+11],22,-1990404162),t=ze(t,i,a,s,n[o+12],7,1804603682),s=ze(s,t,i,a,n[o+13],12,-40341101),a=ze(a,s,t,i,n[o+14],17,-1502002290),i=ze(i,a,s,t,n[o+15],22,1236535329),t=Ze(t,i,a,s,n[o+1],5,-165796510),s=Ze(s,t,i,a,n[o+6],9,-1069501632),a=Ze(a,s,t,i,n[o+11],14,643717713),i=Ze(i,a,s,t,n[o],20,-373897302),t=Ze(t,i,a,s,n[o+5],5,-701558691),s=Ze(s,t,i,a,n[o+10],9,38016083),a=Ze(a,s,t,i,n[o+15],14,-660478335),i=Ze(i,a,s,t,n[o+4],20,-405537848),t=Ze(t,i,a,s,n[o+9],5,568446438),s=Ze(s,t,i,a,n[o+14],9,-1019803690),a=Ze(a,s,t,i,n[o+3],14,-187363961),i=Ze(i,a,s,t,n[o+8],20,1163531501),t=Ze(t,i,a,s,n[o+13],5,-1444681467),s=Ze(s,t,i,a,n[o+2],9,-51403784),a=Ze(a,s,t,i,n[o+7],14,1735328473),i=Ze(i,a,s,t,n[o+12],20,-1926607734),t=Xe(t,i,a,s,n[o+5],4,-378558),s=Xe(s,t,i,a,n[o+8],11,-2022574463),a=Xe(a,s,t,i,n[o+11],16,1839030562),i=Xe(i,a,s,t,n[o+14],23,-35309556),t=Xe(t,i,a,s,n[o+1],4,-1530992060),s=Xe(s,t,i,a,n[o+4],11,1272893353),a=Xe(a,s,t,i,n[o+7],16,-155497632),i=Xe(i,a,s,t,n[o+10],23,-1094730640),t=Xe(t,i,a,s,n[o+13],4,681279174),s=Xe(s,t,i,a,n[o],11,-358537222),a=Xe(a,s,t,i,n[o+3],16,-722521979),i=Xe(i,a,s,t,n[o+6],23,76029189),t=Xe(t,i,a,s,n[o+9],4,-640364487),s=Xe(s,t,i,a,n[o+12],11,-421815835),a=Xe(a,s,t,i,n[o+15],16,530742520),i=Xe(i,a,s,t,n[o+2],23,-995338651),t=Qe(t,i,a,s,n[o],6,-198630844),s=Qe(s,t,i,a,n[o+7],10,1126891415),a=Qe(a,s,t,i,n[o+14],15,-1416354905),i=Qe(i,a,s,t,n[o+5],21,-57434055),t=Qe(t,i,a,s,n[o+12],6,1700485571),s=Qe(s,t,i,a,n[o+3],10,-1894986606),a=Qe(a,s,t,i,n[o+10],15,-1051523),i=Qe(i,a,s,t,n[o+1],21,-2054922799),t=Qe(t,i,a,s,n[o+8],6,1873313359),s=Qe(s,t,i,a,n[o+15],10,-30611744),a=Qe(a,s,t,i,n[o+6],15,-1560198380),i=Qe(i,a,s,t,n[o+13],21,1309151649),t=Qe(t,i,a,s,n[o+4],6,-145523070),s=Qe(s,t,i,a,n[o+11],10,-1120210379),a=Qe(a,s,t,i,n[o+2],15,718787259),i=Qe(i,a,s,t,n[o+9],21,-343485551),t=ln(t,d),i=ln(i,p),a=ln(a,y),s=ln(s,f)}return[t,i,a,s]}function Kg(n){if(n.length===0)return[];for(var e=n.length*8,t=new Uint32Array(Qh(e)),i=0;i<e;i+=8)t[i>>5]|=(n[i/8]&255)<<i%32;return t}function ln(n,e){var t=(n&65535)+(e&65535),i=(n>>16)+(e>>16)+(t>>16);return i<<16|t&65535}function eI(n,e){return n<<e|n>>>32-e}function ea(n,e,t,i,a,s){return ln(eI(ln(ln(e,n),ln(i,s)),a),t)}function ze(n,e,t,i,a,s,o){return ea(e&t|~e&i,n,e,a,s,o)}function Ze(n,e,t,i,a,s,o){return ea(e&i|t&~i,n,e,a,s,o)}function Xe(n,e,t,i,a,s,o){return ea(e^t^i,n,e,a,s,o)}function Qe(n,e,t,i,a,s,o){return ea(t^(e|~i),n,e,a,s,o)}var tI=Xh("v3",48,Zg);const nI=tI;function rI(n,e,t){n=n||{};var i=n.random||(n.rng||Yh)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var a=0;a<16;++a)e[t+a]=i[a];return e}return Ki(i)}function iI(n,e,t,i){switch(n){case 0:return e&t^~e&i;case 1:return e^t^i;case 2:return e&t^e&i^t&i;case 3:return e^t^i}}function ks(n,e){return n<<e|n>>>32-e}function aI(n){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){var i=unescape(encodeURIComponent(n));n=[];for(var a=0;a<i.length;++a)n.push(i.charCodeAt(a))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);for(var s=n.length/4+2,o=Math.ceil(s/16),d=new Array(o),p=0;p<o;++p){for(var y=new Uint32Array(16),f=0;f<16;++f)y[f]=n[p*64+f*4]<<24|n[p*64+f*4+1]<<16|n[p*64+f*4+2]<<8|n[p*64+f*4+3];d[p]=y}d[o-1][14]=(n.length-1)*8/Math.pow(2,32),d[o-1][14]=Math.floor(d[o-1][14]),d[o-1][15]=(n.length-1)*8&4294967295;for(var m=0;m<o;++m){for(var b=new Uint32Array(80),P=0;P<16;++P)b[P]=d[m][P];for(var C=16;C<80;++C)b[C]=ks(b[C-3]^b[C-8]^b[C-14]^b[C-16],1);for(var $=t[0],ve=t[1],tt=t[2],ge=t[3],Ka=t[4],Un=0;Un<80;++Un){var gv=Math.floor(Un/20),e9=ks($,5)+iI(gv,ve,tt,ge)+Ka+e[gv]+b[Un]>>>0;Ka=ge,ge=tt,tt=ks(ve,30)>>>0,ve=$,$=e9}t[0]=t[0]+$>>>0,t[1]=t[1]+ve>>>0,t[2]=t[2]+tt>>>0,t[3]=t[3]+ge>>>0,t[4]=t[4]+Ka>>>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 sI=Xh("v5",80,aI);const oI=sI,lI="00000000-0000-0000-0000-000000000000";function cI(n){if(!Qi(n))throw TypeError("Invalid UUID");return parseInt(n.substr(14,1),16)}const dI=kg(Object.freeze(Object.defineProperty({__proto__:null,NIL:lI,parse:Zh,stringify:Ki,v1:Wg,v3:nI,v4:rI,v5:oI,validate:Qi,version:cI},Symbol.toStringTag,{value:"Module"})));function qs(n,e){if(!n||!e||!n.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=n,this.dstAlphabet=e}qs.prototype.convert=function(n){var e,t,i,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,d=n.length,p=typeof n=="string"?"":[];if(!this.isValid(n))throw new Error('Number "'+n+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return n;for(e=0;e<d;e++)a[e]=this.srcAlphabet.indexOf(n[e]);do{for(t=0,i=0,e=0;e<d;e++)t=t*s+a[e],t>=o?(a[i++]=parseInt(t/o,10),t=t%o):i>0&&(a[i++]=0);d=i,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(i!==0);return p},qs.prototype.isValid=function(n){for(var e=0;e<n.length;++e)if(this.srcAlphabet.indexOf(n[e])===-1)return!1;return!0};var uI=qs,pI=uI;function xr(n,e){var t=new pI(n,e);return function(i){return t.convert(i)}}xr.BIN="01",xr.OCT="01234567",xr.DEC="0123456789",xr.HEX="0123456789abcdef";var yI=xr;const{v4:Js}=dI,ta=yI,Ws="123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",hI="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",fI={consistentLength:!0};let Hs;const Kh=(n,e,t)=>{const i=e(n.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?i:i.padStart(t.shortIdLength,t.paddingChar)},mI=(n,e)=>{const i=e(n).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[i[1],i[2],i[3],i[4],i[5]].join("-")},TI=n=>Math.ceil(Math.log(2**128)/Math.log(n));var EI=(()=>{const n=(e,t)=>{const i=e||Ws,a={...fI,...t};if([...new Set(Array.from(i))].length!==i.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=TI(i.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:i[0]},d=ta(ta.HEX,i),p=ta(i,ta.HEX),y=()=>Kh(Js(),d,o),f={new:y,generate:y,uuid:Js,fromUUID:m=>Kh(m,d,o),toUUID:m=>mI(m,p),alphabet:i,maxLength:s};return Object.freeze(f),f};return n.constants={flickrBase58:Ws,cookieBase90:hI},n.uuid=Js,n.generate=()=>(Hs||(Hs=n(Ws).generate),Hs()),n})();const ef=jg(EI),RI=ef();function tf(){return RI.uuid()}function nf(n){return n.rangeStart+Math.random()}function rf(n){const e=n.rangeEnd;return Math.random()*e}function af(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random()*(t-e)+e}function sf(n){return n.rangeStart&&n.rangeEnd?af(n):n.rangeStart?nf(n):n.rangeEnd?rf(n):Math.random()}function of(n){const e=n.rangeStart;return Math.random().toString(36).substring(e)}function lf(n){const e=n.rangeEnd;return Math.random().toString(36).substring(0,e)}function cf(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random().toString(36).substring(e,t)}function df(n){return n.rangeStart&&n.rangeEnd?cf(n):n.rangeStart?of(n):n.rangeEnd?lf(n):Math.random().toString(36)}function uf(n){return Math.random()>=.5}function bI(n){if(!n||!n.autogeneration)return null;switch(n.autogeneration.type){case Le.CurrentDateAndTime:if(n.name===v.Date)return new Date;case Le.Random:{if(n.name===v.Date)return Hh(n.autogeneration);if(n.name===v.Number)return sf(n.autogeneration);if(n.name===v.String)return df(n.autogeneration);if(n.name===v.Boolean)return uf(n.autogeneration)}case Le.Unique:if(n.name===v.UUID)return tf();default:throw new Error(`Generating a ${n.autogeneration.type} value for a ${n.name} is not supported`)}}const q="e7eb5382-3d99-44fd-972a-b8b1e819f6be",Ys="global-user-variable-id",pf="last-executed-timestamp-variable-id",vI={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:r.DataType},gI={id:"alternative-relational-database-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:r.Property},II={id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.String,value:null,parent:vI,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:gI},na={id:"alternative-relational-database-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},PI={required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!1,implements:$i,static:!0,index:0,dataType:II,description:"The name of the main database inside of the server instance where the data will be stored.",parent:na};r.GenericReference,r.DataType;const DI={id:"alternative-relational-database-entity-username-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:r.Property},SI={id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:DI},AI={required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:r.Property,private:!1,abstract:!1,implements:Gi,static:!0,index:1,dataType:SI,description:"The username that will be used to connect to the database.",parent:na};r.GenericReference,r.DataType;const OI={id:"alternative-relational-database-entity-password-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:r.Property},CI={id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:OI},BI={required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:r.Property,private:!1,abstract:!1,implements:Fi,static:!0,index:2,dataType:CI,description:"The password that will be used to connect to the database.",parent:na},wI={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:r.DataType},MI={id:"alternative-relational-database-entity-min-size-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:r.Property},_I={id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.Number,value:6,parent:wI,autogeneration:null,valueAsType:null},parent:MI},NI={required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!1,implements:xi,static:!0,index:3,dataType:_I,description:"The minimum size of the database in GB.",parent:na},VI={id:"alternative-relational-database-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},yf={id:"alternative-relational-database-entity-id",type:r.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[PI,AI,BI,NI],methods:[],abstractMethods:[],extends:[],implements:[vn],x:0,y:0,parent:VI},LI={id:"animal-prototype-database-property-ref-id",type:r.GenericReference,entityId:"animal-prototype-database-property-id",entityType:r.Property},$I={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:r.DataType},GI={id:"animal-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:v.EntityTemplate,valueAsType:yf,autogeneration:null,parent:$I},parent:LI},FI={id:"animal-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},xI={required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:vr,static:!0,index:0,dataType:GI,description:"The database that the entity belongs to.",parent:FI},UI={type:r.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:r.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},jI={id:"c1930577-9e79-48a6-8905-be24611015c1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:UI},kI={type:r.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},qI={required:!0,type:r.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",implements:null,static:!1,private:!1,index:0,dataType:jI,abstract:!1,parent:kI},JI={type:r.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:r.Project,entityId:q},WI={type:r.CustomEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[xI,qI],methods:[],extends:[],implements:[Oe],x:0,y:0,parent:JI},HI={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:r.DataType},YI={id:"default-relational-database-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:r.Property},zI={id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.String,value:null,parent:HI,autogeneration:{type:Le.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:YI},ra={id:"default-relational-database-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},ZI={required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!1,implements:$i,static:!0,index:0,dataType:zI,description:"The name of the main database inside of the server instance where the data will be stored.",parent:ra};r.GenericReference,r.DataType;const XI={id:"default-relational-database-entity-username-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:r.Property},QI={id:"default-relational-database-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:XI},KI={required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:r.Property,private:!1,abstract:!1,implements:Gi,static:!0,index:1,dataType:QI,description:"The username that will be used to connect to the database.",parent:ra};r.GenericReference,r.DataType;const eP={id:"default-relational-database-entity-password-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:r.Property},tP={id:"default-relational-database-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:eP},nP={required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:r.Property,private:!1,abstract:!1,implements:Fi,static:!0,index:2,dataType:tP,description:"The password that will be used to connect to the database.",parent:ra},rP={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:r.DataType},iP={id:"default-relational-database-entity-min-size-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:r.Property},aP={id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.Number,value:6,parent:rP,autogeneration:null,valueAsType:null},parent:iP},sP={required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!1,implements:xi,static:!0,index:3,dataType:aP,description:"The minimum size of the database in GB.",parent:ra},oP={id:"default-relational-database-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},zs={id:"default-relational-database-entity-id",type:r.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[ZI,KI,nP,sP],methods:[],abstractMethods:[],extends:[],implements:[vn],x:0,y:0,parent:oP},lP={id:"user-prototype-database-property-data-type-ref-id",type:r.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:r.DataType},cP={id:"user-prototype-database-property-ref-id",type:r.GenericReference,entityId:"user-prototype-database-property-id",entityType:r.Property},dP={id:"user-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:v.EntityTemplate,valueAsType:zs,autogeneration:null,parent:lP},parent:cP},uP={id:"user-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},pP={required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:vr,static:!0,index:0,dataType:dP,description:"The database that the entity belongs to.",parent:uP},yP={type:r.GenericReference,id:"user-prototype-parent-ref-id",entityType:r.Project,entityId:q},Zs={type:r.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Oe],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[pP],methods:[],x:0,y:0,parent:yP},hP={type:r.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:r.Property,entityId:"person-date-of-birth-property-id"},fP={id:"person-date-of-birth-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mr,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:hP},mP={type:r.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},TP={required:!0,type:r.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,dataType:fP,abstract:!1,parent:mP},EP={type:r.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:r.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},RP={id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:EP},bP={type:r.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},vP={required:!0,type:r.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,dataType:RP,abstract:!1,parent:bP},gP={type:r.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:r.Project,entityId:q},lt={type:r.CustomEntity,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:[vP,TP],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[Zs],x:0,y:0,parent:gP},IP={type:r.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},PP={type:r.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:r.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},DP={type:r.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:r.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},SP={type:r.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:r.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},AP={id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SP},Xs={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:r.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:AP,readsValue:DP,required:!0,index:0,parent:PP},OP={type:r.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},CP={type:r.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},hf={type:r.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[Xs],calledByError:[],calledByEntry:[OP],calledBySuccess:[],throws:null,x:0,y:0,parent:CP},BP={type:r.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:r.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},wP={id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:BP},ff={id:"500dee3a-3435-4453-9699-0d053f646523",type:r.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:wP,required:!0,writesValues:[Xs],index:0,parent:IP},MP={type:r.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},mf={type:r.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[ff],calls:[hf],returnStatements:[hf],index:0,collapsed:!1,private:!1,x:0,y:0,parent:MP},_P={type:r.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:r.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},NP={id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_P},VP={type:r.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:r.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},LP={type:r.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},$P={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:r.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:NP,readsValue:VP,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:LP},GP={type:r.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:r.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},FP={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:r.OutputMap,version:1,declaration:Xs,writesValues:[$P],index:0,parent:GP},xP={type:r.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},UP={type:r.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},jP={type:r.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:r.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},kP={id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jP},qP={type:r.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:r.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},JP={type:r.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},WP={type:r.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:r.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},HP={type:r.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:r.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},Tf={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:r.InputMap,version:1,declaration:ff,name:null,description:null,readsValue:HP,dynamicArguments:[],defaultValue:null,index:0,parent:WP},YP={type:r.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:kP,readsValue:qP,writesValues:[Tf],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:JP},zP={type:r.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:mf,inputs:[Tf],outputs:[FP],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[xP],calledBySuccess:[],parent:UP,error:null,x:0,y:0},ZP={type:r.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:r.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},XP={id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ZP},QP={type:r.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},KP={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:r.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:XP,required:!0,index:0,writesValues:[YP],parent:QP},eD={type:r.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},tD={type:r.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[KP],collapsed:!0,returnStatements:[],calls:[zP],private:!1,index:0,implements:null,x:0,y:0,parent:eD},nD={type:r.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:r.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},rD={id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:nD},iD={type:r.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},Ef={required:!0,type:r.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:rD,abstract:!1,parent:iD},aD={type:r.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:r.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},sD={id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aD},oD={type:r.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},Rf={required:!0,type:r.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:sD,implements:null,static:!1,private:!0,abstract:!1,parent:oD},lD={type:r.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:r.Project,entityId:q},er={type:r.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[Ef,Rf],methods:[mf,tD],extends:[],implements:[Oe],x:0,y:0,parent:lD},Ur="bitcoin-api-response-id",bf="time-property-id",vf="disclamer-property-id",gf="chart-name-property-id",If="bpi-property-id",ia="bpi-entity-id",Pf="usd-property-id",Df="gbp-property-id",Sf="eur-property-id",tr="currency-entity-id",Af="currency-code-property-id",Of="currency-symbol-property-id",Cf="currency-rate-property-id",Bf="currency-description-property-id",wf="currency-rate-number-property-id",cD={type:r.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:r.Property,entityId:Af},dD={id:"code-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:cD},uD={type:r.GenericReference,id:"code-property-parent-ref-id",entityType:r.CustomEntity,entityId:tr},pD={required:!0,type:r.Property,id:Af,version:1,name:"code",description:null,dataType:dD,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:uD},yD={type:r.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:r.Property,entityId:Of},hD={id:"symbol-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["&#36;","&pound;","&euro;"],constant:!1,parent:yD},fD={type:r.GenericReference,id:"symbol-property-parent-ref-id",entityType:r.CustomEntity,entityId:tr},mD={required:!0,type:r.Property,id:Of,version:1,name:"symbol",description:null,index:0,dataType:hD,implements:null,static:!1,private:!1,abstract:!1,parent:fD},TD={type:r.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:r.Property,entityId:Cf},ED={id:"rate-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:TD},RD={type:r.GenericReference,id:"rate-property-parent-ref-id",entityType:r.CustomEntity,entityId:tr},bD={required:!0,type:r.Property,id:Cf,version:1,name:"rate",description:null,index:0,dataType:ED,implements:null,static:!1,private:!1,abstract:!1,parent:RD},vD={type:r.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:r.Property,entityId:Bf},gD={id:"description-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vD},ID={type:r.GenericReference,id:"description-property-parent-ref-id",entityType:r.CustomEntity,entityId:tr},PD={required:!0,type:r.Property,id:Bf,version:1,name:"description",description:null,dataType:gD,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:ID},DD={type:r.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:r.Property,entityId:wf},SD={id:"rate-number-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DD},AD={type:r.GenericReference,id:"rate-number-property-parent-ref-id",entityType:r.CustomEntity,entityId:tr},OD={required:!0,type:r.Property,id:wf,version:1,name:"rate_float",description:null,dataType:SD,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:AD},CD={type:r.GenericReference,id:"currency-prototype-parent-ref-id",entityType:r.Project,entityId:q},aa={type:r.CustomEntity,id:tr,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[pD,mD,bD,PD,OD],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:CD},BD={type:r.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:r.Property,entityId:Pf},wD={id:"usd-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:aa,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:BD},MD={type:r.GenericReference,id:"usd-property-parent-ref-id",entityType:r.CustomEntity,entityId:ia},_D={required:!0,id:Pf,type:r.Property,version:1,name:"USD",description:null,index:0,dataType:wD,implements:null,static:!1,private:!1,abstract:!1,parent:MD},ND={type:r.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:r.Property,entityId:Df},VD={id:"gbp-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:aa,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ND},LD={type:r.GenericReference,id:"gbp-property-parent-ref-id",entityType:r.CustomEntity,entityId:ia},$D={required:!0,id:Df,type:r.Property,version:1,name:"GBP",description:null,index:0,dataType:VD,implements:null,static:!1,private:!1,abstract:!1,parent:LD},GD={type:r.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:r.Property,entityId:Sf},FD={id:"eur-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:aa,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:GD},xD={type:r.GenericReference,id:"eur-property-parent-ref-id",entityType:r.CustomEntity,entityId:ia},UD={required:!0,id:Sf,type:r.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:FD,private:!1,abstract:!1,parent:xD},jD={type:r.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:r.Project,entityId:q},Mf={type:r.CustomEntity,id:ia,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[_D,$D,UD],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:jD},kD={type:r.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:r.Property,entityId:bf},qD={id:"time-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:nc,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kD},JD={type:r.GenericReference,id:"time-property-parent-ref-id",entityType:r.CustomEntity,entityId:Ur},WD={required:!0,type:r.Property,id:bf,version:1,name:"time",description:null,index:0,dataType:qD,implements:null,static:!1,private:!1,abstract:!1,parent:JD},HD={type:r.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:r.Property,entityId:vf},YD={id:"disclamer-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:HD},zD={type:r.GenericReference,id:"disclamer-property-parent-ref-id",entityType:r.CustomEntity,entityId:Ur},ZD={required:!0,type:r.Property,id:vf,version:1,name:"disclamer",description:null,index:0,dataType:YD,implements:null,static:!1,private:!1,abstract:!1,parent:zD},XD={type:r.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:r.Property,entityId:gf},QD={id:"chart-name-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:XD},KD={type:r.GenericReference,id:"chart-name-property-parent-ref-id",entityType:r.CustomEntity,entityId:Ur},eS={required:!0,type:r.Property,id:gf,version:1,name:"chartName",description:null,index:0,dataType:QD,implements:null,static:!1,private:!1,abstract:!1,parent:KD},tS={type:r.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:r.Property,entityId:If},nS={id:"bpi-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Mf,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:tS},rS={type:r.GenericReference,id:"bpi-property-parent-ref-id",entityType:r.CustomEntity,entityId:Ur},iS={required:!0,type:r.Property,id:If,version:1,name:"bpi",description:null,implements:null,index:0,dataType:nS,static:!1,private:!1,abstract:!1,parent:rS},aS={type:r.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:r.Project,entityId:q},_f={type:r.CustomEntity,id:Ur,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[WD,ZD,eS,iS],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:aS},sS={type:r.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:r.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},oS={id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sS},lS={type:r.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:r.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},cS={type:r.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:r.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},dS={id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cS},uS={type:r.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:r.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Nf={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",dataType:dS,readsValue:uS,required:!0,index:0,parent:lS},pS={type:r.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},yS={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:r.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,dataType:oS,writesValues:[Nf],required:!0,index:0,parent:pS},hS={type:r.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},fS={type:r.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},mS={type:r.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},Vf={type:r.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[Nf],calledByError:[],calledByEntry:[fS],calledBySuccess:[],throws:null,x:0,y:0,parent:mS},TS={type:r.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:[yS],calls:[Vf],index:0,collapsed:!1,implements:null,returnStatements:[Vf],private:!1,x:0,y:0,parent:hS},ES={type:r.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},RS={type:r.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},bS={type:r.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:r.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},vS={type:r.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:r.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},gS={type:r.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:r.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},IS={id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gS},Qs={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:r.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:IS,readsValue:vS,required:!0,index:0,parent:bS},Lf={type:r.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[Qs],calledByError:[],calledByEntry:[],calledBySuccess:[ES],throws:null,x:0,y:0,parent:RS},PS={type:r.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},DS={type:r.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:r.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},$f={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:r.InputMap,version:1,declaration:Ts,name:null,description:null,dynamicArguments:[],readsValue:DS,defaultValue:null,parent:PS,index:2},SS={type:r.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:r.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},AS={id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SS},OS={type:r.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},CS={type:r.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:r.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},BS={type:r.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:r.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},Gf={type:r.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",dataType:AS,readsValue:CS,writesValues:[Qs],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[BS],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:OS},wS={type:r.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:r.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},MS={type:r.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},_S={type:r.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:wi,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:r.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:v.String,valueAsType:null,parent:wS,autogeneration:null},index:1,dynamicArguments:[],parent:MS},NS={type:r.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},VS={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:r.OutputMap,version:1,declaration:Rr,index:2,writesValues:[Gf],parent:NS},LS={type:r.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},$S={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:r.InputMap,version:1,declaration:Bi,name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:null,parent:LS},GS={type:r.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},FS={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:r.InputMap,version:1,name:null,description:null,declaration:Mi,dynamicArguments:[],index:3,readsValue:null,defaultValue:null,parent:GS},xS={type:r.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},US={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:r.InputMap,version:1,declaration:_i,name:null,description:null,dynamicArguments:[],readsValue:null,index:4,defaultValue:null,parent:xS},jS={type:r.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},kS={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:r.OutputMap,version:1,declaration:Ni,index:1,writesValues:[],parent:jS},qS={type:r.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},JS={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:r.OutputMap,version:1,declaration:Rr,index:0,writesValues:[],parent:qS},WS={type:r.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},HS={type:r.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},YS={type:r.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},zS={type:r.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:r.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},ZS={type:r.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:r.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},XS={id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:at,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ZS},QS={type:r.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:r.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},Ff={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:r.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:XS,required:!0,readsValue:null,index:0,parent:QS},KS={type:r.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[zS],throws:Ff,x:0,y:0,parent:YS},eA={type:r.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},tA={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:r.OutputMap,declaration:Rs,version:1,writesValues:[Ff],index:0,parent:eA},nA={type:r.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Vi,inputs:[$S,_S,$f,FS,US],outputs:[JS,kS,VS],process:null,calledByError:[],calledByEntry:[WS],calledBySuccess:[],successCalls:[Lf,Gf],errorCalls:[KS],error:tA,dynamicArguments:[],x:0,y:0,parent:HS},rA={type:r.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:r.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},iA={type:r.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},aA={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:r.InputMap,version:1,declaration:Ai,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:r.PrimitiveValue,version:1,value:"?name=",name:v.String,parent:rA,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:iA},sA={type:r.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},oA={type:r.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},lA={type:r.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:r.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},cA={id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:lA},dA={type:r.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:r.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},uA={type:r.GenericReference,id:"assembled-query-string-called-by-ref",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},xf={type:r.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",dataType:cA,readsValue:dA,writesValues:[$f],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[uA],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:oA},pA={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:r.OutputMap,version:1,writesValues:[xf],declaration:Tr,index:0,parent:sA},yA={type:r.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},hA={type:r.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},fA={type:r.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:r.ArgumentDeclaration},mA={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Uf={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:r.InputMap,declaration:Oi,name:null,description:null,readsValue:fA,dynamicArguments:[],defaultValue:null,index:1,parent:mA},TA={type:r.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:Ci,version:1,inputs:[aA,Uf],outputs:[pA],process:null,calledByError:[],calledByEntry:[yA],calledBySuccess:[],dynamicArguments:[],successCalls:[xf],errorCalls:[],error:null,x:0,y:0,parent:hA},EA={type:r.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:r.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},RA={id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:EA},bA={type:r.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},jf={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:r.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:RA,required:!1,writesValues:[Uf],index:0,parent:bA},vA={type:r.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:r.Project,entityId:q},kf={type:r.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:[jf],calls:[TA,nA],returnStatements:[Lf],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:vA},gA={type:r.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:r.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},IA={type:r.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},PA={type:r.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},DA={type:r.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},qf={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:r.InputMap,declaration:jf,name:null,description:null,readsValue:PA,dynamicArguments:[],defaultValue:null,index:0,parent:DA},SA={type:r.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},AA={type:r.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:r.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},OA={id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:AA},CA={type:r.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:r.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},BA={type:r.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},wA={type:r.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Jf={type:r.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:OA,readsValue:CA,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[wA],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:BA},MA={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.OutputMap,version:1,declaration:Qs,writesValues:[Jf],index:0,parent:SA},_A={type:r.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:kf,inputs:[qf],outputs:[MA],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[gA],successCalls:[Jf],errorCalls:[],error:null,x:0,y:0,parent:IA},NA={type:r.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},VA={type:r.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},LA={type:r.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},$A={type:r.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:r.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},Wf={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:r.InputMap,declaration:Hn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:LA,defaultValue:null,index:0,parent:$A},GA={type:r.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:Hn,inputs:[Wf],calledByError:[],calledByEntry:[NA],calledBySuccess:[],successCalls:[_A],errorCalls:[],x:0,y:0,parent:VA},FA={type:r.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},xA={type:r.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:r.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},UA={id:"d64152ea-831f-4426-9506-a39bfa170513",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:er,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xA},jA={type:r.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},kA={type:r.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:r.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},qA={type:r.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},Hf={type:r.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",dataType:UA,readsValue:kA,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[qA],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:jA},JA={type:r.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:r.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},WA={id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:er,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:JA},HA={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:r.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:WA,required:!0,index:1,writesValues:[Hf],parent:FA},YA={type:r.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},zA={type:r.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},ZA={type:r.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},XA={id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ZA},QA={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:r.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:XA,required:!0,index:0,writesValues:[Wf,qf],parent:zA},KA={type:r.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:[QA,HA],calls:[GA,Hf],index:1,private:!1,implements:null,x:0,y:0,parent:YA},eO={type:r.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},tO={type:r.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:r.Property,entityId:"employee-manager-property-id"},nO={id:"employee-manager-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:eO,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:tO},rO={type:r.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},iO={required:!0,type:r.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,dataType:nO,abstract:!1,parent:rO},aO={type:r.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:r.Property,entityId:"employee-start-date-property-id"},sO={id:"employee-start-date-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mr,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:aO},oO={type:r.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},lO={required:!0,type:r.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,implements:null,dataType:sO,abstract:!1,parent:oO},cO={type:r.GenericReference,id:"employee-department-property-ref-id",entityType:r.Property,entityId:"employee-department-property-id"},dO={id:"employee-department-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:cO},uO={type:r.GenericReference,id:"employee-department-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},pO={required:!0,type:r.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,implements:null,static:!1,private:!1,dataType:dO,abstract:!1,parent:uO},yO={type:r.GenericReference,id:"employee-prototype-parent-ref-id",entityType:r.Project,entityId:q},Rt={type:r.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[pO,lO,iO],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[lt],x:0,y:0,parent:yO},hO={type:r.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:r.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},fO={id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:hO},mO={type:r.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},TO={required:!0,type:r.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,implements:null,dataType:fO,abstract:!1,parent:mO},EO={type:r.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:r.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},RO={id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:er,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:EO},bO={type:r.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},Ks={required:!0,type:r.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,dataType:RO,abstract:!1,parent:bO},vO={type:r.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:r.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},gO={id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:lt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vO},IO={type:r.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},PO={required:!0,type:r.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,dataType:gO,private:!0,abstract:!1,parent:IO},DO={type:r.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:r.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},SO={id:"ad44250b-40c2-48f7-a480-381fa938f562",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DO},AO={type:r.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},OO={required:!0,type:r.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:SO,implements:null,private:!0,static:!1,abstract:!1,parent:AO},CO={type:r.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:r.Project,entityId:q},yt={type:r.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[TO,Ks,PO,OO],static:!1,abstract:!1,abstractMethods:[],methods:[TS,KA],extends:[],implements:[Oe],x:0,y:0,parent:CO},BO={type:r.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:r.Project,entityId:q},eo={type:r.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:BO};r.GenericReference,r.DataType;const wO={id:"cron-job-entity-expression-property-ref-id",type:r.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:r.Property},MO={id:"cron-job-entity-expression-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:null,parent:wO},_O={id:"cron-job-entity-ref-id",type:r.GenericReference,entityId:"cron-job-entity-id",entityType:r.CustomEntity},NO={required:!0,id:"cron-job-entity-expression-property-id",type:r.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:MO,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:_O},VO={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:r.GenericReference,entityId:"show-popup-func-decl-id",entityType:r.FunctionDeclaration},LO={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:r.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:r.FunctionDeclaration},$O={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:r.FunctionCall,declaration:eo,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[VO],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:LO},GO={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:r.GenericReference,entityId:"cron-job-entity-id",entityType:r.CustomEntity},FO={id:"cron-job-entity-trigger-func-decl-id",version:1,type:r.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:Ss,calls:[$O],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:GO},xO={id:"cron-job-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},UO={id:"cron-job-entity-id",version:1,type:r.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[NO],static:!0,abstract:!1,abstractMethods:[],extends:[hh],implements:[],methods:[FO],x:0,y:0,parent:xO},jO={type:r.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:r.Project,entityId:q},kO={type:r.CustomEntity,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:[Ps],x:0,y:0,parent:jO},Yf="f558fbf8-67de-4545-9804-6ae621e0b2d4",qO={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},JO={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},WO={id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:G,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:{},parent:qO,autogeneration:null,valueAsType:null},parent:JO},HO={id:"getCompanyByIdEndpointReachedEntityEventRef",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},YO={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},zO={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},ZO={id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:{},parent:YO,autogeneration:null,valueAsType:null},parent:zO},XO={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:r.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:ZO,required:!0,index:0,parent:HO},QO={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},KO={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:r.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:[],dataType:WO,required:!0,index:1,parent:QO},eC={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},tC={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},nC={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},rC={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:G,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:{},parent:tC,autogeneration:null,valueAsType:null},parent:nC},iC={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:r.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:rC,required:!0,index:2,parent:eC},aC={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},sC={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},oC={id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:sC},lC={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:r.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:oC,index:3,required:!0,parent:aC},cC={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},dC={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cC},uC={id:"getCompanyByIdEndpointReturnStatementRef",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},pC={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:r.ReturnDeclaration,name:"Response code",dataType:dC,readsValue:null,required:!0,index:0,parent:uC},yC={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},hC={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},fC={id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:at,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.JSON,value:{},parent:yC,autogeneration:null,valueAsType:null},parent:hC},mC={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},TC={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:r.ReturnDeclaration,name:"Response headers",dataType:fC,readsValue:null,required:!0,index:1,parent:mC},EC={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},RC={id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:at,defaultValue:null,parent:EC},bC={id:"getCompanyByIdEndpointReturnStatementRefThree",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},vC={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:r.ReturnDeclaration,name:"Response body",dataType:RC,readsValue:null,required:!0,index:2,parent:bC},gC={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:r.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:r.FunctionDeclaration},IC={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},PC={id:"getCompanyByIdEndpointReturnStatement",type:r.ReturnStatement,version:1,outputs:[pC,TC,vC],calledByError:[],calledByEntry:[gC],calledBySuccess:[],throws:null,x:0,y:0,parent:IC},DC={id:"endpointBuiltInBaseEntityRefFour",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:Yf},SC={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:r.FunctionDeclaration,inputs:[XO,KO,iC,lC],returnStatements:[PC],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:Is,index:0,private:!1,x:0,y:0,parent:DC},AC={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},OC={id:"getCompanyByIdEndpointPathPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"getCompanyByIdEndpointPathProperty"},CC={id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:G,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:v.String,value:"/company/{id}",parent:AC,valueAsType:null,autogeneration:null},parent:OC},BC={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},wC={required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:r.Property,private:!1,abstract:!1,static:!0,implements:vs,dataType:CC,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:BC},MC={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},_C={id:"getCompanyByIdEndpointMethodPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"getCompanyByIdEndpointMethodProperty"},NC={id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Rn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,value:"GET",name:v.Enum,parent:MC,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:_C},VC={id:"getCompanyByIdEndpointBaseEntityRefThree",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},LC={required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:r.Property,private:!1,abstract:!1,static:!0,implements:gs,index:0,dataType:NC,description:null,parent:VC},$C={type:r.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:r.Project,entityId:q},GC={type:r.CustomEntity,id:Yf,version:1,name:"Get given company data by id",description:null,properties:[wC,LC],methods:[SC],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[Ps],x:0,y:0,parent:$C},FC={id:"product-prototype-database-property-ref-id",type:r.GenericReference,entityId:"product-prototype-database-property-id",entityType:r.Property},xC={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:r.DataType},UC={id:"product-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:vn,asType:!1,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:v.EntityTemplate,valueAsType:zs,autogeneration:null,parent:xC},parent:FC},jC={id:"product-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},kC={required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:vr,static:!0,index:0,dataType:UC,description:"The database that the entity belongs to.",parent:jC},qC={type:r.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:r.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},JC={id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qC},WC={type:r.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:r.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},HC={required:!0,type:r.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,dataType:JC,abstract:!1,parent:WC},YC={type:r.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:r.Project,entityId:q},zC={type:r.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Oe],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[kC,HC],methods:[],x:0,y:0,parent:YC},jr="project-loaded-event-id",jt="get-bitcoin-price-http-call-operation-id",zf="get-bitcoin-price-http-call-response-body-id",sa="validate-bitcoin-price-response-operation-ids",ZC={type:r.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:zf},XC={type:r.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:r.Operation,entityId:sa},Zf={id:"validate-bitcoin-data-to-validate-input-map-id",type:r.InputMap,version:1,declaration:qn.fixedArguments[1],name:null,description:null,readsValue:ZC,defaultValue:null,dynamicArguments:[],index:0,parent:XC},QC={type:r.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:r.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},KC={type:r.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:r.Operation,entityId:sa},eB={id:"validate-bitcoin-type-to-match-input-map-id",type:r.InputMap,version:1,declaration:qn.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:r.PrimitiveValue,version:1,name:v.EntityTemplate,valueAsType:_f,value:null,parent:QC,autogeneration:null},dynamicArguments:[],index:0,parent:KC},tB={type:r.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:r.Operation,entityId:sa},nB={id:"validate-bitcoin-validated-entity-output-map-id",type:r.OutputMap,version:1,declaration:qn.fixedReturns[0],writesValues:[],index:0,parent:tB},rB={type:r.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:r.GlobalEvent,entityId:jr},iB={type:r.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:r.Operation,entityId:jt},aB={type:r.Operation,id:sa,version:1,declaration:qn,inputs:[eB,Zf],outputs:[nB],process:null,dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[iB],parent:rB},sB={type:r.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:r.FunctionCall,entityId:jt},oB={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:r.InputMap,declaration:Bi,name:null,description:null,readsValue:null,defaultValue:null,dynamicArguments:[],index:0,parent:sB},lB={type:r.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:r.FunctionCall,entityId:jt},cB={type:r.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:r.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},dB={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:r.InputMap,declaration:wi,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:r.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:v.String,parent:cB,valueAsType:null,autogeneration:null},index:1,dynamicArguments:[],parent:lB},uB={type:r.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:r.FunctionCall,entityId:jt},pB={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:r.InputMap,declaration:Mi,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:2,parent:uB},yB={type:r.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:r.FunctionCall,entityId:jt},hB={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:r.InputMap,declaration:_i,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:3,parent:yB},fB={type:r.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:r.FunctionCall,entityId:jt},mB={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:r.OutputMap,declaration:Ni,writesValues:[],index:1,parent:fB},TB={type:r.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:r.FunctionCall,entityId:jt},EB={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:r.OutputMap,declaration:Es,writesValues:[],index:0,parent:TB},RB={type:r.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:r.FunctionCall,entityId:jt},bB={id:zf,type:r.OutputMap,version:1,declaration:Rr,writesValues:[Zf],index:2,parent:RB},vB={type:r.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:r.FunctionDeclaration,entityId:jt},gB={type:r.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:r.GlobalEvent,entityId:jr},IB={type:r.Operation,id:jt,version:1,declaration:Vi,inputs:[oB,dB,pB,hB],outputs:[EB,mB,bB],process:null,parent:gB,calledByError:[],calledByEntry:[vB],calledBySuccess:[],dynamicArguments:[],successCalls:[aB],errorCalls:[],error:null,x:0,y:0},PB={type:r.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:r.GlobalEvent,entityId:jr},DB={type:r.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:r.GlobalEvent,entityId:jr},SB={process:null,type:r.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:eo,inputs:[],outputs:[],calledByError:[],calledByEntry:[PB],calledBySuccess:[],parent:DB,successCalls:[],errorCalls:[],error:null,x:0,y:0},AB={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:r.GenericReference,entityType:r.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},OB={type:r.GlobalEvent,id:jr,version:1,name:Wt.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:Cs,parent:AB,inputs:[],calls:[SB,IB],x:0,y:0},At="abort-execution-func-declaration-id",kr="abort-execution-func-exec-var-declaration-id",oa="abort-execution-func-small-wait-op-id",to="abort-execution-func-long-wait-op-id",Xf="abort-execution-func-long-wait-process-output-id",Qf="abort-execution-func-exec-var-instance-write-id",Kf="abort-execution-func-long-wait-return-stmt-id",em="abort-execution-func-small-wait-return-stmt-id",CB="abort-execution-func-exec-var-instance-abort-call-id",no="abort-execution-func-exec-var-instance-abort-internal-call-id",tm="abort-execution-func-exec-second-wait-op-id",BB={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},wB={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:r.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},MB={id:"short-wait-return-statement-returned-hello-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:wB},constant:!1,parent:BB},_B={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:r.ReturnStatement,entityId:em},NB={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:MB,readsValue:null,required:!0,index:0,parent:_B},VB={type:r.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:oa},LB={type:r.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:At},nm={type:r.ReturnStatement,id:em,version:1,outputs:[NB],calledByError:[],calledByEntry:[],calledBySuccess:[VB],throws:null,x:0,y:0,parent:LB},$B={type:r.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"second-wait-argument-map-id"},GB={type:r.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:r.Operation,entityId:tm},FB={id:"second-wait-argument-map-id",type:r.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:r.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:v.Number,parent:$B},index:0,parent:GB},xB={type:r.GenericReference,id:"small-wait-parent-ref-id",entityType:r.FunctionDeclaration,entityId:At},UB={type:r.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:r.InternalCall,entityId:no},jB={id:tm,type:r.Operation,version:1,declaration:st,inputs:[FB],dynamicArguments:[],outputs:[],process:null,successCalls:[nm],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[UB],error:null,parent:xB},kB={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:r.VariableInstance,entityId:Qf},qB={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:r.Operation,entityId:oa},JB={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:At},WB={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:kr},HB={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:r.InternalCall,entityId:no},YB={id:CB,type:r.VariableInstance,version:1,declaration:WB,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[HB],parent:JB},rm={id:no,type:r.InternalCall,version:1,inputs:[],outputs:[],declaration:As,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[kB,qB],successCalls:[jB],errorCalls:[],error:null,index:0,parent:YB},zB={type:r.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:At},ZB={type:r.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:r.VariableDeclaration,entityId:kr},XB={type:r.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:r.FunctionDeclaration,entityId:At},QB={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:kr},KB={type:r.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:r.OutputMap,entityId:Xf},ro={id:Qf,type:r.VariableInstance,version:1,declaration:QB,inputs:[],outputs:[],calledByError:[],calledByEntry:[XB],calledBySuccess:[ZB],successCalls:[rm],errorCalls:[],x:0,y:0,readsValue:KB,writesValues:[],internalCalls:[],parent:zB},ew={type:r.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:kr};r.GenericReference,r.DataType;const tw={id:"abort-exec-func-var-decl-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Os,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:ew,defaultValue:null},nw={type:r.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:At},rw={type:r.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:At},iw={id:kr,type:r.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:tw,inputs:[],outputs:[],calledByError:[],calledByEntry:[rw],calledBySuccess:[],successCalls:[ro],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:nw},aw={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},sw={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:r.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},ow={id:"long-wait-return-statement-returned-hello-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:sw},constant:!1,parent:aw},lw={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:r.ReturnStatement,entityId:Kf},cw={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:ow,readsValue:null,required:!0,index:0,parent:lw},dw={type:r.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:to},uw={type:r.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:At},im={type:r.ReturnStatement,id:Kf,version:1,outputs:[cw],calledByError:[],calledByEntry:[],calledBySuccess:[dw],throws:null,x:0,y:0,parent:uw},pw={type:r.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"long-argument-map-id"},am={type:r.GenericReference,id:"long-argument-map-parent-ref-id",entityType:r.Operation,entityId:to},yw={id:"long-argument-map-id",type:r.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:r.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:v.Number,parent:pw},index:0,parent:am},hw={type:r.GenericReference,id:"long-parent-ref-id",entityType:r.FunctionDeclaration,entityId:At},fw={type:r.GenericReference,id:"long-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:At},mw={id:Xf,type:r.OutputMap,version:1,declaration:Ah,writesValues:[ro],index:0,parent:am},Tw={id:to,type:r.Operation,version:1,declaration:st,inputs:[yw],dynamicArguments:[],outputs:[],process:mw,successCalls:[im],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[fw],calledBySuccess:[],error:null,parent:hw},Ew={type:r.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"small-wait-argument-map-id"},Rw={type:r.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:r.Operation,entityId:oa},bw={id:"small-wait-argument-map-id",type:r.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:r.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:v.Number,parent:Ew},index:0,parent:Rw},vw={type:r.GenericReference,id:"small-wait-parent-ref-id",entityType:r.FunctionDeclaration,entityId:At},gw={type:r.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:At},Iw={id:oa,type:r.Operation,version:1,declaration:st,inputs:[bw],dynamicArguments:[],outputs:[],process:null,successCalls:[rm],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[gw],calledBySuccess:[],error:null,parent:vw},Pw={type:r.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:r.Project,entityId:q},sm={id:"abort-execution-func-decl-id",type:r.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[im,nm],calls:[Iw,iw,ro,Tw],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:Pw},Dw={type:r.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:r.Project,entityId:q},Sw={id:"call-execution-abort-func-id",type:r.FunctionCall,version:1,declaration:sm,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:Dw},io="manual-hello-world-loop-func-decl-id",om="manual-hello-world-loop-func-return-statement-id",Zt="manual-hello-world-loop-id",qr="manual-hello-world-loop-body-id",lm="manual-hello-world-loop-break-statement-id",la="manual-hello-world-loop-current-iteration-number-output-map-id",ao="manual-hello-world-loop-previous-iterations-results-output-map-id",so="assembled-hello-world-text-output-id",cm="assembled-hello-world-list-output-id",Jr="iteration-number-is-equal-or-greater-than-10-condition-id",ca="join-hello-world-and-number-operation-id",da="append-string-to-list-operation-id",dm="hello-world-loop-output-map-id",Aw={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:r.ReturnStatement,entityId:om},Ow={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:r.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},Cw={id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Ow},Bw={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:r.OutputMap,entityId:dm},um={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:r.ReturnDeclaration,name:"Results",description:null,dataType:Cw,readsValue:Bw,required:!0,index:0,parent:Aw},ww={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:r.Loop,entityId:Zt},Mw={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:r.FunctionDeclaration,entityId:io},pm={type:r.ReturnStatement,id:om,version:1,outputs:[um],calledByError:[],calledByEntry:[],calledBySuccess:[ww],parent:Mw,throws:null,x:0,y:0},_w={type:r.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:r.BreakStatement,entityId:lm},Nw={type:r.GenericReference,id:"hello-world-loop-break-statement-output-data-type-ref-id",entityType:r.ReturnDeclaration,entityId:"hello-world-loop-break-statement-output-id"},Vw={id:"hello-world-loop-break-statement-output-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Nw},Lw={type:r.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:r.OutputMap,entityId:so},oo={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:r.ReturnDeclaration,name:"Iteration result",description:null,dataType:Vw,readsValue:Lw,required:!0,index:0,parent:_w},$w={type:r.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:r.Condition,entityId:Jr},Gw={type:r.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:r.Loop,entityId:Zt},ym={type:r.BreakStatement,id:lm,version:1,outputs:[oo],calledByError:[],calledByEntry:[],calledBySuccess:[$w],parent:Gw,throws:null,x:0,y:0},Fw={type:r.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:r.ContinueStatement,entityId:"hello-world-loop-continue-statement"},xw={type:r.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:r.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},Uw={id:"hello-world-loop-continue-statement-output-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xw},jw={type:r.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:r.OutputMap,entityId:so},hm={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:r.ReturnDeclaration,name:"Iteration result",description:null,dataType:Uw,readsValue:jw,required:!0,index:0,parent:Fw},kw={type:r.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:r.Condition,entityId:Jr},qw={type:r.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:r.Loop,entityId:Zt},fm={type:r.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[hm],calledBySuccess:[],calledByError:[kw],calledByEntry:[],parent:qw,throws:null,x:0,y:0};r.GenericReference,r.InputMap;const Jw={type:r.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:r.Operation,entityId:da},Ww={type:r.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:r.OutputMap,entityId:ao},mm={id:"append-string-to-list-base-string-map-id",type:r.InputMap,version:1,declaration:cs,name:null,description:null,readsValue:Ww,defaultValue:null,dynamicArguments:[],index:0,parent:Jw},Hw={type:r.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:r.Operation,entityId:da},Yw={id:cm,type:r.OutputMap,version:1,writesValues:[oo],declaration:Tr,index:0,parent:Hw},zw={type:r.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:r.Condition,entityId:Jr},Zw={type:r.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:cm},Xw={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:da},Tm={id:"latest-string-to-add-input-map-id",version:1,type:r.InputMap,declaration:ds,name:null,description:null,readsValue:Zw,dynamicArguments:[],defaultValue:null,index:1,parent:Xw},Qw={type:r.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Zt},Kw={type:r.Operation,id:da,declaration:us,version:1,inputs:[mm,Tm],outputs:[Yw],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[zw],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:Qw},eM={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:qr},tM={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:r.Loop,entityId:Zt},nM={type:r.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:r.OutputMap,entityId:la},Em={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:r.Condition,entityId:Jr},rM={id:"current-iteration-number-to-check-map-id",version:1,type:r.InputMap,declaration:gr.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:nM,index:1,defaultValue:null,parent:Em},iM={type:r.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:r.InputMap,entityId:"max-num-iterations-value-map-id"},aM={id:"max-num-iterations-value-map-id",version:1,type:r.InputMap,declaration:gr.fixedArguments[1],name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:r.PrimitiveValue,version:1,name:v.Number,value:10,autogeneration:null,valueAsType:null,parent:iM},parent:Em},sM={type:r.Condition,id:Jr,version:1,declaration:gr,inputs:[aM,rM],calledByError:[],calledByEntry:[eM],calledBySuccess:[],successCalls:[ym,Kw],errorCalls:[fm],x:0,y:0,parent:tM},oM={type:r.GenericReference,id:"base-string-map-ref-id",entityType:r.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},lM={type:r.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:r.Operation,entityId:ca},cM={id:"join-hello-world-and-number-base-string-map-id",type:r.InputMap,version:1,declaration:Ai,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:r.PrimitiveValue,version:1,value:"Hello world ",name:v.String,parent:oM,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:lM},dM={type:r.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:r.Operation,entityId:ca},uM={id:so,type:r.OutputMap,version:1,writesValues:[Tm,hm],declaration:Tr,index:0,parent:dM},pM={type:r.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:qr},yM={type:r.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:la},hM={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:ca},Rm={id:"current-iteration-number-input-map-id",version:1,type:r.InputMap,declaration:Oi,name:null,description:null,readsValue:yM,dynamicArguments:[],defaultValue:null,index:1,parent:hM},fM={type:r.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Zt},mM={type:r.Operation,id:ca,declaration:Ci,version:1,inputs:[cM,Rm],outputs:[uM],process:null,calledByError:[],calledByEntry:[pM],calledBySuccess:[],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:fM},TM={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:ao,entityType:r.ArgumentDeclaration},EM={id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:TM},RM={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:r.GenericReference,entityId:qr,entityType:r.FunctionDeclaration},bM={id:ao,type:r.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:EM,writesValues:[mm],index:1,parent:RM},vM={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:r.GenericReference,entityId:qr,entityType:r.FunctionDeclaration},gM={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:la,entityType:r.ArgumentDeclaration};r.DataType;const IM={id:la,type:r.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,dataType:null,writesValues:[Rm],index:0,parent:vM},PM={id:"manual-flow-loop-body-parent-ref-id",type:r.GenericReference,entityId:Zt,entityType:r.Loop},DM={id:qr,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[IM,bM],calls:[sM,mM],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:PM},SM={type:r.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:r.Loop,entityId:Zt},AM={type:r.OutputMap,id:dm,version:1,declaration:oo,writesValues:[um],index:0,parent:SM},OM={id:"manual-hello-world-loop-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},CM={id:"manual-hello-world-loop-called-by-ref-id",type:r.GenericReference,entityId:io,entityType:r.FunctionDeclaration},BM={id:Zt,type:r.Loop,version:1,declaration:_p,inputs:[],outputs:[AM],body:DM,successCalls:[pm],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[CM],calledBySuccess:[],breakStatements:[ym],continueStatements:[fm],x:0,y:0,parent:OM},wM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},bm={type:r.FunctionDeclaration,id:io,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[BM],returnStatements:[pm],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:wM},MM={type:r.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:r.Project,entityId:q},_M={id:"call-hello-world-loop-id",type:r.FunctionCall,version:1,declaration:bm,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:MM},Xt="company-dto-function-declaration-id",lo="company-dto-func-declaration-argument-dcl-id",kt="company-dto-function-company-variable-id",cn="company-dto-function-company-dto-variable-id",nr="iterate-over-employee-list-loop-id",vm="iterate-over-employee-list-loop-employee-dto-output-map-id",co="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",Wr="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",gm="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",NM="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",Im="iterate-over-employee-list-continue-statement-id",ua="iterate-over-employee-list-loop-body-id",Pm="company-dto-func-declaration-return-statement-id",Dm="company-dto-func-declaration-return-decl-id",Sm="company-dto-func-declaration-company-variable-id-output-map-id",Am="company-dto-func-declaration-company-variable-employess-output-map-id",Om="company-dto-func-declaration-company-variable-name-output-map-id",VM="company-dto-func-declaration-company-dto-variable-input-map-id",LM="company-dto-func-declaration-company-dto-variable-employess-input-map-id",$M="company-dto-func-declaration-company-dto-variable-name-input-map-id",pa="company-dto-func-declaration-owner-variable-id",GM="company-dto-func-declaration-company-dto-variable-owner-input-map-id",Cm="company-dto-func-declaration-company-variable-owner-output-map-id",Bm="company-dto-func-declaration-owner-variable-id-output-map-id",ya="company-dto-func-declaration-bank-account-variable-id",FM="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",wm="company-dto-func-declaration-company-variable-bank-account-output-map-id",Mm="company-dto-func-declaration-bank-account-variable-id-output-map-id",xM={type:r.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:Dm},UM={id:"company-dto-func-returned-company-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xM},jM={type:r.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:Pm},kM={type:r.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:cn},_m={isError:!1,id:Dm,type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:UM,readsValue:kM,required:!0,index:0,parent:jM},qM={type:r.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:r.Operation,entityId:cn},JM={type:r.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Xt},uo={type:r.ReturnStatement,id:Pm,version:1,outputs:[_m],calledByError:[],calledByEntry:[],calledBySuccess:[qM],throws:null,x:0,y:0,parent:JM},WM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Bm},HM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:cn},Nm={id:GM,type:r.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,dynamicArguments:[],index:5,readsValue:WM,parent:HM},YM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Mm},zM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:cn},Vm={id:FM,type:r.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:YM,parent:zM},ZM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Om},XM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:cn},Lm={id:$M,type:r.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:ZM,parent:XM},QM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:vm},KM={type:r.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:cn},$m={id:LM,type:r.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:QM,parent:KM},e_={type:r.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Sm},t_={type:r.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:cn},Gm={id:VM,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,dynamicArguments:[],index:1,readsValue:e_,parent:t_},n_={type:r.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Xt},r_={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:r.VariableDeclaration,entityId:ya},i_={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:r.VariableDeclaration,entityId:pa},a_={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:r.VariableDeclaration,entityId:nr},po={id:cn,type:r.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[r_,i_,a_],successCalls:[uo],errorCalls:[],readsValue:null,writesValues:[_m],inputs:[Gm,Lm,Vm,Nm,$m],outputs:[],internalCalls:[],parent:n_,x:0,y:0},Dn="employee-dto-func-declaration-id",yo="employee-dto-func-declaration-argument-dcl-id",Fm="employee-dto-func-declaration-return-statement-id",xm="employee-dto-func-declaration-return-decl-id",Sn="employee-dto-func-declaration-employee-variable-id",An="employee-dto-func-declaration-employee-dto-variable-id",ha="employee-dto-func-declaration-manager-variable-id",Um="employee-dto-func-declaration-employee-variable-id-output-map-id",jm="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",km="employee-dto-func-declaration-employee-variable-department-output-map-id",qm="employee-dto-func-declaration-employee-variable-manager-output-map-id",Jm="employee-dto-func-declaration-manager-variable-id-output-map-id",s_="employee-dto-func-declaration-employee-dto-variable-input-map-id",o_="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",l_="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",c_="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",d_={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:xm},u_={id:"employee-dto-func-returned-employee-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:d_},p_={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:Fm},y_={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:An},Wm={isError:!1,id:xm,type:r.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:u_,readsValue:y_,required:!0,index:0,parent:p_},h_={type:r.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:r.Operation,entityId:An},f_={type:r.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Dn},ho={type:r.ReturnStatement,id:Fm,version:1,outputs:[Wm],calledByError:[],calledByEntry:[],calledBySuccess:[h_],throws:null,x:0,y:0,parent:f_},m_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Jm},T_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:An},Hm={id:c_,type:r.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:m_,parent:T_},E_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:km},R_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:An},Ym={id:l_,type:r.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:E_,parent:R_},b_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:jm},v_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:An},zm={id:o_,type:r.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:b_,parent:v_},g_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Um},I_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:An},Zm={id:s_,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:g_,parent:I_},P_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Dn},D_={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:r.VariableDeclaration,entityId:ha},S_={id:An,type:r.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[D_],successCalls:[ho],errorCalls:[],readsValue:null,writesValues:[Wm],inputs:[Zm,zm,Ym,Hm],outputs:[],internalCalls:[],parent:P_,x:0,y:0},A_={type:r.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:ha},O_={id:Jm,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[Hm],parent:A_},C_={type:r.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:ha},B_={id:"employee-dto-func-manager-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:C_,defaultValue:null},w_={type:r.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:qm},M_={type:r.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Dn};r.GenericReference,r.VariableDeclaration;const Xm={id:ha,type:r.VariableDeclaration,version:1,name:"Manager",dataType:B_,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[S_],errorCalls:[],readsValue:w_,writesValues:[],inputs:[],outputs:[O_],internalCalls:[],parent:M_,x:0,y:0},__={type:r.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Sn},N_={id:qm,type:r.OutputMap,version:1,declaration:Rt.properties[2],index:3,writesValues:[Xm],parent:__},V_={type:r.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Sn},L_={id:km,type:r.OutputMap,version:1,declaration:Rt.properties[0],index:2,writesValues:[Ym],parent:V_},$_={type:r.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Sn},G_={id:jm,type:r.OutputMap,version:1,declaration:lt.properties[1],index:1,writesValues:[zm],parent:$_},F_={type:r.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Sn},x_={id:Um,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[Zm],parent:F_},U_={type:r.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Sn},j_={id:"employee-dto-func-employee-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:U_,defaultValue:null},k_={type:r.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Dn},q_={type:r.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:yo},J_={type:r.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:r.FunctionDeclaration,entityId:Dn},Qm={id:Sn,type:r.VariableDeclaration,version:1,name:"Company employee",dataType:j_,description:"A variable holding a company employee",calledByError:[],calledByEntry:[J_],calledBySuccess:[],successCalls:[Xm],errorCalls:[],readsValue:q_,writesValues:[],inputs:[],outputs:[x_,G_,L_,N_],internalCalls:[],parent:k_,x:0,y:0},W_={type:r.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:yo,entityType:r.ArgumentDeclaration},H_={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:Rt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:W_,defaultValue:null},Y_={type:r.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:Dn,entityType:r.FunctionDeclaration},z_={type:r.ArgumentDeclaration,id:yo,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,dataType:H_,index:0,writesValues:[Qm],parent:Y_},Z_={type:r.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},fo={type:r.FunctionDeclaration,id:Dn,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[z_],calls:[Qm],implements:null,returnStatements:[ho],collapsed:!1,private:!1,x:0,y:0,parent:Z_},X_={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:gm,entityType:r.ReturnDeclaration},Q_={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Rt,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:X_},K_={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:r.GenericReference,entityId:Wr,entityType:r.OutputMap},eN={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:r.GenericReference,entityId:Im,entityType:r.ContinueStatement},Km={isError:!1,id:gm,type:r.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:K_,dataType:Q_,required:!0,index:0,parent:eN},tN={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:r.GenericReference,entityId:Wr,entityType:r.FunctionCall},nN={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:r.GenericReference,entityId:nr,entityType:r.Loop},eT={id:Im,type:r.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[tN],outputs:[Km],throws:null,x:0,y:0,parent:nN},rN={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:r.GenericReference,entityId:Wr,entityType:r.FunctionCall},iN={id:NM,type:r.OutputMap,version:1,declaration:ho.outputs[0],writesValues:[Km],index:0,parent:rN},aN={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:r.GenericReference,entityId:co,entityType:r.ArgumentDeclaration},sN={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:r.GenericReference,entityId:Wr,entityType:r.FunctionCall},tT={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:fo.inputs[0],readsValue:aN,index:0,defaultValue:null,dynamicArguments:[],parent:sN},oN={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:r.GenericReference,entityId:ua,entityType:r.FunctionDeclaration},lN={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:r.GenericReference,entityId:ua,entityType:r.FunctionDeclaration},cN={id:Wr,type:r.FunctionCall,version:1,declaration:fo,inputs:[tT],process:null,outputs:[iN],calledByError:[],calledByEntry:[oN],calledBySuccess:[],successCalls:[eT],errorCalls:[],error:null,x:0,y:0,parent:lN},dN={type:r.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:co,entityType:r.ArgumentDeclaration},uN={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Rt,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:dN},pN={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:ua,entityType:r.FunctionDeclaration},yN={id:co,type:r.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:uN,required:!0,index:0,writesValues:[tT],parent:pN},hN={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:r.GenericReference,entityId:nr,entityType:r.Loop},fN={id:ua,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[yN],calls:[cN],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:hN},mN={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:r.GenericReference,entityId:nr,entityType:r.Loop},TN={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:r.GenericReference,entityId:Am,entityType:r.OutputMap},nT={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:Jn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:TN,index:0,parent:mN},EN={id:"iterate-over-employee-list-loop-parent-ref-id",type:r.GenericReference,entityId:Xt,entityType:r.FunctionDeclaration},RN={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:r.GenericReference,entityId:nr,entityType:r.Loop},bN={id:vm,type:r.OutputMap,version:1,declaration:Jn.fixedReturns[0],writesValues:[$m],index:0,parent:RN},vN={type:r.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:r.VariableDeclaration,entityId:kt},gN={id:nr,type:r.Loop,version:1,declaration:Jn,inputs:[nT],successCalls:[po],errorCalls:[],outputs:[bN],body:fN,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[vN],breakStatements:[],continueStatements:[eT],error:null,x:0,y:0,parent:EN},IN={type:r.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:ya},PN={id:Mm,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[Vm],parent:IN},DN={type:r.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:ya},SN={id:"company-dto-func-bank-account-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:DN,defaultValue:null},AN={type:r.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:wm},ON={type:r.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Xt};r.GenericReference,r.VariableDeclaration;const rT={id:ya,type:r.VariableDeclaration,version:1,name:"Bank account",dataType:SN,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[po],errorCalls:[],readsValue:AN,writesValues:[],inputs:[],outputs:[PN],internalCalls:[],parent:ON,x:0,y:0},CN={type:r.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:pa},BN={id:Bm,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[Nm],parent:CN},wN={type:r.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:pa},MN={id:"company-dto-func-owner-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:wN,defaultValue:null},_N={type:r.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:Cm},NN={type:r.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Xt};r.GenericReference,r.VariableDeclaration;const iT={id:pa,type:r.VariableDeclaration,version:1,name:"Owner",dataType:MN,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[po],errorCalls:[],readsValue:_N,writesValues:[],inputs:[],outputs:[BN],internalCalls:[],parent:NN,x:0,y:0},VN={type:r.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kt},LN={id:Cm,type:r.OutputMap,version:1,declaration:yt.properties[2],index:4,writesValues:[iT],parent:VN},$N={type:r.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kt},GN={id:wm,type:r.OutputMap,version:1,declaration:yt.properties[2],index:3,writesValues:[rT],parent:$N},FN={type:r.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kt},xN={id:Om,type:r.OutputMap,version:1,declaration:yt.properties[0],index:2,writesValues:[Lm],parent:FN},UN={type:r.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kt},jN={id:Am,type:r.OutputMap,version:1,declaration:yt.properties[3],index:1,writesValues:[nT],parent:UN},kN={type:r.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kt},qN={id:Sm,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[Gm],parent:kN},JN={type:r.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:kt},WN={id:"company-dto-func-company-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:JN,defaultValue:null},HN={type:r.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Xt},YN={type:r.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:lo},zN={type:r.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:r.FunctionDeclaration,entityId:Xt},aT={id:kt,type:r.VariableDeclaration,version:1,name:"Company",dataType:WN,description:"A variable holding a company",calledByError:[],calledByEntry:[zN],calledBySuccess:[],successCalls:[rT,iT,gN],errorCalls:[],readsValue:YN,writesValues:[],inputs:[],outputs:[qN,jN,xN,GN,LN],internalCalls:[],parent:HN,x:0,y:0},ZN={type:r.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:lo,entityType:r.ArgumentDeclaration},XN={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:ZN,defaultValue:null},QN={type:r.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:Xt,entityType:r.FunctionDeclaration},KN={type:r.ArgumentDeclaration,id:lo,version:1,name:"Company",description:"The company to create a DTO for",required:!0,dataType:XN,index:0,writesValues:[aT],parent:QN},e0={type:r.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},mo={type:r.FunctionDeclaration,id:Xt,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[KN],calls:[aT],implements:null,index:null,returnStatements:[uo],collapsed:!1,private:!1,x:0,y:0,parent:e0},Hr="exec-in-parallel-operation-call-id",Yr="exec-sequentially-operation-call-id",ct="concurrency-and-wait-function-declaration-id",sT="concurrency-and-wait-return-statement-id",oT="concurrency-and-wait-return-declaration-id",To="exec-in-parallel-argument-map-id",lT="exec-sequentially-argument-map-id",Eo="wait-for-2-seconds-operation-id",cT="wait-for-2-seconds-argument-map-id",Ro="map-company-dto-function-call-id",dT="map-company-dto-function-call-company-dto-output-map-id",zr="company-dto-variable-one-id",bo="company-dto-variable-one-instance-id",t0="company-dto-variable-two-id",n0={type:r.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:oT},r0={id:"returned-company-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:n0},i0={type:r.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:sT},a0={type:r.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:zr},uT={isError:!1,id:oT,type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:r0,readsValue:a0,required:!0,index:0,parent:i0},s0={type:r.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:Eo},o0={type:r.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},pT={type:r.ReturnStatement,id:sT,version:1,outputs:[uT],calledByError:[],calledByEntry:[],calledBySuccess:[s0],throws:null,x:0,y:0,parent:o0},l0={type:r.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:r.VariableInstance,entityId:bo},c0={type:r.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:r.VariableInstance,entityId:bo},d0={type:r.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},yT={id:t0,type:r.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[l0],internalCalls:[],writesValues:[uT],readsValue:c0,x:0,y:0,parent:d0},u0={type:r.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:r.VariableDeclaration,entityId:zr},p0={type:r.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:zr},y0={type:r.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},h0={type:r.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:zr},hT={id:bo,type:r.VariableInstance,version:1,declaration:h0,inputs:[],outputs:[],successCalls:[yT],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[u0],internalCalls:[],writesValues:[yT],readsValue:p0,x:0,y:0,parent:y0},f0={type:r.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:r.FunctionCall,entityId:Ro},m0={type:r.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:r.OutputMap,entityId:dT},T0={type:r.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},fT={id:zr,type:r.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[hT],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[f0],internalCalls:[],writesValues:[hT],readsValue:m0,x:0,y:0,parent:T0},mT={type:r.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:r.FunctionCall,entityId:Ro},E0={id:"map-company-dto-function-call-company-input-map-id",type:r.InputMap,version:1,declaration:mo.inputs[0],name:null,description:null,defaultValue:null,dynamicArguments:[],index:0,readsValue:null,parent:mT},R0={id:dT,type:r.OutputMap,version:1,declaration:uo.outputs[0],writesValues:[fT],index:0,parent:mT},b0={id:"map-company-dto-function-call-called-by-ref-id",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:ct},v0={id:"map-company-dto-function-call-parent-ref-id",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:ct},g0={id:Ro,type:r.FunctionCall,version:1,declaration:mo,successCalls:[fT],process:null,errorCalls:[],inputs:[E0],outputs:[R0],calledByError:[],calledByEntry:[b0],calledBySuccess:[],parent:v0,x:0,y:0,error:null},I0={type:r.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:pf},P0={type:r.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:r.DataType,entityId:"last-timestamp-variable-datatype-id"},D0={id:"last-timestamp-variable-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:mr,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:I0,defaultValue:{id:"last-timestamp-variable-default-value-id",type:r.PrimitiveValue,version:1,name:v.Date,value:null,autogeneration:{type:Le.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:P0,valueAsType:null}},S0={type:r.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:r.Project,entityId:q},vo={id:pf,type:r.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:D0,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:S0},A0={type:r.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:cT},O0={type:r.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:r.Operation,entityId:Eo},C0={id:cT,type:r.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:r.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:v.Number,parent:A0},index:0,parent:O0},B0={type:r.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},w0={type:r.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Yr},M0={type:r.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:r.FunctionDeclaration,entityId:Hr},TT={id:Eo,type:r.Operation,version:1,declaration:Mt,inputs:[C0],dynamicArguments:[],outputs:[],process:null,successCalls:[pT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[w0,M0],calledBySuccess:[],error:null,parent:B0},_0={type:r.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"wait-for-random-amount-input-map-id"},N0={type:r.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:r.Operation,entityId:"wait-for-random-amount-id"},V0={id:"wait-for-random-amount-input-map-id",type:r.InputMap,version:1,declaration:bn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:r.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:Le.Random,rangeStart:1e3,rangeEnd:4e3},name:v.Number,parent:_0},index:0,parent:N0},L0={type:r.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:r.Project,entityId:q},rr={id:"wait-for-random-amount-id",type:r.Operation,version:1,declaration:Mt,inputs:[V0],dynamicArguments:[],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:L0},ET="list-of-functions-variable-id",$0={type:r.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:ET},G0={id:"list-of-functions-variable-action-descriptor-id",type:r.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.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},F0={type:r.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:r.DataType,entityId:"list-of-functions-variable-data-type-id"},x0={id:"list-of-functions-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G0,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:v.ActionDescriptor,value:null,valueAsType:[rr,rr,rr,rr,rr],autogeneration:null,parent:F0},constant:!1,parent:$0},U0={type:r.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct};r.GenericReference,r.InputMap;const j0={type:r.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:r.InputMap,entityId:lT},k0={type:r.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:r.InputMap,entityId:To},RT={id:ET,type:r.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:x0,parent:U0,readsValue:null,writesValues:[j0,k0],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},q0={type:r.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:r.Operation,entityId:Hr},J0={type:r.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},W0={type:r.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:"exec-in-parallel-return-map-id"},H0={type:r.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:r.Operation,entityId:Hr},bT={id:"exec-in-parallel-result-variable-id",type:r.VariableInstance,version:1,declaration:vo,readsValue:W0,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[H0],successCalls:[],errorCalls:[],internalCalls:[],parent:J0,x:0,y:0},Y0={id:"exec-in-parallel-return-map-id",type:r.OutputMap,version:1,declaration:ys,writesValues:[bT],index:0,parent:q0},z0={type:r.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:r.Operation,entityId:Hr},Z0={id:To,type:r.InputMap,version:1,declaration:ps,name:null,description:null,dynamicArguments:[],readsValue:RT,defaultValue:null,index:0,parent:z0},X0={type:r.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},Q0={type:r.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:ct},K0={process:null,id:Hr,type:r.Operation,version:1,declaration:Mt,inputs:[Z0],dynamicArguments:[],outputs:[Y0],successCalls:[TT,bT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[Q0],calledBySuccess:[],error:null,parent:X0},e1={type:r.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:r.Operation,entityId:Yr},t1={type:r.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},n1={type:r.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:"exec-sequentially-return-map-id"},r1={type:r.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:r.Operation,entityId:Yr},vT={id:"exec-sequentially-result-variable-id",type:r.VariableInstance,version:1,declaration:vo,readsValue:n1,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[r1],successCalls:[],errorCalls:[],internalCalls:[],parent:t1,x:0,y:0},i1={id:"exec-sequentially-return-map-id",type:r.OutputMap,version:1,declaration:fs,writesValues:[vT],index:0,parent:e1},a1={type:r.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:r.Operation,entityId:Yr},s1={id:lT,type:r.InputMap,version:1,declaration:hs,name:null,description:null,dynamicArguments:[],readsValue:RT,defaultValue:null,index:0,parent:a1},o1={type:r.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:r.FunctionDeclaration,entityId:ct},l1={type:r.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:ct},c1={id:Yr,type:r.Operation,version:1,declaration:Ht,inputs:[s1],process:null,dynamicArguments:[],outputs:[i1],successCalls:[TT,vT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[l1],calledBySuccess:[],error:null,parent:o1},d1={type:r.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:r.Project,entityId:q},u1={type:r.FunctionDeclaration,id:ct,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:[c1,K0,g0],returnStatements:[pT],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:d1},p1={type:r.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:r.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},y1={id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:p1},h1={type:r.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:r.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},f1={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",dataType:y1,readsValue:null,required:!0,index:0,parent:h1},m1={type:r.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},T1={type:r.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},gT={type:r.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[f1],calledByError:[],calledByEntry:[T1],calledBySuccess:[],throws:null,x:0,y:0,parent:m1},E1={type:r.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:r.Project,entityId:q},R1={type:r.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[gT],index:null,implements:null,returnStatements:[gT],collapsed:!1,private:!1,x:0,y:0,parent:E1},go="get-current-date-and-time-func-decl-id",IT="get-current-date-and-time-return-statement-id",PT="get-current-date-and-time-return-declaration-id",DT="get-current-date-and-time-return-declaration-data-type-id",b1={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:r.DataType,entityId:DT},v1={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:PT},g1={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:DT,version:1,entity:mr,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:v.Date,valueAsType:null,autogeneration:{type:Le.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:b1},constant:!1,parent:v1},I1={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:r.ReturnStatement,entityId:IT};r.ReturnDeclaration;const P1={type:r.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:go},D1={type:r.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:go};r.ReturnStatement;const S1={type:r.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:r.Project,entityId:q},A1={type:r.FunctionDeclaration,id:go,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:S1},ST="do-math-return-statement-id",AT="do-math-return-declaration-id",O1={type:r.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:r.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},C1={id:"do-math-func-var-to-return-one-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:O1},B1={type:r.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},w1={type:r.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:r.ReturnDeclaration,entityId:AT},M1={type:r.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:C1,readsValue:null,writesValues:[w1],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:B1},_1={type:r.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:r.ReturnStatement,entityId:ST},N1={type:r.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:r.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},V1={id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:N1},L1={isError:!1,id:AT,version:1,type:r.ReturnDeclaration,name:"Result",description:null,dataType:V1,readsValue:M1,required:!0,index:0,parent:_1},$1={type:r.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},G1={type:r.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},OT={type:r.ReturnStatement,id:ST,version:1,outputs:[L1],calledByError:[],calledByEntry:[],calledBySuccess:[$1],parent:G1,throws:null,x:0,y:0},F1={type:r.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:r.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},x1={id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:F1},U1={type:r.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},j1={type:r.GenericReference,id:"do-math-func-return-one-called-by",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},k1={type:r.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:r.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},CT={type:r.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:x1,description:null,readsValue:k1,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[j1],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:U1},q1={type:r.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},J1={type:r.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:r.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},W1={type:r.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:r.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},H1={id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:W1},Y1={type:r.GenericReference,id:"do-math-func-return-two-called-by",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},BT={type:r.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[Y1],successCalls:[],errorCalls:[],dataType:H1,readsValue:J1,writesValues:[],internalCalls:[],parent:q1,x:0,y:0},wT={type:r.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},z1={type:r.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},Z1={type:r.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},X1={type:r.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:r.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},MT={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:r.InputMap,declaration:is,name:null,description:null,dynamicArguments:[],readsValue:X1,defaultValue:null,index:0,parent:Z1},Q1={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:r.OutputMap,version:1,declaration:ss,writesValues:[CT,BT],index:0,parent:z1},K1={type:r.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},eV={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:r.GenericReference,entityType:r.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},_T={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:r.InputMap,declaration:as,name:null,description:null,dynamicArguments:[],readsValue:eV,defaultValue:null,index:1,parent:K1},tV={type:r.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:os,version:1,inputs:[MT,_T],dynamicArguments:[],outputs:[Q1],calledByError:[],calledByEntry:[wT],calledBySuccess:[],process:null,successCalls:[OT,CT,BT],errorCalls:[],parent:wT,error:null,x:0,y:0},nV={type:r.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:r.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},rV={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:r.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:r.ArgumentDeclaration},NT={id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:r.PrimitiveValue,version:1,value:1,name:v.Number,parent:nV,valueAsType:null,autogeneration:null},constant:!1,parent:rV},iV={type:r.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:r.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},aV={type:r.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},sV={type:r.GenericReference,id:"do-math-func-var-called-by-ref",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},VT={type:r.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:NT,inputs:[],outputs:[],calledByError:[],calledByEntry:[sV],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:iV,writesValues:[_T],internalCalls:[],x:0,y:0,parent:aV},oV={entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:r.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},lV={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:r.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:NT,writesValues:[VT],required:!0,index:1,parent:oV},cV={type:r.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:r.Project,entityId:q},dV={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},uV={type:r.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:r.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},pV={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:r.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:r.ArgumentDeclaration},yV={id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:r.PrimitiveValue,version:1,value:5,name:v.Number,parent:uV,valueAsType:null,autogeneration:null},constant:!1,parent:pV},hV={id:"d8895765-f705-457e-85fa-25d130926769",type:r.ArgumentDeclaration,version:1,name:"N",dataType:yV,description:"The number to add",writesValues:[MT],required:!0,index:0,parent:dV},fV={type:r.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[hV,lV],calls:[tV,VT],implements:null,index:null,collapsed:!1,returnStatements:[OT],private:!1,x:0,y:0,parent:cV},bt="replace-bank-account-in-company-func-declaration-id",Io="company-entity-to-modify-arg-declaration-id",mV="account-number-to-create-arg-decl-id",ir="company-variable-id",ar="search-person-by-id-id",LT="new-bank-account-owner-arg-decl-id",$T="search-person-by-id-output-declaration-id",Po="search-person-by-id-output-entity-map-id",fa="person-not-empty-condition-id",ma="create-new-bank-account-instance-operation-id",GT="create-new-bank-account-instance-operation-output-entity-map-id",FT="company-bank-account-output-map-id",xT="old-bank-account-var-declaration-id",UT="company-variable-instance-id",TV="delete-bank-account-internal-call-id",EV={type:r.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:r.FunctionDeclaration,entityId:bt},RV={type:r.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:r.InternalCall,entityId:TV},bV={type:r.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:ir},vV={type:r.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:r.VariableInstance,entityId:UT},gV={type:r.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:GT},jT={type:r.InputMap,id:"bank-account-input-map-id",version:1,readsValue:gV,declaration:Ks,name:null,description:null,index:0,defaultValue:null,dynamicArguments:[],parent:vV},IV={type:r.VariableInstance,id:UT,version:1,declaration:bV,inputs:[jT],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[RV],successCalls:[],errorCalls:[],internalCalls:[],parent:EV,readsValue:null,writesValues:[],x:0,y:0},PV={type:r.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:ir},DV={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:er,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:PV},SV={type:r.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:FT},AV={type:r.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:bt},OV={type:r.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:r.VariableDeclaration,entityId:ir},CV={type:r.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:r.Operation,entityId:ma},BV={type:r.GenericReference,id:"delete-bank-account-internal-call-parent-ref-id",entityType:r.VariableDeclaration,entityId:xT},kT={process:null,type:r.InternalCall,id:"delete-bank-account-internal-call-id",version:1,declaration:Ds,index:0,successCalls:[IV],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[CV],parent:BV},qT={type:r.VariableDeclaration,id:xT,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:DV,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[OV],successCalls:[],internalCalls:[kT],errorCalls:[],parent:AV,readsValue:SV,writesValues:[],x:0,y:0},wV={type:r.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:ir},MV={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:wV},_V={type:r.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:Io},NV={type:r.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:r.FunctionDeclaration,entityId:bt},VV={type:r.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:bt},LV={type:r.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:ir},$V={id:FT,version:1,type:r.OutputMap,declaration:Ks,index:0,parent:LV,writesValues:[qT]},JT={type:r.VariableDeclaration,id:ir,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:MV,inputs:[],outputs:[$V],calledByError:[],calledByEntry:[VV],calledBySuccess:[],successCalls:[qT],errorCalls:[],parent:NV,internalCalls:[],readsValue:_V,writesValues:[],x:0,y:0},GV={type:r.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:r.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},FV={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:r.GenericReference,entityType:r.OutputMap,entityId:Po},WT={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:r.InputMap,declaration:Rf,name:null,description:null,dynamicArguments:[],readsValue:FV,index:1,defaultValue:null,parent:GV},xV={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:mV},UV={type:r.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:r.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},HT={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:r.InputMap,declaration:Ef,name:null,description:null,dynamicArguments:[],readsValue:xV,defaultValue:null,index:0,parent:UV},jV={type:r.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:r.Operation,entityId:ma},kV={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:r.InputMap,declaration:Er.fixedArguments[0],name:null,description:null,dynamicArguments:[HT,WT],index:0,readsValue:null,defaultValue:{type:r.PrimitiveValue,name:v.EntityTemplate,value:null,valueAsType:er,autogeneration:null},parent:jV},qV={type:r.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:r.Operation,entityId:ma},JV={id:GT,version:1,type:r.OutputMap,declaration:Er.fixedReturns[0],index:0,writesValues:[jT],parent:qV},WV={type:r.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:r.Condition,entityId:fa},HV={type:r.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:r.FunctionDeclaration,entityId:bt},YV={process:null,id:ma,type:r.Operation,version:1,declaration:Er,inputs:[kV],dynamicArguments:[],error:null,outputs:[JV],successCalls:[kT],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[WV],parent:HV,x:0,y:0},zV={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:r.DataType},ZV={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:r.ReturnDeclaration};r.DataType,r.PrimitiveValue,v.String;const XV={id:"person-not-found-thrown-error-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:r.ReturnStatement},QV={isError:!0,id:"person-not-found-thrown-error-id",type:r.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:XV,required:!0,index:0,readsValue:null},KV={id:"person-not-found-error-return-statement-called-by-ref-id",type:r.GenericReference,entityId:fa,entityType:r.Condition},eL={id:"person-not-found-error-return-statement-parent-ref-id",type:r.GenericReference,entityId:bt,entityType:r.FunctionDeclaration},tL={id:"person-not-found-error-return-statement-id",type:r.ReturnStatement,version:1,throws:QV,outputs:[],calledBySuccess:[],calledByError:[KV],calledByEntry:[],x:0,y:0,parent:eL},nL={type:r.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:r.Search,entityId:ar},rL={type:r.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:r.FunctionDeclaration,entityId:bt},iL={type:r.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Po},aL={type:r.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:r.Condition,entityId:fa},YT={id:"person-entity-to-check-map-id",version:1,type:r.InputMap,declaration:Hn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:iL,index:0,defaultValue:null,parent:aL},sL={type:r.Condition,id:fa,version:1,declaration:Hn,inputs:[YT],calledByError:[],calledByEntry:[],calledBySuccess:[nL],successCalls:[YV],errorCalls:[tL],x:0,y:0,parent:rL},oL={type:r.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:r.ReturnDeclaration,entityId:$T},lL={id:"search-person-by-id-output-entity-declaration-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:lt,defaultValue:null,parent:oL},cL={type:r.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:r.Search,entityId:ar},zT={isError:!1,id:$T,type:r.ReturnDeclaration,version:1,dataType:lL,name:"Found person",description:"The person entity that was found",parent:cL,required:!0,index:0,readsValue:null},dL={type:r.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:r.Search,entityId:ar},uL={type:r.OutputMap,id:Po,version:1,declaration:zT,parent:dL,writesValues:[YT,WT],index:0},pL={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:r.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:r.ArgumentDeclaration};r.DataType;const yL={type:r.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:r.Search,entityId:ar},ZT={id:"search-person-by-id-input-declaration-id",type:r.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",index:0,required:!0,parent:yL,writesValues:[]},hL={type:r.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:r.Search,entityId:ar},fL={id:"search-person-by-id-input-map-reads-value-ref-id",type:r.GenericReference,entityId:LT,entityType:r.ArgumentDeclaration},XT={type:r.InputMap,id:"search-person-by-id-input-map",version:1,declaration:ZT,name:null,description:null,readsValue:fL,defaultValue:null,parent:hL,dynamicArguments:[],index:0},mL={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},TL={type:r.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:r.FunctionDeclaration,entityId:bt},EL={type:r.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:bt},RL={type:r.Search,id:ar,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:mL,inputsDeclarations:[ZT],inputs:[XT],outputsDeclarations:[zT],outputs:[uL],calledByError:[],calledByEntry:[EL],calledBySuccess:[],error:null,successCalls:[sL],errorCalls:[],parent:TL,x:0,y:0};r.GenericReference,r.DataType;const bL={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:"account-number-to-create-arg-decl-id",entityType:r.ArgumentDeclaration},vL={id:"account-number-to-create-arg-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:G,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:bL},gL={entityType:r.FunctionDeclaration,entityId:bt,type:r.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},IL={id:"account-number-to-create-arg-decl-id",type:r.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:vL,writesValues:[HT],required:!0,index:1,parent:gL};r.GenericReference,r.DataType;const PL={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:r.ArgumentDeclaration},DL={id:"new-bank-account-owner-arg-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:rs,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:PL},SL={entityType:r.FunctionDeclaration,entityId:bt,type:r.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},AL={id:LT,type:r.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",dataType:DL,writesValues:[XT],required:!1,index:1,parent:SL},OL={type:r.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:r.Project,entityId:q},CL={type:r.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:r.FunctionDeclaration,entityId:bt};r.GenericReference,r.DataType;const BL={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:r.GenericReference,entityId:Io,entityType:r.ArgumentDeclaration},wL={id:"company-entity-to-modify-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:BL},ML={id:Io,type:r.ArgumentDeclaration,version:1,name:"Company",dataType:wL,description:"The company to replace the bank account for",writesValues:[JT],required:!0,index:0,parent:CL},_L={type:r.FunctionDeclaration,id:bt,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:[ML,IL,AL],index:null,implements:null,calls:[RL,JT],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:OL},NL={type:r.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:r.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},VL={type:r.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:NL,x:0,y:0},LL={type:r.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:r.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},$L={type:r.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:r.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},GL={type:r.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[VL],events:[],implements:$L,parent:LL,x:0,y:0},Do="iterate-over-list-loop-id",QT="iterate-over-list-loop-body-id",KT="iterate-over-list-loop-body-current-iteration-argument-declaration-id",FL={type:r.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:KT,entityType:r.ArgumentDeclaration},xL={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:FL},UL={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:QT,entityType:r.FunctionDeclaration},jL={id:KT,type:r.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:xL,required:!0,index:0,writesValues:[],parent:UL},kL={id:"iterate-over-list-loop-body-parent-ref-id",type:r.GenericReference,entityId:Do,entityType:r.Loop},qL={id:QT,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[jL],calls:[],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:kL},JL={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:r.GenericReference,entityId:Do,entityType:r.Loop},WL={id:"iterate-over-list-loop-iteration-list-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:Jn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:null,index:0,parent:JL},HL={id:"iterate-over-list-loop-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},YL={id:Do,type:r.Loop,version:1,declaration:Jn,inputs:[WL],successCalls:[],errorCalls:[],outputs:[],process:null,body:qL,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:HL};var So=(n=>(n.EQ="eq",n.NEQ="neq",n.GT="gt",n.GTE="gte",n.LT="lt",n.LTE="lte",n.LIKE="like",n.ILIKE="ilike",n))(So||{}),eE=(n=>(n.COUNT="count",n.SUM="sum",n.AVG="avg",n.MIN="min",n.MAX="max",n))(eE||{});const zL={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:eE.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:So.NEQ,value:null}]},where:[{name:"employee_count",operation:So.GT,value:1}]},ZL={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},XL={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:r.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:r.Search},tE={isError:!1,id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:r.ReturnDeclaration,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,readsValue:null,required:!0,index:0,parent:XL},QL={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:r.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:r.Search},KL={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:r.OutputMap,version:1,declaration:tE,writesValues:[],index:0,parent:QL},e$={id:"find-companies-with-multiple-employees-and-bank-account",type:r.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:[tE],inputs:[],outputs:[KL],query:zL,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:ZL},sr="random-company-employee-test-variable-id",Ao="manager-global-variable-id",nE="global-user-instance-id",or="employee-mapped-dto-variable-id",rE="random-employee-id-output-map-id",iE="random-employee-birth-date-output-map-id",aE="random-employee-department-output-map-id",sE="random-employee-manager-output-map-id",oE="manager-global-id-output-map-id",lE="global-user-instance-id-output-map-id",t$="employee-mapped-dto-requester-id-input-map-id",n$="employee-mapped-dto-id-input-map-id",r$="employee-mapped-dto-birth-date-input-map-id",i$="employee-mapped-dto-department-input-map-id",a$="employee-mapped-dto-manager-input-map-id",s$={type:r.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:oE},o$={type:r.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:or},cE={id:a$,type:r.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:s$,parent:o$},l$={type:r.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:aE},c$={type:r.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:or},dE={id:i$,type:r.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:l$,parent:c$},d$={type:r.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:iE},u$={type:r.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:or},uE={id:r$,type:r.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:d$,parent:u$},p$={type:r.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:rE},y$={type:r.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:or},pE={id:n$,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:p$,parent:y$},h$={type:r.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:lE},f$={type:r.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:or},yE={id:t$,type:r.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,dynamicArguments:[],index:0,readsValue:h$,parent:f$},m$={type:r.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ao},T$={id:oE,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[cE],parent:m$},E$={type:r.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ao},R$={id:"manager-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:E$,defaultValue:null},b$={type:r.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:sE},v$={type:r.GenericReference,id:"manager-variable-parent-ref-id",entityType:r.Project,entityId:q},hE={id:Ao,type:r.VariableDeclaration,version:1,name:"Manager",dataType:R$,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:b$,writesValues:[],inputs:[],outputs:[T$],internalCalls:[],parent:v$,x:0,y:0},g$={type:r.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:sr},I$={id:sE,type:r.OutputMap,version:1,declaration:Rt.properties[2],index:3,writesValues:[hE],parent:g$},P$={type:r.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:sr},D$={id:aE,type:r.OutputMap,version:1,declaration:Rt.properties[0],index:2,writesValues:[dE],parent:P$},S$={type:r.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:sr},A$={id:iE,type:r.OutputMap,version:1,declaration:lt.properties[1],index:1,writesValues:[uE],parent:S$},O$={type:r.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:sr},C$={id:rE,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[pE],parent:O$},B$={type:r.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:sr},w$={id:"random-company-employee-test-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:B$,defaultValue:null},M$={type:r.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:r.Project,entityId:q},_$={id:sr,type:r.VariableDeclaration,version:1,name:"Company employee",dataType:w$,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[C$,A$,D$,I$],internalCalls:[],parent:M$,x:0,y:0},N$={type:r.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:r.Project,entityId:q},V$={id:or,type:r.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[yE,pE,uE,dE,cE],outputs:[],internalCalls:[],parent:N$,x:0,y:0},L$={type:r.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:r.VariableDeclaration,entityId:Ys},$$={id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Zs,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:L$,defaultValue:null},G$={type:r.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:r.Project,entityId:q},fE={id:Ys,type:r.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:$$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:G$},F$={type:r.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:r.VariableInstance,entityId:nE},x$={id:lE,type:r.OutputMap,version:1,declaration:Oe.properties[1],index:0,writesValues:[yE],parent:F$},U$={type:r.GenericReference,id:"global-user-instance-parent-ref-id",entityType:r.Project,entityId:q},j$={id:nE,type:r.VariableInstance,version:1,declaration:fE,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[x$],internalCalls:[],parent:U$,x:0,y:0},k$={type:r.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ys},q$={type:r.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:r.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},J$={id:"is-test-environment-variable-dcl-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:kn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:k$,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:v.Boolean,version:1,value:null,type:r.PrimitiveValue,autogeneration:{type:Le.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:q$}},W$={type:r.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:r.Project,entityId:q},mE={id:"is-test-environment-variable-dcl-id",type:r.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:J$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:W$},H$={type:r.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:r.Project,entityId:q},Y$={id:"is-test-environment-variable-instance-id",type:r.VariableInstance,version:1,declaration:mE,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:H$,x:0,y:0},z$={type:r.Project,id:q,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:[GL],entities:[zs,Zs,lt,zC,Rt,aa,Mf,_f,er,kO,yt,GC,yf,WI,UO],functions:[u1,sm,fo,R1,A1,bm,mo,eo,_L,kf,fV],events:[OB],variableDeclarations:[mE,fE,vo,_$,hE,V$],variableInstances:[Y$,j$],conditions:[],operations:[rr],functionCalls:[Sw,_M],loops:[YL],searches:[e$]};function Ta(n){return n.charAt(0).toUpperCase()+n.slice(1)}function TE(n){return n.charAt(0).toLowerCase()+n.slice(1)}function EE(n,e){if(n.type!==r.Property||e.type!==r.Property)throw new Error(`Expected property entities for comparison. But got ${n.type} and ${e.type}.`);return n===e||n.id===e.id?!0:n.name!==e.name||n.static!==e.static||n.abstract!==e.abstract?!1:Ea(n.dataType,e.dataType).compatible}function RE(n,e){if(n.type!==r.CustomEntity||e.type!==r.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${n.type} and ${e.type}.`);if(n===e||n.id===e.id)return!0;if(n.properties.length!==e.properties.length)return!1;let t=[...e.properties];const i=[];for(let a=0;a<n.properties.length;a++){const s=n.properties[a];t.find(d=>{const p=EE(s,d);return p&&(t=t.filter(y=>y.id!==d.id)),p})||i.push(s)}return!(i.length>0)}var Ot=(n=>(n.BothUnconstrained="both-unconstrained",n.AConstraintBUnconstrained="a-constraint-b-unconstrained",n.BConstraintAUnconstrained="b-constraint-a-unconstrained",n.Same="same",n.AIsListBIsNot="a-is-list-b-is-not",n.BIsListAIsNot="b-is-list-a-is-not",n.AIsNullableBIsNot="a-is-nullable-b-is-not",n.BIsNullableAIsNot="b-is-nullable-a-is-not",n.AIsTemplateBIsNot="a-is-template-b-is-not",n.BIsTemplateAIsNot="b-is-template-a-is-not",n.BothUntyped="both-untyped",n.AIsUntypedBIsNot="a-is-untyped-b-is-not",n.BIsUntypedAIsNot="b-is-untyped-a-is-not",n.TypeEntityMismatch="type-entity-mismatch",n.SameCustomEntities="same-custom-entities",n.CompatibleCustomEntities="compatible-custom-entities",n.IncompatibleCustomEntities="incompatible-custom-entities",n.SamePrimitiveEntities="same-primitive-entities",n.IncompatiblePrimitiveEntities="incompatible-primitive-entities",n.SameBuiltInBaseEntities="same-built-in-base-entities",n.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",n.CheckUnknown="check-unknown",n))(Ot||{});function Ea(n,e){var t,i,a,s,o,d,p,y,f,m,b;if(n&&n.type!==r.DataType||e&&e.type!==r.DataType)throw new Error(`Expected data-type entities for comparison. But got ${n==null?void 0:n.type} and ${e==null?void 0:e.type}.`);if(n===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(n===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(n===e)return{compatible:!0,type:"same"};if(n.id===e.id)return{compatible:!0,type:"same"};if(n.isList!==e.isList)return{compatible:!1,type:n.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(n.isNullable!==e.isNullable)return{compatible:!1,type:n.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(n.asType!==e.asType)return{compatible:!1,type:n.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!n.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(n.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!n.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=n.entity)==null?void 0:t.type)!==((i=e.entity)==null?void 0:i.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=n.entity)==null?void 0:a.type)===r.CustomEntity){if(((s=n.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const P=RE(n.entity,e.entity);return{compatible:P,type:P?"compatible-custom-entities":"incompatible-custom-entities"}}return((d=n.entity)==null?void 0:d.type)===r.PrimitiveEntity?((p=n.entity)==null?void 0:p.id)===((y=e.entity)==null?void 0:y.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((f=n.entity)==null?void 0:f.type)===r.BuiltInBaseEntity?((m=n.entity)==null?void 0:m.id)===((b=e.entity)==null?void 0:b.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function bE(n){const e=n.project.builtInBaseEntities.find(a=>a.id===w.EXECUTION),t={id:n.id+"--infered-data-type",version:1,type:r.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},i=R(t,n.project);return i.inferred=!0,i.sync(t),i.setParent(n),i.entity=e,i}function vE(n){return n.dataType?n.dataType:null}function gE(n){return n.declaration?n.declaration.dataType:n.readsValue?Ra(n.readsValue):null}function IE(n){return n.declaration.dataType}function PE(n){if(n.dataType)return n.dataType;if(n.readsValue)return[r.Operation,r.FunctionCall,r.InternalCall].includes(n.readsValue.type)?bE(n):Ra(n.readsValue);const e={id:n.id+"--infered-entity",type:r.CustomEntity,version:1,name:A(n,n.project),description:n.description,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:null},t=R(e,n.project);t.sync(e);const i=n.inputs.map(s=>{const o=Ra(s),d={id:s.id+"--infered-property",type:r.Property,version:1,name:A(s,n.project),description:s.description,static:!0,abstract:!1,private:!1,required:!1,index:s.index,implements:null,dataType:null,parent:null},p=R(d,n.project);return p.setParent(t),p.dataType=o,p});t.properties=Ev(t.properties,i);const a=R({id:n.id+"--infered-data-type",version:1,type:r.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},n.project);return a.inferred=!0,t.setParent(a),a.entity=t,a.setParent(n),a}function DE(n){return n.declaration?n.declaration.dataType:null}function Ra(n){switch(n.type){case r.VariableDeclaration:return PE(n);case r.ArgumentDeclaration:return vE(n);case r.ReturnDeclaration:return null;case r.VariableInstance:return IE(n);case r.InputMap:return gE(n);case r.OutputMap:return DE(n);default:throw new Error(`Cannot infer data type from entity of type ${n.type}.`)}}function Oo(n){var e;switch(n.type){case r.ArgumentDeclaration:return n.dataType;case r.InputMap:return((e=n.declaration)==null?void 0:e.dataType)||null;case r.VariableDeclaration:return n.dataType;case r.VariableInstance:return n.declaration.dataType;case r.OutputMap:return n.declaration.dataType;case r.ReturnDeclaration:return n.dataType;default:return null}}var T=(n=>(n.Error="error",n.Warning="warning",n))(T||{}),g=(n=>(n.InvalidObjectStructure="invalid-object-structure",n.NameNotUniqueInScope="name-not-unique-in-scope",n.EmptyName="empty-name",n.MissingCaller="missing-caller",n.PropertyOverwrite="property-overwrite",n.MethodOverwrite="method-overwrite",n.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",n.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",n.UnreachableEntity="unreachable-entity",n))(g||{}),h=(n=>(n.RootReference="root-reference",n.ReferencedEntityNotFound="referenced-entity-not-found",n.EntityIdNotUnique="entity-id-not-unique",n.BuiltInEntityGenerated="built-in-entity-generated",n.BuiltInEntityUpdated="built-in-entity-updated",n.BuiltInEntityDeleted="built-in-entity-deleted",n.UnknownEntityType="unknown-entity-type",n.MissingTypeProperty="missing-type-property",n.MissingIdProperty="missing-id-property",n.BuiltInEntityParent="built-in-entity-parent",n.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",n.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",n.RecommendedImplementOperationAction="recommended-implement-operation-action",n.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",n.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",n.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",n.RecommendedImplementConditionAction="recommended-implement-condition-action",n.InvalidReferenceObjectStructure="invalid-reference-object-structure",n.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",n.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",n.InvalidParentReference="invalid-parent-reference",n.InvalidImplementsReference="invalid-implements-reference",n.InvalidExtendsReference="invalid-extends-reference",n.InvalidGenerationActionPayload="invalid-generation-action-payload",n.InvalidReference="invalid-reference",n.InvalidInternalCallParentDeclarationRelation="invalid-internal-call-parent-declaration-relation",n.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",n.InvalidUpdateEntityOperation="invalid-update-entity-operation",n.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",n.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",n.UnrecognizedProperty="unrecognized-property",n.SelfReference="self-reference",n.DuplicateReference="duplicate-reference",n.CallerWithIncompatibleScope="caller-with-incompatible-scope",n.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",n.InvalidInputMapDeclaration="invalid-input-map-declaration",n.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",n.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",n.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",n.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",n.OutputOverwrite="output-overwrite",n.InputOverwrite="input-overwrite",n.IncompatibleScope="incompatible-scope",n.InvalidParentUpdate="invalid-parent-update",n.NonInteractiveEntityReferenced="non-interactive-entity-referenced",n.InvalidParentRelationType="invalid-parent-relation-type",n))(h||{}),_=(n=>(n.ScopeWithoutLogic="scope-without-logic",n.ExtendingAbstractEntity="extending-abstract-entity",n.ImplementingNonAbstractEntity="implementing-non-abstract-entity",n.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",n.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",n.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",n.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",n.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",n.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",n.IncorrectEntityImplementation="incorrect-entity-implementation",n.IncorrectMethodImplementation="incorrect-method-implementation",n.IncorrectPropertyImplementation="incorrect-property-implementation",n.PropertyImplementsNonAbstact="property-implements-non-abstract",n.NonStaticPropertyImplementsStatic="non-static-property-implements-static",n.StaticPropertyImplementsNonStatic="static-property-implements-non-static",n.PropertyImplementsIncompatibleType="property-implements-incompatible-type",n.MissingPropertyImplementation="missing-property-implementation",n.MissingMethodImplementation="missing-method-implementation",n.NoProperties="no-properties",n.ReadingFromIncompatibleType="reading-from-incompatible-type",n.WritingToIncompatibleType="writing-to-incompatible-type",n.InvalidPropertiesCombination="invalid-properties-combination",n.DisconnectedCallableEntity="disconnected-callable-entity",n))(_||{});class E{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(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 g?new lr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class lr{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(this,"code");l(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 lr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function W(n){const e=n.entity.errors.find(i=>i.id===n.id);return e?{new:!1,error:e}:{new:!0,error:new lr(n)}}function z(n,e){const t=[];return e.forEach(i=>{const a=n.find(s=>s.id===i.id);a?t.push(a):t.push(i)}),t}function D(n){if(n){let e=null;return typeof n=="string"?e=n:n.entityId?e=n.entityId:n.type!==r.GenericReference&&(e=n.id),e}return null}function Co(n){return n.declaration||n}function Z$(n){return n.type===r.VariableDeclaration?n.parent===n.project?"global-declaration":"local-declaration":n.declaration.parent===n.project?"global-instance":"local-instance"}function Bo(n,e){const t=[];if(n.type===r.Project)t.push(...n.variableDeclarations);else{const a=Bt(we(n)).filter(s=>s.type===r.VariableDeclaration);t.push(...a),n.parent&&(it.includes(n.parent.type)||n.parent.type===r.Project)&&t.push(...Bo(n.parent))}return t}function X$(n){return n.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,t){return t===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}function Q$(n){return n.split(/\s+/).map(i=>i[0].toUpperCase()+i.slice(1).toLowerCase()).join("")}function SE(n){var e;return(e=n.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 ba(n){return SE(n).toLowerCase()}function On(n,e=!0){if(!(n!=null&&n.dataType))return"Any data type";if(!n.dataType.entity)return n.dataType.isList?"List of an unknown data type":"Unknown data type";if(n.dataType.entity.type===r.PrimitiveEntity){let t=n.dataType.entity.name;switch(n.dataType.entity.name){case v.String:t="Text";break;case v.JSON:t=e?"Any data structure":"Unknown data structure";break;default:t=n.dataType.entity.name;break}return n.dataType.isList?`List of ${t}s`:`${t.slice(0,1).toUpperCase()}${t.slice(1)}`}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function AE(n){return On(n.declaration)}function K$(n){return n.type===r.VariableInstance?AE(n):On(n)}function OE(n){if(!n)return"Any data type";if(!n.entity)return"Inherited";if(n.entity.type===r.PrimitiveEntity){const e=n.entity.name===v.String?"Text":n.entity.name;return n.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.entity.type===r.CustomEntity){const e=Mo(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.entity.type===r.BuiltInBaseEntity){const e=wo(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.isList?`List of ${n.entity.name} entities`:`${n.entity.name.slice(0,1).toUpperCase()+n.entity.name.slice(1)} entity`}function CE(n){if(!n.dataType)return"Any data type";if(!n.dataType.entity)return"Inherited";if(n.dataType.entity.type===r.PrimitiveEntity){const e=n.dataType.entity.name===v.String?"Text":n.dataType.entity.name;return n.dataType.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.dataType.entity.type===r.CustomEntity){const e=Mo(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.dataType.entity.type===r.BuiltInBaseEntity){const e=wo(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function BE(n){switch(n.type){case r.Property:return CE(n);case r.VariableDeclaration:return On(n);case r.ArgumentDeclaration:return On(n,!1);case r.InputMap:{const e=n.declaration;return e?BE(e):"Unknown data type"}case r.ReturnDeclaration:return On(n,!1);case r.OutputMap:{const e=n.declaration;return On(e,!1)}}return"Unknown data type"}function va(n){switch(n.declaration.id){case De.Equal:return"is equal to";case De.NotEqual:return"is not equal to";case De.MoreThan:return"is greater than";case De.MoreThanOrEqual:return"is greater than or equal to";case De.LessThan:return"is less than";case De.LessThanOrEqual:return"is less than or equal to";case De.And:return"and";case De.Or:return"or";case St.Empty:return"is empty";case St.NotEmpty:return"is not empty"}}function wE(n){return n.includes(w.HTTP_ENDPOINT)?"HTTP endpoint":n.includes(w.PERSISTED_ENTITY)?"Persisted entity":n.includes(w.CRON_JOB)?"Scheduled execution":n.includes(w.RELATIONAL_DATABASE)?"Relational database":"Entity"}function wo(n){switch(n.name){case w.HTTP_ENDPOINT:return"HTTP endpoint";case w.PERSISTED_ENTITY:return"Persisted entity";case w.CRON_JOB:return"Scheduled execution";case w.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function Mo(n){const e=pv(n);if(!e){const t=dv(n);return t.includes(w.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(w.PERSISTED_ENTITY)?"Persisted entity":t.includes(w.CRON_JOB)?"Scheduled execution":t.includes(w.RELATIONAL_DATABASE)?"Relational database":A(n,n.project)+" entity"}return A(e,n.project)+" entity"}function ME(n){let e="Find ";return n.outputsDeclarations.forEach((t,i)=>{const a=Oo(t),s=TE(a&&a.entity?A(a.entity,n.project):"unstructured data");i===0?e+=`${s} `:i===n.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function _E(n){switch(n.name){case v.String:return"Text";case v.Number:return"Number";case v.Boolean:return"Boolean";case v.JSON:return"Data structure";case v.UUID:return"Unique identifier";case v.Date:return"Date";case v.EntityTemplate:return"Entity as template";case v.Enum:return"Enumeration";case v.File:return"File";case v.Null:return"Empty";case v.ActionDescriptor:return"Action descriptor";default:return n.name}}function NE(n){switch(n.id){case $e.List:return"Loop over list items";case $e.ManualFlow:return"Manual flow control loop";case $e.ObjectKeys:return"Loop over object keys";case $e.ObjectValues:return"Loop over object values";case $e.Counted:return"Loop given number of times";case $e.String:return"Loop over text characters";case nt.Addition:return"Sum numbers";case nt.Substraction:return"Subtract numbers";case nt.Multiplication:return"Multiply numbers";case nt.Division:return"Divide numbers";case nt.Remainder:return"Get remainder of numbers";case nt.Exponentiation:return"Get exponent of numbers";case be.AddIndex:return"Add at index position";case be.DeleteFirst:return"Delete first character";case be.DeleteLast:return"Delete last character";case be.DeleteIndex:return"Delete at index position";case be.Join:return"Join texts";case be.ReplaceAllMatches:return"Replace all matches";case be.ReplaceFirst:return"Replace first match";case be.ReplaceLast:return"Replace last match";case be.Split:return"Split text";case be.ReplaceIndex:return"Replace at index position";case be.ReplaceSingleMatch:return"Replace single match";case be.GetFirst:return"Get first character";case be.GetLast:return"Get last character";case be.GetIndex:return"Get at index position";case be.Append:return"Add at the end";case be.Prepend:return"Add at the start";case Ie.Wait:return"Wait";case Ie.Parallel:return"Run in parallel";case Ie.Sequential:return"Run in sequence";case qe.HttpRequest:return"HTTP request";case He.CreateNewInstance:return"Create new copy of entity";case U.AddIndex:return"Add item at index position";case U.DeleteFirst:return"Delete first item";case U.DeleteLast:return"Delete last item";case U.DeleteIndex:return"Delete item at index position";case U.Join:return"Join lists";case U.ReplaceAllMatches:return"Replace all matches";case U.ReplaceFirst:return"Replace first match";case U.ReplaceLast:return"Replace last match";case U.Split:return"Split list";case U.ReplaceIndex:return"Replace at index position";case U.ReplaceSingleMatch:return"Replace single match";case U.GetFirst:return"Get first item";case U.GetLast:return"Get last item";case U.GetIndex:return"Get item at index position";case U.Append:return"Add item at the end";case U.Prepend:return"Add item at the start";case Wt.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(n.name.slice(0,1).toUpperCase()+n.name.slice(1)).replaceAll("-"," ")}}function A(n,e){var t;if(r.FunctionDeclaration===n.type){const i=n.name;if(Object.values(Et).includes(i))switch(i){case Et.AbortExecution:return"Abort execution";case Et.DeletePersistedEntity:return"Delete persisted entity";case Et.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Ta(n.type).replaceAll("-"," ")}return i}if(r.BuiltInBaseEntity===n.type)return wE([n.name]);if(Zl.includes(n.type)&&n.type!==r.ActionDescriptor)return n.name;switch(n.type){case r.Search:return ME(n);case r.Operation:case r.InternalCall:case r.Loop:const i=wt(n.declaration,e);return A(i,e);case r.ActionDescriptor:return NE(n);case r.BreakStatement:const a=wt(n.parent,e);return`Stop loop ${A(a,e)}`;case r.ContinueStatement:const s=wt(n.parent,e);return`Execute next iteration of ${A(s,e)}`;case r.FunctionCall:return wt(n.declaration,e).name;case r.Condition:{const d=n;if((t=n.inputs)!=null&&t.length){const p=A(d.inputs[0],d.project);if(d.inputs[1]){const y=d.inputs[1].declaration.name;return`If ${p} ${va(d)} ${y}`}return`If ${p} ${va(d)}`}else return`If ${va(d)}`}case r.ReturnStatement:{const d=wt(n.parent,e);return`Output of ${A(d,e)}`}case r.InputMap:if(n.declaration){const d=wt(n.declaration,e);return A(d,e)||""}else return n.name||"";case r.VariableInstance:{const d=wt(n.declaration,e);return A(d,e)||""}case r.OutputMap:if(n.declaration){const d=wt(n.declaration,e);return(d==null?void 0:d.name)||""}else return"";case r.PrimitiveEntity:case r.PrimitiveValue:return _E(n);default:return Ta(n.type).replaceAll("-"," ")}}function ga(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:g.EmptyName,issue:null}));const i=e.entities.filter(a=>a.name===n.name);return i.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in the project. Entity with id "${i[0].id}" has the same name.
2
+ Please provide a unique 'name' string.`,severity:T.Error,code:g.NameNotUniqueInScope,issue:null})),t}function _o(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:g.EmptyName,issue:null}));const i=n.parent?D(n.parent):null;let a=e;i&&(a=e.get(i));const s=[];a.type===r.CustomEntity?s.push(...a.methods.map(d=>d)):a.type===r.Project?s.push(...a.functions.map(d=>d)):a.type===r.Loop?a.body&&s.push(a.body):a.type===r.InstalledProject&&s.push(...a.functions.map(d=>d));const o=s.filter(d=>d.name===n.name);return o.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in ${a.type===r.Project?"the globally declared project scope":"its parent entity"}. Entity with id "${o[0].id}" has the same name.
3
+ Please provide a unique 'name' string.`,severity:T.Error,code:g.NameNotUniqueInScope,issue:null})),t}function No(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:g.EmptyName,issue:null}));const i=n.parent&&wt(n.parent,e)||e;if(!i)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${n.parent}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const s=Bo(i).filter(o=>o.name===n.name);s.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in its scope or higher scopes. Entity with id "${s[0].id}" has the same name.
4
+ Please provide a unique 'name' string.`,severity:T.Error,code:g.NameNotUniqueInScope,issue:null}))}return t}function Vo(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:g.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=a.properties.filter(d=>d.name===n.name);o.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all properties in the parent entity. Entity with id "${o[0].id}" has the same name.
5
+ Please provide a unique 'name' string.`,severity:T.Error,code:g.NameNotUniqueInScope,issue:null}))}}return t}function Lo(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:g.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=Gl(a).filter(d=>d.name===n.name);o.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
6
+ Please provide a unique 'name' string.`,severity:T.Error,code:g.NameNotUniqueInScope,issue:null}))}}return t}function $o(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${g.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:g.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=Fl(a).filter(d=>d.name===n.name);o.length&&t.push(new E({id:`${n.id}--${g.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all outputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
7
+ Please provide a unique 'name' string.`,severity:T.Error,code:g.NameNotUniqueInScope,issue:null}))}}return t}function eG(n,e){switch(n.type){case r.CustomEntity:return ga(n,e);case r.FunctionDeclaration:return _o(n,e);case r.VariableDeclaration:return No(n,e);case r.Property:return Vo(n,e);case r.ArgumentDeclaration:return Lo(n,e);case r.ReturnDeclaration:return $o(n,e);default:return[]}}const L=ef();function qt(n,e,t){const a=`${ba(n)}-${e}-id`;return t.instances[a]?L.uuid():a}function tG(n,e){let t="",i=null;if(n.parent){const s=e.get(n.parent);s&&(i=s)}let a="";return i&&(a=`${ba(A(i,e))}-`),t=`${a}${ba(A(n,e))}-id`,e.instances[t]?L.uuid():t}function nG(n){return n instanceof Error&&n.name==="ZodError"&&"issues"in n&&Array.isArray(n.issues)}var rG=class extends Error{constructor(e,t){super(e,t);l(this,"name");l(this,"details");this.name="ZodValidationError",this.details=iG(t)}toString(){return this.message}};function iG(n){if(n){const e=n.cause;if(nG(e))return e.issues}return[]}var aG="; ",VE="Validation error",sG=": ",oG=", or ";function lG(n,e,t){return e!==null?n.length>0?[e,n].join(t):e:n.length>0?n:VE}var cG=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function dG(n){return n.length===1?n[0].toString():n.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+uG(t)+'"]';if(!cG.test(t))return e+'["'+t+'"]';const i=e.length===0?"":".";return e+i+t},"")}function uG(n){return n.replace(/"/g,'\\"')}function pG(n){return n.length!==0}function Ia(n){const{issue:e,issueSeparator:t,unionSeparator:i,includePath:a}=n;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const d=o.issues.map(p=>Ia({issue:p,issueSeparator:t,unionSeparator:i,includePath:a})).join(t);return s.includes(d)||s.push(d),s},[]).join(i);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>Ia({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>Ia({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(a&&pG(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 "${dG(e.path)}"`}return e.message}function yG(n,e={}){const{issueSeparator:t=aG,unionSeparator:i=oG,prefixSeparator:a=sG,prefix:s=VE,includePath:o=!0}=e,d=Ia({issue:n,issueSeparator:t,unionSeparator:i,includePath:o}),p=lG(d,s,a);return new rG(p,{cause:new pt([n])})}var LE="1.13.7",$E=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Pa=Array.prototype,Go=Object.prototype,GE=typeof Symbol<"u"?Symbol.prototype:null,hG=Pa.push,Zr=Pa.slice,Xr=Go.toString,fG=Go.hasOwnProperty,FE=typeof ArrayBuffer<"u",mG=typeof DataView<"u",TG=Array.isArray,xE=Object.keys,UE=Object.create,jE=FE&&ArrayBuffer.isView,EG=isNaN,RG=isFinite,kE=!{toString:null}.propertyIsEnumerable("toString"),qE=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],bG=Math.pow(2,53)-1;function ht(n,e){return e=e==null?n.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),i=Array(t),a=0;a<t;a++)i[a]=arguments[a+e];switch(e){case 0:return n.call(this,i);case 1:return n.call(this,arguments[0],i);case 2:return n.call(this,arguments[0],arguments[1],i)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=i,n.apply(this,s)}}function dn(n){var e=typeof n;return e==="function"||e==="object"&&!!n}function vG(n){return n===null}function JE(n){return n===void 0}function WE(n){return n===!0||n===!1||Xr.call(n)==="[object Boolean]"}function gG(n){return!!(n&&n.nodeType===1)}function Ke(n){var e="[object "+n+"]";return function(t){return Xr.call(t)===e}}const Fo=Ke("String"),HE=Ke("Number"),IG=Ke("Date"),PG=Ke("RegExp"),DG=Ke("Error"),YE=Ke("Symbol"),zE=Ke("ArrayBuffer");var ZE=Ke("Function"),SG=$E.document&&$E.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof SG!="function"&&(ZE=function(n){return typeof n=="function"||!1});const dt=ZE,XE=Ke("Object");var QE=mG&&(!/\[native code\]/.test(String(DataView))||XE(new DataView(new ArrayBuffer(8)))),xo=typeof Map<"u"&&XE(new Map),AG=Ke("DataView");function OG(n){return n!=null&&dt(n.getInt8)&&zE(n.buffer)}const Da=QE?OG:AG,Cn=TG||Ke("Array");function un(n,e){return n!=null&&fG.call(n,e)}var Uo=Ke("Arguments");(function(){Uo(arguments)||(Uo=function(n){return un(n,"callee")})})();const jo=Uo;function CG(n){return!YE(n)&&RG(n)&&!isNaN(parseFloat(n))}function KE(n){return HE(n)&&EG(n)}function eR(n){return function(){return n}}function tR(n){return function(e){var t=n(e);return typeof t=="number"&&t>=0&&t<=bG}}function nR(n){return function(e){return e==null?void 0:e[n]}}const Sa=nR("byteLength"),BG=tR(Sa);var wG=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function MG(n){return jE?jE(n)&&!Da(n):BG(n)&&wG.test(Xr.call(n))}const rR=FE?MG:eR(!1),ft=nR("length");function _G(n){for(var e={},t=n.length,i=0;i<t;++i)e[n[i]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,n.push(a)}}}function iR(n,e){e=_G(e);var t=qE.length,i=n.constructor,a=dt(i)&&i.prototype||Go,s="constructor";for(un(n,s)&&!e.contains(s)&&e.push(s);t--;)s=qE[t],s in n&&n[s]!==a[s]&&!e.contains(s)&&e.push(s)}function je(n){if(!dn(n))return[];if(xE)return xE(n);var e=[];for(var t in n)un(n,t)&&e.push(t);return kE&&iR(n,e),e}function aR(n){if(n==null)return!0;var e=ft(n);return typeof e=="number"&&(Cn(n)||Fo(n)||jo(n))?e===0:ft(je(n))===0}function sR(n,e){var t=je(e),i=t.length;if(n==null)return!i;for(var a=Object(n),s=0;s<i;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function Z(n){if(n instanceof Z)return n;if(!(this instanceof Z))return new Z(n);this._wrapped=n}Z.VERSION=LE,Z.prototype.value=function(){return this._wrapped},Z.prototype.valueOf=Z.prototype.toJSON=Z.prototype.value,Z.prototype.toString=function(){return String(this._wrapped)};function oR(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,Sa(n))}var lR="[object DataView]";function ko(n,e,t,i){if(n===e)return n!==0||1/n===1/e;if(n==null||e==null)return!1;if(n!==n)return e!==e;var a=typeof n;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:cR(n,e,t,i)}function cR(n,e,t,i){n instanceof Z&&(n=n._wrapped),e instanceof Z&&(e=e._wrapped);var a=Xr.call(n);if(a!==Xr.call(e))return!1;if(QE&&a=="[object Object]"&&Da(n)){if(!Da(e))return!1;a=lR}switch(a){case"[object RegExp]":case"[object String]":return""+n==""+e;case"[object Number]":return+n!=+n?+e!=+e:+n==0?1/+n===1/e:+n==+e;case"[object Date]":case"[object Boolean]":return+n==+e;case"[object Symbol]":return GE.valueOf.call(n)===GE.valueOf.call(e);case"[object ArrayBuffer]":case lR:return cR(oR(n),oR(e),t,i)}var s=a==="[object Array]";if(!s&&rR(n)){var o=Sa(n);if(o!==Sa(e))return!1;if(n.buffer===e.buffer&&n.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof n!="object"||typeof e!="object")return!1;var d=n.constructor,p=e.constructor;if(d!==p&&!(dt(d)&&d instanceof d&&dt(p)&&p instanceof p)&&"constructor"in n&&"constructor"in e)return!1}t=t||[],i=i||[];for(var y=t.length;y--;)if(t[y]===n)return i[y]===e;if(t.push(n),i.push(e),s){if(y=n.length,y!==e.length)return!1;for(;y--;)if(!ko(n[y],e[y],t,i))return!1}else{var f=je(n),m;if(y=f.length,je(e).length!==y)return!1;for(;y--;)if(m=f[y],!(un(e,m)&&ko(n[m],e[m],t,i)))return!1}return t.pop(),i.pop(),!0}function NG(n,e){return ko(n,e)}function Qr(n){if(!dn(n))return[];var e=[];for(var t in n)e.push(t);return kE&&iR(n,e),e}function qo(n){var e=ft(n);return function(t){if(t==null)return!1;var i=Qr(t);if(ft(i))return!1;for(var a=0;a<e;a++)if(!dt(t[n[a]]))return!1;return n!==pR||!dt(t[Jo])}}var Jo="forEach",dR="has",Wo=["clear","delete"],uR=["get",dR,"set"],VG=Wo.concat(Jo,uR),pR=Wo.concat(uR),LG=["add"].concat(Wo,Jo,dR);const $G=xo?qo(VG):Ke("Map"),GG=xo?qo(pR):Ke("WeakMap"),FG=xo?qo(LG):Ke("Set"),xG=Ke("WeakSet");function cr(n){for(var e=je(n),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=n[e[a]];return i}function UG(n){for(var e=je(n),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=[e[a],n[e[a]]];return i}function yR(n){for(var e={},t=je(n),i=0,a=t.length;i<a;i++)e[n[t[i]]]=t[i];return e}function Ho(n){var e=[];for(var t in n)dt(n[t])&&e.push(t);return e.sort()}function Yo(n,e){return function(t){var i=arguments.length;if(e&&(t=Object(t)),i<2||t==null)return t;for(var a=1;a<i;a++)for(var s=arguments[a],o=n(s),d=o.length,p=0;p<d;p++){var y=o[p];(!e||t[y]===void 0)&&(t[y]=s[y])}return t}}const hR=Yo(Qr),Aa=Yo(je),fR=Yo(Qr,!0);function jG(){return function(){}}function mR(n){if(!dn(n))return{};if(UE)return UE(n);var e=jG();e.prototype=n;var t=new e;return e.prototype=null,t}function kG(n,e){var t=mR(n);return e&&Aa(t,e),t}function qG(n){return dn(n)?Cn(n)?n.slice():hR({},n):n}function JG(n,e){return e(n),n}function TR(n){return Cn(n)?n:[n]}Z.toPath=TR;function Kr(n){return Z.toPath(n)}function zo(n,e){for(var t=e.length,i=0;i<t;i++){if(n==null)return;n=n[e[i]]}return t?n:void 0}function ER(n,e,t){var i=zo(n,Kr(e));return JE(i)?t:i}function WG(n,e){e=Kr(e);for(var t=e.length,i=0;i<t;i++){var a=e[i];if(!un(n,a))return!1;n=n[a]}return!!t}function Zo(n){return n}function ei(n){return n=Aa({},n),function(e){return sR(e,n)}}function Xo(n){return n=Kr(n),function(e){return zo(e,n)}}function ti(n,e,t){if(e===void 0)return n;switch(t??3){case 1:return function(i){return n.call(e,i)};case 3:return function(i,a,s){return n.call(e,i,a,s)};case 4:return function(i,a,s,o){return n.call(e,i,a,s,o)}}return function(){return n.apply(e,arguments)}}function RR(n,e,t){return n==null?Zo:dt(n)?ti(n,e,t):dn(n)&&!Cn(n)?ei(n):Xo(n)}function Qo(n,e){return RR(n,e,1/0)}Z.iteratee=Qo;function mt(n,e,t){return Z.iteratee!==Qo?Z.iteratee(n,e):RR(n,e,t)}function HG(n,e,t){e=mt(e,t);for(var i=je(n),a=i.length,s={},o=0;o<a;o++){var d=i[o];s[d]=e(n[d],d,n)}return s}function bR(){}function YG(n){return n==null?bR:function(e){return ER(n,e)}}function zG(n,e,t){var i=Array(Math.max(0,n));e=ti(e,t,1);for(var a=0;a<n;a++)i[a]=e(a);return i}function Ko(n,e){return e==null&&(e=n,n=0),n+Math.floor(Math.random()*(e-n+1))}const ni=Date.now||function(){return new Date().getTime()};function vR(n){var e=function(s){return n[s]},t="(?:"+je(n).join("|")+")",i=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,i.test(s)?s.replace(a,e):s}}const gR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},ZG=vR(gR),XG=yR(gR),QG=vR(XG),KG=Z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var el=/(.)^/,eF={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},tF=/\\|'|\r|\n|\u2028|\u2029/g;function nF(n){return"\\"+eF[n]}var rF=/^\s*(\w|\$)+\s*$/;function iF(n,e,t){!e&&t&&(e=t),e=fR({},e,Z.templateSettings);var i=RegExp([(e.escape||el).source,(e.interpolate||el).source,(e.evaluate||el).source].join("|")+"|$","g"),a=0,s="__p+='";n.replace(i,function(y,f,m,b,P){return s+=n.slice(a,P).replace(tF,nF),a=P+y.length,f?s+=`'+
8
8
  ((__t=(`+f+`))==null?'':_.escape(__t))+
9
9
  '`:m?s+=`'+
10
10
  ((__t=(`+m+`))==null?'':__t)+
11
11
  '`:b&&(s+=`';
12
12
  `+b+`
13
13
  __p+='`),y}),s+=`';
14
- `;var o=e.variable;if(o){if(!$G.test(o))throw new Error("variable is not a bare identifier: "+o)}else s=`with(obj||{}){
14
+ `;var o=e.variable;if(o){if(!rF.test(o))throw new Error("variable is not a bare identifier: "+o)}else s=`with(obj||{}){
15
15
  `+s+`}
16
16
  `,o="obj";s=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
17
17
  `+s+`return __p;
18
18
  `;var d;try{d=new Function(o,"_",s)}catch(y){throw y.source=s,y}var p=function(y){return d.call(this,y,Z)};return p.source="function("+o+`){
19
- `+s+"}",p}function FG(i,e,t){e=Qr(e);var r=e.length;if(!r)return dt(t)?t.call(i):t;for(var a=0;a<r;a++){var s=i==null?void 0:i[e[a]];s===void 0&&(s=t,a=r),i=dt(s)?s.call(i):s}return i}var xG=0;function UG(i){var e=++xG+"";return i?i+e:e}function jG(i){var e=Z(i);return e._chain=!0,e}function zE(i,e,t,r,a){if(!(r instanceof e))return i.apply(t,a);var s=jE(i.prototype),o=i.apply(s,a);return dn(o)?o:s}var cr=ht(function(i,e){var t=cr.placeholder,r=function(){for(var a=0,s=e.length,o=Array(s),d=0;d<s;d++)o[d]=e[d]===t?arguments[a++]:e[d];for(;a<arguments.length;)o.push(arguments[a++]);return zE(i,r,this,this,o)};return r});cr.placeholder=Z;const ZE=ht(function(i,e,t){if(!dt(i))throw new TypeError("Bind must be called on a function");var r=ht(function(a){return zE(i,r,e,this,t.concat(a))});return r}),vt=AE(ft);function Cn(i,e,t,r){if(r=r||[],!e&&e!==0)e=1/0;else if(e<=0)return r.concat(i);for(var a=r.length,s=0,o=ft(i);s<o;s++){var d=i[s];if(vt(d)&&(On(d)||Ao(d)))if(e>1)Cn(d,e-1,t,r),a=r.length;else for(var p=0,y=d.length;p<y;)r[a++]=d[p++];else t||(r[a++]=d)}return r}const kG=ht(function(i,e){e=Cn(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var r=e[t];i[r]=ZE(i[r],i)}return i});function qG(i,e){var t=function(r){var a=t.cache,s=""+(e?e.apply(this,arguments):r);return un(a,s)||(a[s]=i.apply(this,arguments)),a[s]};return t.cache={},t}const XE=ht(function(i,e,t){return setTimeout(function(){return i.apply(null,t)},e)}),JG=cr(XE,Z,1);function WG(i,e,t){var r,a,s,o,d=0;t||(t={});var p=function(){d=t.leading===!1?0:ti(),r=null,o=i.apply(a,s),r||(a=s=null)},y=function(){var f=ti();!d&&t.leading===!1&&(d=f);var m=e-(f-d);return a=this,s=arguments,m<=0||m>e?(r&&(clearTimeout(r),r=null),d=f,o=i.apply(a,s),r||(a=s=null)):!r&&t.trailing!==!1&&(r=setTimeout(p,m)),o};return y.cancel=function(){clearTimeout(r),d=0,r=a=s=null},y}function HG(i,e,t){var r,a,s,o,d,p=function(){var f=ti()-a;e>f?r=setTimeout(p,e-f):(r=null,t||(o=i.apply(d,s)),r||(s=d=null))},y=ht(function(f){return d=this,s=f,a=ti(),r||(r=setTimeout(p,e),t&&(o=i.apply(d,s))),o});return y.cancel=function(){clearTimeout(r),r=s=d=null},y}function YG(i,e){return cr(e,i)}function xo(i){return function(){return!i.apply(this,arguments)}}function zG(){var i=arguments,e=i.length-1;return function(){for(var t=e,r=i[e].apply(this,arguments);t--;)r=i[t].call(this,r);return r}}function ZG(i,e){return function(){if(--i<1)return e.apply(this,arguments)}}function QE(i,e){var t;return function(){return--i>0&&(t=e.apply(this,arguments)),i<=1&&(e=null),t}}const XG=cr(QE,2);function KE(i,e,t){e=mt(e,t);for(var r=je(i),a,s=0,o=r.length;s<o;s++)if(a=r[s],e(i[a],a,i))return a}function eR(i){return function(e,t,r){t=mt(t,r);for(var a=ft(e),s=i>0?0:a-1;s>=0&&s<a;s+=i)if(t(e[s],s,e))return s;return-1}}const Uo=eR(1),tR=eR(-1);function nR(i,e,t,r){t=mt(t,r,1);for(var a=t(e),s=0,o=ft(i);s<o;){var d=Math.floor((s+o)/2);t(i[d])<a?s=d+1:o=d}return s}function rR(i,e,t){return function(r,a,s){var o=0,d=ft(r);if(typeof s=="number")i>0?o=s>=0?s:Math.max(s+d,o):d=s>=0?Math.min(s+1,d):s+d+1;else if(t&&s&&d)return s=t(r,a),r[s]===a?s:-1;if(a!==a)return s=e(zr.call(r,o,d),DE),s>=0?s+o:-1;for(s=i>0?o:d-1;s>=0&&s<d;s+=i)if(r[s]===a)return s;return-1}}const iR=rR(1,Uo,nR),QG=rR(-1,tR);function jo(i,e,t){var r=vt(i)?Uo:KE,a=r(i,e,t);if(a!==void 0&&a!==-1)return i[a]}function KG(i,e){return jo(i,Kr(e))}function Qt(i,e,t){e=ei(e,t);var r,a;if(vt(i))for(r=0,a=i.length;r<a;r++)e(i[r],r,i);else{var s=je(i);for(r=0,a=s.length;r<a;r++)e(i[s[r]],s[r],i)}return i}function Bn(i,e,t){e=mt(e,t);for(var r=!vt(i)&&je(i),a=(r||i).length,s=Array(a),o=0;o<a;o++){var d=r?r[o]:o;s[o]=e(i[d],d,i)}return s}function aR(i){var e=function(t,r,a,s){var o=!vt(t)&&je(t),d=(o||t).length,p=i>0?0:d-1;for(s||(a=t[o?o[p]:p],p+=i);p>=0&&p<d;p+=i){var y=o?o[p]:p;a=r(a,t[y],y,t)}return a};return function(t,r,a,s){var o=arguments.length>=3;return e(t,ei(r,s,4),a,o)}}const ko=aR(1),sR=aR(-1);function dr(i,e,t){var r=[];return e=mt(e,t),Qt(i,function(a,s,o){e(a,s,o)&&r.push(a)}),r}function eF(i,e,t){return dr(i,xo(mt(e)),t)}function oR(i,e,t){e=mt(e,t);for(var r=!vt(i)&&je(i),a=(r||i).length,s=0;s<a;s++){var o=r?r[s]:s;if(!e(i[o],o,i))return!1}return!0}function lR(i,e,t){e=mt(e,t);for(var r=!vt(i)&&je(i),a=(r||i).length,s=0;s<a;s++){var o=r?r[s]:s;if(e(i[o],o,i))return!0}return!1}function Kt(i,e,t,r){return vt(i)||(i=lr(i)),(typeof t!="number"||r)&&(t=0),iR(i,e,t)>=0}const tF=ht(function(i,e,t){var r,a;return dt(e)?a=e:(e=Qr(e),r=e.slice(0,-1),e=e[e.length-1]),Bn(i,function(s){var o=a;if(!o){if(r&&r.length&&(s=No(s,r)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function qo(i,e){return Bn(i,Lo(e))}function nF(i,e){return dr(i,Kr(e))}function cR(i,e,t){var r=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof i[0]!="object"&&i!=null){i=vt(i)?i:lr(i);for(var d=0,p=i.length;d<p;d++)s=i[d],s!=null&&s>r&&(r=s)}else e=mt(e,t),Qt(i,function(y,f,m){o=e(y,f,m),(o>a||o===-1/0&&r===-1/0)&&(r=y,a=o)});return r}function rF(i,e,t){var r=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof i[0]!="object"&&i!=null){i=vt(i)?i:lr(i);for(var d=0,p=i.length;d<p;d++)s=i[d],s!=null&&s<r&&(r=s)}else e=mt(e,t),Qt(i,function(y,f,m){o=e(y,f,m),(o<a||o===1/0&&r===1/0)&&(r=y,a=o)});return r}var iF=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function dR(i){return i?On(i)?zr.call(i):Po(i)?i.match(iF):vt(i)?Bn(i,Vo):lr(i):[]}function uR(i,e,t){if(e==null||t)return vt(i)||(i=lr(i)),i[Go(i.length-1)];var r=dR(i),a=ft(r);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var d=Go(o,s),p=r[o];r[o]=r[d],r[d]=p}return r.slice(0,e)}function aF(i){return uR(i,1/0)}function sF(i,e,t){var r=0;return e=mt(e,t),qo(Bn(i,function(a,s,o){return{value:a,index:r++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,d=s.criteria;if(o!==d){if(o>d||o===void 0)return 1;if(o<d||d===void 0)return-1}return a.index-s.index}),"value")}function va(i,e){return function(t,r,a){var s=e?[[],[]]:{};return r=mt(r,a),Qt(t,function(o,d){var p=r(o,d,t);i(s,o,p)}),s}}const oF=va(function(i,e,t){un(i,t)?i[t].push(e):i[t]=[e]}),lF=va(function(i,e,t){i[t]=e}),cF=va(function(i,e,t){un(i,t)?i[t]++:i[t]=1}),dF=va(function(i,e,t){i[t?0:1].push(e)},!0);function uF(i){return i==null?0:vt(i)?i.length:je(i).length}function pF(i,e,t){return e in t}const pR=ht(function(i,e){var t={},r=e[0];if(i==null)return t;dt(r)?(e.length>1&&(r=ei(r,e[1])),e=Xr(i)):(r=pF,e=Cn(e,!1,!1),i=Object(i));for(var a=0,s=e.length;a<s;a++){var o=e[a],d=i[o];r(d,o,i)&&(t[o]=d)}return t}),yF=ht(function(i,e){var t=e[0],r;return dt(t)?(t=xo(t),e.length>1&&(r=e[1])):(e=Bn(Cn(e,!1,!1),String),t=function(a,s){return!Kt(e,s)}),pR(i,t,r)});function yR(i,e,t){return zr.call(i,0,Math.max(0,i.length-(e==null||t?1:e)))}function Jo(i,e,t){return i==null||i.length<1?e==null||t?void 0:[]:e==null||t?i[0]:yR(i,i.length-e)}function ga(i,e,t){return zr.call(i,e==null||t?1:e)}function hF(i,e,t){return i==null||i.length<1?e==null||t?void 0:[]:e==null||t?i[i.length-1]:ga(i,Math.max(0,i.length-e))}function fF(i){return dr(i,Boolean)}function mF(i,e){return Cn(i,e,!1)}const hR=ht(function(i,e){return e=Cn(e,!0,!0),dr(i,function(t){return!Kt(e,t)})}),TF=ht(function(i,e){return hR(i,e)});function Wo(i,e,t,r){EE(e)||(r=t,t=e,e=!1),t!=null&&(t=mt(t,r));for(var a=[],s=[],o=0,d=ft(i);o<d;o++){var p=i[o],y=t?t(p,o,i):p;e&&!t?((!o||s!==y)&&a.push(p),s=y):t?Kt(s,y)||(s.push(y),a.push(p)):Kt(a,p)||a.push(p)}return a}const EF=ht(function(i){return Wo(Cn(i,!0,!0))});function RF(i){for(var e=[],t=arguments.length,r=0,a=ft(i);r<a;r++){var s=i[r];if(!Kt(e,s)){var o;for(o=1;o<t&&Kt(arguments[o],s);o++);o===t&&e.push(s)}}return e}function Ho(i){for(var e=i&&cR(i,ft).length||0,t=Array(e),r=0;r<e;r++)t[r]=qo(i,r);return t}const bF=ht(Ho);function vF(i,e){for(var t={},r=0,a=ft(i);r<a;r++)e?t[i[r]]=e[r]:t[i[r][0]]=i[r][1];return t}function gF(i,e,t){e==null&&(e=i||0,i=0),t||(t=e<i?-1:1);for(var r=Math.max(Math.ceil((e-i)/t),0),a=Array(r),s=0;s<r;s++,i+=t)a[s]=i;return a}function IF(i,e){if(e==null||e<1)return[];for(var t=[],r=0,a=i.length;r<a;)t.push(zr.call(i,r,r+=e));return t}function Yo(i,e){return i._chain?Z(e).chain():e}function fR(i){return Qt(Mo(i),function(e){var t=Z[e]=i[e];Z.prototype[e]=function(){var r=[this._wrapped];return Y$.apply(r,arguments),Yo(this,t.apply(Z,r))}}),Z}Qt(["pop","push","reverse","shift","sort","splice","unshift"],function(i){var e=Ta[i];Z.prototype[i]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(i==="shift"||i==="splice")&&t.length===0&&delete t[0]),Yo(this,t)}}),Qt(["concat","join","slice"],function(i){var e=Ta[i];Z.prototype[i]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),Yo(this,t)}});var mR=fR(Object.freeze(Object.defineProperty({__proto__:null,VERSION:lE,after:ZG,all:oR,allKeys:Xr,any:lR,assign:ba,before:QE,bind:ZE,bindAll:kG,chain:jG,chunk:IF,clone:PG,collect:Bn,compact:fF,compose:zG,constant:SE,contains:Kt,countBy:cF,create:IG,debounce:HG,default:Z,defaults:UE,defer:JG,delay:XE,detect:jo,difference:hR,drop:ga,each:Qt,escape:BG,every:oR,extend:xE,extendOwn:ba,filter:dr,find:jo,findIndex:Uo,findKey:KE,findLastIndex:tR,findWhere:KG,first:Jo,flatten:mF,foldl:ko,foldr:sR,forEach:Qt,functions:Mo,get:qE,groupBy:oF,has:SG,head:Jo,identity:Vo,include:Kt,includes:Kt,indexBy:lF,indexOf:iR,initial:yR,inject:ko,intersection:RF,invert:FE,invoke:tF,isArguments:Ao,isArray:On,isArrayBuffer:vE,isBoolean:EE,isDataView:Ea,isDate:rG,isElement:nG,isEmpty:wE,isEqual:hG,isError:aG,isFinite:cG,isFunction:dt,isMap:TG,isMatch:ME,isNaN:DE,isNull:tG,isNumber:RE,isObject:dn,isRegExp:iG,isSet:RG,isString:Po,isSymbol:bE,isTypedArray:CE,isUndefined:TE,isWeakMap:EG,isWeakSet:bG,iteratee:$o,keys:je,last:hF,lastIndexOf:QG,map:Bn,mapObject:AG,matcher:Kr,matches:Kr,max:cR,memoize:qG,methods:Mo,min:rF,mixin:fR,negate:xo,noop:WE,now:ti,object:vF,omit:yF,once:XG,pairs:vG,partial:cr,partition:dF,pick:pR,pluck:qo,property:Lo,propertyOf:OG,random:Go,range:gF,reduce:ko,reduceRight:sR,reject:eF,rest:ga,restArguments:ht,result:FG,sample:uR,select:dr,shuffle:aF,size:uF,some:lR,sortBy:sF,sortedIndex:nR,tail:ga,take:Jo,tap:DG,template:GG,templateSettings:_G,throttle:WG,times:CG,toArray:dR,toPath:kE,transpose:Ho,unescape:MG,union:EF,uniq:Wo,unique:Wo,uniqueId:UG,unzip:Ho,values:lr,where:nF,without:TF,wrap:YG,zip:bF},Symbol.toStringTag,{value:"Module"})));mR._=mR;const Ia=c.union([c.string(),c.number(),c.boolean(),c.date()]),PF=c.enum([Le.CurrentDateAndTime,Le.Random,Le.Unique]),zo=c.object({type:PF,rangeStart:Ia.nullable(),rangeEnd:Ia.nullable()}),Pa=zo.extend({type:c.literal(Le.Random),rangeStart:Ia,rangeEnd:Ia}),TR=zo.extend({type:c.literal(Le.Unique),rangeStart:c.null(),rangeEnd:c.null()}),DF=zo.extend({type:c.literal(Le.CurrentDateAndTime),rangeStart:c.null(),rangeEnd:c.null()}),Zo=Pa.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),SF=Zo.extend({rangeStart:c.number(),rangeEnd:c.null()}),AF=Zo.extend({rangeStart:c.null(),rangeEnd:c.number()}),OF=Zo.extend({rangeStart:c.number(),rangeEnd:c.number()}),Xo=Pa.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),CF=Xo.extend({rangeStart:c.number(),rangeEnd:c.null()}),BF=Xo.extend({rangeStart:c.null(),rangeEnd:c.number()}),wF=Xo.extend({rangeStart:c.number(),rangeEnd:c.number()}),Qo=Pa.extend({rangeStart:c.date().nullable(),rangeEnd:c.date().nullable()}),MF=Qo.extend({rangeStart:c.date(),rangeEnd:c.null()}),_F=Qo.extend({rangeStart:c.null(),rangeEnd:c.date()}),NF=Qo.extend({rangeStart:c.date(),rangeEnd:c.date()}),ER=Pa.extend({rangeStart:c.null(),rangeEnd:c.null()}),RR=c.union([CF,BF,wF]),bR=c.union([SF,AF,OF]),vR=c.union([MF,_F,NF,DF]),gR=c.union([RR,bR,vR,TR,ER]);function IR(){return c.union([c.object({type:c.literal(n.ValueDescriptor)}),c.record(c.string(),c.any())])}function VF(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.ValueDescriptor)})}function PR(){return c.object({id:c.string(),type:c.literal(n.ValueDescriptor),name:c.string(),required:c.boolean()})}function LF(){return PR().merge(c.object({version:c.number(),index:c.number()}))}function $F(){return PR().merge(c.object({}))}function GF(){return c.object({dataType:pn(),parent:pr()})}function FF(){return LF().merge(GF())}function Ko(){return c.union([c.object({type:c.literal(n.PrimitiveEntity)}),c.record(c.string(),c.any())])}function el(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.PrimitiveEntity)})}function DR(){return c.object({id:c.string(),type:c.literal(n.PrimitiveEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function xF(){return DR().merge(c.object({version:c.number()}))}function UF(){return DR().merge(c.object({}))}function jF(){return c.object({properties:c.array(ur()),methods:c.array(qt()),abstractMethods:c.array(wn()),extends:c.array(c.union([Ko(),ni()]))})}function kF(){return xF().merge(jF())}function ur(){return c.union([c.object({type:c.literal(n.Property)}),c.record(c.string(),c.any())])}function qF(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.Property)})}function SR(){return c.object({id:c.string(),type:c.literal(n.Property),name:c.string(),description:c.string().nullable(),private:c.boolean(),static:c.boolean(),required:c.boolean(),abstract:c.boolean()})}function JF(){return SR().merge(c.object({version:c.number(),index:c.number()}))}function WF(){return SR().merge(c.object({}))}function HF(){return c.object({dataType:pn(),implements:ur().nullable(),parent:c.union([ai(),el(),tl()])})}function YF(){return JF().merge(HF())}function zF(){return c.enum([M.CRON_JOB,M.EXECUTION,M.HTTP_ENDPOINT,M.PERSISTED_ENTITY,M.RELATIONAL_DATABASE])}function ni(){return c.union([c.object({type:c.literal(n.BuiltInBaseEntity)}),c.record(c.string(),c.any())])}function tl(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.BuiltInBaseEntity)})}function AR(){return c.object({id:c.string(),version:c.number(),type:c.literal(n.BuiltInBaseEntity),name:zF(),description:c.string().nullable(),abstract:c.boolean(),static:c.boolean()})}function ZF(){return AR()}function XF(){return AR().merge(c.object({}))}function QF(){return c.object({properties:c.array(ur()),methods:c.array(qt()),abstractMethods:c.array(wn()),extends:c.array(c.union([ni(),Ko()]))})}function KF(){return ZF().merge(QF())}function OR(){return c.enum([V.Dynamic,V.Fixed,V.None])}function wn(){return c.union([c.object({type:c.literal(n.ActionDescriptor)}),c.record(c.string(),c.any())])}function pr(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.ActionDescriptor)})}function CR(){return c.object({id:c.string(),type:c.literal(n.ActionDescriptor),name:c.string(),description:c.string().nullable(),argumentsType:OR(),returnsType:OR()})}function ex(){return CR().merge(c.object({version:c.number()}))}function tx(){return CR().merge(c.object({}))}function nx(){return c.object({fixedArguments:c.array(IR()),fixedReturns:c.array(IR()),dynamicArgumentTypes:pn().nullable(),dynamicReturnTypes:pn().nullable(),parent:c.union([Pt(),ai(),tl(),el()]).nullable()})}function BR(){return ex().merge(nx())}function rx(){return c.union([c.object({type:c.literal(n.Loop)}),c.record(c.string(),c.any())])}function Mn(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.Loop)})}function wR(){return c.object({id:c.string(),type:c.literal(n.Loop)})}function ix(){return wR().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function ax(){return wR().merge(c.object({declaration:c.union([c.string(),qt()])}))}function sx(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),declaration:wn(),inputs:c.array(Ot()),outputs:c.array(gt()),successCalls:c.array(We()),errorCalls:c.array(We()),error:gt(),body:qt(),parent:c.union([yn(),Pt()]),breakStatements:c.array(Ax()),continueStatements:c.array(lx())})}function ox(){return ix().merge(sx())}function lx(){return c.union([c.object({type:c.literal(n.ContinueStatement)}),c.record(c.string(),c.any())])}function MR(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.ContinueStatement)})}function _R(){return c.object({id:c.string(),type:c.literal(n.ContinueStatement)})}function cx(){return _R().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function dx(){return _R().merge(c.object({}))}function ux(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),outputs:c.array(en()),throws:c.optional(en()),parent:Mn()})}function px(){return cx().merge(ux())}function NR(){return c.union([c.object({type:c.literal(n.ReturnStatement)}),c.record(c.string(),c.any())])}function VR(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.ReturnStatement)})}function LR(){return c.object({id:c.string(),type:c.literal(n.ReturnStatement)})}function yx(){return LR().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function hx(){return LR().merge(c.object({}))}function fx(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),outputs:c.array(en()),throws:c.optional(en()),parent:yn()})}function mx(){return yx().merge(fx())}function Tx(){return c.union([c.object({type:c.literal(n.Search)}),c.record(c.string(),c.any())])}function nl(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.Search)})}function $R(){return c.object({id:c.string(),type:c.literal(n.Search),name:c.string(),query:c.any(),description:c.string().nullable()})}function Ex(){return $R().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Rx(){return $R().merge(c.object({}))}function bx(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),inputsDeclarations:c.array(ii()),inputs:c.array(Ot()),outputsDeclarations:c.array(en()),outputs:c.array(gt()),parent:c.union([yn(),Pt()]),error:gt().nullable()})}function vx(){return Ex().merge(bx())}function en(){return c.union([c.object({type:c.literal(n.ReturnDeclaration)}),c.record(c.string(),c.any())])}function gx(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.ReturnDeclaration)})}function GR(){return c.object({id:c.string(),type:c.literal(n.ReturnDeclaration),name:c.string(),description:c.string().nullable(),isError:c.boolean()})}function Ix(){return GR().merge(c.object({version:c.number(),index:c.number()}))}function Px(){return GR().merge(c.object({}))}function Dx(){return c.object({dataType:pn().nullable(),readsValue:Sa().nullable(),parent:c.union([VR(),pr(),pr(),nl(),ri(),MR()])})}function Sx(){return Ix().merge(Dx())}function Ax(){return c.union([c.object({type:c.literal(n.BreakStatement)}),c.record(c.string(),c.any())])}function ri(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.BreakStatement)})}function FR(){return c.object({id:c.string(),type:c.literal(n.BreakStatement)})}function Ox(){return FR().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Cx(){return FR().merge(c.object({}))}function Bx(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),outputs:c.array(en()),throws:c.optional(en()),parent:Mn()})}function wx(){return Ox().merge(Bx())}function gt(){return c.union([c.object({type:c.literal(n.OutputMap)}),c.record(c.string(),c.any())])}function Mx(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.OutputMap)})}function xR(){return c.object({id:c.string(),type:c.literal(n.OutputMap)})}function _x(){return xR().merge(c.object({version:c.number(),index:c.number()}))}function Nx(){return xR().merge(c.object({}))}function Vx(){return c.object({writesValues:c.array(_n()),declaration:c.union([en(),ur()]),parent:c.union([Se(),Mn(),ri()])})}function Lx(){return _x().merge(Vx())}function UR(){return c.union([c.object({type:c.literal(n.FunctionCall)}),c.record(c.string(),c.any())])}function $x(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.FunctionCall)})}function jR(){return c.object({id:c.string(),type:c.literal(n.FunctionCall)})}function Gx(){return jR().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Fx(){return jR().merge(c.object({}))}function xx(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),writesValues:c.array(_n()),declaration:qt(),inputs:c.array(Ot()),outputs:c.array(gt()),error:c.optional(gt()),parent:c.union([yn(),Pt()])})}function Ux(){return Gx().merge(xx())}function jx(){return c.enum([De.Equal,De.NotEqual,De.MoreThan,De.MoreThanOrEqual,De.LessThan,De.LessThanOrEqual,De.And,De.Or,St.Empty,St.NotEmpty])}function kx(){return c.union([c.object({type:c.literal(n.Condition)}),c.record(c.string(),c.any())])}function qx(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.Condition)})}function kR(){return c.object({id:c.string(),type:c.literal(n.Condition)})}function Jx(){return kR().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Wx(){return kR().merge(c.object({}))}function Hx(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),leftValue:Ot(),rightValue:Ot().nullable(),operator:jx(),parent:c.union([yn(),Pt()])})}function Yx(){return Jx().merge(Hx())}function rl(){return c.union([c.object({type:c.literal(n.InternalCall)}),c.record(c.string(),c.any())])}function zx(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.InternalCall)})}function qR(){return c.object({id:c.string(),type:c.literal(n.InternalCall),index:c.number()})}function Zx(){return qR().merge(c.object({version:c.number(),index:c.number()}))}function Xx(){return qR().merge(c.object({declaration:c.union([c.string(),qt()])}))}function Qx(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),writesValues:c.array(_n()),declaration:qt(),inputs:c.array(Ot()),outputs:c.array(gt()),parent:cl(),error:c.optional(gt())})}function Kx(){return Zx().merge(Qx())}function Ot(){return c.union([c.object({type:c.literal(n.InputMap)}),c.record(c.string(),c.any())])}function il(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.InputMap)})}function JR(){return c.object({id:c.string(),type:c.literal(n.InputMap),name:c.string().nullable().optional(),description:c.string().nullable().optional()})}function e4(){return JR().merge(c.object({version:c.number(),index:c.number()}))}function t4(){return JR().merge(c.object({}))}function n4(){return c.object({defaultValue:sl().nullable(),declaration:c.union([ii(),ur()]).nullable(),readsValue:Sa().nullable(),parent:c.union([Se(),il(),Mn(),ri()]),dynamicArguments:c.array(Ot())})}function r4(){return e4().merge(n4())}function WR(){return c.union([c.object({type:c.literal(n.Operation)}),c.record(c.string(),c.any())])}function HR(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.Operation)})}function al(){return c.object({id:c.string(),type:c.literal(n.Operation)})}function i4(){return al().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function a4(){return al().merge(c.object({}))}function s4(){return al().merge(c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),writesValues:c.array(_n()),declaration:wn(),inputs:c.array(Ot()),outputs:c.array(gt()),error:c.array(gt()),dynamicArguments:c.array(Ot()),parent:c.union([yn(),Pt()])}))}function o4(){return i4().merge(s4())}function Da(){return c.union([c.string(),c.number(),c.boolean(),c.null(),c.date()])}function YR(){return c.record(c.string(),Da())}function l4(){return c.array(c.union([Da(),YR()]))}function zR(){return c.union([Da(),YR(),l4()])}function ZR(){return c.union([Da(),zR()])}function XR(){return c.enum([g.String,g.Number,g.Boolean,g.Null,g.Date,g.JSON,g.Enum,g.File,g.UUID,g.EntityTemplate,g.ActionDescriptor])}function c4(){return c.union([ai(),HR(),dl()])}function d4(){return c.object({id:c.string(),name:XR(),type:c.literal(n.PrimitiveValue),value:ZR(),autogeneration:gR.nullable()})}function u4(){return d4().merge(c.object({}))}function Lt(){return c.object({id:c.string(),version:c.number(),name:XR(),type:c.literal(n.PrimitiveValue),value:ZR(),valueAsType:c4().nullable(),autogeneration:gR.nullable(),parent:c.union([QR(),il()])})}function p4(){return Lt().extend({name:c.literal(g.String),value:c.string(),autogeneration:RR.nullable()})}function y4(){return Lt().extend({name:c.literal(g.Number),value:c.number(),autogeneration:bR.nullable()})}function h4(){return Lt().extend({name:c.literal(g.Boolean),value:c.boolean(),autogeneration:ER.nullable()})}function f4(){return Lt().extend({name:c.literal(g.Null),value:c.null(),autogeneration:c.null()})}function m4(){return Lt().extend({name:c.literal(g.Date),value:c.date(),autogeneration:vR.nullable()})}function T4(){return Lt().extend({name:c.literal(g.JSON),value:zR(),autogeneration:c.null()})}function E4(){return Lt().extend({name:c.literal(g.Enum),value:c.string(),autogeneration:c.null()})}function R4(){return Lt().extend({name:c.literal(g.File),value:c.string(),autogeneration:c.null()})}function b4(){return Lt().extend({name:c.literal(g.UUID),value:c.string(),autogeneration:TR.nullable()})}function v4(){return Lt().extend({name:c.literal(g.EntityTemplate),value:ai(),autogeneration:c.null()})}function g4(){return Lt().extend({name:c.literal(g.ActionDescriptor),value:dl(),autogeneration:c.null()})}function sl(){return c.union([p4(),y4(),h4(),f4(),m4(),T4(),E4(),R4(),b4(),v4(),g4()])}function pn(){return c.union([c.object({type:c.literal(n.DataType)}),c.record(c.string(),c.any())])}function QR(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.DataType)})}function KR(){return c.object({id:c.string(),type:c.literal(n.DataType),isNullable:c.boolean(),isList:c.boolean(),constant:c.boolean(),asType:c.boolean(),options:c.array(c.string()).optional()})}function I4(){return KR().merge(c.object({version:c.number()}))}function P4(){return KR().merge(c.object({}))}function D4(){return c.object({defaultValue:sl().nullable(),entity:c.union([Aa(),ni(),Ko(),wn()]).nullable(),parent:c.union([qF(),Y4(),pr(),VF()])})}function S4(){return I4().merge(D4())}function ol(){return c.union([c.object({type:c.literal(n.VariableDeclaration)}),c.record(c.string(),c.any())])}function A4(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.VariableDeclaration)})}function eb(){return c.object({id:c.string(),type:c.literal(n.VariableDeclaration),name:c.string(),description:c.string().nullable()})}function O4(){return eb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function C4(){return eb().merge(c.object({}))}function B4(){return c.object({dataType:pn().nullable(),readsValue:Sa().nullable(),writesValues:c.array(_n()),inputs:c.array(Ot()),outputs:c.array(gt()),successCalls:c.array(We()),errorCalls:c.array(We()),internalCalls:c.array(rl()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),parent:c.union([yn(),Pt()])})}function w4(){return O4().merge(B4())}function tb(){return c.union([c.object({type:c.literal(n.VariableInstance)}),c.record(c.string(),c.any())])}function M4(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.VariableInstance)})}function nb(){return c.object({id:c.string(),type:c.literal(n.VariableInstance)})}function _4(){return nb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function N4(){return nb().merge(c.object({}))}function V4(){return c.object({declaration:ol(),dataType:pn().nullable(),readsValue:Sa().nullable(),writesValues:c.array(_n()),inputs:c.array(Ot()),outputs:c.array(gt()),successCalls:c.array(We()),errorCalls:c.array(We()),internalCalls:c.array(rl()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),parent:c.union([yn(),Pt()])})}function L4(){return _4().merge(V4())}function $4(){return c.union([c.object({type:c.literal(n.InstalledProject)}),c.record(c.string(),c.any())])}function rb(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.InstalledProject)})}function G4(){return c.object({version:c.number(),x:c.number(),y:c.number()})}function F4(){return c.object({})}function x4(){return c.object({implements:Pt(),description:c.string().nullable(),functions:c.array(qt()),events:c.array(ib()),parent:Pt()})}function U4(){return G4().merge(x4())}function ib(){return c.union([c.object({type:c.literal(n.GlobalEvent)}),c.record(c.string(),c.any())])}function j4(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.GlobalEvent)})}function ll(){return c.object({id:c.string(),type:c.literal(n.GlobalEvent),name:c.string(),collapsed:c.boolean()})}function k4(){return ll().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function q4(){return ll().merge(c.object({}))}function J4(){return ll().merge(c.object({returnStatements:c.array(NR()),implements:c.array(BR()),inputs:c.array(ii()),calls:c.array(We()),parent:c.union([Pt(),rb()])}))}function W4(){return k4().merge(J4())}function ab(){return c.union([ol(),tb()])}function cl(){return c.union([A4(),M4()])}function _n(){return c.union([ab(),Ot(),en()])}function H4(){return c.union([cl(),il(),gx()])}function Sa(){return c.union([ab(),ii(),gt(),WR(),rl(),UR()])}function Y4(){return c.union([Z4(),Mx(),H4()])}function z4(){return j4()}function Se(){return c.union([HR(),$x(),qx(),nl(),cl(),zx(),Mn()])}function We(){return c.union([Se(),VR(),ri(),MR()])}function It(){return c.union([dl(),z4()])}function yn(){return c.union([It(),Mn()])}function ii(){return c.union([c.object({type:c.literal(n.ArgumentDeclaration)}),c.record(c.string(),c.any())])}function Z4(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.ArgumentDeclaration)})}function sb(){return c.object({id:c.string(),type:c.literal(n.ArgumentDeclaration)})}function X4(){return sb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Q4(){return sb().merge(c.object({}))}function K4(){return c.object({dataType:pn().nullable(),writesValues:c.array(_n()),parent:c.union([It(),pr(),pr(),nl(),ri()])})}function eU(){return X4().merge(K4())}function qt(){return c.union([c.object({type:c.literal(n.FunctionDeclaration)}),c.record(c.string(),c.any())])}function dl(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.FunctionDeclaration)})}function ob(){return c.object({id:c.string(),type:c.literal(n.FunctionDeclaration),name:c.string(),description:c.string().nullable()})}function tU(){return ob().merge(c.object({version:c.number(),x:c.number(),y:c.number(),index:c.number().nullable()}))}function nU(){return ob()}function rU(){return c.object({inputs:c.array(ii()),implements:wn().nullable(),returnStatements:c.array(NR()),parent:c.union([Pt(),rb(),ai(),Mn(),tl(),el()])})}function iU(){return tU().merge(rU())}function Pt(){return c.object({entityType:c.literal(n.Project),entityId:c.string(),id:c.string(),type:c.literal(n.GenericReference)})}function lb(){return c.object({id:c.string(),type:c.literal(n.Project),name:c.string(),description:c.string().nullable()})}function aU(){return lb().merge(c.object({version:c.number()}))}function sU(){return lb()}function oU(){return c.object({entities:c.array(Aa()),functions:c.array(qt()),events:c.array(ib()),projects:c.array($4()),variableDeclarations:c.array(ol()),variableInstances:c.array(tb()),conditions:c.array(kx()),operations:c.array(WR()),functionCalls:c.array(UR()),loops:c.array(rx()),searches:c.array(Tx())})}function lU(){return aU().merge(oU())}function Aa(){return c.union([c.object({type:c.literal(n.CustomEntity)}),c.record(c.string(),c.any())])}function ai(){return c.object({id:c.string(),type:c.literal(n.GenericReference),entityId:c.string(),entityType:c.literal(n.CustomEntity)})}function cb(){return c.object({id:c.string(),type:c.literal(n.CustomEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function cU(){return cb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function dU(){return cb().merge(c.object({}))}function uU(){return c.union([Pt(),QR()])}function pU(){return c.object({properties:c.array(ur()),methods:c.array(qt()),abstractMethods:c.array(wn()),extends:c.array(c.union([Aa(),ni()])),implements:c.array(c.union([Aa(),ni()])),parent:uU()})}function yU(){return cU().merge(pU())}function hU(i){const e=yU(),t=i.toJSON();e.safeParse(t).success;const a=i.implements.flatMap(f=>TU(i,f)),s=i.extends.flatMap(f=>EU(i,f)),o=bU(i),d=RU(i);i.methods.flatMap(f=>f.validate());const p=[...a,...s,...o,...d];return z(i.errors,p)}function fU(i,e){const t=e.properties.filter(s=>s.abstract),r=[];let a=[...i.properties];return t.forEach(s=>{const o=a.find(d=>{var p;return((p=d.implements)==null?void 0:p.id)===s.id});o?a=a.filter(d=>d.id!==o.id):r.push(s)}),r}function mU(i,e){const t=e.abstractMethods,r=[];let a=[...i.methods];return t.forEach(s=>{const o=a.find(d=>{var p;return((p=d.implements)==null?void 0:p.id)===s.id});o?a=a.filter(d=>d.id!==o.id):r.push(s)}),r}function TU(i,e){const t=[];if(!e.abstract){const f=W({id:i.id+"--"+_.ImplementingNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:_.ImplementingNonAbstractEntity,entity:i});return t.push(f.error),t}const r=e.properties.filter(f=>f.abstract),a=[];let s=[...i.properties];r.forEach(f=>{const m=s.find(b=>{var P;return((P=b.implements)==null?void 0:P.id)===f.id});m?s=s.filter(b=>b.id!==m.id):a.push(f)}),a.length&&a.forEach(f=>{const m=W({id:i.id+"--"+_.MissingPropertyImplementation+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${i.name}" with id "${i.id}" implements it`,issue:null,severity:T.Error,code:_.MissingPropertyImplementation,entity:i});t.push(m.error)});const o=[];let d=[...i.methods];e.abstractMethods.forEach(f=>{const m=d.find(b=>{var P;return((P=b.implements)==null?void 0:P.id)===f.id});m?d=d.filter(b=>b.id!==m.id):o.push(f)}),o.length&&o.forEach(f=>{const m=W({id:i.id+"--"+_.MissingMethodImplementation+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${i.name}" with id "${i.id}" implements it`,issue:null,severity:T.Error,code:_.MissingMethodImplementation,entity:i});t.push(m.error)});const p=[];e.properties.forEach(f=>{const m=s.find(b=>b.name===f.name);m&&p.push([m,f])}),p.length&&p.forEach(([f])=>{const m=W({id:i.id+"--"+v.PropertyOverwrite+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${i.name}" with id "${i.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:v.PropertyOverwrite,entity:i});t.push(m.error)});const y=[];return e.methods.forEach(f=>{const m=d.find(b=>b.name===f.name);m&&y.push([m,f])}),y.length&&y.forEach(([f])=>{const m=W({id:i.id+"--"+v.MethodOverwrite+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${i.name}" with id "${i.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:v.MethodOverwrite,entity:i});t.push(m.error)}),t}function EU(i,e){const t=[],r=[];if(e.abstract){const s=W({id:i.id+"--"+_.ExtendingAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:_.ExtendingAbstractEntity,entity:i});return t.push(s.error),t}i.properties.forEach(s=>{var d;const o=e.properties.find(p=>p.name===s.name);((d=s.implements)==null?void 0:d.id)!==(o==null?void 0:o.id)&&o&&r.push(s)}),r.length&&r.forEach(s=>{const o=W({id:i.id+"--"+v.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${i.name}" with id "${i.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:v.PropertyOverwrite,entity:i});t.push(o.error)});const a=[];return i.methods.forEach(s=>{var d;const o=e.methods.find(p=>p.name===s.name);((d=s.implements)==null?void 0:d.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=W({id:i.id+"--"+v.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${i.name}" with id "${i.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:v.MethodOverwrite,entity:i});t.push(o.error)}),t}function RU(i){const e=[];if(!i.properties.length){const t=W({id:i.id+"--"+_.NoProperties,message:"No properties implemented",issue:null,severity:T.Warning,code:_.NoProperties,entity:i});e.push(t.error)}return i.properties.forEach(t=>{t.validate()}),e}function bU(i){const e=[];if(i.abstract){if(i.methods.length){const t=W({id:i.id+"--"+_.AbstractEntityWithNonAbstractMethods,message:`Entity "${i.name}" with id "${i.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:T.Error,code:_.AbstractEntityWithNonAbstractMethods,entity:i});e.push(t.error)}if(i.properties.some(t=>!t.abstract)){const t=W({id:i.id+"--"+_.AbstractEntityWithNonAbstractProperties,message:`Entity "${i.name}" with id "${i.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:T.Error,code:_.AbstractEntityWithNonAbstractProperties,entity:i});e.push(t.error),i.properties.forEach(r=>{if(!r.abstract){const a=W({id:i.id+"--"+_.StaticEntityWithNonStaticProperties+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${i.name}" with id "${i.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:T.Error,code:_.StaticEntityWithNonStaticProperties,entity:i});e.push(a.error)}})}}else{if(i.abstractMethods.length){const t=W({id:i.id+"--"+_.AbstractPropertyInNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is not marked as abstract but has abstract methods`,issue:null,severity:T.Error,code:_.AbstractPropertyInNonAbstractEntity,entity:i});e.push(t.error)}if(i.properties.some(t=>t.abstract)){const t=W({id:i.id+"--"+_.AbstractMethodInNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is not marked as abstract but has abstract properties`,issue:null,severity:T.Error,code:_.AbstractMethodInNonAbstractEntity,entity:i});e.push(t.error),i.properties.forEach(r=>{if(r.abstract){const a=W({id:i.id+"--"+_.AbstractMethodInNonAbstractEntity+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${i.name}" with id "${i.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:T.Error,code:_.AbstractMethodInNonAbstractEntity,entity:i});e.push(a.error)}})}}if(i.static&&i.properties.some(t=>!t.static)){const t=W({id:i.id+"--"+_.StaticEntityWithNonStaticProperties,message:`Entity "${i.name}" with id "${i.id}" is marked as static but has non-static properties`,issue:null,severity:T.Error,code:_.StaticEntityWithNonStaticProperties,entity:i});e.push(t.error),i.properties.forEach(r=>{if(!r.static){const a=W({id:i.id+"--"+_.NonStaticPropertyInStaticEntity+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${i.name}" with id "${i.id}" is not marked as static but the entity is marked as static`,issue:null,severity:T.Error,code:_.NonStaticPropertyInStaticEntity,entity:i});e.push(a.error)}})}return e}function vU(i,e){const t=[];if(i.parent)if(i.id===i.parent)t.push(new E({id:`${i.id}--${i.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.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 r=e.get(i.parent);r?[n.Project,n.DataType].includes(r.type)||t.push(new E({id:`${i.id}--${i.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a parent reference that isn't pointing to an entity of type 'project' or 'data-type'.`,issue:null})):t.push(new E({id:`${i.id}--${i.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${i.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return i.implements&&Array.isArray(i.implements)?i.implements.forEach(r=>{if(i.id===r){t.push(new E({id:`${i.id}--${r}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.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(r);a?[n.CustomEntity,n.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${i.id}--${r}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${i.id}--${r}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'implements' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${i.id}--${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${r}" 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 E({id:`${i.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'implements' property that isn't an array.`,issue:null})),i.extends&&Array.isArray(i.extends)&&i.extends.forEach(r=>{const a=e.get(r);a?[n.CustomEntity,n.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${i.id}--${r}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.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 E({id:`${i.id}--${r}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'extends' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${i.id}--${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${r}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}function gU(i){var e,t,r;switch(i.id){case Me["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=i.project.entities.filter(f=>!!f.implements.find(m=>m.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(f=>!!f.properties.find(m=>{var b;return m.implements&&m.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((b=m.getDefaultValue())==null?void 0:b.value)===!0}))){const m=a[0].properties.find(P=>P.implements&&P.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),b=(e=m==null?void 0:m.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(m!=null&&m.dataType){const P=(t=m==null?void 0:m.dataType)==null?void 0:t.id.split("-id")[0],O=R({id:P+"-default-value-id",version:1,type:n.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:m==null?void 0:m.dataType.toReference()},i.project);return O.setParent(m==null?void 0:m.dataType),O.initChildren(),O.addSelfToProject(),{newEntities:[O]}}return{newEntities:[]}}const o=i.project.get(Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),d=ul(o,"Main database");if(d.errors.length>0)return{newEntities:[]};const p=d.implemented.properties.find(f=>f.implements&&f.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),y=(r=p==null?void 0:p.dataType)==null?void 0:r.defaultValue;if(y)y.value=!0;else if(p!=null&&p.dataType){const f=p==null?void 0:p.dataType.id.split("-id")[0],m=R({id:f+"-default-value-id",version:1,type:n.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},i.project);m.setParent(p==null?void 0:p.dataType),m.initChildren(),m.addSelfToProject()}return{newEntities:[d.implemented]}}}return{newEntities:[]}}function IU(i){return i.implements.filter(t=>t.type===n.BuiltInBaseEntity).map(t=>{var r;switch(t.id){case Me["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=i.project.entities.filter(p=>p.implements.find(y=>y.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(y=>{var f;return y.implements&&y.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((f=y.getDefaultValue())==null?void 0:f.value)===!0}));if(!s)return{newEntities:[]};const o=i.properties.find(p=>p.implements&&p.implements.id===Me["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database),d=(r=o==null?void 0:o.dataType)==null?void 0:r.defaultValue;if(o&&(o!=null&&o.dataType)&&!d){const p=o==null?void 0:o.dataType.id.split("-id")[0],y=R({id:p+"-default-value-id",version:1,type:n.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},i.project);return y.setParent(o==null?void 0:o.dataType),y.initChildren(),y.addSelfToProject(),{newEntities:[y]}}return{newEntities:[]}}}}),{newEntities:[]}}function ul(i,e,t){const r=t||Xt(e,n.CustomEntity,i.project),a=r.split("-id"),s=a[a.length-1||0]||r,o={id:r,version:1,name:e,type:n.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[i],x:0,y:0,parent:i.project},d=sE(o,i.project);if(d.length>0)return{errors:d,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=gU(i),y=R(o,i.project);y.setParent(i.project),y.initChildren();const f=i.properties.map(P=>{const O=s+"-"+Xt(B(P,i.project),n.Property,i.project),$=P.clone(y,O);return $.abstract=!1,$.implements=P,$.setParent(y),y.addProperty($),$}),m=i.abstractMethods.map(P=>{const O=s+Xt(P.name,n.FunctionDeclaration,i.project),$=P.implementAsFunctionDeclaration(O),ve={id:O+"-parent-ref-id",type:n.GenericReference,entityId:r,entityType:n.CustomEntity},tt={...$,implements:P,parent:ve},ge=R(tt,i.project);return y.addMethod(ge),ge.setParent(y),ge.initChildren(),ge.implements=P,ge});o.properties=f,o.methods=m;const b=IU(y);return{implemented:y,errors:[],entitiesChanges:{new:[y,...p.newEntities,...b.newEntities],updated:[y],deleted:[]}}}const X=class X{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"static");l(this,"abstract");l(this,"type",n.CustomEntity);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"implements",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestedProperties",[]);l(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let r=t;if(e.parent){const p=D(e.parent);r=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:n.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:r},d=R(o,t);return d.setParent(r),d.initChildren(),d}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=vU(r,t),o=sE(r,t);a.push(...s,...o,...Ae(r));const d=r.parent?t.get(r.parent):null;if(d&&d.type===n.DataType){const p=d;p.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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.
19
+ `+s+"}",p}function aF(n,e,t){e=Kr(e);var i=e.length;if(!i)return dt(t)?t.call(n):t;for(var a=0;a<i;a++){var s=n==null?void 0:n[e[a]];s===void 0&&(s=t,a=i),n=dt(s)?s.call(n):s}return n}var sF=0;function oF(n){var e=++sF+"";return n?n+e:e}function lF(n){var e=Z(n);return e._chain=!0,e}function IR(n,e,t,i,a){if(!(i instanceof e))return n.apply(t,a);var s=mR(n.prototype),o=n.apply(s,a);return dn(o)?o:s}var dr=ht(function(n,e){var t=dr.placeholder,i=function(){for(var a=0,s=e.length,o=Array(s),d=0;d<s;d++)o[d]=e[d]===t?arguments[a++]:e[d];for(;a<arguments.length;)o.push(arguments[a++]);return IR(n,i,this,this,o)};return i});dr.placeholder=Z;const PR=ht(function(n,e,t){if(!dt(n))throw new TypeError("Bind must be called on a function");var i=ht(function(a){return IR(n,i,e,this,t.concat(a))});return i}),vt=tR(ft);function Bn(n,e,t,i){if(i=i||[],!e&&e!==0)e=1/0;else if(e<=0)return i.concat(n);for(var a=i.length,s=0,o=ft(n);s<o;s++){var d=n[s];if(vt(d)&&(Cn(d)||jo(d)))if(e>1)Bn(d,e-1,t,i),a=i.length;else for(var p=0,y=d.length;p<y;)i[a++]=d[p++];else t||(i[a++]=d)}return i}const cF=ht(function(n,e){e=Bn(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var i=e[t];n[i]=PR(n[i],n)}return n});function dF(n,e){var t=function(i){var a=t.cache,s=""+(e?e.apply(this,arguments):i);return un(a,s)||(a[s]=n.apply(this,arguments)),a[s]};return t.cache={},t}const DR=ht(function(n,e,t){return setTimeout(function(){return n.apply(null,t)},e)}),uF=dr(DR,Z,1);function pF(n,e,t){var i,a,s,o,d=0;t||(t={});var p=function(){d=t.leading===!1?0:ni(),i=null,o=n.apply(a,s),i||(a=s=null)},y=function(){var f=ni();!d&&t.leading===!1&&(d=f);var m=e-(f-d);return a=this,s=arguments,m<=0||m>e?(i&&(clearTimeout(i),i=null),d=f,o=n.apply(a,s),i||(a=s=null)):!i&&t.trailing!==!1&&(i=setTimeout(p,m)),o};return y.cancel=function(){clearTimeout(i),d=0,i=a=s=null},y}function yF(n,e,t){var i,a,s,o,d,p=function(){var f=ni()-a;e>f?i=setTimeout(p,e-f):(i=null,t||(o=n.apply(d,s)),i||(s=d=null))},y=ht(function(f){return d=this,s=f,a=ni(),i||(i=setTimeout(p,e),t&&(o=n.apply(d,s))),o});return y.cancel=function(){clearTimeout(i),i=s=d=null},y}function hF(n,e){return dr(e,n)}function tl(n){return function(){return!n.apply(this,arguments)}}function fF(){var n=arguments,e=n.length-1;return function(){for(var t=e,i=n[e].apply(this,arguments);t--;)i=n[t].call(this,i);return i}}function mF(n,e){return function(){if(--n<1)return e.apply(this,arguments)}}function SR(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}}const TF=dr(SR,2);function AR(n,e,t){e=mt(e,t);for(var i=je(n),a,s=0,o=i.length;s<o;s++)if(a=i[s],e(n[a],a,n))return a}function OR(n){return function(e,t,i){t=mt(t,i);for(var a=ft(e),s=n>0?0:a-1;s>=0&&s<a;s+=n)if(t(e[s],s,e))return s;return-1}}const nl=OR(1),CR=OR(-1);function BR(n,e,t,i){t=mt(t,i,1);for(var a=t(e),s=0,o=ft(n);s<o;){var d=Math.floor((s+o)/2);t(n[d])<a?s=d+1:o=d}return s}function wR(n,e,t){return function(i,a,s){var o=0,d=ft(i);if(typeof s=="number")n>0?o=s>=0?s:Math.max(s+d,o):d=s>=0?Math.min(s+1,d):s+d+1;else if(t&&s&&d)return s=t(i,a),i[s]===a?s:-1;if(a!==a)return s=e(Zr.call(i,o,d),KE),s>=0?s+o:-1;for(s=n>0?o:d-1;s>=0&&s<d;s+=n)if(i[s]===a)return s;return-1}}const MR=wR(1,nl,BR),EF=wR(-1,CR);function rl(n,e,t){var i=vt(n)?nl:AR,a=i(n,e,t);if(a!==void 0&&a!==-1)return n[a]}function RF(n,e){return rl(n,ei(e))}function Qt(n,e,t){e=ti(e,t);var i,a;if(vt(n))for(i=0,a=n.length;i<a;i++)e(n[i],i,n);else{var s=je(n);for(i=0,a=s.length;i<a;i++)e(n[s[i]],s[i],n)}return n}function wn(n,e,t){e=mt(e,t);for(var i=!vt(n)&&je(n),a=(i||n).length,s=Array(a),o=0;o<a;o++){var d=i?i[o]:o;s[o]=e(n[d],d,n)}return s}function _R(n){var e=function(t,i,a,s){var o=!vt(t)&&je(t),d=(o||t).length,p=n>0?0:d-1;for(s||(a=t[o?o[p]:p],p+=n);p>=0&&p<d;p+=n){var y=o?o[p]:p;a=i(a,t[y],y,t)}return a};return function(t,i,a,s){var o=arguments.length>=3;return e(t,ti(i,s,4),a,o)}}const il=_R(1),NR=_R(-1);function ur(n,e,t){var i=[];return e=mt(e,t),Qt(n,function(a,s,o){e(a,s,o)&&i.push(a)}),i}function bF(n,e,t){return ur(n,tl(mt(e)),t)}function VR(n,e,t){e=mt(e,t);for(var i=!vt(n)&&je(n),a=(i||n).length,s=0;s<a;s++){var o=i?i[s]:s;if(!e(n[o],o,n))return!1}return!0}function LR(n,e,t){e=mt(e,t);for(var i=!vt(n)&&je(n),a=(i||n).length,s=0;s<a;s++){var o=i?i[s]:s;if(e(n[o],o,n))return!0}return!1}function Kt(n,e,t,i){return vt(n)||(n=cr(n)),(typeof t!="number"||i)&&(t=0),MR(n,e,t)>=0}const vF=ht(function(n,e,t){var i,a;return dt(e)?a=e:(e=Kr(e),i=e.slice(0,-1),e=e[e.length-1]),wn(n,function(s){var o=a;if(!o){if(i&&i.length&&(s=zo(s,i)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function al(n,e){return wn(n,Xo(e))}function gF(n,e){return ur(n,ei(e))}function $R(n,e,t){var i=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=vt(n)?n:cr(n);for(var d=0,p=n.length;d<p;d++)s=n[d],s!=null&&s>i&&(i=s)}else e=mt(e,t),Qt(n,function(y,f,m){o=e(y,f,m),(o>a||o===-1/0&&i===-1/0)&&(i=y,a=o)});return i}function IF(n,e,t){var i=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=vt(n)?n:cr(n);for(var d=0,p=n.length;d<p;d++)s=n[d],s!=null&&s<i&&(i=s)}else e=mt(e,t),Qt(n,function(y,f,m){o=e(y,f,m),(o<a||o===1/0&&i===1/0)&&(i=y,a=o)});return i}var PF=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function GR(n){return n?Cn(n)?Zr.call(n):Fo(n)?n.match(PF):vt(n)?wn(n,Zo):cr(n):[]}function FR(n,e,t){if(e==null||t)return vt(n)||(n=cr(n)),n[Ko(n.length-1)];var i=GR(n),a=ft(i);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var d=Ko(o,s),p=i[o];i[o]=i[d],i[d]=p}return i.slice(0,e)}function DF(n){return FR(n,1/0)}function SF(n,e,t){var i=0;return e=mt(e,t),al(wn(n,function(a,s,o){return{value:a,index:i++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,d=s.criteria;if(o!==d){if(o>d||o===void 0)return 1;if(o<d||d===void 0)return-1}return a.index-s.index}),"value")}function Oa(n,e){return function(t,i,a){var s=e?[[],[]]:{};return i=mt(i,a),Qt(t,function(o,d){var p=i(o,d,t);n(s,o,p)}),s}}const AF=Oa(function(n,e,t){un(n,t)?n[t].push(e):n[t]=[e]}),OF=Oa(function(n,e,t){n[t]=e}),CF=Oa(function(n,e,t){un(n,t)?n[t]++:n[t]=1}),BF=Oa(function(n,e,t){n[t?0:1].push(e)},!0);function wF(n){return n==null?0:vt(n)?n.length:je(n).length}function MF(n,e,t){return e in t}const xR=ht(function(n,e){var t={},i=e[0];if(n==null)return t;dt(i)?(e.length>1&&(i=ti(i,e[1])),e=Qr(n)):(i=MF,e=Bn(e,!1,!1),n=Object(n));for(var a=0,s=e.length;a<s;a++){var o=e[a],d=n[o];i(d,o,n)&&(t[o]=d)}return t}),_F=ht(function(n,e){var t=e[0],i;return dt(t)?(t=tl(t),e.length>1&&(i=e[1])):(e=wn(Bn(e,!1,!1),String),t=function(a,s){return!Kt(e,s)}),xR(n,t,i)});function UR(n,e,t){return Zr.call(n,0,Math.max(0,n.length-(e==null||t?1:e)))}function sl(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[0]:UR(n,n.length-e)}function Ca(n,e,t){return Zr.call(n,e==null||t?1:e)}function NF(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[n.length-1]:Ca(n,Math.max(0,n.length-e))}function VF(n){return ur(n,Boolean)}function LF(n,e){return Bn(n,e,!1)}const jR=ht(function(n,e){return e=Bn(e,!0,!0),ur(n,function(t){return!Kt(e,t)})}),$F=ht(function(n,e){return jR(n,e)});function ol(n,e,t,i){WE(e)||(i=t,t=e,e=!1),t!=null&&(t=mt(t,i));for(var a=[],s=[],o=0,d=ft(n);o<d;o++){var p=n[o],y=t?t(p,o,n):p;e&&!t?((!o||s!==y)&&a.push(p),s=y):t?Kt(s,y)||(s.push(y),a.push(p)):Kt(a,p)||a.push(p)}return a}const GF=ht(function(n){return ol(Bn(n,!0,!0))});function FF(n){for(var e=[],t=arguments.length,i=0,a=ft(n);i<a;i++){var s=n[i];if(!Kt(e,s)){var o;for(o=1;o<t&&Kt(arguments[o],s);o++);o===t&&e.push(s)}}return e}function ll(n){for(var e=n&&$R(n,ft).length||0,t=Array(e),i=0;i<e;i++)t[i]=al(n,i);return t}const xF=ht(ll);function UF(n,e){for(var t={},i=0,a=ft(n);i<a;i++)e?t[n[i]]=e[i]:t[n[i][0]]=n[i][1];return t}function jF(n,e,t){e==null&&(e=n||0,n=0),t||(t=e<n?-1:1);for(var i=Math.max(Math.ceil((e-n)/t),0),a=Array(i),s=0;s<i;s++,n+=t)a[s]=n;return a}function kF(n,e){if(e==null||e<1)return[];for(var t=[],i=0,a=n.length;i<a;)t.push(Zr.call(n,i,i+=e));return t}function cl(n,e){return n._chain?Z(e).chain():e}function kR(n){return Qt(Ho(n),function(e){var t=Z[e]=n[e];Z.prototype[e]=function(){var i=[this._wrapped];return hG.apply(i,arguments),cl(this,t.apply(Z,i))}}),Z}Qt(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=Pa[n];Z.prototype[n]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(n==="shift"||n==="splice")&&t.length===0&&delete t[0]),cl(this,t)}}),Qt(["concat","join","slice"],function(n){var e=Pa[n];Z.prototype[n]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),cl(this,t)}});var qR=kR(Object.freeze(Object.defineProperty({__proto__:null,VERSION:LE,after:mF,all:VR,allKeys:Qr,any:LR,assign:Aa,before:SR,bind:PR,bindAll:cF,chain:lF,chunk:kF,clone:qG,collect:wn,compact:VF,compose:fF,constant:eR,contains:Kt,countBy:CF,create:kG,debounce:yF,default:Z,defaults:fR,defer:uF,delay:DR,detect:rl,difference:jR,drop:Ca,each:Qt,escape:ZG,every:VR,extend:hR,extendOwn:Aa,filter:ur,find:rl,findIndex:nl,findKey:AR,findLastIndex:CR,findWhere:RF,first:sl,flatten:LF,foldl:il,foldr:NR,forEach:Qt,functions:Ho,get:ER,groupBy:AF,has:WG,head:sl,identity:Zo,include:Kt,includes:Kt,indexBy:OF,indexOf:MR,initial:UR,inject:il,intersection:FF,invert:yR,invoke:vF,isArguments:jo,isArray:Cn,isArrayBuffer:zE,isBoolean:WE,isDataView:Da,isDate:IG,isElement:gG,isEmpty:aR,isEqual:NG,isError:DG,isFinite:CG,isFunction:dt,isMap:$G,isMatch:sR,isNaN:KE,isNull:vG,isNumber:HE,isObject:dn,isRegExp:PG,isSet:FG,isString:Fo,isSymbol:YE,isTypedArray:rR,isUndefined:JE,isWeakMap:GG,isWeakSet:xG,iteratee:Qo,keys:je,last:NF,lastIndexOf:EF,map:wn,mapObject:HG,matcher:ei,matches:ei,max:$R,memoize:dF,methods:Ho,min:IF,mixin:kR,negate:tl,noop:bR,now:ni,object:UF,omit:_F,once:TF,pairs:UG,partial:dr,partition:BF,pick:xR,pluck:al,property:Xo,propertyOf:YG,random:Ko,range:jF,reduce:il,reduceRight:NR,reject:bF,rest:Ca,restArguments:ht,result:aF,sample:FR,select:ur,shuffle:DF,size:wF,some:LR,sortBy:SF,sortedIndex:BR,tail:Ca,take:sl,tap:JG,template:iF,templateSettings:KG,throttle:pF,times:zG,toArray:GR,toPath:TR,transpose:ll,unescape:QG,union:GF,uniq:ol,unique:ol,uniqueId:oF,unzip:ll,values:cr,where:gF,without:$F,wrap:hF,zip:xF},Symbol.toStringTag,{value:"Module"})));qR._=qR;const Ba=c.union([c.string(),c.number(),c.boolean(),c.date()]),qF=c.enum([Le.CurrentDateAndTime,Le.Random,Le.Unique]),dl=c.object({type:qF,rangeStart:Ba.nullable(),rangeEnd:Ba.nullable()}),wa=dl.extend({type:c.literal(Le.Random),rangeStart:Ba,rangeEnd:Ba}),JR=dl.extend({type:c.literal(Le.Unique),rangeStart:c.null(),rangeEnd:c.null()}),JF=dl.extend({type:c.literal(Le.CurrentDateAndTime),rangeStart:c.null(),rangeEnd:c.null()}),ul=wa.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),WF=ul.extend({rangeStart:c.number(),rangeEnd:c.null()}),HF=ul.extend({rangeStart:c.null(),rangeEnd:c.number()}),YF=ul.extend({rangeStart:c.number(),rangeEnd:c.number()}),pl=wa.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),zF=pl.extend({rangeStart:c.number(),rangeEnd:c.null()}),ZF=pl.extend({rangeStart:c.null(),rangeEnd:c.number()}),XF=pl.extend({rangeStart:c.number(),rangeEnd:c.number()}),yl=wa.extend({rangeStart:c.date().nullable(),rangeEnd:c.date().nullable()}),QF=yl.extend({rangeStart:c.date(),rangeEnd:c.null()}),KF=yl.extend({rangeStart:c.null(),rangeEnd:c.date()}),e4=yl.extend({rangeStart:c.date(),rangeEnd:c.date()}),WR=wa.extend({rangeStart:c.null(),rangeEnd:c.null()}),HR=c.union([zF,ZF,XF]),YR=c.union([WF,HF,YF]),zR=c.union([QF,KF,e4,JF]),ZR=c.union([HR,YR,zR,JR,WR]);function XR(){return c.union([c.object({type:c.literal(r.ValueDescriptor)}),c.record(c.string(),c.any())])}function t4(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ValueDescriptor)})}function QR(){return c.object({id:c.string(),type:c.literal(r.ValueDescriptor),name:c.string(),required:c.boolean()})}function n4(){return QR().merge(c.object({version:c.number(),index:c.number()}))}function r4(){return QR().merge(c.object({}))}function i4(){return c.object({dataType:pn(),parent:yr()})}function a4(){return n4().merge(i4())}function hl(){return c.union([c.object({type:c.literal(r.PrimitiveEntity)}),c.record(c.string(),c.any())])}function fl(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.PrimitiveEntity)})}function KR(){return c.object({id:c.string(),type:c.literal(r.PrimitiveEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function s4(){return KR().merge(c.object({version:c.number()}))}function o4(){return KR().merge(c.object({}))}function l4(){return c.object({properties:c.array(pr()),methods:c.array(Jt()),abstractMethods:c.array(Mn()),extends:c.array(c.union([hl(),ri()]))})}function c4(){return s4().merge(l4())}function pr(){return c.union([c.object({type:c.literal(r.Property)}),c.record(c.string(),c.any())])}function d4(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Property)})}function eb(){return c.object({id:c.string(),type:c.literal(r.Property),name:c.string(),description:c.string().nullable(),private:c.boolean(),static:c.boolean(),required:c.boolean(),abstract:c.boolean()})}function u4(){return eb().merge(c.object({version:c.number(),index:c.number()}))}function p4(){return eb().merge(c.object({}))}function y4(){return c.object({dataType:pn(),implements:pr().nullable(),parent:c.union([si(),fl(),ml()])})}function h4(){return u4().merge(y4())}function f4(){return c.enum([w.CRON_JOB,w.EXECUTION,w.HTTP_ENDPOINT,w.PERSISTED_ENTITY,w.RELATIONAL_DATABASE])}function ri(){return c.union([c.object({type:c.literal(r.BuiltInBaseEntity)}),c.record(c.string(),c.any())])}function ml(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.BuiltInBaseEntity)})}function tb(){return c.object({id:c.string(),version:c.number(),type:c.literal(r.BuiltInBaseEntity),name:f4(),description:c.string().nullable(),abstract:c.boolean(),static:c.boolean()})}function m4(){return tb()}function T4(){return tb().merge(c.object({}))}function E4(){return c.object({properties:c.array(pr()),methods:c.array(Jt()),abstractMethods:c.array(Mn()),extends:c.array(c.union([ri(),hl()]))})}function R4(){return m4().merge(E4())}function nb(){return c.enum([V.Dynamic,V.Fixed,V.None])}function Mn(){return c.union([c.object({type:c.literal(r.ActionDescriptor)}),c.record(c.string(),c.any())])}function yr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ActionDescriptor)})}function rb(){return c.object({id:c.string(),type:c.literal(r.ActionDescriptor),name:c.string(),description:c.string().nullable(),argumentsType:nb(),returnsType:nb()})}function b4(){return rb().merge(c.object({version:c.number()}))}function v4(){return rb().merge(c.object({}))}function g4(){return c.object({fixedArguments:c.array(XR()),fixedReturns:c.array(XR()),dynamicArgumentTypes:pn().nullable(),dynamicReturnTypes:pn().nullable(),parent:c.union([Pt(),si(),ml(),fl()]).nullable()})}function ib(){return b4().merge(g4())}function I4(){return c.union([c.object({type:c.literal(r.Loop)}),c.record(c.string(),c.any())])}function _n(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Loop)})}function ab(){return c.object({id:c.string(),type:c.literal(r.Loop)})}function P4(){return ab().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function D4(){return ab().merge(c.object({declaration:c.union([c.string(),Jt()])}))}function S4(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),declaration:Mn(),inputs:c.array(Ct()),outputs:c.array(gt()),successCalls:c.array(We()),errorCalls:c.array(We()),error:gt(),body:Jt(),parent:c.union([yn(),Pt()]),breakStatements:c.array(H4()),continueStatements:c.array(O4())})}function A4(){return P4().merge(S4())}function O4(){return c.union([c.object({type:c.literal(r.ContinueStatement)}),c.record(c.string(),c.any())])}function sb(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ContinueStatement)})}function ob(){return c.object({id:c.string(),type:c.literal(r.ContinueStatement)})}function C4(){return ob().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function B4(){return ob().merge(c.object({}))}function w4(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),outputs:c.array(en()),throws:c.optional(en()),parent:_n()})}function M4(){return C4().merge(w4())}function lb(){return c.union([c.object({type:c.literal(r.ReturnStatement)}),c.record(c.string(),c.any())])}function cb(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ReturnStatement)})}function db(){return c.object({id:c.string(),type:c.literal(r.ReturnStatement)})}function _4(){return db().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function N4(){return db().merge(c.object({}))}function V4(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),outputs:c.array(en()),throws:c.optional(en()),parent:yn()})}function L4(){return _4().merge(V4())}function $4(){return c.union([c.object({type:c.literal(r.Search)}),c.record(c.string(),c.any())])}function Tl(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Search)})}function ub(){return c.object({id:c.string(),type:c.literal(r.Search),name:c.string(),query:c.any(),description:c.string().nullable()})}function G4(){return ub().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function F4(){return ub().merge(c.object({}))}function x4(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),inputsDeclarations:c.array(ai()),inputs:c.array(Ct()),outputsDeclarations:c.array(en()),outputs:c.array(gt()),parent:c.union([yn(),Pt()]),error:gt().nullable()})}function U4(){return G4().merge(x4())}function en(){return c.union([c.object({type:c.literal(r.ReturnDeclaration)}),c.record(c.string(),c.any())])}function j4(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ReturnDeclaration)})}function pb(){return c.object({id:c.string(),type:c.literal(r.ReturnDeclaration),name:c.string(),description:c.string().nullable(),isError:c.boolean()})}function k4(){return pb().merge(c.object({version:c.number(),index:c.number()}))}function q4(){return pb().merge(c.object({}))}function J4(){return c.object({dataType:pn().nullable(),readsValue:_a().nullable(),parent:c.union([cb(),yr(),yr(),Tl(),ii(),sb()])})}function W4(){return k4().merge(J4())}function H4(){return c.union([c.object({type:c.literal(r.BreakStatement)}),c.record(c.string(),c.any())])}function ii(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.BreakStatement)})}function yb(){return c.object({id:c.string(),type:c.literal(r.BreakStatement)})}function Y4(){return yb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function z4(){return yb().merge(c.object({}))}function Z4(){return c.object({calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),outputs:c.array(en()),throws:c.optional(en()),parent:_n()})}function X4(){return Y4().merge(Z4())}function gt(){return c.union([c.object({type:c.literal(r.OutputMap)}),c.record(c.string(),c.any())])}function Q4(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.OutputMap)})}function hb(){return c.object({id:c.string(),type:c.literal(r.OutputMap)})}function K4(){return hb().merge(c.object({version:c.number(),index:c.number()}))}function ex(){return hb().merge(c.object({}))}function tx(){return c.object({writesValues:c.array(Nn()),declaration:c.union([en(),pr()]),parent:c.union([Se(),_n(),ii()])})}function nx(){return K4().merge(tx())}function fb(){return c.union([c.object({type:c.literal(r.FunctionCall)}),c.record(c.string(),c.any())])}function rx(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.FunctionCall)})}function mb(){return c.object({id:c.string(),type:c.literal(r.FunctionCall)})}function ix(){return mb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function ax(){return mb().merge(c.object({}))}function sx(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),writesValues:c.array(Nn()),declaration:Jt(),inputs:c.array(Ct()),outputs:c.array(gt()),error:c.optional(gt()),parent:c.union([yn(),Pt()])})}function ox(){return ix().merge(sx())}function lx(){return c.enum([De.Equal,De.NotEqual,De.MoreThan,De.MoreThanOrEqual,De.LessThan,De.LessThanOrEqual,De.And,De.Or,St.Empty,St.NotEmpty])}function cx(){return c.union([c.object({type:c.literal(r.Condition)}),c.record(c.string(),c.any())])}function dx(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Condition)})}function Tb(){return c.object({id:c.string(),type:c.literal(r.Condition)})}function ux(){return Tb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function px(){return Tb().merge(c.object({}))}function yx(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),leftValue:Ct(),rightValue:Ct().nullable(),operator:lx(),parent:c.union([yn(),Pt()])})}function hx(){return ux().merge(yx())}function El(){return c.union([c.object({type:c.literal(r.InternalCall)}),c.record(c.string(),c.any())])}function fx(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InternalCall)})}function Eb(){return c.object({id:c.string(),type:c.literal(r.InternalCall),index:c.number()})}function mx(){return Eb().merge(c.object({version:c.number(),index:c.number()}))}function Tx(){return Eb().merge(c.object({declaration:c.union([c.string(),Jt()])}))}function Ex(){return c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),writesValues:c.array(Nn()),declaration:Jt(),inputs:c.array(Ct()),outputs:c.array(gt()),parent:Pl(),error:c.optional(gt())})}function Rx(){return mx().merge(Ex())}function Ct(){return c.union([c.object({type:c.literal(r.InputMap)}),c.record(c.string(),c.any())])}function Rl(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InputMap)})}function Rb(){return c.object({id:c.string(),type:c.literal(r.InputMap),name:c.string().nullable().optional(),description:c.string().nullable().optional()})}function bx(){return Rb().merge(c.object({version:c.number(),index:c.number()}))}function vx(){return Rb().merge(c.object({}))}function gx(){return c.object({defaultValue:vl().nullable(),declaration:c.union([ai(),pr()]).nullable(),readsValue:_a().nullable(),parent:c.union([Se(),Rl(),_n(),ii()]),dynamicArguments:c.array(Ct())})}function Ix(){return bx().merge(gx())}function bb(){return c.union([c.object({type:c.literal(r.Operation)}),c.record(c.string(),c.any())])}function vb(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Operation)})}function bl(){return c.object({id:c.string(),type:c.literal(r.Operation)})}function Px(){return bl().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Dx(){return bl().merge(c.object({}))}function Sx(){return bl().merge(c.object({successCalls:c.array(We()),errorCalls:c.array(We()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),writesValues:c.array(Nn()),declaration:Mn(),inputs:c.array(Ct()),outputs:c.array(gt()),error:c.array(gt()),dynamicArguments:c.array(Ct()),parent:c.union([yn(),Pt()])}))}function Ax(){return Px().merge(Sx())}function Ma(){return c.union([c.string(),c.number(),c.boolean(),c.null(),c.date()])}function gb(){return c.record(c.string(),Ma())}function Ox(){return c.array(c.union([Ma(),gb()]))}function Ib(){return c.union([Ma(),gb(),Ox()])}function Pb(){return c.union([Ma(),Ib()])}function Db(){return c.enum([v.String,v.Number,v.Boolean,v.Null,v.Date,v.JSON,v.Enum,v.File,v.UUID,v.EntityTemplate,v.ActionDescriptor])}function Cx(){return c.union([si(),vb(),Dl()])}function Bx(){return c.object({id:c.string(),name:Db(),type:c.literal(r.PrimitiveValue),value:Pb(),autogeneration:ZR.nullable()})}function wx(){return Bx().merge(c.object({}))}function Lt(){return c.object({id:c.string(),version:c.number(),name:Db(),type:c.literal(r.PrimitiveValue),value:Pb(),valueAsType:Cx().nullable(),autogeneration:ZR.nullable(),parent:c.union([Sb(),Rl()])})}function Mx(){return Lt().extend({name:c.literal(v.String),value:c.string(),autogeneration:HR.nullable()})}function _x(){return Lt().extend({name:c.literal(v.Number),value:c.number(),autogeneration:YR.nullable()})}function Nx(){return Lt().extend({name:c.literal(v.Boolean),value:c.boolean(),autogeneration:WR.nullable()})}function Vx(){return Lt().extend({name:c.literal(v.Null),value:c.null(),autogeneration:c.null()})}function Lx(){return Lt().extend({name:c.literal(v.Date),value:c.date(),autogeneration:zR.nullable()})}function $x(){return Lt().extend({name:c.literal(v.JSON),value:Ib(),autogeneration:c.null()})}function Gx(){return Lt().extend({name:c.literal(v.Enum),value:c.string(),autogeneration:c.null()})}function Fx(){return Lt().extend({name:c.literal(v.File),value:c.string(),autogeneration:c.null()})}function xx(){return Lt().extend({name:c.literal(v.UUID),value:c.string(),autogeneration:JR.nullable()})}function Ux(){return Lt().extend({name:c.literal(v.EntityTemplate),value:si(),autogeneration:c.null()})}function jx(){return Lt().extend({name:c.literal(v.ActionDescriptor),value:Dl(),autogeneration:c.null()})}function vl(){return c.union([Mx(),_x(),Nx(),Vx(),Lx(),$x(),Gx(),Fx(),xx(),Ux(),jx()])}function pn(){return c.union([c.object({type:c.literal(r.DataType)}),c.record(c.string(),c.any())])}function Sb(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.DataType)})}function Ab(){return c.object({id:c.string(),type:c.literal(r.DataType),isNullable:c.boolean(),isList:c.boolean(),constant:c.boolean(),asType:c.boolean(),options:c.array(c.string()).optional()})}function kx(){return Ab().merge(c.object({version:c.number()}))}function qx(){return Ab().merge(c.object({}))}function Jx(){return c.object({defaultValue:vl().nullable(),entity:c.union([Na(),ri(),hl(),Mn()]).nullable(),parent:c.union([d4(),hU(),yr(),t4()])})}function Wx(){return kx().merge(Jx())}function gl(){return c.union([c.object({type:c.literal(r.VariableDeclaration)}),c.record(c.string(),c.any())])}function Hx(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.VariableDeclaration)})}function Ob(){return c.object({id:c.string(),type:c.literal(r.VariableDeclaration),name:c.string(),description:c.string().nullable()})}function Yx(){return Ob().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function zx(){return Ob().merge(c.object({}))}function Zx(){return c.object({dataType:pn().nullable(),readsValue:_a().nullable(),writesValues:c.array(Nn()),inputs:c.array(Ct()),outputs:c.array(gt()),successCalls:c.array(We()),errorCalls:c.array(We()),internalCalls:c.array(El()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),parent:c.union([yn(),Pt()])})}function Xx(){return Yx().merge(Zx())}function Cb(){return c.union([c.object({type:c.literal(r.VariableInstance)}),c.record(c.string(),c.any())])}function Qx(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.VariableInstance)})}function Bb(){return c.object({id:c.string(),type:c.literal(r.VariableInstance)})}function Kx(){return Bb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function eU(){return Bb().merge(c.object({}))}function tU(){return c.object({declaration:gl(),dataType:pn().nullable(),readsValue:_a().nullable(),writesValues:c.array(Nn()),inputs:c.array(Ct()),outputs:c.array(gt()),successCalls:c.array(We()),errorCalls:c.array(We()),internalCalls:c.array(El()),calledBySuccess:c.array(Se()),calledByError:c.array(Se()),calledByEntry:c.array(It()),parent:c.union([yn(),Pt()])})}function nU(){return Kx().merge(tU())}function rU(){return c.union([c.object({type:c.literal(r.InstalledProject)}),c.record(c.string(),c.any())])}function wb(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InstalledProject)})}function iU(){return c.object({version:c.number(),x:c.number(),y:c.number()})}function aU(){return c.object({})}function sU(){return c.object({implements:Pt(),description:c.string().nullable(),functions:c.array(Jt()),events:c.array(Mb()),parent:Pt()})}function oU(){return iU().merge(sU())}function Mb(){return c.union([c.object({type:c.literal(r.GlobalEvent)}),c.record(c.string(),c.any())])}function lU(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.GlobalEvent)})}function Il(){return c.object({id:c.string(),type:c.literal(r.GlobalEvent),name:c.string(),collapsed:c.boolean()})}function cU(){return Il().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function dU(){return Il().merge(c.object({}))}function uU(){return Il().merge(c.object({returnStatements:c.array(lb()),implements:c.array(ib()),inputs:c.array(ai()),calls:c.array(We()),parent:c.union([Pt(),wb()])}))}function pU(){return cU().merge(uU())}function _b(){return c.union([gl(),Cb()])}function Pl(){return c.union([Hx(),Qx()])}function Nn(){return c.union([_b(),Ct(),en()])}function yU(){return c.union([Pl(),Rl(),j4()])}function _a(){return c.union([_b(),ai(),gt(),bb(),El(),fb()])}function hU(){return c.union([mU(),Q4(),yU()])}function fU(){return lU()}function Se(){return c.union([vb(),rx(),dx(),Tl(),Pl(),fx(),_n()])}function We(){return c.union([Se(),cb(),ii(),sb()])}function It(){return c.union([Dl(),fU()])}function yn(){return c.union([It(),_n()])}function ai(){return c.union([c.object({type:c.literal(r.ArgumentDeclaration)}),c.record(c.string(),c.any())])}function mU(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ArgumentDeclaration)})}function Nb(){return c.object({id:c.string(),type:c.literal(r.ArgumentDeclaration)})}function TU(){return Nb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function EU(){return Nb().merge(c.object({}))}function RU(){return c.object({dataType:pn().nullable(),writesValues:c.array(Nn()),parent:c.union([It(),yr(),yr(),Tl(),ii()])})}function bU(){return TU().merge(RU())}function Jt(){return c.union([c.object({type:c.literal(r.FunctionDeclaration)}),c.record(c.string(),c.any())])}function Dl(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.FunctionDeclaration)})}function Vb(){return c.object({id:c.string(),type:c.literal(r.FunctionDeclaration),name:c.string(),description:c.string().nullable()})}function vU(){return Vb().merge(c.object({version:c.number(),x:c.number(),y:c.number(),index:c.number().nullable()}))}function gU(){return Vb()}function IU(){return c.object({inputs:c.array(ai()),implements:Mn().nullable(),returnStatements:c.array(lb()),parent:c.union([Pt(),wb(),si(),_n(),ml(),fl()])})}function PU(){return vU().merge(IU())}function Pt(){return c.object({entityType:c.literal(r.Project),entityId:c.string(),id:c.string(),type:c.literal(r.GenericReference)})}function Lb(){return c.object({id:c.string(),type:c.literal(r.Project),name:c.string(),description:c.string().nullable()})}function DU(){return Lb().merge(c.object({version:c.number()}))}function SU(){return Lb()}function AU(){return c.object({entities:c.array(Na()),functions:c.array(Jt()),events:c.array(Mb()),projects:c.array(rU()),variableDeclarations:c.array(gl()),variableInstances:c.array(Cb()),conditions:c.array(cx()),operations:c.array(bb()),functionCalls:c.array(fb()),loops:c.array(I4()),searches:c.array($4())})}function OU(){return DU().merge(AU())}function Na(){return c.union([c.object({type:c.literal(r.CustomEntity)}),c.record(c.string(),c.any())])}function si(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.CustomEntity)})}function $b(){return c.object({id:c.string(),type:c.literal(r.CustomEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function CU(){return $b().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function BU(){return $b().merge(c.object({}))}function wU(){return c.union([Pt(),Sb()])}function MU(){return c.object({properties:c.array(pr()),methods:c.array(Jt()),abstractMethods:c.array(Mn()),extends:c.array(c.union([Na(),ri()])),implements:c.array(c.union([Na(),ri()])),parent:wU()})}function _U(){return CU().merge(MU())}function NU(n){const e=_U(),t=n.toJSON();e.safeParse(t).success;const a=n.implements.flatMap(f=>$U(n,f)),s=n.extends.flatMap(f=>GU(n,f)),o=xU(n),d=FU(n);n.methods.flatMap(f=>f.validate());const p=[...a,...s,...o,...d];return z(n.errors,p)}function VU(n,e){const t=e.properties.filter(s=>s.abstract),i=[];let a=[...n.properties];return t.forEach(s=>{const o=a.find(d=>{var p;return((p=d.implements)==null?void 0:p.id)===s.id});o?a=a.filter(d=>d.id!==o.id):i.push(s)}),i}function LU(n,e){const t=e.abstractMethods,i=[];let a=[...n.methods];return t.forEach(s=>{const o=a.find(d=>{var p;return((p=d.implements)==null?void 0:p.id)===s.id});o?a=a.filter(d=>d.id!==o.id):i.push(s)}),i}function $U(n,e){const t=[];if(!e.abstract){const f=W({id:n.id+"--"+_.ImplementingNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:_.ImplementingNonAbstractEntity,entity:n});return t.push(f.error),t}const i=e.properties.filter(f=>f.abstract),a=[];let s=[...n.properties];i.forEach(f=>{const m=s.find(b=>{var P;return((P=b.implements)==null?void 0:P.id)===f.id});m?s=s.filter(b=>b.id!==m.id):a.push(f)}),a.length&&a.forEach(f=>{const m=W({id:n.id+"--"+_.MissingPropertyImplementation+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:T.Error,code:_.MissingPropertyImplementation,entity:n});t.push(m.error)});const o=[];let d=[...n.methods];e.abstractMethods.forEach(f=>{const m=d.find(b=>{var P;return((P=b.implements)==null?void 0:P.id)===f.id});m?d=d.filter(b=>b.id!==m.id):o.push(f)}),o.length&&o.forEach(f=>{const m=W({id:n.id+"--"+_.MissingMethodImplementation+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:T.Error,code:_.MissingMethodImplementation,entity:n});t.push(m.error)});const p=[];e.properties.forEach(f=>{const m=s.find(b=>b.name===f.name);m&&p.push([m,f])}),p.length&&p.forEach(([f])=>{const m=W({id:n.id+"--"+g.PropertyOverwrite+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:g.PropertyOverwrite,entity:n});t.push(m.error)});const y=[];return e.methods.forEach(f=>{const m=d.find(b=>b.name===f.name);m&&y.push([m,f])}),y.length&&y.forEach(([f])=>{const m=W({id:n.id+"--"+g.MethodOverwrite+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:g.MethodOverwrite,entity:n});t.push(m.error)}),t}function GU(n,e){const t=[],i=[];if(e.abstract){const s=W({id:n.id+"--"+_.ExtendingAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:_.ExtendingAbstractEntity,entity:n});return t.push(s.error),t}n.properties.forEach(s=>{var d;const o=e.properties.find(p=>p.name===s.name);((d=s.implements)==null?void 0:d.id)!==(o==null?void 0:o.id)&&o&&i.push(s)}),i.length&&i.forEach(s=>{const o=W({id:n.id+"--"+g.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:g.PropertyOverwrite,entity:n});t.push(o.error)});const a=[];return n.methods.forEach(s=>{var d;const o=e.methods.find(p=>p.name===s.name);((d=s.implements)==null?void 0:d.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=W({id:n.id+"--"+g.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:g.MethodOverwrite,entity:n});t.push(o.error)}),t}function FU(n){const e=[];if(!n.properties.length){const t=W({id:n.id+"--"+_.NoProperties,message:"No properties implemented",issue:null,severity:T.Warning,code:_.NoProperties,entity:n});e.push(t.error)}return n.properties.forEach(t=>{t.validate()}),e}function xU(n){const e=[];if(n.abstract){if(n.methods.length){const t=W({id:n.id+"--"+_.AbstractEntityWithNonAbstractMethods,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:T.Error,code:_.AbstractEntityWithNonAbstractMethods,entity:n});e.push(t.error)}if(n.properties.some(t=>!t.abstract)){const t=W({id:n.id+"--"+_.AbstractEntityWithNonAbstractProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:T.Error,code:_.AbstractEntityWithNonAbstractProperties,entity:n});e.push(t.error),n.properties.forEach(i=>{if(!i.abstract){const a=W({id:n.id+"--"+_.StaticEntityWithNonStaticProperties+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:T.Error,code:_.StaticEntityWithNonStaticProperties,entity:n});e.push(a.error)}})}}else{if(n.abstractMethods.length){const t=W({id:n.id+"--"+_.AbstractPropertyInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract methods`,issue:null,severity:T.Error,code:_.AbstractPropertyInNonAbstractEntity,entity:n});e.push(t.error)}if(n.properties.some(t=>t.abstract)){const t=W({id:n.id+"--"+_.AbstractMethodInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract properties`,issue:null,severity:T.Error,code:_.AbstractMethodInNonAbstractEntity,entity:n});e.push(t.error),n.properties.forEach(i=>{if(i.abstract){const a=W({id:n.id+"--"+_.AbstractMethodInNonAbstractEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:T.Error,code:_.AbstractMethodInNonAbstractEntity,entity:n});e.push(a.error)}})}}if(n.static&&n.properties.some(t=>!t.static)){const t=W({id:n.id+"--"+_.StaticEntityWithNonStaticProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as static but has non-static properties`,issue:null,severity:T.Error,code:_.StaticEntityWithNonStaticProperties,entity:n});e.push(t.error),n.properties.forEach(i=>{if(!i.static){const a=W({id:n.id+"--"+_.NonStaticPropertyInStaticEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is not marked as static but the entity is marked as static`,issue:null,severity:T.Error,code:_.NonStaticPropertyInStaticEntity,entity:n});e.push(a.error)}})}return e}function UU(n,e){const t=[];if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.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 i=e.get(n.parent);i?[r.Project,r.DataType].includes(i.type)||t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'project' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return n.implements&&Array.isArray(n.implements)?n.implements.forEach(i=>{if(n.id===i){t.push(new E({id:`${n.id}--${i}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.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(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${n.id}--${i}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" 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 E({id:`${n.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' property that isn't an array.`,issue:null})),n.extends&&Array.isArray(n.extends)&&n.extends.forEach(i=>{const a=e.get(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${n.id}--${i}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.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 E({id:`${n.id}--${i}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'extends' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}function Gb(n){var e,t,i;switch(n.id){case Me["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=n.project.entities.filter(f=>!!f.implements.find(m=>m.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(f=>!!f.properties.find(m=>{var b;return m.implements&&m.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((b=m.getDefaultValue())==null?void 0:b.value)===!0}))){const m=a[0].properties.find(P=>P.implements&&P.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),b=(e=m==null?void 0:m.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(m!=null&&m.dataType){const P=(t=m==null?void 0:m.dataType)==null?void 0:t.id.split("-id")[0],C=R({id:P+"-default-value-id",version:1,type:r.PrimitiveValue,name:v.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:m==null?void 0:m.dataType.toReference()},n.project);return C.setParent(m==null?void 0:m.dataType),C.initChildren(),C.addSelfToProject(),{newEntities:[C]}}return{newEntities:[]}}const o=n.project.get(Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),d=Va(o,"Main database");if(d.errors.length>0)return{newEntities:[]};const p=d.implemented.properties.find(f=>f.implements&&f.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),y=(i=p==null?void 0:p.dataType)==null?void 0:i.defaultValue;if(y)y.value=!0;else if(p!=null&&p.dataType){const f=p==null?void 0:p.dataType.id.split("-id")[0],m=R({id:f+"-default-value-id",version:1,type:r.PrimitiveValue,name:v.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},n.project);m.setParent(p==null?void 0:p.dataType),m.initChildren(),m.addSelfToProject()}return{newEntities:[d.implemented]}}}return{newEntities:[]}}function Fb(n){return n.implements.filter(t=>t.type===r.BuiltInBaseEntity).map(t=>{var i;switch(t.id){case Me["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=n.project.entities.filter(p=>p.implements.find(y=>y.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(y=>{var f;return y.implements&&y.implements.id===Me["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((f=y.getDefaultValue())==null?void 0:f.value)===!0}));if(!s)return{newEntities:[]};const o=n.properties.find(p=>p.implements&&p.implements.id===Me["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database),d=(i=o==null?void 0:o.dataType)==null?void 0:i.defaultValue;if(o&&(o!=null&&o.dataType)&&!d){const p=o==null?void 0:o.dataType.id.split("-id")[0],y=R({id:p+"-default-value-id",version:1,type:r.PrimitiveValue,name:v.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},n.project);return y.setParent(o==null?void 0:o.dataType),y.initChildren(),y.addSelfToProject(),{newEntities:[y]}}return{newEntities:[]}}}}),{newEntities:[]}}function Va(n,e,t){const i=t||qt(e,r.CustomEntity,n.project),a=i.split("-id"),s=a[a.length-1||0]||i,o={id:i,version:1,name:e,type:r.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[n],x:0,y:0,parent:n.project},d=ga(o,n.project);if(d.length>0)return{errors:d,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=Gb(n),y=R(o,n.project);y.setParent(n.project),y.initChildren();const f=n.properties.map(P=>{const C=s+"-"+qt(A(P,n.project),r.Property,n.project),$=P.clone(y,C);return $.abstract=!1,$.implements=P,$.setParent(y),y.addProperty($),$}),m=n.abstractMethods.map(P=>{const C=s+qt(P.name,r.FunctionDeclaration,n.project),$=P.implementAsFunctionDeclaration(C),ve={id:C+"-parent-ref-id",type:r.GenericReference,entityId:i,entityType:r.CustomEntity},tt={...$,implements:P,parent:ve},ge=R(tt,n.project);return y.addMethod(ge),ge.setParent(y),ge.initChildren(),ge.implements=P,ge});o.properties=f,o.methods=m;const b=Fb(y);return{implemented:y,errors:[],entitiesChanges:{new:[y,...p.newEntities,...b.newEntities],updated:[y],deleted:[]}}}const X=class X{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"static");l(this,"abstract");l(this,"type",r.CustomEntity);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"implements",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestedProperties",[]);l(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let i=t;if(e.parent){const p=D(e.parent);i=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:r.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:i},d=R(o,t);return d.setParent(i),d.initChildren(),d}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=UU(i,t),o=ga(i,t);a.push(...s,...o,...Ae(i));const d=i.parent?t.get(i.parent):null;if(d&&d.type===r.DataType){const p=d;p.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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.
20
20
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
21
- ${Va({describe_entity:p.entity.id})}
22
- 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:r}}get extendedProperties(){return S(this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]))}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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}}addSelfToProject(){if(this.parent.type===n.DataType){const e=this.parent;e.entity=this}else this.project.addCustomEntity(this);return this}setParent(e){return this.parent=e,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=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.methods=this.initialData.methods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.abstractMethods=this.initialData.abstractMethods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.extends=this.initialData.extends.map(e=>R(e,this.project)),this.implements=this.initialData.implements.map(e=>R(e,this.project)),this.addSuggestions(),this)}addSuggestions(){return this.implements.forEach(e=>{fU(this,e).forEach(a=>{const s=a.toJSON();s.id=`_suggestion--parent--${this.id}--${a.id}`;const o=R(s,this.project);o.suggestion=!0,o.setParent(this),o.initChildren(),this.addSuggestedProperty(o)}),mU(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),d=R(o,this.project);if(d.suggestion=!0,d.setParent(this),d.initChildren(),d.inputs.forEach(p=>{p.suggestion=!0}),d.returnStatements.length){const p=d.returnStatements[0];p.suggestion=!0,p.outputs.forEach(y=>{y.suggestion=!0})}this.addSuggestedMethod(d)})}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.methods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),{affected:S(r),removed:S(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(r=>r.toFlat(e)),...this.implements.flatMap(r=>r.toFlat(e)),...this.properties.flatMap(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(r=>r.toFlatIds(e)),...this.implements.flatMap(r=>r.toFlatIds(e)),...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{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(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),implements:this.implements.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,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(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),implements:this.implements.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.toFlatJSON(e)),...this.implements.flatMap(r=>r.toFlatJSON(e)),...this.extends.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===n.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===n.CustomEntity).flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===n.CustomEntity).flatMap(r=>r.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=hU(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(){return new X(this.toJSON(),this.project)}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return ul(this,e,t)}};l(X,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),l(X,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(X,"BASE_PROPERTIES",[...X.MUTABLE_BASE_PROPERTIES,...X.INMUTABLE_BASE_PROPERTIES]),l(X,"MUTABLE_META_PROPERTIES",[...X.MUTABLE_BASE_PROPERTIES,"x","y"]),l(X,"INMUTABLE_META_PROPERTIES",[...X.INMUTABLE_BASE_PROPERTIES]),l(X,"META_PROPERTIES",[...X.MUTABLE_META_PROPERTIES,...X.INMUTABLE_META_PROPERTIES]),l(X,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),l(X,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(X,"UPSTREAM_PROPERTIES",[...X.MUTABLE_UPSTREAM_PROPERTIES,...X.INMUTABLE_UPSTREAM_PROPERTIES]),l(X,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),l(X,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(X,"DOWNSTREAM_PROPERTIES",[...X.MUTABLE_DOWNSTREAM_PROPERTIES,...X.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(X,"PROPERTIES",[...X.META_PROPERTIES,...X.UPSTREAM_PROPERTIES,...X.DOWNSTREAM_PROPERTIES]);let si=X;function PU(i){var o;const e=YF(),t=i.toJSON();e.safeParse(t).success;const a=DU(i);(o=i.dataType)==null||o.validate();const s=[...a];if(i.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const d=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});s.push(d.error)}return s}function DU(i){const e=[];if(!i.implements)return e;const t=i.implements;if(!t.abstract){const a=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(t,i.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});e.push(a.error)}if(i.static&&!t.static){const a=W({id:`${i.id}--${_.NonStaticPropertyImplementsStatic}`,message:`Static property "${B(i,i.project)}" with id "${i.id}" implements a non-static property "${B(t,i.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:_.NonStaticPropertyImplementsStatic,entity:i});e.push(a.error)}if(!i.static&&t.static){const a=W({id:`${i.id}--${_.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${B(i,i.project)}" with id "${i.id}" implements a static property "${B(t,i.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:_.StaticPropertyImplementsNonStatic,entity:i});e.push(a.error)}if(!vo(i.dataType,t.dataType)){const a=W({id:`${i.id}--${_.PropertyImplementsIncompatibleType}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a property "${B(t,i.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:T.Error,code:_.PropertyImplementsIncompatibleType,entity:i});e.push(a.error)}return z(i.errors,e)}function SU(i,e){const t=[];if(i.parent){const a=e.get(i.parent);if(!a)t.push(new E({id:`${i.id}--${i.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${i.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const s=Gn(a);if(s){const o=a!==s?`The entity of type '${i.type}' with id '${i.id}' have 'parent' with id '${i.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${B(s,a.project)}) higher up in the tree.`:`The entity of type '${i.type}' with id '${i.id}' have 'parent' with id '${i.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${i.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:o,issue:null}))}else if(![n.CustomEntity].includes(a.type))t.push(new E({id:`${i.id}--${i.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const d=mn(a).filter(p=>!p.interactive);if(d.length){let p=d.length>1?`The entity of type '${i.type}' with id '${i.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${j(d.map(y=>B(y,y.project)),'", "','" and "')}").`:`The entity of type '${i.type}' with id '${i.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${B(d[0],d[0].project)}").`;p+=`
23
- ${Vn}`,t.push(new E({id:`${i.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:p,issue:null}))}else if(i.implements){const p=e.get(i.implements);if(i.id===i.implements)return t.push(new E({id:`${i.id}--${i.implements}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.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 E({id:`${i.id}--${i.implements}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${i.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 y=a.properties.find(f=>{var m;return((m=f.implements)==null?void 0:m.id)===i.implements});y?t.push(new E({id:`${i.id}--${v.PropertyOverwrite}`,code:v.PropertyOverwrite,severity:T.Error,message:`The property with id "${i.id}" is trying to implement the property with id "${i.implements}", but the parent entity already has a property with id '${y.id}' that implements the same base property.`,issue:null})):[n.Property].includes(p.type)?p.abstract||t.push(new E({id:`${i.id}--${i.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${i.id}--${i.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const r=Ve(i,{},e);return t.push(...r.errors),t}const pe=class pe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"private");l(this,"abstract");l(this,"index");l(this,"static");l(this,"required");l(this,"type",n.Property);l(this,"dataType",null);l(this,"implements",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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}static fromGenerationTarget(e,t){const r=D(e.parent),a=t.get(r);let s=null;if(e.implements){const p=D(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:n.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,description:e.description,implements:s,dataType:null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=SU(r,t),o=_$(r,t);return a.push(...s,...o,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
24
- 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 E({id:`${this.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
25
- ${ml}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addProperty(this),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType){const e=R(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return 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||this.abstract,this.private=e.private||this.private,this.index=e.index||this.index,this.static=e.static||this.static,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return e||this.parent.type===n.CustomEntity&&(this.parent.removeProperty(this),r.push(this.parent)),{affected:S(r),removed:S(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.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return this.parent.type===n.CustomEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e,t;return{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,abstract:this.abstract,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,implements:((t=this.implements)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,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,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,implements:((t=this.implements)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[],...((a=this.implements)==null?void 0:a.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 r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.dataType)==null?void 0:r.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){return this.errors=PU(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,r=!0){var f;const a=t||Xt(B(this,this.project),n.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,d={id:a,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:null,implements:null,parent:e||this.parent},p=qa(d,this.project);r&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",r))||null;if(y&&p.setDataType(y),this.implements){const m=this.implements.clone(e||this.parent.type===n.CustomEntity?e:null,o+"-implements-id",r);p.implements=m}return p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(pe,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),l(pe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"index"]),l(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),l(pe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let oi=pe;function AU(i){const e=iU(),t=i.toJSON();e.safeParse(t).success;const a=OU(i),s=CU(i),o=Tt(i);i.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const d=[...a,...s];if(i.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});d.push(p.error)}return z(i.errors,d)}function OU(i){const e=[];if(!i.calls.length){const t=W({id:`${i.id}--${_.ScopeWithoutLogic}`,message:`Action "${B(i,i.project)}" with id "${i.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:T.Error,code:_.ScopeWithoutLogic,entity:i});e.push(t.error)}return z(i.errors,e)}function CU(i){const e=[];return i.implements,z(i.errors,e)}const Q=class Q{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"private");l(this,"index",null);l(this,"type",n.FunctionDeclaration);l(this,"implements",null);l(this,"inputs",[]);l(this,"returnStatements",[]);l(this,"calls",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);l(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 r=t;if(e.parent){const d=D(e.parent);r=t.get(d)}let a=null;if(e.implements){const d=D(e.implements);a=t.get(d)}const s={id:e.id,version:1,name:e.name,type:n.FunctionDeclaration,index:r.type===n.CustomEntity?r.methods.length:null,description:e.description,collapsed:!1,private:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:r},o=R(s,t);return o.setParent(r),o.initChildren(),o}static validateGenerationTarget(e,t){var f;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[n.Project,n.InstalledProject,n.CustomEntity,n.Loop],optional:!0},implements:{list:!1,types:[n.ActionDescriptor],optional:!0}},t);r=s.modifiedData;const o=w$(r,t),d=r.parent?t.get(r.parent):null;if(d&&d.type===n.CustomEntity){const m=d,P=mn(m).filter(O=>!O.interactive);if(P.length){let O=P.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${j(P.map($=>B($,$.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${B(P[0],P[0].project)}").`;O+=`
26
- ${Vn}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:O,issue:null}))}else{const O=m.methods.find(tt=>{var ge;return((ge=tt.implements)==null?void 0:ge.id)===r.implements});O&&a.push(new E({id:`${r.id}--${v.MethodOverwrite}`,code:v.MethodOverwrite,severity:T.Error,message:`The '${n.FunctionDeclaration}' with id "${r.id}" is trying to implement the '${n.ActionDescriptor}' with id "${r.implements}", but the parent custom-entity already has a ${n.FunctionDeclaration} with id '${O.id}' that implements the same base method.
27
- A ${n.FunctionDeclaration} that has a parent of type '${n.CustomEntity}' is considered a method of that entity, and cannot implement the same '${n.ActionDescriptor}' more than once.
28
- ${n.ActionDescriptor} entities inside a ${n.CustomEntity} are considered abstract methods that can be implemented by ${n.FunctionDeclaration} entities inside the same parent.
29
- If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${n.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}));const $=r.implements;m.abstractMethods.find(tt=>tt.id===$)||a.push(new E({id:`${r.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`The '${n.FunctionDeclaration}' with id "${r.id}" is trying to implement the '${n.ActionDescriptor}' with id "${r.implements}", but the parent custom-entity with id "${m.id}" does not have a action descriptor (abstract method) with that id.
30
- A ${n.FunctionDeclaration} that has a parent of type '${n.CustomEntity}' 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.
21
+ ${ka({describe_entity:p.entity.id})}
22
+ 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:i}}get extendedProperties(){return S(this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]))}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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}}addSelfToProject(){if(this.parent.type===r.DataType){const e=this.parent;e.entity=this}else this.project.addCustomEntity(this);return this}setParent(e){return this.parent=e,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=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.methods=this.initialData.methods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.abstractMethods=this.initialData.abstractMethods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.extends=this.initialData.extends.map(e=>R(e,this.project)),this.implements=this.initialData.implements.map(e=>R(e,this.project)),this.addSuggestions(),this)}addSuggestions(){return this.implements.forEach(e=>{VU(this,e).forEach(a=>{const s=a.toJSON();s.id=`_suggestion--parent--${this.id}--${a.id}`;const o=R(s,this.project);o.suggestion=!0,o.setParent(this),o.initChildren(),this.addSuggestedProperty(o)}),LU(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),d=R(o,this.project);if(d.suggestion=!0,d.setParent(this),d.initChildren(),d.inputs.forEach(p=>{p.suggestion=!0}),d.returnStatements.length){const p=d.returnStatements[0];p.suggestion=!0,p.outputs.forEach(y=>{y.suggestion=!0})}this.addSuggestedMethod(d)})}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.methods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),{affected:S(i),removed:S(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(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(i=>i.toFlat(e)),...this.implements.flatMap(i=>i.toFlat(e)),...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(i=>i.toFlatIds(e)),...this.implements.flatMap(i=>i.toFlatIds(e)),...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{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(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),implements:this.implements.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,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(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),implements:this.implements.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e)),...this.implements.flatMap(i=>i.toFlatJSON(e)),...this.extends.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.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(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.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=NU(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(){return new X(this.toJSON(),this.project)}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return Va(this,e,t)}};l(X,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),l(X,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(X,"BASE_PROPERTIES",[...X.MUTABLE_BASE_PROPERTIES,...X.INMUTABLE_BASE_PROPERTIES]),l(X,"MUTABLE_META_PROPERTIES",[...X.MUTABLE_BASE_PROPERTIES,"x","y"]),l(X,"INMUTABLE_META_PROPERTIES",[...X.INMUTABLE_BASE_PROPERTIES]),l(X,"META_PROPERTIES",[...X.MUTABLE_META_PROPERTIES,...X.INMUTABLE_META_PROPERTIES]),l(X,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),l(X,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(X,"UPSTREAM_PROPERTIES",[...X.MUTABLE_UPSTREAM_PROPERTIES,...X.INMUTABLE_UPSTREAM_PROPERTIES]),l(X,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),l(X,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(X,"DOWNSTREAM_PROPERTIES",[...X.MUTABLE_DOWNSTREAM_PROPERTIES,...X.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(X,"PROPERTIES",[...X.META_PROPERTIES,...X.UPSTREAM_PROPERTIES,...X.DOWNSTREAM_PROPERTIES]);let oi=X;function jU(n){var o;const e=h4(),t=n.toJSON();e.safeParse(t).success;const a=kU(n);(o=n.dataType)==null||o.validate();const s=[...a];if(n.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const d=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});s.push(d.error)}return s}function kU(n){const e=[];if(!n.implements)return e;const t=n.implements;if(!t.abstract){const a=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});e.push(a.error)}if(n.static&&!t.static){const a=W({id:`${n.id}--${_.NonStaticPropertyImplementsStatic}`,message:`Static property "${A(n,n.project)}" with id "${n.id}" implements a non-static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:_.NonStaticPropertyImplementsStatic,entity:n});e.push(a.error)}if(!n.static&&t.static){const a=W({id:`${n.id}--${_.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${A(n,n.project)}" with id "${n.id}" implements a static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:_.StaticPropertyImplementsNonStatic,entity:n});e.push(a.error)}if(!Ea(n.dataType,t.dataType)){const a=W({id:`${n.id}--${_.PropertyImplementsIncompatibleType}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a property "${A(t,n.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:T.Error,code:_.PropertyImplementsIncompatibleType,entity:n});e.push(a.error)}return z(n.errors,e)}function qU(n,e){const t=[];if(n.parent){const a=e.get(n.parent);if(!a)t.push(new E({id:`${n.id}--${n.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const s=Fn(a);if(s){const o=a!==s?`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${A(s,a.project)}) higher up in the tree.`:`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${n.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:o,issue:null}))}else if(![r.CustomEntity].includes(a.type))t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const d=mn(a).filter(p=>!p.interactive);if(d.length){let p=d.length>1?`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${j(d.map(y=>A(y,y.project)),'", "','" and "')}").`:`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(d[0],d[0].project)}").`;p+=`
23
+ ${Ln}`,t.push(new E({id:`${n.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:p,issue:null}))}else if(n.implements){const p=e.get(n.implements);if(n.id===n.implements)return t.push(new E({id:`${n.id}--${n.implements}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.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 E({id:`${n.id}--${n.implements}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.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 y=a.properties.find(f=>{var m;return((m=f.implements)==null?void 0:m.id)===n.implements});y?t.push(new E({id:`${n.id}--${g.PropertyOverwrite}`,code:g.PropertyOverwrite,severity:T.Error,message:`The property with id "${n.id}" is trying to implement the property with id "${n.implements}", but the parent entity already has a property with id '${y.id}' that implements the same base property.`,issue:null})):[r.Property].includes(p.type)?p.abstract||t.push(new E({id:`${n.id}--${n.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${n.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const i=Ve(n,{},e);return t.push(...i.errors),t}const pe=class pe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"private");l(this,"abstract");l(this,"index");l(this,"static");l(this,"required");l(this,"type",r.Property);l(this,"dataType",null);l(this,"implements",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.implements){const p=D(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,description:e.description,implements:s,dataType:null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=qU(i,t),o=Vo(i,t);return a.push(...s,...o,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
24
+ 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 E({id:`${this.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
25
+ ${Bl}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addProperty(this),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType){const e=R(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return 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||this.abstract,this.private=e.private||this.private,this.index=e.index||this.index,this.static=e.static||this.static,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return e||this.parent.type===r.CustomEntity&&(this.parent.removeProperty(this),i.push(this.parent)),{affected:S(i),removed:S(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.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return this.parent.type===r.CustomEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e,t;return{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,abstract:this.abstract,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,implements:((t=this.implements)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,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,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,implements:((t=this.implements)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[],...((a=this.implements)==null?void 0:a.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 i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){return this.errors=jU(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,i=!0){var f;const a=t||qt(A(this,this.project),r.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,d={id:a,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:null,implements:null,parent:e||this.parent},p=Qa(d,this.project);i&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",i))||null;if(y&&p.setDataType(y),this.implements){const m=this.implements.clone(e||this.parent.type===r.CustomEntity?e:null,o+"-implements-id",i);p.implements=m}return p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(pe,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),l(pe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"index"]),l(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),l(pe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let li=pe;function JU(n){const e=PU(),t=n.toJSON();e.safeParse(t).success;const a=WU(n),s=HU(n),o=Tt(n);n.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const d=[...a,...s];if(n.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});d.push(p.error)}return z(n.errors,d)}function WU(n){const e=[];if(!n.calls.length){const t=W({id:`${n.id}--${_.ScopeWithoutLogic}`,message:`Action "${A(n,n.project)}" with id "${n.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:T.Error,code:_.ScopeWithoutLogic,entity:n});e.push(t.error)}return z(n.errors,e)}function HU(n){const e=[];return n.implements,z(n.errors,e)}const Q=class Q{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"private");l(this,"index",null);l(this,"type",r.FunctionDeclaration);l(this,"implements",null);l(this,"inputs",[]);l(this,"returnStatements",[]);l(this,"calls",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);l(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 i=t;if(e.parent){const d=D(e.parent);i=t.get(d)}let a=null;if(e.implements){const d=D(e.implements);a=t.get(d)}const s={id:e.id,version:1,name:e.name,type:r.FunctionDeclaration,index:i.type===r.CustomEntity?i.methods.length:null,description:e.description,collapsed:!1,private:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:i},o=R(s,t);return o.setParent(i),o.initChildren(),o}static validateGenerationTarget(e,t){var f;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[r.Project,r.InstalledProject,r.CustomEntity,r.Loop],optional:!0},implements:{list:!1,types:[r.ActionDescriptor],optional:!0}},t);i=s.modifiedData;const o=_o(i,t),d=i.parent?t.get(i.parent):null;if(d&&d.type===r.CustomEntity){const m=d,P=mn(m).filter(C=>!C.interactive);if(P.length){let C=P.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${j(P.map($=>A($,$.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(P[0],P[0].project)}").`;C+=`
26
+ ${Ln}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:C,issue:null}))}else{const C=m.methods.find(tt=>{var ge;return((ge=tt.implements)==null?void 0:ge.id)===i.implements});C&&a.push(new E({id:`${i.id}--${g.MethodOverwrite}`,code:g.MethodOverwrite,severity:T.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${r.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity already has a ${r.FunctionDeclaration} with id '${C.id}' that implements the same base method.
27
+ A ${r.FunctionDeclaration} that has a parent of type '${r.CustomEntity}' is considered a method of that entity, and cannot implement the same '${r.ActionDescriptor}' more than once.
28
+ ${r.ActionDescriptor} entities inside a ${r.CustomEntity} are considered abstract methods that can be implemented by ${r.FunctionDeclaration} entities inside the same parent.
29
+ If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${r.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}));const $=i.implements;m.abstractMethods.find(tt=>tt.id===$)||a.push(new E({id:`${i.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${r.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity with id "${m.id}" does not have a action descriptor (abstract method) with that id.
30
+ A ${r.FunctionDeclaration} that has a parent of type '${r.CustomEntity}' 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.
31
31
  If you want to implement a new method, you can create a new 'function-declaration' inside the parent custom-entity. But note that often custom-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 custom-entity is first created.
32
- If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${n.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}))}}else if(d&&d.type===n.Loop){const m=d.body;m&&((f=m.implements)==null?void 0:f.id)===r.implements&&a.push(new E({id:`${r.id}--${v.MethodOverwrite}`,code:v.MethodOverwrite,severity:T.Error,message:`The '${n.FunctionDeclaration}' with id "${r.id}" is being added as the 'body' of the ${n.Loop} with id "${d.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=r.parent&&t.get(r.parent)||t.getBuiltIn(r.parent),y=p?Gn(p):null;return y&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${B(y,t)}" with id '${y.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,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&(this.parent.type===n.Project?t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
32
+ If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${r.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}))}}else if(d&&d.type===r.Loop){const m=d.body;m&&((f=m.implements)==null?void 0:f.id)===i.implements&&a.push(new E({id:`${i.id}--${g.MethodOverwrite}`,code:g.MethodOverwrite,severity:T.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is being added as the 'body' of the ${r.Loop} with id "${d.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=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),y=p?Fn(p):null;return y&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${A(y,t)}" with id '${y.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,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&(this.parent.type===r.Project?t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
33
33
  This is likely an incorrect strategy because this is a globally declared '${this.type}' entity which can only have the root project as its parent.`,issue:null})):t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
34
34
  This is likely an incorrect strategy because this function declaration is a method, since it belongs to a '${this.parent.type}' entity, 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.
35
- Please consider that any updates might affect the overlap with the signature of the parent entity's action descriptors.`,issue:null}))),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===n.CustomEntity?this.parent.addMethod(this):this.parent.type===n.Loop&&this.parent.setBody(this),this}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.indexOf(e);return t!==-1&&this.inputs.splice(t,1),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.implements&&(this.implements=R(this.initialData.implements,this.project)),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.private=e.private||this.private,this.index=e.index||this.index,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),Tt(this).forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),{affected:S(r),removed:S(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(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),Tt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,x:this.x,y:this.y,collapsed:this.collapsed,private:this.private,parent:this.parent.toReference(),calls:this.calls.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),implements:((e=this.implements)==null?void 0:e.toJSON())||null,returnStatements:this.returnStatements.map(t=>t.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,collapsed:this.collapsed,private:this.private,x:this.x,y:this.y,inputs:this.inputs.map(t=>t.toReference()),calls:this.calls.map(t=>t.toReference()),returnStatements:this.returnStatements.map(t=>t.toReference()),implements:((e=this.implements)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.calls.flatMap(r=>r.toFlatJSON(e)),...this.returnStatements.flatMap(r=>r.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;const e=this.parent.type===n.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,implements:((t=this.implements)==null?void 0:t.id)||null,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.calls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=AU(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Tt(this);return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...e.flatMap(r=>r.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Q(this.toJSON(),this.project)}getVariableInstances(){return Y(this).filter(r=>r.type===n.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const r={id:t.id||L.uuid(),version:t.version||1,type:n.FunctionCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toJSON(),x:0,y:0},a=R(r,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(Q,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),l(Q,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Q,"BASE_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,...Q.INMUTABLE_BASE_PROPERTIES]),l(Q,"MUTABLE_META_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),l(Q,"INMUTABLE_META_PROPERTIES",[...Q.INMUTABLE_BASE_PROPERTIES]),l(Q,"META_PROPERTIES",[...Q.MUTABLE_META_PROPERTIES,...Q.INMUTABLE_META_PROPERTIES]),l(Q,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Q,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(Q,"UPSTREAM_PROPERTIES",[...Q.MUTABLE_UPSTREAM_PROPERTIES,...Q.INMUATABLE_UPSTREAM_PROPERTIES]),l(Q,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(Q,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),l(Q,"DOWNSTREAM_PROPERTIES",[...Q.MUTABLE_DOWNSTREAM_PROPERTIES,...Q.INMUATABLE_DOWNSTREAM_PROPERTIES]),l(Q,"PROPERTIES",[...Q.META_PROPERTIES,...Q.UPSTREAM_PROPERTIES,...Q.DOWNSTREAM_PROPERTIES]);let li=Q;function BU(i){const e=S4(),t=i.toJSON();e.safeParse(t).success;const a=[];if(i.entity&&i.andChildrenGroup||i.entity&&i.orChildrenGroup||i.andChildrenGroup&&i.orChildrenGroup){const s=W({id:i.id+"--"+_.InvalidPropertiesCombination,message:`Data type with id "${i.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:T.Error,code:_.InvalidPropertiesCombination,entity:i});a.push(s.error)}return z(i.errors,a)}function wU(i,e){const t=[],r=[n.CustomEntity,n.ActionDescriptor,n.Property,n.ArgumentDeclaration,n.ReturnDeclaration,n.VariableDeclaration,n.ValueDescriptor,n.DataType],a=`'${j(r,"', '","' or '")}'`;if(i.parent)if(i.id===i.parent)t.push(new E({id:`${i.id}--${i.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.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 s=e.get(i.parent);s?r.includes(s.type)||t.push(new E({id:`${i.id}--${i.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a parent reference that isn't pointing to an entity of type ${a}.`,issue:null})):t.push(new E({id:`${i.id}--${i.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${i.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${i.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is missing a 'parent' reference. The 'parent' of a 'data-type' entity must be a reference to an entity of type ${a}.`,issue:null}));if(i.entity){if(i.id===i.entity)return t.push(new E({id:`${i.id}--${i.entity}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to itself at 'entity'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;const s=e.get(i.entity);s?[n.CustomEntity,n.PrimitiveEntity,n.ActionDescriptor,n.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${i.id}--${i.entity}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'entity' reference that isn't pointing to an entity of type 'custom-entity', 'primitive-entity', 'action-descriptor' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${i.id}--${i.entity}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${i.entity}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return t}const ye=class ye{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"isNullable");l(this,"isList");l(this,"constant");l(this,"asType");l(this,"type",n.DataType);l(this,"options");l(this,"parentRelationType");l(this,"defaultValue",null);l(this,"entity",null);l(this,"andChildrenGroup");l(this,"orChildrenGroup");l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"inferred",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.isNullable=e.isNullable,this.isList=e.isList,this.constant=e.constant,this.asType=e.asType,this.options=e.options,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const r=D(e.parent),a=t.get(r);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,defaultValue:null,entity:s,asType:e.asType,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var p;let r=JSON.parse(JSON.stringify(e));const a=[],s=wU(r,t);if(a.push(...s,...Ae(r)),r.entity){const y=t.get(r.entity);if(y.type===n.CustomEntity){const m=mn(y).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${j(m.map(P=>P.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${r.entity}' at 'entity'. The entity extends or implements non-interactive built-in-base-entity ${b}.
36
- ${Vn}`,issue:null}))}}}const o=r.parent&&t.get(r.parent)||t.getBuiltIn(r.parent),d=o?Gn(o):null;if(d)a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${B(d,t)}" with id '${d.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null}));else if(o){const y=o.type,f=[n.Property,n.VariableDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.ValueDescriptor];if(f.includes(y)&&(r.parentRelationType&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot have a 'parentRelationType' property set of type '${y}'.
37
- The entitities of type '${j(f,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property so no 'parentRelationType' is needed.`,issue:null})),o.dataType)){const m=(p=o.dataType)==null?void 0:p.id;a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot be added as a child to the entity with id '${r.parent}' and type '${y}', because it already has a 'data-type' child with id '${m}'.
35
+ Please consider that any updates might affect the overlap with the signature of the parent entity's action descriptors.`,issue:null}))),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===r.CustomEntity?this.parent.addMethod(this):this.parent.type===r.Loop&&this.parent.setBody(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.indexOf(e);return t!==-1&&this.inputs.splice(t,1),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.implements&&(this.implements=R(this.initialData.implements,this.project)),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.private=e.private||this.private,this.index=e.index||this.index,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),Tt(this).forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),{affected:S(i),removed:S(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(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),Tt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,x:this.x,y:this.y,collapsed:this.collapsed,private:this.private,parent:this.parent.toReference(),calls:this.calls.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),implements:((e=this.implements)==null?void 0:e.toJSON())||null,returnStatements:this.returnStatements.map(t=>t.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,collapsed:this.collapsed,private:this.private,x:this.x,y:this.y,inputs:this.inputs.map(t=>t.toReference()),calls:this.calls.map(t=>t.toReference()),returnStatements:this.returnStatements.map(t=>t.toReference()),implements:((e=this.implements)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,implements:((t=this.implements)==null?void 0:t.id)||null,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=JU(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Tt(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Q(this.toJSON(),this.project)}getVariableInstances(){return Y(this).filter(i=>i.type===r.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const i={id:t.id||L.uuid(),version:t.version||1,type:r.FunctionCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toJSON(),x:0,y:0},a=R(i,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(Q,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),l(Q,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Q,"BASE_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,...Q.INMUTABLE_BASE_PROPERTIES]),l(Q,"MUTABLE_META_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),l(Q,"INMUTABLE_META_PROPERTIES",[...Q.INMUTABLE_BASE_PROPERTIES]),l(Q,"META_PROPERTIES",[...Q.MUTABLE_META_PROPERTIES,...Q.INMUTABLE_META_PROPERTIES]),l(Q,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Q,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(Q,"UPSTREAM_PROPERTIES",[...Q.MUTABLE_UPSTREAM_PROPERTIES,...Q.INMUATABLE_UPSTREAM_PROPERTIES]),l(Q,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(Q,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),l(Q,"DOWNSTREAM_PROPERTIES",[...Q.MUTABLE_DOWNSTREAM_PROPERTIES,...Q.INMUATABLE_DOWNSTREAM_PROPERTIES]),l(Q,"PROPERTIES",[...Q.META_PROPERTIES,...Q.UPSTREAM_PROPERTIES,...Q.DOWNSTREAM_PROPERTIES]);let ci=Q;function YU(n){const e=Wx(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.entity&&n.andChildrenGroup||n.entity&&n.orChildrenGroup||n.andChildrenGroup&&n.orChildrenGroup){const s=W({id:n.id+"--"+_.InvalidPropertiesCombination,message:`Data type with id "${n.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:T.Error,code:_.InvalidPropertiesCombination,entity:n});a.push(s.error)}return z(n.errors,a)}function zU(n,e){const t=[],i=[r.CustomEntity,r.ActionDescriptor,r.Property,r.ArgumentDeclaration,r.ReturnDeclaration,r.VariableDeclaration,r.ValueDescriptor,r.DataType],a=`'${j(i,"', '","' or '")}'`;if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.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 s=e.get(n.parent);s?i.includes(s.type)||t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type ${a}.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${n.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a 'data-type' entity must be a reference to an entity of type ${a}.`,issue:null}));if(n.entity){if(n.id===n.entity)return t.push(new E({id:`${n.id}--${n.entity}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'entity'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;const s=e.get(n.entity);s?[r.CustomEntity,r.PrimitiveEntity,r.ActionDescriptor,r.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${n.id}--${n.entity}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'entity' reference that isn't pointing to an entity of type 'custom-entity', 'primitive-entity', 'action-descriptor' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${n.entity}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.entity}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return t}const ye=class ye{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"isNullable");l(this,"isList");l(this,"constant");l(this,"asType");l(this,"type",r.DataType);l(this,"options");l(this,"parentRelationType");l(this,"defaultValue",null);l(this,"entity",null);l(this,"andChildrenGroup");l(this,"orChildrenGroup");l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"inferred",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.isNullable=e.isNullable,this.isList=e.isList,this.constant=e.constant,this.asType=e.asType,this.options=e.options,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,defaultValue:null,entity:s,asType:e.asType,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var p;let i=JSON.parse(JSON.stringify(e));const a=[],s=zU(i,t);if(a.push(...s,...Ae(i)),i.entity){const y=t.get(i.entity);if(y.type===r.CustomEntity){const m=mn(y).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${j(m.map(P=>P.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${i.entity}' at 'entity'. The entity extends or implements non-interactive built-in-base-entity ${b}.
36
+ ${Ln}`,issue:null}))}}}const o=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),d=o?Fn(o):null;if(d)a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${A(d,t)}" with id '${d.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null}));else if(o){const y=o.type,f=[r.Property,r.VariableDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.ValueDescriptor];if(f.includes(y)&&(i.parentRelationType&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot have a 'parentRelationType' property set of type '${y}'.
37
+ The entitities of type '${j(f,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property so no 'parentRelationType' is needed.`,issue:null})),o.dataType)){const m=(p=o.dataType)==null?void 0:p.id;a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot be added as a child to the entity with id '${i.parent}' and type '${y}', because it already has a 'data-type' child with id '${m}'.
38
38
  The entitities of type '${j(f,"', '","' 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:
39
- ${Va({describe_entity:m})}
40
- Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}y===n.ActionDescriptor&&(!r.parentRelationType||!(r.parentRelationType===xe.DynamicArgumentTypes||r.parentRelationType===xe.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'dynamic-argument-types' or 'dynamic-return-types' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})),y===n.DataType&&(!r.parentRelationType||!(r.parentRelationType===xe.AndDataTypeGroup||r.parentRelationType===xe.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.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:r}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this.parent.type===n.DataType?this.parentRelationType===xe.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===xe.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===n.ActionDescriptor?this.parentRelationType===xe.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===xe.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),this}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(r=>r.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(r=>r.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.entity)if(this.initialData.entity.type===n.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=e}else this.entity=R(this.initialData.entity,this.project);return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(e=>R(e,this.project))),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(e=>R(e,this.project))),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.isNullable=e.isNullable||this.isNullable,this.isList=e.isList||this.isList,this.constant=e.constant||this.constant,this.asType=e.asType||this.asType,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],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});r.push(...s),a.push(...o)}if(this.entity&&this.entity.type===n.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}if(!e){this.parent.type===n.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===n.DataType){if(this.parentRelationType===xe.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(d=>d.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===xe.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(d=>d.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===n.ActionDescriptor){const o=this.parent;this.parentRelationType===xe.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===xe.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();r.push(s)}return{affected:S(r),removed:S(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:r}=this.defaultValue.restore({seenEntities:e});t.push(...r)}if(this.entity&&this.entity.type===n.CustomEntity&&this.entity.parent===this){const{affected:r}=this.entity.restore({seenEntities:e});t.push(...r)}if(this.parent.type===n.DataType){const r=this.parent;Array.isArray(r.andChildrenGroup)&&r.andChildrenGroup.push(this)}if(this.parent.type===n.DataType){const r=this.parent;this.parentRelationType===xe.AndDataTypeGroup?Array.isArray(r.andChildrenGroup)&&r.andChildrenGroup.push(this):this.parentRelationType===xe.OrDataTypeGroup&&Array.isArray(r.orChildrenGroup)&&r.orChildrenGroup.push(this)}else if(this.parent.type===n.ActionDescriptor){const r=this.parent;this.parentRelationType===xe.DynamicArgumentTypes?r.setDynamicArgumentTypes(this):this.parentRelationType===xe.DynamicReturnTypes&&r.setDynamicReturnTypes(this)}else{const r=this.parent;r.setDataType(this),t.push(r)}return{affected:t,self:this}}toFlat(e=new Set){var r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.andChildrenGroup)==null?void 0:r.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 r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.andChildrenGroup)==null?void 0:r.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(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,asType:this.asType,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,parentRelationType:this.parentRelationType,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toJSON()))||null,orChildrenGroup:((r=this.orChildrenGroup)==null?void 0:r.map(s=>s.toJSON()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,isList:this.isList,isNullable:this.isNullable,options:this.options,constant:this.constant,asType:this.asType,parentRelationType:this.parentRelationType,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toReference()))||null,orChildrenGroup:((r=this.orChildrenGroup)==null?void 0:r.map(s=>s.toReference()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r,a,s,o;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.defaultValue)==null?void 0:r.toFlatJSON(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(d=>d.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(d=>d.toFlatJSON(e)))||[],...((o=this.entity)==null?void 0:o.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,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 r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.defaultValue)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==n.CustomEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,r,a;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.andChildrenGroup)==null||t.forEach(s=>s.clearErrors()),(r=this.orChildrenGroup)==null||r.forEach(s=>s.clearErrors()),this.inferred&&((a=this.entity)==null||a.clearErrors()),this}validate(){const e=BU(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,r=!0){var b,P,O;const a=this.toJSON(),s=t||Xt(P$(this),n.DataType,this.project),o=s.split("-id"),d=o[o.length-1||0]||s;a.id=s;const p=qa(a,this.project);e&&p.setParent(e),r&&p.subscribe(),p.initChildren();const y=(b=this.defaultValue)==null?void 0:b.clone(p,d+"-default-value-id",r);p.defaultValue=y||null;const f=(P=this.andChildrenGroup)==null?void 0:P.map(($,ve)=>$.clone(this,d+"-and-group-data-type-"+ve+"-id",r)),m=(O=this.orChildrenGroup)==null?void 0:O.map(($,ve)=>$.clone(this,d+"-or-group-data-type-"+ve+"-id",r));return p.andChildrenGroup=f||null,p.orChildrenGroup=m||null,p}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}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}setEntity(e){return this.entity=e,this}};l(ye,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),l(ye,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ye,"BASE_PROPERTIES",[...ye.MUTABLE_BASE_PROPERTIES,...ye.INMUTABLE_BASE_PROPERTIES]),l(ye,"MUTABLE_META_PROPERTIES",[...ye.MUTABLE_BASE_PROPERTIES,"inferred"]),l(ye,"INMUTABLE_META_PROPERTIES",[...ye.INMUTABLE_BASE_PROPERTIES]),l(ye,"META_PROPERTIES",[...ye.MUTABLE_META_PROPERTIES,...ye.INMUTABLE_META_PROPERTIES]),l(ye,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),l(ye,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(ye,"UPSTREAM_PROPERTIES",[...ye.MUTABLE_UPSTREAM_PROPERTIES,...ye.INMUTABLE_UPSTREAM_PROPERTIES]),l(ye,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),l(ye,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ye,"DOWNSTREAM_PROPERTIES",[...ye.MUTABLE_DOWNSTREAM_PROPERTIES,...ye.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ye,"PROPERTIES",[...ye.META_PROPERTIES,...ye.UPSTREAM_PROPERTIES,...ye.DOWNSTREAM_PROPERTIES]);let Oa=ye;function MU(i){var d;const e=o4(),t=i.toJSON();e.safeParse(t).success;const a=_U(i),s=hn(i),o=[...a,...s];if(i.id==="exec-sequentially-operation-call-id"){const p=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});o.push(p.error)}return i.outputs.forEach(p=>p.validate()),(d=i.error)==null||d.validate(),z(i.errors,o)}function _U(i){const e=[];return i.inputs.forEach(t=>{t.validate()}),i.dynamicArguments.forEach(t=>{t.validate()}),z(i.errors,e)}const K=class K{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.Operation);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"dynamicArguments",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 r=t;if(e.parent){const m=D(e.parent);r=t.get(m)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=D(m);return t.get(b)}),d=e.calledBySuccess.map(m=>{const b=D(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=D(m);return t.get(b)}),y={id:e.id,version:1,type:n.Operation,declaration:s,calledByEntry:o,calledBySuccess:d,calledByError:p,errorCalls:[],successCalls:[],dynamicArguments:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:r},f=R(y,t);return f.setParent(r),f.initChildren(),f}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...it,n.Project],optional:!0}},t);r=s.modifiedData,a.push(...s.errors,...Ae(r));const o=D(r.declaration);if(o){const d=c8(o,t);a.push(...d)}else{const d=`
39
+ ${ka({describe_entity:m})}
40
+ Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}y===r.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===xe.DynamicArgumentTypes||i.parentRelationType===xe.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'dynamic-argument-types' or 'dynamic-return-types' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})),y===r.DataType&&(!i.parentRelationType||!(i.parentRelationType===xe.AndDataTypeGroup||i.parentRelationType===xe.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.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:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this.parent.type===r.DataType?this.parentRelationType===xe.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===xe.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===r.ActionDescriptor?this.parentRelationType===xe.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===xe.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),this}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(i=>i.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(i=>i.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.entity)if(this.initialData.entity.type===r.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=e}else this.entity=R(this.initialData.entity,this.project);return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(e=>R(e,this.project))),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(e=>R(e,this.project))),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.isNullable=e.isNullable||this.isNullable,this.isList=e.isList||this.isList,this.constant=e.constant||this.constant,this.asType=e.asType||this.asType,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],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});i.push(...s),a.push(...o)}if(this.entity&&this.entity.type===r.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}if(!e){this.parent.type===r.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===r.DataType){if(this.parentRelationType===xe.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(d=>d.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===xe.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(d=>d.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===r.ActionDescriptor){const o=this.parent;this.parentRelationType===xe.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===xe.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();i.push(s)}return{affected:S(i),removed:S(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:i}=this.defaultValue.restore({seenEntities:e});t.push(...i)}if(this.entity&&this.entity.type===r.CustomEntity&&this.entity.parent===this){const{affected:i}=this.entity.restore({seenEntities:e});t.push(...i)}if(this.parent.type===r.DataType){const i=this.parent;Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this)}if(this.parent.type===r.DataType){const i=this.parent;this.parentRelationType===xe.AndDataTypeGroup?Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this):this.parentRelationType===xe.OrDataTypeGroup&&Array.isArray(i.orChildrenGroup)&&i.orChildrenGroup.push(this)}else if(this.parent.type===r.ActionDescriptor){const i=this.parent;this.parentRelationType===xe.DynamicArgumentTypes?i.setDynamicArgumentTypes(this):this.parentRelationType===xe.DynamicReturnTypes&&i.setDynamicReturnTypes(this)}else{const i=this.parent;i.setDataType(this),t.push(i)}return{affected:t,self:this}}toFlat(e=new Set){var i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.andChildrenGroup)==null?void 0:i.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 i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.andChildrenGroup)==null?void 0:i.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(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,asType:this.asType,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,parentRelationType:this.parentRelationType,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toJSON()))||null,orChildrenGroup:((i=this.orChildrenGroup)==null?void 0:i.map(s=>s.toJSON()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,isList:this.isList,isNullable:this.isNullable,options:this.options,constant:this.constant,asType:this.asType,parentRelationType:this.parentRelationType,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toReference()))||null,orChildrenGroup:((i=this.orChildrenGroup)==null?void 0:i.map(s=>s.toReference()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i,a,s,o;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.defaultValue)==null?void 0:i.toFlatJSON(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(d=>d.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(d=>d.toFlatJSON(e)))||[],...((o=this.entity)==null?void 0:o.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,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 i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.defaultValue)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==r.CustomEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,i,a;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.andChildrenGroup)==null||t.forEach(s=>s.clearErrors()),(i=this.orChildrenGroup)==null||i.forEach(s=>s.clearErrors()),this.inferred&&((a=this.entity)==null||a.clearErrors()),this}validate(){const e=YU(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,i=!0){var b,P,C;const a=this.toJSON(),s=t||qt(OE(this),r.DataType,this.project),o=s.split("-id"),d=o[o.length-1||0]||s;a.id=s;const p=Qa(a,this.project);e&&p.setParent(e),i&&p.subscribe(),p.initChildren();const y=(b=this.defaultValue)==null?void 0:b.clone(p,d+"-default-value-id",i);p.defaultValue=y||null;const f=(P=this.andChildrenGroup)==null?void 0:P.map(($,ve)=>$.clone(this,d+"-and-group-data-type-"+ve+"-id",i)),m=(C=this.orChildrenGroup)==null?void 0:C.map(($,ve)=>$.clone(this,d+"-or-group-data-type-"+ve+"-id",i));return p.andChildrenGroup=f||null,p.orChildrenGroup=m||null,p}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}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}setEntity(e){return this.entity=e,this}};l(ye,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),l(ye,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ye,"BASE_PROPERTIES",[...ye.MUTABLE_BASE_PROPERTIES,...ye.INMUTABLE_BASE_PROPERTIES]),l(ye,"MUTABLE_META_PROPERTIES",[...ye.MUTABLE_BASE_PROPERTIES,"inferred"]),l(ye,"INMUTABLE_META_PROPERTIES",[...ye.INMUTABLE_BASE_PROPERTIES]),l(ye,"META_PROPERTIES",[...ye.MUTABLE_META_PROPERTIES,...ye.INMUTABLE_META_PROPERTIES]),l(ye,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),l(ye,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(ye,"UPSTREAM_PROPERTIES",[...ye.MUTABLE_UPSTREAM_PROPERTIES,...ye.INMUTABLE_UPSTREAM_PROPERTIES]),l(ye,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),l(ye,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ye,"DOWNSTREAM_PROPERTIES",[...ye.MUTABLE_DOWNSTREAM_PROPERTIES,...ye.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ye,"PROPERTIES",[...ye.META_PROPERTIES,...ye.UPSTREAM_PROPERTIES,...ye.DOWNSTREAM_PROPERTIES]);let La=ye;function ZU(n){var d;const e=Ax(),t=n.toJSON();e.safeParse(t).success;const a=XU(n),s=hn(n),o=[...a,...s];if(n.id==="exec-sequentially-operation-call-id"){const p=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});o.push(p.error)}return n.outputs.forEach(p=>p.validate()),(d=n.error)==null||d.validate(),z(n.errors,o)}function XU(n){const e=[];return n.inputs.forEach(t=>{t.validate()}),n.dynamicArguments.forEach(t=>{t.validate()}),z(n.errors,e)}const K=class K{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Operation);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"dynamicArguments",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 i=t;if(e.parent){const m=D(e.parent);i=t.get(m)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=D(m);return t.get(b)}),d=e.calledBySuccess.map(m=>{const b=D(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=D(m);return t.get(b)}),y={id:e.id,version:1,type:r.Operation,declaration:s,calledByEntry:o,calledBySuccess:d,calledByError:p,errorCalls:[],successCalls:[],dynamicArguments:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...it,r.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,...Ae(i));const o=D(i.declaration);if(o){const d=A8(o,t);a.push(...d)}else{const d=`
41
41
  All built-in 'action-descriptor' entity ids are:
42
- - ${t.operationDeclarations.map(p=>`${p.id} (${B(p,t)})`).join(`
42
+ - ${t.operationDeclarations.map(p=>`${p.id} (${A(p,t)})`).join(`
43
43
  - `)}.
44
- `;a.push(new E({id:`${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.Operation}" with id "${r.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'action-descriptor' entity.
45
- References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${d}`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
44
+ `;a.push(new E({id:`${i.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${r.Operation}" with id "${i.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'action-descriptor' entity.
45
+ References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${d}`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
46
46
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
47
- 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}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addOperation(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==n.InternalCall&&t.setParent(this.parent),t.initChildren(),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const r=[],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:d}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}if(this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),this.outputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),this.error){const{affected:o,removed:d}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:S(r),removed:S(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.dynamicArguments.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.process?this.process.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.dynamicArguments.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON(),dynamicArguments:this.dynamicArguments.map(r=>r.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),dynamicArguments:this.dynamicArguments.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.dynamicArguments.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===n.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){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.dynamicArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),this.dynamicArguments.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=MU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.dynamicArguments.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){return new K(this.toJSON(),this.project)}};l(K,"MUTABLE_BASE_PROPERTIES",[]),l(K,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(K,"BASE_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,...K.INMUTABLE_BASE_PROPERTIES]),l(K,"MUTABLE_META_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,"x","y"]),l(K,"INMUTABLE_META_PROPERTIES",[...K.INMUTABLE_BASE_PROPERTIES]),l(K,"META_PROPERTIES",[...K.MUTABLE_META_PROPERTIES,...K.INMUTABLE_META_PROPERTIES]),l(K,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(K,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(K,"UPSTREAM_PROPERTIES",[...K.MUTABLE_UPSTREAM_PROPERTIES,...K.INMUTABLE_UPSTREAM_PROPERTIES]),l(K,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error","dynamicArguments"]),l(K,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(K,"DOWNSTREAM_PROPERTIES",[...K.MUTABLE_DOWNSTREAM_PROPERTIES,...K.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(K,"PROPERTIES",[...K.META_PROPERTIES,...K.UPSTREAM_PROPERTIES,...K.DOWNSTREAM_PROPERTIES]);let ci=K;function NU(i){const e=W4(),t=i.toJSON();e.safeParse(t).success;const a=Tt(i);i.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return z(i.errors,s)}const ee=class ee{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"type",n.GlobalEvent);l(this,"inputs",[]);l(this,"calls",[]);l(this,"returnStatements",[]);l(this,"parent");l(this,"implements");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.collapsed=e.collapsed}static fromGenerationTarget(e,t){let r=t;if(e.parent){const d=D(e.parent);r=t.get(d)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:n.GlobalEvent,collapsed:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:r},o=R(s,t);return o.setParent(r),o.initChildren(),o}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{},t);if(r=s.modifiedData,a.push(...s.errors,...Ae(r)),!e.implements)a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'implements' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for 'global-event' entities.
48
- ${El(t)}`,issue:null}));else if(!t.get(e.implements))a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't found in the project. The 'implements' property must point to one of the built-in action descriptors reserved for 'global-event' entities.
49
- ${El(t)}`,issue:null}));else if(!t.globalEventActionDescriptors.find(p=>p.id===e.implements))a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't pointing to an action descriptor reserved for 'global-event' entities.
50
- ${El(t)}`,issue:null}));else{const p=t.events.find(y=>y.implements.id===e.implements);p&&a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that points to an action descriptor that is already implemented by another global event with id '${p.id}' in the project. Each global event must implement a unique action descriptor.
51
- You can attach new logic to the existing 'global-event' but creating a new callable entity that gets called by it.`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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}}addSelfToProject(){return this.project.addGlobalEvent(this),this}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.findIndex(r=>r.id===e.id);return t>-1&&this.inputs.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),t.type!==n.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.implements=R(this.initialData.implements,this.project),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.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),Tt(this).forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),{affected:S(r),removed:S(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(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),Tt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,x:this.x,y:this.y,collapsed:this.collapsed,implements:this.implements.toJSON(),returnStatements:this.returnStatements.map(e=>e.toJSON()),inputs:this.inputs.map(e=>e.toJSON()),calls:this.calls.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,collapsed:this.collapsed,x:this.x,y:this.y,implements:this.implements.toReference(),inputs:this.inputs.map(e=>e.toReference()),calls:this.calls.map(e=>e.toReference()),returnStatements:this.returnStatements.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.calls.flatMap(r=>r.toFlatJSON(e)),...this.returnStatements.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.calls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=NU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Tt(this);return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...e.flatMap(r=>r.getErrors())]}getShallowErrors(){return this.errors}clone(){return new ee(this.toJSON(),this.project)}getVariableInstances(){return Y(this).filter(r=>r.type===n.VariableInstance)}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(ee,"MUTABLE_BASE_PROPERTIES",["description"]),l(ee,"INMUTABLE_BASE_PROPERTIES",["id","version","name","type"]),l(ee,"BASE_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"MUTABLE_META_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,"x","y","collapsed"]),l(ee,"INMUTABLE_META_PROPERTIES",[...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"META_PROPERTIES",[...ee.MUTABLE_META_PROPERTIES,...ee.INMUTABLE_META_PROPERTIES]),l(ee,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(ee,"UPSTREAM_PROPERTIES",[...ee.MUTABLE_UPSTREAM_PROPERTIES,...ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ee,"DOWNSTREAM_PROPERTIES",[...ee.MUTABLE_DOWNSTREAM_PROPERTIES,...ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ee,"PROPERTIES",[...ee.META_PROPERTIES,...ee.UPSTREAM_PROPERTIES,...ee.DOWNSTREAM_PROPERTIES]);let Ca=ee;function VU(i){var o,d;const e=ox(),t=i.toJSON();e.safeParse(t).success,i.inputs.forEach(p=>p.validate()),i.outputs.forEach(p=>p.validate()),(o=i.error)==null||o.validate(),(d=i.body)==null||d.validate();const s=[...hn(i)];if(i.id==="iterate-over-list-loop-id"){const p=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});s.push(p.error)}return z(i.errors,s)}const te=class te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.Loop);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"breakStatements",[]);l(this,"continueStatements",[]);l(this,"body");l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(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 r=t;if(e.parent){const m=D(e.parent);r=t.get(m)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=D(m);return t.get(b)}),d=e.calledBySuccess.map(m=>{const b=D(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=D(m);return t.get(b)}),y={id:e.id,version:1,type:n.Loop,declaration:s,calledByEntry:o,calledBySuccess:d,calledByError:p,process:null,errorCalls:[],successCalls:[],inputs:[],outputs:[],body:null,breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:r},f=R(y,t);return f.setParent(r),f.initChildren(),f}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...it,n.Project],optional:!0},declaration:{list:!1,types:[n.ActionDescriptor]}},t);return r=s.modifiedData,a.push(...s.errors,...Ae(r)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${n.Condition}' entities.
52
- ${Rl(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 '${n.Condition}' entities.
53
- ${Rl(t)}`,issue:null})):a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.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 '${n.Condition}' entities.
54
- ${Rl(t)}`,issue:null})),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
47
+ 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}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addOperation(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.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(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==r.InternalCall&&t.setParent(this.parent),t.initChildren(),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],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:d}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}if(this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.outputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.error){const{affected:o,removed:d}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(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:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.dynamicArguments.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.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(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.dynamicArguments.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON(),dynamicArguments:this.dynamicArguments.map(i=>i.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),dynamicArguments:this.dynamicArguments.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.dynamicArguments.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.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){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.dynamicArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),this.dynamicArguments.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=ZU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.dynamicArguments.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){return new K(this.toJSON(),this.project)}};l(K,"MUTABLE_BASE_PROPERTIES",[]),l(K,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(K,"BASE_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,...K.INMUTABLE_BASE_PROPERTIES]),l(K,"MUTABLE_META_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,"x","y"]),l(K,"INMUTABLE_META_PROPERTIES",[...K.INMUTABLE_BASE_PROPERTIES]),l(K,"META_PROPERTIES",[...K.MUTABLE_META_PROPERTIES,...K.INMUTABLE_META_PROPERTIES]),l(K,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(K,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(K,"UPSTREAM_PROPERTIES",[...K.MUTABLE_UPSTREAM_PROPERTIES,...K.INMUTABLE_UPSTREAM_PROPERTIES]),l(K,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error","dynamicArguments"]),l(K,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(K,"DOWNSTREAM_PROPERTIES",[...K.MUTABLE_DOWNSTREAM_PROPERTIES,...K.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(K,"PROPERTIES",[...K.META_PROPERTIES,...K.UPSTREAM_PROPERTIES,...K.DOWNSTREAM_PROPERTIES]);let di=K;function QU(n){const e=pU(),t=n.toJSON();e.safeParse(t).success;const a=Tt(n);n.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return z(n.errors,s)}const ee=class ee{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"type",r.GlobalEvent);l(this,"inputs",[]);l(this,"calls",[]);l(this,"returnStatements",[]);l(this,"parent");l(this,"implements");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.collapsed=e.collapsed}static fromGenerationTarget(e,t){let i=t;if(e.parent){const d=D(e.parent);i=t.get(d)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:r.GlobalEvent,collapsed:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:i},o=R(s,t);return o.setParent(i),o.initChildren(),o}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{},t);if(i=s.modifiedData,a.push(...s.errors,...Ae(i)),!e.implements)a.push(new E({id:`${e.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'implements' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for 'global-event' entities.
48
+ ${Ml(t)}`,issue:null}));else if(!t.get(e.implements))a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't found in the project. The 'implements' property must point to one of the built-in action descriptors reserved for 'global-event' entities.
49
+ ${Ml(t)}`,issue:null}));else if(!t.globalEventActionDescriptors.find(p=>p.id===e.implements))a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't pointing to an action descriptor reserved for 'global-event' entities.
50
+ ${Ml(t)}`,issue:null}));else{const p=t.events.find(y=>y.implements.id===e.implements);p&&a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that points to an action descriptor that is already implemented by another global event with id '${p.id}' in the project. Each global event must implement a unique action descriptor.
51
+ You can attach new logic to the existing 'global-event' but creating a new callable entity that gets called by it.`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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}}addSelfToProject(){return this.project.addGlobalEvent(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.implements=R(this.initialData.implements,this.project),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.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),Tt(this).forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),{affected:S(i),removed:S(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(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),Tt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Tt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,x:this.x,y:this.y,collapsed:this.collapsed,implements:this.implements.toJSON(),returnStatements:this.returnStatements.map(e=>e.toJSON()),inputs:this.inputs.map(e=>e.toJSON()),calls:this.calls.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,collapsed:this.collapsed,x:this.x,y:this.y,implements:this.implements.toReference(),inputs:this.inputs.map(e=>e.toReference()),calls:this.calls.map(e=>e.toReference()),returnStatements:this.returnStatements.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=QU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Tt(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(){return new ee(this.toJSON(),this.project)}getVariableInstances(){return Y(this).filter(i=>i.type===r.VariableInstance)}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(ee,"MUTABLE_BASE_PROPERTIES",["description"]),l(ee,"INMUTABLE_BASE_PROPERTIES",["id","version","name","type"]),l(ee,"BASE_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"MUTABLE_META_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,"x","y","collapsed"]),l(ee,"INMUTABLE_META_PROPERTIES",[...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"META_PROPERTIES",[...ee.MUTABLE_META_PROPERTIES,...ee.INMUTABLE_META_PROPERTIES]),l(ee,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(ee,"UPSTREAM_PROPERTIES",[...ee.MUTABLE_UPSTREAM_PROPERTIES,...ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ee,"DOWNSTREAM_PROPERTIES",[...ee.MUTABLE_DOWNSTREAM_PROPERTIES,...ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ee,"PROPERTIES",[...ee.META_PROPERTIES,...ee.UPSTREAM_PROPERTIES,...ee.DOWNSTREAM_PROPERTIES]);let $a=ee;function KU(n){var o,d;const e=A4(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),(o=n.error)==null||o.validate(),(d=n.body)==null||d.validate();const s=[...hn(n)];if(n.id==="iterate-over-list-loop-id"){const p=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});s.push(p.error)}return z(n.errors,s)}const te=class te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Loop);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"breakStatements",[]);l(this,"continueStatements",[]);l(this,"body");l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(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 i=t;if(e.parent){const m=D(e.parent);i=t.get(m)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=D(m);return t.get(b)}),d=e.calledBySuccess.map(m=>{const b=D(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=D(m);return t.get(b)}),y={id:e.id,version:1,type:r.Loop,declaration:s,calledByEntry:o,calledBySuccess:d,calledByError:p,process:null,errorCalls:[],successCalls:[],inputs:[],outputs:[],body:null,breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...it,r.Project],optional:!0},declaration:{list:!1,types:[r.ActionDescriptor]}},t);return i=s.modifiedData,a.push(...s.errors,...Ae(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${r.Condition}' entities.
52
+ ${_l(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 '${r.Condition}' entities.
53
+ ${_l(t)}`,issue:null})):a.push(new E({id:`${e.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.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 '${r.Condition}' entities.
54
+ ${_l(t)}`,issue:null})),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
55
55
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
56
- 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}}addSelfToProject(){return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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 r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.body&&(this.body=R(this.initialData.body,this.project),this.body.setParent(this),this.body.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.body.restore({seenEntities:e}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(r=>r.toFlat(e)),...this.breakStatements.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(r=>r.toFlatIds(e)),...this.breakStatements.flatMap(r=>r.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:((e=this.process)==null?void 0:e.toJSON())||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,body:this.body.toJSON(),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(r=>r.toJSON()),continueStatements:this.continueStatements.map(r=>r.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,body:((t=this.body)==null?void 0:t.toReference())||null,inputs:this.inputs.map(s=>s.toReference()),outputs:this.outputs.map(s=>s.toReference()),successCalls:this.successCalls.map(s=>s.toReference()),errorCalls:this.errorCalls.map(s=>s.toReference()),process:((r=this.process)==null?void 0:r.toReference())||null,calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),continueStatements:this.continueStatements.map(s=>s.toReference()),breakStatements:this.breakStatements.map(s=>s.toReference()),error:((a=this.error)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.body)==null?void 0:r.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===n.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 r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.body)==null?void 0:r.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(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),this.continueStatements.forEach(r=>r.clearErrors()),this.breakStatements.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=VU(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){return new te(this.toJSON(),this.project)}getVariableInstances(){return this.body?Y(this.body).filter(r=>r.type===n.VariableInstance):[]}addReturnStatement(e){return this.body.addReturnStatement(e),this}removeReturnStatement(e){return this.body.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}};l(te,"MUTABLE_BASE_PROPERTIES",[]),l(te,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(te,"BASE_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,...te.INMUTABLE_BASE_PROPERTIES]),l(te,"MUTABLE_META_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,"x","y"]),l(te,"INMUTABLE_META_PROPERTIES",[...te.INMUTABLE_BASE_PROPERTIES]),l(te,"META_PROPERTIES",[...te.MUTABLE_META_PROPERTIES,...te.INMUTABLE_META_PROPERTIES]),l(te,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(te,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(te,"UPSTREAM_PROPERTIES",[...te.MUTABLE_UPSTREAM_PROPERTIES,...te.INMUTABLE_UPSTREAM_PROPERTIES]),l(te,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","successCalls","errorCalls","error","breakStatements","continueStatements"]),l(te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(te,"DOWNSTREAM_PROPERTIES",[...te.MUTABLE_DOWNSTREAM_PROPERTIES,...te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(te,"PROPERTIES",[...te.META_PROPERTIES,...te.UPSTREAM_PROPERTIES,...te.DOWNSTREAM_PROPERTIES]);let di=te;function LU(i){const e=Yx(),t=i.toJSON();e.safeParse(t).success,i.inputs.forEach(o=>o.validate());const s=[...hn(i)];return z(i.errors,s)}const he=class he{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.Condition);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"declaration");l(this,"inputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(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 r=t;if(e.parent){const f=D(e.parent);r=t.get(f)}const a=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=D(f);return t.get(m)});let d;if(e.declaration){const f=D(e.declaration);d=t.get(f)}const p={id:e.id,version:1,type:n.Condition,declaration:d,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:r},y=R(p,t);return y.setParent(r),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...it,n.Project],optional:!0}},t);return r=s.modifiedData,a.push(...s.errors,...Ae(r)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${n.Condition}' entities.
57
- ${bl(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 '${n.Condition}' entities.
58
- ${bl(t)}`,issue:null})):a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.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 '${n.Condition}' entities.
59
- ${bl(t)}`,issue:null})),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
60
- 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}}addSelfToProject(){return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(r=>r.toFlat(e)),...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(e=>e.toJSON()),errorCalls:this.errorCalls.map(e=>e.toJSON()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),inputs:this.inputs.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(),inputs:this.inputs.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===n.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(r=>r.toFlatGenerationTarget(e)),...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.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=LU(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){return new he(this.toJSON(),this.project)}};l(he,"MUTABLE_BASE_PROPERTIES",["operator"]),l(he,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),l(he,"MUTABLE_META_PROPERTIES",["x","y"]),l(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),l(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),l(he,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(he,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),l(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),l(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let ui=he;class Ba{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==n.GenericReference&&(e.readsValue=R(e.initialData.readsValue,e.project),_e.includes(e.readsValue.type))){let t=e.parent;it.includes(t.type)||(t=t.parent),e.readsValue.setParent(t),e.readsValue.addValueReader(e),e.readsValue.initChildren(),t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):t.subscribeDetachedChild(e.readsValue)}return e.readsValue}}class wa{static initWritesValues(e,t){const r=e.initialData.writesValues.reduce((s,o)=>{if(o.type===n.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const d=R(o,e.project);return d.setValueWriter(e),_e.includes(d.type)&&(d.setParent(t),d.initChildren()),[...s,d]},[]),a=[...e.writesValues];return e.writesValues=S([...a,...r]),e.writesValues}}function $U(i){var o;const e=w4(),t=i.toJSON();e.safeParse(t).success,(o=i.dataType)==null||o.validate(),i.inputs.forEach(d=>d.validate()),i.outputs.forEach(d=>d.validate()),i.internalCalls.forEach(d=>d.validate());const s=[...hn(i)];if(i.id==="random-company-employee-test-variable-id"){const d=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});s.push(d.error)}if(i.id==="company-dto-variable-one-id"){const d=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});s.push(d.error)}return z(i.errors,s)}const ne=class ne{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"dataType",null);l(this,"x");l(this,"y");l(this,"type",n.VariableDeclaration);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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}static fromGenerationTarget(e,t){let r=t;if(e.parent){const f=D(e.parent);r=t.get(f)}const a=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=D(f);return t.get(m)});let d=null;if(e.readsValue){const f=D(e.readsValue);d=t.get(f)}const p={id:e.id,version:1,type:n.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:d,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:r},y=R(p,t);return y.setParent(r),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...it,n.Project],optional:!0}},t);r=s.modifiedData;const o=M$(r,t);return a.push(...s.errors,...o,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=La(r,this);return r=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
56
+ 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}}addSelfToProject(){return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.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(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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 i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.body&&(this.body=R(this.initialData.body,this.project),this.body.setParent(this),this.body.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(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(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.body.restore({seenEntities:e}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(i=>i.toFlat(e)),...this.breakStatements.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(i=>i.toFlatIds(e)),...this.breakStatements.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:((e=this.process)==null?void 0:e.toJSON())||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,body:this.body.toJSON(),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(i=>i.toJSON()),continueStatements:this.continueStatements.map(i=>i.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,body:((t=this.body)==null?void 0:t.toReference())||null,inputs:this.inputs.map(s=>s.toReference()),outputs:this.outputs.map(s=>s.toReference()),successCalls:this.successCalls.map(s=>s.toReference()),errorCalls:this.errorCalls.map(s=>s.toReference()),process:((i=this.process)==null?void 0:i.toReference())||null,calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),continueStatements:this.continueStatements.map(s=>s.toReference()),breakStatements:this.breakStatements.map(s=>s.toReference()),error:((a=this.error)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.body)==null?void 0:i.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===r.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 i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.body)==null?void 0:i.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(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),this.continueStatements.forEach(i=>i.clearErrors()),this.breakStatements.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=KU(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){return new te(this.toJSON(),this.project)}getVariableInstances(){return this.body?Y(this.body).filter(i=>i.type===r.VariableInstance):[]}addReturnStatement(e){return this.body.addReturnStatement(e),this}removeReturnStatement(e){return this.body.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}};l(te,"MUTABLE_BASE_PROPERTIES",[]),l(te,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(te,"BASE_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,...te.INMUTABLE_BASE_PROPERTIES]),l(te,"MUTABLE_META_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,"x","y"]),l(te,"INMUTABLE_META_PROPERTIES",[...te.INMUTABLE_BASE_PROPERTIES]),l(te,"META_PROPERTIES",[...te.MUTABLE_META_PROPERTIES,...te.INMUTABLE_META_PROPERTIES]),l(te,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(te,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(te,"UPSTREAM_PROPERTIES",[...te.MUTABLE_UPSTREAM_PROPERTIES,...te.INMUTABLE_UPSTREAM_PROPERTIES]),l(te,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","successCalls","errorCalls","error","breakStatements","continueStatements"]),l(te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(te,"DOWNSTREAM_PROPERTIES",[...te.MUTABLE_DOWNSTREAM_PROPERTIES,...te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(te,"PROPERTIES",[...te.META_PROPERTIES,...te.UPSTREAM_PROPERTIES,...te.DOWNSTREAM_PROPERTIES]);let ui=te;function e8(n){const e=hx(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate());const s=[...hn(n)];return z(n.errors,s)}const he=class he{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Condition);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"declaration");l(this,"inputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(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 i=t;if(e.parent){const f=D(e.parent);i=t.get(f)}const a=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=D(f);return t.get(m)});let d;if(e.declaration){const f=D(e.declaration);d=t.get(f)}const p={id:e.id,version:1,type:r.Condition,declaration:d,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:i},y=R(p,t);return y.setParent(i),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...it,r.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,...Ae(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${r.Condition}' entities.
57
+ ${Nl(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 '${r.Condition}' entities.
58
+ ${Nl(t)}`,issue:null})):a.push(new E({id:`${e.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.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 '${r.Condition}' entities.
59
+ ${Nl(t)}`,issue:null})),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
60
+ 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}}addSelfToProject(){return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(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(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(i=>i.toFlat(e)),...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(e=>e.toJSON()),errorCalls:this.errorCalls.map(e=>e.toJSON()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),inputs:this.inputs.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(),inputs:this.inputs.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.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(i=>i.toFlatGenerationTarget(e)),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.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=e8(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){return new he(this.toJSON(),this.project)}};l(he,"MUTABLE_BASE_PROPERTIES",["operator"]),l(he,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),l(he,"MUTABLE_META_PROPERTIES",["x","y"]),l(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),l(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),l(he,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(he,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),l(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),l(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let pi=he;class Ga{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==r.GenericReference&&(e.readsValue=R(e.initialData.readsValue,e.project),_e.includes(e.readsValue.type))){let t=e.parent;it.includes(t.type)||(t=t.parent),e.readsValue.setParent(t),e.readsValue.addValueReader(e),e.readsValue.initChildren(),t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):t.subscribeDetachedChild(e.readsValue)}return e.readsValue}}class Fa{static initWritesValues(e,t){const i=e.initialData.writesValues.reduce((s,o)=>{if(o.type===r.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const d=R(o,e.project);return d.setValueWriter(e),_e.includes(d.type)&&(d.setParent(t),d.initChildren()),[...s,d]},[]),a=[...e.writesValues];return e.writesValues=S([...a,...i]),e.writesValues}}function t8(n){var o;const e=Xx(),t=n.toJSON();e.safeParse(t).success,(o=n.dataType)==null||o.validate(),n.inputs.forEach(d=>d.validate()),n.outputs.forEach(d=>d.validate()),n.internalCalls.forEach(d=>d.validate());const s=[...hn(n)];if(n.id==="random-company-employee-test-variable-id"){const d=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});s.push(d.error)}if(n.id==="company-dto-variable-one-id"){const d=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});s.push(d.error)}return z(n.errors,s)}const ne=class ne{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"dataType",null);l(this,"x");l(this,"y");l(this,"type",r.VariableDeclaration);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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}static fromGenerationTarget(e,t){let i=t;if(e.parent){const f=D(e.parent);i=t.get(f)}const a=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=D(f);return t.get(m)});let d=null;if(e.readsValue){const f=D(e.readsValue);d=t.get(f)}const p={id:e.id,version:1,type:r.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:d,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},y=R(p,t);return y.setParent(i),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...it,r.Project],optional:!0}},t);i=s.modifiedData;const o=No(i,t);return a.push(...s.errors,...o,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=qa(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
61
61
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
62
62
  Specifically for variables, their scope is also calculated from their value readers and value writters.
63
- 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:r}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),wa.initWritesValues(this,this.parent),Ba.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.internalCalls=this.initialData.internalCalls.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this)}setValueWriter(e){return this.readsValue=e,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.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),Ii(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.internalCalls.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e)),...this.successCalls.flatMap(a=>a.toFlat(e)),...this.errorCalls.flatMap(a=>a.toFlat(e)),...this.inputs.flatMap(a=>a.toFlat(e)),...this.outputs.flatMap(a=>a.toFlat(e)),...this.internalCalls.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.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(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toJSON()),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),internalCalls:this.internalCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toReference()),inputs:this.inputs.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toReference()),successCalls:this.successCalls.map(r=>r.toReference()),errorCalls:this.errorCalls.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),internalCalls:this.internalCalls.map(r=>r.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.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.internalCalls.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===n.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 r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.dataType)==null?void 0:r.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.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.internalCalls.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],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()),(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=$U(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,r;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((r=this.readsValue)==null?void 0:r.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ne(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const r={id:t.id||L.uuid(),version:t.version||1,type:n.VariableInstance,parent:e.toReference(),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=R(r,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(this.dataType.entity.type===n.CustomEntity)return this.dataType.entity.properties.filter(r=>!this.inputs.find(a=>a.declaration===r)).map(r=>{const a={id:L.uuid(),version:1,type:n.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:r,defaultValue:null,index:r.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if(this.dataType.entity.type===n.CustomEntity)return this.dataType.entity.properties.filter(r=>!this.outputs.find(a=>a.declaration===r)).map(r=>{const a={id:L.uuid(),version:1,type:n.OutputMap,parent:this.toReference(),declaration:r,index:r.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType||null}};l(ne,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ne,"BASE_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"MUTABLE_META_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ne,"INMUTABLE_META_PROPERTIES",[...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"META_PROPERTIES",[...ne.MUTABLE_META_PROPERTIES,...ne.INMUTABLE_META_PROPERTIES]),l(ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(ne,"UPSTREAM_PROPERTIES",[...ne.MUTABLE_UPSTREAM_PROPERTIES,...ne.INMUTABLE_UPSTREAM_PROPERTIES]),l(ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ne,"DOWNSTREAM_PROPERTIES",[...ne.MUTABLE_DOWNSTREAM_PROPERTIES,...ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ne,"PROPERTIES",[...ne.META_PROPERTIES,...ne.UPSTREAM_PROPERTIES,...ne.DOWNSTREAM_PROPERTIES]);let pi=ne;function GU(i){const e=L4(),t=i.toJSON();e.safeParse(t).success,i.inputs.forEach(o=>o.validate()),i.outputs.forEach(o=>o.validate()),i.internalCalls.forEach(o=>o.validate());const s=[...hn(i)];if(i.id==="exec-sequentially-result-variable-id"){const o=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});s.push(o.error)}return z(i.errors,s)}const re=class re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.VariableInstance);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(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 r=t;if(e.parent){const b=D(e.parent);r=t.get(b)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const P=D(b);return t.get(P)}),d=e.calledBySuccess.map(b=>{const P=D(b);return t.get(P)}),p=e.calledByError.map(b=>{const P=D(b);return t.get(P)});let y=null;if(e.readsValue){const b=D(e.readsValue);y=t.get(b)}const f={id:e.id,version:1,type:n.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:d,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:y,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:r},m=R(f,t);return m.setParent(r),m.initChildren(),m}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...it,n.Project],optional:!0},declaration:{list:!1,types:[n.VariableDeclaration]}},t);return r=s.modifiedData,a.push(...s.errors,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=La(r,this);return r=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
63
+ 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:i}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(i=>i.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(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),Fa.initWritesValues(this,this.parent),Ga.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.internalCalls=this.initialData.internalCalls.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this)}setValueWriter(e){return this.readsValue=e,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.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),Pi(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.internalCalls.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e)),...this.successCalls.flatMap(a=>a.toFlat(e)),...this.errorCalls.flatMap(a=>a.toFlat(e)),...this.inputs.flatMap(a=>a.toFlat(e)),...this.outputs.flatMap(a=>a.toFlat(e)),...this.internalCalls.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.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(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toJSON()),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),internalCalls:this.internalCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toReference()),inputs:this.inputs.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toReference()),successCalls:this.successCalls.map(i=>i.toReference()),errorCalls:this.errorCalls.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),internalCalls:this.internalCalls.map(i=>i.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.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.internalCalls.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.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 i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.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.internalCalls.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],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()),(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=t8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,i;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((i=this.readsValue)==null?void 0:i.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ne(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const i={id:t.id||L.uuid(),version:t.version||1,type:r.VariableInstance,parent:e.toReference(),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=R(i,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(this.dataType.entity.type===r.CustomEntity)return this.dataType.entity.properties.filter(i=>!this.inputs.find(a=>a.declaration===i)).map(i=>{const a={id:L.uuid(),version:1,type:r.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:i,defaultValue:null,index:i.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if(this.dataType.entity.type===r.CustomEntity)return this.dataType.entity.properties.filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:L.uuid(),version:1,type:r.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType||null}};l(ne,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ne,"BASE_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"MUTABLE_META_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ne,"INMUTABLE_META_PROPERTIES",[...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"META_PROPERTIES",[...ne.MUTABLE_META_PROPERTIES,...ne.INMUTABLE_META_PROPERTIES]),l(ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(ne,"UPSTREAM_PROPERTIES",[...ne.MUTABLE_UPSTREAM_PROPERTIES,...ne.INMUTABLE_UPSTREAM_PROPERTIES]),l(ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ne,"DOWNSTREAM_PROPERTIES",[...ne.MUTABLE_DOWNSTREAM_PROPERTIES,...ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ne,"PROPERTIES",[...ne.META_PROPERTIES,...ne.UPSTREAM_PROPERTIES,...ne.DOWNSTREAM_PROPERTIES]);let yi=ne;function n8(n){const e=nU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate()),n.outputs.forEach(o=>o.validate()),n.internalCalls.forEach(o=>o.validate());const s=[...hn(n)];if(n.id==="exec-sequentially-result-variable-id"){const o=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});s.push(o.error)}return z(n.errors,s)}const re=class re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.VariableInstance);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(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 i=t;if(e.parent){const b=D(e.parent);i=t.get(b)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const P=D(b);return t.get(P)}),d=e.calledBySuccess.map(b=>{const P=D(b);return t.get(P)}),p=e.calledByError.map(b=>{const P=D(b);return t.get(P)});let y=null;if(e.readsValue){const b=D(e.readsValue);y=t.get(b)}const f={id:e.id,version:1,type:r.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:d,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:y,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},m=R(f,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...it,r.Project],optional:!0},declaration:{list:!1,types:[r.VariableDeclaration]}},t);return i=s.modifiedData,a.push(...s.errors,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=qa(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
64
64
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
65
65
  Specifically for variables, their scope is also calculated from their value readers and value writters.
66
- 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:r}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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.declaration.type===n.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!e)return this;this.declaration=e}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return wa.initWritesValues(this,this.parent),Ba.initReadsValue(this),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.internalCalls=this.initialData.internalCalls.reduce((e,t)=>{if(t.type===n.GenericReference){const r=this.project.findSubscribedInstanceFromReference(t);if(!r)return e;const a=r;return a.setParent(this),[...e,a]}else{const r=R(t,this.project);return r.setParent(this),r.initChildren(),[...e,r]}},[]),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this}setValueWriter(e){return this.readsValue=e,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(){return this}async create(){return this}async update(e){return this.sync(e),Ii(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.internalCalls.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(r=>r.toFlat(e)),...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.internalCalls.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(r=>r.toFlatIds(e)),...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.internalCalls.flatMap(r=>r.toFlatIds(e))])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,declaration:this.declaration.toReference(),readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,writesValues:this.writesValues.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),internalCalls:this.internalCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toReference()),inputs:this.inputs.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toReference()),successCalls:this.successCalls.map(r=>r.toReference()),errorCalls:this.errorCalls.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),internalCalls:this.internalCalls.map(r=>r.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.declaration)==null?void 0:r.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.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.internalCalls.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===n.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 r,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.declaration)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.readsValue)==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(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.outputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this.internalCalls.forEach(e=>e.clearErrors()),this}validate(){const e=GU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...this.internalCalls.flatMap(r=>r.getErrors()),...this.outputs.flatMap(r=>r.getErrors()),...((t=this.readsValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new re(this.toJSON(),this.project)}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(this.declaration.dataType.entity.type===n.CustomEntity)return this.declaration.dataType.entity.properties.filter(r=>!this.inputs.find(a=>a.declaration===r)).map(r=>{const a={id:L.uuid(),version:1,type:n.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:r,defaultValue:null,index:r.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if(this.declaration.dataType.entity.type===n.CustomEntity)return this.declaration.dataType.entity.properties.filter(r=>!this.outputs.find(a=>a.declaration===r)).map(r=>{const a={id:L.uuid(),version:1,type:n.OutputMap,parent:this.toReference(),declaration:r,index:r.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(re,"MUTABLE_BASE_PROPERTIES",[]),l(re,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(re,"BASE_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,...re.INMUTABLE_BASE_PROPERTIES]),l(re,"MUTABLE_META_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,"x","y"]),l(re,"INMUTABLE_META_PROPERTIES",[...re.INMUTABLE_BASE_PROPERTIES]),l(re,"META_PROPERTIES",[...re.MUTABLE_META_PROPERTIES,...re.INMUTABLE_META_PROPERTIES]),l(re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(re,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(re,"UPSTREAM_PROPERTIES",[...re.MUTABLE_UPSTREAM_PROPERTIES,...re.INMUTABLE_UPSTREAM_PROPERTIES]),l(re,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(re,"DOWNSTREAM_PROPERTIES",[...re.MUTABLE_DOWNSTREAM_PROPERTIES,...re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(re,"PROPERTIES",[...re.META_PROPERTIES,...re.UPSTREAM_PROPERTIES,...re.DOWNSTREAM_PROPERTIES]);let yi=re;function FU(i){var s;const e=Sx(),t=i.toJSON();e.safeParse(t).success,(s=i.dataType)==null||s.validate();const a=[];if(i.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});a.push(o.error)}return z(i.errors,a)}const ie=class ie{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"isError");l(this,"type",n.ReturnDeclaration);l(this,"dataType",null);l(this,"readsValue",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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.isError=e.isError}static fromGenerationTarget(e,t){const r=D(e.parent),a=t.get(r);let s=null;if(e.readsValue){const p=D(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:n.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,required:e.required,readsValue:s,dataType:null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var d,p;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[n.ReturnStatement,n.Search,n.BreakStatement,n.ContinueStatement]}},t),o=V$(r,t);if(r=s.modifiedData,r.parent){const y=t.get(D(r.parent));if(y&&[n.BreakStatement,n.ContinueStatement].includes(y.type)){const f=y,m=f.parent,b=[...m.breakStatements.filter(O=>O.id!==y.id),...m.continueStatements.filter(O=>O.id!==y.id)];if(f.outputs.length)a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${r.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This '${f.type}' already has return declarations.
67
- ${pb}`,issue:null}));else{const O=(p=(d=b[0])==null?void 0:d.outputs[0])==null?void 0:p.name;O!==r.name&&a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${r.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This new 'return-declaration' doesn't have the same name "${O}" as the return declarations on the other statements in the same scope.
68
- ${pb}`,issue:null}))}}else if(y&&y.type===n.ReturnStatement){const f=y.parent;if(f&&Fe.includes(f.type)){const m=f.implements;if(m)if(m.returnsType===V.Fixed){const b=m.fixedReturns.find(ge=>ge.name===r.name),P=m.fixedReturns.filter(ge=>!y.outputs.find(xn=>xn.type===n.ReturnDeclaration&&xn.name===ge.name)),O=y.outputs.filter(ge=>ge.type===n.ReturnDeclaration),$=O.find(ge=>ge.name===r.name),ve=O.length?`The parent entity already implements the following return declarations: ${j(O.map(ge=>`'${ge.id}' (${ge.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented return declarations.",tt=P.length?`The parent entity is still missing the following returns in the implementation: ${j(P.map(ge=>`'${ge.id}' (${ge.name})`),", "," and ")}.`:"The parent entity has all the returns it needs implemented.";b?$&&a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${n.ActionDescriptor} with fixed outputs.
66
+ 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:i}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(i=>i.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(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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.declaration.type===r.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!e)return this;this.declaration=e}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return Fa.initWritesValues(this,this.parent),Ga.initReadsValue(this),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.internalCalls=this.initialData.internalCalls.reduce((e,t)=>{if(t.type===r.GenericReference){const i=this.project.findSubscribedInstanceFromReference(t);if(!i)return e;const a=i;return a.setParent(this),[...e,a]}else{const i=R(t,this.project);return i.setParent(this),i.initChildren(),[...e,i]}},[]),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this}setValueWriter(e){return this.readsValue=e,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(){return this}async create(){return this}async update(e){return this.sync(e),Pi(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.internalCalls.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(i=>i.toFlat(e)),...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.internalCalls.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(i=>i.toFlatIds(e)),...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.internalCalls.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,declaration:this.declaration.toReference(),readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,writesValues:this.writesValues.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),internalCalls:this.internalCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toReference()),inputs:this.inputs.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toReference()),successCalls:this.successCalls.map(i=>i.toReference()),errorCalls:this.errorCalls.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),internalCalls:this.internalCalls.map(i=>i.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.declaration)==null?void 0:i.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.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.internalCalls.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.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 i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.declaration)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.readsValue)==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(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.outputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this.internalCalls.forEach(e=>e.clearErrors()),this}validate(){const e=n8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...this.internalCalls.flatMap(i=>i.getErrors()),...this.outputs.flatMap(i=>i.getErrors()),...((t=this.readsValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new re(this.toJSON(),this.project)}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(this.declaration.dataType.entity.type===r.CustomEntity)return this.declaration.dataType.entity.properties.filter(i=>!this.inputs.find(a=>a.declaration===i)).map(i=>{const a={id:L.uuid(),version:1,type:r.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:i,defaultValue:null,index:i.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if(this.declaration.dataType.entity.type===r.CustomEntity)return this.declaration.dataType.entity.properties.filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:L.uuid(),version:1,type:r.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(re,"MUTABLE_BASE_PROPERTIES",[]),l(re,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(re,"BASE_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,...re.INMUTABLE_BASE_PROPERTIES]),l(re,"MUTABLE_META_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,"x","y"]),l(re,"INMUTABLE_META_PROPERTIES",[...re.INMUTABLE_BASE_PROPERTIES]),l(re,"META_PROPERTIES",[...re.MUTABLE_META_PROPERTIES,...re.INMUTABLE_META_PROPERTIES]),l(re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(re,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(re,"UPSTREAM_PROPERTIES",[...re.MUTABLE_UPSTREAM_PROPERTIES,...re.INMUTABLE_UPSTREAM_PROPERTIES]),l(re,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(re,"DOWNSTREAM_PROPERTIES",[...re.MUTABLE_DOWNSTREAM_PROPERTIES,...re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(re,"PROPERTIES",[...re.META_PROPERTIES,...re.UPSTREAM_PROPERTIES,...re.DOWNSTREAM_PROPERTIES]);let hi=re;function r8(n){var s;const e=W4(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return z(n.errors,a)}const ie=class ie{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"isError");l(this,"type",r.ReturnDeclaration);l(this,"dataType",null);l(this,"readsValue",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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.isError=e.isError}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.readsValue){const p=D(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,required:e.required,readsValue:s,dataType:null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var d,p;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[r.ReturnStatement,r.Search,r.BreakStatement,r.ContinueStatement]}},t),o=$o(i,t);if(i=s.modifiedData,i.parent){const y=t.get(D(i.parent));if(y&&[r.BreakStatement,r.ContinueStatement].includes(y.type)){const f=y,m=f.parent,b=[...m.breakStatements.filter(C=>C.id!==y.id),...m.continueStatements.filter(C=>C.id!==y.id)];if(f.outputs.length)a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This '${f.type}' already has return declarations.
67
+ ${jb}`,issue:null}));else{const C=(p=(d=b[0])==null?void 0:d.outputs[0])==null?void 0:p.name;C!==i.name&&a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This new 'return-declaration' doesn't have the same name "${C}" as the return declarations on the other statements in the same scope.
68
+ ${jb}`,issue:null}))}}else if(y&&y.type===r.ReturnStatement){const f=y.parent;if(f&&Fe.includes(f.type)){const m=f.implements;if(m)if(m.returnsType===V.Fixed){const b=m.fixedReturns.find(ge=>ge.name===i.name),P=m.fixedReturns.filter(ge=>!y.outputs.find(Un=>Un.type===r.ReturnDeclaration&&Un.name===ge.name)),C=y.outputs.filter(ge=>ge.type===r.ReturnDeclaration),$=C.find(ge=>ge.name===i.name),ve=C.length?`The parent entity already implements the following return declarations: ${j(C.map(ge=>`'${ge.id}' (${ge.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented return declarations.",tt=P.length?`The parent entity is still missing the following returns in the implementation: ${j(P.map(ge=>`'${ge.id}' (${ge.name})`),", "," and ")}.`:"The parent entity has all the returns it needs implemented.";b?$&&a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${r.ActionDescriptor} with fixed outputs.
69
69
  Adding a new return would make the implementation invalid. An return with the same name already exists in the parent entity.
70
70
  ${ve}
71
- ${tt}`,issue:null})):a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${n.ActionDescriptor} with fixed outputs.
71
+ ${tt}`,issue:null})):a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${r.ActionDescriptor} with fixed outputs.
72
72
  Adding a new return would make the implementation invalid. There are no returns in the descriptor with the same name.
73
73
  ${ve}
74
- ${tt}`,issue:null}))}else m.returnsType===V.Dynamic||m.returnsType===V.None&&a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${n.ActionDescriptor} with no outputs.
75
- Adding a new return would make the implementation invalid.`,issue:null}))}}}return a.push(...s.errors,...o,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=La(r,this);return r=a.modifiedData,t.push(...a.errors),r.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
76
- 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:r}}addSelfToProject(){var e;return this.parent.addOutputDeclaration(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),Ba.initReadsValue(this),this)}setValueWriter(e){return this.readsValue=e,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||this.index,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}async load(){return this}async create(){return this}async update(e){return this.sync(e),Ii(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:S(r),removed:S(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.dataType){const r=this.dataType.restore({seenEntities:e});t.push(...r.affected)}return{affected:[],self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,dataType:((t=this.dataType)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.dataType)==null?void 0:r.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 r,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.readsValue)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=FU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ie(this.toJSON(),this.project)}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(ie,"MUTABLE_BASE_PROPERTIES",["name","description","required","isError"]),l(ie,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ie,"BASE_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"MUTABLE_META_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,"index"]),l(ie,"INMUTABLE_META_PROPERTIES",[...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"META_PROPERTIES",[...ie.MUTABLE_META_PROPERTIES,...ie.INMUTABLE_META_PROPERTIES]),l(ie,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(ie,"UPSTREAM_PROPERTIES",[...ie.MUTABLE_UPSTREAM_PROPERTIES,...ie.INMUTABLE_UPSTREAM_PROPERTIES]),l(ie,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ie,"DOWNSTREAM_PROPERTIES",[...ie.MUTABLE_DOWNSTREAM_PROPERTIES,...ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ie,"PROPERTIES",[...ie.META_PROPERTIES,...ie.UPSTREAM_PROPERTIES,...ie.DOWNSTREAM_PROPERTIES]);let $t=ie;function xU(i){var o;const e=vx(),t=i.toJSON();e.safeParse(t).success,i.inputsDeclarations.forEach(d=>d.validate()),i.inputs.forEach(d=>d.validate()),i.outputsDeclarations.forEach(d=>d.validate()),i.outputs.forEach(d=>d.validate()),(o=i.error)==null||o.validate();const s=[...hn(i)];if(i.id==="search-person-by-id-id"){const d=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});s.push(d.error)}return z(i.errors,s)}const Pe=class Pe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"query");l(this,"type",n.Search);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"inputsDeclarations",[]);l(this,"inputs",[]);l(this,"outputsDeclarations",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 r=t;if(e.parent){const y=D(e.parent);r=t.get(y)}const a=e.calledByEntry.map(y=>{const f=D(y);return t.get(f)}),s=e.calledBySuccess.map(y=>{const f=D(y);return t.get(f)}),o=e.calledByError.map(y=>{const f=D(y);return t.get(f)}),d={id:e.id,version:1,type:n.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:r},p=R(d,t);return p.setParent(r),p.initChildren(),p}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...it,n.Project],optional:!0}},t);return r=s.modifiedData,a.push(...s.errors,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
74
+ ${tt}`,issue:null}))}else m.returnsType===V.Dynamic||m.returnsType===V.None&&a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${r.ActionDescriptor} with no outputs.
75
+ Adding a new return would make the implementation invalid.`,issue:null}))}}}return a.push(...s.errors,...o,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=qa(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
76
+ 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:i}}addSelfToProject(){var e;return this.parent.addOutputDeclaration(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),Ga.initReadsValue(this),this)}setValueWriter(e){return this.readsValue=e,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||this.index,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}async load(){return this}async create(){return this}async update(e){return this.sync(e),Pi(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(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.dataType){const i=this.dataType.restore({seenEntities:e});t.push(...i.affected)}return{affected:[],self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,dataType:((t=this.dataType)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.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 i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.readsValue)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=r8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ie(this.toJSON(),this.project)}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(ie,"MUTABLE_BASE_PROPERTIES",["name","description","required","isError"]),l(ie,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ie,"BASE_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"MUTABLE_META_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,"index"]),l(ie,"INMUTABLE_META_PROPERTIES",[...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"META_PROPERTIES",[...ie.MUTABLE_META_PROPERTIES,...ie.INMUTABLE_META_PROPERTIES]),l(ie,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(ie,"UPSTREAM_PROPERTIES",[...ie.MUTABLE_UPSTREAM_PROPERTIES,...ie.INMUTABLE_UPSTREAM_PROPERTIES]),l(ie,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ie,"DOWNSTREAM_PROPERTIES",[...ie.MUTABLE_DOWNSTREAM_PROPERTIES,...ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ie,"PROPERTIES",[...ie.META_PROPERTIES,...ie.UPSTREAM_PROPERTIES,...ie.DOWNSTREAM_PROPERTIES]);let $t=ie;function i8(n){var o;const e=U4(),t=n.toJSON();e.safeParse(t).success,n.inputsDeclarations.forEach(d=>d.validate()),n.inputs.forEach(d=>d.validate()),n.outputsDeclarations.forEach(d=>d.validate()),n.outputs.forEach(d=>d.validate()),(o=n.error)==null||o.validate();const s=[...hn(n)];if(n.id==="search-person-by-id-id"){const d=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});s.push(d.error)}return z(n.errors,s)}const Pe=class Pe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"query");l(this,"type",r.Search);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"inputsDeclarations",[]);l(this,"inputs",[]);l(this,"outputsDeclarations",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 i=t;if(e.parent){const y=D(e.parent);i=t.get(y)}const a=e.calledByEntry.map(y=>{const f=D(y);return t.get(f)}),s=e.calledBySuccess.map(y=>{const f=D(y);return t.get(f)}),o=e.calledByError.map(y=>{const f=D(y);return t.get(f)}),d={id:e.id,version:1,type:r.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:i},p=R(d,t);return p.setParent(i),p.initChildren(),p}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...it,r.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
77
77
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
78
- 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}}addSelfToProject(){return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),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 r=this.inputsDeclarations.findIndex(a=>a.id===e.declaration.id);return r>-1&&this.inputsDeclarations.splice(r,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)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(r=>r.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(r=>r.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(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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=R(e,this.project);return[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),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.query=e.query||this.query,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.inputsDeclarations.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.outputsDeclarations.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e;return{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(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputsDeclarations:this.inputsDeclarations.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputsDeclarations:this.outputsDeclarations.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),parent:this.parent.toReference(),error:((e=this.error)==null?void 0:e.toJSON())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,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(e=>e.toReference()),inputsDeclarations:this.inputsDeclarations.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),outputsDeclarations:this.outputsDeclarations.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===n.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(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(r=>r.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=xU(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){return new Pe(this.toJSON(),this.project)}};l(Pe,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),l(Pe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Pe,"BASE_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,...Pe.INMUTABLE_BASE_PROPERTIES]),l(Pe,"MUTABLE_META_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,"x","y"]),l(Pe,"INMUTABLE_META_PROPERTIES",[...Pe.INMUTABLE_BASE_PROPERTIES]),l(Pe,"META_PROPERTIES",[...Pe.MUTABLE_META_PROPERTIES,...Pe.INMUTABLE_META_PROPERTIES]),l(Pe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(Pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(Pe,"UPSTREAM_PROPERTIES",[...Pe.MUTABLE_UPSTREAM_PROPERTIES,...Pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(Pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),l(Pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Pe,"DOWNSTREAM_PROPERTIES",[...Pe.MUTABLE_DOWNSTREAM_PROPERTIES,...Pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Pe,"PROPERTIES",[...$t.META_PROPERTIES,...$t.UPSTREAM_PROPERTIES,...$t.DOWNSTREAM_PROPERTIES]);let hi=Pe;function UU(i){const e=U4(),t=i.toJSON();e.safeParse(t).success,i.functions.forEach(s=>s.validate()),i.events.forEach(s=>s.validate());const a=[];return z(i.errors,a)}const fe=class fe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"type",n.InstalledProject);l(this,"implements");l(this,"functions",[]);l(this,"events",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 r=t,a={id:e.id,version:1,name:e.name,type:n.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:n.Project,type:n.GenericReference,id:L.uuid()},x:0,y:0,parent:r},s=R(a,t);return s.setParent(r),s.initChildren(),s}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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}}addSelfToProject(){return 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=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],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:d}=s.remove({ignoreUpstream:!1,seenEntities:t});r.push(...o),a.push(...d)}),this.events.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!1,seenEntities:t});r.push(...o),a.push(...d)}),{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(r=>r.toFlat(e)),...this.events.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(r=>r.toFlatIds(e)),...this.events.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,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(e=>e.toReference()),events:this.events.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.functions.flatMap(r=>r.toFlatJSON(e)),...this.events.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.events.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=UU(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(){return new fe(this.toJSON(),this.project)}};l(fe,"MUTABLE_BASE_PROPERTIES",[]),l(fe,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),l(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"MUTABLE_META_PROPERTIES",["x","y"]),l(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),l(fe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(fe,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),l(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUTABLE_UPSTREAM_PROPERTIES]),l(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),l(fe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let fi=fe;function jU(i){var o;const e=Kx(),t=i.toJSON();e.safeParse(t).success,i.inputs.forEach(d=>d.validate()),i.outputs.forEach(d=>d.validate()),(o=i.error)==null||o.validate();const s=[...hn(i)];return z(i.errors,s)}const ae=class ae{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",n.InternalCall);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"project");l(this,"errors",[]);l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version}static fromGenerationTarget(e,t){const r=D(e.parent),a=t.get(r),s=D(e.declaration),o=t.get(s),d=e.calledByEntry.map(b=>{const P=D(b);return t.get(P)}),p=e.calledBySuccess.map(b=>{const P=D(b);return t.get(P)}),y=e.calledByError.map(b=>{const P=D(b);return t.get(P)}),f={id:e.id,version:1,type:n.InternalCall,index:a.internalCalls.length,declaration:o.toReference(),calledByEntry:d,calledBySuccess:p,calledByError:y,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,parent:a},m=R(f,t);return m.setParent(a),m.initChildren(),m}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:_e}},t);r=s.modifiedData;const o=D(r.parent),d=t.get(o);if(d){const p=rE(d),y=p==null?void 0:p.entity;if(!y)a.push(new E({id:`${r.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.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}));else if(![n.CustomEntity,n.BuiltInBaseEntity,n.PrimitiveEntity].includes(y.type))a.push(new E({id:`${r.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
79
- This variable's data-type has an 'entity' field that references an entity with id '${y.id}' and of type '${y.type}'.`,issue:null}));else{const f=$b(y);let m="";f?y.methods.length?m=`
78
+ 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}}addSelfToProject(){return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),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 i=this.inputsDeclarations.findIndex(a=>a.id===e.declaration.id);return i>-1&&this.inputsDeclarations.splice(i,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)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(i=>i.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(i=>i.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(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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=R(e,this.project);return[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),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.query=e.query||this.query,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(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(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.inputsDeclarations.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.outputsDeclarations.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.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(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e;return{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(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputsDeclarations:this.inputsDeclarations.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputsDeclarations:this.outputsDeclarations.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),parent:this.parent.toReference(),error:((e=this.error)==null?void 0:e.toJSON())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,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(e=>e.toReference()),inputsDeclarations:this.inputsDeclarations.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),outputsDeclarations:this.outputsDeclarations.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.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(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(i=>i.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=i8(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){return new Pe(this.toJSON(),this.project)}};l(Pe,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),l(Pe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Pe,"BASE_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,...Pe.INMUTABLE_BASE_PROPERTIES]),l(Pe,"MUTABLE_META_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,"x","y"]),l(Pe,"INMUTABLE_META_PROPERTIES",[...Pe.INMUTABLE_BASE_PROPERTIES]),l(Pe,"META_PROPERTIES",[...Pe.MUTABLE_META_PROPERTIES,...Pe.INMUTABLE_META_PROPERTIES]),l(Pe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(Pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(Pe,"UPSTREAM_PROPERTIES",[...Pe.MUTABLE_UPSTREAM_PROPERTIES,...Pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(Pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),l(Pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Pe,"DOWNSTREAM_PROPERTIES",[...Pe.MUTABLE_DOWNSTREAM_PROPERTIES,...Pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Pe,"PROPERTIES",[...$t.META_PROPERTIES,...$t.UPSTREAM_PROPERTIES,...$t.DOWNSTREAM_PROPERTIES]);let fi=Pe;function a8(n){const e=oU(),t=n.toJSON();e.safeParse(t).success,n.functions.forEach(s=>s.validate()),n.events.forEach(s=>s.validate());const a=[];return z(n.errors,a)}const fe=class fe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"type",r.InstalledProject);l(this,"implements");l(this,"functions",[]);l(this,"events",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 i=t,a={id:e.id,version:1,name:e.name,type:r.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:r.Project,type:r.GenericReference,id:L.uuid()},x:0,y:0,parent:i},s=R(a,t);return s.setParent(i),s.initChildren(),s}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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}}addSelfToProject(){return 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=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],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:d}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...d)}),this.events.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...d)}),{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(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(i=>i.toFlatIds(e)),...this.events.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,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(e=>e.toReference()),events:this.events.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.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(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=a8(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(){return new fe(this.toJSON(),this.project)}};l(fe,"MUTABLE_BASE_PROPERTIES",[]),l(fe,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),l(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"MUTABLE_META_PROPERTIES",["x","y"]),l(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),l(fe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(fe,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),l(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUTABLE_UPSTREAM_PROPERTIES]),l(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),l(fe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let mi=fe;function s8(n){var o;const e=Rx(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(d=>d.validate()),n.outputs.forEach(d=>d.validate()),(o=n.error)==null||o.validate();const s=[...hn(n)];return z(n.errors,s)}const ae=class ae{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",r.InternalCall);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"project");l(this,"errors",[]);l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=D(e.declaration),o=t.get(s),d=e.calledByEntry.map(b=>{const P=D(b);return t.get(P)}),p=e.calledBySuccess.map(b=>{const P=D(b);return t.get(P)}),y=e.calledByError.map(b=>{const P=D(b);return t.get(P)}),f={id:e.id,version:1,type:r.InternalCall,index:a.internalCalls.length,declaration:o.toReference(),calledByEntry:d,calledBySuccess:p,calledByError:y,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,parent:a},m=R(f,t);return m.setParent(a),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:_e}},t);i=s.modifiedData;const o=D(i.parent),d=t.get(o);if(d){const p=Oo(d),y=p==null?void 0:p.entity;if(!y)a.push(new E({id:`${i.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${i.declaration}".`,issue:null}));else if(![r.CustomEntity,r.BuiltInBaseEntity,r.PrimitiveEntity].includes(y.type))a.push(new E({id:`${i.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
79
+ This variable's data-type has an 'entity' field that references an entity with id '${y.id}' and of type '${y.type}'.`,issue:null}));else{const f=yv(y);let m="";f?y.methods.length?m=`
80
80
  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:
81
81
  - ${y.methods.map($=>$.id).join(`
82
82
  - `)}
83
- You can reference any of them as the 'delcaration' property on a new 'internal-call' entity.`:y.type===n.CustomEntity?m=`
83
+ You can reference any of them as the 'delcaration' property on a new 'internal-call' entity.`:y.type===r.CustomEntity?m=`
84
84
  This variable's data-type 'entity' is a custom entity which doesn't have any methods attached to it yet.
85
- You can attach methods to it by creating 'function-declaration' entities which have the entity as its 'parent' field. Then you can reference them as the 'declaration' property on a new 'internal-call' entity in a variable`:[n.BuiltInBaseEntity,n.PrimitiveEntity].includes(y.type)&&(m=`
85
+ You can attach methods to it by creating 'function-declaration' entities which have the entity as its 'parent' field. Then you can reference them as the 'declaration' property on a new 'internal-call' entity in a variable`:[r.BuiltInBaseEntity,r.PrimitiveEntity].includes(y.type)&&(m=`
86
86
  This variable's data-type 'entity' is a ${y.type} which doesn't have any methods attached to it yet.
87
- Built-in entity types can't have methods attached to them by the user. They are predefined entities that can't be modified. You can reference them as the 'declaration' property on a new 'internal-call' entity in a variable`):y.type===n.CustomEntity?m=`
87
+ Built-in entity types can't have methods attached to them by the user. They are predefined entities that can't be modified. You can reference them as the 'declaration' property on a new 'internal-call' entity in a variable`):y.type===r.CustomEntity?m=`
88
88
  This variable's data-type 'entity' is a custom entity which extends or implements a non-interactive 'built-in-base-entity'.
89
- ${Vn}`:y.type===n.BuiltInBaseEntity&&(m=`
89
+ ${Ln}`:y.type===r.BuiltInBaseEntity&&(m=`
90
90
  This variable's data-type 'entity' is a non-interactive 'built-in-base-entity'.
91
- ${Vn}`);const b=r.declaration,P=t.get(b);if(!P)a.push(new E({id:`${r.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a declaration method (function-declaration) that doesn't exist in the project.${m}`,issue:null}));else{const O=(y.methods||[]).find($=>$.id===r.declaration);O?O.type!==n.FunctionDeclaration?a.push(new E({id:`${r.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", points to a 'declaration' that isn't a 'function-declaration' entity.
92
- The declaration of the internal-call must be a 'function-declaration' entity which exists as a method in the entity of the data-type of the parent variable.${m}`,issue:null})):P.parent.id!==y.id&&a.push(new E({id:`${r.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a declaration method (function-declaration) that doesn't belong to its parent's data type entity.
93
- The data type on this variable points to a different entity than the declaration of the internal-call.${m}`,issue:null})):a.push(new E({id:`${r.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.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) with id "${r.declaration}".${m}`,issue:null}))}}(d.inputs.length||d.outputs.length||d.internalCalls.length)&&a.push(new E({id:`${r.id}--${h.InvalidInternalCallParentRelation}`,code:h.InvalidInternalCallParentRelation,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", can only be added to a variable declaration or variable instance parent if the parent doesn't already have inputs, outputs or other internal calls.
91
+ ${Ln}`);const b=i.declaration,P=t.get(b);if(!P)a.push(new E({id:`${i.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a declaration method (function-declaration) that doesn't exist in the project.${m}`,issue:null}));else{const C=(y.methods||[]).find($=>$.id===i.declaration);C?C.type!==r.FunctionDeclaration?a.push(new E({id:`${i.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", points to a 'declaration' that isn't a 'function-declaration' entity.
92
+ The declaration of the internal-call must be a 'function-declaration' entity which exists as a method in the entity of the data-type of the parent variable.${m}`,issue:null})):P.parent.id!==y.id&&a.push(new E({id:`${i.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a declaration method (function-declaration) that doesn't belong to its parent's data type entity.
93
+ The data type on this variable points to a different entity than the declaration of the internal-call.${m}`,issue:null})):a.push(new E({id:`${i.id}--${h.InvalidInternalCallParentDeclarationRelation}`,code:h.InvalidInternalCallParentDeclarationRelation,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) with id "${i.declaration}".${m}`,issue:null}))}}(d.inputs.length||d.outputs.length||d.internalCalls.length)&&a.push(new E({id:`${i.id}--${h.InvalidInternalCallParentRelation}`,code:h.InvalidInternalCallParentRelation,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", can only be added to a variable declaration or variable instance parent if the parent doesn't already have inputs, outputs or other internal calls.
94
94
  If you need a new variable-instance for this, consider using the 'implement_variable_instance' generation action to create one and give it a caller.
95
- The you can attach the new internal-call to it.`,issue:null}))}return a.push(...s.errors,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
96
- 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}}addSelfToProject(){var e;return this.parent.addInternalCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.parent.type!==n.GenericReference){const e=R(this.initialData.parent,this.project);this.setParent(e),this.parent.initChildren(),this.parent.addInternalCall(this);const t=this.calledBy.find(r=>!!r.parent&&it.includes(r.parent.type));if(t){const r=R(t.parent,this.project);this.parent.setParent(r)}else if(!t&&!this.parent.calledBy.length)throw new Error("Parent of internal call parent could not be resolved")}return this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),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||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const r=[],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:d}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}if(this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),this.outputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),this.error){const{affected:o,removed:d}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:S(r),removed:S(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.toFlat(e)),...this.process?this.process.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,index:this.index,successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.process?this.process.toFlatGenerationTarget(e):[],...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=jU(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){return new ae(this.toJSON(),this.project)}};l(ae,"MUTABLE_BASE_PROPERTIES",[]),l(ae,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ae,"BASE_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"MUTABLE_META_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,"index"]),l(ae,"INMUTABLE_META_PROPERTIES",[...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"META_PROPERTIES",[...ae.MUTABLE_META_PROPERTIES,...ae.INMUTABLE_META_PROPERTIES]),l(ae,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(ae,"UPSTREAM_PROPERTIES",[...ae.MUTABLE_UPSTREAM_PROPERTIES,...ae.INMUTABLE_UPSTREAM_PROPERTIES]),l(ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),l(ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ae,"DOWNSTREAM_PROPERTIES",[...ae.MUTABLE_DOWNSTREAM_PROPERTIES,...ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ae,"PROPERTIES",[...ae.META_PROPERTIES,...ae.UPSTREAM_PROPERTIES,...ae.DOWNSTREAM_PROPERTIES]);let Ma=ae;function kU(i){const e=r4(),t=i.toJSON();e.safeParse(t).success;const a=[];if(i.id==="exec-sequentially-argument-map-id"){const s=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});a.push(s.error)}return z(i.errors,a)}const se=class se{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"name",null);l(this,"description",null);l(this,"declaration",null);l(this,"type",n.InputMap);l(this,"defaultValue",null);l(this,"readsValue",null);l(this,"dynamicArguments",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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||null,this.description=e.description||null}static fromGenerationTarget(e,t){const r=D(e.parent),a=t.get(r);let s=null;if(e.declaration){const y=D(e.declaration);s=t.get(y)}let o=null;if(e.readsValue){const y=D(e.readsValue);o=t.get(y)}const d={id:e.id,version:1,name:e.name||null,type:n.InputMap,index:(a.inputs||a.dynamicArguments||[]).length,description:e.description||null,declaration:s,readsValue:o,dynamicArguments:[],defaultValue:null,parent:a},p=R(d,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var y;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...Ge,n.InputMap]}},t);r=s.modifiedData;const o=t.get(r.parent),d=r.declaration&&(t.get(r.declaration)||t.getBuiltIn(r.declaration)),p=((o==null?void 0:o.inputs)||[]).find(f=>{var m;return r.declaration&&((m=f.declaration)==null?void 0:m.id)===r.declaration});if(r.declaration?d?[n.Property,n.ArgumentDeclaration,n.ValueDescriptor].includes(d.type)?o&&d.type===n.ArgumentDeclaration&&![n.FunctionCall,n.Search,n.InternalCall].includes(o.type)?a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' has a 'declaration' property pointing to an entity with type '${n.ArgumentDeclaration}' with id '${r.declaration}'.
95
+ The you can attach the new internal-call to it.`,issue:null}))}return a.push(...s.errors,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
96
+ 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}}addSelfToProject(){var e;return this.parent.addInternalCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.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(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.parent.type!==r.GenericReference){const e=R(this.initialData.parent,this.project);this.setParent(e),this.parent.initChildren(),this.parent.addInternalCall(this);const t=this.calledBy.find(i=>!!i.parent&&it.includes(i.parent.type));if(t){const i=R(t.parent,this.project);this.parent.setParent(i)}else if(!t&&!this.parent.calledBy.length)throw new Error("Parent of internal call parent could not be resolved")}return this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),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||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],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:d}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}if(this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.outputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.error){const{affected:o,removed:d}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(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:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.process?this.process.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(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,index:this.index,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.process?this.process.toFlatGenerationTarget(e):[],...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=s8(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){return new ae(this.toJSON(),this.project)}};l(ae,"MUTABLE_BASE_PROPERTIES",[]),l(ae,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ae,"BASE_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"MUTABLE_META_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,"index"]),l(ae,"INMUTABLE_META_PROPERTIES",[...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"META_PROPERTIES",[...ae.MUTABLE_META_PROPERTIES,...ae.INMUTABLE_META_PROPERTIES]),l(ae,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(ae,"UPSTREAM_PROPERTIES",[...ae.MUTABLE_UPSTREAM_PROPERTIES,...ae.INMUTABLE_UPSTREAM_PROPERTIES]),l(ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),l(ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ae,"DOWNSTREAM_PROPERTIES",[...ae.MUTABLE_DOWNSTREAM_PROPERTIES,...ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ae,"PROPERTIES",[...ae.META_PROPERTIES,...ae.UPSTREAM_PROPERTIES,...ae.DOWNSTREAM_PROPERTIES]);let xa=ae;function o8(n){const e=Ix(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-argument-map-id"){const s=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return z(n.errors,a)}const se=class se{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"name",null);l(this,"description",null);l(this,"declaration",null);l(this,"type",r.InputMap);l(this,"defaultValue",null);l(this,"readsValue",null);l(this,"dynamicArguments",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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||null,this.description=e.description||null}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.declaration){const y=D(e.declaration);s=t.get(y)}let o=null;if(e.readsValue){const y=D(e.readsValue);o=t.get(y)}const d={id:e.id,version:1,name:e.name||null,type:r.InputMap,index:(a.inputs||a.dynamicArguments||[]).length,description:e.description||null,declaration:s,readsValue:o,dynamicArguments:[],defaultValue:null,parent:a},p=R(d,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var y;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...Ge,r.InputMap]}},t);i=s.modifiedData;const o=t.get(i.parent),d=i.declaration&&(t.get(i.declaration)||t.getBuiltIn(i.declaration)),p=((o==null?void 0:o.inputs)||[]).find(f=>{var m;return i.declaration&&((m=f.declaration)==null?void 0:m.id)===i.declaration});if(i.declaration?d?[r.Property,r.ArgumentDeclaration,r.ValueDescriptor].includes(d.type)?o&&d.type===r.ArgumentDeclaration&&![r.FunctionCall,r.Search,r.InternalCall].includes(o.type)?a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${r.ArgumentDeclaration}' with id '${i.declaration}'.
97
97
  The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
98
- Only 'function-call', 'search' and 'internal-call' entities can have input-maps whose 'declaration' points to 'argument-declaration' entities.`,issue:null})):o&&d.type===n.Property&&!_e.includes(o.type)?a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' has a 'declaration' property pointing to an entity with type '${n.Property}' with id '${r.declaration}'.
98
+ Only 'function-call', 'search' and 'internal-call' entities can have input-maps whose 'declaration' points to 'argument-declaration' entities.`,issue:null})):o&&d.type===r.Property&&!_e.includes(o.type)?a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${r.Property}' with id '${i.declaration}'.
99
99
  The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
100
- Only variables can have input-maps whose 'declaration' points to 'property' entities.`,issue:null})):o&&d.type===n.ValueDescriptor&&![n.Condition,n.Operation,n.Loop].includes(o.type)&&a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' has a 'declaration' property pointing to an entity with type '${n.ValueDescriptor}' with id '${r.declaration}'.
100
+ Only variables can have input-maps whose 'declaration' points to 'property' entities.`,issue:null})):o&&d.type===r.ValueDescriptor&&![r.Condition,r.Operation,r.Loop].includes(o.type)&&a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${r.ValueDescriptor}' with id '${i.declaration}'.
101
101
  The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
102
- Only 'condition', 'operation' and 'loop' entities can have input-maps whose 'declaration' points to 'value-descriptor' entities.`,issue:null})):a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' must have a 'declaration' property pointing to a '${j([n.Property,n.ArgumentDeclaration,n.ValueDescriptor],"', '","' or '")}' entity.
102
+ Only 'condition', 'operation' and 'loop' entities can have input-maps whose 'declaration' points to 'value-descriptor' entities.`,issue:null})):a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' must have a 'declaration' property pointing to a '${j([r.Property,r.ArgumentDeclaration,r.ValueDescriptor],"', '","' or '")}' entity.
103
103
  Only input-map entities for variables with an inferred data type are allowed to not have a declaration.
104
- This is because a dynamically assembled object can have new properties added to it as input-maps. Otherwise all input maps need to point to a declaration`,issue:null})):a.push(new E({id:`${r.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' has a 'declaration' property that points to an entity with id '${r.declaration}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null})):(!_e.includes(o.type)||_e.includes(o.type)&&!((y=o.getDataType())!=null&&y.inferred))&&a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' must have a 'declaration' property pointing to a 'argument-declaration' or 'property' entity.
104
+ This is because a dynamically assembled object can have new properties added to it as input-maps. Otherwise all input maps need to point to a declaration`,issue:null})):a.push(new E({id:`${i.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' has a 'declaration' property that points to an entity with id '${i.declaration}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null})):(!_e.includes(o.type)||_e.includes(o.type)&&!((y=o.getDataType())!=null&&y.inferred))&&a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' must have a 'declaration' property pointing to a 'argument-declaration' or 'property' entity.
105
105
  Only input-map entities for variables with an inferred data type are allowed to not have a declaration.
106
- This is because a dynamically assembled object can have new properties added to it as input-maps. Otherwise all input maps need to point to a declaration`,issue:null})),d&&o){if(p)a.push(new E({id:`${r.id}--${h.InputOverwrite}`,code:h.InputOverwrite,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an input-map with id '${p.id}' that points to the same base ${d.type} as declaration.
106
+ This is because a dynamically assembled object can have new properties added to it as input-maps. Otherwise all input maps need to point to a declaration`,issue:null})),d&&o){if(p)a.push(new E({id:`${i.id}--${h.InputOverwrite}`,code:h.InputOverwrite,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an input-map with id '${p.id}' that points to the same base ${d.type} as declaration.
107
107
  Any value reads can be done with that input-map instead.
108
- You can't edit input-map entities as they need to match their argument declarations, so you can only modify the 'readsValue' property so it reads the value from an external entity, or the 'defaultValue' so it has a hard-coded one.`,issue:null}));else if(_e.includes(o.type)){const b=iE(o).dataType,P=b==null?void 0:b.entity;P&&P.type===n.ActionDescriptor?a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.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.
108
+ You can't edit input-map entities as they need to match their argument declarations, so you can only modify the 'readsValue' property so it reads the value from an external entity, or the 'defaultValue' so it has a hard-coded one.`,issue:null}));else if(_e.includes(o.type)){const b=Co(o).dataType,P=b==null?void 0:b.entity;P&&P.type===r.ActionDescriptor?a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.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.
109
109
  This means it can hold a function-call or operation as its value, to be executed programatically.
110
- Input maps can only be added to variables which hold an entity with properties.`,issue:null})):P&&!(b!=null&&b.inferred)&&(P.properties.find($=>$.id===d.id)||a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${d.id}' of the 'input-map' does not exist in the entity of the 'data-type'.
111
- The entity of the data-type has the following properties that can be reads as input maps, ids: '${j(P.properties.map($=>$.id),"', '","' and '")}'`,issue:null})))}else if(Ge.filter(f=>_e.includes(f)).includes(o.type)){const m=Pl(o),b=m.find(O=>O.id===r.declaration),P=`The parent entity has the following argument declarations that can be referenced by input-maps, ids: '${j(m.map(O=>O.id),"', '","' and '")}'`;b||a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${r.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 '${r.declaration}'.
110
+ Input maps can only be added to variables which hold an entity with properties.`,issue:null})):P&&!(b!=null&&b.inferred)&&(P.properties.find($=>$.id===d.id)||a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${d.id}' of the 'input-map' does not exist in the entity of the 'data-type'.
111
+ The entity of the data-type has the following properties that can be reads as input maps, ids: '${j(P.properties.map($=>$.id),"', '","' and '")}'`,issue:null})))}else if(Ge.filter(f=>_e.includes(f)).includes(o.type)){const m=Gl(o),b=m.find(C=>C.id===i.declaration),P=`The parent entity has the following argument declarations that can be referenced by input-maps, ids: '${j(m.map(C=>C.id),"', '","' and '")}'`;b||a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.InputMap}' with id '${i.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 '${i.declaration}'.
112
112
  You can't add an input-map to an entity that doesn't have a matching 'argument-declaration'.
113
- ${P}`,issue:null}))}}return a.push(...s.errors,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=La(r,this);return r=a.modifiedData,t.push(...a.errors),r.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
114
- 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:r}}addSelfToProject(){var e;return this.parent.addInput(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}removeInput(e){return this.dynamicArguments=this.dynamicArguments.filter(t=>t.id!==e.id),this}addInput(e){return this.dynamicArguments.includes(e)?this:this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),Ba.initReadsValue(this),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}setValueWriter(e){return this.readsValue=e,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||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),Ii(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.dynamicArguments.forEach(s=>{r.push(s),s.remove({ignoreUpstream:!0,seenEntities:t})}),this.defaultValue&&(r.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(r.push(this.parent),this.parent.removeInput(this)),{affected:r,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.dynamicArguments.forEach(r=>{t.push(r),r.restore({seenEntities:e})}),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.dynamicArguments.flatMap(r=>r.toFlat(e)),...this.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dynamicArguments.flatMap(r=>r.toFlatIds(e)),...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(){var e,t,r;return{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,declaration:((t=this.declaration)==null?void 0:t.toJSON())||null,readsValue:((r=this.readsValue)==null?void 0:r.toReference())||null,parent:this.parent.toReference(),dynamicArguments:this.dynamicArguments.map(a=>a.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,dynamicArguments:this.dynamicArguments.map(a=>a.toReference()),declaration:((t=this.declaration)==null?void 0:t.toReference())||null,readsValue:((r=this.readsValue)==null?void 0:r.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dynamicArguments.flatMap(r=>r.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.dynamicArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.dynamicArguments.forEach(t=>t.clearErrors()),(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=kU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dynamicArguments.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return this.defaultValue||((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e){return new se(this.toJSON(),this.project)}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(se,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(se,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(se,"BASE_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,...se.INMUTABLE_BASE_PROPERTIES]),l(se,"MUTABLE_META_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,"index"]),l(se,"INMUTABLE_META_PROPERTIES",[...se.INMUTABLE_BASE_PROPERTIES]),l(se,"META_PROPERTIES",[...se.MUTABLE_META_PROPERTIES,...se.INMUTABLE_META_PROPERTIES]),l(se,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(se,"UPSTREAM_PROPERTIES",[...se.MUTABLE_UPSTREAM_PROPERTIES,...se.INMUTABLE_UPSTREAM_PROPERTIES]),l(se,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue","dynamicArguments"]),l(se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(se,"DOWNSTREAM_PROPERTIES",[...se.MUTABLE_DOWNSTREAM_PROPERTIES,...se.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(se,"PROPERTIES",[...se.META_PROPERTIES,...se.UPSTREAM_PROPERTIES,...se.DOWNSTREAM_PROPERTIES]);let mi=se;function qU(i){const e=Lx(),t=i.toJSON();e.safeParse(t).success;const a=[];if(i.id==="exec-sequentially-return-map-id"){const s=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});a.push(s.error)}return z(i.errors,a)}const oe=class oe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",n.OutputMap);l(this,"parentRelationType");l(this,"declaration");l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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 r=D(e.parent),a=t.get(r);let s;if(e.declaration){const p=D(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:n.OutputMap,index:(a.outputs||[]).length,declaration:s,writesValues:[],parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var d;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:Ge.filter(p=>p!==n.Condition)},declaration:{list:!1,types:[n.ReturnDeclaration,n.Property]}},t);r=s.modifiedData;const o=t.get(r.parent);if(o&&Ge.filter(p=>p!==n.Condition).includes(o.type)){const p=o.outputs.find(y=>y.declaration.id===D(r.declaration));if(p)a.push(new E({id:`${r.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${n.OutputMap}' with id '${r.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'.
113
+ ${P}`,issue:null}))}}return a.push(...s.errors,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=qa(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
114
+ 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:i}}addSelfToProject(){var e;return this.parent.addInput(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}removeInput(e){return this.dynamicArguments=this.dynamicArguments.filter(t=>t.id!==e.id),this}addInput(e){return this.dynamicArguments.includes(e)?this:this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),Ga.initReadsValue(this),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}setValueWriter(e){return this.readsValue=e,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||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),Pi(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.dynamicArguments.forEach(s=>{i.push(s),s.remove({ignoreUpstream:!0,seenEntities:t})}),this.defaultValue&&(i.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(i.push(this.parent),this.parent.removeInput(this)),{affected:i,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.dynamicArguments.forEach(i=>{t.push(i),i.restore({seenEntities:e})}),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.dynamicArguments.flatMap(i=>i.toFlat(e)),...this.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dynamicArguments.flatMap(i=>i.toFlatIds(e)),...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(){var e,t,i;return{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,declaration:((t=this.declaration)==null?void 0:t.toJSON())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference(),dynamicArguments:this.dynamicArguments.map(a=>a.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,dynamicArguments:this.dynamicArguments.map(a=>a.toReference()),declaration:((t=this.declaration)==null?void 0:t.toReference())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dynamicArguments.flatMap(i=>i.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.dynamicArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.dynamicArguments.forEach(t=>t.clearErrors()),(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=o8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dynamicArguments.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return this.defaultValue||((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e){return new se(this.toJSON(),this.project)}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(se,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(se,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(se,"BASE_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,...se.INMUTABLE_BASE_PROPERTIES]),l(se,"MUTABLE_META_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,"index"]),l(se,"INMUTABLE_META_PROPERTIES",[...se.INMUTABLE_BASE_PROPERTIES]),l(se,"META_PROPERTIES",[...se.MUTABLE_META_PROPERTIES,...se.INMUTABLE_META_PROPERTIES]),l(se,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(se,"UPSTREAM_PROPERTIES",[...se.MUTABLE_UPSTREAM_PROPERTIES,...se.INMUTABLE_UPSTREAM_PROPERTIES]),l(se,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue","dynamicArguments"]),l(se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(se,"DOWNSTREAM_PROPERTIES",[...se.MUTABLE_DOWNSTREAM_PROPERTIES,...se.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(se,"PROPERTIES",[...se.META_PROPERTIES,...se.UPSTREAM_PROPERTIES,...se.DOWNSTREAM_PROPERTIES]);let Ti=se;function l8(n){const e=nx(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-return-map-id"){const s=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return z(n.errors,a)}const oe=class oe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",r.OutputMap);l(this,"parentRelationType");l(this,"declaration");l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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 i=D(e.parent),a=t.get(i);let s;if(e.declaration){const p=D(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:r.OutputMap,index:(a.outputs||[]).length,declaration:s,writesValues:[],parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var d;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:Ge.filter(p=>p!==r.Condition)},declaration:{list:!1,types:[r.ReturnDeclaration,r.Property]}},t);i=s.modifiedData;const o=t.get(i.parent);if(o&&Ge.filter(p=>p!==r.Condition).includes(o.type)){const p=o.outputs.find(y=>y.declaration.id===D(i.declaration));if(p)a.push(new E({id:`${i.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${r.OutputMap}' with id '${i.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'.
115
115
  Any value reads can be done with that output-map instead.
116
- 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 y=t.get(r.declaration);if(y&&_e.includes(o.type)){const f=iE(o),m=f.dataType,b=(d=f.dataType)==null?void 0:d.entity;m?b?b.type===n.ActionDescriptor?a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.OutputMap}' with id '${r.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.
116
+ 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 y=t.get(i.declaration);if(y&&_e.includes(o.type)){const f=Co(o),m=f.dataType,b=(d=f.dataType)==null?void 0:d.entity;m?b?b.type===r.ActionDescriptor?a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.OutputMap}' with id '${i.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.
117
117
  This means it can hold a function-call or operation as its value, to be executed programatically.
118
- Output maps can only be added to variables which hold an entity with properties.`,issue:null})):b.properties.find(O=>O.id===y.id)||a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.OutputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${y.id}' of the 'output-map' does not exist in the entity of the 'data-type'.
119
- The entity of the data-type has the following properties that can be reads as output maps, ids: '${j(b.properties.map(O=>O.id),"', '","' and '")}'`,issue:null})):a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.OutputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' doesn't have an 'entity' set, so it cannot be determined if the output-map is reading a valid property of the data type entity.
120
- ${yb}`,issue:null})):a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.OutputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is not set, so it cannot be determined if the output-map is reading a valid property of the data type entity.
121
- ${yb}`,issue:null}))}else if(y){const f=o.outputs.find(m=>m.declaration.id===r.declaration);f&&a.push(new E({id:`${r.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${n.OutputMap}' with id '${r.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 '${f.id}' that points to the same declaration.
118
+ Output maps can only be added to variables which hold an entity with properties.`,issue:null})):b.properties.find(C=>C.id===y.id)||a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${y.id}' of the 'output-map' does not exist in the entity of the 'data-type'.
119
+ The entity of the data-type has the following properties that can be reads as output maps, ids: '${j(b.properties.map(C=>C.id),"', '","' and '")}'`,issue:null})):a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' doesn't have an 'entity' set, so it cannot be determined if the output-map is reading a valid property of the data type entity.
120
+ ${kb}`,issue:null})):a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is not set, so it cannot be determined if the output-map is reading a valid property of the data type entity.
121
+ ${kb}`,issue:null}))}else if(y){const f=o.outputs.find(m=>m.declaration.id===i.declaration);f&&a.push(new E({id:`${i.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${r.OutputMap}' with id '${i.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 '${f.id}' that points to the same declaration.
122
122
  Any value reads can be done with that output-map instead.
123
- 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,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
124
- 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}}addSelfToProject(){return this.parent.addOutput(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),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,wa.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),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||this.index,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),{affected:r,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,writesValues:this.writesValues.map(e=>e.toJSON()),declaration:this.declaration.toJSON(),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,declaration:this.declaration.toReference(),writesValues:this.writesValues.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this}validate(){const e=qU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new oe(this.toJSON(),this.project)}getDataType(){return this.declaration.getDataType()||null}};l(oe,"MUTABLE_BASE_PROPERTIES",[]),l(oe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"index"]),l(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),l(oe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),l(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),l(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let Ti=oe;function JU(i){var s;const e=eU(),t=i.toJSON();e.safeParse(t).success,(s=i.dataType)==null||s.validate();const a=[];if(i.id==="company-dto-func-declaration-argument-dcl-id"){const o=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});a.push(o.error)}if(i.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=W({id:`${i.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${B(i,i.project)}" with id "${i.id}" implements a non-abstract property "${B(i,i.project)}" with id "${i.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:i});a.push(o.error)}return z(i.errors,a)}const le=class le{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"type",n.ArgumentDeclaration);l(this,"dataType",null);l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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}static fromGenerationTarget(e,t){const r=D(e.parent),a=t.get(r),s={id:e.id,version:1,name:e.name,type:n.ArgumentDeclaration,index:a.inputs.length,description:e.description,required:e.required,dataType:null,writesValues:[],parent:a},o=R(s,t);return o.setParent(a),o.initChildren(),o}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[n.FunctionDeclaration,n.Search,n.Condition]}},t);r=s.modifiedData;const o=N$(r,t);if(console.log("Checking that the argument declaration does not overlap with the implemented signature"),r.parent){const d=t.get(D(r.parent));if(d)if(console.log("Parent found"),Fe.includes(d.type)){console.log("Parent is an entry point");const p=d.implements;if(p)if(console.log("Parent implements a descriptor. Argument type: ",p.argumentsType),p.argumentsType===V.Fixed){console.log("Descriptor has fixed arguments");const y=p.fixedArguments.find($=>$.name===r.name),f=p.fixedArguments.filter($=>!d.inputs.find(tt=>tt.type===n.ArgumentDeclaration&&tt.name===$.name)),m=d.inputs.filter($=>$.type===n.ArgumentDeclaration),b=m.find($=>$.name===r.name),P=m.length?`The parent entity already implements the following arguments: ${j(m.map($=>`'${$.id}' (${$.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",O=f.length?`The parent entity is still missing the following arguments in the implementation: ${j(f.map($=>`'${$.id}' (${$.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";y?b&&(console.log("Argument with the same name already implemented"),a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ArgumentDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${d.type}' with id '${d.id}' that implements a ${n.ActionDescriptor} with fixed arguments.
123
+ 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,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
124
+ 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}}addSelfToProject(){return this.parent.addOutput(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),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,Fa.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),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||this.index,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),{affected:i,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,writesValues:this.writesValues.map(e=>e.toJSON()),declaration:this.declaration.toJSON(),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,declaration:this.declaration.toReference(),writesValues:this.writesValues.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this}validate(){const e=l8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new oe(this.toJSON(),this.project)}getDataType(){return this.declaration.getDataType()||null}};l(oe,"MUTABLE_BASE_PROPERTIES",[]),l(oe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"index"]),l(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),l(oe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),l(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),l(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let Ei=oe;function c8(n){var s;const e=bU(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="company-dto-func-declaration-argument-dcl-id"){const o=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}if(n.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=W({id:`${n.id}--${_.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:_.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return z(n.errors,a)}const le=class le{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"type",r.ArgumentDeclaration);l(this,"dataType",null);l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s={id:e.id,version:1,name:e.name,type:r.ArgumentDeclaration,index:a.inputs.length,description:e.description,required:e.required,dataType:null,writesValues:[],parent:a},o=R(s,t);return o.setParent(a),o.initChildren(),o}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[r.FunctionDeclaration,r.Search,r.Condition]}},t);i=s.modifiedData;const o=Lo(i,t);if(console.log("Checking that the argument declaration does not overlap with the implemented signature"),i.parent){const d=t.get(D(i.parent));if(d)if(console.log("Parent found"),Fe.includes(d.type)){console.log("Parent is an entry point");const p=d.implements;if(p)if(console.log("Parent implements a descriptor. Argument type: ",p.argumentsType),p.argumentsType===V.Fixed){console.log("Descriptor has fixed arguments");const y=p.fixedArguments.find($=>$.name===i.name),f=p.fixedArguments.filter($=>!d.inputs.find(tt=>tt.type===r.ArgumentDeclaration&&tt.name===$.name)),m=d.inputs.filter($=>$.type===r.ArgumentDeclaration),b=m.find($=>$.name===i.name),P=m.length?`The parent entity already implements the following arguments: ${j(m.map($=>`'${$.id}' (${$.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",C=f.length?`The parent entity is still missing the following arguments in the implementation: ${j(f.map($=>`'${$.id}' (${$.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";y?b&&(console.log("Argument with the same name already implemented"),a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${d.type}' with id '${d.id}' that implements a ${r.ActionDescriptor} with fixed arguments.
125
125
  Adding a new argument would make the implementation invalid. An argument with the same name already exists in the parent entity.
126
126
  ${P}
127
- ${O}`,issue:null}))):(console.log("No argument with the same name in the descriptor"),a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ArgumentDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${d.type}' with id '${d.id}' that implements a ${n.ActionDescriptor} with fixed arguments.
127
+ ${C}`,issue:null}))):(console.log("No argument with the same name in the descriptor"),a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${d.type}' with id '${d.id}' that implements a ${r.ActionDescriptor} with fixed arguments.
128
128
  Adding a new argument would make the implementation invalid. There are no arguments in the descriptor with the same name.
129
129
  ${P}
130
- ${O}`,issue:null})))}else p.argumentsType===V.Dynamic?console.log("Descriptor has dynamic arguments"):p.argumentsType===V.None&&(console.log("Descriptor has no arguments"),a.push(new E({id:`${r.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ArgumentDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${d.type}' with id '${d.id}' that implements a ${n.ActionDescriptor} with no arguments.
131
- Adding a new argument would make the implementation invalid.`,issue:null})));else console.log("Parent does not implement a descriptor")}else console.log("Parent is not an entry point");else console.log("Parent not found")}return a.push(...s.errors,...o,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
132
- 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}}addSelfToProject(){return this.parent.addInputDeclaration(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),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.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),wa.initWritesValues(this,this.parent),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||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),e||(r.push(this.parent),this.parent.removeInputDeclaration(this)),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:S(r),removed:S(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.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),t.push(this.parent),this.parent.addInputDeclaration(this),this.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return{affected:S(t),self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(a=>a.toFlat(e)),...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(a=>a.toFlatIds(e)),...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e;return{id:this.id,version:this.version,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,writesValues:this.writesValues.map(t=>t.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,writesValues:this.writesValues.map(t=>t.toReference()),dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...((r=this.dataType)==null?void 0:r.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=JU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this==null?void 0:this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new le(this.toJSON(),this.project)}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};l(le,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(le,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(le,"BASE_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,...le.INMUTABLE_BASE_PROPERTIES]),l(le,"MUTABLE_META_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,"index"]),l(le,"INMUTABLE_META_PROPERTIES",[...le.INMUTABLE_BASE_PROPERTIES]),l(le,"META_PROPERTIES",[...le.MUTABLE_META_PROPERTIES,...le.INMUTABLE_META_PROPERTIES]),l(le,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(le,"UPSTREAM_PROPERTIES",[...le.MUTABLE_UPSTREAM_PROPERTIES,...le.INMUTABLE_UPSTREAM_PROPERTIES]),l(le,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType"]),l(le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(le,"DOWNSTREAM_PROPERTIES",[...le.MUTABLE_DOWNSTREAM_PROPERTIES,...le.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(le,"PROPERTIES",[...le.META_PROPERTIES,...le.UPSTREAM_PROPERTIES,...le.DOWNSTREAM_PROPERTIES]);let Ei=le;function WU(i){const e=sl(),t=i.toJSON();e.safeParse(t).success;const a=[];return z(i.errors,a)}function HU(i,e){const t=[];if(i.parent)if(i.parent){const r=e.get(i.parent);r?[n.InputMap,n.DataType].includes(r.type)?r.type===n.DataType&&r.defaultValue&&t.push(new E({id:`${i.id}--${i.parent}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${r.defaultValue.id}".
130
+ ${C}`,issue:null})))}else p.argumentsType===V.Dynamic?console.log("Descriptor has dynamic arguments"):p.argumentsType===V.None&&(console.log("Descriptor has no arguments"),a.push(new E({id:`${i.id}--${g.NoOverlapWithImplementedSignature}`,code:g.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${d.type}' with id '${d.id}' that implements a ${r.ActionDescriptor} with no arguments.
131
+ Adding a new argument would make the implementation invalid.`,issue:null})));else console.log("Parent does not implement a descriptor")}else console.log("Parent is not an entry point");else console.log("Parent not found")}return a.push(...s.errors,...o,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
132
+ 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}}addSelfToProject(){return this.parent.addInputDeclaration(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),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.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),Fa.initWritesValues(this,this.parent),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||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),e||(i.push(this.parent),this.parent.removeInputDeclaration(this)),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(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.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),t.push(this.parent),this.parent.addInputDeclaration(this),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return{affected:S(t),self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(a=>a.toFlat(e)),...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(a=>a.toFlatIds(e)),...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e;return{id:this.id,version:this.version,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,writesValues:this.writesValues.map(t=>t.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,writesValues:this.writesValues.map(t=>t.toReference()),dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=c8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this==null?void 0:this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new le(this.toJSON(),this.project)}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};l(le,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(le,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(le,"BASE_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,...le.INMUTABLE_BASE_PROPERTIES]),l(le,"MUTABLE_META_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,"index"]),l(le,"INMUTABLE_META_PROPERTIES",[...le.INMUTABLE_BASE_PROPERTIES]),l(le,"META_PROPERTIES",[...le.MUTABLE_META_PROPERTIES,...le.INMUTABLE_META_PROPERTIES]),l(le,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(le,"UPSTREAM_PROPERTIES",[...le.MUTABLE_UPSTREAM_PROPERTIES,...le.INMUTABLE_UPSTREAM_PROPERTIES]),l(le,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType"]),l(le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(le,"DOWNSTREAM_PROPERTIES",[...le.MUTABLE_DOWNSTREAM_PROPERTIES,...le.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(le,"PROPERTIES",[...le.META_PROPERTIES,...le.UPSTREAM_PROPERTIES,...le.DOWNSTREAM_PROPERTIES]);let Ri=le;function d8(n){const e=vl(),t=n.toJSON();e.safeParse(t).success;const a=[];return z(n.errors,a)}function u8(n,e){const t=[];if(n.parent)if(n.parent){const i=e.get(n.parent);i?[r.InputMap,r.DataType].includes(i.type)?i.type===r.DataType&&i.defaultValue&&t.push(new E({id:`${n.id}--${n.parent}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${i.defaultValue.id}".
133
133
  Data types can only have one 'primitive-value' entity as 'defaultValue'.
134
134
  You can update the existing 'primitive-value' with the 'update' action, for example, like so:
135
135
  \`\`\`json
136
136
  {
137
137
  "update": {
138
- "entityId": "${r.defaultValue.id}",
138
+ "entityId": "${i.defaultValue.id}",
139
139
  "data": {
140
140
  "value": "Some new value here"
141
141
  }
142
142
  }
143
143
  }\`\`\`
144
- Or 'delete' and then 'post' actions to replace it.`,issue:null})):t.push(new E({id:`${i.id}--${i.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a parent reference that isn't pointing to an entity of type 'input-map' or 'data-type'.`,issue:null})):t.push(new E({id:`${i.id}--${i.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${i.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${i.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null}));else return t.push(new E({id:`${i.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null})),t;if(i.valueAsType){const r=[],a=[],s=i.valueAsType;Array.isArray(s)?s.forEach(o=>{typeof o=="string"?a.push(o):r.push(o)}):typeof s=="string"?a.push(s):r.push(s),r.forEach(o=>{const d=yl(o);t.push(...d),d.length===0&&a.push(o.entityId)}),a.forEach(o=>{const d=e.get(o);d?[n.CustomEntity,n.BuiltInBaseEntity].includes(d.type)||t.push(new E({id:`${i.id}--${o}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'valueAsType' reference that isn't pointing to an entity of type 'custom-entity', 'function-declaration' or 'operation'.`,issue:null})):t.push(new E({id:`${i.id}--${o}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${o}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))})}return t}const me=class me{constructor(e,t){l(this,"initialData");l(this,"type",n.PrimitiveValue);l(this,"id");l(this,"version");l(this,"name");l(this,"autogeneration",null);l(this,"value",null);l(this,"valueAsType",null);l(this,"errors",[]);l(this,"parent");l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.autogeneration=e.autogeneration,this.value=e.value}static fromGenerationTarget(e,t){const r=D(e.parent),a=t.get(r);let s=null;e.valueAsType&&(Array.isArray(e.valueAsType)?s=e.valueAsType.map(p=>t.get(p)||t.getBuiltIn(p)):s=t.get(e.valueAsType)||t.getBuiltIn(e.valueAsType));const o={id:e.id,version:1,type:n.PrimitiveValue,name:e.name,autogeneration:e.autogeneration,valueAsType:s,value:e.value||null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=HU(r,t);return a.push(...s,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
145
- 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}}addSelfToProject(){return this.parent.setDefaultValue(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.valueAsType&&(Array.isArray(this.initialData.valueAsType)?this.valueAsType=this.initialData.valueAsType.map(e=>R(e,this.project)):this.valueAsType=R(this.initialData.valueAsType,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.subscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.autogeneration=e.autogeneration||this.autogeneration,e.value!==void 0&&(this.value=e.value),this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),{affected:S(r),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlat(e)):this.valueAsType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlatIds(e)):this.valueAsType.toFlatIds(e):[]])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,autogeneration:this.autogeneration,value:this.value,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlatJSON(e)):this.valueAsType.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.id):this.valueAsType.id:null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlatGenerationTarget(e)):this.valueAsType.toFlatGenerationTarget(e):[]])}clearErrors(){return this.errors=[],this}validate(){const e=WU(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,r=!0){const a=this.toJSON(),s=t||Xt(this.name,n.PrimitiveValue,this.project);a.id=s;const o=qa(a,this.project);return e&&o.setParent(e),r&&o.subscribe(),o}};l(me,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value"]),l(me,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),l(me,"MUTABLE_META_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES]),l(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),l(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),l(me,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(me,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),l(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["valueAsType"]),l(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let pl=me;function YU(i){var s;const e=mx(),t=i.toJSON();e.safeParse(t).success,i.outputs.forEach(o=>o.validate()),(s=i.throws)==null||s.validate();const a=[];return z(i.errors,a)}function zU(i){var s;const e=px(),t=i.toJSON();e.safeParse(t).success,i.outputs.forEach(o=>o.validate()),(s=i.throws)==null||s.validate();const a=[];return z(i.errors,a)}const Te=class Te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.ContinueStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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){const r=D(e.parent),a=t.get(r),s=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),d=e.calledByError.map(f=>{const m=D(f);return t.get(m)}),p={id:e.id,version:1,type:n.ContinueStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:d,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[n.Loop]}},t);return r=s.modifiedData,a.push(...s.errors,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
144
+ Or 'delete' and then 'post' actions to replace it.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'input-map' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${n.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null}));else return t.push(new E({id:`${n.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null})),t;if(n.valueAsType){const i=[],a=[],s=n.valueAsType;Array.isArray(s)?s.forEach(o=>{typeof o=="string"?a.push(o):i.push(o)}):typeof s=="string"?a.push(s):i.push(s),i.forEach(o=>{const d=Al(o);t.push(...d),d.length===0&&a.push(o.entityId)}),a.forEach(o=>{const d=e.get(o);d?[r.CustomEntity,r.BuiltInBaseEntity].includes(d.type)||t.push(new E({id:`${n.id}--${o}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'valueAsType' reference that isn't pointing to an entity of type 'custom-entity', 'function-declaration' or 'operation'.`,issue:null})):t.push(new E({id:`${n.id}--${o}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${o}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))})}return t}const me=class me{constructor(e,t){l(this,"initialData");l(this,"type",r.PrimitiveValue);l(this,"id");l(this,"version");l(this,"name");l(this,"autogeneration",null);l(this,"value",null);l(this,"valueAsType",null);l(this,"errors",[]);l(this,"parent");l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.autogeneration=e.autogeneration,this.value=e.value}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.valueAsType&&(Array.isArray(e.valueAsType)?s=e.valueAsType.map(p=>t.get(p)||t.getBuiltIn(p)):s=t.get(e.valueAsType)||t.getBuiltIn(e.valueAsType));const o={id:e.id,version:1,type:r.PrimitiveValue,name:e.name,autogeneration:e.autogeneration,valueAsType:s,value:e.value||null,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=u8(i,t);return a.push(...s,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
145
+ 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}}addSelfToProject(){return this.parent.setDefaultValue(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.valueAsType&&(Array.isArray(this.initialData.valueAsType)?this.valueAsType=this.initialData.valueAsType.map(e=>R(e,this.project)):this.valueAsType=R(this.initialData.valueAsType,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.subscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.autogeneration=e.autogeneration||this.autogeneration,e.value!==void 0&&(this.value=e.value),this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlat(e)):this.valueAsType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatIds(e)):this.valueAsType.toFlatIds(e):[]])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,autogeneration:this.autogeneration,value:this.value,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatJSON(e)):this.valueAsType.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.id):this.valueAsType.id:null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatGenerationTarget(e)):this.valueAsType.toFlatGenerationTarget(e):[]])}clearErrors(){return this.errors=[],this}validate(){const e=d8(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,i=!0){const a=this.toJSON(),s=t||qt(this.name,r.PrimitiveValue,this.project);a.id=s;const o=Qa(a,this.project);return e&&o.setParent(e),i&&o.subscribe(),o}};l(me,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value"]),l(me,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),l(me,"MUTABLE_META_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES]),l(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),l(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),l(me,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(me,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),l(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["valueAsType"]),l(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let Sl=me;function p8(n){var s;const e=L4(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return z(n.errors,a)}function y8(n){var s;const e=M4(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return z(n.errors,a)}const Te=class Te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.ContinueStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),d=e.calledByError.map(f=>{const m=D(f);return t.get(m)}),p={id:e.id,version:1,type:r.ContinueStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:d,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[r.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
146
146
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
147
147
  You shouldn't have to manually update a 'parent' property.
148
- Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addContinueStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeContinueStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addContinueStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toJSON()),throws:((e=this.throws)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(t=>t.toReference()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e)),...((r=this.throws)==null?void 0:r.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=zU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Te(this.toJSON(),this.project)}};l(Te,"MUTABLE_BASE_PROPERTIES",[]),l(Te,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Te,"BASE_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES,...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"MUTABLE_META_PROPERTIES",["x","y"]),l(Te,"INMUTABLE_META_PROPERTIES",[...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"META_PROPERTIES",[...Te.MUTABLE_META_PROPERTIES,...Te.INMUTABLE_META_PROPERTIES]),l(Te,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(Te,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),l(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(Te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Te,"DOWNSTREAM_PROPERTIES",[...Te.MUTABLE_DOWNSTREAM_PROPERTIES,...Te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Te,"PROPERTIES",[...Te.META_PROPERTIES,...Te.UPSTREAM_PROPERTIES,...Te.DOWNSTREAM_PROPERTIES]);let Dt=Te;const et=class et{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.ReturnStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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){const r=D(e.parent),a=t.get(r),s=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),d=e.calledByError.map(f=>{const m=D(f);return t.get(m)}),p={id:e.id,version:1,type:n.ReturnStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:d,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:it}},t);return r=s.modifiedData,a.push(...s.errors,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
148
+ Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addContinueStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeContinueStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(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.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addContinueStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toJSON()),throws:((e=this.throws)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(t=>t.toReference()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e)),...((i=this.throws)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=y8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Te(this.toJSON(),this.project)}};l(Te,"MUTABLE_BASE_PROPERTIES",[]),l(Te,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Te,"BASE_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES,...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"MUTABLE_META_PROPERTIES",["x","y"]),l(Te,"INMUTABLE_META_PROPERTIES",[...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"META_PROPERTIES",[...Te.MUTABLE_META_PROPERTIES,...Te.INMUTABLE_META_PROPERTIES]),l(Te,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(Te,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),l(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(Te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Te,"DOWNSTREAM_PROPERTIES",[...Te.MUTABLE_DOWNSTREAM_PROPERTIES,...Te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Te,"PROPERTIES",[...Te.META_PROPERTIES,...Te.UPSTREAM_PROPERTIES,...Te.DOWNSTREAM_PROPERTIES]);let Dt=Te;const et=class et{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.ReturnStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),d=e.calledByError.map(f=>{const m=D(f);return t.get(m)}),p={id:e.id,version:1,type:r.ReturnStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:d,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:it}},t);return i=s.modifiedData,a.push(...s.errors,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
149
149
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
150
150
  You shouldn't have to manually update a 'parent' property.
151
- Specifically for return statements the parent needs to always be the 'function-declaration' or 'global-event' that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addReturnStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeReturnStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addReturnStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toJSON()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=YU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new et(this.toJSON(),this.project)}};l(et,"MUTABLE_BASE_PROPERTIES",[]),l(et,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(et,"BASE_PROPERTIES",[...Dt.MUTABLE_BASE_PROPERTIES,...Dt.INMUTABLE_BASE_PROPERTIES]),l(et,"MUTABLE_META_PROPERTIES",["x","y"]),l(et,"INMUTABLE_META_PROPERTIES",[...Dt.INMUTABLE_BASE_PROPERTIES]),l(et,"META_PROPERTIES",[...Dt.MUTABLE_META_PROPERTIES,...Dt.INMUTABLE_META_PROPERTIES]),l(et,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(et,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(et,"UPSTREAM_PROPERTIES",[...Dt.MUTABLE_UPSTREAM_PROPERTIES,...Dt.INMUTABLE_UPSTREAM_PROPERTIES]),l(et,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(et,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(et,"DOWNSTREAM_PROPERTIES",[...Dt.MUTABLE_DOWNSTREAM_PROPERTIES,...Dt.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(et,"PROPERTIES",[...$t.META_PROPERTIES,...$t.UPSTREAM_PROPERTIES,...$t.DOWNSTREAM_PROPERTIES]);let Ri=et;function ZU(i){var s;const e=wx(),t=i.toJSON();e.safeParse(t).success,i.outputs.forEach(o=>o.validate()),(s=i.throws)==null||s.validate();const a=[];return z(i.errors,a)}const Ee=class Ee{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.BreakStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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){const r=D(e.parent),a=t.get(r),s=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),d=e.calledByError.map(f=>{const m=D(f);return t.get(m)}),p={id:e.id,version:1,type:n.BreakStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:d,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[n.Loop]}},t);return r=s.modifiedData,a.push(...s.errors,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
151
+ Specifically for return statements the parent needs to always be the 'function-declaration' or 'global-event' that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addReturnStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeReturnStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(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.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addReturnStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toJSON()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=p8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new et(this.toJSON(),this.project)}};l(et,"MUTABLE_BASE_PROPERTIES",[]),l(et,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(et,"BASE_PROPERTIES",[...Dt.MUTABLE_BASE_PROPERTIES,...Dt.INMUTABLE_BASE_PROPERTIES]),l(et,"MUTABLE_META_PROPERTIES",["x","y"]),l(et,"INMUTABLE_META_PROPERTIES",[...Dt.INMUTABLE_BASE_PROPERTIES]),l(et,"META_PROPERTIES",[...Dt.MUTABLE_META_PROPERTIES,...Dt.INMUTABLE_META_PROPERTIES]),l(et,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(et,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(et,"UPSTREAM_PROPERTIES",[...Dt.MUTABLE_UPSTREAM_PROPERTIES,...Dt.INMUTABLE_UPSTREAM_PROPERTIES]),l(et,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(et,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(et,"DOWNSTREAM_PROPERTIES",[...Dt.MUTABLE_DOWNSTREAM_PROPERTIES,...Dt.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(et,"PROPERTIES",[...$t.META_PROPERTIES,...$t.UPSTREAM_PROPERTIES,...$t.DOWNSTREAM_PROPERTIES]);let bi=et;function h8(n){var s;const e=X4(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return z(n.errors,a)}const Ee=class Ee{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.BreakStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(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){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=D(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=D(f);return t.get(m)}),d=e.calledByError.map(f=>{const m=D(f);return t.get(m)}),p={id:e.id,version:1,type:r.BreakStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:d,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[r.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
152
152
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
153
153
  You shouldn't have to manually update a 'parent' property.
154
- Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addBreakStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeBreakStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:S(r),removed:S(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addBreakStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=ZU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors()),...this.throws?this.throws.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new Ee(this.toJSON(),this.project)}};l(Ee,"MUTABLE_BASE_PROPERTIES",[]),l(Ee,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Ee,"BASE_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"MUTABLE_META_PROPERTIES",["x","y"]),l(Ee,"INMUTABLE_META_PROPERTIES",[...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"META_PROPERTIES",[...Ee.MUTABLE_META_PROPERTIES,...Ee.INMUTABLE_META_PROPERTIES]),l(Ee,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(Ee,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(Ee,"UPSTREAM_PROPERTIES",[...Ee.MUTABLE_UPSTREAM_PROPERTIES,...Ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(Ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(Ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Ee,"DOWNSTREAM_PROPERTIES",[...Ee.MUTABLE_DOWNSTREAM_PROPERTIES,...Ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Ee,"PROPERTIES",[...Ee.META_PROPERTIES,...Ee.UPSTREAM_PROPERTIES,...Ee.DOWNSTREAM_PROPERTIES]);let _a=Ee;function XU(i){var s,o;const e=BR(),t=i.toJSON();e.safeParse(t).success,i.fixedArguments.flatMap(d=>d.validate()),i.fixedReturns.flatMap(d=>d.validate()),(s=i.dynamicArgumentTypes)==null||s.validate(),(o=i.dynamicReturnTypes)==null||o.validate();const a=[];return z(i.errors,a)}const ce=class ce{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"argumentsType");l(this,"returnsType");l(this,"type",n.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"implementation",null);l(this,"parent",null);l(this,"errors",[]);l(this,"project");l(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.argumentsType=e.argumentsType,this.returnsType=e.returnsType}static fromGenerationTarget(e,t){let r=null;if(e.parent){const o=D(e.parent);r=t.get(o)}const a={id:e.id,version:1,name:e.name,type:n.ActionDescriptor,description:e.description,dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:e.argumentsType,returnsType:e.returnsType,fixedArguments:[],fixedReturns:[],error:null,parent:r},s=R(a,t);return r&&s.setParent(r),s.initChildren(),s}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[n.CustomEntity,n.DataType]}},t);r=s.modifiedData;const o=r.parent?t.get(r.parent):null;if(o&&o.type===n.CustomEntity){const d=o,y=mn(d).filter(f=>!f.interactive);if(y.length){let f=y.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${d.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${j(y.map(m=>B(m,m.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${d.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${B(y[0],y[0].project)}").`;f+=`
155
- ${Vn}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:f,issue:null}))}}else if(o&&o.type===n.DataType){const d=o;d.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${d.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
154
+ Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addBreakStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeBreakStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(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.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addBreakStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=h8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors()),...this.throws?this.throws.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new Ee(this.toJSON(),this.project)}};l(Ee,"MUTABLE_BASE_PROPERTIES",[]),l(Ee,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Ee,"BASE_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"MUTABLE_META_PROPERTIES",["x","y"]),l(Ee,"INMUTABLE_META_PROPERTIES",[...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"META_PROPERTIES",[...Ee.MUTABLE_META_PROPERTIES,...Ee.INMUTABLE_META_PROPERTIES]),l(Ee,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(Ee,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(Ee,"UPSTREAM_PROPERTIES",[...Ee.MUTABLE_UPSTREAM_PROPERTIES,...Ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(Ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(Ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Ee,"DOWNSTREAM_PROPERTIES",[...Ee.MUTABLE_DOWNSTREAM_PROPERTIES,...Ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Ee,"PROPERTIES",[...Ee.META_PROPERTIES,...Ee.UPSTREAM_PROPERTIES,...Ee.DOWNSTREAM_PROPERTIES]);let Ua=Ee;function f8(n){var s,o;const e=ib(),t=n.toJSON();e.safeParse(t).success,n.fixedArguments.flatMap(d=>d.validate()),n.fixedReturns.flatMap(d=>d.validate()),(s=n.dynamicArgumentTypes)==null||s.validate(),(o=n.dynamicReturnTypes)==null||o.validate();const a=[];return z(n.errors,a)}const ce=class ce{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"argumentsType");l(this,"returnsType");l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"implementation",null);l(this,"parent",null);l(this,"errors",[]);l(this,"project");l(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.argumentsType=e.argumentsType,this.returnsType=e.returnsType}static fromGenerationTarget(e,t){let i=null;if(e.parent){const o=D(e.parent);i=t.get(o)}const a={id:e.id,version:1,name:e.name,type:r.ActionDescriptor,description:e.description,dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:e.argumentsType,returnsType:e.returnsType,fixedArguments:[],fixedReturns:[],error:null,parent:i},s=R(a,t);return i&&s.setParent(i),s.initChildren(),s}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[r.CustomEntity,r.DataType]}},t);i=s.modifiedData;const o=i.parent?t.get(i.parent):null;if(o&&o.type===r.CustomEntity){const d=o,y=mn(d).filter(f=>!f.interactive);if(y.length){let f=y.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${d.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${j(y.map(m=>A(m,m.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${d.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(y[0],y[0].project)}").`;f+=`
155
+ ${Ln}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:f,issue:null}))}}else if(o&&o.type===r.DataType){const d=o;d.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${d.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
156
156
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
157
- ${Va({describe_entity:d.entity.id})}
158
- 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,...Ae(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
159
- 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}}addSelfToProject(){return this.parent?(this.parent.type===n.CustomEntity?this.parent.addAbstractMethod(this):this.parent.type===n.DataType&&this.parent.setEntity(this),this):this}setParent(e){return this.parent=e,this}setDynamicReturnTypes(e){return this.dynamicReturnTypes=e,this}setDynamicArgumentTypes(e){return this.dynamicArgumentTypes=e,this}removeDynamicArgumentTypes(){return this.dynamicArgumentTypes=null,this}removeDynamicReturnTypes(){return this.dynamicReturnTypes=null,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.fixedArguments=this.initialData.fixedArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.fixedReturns=this.initialData.fixedReturns.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.dynamicArgumentTypes&&(this.dynamicArgumentTypes=R(this.initialData.dynamicArgumentTypes,this.project),this.dynamicArgumentTypes.setParent(this),this.dynamicArgumentTypes.initChildren()),this.initialData.dynamicReturnTypes&&(this.dynamicReturnTypes=R(this.initialData.dynamicReturnTypes,this.project),this.dynamicReturnTypes.setParent(this),this.dynamicReturnTypes.initChildren()),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.argumentsType=e.argumentsType||this.argumentsType,this.returnsType=e.returnsType||this.returnsType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.fixedArguments.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o.affected),a.push(...o.removed)}),this.fixedReturns.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o.affected),a.push(...o.removed)}),this.dynamicArgumentTypes){const s=this.dynamicArgumentTypes.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}if(this.dynamicReturnTypes){const s=this.dynamicReturnTypes.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}if(this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:S(r),removed:S(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.fixedArguments.forEach(r=>{const a=r.restore({seenEntities:e});t.push(...a.affected)}),this.fixedReturns.forEach(r=>{const a=r.restore({seenEntities:e});t.push(...a.affected)}),this.dynamicArgumentTypes){const r=this.dynamicArgumentTypes.restore({seenEntities:e});t.push(...r.affected)}if(this.dynamicReturnTypes){const r=this.dynamicReturnTypes.restore({seenEntities:e});t.push(...r.affected)}if(this.error){const r=this.error.restore({seenEntities:e});t.push(...r.affected)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.fixedArguments.flatMap(r=>r.toFlat(e)),...this.fixedReturns.flatMap(r=>r.toFlat(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlat(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.fixedArguments.flatMap(r=>r.toFlatIds(e)),...this.fixedReturns.flatMap(r=>r.toFlatIds(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatIds(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatIds(e):[]])}toJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toJSON())||null,fixedArguments:this.fixedArguments.map(s=>s.toJSON()),fixedReturns:this.fixedReturns.map(s=>s.toJSON()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toJSON())||null,dynamicReturnTypes:((r=this.dynamicReturnTypes)==null?void 0:r.toJSON())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toReference())||null,fixedArguments:this.fixedArguments.map(s=>s.toReference()),fixedReturns:this.fixedReturns.map(s=>s.toReference()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toReference())||null,dynamicReturnTypes:((r=this.dynamicReturnTypes)==null?void 0:r.toReference())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.fixedArguments.flatMap(r=>r.toFlatJSON(e)),...this.fixedReturns.flatMap(r=>r.toFlatJSON(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatJSON(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,argumentsType:this.argumentsType,returnsType:this.returnsType,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.fixedArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.fixedReturns.flatMap(r=>r.toFlatGenerationTarget(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatGenerationTarget(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatGenerationTarget(e):[]])}implementAsFunctionDeclaration(e){var s;const t=this.fixedArguments.map((o,d)=>{var y;const p={id:e+"--"+o.id+"--parent-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:n.ArgumentDeclaration,name:o.name,required:o.required,writesValues:[],description:o.description,index:d,dataType:((y=o.dataType)==null?void 0:y.toJSON())||null,parent:p}}),r=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((f,m)=>{var P;const b={id:e+"--return-statement--"+f.id+"--parent-ref",type:n.GenericReference,entityId:e,entityType:n.ReturnStatement};return{id:e+"--"+f.id,version:f.version,type:n.ReturnDeclaration,name:f.name,description:f.description,readsValue:null,required:f.required,isError:!1,index:m,dataType:((P=f.dataType)==null?void 0:P.toJSON())||null,parent:b}}),d={id:e+"--return-statement-parent-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e},y={id:e+"--return-statement",version:this.version,type:n.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:d,x:0,y:0};r.push(y),a.push(y)}return{id:e,version:this.version,type:n.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:r,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,r=this.id+"--instance-"+L.fromUUID(L.uuid()),a={id:r,version:this.version,type:n.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((d,p)=>{const f={id:d.toReference().id+"--input-map-id",version:this.version,type:n.InputMap,name:null,description:null,declaration:d,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:L.uuid(),type:n.GenericReference,entityId:r,entityType:n.Loop}};a.inputs.push(f)}),this.fixedReturns.forEach((d,p)=>{const f={id:d.toReference().id+"--output-map-id",version:this.version,type:n.OutputMap,declaration:d,writesValues:[],index:p,parent:{id:L.uuid(),type:n.GenericReference,entityId:r,entityType:n.Loop}};a.outputs.push(f)});const s={id:r+"--body-function-declaration-id",version:this.version,type:n.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:L.uuid(),type:n.GenericReference,entityId:r,entityType:n.Loop}};s.inputs=[{id:L.uuid(),version:this.version,type:n.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],index:0,parent:{id:s.id,type:n.GenericReference,entityId:s.id,entityType:n.FunctionDeclaration}},{id:L.uuid(),version:this.version,type:n.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],index:1,parent:{id:s.id,type:n.GenericReference,entityId:s.id,entityType:n.FunctionDeclaration}}],a.body=s;const o=R(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const r=e||this.project,a=t||this.id+"--instance-"+L.fromUUID(L.uuid()),s={id:a,version:this.version,type:n.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,dynamicArguments:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:r.toReference()};if(this.fixedArguments.forEach((d,p)=>{const y={id:a+Xt(d.name,n.InputMap,this.project),version:this.version,type:n.InputMap,name:null,description:null,declaration:d,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:L.uuid(),type:n.GenericReference,entityId:a,entityType:n.Operation}};s.inputs.push(y)}),this.fixedReturns.forEach((d,p)=>{const y={id:a+Xt(d.name,n.OutputMap,this.project),version:this.version,type:n.OutputMap,declaration:d,writesValues:[],index:p,parent:{id:L.uuid(),type:n.GenericReference,entityId:a,entityType:n.Operation}};s.outputs.push(y)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:n.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:L.uuid(),type:n.GenericReference,entityId:a,entityType:n.Operation}};s.error=p}const o=R(s,this.project);return o.setParent(r),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,r=this.id+"--instance-"+L.fromUUID(L.uuid()),a={id:r,version:this.version,type:n.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,d)=>{const p={id:r+Xt(o.name,n.InputMap,this.project),version:this.version,type:n.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:d,dynamicArguments:[],parent:{id:L.uuid(),type:n.GenericReference,entityId:r,entityType:n.Condition}};a.inputs.push(p)});const s=R(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e,t,r;return this.errors=[],this.fixedArguments.forEach(a=>a.clearErrors()),this.fixedReturns.forEach(a=>a.clearErrors()),(e=this.dynamicArgumentTypes)==null||e.clearErrors(),(t=this.dynamicReturnTypes)==null||t.clearErrors(),(r=this.error)==null||r.clearErrors(),this}validate(){const e=XU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.fixedArguments.flatMap(t=>t.getErrors()),...this.fixedReturns.flatMap(t=>t.getErrors()),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.getErrors():[],...this.dynamicReturnTypes?this.dynamicReturnTypes.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ce(this.toJSON(),this.project)}setDynamicArgumentsDataType(e){return this.dynamicArgumentTypes=e,this}setDynamicReturnsDataType(e){return this.dynamicReturnTypes=e,this}addFixedArgument(e){return this.fixedArguments.find(t=>t.id===e.id)||this.fixedArguments.push(e),this}removeFixedArgument(e){return this.fixedArguments=this.fixedArguments.filter(t=>t.id!==e.id),this}addFixedReturn(e){return this.fixedReturns.find(t=>t.id===e.id)||this.fixedReturns.push(e),this}removeFixedReturn(e){return this.fixedReturns=this.fixedReturns.filter(t=>t.id!==e.id),this}};l(ce,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),l(ce,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES]),l(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),l(ce,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),l(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),l(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let Nn=ce;function QU(i){var s;const e=FF(),t=i.toJSON();e.safeParse(t).success,(s=i.dataType)==null||s.validate();const a=[];return z(i.errors,a)}const de=class de{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"parentRelationType");l(this,"type",n.ValueDescriptor);l(this,"dataType",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(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 r=e.parent?D(e.parent):null,a=r?t.get(r):null,s=e.parentRelationType===A.FixedArguments?a==null?void 0:a.fixedArguments.length:a==null?void 0:a.fixedReturns.length,o={id:e.id,version:1,name:e.name,type:n.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},d=R(o,t);return a&&d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[n.ActionDescriptor]}},t);r=s.modifiedData,a.push(...s.errors,...Ae(r));const o=r.parent&&t.get(r.parent),d=o&&Gn(o);return d&&d.type===n.ActionDescriptor&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${d.name}" of type '${d.type}' with id '${d.id}'.
160
- You can't modify system entities that are built-in.`,issue:null})),o&&o.type===n.ActionDescriptor&&(!r.parentRelationType||!(r.parentRelationType===A.FixedArguments||r.parentRelationType===A.FixedReturns||r.parentRelationType===A.ReturnedError)?a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either '${A.FixedArguments}', '${A.FixedReturns}', or '${A.ReturnedError}' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})):r.parentRelationType===A.ReturnedError&&o.error&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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}'.
157
+ ${ka({describe_entity:d.entity.id})}
158
+ 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,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
159
+ 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}}addSelfToProject(){return this.parent?(this.parent.type===r.CustomEntity?this.parent.addAbstractMethod(this):this.parent.type===r.DataType&&this.parent.setEntity(this),this):this}setParent(e){return this.parent=e,this}setDynamicReturnTypes(e){return this.dynamicReturnTypes=e,this}setDynamicArgumentTypes(e){return this.dynamicArgumentTypes=e,this}removeDynamicArgumentTypes(){return this.dynamicArgumentTypes=null,this}removeDynamicReturnTypes(){return this.dynamicReturnTypes=null,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.fixedArguments=this.initialData.fixedArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.fixedReturns=this.initialData.fixedReturns.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.dynamicArgumentTypes&&(this.dynamicArgumentTypes=R(this.initialData.dynamicArgumentTypes,this.project),this.dynamicArgumentTypes.setParent(this),this.dynamicArgumentTypes.initChildren()),this.initialData.dynamicReturnTypes&&(this.dynamicReturnTypes=R(this.initialData.dynamicReturnTypes,this.project),this.dynamicReturnTypes.setParent(this),this.dynamicReturnTypes.initChildren()),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.argumentsType=e.argumentsType||this.argumentsType,this.returnsType=e.returnsType||this.returnsType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.fixedArguments.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o.affected),a.push(...o.removed)}),this.fixedReturns.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o.affected),a.push(...o.removed)}),this.dynamicArgumentTypes){const s=this.dynamicArgumentTypes.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}if(this.dynamicReturnTypes){const s=this.dynamicReturnTypes.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}if(this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(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.fixedArguments.forEach(i=>{const a=i.restore({seenEntities:e});t.push(...a.affected)}),this.fixedReturns.forEach(i=>{const a=i.restore({seenEntities:e});t.push(...a.affected)}),this.dynamicArgumentTypes){const i=this.dynamicArgumentTypes.restore({seenEntities:e});t.push(...i.affected)}if(this.dynamicReturnTypes){const i=this.dynamicReturnTypes.restore({seenEntities:e});t.push(...i.affected)}if(this.error){const i=this.error.restore({seenEntities:e});t.push(...i.affected)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.fixedArguments.flatMap(i=>i.toFlat(e)),...this.fixedReturns.flatMap(i=>i.toFlat(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlat(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.fixedArguments.flatMap(i=>i.toFlatIds(e)),...this.fixedReturns.flatMap(i=>i.toFlatIds(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatIds(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatIds(e):[]])}toJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toJSON())||null,fixedArguments:this.fixedArguments.map(s=>s.toJSON()),fixedReturns:this.fixedReturns.map(s=>s.toJSON()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toJSON())||null,dynamicReturnTypes:((i=this.dynamicReturnTypes)==null?void 0:i.toJSON())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toReference())||null,fixedArguments:this.fixedArguments.map(s=>s.toReference()),fixedReturns:this.fixedReturns.map(s=>s.toReference()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toReference())||null,dynamicReturnTypes:((i=this.dynamicReturnTypes)==null?void 0:i.toReference())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.fixedArguments.flatMap(i=>i.toFlatJSON(e)),...this.fixedReturns.flatMap(i=>i.toFlatJSON(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatJSON(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,argumentsType:this.argumentsType,returnsType:this.returnsType,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.fixedArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.fixedReturns.flatMap(i=>i.toFlatGenerationTarget(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatGenerationTarget(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatGenerationTarget(e):[]])}implementAsFunctionDeclaration(e){var s;const t=this.fixedArguments.map((o,d)=>{var y;const p={id:e+"--"+o.id+"--parent-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:r.ArgumentDeclaration,name:o.name,required:o.required,writesValues:[],description:o.description,index:d,dataType:((y=o.dataType)==null?void 0:y.toJSON())||null,parent:p}}),i=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((f,m)=>{var P;const b={id:e+"--return-statement--"+f.id+"--parent-ref",type:r.GenericReference,entityId:e,entityType:r.ReturnStatement};return{id:e+"--"+f.id,version:f.version,type:r.ReturnDeclaration,name:f.name,description:f.description,readsValue:null,required:f.required,isError:!1,index:m,dataType:((P=f.dataType)==null?void 0:P.toJSON())||null,parent:b}}),d={id:e+"--return-statement-parent-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e},y={id:e+"--return-statement",version:this.version,type:r.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:d,x:0,y:0};i.push(y),a.push(y)}return{id:e,version:this.version,type:r.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:i,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,i=this.id+"--instance-"+L.fromUUID(L.uuid()),a={id:i,version:this.version,type:r.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((d,p)=>{const f={id:d.toReference().id+"--input-map-id",version:this.version,type:r.InputMap,name:null,description:null,declaration:d,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:L.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};a.inputs.push(f)}),this.fixedReturns.forEach((d,p)=>{const f={id:d.toReference().id+"--output-map-id",version:this.version,type:r.OutputMap,declaration:d,writesValues:[],index:p,parent:{id:L.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};a.outputs.push(f)});const s={id:i+"--body-function-declaration-id",version:this.version,type:r.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:L.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};s.inputs=[{id:L.uuid(),version:this.version,type:r.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],index:0,parent:{id:s.id,type:r.GenericReference,entityId:s.id,entityType:r.FunctionDeclaration}},{id:L.uuid(),version:this.version,type:r.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],index:1,parent:{id:s.id,type:r.GenericReference,entityId:s.id,entityType:r.FunctionDeclaration}}],a.body=s;const o=R(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const i=e||this.project,a=t||this.id+"--instance-"+L.fromUUID(L.uuid()),s={id:a,version:this.version,type:r.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,dynamicArguments:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:i.toReference()};if(this.fixedArguments.forEach((d,p)=>{const y={id:a+qt(d.name,r.InputMap,this.project),version:this.version,type:r.InputMap,name:null,description:null,declaration:d,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:L.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.inputs.push(y)}),this.fixedReturns.forEach((d,p)=>{const y={id:a+qt(d.name,r.OutputMap,this.project),version:this.version,type:r.OutputMap,declaration:d,writesValues:[],index:p,parent:{id:L.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.outputs.push(y)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:r.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:L.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.error=p}const o=R(s,this.project);return o.setParent(i),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,i=this.id+"--instance-"+L.fromUUID(L.uuid()),a={id:i,version:this.version,type:r.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,d)=>{const p={id:i+qt(o.name,r.InputMap,this.project),version:this.version,type:r.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:d,dynamicArguments:[],parent:{id:L.uuid(),type:r.GenericReference,entityId:i,entityType:r.Condition}};a.inputs.push(p)});const s=R(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e,t,i;return this.errors=[],this.fixedArguments.forEach(a=>a.clearErrors()),this.fixedReturns.forEach(a=>a.clearErrors()),(e=this.dynamicArgumentTypes)==null||e.clearErrors(),(t=this.dynamicReturnTypes)==null||t.clearErrors(),(i=this.error)==null||i.clearErrors(),this}validate(){const e=f8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.fixedArguments.flatMap(t=>t.getErrors()),...this.fixedReturns.flatMap(t=>t.getErrors()),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.getErrors():[],...this.dynamicReturnTypes?this.dynamicReturnTypes.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ce(this.toJSON(),this.project)}setDynamicArgumentsDataType(e){return this.dynamicArgumentTypes=e,this}setDynamicReturnsDataType(e){return this.dynamicReturnTypes=e,this}addFixedArgument(e){return this.fixedArguments.find(t=>t.id===e.id)||this.fixedArguments.push(e),this}removeFixedArgument(e){return this.fixedArguments=this.fixedArguments.filter(t=>t.id!==e.id),this}addFixedReturn(e){return this.fixedReturns.find(t=>t.id===e.id)||this.fixedReturns.push(e),this}removeFixedReturn(e){return this.fixedReturns=this.fixedReturns.filter(t=>t.id!==e.id),this}};l(ce,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),l(ce,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES]),l(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),l(ce,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),l(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),l(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let Vn=ce;function m8(n){var s;const e=a4(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];return z(n.errors,a)}const de=class de{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"parentRelationType");l(this,"type",r.ValueDescriptor);l(this,"dataType",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(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 i=e.parent?D(e.parent):null,a=i?t.get(i):null,s=e.parentRelationType===O.FixedArguments?a==null?void 0:a.fixedArguments.length:a==null?void 0:a.fixedReturns.length,o={id:e.id,version:1,name:e.name,type:r.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},d=R(o,t);return a&&d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[r.ActionDescriptor]}},t);i=s.modifiedData,a.push(...s.errors,...Ae(i));const o=i.parent&&t.get(i.parent),d=o&&Fn(o);return d&&d.type===r.ActionDescriptor&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${d.name}" of type '${d.type}' with id '${d.id}'.
160
+ You can't modify system entities that are built-in.`,issue:null})),o&&o.type===r.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===O.FixedArguments||i.parentRelationType===O.FixedReturns||i.parentRelationType===O.ReturnedError)?a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either '${O.FixedArguments}', '${O.FixedReturns}', or '${O.ReturnedError}' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})):i.parentRelationType===O.ReturnedError&&o.error&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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}'.
161
161
  An action descriptor can only have one error value descriptor child.
162
162
  Either remove the existing error value descriptor or update it with the 'update' action.
163
163
  You can use the 'describe_entity' action to get more information about the existing error value descriptor like so:
164
- ${Va({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var e,t;return this.parentRelationType===A.FixedArguments?(e=this.parent)==null||e.addFixedArgument(this):this.parentRelationType===A.FixedReturns?(t=this.parent)==null||t.addFixedReturn(this):this.parentRelationType===A.ReturnedError&&this.parent&&(this.parent.error=this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),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.index=e.index||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return{affected:S(r),removed:S(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.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dataType?this.dataType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dataType?this.dataType.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dataType?this.dataType.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parentRelationType:this.parentRelationType,parent:(e=this.parent)==null?void 0:e.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dataType?this.dataType.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=QU(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dataType?this.dataType.getErrors():[]]}getShallowErrors(){return this.errors}clone(){return new de(this.toJSON(),this.project)}getDataType(){return this.dataType||null}setDataType(e){return this.dataType=e,this}};l(de,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(de,"INMUTABLE_BASE_PROPERTIES",["id","version","type","parentRelationType"]),l(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),l(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"index"]),l(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),l(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),l(de,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(de,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUTABLE_UPSTREAM_PROPERTIES]),l(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(de,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let Na=de;function KU(i){switch(i.type){case n.PrimitiveValue:return u4();case n.CustomEntity:return dU();case n.PrimitiveEntity:return UF();case n.FunctionDeclaration:return nU();case n.GlobalEvent:return q4();case n.DataType:return P4();case n.Property:return WF();case n.FunctionCall:return Fx();case n.Condition:return Wx();case n.Operation:return a4();case n.VariableDeclaration:return C4();case n.VariableInstance:return N4();case n.OutputMap:return Nx();case n.ReturnDeclaration:return Px();case n.ArgumentDeclaration:return Q4();case n.InputMap:return t4();case n.Project:return sU();case n.InstalledProject:return F4();case n.ActionDescriptor:return tx();case n.ReturnStatement:return hx();case n.Loop:return ax();case n.Search:return Rx();case n.ValueDescriptor:return $F();case n.BuiltInBaseEntity:return XF();case n.InternalCall:return Xx();case n.ContinueStatement:return dx();case n.BreakStatement:return Cx();default:return null}}function yl(i){const e=[];dn(i)||e.push(new E({id:`${i}--${h.InvalidReferenceObjectStructure}`,message:`Reference object with id "${i}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));const t=i.id||"reference-to--"+(i.entityId||"unknown"),r=`Reference object ${i.id?`with id "${i.id}"`:`to entity with id "${i.entityId}" and type "${i.entityType}"`}`;return i.entityId||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${r} is missing an 'entityId' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),i.entityType||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${r} is missing an 'entityType' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),i.id||e.push(new E({id:`${t}--${h.MissingIdProperty}`,message:`${r} is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})),i.type||e.push(new E({id:`${t}--${h.MissingTypeProperty}`,message:`${r} is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})),e}function e8(i,e){return e.success?[]:e.error.issues.map(t=>new E({id:`${i.id}--${v.InvalidObjectStructure}`,message:`Entity of type "${i.type}" and with id "${i.id}", has an invalid structure: ${H$(t).toString().replace("Validation error: ","")}`,severity:T.Error,code:v.InvalidObjectStructure,issue:t}))}function Ae(i,e){const t=[],r=KU(i);if(r){const s=r.safeParse(i);t.push(...e8(i,s))}const a=jb(i.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(d=>{i[d]&&!wE(i[d])&&t.push(new E({id:`${i.id}--${h.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${i.type}" with id "${i.id}" cannot have the property "${d}" set directly. It is a downstream property that points to a downstream nested entity.
164
+ ${ka({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var e,t;return this.parentRelationType===O.FixedArguments?(e=this.parent)==null||e.addFixedArgument(this):this.parentRelationType===O.FixedReturns?(t=this.parent)==null||t.addFixedReturn(this):this.parentRelationType===O.ReturnedError&&this.parent&&(this.parent.error=this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),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.index=e.index||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return{affected:S(i),removed:S(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.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dataType?this.dataType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dataType?this.dataType.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dataType?this.dataType.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parentRelationType:this.parentRelationType,parent:(e=this.parent)==null?void 0:e.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dataType?this.dataType.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=m8(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dataType?this.dataType.getErrors():[]]}getShallowErrors(){return this.errors}clone(){return new de(this.toJSON(),this.project)}getDataType(){return this.dataType||null}setDataType(e){return this.dataType=e,this}};l(de,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(de,"INMUTABLE_BASE_PROPERTIES",["id","version","type","parentRelationType"]),l(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),l(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"index"]),l(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),l(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),l(de,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(de,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUTABLE_UPSTREAM_PROPERTIES]),l(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(de,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let ja=de;function T8(n){switch(n.type){case r.PrimitiveValue:return wx();case r.CustomEntity:return BU();case r.PrimitiveEntity:return o4();case r.FunctionDeclaration:return gU();case r.GlobalEvent:return dU();case r.DataType:return qx();case r.Property:return p4();case r.FunctionCall:return ax();case r.Condition:return px();case r.Operation:return Dx();case r.VariableDeclaration:return zx();case r.VariableInstance:return eU();case r.OutputMap:return ex();case r.ReturnDeclaration:return q4();case r.ArgumentDeclaration:return EU();case r.InputMap:return vx();case r.Project:return SU();case r.InstalledProject:return aU();case r.ActionDescriptor:return v4();case r.ReturnStatement:return N4();case r.Loop:return D4();case r.Search:return F4();case r.ValueDescriptor:return r4();case r.BuiltInBaseEntity:return T4();case r.InternalCall:return Tx();case r.ContinueStatement:return B4();case r.BreakStatement:return z4();default:return null}}function Al(n){const e=[];dn(n)||e.push(new E({id:`${n}--${h.InvalidReferenceObjectStructure}`,message:`Reference object with id "${n}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));const t=n.id||"reference-to--"+(n.entityId||"unknown"),i=`Reference object ${n.id?`with id "${n.id}"`:`to entity with id "${n.entityId}" and type "${n.entityType}"`}`;return n.entityId||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityId' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),n.entityType||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityType' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),n.id||e.push(new E({id:`${t}--${h.MissingIdProperty}`,message:`${i} is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})),n.type||e.push(new E({id:`${t}--${h.MissingTypeProperty}`,message:`${i} is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})),e}function E8(n,e){return e.success?[]:e.error.issues.map(t=>new E({id:`${n.id}--${g.InvalidObjectStructure}`,message:`Entity of type "${n.type}" and with id "${n.id}", has an invalid structure: ${yG(t).toString().replace("Validation error: ","")}`,severity:T.Error,code:g.InvalidObjectStructure,issue:t}))}function Ae(n,e){const t=[],i=T8(n);if(i){const s=i.safeParse(n);t.push(...E8(n,s))}const a=Rv(n.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(d=>{n[d]&&!aR(n[d])&&t.push(new E({id:`${n.id}--${h.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the property "${d}" set directly. It is a downstream property that points to a downstream nested entity.
165
165
  All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
166
- To modify '${d}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(i).forEach(d=>{o.includes(d)||t.push(new E({id:`${i.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${i.type}" with id "${i.id}" has an unrecognized property "${d}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}return t}function db(i,e,t){const r=[],a=i[e.key];if(!a)return r.push(new E({id:`${i.id}--${e.key}--${v.InvalidObjectStructure}`,message:`Entity of type "${i.type}" with id "${i.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${i.type}" entity can be ${j(e.types,", "," or ")}.`,severity:T.Error,code:v.InvalidObjectStructure,issue:null})),{entityState:null,errors:r};let s=null;if(typeof a=="string")s=a;else{const d=yl(a);r.push(...d),d.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:r};if(i.id===s)return r.push(new E({id:`${i.id}--${s}--${h.SelfReference}`,message:`Entity of type "${i.type}" with id "${i.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:T.Error,code:h.SelfReference,issue:null})),{entityState:null,errors:r};const o=t.get(s)||t.getBuiltIn(s);return o?e.types.includes(o.type)||r.push(new E({id:`${i.id}--${s}--${h.InvalidReference}`,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${j(e.types,"', '","' or '")}'.`,severity:T.Error,code:h.InvalidReference,issue:null})):r.push(new E({id:`${i.id}--${s}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${i.type}" with id "${i.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:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:r}}function hl(i,e,t){const r=[],a=i[e];return a?Array.isArray(a)?{entities:a.map(o=>{let d=null;if(typeof o=="string")d=o;else{const y=yl(o);r.push(...y),y.length===0&&(d=o.entityId)}if(!d)return{entityState:null,errors:[new E({id:`${i.id}--${e}--${h.InvalidReference}`,message:`Entity of type "${i.type}" with id "${i.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReference,issue:null})]};const p=t.get(d)||t.getBuiltIn(d);return p?{entityState:p,errors:[]}:(r.push(new E({id:`${i.id}--${d}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${d}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:r})}),errors:[]}:(r.push(new E({id:`${i.id}--${e}--${v.InvalidObjectStructure}`,message:`Entity of type "${i.type}" with id "${i.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:T.Error,code:v.InvalidObjectStructure,issue:null})),{entities:[],errors:r}):(r.push(new E({id:`${i.id}--${e}--${v.InvalidObjectStructure}`,message:`Entity of type "${i.type}" with id "${i.id}" is missing a list of references to "${e}" entities.`,severity:T.Error,code:v.InvalidObjectStructure,issue:null})),{entities:[],errors:r})}function ub(i,e,t){const r=[],a=db(i,e,t);if(a.errors.length>0)return a.errors;if(a.entityState){const s=a.entityState;e.types.includes(s.type)||r.push(new E({id:`${i.id}--${s.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${j(e.types,"', '","' or '")}'.`,issue:null})),i.id===s.id&&r.push(new E({id:`${i.id}--${s.id}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.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 r}function j(i,e,t){if(i.length===1)return i[0];if(i.length===2)return i.join(t);{const r=i.pop();return`${i.join(e)}${t}${r}`}}const yr=`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.
167
- All pass-through callable entities are: ${j(Ge,", "," and ")}.`,fl=`Entry point entities are the entities which start the execution of a logic chain. They are ${j(Fe,", "," 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. `,t8=`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: ${j(tn,", "," and ")}.`;`${j(En,", "," and ")}`;const pb=`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.
168
- 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'.`,yb=`A variable without a data type which reads an-untyped object value, or has object properties written into it as input-map writes, will infere its data-type. This means that a 'data-type' will be created, with an implicitly declared 'custom-entity' as its 'entity' property, defining the structure of the object.
169
- This data type entity is what will define which properties are available to be read from the variable or any of its instances as 'output-map' entities.`,Vn=`Entities of type '${n.BuiltInBaseEntity}' that have the 'interactive' property set to false cannot be used programmatically during runtime. They can't be used as data types or instanciated in variables. Their methods can't be called by the code, and are only called by the system in the background. Their properties' values are constant and set only once when declared. They also can't be extended with unrecognized properties or methods that aren't part of the base out-of-the-box entity.`,hb=`Entities that read values from other entities, can be connected with entities that write values to them. Value reading entity types are: '${j(Tn,"', '","' and '")}'.`,n8=`Entities that write values to other entities, can be connected with entities that read values from them. Value writing entity types are: '${j(rt,"', '","' and '")}'.`,fb=`A property entity, is neither a value reading, or a value writting entity, but they are often confused with one.
166
+ To modify '${d}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(n).forEach(d=>{o.includes(d)||t.push(new E({id:`${n.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${n.type}" with id "${n.id}" has an unrecognized property "${d}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}return t}function xb(n,e,t){const i=[],a=n[e.key];if(!a)return i.push(new E({id:`${n.id}--${e.key}--${g.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${n.type}" entity can be ${j(e.types,", "," or ")}.`,severity:T.Error,code:g.InvalidObjectStructure,issue:null})),{entityState:null,errors:i};let s=null;if(typeof a=="string")s=a;else{const d=Al(a);i.push(...d),d.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:i};if(n.id===s)return i.push(new E({id:`${n.id}--${s}--${h.SelfReference}`,message:`Entity of type "${n.type}" with id "${n.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:T.Error,code:h.SelfReference,issue:null})),{entityState:null,errors:i};const o=t.get(s)||t.getBuiltIn(s);return o?e.types.includes(o.type)||i.push(new E({id:`${n.id}--${s}--${h.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${j(e.types,"', '","' or '")}'.`,severity:T.Error,code:h.InvalidReference,issue:null})):i.push(new E({id:`${n.id}--${s}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.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:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:i}}function Ol(n,e,t){const i=[],a=n[e];return a?Array.isArray(a)?{entities:a.map(o=>{let d=null;if(typeof o=="string")d=o;else{const y=Al(o);i.push(...y),y.length===0&&(d=o.entityId)}if(!d)return{entityState:null,errors:[new E({id:`${n.id}--${e}--${h.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReference,issue:null})]};const p=t.get(d)||t.getBuiltIn(d);return p?{entityState:p,errors:[]}:(i.push(new E({id:`${n.id}--${d}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${d}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:i})}),errors:[]}:(i.push(new E({id:`${n.id}--${e}--${g.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:T.Error,code:g.InvalidObjectStructure,issue:null})),{entities:[],errors:i}):(i.push(new E({id:`${n.id}--${e}--${g.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a list of references to "${e}" entities.`,severity:T.Error,code:g.InvalidObjectStructure,issue:null})),{entities:[],errors:i})}function Ub(n,e,t){const i=[],a=xb(n,e,t);if(a.errors.length>0)return a.errors;if(a.entityState){const s=a.entityState;e.types.includes(s.type)||i.push(new E({id:`${n.id}--${s.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${j(e.types,"', '","' or '")}'.`,issue:null})),n.id===s.id&&i.push(new E({id:`${n.id}--${s.id}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.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 i}function j(n,e,t){if(n.length===1)return n[0];if(n.length===2)return n.join(t);{const i=n.pop();return`${n.join(e)}${t}${i}`}}const hr=`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.
167
+ All pass-through callable entities are: ${j(Ge,", "," and ")}.`,Cl=`Entry point entities are the entities which start the execution of a logic chain. They are ${j(Fe,", "," 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. `,R8=`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: ${j(tn,", "," and ")}.`;`${j(En,", "," and ")}`;const jb=`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.
168
+ 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'.`,kb=`A variable without a data type which reads an-untyped object value, or has object properties written into it as input-map writes, will infere its data-type. This means that a 'data-type' will be created, with an implicitly declared 'custom-entity' as its 'entity' property, defining the structure of the object.
169
+ This data type entity is what will define which properties are available to be read from the variable or any of its instances as 'output-map' entities.`,Ln=`Entities of type '${r.BuiltInBaseEntity}' that have the 'interactive' property set to false cannot be used programmatically during runtime. They can't be used as data types or instanciated in variables. Their methods can't be called by the code, and are only called by the system in the background. Their properties' values are constant and set only once when declared. They also can't be extended with unrecognized properties or methods that aren't part of the base out-of-the-box entity.`,qb=`Entities that read values from other entities, can be connected with entities that write values to them. Value reading entity types are: '${j(Tn,"', '","' and '")}'.`,b8=`Entities that write values to other entities, can be connected with entities that read values from them. Value writing entity types are: '${j(rt,"', '","' and '")}'.`,Jb=`A property entity, is neither a value reading, or a value writting entity, but they are often confused with one.
170
170
  A 'property' can have a default value through its nested 'data-type' entity.
171
171
  The 'property' entity only represents the data field in the declaration, and it can't write or read values.
172
- When a 'custom-entity' is instantiated as a variable, any writes or reads to its properties are done through 'input-map's and 'output-map's.`,ml=`Some entities can hold values during runtime, they often can be given a hardcoded "default value" either directly or on their declarations, and can be connected to other entities that write or read values to and from them. Entities that can hold values are: '${j(Nl,"', '","' and '")}'.
172
+ When a 'custom-entity' is instantiated as a variable, any writes or reads to its properties are done through 'input-map's and 'output-map's.`,Bl=`Some entities can hold values during runtime, they often can be given a hardcoded "default value" either directly or on their declarations, and can be connected to other entities that write or read values to and from them. Entities that can hold values are: '${j(Yl,"', '","' and '")}'.
173
173
  Some entities with values can both write and read values, while others can only do one of the two.
174
- ${hb}
175
- ${n8}.
176
- ${fb}`,mb=`To establish a connection of a reader and writter value during the generation process you can use the 'connect_values' generation action, like so:
174
+ ${qb}
175
+ ${b8}.
176
+ ${Jb}`,Wb=`To establish a connection of a reader and writter value during the generation process you can use the 'connect_values' generation action, like so:
177
177
  \`\`\`json
178
178
  {
179
179
  "connect_values": {
@@ -182,118 +182,118 @@ ${fb}`,mb=`To establish a connection of a reader and writter value during the ge
182
182
  }
183
183
  }
184
184
  \`\`\`
185
- You can use the 'disconnect_values' generation action to remove the connection between two value holding entities in the same way.`,Tl=`If an explicit 'parent' isn't given for a callable entity, the scope will be auto-calculated to match the parent scope of the caller entity.
186
- If the entity that should be the parent of a callable entity is unclear, you can always skip the 'parent' property and the system will automatically calculate the parent based on the caller entity.`;function Va(i){return`\`\`\`json
187
- ${typeof i=="string"?i:JSON.stringify(i,null,2)}
188
- \`\`\``}function r8(i,e){const t=JSON.parse(JSON.stringify(i)),r=[];if(Fe.includes(e.type))r.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to an entry-point entity at 'calledBySuccess' with id "${e.id}".
185
+ You can use the 'disconnect_values' generation action to remove the connection between two value holding entities in the same way.`,wl=`If an explicit 'parent' isn't given for a callable entity, the scope will be auto-calculated to match the parent scope of the caller entity.
186
+ If the entity that should be the parent of a callable entity is unclear, you can always skip the 'parent' property and the system will automatically calculate the parent based on the caller entity.`;function ka(n){return`\`\`\`json
187
+ ${typeof n=="string"?n:JSON.stringify(n,null,2)}
188
+ \`\`\``}function v8(n,e){const t=JSON.parse(JSON.stringify(n)),i=[];if(Fe.includes(e.type))i.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledBySuccess' with id "${e.id}".
189
189
  Entry-point entities can only be referenced as 'calledByEntry'.
190
- ${fl}
190
+ ${Cl}
191
191
  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(Ne.includes(e.type)){const a=e.calledBy||[],s=a.length?`
192
192
 
193
- This ${e.type} is called by ${j(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.`:"";r.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a '${e.type}' entity at 'calledBySuccess' with id "${e.id}".
193
+ This ${e.type} is called by ${j(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.`:"";i.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledBySuccess' with id "${e.id}".
194
194
  ${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
195
- Termination entities are ${j(Ne,", "," and ")}.${s}`,issue:null}))}else if(!Ge.includes(e.type))r.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a pass-through callable entity.
196
- ${yr}`,issue:null}));else if(!tn.includes(e.type))return r.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a caller entity.
195
+ Termination entities are ${j(Ne,", "," and ")}.${s}`,issue:null}))}else if(!Ge.includes(e.type))i.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a pass-through callable entity.
196
+ ${hr}`,issue:null}));else if(!tn.includes(e.type))return i.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a caller entity.
197
197
  All caller entity types are: ${j(tn,", "," and ")}.
198
198
  For the 'calledBySuccess' property, you specifically need to reference a pass-through callable entity.
199
- ${yr}`,issue:null})),{errors:r,modifiedData:t};return{errors:r,modifiedData:t}}function i8(i,e){const t=[];if(Fe.includes(e.type))t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to an entry-point entity at 'calledByError' with id "${e.id}".
199
+ ${hr}`,issue:null})),{errors:i,modifiedData:t};return{errors:i,modifiedData:t}}function g8(n,e){const t=[];if(Fe.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledByError' with id "${e.id}".
200
200
  Entry-point entities can only be referenced as 'calledByEntry'.
201
- ${fl}`,issue:null}));else if(Ne.includes(e.type)){const r=e.calledBy||[],a=r.length?`
201
+ ${Cl}`,issue:null}));else if(Ne.includes(e.type)){const i=e.calledBy||[],a=i.length?`
202
202
 
203
- This ${e.type} is called by ${j(r.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${r.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a '${e.type}' entity at 'calledByError' with id "${e.id}".
203
+ This ${e.type} is called by ${j(i.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${i.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledByError' with id "${e.id}".
204
204
  ${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
205
- Termination entities are ${j(Ne,", "," and ")}.${a}`,issue:null}))}else if(!Ge.includes(e.type))t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a pass-through callable entity.
206
- ${yr}`,issue:null}));else if(!tn.includes(e.type))return t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a caller entity.
205
+ Termination entities are ${j(Ne,", "," and ")}.${a}`,issue:null}))}else if(!Ge.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a pass-through callable entity.
206
+ ${hr}`,issue:null}));else if(!tn.includes(e.type))return t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a caller entity.
207
207
  All caller entity types are: ${j(tn,", "," and ")}.
208
208
  For the 'calledByError' property, you specifically need to reference a pass-through callable entity.
209
- ${yr}`,issue:null})),t;return t}function a8(i,e){const t=[];if(Ne.includes(e.type)){const r=e.calledBy||[],a=r.length?`
209
+ ${hr}`,issue:null})),t;return t}function I8(n,e){const t=[];if(Ne.includes(e.type)){const i=e.calledBy||[],a=i.length?`
210
210
 
211
- This ${e.type} is called by ${j(r.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${r.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a '${e.type}' entity at 'calledByEntry' with id "${e.id}".
211
+ This ${e.type} is called by ${j(i.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${i.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledByEntry' with id "${e.id}".
212
212
  ${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
213
- Termination entities are ${j(Ne,", "," and ")}.${a}`,issue:null}))}else if(Ge.includes(e.type))t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${i.type}" with id "${i.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.
214
- ${yr}.
215
- ${fl}.
213
+ Termination entities are ${j(Ne,", "," and ")}.${a}`,issue:null}))}else if(Ge.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${n.type}" with id "${n.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.
214
+ ${hr}.
215
+ ${Cl}.
216
216
 
217
- We have moved the reference to 'calledBySuccess' for you.`,issue:null}));else if(!tn.includes(e.type))return t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that isn't a caller entity.
217
+ We have moved the reference to 'calledBySuccess' for you.`,issue:null}));else if(!tn.includes(e.type))return t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that isn't a caller entity.
218
218
  All caller entity types are: ${j(tn,", "," and ")}.
219
219
  For the 'calledByEntry' property, you specifically need to reference a pass-through callable entity.
220
- ${yr}`,issue:null})),t;return t}function s8(i,e){const t=[];let r=JSON.parse(JSON.stringify(i));if(En.includes(r.type)){if(r.calledBySuccess){const s=hl(r,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const d=r8(r,o.entityState);r=d.modifiedData,t.push(...d.errors)}):t.push(...s.errors)}if(r.calledByError){const s=hl(r,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const d=i8(r,o.entityState);t.push(...d)}):t.push(...s.errors)}if(r.calledByEntry){const s=hl(r,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const d=a8(r,o.entityState);t.push(...d)}),t.push(...t)):t.push(...s.errors)}const a=[...r.calledBySuccess||[],...r.calledByError||[],...r.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new E({id:`${r.id}--${h.DuplicateReference}`,code:h.DuplicateReference,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=ut(r,e);r.type===n.ReturnStatement&&o&&!Fe.includes(o.type)?t.push(new E({id:`${r.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" has an explicitly set parent, but it isn't a '${j(Fe,"', '","' or '")}' entity. A return statement's parent should always be resolved to a function declaration or global event.${Tl}`,issue:null})):r.type===n.ContinueStatement&&o&&o.type!==n.Loop?t.push(new E({id:`${r.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" has an explicitly set parent, but it isn't a '${n.Loop}' entity. A continue statement's parent should always be resolved to a loop entity.${Tl}`,issue:null})):r.type===n.BreakStatement&&o&&o.type!==n.Loop&&t.push(new E({id:`${r.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" has an explicitly set parent, but it isn't a '${n.Loop}' entity. A break statement's parent should always be resolved to a loop entity.${Tl}`,issue:null}));const d=[],p=[];let y=null;if(s.forEach(f=>{const m=e.get(f);if(!m){t.push(new E({id:`${r.id}--${f}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a caller entity with id "${f}" that doesn't exist in the project.`,issue:null}));return}const b=ut(m,e);if(o)gi(o,b,e)?(Ne.includes(r.type)&&((r.calledBySuccess||[]).find(O=>O===m.id)?(m.successCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${r.id}--${m.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
221
- 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})):(r.calledByError||[]).find(O=>O===m.id)?(m.errorCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${r.id}--${m.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
222
- 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})):(r.calledByEntry||[]).find(O=>O===m.id)&&(m.calls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${r.id}--${m.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
223
- 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}))),d.push({caller:m,scope:b})):p.push({caller:m,scope:b,errors:[new E({id:`${r.id}--${m.id}--${h.CallerWithIncompatibleScope}`,code:h.CallerWithIncompatibleScope,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.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(!y)y=b;else{const{compatible:P}=gi(y,b,e);P?(Ne.includes(r.type)&&((r.calledBySuccess||[]).find(O=>O===m.id)?(m.successCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${r.id}--${m.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
224
- 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})):(r.calledByError||[]).find(O=>O===m.id)?(m.errorCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${r.id}--${m.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
225
- 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})):(r.calledByEntry||[]).find(O=>O===m.id)&&(m.calls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${r.id}--${m.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
226
- 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}))),d.push({caller:m,scope:b})):p.push({caller:m,scope:b,errors:[new E({id:`${r.id}--${m.id}--${h.CallerWithIncompatibleScope}`,code:h.CallerWithIncompatibleScope,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" has multiple caller, but not all of them have compatible scopes. Caller of type "${m.type}" with id "${m.id}" is in a different scope than caller of type "${y.type}" with id "${y.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(f=>{t.push(...f.errors)});else if(d.length&&!o&&Ha.includes(r.type)){const f=d.filter(m=>m.scope!==e);if(f.length){const m=qb(f.map(b=>b.scope));r.parent=m.id}else r.parent=e.id}}else{let s=`Entity of type "${r.type}" with id "${r.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'.
227
- To add a caller, use the 'add_caller' action with the properties: 'callerEntityId', a 'calleeEntityId', and optionally a boolean 'fromError' (if the caller calls when an error occured in its execution).`;r.type===n.ReturnStatement?s+=`
228
- Return statements need to have a caller when created, since their purpose is to terminate a call chain.`:r.type===n.ContinueStatement?s+=`
229
- Continue statements need to have a caller when created, since they are used to skip the rest of the current iteration of a loop and can't be detached from a call chain.`:r.type===n.BreakStatement&&(s+=`
220
+ ${hr}`,issue:null})),t;return t}function P8(n,e){const t=[];let i=JSON.parse(JSON.stringify(n));if(En.includes(i.type)){if(i.calledBySuccess){const s=Ol(i,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const d=v8(i,o.entityState);i=d.modifiedData,t.push(...d.errors)}):t.push(...s.errors)}if(i.calledByError){const s=Ol(i,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const d=g8(i,o.entityState);t.push(...d)}):t.push(...s.errors)}if(i.calledByEntry){const s=Ol(i,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const d=I8(i,o.entityState);t.push(...d)}),t.push(...t)):t.push(...s.errors)}const a=[...i.calledBySuccess||[],...i.calledByError||[],...i.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new E({id:`${i.id}--${h.DuplicateReference}`,code:h.DuplicateReference,severity:T.Warning,message:`Entity of type "${i.type}" with id "${i.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=ut(i,e);i.type===r.ReturnStatement&&o&&!Fe.includes(o.type)?t.push(new E({id:`${i.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${j(Fe,"', '","' or '")}' entity. A return statement's parent should always be resolved to a function declaration or global event.${wl}`,issue:null})):i.type===r.ContinueStatement&&o&&o.type!==r.Loop?t.push(new E({id:`${i.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${r.Loop}' entity. A continue statement's parent should always be resolved to a loop entity.${wl}`,issue:null})):i.type===r.BreakStatement&&o&&o.type!==r.Loop&&t.push(new E({id:`${i.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${r.Loop}' entity. A break statement's parent should always be resolved to a loop entity.${wl}`,issue:null}));const d=[],p=[];let y=null;if(s.forEach(f=>{const m=e.get(f);if(!m){t.push(new E({id:`${i.id}--${f}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity with id "${f}" that doesn't exist in the project.`,issue:null}));return}const b=ut(m,e);if(o)Ii(o,b,e)?(Ne.includes(i.type)&&((i.calledBySuccess||[]).find(C=>C===m.id)?(m.successCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${i.id}--${m.id}--${g.UnreachableEntity}`,code:g.UnreachableEntity,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
221
+ 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})):(i.calledByError||[]).find(C=>C===m.id)?(m.errorCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${i.id}--${m.id}--${g.UnreachableEntity}`,code:g.UnreachableEntity,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
222
+ 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})):(i.calledByEntry||[]).find(C=>C===m.id)&&(m.calls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${i.id}--${m.id}--${g.UnreachableEntity}`,code:g.UnreachableEntity,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
223
+ 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}))),d.push({caller:m,scope:b})):p.push({caller:m,scope:b,errors:[new E({id:`${i.id}--${m.id}--${h.CallerWithIncompatibleScope}`,code:h.CallerWithIncompatibleScope,severity:T.Warning,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${m.type}" with id "${m.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(!y)y=b;else{const{compatible:P}=Ii(y,b,e);P?(Ne.includes(i.type)&&((i.calledBySuccess||[]).find(C=>C===m.id)?(m.successCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${i.id}--${m.id}--${g.UnreachableEntity}`,code:g.UnreachableEntity,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
224
+ 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})):(i.calledByError||[]).find(C=>C===m.id)?(m.errorCalls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${i.id}--${m.id}--${g.UnreachableEntity}`,code:g.UnreachableEntity,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
225
+ 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})):(i.calledByEntry||[]).find(C=>C===m.id)&&(m.calls||[]).find(ve=>Ne.includes(ve.type))&&t.push(new E({id:`${i.id}--${m.id}--${g.UnreachableEntity}`,code:g.UnreachableEntity,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
226
+ 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}))),d.push({caller:m,scope:b})):p.push({caller:m,scope:b,errors:[new E({id:`${i.id}--${m.id}--${h.CallerWithIncompatibleScope}`,code:h.CallerWithIncompatibleScope,severity:T.Warning,message:`Entity of type "${i.type}" with id "${i.id}" has multiple caller, but not all of them have compatible scopes. Caller of type "${m.type}" with id "${m.id}" is in a different scope than caller of type "${y.type}" with id "${y.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(f=>{t.push(...f.errors)});else if(d.length&&!o&&ts.includes(i.type)){const f=d.filter(m=>m.scope!==e);if(f.length){const m=vv(f.map(b=>b.scope));i.parent=m.id}else i.parent=e.id}}else{let s=`Entity of type "${i.type}" with id "${i.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'.
227
+ To add a caller, use the 'add_caller' action with the properties: 'callerEntityId', a 'calleeEntityId', and optionally a boolean 'fromError' (if the caller calls when an error occured in its execution).`;i.type===r.ReturnStatement?s+=`
228
+ Return statements need to have a caller when created, since their purpose is to terminate a call chain.`:i.type===r.ContinueStatement?s+=`
229
+ Continue statements need to have a caller when created, since they are used to skip the rest of the current iteration of a loop and can't be detached from a call chain.`:i.type===r.BreakStatement&&(s+=`
230
230
  Break statements need to have a caller when created, since they are used to exit a loop and can't be detached from a call chain.`),s+=`
231
- ${t8}`,Ne.includes(r.type)||(s+=`
232
- It is recommended to have a caller reference already at the moment of creation in the payload of the generation action.`),t.push(new E({id:`${r.id}--${v.MissingCaller}`,code:v.MissingCaller,severity:Ne.includes(r.type)?T.Error:T.Warning,message:s,issue:null}))}}return{errors:t,modifiedData:r}}function Tb(i,e){const t=[];if(e.type===n.PrimitiveValue){const o=e.parent;let d=!1;if(o.type===n.InputMap)t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
231
+ ${R8}`,Ne.includes(i.type)||(s+=`
232
+ It is recommended to have a caller reference already at the moment of creation in the payload of the generation action.`),t.push(new E({id:`${i.id}--${g.MissingCaller}`,code:g.MissingCaller,severity:Ne.includes(i.type)?T.Error:T.Warning,message:s,issue:null}))}}return{errors:t,modifiedData:i}}function Hb(n,e){const t=[];if(e.type===r.PrimitiveValue){const o=e.parent;let d=!1;if(o.type===r.InputMap)t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
233
233
  All value writting entity types are: ${j(rt,", "," and ")}.
234
234
 
235
- This primitive-value entity belongs to an input map entity with id "${o.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(o.type===n.DataType){const p=o,y=p.parent;rt.includes(y.type)?t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
235
+ This primitive-value entity belongs to an input map entity with id "${o.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(o.type===r.DataType){const p=o,y=p.parent;rt.includes(y.type)?t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
236
236
  All value writting entity types are: ${j(rt,", "," and ")}.
237
237
 
238
- This primitive-value entity belongs to a data type entity with id "${p.id}", which itself belongs to a ${y.type} entity with id "${y.id}". ${y.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):d=!0}d&&t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
239
- All value writting entity types are: ${j(rt,", "," and ")}.`,issue:null}))}else if(e.type===n.DataType){const o=e.parent;rt.includes(o.type)?t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
238
+ This primitive-value entity belongs to a data type entity with id "${p.id}", which itself belongs to a ${y.type} entity with id "${y.id}". ${y.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):d=!0}d&&t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
239
+ All value writting entity types are: ${j(rt,", "," and ")}.`,issue:null}))}else if(e.type===r.DataType){const o=e.parent;rt.includes(o.type)?t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
240
240
  All value writting entity types are: ${j(rt,", "," and ")}.
241
241
 
242
- 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 E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
243
- All value writting entity types are: ${j(rt,", "," and ")}.`,issue:null}))}else rt.includes(e.type)||t.push(new E({id:`${i.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that isn't a value writting entity.
244
- All value writting entity types are: ${j(rt,", "," and ")}.`,issue:null}));const r=ut(i,e.project),a=ut(e,e.project);if(r){const s=gi(r,e,e.project);if(!s.compatible){const{type:o}=s;let d="";const p=`But they are nested under different subscopes. The reader is in the scope of the '${r.type}' (${B(r,e.project)}) with id '${r.id}', and the writter is in the scope of the '${a.type}' (${B(a,e.project)}) with id '${a.id}'.`;o===ja.ParallelInCommonParent?(d=`The reader and the writter entities are both in the scope of the '${s.commonAncestorScope.type}' (${B(s.commonAncestorScope,e.project)}) with id '${s.commonAncestorScope.id}'.`,d+=`
245
- ${p}`):o===ja.ParallelInProject&&(d="The reader and the writter entities are both in separate scopes in the project that have no common ancestor.",d+=`
242
+ 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 E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
243
+ All value writting entity types are: ${j(rt,", "," and ")}.`,issue:null}))}else rt.includes(e.type)||t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that isn't a value writting entity.
244
+ All value writting entity types are: ${j(rt,", "," and ")}.`,issue:null}));const i=ut(n,e.project),a=ut(e,e.project);if(i){const s=Ii(i,e,e.project);if(!s.compatible){const{type:o}=s;let d="";const p=`But they are nested under different subscopes. The reader is in the scope of the '${i.type}' (${A(i,e.project)}) with id '${i.id}', and the writter is in the scope of the '${a.type}' (${A(a,e.project)}) with id '${a.id}'.`;o===Za.ParallelInCommonParent?(d=`The reader and the writter entities are both in the scope of the '${s.commonAncestorScope.type}' (${A(s.commonAncestorScope,e.project)}) with id '${s.commonAncestorScope.id}'.`,d+=`
245
+ ${p}`):o===Za.ParallelInProject&&(d="The reader and the writter entities are both in separate scopes in the project that have no common ancestor.",d+=`
246
246
  ${p}`),d+=`
247
- 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 E({id:`${i.id}--${e.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" with an incompatible scope.
248
- ${d}`,issue:null}))}}return t}function Ve(i,e,t,r=!1){const a=[],s={...e};let o=JSON.parse(JSON.stringify(i));if(!r){if(Tn.includes(o.type)){if(o.readsValue){const y=db(o,{key:"readsValue",types:rt},t);if(y.errors.length===0){const f=Tb(o,y.entityState);a.push(...f)}else a.push(...y.errors);delete s.readsValue}}else o.readsValue&&(rt.includes(o.type)?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${j(Tn,", "," and ")}.
249
- ${ml}`,issue:null})):n.Property===o.type?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${j(Tn,", "," and ")}.
250
- ${fb}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${j(Tn,", "," and ")}.
251
- ${hb}`,issue:null})),delete s.readsValue);o.writesValues&&(rt.includes(o.type)?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
252
- ${mb}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
253
- ${ml}
254
- ${mb}`,issue:null})),delete s.writesValues);const p=s8(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const d=Object.entries(s);for(const[p,y]of d){const f=y.types,m=y.optional,b=o[p];if(!b){m||a.push(new E({id:`${o.id}--${p}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" is missing a reference to a "${p}" entity. The '${p}' property of a "${o.type}" entity can be ${j(f,", "," or ")}`,issue:null}));continue}if(y.list)if(Array.isArray(b))for(const P of b){const O=ub(o,{key:p,types:f,optional:m},t);a.push(...O)}else{a.push(new E({id:`${o.id}--${p}--${h.ContainsSingleButShouldBeReferenceList}`,code:h.ContainsSingleButShouldBeReferenceList,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which is a list, but it isn't.`,issue:null}));continue}else if(Array.isArray(b)){a.push(new E({id:`${o.id}--${p}--${h.ContainsListButShouldReferenceSingle}`,code:h.ContainsListButShouldReferenceSingle,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which holds a single reference, but it is a list.`,issue:null}));continue}else{const P=ub(o,{key:p,types:f,optional:m},t);a.push(...P)}}return{errors:a,modifiedData:o}}function o8(i){return i.functions.length?`All global 'function-declaration' entity ids are:
255
- - ${i.functions.map(t=>`${t.id} (${B(t,i)})`).join(`
256
- - `)}.`:"The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities."}function El(i){return`All reserved action decriptor ids for '${n.GlobalEvent}' entities are:
257
- - ${i.globalEventActionDescriptors.map(e=>`${e.id} (${B(e,i)})`).join(`
258
- - `)}`}function Rl(i){return`All reserved action decriptor ids for '${n.Loop}' entities are:
259
- - ${i.loopDeclarations.map(e=>`${e.id} (${B(e,i)})`).join(`
260
- - `)}`}function bl(i){return`All reserved action decriptor ids for '${n.Condition}' entities are:
261
- - ${i.conditionDeclarations.map(e=>`${e.id} (${B(e,i)})`).join(`
262
- - `)}`}function l8(i,e){const t=[];if(!i)return[];const r=e.get(i),a=o8(e);if(!r)t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else if(r.type===n.ActionDescriptor)t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The 'functionDeclarationId' reference is pointing to entity with id '${i}' which is of type '${r.type}' entity. If you meant to reference an 'action-descriptor', you can use the 'implement_operation' generation action instead.
247
+ 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 E({id:`${n.id}--${e.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" with an incompatible scope.
248
+ ${d}`,issue:null}))}}return t}function Ve(n,e,t,i=!1){const a=[],s={...e};let o=JSON.parse(JSON.stringify(n));if(!i){if(Tn.includes(o.type)){if(o.readsValue){const y=xb(o,{key:"readsValue",types:rt},t);if(y.errors.length===0){const f=Hb(o,y.entityState);a.push(...f)}else a.push(...y.errors);delete s.readsValue}}else o.readsValue&&(rt.includes(o.type)?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${j(Tn,", "," and ")}.
249
+ ${Bl}`,issue:null})):r.Property===o.type?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${j(Tn,", "," and ")}.
250
+ ${Jb}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${j(Tn,", "," and ")}.
251
+ ${qb}`,issue:null})),delete s.readsValue);o.writesValues&&(rt.includes(o.type)?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
252
+ ${Wb}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
253
+ ${Bl}
254
+ ${Wb}`,issue:null})),delete s.writesValues);const p=P8(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const d=Object.entries(s);for(const[p,y]of d){const f=y.types,m=y.optional,b=o[p];if(!b){m||a.push(new E({id:`${o.id}--${p}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" is missing a reference to a "${p}" entity. The '${p}' property of a "${o.type}" entity can be ${j(f,", "," or ")}`,issue:null}));continue}if(y.list)if(Array.isArray(b))for(const P of b){const C=Ub(o,{key:p,types:f,optional:m},t);a.push(...C)}else{a.push(new E({id:`${o.id}--${p}--${h.ContainsSingleButShouldBeReferenceList}`,code:h.ContainsSingleButShouldBeReferenceList,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which is a list, but it isn't.`,issue:null}));continue}else if(Array.isArray(b)){a.push(new E({id:`${o.id}--${p}--${h.ContainsListButShouldReferenceSingle}`,code:h.ContainsListButShouldReferenceSingle,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which holds a single reference, but it is a list.`,issue:null}));continue}else{const P=Ub(o,{key:p,types:f,optional:m},t);a.push(...P)}}return{errors:a,modifiedData:o}}function D8(n){return n.functions.length?`All global 'function-declaration' entity ids are:
255
+ - ${n.functions.map(t=>`${t.id} (${A(t,n)})`).join(`
256
+ - `)}.`:"The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities."}function Ml(n){return`All reserved action decriptor ids for '${r.GlobalEvent}' entities are:
257
+ - ${n.globalEventActionDescriptors.map(e=>`${e.id} (${A(e,n)})`).join(`
258
+ - `)}`}function _l(n){return`All reserved action decriptor ids for '${r.Loop}' entities are:
259
+ - ${n.loopDeclarations.map(e=>`${e.id} (${A(e,n)})`).join(`
260
+ - `)}`}function Nl(n){return`All reserved action decriptor ids for '${r.Condition}' entities are:
261
+ - ${n.conditionDeclarations.map(e=>`${e.id} (${A(e,n)})`).join(`
262
+ - `)}`}function S8(n,e){const t=[];if(!n)return[];const i=e.get(n),a=D8(e);if(!i)t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,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.`,issue:null}));else if(i.type===r.ActionDescriptor)t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The 'functionDeclarationId' reference is pointing to entity with id '${n}' which is of type '${i.type}' entity. If you meant to reference an 'action-descriptor', you can use the 'implement_operation' generation action instead.
263
263
  Otherwise, if you were trying to implement a 'function-call' from a globally declarated 'function-declaration':
264
- ${a}`,issue:null}));else if(r.type!==n.FunctionDeclaration)t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The 'functionDeclarationId' reference is pointing to entity with id '${i}' which is of type '${r.type}' entity. Only 'function-declaration' entities can be implemented as function calls.
265
- ${a}`,issue:null}));else if(r.parent.type===n.CustomEntity){const o=mn(r.parent).filter(p=>!p.interactive);let d="";o.length&&(d=`
264
+ ${a}`,issue:null}));else if(i.type!==r.FunctionDeclaration)t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The 'functionDeclarationId' reference is pointing to entity with id '${n}' which is of type '${i.type}' entity. Only 'function-declaration' entities can be implemented as function calls.
265
+ ${a}`,issue:null}));else if(i.parent.type===r.CustomEntity){const o=mn(i.parent).filter(p=>!p.interactive);let d="";o.length&&(d=`
266
266
  Furthermore, the specific 'custom-entity' extends or implements non-interactive built-in-base-entities ${o.length>1?`entities with ids '${j(o.map(y=>y.id),"', '","' and '")}'`:`entity with id '${o[0].id}'`}.
267
- ${Vn}`),t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The function declaration entity with id '${i}' is a method of the 'custom-entity' with id '${r.parent.id}'. Only globally declared, standalone functions can be implemented as function calls.
268
- If you want to call a method of a custom entity, use a '${n.InternalCall}' entity on any variable which is an instance of that custom entity.
269
- ${a}${d}`,issue:null}))}else r.parent.type===n.Loop?t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The function declaration entity with id '${i}' is the body of the 'loop' with id '${r.parent.id}'. Only globally declared, standalone functions can be implemented as function calls.
267
+ ${Ln}`),t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The function declaration entity with id '${n}' is a method of the 'custom-entity' with id '${i.parent.id}'. Only globally declared, standalone functions can be implemented as function calls.
268
+ If you want to call a method of a custom entity, use a '${r.InternalCall}' entity on any variable which is an instance of that custom entity.
269
+ ${a}${d}`,issue:null}))}else i.parent.type===r.Loop?t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The function declaration entity with id '${n}' is the body of the 'loop' with id '${i.parent.id}'. Only globally declared, standalone functions can be implemented as function calls.
270
270
  If you want to execute the logic of a loop's body you can call the loop entity itself anf the body will be executed once for each iteration.
271
- ${a}`,issue:null})):r.parent.type!==n.Project&&t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The function declaration entity with id '${i}' has a 'parent' entity which isn't the root project. Only globally declared, standalone functions can be implemented as function calls.${a}`,issue:null}));return t}function c8(i,e){const t=[];if(!i)return[];const r=e.getBuiltIn(i),a=`
271
+ ${a}`,issue:null})):i.parent.type!==r.Project&&t.push(new E({id:`last-action--${h.InvalidFunctionDeclarationForFunctionCall}`,code:h.InvalidFunctionDeclarationForFunctionCall,severity:T.Error,message:`The function declaration entity with id '${n}' has a 'parent' entity which isn't the root project. Only globally declared, standalone functions can be implemented as function calls.${a}`,issue:null}));return t}function A8(n,e){const t=[];if(!n)return[];const i=e.getBuiltIn(n),a=`
272
272
  All built-in 'action-descriptor' entities that define 'operation' entity, are (IDs):
273
- - ${e.operationDeclarations.map(s=>`${s.id} (${B(s,e)}).`).join(`
273
+ - ${e.operationDeclarations.map(s=>`${s.id} (${A(s,e)}).`).join(`
274
274
  - `)}
275
- `;return r?r.type===n.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${i}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):r.type===n.ActionDescriptor?e.operationDeclarations.find(o=>o.id===i)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${i}' is of type '${r.type}' entity but it isn't one of the allowed operation descriptors.${a}`,issue:null})):r.type!==n.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${i}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${i}' that isn't yet found in the project.${a}`,issue:null})),t}function d8(i,e,t){var p,y,f,m;if(t.compatible)return"";const r=`entity of type "${i.type}" with id "${i.id}"`,a=`entity with id "${i.id}"`,s=`entity of type "${e.type}" with id "${e.id}"`,o=`entity with id "${e.id}"`,d=bo(`${r} and ${s} have incompatible data types and cannot be connected as value-reader and value-writter.`);return t.type===Vt.AIsListBIsNot?`${d}
276
- ${a} is a list, but ${o} is not. A list can't be connected to a single value.`:t.type===Vt.BIsListAIsNot?`${d}
277
- ${a} is not a list, but ${o} is. A single value can't be connected to a list.`:t.type===Vt.AIsNullableBIsNot?`${d}
278
- ${a} is nullable, but ${o} is not. A nullable value can't be connected to a non-nullable value since an empty value might be incorrectly provided.`:t.type===Vt.BIsNullableAIsNot?`${d}
279
- ${a} is not nullable, but ${o} is. A non-nullable value can't be connected to a nullable value since an empty value might be incorrectly provided.`:t.type===Vt.AIsTemplateBIsNot?`${d}
280
- ${a} is a template, but ${o} is not. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type===Vt.BIsTemplateAIsNot?`${d}
281
- ${a} is not a template, but ${o} is. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type===Vt.TypeEntityMismatch?`${d}
282
- Their 'entity' property is of different types. They must be of the same type to be connected. For example, the 'entity' can be a '${n.CustomEntity}' or a '${n.PrimitiveEntity}'.`:t.type===Vt.IncompatibleCustomEntities?`${d}
283
- Both point to custom entities, but they are not compatible to be connected. They must be either the same custom entity, or a custom entity that has equivalent shape, which includes the same properties all with compatible data types with the properties in the counterpart entity.`:t.type===Vt.IncompatiblePrimitiveEntities?`${d}
284
- ${a} is of primitive type '${((p=i.getDataType())==null?void 0:p.entity).name}' and ${o} is of primitive type '${((y=e.getDataType())==null?void 0:y.entity).name}'. They must be of the same primitive type to be connected.`:t.type===Vt.IncompatibleBuiltInBaseEntities?`${d}
285
- Both point to a built-in-base-entity. But${a} is of built-in base type '${((f=i.getDataType())==null?void 0:f.entity).name}' and ${o} is of built-in base type '${((m=e.getDataType())==null?void 0:m.entity).name}'. They must be of the same built-in base type to be connected.`:d}function La(i,e){const t=[];if(i.readsValue){const r=e.project.get(D(i.readsValue));if(e.project.getBuiltIn(D(i.readsValue)))t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to a built-in entity with id '${i.readsValue}'. Only user-created entities can be referenced.`,issue:null}));else if(!r)t.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${i.readsValue}' because the entity was not found in the project state.`,issue:null}));else{const s=Gn(r);if(s)t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${i.readsValue}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${B(s,e.project)}) higher up in the tree.`,issue:null}));else{const o=Tb({...e.toGenerationTarget(),...i},r);t.push(...o);const d=vo(e.getDataType(),r.getDataType());d.compatible||t.push(new E({id:`${e.id}--${v.ReaderWriterIncompatibleDataType}`,code:v.ReaderWriterIncompatibleDataType,severity:T.Error,message:d8(e,r,d),issue:null}))}}}return{errors:t,modifiedData:i}}function hn(i){const e=[];if(i.parent===i.project)i.calledBy.length||e.push(new or({id:`${i.id}--${_.DisconnectedCallableEntity}`,code:_.DisconnectedCallableEntity,severity:T.Warning,message:`This '${i.type}' entity "${B(i,i.project)}" with id "${i.id}" is globally declared and isn't called by any other entity.
275
+ `;return i?i.type===r.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):i.type===r.ActionDescriptor?e.operationDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${n}' is of type '${i.type}' entity but it isn't one of the allowed operation descriptors.${a}`,issue:null})):i.type!==r.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function O8(n,e,t){var p,y,f,m;if(t.compatible)return"";const i=`entity of type "${n.type}" with id "${n.id}"`,a=`entity with id "${n.id}"`,s=`entity of type "${e.type}" with id "${e.id}"`,o=`entity with id "${e.id}"`,d=Ta(`${i} and ${s} have incompatible data types and cannot be connected as value-reader and value-writter.`);return t.type===Ot.AIsListBIsNot?`${d}
276
+ ${a} is a list, but ${o} is not. A list can't be connected to a single value.`:t.type===Ot.BIsListAIsNot?`${d}
277
+ ${a} is not a list, but ${o} is. A single value can't be connected to a list.`:t.type===Ot.AIsNullableBIsNot?`${d}
278
+ ${a} is nullable, but ${o} is not. A nullable value can't be connected to a non-nullable value since an empty value might be incorrectly provided.`:t.type===Ot.BIsNullableAIsNot?`${d}
279
+ ${a} is not nullable, but ${o} is. A non-nullable value can't be connected to a nullable value since an empty value might be incorrectly provided.`:t.type===Ot.AIsTemplateBIsNot?`${d}
280
+ ${a} is a template, but ${o} is not. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type===Ot.BIsTemplateAIsNot?`${d}
281
+ ${a} is not a template, but ${o} is. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type===Ot.TypeEntityMismatch?`${d}
282
+ Their 'entity' property is of different types. They must be of the same type to be connected. For example, the 'entity' can be a '${r.CustomEntity}' or a '${r.PrimitiveEntity}'.`:t.type===Ot.IncompatibleCustomEntities?`${d}
283
+ Both point to custom entities, but they are not compatible to be connected. They must be either the same custom entity, or a custom entity that has equivalent shape, which includes the same properties all with compatible data types with the properties in the counterpart entity.`:t.type===Ot.IncompatiblePrimitiveEntities?`${d}
284
+ ${a} is of primitive type '${((p=n.getDataType())==null?void 0:p.entity).name}' and ${o} is of primitive type '${((y=e.getDataType())==null?void 0:y.entity).name}'. They must be of the same primitive type to be connected.`:t.type===Ot.IncompatibleBuiltInBaseEntities?`${d}
285
+ Both point to a built-in-base-entity. But${a} is of built-in base type '${((f=n.getDataType())==null?void 0:f.entity).name}' and ${o} is of built-in base type '${((m=e.getDataType())==null?void 0:m.entity).name}'. They must be of the same built-in base type to be connected.`:d}function qa(n,e){const t=[];if(n.readsValue){const i=e.project.get(D(n.readsValue));if(e.project.getBuiltIn(D(n.readsValue)))t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to a built-in entity with id '${n.readsValue}'. Only user-created entities can be referenced.`,issue:null}));else if(!i)t.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity was not found in the project state.`,issue:null}));else{const s=Fn(i);if(s)t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${A(s,e.project)}) higher up in the tree.`,issue:null}));else{const o=Hb({...e.toGenerationTarget(),...n},i);t.push(...o);const d=Ea(e.getDataType(),i.getDataType());d.compatible||t.push(new E({id:`${e.id}--${g.ReaderWriterIncompatibleDataType}`,code:g.ReaderWriterIncompatibleDataType,severity:T.Error,message:O8(e,i,d),issue:null}))}}}return{errors:t,modifiedData:n}}function hn(n){const e=[];if(n.parent===n.project)n.calledBy.length||e.push(new lr({id:`${n.id}--${_.DisconnectedCallableEntity}`,code:_.DisconnectedCallableEntity,severity:T.Warning,message:`This '${n.type}' entity "${A(n,n.project)}" with id "${n.id}" is globally declared and isn't called by any other entity.
286
286
  Globally declared callable entities will not be part of any logic execution when the project is published.
287
- 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 '${n.GlobalEvent}' or '${n.FunctionDeclaration}'.
287
+ 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 '${r.GlobalEvent}' or '${r.FunctionDeclaration}'.
288
288
  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.
289
- Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:i}));else{const t=Ml(i);if(!t.reachable){let r=`This '${i.type}' entity "${B(i,i.project)}" with id "${i.id}" is not reachable from the project's closest entry point '${t.entryPoint.type}' "${B(i,i.project)}".`;r+=`
290
- This is because there are termination statements in the call chain before reaching this '${i.type}'.
289
+ Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:n}));else{const t=Wl(n);if(!t.reachable){let i=`This '${n.type}' entity "${A(n,n.project)}" with id "${n.id}" is not reachable from the project's closest entry point '${t.entryPoint.type}' "${A(n,n.project)}".`;i+=`
290
+ This is because there are termination statements in the call chain before reaching this '${n.type}'.
291
291
  If a caller entity calls a termination statement, it will always prevent all other calls from executing.`;let a=`
292
- This '${i.type}' is blocked `;t.blocks.forEach((s,o)=>{const d=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${B(d,i.project)}" with id "${d.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new or({id:`${i.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:T.Warning,message:`${r}${a}`,issue:null,entity:i}))}}return z(i.errors,e)}function u8(i){var o;const e=Ux(),t=i.toJSON();e.safeParse(t).success,i.inputs.forEach(d=>d.validate()),i.outputs.forEach(d=>d.validate()),(o=i.error)==null||o.validate();const s=[...hn(i)];return z(i.errors,s)}const Re=class Re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",n.FunctionCall);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"process",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 r=t;if(e.parent){const m=D(e.parent);r=t.get(m)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=D(m);return t.get(b)}),d=e.calledBySuccess.map(m=>{const b=D(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=D(m);return t.get(b)}),y={id:e.id,version:1,type:n.FunctionCall,declaration:s.toReference(),calledByEntry:o,calledBySuccess:d,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:r},f=R(y,t);return f.setParent(r),f.initChildren(),f}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ve(r,{parent:{list:!1,types:[...it,n.Project],optional:!0}},t);r=s.modifiedData,a.push(...s.errors,...Ae(r));const o=D(r.declaration);if(o){const d=l8(o,t);a.push(...d)}else{const d=t.functions.length?`
292
+ This '${n.type}' is blocked `;t.blocks.forEach((s,o)=>{const d=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${A(d,n.project)}" with id "${d.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new lr({id:`${n.id}--${g.UnreachableEntity}`,code:g.UnreachableEntity,severity:T.Warning,message:`${i}${a}`,issue:null,entity:n}))}}return z(n.errors,e)}function C8(n){var o;const e=ox(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(d=>d.validate()),n.outputs.forEach(d=>d.validate()),(o=n.error)==null||o.validate();const s=[...hn(n)];return z(n.errors,s)}const Re=class Re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.FunctionCall);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"process",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(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 i=t;if(e.parent){const m=D(e.parent);i=t.get(m)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=D(m);return t.get(b)}),d=e.calledBySuccess.map(m=>{const b=D(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=D(m);return t.get(b)}),y={id:e.id,version:1,type:r.FunctionCall,declaration:s.toReference(),calledByEntry:o,calledBySuccess:d,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ve(i,{parent:{list:!1,types:[...it,r.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,...Ae(i));const o=D(i.declaration);if(o){const d=S8(o,t);a.push(...d)}else{const d=t.functions.length?`
293
293
  All global 'function-declaration' entity ids are:
294
- - ${t.functions.map(p=>`${p.id} (${B(p,t)})`).join(`
294
+ - ${t.functions.map(p=>`${p.id} (${A(p,t)})`).join(`
295
295
  - `)}.`:`
296
- The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities.`;a.push(new E({id:`${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.FunctionCall}" with id "${r.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'function-declaration' entity.
297
- References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${d}`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
296
+ The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities.`;a.push(new E({id:`${i.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${r.FunctionCall}" with id "${i.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'function-declaration' entity.
297
+ References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${d}`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
298
298
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
299
- 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}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addFunctionCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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.push(e),this}addSuccessCall(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===n.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=D(this.initialData.declaration),t=this.project.get(e);this.declaration=t}return this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initOutputs(),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this}initOutputs(){const e=[];this.outputs=this.initialData.outputs.map(s=>{const o=R(s,this.project);return e.push(o.index),o.setParent(this),o.initChildren(),o});const r=Dl(this).filter(s=>!this.outputs.find(o=>o.declaration.id===s.id));r.sort((s,o)=>s.index-o.index);const a=r.map((s,o)=>{const d=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:L.uuid(),type:n.OutputMap,version:1,declaration:s,index:d,parent:this,writesValues:[]},y=R(p,this.project);return y.setParent(this),y.initChildren(),y});return this.outputs.push(...a),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const r=[],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:d}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}if(this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),this.outputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...d),a.push(...p)}),this.error){const{affected:o,removed:d}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...d)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:S(r),removed:S(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.process?this.process.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===n.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(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=u8(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){return new Re(this.toJSON(),this.project)}};l(Re,"MUTABLE_BASE_PROPERTIES",[]),l(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"MUTABLE_META_PROPERTIES",["x","y"]),l(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),l(Re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(Re,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),l(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),l(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let bi=Re;function $a(i,e){const t=$n(i);if(t.length===0)return{list:[],last:null};let r=null;return{list:t.flatMap(s=>{if(s===e)return r=s,[s];const o=$a(s,e);return o.last&&(r=o.last),[s,...o.list]}),last:r}}function Eb(i,e,t=new Set){const r=fn(i),a=fn(e),s=r.filter(p=>!a.includes(p)),o=r.filter(p=>a.includes(p)),d=s.reduce((p,y)=>t.has(y.id)?p:(t.add(y.id),S([...p,...Eb(y,e,t)])),[]);return S([...o,...d])}function vi(i,e){const t=$a(i,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function p8(i,e){return!!$a(i,e).last}function y8(i){if(Fe.includes(i.type))return i;if([...En,n.VariableDeclaration].includes(i.type)){const e=i.parent;return Fe.includes(e.type)?e:null}return null}function vl(i,e){if(!i||!e)throw new Error("Both entities must be defined to find a common ancestor");if(i===e)return i;const t=i.parent;if(t){if(t===e)return e;if(t.type===n.Project)return null}else return null;const r=e.parent;if(r){if(r===i)return i;if(r.type===n.Project)return null}else return null;return vl(t,r)}function ke(i){if(Ya.includes(i.type)){if(i.type===n.FunctionDeclaration){const e=i.parent;if(e.type===n.CustomEntity)return e}return i}else{const e=i.parent;return e?ke(e):null}}function h8(i){return i.type===n.VariableDeclaration?[i]:Ge.includes(i.type)?[...i.inputs,...i.outputs||[]]:i.type===n.ReturnStatement?i.outputs:Un.includes(i.type)||i.type===n.FunctionDeclaration?i.inputs:[]}function f8(i){const e=fn(i),t=[],r=[];Vl.includes(i.type)&&t.push(...gl(i));const a=e.filter(s=>{const o=t.includes(s);return o?!1:En.includes(s.type)&&!o?(r.push(s),!1):!0});return t.sort((s,o)=>vi(o,s)?-1:0),r.sort((s,o)=>vi(o,s)?-1:0),[...t,...r,...a]}function Rb(i){return[...i].sort((e,t)=>vi(t,e)?-1:0)}function m8(i){const e=Rb(i),t=[];return e.forEach(r=>{const a=t[t.length-1];if(a){const s=a[a.length-1];vi(r,s)?t.push([r]):a.push(r)}else t.push([r])}),t}function Ct(i){const e=i.map(t=>ke(t));return S(e)}function gl(i){return Ge.includes(i.type)?[...Ct(i.successCalls),...Ct(i.errorCalls)]:Fe.includes(i.type)?Ct(i.calls):[]}function T8(i,e){return gl(i).includes(e)}function Il(i){return i.writesValues||[]}function E8(i,e){return Il(i).includes(e)}function bb(i){var e;return _e.includes((e=i==null?void 0:i.readsValue)==null?void 0:e.type)?i.readsValue:null}function R8(i){return i.writesValues}function vb(i=[]){return i.map(bb).filter(e=>!!e)}function Ga(i=[]){return i.map(e=>e.writesValues).flat().filter(e=>_e.includes(e.type))}function gb(i=[]){return i.map(e=>e.readsValue).filter(e=>!!e&&_e.includes(e.type))}function Ib(i){return _e.includes(i.type)?i:null}function Pb(i){return i.writesValues.map(Ib).filter(e=>!!e)}function Db(i=[]){return i.reduce((e,t)=>t.type===n.OutputMap?[...e,...Pb(t)]:e,[])}function we(i){return Ge.includes(i.type)?[...Ln(Ct(i.successCalls)),...Ln(Ct(i.errorCalls))]:Fe.includes(i.type)?Ln(Ct(i.calls)):[]}function Sb(i,e=new Set){return i.writesValues.filter(r=>_e.includes(r.type)&&!e.has(r.id)).reduce((r,a)=>e.has(a.id)?r:[...r,...Y(a,e)],[])}function Ab(i,e=new Set){var r;return(((r=i.readsValue)==null?void 0:r.writesValues)||[]).filter(a=>_e.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...Y(s,e)],[])}function Y(i,e=new Set){if(e.has(i.id))return[];if(i.type===n.ReturnStatement)return gb(i.outputs).reduce((r,a)=>[...r,...Y(a,e)],[]);if(i.type===n.FunctionCall||i.type===n.Operation||i.type===n.Condition)return[...we(i).reduce((s,o)=>{const d=ke(o);return[...s,...Y(d||o,e)]},[]),...vb(i.inputs),...Db(i.outputs)].reduce((s,o)=>[...s,...Y(o,e)],[]);if(Un.includes(i.type)){const t=Ga(i.inputs),a=we(i).reduce((s,o)=>{const d=ke(o);return[...s,...Y(d||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Y(o,e)],[])}if(i.type===n.FunctionDeclaration){const t=[...Ga(i.inputs)],a=we(i).reduce((s,o)=>{const d=ke(o);return[...s,...Y(d||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Y(o)],[])}if(_e.includes(i.type)){e.add(i.id);const r=we(i).reduce((a,s)=>{const o=ke(s);return[...a,...Y(o||s,e)]},[]);return[i,...r,...Ab(i,e),...Sb(i,e)]}return[]}function Tt(i,e=new Set){return e.has(i.id)?[]:(e.add(i.id),[...fn(i).reduce((a,s)=>[...a,s,...Tt(s,e)],[])])}function Ln(i){return i.reduce((e,t)=>t.type===n.ReturnStatement||t.type===n.ContinueStatement||t.type===n.BreakStatement?e:[...e,t,...we(t)],[])}function Ob(i){const e=i.entities||[],t=[...e,...i.functions||[],...i.events||[],...i.projects||[]],r=e.reduce((p,y)=>[...p,...y.properties],[]),a=e.reduce((p,y)=>[...p,...y.methods],[]),s=a.reduce((p,y)=>[...p,...Ga(y.inputs),...Ln(Ct(y.calls)),...y.returnStatements],[]),o=i.functions.reduce((p,y)=>[...p,...Ln(Ct(y.calls)),...y.returnStatements],[]),d=i.events.reduce((p,y)=>[...p,...Ln(Ct(y.calls)),...y.returnStatements],[]);return[...t,...r,...a,...s,...o,...d]}function Cb(i,e){return e.filter(r=>{if(!r)return!1;switch(r.type){case n.FunctionCall:return r.inputs.find(a=>a.id===i.id)!==void 0||r.outputs.find(a=>a.id===i.id)!==void 0;case n.Condition:return r.successCalls.find(a=>a.id===i.id)!==void 0||r.errorCalls.find(a=>a.id===i.id)!==void 0||r.inputs.find(a=>a.id===i.id)!==void 0;case n.Operation:return r.outputs.find(a=>a.id===i.id)!==void 0;case n.VariableDeclaration:return Ge.includes(i.type)?Bb(i).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===r.id})!==void 0:!1;case n.CustomEntity:return r.properties.find(a=>a.id===i.id)!==void 0||r.methods.find(a=>a.id===i.id)!==void 0;case n.FunctionDeclaration:return r.inputs.find(a=>a.id===i.id)!==void 0||(r.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===i.id)!==void 0;default:return!1}})}function b8(i){const e=Ob(i.project);return Cb(i,e)}function $n(i){const e=[];if(En.includes(i.type)){i.calledBy.forEach(a=>{const s=ke(a);s&&e.push(s)});const r=[...i.inputs||[],...i.outputs||[]].map(a=>Sl(a)).filter(a=>a!==null);e.push(...S(r))}if(_e.includes(i.type)){const t=Sl(i);t&&e.push(t)}return S(e)}function Pl(i){return i.type===n.FunctionCall||i.type===n.InternalCall?i.declaration.inputs:[n.Operation,n.Condition,n.Loop].includes(i.type)?i.declaration.fixedArguments:i.type===n.FunctionDeclaration||Un.includes(i.type)?i.inputs:i.type===n.Search?i.inputsDeclarations:[]}function v8(i,e){return e.type===n.Condition?e.inputs.find(t=>t.declaration.id===i.id):e.type===n.FunctionCall||e.type===n.Operation?e.inputs.find(t=>t.declaration.id===i.id):null}function Bb(i){return Ge.includes(i.type)?i.inputs:[]}function Dl(i){var e;return i.type===n.FunctionCall?((e=i.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[n.Operation,n.Condition,n.Loop].includes(i.type)?i.declaration.fixedReturns:i.type===n.Search?i.outputsDeclarations:Ne.includes(i.type)?i.outputs:[]}function g8(i,e){return e.type===n.Condition?null:e.type===n.FunctionCall||e.type===n.Operation?e.outputs.find(t=>t.declaration.id===i.id):null}function I8(i){return i.type===n.Condition?[]:Ge.includes(i.type)?i.outputs:[]}function Sl(i){const e=i.readsValue;return e?ke(e):null}function wb(i){const e=i.internalCalls||[];return S(Ct(S(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function hr(i){const e=Il(i),t=[];return e.forEach(r=>{if(_e.includes(r.type))t.push(r);else if(r.type===n.InputMap){const a=r.parent;if(a.type===n.InputMap){const s=a.parent;t.push(s)}else t.push(a)}else[n.ActionDescriptor].includes(r.parent.type)||t.push(r.parent)}),t}function S(i){const e=new Set;return i.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function fn(i,e=!1){const t=[];if(i.type===n.Project&&t.push(...(i==null?void 0:i.entities)||[],...(i==null?void 0:i.functions)||[],...(i==null?void 0:i.variableDeclarations)||[],...(i==null?void 0:i.variableInstances)||[],...(i==null?void 0:i.searches)||[],...(i==null?void 0:i.loops)||[],...(i==null?void 0:i.operations)||[],...(i==null?void 0:i.conditions)||[],...(i==null?void 0:i.functionCalls)||[],...(i==null?void 0:i.events)||[],...(i==null?void 0:i.projects)||[]),it.includes(i.type)&&t.push(...(i==null?void 0:i.detachedChildren)||[]),i.type===n.CustomEntity){const r=[...i.suggestedMethods,...i.methods].flatMap(a=>a.collapsed&&e?[]:fn(a));t.push(...r)}if(i.type===n.Condition){const r=i.successCalls.map(s=>ke(s)),a=i.errorCalls.map(s=>ke(s));t.push(...r,...a)}if(Un.includes(i.type)){if(i.collapsed&&e)return[];const r=i.inputs.map(s=>hr(s)).flat(),a=i.calls.map(s=>ke(s));t.push(...S(r),...a)}if(Ge.includes(i.type)&&i.type!==n.Condition){const r=i==null?void 0:i.outputs.map(o=>hr(o)).flat(),a=i.successCalls.map(o=>ke(o)),s=i.errorCalls.map(o=>ke(o));t.push(...S(r),...a,...s)}if(_e.includes(i.type)){const r=hr(i),a=wb(i);t.push(...r,...a)}if(i.type===n.Loop){const r=i.outputs.map(o=>hr(o)).flat();if(i.body){const o=fn(i.body,e);t.push(...o)}const a=i.errorCalls.map(o=>ke(o)),s=i.successCalls.map(o=>ke(o));t.push(...S(r),...s,...a)}if(i.type===n.FunctionDeclaration){if(i.collapsed&&e)return[];const r=i.inputs.map(s=>hr(s)).flat(),a=i.calls.map(s=>ke(s));t.push(...S(r),...a)}return S(t)}function Mb(i,e=!1){const t=fn(i,e),r=[...t,...t.reduce((a,s)=>[...a,...Mb(s,e)],[])];return S(r)}function _b(i){const e=$n(i),t=[...e,...e.reduce((r,a)=>[...r,..._b(a)],[])];return S(t)}function Fa(i){return i.implements.reduce((e,t)=>t.type===n.CustomEntity?[...e,n.CustomEntity,...Fa(t),...xa(t)]:[...e,t.name],[])}function xa(i){return i.extends.reduce((e,t)=>t.type===n.CustomEntity?[...e,n.CustomEntity,...xa(t),...Fa(t)]:[...e,t.name],[])}function Al(i){return i.extends.reduce((e,t)=>t.type===n.CustomEntity?[...e,t,...Al(t),...Ol(t)]:[...e,t],[])}function Ol(i){return i.implements.reduce((e,t)=>t.type===n.CustomEntity?[...e,t,...Ol(t),...Al(t)]:[...e,t],[])}function Nb(i){return[...xa(i),...Fa(i)].filter((t,r,a)=>a.indexOf(t)===r)}function Vb(i){return i.implements.length===0&&i.extends.length===0?null:i.implements.find(r=>r.type===n.BuiltInBaseEntity&&r.name===M.PERSISTED_ENTITY)?i:[...i.implements,...i.extends].reduce((r,a)=>{if(a.type===n.CustomEntity){const s=Vb(a);if(s)return s}return r},null)}function P8(i){const e=i.extends.find(t=>t.type===n.BuiltInBaseEntity);return e&&e.type===n.BuiltInBaseEntity?e:null}function D8(i){const e=i.implements.find(t=>t.type===n.BuiltInBaseEntity);return e&&e.type===n.BuiltInBaseEntity?e:null}function Lb(i){const e=i.extends.find(t=>t.type===n.CustomEntity);return e&&e.type===n.CustomEntity?e:null}function mn(i){const e=[...i.implements,...i.extends].reduce((t,r)=>r.type===n.BuiltInBaseEntity?[...t,r]:r.type===n.CustomEntity?[...t,...mn(r)]:t,[]);return S(e)}function $b(i){return i.type===n.PrimitiveEntity?!0:i.type===n.BuiltInBaseEntity?i.interactive:!mn(i).find(r=>!r.interactive)}function S8(i){return i.parent===i.project&&i.project.variableDeclarations.includes(i)}function Cl(i){return i.parent!==i.project?!1:n.VariableDeclaration===i.type?i.project.variableDeclarations.includes(i):n.VariableInstance===i.type?i.project.variableInstances.includes(i):n.FunctionCall===i.type?i.project.functionCalls.includes(i):n.Condition===i.type?i.project.conditions.includes(i):n.Operation===i.type?i.project.operations.includes(i):n.Loop===i.type?i.project.loops.includes(i):n.Search===i.type?i.project.searches.includes(i):!1}function Gb(i){if([...Fe,n.CustomEntity,n.InstalledProject,n.Project].includes(i.type)||Cl(i))return!1;const e=$n(i);return e.length===0?!0:e.some(t=>Gb(t))}function Bl(i){return[...Fe,n.CustomEntity,n.InstalledProject,n.Project].includes(i.type)||Cl(i)?!1:$n(i).length===0}function Fb(i,e=0){if(Bl(i)){const t=$n(i);return t.length===0?i:t.map(a=>Fb(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function xb(i){const e=[];if(Bl(i))e.push(i);else return[];return $n(i).forEach(r=>{e.push(...xb(r))}),e}function Ub(i){return i.type===n.FunctionDeclaration&&i.parent!==i.project&&!![n.CustomEntity,n.Loop,n.InstalledProject].includes(i.parent.type)}function A8(i,e){const t=new Map;return i.forEach(r=>{t.set(r.id,r)}),e.forEach(r=>{t.set(r.id,r)}),Array.from(t.values())}function jb(i){switch(i){case n.CustomEntity:return si;case n.FunctionDeclaration:return li;case n.VariableDeclaration:return pi;case n.VariableInstance:return yi;case n.FunctionCall:return bi;case n.Operation:return ci;case n.Condition:return ui;case n.ReturnStatement:return Ri;case n.Loop:return di;case n.Search:return hi;case n.InputMap:return mi;case n.OutputMap:return Ti;case n.ArgumentDeclaration:return Ei;case n.ReturnDeclaration:return $t;case n.Property:return oi;case n.InstalledProject:return fi;case n.Project:return Pi;case n.BuiltInBaseEntity:return Fn;default:return null}}function ut(i,e){if(it.includes(i.type))return i;if(Di.includes(i.type))return null;const t=i.parent;if(!t)return null;if(t.type===n.GenericReference){const r=D(t);if(!r)return null;const a=e.get(r);return a?ut(a,e):null}else return t===e?e:ut(t,e)}function wl(i,e){if(Di.includes(i.type)||e.getAllBuiltInIds().includes(i.id))return null;const r=Bt(i.parent,e);return r?r===e?it.includes(i.type)?i:null:r.type===n.CustomEntity?i:wl(r,e):null}function Ua(i,e,t){if(i===e||e===t||i===t)return!1;const r=ut(e.parent,t);return r===i?!0:Ua(r,e,t)}var ja=(i=>(i.SameBothLocal="same-both-local",i.AInB="a-in-b",i.BInA="b-in-a",i.ParallelInCommonParent="parallel-in-common-parent",i.ParallelInProject="parallel-in-project",i.AIsGlobalBIsNot="a-is-global-b-is-not",i.BIsGlobalAIsNot="b-is-global-a-is-not",i.SameBothGlobal="same-both-global",i))(ja||{});function gi(i,e,t){const r=ut(i,t),a=ut(e,t);if(!r)throw new Error("Could not find scope owner for the entity: "+i.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(r===a&&r.type!==n.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:r};if(r===a&&r.type===n.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:r};if(r.type===n.Project&&a.type!==n.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:r};if(r.type!==n.Project&&a.type===n.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(Ua(r,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:r};if(Ua(a,r,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const d=vl(r,a);return d===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:d}:d?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:ut(d,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function kb(i,e,t){const r=gi(i,e,t);if(!r.compatible||r.type!=="same-both-local")return null;if(i===e)return i;let a=ut(i.parent,t);if(a){if(a===e)return e;if(a.type===n.Project)return i}else return i;for(;a;){if(a){if(a===e)return e;if(a.type===n.Project)return i}else return i;a=ut(a.parent,t)}let s=ut(e.parent,t);if(s){if(s===i)return i;if(s.type===n.Project)return e}else return e;for(;s;){if(s){if(s===i)return i;if(s.type===n.Project)return e}else return e;s=ut(s.parent,t)}return null}function qb(i){return i.length===0?null:i.length===1?i[0]:i.reduce((t,r)=>{const a=kb(t,r,r.project);return!a||a===r?t:r},i[0])}function Bt(i,e){let t;return typeof i=="string"?t=i:i.type===n.GenericReference?t=D(i):t=i.id,t===e.id?e:e.get(t)}function Gn(i){if(Di.includes(i.type))return i;if(i.type===n.Project)return null;if(i.project.getAllBuiltInIds().includes(i.id))return i;const t=i.parent;return!t||t.type===n.Project?null:Gn(t)}function Ii(i,e){var t;if(i.readsValue){const r=Bt(i.readsValue,e.project);e.setValueWriter(r),r.addValueReader(e)}else i.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function Ml(i){const e=[];function t(o,d){return e.some(p=>p.blockedByCaller===o&&p.blockedByCalling===d)}function r(o,d){t(o,d)||e.push({blockedByCaller:o,blockedByCalling:d})}const a=wl(i,i.project);return i.calledBy.forEach(o=>{if([...o.calls||[],...o.successCalls||[],...o.errorCalls||[]].forEach(y=>{Ne.includes(y.type)&&r(o,y)}),o===a)return;let p;if(Ge.includes(o.type))p=o;else if(o.type===n.FunctionDeclaration){const y=ke(o);if(y.type===n.CustomEntity)return;y.type===n.Loop&&(p=y)}if(p){const y=Ml(p);y.reachable||(Ne.includes(i.type)?y.blocks.forEach(f=>{r(o,f.blockedByCalling)}):we(i).find(b=>b===o)||y.blocks.forEach(b=>{r(o,b.blockedByCalling)}))}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function O8(i){return Ya.includes(i.type)?i.type===n.FunctionDeclaration?!Ub(i):!0:!1}function C8(i){if(n.ActionDescriptor===i.type){if(i.project.operationDeclarations.find(s=>s.id===i.id))return n.Operation;if(i.project.globalEventActionDescriptors.find(s=>s.id===i.id))return n.GlobalEvent;if(i.project.loopDeclarations.find(s=>s.id===i.id))return n.Loop;if(i.project.conditionDeclarations.find(s=>s.id===i.id))return n.Condition}return i.type}const ue=class ue{constructor(e){l(this,"initialData");l(this,"id");l(this,"version");l(this,"type",n.Project);l(this,"name",null);l(this,"description",null);l(this,"x");l(this,"y");l(this,"entities",[]);l(this,"projects",[]);l(this,"functions",[]);l(this,"events",[]);l(this,"variableDeclarations",[]);l(this,"variableInstances",[]);l(this,"conditions",[]);l(this,"operations",[]);l(this,"functionCalls",[]);l(this,"loops",[]);l(this,"searches",[]);l(this,"primitives",[]);l(this,"builtInBaseEntities",[]);l(this,"operationDeclarations",[]);l(this,"globalEventActionDescriptors",[]);l(this,"loopDeclarations",[]);l(this,"conditionDeclarations",[]);l(this,"valueDescriptors",[]);l(this,"dataTypes",[]);l(this,"project");l(this,"instances",{});l(this,"builtInInstances",{});l(this,"errors",[]);l(this,"references",[]);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}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Ae(r)),{errors:a,modifiedData:r}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async r=>{await t.init(this),r(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return 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.entities=this.initialData.entities.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.projects=this.initialData.projects.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functions=this.initialData.functions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableDeclarations=this.initialData.variableDeclarations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableInstances=this.initialData.variableInstances.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.conditions=this.initialData.conditions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.operations=this.initialData.operations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functionCalls=this.initialData.functionCalls.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.loops=this.initialData.loops.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.searches=this.initialData.searches.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.attachOrphanReferences(),this.validate(),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(){return this}async create(){return this}async update(e){return this}async delete(){return 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(r=>r.toFlat(e)),...this.functions.flatMap(r=>r.toFlat(e)),...this.events.flatMap(r=>r.toFlat(e)),...this.projects.flatMap(r=>r.toFlat(e)),...this.variableDeclarations.flatMap(r=>r.toFlat(e)),...this.variableInstances.flatMap(r=>r.toFlat(e)),...this.conditions.flatMap(r=>r.toFlat(e)),...this.operations.flatMap(r=>r.toFlat(e)),...this.functionCalls.flatMap(r=>r.toFlat(e)),...this.loops.flatMap(r=>r.toFlat(e)),...this.searches.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toReference()),functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),projects:this.projects.map(e=>e.toReference()),variableDeclarations:this.variableDeclarations.map(e=>e.toReference()),variableInstances:this.variableInstances.map(e=>e.toReference()),conditions:this.conditions.map(e=>e.toReference()),operations:this.operations.map(e=>e.toReference()),functionCalls:this.functionCalls.map(e=>e.toReference()),loops:this.loops.map(e=>e.toReference()),searches:this.searches.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(r=>r.toFlatJSON(e)),...this.functions.flatMap(r=>r.toFlatJSON(e)),...this.events.flatMap(r=>r.toFlatJSON(e)),...this.projects.flatMap(r=>r.toFlatJSON(e)),...this.variableDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.variableInstances.flatMap(r=>r.toFlatJSON(e)),...this.conditions.flatMap(r=>r.toFlatJSON(e)),...this.operations.flatMap(r=>r.toFlatJSON(e)),...this.functionCalls.flatMap(r=>r.toFlatJSON(e)),...this.loops.flatMap(r=>r.toFlatJSON(e)),...this.searches.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.functions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.events.flatMap(r=>r.toFlatGenerationTarget(e)),...this.projects.flatMap(r=>r.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(r=>r.toFlatGenerationTarget(e)),...this.conditions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.operations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.loops.flatMap(r=>r.toFlatGenerationTarget(e)),...this.searches.flatMap(r=>r.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=lU(),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 new ue(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(r=>r.id===e.id);if(t>-1){const r=this.entities[t];return this.entities.splice(t,1),r}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(r=>r.id===e.id);if(t>-1){const r=this.functions[t];return this.functions.splice(t,1),r}return null}removeExternalProject(e){const t=this.projects.findIndex(r=>r.id===e.id);if(t>-1){const r=this.projects[t];return this.projects.splice(t,1),r}return null}removeGlobalEvent(e){const t=this.events.findIndex(r=>r.id===e.id);if(t>-1){const r=this.events[t];return this.events.splice(t,1),r}return null}removeTopLevelVariableDeclaration(e){if(e.type!==n.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(r=>r.id===e.id);if(t>-1){const r=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),r}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,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.functionCalls.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.operations.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.loops.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.searches.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.functionCalls.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.conditions.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.loops.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.searches.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.conditions.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.operations.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.loops.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.searches.reduce((t,r)=>{const a=we(r);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const a=Y(r);return[...t,...a]},[]),...this.functionCalls.reduce((t,r)=>{const a=Y(r);return[...t,...a]},[]),...this.conditions.reduce((t,r)=>{const a=Y(r);return[...t,...a]},[]),...this.operations.reduce((t,r)=>{const a=Y(r);return[...t,...a]},[]),...this.loops.reduce((t,r)=>{const a=Y(r);return[...t,...a]},[]),...this.searches.reduce((t,r)=>{const a=Y(r);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return S([...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,r)=>{const s=Y(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(r=>{if(!r.declaration){const a=r.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(d=>d.id===s);o&&r.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===M.PERSISTED_ENTITY)||null}};l(ue,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(ue,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),l(ue,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ue,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),l(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let Pi=ue;function B8(i){const e=kF(),t=i.toJSON();e.safeParse(t).success;const a=[];return z(i.errors,a)}class ka{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",n.PrimitiveEntity);l(this,"static");l(this,"abstract");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(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(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.parent=this,a})}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return 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(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{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(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){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(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.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=B8(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}clone(){return new ka(this.toJSON(),this.project)}}function w8(i){const e=KF(),t=i.toJSON();e.safeParse(t).success;const a=[];return z(i.errors,a)}class Fn{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",n.BuiltInBaseEntity);l(this,"abstract",!1);l(this,"static");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"interactive",!1);l(this,"errors",[]);l(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(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(r=>R(r,this.project))}get extendedProperties(){return S(this.extends.reduce((e,t)=>{if(t instanceof Fn){const r=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);e.push(...r)}return e},[]))}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return 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(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e)),...this.extends.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.toFlatIds(e)),...this.extends.flatMap(r=>r.toFlatIds(e))])}toJSON(){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(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){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(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.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=w8(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}clone(){return new Fn(this.toJSON(),this.project)}implement(e,t){return ul(this,e,t)}}function qa(i,e){if(!i)throw new Error("Entity is null");const t=e.findSubscribedInstance(i);switch(i.type){case n.PrimitiveValue:return t||new pl(i,e);case n.CustomEntity:return t||new si(i,e);case n.PrimitiveEntity:return t||new ka(i,e);case n.FunctionDeclaration:return t||new li(i,e);case n.GlobalEvent:return t||new Ca(i,e);case n.DataType:return t||new Oa(i,e);case n.Property:return t||new oi(i,e);case n.FunctionCall:return t||new bi(i,e);case n.Condition:return t||new ui(i,e);case n.Operation:return t||new ci(i,e);case n.VariableDeclaration:return t||new pi(i,e);case n.VariableInstance:return t||new yi(i,e);case n.OutputMap:return t||new Ti(i,e);case n.ReturnDeclaration:return t||new $t(i,e);case n.ArgumentDeclaration:return t||new Ei(i,e);case n.InputMap:return t||new mi(i,e);case n.Project:return t||new Pi(i);case n.InstalledProject:return t||new fi(i,e);case n.ActionDescriptor:return t||new Nn(i,e);case n.ReturnStatement:return t||new Ri(i,e);case n.Loop:return t||new di(i,e);case n.Search:return t||new hi(i,e);case n.ValueDescriptor:return t||new Na(i,e);case n.BuiltInBaseEntity:return t||new Fn(i,e);case n.InternalCall:return t||new Ma(i,e);case n.ContinueStatement:return t||new Dt(i,e);case n.BreakStatement:return t||new _a(i,e);default:throw new Error("Invalid entity type: "+i.type)}}function R(i,e){if(!i)throw new Error("Entity is null");const t=qa(i,e);return t.subscribe(),t}class M8 extends Fn{constructor(t){super(Oe,t);l(this,"initialData");l(this,"id",M.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",M.PERSISTED_ENTITY);l(this,"description",Oe.description);l(this,"type",n.BuiltInBaseEntity);l(this,"abstract",Oe.abstract);l(this,"static",Oe.static);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=Oe,this.project=t,this.id=Oe.id,this.version=Oe.version,this.name=Oe.name,this.static=Oe.static,this.abstract=Oe.abstract,this.properties=this.initialData.properties.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(r=>R(r,this.project))}}class _8 extends Nn{constructor(t){super(wt,t);l(this,"id",Ie.Parallel);l(this,"name",Ie.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",wt);l(this,"type",n.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async()=>{});this.project=t,this.fixedArguments=wt.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=wt.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=wt.error?R(wt.error,this.project):null}}class N8 extends Nn{constructor(t){super(st,t);l(this,"id",st.id);l(this,"name",st.name);l(this,"description",st.description);l(this,"version",st.version);l(this,"autoexecutable",!1);l(this,"initialData",st);l(this,"type",n.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[0])=>{const r=t[0];return[new Promise(s=>{setTimeout(()=>{s()},r)})]});this.project=t,this.fixedArguments=st.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=st.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=st.error?R(st.error,this.project):null}}class V8 extends Nn{constructor(t){super(Wt,t);l(this,"id",Ie.Sequential);l(this,"name",Ie.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",Wt);l(this,"type",n.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[[]])=>[[]]);this.project=t,this.fixedArguments=Wt.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=Wt.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Wt.error?R(Wt.error,this.project):null}}const L8="test_primitive_entities_export";u.ActionDescriptorState=Nn,u.ActionDescriptorValuesType=V,u.AppendToListOperationInputIds=pd,u.AppendToListOperationOutputIds=yd,u.ArgumentDeclarationState=Ei,u.BUILT_IN_BASE_ENTITY_IDS=Me,u.BUILT_IN_ENTITY_TYPES=Di,u.BaseEntityNames=M,u.BaseValueDescriptorIds=ls,u.BreakStatementState=_a,u.BuiltInBaseEntityState=Fn,u.CALLABLE_TYPES=En,u.CALLER_TYPES=tn,u.COMPARISON_CONDITIONS=dh,u.CONDITIONS=Ev,u.CUSTOM_ENTITY_OPERATIONS=Au,u.ComparisonOperatorTypes=De,u.ConditionState=ui,u.ContinueStatementState=Dt,u.CreateNewInputIds=ru,u.CreateNewOutputIds=iu,u.CustomEntityState=si,u.DRAGGABLE_CALLABLE_TYPES=Ha,u.DRAGGABLE_CALLER_TYPES=Vl,u.DRAGGABLE_ELEMENT_TYPES=Ya,u.DRAGGABLE_EXECUTABLE_TYPES=Hb,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=Wa,u.DataTypeParentChildRelation=xe,u.DataTypeState=Oa,u.ENTITY_TYPES=Yb,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=it,u.ENTITY_WITH_NAMES_TYPES=Ll,u.ENTITY_WITH_VALUE_TYPES=Nl,u.ENTRY_POINT_TYPES=Fe,u.EVENT_TYPES=Un,u.EXECUTABLE_TYPES=Wb,u.EXECUTION_OPERATIONS=nu,u.EntityOperations=He,u.EntityType=n,u.ExecutionOperations=Ie,u.FunctionCallState=bi,u.FunctionDeclarationState=li,u.GLOBAL_EVENT_DECLARATIONS=Rv,u.GetLastInListOperationInputIds=Kc,u.GetLastInListOperationOutputIds=ed,u.GlobalEventNames=Jt,u.GlobalEventState=Ca,u.HTTPOperations=qe,u.HTTP_OPERATIONS=op,u.InputMapState=mi,u.InstalledProjectState=fi,u.InternalCallState=Ma,u.JoinListOperationInputIds=Tc,u.JoinListOperationOutputIds=Ec,u.JoinStringOperationInputIds=rc,u.JoinStringOperationOutputIds=ic,u.LIST_OPERATIONS=Sd,u.ListOperations=U,u.LoopState=di,u.LoopTypes=$e,u.NUMBER_OPERATIONS=nc,u.NumberAdditionOperationInputIds=kl,u.NumberAdditionOperationOutputIds=ql,u.NumberOperations=nt,u.OPERATION_DECLARATIONS=Zb,u.OperationState=ci,u.OutputMapParentChildRelation=_l,u.OutputMapState=Ti,u.PASS_THROUGH_CALLABLE_TYPES=Ge,u.ParallelExecutionOperation=_8,u.ParallelExecutionOperationInputIds=Ad,u.ParallelExecutionOperationOutputIds=Od,u.PersistedEntity=M8,u.PersistedEntityMethods=Et,u.PrimitiveEntityState=ka,u.PrimitiveTypes=g,u.ProjectState=Pi,u.PropertyState=oi,u.ReturnDeclarationState=$t,u.ReturnStatementState=Ri,u.STANDALONE_CONDITIONS=ih,u.STRING_OPERATIONS=mc,u.ScopeCompatibilityType=ja,u.SearchState=hi,u.SequentialExecutionOperation=V8,u.SequentialExecutionOperationInputIds=Jd,u.SequentialExecutionOperationOutputIds=Wd,u.SplitListOperationInputIds=Nc,u.SplitListOperationOutputIds=Vc,u.StandaloneOperatorTypes=St,u.StringOperations=be,u.TERMINATION_TYPES=Ne,u.USER_MANAGED_ENTITY_TYPES=zb,u.VALUE_READING_TYPES=Tn,u.VALUE_WRITING_TYPES=rt,u.VARIABLE_TYPES=_e,u.ValidationInputIds=yu,u.ValidationOutputIds=hu,u.ValueAutogenerationType=Le,u.ValueDescriptorParentChildRelation=A,u.ValueDescriptorState=Na,u.VariableDeclarationState=pi,u.VariableInstanceState=yi,u.WaitOperation=N8,u.WaitOperationInputIds=Gd,u.WaitOperationOutputIds=Fd,u.appendToListOperation=rs,u.appendToListOperationElementToAppendArgument=ns,u.appendToListOperationElementToAppendArgumentParentRef=vd,u.appendToListOperationElementToAppendArgumentRef=md,u.appendToListOperationError=Dd,u.appendToListOperationErrorParentRef=Pd,u.appendToListOperationListArgument=ts,u.appendToListOperationListArgumentParentRef=bd,u.appendToListOperationListArgumentRef=hd,u.appendToListOperationListDataType=fd,u.appendToListOperationResultListDataType=Rd,u.appendToListOperationResultListReturn=Id,u.appendToListOperationResultListReturnParentRef=gd,u.appendToListOperationResultListReturnRef=Ed,u.appendToListOperationSecondListDataType=Td,u.baseHttpRequestFunctionDeclaration=Ni,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=us,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=sp,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=ap,u.baseHttpRequestFunctionDeclarationRef=tp,u.baseHttpRequestFunctionDeclarationRefEight=rp,u.baseHttpRequestFunctionDeclarationRefFive=Ku,u.baseHttpRequestFunctionDeclarationRefFour=Qu,u.baseHttpRequestFunctionDeclarationRefNine=ip,u.baseHttpRequestFunctionDeclarationRefSeven=np,u.baseHttpRequestFunctionDeclarationRefSix=ep,u.baseHttpRequestFunctionDeclarationRefThree=Xu,u.baseHttpRequestFunctionDeclarationRefTwo=Zu,u.booleanPrototype=jn,u.checkIsBranchDependentButNotDirectlyOnBranch=vi,u.checkIsBranchDependentOnBranch=p8,u.checkIsCallableEntityReachable=Ml,u.checkIsCanvasEntity=O8,u.checkIsDetachedBranch=Gb,u.checkIsDetachedBranchShallow=Bl,u.checkIsGlobalVariable=S8,u.checkIsGloballyDeclared=Cl,u.checkIsMethod=Ub,u.checkIsNestedScope=Ua,u.checkScopeCompatibility=gi,u.createNewInstanceOperation=Tr,u.createNewInstanceOperationEntityToInstanciateArgument=lu,u.createNewInstanceOperationEntityToInstanciateArgumentRef=au,u.createNewInstanceOperationEntityToInstanciateDataType=su,u.createNewInstanceOperationError=pu,u.createNewInstanceOperationErrorParentRef=uu,u.createNewInstanceOperationOutputEntityDeclaration=du,u.createNewInstanceOperationOutputEntityDeclarationParentRef=cu,u.createNewInstanceOperationRef=ou,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=eh,u.cronJobBuiltInBaseEntityExpressionProperty=Ky,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=fv,u.cronJobBuiltInBaseEntityExpressionPropertyRef=Xy,u.cronJobBuiltInBaseEntityRef=Qy,u.cronJobTriggeredFunctionDeclarationBlueprint=Es,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=zy,u.customEntityToZodSchema=Ch,u.datePrototype=fr,u.deletePersistedEntityMethod=Ts,u.deletePersistedEntityMethodParentRef=Ay,u.endpointBuiltInBaseEntity=ms,u.endpointBuiltInBaseEntityRef=Cp,u.endpointBuiltInBaseEntityRefFour=Ty,u.endpointBuiltInBaseEntityRefThree=Gp,u.endpointBuiltInBaseEntityRefTwo=Np,u.endpointBuiltInCorsProperty=Bp,u.endpointBuiltInCorsPropertyDataType=Op,u.endpointBuiltInCorsPropertyDataTypeRef=Sp,u.endpointBuiltInCorsPropertyRef=Ap,u.endpointBuiltInMethodProperty=hs,u.endpointBuiltInMethodPropertyDataType=$p,u.endpointBuiltInMethodPropertyDataTypeRef=Vp,u.endpointBuiltInMethodPropertyRef=Lp,u.endpointBuiltInPathProperty=ys,u.endpointBuiltInPathPropertyDataType=_p,u.endpointBuiltInPathPropertyDataTypeRef=wp,u.endpointBuiltInPathPropertyRef=Mp,u.endpointPathParamsArgumentDeclaration=Kp,u.endpointPathParamsArgumentDeclarationRef=Yp,u.endpointPathParamsVariableDataType=zp,u.endpointPathParamsVariableDataTypeRef=Hp,u.endpointReachedTriggerActionDescriptor=fs,u.endpointReachedTriggerActionDescriptorRef=Zp,u.endpointReachedTriggerActionDescriptorRefFour=ny,u.endpointReachedTriggerActionDescriptorRefThree=ey,u.endpointReachedTriggerActionDescriptorRefTwo=Qp,u.endpointRequestBodyArgumentDeclaration=ry,u.endpointRequestBodyArgumentDeclarationRef=jp,u.endpointRequestBodyVariableDataType=kp,u.endpointRequestHeadersArgumentDeclaration=Xp,u.endpointRequestHeadersArgumentDeclarationRef=xp,u.endpointRequestHeadersVariableDataType=Up,u.endpointRequestHeadersVariableDataTypeRef=Fp,u.endpointRequestQueryParamsArgumentDeclaration=ty,u.endpointRequestQueryParamsArgumentDeclarationRef=Jp,u.endpointRequestQueryParamsVariableDataType=Wp,u.endpointRequestQueryParamsVariableDataTypeRef=qp,u.endpointResponseBodyDataType=hy,u.endpointResponseBodyReturnDeclaration=my,u.endpointResponseBodyReturnDeclarationRef=yy,u.endpointResponseCodeDataType=ay,u.endpointResponseCodeReturnDeclaration=oy,u.endpointResponseCodeReturnDeclarationRef=iy,u.endpointResponseHeadersDataType=dy,u.endpointResponseHeadersDataTypeRef=ly,u.endpointResponseHeadersReturnDeclaration=py,u.endpointResponseHeadersReturnDeclarationRef=cy,u.endpointReturnStatementRef=sy,u.endpointReturnStatementRefThree=fy,u.endpointReturnStatementRefTwo=uy,u.enumOptionsProperty=Ul,u.enumOptionsPropertyDataType=Fl,u.enumOptionsPropertyDataTypeRef=$l,u.enumOptionsPropertyRef=Gl,u.enumPrototype=Rn,u.enumPrototypeRef=xl,u.executionBuiltInEntity=bs,u.executionBuiltInEntityAbortMethod=Rs,u.executionBuiltInEntityAbortMethodParentRef=th,u.filterOutDuplicateEntities=S,u.findReferenceToSelfInList=Cb,u.findReferencesToSelfInProject=b8,u.flattenCalls=Ln,u.flattenCanvasAncestorsUntil=$a,u.flattenCustomEntityExtensionAndImplementationTypes=Nb,u.flattenCustomEntityExtensionTypes=xa,u.flattenCustomEntityExtensions=Al,u.flattenCustomEntityImplementations=Ol,u.flattenCustomEntityImplementionTypes=Fa,u.flattenDerivedCanvasEntities=Tt,u.flattenDetachedBranch=xb,u.flattenElementCalls=we,u.flattenProjectElements=Ob,u.flattenRelatedCanvasElementsOnTheLeft=_b,u.flattenRelatedCanvasElementsOnTheRight=Mb,u.flattenVariableReads=Ab,u.flattenVariableWrites=Sb,u.flattenVariables=Y,u.generate=kg,u.generateRandomBoolean=Zh,u.generateRandomDate=_h,u.generateRandomDateAfter=Bh,u.generateRandomDateBefore=wh,u.generateRandomDateBetweenRange=Mh,u.generateRandomNumber=Jh,u.generateRandomNumberAfter=jh,u.generateRandomNumberBefore=kh,u.generateRandomNumberBetweenRange=qh,u.generateRandomText=zh,u.generateRandomTextAfter=Wh,u.generateRandomTextBefore=Hh,u.generateRandomTextBetweenRange=Yh,u.generateUniqueUUID=Uh,u.getBaseBuiltInEntities=mn,u.getBuiltInEntityOwner=Gn,u.getCalls=gl,u.getCanvasEntitiesDerivedFromInternalCalls=wb,u.getCanvasEntitiesDerivedFromWrites=hr,u.getCanvasEntityDerivedFromValueReadingEntity=Sl,u.getChildrenEntityWithValues=h8,u.getCommonAncestor=vl,u.getCommonChildren=Eb,u.getDeepestScope=qb,u.getEntityArgumentDeclarations=Pl,u.getEntityInputMaps=Bb,u.getEntityOutputMaps=I8,u.getEntityReturnDeclarations=Dl,u.getExtendedBuiltInEntity=P8,u.getExtendedCustomEntity=Lb,u.getHeadIfPartOfDetachedBranch=Fb,u.getHighestScope=kb,u.getImplementedBuiltInEntity=D8,u.getIsInteractive=$b,u.getLastInListOperation=ud,u.getLastInListOperationError=dd,u.getLastInListOperationErrorParentRef=cd,u.getLastInListOperationInputListArgument=sd,u.getLastInListOperationInputListArgumentParentRef=ad,u.getLastInListOperationInputListArgumentRef=td,u.getLastInListOperationInputListDataType=nd,u.getLastInListOperationOutputElementDataType=id,u.getLastInListOperationOutputElementReturn=ld,u.getLastInListOperationOutputElementReturnParentRef=od,u.getLastInListOperationOutputElementReturnRef=rd,u.getLinkedEntitiesFromArgumentDeclaration=R8,u.getLowestPersistedEntityImplementation=Vb,u.getParentCanvasEntities=Ct,u.getParentCanvasEntity=ke,u.getParentEntryPoint=y8,u.getPrototypeByType=jb,u.getRelatedCanvasElementsOnTheLeft=$n,u.getRelatedCanvasElementsOnTheRight=fn,u.getRootEntryPointScopeOwner=wl,u.getScopeOwner=ut,u.getUsedArgFromDeclaration=v8,u.getUsedReturnFromDeclaration=g8,u.getVariableFromInputMapping=bb,u.getVariableFromReturnVariablePointer=Ib,u.getVariablesFromArgumentDeclarations=Ga,u.getVariablesFromInputMaps=vb,u.getVariablesFromOutputMapping=Pb,u.getVariablesFromOutputMaps=Db,u.getVariablesFromReturnDeclarations=gb,u.getWrites=Il,u.groupCallsBasedOnParallelizableExecution=m8,u.httpRequestBodyArgument=Mi,u.httpRequestBodyArgumentRef=xu,u.httpRequestBodyDataType=Uu,u.httpRequestHeadersArgument=wi,u.httpRequestHeadersArgumentRef=Gu,u.httpRequestHeadersDataType=Fu,u.httpRequestMethodArgument=Ci,u.httpRequestMethodArgumentRef=Lu,u.httpRequestMethodDataType=$u,u.httpRequestMethodDataTypeRef=Nu,u.httpRequestQueryParamsArgument=cs,u.httpRequestQueryParamsArgumentRef=Mu,u.httpRequestQueryParamsDataType=_u,u.httpRequestVariableURLArgument=Bi,u.httpRequestVariableURLArgumentRef=Bu,u.httpRequestVariableURLDataType=wu,u.httpRequestVariableURLDataTypeRef=Ou,u.httpResponseBodyReturnDataType=zu,u.httpResponseBodyReturnDataTypeRef=Hu,u.httpResponseBodyReturnReturn=Er,u.httpResponseBodyReturnReturnRef=Yu,u.httpResponseCodeDataType=ku,u.httpResponseCodeReturn=ds,u.httpResponseCodeReturnRef=ju,u.httpResponseHeadersDataType=Wu,u.httpResponseHeadersDataTypeRef=qu,u.httpResponseHeadersReturn=_i,u.httpResponseHeadersReturnRef=Ju,u.iterateOverListActionDescriptor=qn,u.iterateOverListActionDescriptorListArgumentDeclaration=hp,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=pp,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=up,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=yp,u.iterateOverListActionDescriptorReturnDeclaration=dp,u.iterateOverListActionDescriptorReturnDeclarationParentRef=cp,u.joinListOperation=_c,u.joinListOperationError=Mc,u.joinListOperationErrorParentRef=wc,u.joinListOperationFirstListArgument=Sc,u.joinListOperationFirstListArgumentParentRef=Dc,u.joinListOperationFirstListArgumentRef=Rc,u.joinListOperationFirstListDataType=bc,u.joinListOperationResultListDataType=Pc,u.joinListOperationResultListReturn=Bc,u.joinListOperationResultListReturnParentRef=Cc,u.joinListOperationResultListReturnRef=Ic,u.joinListOperationSecondListArgument=Oc,u.joinListOperationSecondListArgumentParentRef=Ac,u.joinListOperationSecondListArgumentRef=vc,u.joinListOperationSecondListDataType=gc,u.joinStringOperation=Oi,u.joinStringOperationError=fc,u.joinStringOperationErrorParentRef=hc,u.joinStringOperationFirstStringArgument=Si,u.joinStringOperationFirstStringArgumentParentRef=uc,u.joinStringOperationFirstStringArgumentRef=ac,u.joinStringOperationFirstStringDataType=sc,u.joinStringOperationResultStringDataType=dc,u.joinStringOperationResultStringReturn=mr,u.joinStringOperationResultStringReturnParentRef=yc,u.joinStringOperationResultStringReturnRef=cc,u.joinStringOperationSecondStringArgument=Ai,u.joinStringOperationSecondStringArgumentParentRef=pc,u.joinStringOperationSecondStringArgumentRef=oc,u.joinStringOperationSecondStringDataType=lc,u.jsonPrototype=jl,u.keyValueParamBuiltInBaseEntity=ps,u.keyValueParamBuiltInBaseEntityNameProperty=gp,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=Qb,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=vp,u.keyValueParamBuiltInBaseEntityNamePropertyRef=bp,u.keyValueParamBuiltInBaseEntityValueProperty=Dp,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=ev,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=Pp,u.keyValueParamBuiltInBaseEntityValuePropertyRef=Ip,u.manualFlowActionDescriptor=Rp,u.manualFlowActionDescriptorDeclarationReturnDeclaration=Ep,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=mp,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=fp,u.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=Tp,u.mapActionDescriptorToTypeItRepresents=C8,u.mergeListOfEntities=A8,u.methodDefaultValue=Vu,u.mockClientProject=E$,u.moreThanOrEqualCondition=vr,u.moreThanOrEqualConditionLeftHandArgument=oh,u.moreThanOrEqualConditionLeftHandArgumentParentRef=sh,u.moreThanOrEqualConditionRightHandArgument=ch,u.moreThanOrEqualConditionRightHandArgumentParentRef=lh,u.notEmptyCondition=Wn,u.notEmptyConditionArgument=rh,u.notEmptyConditionRef=nh,u.numberAdditionOperation=Ka,u.numberAdditionOperationError=tc,u.numberAdditionOperationErrorParentRef=ec,u.numberAdditionOperationFirstNumberArgument=Za,u.numberAdditionOperationFirstNumberArgumentRef=Jl,u.numberAdditionOperationFirstNumberDataType=Wl,u.numberAdditionOperationRef=Xl,u.numberAdditionOperationRefThree=Kl,u.numberAdditionOperationRefTwo=Ql,u.numberAdditionOperationResultNumberDataType=Zl,u.numberAdditionOperationResultNumberReturn=Qa,u.numberAdditionOperationResultNumberReturnRef=zl,u.numberAdditionOperationSecondNumberArgument=Xa,u.numberAdditionOperationSecondNumberArgumentRef=Hl,u.numberAdditionOperationSecondNumberDataType=Yl,u.numberPrototype=Ce,u.parallelExecutionOperation=wt,u.parallelExecutionOperationError=$d,u.parallelExecutionOperationErrorParentRef=Ld,u.parallelExecutionOperationListOfExecutionResultsDataType=_d,u.parallelExecutionOperationListOfExecutionResultsReturn=as,u.parallelExecutionOperationListOfExecutionResultsReturnRef=Md,u.parallelExecutionOperationListOfFunctionsArgument=is,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=wd,u.parallelExecutionOperationListOfFunctionsArgumentRef=Bd,u.parallelExecutionOperationListOfFunctionsBlueprint=Cd,u.parallelExecutionOperationRef=Nd,u.parallelExecutionOperationRefThree=Vd,u.persistedBuiltInBaseEntity=Oe,u.persistedBuiltInBaseEntityCreatedAtProperty=qy,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=jy,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=yv,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=ky,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=Uy,u.persistedBuiltInBaseEntityDatabaseProperty=br,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=cv,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=My,u.persistedBuiltInBaseEntityDatabasePropertyRef=wy,u.persistedBuiltInBaseEntityDeletedAtProperty=xy,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Gy,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=pv,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Fy,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=$y,u.persistedBuiltInBaseEntityIdentifierProperty=Ly,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=_y,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Vy,u.persistedBuiltInBaseEntityIdentifierPropertyRef=Ny,u.persistedBuiltInBaseEntityUpdatedAtProperty=Yy,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=Wy,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=hv,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Hy,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Jy,u.processOutputGlobalValueDescriptorDataType=ph,u.processOutputGlobalValueDescriptorReturn=yh,u.processOutputGlobalValueDescriptorReturnRef=uh,u.projectPublicationCompletedGlobalEvent=vs,u.propertyToZodSchema=Oh,u.relationalDatabaseBuiltInBaseEntity=vn,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=Sy,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=Py,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=Dy,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Li,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=Ey,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=Ry,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Fi,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=gy,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=Iy,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=Gi,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=av,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=vy,u.relationalDatabaseBuiltInBaseEntityRef=Jn,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=$i,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=rv,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=by,u.resolveFirstCallsSecond=T8,u.resolveFirstWritesSecond=E8,u.sequentialExecutionOperation=Wt,u.sequentialExecutionOperationError=tu,u.sequentialExecutionOperationErrorParentRef=eu,u.sequentialExecutionOperationListOfExecutionResultsDataType=Xd,u.sequentialExecutionOperationListOfExecutionResultsReturn=os,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Kd,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=Zd,u.sequentialExecutionOperationListOfFunctionsArgument=ss,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=zd,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Qd,u.sequentialExecutionOperationListOfFunctionsArgumentRef=Yd,u.sequentialExecutionOperationListOfFunctionsBlueprint=Hd,u.softDeletePersistedEntityMethod=Cy,u.softDeletePersistedEntityMethodParentRef=Oy,u.sortCallsBasedOnExecutionDependencies=Rb,u.sortChildrenEntitiesBasedOnExecutionDependencies=f8,u.splitListOperation=Qc,u.splitListOperationError=Xc,u.splitListOperationErrorParentRef=Zc,u.splitListOperationFirstOutputListDataType=xc,u.splitListOperationFirstOutputListReturn=Wc,u.splitListOperationFirstOutputListReturnParentRef=Jc,u.splitListOperationFirstOutputListReturnRef=es,u.splitListOperationInputListArgument=jc,u.splitListOperationInputListArgumentParentRef=Uc,u.splitListOperationInputListArgumentRef=Lc,u.splitListOperationInputListDataType=$c,u.splitListOperationSecondOutputListDataType=Hc,u.splitListOperationSecondOutputListReturn=zc,u.splitListOperationSecondOutputListReturnParentRef=Yc,u.splitListOperationSplitIndexArgument=qc,u.splitListOperationSplitIndexArgumentParentRef=kc,u.splitListOperationSplitIndexArgumentRef=Gc,u.splitListOperationSplitIndexDataType=Fc,u.stringPrototype=G,u.test_primitive_entities_export=L8,u.toEntityState=Bt,u.untypedObjectPrototype=at,u.updateValueReader=Ii,u.urlDefaultValue=Cu,u.uuidPrototype=za,u.validateDataOperation=kn,u.validateDataOperationDataToValidateArgument=Eu,u.validateDataOperationDataToValidateArgumentParentRef=Tu,u.validateDataOperationDataToValidateArgumentRef=fu,u.validateDataOperationDataToValidateDataType=mu,u.validateDataOperationEntityToMatchTypeArgument=gu,u.validateDataOperationEntityToMatchTypeArgumentParentRef=vu,u.validateDataOperationEntityToMatchTypeArgumentRef=Ru,u.validateDataOperationEntityToMatchTypeDataType=bu,u.validateDataOperationError=Su,u.validateDataOperationErrorParentRef=Du,u.validateDataOperationOutputEntityDeclaration=Pu,u.validateDataOperationOutputEntityDeclarationParentRef=Iu,u.waitOperation=st,u.waitOperationMillisecondsNumberArgument=bn,u.waitOperationMillisecondsNumberArgumentRef=xd,u.waitOperationMillisecondsNumberDataType=Ud,u.waitOperationOperationError=qd,u.waitOperationOperationErrorParentRef=kd,u.waitOperationRef=jd,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
299
+ 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}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addFunctionCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.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(i=>i.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.push(e),this}addSuccessCall(e){return 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 i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,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(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===r.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=D(this.initialData.declaration),t=this.project.get(e);this.declaration=t}return this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initOutputs(),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this}initOutputs(){const e=[];this.outputs=this.initialData.outputs.map(s=>{const o=R(s,this.project);return e.push(o.index),o.setParent(this),o.initChildren(),o});const i=Fl(this).filter(s=>!this.outputs.find(o=>o.declaration.id===s.id));i.sort((s,o)=>s.index-o.index);const a=i.map((s,o)=>{const d=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:L.uuid(),type:r.OutputMap,version:1,declaration:s,index:d,parent:this,writesValues:[]},y=R(p,this.project);return y.setParent(this),y.initChildren(),y});return this.outputs.push(...a),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(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],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:d}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}if(this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.outputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.error){const{affected:o,removed:d}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(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:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.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(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.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(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=C8(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){return new Re(this.toJSON(),this.project)}};l(Re,"MUTABLE_BASE_PROPERTIES",[]),l(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"MUTABLE_META_PROPERTIES",["x","y"]),l(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),l(Re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(Re,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),l(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),l(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let vi=Re;function Ja(n,e){const t=Gn(n);if(t.length===0)return{list:[],last:null};let i=null;return{list:t.flatMap(s=>{if(s===e)return i=s,[s];const o=Ja(s,e);return o.last&&(i=o.last),[s,...o.list]}),last:i}}function Yb(n,e,t=new Set){const i=fn(n),a=fn(e),s=i.filter(p=>!a.includes(p)),o=i.filter(p=>a.includes(p)),d=s.reduce((p,y)=>t.has(y.id)?p:(t.add(y.id),S([...p,...Yb(y,e,t)])),[]);return S([...o,...d])}function gi(n,e){const t=Ja(n,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function B8(n,e){return!!Ja(n,e).last}function w8(n){if(Fe.includes(n.type))return n;if([...En,r.VariableDeclaration].includes(n.type)){const e=n.parent;return Fe.includes(e.type)?e:null}return null}function Vl(n,e){if(!n||!e)throw new Error("Both entities must be defined to find a common ancestor");if(n===e)return n;const t=n.parent;if(t){if(t===e)return e;if(t.type===r.Project)return null}else return null;const i=e.parent;if(i){if(i===n)return n;if(i.type===r.Project)return null}else return null;return Vl(t,i)}function ke(n){if(ns.includes(n.type)){if(n.type===r.FunctionDeclaration){const e=n.parent;if(e.type===r.CustomEntity)return e}return n}else{const e=n.parent;return e?ke(e):null}}function M8(n){return n.type===r.VariableDeclaration?[n]:Ge.includes(n.type)?[...n.inputs,...n.outputs||[]]:n.type===r.ReturnStatement?n.outputs:jn.includes(n.type)||n.type===r.FunctionDeclaration?n.inputs:[]}function _8(n){const e=fn(n),t=[],i=[];zl.includes(n.type)&&t.push(...Ll(n));const a=e.filter(s=>{const o=t.includes(s);return o?!1:En.includes(s.type)&&!o?(i.push(s),!1):!0});return t.sort((s,o)=>gi(o,s)?-1:0),i.sort((s,o)=>gi(o,s)?-1:0),[...t,...i,...a]}function zb(n){return[...n].sort((e,t)=>gi(t,e)?-1:0)}function N8(n){const e=zb(n),t=[];return e.forEach(i=>{const a=t[t.length-1];if(a){const s=a[a.length-1];gi(i,s)?t.push([i]):a.push(i)}else t.push([i])}),t}function Bt(n){const e=n.map(t=>ke(t));return S(e)}function Ll(n){return Ge.includes(n.type)?[...Bt(n.successCalls),...Bt(n.errorCalls)]:Fe.includes(n.type)?Bt(n.calls):[]}function V8(n,e){return Ll(n).includes(e)}function $l(n){return n.writesValues||[]}function L8(n,e){return $l(n).includes(e)}function Zb(n){var e;return _e.includes((e=n==null?void 0:n.readsValue)==null?void 0:e.type)?n.readsValue:null}function $8(n){return n.writesValues}function Xb(n=[]){return n.map(Zb).filter(e=>!!e)}function Wa(n=[]){return n.map(e=>e.writesValues).flat().filter(e=>_e.includes(e.type))}function Qb(n=[]){return n.map(e=>e.readsValue).filter(e=>!!e&&_e.includes(e.type))}function Kb(n){return _e.includes(n.type)?n:null}function ev(n){return n.writesValues.map(Kb).filter(e=>!!e)}function tv(n=[]){return n.reduce((e,t)=>t.type===r.OutputMap?[...e,...ev(t)]:e,[])}function we(n){return Ge.includes(n.type)?[...$n(Bt(n.successCalls)),...$n(Bt(n.errorCalls))]:Fe.includes(n.type)?$n(Bt(n.calls)):[]}function nv(n,e=new Set){return n.writesValues.filter(i=>_e.includes(i.type)&&!e.has(i.id)).reduce((i,a)=>e.has(a.id)?i:[...i,...Y(a,e)],[])}function rv(n,e=new Set){var i;return(((i=n.readsValue)==null?void 0:i.writesValues)||[]).filter(a=>_e.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...Y(s,e)],[])}function Y(n,e=new Set){if(e.has(n.id))return[];if(n.type===r.ReturnStatement)return Qb(n.outputs).reduce((i,a)=>[...i,...Y(a,e)],[]);if(n.type===r.FunctionCall||n.type===r.Operation||n.type===r.Condition)return[...we(n).reduce((s,o)=>{const d=ke(o);return[...s,...Y(d||o,e)]},[]),...Xb(n.inputs),...tv(n.outputs)].reduce((s,o)=>[...s,...Y(o,e)],[]);if(jn.includes(n.type)){const t=Wa(n.inputs),a=we(n).reduce((s,o)=>{const d=ke(o);return[...s,...Y(d||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Y(o,e)],[])}if(n.type===r.FunctionDeclaration){const t=[...Wa(n.inputs)],a=we(n).reduce((s,o)=>{const d=ke(o);return[...s,...Y(d||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Y(o)],[])}if(_e.includes(n.type)){e.add(n.id);const i=we(n).reduce((a,s)=>{const o=ke(s);return[...a,...Y(o||s,e)]},[]);return[n,...i,...rv(n,e),...nv(n,e)]}return[]}function Tt(n,e=new Set){return e.has(n.id)?[]:(e.add(n.id),[...fn(n).reduce((a,s)=>[...a,s,...Tt(s,e)],[])])}function $n(n){return n.reduce((e,t)=>t.type===r.ReturnStatement||t.type===r.ContinueStatement||t.type===r.BreakStatement?e:[...e,t,...we(t)],[])}function iv(n){const e=n.entities||[],t=[...e,...n.functions||[],...n.events||[],...n.projects||[]],i=e.reduce((p,y)=>[...p,...y.properties],[]),a=e.reduce((p,y)=>[...p,...y.methods],[]),s=a.reduce((p,y)=>[...p,...Wa(y.inputs),...$n(Bt(y.calls)),...y.returnStatements],[]),o=n.functions.reduce((p,y)=>[...p,...$n(Bt(y.calls)),...y.returnStatements],[]),d=n.events.reduce((p,y)=>[...p,...$n(Bt(y.calls)),...y.returnStatements],[]);return[...t,...i,...a,...s,...o,...d]}function av(n,e){return e.filter(i=>{if(!i)return!1;switch(i.type){case r.FunctionCall:return i.inputs.find(a=>a.id===n.id)!==void 0||i.outputs.find(a=>a.id===n.id)!==void 0;case r.Condition:return i.successCalls.find(a=>a.id===n.id)!==void 0||i.errorCalls.find(a=>a.id===n.id)!==void 0||i.inputs.find(a=>a.id===n.id)!==void 0;case r.Operation:return i.outputs.find(a=>a.id===n.id)!==void 0;case r.VariableDeclaration:return Ge.includes(n.type)?sv(n).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===i.id})!==void 0:!1;case r.CustomEntity:return i.properties.find(a=>a.id===n.id)!==void 0||i.methods.find(a=>a.id===n.id)!==void 0;case r.FunctionDeclaration:return i.inputs.find(a=>a.id===n.id)!==void 0||(i.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===n.id)!==void 0;default:return!1}})}function G8(n){const e=iv(n.project);return av(n,e)}function Gn(n){const e=[];if(En.includes(n.type)){n.calledBy.forEach(a=>{const s=ke(a);s&&e.push(s)});const i=[...n.inputs||[],...n.outputs||[]].map(a=>xl(a)).filter(a=>a!==null);e.push(...S(i))}if(_e.includes(n.type)){const t=xl(n);t&&e.push(t)}return S(e)}function Gl(n){return n.type===r.FunctionCall||n.type===r.InternalCall?n.declaration.inputs:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedArguments:n.type===r.FunctionDeclaration||jn.includes(n.type)?n.inputs:n.type===r.Search?n.inputsDeclarations:[]}function F8(n,e){return e.type===r.Condition?e.inputs.find(t=>t.declaration.id===n.id):e.type===r.FunctionCall||e.type===r.Operation?e.inputs.find(t=>t.declaration.id===n.id):null}function sv(n){return Ge.includes(n.type)?n.inputs:[]}function Fl(n){var e;return n.type===r.FunctionCall?((e=n.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedReturns:n.type===r.Search?n.outputsDeclarations:Ne.includes(n.type)?n.outputs:[]}function x8(n,e){return e.type===r.Condition?null:e.type===r.FunctionCall||e.type===r.Operation?e.outputs.find(t=>t.declaration.id===n.id):null}function U8(n){return n.type===r.Condition?[]:Ge.includes(n.type)?n.outputs:[]}function xl(n){const e=n.readsValue;return e?ke(e):null}function ov(n){const e=n.internalCalls||[];return S(Bt(S(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function fr(n){const e=$l(n),t=[];return e.forEach(i=>{if(_e.includes(i.type))t.push(i);else if(i.type===r.InputMap){const a=i.parent;if(a.type===r.InputMap){const s=a.parent;t.push(s)}else t.push(a)}else[r.ActionDescriptor].includes(i.parent.type)||t.push(i.parent)}),t}function S(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function fn(n,e=!1){const t=[];if(n.type===r.Project&&t.push(...(n==null?void 0:n.entities)||[],...(n==null?void 0:n.functions)||[],...(n==null?void 0:n.variableDeclarations)||[],...(n==null?void 0:n.variableInstances)||[],...(n==null?void 0:n.searches)||[],...(n==null?void 0:n.loops)||[],...(n==null?void 0:n.operations)||[],...(n==null?void 0:n.conditions)||[],...(n==null?void 0:n.functionCalls)||[],...(n==null?void 0:n.events)||[],...(n==null?void 0:n.projects)||[]),it.includes(n.type)&&t.push(...(n==null?void 0:n.detachedChildren)||[]),n.type===r.CustomEntity){const i=[...n.suggestedMethods,...n.methods].flatMap(a=>a.collapsed&&e?[]:fn(a));t.push(...i)}if(n.type===r.Condition){const i=n.successCalls.map(s=>ke(s)),a=n.errorCalls.map(s=>ke(s));t.push(...i,...a)}if(jn.includes(n.type)){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>fr(s)).flat(),a=n.calls.map(s=>ke(s));t.push(...S(i),...a)}if(Ge.includes(n.type)&&n.type!==r.Condition){const i=n==null?void 0:n.outputs.map(o=>fr(o)).flat(),a=n.successCalls.map(o=>ke(o)),s=n.errorCalls.map(o=>ke(o));t.push(...S(i),...a,...s)}if(_e.includes(n.type)){const i=fr(n),a=ov(n);t.push(...i,...a)}if(n.type===r.Loop){const i=n.outputs.map(o=>fr(o)).flat();if(n.body){const o=fn(n.body,e);t.push(...o)}const a=n.errorCalls.map(o=>ke(o)),s=n.successCalls.map(o=>ke(o));t.push(...S(i),...s,...a)}if(n.type===r.FunctionDeclaration){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>fr(s)).flat(),a=n.calls.map(s=>ke(s));t.push(...S(i),...a)}return S(t)}function lv(n,e=!1){const t=fn(n,e),i=[...t,...t.reduce((a,s)=>[...a,...lv(s,e)],[])];return S(i)}function cv(n){const e=Gn(n),t=[...e,...e.reduce((i,a)=>[...i,...cv(a)],[])];return S(t)}function Ha(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...Ha(t),...Ya(t)]:[...e,t.name],[])}function Ya(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...Ya(t),...Ha(t)]:[...e,t.name],[])}function Ul(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...Ul(t),...jl(t)]:[...e,t],[])}function jl(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...jl(t),...Ul(t)]:[...e,t],[])}function dv(n){return[...Ya(n),...Ha(n)].filter((t,i,a)=>a.indexOf(t)===i)}function uv(n){return n.implements.length===0&&n.extends.length===0?null:n.implements.find(i=>i.type===r.BuiltInBaseEntity&&i.name===w.PERSISTED_ENTITY)?n:[...n.implements,...n.extends].reduce((i,a)=>{if(a.type===r.CustomEntity){const s=uv(a);if(s)return s}return i},null)}function j8(n){const e=n.extends.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function k8(n){const e=n.implements.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function pv(n){const e=n.extends.find(t=>t.type===r.CustomEntity);return e&&e.type===r.CustomEntity?e:null}function mn(n){const e=[...n.implements,...n.extends].reduce((t,i)=>i.type===r.BuiltInBaseEntity?[...t,i]:i.type===r.CustomEntity?[...t,...mn(i)]:t,[]);return S(e)}function yv(n){return n.type===r.PrimitiveEntity?!0:n.type===r.BuiltInBaseEntity?n.interactive:!mn(n).find(i=>!i.interactive)}function q8(n){return n.parent===n.project&&n.project.variableDeclarations.includes(n)}function kl(n){return n.parent!==n.project?!1:r.VariableDeclaration===n.type?n.project.variableDeclarations.includes(n):r.VariableInstance===n.type?n.project.variableInstances.includes(n):r.FunctionCall===n.type?n.project.functionCalls.includes(n):r.Condition===n.type?n.project.conditions.includes(n):r.Operation===n.type?n.project.operations.includes(n):r.Loop===n.type?n.project.loops.includes(n):r.Search===n.type?n.project.searches.includes(n):!1}function hv(n){if([...Fe,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||kl(n))return!1;const e=Gn(n);return e.length===0?!0:e.some(t=>hv(t))}function ql(n){return[...Fe,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||kl(n)?!1:Gn(n).length===0}function fv(n,e=0){if(ql(n)){const t=Gn(n);return t.length===0?n:t.map(a=>fv(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function mv(n){const e=[];if(ql(n))e.push(n);else return[];return Gn(n).forEach(i=>{e.push(...mv(i))}),e}function Tv(n){return n.type===r.FunctionDeclaration&&n.parent!==n.project&&!![r.CustomEntity,r.Loop,r.InstalledProject].includes(n.parent.type)}function Ev(n,e){const t=new Map;return n.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function Rv(n){switch(n){case r.CustomEntity:return oi;case r.FunctionDeclaration:return ci;case r.VariableDeclaration:return yi;case r.VariableInstance:return hi;case r.FunctionCall:return vi;case r.Operation:return di;case r.Condition:return pi;case r.ReturnStatement:return bi;case r.Loop:return ui;case r.Search:return fi;case r.InputMap:return Ti;case r.OutputMap:return Ei;case r.ArgumentDeclaration:return Ri;case r.ReturnDeclaration:return $t;case r.Property:return li;case r.InstalledProject:return mi;case r.Project:return Di;case r.BuiltInBaseEntity:return xn;default:return null}}function ut(n,e){if(it.includes(n.type))return n;if(Si.includes(n.type))return null;const t=n.parent;if(!t)return null;if(t.type===r.GenericReference){const i=D(t);if(!i)return null;const a=e.get(i);return a?ut(a,e):null}else return t===e?e:ut(t,e)}function Jl(n,e){if(Si.includes(n.type)||e.getAllBuiltInIds().includes(n.id))return null;const i=wt(n.parent,e);return i?i===e?it.includes(n.type)?n:null:i.type===r.CustomEntity?n:Jl(i,e):null}function za(n,e,t){if(n===e||e===t||n===t)return!1;const i=ut(e.parent,t);return i===n?!0:za(i,e,t)}var Za=(n=>(n.SameBothLocal="same-both-local",n.AInB="a-in-b",n.BInA="b-in-a",n.ParallelInCommonParent="parallel-in-common-parent",n.ParallelInProject="parallel-in-project",n.AIsGlobalBIsNot="a-is-global-b-is-not",n.BIsGlobalAIsNot="b-is-global-a-is-not",n.SameBothGlobal="same-both-global",n))(Za||{});function Ii(n,e,t){const i=ut(n,t),a=ut(e,t);if(!i)throw new Error("Could not find scope owner for the entity: "+n.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(i===a&&i.type!==r.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:i};if(i===a&&i.type===r.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:i};if(i.type===r.Project&&a.type!==r.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:i};if(i.type!==r.Project&&a.type===r.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(za(i,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:i};if(za(a,i,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const d=Vl(i,a);return d===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:d}:d?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:ut(d,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function bv(n,e,t){const i=Ii(n,e,t);if(!i.compatible||i.type!=="same-both-local")return null;if(n===e)return n;let a=ut(n.parent,t);if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;for(;a;){if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;a=ut(a.parent,t)}let s=ut(e.parent,t);if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;for(;s;){if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;s=ut(s.parent,t)}return null}function vv(n){return n.length===0?null:n.length===1?n[0]:n.reduce((t,i)=>{const a=bv(t,i,i.project);return!a||a===i?t:i},n[0])}function wt(n,e){let t;return typeof n=="string"?t=n:n.type===r.GenericReference?t=D(n):t=n.id,t===e.id?e:e.get(t)}function Fn(n){if(Si.includes(n.type))return n;if(n.type===r.Project)return null;if(n.project.getAllBuiltInIds().includes(n.id))return n;const t=n.parent;return!t||t.type===r.Project?null:Fn(t)}function Pi(n,e){var t;if(n.readsValue){const i=wt(n.readsValue,e.project);e.setValueWriter(i),i.addValueReader(e)}else n.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function Wl(n){const e=[];function t(o,d){return e.some(p=>p.blockedByCaller===o&&p.blockedByCalling===d)}function i(o,d){t(o,d)||e.push({blockedByCaller:o,blockedByCalling:d})}const a=Jl(n,n.project);return n.calledBy.forEach(o=>{if([...o.calls||[],...o.successCalls||[],...o.errorCalls||[]].forEach(y=>{Ne.includes(y.type)&&i(o,y)}),o===a)return;let p;if(Ge.includes(o.type))p=o;else if(o.type===r.FunctionDeclaration){const y=ke(o);if(y.type===r.CustomEntity)return;y.type===r.Loop&&(p=y)}if(p){const y=Wl(p);y.reachable||(Ne.includes(n.type)?y.blocks.forEach(f=>{i(o,f.blockedByCalling)}):we(n).find(b=>b===o)||y.blocks.forEach(b=>{i(o,b.blockedByCalling)}))}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function J8(n){return ns.includes(n.type)?n.type===r.FunctionDeclaration?!Tv(n):!0:!1}function W8(n){if(r.ActionDescriptor===n.type){if(n.project.operationDeclarations.find(s=>s.id===n.id))return r.Operation;if(n.project.globalEventActionDescriptors.find(s=>s.id===n.id))return r.GlobalEvent;if(n.project.loopDeclarations.find(s=>s.id===n.id))return r.Loop;if(n.project.conditionDeclarations.find(s=>s.id===n.id))return r.Condition}return n.type}const ue=class ue{constructor(e){l(this,"initialData");l(this,"id");l(this,"version");l(this,"type",r.Project);l(this,"name",null);l(this,"description",null);l(this,"x");l(this,"y");l(this,"entities",[]);l(this,"projects",[]);l(this,"functions",[]);l(this,"events",[]);l(this,"variableDeclarations",[]);l(this,"variableInstances",[]);l(this,"conditions",[]);l(this,"operations",[]);l(this,"functionCalls",[]);l(this,"loops",[]);l(this,"searches",[]);l(this,"primitives",[]);l(this,"builtInBaseEntities",[]);l(this,"operationDeclarations",[]);l(this,"globalEventActionDescriptors",[]);l(this,"loopDeclarations",[]);l(this,"conditionDeclarations",[]);l(this,"valueDescriptors",[]);l(this,"dataTypes",[]);l(this,"project");l(this,"instances",{});l(this,"builtInInstances",{});l(this,"errors",[]);l(this,"references",[]);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}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Ae(i)),{errors:a,modifiedData:i}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async i=>{await t.init(this),i(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return 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.entities=this.initialData.entities.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.projects=this.initialData.projects.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functions=this.initialData.functions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableDeclarations=this.initialData.variableDeclarations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableInstances=this.initialData.variableInstances.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.conditions=this.initialData.conditions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.operations=this.initialData.operations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functionCalls=this.initialData.functionCalls.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.loops=this.initialData.loops.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.searches=this.initialData.searches.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.attachOrphanReferences(),this.validate(),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(){return this}async create(){return this}async update(e){return this}async delete(){return 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(i=>i.toFlat(e)),...this.functions.flatMap(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e)),...this.projects.flatMap(i=>i.toFlat(e)),...this.variableDeclarations.flatMap(i=>i.toFlat(e)),...this.variableInstances.flatMap(i=>i.toFlat(e)),...this.conditions.flatMap(i=>i.toFlat(e)),...this.operations.flatMap(i=>i.toFlat(e)),...this.functionCalls.flatMap(i=>i.toFlat(e)),...this.loops.flatMap(i=>i.toFlat(e)),...this.searches.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toReference()),functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),projects:this.projects.map(e=>e.toReference()),variableDeclarations:this.variableDeclarations.map(e=>e.toReference()),variableInstances:this.variableInstances.map(e=>e.toReference()),conditions:this.conditions.map(e=>e.toReference()),operations:this.operations.map(e=>e.toReference()),functionCalls:this.functionCalls.map(e=>e.toReference()),loops:this.loops.map(e=>e.toReference()),searches:this.searches.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatJSON(e)),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.toFlatJSON(e)),...this.projects.flatMap(i=>i.toFlatJSON(e)),...this.variableDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.variableInstances.flatMap(i=>i.toFlatJSON(e)),...this.conditions.flatMap(i=>i.toFlatJSON(e)),...this.operations.flatMap(i=>i.toFlatJSON(e)),...this.functionCalls.flatMap(i=>i.toFlatJSON(e)),...this.loops.flatMap(i=>i.toFlatJSON(e)),...this.searches.flatMap(i=>i.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(i=>i.toFlatGenerationTarget(e)),...this.functions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e)),...this.projects.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(i=>i.toFlatGenerationTarget(e)),...this.conditions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.operations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.loops.flatMap(i=>i.toFlatGenerationTarget(e)),...this.searches.flatMap(i=>i.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=OU(),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 new ue(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(i=>i.id===e.id);if(t>-1){const i=this.entities[t];return this.entities.splice(t,1),i}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(i=>i.id===e.id);if(t>-1){const i=this.functions[t];return this.functions.splice(t,1),i}return null}removeExternalProject(e){const t=this.projects.findIndex(i=>i.id===e.id);if(t>-1){const i=this.projects[t];return this.projects.splice(t,1),i}return null}removeGlobalEvent(e){const t=this.events.findIndex(i=>i.id===e.id);if(t>-1){const i=this.events[t];return this.events.splice(t,1),i}return null}removeTopLevelVariableDeclaration(e){if(e.type!==r.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(i=>i.id===e.id);if(t>-1){const i=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),i}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,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=we(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const a=Y(i);return[...t,...a]},[]),...this.functionCalls.reduce((t,i)=>{const a=Y(i);return[...t,...a]},[]),...this.conditions.reduce((t,i)=>{const a=Y(i);return[...t,...a]},[]),...this.operations.reduce((t,i)=>{const a=Y(i);return[...t,...a]},[]),...this.loops.reduce((t,i)=>{const a=Y(i);return[...t,...a]},[]),...this.searches.reduce((t,i)=>{const a=Y(i);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return S([...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=Y(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(i=>{if(!i.declaration){const a=i.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(d=>d.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===w.PERSISTED_ENTITY)||null}};l(ue,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(ue,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),l(ue,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ue,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),l(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let Di=ue;function H8(n){const e=c4(),t=n.toJSON();e.safeParse(t).success;const a=[];return z(n.errors,a)}class Xa{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.PrimitiveEntity);l(this,"static");l(this,"abstract");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(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(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a})}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return 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(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{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(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){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(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.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(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.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=H8(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}clone(){return new Xa(this.toJSON(),this.project)}}function Y8(n){const e=R4(),t=n.toJSON();e.safeParse(t).success;const a=[];return z(n.errors,a)}class xn{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",!1);l(this,"static");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"interactive",!1);l(this,"errors",[]);l(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(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}get extendedProperties(){return S(this.extends.reduce((e,t)=>{if(t instanceof xn){const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);e.push(...i)}return e},[]))}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return 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(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e)),...this.extends.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e)),...this.extends.flatMap(i=>i.toFlatIds(e))])}toJSON(){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(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+L.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){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(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.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(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.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=Y8(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}clone(){return new xn(this.toJSON(),this.project)}implement(e,t){return Va(this,e,t)}}function Qa(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case r.PrimitiveValue:return t||new Sl(n,e);case r.CustomEntity:return t||new oi(n,e);case r.PrimitiveEntity:return t||new Xa(n,e);case r.FunctionDeclaration:return t||new ci(n,e);case r.GlobalEvent:return t||new $a(n,e);case r.DataType:return t||new La(n,e);case r.Property:return t||new li(n,e);case r.FunctionCall:return t||new vi(n,e);case r.Condition:return t||new pi(n,e);case r.Operation:return t||new di(n,e);case r.VariableDeclaration:return t||new yi(n,e);case r.VariableInstance:return t||new hi(n,e);case r.OutputMap:return t||new Ei(n,e);case r.ReturnDeclaration:return t||new $t(n,e);case r.ArgumentDeclaration:return t||new Ri(n,e);case r.InputMap:return t||new Ti(n,e);case r.Project:return t||new Di(n);case r.InstalledProject:return t||new mi(n,e);case r.ActionDescriptor:return t||new Vn(n,e);case r.ReturnStatement:return t||new bi(n,e);case r.Loop:return t||new ui(n,e);case r.Search:return t||new fi(n,e);case r.ValueDescriptor:return t||new ja(n,e);case r.BuiltInBaseEntity:return t||new xn(n,e);case r.InternalCall:return t||new xa(n,e);case r.ContinueStatement:return t||new Dt(n,e);case r.BreakStatement:return t||new Ua(n,e);default:throw new Error("Invalid entity type: "+n.type)}}function R(n,e){if(!n)throw new Error("Entity is null");const t=Qa(n,e);return t.subscribe(),t}class z8 extends xn{constructor(t){super(Oe,t);l(this,"initialData");l(this,"id",w.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",w.PERSISTED_ENTITY);l(this,"description",Oe.description);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",Oe.abstract);l(this,"static",Oe.static);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=Oe,this.project=t,this.id=Oe.id,this.version=Oe.version,this.name=Oe.name,this.static=Oe.static,this.abstract=Oe.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}}class Z8 extends Vn{constructor(t){super(Mt,t);l(this,"id",Ie.Parallel);l(this,"name",Ie.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",Mt);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async()=>{});this.project=t,this.fixedArguments=Mt.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=Mt.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Mt.error?R(Mt.error,this.project):null}}class X8 extends Vn{constructor(t){super(st,t);l(this,"id",st.id);l(this,"name",st.name);l(this,"description",st.description);l(this,"version",st.version);l(this,"autoexecutable",!1);l(this,"initialData",st);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[0])=>{const i=t[0];return[new Promise(s=>{setTimeout(()=>{s()},i)})]});this.project=t,this.fixedArguments=st.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=st.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=st.error?R(st.error,this.project):null}}class Q8 extends Vn{constructor(t){super(Ht,t);l(this,"id",Ie.Sequential);l(this,"name",Ie.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",Ht);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[[]])=>[[]]);this.project=t,this.fixedArguments=Ht.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=Ht.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Ht.error?R(Ht.error,this.project):null}}const K8="test_primitive_entities_export";u.ActionDescriptorState=Vn,u.ActionDescriptorValuesType=V,u.AppendToListOperationInputIds=Sd,u.AppendToListOperationOutputIds=Ad,u.ArgumentDeclarationState=Ri,u.BUILT_IN_BASE_ENTITY_IDS=Me,u.BUILT_IN_ENTITY_TYPES=Si,u.BaseEntityNames=w,u.BaseValueDescriptorIds=ms,u.BreakStatementState=Ua,u.BuiltInBaseEntityState=xn,u.CALLABLE_TYPES=En,u.CALLER_TYPES=tn,u.COMPARISON_CONDITIONS=Ph,u.CONDITIONS=zv,u.CUSTOM_ENTITY_OPERATIONS=Uu,u.ComparisonOperatorTypes=De,u.ConditionState=pi,u.ContinueStatementState=Dt,u.CreateNewInputIds=Tu,u.CreateNewOutputIds=Eu,u.CustomEntityState=oi,u.DRAGGABLE_CALLABLE_TYPES=ts,u.DRAGGABLE_CALLER_TYPES=zl,u.DRAGGABLE_ELEMENT_TYPES=ns,u.DRAGGABLE_EXECUTABLE_TYPES=Pv,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=es,u.DataTypeCompatibilityTypes=Ot,u.DataTypeParentChildRelation=xe,u.DataTypeState=La,u.ENTITY_TYPES=Dv,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=it,u.ENTITY_WITH_NAMES_TYPES=Zl,u.ENTITY_WITH_VALUE_TYPES=Yl,u.ENTRY_POINT_TYPES=Fe,u.EVENT_TYPES=jn,u.EXECUTABLE_TYPES=Iv,u.EXECUTION_OPERATIONS=mu,u.EntityOperations=He,u.EntityType=r,u.ExecutionOperations=Ie,u.FunctionCallState=vi,u.FunctionDeclarationState=ci,u.GLOBAL_EVENT_DECLARATIONS=Zv,u.GetLastInListOperationInputIds=yd,u.GetLastInListOperationOutputIds=hd,u.GlobalEventNames=Wt,u.GlobalEventState=$a,u.HTTPOperations=qe,u.HTTP_OPERATIONS=vp,u.InputMapState=Ti,u.InstalledProjectState=mi,u.InternalCallState=xa,u.JoinListOperationInputIds=wc,u.JoinListOperationOutputIds=Mc,u.JoinStringOperationInputIds=Tc,u.JoinStringOperationOutputIds=Ec,u.LIST_OPERATIONS=xd,u.ListOperations=U,u.LoopState=ui,u.LoopTypes=$e,u.NUMBER_OPERATIONS=mc,u.NumberAdditionOperationInputIds=rc,u.NumberAdditionOperationOutputIds=ic,u.NumberOperations=nt,u.OPERATION_DECLARATIONS=Av,u.OperationState=di,u.OutputMapParentChildRelation=Hl,u.OutputMapState=Ei,u.PASS_THROUGH_CALLABLE_TYPES=Ge,u.ParallelExecutionOperation=Z8,u.ParallelExecutionOperationInputIds=Ud,u.ParallelExecutionOperationOutputIds=jd,u.PersistedEntity=z8,u.PersistedEntityMethods=Et,u.PrimitiveEntityState=Xa,u.PrimitiveTypes=v,u.ProjectState=Di,u.PropertyState=li,u.ReturnDeclarationState=$t,u.ReturnStatementState=bi,u.STANDALONE_CONDITIONS=Eh,u.STRING_OPERATIONS=Bc,u.ScopeCompatibilityType=Za,u.SearchState=fi,u.SequentialExecutionOperation=Q8,u.SequentialExecutionOperationInputIds=au,u.SequentialExecutionOperationOutputIds=su,u.SplitListOperationInputIds=Yc,u.SplitListOperationOutputIds=zc,u.StandaloneOperatorTypes=St,u.StringOperations=be,u.TERMINATION_TYPES=Ne,u.USER_MANAGED_ENTITY_TYPES=Sv,u.UUID=L,u.VALUE_READING_TYPES=Tn,u.VALUE_WRITING_TYPES=rt,u.VARIABLE_TYPES=_e,u.ValidationInputIds=Au,u.ValidationOutputIds=Ou,u.ValueAutogenerationType=Le,u.ValueDescriptorParentChildRelation=O,u.ValueDescriptorState=ja,u.VariableDeclarationState=yi,u.VariableInstanceState=hi,u.WaitOperation=X8,u.WaitOperationInputIds=Qd,u.WaitOperationOutputIds=Kd,u.appendToListOperation=us,u.appendToListOperationElementToAppendArgument=ds,u.appendToListOperationElementToAppendArgumentParentRef=Vd,u.appendToListOperationElementToAppendArgumentRef=Bd,u.appendToListOperationError=Fd,u.appendToListOperationErrorParentRef=Gd,u.appendToListOperationListArgument=cs,u.appendToListOperationListArgumentParentRef=Nd,u.appendToListOperationListArgumentRef=Od,u.appendToListOperationListDataType=Cd,u.appendToListOperationResultListDataType=_d,u.appendToListOperationResultListReturn=$d,u.appendToListOperationResultListReturnParentRef=Ld,u.appendToListOperationResultListReturnRef=Md,u.appendToListOperationSecondListDataType=wd,u.baseHttpRequestFunctionDeclaration=Vi,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=Rs,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=bp,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=Rp,u.baseHttpRequestFunctionDeclarationRef=fp,u.baseHttpRequestFunctionDeclarationRefEight=Tp,u.baseHttpRequestFunctionDeclarationRefFive=yp,u.baseHttpRequestFunctionDeclarationRefFour=pp,u.baseHttpRequestFunctionDeclarationRefNine=Ep,u.baseHttpRequestFunctionDeclarationRefSeven=mp,u.baseHttpRequestFunctionDeclarationRefSix=hp,u.baseHttpRequestFunctionDeclarationRefThree=up,u.baseHttpRequestFunctionDeclarationRefTwo=dp,u.booleanPrototype=kn,u.capitalizeFirstLetter=Ta,u.checkAreCustomEntitiesCompatibleAsDataType=RE,u.checkAreDataTypesCompatible=Ea,u.checkArePropertiesCompatibleAsDataType=EE,u.checkIsBranchDependentButNotDirectlyOnBranch=gi,u.checkIsBranchDependentOnBranch=B8,u.checkIsCallableEntityReachable=Wl,u.checkIsCanvasEntity=J8,u.checkIsDetachedBranch=hv,u.checkIsDetachedBranchShallow=ql,u.checkIsGlobalVariable=q8,u.checkIsGloballyDeclared=kl,u.checkIsMethod=Tv,u.checkIsNestedScope=za,u.checkScopeCompatibility=Ii,u.createNewInstanceOperation=Er,u.createNewInstanceOperationEntityToInstanciateArgument=gu,u.createNewInstanceOperationEntityToInstanciateArgumentRef=Ru,u.createNewInstanceOperationEntityToInstanciateDataType=bu,u.createNewInstanceOperationError=Su,u.createNewInstanceOperationErrorParentRef=Du,u.createNewInstanceOperationOutputEntityDeclaration=Pu,u.createNewInstanceOperationOutputEntityDeclarationParentRef=Iu,u.createNewInstanceOperationRef=vu,u.createSemanticId=qt,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=hh,u.cronJobBuiltInBaseEntityExpressionProperty=yh,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=Wv,u.cronJobBuiltInBaseEntityExpressionPropertyRef=uh,u.cronJobBuiltInBaseEntityRef=ph,u.cronJobTriggeredFunctionDeclarationBlueprint=Ss,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=ch,u.customEntityToZodSchema=kh,u.datePrototype=mr,u.deletePersistedEntityMethod=Ds,u.deletePersistedEntityMethodParentRef=Uy,u.endpointBuiltInBaseEntity=Ps,u.endpointBuiltInBaseEntityRef=kp,u.endpointBuiltInBaseEntityRefFour=wy,u.endpointBuiltInBaseEntityRefThree=Qp,u.endpointBuiltInBaseEntityRefTwo=Yp,u.endpointBuiltInCorsProperty=qp,u.endpointBuiltInCorsPropertyDataType=jp,u.endpointBuiltInCorsPropertyDataTypeRef=xp,u.endpointBuiltInCorsPropertyRef=Up,u.endpointBuiltInMethodProperty=gs,u.endpointBuiltInMethodPropertyDataType=Xp,u.endpointBuiltInMethodPropertyDataTypeRef=zp,u.endpointBuiltInMethodPropertyRef=Zp,u.endpointBuiltInPathProperty=vs,u.endpointBuiltInPathPropertyDataType=Hp,u.endpointBuiltInPathPropertyDataTypeRef=Jp,u.endpointBuiltInPathPropertyRef=Wp,u.endpointPathParamsArgumentDeclaration=yy,u.endpointPathParamsArgumentDeclarationRef=ly,u.endpointPathParamsVariableDataType=cy,u.endpointPathParamsVariableDataTypeRef=oy,u.endpointReachedTriggerActionDescriptor=Is,u.endpointReachedTriggerActionDescriptorRef=dy,u.endpointReachedTriggerActionDescriptorRefFour=my,u.endpointReachedTriggerActionDescriptorRefThree=hy,u.endpointReachedTriggerActionDescriptorRefTwo=py,u.endpointRequestBodyArgumentDeclaration=Ty,u.endpointRequestBodyArgumentDeclarationRef=ny,u.endpointRequestBodyVariableDataType=ry,u.endpointRequestHeadersArgumentDeclaration=uy,u.endpointRequestHeadersArgumentDeclarationRef=ey,u.endpointRequestHeadersVariableDataType=ty,u.endpointRequestHeadersVariableDataTypeRef=Kp,u.endpointRequestQueryParamsArgumentDeclaration=fy,u.endpointRequestQueryParamsArgumentDeclarationRef=ay,u.endpointRequestQueryParamsVariableDataType=sy,u.endpointRequestQueryParamsVariableDataTypeRef=iy,u.endpointResponseBodyDataType=Oy,u.endpointResponseBodyReturnDeclaration=By,u.endpointResponseBodyReturnDeclarationRef=Ay,u.endpointResponseCodeDataType=Ry,u.endpointResponseCodeReturnDeclaration=vy,u.endpointResponseCodeReturnDeclarationRef=Ey,u.endpointResponseHeadersDataType=Py,u.endpointResponseHeadersDataTypeRef=gy,u.endpointResponseHeadersReturnDeclaration=Sy,u.endpointResponseHeadersReturnDeclarationRef=Iy,u.endpointReturnStatementRef=by,u.endpointReturnStatementRefThree=Cy,u.endpointReturnStatementRefTwo=Dy,u.enumOptionsProperty=tc,u.enumOptionsPropertyDataType=Kl,u.enumOptionsPropertyDataTypeRef=Xl,u.enumOptionsPropertyRef=Ql,u.enumPrototype=Rn,u.enumPrototypeRef=ec,u.executionBuiltInEntity=Os,u.executionBuiltInEntityAbortMethod=As,u.executionBuiltInEntityAbortMethodParentRef=fh,u.filterOutDuplicateEntities=S,u.findReferenceToSelfInList=av,u.findReferencesToSelfInProject=G8,u.flattenCalls=$n,u.flattenCanvasAncestorsUntil=Ja,u.flattenCustomEntityExtensionAndImplementationTypes=dv,u.flattenCustomEntityExtensionTypes=Ya,u.flattenCustomEntityExtensions=Ul,u.flattenCustomEntityImplementations=jl,u.flattenCustomEntityImplementionTypes=Ha,u.flattenDerivedCanvasEntities=Tt,u.flattenDetachedBranch=mv,u.flattenElementCalls=we,u.flattenProjectElements=iv,u.flattenRelatedCanvasElementsOnTheLeft=cv,u.flattenRelatedCanvasElementsOnTheRight=lv,u.flattenVariableReads=rv,u.flattenVariableWrites=nv,u.flattenVariables=Y,u.generate=bI,u.generateExecutionDataType=bE,u.generateRandomBoolean=uf,u.generateRandomDate=Hh,u.generateRandomDateAfter=qh,u.generateRandomDateBefore=Jh,u.generateRandomDateBetweenRange=Wh,u.generateRandomNumber=sf,u.generateRandomNumberAfter=nf,u.generateRandomNumberBefore=rf,u.generateRandomNumberBetweenRange=af,u.generateRandomText=df,u.generateRandomTextAfter=of,u.generateRandomTextBefore=lf,u.generateRandomTextBetweenRange=cf,u.generateUniqueUUID=tf,u.getBaseBuiltInEntities=mn,u.getBuiltInEntityOwner=Fn,u.getCalls=Ll,u.getCanvasEntitiesDerivedFromInternalCalls=ov,u.getCanvasEntitiesDerivedFromWrites=fr,u.getCanvasEntityDerivedFromValueReadingEntity=xl,u.getChildrenEntityWithValues=M8,u.getCommonAncestor=Vl,u.getCommonChildren=Yb,u.getDeclaration=Co,u.getDeepestScope=vv,u.getEntityArgumentDeclarations=Gl,u.getEntityInputMaps=sv,u.getEntityOutputMaps=U8,u.getEntityReturnDeclarations=Fl,u.getExtendedBuiltInEntity=j8,u.getExtendedCustomEntity=pv,u.getHeadIfPartOfDetachedBranch=fv,u.getHighestScope=bv,u.getImplementedBuiltInEntity=k8,u.getIsInteractive=yv,u.getLastInListOperation=Dd,u.getLastInListOperationError=Pd,u.getLastInListOperationErrorParentRef=Id,u.getLastInListOperationInputListArgument=bd,u.getLastInListOperationInputListArgumentParentRef=Rd,u.getLastInListOperationInputListArgumentRef=fd,u.getLastInListOperationInputListDataType=md,u.getLastInListOperationOutputElementDataType=Ed,u.getLastInListOperationOutputElementReturn=gd,u.getLastInListOperationOutputElementReturnParentRef=vd,u.getLastInListOperationOutputElementReturnRef=Td,u.getLinkedEntitiesFromArgumentDeclaration=$8,u.getLowestPersistedEntityImplementation=uv,u.getParentCanvasEntities=Bt,u.getParentCanvasEntity=ke,u.getParentEntryPoint=w8,u.getPrototypeByType=Rv,u.getReferenceEntityId=D,u.getRelatedCanvasElementsOnTheLeft=Gn,u.getRelatedCanvasElementsOnTheRight=fn,u.getRootEntryPointScopeOwner=Jl,u.getScopeOwner=ut,u.getUsedArgFromDeclaration=F8,u.getUsedReturnFromDeclaration=x8,u.getVariableFromInputMapping=Zb,u.getVariableFromReturnVariablePointer=Kb,u.getVariablesFromArgumentDeclarations=Wa,u.getVariablesFromInputMaps=Xb,u.getVariablesFromOutputMapping=ev,u.getVariablesFromOutputMaps=tv,u.getVariablesFromReturnDeclarations=Qb,u.getVariablesInSameOrHigherScope=Bo,u.getWrites=$l,u.groupCallsBasedOnParallelizableExecution=N8,u.handleAfterEntityImplementationSideEffects=Fb,u.handleBeforeEntityImplementationSideEffects=Gb,u.httpRequestBodyArgument=_i,u.httpRequestBodyArgumentRef=ep,u.httpRequestBodyDataType=tp,u.httpRequestHeadersArgument=Mi,u.httpRequestHeadersArgumentRef=Qu,u.httpRequestHeadersDataType=Ku,u.httpRequestMethodArgument=Bi,u.httpRequestMethodArgumentRef=Zu,u.httpRequestMethodDataType=Xu,u.httpRequestMethodDataTypeRef=Yu,u.httpRequestQueryParamsArgument=Ts,u.httpRequestQueryParamsArgumentRef=Wu,u.httpRequestQueryParamsDataType=Hu,u.httpRequestVariableURLArgument=wi,u.httpRequestVariableURLArgumentRef=qu,u.httpRequestVariableURLDataType=Ju,u.httpRequestVariableURLDataTypeRef=ju,u.httpResponseBodyReturnDataType=cp,u.httpResponseBodyReturnDataTypeRef=op,u.httpResponseBodyReturnReturn=Rr,u.httpResponseBodyReturnReturnRef=lp,u.httpResponseCodeDataType=rp,u.httpResponseCodeReturn=Es,u.httpResponseCodeReturnRef=np,u.httpResponseHeadersDataType=sp,u.httpResponseHeadersDataTypeRef=ip,u.httpResponseHeadersReturn=Ni,u.httpResponseHeadersReturnRef=ap,u.implement=Va,u.inferArgumentDeclarationDataType=vE,u.inferDataType=Ra,u.inferInputMapDataType=gE,u.inferOutputMapDataType=DE,u.inferVariableDeclarationDataType=PE,u.inferVariableInstanceDataType=IE,u.iterateOverListActionDescriptor=Jn,u.iterateOverListActionDescriptorListArgumentDeclaration=Op,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=Sp,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=Dp,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=Ap,u.iterateOverListActionDescriptorReturnDeclaration=Pp,u.iterateOverListActionDescriptorReturnDeclarationParentRef=Ip,u.joinListOperation=Hc,u.joinListOperationError=Wc,u.joinListOperationErrorParentRef=Jc,u.joinListOperationFirstListArgument=xc,u.joinListOperationFirstListArgumentParentRef=Fc,u.joinListOperationFirstListArgumentRef=_c,u.joinListOperationFirstListDataType=Nc,u.joinListOperationResultListDataType=Gc,u.joinListOperationResultListReturn=qc,u.joinListOperationResultListReturnParentRef=kc,u.joinListOperationResultListReturnRef=$c,u.joinListOperationSecondListArgument=jc,u.joinListOperationSecondListArgumentParentRef=Uc,u.joinListOperationSecondListArgumentRef=Vc,u.joinListOperationSecondListDataType=Lc,u.joinStringOperation=Ci,u.joinStringOperationError=Cc,u.joinStringOperationErrorParentRef=Oc,u.joinStringOperationFirstStringArgument=Ai,u.joinStringOperationFirstStringArgumentParentRef=Dc,u.joinStringOperationFirstStringArgumentRef=Rc,u.joinStringOperationFirstStringDataType=bc,u.joinStringOperationResultStringDataType=Pc,u.joinStringOperationResultStringReturn=Tr,u.joinStringOperationResultStringReturnParentRef=Ac,u.joinStringOperationResultStringReturnRef=Ic,u.joinStringOperationSecondStringArgument=Oi,u.joinStringOperationSecondStringArgumentParentRef=Sc,u.joinStringOperationSecondStringArgumentRef=vc,u.joinStringOperationSecondStringDataType=gc,u.jsonPrototype=nc,u.keyValueParamBuiltInBaseEntity=bs,u.keyValueParamBuiltInBaseEntityNameProperty=Lp,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=Cv,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=Vp,u.keyValueParamBuiltInBaseEntityNamePropertyRef=Np,u.keyValueParamBuiltInBaseEntityValueProperty=Fp,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=wv,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=Gp,u.keyValueParamBuiltInBaseEntityValuePropertyRef=$p,u.lowercaseFirstLetter=TE,u.manualFlowActionDescriptor=_p,u.manualFlowActionDescriptorDeclarationReturnDeclaration=Mp,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=Bp,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=Cp,u.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=wp,u.mapActionDescriptorToTypeItRepresents=W8,u.mergeListOfEntities=Ev,u.methodDefaultValue=zu,u.mockClientProject=z$,u.moreThanOrEqualCondition=gr,u.moreThanOrEqualConditionLeftHandArgument=vh,u.moreThanOrEqualConditionLeftHandArgumentParentRef=bh,u.moreThanOrEqualConditionRightHandArgument=Ih,u.moreThanOrEqualConditionRightHandArgumentParentRef=gh,u.notEmptyCondition=Hn,u.notEmptyConditionArgument=Th,u.notEmptyConditionRef=mh,u.numberAdditionOperation=os,u.numberAdditionOperationError=fc,u.numberAdditionOperationErrorParentRef=hc,u.numberAdditionOperationFirstNumberArgument=is,u.numberAdditionOperationFirstNumberArgumentRef=ac,u.numberAdditionOperationFirstNumberDataType=sc,u.numberAdditionOperationRef=uc,u.numberAdditionOperationRefThree=yc,u.numberAdditionOperationRefTwo=pc,u.numberAdditionOperationResultNumberDataType=dc,u.numberAdditionOperationResultNumberReturn=ss,u.numberAdditionOperationResultNumberReturnRef=cc,u.numberAdditionOperationSecondNumberArgument=as,u.numberAdditionOperationSecondNumberArgumentRef=oc,u.numberAdditionOperationSecondNumberDataType=lc,u.numberPrototype=Ce,u.parallelExecutionOperation=Mt,u.parallelExecutionOperationError=Xd,u.parallelExecutionOperationErrorParentRef=Zd,u.parallelExecutionOperationListOfExecutionResultsDataType=Hd,u.parallelExecutionOperationListOfExecutionResultsReturn=ys,u.parallelExecutionOperationListOfExecutionResultsReturnRef=Wd,u.parallelExecutionOperationListOfFunctionsArgument=ps,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=Jd,u.parallelExecutionOperationListOfFunctionsArgumentRef=qd,u.parallelExecutionOperationListOfFunctionsBlueprint=kd,u.parallelExecutionOperationRef=Yd,u.parallelExecutionOperationRefThree=zd,u.persistedBuiltInBaseEntity=Oe,u.persistedBuiltInBaseEntityCreatedAtProperty=ih,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=nh,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=qv,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=rh,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=th,u.persistedBuiltInBaseEntityDatabaseProperty=vr,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=xv,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=Wy,u.persistedBuiltInBaseEntityDatabasePropertyRef=Jy,u.persistedBuiltInBaseEntityDeletedAtProperty=eh,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Qy,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=kv,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Ky,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=Xy,u.persistedBuiltInBaseEntityIdentifierProperty=Zy,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=Hy,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=zy,u.persistedBuiltInBaseEntityIdentifierPropertyRef=Yy,u.persistedBuiltInBaseEntityUpdatedAtProperty=lh,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=sh,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=Jv,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=oh,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=ah,u.processOutputGlobalValueDescriptorDataType=Sh,u.processOutputGlobalValueDescriptorReturn=Ah,u.processOutputGlobalValueDescriptorReturnRef=Dh,u.projectPublicationCompletedGlobalEvent=Cs,u.propertyToZodSchema=jh,u.relationalDatabaseBuiltInBaseEntity=vn,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=xy,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=Gy,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=Fy,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=$i,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=My,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=_y,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=xi,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=Ly,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=$y,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=Fi,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=Lv,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=Vy,u.relationalDatabaseBuiltInBaseEntityRef=Wn,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=Gi,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=Nv,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=Ny,u.resolveActionDescriptorName=NE,u.resolveBaseEntityName=wE,u.resolveBuiltInBaseEntityDataTypeLabel=wo,u.resolveConditionOperatorLabel=va,u.resolveCustomEntityDataTypeLabel=Mo,u.resolveDataType=Oo,u.resolveDataTypeLabel=OE,u.resolveEntityDataTypeLabel=BE,u.resolveEntityName=A,u.resolveFirstCallsSecond=V8,u.resolveFirstWritesSecond=L8,u.resolvePrimitiveEntityName=_E,u.resolvePropertyDataTypeLabel=CE,u.resolveSearchName=ME,u.resolveVariableDataTypeLabel=K$,u.resolveVariableDeclarationDataTypeLabel=On,u.resolveVariableInstanceDataTypeLabel=AE,u.resolveVariableScope=Z$,u.sequentialExecutionOperation=Ht,u.sequentialExecutionOperationError=fu,u.sequentialExecutionOperationErrorParentRef=hu,u.sequentialExecutionOperationListOfExecutionResultsDataType=uu,u.sequentialExecutionOperationListOfExecutionResultsReturn=fs,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=yu,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=du,u.sequentialExecutionOperationListOfFunctionsArgument=hs,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=cu,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=pu,u.sequentialExecutionOperationListOfFunctionsArgumentRef=lu,u.sequentialExecutionOperationListOfFunctionsBlueprint=ou,u.softDeletePersistedEntityMethod=ky,u.softDeletePersistedEntityMethodParentRef=jy,u.sortCallsBasedOnExecutionDependencies=zb,u.sortChildrenEntitiesBasedOnExecutionDependencies=_8,u.splitListOperation=pd,u.splitListOperationError=ud,u.splitListOperationErrorParentRef=dd,u.splitListOperationFirstOutputListDataType=ed,u.splitListOperationFirstOutputListReturn=sd,u.splitListOperationFirstOutputListReturnParentRef=ad,u.splitListOperationFirstOutputListReturnRef=ls,u.splitListOperationInputListArgument=nd,u.splitListOperationInputListArgumentParentRef=td,u.splitListOperationInputListArgumentRef=Zc,u.splitListOperationInputListDataType=Xc,u.splitListOperationSecondOutputListDataType=od,u.splitListOperationSecondOutputListReturn=cd,u.splitListOperationSecondOutputListReturnParentRef=ld,u.splitListOperationSplitIndexArgument=id,u.splitListOperationSplitIndexArgumentParentRef=rd,u.splitListOperationSplitIndexArgumentRef=Qc,u.splitListOperationSplitIndexDataType=Kc,u.stringPrototype=G,u.suggestNewIdForEntity=tG,u.test_primitive_entities_export=K8,u.toCamelCase=X$,u.toEntityState=wt,u.toKebabCase=SE,u.toLowerCaseKebabCase=ba,u.toPascalCase=Q$,u.untypedObjectPrototype=at,u.updateValueReader=Pi,u.urlDefaultValue=ku,u.uuidPrototype=rs,u.validateArgumentDeclarationName=Lo,u.validateCustomEntityName=ga,u.validateDataOperation=qn,u.validateDataOperationDataToValidateArgument=Mu,u.validateDataOperationDataToValidateArgumentParentRef=wu,u.validateDataOperationDataToValidateArgumentRef=Cu,u.validateDataOperationDataToValidateDataType=Bu,u.validateDataOperationEntityToMatchTypeArgument=Lu,u.validateDataOperationEntityToMatchTypeArgumentParentRef=Vu,u.validateDataOperationEntityToMatchTypeArgumentRef=_u,u.validateDataOperationEntityToMatchTypeDataType=Nu,u.validateDataOperationError=xu,u.validateDataOperationErrorParentRef=Fu,u.validateDataOperationOutputEntityDeclaration=Gu,u.validateDataOperationOutputEntityDeclarationParentRef=$u,u.validateFunctionDeclarationName=_o,u.validateName=eG,u.validatePropertyName=Vo,u.validateReturnDeclarationName=$o,u.validateVariableDeclarationName=No,u.waitOperation=st,u.waitOperationMillisecondsNumberArgument=bn,u.waitOperationMillisecondsNumberArgumentRef=eu,u.waitOperationMillisecondsNumberDataType=tu,u.waitOperationOperationError=iu,u.waitOperationOperationErrorParentRef=ru,u.waitOperationRef=nu,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});