@elyx-code/project-logic-tree 0.0.6177 → 0.0.6178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.cjs
CHANGED
|
@@ -21,7 +21,7 @@ WHERE
|
|
|
21
21
|
AND Employee.manager IS NOT NULL
|
|
22
22
|
OR (Employee.manager = User.identifier AND User.identifier IS NOT NULL)
|
|
23
23
|
ORDER BY Employee.startDate DESC, Employee.department ASC
|
|
24
|
-
LIMIT 10 OFFSET 0;`,x8={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:n.GenericReference,entityId:ue,version:"1",entityType:n.Project},k8={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",version:"1",entityType:n.Search},LA={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:n.ValueDescriptor,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"companies",description:"List of companies with multiple employees and an existing bank account",defaultValue:null,dataType:null,required:!0,parentRelationType:M.FixedReturns,index:0,parent:k8},Z8={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",version:"1",entityType:n.Search},q8={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:LA,writesValues:[],index:0,parent:Z8},J8={id:"find-companies-with-multiple-employees-and-bank-account",type:n.Search,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!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:[LA],inputs:[],outputs:[q8],query:S8,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:x8},W8={type:n.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:bA},Y8={type:n.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},UA={id:kk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:W8,parent:Y8},z8={type:n.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:EA},H8={type:n.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},jA={id:xk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:z8,parent:H8},K8={type:n.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:TA},X8={type:n.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},$A={id:Sk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:K8,parent:X8},Q8={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:vA},e9={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},GA={id:Fk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:Q8,parent:e9},t9={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:RA},r9={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},FA={id:Gk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,index:0,readsValue:t9,parent:r9},i9={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Ju},n9={id:bA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:dr.properties[0],defaultValue:null,index:0,writesValues:[UA],parent:i9},a9={type:n.GenericReference,id:"manager-variable-data-type-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Ju},s9={like:!1,inferred:!1,id:"manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,entity:vr,asType:!1,isList:!1,parent:a9},o9={type:n.GenericReference,id:"manager-variable-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:IA},d9={type:n.GenericReference,id:"manager-variable-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},SA={constant:!0,required:!0,id:Ju,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Manager",dataType:s9,description:"A variable holding an inherited manager for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:o9,writesValues:[],inputs:[],outputs:[n9],internalCalls:[],parent:d9,x:0,y:0},l9={type:n.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},u9={id:IA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:vr.properties[2],index:3,writesValues:[SA],parent:l9},p9={type:n.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},c9={id:EA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:vr.properties[0],index:2,writesValues:[jA],parent:p9},f9={type:n.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},y9={id:TA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:xt.properties[1],index:1,writesValues:[$A],parent:f9},h9={type:n.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},m9={id:vA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:dr.properties[0],index:0,writesValues:[GA],parent:h9},v9={type:n.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},T9={like:!1,inferred:!1,id:"random-company-employee-test-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,entity:vr,asType:!1,isList:!1,parent:v9},E9={type:n.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},I9={constant:!0,required:!0,id:da,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Company employee",dataType:T9,description:"A variable holding a random company employee for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[m9,y9,c9,u9],internalCalls:[],parent:E9,x:0,y:0},b9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",version:"1",entityType:n.InputMap,entityId:AA},R9={type:n.LiteralValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:g.Date,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,valueAsTypeList:null,valueAsTypeSingle:null,value:null,autogeneration:{type:yt.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:b9},A9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",version:"1",entityType:n.VariableInstance,entityId:yn},D9={id:AA,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:R9,index:5,readsValue:null,parent:A9},O9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},P9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},w9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},V9={id:yn,type:n.VariableInstance,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:O9,calledByError:[],calledByEntry:[],calledBySuccess:[P9],successCalls:[Yu,_A,DA],errorCalls:[],readsValue:null,writesValues:[BA],inputs:[D9],outputs:[],internalCalls:[],parent:w9,x:0,y:0},C9={type:n.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},B9={constant:!0,required:!0,id:Gr,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Yu,V9],errorCalls:[],readsValue:null,writesValues:[wA],inputs:[FA,GA,$A,jA,UA],outputs:[],internalCalls:[],parent:C9,x:0,y:0},_9={type:n.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",version:"1",entityType:n.VariableDeclaration,entityId:GI},M9={like:!1,inferred:!1,id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:cu,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,asType:!1,isList:!1,parent:_9},g9={type:n.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",version:"1",entityType:n.Project,entityId:ue},xA={constant:!0,required:!0,id:GI,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Current user",description:"The user that is currently logged in",defaultValue:null,dataType:M9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:g9},N9={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",version:"1",entityType:n.VariableInstance,entityId:mA},L9={id:RA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:dr.properties[0],index:0,writesValues:[FA],parent:N9},U9={type:n.GenericReference,id:"global-user-instance-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},j9={id:mA,type:n.VariableInstance,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:xA,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[L9],internalCalls:[],parent:U9,x:0,y:0},$9={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},G9={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},F9={like:!1,inferred:!1,id:"is-test-environment-variable-dcl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Kr,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,asType:!1,isList:!1,parent:$9},S9={type:n.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",version:"1",entityType:n.Project,entityId:ue},kA={constant:!0,required:!0,id:"is-test-environment-variable-dcl-id",type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:g.Boolean,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,value:null,type:n.LiteralValue,autogeneration:{type:yt.Random,rangeStart:null,rangeEnd:null},valueAsTypeList:null,valueAsTypeSingle:null,parent:G9},dataType:F9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:S9},x9={type:n.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},k9={id:"is-test-environment-variable-instance-id",type:n.VariableInstance,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:kA,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:x9,x:0,y:0},ZA={type:n.Project,id:ue,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!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:[Mk],entities:[pu,dr,cu,xt,D2,vr,$o,rb,ib,ta,iL,Tr,KL,uu,TC,d2,tL],functions:[KF,Ob,Cu,sS,hS,jb,Bu,mu,Vk,cb,nx],events:[iU],variableDeclarations:[kA,xA,Lu,I9,SA,B9],variableInstances:[k9,j9],conditions:[],operations:[aa],functionCalls:[i4,yj],loops:[F8,Yu,_A,B8,DA],searches:[J8]};var qA={exports:{}};(function(i,s){(function(e,t){i.exports=t()})(xw,function(){var e=1e3,t=6e4,r=36e5,a="millisecond",d="second",o="minute",l="hour",p="day",h="week",c="month",v="quarter",E="year",O="date",w="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,F={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(he){var te=["th","st","nd","rd"],Y=he%100;return"["+he+(te[(Y-20)%10]||te[Y]||te[0])+"]"}},_=function(he,te,Y){var oe=String(he);return!oe||oe.length>=te?he:""+Array(te+1-oe.length).join(Y)+he},$={s:_,z:function(he){var te=-he.utcOffset(),Y=Math.abs(te),oe=Math.floor(Y/60),Q=Y%60;return(te<=0?"+":"-")+_(oe,2,"0")+":"+_(Q,2,"0")},m:function he(te,Y){if(te.date()<Y.date())return-he(Y,te);var oe=12*(Y.year()-te.year())+(Y.month()-te.month()),Q=te.clone().add(oe,c),Ue=Y-Q<0,je=te.clone().add(oe+(Ue?-1:1),c);return+(-(oe+(Y-Q)/(Ue?Q-je:je-Q))||0)},a:function(he){return he<0?Math.ceil(he)||0:Math.floor(he)},p:function(he){return{M:c,y:E,w:h,d:p,D:O,h:l,m:o,s:d,ms:a,Q:v}[he]||String(he||"").toLowerCase().replace(/s$/,"")},u:function(he){return he===void 0}},k="en",W={};W[k]=F;var ee="$isDayjsObject",pe=function(he){return he instanceof Ht||!(!he||!he[ee])},Te=function he(te,Y,oe){var Q;if(!te)return k;if(typeof te=="string"){var Ue=te.toLowerCase();W[Ue]&&(Q=Ue),Y&&(W[Ue]=Y,Q=Ue);var je=te.split("-");if(!Q&&je.length>1)return he(je[0])}else{var ut=te.name;W[ut]=te,Q=ut}return!oe&&Q&&(k=Q),Q||!oe&&k},K=function(he,te){if(pe(he))return he.clone();var Y=typeof te=="object"?te:{};return Y.date=he,Y.args=arguments,new Ht(Y)},se=$;se.l=Te,se.i=pe,se.w=function(he,te){return K(he,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Ht=function(){function he(Y){this.$L=Te(Y.locale,null,!0),this.parse(Y),this.$x=this.$x||Y.x||{},this[ee]=!0}var te=he.prototype;return te.parse=function(Y){this.$d=function(oe){var Q=oe.date,Ue=oe.utc;if(Q===null)return new Date(NaN);if(se.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var je=Q.match(C);if(je){var ut=je[2]-1||0,It=(je[7]||"0").substring(0,3);return Ue?new Date(Date.UTC(je[1],ut,je[3]||1,je[4]||0,je[5]||0,je[6]||0,It)):new Date(je[1],ut,je[3]||1,je[4]||0,je[5]||0,je[6]||0,It)}}return new Date(Q)}(Y),this.init()},te.init=function(){var Y=this.$d;this.$y=Y.getFullYear(),this.$M=Y.getMonth(),this.$D=Y.getDate(),this.$W=Y.getDay(),this.$H=Y.getHours(),this.$m=Y.getMinutes(),this.$s=Y.getSeconds(),this.$ms=Y.getMilliseconds()},te.$utils=function(){return se},te.isValid=function(){return this.$d.toString()!==w},te.isSame=function(Y,oe){var Q=K(Y);return this.startOf(oe)<=Q&&Q<=this.endOf(oe)},te.isAfter=function(Y,oe){return K(Y)<this.startOf(oe)},te.isBefore=function(Y,oe){return this.endOf(oe)<K(Y)},te.$g=function(Y,oe,Q){return se.u(Y)?this[oe]:this.set(Q,Y)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(Y,oe){var Q=this,Ue=!!se.u(oe)||oe,je=se.p(Y),ut=function(Ln,ar){var Hi=se.w(Q.$u?Date.UTC(Q.$y,ar,Ln):new Date(Q.$y,ar,Ln),Q);return Ue?Hi:Hi.endOf(p)},It=function(Ln,ar){return se.w(Q.toDate()[Ln].apply(Q.toDate("s"),(Ue?[0,0,0,0]:[23,59,59,999]).slice(ar)),Q)},Vt=this.$W,Gt=this.$M,br=this.$D,Da="set"+(this.$u?"UTC":"");switch(je){case E:return Ue?ut(1,0):ut(31,11);case c:return Ue?ut(1,Gt):ut(0,Gt+1);case h:var Nn=this.$locale().weekStart||0,Ls=(Vt<Nn?Vt+7:Vt)-Nn;return ut(Ue?br-Ls:br+(6-Ls),Gt);case p:case O:return It(Da+"Hours",0);case l:return It(Da+"Minutes",1);case o:return It(Da+"Seconds",2);case d:return It(Da+"Milliseconds",3);default:return this.clone()}},te.endOf=function(Y){return this.startOf(Y,!1)},te.$set=function(Y,oe){var Q,Ue=se.p(Y),je="set"+(this.$u?"UTC":""),ut=(Q={},Q[p]=je+"Date",Q[O]=je+"Date",Q[c]=je+"Month",Q[E]=je+"FullYear",Q[l]=je+"Hours",Q[o]=je+"Minutes",Q[d]=je+"Seconds",Q[a]=je+"Milliseconds",Q)[Ue],It=Ue===p?this.$D+(oe-this.$W):oe;if(Ue===c||Ue===E){var Vt=this.clone().set(O,1);Vt.$d[ut](It),Vt.init(),this.$d=Vt.set(O,Math.min(this.$D,Vt.daysInMonth())).$d}else ut&&this.$d[ut](It);return this.init(),this},te.set=function(Y,oe){return this.clone().$set(Y,oe)},te.get=function(Y){return this[se.p(Y)]()},te.add=function(Y,oe){var Q,Ue=this;Y=Number(Y);var je=se.p(oe),ut=function(Gt){var br=K(Ue);return se.w(br.date(br.date()+Math.round(Gt*Y)),Ue)};if(je===c)return this.set(c,this.$M+Y);if(je===E)return this.set(E,this.$y+Y);if(je===p)return ut(1);if(je===h)return ut(7);var It=(Q={},Q[o]=t,Q[l]=r,Q[d]=e,Q)[je]||1,Vt=this.$d.getTime()+Y*It;return se.w(Vt,this)},te.subtract=function(Y,oe){return this.add(-1*Y,oe)},te.format=function(Y){var oe=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||w;var Ue=Y||"YYYY-MM-DDTHH:mm:ssZ",je=se.z(this),ut=this.$H,It=this.$m,Vt=this.$M,Gt=Q.weekdays,br=Q.months,Da=Q.meridiem,Nn=function(ar,Hi,Us,el){return ar&&(ar[Hi]||ar(oe,Ue))||Us[Hi].slice(0,el)},Ls=function(ar){return se.s(ut%12||12,ar,"0")},Ln=Da||function(ar,Hi,Us){var el=ar<12?"AM":"PM";return Us?el.toLowerCase():el};return Ue.replace(U,function(ar,Hi){return Hi||function(Us){switch(Us){case"YY":return String(oe.$y).slice(-2);case"YYYY":return se.s(oe.$y,4,"0");case"M":return Vt+1;case"MM":return se.s(Vt+1,2,"0");case"MMM":return Nn(Q.monthsShort,Vt,br,3);case"MMMM":return Nn(br,Vt);case"D":return oe.$D;case"DD":return se.s(oe.$D,2,"0");case"d":return String(oe.$W);case"dd":return Nn(Q.weekdaysMin,oe.$W,Gt,2);case"ddd":return Nn(Q.weekdaysShort,oe.$W,Gt,3);case"dddd":return Gt[oe.$W];case"H":return String(ut);case"HH":return se.s(ut,2,"0");case"h":return Ls(1);case"hh":return Ls(2);case"a":return Ln(ut,It,!0);case"A":return Ln(ut,It,!1);case"m":return String(It);case"mm":return se.s(It,2,"0");case"s":return String(oe.$s);case"ss":return se.s(oe.$s,2,"0");case"SSS":return se.s(oe.$ms,3,"0");case"Z":return je}return null}(ar)||je.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(Y,oe,Q){var Ue,je=this,ut=se.p(oe),It=K(Y),Vt=(It.utcOffset()-this.utcOffset())*t,Gt=this-It,br=function(){return se.m(je,It)};switch(ut){case E:Ue=br()/12;break;case c:Ue=br();break;case v:Ue=br()/3;break;case h:Ue=(Gt-Vt)/6048e5;break;case p:Ue=(Gt-Vt)/864e5;break;case l:Ue=Gt/r;break;case o:Ue=Gt/t;break;case d:Ue=Gt/e;break;default:Ue=Gt}return Q?Ue:se.a(Ue)},te.daysInMonth=function(){return this.endOf(c).$D},te.$locale=function(){return W[this.$L]},te.locale=function(Y,oe){if(!Y)return this.$L;var Q=this.clone(),Ue=Te(Y,oe,!0);return Ue&&(Q.$L=Ue),Q},te.clone=function(){return se.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},he}(),zr=Ht.prototype;return K.prototype=zr,[["$ms",a],["$s",d],["$m",o],["$H",l],["$W",p],["$M",c],["$y",E],["$D",O]].forEach(function(he){zr[he[1]]=function(te){return this.$g(te,he[0],he[1])}}),K.extend=function(he,te){return he.$i||(he(te,Ht,K),he.$i=!0),K},K.locale=Te,K.isDayjs=pe,K.unix=function(he){return K(1e3*he)},K.en=W[k],K.Ls=W,K.p={},K})})(qA);var Z9=qA.exports;const T=mI(Z9);var D=(i=>(i.Error="error",i.Warning="warning",i))(D||{}),j=(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.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",i.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",i.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",i.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",i.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",i))(j||{}),I=(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.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))(I||{}),q=(i=>(i.NoPrimaryKeyProperty="no-primary-key-property",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.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",i.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",i.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",i.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",i.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",i.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",i))(q||{});class P{constructor(s){f(this,"id");f(this,"message");f(this,"issue");f(this,"severity");f(this,"code");this.id=s.id,this.message=s.message,this.issue=s.issue,this.severity=s.severity,this.code=s.code}toEntityError(s){return this.code in j?new hn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:s}):null}}class hn{constructor(s){f(this,"id");f(this,"message");f(this,"issue");f(this,"severity");f(this,"code");f(this,"entity");this.id=s.id,this.message=s.message,this.issue=s.issue,this.severity=s.severity,this.code=s.code,this.entity=s.entity}clone(){return new hn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function q9(i){const s=new Set;return i.filter(e=>s.has(e.id)?!1:(s.add(e.id),!0))}function ye(i){const s=i.entity.errors.find(t=>t.id===i.id);return s?{new:!1,error:s}:{new:!0,error:new hn(i)}}function J9(i,s){const e=new Map;return i.forEach(t=>{e.set(t.id,t)}),s.forEach(t=>{e.set(t.id,t)}),Array.from(e.values())}function Ye(i,s){const e=[];return s.forEach(t=>{const r=i.find(a=>a.id===t.id);r?e.push(r):e.push(t)}),e}const ds=m.union([m.string(),m.number(),m.boolean(),m.date()]),JA=m.enum([yt.CurrentDateAndTime,yt.Random,yt.Unique]),Xo=m.object({type:JA,rangeStart:ds.nullable(),rangeEnd:ds.nullable()}),ls=Xo.extend({type:m.literal(yt.Random),rangeStart:ds,rangeEnd:ds}),Qu=Xo.extend({type:m.literal(yt.Unique),rangeStart:m.null(),rangeEnd:m.null()}),WA=Xo.extend({type:m.literal(yt.CurrentDateAndTime),rangeStart:m.null(),rangeEnd:m.null()}),Qo=ls.extend({rangeStart:m.number().nullable(),rangeEnd:m.number().nullable()}),YA=Qo.extend({rangeStart:m.number(),rangeEnd:m.null()}),zA=Qo.extend({rangeStart:m.null(),rangeEnd:m.number()}),HA=Qo.extend({rangeStart:m.number(),rangeEnd:m.number()}),ed=ls.extend({rangeStart:m.number().nullable(),rangeEnd:m.number().nullable()}),KA=ed.extend({rangeStart:m.number(),rangeEnd:m.null()}),XA=ed.extend({rangeStart:m.null(),rangeEnd:m.number()}),QA=ed.extend({rangeStart:m.number(),rangeEnd:m.number()}),td=ls.extend({rangeStart:m.date().nullable(),rangeEnd:m.date().nullable()}),eD=td.extend({rangeStart:m.date(),rangeEnd:m.null()}),tD=td.extend({rangeStart:m.null(),rangeEnd:m.date()}),rD=td.extend({rangeStart:m.date(),rangeEnd:m.date()}),ep=ls.extend({rangeStart:m.null(),rangeEnd:m.null()}),tp=m.union([KA,XA,QA]),rp=m.union([YA,zA,HA]),ip=m.union([eD,tD,rD,WA]),np=m.union([tp,rp,ip,Qu,ep]);function us(){return m.union([m.object({type:m.literal(n.ValueDescriptor)}),m.record(m.string(),m.any())])}function iD(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ValueDescriptor)})}function ap(){return m.object({id:m.string(),type:m.literal(n.ValueDescriptor),name:m.string(),required:m.boolean()})}function W9(){return ap().merge(m.object({version:m.number(),index:m.number()}))}function Y9(){return ap().merge(m.object({}))}function z9(){return m.object({dataType:En(),parent:vn()})}function H9(){return W9().merge(z9())}function rd(){return m.union([m.object({type:m.literal(n.PrimitiveEntity)}),m.record(m.string(),m.any())])}function id(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.PrimitiveEntity)})}function nd(){return m.object({id:m.string(),type:m.literal(n.PrimitiveEntity),name:m.string(),description:m.string().nullable(),static:m.boolean(),abstract:m.boolean()})}function K9(){return nd().merge(m.object({version:m.number()}))}function X9(){return nd().merge(m.object({}))}function Q9(){return m.object({properties:m.array(mn()),methods:m.array(ur()),abstractMethods:m.array(Fr()),extends:m.array(m.union([rd(),la()]))})}function e6(){return K9().merge(Q9())}function mn(){return m.union([m.object({type:m.literal(n.Property)}),m.record(m.string(),m.any())])}function nD(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Property)})}function sp(){return m.object({id:m.string(),type:m.literal(n.Property),name:m.string(),description:m.string().nullable(),private:m.boolean(),static:m.boolean(),required:m.boolean(),abstract:m.boolean()})}function t6(){return sp().merge(m.object({version:m.number(),index:m.number()}))}function r6(){return sp().merge(m.object({}))}function i6(){return m.object({dataType:En(),implements:mn().nullable(),parent:m.union([Rn(),id(),ad()])})}function n6(){return t6().merge(i6())}function a6(){return m.enum([z.CRON_JOB,z.EXECUTION,z.HTTP_ENDPOINT,z.PERSISTED_ENTITY,z.RELATIONAL_DATABASE])}function la(){return m.union([m.object({type:m.literal(n.BuiltInBaseEntity)}),m.record(m.string(),m.any())])}function ad(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.BuiltInBaseEntity)})}function op(){return m.object({id:m.string(),version:m.number(),type:m.literal(n.BuiltInBaseEntity),name:a6(),description:m.string().nullable(),abstract:m.boolean(),static:m.boolean()})}function s6(){return op()}function o6(){return op().merge(m.object({}))}function d6(){return m.object({properties:m.array(mn()),methods:m.array(ur()),abstractMethods:m.array(Fr()),extends:m.array(m.union([la(),rd()]))})}function l6(){return s6().merge(d6())}function Fr(){return m.union([m.object({type:m.literal(n.ActionDescriptor)}),m.record(m.string(),m.any())])}function vn(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ActionDescriptor)})}function sd(){return m.object({id:m.string(),type:m.literal(n.ActionDescriptor),name:m.string(),description:m.string().nullable()})}function u6(){return sd().merge(m.object({version:m.number()}))}function p6(){return sd().merge(m.object({}))}function c6(){return m.object({inputs:m.array(us()),outputs:m.array(us()),parent:m.union([Xt(),Rn(),ad(),id()]).nullable()})}function aD(){return u6().merge(c6())}function ua(){return m.union([m.object({type:m.literal(n.Loop)}),m.record(m.string(),m.any())])}function Sr(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Loop)})}function sD(){return m.object({id:m.string(),type:m.literal(n.Loop)})}function f6(){return sD().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function y6(){return sD().merge(m.object({declaration:m.union([m.string(),ur()])}))}function h6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),declaration:Fr(),inputs:m.array(Pr()),outputs:m.array(qt()),outputsDeclarations:m.array(us()),successCalls:m.array(Dt()),errorCalls:m.array(Dt()),error:qt(),body:ur(),parent:m.union([ui(),Xt()]),breakStatements:m.array(ya()),continueStatements:m.array(pa())})}function m6(){return f6().merge(h6())}function pa(){return m.union([m.object({type:m.literal(n.ContinueStatement)}),m.record(m.string(),m.any())])}function ca(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ContinueStatement)})}function dp(){return m.object({id:m.string(),type:m.literal(n.ContinueStatement)})}function v6(){return dp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function T6(){return dp().merge(m.object({}))}function E6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),outputs:m.array(oi()),throws:m.optional(oi()),parent:Sr()})}function I6(){return v6().merge(E6())}function Tn(){return m.union([m.object({type:m.literal(n.ReturnStatement)}),m.record(m.string(),m.any())])}function fa(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ReturnStatement)})}function lp(){return m.object({id:m.string(),type:m.literal(n.ReturnStatement)})}function b6(){return lp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function R6(){return lp().merge(m.object({}))}function A6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),outputs:m.array(oi()),throws:m.optional(oi()),parent:ui()})}function D6(){return b6().merge(A6())}function oi(){return m.union([m.object({type:m.literal(n.ReturnDeclaration)}),m.record(m.string(),m.any())])}function oD(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ReturnDeclaration)})}function up(){return m.object({id:m.string(),type:m.literal(n.ReturnDeclaration),name:m.string(),description:m.string().nullable(),isError:m.boolean()})}function O6(){return up().merge(m.object({version:m.number(),index:m.number()}))}function P6(){return up().merge(m.object({}))}function w6(){return m.object({dataType:En().nullable(),readsValue:ms().nullable(),parent:m.union([fa(),vn(),di(),ca()])})}function V6(){return O6().merge(w6())}function ya(){return m.union([m.object({type:m.literal(n.BreakStatement)}),m.record(m.string(),m.any())])}function di(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.BreakStatement)})}function pp(){return m.object({id:m.string(),type:m.literal(n.BreakStatement)})}function C6(){return pp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function B6(){return pp().merge(m.object({}))}function _6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),outputs:m.array(oi()),throws:m.optional(oi()),parent:Sr()})}function M6(){return C6().merge(_6())}function qt(){return m.union([m.object({type:m.literal(n.OutputMap)}),m.record(m.string(),m.any())])}function cp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.OutputMap)})}function fp(){return m.object({id:m.string(),type:m.literal(n.OutputMap)})}function g6(){return fp().merge(m.object({version:m.number(),index:m.number()}))}function N6(){return fp().merge(m.object({}))}function L6(){return m.object({writesValues:m.array(li()),declaration:m.union([oi(),mn()]),parent:m.union([et(),Sr(),di()])})}function U6(){return g6().merge(L6())}function ha(){return m.union([m.object({type:m.literal(n.FunctionCall)}),m.record(m.string(),m.any())])}function ps(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.FunctionCall)})}function yp(){return m.object({id:m.string(),type:m.literal(n.FunctionCall)})}function j6(){return yp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function $6(){return yp().merge(m.object({}))}function G6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),writesValues:m.array(li()),declaration:ur(),inputs:m.array(Pr()),outputs:m.array(qt()),error:m.optional(qt()),parent:m.union([ui(),Xt()])})}function F6(){return j6().merge(G6())}function S6(){return m.enum([pt.Equal,pt.NotEqual,pt.MoreThan,pt.MoreThanOrEqual,pt.LessThan,pt.LessThanOrEqual,pt.And,pt.Or,yr.Empty,yr.NotEmpty])}function cs(){return m.union([m.object({type:m.literal(n.Condition)}),m.record(m.string(),m.any())])}function od(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Condition)})}function hp(){return m.object({id:m.string(),type:m.literal(n.Condition)})}function x6(){return hp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function k6(){return hp().merge(m.object({}))}function Z6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),leftValue:Pr(),rightValue:Pr().nullable(),operator:S6(),parent:m.union([ui(),Xt()])})}function q6(){return x6().merge(Z6())}function fs(){return m.union([m.object({type:m.literal(n.Search)}),m.record(m.string(),m.any())])}function ys(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Search)})}function mp(){return m.object({id:m.string(),type:m.literal(n.Search),name:m.string(),query:m.any(),description:m.string().nullable()})}function J6(){return mp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function W6(){return mp().merge(m.object({}))}function Y6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),inputsDeclarations:m.array(bn()),inputs:m.array(Pr()),outputsDeclarations:m.array(us()),outputs:m.array(qt()),parent:m.union([ui(),Xt()]),error:qt().nullable()})}function z6(){return J6().merge(Y6())}function hs(){return m.union([m.object({type:m.literal(n.InternalCall)}),m.record(m.string(),m.any())])}function vp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.InternalCall)})}function Tp(){return m.object({id:m.string(),type:m.literal(n.InternalCall),index:m.number()})}function H6(){return Tp().merge(m.object({version:m.number(),index:m.number()}))}function K6(){return Tp().merge(m.object({declaration:m.union([m.string(),ur()])}))}function X6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),writesValues:m.array(li()),declaration:ur(),inputs:m.array(Pr()),outputs:m.array(qt()),parent:Pi(),error:m.optional(qt())})}function Q6(){return H6().merge(X6())}function Pr(){return m.union([m.object({type:m.literal(n.InputMap)}),m.record(m.string(),m.any())])}function dd(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.InputMap)})}function Ep(){return m.object({id:m.string(),type:m.literal(n.InputMap),name:m.string().nullable().optional(),description:m.string().nullable().optional()})}function e3(){return Ep().merge(m.object({version:m.number(),index:m.number()}))}function t3(){return Ep().merge(m.object({}))}function r3(){return m.object({defaultValue:Ip().nullable(),declaration:m.union([bn(),mn()]).nullable(),readsValue:ms().nullable(),parent:m.union([et(),dd(),Sr(),di()])})}function i3(){return e3().merge(r3())}function ma(){return m.union([m.object({type:m.literal(n.Operation)}),m.record(m.string(),m.any())])}function va(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Operation)})}function ld(){return m.object({id:m.string(),type:m.literal(n.Operation)})}function n3(){return ld().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function a3(){return ld().merge(m.object({}))}function s3(){return ld().merge(m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),writesValues:m.array(li()),declaration:Fr(),inputs:m.array(Pr()),outputs:m.array(qt()),error:m.array(qt()),parent:m.union([ui(),Xt()])}))}function o3(){return n3().merge(s3())}function ud(){return m.union([m.string(),m.number(),m.boolean(),m.null(),m.date()])}function dD(){return m.record(m.string(),ud())}function d3(){return m.array(m.union([ud(),dD()]))}function lD(){return m.union([ud(),dD(),d3()])}function uD(){return m.union([ud(),lD()])}function pD(){return m.enum([g.String,g.Number,g.Boolean,g.Null,g.Date,g.KeyValue,g.Enum,g.File,g.UUID,g.EntityTemplate,g.ActionDescriptor])}function cD(){return m.union([Rn(),va(),vs()])}function l3(){return m.object({id:m.string(),name:pD(),type:m.literal(n.LiteralValue),value:uD(),autogeneration:np.nullable()})}function u3(){return l3().merge(m.object({}))}function wr(){return m.object({id:m.string(),version:m.number(),name:pD(),type:m.literal(n.LiteralValue),value:uD(),valueAsTypeList:m.array(cD()).nullable(),valueAsTypeSingle:cD().nullable(),autogeneration:np.nullable(),parent:m.union([bp(),dd()])})}function p3(){return wr().extend({name:m.literal(g.String),value:m.string(),autogeneration:tp.nullable()})}function c3(){return wr().extend({name:m.literal(g.Number),value:m.number(),autogeneration:rp.nullable()})}function f3(){return wr().extend({name:m.literal(g.Boolean),value:m.boolean(),autogeneration:ep.nullable()})}function y3(){return wr().extend({name:m.literal(g.Null),value:m.null(),autogeneration:m.null()})}function h3(){return wr().extend({name:m.literal(g.Date),value:m.date(),autogeneration:ip.nullable()})}function m3(){return wr().extend({name:m.literal(g.KeyValue),value:lD(),autogeneration:m.null()})}function v3(){return wr().extend({name:m.literal(g.Enum),value:m.string(),autogeneration:m.null()})}function T3(){return wr().extend({name:m.literal(g.File),value:m.string(),autogeneration:m.null()})}function E3(){return wr().extend({name:m.literal(g.UUID),value:m.string(),autogeneration:Qu.nullable()})}function I3(){return wr().extend({name:m.literal(g.EntityTemplate),value:Rn(),autogeneration:m.null()})}function b3(){return wr().extend({name:m.literal(g.ActionDescriptor),value:vs(),autogeneration:m.null()})}function Ip(){return m.union([p3(),c3(),f3(),y3(),h3(),m3(),v3(),T3(),E3(),I3(),b3()])}function En(){return m.union([m.object({type:m.literal(n.DataType)}),m.record(m.string(),m.any())])}function bp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.DataType)})}function Rp(){return m.object({id:m.string(),type:m.literal(n.DataType),isNullable:m.boolean(),isList:m.boolean(),constant:m.boolean(),asType:m.boolean(),options:m.array(m.string()).optional()})}function R3(){return Rp().merge(m.object({version:m.number()}))}function A3(){return Rp().merge(m.object({}))}function D3(){return m.object({defaultValue:Ip().nullable(),entity:m.union([Ta(),la(),rd(),Fr()]).nullable(),parent:m.union([nD(),hD(),iD()])})}function O3(){return R3().merge(D3())}function Ap(){return m.union([m.object({type:m.literal(n.VariableDeclaration)}),m.record(m.string(),m.any())])}function P3(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.VariableDeclaration)})}function Dp(){return m.object({id:m.string(),type:m.literal(n.VariableDeclaration),name:m.string(),description:m.string().nullable()})}function w3(){return Dp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function V3(){return Dp().merge(m.object({}))}function C3(){return m.object({dataType:En().nullable(),readsValue:ms().nullable(),writesValues:m.array(li()),inputs:m.array(Pr()),outputs:m.array(qt()),successCalls:m.array(Dt()),errorCalls:m.array(Dt()),internalCalls:m.array(hs()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),parent:m.union([ui(),Xt()])})}function B3(){return w3().merge(C3())}function fD(){return m.union([m.object({type:m.literal(n.VariableInstance)}),m.record(m.string(),m.any())])}function _3(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.VariableInstance)})}function Op(){return m.object({id:m.string(),type:m.literal(n.VariableInstance)})}function M3(){return Op().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function g3(){return Op().merge(m.object({}))}function N3(){return m.object({declaration:Ap(),dataType:En().nullable(),readsValue:ms().nullable(),writesValues:m.array(li()),inputs:m.array(Pr()),outputs:m.array(qt()),successCalls:m.array(Dt()),errorCalls:m.array(Dt()),internalCalls:m.array(hs()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),parent:m.union([ui(),Xt()])})}function L3(){return M3().merge(N3())}function Pp(){return m.union([m.object({type:m.literal(n.InstalledProject)}),m.record(m.string(),m.any())])}function pd(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.InstalledProject)})}function U3(){return m.object({id:m.string(),type:m.literal(n.InstalledProject)})}function j3(){return m.object({version:m.number(),x:m.number(),y:m.number()})}function $3(){return m.object({})}function G3(){return m.object({implements:Xt(),description:m.string().nullable(),functions:m.array(ur()),events:m.array(wp()),parent:Xt()})}function F3(){return j3().merge(G3())}function wp(){return m.union([m.object({type:m.literal(n.GlobalEvent)}),m.record(m.string(),m.any())])}function S3(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.GlobalEvent)})}function cd(){return m.object({id:m.string(),type:m.literal(n.GlobalEvent),name:m.string(),collapsed:m.boolean()})}function x3(){return cd().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function k3(){return cd().merge(m.object({}))}function Z3(){return cd().merge(m.object({returnStatements:m.array(Tn()),implements:m.array(aD()),inputs:m.array(bn()),calls:m.array(Dt()),parent:m.union([Xt(),pd()])}))}function q3(){return x3().merge(Z3())}function In(){return m.union([Ap(),fD()])}function Pi(){return m.union([P3(),_3()])}function li(){return m.union([In(),Pr(),oi()])}function yD(){return m.union([Pi(),dd(),oD()])}function ms(){return m.union([In(),bn(),qt(),ma(),hs(),ha()])}function J3(){return m.union([Pi(),Vp(),cp(),va(),vp(),ps()])}function W3(){return m.union([bn(),qt(),li()])}function hD(){return m.union([Vp(),cp(),yD()])}function fd(){return wp()}function yd(){return S3()}function hd(){return m.union([ma(),ha(),cs(),fs(),In(),hs(),ua()])}function et(){return m.union([va(),ps(),od(),ys(),Pi(),vp(),Sr()])}function md(){return m.union([ma(),ha(),cs(),fs(),In(),ua()])}function vd(){return m.union([va(),ps(),od(),ys(),Pi(),Sr()])}function mD(){return m.union([hd(),Tn(),ya(),pa()])}function Dt(){return m.union([et(),fa(),di(),ca()])}function vD(){return m.union([md(),Tn(),ya(),pa()])}function TD(){return m.union([vd(),fa(),di(),ca()])}function wi(){return m.union([ur(),fd()])}function bt(){return m.union([vs(),yd()])}function Y3(){return m.union([hd(),wi()])}function z3(){return m.union([et(),bt()])}function H3(){return m.union([md(),wi()])}function K3(){return m.union([vd(),bt()])}function X3(){return m.union([mD(),wi()])}function Q3(){return m.union([Dt(),bt()])}function e5(){return m.union([vD(),wi()])}function t5(){return m.union([TD(),bt()])}function r5(){return m.union([wi(),ua()])}function ui(){return m.union([bt(),Sr()])}function i5(){return m.union([hd(),wi()])}function n5(){return m.union([et(),bt()])}function a5(){return m.union([md(),wi()])}function s5(){return m.union([vd(),bt()])}function o5(){return m.union([Tn(),ya(),pa()])}function d5(){return m.union([fa(),di(),ca()])}function l5(){return m.union([la(),b5(),Pp(),Ta(),ur(),fd(),In(),Pr(),qt(),cs(),ma(),ha(),oi(),bn(),rd(),En(),mn(),Fr(),Tn(),pa(),ya(),ua(),fs(),Fr(),Fr(),us(),hs()])}function u5(){return m.union([ad(),Xt(),pd(),Rn(),vs(),yd(),Pi(),dd(),cp(),od(),va(),ps(),oD(),Vp(),id(),bp(),nD(),vn(),fa(),ca(),di(),Sr(),ys(),vn(),vn(),iD(),vp()])}function p5(){return m.union([Pp(),Ta(),ur(),fd(),In(),cs(),ma(),ha(),Tn(),pa(),ya(),ua(),fs()])}function c5(){return m.union([pd(),Rn(),vs(),yd(),Pi(),od(),va(),ps(),fa(),ca(),di(),Sr(),ys()])}function bn(){return m.union([m.object({type:m.literal(n.ArgumentDeclaration)}),m.record(m.string(),m.any())])}function Vp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ArgumentDeclaration)})}function Cp(){return m.object({id:m.string(),type:m.literal(n.ArgumentDeclaration)})}function f5(){return Cp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function y5(){return Cp().merge(m.object({}))}function h5(){return m.object({dataType:En().nullable(),writesValues:m.array(li()),parent:m.union([bt(),vn(),vn(),ys(),di()])})}function m5(){return f5().merge(h5())}function ur(){return m.union([m.object({type:m.literal(n.FunctionDeclaration)}),m.record(m.string(),m.any())])}function vs(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.FunctionDeclaration)})}function Bp(){return m.object({id:m.string(),type:m.literal(n.FunctionDeclaration),name:m.string(),description:m.string().nullable()})}function v5(){return Bp().merge(m.object({version:m.number(),x:m.number(),y:m.number(),index:m.number().nullable()}))}function T5(){return Bp()}function E5(){return m.object({inputs:m.array(bn()),implements:Fr().nullable(),returnStatements:m.array(Tn()),parent:m.union([Xt(),pd(),Rn(),Sr(),ad(),id()])})}function I5(){return v5().merge(E5())}function b5(){return m.union([m.object({type:m.literal(n.Project)}),m.record(m.string(),m.any())])}function Xt(){return m.object({entityType:m.literal(n.Project),entityId:m.string(),id:m.string(),type:m.literal(n.GenericReference)})}function _p(){return m.object({id:m.string(),type:m.literal(n.Project),name:m.string(),description:m.string().nullable()})}function R5(){return _p().merge(m.object({version:m.number()}))}function A5(){return _p()}function D5(){return m.object({entities:m.array(Ta()),functions:m.array(ur()),events:m.array(wp()),projects:m.array(Pp()),variableDeclarations:m.array(Ap()),variableInstances:m.array(fD()),conditions:m.array(cs()),operations:m.array(ma()),functionCalls:m.array(ha()),loops:m.array(ua()),searches:m.array(fs())})}function O5(){return R5().merge(D5())}function Ta(){return m.union([m.object({type:m.literal(n.DefinitionEntity)}),m.record(m.string(),m.any())])}function Rn(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.DefinitionEntity)})}function Mp(){return m.object({id:m.string(),type:m.literal(n.DefinitionEntity),name:m.string(),description:m.string().nullable(),static:m.boolean(),abstract:m.boolean()})}function P5(){return Mp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function w5(){return Mp().merge(m.object({}))}function V5(){return m.union([Xt(),bp()])}function C5(){return m.object({properties:m.array(mn()),methods:m.array(ur()),abstractMethods:m.array(Fr()),extends:m.array(m.union([Ta(),la()])),implements:m.array(m.union([Ta(),la()])),parent:V5()})}function B5(){return P5().merge(C5())}function _5(i){const s=B5(),e=i.toJSON();s.safeParse(e).success;const r=i.implements.flatMap(h=>N5(i,h)),a=i.extends.flatMap(h=>L5(i,h)),d=j5(i),o=U5(i);i.methods.flatMap(h=>h.validate());const l=[...r,...a,...d,...o];return Ye(i.errors,l)}function M5(i,s){const e=s.properties.filter(a=>a.abstract),t=[];let r=[...i.properties];return e.forEach(a=>{const d=r.find(o=>{var l;return((l=o.implements)==null?void 0:l.id)===a.id});d?r=r.filter(o=>o.id!==d.id):t.push(a)}),t}function g5(i,s){const e=s.abstractMethods,t=[];let r=[...i.methods];return e.forEach(a=>{const d=r.find(o=>{var l;return((l=o.implements)==null?void 0:l.id)===a.id});d?r=r.filter(o=>o.id!==d.id):t.push(a)}),t}function N5(i,s){const e=[];if(!s.abstract){const h=ye({id:i.id+"--"+q.ImplementingNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is implementing a non-abstract entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:q.ImplementingNonAbstractEntity,entity:i});return e.push(h.error),e}const t=s.properties.filter(h=>h.abstract),r=[];let a=[...i.properties];t.forEach(h=>{const c=a.find(v=>{var E;return((E=v.implements)==null?void 0:E.id)===h.id});c?a=a.filter(v=>v.id!==c.id):r.push(h)}),r.length&&r.forEach(h=>{const c=ye({id:i.id+"--"+q.MissingPropertyImplementation+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${s.name}" with id "${s.id}" is not implemented when entity "${i.name}" with id "${i.id}" implements it`,issue:null,severity:D.Error,code:q.MissingPropertyImplementation,entity:i});e.push(c.error)});const d=[];let o=[...i.methods];s.abstractMethods.forEach(h=>{const c=o.find(v=>{var E;return((E=v.implements)==null?void 0:E.id)===h.id});c?o=o.filter(v=>v.id!==c.id):d.push(h)}),d.length&&d.forEach(h=>{const c=ye({id:i.id+"--"+q.MissingMethodImplementation+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${s.name}" with id "${s.id}" is not implemented when entity "${i.name}" with id "${i.id}" implements it`,issue:null,severity:D.Error,code:q.MissingMethodImplementation,entity:i});e.push(c.error)});const l=[];s.properties.forEach(h=>{const c=a.find(v=>v.name===h.name);c&&l.push([c,h])}),l.length&&l.forEach(([h])=>{const c=ye({id:i.id+"--"+j.PropertyOverwrite+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${i.name}" with id "${i.id}" overwrites the property with the same name from the base entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.PropertyOverwrite,entity:i});e.push(c.error)});const p=[];return s.methods.forEach(h=>{const c=o.find(v=>v.name===h.name);c&&p.push([c,h])}),p.length&&p.forEach(([h])=>{const c=ye({id:i.id+"--"+j.MethodOverwrite+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${i.name}" with id "${i.id}" overwrites the method with the same name from the base entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.MethodOverwrite,entity:i});e.push(c.error)}),e}function L5(i,s){const e=[],t=[];if(s.abstract){const a=ye({id:i.id+"--"+q.ExtendingAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is extending an abstract entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:q.ExtendingAbstractEntity,entity:i});return e.push(a.error),e}i.properties.forEach(a=>{var o;const d=s.properties.find(l=>l.name===a.name);((o=a.implements)==null?void 0:o.id)!==(d==null?void 0:d.id)&&d&&t.push(a)}),t.length&&t.forEach(a=>{const d=ye({id:i.id+"--"+j.PropertyOverwrite,message:`Property "${a.name}" with id "${a.id}" of entity "${i.name}" with id "${i.id}" overwrites the property with the same name from the extended entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.PropertyOverwrite,entity:i});e.push(d.error)});const r=[];return i.methods.forEach(a=>{var o;const d=s.methods.find(l=>l.name===a.name);((o=a.implements)==null?void 0:o.id)!==(d==null?void 0:d.id)&&d&&r.push(a)}),r.length&&r.forEach(a=>{const d=ye({id:i.id+"--"+j.MethodOverwrite,message:`Method "${a.name}" with id "${a.id}" of entity "${i.name}" with id "${i.id}" overwrites the method with the same name from the extended entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.MethodOverwrite,entity:i});e.push(d.error)}),e}function U5(i){const s=[];if(!i.properties.length){const e=ye({id:i.id+"--"+q.NoProperties,message:"No properties implemented",issue:null,severity:D.Warning,code:q.NoProperties,entity:i});s.push(e.error)}return i.properties.forEach(e=>{e.validate()}),s}function j5(i){const s=[];if(i.abstract){if(i.methods.length){const e=ye({id:i.id+"--"+q.AbstractEntityWithNonAbstractMethods,message:`Entity "${i.name}" with id "${i.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:D.Error,code:q.AbstractEntityWithNonAbstractMethods,entity:i});s.push(e.error)}if(i.properties.some(e=>!e.abstract)){const e=ye({id:i.id+"--"+q.AbstractEntityWithNonAbstractProperties,message:`Entity "${i.name}" with id "${i.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:D.Error,code:q.AbstractEntityWithNonAbstractProperties,entity:i});s.push(e.error),i.properties.forEach(t=>{if(!t.abstract){const r=ye({id:i.id+"--"+q.StaticEntityWithNonStaticProperties+"--"+t.id,message:`Property "${t.name}" with id "${t.id}" of entity "${i.name}" with id "${i.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:D.Error,code:q.StaticEntityWithNonStaticProperties,entity:i});s.push(r.error)}})}}else{if(i.abstractMethods.length){const e=ye({id:i.id+"--"+q.AbstractPropertyInNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is not marked as abstract but has abstract methods`,issue:null,severity:D.Error,code:q.AbstractPropertyInNonAbstractEntity,entity:i});s.push(e.error)}if(i.properties.some(e=>e.abstract)){const e=ye({id:i.id+"--"+q.AbstractMethodInNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is not marked as abstract but has abstract properties`,issue:null,severity:D.Error,code:q.AbstractMethodInNonAbstractEntity,entity:i});s.push(e.error),i.properties.forEach(t=>{if(t.abstract){const r=ye({id:i.id+"--"+q.AbstractMethodInNonAbstractEntity+"--"+t.id,message:`Property "${t.name}" with id "${t.id}" of entity "${i.name}" with id "${i.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:D.Error,code:q.AbstractMethodInNonAbstractEntity,entity:i});s.push(r.error)}})}}if(i.static&&i.properties.some(e=>!e.static)){const e=ye({id:i.id+"--"+q.StaticEntityWithNonStaticProperties,message:`Entity "${i.name}" with id "${i.id}" is marked as static but has non-static properties`,issue:null,severity:D.Error,code:q.StaticEntityWithNonStaticProperties,entity:i});s.push(e.error),i.properties.forEach(t=>{if(!t.static){const r=ye({id:i.id+"--"+q.NonStaticPropertyInStaticEntity+"--"+t.id,message:`Property "${t.name}" with id "${t.id}" of entity "${i.name}" with id "${i.id}" is not marked as static but the entity is marked as static`,issue:null,severity:D.Error,code:q.NonStaticPropertyInStaticEntity,entity:i});s.push(r.error)}})}return s}function $5(i){return i instanceof Error&&i.name==="ZodError"&&"issues"in i&&Array.isArray(i.issues)}var G5=class extends Error{constructor(s,e){super(s,e);f(this,"name");f(this,"details");this.name="ZodValidationError",this.details=F5(e)}toString(){return this.message}};function F5(i){if(i){const s=i.cause;if($5(s))return s.issues}return[]}function S5(i){return i.length!==0}var x5=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function k5(i){return i.length===1?i[0].toString():i.reduce((s,e)=>{if(typeof e=="number")return s+"["+e.toString()+"]";if(e.includes('"'))return s+'["'+Z5(e)+'"]';if(!x5.test(e))return s+'["'+e+'"]';const t=s.length===0?"":".";return s+t+e},"")}function Z5(i){return i.replace(/"/g,'\\"')}var q5="; ",J5=99,ED="Validation error",W5=": ",Y5=", or ";function z5(i={}){const{issueSeparator:s=q5,unionSeparator:e=Y5,prefixSeparator:t=W5,prefix:r=ED,includePath:a=!0,maxIssuesInMessage:d=J5}=i;return o=>{const l=o.slice(0,d).map(p=>Td({issue:p,issueSeparator:s,unionSeparator:e,includePath:a})).join(s);return H5(l,r,t)}}function Td(i){const{issue:s,issueSeparator:e,unionSeparator:t,includePath:r}=i;if(s.code===x.invalid_union)return s.unionErrors.reduce((a,d)=>{const o=d.issues.map(l=>Td({issue:l,issueSeparator:e,unionSeparator:t,includePath:r})).join(e);return a.includes(o)||a.push(o),a},[]).join(t);if(s.code===x.invalid_arguments)return[s.message,...s.argumentsError.issues.map(a=>Td({issue:a,issueSeparator:e,unionSeparator:t,includePath:r}))].join(e);if(s.code===x.invalid_return_type)return[s.message,...s.returnTypeError.issues.map(a=>Td({issue:a,issueSeparator:e,unionSeparator:t,includePath:r}))].join(e);if(r&&S5(s.path)){if(s.path.length===1){const a=s.path[0];if(typeof a=="number")return`${s.message} at index ${a}`}return`${s.message} at "${k5(s.path)}"`}return s.message}function H5(i,s,e){return s!==null?i.length>0?[s,i].join(e):s:i.length>0?i:ED}function K5(i,s={}){const t=X5(s)([i]);return new G5(t,{cause:new Kt([i])})}function X5(i){return"messageBuilder"in i?i.messageBuilder:z5(i)}var ID="1.13.7",bD=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Ed=Array.prototype,gp=Object.prototype,RD=typeof Symbol<"u"?Symbol.prototype:null,Q5=Ed.push,Ts=Ed.slice,Es=gp.toString,eZ=gp.hasOwnProperty,AD=typeof ArrayBuffer<"u",tZ=typeof DataView<"u",rZ=Array.isArray,DD=Object.keys,OD=Object.create,PD=AD&&ArrayBuffer.isView,iZ=isNaN,nZ=isFinite,wD=!{toString:null}.propertyIsEnumerable("toString"),VD=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],aZ=Math.pow(2,53)-1;function Qt(i,s){return s=s==null?i.length-1:+s,function(){for(var e=Math.max(arguments.length-s,0),t=Array(e),r=0;r<e;r++)t[r]=arguments[r+s];switch(s){case 0:return i.call(this,t);case 1:return i.call(this,arguments[0],t);case 2:return i.call(this,arguments[0],arguments[1],t)}var a=Array(s+1);for(r=0;r<s;r++)a[r]=arguments[r];return a[s]=t,i.apply(this,a)}}function Vi(i){var s=typeof i;return s==="function"||s==="object"&&!!i}function sZ(i){return i===null}function CD(i){return i===void 0}function BD(i){return i===!0||i===!1||Es.call(i)==="[object Boolean]"}function oZ(i){return!!(i&&i.nodeType===1)}function jt(i){var s="[object "+i+"]";return function(e){return Es.call(e)===s}}const Np=jt("String"),_D=jt("Number"),dZ=jt("Date"),lZ=jt("RegExp"),uZ=jt("Error"),MD=jt("Symbol"),gD=jt("ArrayBuffer");var ND=jt("Function"),pZ=bD.document&&bD.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof pZ!="function"&&(ND=function(i){return typeof i=="function"||!1});const Jt=ND,LD=jt("Object");var UD=tZ&&(!/\[native code\]/.test(String(DataView))||LD(new DataView(new ArrayBuffer(8)))),Lp=typeof Map<"u"&&LD(new Map),cZ=jt("DataView");function fZ(i){return i!=null&&Jt(i.getInt8)&&gD(i.buffer)}const Id=UD?fZ:cZ,An=rZ||jt("Array");function Ci(i,s){return i!=null&&eZ.call(i,s)}var Up=jt("Arguments");(function(){Up(arguments)||(Up=function(i){return Ci(i,"callee")})})();const jp=Up;function yZ(i){return!MD(i)&&nZ(i)&&!isNaN(parseFloat(i))}function jD(i){return _D(i)&&iZ(i)}function $D(i){return function(){return i}}function GD(i){return function(s){var e=i(s);return typeof e=="number"&&e>=0&&e<=aZ}}function FD(i){return function(s){return s==null?void 0:s[i]}}const bd=FD("byteLength"),hZ=GD(bd);var mZ=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function vZ(i){return PD?PD(i)&&!Id(i):hZ(i)&&mZ.test(Es.call(i))}const SD=AD?vZ:$D(!1),er=FD("length");function TZ(i){for(var s={},e=i.length,t=0;t<e;++t)s[i[t]]=!0;return{contains:function(r){return s[r]===!0},push:function(r){return s[r]=!0,i.push(r)}}}function xD(i,s){s=TZ(s);var e=VD.length,t=i.constructor,r=Jt(t)&&t.prototype||gp,a="constructor";for(Ci(i,a)&&!s.contains(a)&&s.push(a);e--;)a=VD[e],a in i&&i[a]!==r[a]&&!s.contains(a)&&s.push(a)}function Pt(i){if(!Vi(i))return[];if(DD)return DD(i);var s=[];for(var e in i)Ci(i,e)&&s.push(e);return wD&&xD(i,s),s}function Is(i){if(i==null)return!0;var s=er(i);return typeof s=="number"&&(An(i)||Np(i)||jp(i))?s===0:er(Pt(i))===0}function kD(i,s){var e=Pt(s),t=e.length;if(i==null)return!t;for(var r=Object(i),a=0;a<t;a++){var d=e[a];if(s[d]!==r[d]||!(d in r))return!1}return!0}function ze(i){if(i instanceof ze)return i;if(!(this instanceof ze))return new ze(i);this._wrapped=i}ze.VERSION=ID,ze.prototype.value=function(){return this._wrapped},ze.prototype.valueOf=ze.prototype.toJSON=ze.prototype.value,ze.prototype.toString=function(){return String(this._wrapped)};function ZD(i){return new Uint8Array(i.buffer||i,i.byteOffset||0,bd(i))}var qD="[object DataView]";function $p(i,s,e,t){if(i===s)return i!==0||1/i===1/s;if(i==null||s==null)return!1;if(i!==i)return s!==s;var r=typeof i;return r!=="function"&&r!=="object"&&typeof s!="object"?!1:JD(i,s,e,t)}function JD(i,s,e,t){i instanceof ze&&(i=i._wrapped),s instanceof ze&&(s=s._wrapped);var r=Es.call(i);if(r!==Es.call(s))return!1;if(UD&&r=="[object Object]"&&Id(i)){if(!Id(s))return!1;r=qD}switch(r){case"[object RegExp]":case"[object String]":return""+i==""+s;case"[object Number]":return+i!=+i?+s!=+s:+i==0?1/+i===1/s:+i==+s;case"[object Date]":case"[object Boolean]":return+i==+s;case"[object Symbol]":return RD.valueOf.call(i)===RD.valueOf.call(s);case"[object ArrayBuffer]":case qD:return JD(ZD(i),ZD(s),e,t)}var a=r==="[object Array]";if(!a&&SD(i)){var d=bd(i);if(d!==bd(s))return!1;if(i.buffer===s.buffer&&i.byteOffset===s.byteOffset)return!0;a=!0}if(!a){if(typeof i!="object"||typeof s!="object")return!1;var o=i.constructor,l=s.constructor;if(o!==l&&!(Jt(o)&&o instanceof o&&Jt(l)&&l instanceof l)&&"constructor"in i&&"constructor"in s)return!1}e=e||[],t=t||[];for(var p=e.length;p--;)if(e[p]===i)return t[p]===s;if(e.push(i),t.push(s),a){if(p=i.length,p!==s.length)return!1;for(;p--;)if(!$p(i[p],s[p],e,t))return!1}else{var h=Pt(i),c;if(p=h.length,Pt(s).length!==p)return!1;for(;p--;)if(c=h[p],!(Ci(s,c)&&$p(i[c],s[c],e,t)))return!1}return e.pop(),t.pop(),!0}function EZ(i,s){return $p(i,s)}function bs(i){if(!Vi(i))return[];var s=[];for(var e in i)s.push(e);return wD&&xD(i,s),s}function Gp(i){var s=er(i);return function(e){if(e==null)return!1;var t=bs(e);if(er(t))return!1;for(var r=0;r<s;r++)if(!Jt(e[i[r]]))return!1;return i!==zD||!Jt(e[Fp])}}var Fp="forEach",WD="has",Sp=["clear","delete"],YD=["get",WD,"set"],IZ=Sp.concat(Fp,YD),zD=Sp.concat(YD),bZ=["add"].concat(Sp,Fp,WD);const RZ=Lp?Gp(IZ):jt("Map"),AZ=Lp?Gp(zD):jt("WeakMap"),DZ=Lp?Gp(bZ):jt("Set"),OZ=jt("WeakSet");function Ea(i){for(var s=Pt(i),e=s.length,t=Array(e),r=0;r<e;r++)t[r]=i[s[r]];return t}function PZ(i){for(var s=Pt(i),e=s.length,t=Array(e),r=0;r<e;r++)t[r]=[s[r],i[s[r]]];return t}function HD(i){for(var s={},e=Pt(i),t=0,r=e.length;t<r;t++)s[i[e[t]]]=e[t];return s}function xp(i){var s=[];for(var e in i)Jt(i[e])&&s.push(e);return s.sort()}function kp(i,s){return function(e){var t=arguments.length;if(s&&(e=Object(e)),t<2||e==null)return e;for(var r=1;r<t;r++)for(var a=arguments[r],d=i(a),o=d.length,l=0;l<o;l++){var p=d[l];(!s||e[p]===void 0)&&(e[p]=a[p])}return e}}const KD=kp(bs),Rd=kp(Pt),XD=kp(bs,!0);function wZ(){return function(){}}function QD(i){if(!Vi(i))return{};if(OD)return OD(i);var s=wZ();s.prototype=i;var e=new s;return s.prototype=null,e}function VZ(i,s){var e=QD(i);return s&&Rd(e,s),e}function CZ(i){return Vi(i)?An(i)?i.slice():KD({},i):i}function BZ(i,s){return s(i),i}function e1(i){return An(i)?i:[i]}ze.toPath=e1;function Rs(i){return ze.toPath(i)}function Zp(i,s){for(var e=s.length,t=0;t<e;t++){if(i==null)return;i=i[s[t]]}return e?i:void 0}function t1(i,s,e){var t=Zp(i,Rs(s));return CD(t)?e:t}function _Z(i,s){s=Rs(s);for(var e=s.length,t=0;t<e;t++){var r=s[t];if(!Ci(i,r))return!1;i=i[r]}return!!e}function qp(i){return i}function As(i){return i=Rd({},i),function(s){return kD(s,i)}}function Jp(i){return i=Rs(i),function(s){return Zp(s,i)}}function Ds(i,s,e){if(s===void 0)return i;switch(e??3){case 1:return function(t){return i.call(s,t)};case 3:return function(t,r,a){return i.call(s,t,r,a)};case 4:return function(t,r,a,d){return i.call(s,t,r,a,d)}}return function(){return i.apply(s,arguments)}}function r1(i,s,e){return i==null?qp:Jt(i)?Ds(i,s,e):Vi(i)&&!An(i)?As(i):Jp(i)}function Wp(i,s){return r1(i,s,1/0)}ze.iteratee=Wp;function tr(i,s,e){return ze.iteratee!==Wp?ze.iteratee(i,s):r1(i,s,e)}function MZ(i,s,e){s=tr(s,e);for(var t=Pt(i),r=t.length,a={},d=0;d<r;d++){var o=t[d];a[o]=s(i[o],o,i)}return a}function i1(){}function gZ(i){return i==null?i1:function(s){return t1(i,s)}}function NZ(i,s,e){var t=Array(Math.max(0,i));s=Ds(s,e,1);for(var r=0;r<i;r++)t[r]=s(r);return t}function Yp(i,s){return s==null&&(s=i,i=0),i+Math.floor(Math.random()*(s-i+1))}const Os=Date.now||function(){return new Date().getTime()};function n1(i){var s=function(a){return i[a]},e="(?:"+Pt(i).join("|")+")",t=RegExp(e),r=RegExp(e,"g");return function(a){return a=a==null?"":""+a,t.test(a)?a.replace(r,s):a}}const a1={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},LZ=n1(a1),UZ=HD(a1),jZ=n1(UZ),$Z=ze.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var zp=/(.)^/,GZ={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},FZ=/\\|'|\r|\n|\u2028|\u2029/g;function SZ(i){return"\\"+GZ[i]}var xZ=/^\s*(\w|\$)+\s*$/;function kZ(i,s,e){!s&&e&&(s=e),s=XD({},s,ze.templateSettings);var t=RegExp([(s.escape||zp).source,(s.interpolate||zp).source,(s.evaluate||zp).source].join("|")+"|$","g"),r=0,a="__p+='";i.replace(t,function(p,h,c,v,E){return a+=i.slice(r,E).replace(FZ,SZ),r=E+p.length,h?a+=`'+
|
|
24
|
+
LIMIT 10 OFFSET 0;`,x8={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:n.GenericReference,entityId:ue,version:"1",entityType:n.Project},k8={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",version:"1",entityType:n.Search},LA={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:n.ValueDescriptor,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"companies",description:"List of companies with multiple employees and an existing bank account",defaultValue:null,dataType:null,required:!0,parentRelationType:M.FixedReturns,index:0,parent:k8},Z8={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",version:"1",entityType:n.Search},q8={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:LA,writesValues:[],index:0,parent:Z8},J8={id:"find-companies-with-multiple-employees-and-bank-account",type:n.Search,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!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:[LA],inputs:[],outputs:[q8],query:S8,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:x8},W8={type:n.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:bA},Y8={type:n.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},UA={id:kk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:W8,parent:Y8},z8={type:n.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:EA},H8={type:n.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},jA={id:xk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:z8,parent:H8},K8={type:n.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:TA},X8={type:n.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},$A={id:Sk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:K8,parent:X8},Q8={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:vA},e9={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},GA={id:Fk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:Q8,parent:e9},t9={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:RA},r9={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},FA={id:Gk,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,index:0,readsValue:t9,parent:r9},i9={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Ju},n9={id:bA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:dr.properties[0],defaultValue:null,index:0,writesValues:[UA],parent:i9},a9={type:n.GenericReference,id:"manager-variable-data-type-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Ju},s9={like:!1,inferred:!1,id:"manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,entity:vr,asType:!1,isList:!1,parent:a9},o9={type:n.GenericReference,id:"manager-variable-reads-value-ref-id",version:"1",entityType:n.OutputMap,entityId:IA},d9={type:n.GenericReference,id:"manager-variable-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},SA={constant:!0,required:!0,id:Ju,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Manager",dataType:s9,description:"A variable holding an inherited manager for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:o9,writesValues:[],inputs:[],outputs:[n9],internalCalls:[],parent:d9,x:0,y:0},l9={type:n.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},u9={id:IA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:vr.properties[2],index:3,writesValues:[SA],parent:l9},p9={type:n.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},c9={id:EA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:vr.properties[0],index:2,writesValues:[jA],parent:p9},f9={type:n.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},y9={id:TA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:xt.properties[1],index:1,writesValues:[$A],parent:f9},h9={type:n.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},m9={id:vA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:dr.properties[0],index:0,writesValues:[GA],parent:h9},v9={type:n.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:da},T9={like:!1,inferred:!1,id:"random-company-employee-test-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,entity:vr,asType:!1,isList:!1,parent:v9},E9={type:n.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},I9={constant:!0,required:!0,id:da,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Company employee",dataType:T9,description:"A variable holding a random company employee for testing purposes",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[m9,y9,c9,u9],internalCalls:[],parent:E9,x:0,y:0},b9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",version:"1",entityType:n.InputMap,entityId:AA},R9={type:n.LiteralValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:g.Date,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,valueAsTypeList:null,valueAsTypeSingle:null,value:null,autogeneration:{type:yt.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:b9},A9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",version:"1",entityType:n.VariableInstance,entityId:yn},D9={id:AA,type:n.InputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:R9,index:5,readsValue:null,parent:A9},O9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},P9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:Gr},w9={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},V9={id:yn,type:n.VariableInstance,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:O9,calledByError:[],calledByEntry:[],calledBySuccess:[P9],successCalls:[Yu,_A,DA],errorCalls:[],readsValue:null,writesValues:[BA],inputs:[D9],outputs:[],internalCalls:[],parent:w9,x:0,y:0},C9={type:n.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},B9={constant:!0,required:!0,id:Gr,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",defaultValue:null,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Yu,V9],errorCalls:[],readsValue:null,writesValues:[wA],inputs:[FA,GA,$A,jA,UA],outputs:[],internalCalls:[],parent:C9,x:0,y:0},_9={type:n.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",version:"1",entityType:n.VariableDeclaration,entityId:GI},M9={like:!1,inferred:!1,id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:cu,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,asType:!1,isList:!1,parent:_9},g9={type:n.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",version:"1",entityType:n.Project,entityId:ue},xA={constant:!0,required:!0,id:GI,type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Current user",description:"The user that is currently logged in",defaultValue:null,dataType:M9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:g9},N9={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",version:"1",entityType:n.VariableInstance,entityId:mA},L9={id:RA,type:n.OutputMap,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:dr.properties[0],index:0,writesValues:[FA],parent:N9},U9={type:n.GenericReference,id:"global-user-instance-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},j9={id:mA,type:n.VariableInstance,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:xA,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[L9],internalCalls:[],parent:U9,x:0,y:0},$9={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},G9={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",version:"1",entityType:n.VariableDeclaration,entityId:"is-test-environment-variable-dcl-id"},F9={like:!1,inferred:!1,id:"is-test-environment-variable-dcl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Kr,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,asType:!1,isList:!1,parent:$9},S9={type:n.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",version:"1",entityType:n.Project,entityId:ue},kA={constant:!0,required:!0,id:"is-test-environment-variable-dcl-id",type:n.VariableDeclaration,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:g.Boolean,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,value:null,type:n.LiteralValue,autogeneration:{type:yt.Random,rangeStart:null,rangeEnd:null},valueAsTypeList:null,valueAsTypeSingle:null,parent:G9},dataType:F9,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:S9},x9={type:n.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",version:"1",entityType:n.Project,entityId:ue},k9={id:"is-test-environment-variable-instance-id",type:n.VariableInstance,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!1,defaultValue:null,declaration:kA,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:x9,x:0,y:0},ZA={type:n.Project,id:ue,version:"1",createdAt:"2024-01-01T00:00:00.000Z",author:"1",previousVersion:null,deleted:!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:[Mk],entities:[pu,dr,cu,xt,D2,vr,$o,rb,ib,ta,iL,Tr,KL,uu,TC,d2,tL],functions:[KF,Ob,Cu,sS,hS,jb,Bu,mu,Vk,cb,nx],events:[iU],variableDeclarations:[kA,xA,Lu,I9,SA,B9],variableInstances:[k9,j9],conditions:[],operations:[aa],functionCalls:[i4,yj],loops:[F8,Yu,_A,B8,DA],searches:[J8]};var qA={exports:{}};(function(i,s){(function(e,t){i.exports=t()})(xw,function(){var e=1e3,t=6e4,r=36e5,a="millisecond",d="second",o="minute",l="hour",p="day",h="week",c="month",v="quarter",E="year",O="date",w="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,F={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(he){var te=["th","st","nd","rd"],Y=he%100;return"["+he+(te[(Y-20)%10]||te[Y]||te[0])+"]"}},_=function(he,te,Y){var de=String(he);return!de||de.length>=te?he:""+Array(te+1-de.length).join(Y)+he},$={s:_,z:function(he){var te=-he.utcOffset(),Y=Math.abs(te),de=Math.floor(Y/60),Q=Y%60;return(te<=0?"+":"-")+_(de,2,"0")+":"+_(Q,2,"0")},m:function he(te,Y){if(te.date()<Y.date())return-he(Y,te);var de=12*(Y.year()-te.year())+(Y.month()-te.month()),Q=te.clone().add(de,c),Ue=Y-Q<0,je=te.clone().add(de+(Ue?-1:1),c);return+(-(de+(Y-Q)/(Ue?Q-je:je-Q))||0)},a:function(he){return he<0?Math.ceil(he)||0:Math.floor(he)},p:function(he){return{M:c,y:E,w:h,d:p,D:O,h:l,m:o,s:d,ms:a,Q:v}[he]||String(he||"").toLowerCase().replace(/s$/,"")},u:function(he){return he===void 0}},k="en",W={};W[k]=F;var ee="$isDayjsObject",pe=function(he){return he instanceof Ht||!(!he||!he[ee])},Te=function he(te,Y,de){var Q;if(!te)return k;if(typeof te=="string"){var Ue=te.toLowerCase();W[Ue]&&(Q=Ue),Y&&(W[Ue]=Y,Q=Ue);var je=te.split("-");if(!Q&&je.length>1)return he(je[0])}else{var ut=te.name;W[ut]=te,Q=ut}return!de&&Q&&(k=Q),Q||!de&&k},K=function(he,te){if(pe(he))return he.clone();var Y=typeof te=="object"?te:{};return Y.date=he,Y.args=arguments,new Ht(Y)},se=$;se.l=Te,se.i=pe,se.w=function(he,te){return K(he,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Ht=function(){function he(Y){this.$L=Te(Y.locale,null,!0),this.parse(Y),this.$x=this.$x||Y.x||{},this[ee]=!0}var te=he.prototype;return te.parse=function(Y){this.$d=function(de){var Q=de.date,Ue=de.utc;if(Q===null)return new Date(NaN);if(se.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var je=Q.match(C);if(je){var ut=je[2]-1||0,It=(je[7]||"0").substring(0,3);return Ue?new Date(Date.UTC(je[1],ut,je[3]||1,je[4]||0,je[5]||0,je[6]||0,It)):new Date(je[1],ut,je[3]||1,je[4]||0,je[5]||0,je[6]||0,It)}}return new Date(Q)}(Y),this.init()},te.init=function(){var Y=this.$d;this.$y=Y.getFullYear(),this.$M=Y.getMonth(),this.$D=Y.getDate(),this.$W=Y.getDay(),this.$H=Y.getHours(),this.$m=Y.getMinutes(),this.$s=Y.getSeconds(),this.$ms=Y.getMilliseconds()},te.$utils=function(){return se},te.isValid=function(){return this.$d.toString()!==w},te.isSame=function(Y,de){var Q=K(Y);return this.startOf(de)<=Q&&Q<=this.endOf(de)},te.isAfter=function(Y,de){return K(Y)<this.startOf(de)},te.isBefore=function(Y,de){return this.endOf(de)<K(Y)},te.$g=function(Y,de,Q){return se.u(Y)?this[de]:this.set(Q,Y)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(Y,de){var Q=this,Ue=!!se.u(de)||de,je=se.p(Y),ut=function(Ln,ar){var Hi=se.w(Q.$u?Date.UTC(Q.$y,ar,Ln):new Date(Q.$y,ar,Ln),Q);return Ue?Hi:Hi.endOf(p)},It=function(Ln,ar){return se.w(Q.toDate()[Ln].apply(Q.toDate("s"),(Ue?[0,0,0,0]:[23,59,59,999]).slice(ar)),Q)},Vt=this.$W,Gt=this.$M,br=this.$D,Da="set"+(this.$u?"UTC":"");switch(je){case E:return Ue?ut(1,0):ut(31,11);case c:return Ue?ut(1,Gt):ut(0,Gt+1);case h:var Nn=this.$locale().weekStart||0,Ls=(Vt<Nn?Vt+7:Vt)-Nn;return ut(Ue?br-Ls:br+(6-Ls),Gt);case p:case O:return It(Da+"Hours",0);case l:return It(Da+"Minutes",1);case o:return It(Da+"Seconds",2);case d:return It(Da+"Milliseconds",3);default:return this.clone()}},te.endOf=function(Y){return this.startOf(Y,!1)},te.$set=function(Y,de){var Q,Ue=se.p(Y),je="set"+(this.$u?"UTC":""),ut=(Q={},Q[p]=je+"Date",Q[O]=je+"Date",Q[c]=je+"Month",Q[E]=je+"FullYear",Q[l]=je+"Hours",Q[o]=je+"Minutes",Q[d]=je+"Seconds",Q[a]=je+"Milliseconds",Q)[Ue],It=Ue===p?this.$D+(de-this.$W):de;if(Ue===c||Ue===E){var Vt=this.clone().set(O,1);Vt.$d[ut](It),Vt.init(),this.$d=Vt.set(O,Math.min(this.$D,Vt.daysInMonth())).$d}else ut&&this.$d[ut](It);return this.init(),this},te.set=function(Y,de){return this.clone().$set(Y,de)},te.get=function(Y){return this[se.p(Y)]()},te.add=function(Y,de){var Q,Ue=this;Y=Number(Y);var je=se.p(de),ut=function(Gt){var br=K(Ue);return se.w(br.date(br.date()+Math.round(Gt*Y)),Ue)};if(je===c)return this.set(c,this.$M+Y);if(je===E)return this.set(E,this.$y+Y);if(je===p)return ut(1);if(je===h)return ut(7);var It=(Q={},Q[o]=t,Q[l]=r,Q[d]=e,Q)[je]||1,Vt=this.$d.getTime()+Y*It;return se.w(Vt,this)},te.subtract=function(Y,de){return this.add(-1*Y,de)},te.format=function(Y){var de=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||w;var Ue=Y||"YYYY-MM-DDTHH:mm:ssZ",je=se.z(this),ut=this.$H,It=this.$m,Vt=this.$M,Gt=Q.weekdays,br=Q.months,Da=Q.meridiem,Nn=function(ar,Hi,Us,el){return ar&&(ar[Hi]||ar(de,Ue))||Us[Hi].slice(0,el)},Ls=function(ar){return se.s(ut%12||12,ar,"0")},Ln=Da||function(ar,Hi,Us){var el=ar<12?"AM":"PM";return Us?el.toLowerCase():el};return Ue.replace(U,function(ar,Hi){return Hi||function(Us){switch(Us){case"YY":return String(de.$y).slice(-2);case"YYYY":return se.s(de.$y,4,"0");case"M":return Vt+1;case"MM":return se.s(Vt+1,2,"0");case"MMM":return Nn(Q.monthsShort,Vt,br,3);case"MMMM":return Nn(br,Vt);case"D":return de.$D;case"DD":return se.s(de.$D,2,"0");case"d":return String(de.$W);case"dd":return Nn(Q.weekdaysMin,de.$W,Gt,2);case"ddd":return Nn(Q.weekdaysShort,de.$W,Gt,3);case"dddd":return Gt[de.$W];case"H":return String(ut);case"HH":return se.s(ut,2,"0");case"h":return Ls(1);case"hh":return Ls(2);case"a":return Ln(ut,It,!0);case"A":return Ln(ut,It,!1);case"m":return String(It);case"mm":return se.s(It,2,"0");case"s":return String(de.$s);case"ss":return se.s(de.$s,2,"0");case"SSS":return se.s(de.$ms,3,"0");case"Z":return je}return null}(ar)||je.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(Y,de,Q){var Ue,je=this,ut=se.p(de),It=K(Y),Vt=(It.utcOffset()-this.utcOffset())*t,Gt=this-It,br=function(){return se.m(je,It)};switch(ut){case E:Ue=br()/12;break;case c:Ue=br();break;case v:Ue=br()/3;break;case h:Ue=(Gt-Vt)/6048e5;break;case p:Ue=(Gt-Vt)/864e5;break;case l:Ue=Gt/r;break;case o:Ue=Gt/t;break;case d:Ue=Gt/e;break;default:Ue=Gt}return Q?Ue:se.a(Ue)},te.daysInMonth=function(){return this.endOf(c).$D},te.$locale=function(){return W[this.$L]},te.locale=function(Y,de){if(!Y)return this.$L;var Q=this.clone(),Ue=Te(Y,de,!0);return Ue&&(Q.$L=Ue),Q},te.clone=function(){return se.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},he}(),zr=Ht.prototype;return K.prototype=zr,[["$ms",a],["$s",d],["$m",o],["$H",l],["$W",p],["$M",c],["$y",E],["$D",O]].forEach(function(he){zr[he[1]]=function(te){return this.$g(te,he[0],he[1])}}),K.extend=function(he,te){return he.$i||(he(te,Ht,K),he.$i=!0),K},K.locale=Te,K.isDayjs=pe,K.unix=function(he){return K(1e3*he)},K.en=W[k],K.Ls=W,K.p={},K})})(qA);var Z9=qA.exports;const T=mI(Z9);var D=(i=>(i.Error="error",i.Warning="warning",i))(D||{}),j=(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.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",i.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",i.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",i.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",i.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",i))(j||{}),I=(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.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))(I||{}),q=(i=>(i.NoPrimaryKeyProperty="no-primary-key-property",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.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",i.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",i.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",i.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",i.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",i.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",i))(q||{});class P{constructor(s){f(this,"id");f(this,"message");f(this,"issue");f(this,"severity");f(this,"code");this.id=s.id,this.message=s.message,this.issue=s.issue,this.severity=s.severity,this.code=s.code}toEntityError(s){return this.code in j?new hn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:s}):null}}class hn{constructor(s){f(this,"id");f(this,"message");f(this,"issue");f(this,"severity");f(this,"code");f(this,"entity");this.id=s.id,this.message=s.message,this.issue=s.issue,this.severity=s.severity,this.code=s.code,this.entity=s.entity}clone(){return new hn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function q9(i){const s=new Set;return i.filter(e=>s.has(e.id)?!1:(s.add(e.id),!0))}function ye(i){const s=i.entity.errors.find(t=>t.id===i.id);return s?{new:!1,error:s}:{new:!0,error:new hn(i)}}function J9(i,s){const e=new Map;return i.forEach(t=>{e.set(t.id,t)}),s.forEach(t=>{e.set(t.id,t)}),Array.from(e.values())}function Ye(i,s){const e=[];return s.forEach(t=>{const r=i.find(a=>a.id===t.id);r?e.push(r):e.push(t)}),e}const ds=m.union([m.string(),m.number(),m.boolean(),m.date()]),JA=m.enum([yt.CurrentDateAndTime,yt.Random,yt.Unique]),Xo=m.object({type:JA,rangeStart:ds.nullable(),rangeEnd:ds.nullable()}),ls=Xo.extend({type:m.literal(yt.Random),rangeStart:ds,rangeEnd:ds}),Qu=Xo.extend({type:m.literal(yt.Unique),rangeStart:m.null(),rangeEnd:m.null()}),WA=Xo.extend({type:m.literal(yt.CurrentDateAndTime),rangeStart:m.null(),rangeEnd:m.null()}),Qo=ls.extend({rangeStart:m.number().nullable(),rangeEnd:m.number().nullable()}),YA=Qo.extend({rangeStart:m.number(),rangeEnd:m.null()}),zA=Qo.extend({rangeStart:m.null(),rangeEnd:m.number()}),HA=Qo.extend({rangeStart:m.number(),rangeEnd:m.number()}),ed=ls.extend({rangeStart:m.number().nullable(),rangeEnd:m.number().nullable()}),KA=ed.extend({rangeStart:m.number(),rangeEnd:m.null()}),XA=ed.extend({rangeStart:m.null(),rangeEnd:m.number()}),QA=ed.extend({rangeStart:m.number(),rangeEnd:m.number()}),td=ls.extend({rangeStart:m.date().nullable(),rangeEnd:m.date().nullable()}),eD=td.extend({rangeStart:m.date(),rangeEnd:m.null()}),tD=td.extend({rangeStart:m.null(),rangeEnd:m.date()}),rD=td.extend({rangeStart:m.date(),rangeEnd:m.date()}),ep=ls.extend({rangeStart:m.null(),rangeEnd:m.null()}),tp=m.union([KA,XA,QA]),rp=m.union([YA,zA,HA]),ip=m.union([eD,tD,rD,WA]),np=m.union([tp,rp,ip,Qu,ep]);function us(){return m.union([m.object({type:m.literal(n.ValueDescriptor)}),m.record(m.string(),m.any())])}function iD(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ValueDescriptor)})}function ap(){return m.object({id:m.string(),type:m.literal(n.ValueDescriptor),name:m.string(),required:m.boolean()})}function W9(){return ap().merge(m.object({version:m.number(),index:m.number()}))}function Y9(){return ap().merge(m.object({}))}function z9(){return m.object({dataType:En(),parent:vn()})}function H9(){return W9().merge(z9())}function rd(){return m.union([m.object({type:m.literal(n.PrimitiveEntity)}),m.record(m.string(),m.any())])}function id(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.PrimitiveEntity)})}function nd(){return m.object({id:m.string(),type:m.literal(n.PrimitiveEntity),name:m.string(),description:m.string().nullable(),static:m.boolean(),abstract:m.boolean()})}function K9(){return nd().merge(m.object({version:m.number()}))}function X9(){return nd().merge(m.object({}))}function Q9(){return m.object({properties:m.array(mn()),methods:m.array(ur()),abstractMethods:m.array(Fr()),extends:m.array(m.union([rd(),la()]))})}function e6(){return K9().merge(Q9())}function mn(){return m.union([m.object({type:m.literal(n.Property)}),m.record(m.string(),m.any())])}function nD(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Property)})}function sp(){return m.object({id:m.string(),type:m.literal(n.Property),name:m.string(),description:m.string().nullable(),private:m.boolean(),static:m.boolean(),required:m.boolean(),abstract:m.boolean()})}function t6(){return sp().merge(m.object({version:m.number(),index:m.number()}))}function r6(){return sp().merge(m.object({}))}function i6(){return m.object({dataType:En(),implements:mn().nullable(),parent:m.union([Rn(),id(),ad()])})}function n6(){return t6().merge(i6())}function a6(){return m.enum([z.CRON_JOB,z.EXECUTION,z.HTTP_ENDPOINT,z.PERSISTED_ENTITY,z.RELATIONAL_DATABASE])}function la(){return m.union([m.object({type:m.literal(n.BuiltInBaseEntity)}),m.record(m.string(),m.any())])}function ad(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.BuiltInBaseEntity)})}function op(){return m.object({id:m.string(),version:m.number(),type:m.literal(n.BuiltInBaseEntity),name:a6(),description:m.string().nullable(),abstract:m.boolean(),static:m.boolean()})}function s6(){return op()}function o6(){return op().merge(m.object({}))}function d6(){return m.object({properties:m.array(mn()),methods:m.array(ur()),abstractMethods:m.array(Fr()),extends:m.array(m.union([la(),rd()]))})}function l6(){return s6().merge(d6())}function Fr(){return m.union([m.object({type:m.literal(n.ActionDescriptor)}),m.record(m.string(),m.any())])}function vn(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ActionDescriptor)})}function sd(){return m.object({id:m.string(),type:m.literal(n.ActionDescriptor),name:m.string(),description:m.string().nullable()})}function u6(){return sd().merge(m.object({version:m.number()}))}function p6(){return sd().merge(m.object({}))}function c6(){return m.object({inputs:m.array(us()),outputs:m.array(us()),parent:m.union([Xt(),Rn(),ad(),id()]).nullable()})}function aD(){return u6().merge(c6())}function ua(){return m.union([m.object({type:m.literal(n.Loop)}),m.record(m.string(),m.any())])}function Sr(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Loop)})}function sD(){return m.object({id:m.string(),type:m.literal(n.Loop)})}function f6(){return sD().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function y6(){return sD().merge(m.object({declaration:m.union([m.string(),ur()])}))}function h6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),declaration:Fr(),inputs:m.array(Pr()),outputs:m.array(qt()),outputsDeclarations:m.array(us()),successCalls:m.array(Dt()),errorCalls:m.array(Dt()),error:qt(),body:ur(),parent:m.union([ui(),Xt()]),breakStatements:m.array(ya()),continueStatements:m.array(pa())})}function m6(){return f6().merge(h6())}function pa(){return m.union([m.object({type:m.literal(n.ContinueStatement)}),m.record(m.string(),m.any())])}function ca(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ContinueStatement)})}function dp(){return m.object({id:m.string(),type:m.literal(n.ContinueStatement)})}function v6(){return dp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function T6(){return dp().merge(m.object({}))}function E6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),outputs:m.array(oi()),throws:m.optional(oi()),parent:Sr()})}function I6(){return v6().merge(E6())}function Tn(){return m.union([m.object({type:m.literal(n.ReturnStatement)}),m.record(m.string(),m.any())])}function fa(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ReturnStatement)})}function lp(){return m.object({id:m.string(),type:m.literal(n.ReturnStatement)})}function b6(){return lp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function R6(){return lp().merge(m.object({}))}function A6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),outputs:m.array(oi()),throws:m.optional(oi()),parent:ui()})}function D6(){return b6().merge(A6())}function oi(){return m.union([m.object({type:m.literal(n.ReturnDeclaration)}),m.record(m.string(),m.any())])}function oD(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ReturnDeclaration)})}function up(){return m.object({id:m.string(),type:m.literal(n.ReturnDeclaration),name:m.string(),description:m.string().nullable(),isError:m.boolean()})}function O6(){return up().merge(m.object({version:m.number(),index:m.number()}))}function P6(){return up().merge(m.object({}))}function w6(){return m.object({dataType:En().nullable(),readsValue:ms().nullable(),parent:m.union([fa(),vn(),di(),ca()])})}function V6(){return O6().merge(w6())}function ya(){return m.union([m.object({type:m.literal(n.BreakStatement)}),m.record(m.string(),m.any())])}function di(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.BreakStatement)})}function pp(){return m.object({id:m.string(),type:m.literal(n.BreakStatement)})}function C6(){return pp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function B6(){return pp().merge(m.object({}))}function _6(){return m.object({calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),outputs:m.array(oi()),throws:m.optional(oi()),parent:Sr()})}function M6(){return C6().merge(_6())}function qt(){return m.union([m.object({type:m.literal(n.OutputMap)}),m.record(m.string(),m.any())])}function cp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.OutputMap)})}function fp(){return m.object({id:m.string(),type:m.literal(n.OutputMap)})}function g6(){return fp().merge(m.object({version:m.number(),index:m.number()}))}function N6(){return fp().merge(m.object({}))}function L6(){return m.object({writesValues:m.array(li()),declaration:m.union([oi(),mn()]),parent:m.union([et(),Sr(),di()])})}function U6(){return g6().merge(L6())}function ha(){return m.union([m.object({type:m.literal(n.FunctionCall)}),m.record(m.string(),m.any())])}function ps(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.FunctionCall)})}function yp(){return m.object({id:m.string(),type:m.literal(n.FunctionCall)})}function j6(){return yp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function $6(){return yp().merge(m.object({}))}function G6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),writesValues:m.array(li()),declaration:ur(),inputs:m.array(Pr()),outputs:m.array(qt()),error:m.optional(qt()),parent:m.union([ui(),Xt()])})}function F6(){return j6().merge(G6())}function S6(){return m.enum([pt.Equal,pt.NotEqual,pt.MoreThan,pt.MoreThanOrEqual,pt.LessThan,pt.LessThanOrEqual,pt.And,pt.Or,yr.Empty,yr.NotEmpty])}function cs(){return m.union([m.object({type:m.literal(n.Condition)}),m.record(m.string(),m.any())])}function od(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Condition)})}function hp(){return m.object({id:m.string(),type:m.literal(n.Condition)})}function x6(){return hp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function k6(){return hp().merge(m.object({}))}function Z6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),leftValue:Pr(),rightValue:Pr().nullable(),operator:S6(),parent:m.union([ui(),Xt()])})}function q6(){return x6().merge(Z6())}function fs(){return m.union([m.object({type:m.literal(n.Search)}),m.record(m.string(),m.any())])}function ys(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Search)})}function mp(){return m.object({id:m.string(),type:m.literal(n.Search),name:m.string(),query:m.any(),description:m.string().nullable()})}function J6(){return mp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function W6(){return mp().merge(m.object({}))}function Y6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),inputsDeclarations:m.array(bn()),inputs:m.array(Pr()),outputsDeclarations:m.array(us()),outputs:m.array(qt()),parent:m.union([ui(),Xt()]),error:qt().nullable()})}function z6(){return J6().merge(Y6())}function hs(){return m.union([m.object({type:m.literal(n.InternalCall)}),m.record(m.string(),m.any())])}function vp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.InternalCall)})}function Tp(){return m.object({id:m.string(),type:m.literal(n.InternalCall),index:m.number()})}function H6(){return Tp().merge(m.object({version:m.number(),index:m.number()}))}function K6(){return Tp().merge(m.object({declaration:m.union([m.string(),ur()])}))}function X6(){return m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),writesValues:m.array(li()),declaration:ur(),inputs:m.array(Pr()),outputs:m.array(qt()),parent:Pi(),error:m.optional(qt())})}function Q6(){return H6().merge(X6())}function Pr(){return m.union([m.object({type:m.literal(n.InputMap)}),m.record(m.string(),m.any())])}function dd(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.InputMap)})}function Ep(){return m.object({id:m.string(),type:m.literal(n.InputMap),name:m.string().nullable().optional(),description:m.string().nullable().optional()})}function e3(){return Ep().merge(m.object({version:m.number(),index:m.number()}))}function t3(){return Ep().merge(m.object({}))}function r3(){return m.object({defaultValue:Ip().nullable(),declaration:m.union([bn(),mn()]).nullable(),readsValue:ms().nullable(),parent:m.union([et(),dd(),Sr(),di()])})}function i3(){return e3().merge(r3())}function ma(){return m.union([m.object({type:m.literal(n.Operation)}),m.record(m.string(),m.any())])}function va(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.Operation)})}function ld(){return m.object({id:m.string(),type:m.literal(n.Operation)})}function n3(){return ld().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function a3(){return ld().merge(m.object({}))}function s3(){return ld().merge(m.object({successCalls:m.array(Dt()),errorCalls:m.array(Dt()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),writesValues:m.array(li()),declaration:Fr(),inputs:m.array(Pr()),outputs:m.array(qt()),error:m.array(qt()),parent:m.union([ui(),Xt()])}))}function o3(){return n3().merge(s3())}function ud(){return m.union([m.string(),m.number(),m.boolean(),m.null(),m.date()])}function dD(){return m.record(m.string(),ud())}function d3(){return m.array(m.union([ud(),dD()]))}function lD(){return m.union([ud(),dD(),d3()])}function uD(){return m.union([ud(),lD()])}function pD(){return m.enum([g.String,g.Number,g.Boolean,g.Null,g.Date,g.KeyValue,g.Enum,g.File,g.UUID,g.EntityTemplate,g.ActionDescriptor])}function cD(){return m.union([Rn(),va(),vs()])}function l3(){return m.object({id:m.string(),name:pD(),type:m.literal(n.LiteralValue),value:uD(),autogeneration:np.nullable()})}function u3(){return l3().merge(m.object({}))}function wr(){return m.object({id:m.string(),version:m.number(),name:pD(),type:m.literal(n.LiteralValue),value:uD(),valueAsTypeList:m.array(cD()).nullable(),valueAsTypeSingle:cD().nullable(),autogeneration:np.nullable(),parent:m.union([bp(),dd()])})}function p3(){return wr().extend({name:m.literal(g.String),value:m.string(),autogeneration:tp.nullable()})}function c3(){return wr().extend({name:m.literal(g.Number),value:m.number(),autogeneration:rp.nullable()})}function f3(){return wr().extend({name:m.literal(g.Boolean),value:m.boolean(),autogeneration:ep.nullable()})}function y3(){return wr().extend({name:m.literal(g.Null),value:m.null(),autogeneration:m.null()})}function h3(){return wr().extend({name:m.literal(g.Date),value:m.date(),autogeneration:ip.nullable()})}function m3(){return wr().extend({name:m.literal(g.KeyValue),value:lD(),autogeneration:m.null()})}function v3(){return wr().extend({name:m.literal(g.Enum),value:m.string(),autogeneration:m.null()})}function T3(){return wr().extend({name:m.literal(g.File),value:m.string(),autogeneration:m.null()})}function E3(){return wr().extend({name:m.literal(g.UUID),value:m.string(),autogeneration:Qu.nullable()})}function I3(){return wr().extend({name:m.literal(g.EntityTemplate),value:Rn(),autogeneration:m.null()})}function b3(){return wr().extend({name:m.literal(g.ActionDescriptor),value:vs(),autogeneration:m.null()})}function Ip(){return m.union([p3(),c3(),f3(),y3(),h3(),m3(),v3(),T3(),E3(),I3(),b3()])}function En(){return m.union([m.object({type:m.literal(n.DataType)}),m.record(m.string(),m.any())])}function bp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.DataType)})}function Rp(){return m.object({id:m.string(),type:m.literal(n.DataType),isNullable:m.boolean(),isList:m.boolean(),constant:m.boolean(),asType:m.boolean(),options:m.array(m.string()).optional()})}function R3(){return Rp().merge(m.object({version:m.number()}))}function A3(){return Rp().merge(m.object({}))}function D3(){return m.object({defaultValue:Ip().nullable(),entity:m.union([Ta(),la(),rd(),Fr()]).nullable(),parent:m.union([nD(),hD(),iD()])})}function O3(){return R3().merge(D3())}function Ap(){return m.union([m.object({type:m.literal(n.VariableDeclaration)}),m.record(m.string(),m.any())])}function P3(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.VariableDeclaration)})}function Dp(){return m.object({id:m.string(),type:m.literal(n.VariableDeclaration),name:m.string(),description:m.string().nullable()})}function w3(){return Dp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function V3(){return Dp().merge(m.object({}))}function C3(){return m.object({dataType:En().nullable(),readsValue:ms().nullable(),writesValues:m.array(li()),inputs:m.array(Pr()),outputs:m.array(qt()),successCalls:m.array(Dt()),errorCalls:m.array(Dt()),internalCalls:m.array(hs()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),parent:m.union([ui(),Xt()])})}function B3(){return w3().merge(C3())}function fD(){return m.union([m.object({type:m.literal(n.VariableInstance)}),m.record(m.string(),m.any())])}function _3(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.VariableInstance)})}function Op(){return m.object({id:m.string(),type:m.literal(n.VariableInstance)})}function M3(){return Op().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function g3(){return Op().merge(m.object({}))}function N3(){return m.object({declaration:Ap(),dataType:En().nullable(),readsValue:ms().nullable(),writesValues:m.array(li()),inputs:m.array(Pr()),outputs:m.array(qt()),successCalls:m.array(Dt()),errorCalls:m.array(Dt()),internalCalls:m.array(hs()),calledBySuccess:m.array(et()),calledByError:m.array(et()),calledByEntry:m.array(bt()),parent:m.union([ui(),Xt()])})}function L3(){return M3().merge(N3())}function Pp(){return m.union([m.object({type:m.literal(n.InstalledProject)}),m.record(m.string(),m.any())])}function pd(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.InstalledProject)})}function U3(){return m.object({id:m.string(),type:m.literal(n.InstalledProject)})}function j3(){return m.object({version:m.number(),x:m.number(),y:m.number()})}function $3(){return m.object({})}function G3(){return m.object({implements:Xt(),description:m.string().nullable(),functions:m.array(ur()),events:m.array(wp()),parent:Xt()})}function F3(){return j3().merge(G3())}function wp(){return m.union([m.object({type:m.literal(n.GlobalEvent)}),m.record(m.string(),m.any())])}function S3(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.GlobalEvent)})}function cd(){return m.object({id:m.string(),type:m.literal(n.GlobalEvent),name:m.string(),collapsed:m.boolean()})}function x3(){return cd().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function k3(){return cd().merge(m.object({}))}function Z3(){return cd().merge(m.object({returnStatements:m.array(Tn()),implements:m.array(aD()),inputs:m.array(bn()),calls:m.array(Dt()),parent:m.union([Xt(),pd()])}))}function q3(){return x3().merge(Z3())}function In(){return m.union([Ap(),fD()])}function Pi(){return m.union([P3(),_3()])}function li(){return m.union([In(),Pr(),oi()])}function yD(){return m.union([Pi(),dd(),oD()])}function ms(){return m.union([In(),bn(),qt(),ma(),hs(),ha()])}function J3(){return m.union([Pi(),Vp(),cp(),va(),vp(),ps()])}function W3(){return m.union([bn(),qt(),li()])}function hD(){return m.union([Vp(),cp(),yD()])}function fd(){return wp()}function yd(){return S3()}function hd(){return m.union([ma(),ha(),cs(),fs(),In(),hs(),ua()])}function et(){return m.union([va(),ps(),od(),ys(),Pi(),vp(),Sr()])}function md(){return m.union([ma(),ha(),cs(),fs(),In(),ua()])}function vd(){return m.union([va(),ps(),od(),ys(),Pi(),Sr()])}function mD(){return m.union([hd(),Tn(),ya(),pa()])}function Dt(){return m.union([et(),fa(),di(),ca()])}function vD(){return m.union([md(),Tn(),ya(),pa()])}function TD(){return m.union([vd(),fa(),di(),ca()])}function wi(){return m.union([ur(),fd()])}function bt(){return m.union([vs(),yd()])}function Y3(){return m.union([hd(),wi()])}function z3(){return m.union([et(),bt()])}function H3(){return m.union([md(),wi()])}function K3(){return m.union([vd(),bt()])}function X3(){return m.union([mD(),wi()])}function Q3(){return m.union([Dt(),bt()])}function e5(){return m.union([vD(),wi()])}function t5(){return m.union([TD(),bt()])}function r5(){return m.union([wi(),ua()])}function ui(){return m.union([bt(),Sr()])}function i5(){return m.union([hd(),wi()])}function n5(){return m.union([et(),bt()])}function a5(){return m.union([md(),wi()])}function s5(){return m.union([vd(),bt()])}function o5(){return m.union([Tn(),ya(),pa()])}function d5(){return m.union([fa(),di(),ca()])}function l5(){return m.union([la(),b5(),Pp(),Ta(),ur(),fd(),In(),Pr(),qt(),cs(),ma(),ha(),oi(),bn(),rd(),En(),mn(),Fr(),Tn(),pa(),ya(),ua(),fs(),Fr(),Fr(),us(),hs()])}function u5(){return m.union([ad(),Xt(),pd(),Rn(),vs(),yd(),Pi(),dd(),cp(),od(),va(),ps(),oD(),Vp(),id(),bp(),nD(),vn(),fa(),ca(),di(),Sr(),ys(),vn(),vn(),iD(),vp()])}function p5(){return m.union([Pp(),Ta(),ur(),fd(),In(),cs(),ma(),ha(),Tn(),pa(),ya(),ua(),fs()])}function c5(){return m.union([pd(),Rn(),vs(),yd(),Pi(),od(),va(),ps(),fa(),ca(),di(),Sr(),ys()])}function bn(){return m.union([m.object({type:m.literal(n.ArgumentDeclaration)}),m.record(m.string(),m.any())])}function Vp(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.ArgumentDeclaration)})}function Cp(){return m.object({id:m.string(),type:m.literal(n.ArgumentDeclaration)})}function f5(){return Cp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function y5(){return Cp().merge(m.object({}))}function h5(){return m.object({dataType:En().nullable(),writesValues:m.array(li()),parent:m.union([bt(),vn(),vn(),ys(),di()])})}function m5(){return f5().merge(h5())}function ur(){return m.union([m.object({type:m.literal(n.FunctionDeclaration)}),m.record(m.string(),m.any())])}function vs(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.FunctionDeclaration)})}function Bp(){return m.object({id:m.string(),type:m.literal(n.FunctionDeclaration),name:m.string(),description:m.string().nullable()})}function v5(){return Bp().merge(m.object({version:m.number(),x:m.number(),y:m.number(),index:m.number().nullable()}))}function T5(){return Bp()}function E5(){return m.object({inputs:m.array(bn()),implements:Fr().nullable(),returnStatements:m.array(Tn()),parent:m.union([Xt(),pd(),Rn(),Sr(),ad(),id()])})}function I5(){return v5().merge(E5())}function b5(){return m.union([m.object({type:m.literal(n.Project)}),m.record(m.string(),m.any())])}function Xt(){return m.object({entityType:m.literal(n.Project),entityId:m.string(),id:m.string(),type:m.literal(n.GenericReference)})}function _p(){return m.object({id:m.string(),type:m.literal(n.Project),name:m.string(),description:m.string().nullable()})}function R5(){return _p().merge(m.object({version:m.number()}))}function A5(){return _p()}function D5(){return m.object({entities:m.array(Ta()),functions:m.array(ur()),events:m.array(wp()),projects:m.array(Pp()),variableDeclarations:m.array(Ap()),variableInstances:m.array(fD()),conditions:m.array(cs()),operations:m.array(ma()),functionCalls:m.array(ha()),loops:m.array(ua()),searches:m.array(fs())})}function O5(){return R5().merge(D5())}function Ta(){return m.union([m.object({type:m.literal(n.DefinitionEntity)}),m.record(m.string(),m.any())])}function Rn(){return m.object({id:m.string(),type:m.literal(n.GenericReference),entityId:m.string(),entityType:m.literal(n.DefinitionEntity)})}function Mp(){return m.object({id:m.string(),type:m.literal(n.DefinitionEntity),name:m.string(),description:m.string().nullable(),static:m.boolean(),abstract:m.boolean()})}function P5(){return Mp().merge(m.object({version:m.number(),x:m.number(),y:m.number()}))}function w5(){return Mp().merge(m.object({}))}function V5(){return m.union([Xt(),bp()])}function C5(){return m.object({properties:m.array(mn()),methods:m.array(ur()),abstractMethods:m.array(Fr()),extends:m.array(m.union([Ta(),la()])),implements:m.array(m.union([Ta(),la()])),parent:V5()})}function B5(){return P5().merge(C5())}function _5(i){const s=B5(),e=i.toJSON();s.safeParse(e).success;const r=i.implements.flatMap(h=>N5(i,h)),a=i.extends.flatMap(h=>L5(i,h)),d=j5(i),o=U5(i);i.methods.flatMap(h=>h.validate());const l=[...r,...a,...d,...o];return Ye(i.errors,l)}function M5(i,s){const e=s.properties.filter(a=>a.abstract),t=[];let r=[...i.properties];return e.forEach(a=>{const d=r.find(o=>{var l;return((l=o.implements)==null?void 0:l.id)===a.id});d?r=r.filter(o=>o.id!==d.id):t.push(a)}),t}function g5(i,s){const e=s.abstractMethods,t=[];let r=[...i.methods];return e.forEach(a=>{const d=r.find(o=>{var l;return((l=o.implements)==null?void 0:l.id)===a.id});d?r=r.filter(o=>o.id!==d.id):t.push(a)}),t}function N5(i,s){const e=[];if(!s.abstract){const h=ye({id:i.id+"--"+q.ImplementingNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is implementing a non-abstract entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:q.ImplementingNonAbstractEntity,entity:i});return e.push(h.error),e}const t=s.properties.filter(h=>h.abstract),r=[];let a=[...i.properties];t.forEach(h=>{const c=a.find(v=>{var E;return((E=v.implements)==null?void 0:E.id)===h.id});c?a=a.filter(v=>v.id!==c.id):r.push(h)}),r.length&&r.forEach(h=>{const c=ye({id:i.id+"--"+q.MissingPropertyImplementation+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${s.name}" with id "${s.id}" is not implemented when entity "${i.name}" with id "${i.id}" implements it`,issue:null,severity:D.Error,code:q.MissingPropertyImplementation,entity:i});e.push(c.error)});const d=[];let o=[...i.methods];s.abstractMethods.forEach(h=>{const c=o.find(v=>{var E;return((E=v.implements)==null?void 0:E.id)===h.id});c?o=o.filter(v=>v.id!==c.id):d.push(h)}),d.length&&d.forEach(h=>{const c=ye({id:i.id+"--"+q.MissingMethodImplementation+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${s.name}" with id "${s.id}" is not implemented when entity "${i.name}" with id "${i.id}" implements it`,issue:null,severity:D.Error,code:q.MissingMethodImplementation,entity:i});e.push(c.error)});const l=[];s.properties.forEach(h=>{const c=a.find(v=>v.name===h.name);c&&l.push([c,h])}),l.length&&l.forEach(([h])=>{const c=ye({id:i.id+"--"+j.PropertyOverwrite+"--"+h.id,message:`Property "${h.name}" with id "${h.id}" of entity "${i.name}" with id "${i.id}" overwrites the property with the same name from the base entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.PropertyOverwrite,entity:i});e.push(c.error)});const p=[];return s.methods.forEach(h=>{const c=o.find(v=>v.name===h.name);c&&p.push([c,h])}),p.length&&p.forEach(([h])=>{const c=ye({id:i.id+"--"+j.MethodOverwrite+"--"+h.id,message:`Method "${h.name}" with id "${h.id}" of entity "${i.name}" with id "${i.id}" overwrites the method with the same name from the base entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.MethodOverwrite,entity:i});e.push(c.error)}),e}function L5(i,s){const e=[],t=[];if(s.abstract){const a=ye({id:i.id+"--"+q.ExtendingAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is extending an abstract entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:q.ExtendingAbstractEntity,entity:i});return e.push(a.error),e}i.properties.forEach(a=>{var o;const d=s.properties.find(l=>l.name===a.name);((o=a.implements)==null?void 0:o.id)!==(d==null?void 0:d.id)&&d&&t.push(a)}),t.length&&t.forEach(a=>{const d=ye({id:i.id+"--"+j.PropertyOverwrite,message:`Property "${a.name}" with id "${a.id}" of entity "${i.name}" with id "${i.id}" overwrites the property with the same name from the extended entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.PropertyOverwrite,entity:i});e.push(d.error)});const r=[];return i.methods.forEach(a=>{var o;const d=s.methods.find(l=>l.name===a.name);((o=a.implements)==null?void 0:o.id)!==(d==null?void 0:d.id)&&d&&r.push(a)}),r.length&&r.forEach(a=>{const d=ye({id:i.id+"--"+j.MethodOverwrite,message:`Method "${a.name}" with id "${a.id}" of entity "${i.name}" with id "${i.id}" overwrites the method with the same name from the extended entity "${s.name}" with id "${s.id}"`,issue:null,severity:D.Error,code:j.MethodOverwrite,entity:i});e.push(d.error)}),e}function U5(i){const s=[];if(!i.properties.length){const e=ye({id:i.id+"--"+q.NoProperties,message:"No properties implemented",issue:null,severity:D.Warning,code:q.NoProperties,entity:i});s.push(e.error)}return i.properties.forEach(e=>{e.validate()}),s}function j5(i){const s=[];if(i.abstract){if(i.methods.length){const e=ye({id:i.id+"--"+q.AbstractEntityWithNonAbstractMethods,message:`Entity "${i.name}" with id "${i.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:D.Error,code:q.AbstractEntityWithNonAbstractMethods,entity:i});s.push(e.error)}if(i.properties.some(e=>!e.abstract)){const e=ye({id:i.id+"--"+q.AbstractEntityWithNonAbstractProperties,message:`Entity "${i.name}" with id "${i.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:D.Error,code:q.AbstractEntityWithNonAbstractProperties,entity:i});s.push(e.error),i.properties.forEach(t=>{if(!t.abstract){const r=ye({id:i.id+"--"+q.StaticEntityWithNonStaticProperties+"--"+t.id,message:`Property "${t.name}" with id "${t.id}" of entity "${i.name}" with id "${i.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:D.Error,code:q.StaticEntityWithNonStaticProperties,entity:i});s.push(r.error)}})}}else{if(i.abstractMethods.length){const e=ye({id:i.id+"--"+q.AbstractPropertyInNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is not marked as abstract but has abstract methods`,issue:null,severity:D.Error,code:q.AbstractPropertyInNonAbstractEntity,entity:i});s.push(e.error)}if(i.properties.some(e=>e.abstract)){const e=ye({id:i.id+"--"+q.AbstractMethodInNonAbstractEntity,message:`Entity "${i.name}" with id "${i.id}" is not marked as abstract but has abstract properties`,issue:null,severity:D.Error,code:q.AbstractMethodInNonAbstractEntity,entity:i});s.push(e.error),i.properties.forEach(t=>{if(t.abstract){const r=ye({id:i.id+"--"+q.AbstractMethodInNonAbstractEntity+"--"+t.id,message:`Property "${t.name}" with id "${t.id}" of entity "${i.name}" with id "${i.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:D.Error,code:q.AbstractMethodInNonAbstractEntity,entity:i});s.push(r.error)}})}}if(i.static&&i.properties.some(e=>!e.static)){const e=ye({id:i.id+"--"+q.StaticEntityWithNonStaticProperties,message:`Entity "${i.name}" with id "${i.id}" is marked as static but has non-static properties`,issue:null,severity:D.Error,code:q.StaticEntityWithNonStaticProperties,entity:i});s.push(e.error),i.properties.forEach(t=>{if(!t.static){const r=ye({id:i.id+"--"+q.NonStaticPropertyInStaticEntity+"--"+t.id,message:`Property "${t.name}" with id "${t.id}" of entity "${i.name}" with id "${i.id}" is not marked as static but the entity is marked as static`,issue:null,severity:D.Error,code:q.NonStaticPropertyInStaticEntity,entity:i});s.push(r.error)}})}return s}function $5(i){return i instanceof Error&&i.name==="ZodError"&&"issues"in i&&Array.isArray(i.issues)}var G5=class extends Error{constructor(s,e){super(s,e);f(this,"name");f(this,"details");this.name="ZodValidationError",this.details=F5(e)}toString(){return this.message}};function F5(i){if(i){const s=i.cause;if($5(s))return s.issues}return[]}function S5(i){return i.length!==0}var x5=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function k5(i){return i.length===1?i[0].toString():i.reduce((s,e)=>{if(typeof e=="number")return s+"["+e.toString()+"]";if(e.includes('"'))return s+'["'+Z5(e)+'"]';if(!x5.test(e))return s+'["'+e+'"]';const t=s.length===0?"":".";return s+t+e},"")}function Z5(i){return i.replace(/"/g,'\\"')}var q5="; ",J5=99,ED="Validation error",W5=": ",Y5=", or ";function z5(i={}){const{issueSeparator:s=q5,unionSeparator:e=Y5,prefixSeparator:t=W5,prefix:r=ED,includePath:a=!0,maxIssuesInMessage:d=J5}=i;return o=>{const l=o.slice(0,d).map(p=>Td({issue:p,issueSeparator:s,unionSeparator:e,includePath:a})).join(s);return H5(l,r,t)}}function Td(i){const{issue:s,issueSeparator:e,unionSeparator:t,includePath:r}=i;if(s.code===x.invalid_union)return s.unionErrors.reduce((a,d)=>{const o=d.issues.map(l=>Td({issue:l,issueSeparator:e,unionSeparator:t,includePath:r})).join(e);return a.includes(o)||a.push(o),a},[]).join(t);if(s.code===x.invalid_arguments)return[s.message,...s.argumentsError.issues.map(a=>Td({issue:a,issueSeparator:e,unionSeparator:t,includePath:r}))].join(e);if(s.code===x.invalid_return_type)return[s.message,...s.returnTypeError.issues.map(a=>Td({issue:a,issueSeparator:e,unionSeparator:t,includePath:r}))].join(e);if(r&&S5(s.path)){if(s.path.length===1){const a=s.path[0];if(typeof a=="number")return`${s.message} at index ${a}`}return`${s.message} at "${k5(s.path)}"`}return s.message}function H5(i,s,e){return s!==null?i.length>0?[s,i].join(e):s:i.length>0?i:ED}function K5(i,s={}){const t=X5(s)([i]);return new G5(t,{cause:new Kt([i])})}function X5(i){return"messageBuilder"in i?i.messageBuilder:z5(i)}var ID="1.13.7",bD=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Ed=Array.prototype,gp=Object.prototype,RD=typeof Symbol<"u"?Symbol.prototype:null,Q5=Ed.push,Ts=Ed.slice,Es=gp.toString,eZ=gp.hasOwnProperty,AD=typeof ArrayBuffer<"u",tZ=typeof DataView<"u",rZ=Array.isArray,DD=Object.keys,OD=Object.create,PD=AD&&ArrayBuffer.isView,iZ=isNaN,nZ=isFinite,wD=!{toString:null}.propertyIsEnumerable("toString"),VD=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],aZ=Math.pow(2,53)-1;function Qt(i,s){return s=s==null?i.length-1:+s,function(){for(var e=Math.max(arguments.length-s,0),t=Array(e),r=0;r<e;r++)t[r]=arguments[r+s];switch(s){case 0:return i.call(this,t);case 1:return i.call(this,arguments[0],t);case 2:return i.call(this,arguments[0],arguments[1],t)}var a=Array(s+1);for(r=0;r<s;r++)a[r]=arguments[r];return a[s]=t,i.apply(this,a)}}function Vi(i){var s=typeof i;return s==="function"||s==="object"&&!!i}function sZ(i){return i===null}function CD(i){return i===void 0}function BD(i){return i===!0||i===!1||Es.call(i)==="[object Boolean]"}function oZ(i){return!!(i&&i.nodeType===1)}function jt(i){var s="[object "+i+"]";return function(e){return Es.call(e)===s}}const Np=jt("String"),_D=jt("Number"),dZ=jt("Date"),lZ=jt("RegExp"),uZ=jt("Error"),MD=jt("Symbol"),gD=jt("ArrayBuffer");var ND=jt("Function"),pZ=bD.document&&bD.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof pZ!="function"&&(ND=function(i){return typeof i=="function"||!1});const Jt=ND,LD=jt("Object");var UD=tZ&&(!/\[native code\]/.test(String(DataView))||LD(new DataView(new ArrayBuffer(8)))),Lp=typeof Map<"u"&&LD(new Map),cZ=jt("DataView");function fZ(i){return i!=null&&Jt(i.getInt8)&&gD(i.buffer)}const Id=UD?fZ:cZ,An=rZ||jt("Array");function Ci(i,s){return i!=null&&eZ.call(i,s)}var Up=jt("Arguments");(function(){Up(arguments)||(Up=function(i){return Ci(i,"callee")})})();const jp=Up;function yZ(i){return!MD(i)&&nZ(i)&&!isNaN(parseFloat(i))}function jD(i){return _D(i)&&iZ(i)}function $D(i){return function(){return i}}function GD(i){return function(s){var e=i(s);return typeof e=="number"&&e>=0&&e<=aZ}}function FD(i){return function(s){return s==null?void 0:s[i]}}const bd=FD("byteLength"),hZ=GD(bd);var mZ=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function vZ(i){return PD?PD(i)&&!Id(i):hZ(i)&&mZ.test(Es.call(i))}const SD=AD?vZ:$D(!1),er=FD("length");function TZ(i){for(var s={},e=i.length,t=0;t<e;++t)s[i[t]]=!0;return{contains:function(r){return s[r]===!0},push:function(r){return s[r]=!0,i.push(r)}}}function xD(i,s){s=TZ(s);var e=VD.length,t=i.constructor,r=Jt(t)&&t.prototype||gp,a="constructor";for(Ci(i,a)&&!s.contains(a)&&s.push(a);e--;)a=VD[e],a in i&&i[a]!==r[a]&&!s.contains(a)&&s.push(a)}function Pt(i){if(!Vi(i))return[];if(DD)return DD(i);var s=[];for(var e in i)Ci(i,e)&&s.push(e);return wD&&xD(i,s),s}function Is(i){if(i==null)return!0;var s=er(i);return typeof s=="number"&&(An(i)||Np(i)||jp(i))?s===0:er(Pt(i))===0}function kD(i,s){var e=Pt(s),t=e.length;if(i==null)return!t;for(var r=Object(i),a=0;a<t;a++){var d=e[a];if(s[d]!==r[d]||!(d in r))return!1}return!0}function ze(i){if(i instanceof ze)return i;if(!(this instanceof ze))return new ze(i);this._wrapped=i}ze.VERSION=ID,ze.prototype.value=function(){return this._wrapped},ze.prototype.valueOf=ze.prototype.toJSON=ze.prototype.value,ze.prototype.toString=function(){return String(this._wrapped)};function ZD(i){return new Uint8Array(i.buffer||i,i.byteOffset||0,bd(i))}var qD="[object DataView]";function $p(i,s,e,t){if(i===s)return i!==0||1/i===1/s;if(i==null||s==null)return!1;if(i!==i)return s!==s;var r=typeof i;return r!=="function"&&r!=="object"&&typeof s!="object"?!1:JD(i,s,e,t)}function JD(i,s,e,t){i instanceof ze&&(i=i._wrapped),s instanceof ze&&(s=s._wrapped);var r=Es.call(i);if(r!==Es.call(s))return!1;if(UD&&r=="[object Object]"&&Id(i)){if(!Id(s))return!1;r=qD}switch(r){case"[object RegExp]":case"[object String]":return""+i==""+s;case"[object Number]":return+i!=+i?+s!=+s:+i==0?1/+i===1/s:+i==+s;case"[object Date]":case"[object Boolean]":return+i==+s;case"[object Symbol]":return RD.valueOf.call(i)===RD.valueOf.call(s);case"[object ArrayBuffer]":case qD:return JD(ZD(i),ZD(s),e,t)}var a=r==="[object Array]";if(!a&&SD(i)){var d=bd(i);if(d!==bd(s))return!1;if(i.buffer===s.buffer&&i.byteOffset===s.byteOffset)return!0;a=!0}if(!a){if(typeof i!="object"||typeof s!="object")return!1;var o=i.constructor,l=s.constructor;if(o!==l&&!(Jt(o)&&o instanceof o&&Jt(l)&&l instanceof l)&&"constructor"in i&&"constructor"in s)return!1}e=e||[],t=t||[];for(var p=e.length;p--;)if(e[p]===i)return t[p]===s;if(e.push(i),t.push(s),a){if(p=i.length,p!==s.length)return!1;for(;p--;)if(!$p(i[p],s[p],e,t))return!1}else{var h=Pt(i),c;if(p=h.length,Pt(s).length!==p)return!1;for(;p--;)if(c=h[p],!(Ci(s,c)&&$p(i[c],s[c],e,t)))return!1}return e.pop(),t.pop(),!0}function EZ(i,s){return $p(i,s)}function bs(i){if(!Vi(i))return[];var s=[];for(var e in i)s.push(e);return wD&&xD(i,s),s}function Gp(i){var s=er(i);return function(e){if(e==null)return!1;var t=bs(e);if(er(t))return!1;for(var r=0;r<s;r++)if(!Jt(e[i[r]]))return!1;return i!==zD||!Jt(e[Fp])}}var Fp="forEach",WD="has",Sp=["clear","delete"],YD=["get",WD,"set"],IZ=Sp.concat(Fp,YD),zD=Sp.concat(YD),bZ=["add"].concat(Sp,Fp,WD);const RZ=Lp?Gp(IZ):jt("Map"),AZ=Lp?Gp(zD):jt("WeakMap"),DZ=Lp?Gp(bZ):jt("Set"),OZ=jt("WeakSet");function Ea(i){for(var s=Pt(i),e=s.length,t=Array(e),r=0;r<e;r++)t[r]=i[s[r]];return t}function PZ(i){for(var s=Pt(i),e=s.length,t=Array(e),r=0;r<e;r++)t[r]=[s[r],i[s[r]]];return t}function HD(i){for(var s={},e=Pt(i),t=0,r=e.length;t<r;t++)s[i[e[t]]]=e[t];return s}function xp(i){var s=[];for(var e in i)Jt(i[e])&&s.push(e);return s.sort()}function kp(i,s){return function(e){var t=arguments.length;if(s&&(e=Object(e)),t<2||e==null)return e;for(var r=1;r<t;r++)for(var a=arguments[r],d=i(a),o=d.length,l=0;l<o;l++){var p=d[l];(!s||e[p]===void 0)&&(e[p]=a[p])}return e}}const KD=kp(bs),Rd=kp(Pt),XD=kp(bs,!0);function wZ(){return function(){}}function QD(i){if(!Vi(i))return{};if(OD)return OD(i);var s=wZ();s.prototype=i;var e=new s;return s.prototype=null,e}function VZ(i,s){var e=QD(i);return s&&Rd(e,s),e}function CZ(i){return Vi(i)?An(i)?i.slice():KD({},i):i}function BZ(i,s){return s(i),i}function e1(i){return An(i)?i:[i]}ze.toPath=e1;function Rs(i){return ze.toPath(i)}function Zp(i,s){for(var e=s.length,t=0;t<e;t++){if(i==null)return;i=i[s[t]]}return e?i:void 0}function t1(i,s,e){var t=Zp(i,Rs(s));return CD(t)?e:t}function _Z(i,s){s=Rs(s);for(var e=s.length,t=0;t<e;t++){var r=s[t];if(!Ci(i,r))return!1;i=i[r]}return!!e}function qp(i){return i}function As(i){return i=Rd({},i),function(s){return kD(s,i)}}function Jp(i){return i=Rs(i),function(s){return Zp(s,i)}}function Ds(i,s,e){if(s===void 0)return i;switch(e??3){case 1:return function(t){return i.call(s,t)};case 3:return function(t,r,a){return i.call(s,t,r,a)};case 4:return function(t,r,a,d){return i.call(s,t,r,a,d)}}return function(){return i.apply(s,arguments)}}function r1(i,s,e){return i==null?qp:Jt(i)?Ds(i,s,e):Vi(i)&&!An(i)?As(i):Jp(i)}function Wp(i,s){return r1(i,s,1/0)}ze.iteratee=Wp;function tr(i,s,e){return ze.iteratee!==Wp?ze.iteratee(i,s):r1(i,s,e)}function MZ(i,s,e){s=tr(s,e);for(var t=Pt(i),r=t.length,a={},d=0;d<r;d++){var o=t[d];a[o]=s(i[o],o,i)}return a}function i1(){}function gZ(i){return i==null?i1:function(s){return t1(i,s)}}function NZ(i,s,e){var t=Array(Math.max(0,i));s=Ds(s,e,1);for(var r=0;r<i;r++)t[r]=s(r);return t}function Yp(i,s){return s==null&&(s=i,i=0),i+Math.floor(Math.random()*(s-i+1))}const Os=Date.now||function(){return new Date().getTime()};function n1(i){var s=function(a){return i[a]},e="(?:"+Pt(i).join("|")+")",t=RegExp(e),r=RegExp(e,"g");return function(a){return a=a==null?"":""+a,t.test(a)?a.replace(r,s):a}}const a1={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},LZ=n1(a1),UZ=HD(a1),jZ=n1(UZ),$Z=ze.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var zp=/(.)^/,GZ={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},FZ=/\\|'|\r|\n|\u2028|\u2029/g;function SZ(i){return"\\"+GZ[i]}var xZ=/^\s*(\w|\$)+\s*$/;function kZ(i,s,e){!s&&e&&(s=e),s=XD({},s,ze.templateSettings);var t=RegExp([(s.escape||zp).source,(s.interpolate||zp).source,(s.evaluate||zp).source].join("|")+"|$","g"),r=0,a="__p+='";i.replace(t,function(p,h,c,v,E){return a+=i.slice(r,E).replace(FZ,SZ),r=E+p.length,h?a+=`'+
|
|
25
25
|
((__t=(`+h+`))==null?'':_.escape(__t))+
|
|
26
26
|
'`:c?a+=`'+
|
|
27
27
|
((__t=(`+c+`))==null?'':__t)+
|
|
@@ -40,7 +40,7 @@ Please provide a unique 'name' string.`,severity:D.Error,code:j.NameNotUniqueInS
|
|
|
40
40
|
Please provide a unique 'name' string.`,severity:D.Error,code:j.NameNotUniqueInScope,issue:null}))}}return e}function cc(i,s){const e=[];i.name||e.push(new P({id:`${i.id}--${j.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:D.Error,code:j.EmptyName,issue:null}));const t=B(i.parent);if(!t)e.push(new P({id:`${i.id}--parent-reference--${I.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:D.Error,code:I.InvalidReferenceObjectStructure,issue:null}));else{const r=s.get(t);if(!r)e.push(new P({id:`${i.id}--parent-reference--${I.ReferencedEntityNotFound}`,message:`The entity with id '${t}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:D.Error,code:I.ReferencedEntityNotFound,issue:null}));else{const d=Uc(r).filter(o=>o.name===i.name);d.length&&e.push(new P({id:`${i.id}--${j.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 "${d[0].id}" has the same name.
|
|
41
41
|
Please provide a unique 'name' string.`,severity:D.Error,code:j.NameNotUniqueInScope,issue:null}))}}return e}function fc(i,s){const e=[];i.name||e.push(new P({id:`${i.id}--${j.EmptyName}`,message:`Entity with id "${i.id}" and type "${i.type}" has an empty name. Please provide a 'name' string.`,severity:D.Error,code:j.EmptyName,issue:null}));const t=B(i.parent);if(!t)e.push(new P({id:`${i.id}--parent-reference--${I.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:D.Error,code:I.InvalidReferenceObjectStructure,issue:null}));else{const r=s.get(t);if(!r)e.push(new P({id:`${i.id}--parent-reference--${I.ReferencedEntityNotFound}`,message:`The entity with id '${t}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:D.Error,code:I.ReferencedEntityNotFound,issue:null}));else{const d=lP(r).filter(o=>o.name===i.name);d.length&&e.push(new P({id:`${i.id}--${j.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 "${d[0].id}" has the same name.
|
|
42
42
|
Please provide a unique 'name' string.`,severity:D.Error,code:j.NameNotUniqueInScope,issue:null}))}}return e}function L7(i,s){switch(i.type){case n.DefinitionEntity:return Bd(i,s);case n.FunctionDeclaration:return lc(i,s);case n.VariableDeclaration:return uc(i,s);case n.Property:return pc(i,s);case n.ArgumentDeclaration:return cc(i,s);case n.ReturnDeclaration:return fc(i,s);default:return[]}}function S1(i,s,e){const r=`${wd(i)}-${s}-id`;return e.instances[r]?R.UUID.uuid():r}function yc(i,s){let e="",t=null;if(i.parent){const a=s.get(i.parent);a&&(t=a)}let r="";return t&&(r=`${wd(G(t,s))}-`),e=`${r}${wd(G(i,s))}-id`,s.instances[e]?R.UUID.uuid():e}function ct(i,s,e="uuid"){return e==="semantic"?S1(G(i,s),i.type,s):R.UUID.uuid()}function U7(i){var d;const s=n6(),e=i.toJSON();s.safeParse(e).success;const r=j7(i);(d=i.dataType)==null||d.validate();const a=[...r];if(i.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const o=ye({id:`${i.id}--${q.PropertyImplementsNonAbstact}`,message:`Property "${G(i,i.project)}" with id "${i.id}" implements a non-abstract property "${G(i,i.project)}" with id "${i.id}".`,issue:null,severity:D.Error,code:q.PropertyImplementsNonAbstact,entity:i});a.push(o.error)}return a}function j7(i){const s=[];if(!i.implements)return s;const e=i.implements;if(!e.abstract){const r=ye({id:`${i.id}--${q.PropertyImplementsNonAbstact}`,message:`Property "${G(i,i.project)}" with id "${i.id}" implements a non-abstract property "${G(e,i.project)}" with id "${e.id}".`,issue:null,severity:D.Error,code:q.PropertyImplementsNonAbstact,entity:i});s.push(r.error)}if(i.static&&!e.static){const r=ye({id:`${i.id}--${q.NonStaticPropertyImplementsStatic}`,message:`Static property "${G(i,i.project)}" with id "${i.id}" implements a non-static property "${G(e,i.project)}" with id "${e.id}".`,issue:null,severity:D.Error,code:q.NonStaticPropertyImplementsStatic,entity:i});s.push(r.error)}if(!i.static&&e.static){const r=ye({id:`${i.id}--${q.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${G(i,i.project)}" with id "${i.id}" implements a static property "${G(e,i.project)}" with id "${e.id}".`,issue:null,severity:D.Error,code:q.StaticPropertyImplementsNonStatic,entity:i});s.push(r.error)}if(!Ir(i.dataType,e.dataType)){const r=ye({id:`${i.id}--${q.PropertyImplementsIncompatibleType}`,message:`Property "${G(i,i.project)}" with id "${i.id}" implements a property "${G(e,i.project)}" with id "${e.id}" that has an incompatible data type.`,issue:null,severity:D.Error,code:q.PropertyImplementsIncompatibleType,entity:i});s.push(r.error)}return Ye(i.errors,s)}function $7(i,s){const e=[];if(i.parent){const r=s.get(i.parent);if(!r)e.push(new P({id:`${i.id}--${i.parent}--${I.ReferencedEntityNotFound}`,code:I.ReferencedEntityNotFound,severity:D.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 a=Yi(r);if(a){const d=r!==a?`The entity of type '${i.type}' with id '${i.id}' have 'parent' with id '${i.parent}' because the entity belongs to a built-in '${a.type}' entity with id '${a.id}' (${G(a,r.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 ${a.type}.`;e.push(new P({id:`${i.id}--${I.InvalidBuiltInEntityReference}`,code:I.InvalidBuiltInEntityReference,severity:D.Error,message:d,issue:null}))}else if(![n.DefinitionEntity].includes(r.type))e.push(new P({id:`${i.id}--${i.parent}--${I.InvalidParentReference}`,code:I.InvalidParentReference,severity:D.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a parent reference that isn't pointing to an entity of type 'definition-entity'.`,issue:null}));else{const o=Wi(r).filter(l=>!l.interactive);if(o.length){let l=o.length>1?`The entity of type '${i.type}' with id '${i.id}' can't be added to the 'parent' entity with id '${r.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${ie(o.map(p=>G(p,p.project)),'", "','" and "')}").`:`The entity of type '${i.type}' with id '${i.id}' can't be added to the 'parent' entity with id '${r.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${G(o[0],o[0].project)}").`;l+=`
|
|
43
|
-
${Zi}`,e.push(new P({id:`${i.id}--${I.NonInteractiveEntityReferenced}`,code:I.NonInteractiveEntityReferenced,severity:D.Error,message:l,issue:null}))}else if(i.implements){const l=s.get(i.implements);if(i.id===i.implements)return e.push(new P({id:`${i.id}--${i.implements}--${I.SelfReference}`,code:I.SelfReference,severity:D.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})),e;if(!l)e.push(new P({id:`${i.id}--${i.implements}--${I.ReferencedEntityNotFound}`,code:I.ReferencedEntityNotFound,severity:D.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 p=r.properties.find(h=>{var c;return((c=h.implements)==null?void 0:c.id)===i.implements});p?e.push(new P({id:`${i.id}--${j.PropertyOverwrite}`,code:j.PropertyOverwrite,severity:D.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 '${p.id}' that implements the same base property.`,issue:null})):[n.Property].includes(l.type)?l.abstract||e.push(new P({id:`${i.id}--${i.implements}--${I.InvalidImplementsReference}`,code:I.InvalidImplementsReference,severity:D.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})):e.push(new P({id:`${i.id}--${i.implements}--${I.InvalidImplementsReference}`,code:I.InvalidImplementsReference,severity:D.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 t=Et(i,{},s);return e.push(...t.errors),e}class rt{constructor(s){f(this,"version");f(this,"previousVersion",null);f(this,"createdAt");f(this,"deleted",!1);f(this,"author");this.version=s.version,this.previousVersion=s.previousVersion,this.createdAt=T(s.createdAt).toISOString(),this.deleted=s.deleted,this.author=s.author}metaSync(s){this.deleted=s.deleted!==void 0?s.deleted:this.deleted}}var hc=(i=>(i.Manual="manual",i.Automatic="automatic",i))(hc||{}),b=(i=>(i.Added="added",i.Updated="updated",i.Removed="removed",i.Affected="affected",i))(b||{});class A{constructor(s,e,t,r,a=!1,d=""){f(this,"id",R.UUID.uuid());f(this,"seenEntities",[]);f(this,"added",{});f(this,"updated",{});f(this,"removed",{});f(this,"affected",{});f(this,"self",null);f(this,"author");f(this,"timestamp");f(this,"open",!0);f(this,"dirty",!0);f(this,"type","manual");f(this,"autoclose",!1);f(this,"autoCloseActionName","");f(this,"project");if(this.project=s,this.author=e,this.timestamp=t,this.self=r,this.autoclose=a,this.autoCloseActionName=d,this.autoclose&&!this.autoCloseActionName)throw new Error("Auto-close change-set must have an auto-close action name.")}get isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.updated).length===0&&Object.keys(this.removed).length===0}get isValid(){var s;return!(this.isEmpty&&this.self&&!this.affected[(s=this.self)==null?void 0:s.id])}get list(){return[...Object.values(this.added),...Object.values(this.updated),...Object.values(this.removed)]}get listAdded(){return Object.values(this.added)}get listUpdated(){return Object.values(this.updated)}get listRemoved(){return Object.values(this.removed)}get addedIds(){return Object.keys(this.added)}get updatedIds(){return Object.keys(this.updated)}get removedIds(){return Object.keys(this.removed)}get affectedIds(){return Object.keys(this.affected)}discardOrphans(){const s=[...this.addedIds,...this.updatedIds],e=this.project.toFlatIds(),t=Wr(),r=e.filter(d=>!t.includes(d));s.filter(d=>!r.includes(d)).forEach(d=>{this.remove(d)})}attemptAutoclose(s,e){var t;return this.autoclose&&this.autoCloseActionName&&this.autoCloseActionName===s&&(this.self&&e===((t=this.self)==null?void 0:t.id)||!this.self)&&this.close(),this}close(){return this.open=!1,!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],this.isEmpty?(this.project.discardChangeSet(this),this):(this.discardOrphans(),this.project.closeChangeSet(this),this)}get(s){return this.added[s]?this.added[s]:this.updated[s]?this.updated[s]:this.removed[s]?this.removed[s]:null}remove(s){return this.has(s)&&(delete this.added[s],delete this.updated[s],delete this.removed[s],delete this.affected[s],this.seenEntities=this.seenEntities.filter(e=>e!==s)),this}add(s,e){if(!this.open||!this.dirty)return this;const t=Array.from(new Set([...this.project.getAllBuiltInIds(),...Wr()]));if(t.includes(s.id))return this;if(!Kd(s,{...this.project.instances,...this.project.builtInInstances}).every(d=>!t.includes(d)))return this;if(this.seenEntities.indexOf(s.id)===-1&&this.seenEntities.push(s.id),(e==="updated"||e==="removed")&&!this.has(s.id)&&s.createdAt!==this.timestamp){s.increaseVersion(this.timestamp);const{added:d,updated:o,removed:l,affected:p}=s.recursiveCaptureUpstreamVersions(this.timestamp);for(const h of d)this.add(h,"added");for(const h of o)this.add(h,"updated");for(const h of l)this.add(h,"removed");for(const h of p)this.add(h,"affected")}if(e==="added"&&!this.has(s.id)&&s.createdAt!==this.timestamp){const{added:d,updated:o,removed:l,affected:p}=s.recursiveCaptureUpstreamVersions(this.timestamp);for(const h of d)this.add(h,"added");for(const h of o)this.add(h,"updated");for(const h of l)this.add(h,"removed");for(const h of p)this.add(h,"affected")}if(e==="removed"){if(this.added[s.id])return delete this.added[s.id],this.seenEntities=this.seenEntities.filter(d=>d!==s.id),delete this.project.deletedInstances[s.id],this;this.updated[s.id]&&delete this.updated[s.id],this.affected[s.id]&&delete this.affected[s.id],this.removed[s.id]=s}if(e==="added"){if(this.removed[s.id])return this;this.updated[s.id]&&delete this.updated[s.id],this.affected[s.id]&&delete this.affected[s.id],this.added[s.id]=s}if(e==="updated"){if(this.removed[s.id])return this;if(this.added[s.id])return this;this.affected[s.id]&&delete this.affected[s.id],this.updated[s.id]=s}if(e==="affected"){if(this.removed[s.id])return this;if(this.added[s.id])return this;if(this.updated[s.id])return this;this.affected[s.id]=s}return this}toJSON(){const s={},e={},t={},r=new Set;for(const a of Object.values(this.added))s[a.id]=a.toShallowJSON();for(const a of Object.values(this.updated))e[a.id]=a.toShallowJSON();for(const a of Object.values(this.removed))t[a.id]=a.toShallowJSON();for(const a of Object.values(this.affected))r.add(a.id);return{added:s,updated:e,removed:t,affected:Array.from(r),self:this.self?this.self.toShallowJSON():null,seenEntities:this.seenEntities}}has(s){return!!this.added[s]||!!this.removed[s]||!!this.updated[s]||!!this.affected[s]}hasAdded(s){return!!this.added[s]}hasUpdated(s){return!!this.updated[s]}hasRemoved(s){return!!this.removed[s]}hasAffected(s){return!!this.affected[s]}}function G7(i){return new Set([...Object.keys(i.added),...Object.keys(i.updated),...Object.keys(i.removed),...Array.from(i.affected)])}var x1=(i=>(i.Implements="implements",i.DataTypeEntity="data-type-entity",i))(x1||{});const Ie=class Ie extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"name");f(this,"description",null);f(this,"private");f(this,"abstract");f(this,"index");f(this,"static");f(this,"required");f(this,"constant",!1);f(this,"type",n.Property);f(this,"hidden",!1);f(this,"defaultValue",null);f(this,"dataType",null);f(this,"implements",null);f(this,"project");f(this,"errors",[]);f(this,"parent");f(this,"detachedDependents",{});f(this,"knownVersions",null);f(this,"activeVersion",!1);f(this,"initialized",!1);f(this,"startedInitialization",!1);f(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1,this.hidden=e.hidden||!1,this.constant=e.constant||!1}static fromGenerationTarget(e,t){const r=B(e.parent),a=t.get(r);let d=null;if(e.implements){const p=B(e.implements);d=t.get(p)}const o={id:e.id,version:R.UUID.uuid(),createdAt:T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:e.name,type:n.Property,index:a.properties.length,private:e.private||!1,abstract:e.abstract||!1,static:e.static||!1,required:e.required||!1,constant:e.constant||!1,hidden:!1,description:e.description,defaultValue:null,implements:d,dataType:null,parent:a},l=V(o,t);return l.setParent(a,null),l.initChildren(null),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],d=$7(r,t),o=pc(r,t);return a.push(...d,...o,...ot(r)),{errors:a,modifiedData:r}}get isExtendedProperty(){const e=this.parent.allBasePropertiesFromExtendedAndImplementedEntities.find(t=>t.name===this.name);return!!e&&e.id!==this.id&&!e.abstract}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new P({id:`${this.id}--${I.InvalidParentUpdate}`,code:I.InvalidParentUpdate,severity:D.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.
|
|
43
|
+
${Zi}`,e.push(new P({id:`${i.id}--${I.NonInteractiveEntityReferenced}`,code:I.NonInteractiveEntityReferenced,severity:D.Error,message:l,issue:null}))}else if(i.implements){const l=s.get(i.implements);if(i.id===i.implements)return e.push(new P({id:`${i.id}--${i.implements}--${I.SelfReference}`,code:I.SelfReference,severity:D.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})),e;if(!l)e.push(new P({id:`${i.id}--${i.implements}--${I.ReferencedEntityNotFound}`,code:I.ReferencedEntityNotFound,severity:D.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 p=r.properties.find(h=>{var c;return((c=h.implements)==null?void 0:c.id)===i.implements});p?e.push(new P({id:`${i.id}--${j.PropertyOverwrite}`,code:j.PropertyOverwrite,severity:D.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 '${p.id}' that implements the same base property.`,issue:null})):[n.Property].includes(l.type)?l.abstract||e.push(new P({id:`${i.id}--${i.implements}--${I.InvalidImplementsReference}`,code:I.InvalidImplementsReference,severity:D.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})):e.push(new P({id:`${i.id}--${i.implements}--${I.InvalidImplementsReference}`,code:I.InvalidImplementsReference,severity:D.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 t=Et(i,{},s);return e.push(...t.errors),e}class rt{constructor(s){f(this,"version");f(this,"previousVersion",null);f(this,"createdAt");f(this,"deleted",!1);f(this,"author");this.version=s.version,this.previousVersion=s.previousVersion,this.createdAt=T(s.createdAt).toISOString(),this.deleted=s.deleted,this.author=s.author}metaSync(s){this.deleted=s.deleted!==void 0?s.deleted:this.deleted}}var hc=(i=>(i.Manual="manual",i.Automatic="automatic",i))(hc||{}),b=(i=>(i.Added="added",i.Updated="updated",i.Removed="removed",i.Affected="affected",i))(b||{});class A{constructor(s,e,t,r,a=!1,d=""){f(this,"id",R.UUID.uuid());f(this,"seenEntities",[]);f(this,"added",{});f(this,"updated",{});f(this,"removed",{});f(this,"affected",{});f(this,"self",null);f(this,"author");f(this,"timestamp");f(this,"open",!0);f(this,"dirty",!0);f(this,"type","manual");f(this,"autoclose",!1);f(this,"autoCloseActionName","");f(this,"project");if(this.project=s,this.author=e||R.sessionAuthor||"",this.timestamp=t,this.self=r,this.autoclose=a,this.autoCloseActionName=d,this.autoclose&&!this.autoCloseActionName)throw new Error("Auto-close change-set must have an auto-close action name.")}get isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.updated).length===0&&Object.keys(this.removed).length===0}get isValid(){var s;return!(this.isEmpty&&this.self&&!this.affected[(s=this.self)==null?void 0:s.id])}get list(){return[...Object.values(this.added),...Object.values(this.updated),...Object.values(this.removed)]}get listAdded(){return Object.values(this.added)}get listUpdated(){return Object.values(this.updated)}get listRemoved(){return Object.values(this.removed)}get addedIds(){return Object.keys(this.added)}get updatedIds(){return Object.keys(this.updated)}get removedIds(){return Object.keys(this.removed)}get affectedIds(){return Object.keys(this.affected)}discardOrphans(){const s=[...this.addedIds,...this.updatedIds],e=this.project.toFlatIds(),t=Wr(),r=e.filter(d=>!t.includes(d));s.filter(d=>!r.includes(d)).forEach(d=>{this.remove(d)})}attemptAutoclose(s,e){var t;return this.autoclose&&this.autoCloseActionName&&this.autoCloseActionName===s&&(this.self&&e===((t=this.self)==null?void 0:t.id)||!this.self)&&this.close(),this}close(){return this.open=!1,!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],this.isEmpty?(this.project.discardChangeSet(this),this):(this.discardOrphans(),this.project.closeChangeSet(this),this)}get(s){return this.added[s]?this.added[s]:this.updated[s]?this.updated[s]:this.removed[s]?this.removed[s]:null}remove(s){return this.has(s)&&(delete this.added[s],delete this.updated[s],delete this.removed[s],delete this.affected[s],this.seenEntities=this.seenEntities.filter(e=>e!==s)),this}add(s,e){if(!this.open||!this.dirty)return this;const t=Array.from(new Set([...this.project.getAllBuiltInIds(),...Wr()]));if(t.includes(s.id))return this;if(!Kd(s,{...this.project.instances,...this.project.builtInInstances}).every(d=>!t.includes(d)))return this;if(this.seenEntities.indexOf(s.id)===-1&&this.seenEntities.push(s.id),(e==="updated"||e==="removed")&&!this.has(s.id)&&s.createdAt!==this.timestamp){s.increaseVersion(this.timestamp);const{added:d,updated:o,removed:l,affected:p}=s.recursiveCaptureUpstreamVersions(this.timestamp);for(const h of d)this.add(h,"added");for(const h of o)this.add(h,"updated");for(const h of l)this.add(h,"removed");for(const h of p)this.add(h,"affected")}if(e==="added"&&!this.has(s.id)&&s.createdAt!==this.timestamp){const{added:d,updated:o,removed:l,affected:p}=s.recursiveCaptureUpstreamVersions(this.timestamp);for(const h of d)this.add(h,"added");for(const h of o)this.add(h,"updated");for(const h of l)this.add(h,"removed");for(const h of p)this.add(h,"affected")}if(e==="removed"){if(this.added[s.id])return delete this.added[s.id],this.seenEntities=this.seenEntities.filter(d=>d!==s.id),delete this.project.deletedInstances[s.id],this;this.updated[s.id]&&delete this.updated[s.id],this.affected[s.id]&&delete this.affected[s.id],this.removed[s.id]=s}if(e==="added"){if(this.removed[s.id])return this;this.updated[s.id]&&delete this.updated[s.id],this.affected[s.id]&&delete this.affected[s.id],this.added[s.id]=s}if(e==="updated"){if(this.removed[s.id])return this;if(this.added[s.id])return this;this.affected[s.id]&&delete this.affected[s.id],this.updated[s.id]=s}if(e==="affected"){if(this.removed[s.id])return this;if(this.added[s.id])return this;if(this.updated[s.id])return this;this.affected[s.id]=s}return this}toJSON(){const s={},e={},t={},r=new Set;for(const a of Object.values(this.added))s[a.id]=a.toShallowJSON();for(const a of Object.values(this.updated))e[a.id]=a.toShallowJSON();for(const a of Object.values(this.removed))t[a.id]=a.toShallowJSON();for(const a of Object.values(this.affected))r.add(a.id);return{added:s,updated:e,removed:t,affected:Array.from(r),self:this.self?this.self.toShallowJSON():null,seenEntities:this.seenEntities}}has(s){return!!this.added[s]||!!this.removed[s]||!!this.updated[s]||!!this.affected[s]}hasAdded(s){return!!this.added[s]}hasUpdated(s){return!!this.updated[s]}hasRemoved(s){return!!this.removed[s]}hasAffected(s){return!!this.affected[s]}}function G7(i){return new Set([...Object.keys(i.added),...Object.keys(i.updated),...Object.keys(i.removed),...Array.from(i.affected)])}var x1=(i=>(i.Implements="implements",i.DataTypeEntity="data-type-entity",i))(x1||{});const Ie=class Ie extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"name");f(this,"description",null);f(this,"private");f(this,"abstract");f(this,"index");f(this,"static");f(this,"required");f(this,"constant",!1);f(this,"type",n.Property);f(this,"hidden",!1);f(this,"defaultValue",null);f(this,"dataType",null);f(this,"implements",null);f(this,"project");f(this,"errors",[]);f(this,"parent");f(this,"detachedDependents",{});f(this,"knownVersions",null);f(this,"activeVersion",!1);f(this,"initialized",!1);f(this,"startedInitialization",!1);f(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1,this.hidden=e.hidden||!1,this.constant=e.constant||!1}static fromGenerationTarget(e,t){const r=B(e.parent),a=t.get(r);let d=null;if(e.implements){const p=B(e.implements);d=t.get(p)}const o={id:e.id,version:R.UUID.uuid(),createdAt:T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:e.name,type:n.Property,index:a.properties.length,private:e.private||!1,abstract:e.abstract||!1,static:e.static||!1,required:e.required||!1,constant:e.constant||!1,hidden:!1,description:e.description,defaultValue:null,implements:d,dataType:null,parent:a},l=V(o,t);return l.setParent(a,null),l.initChildren(null),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],d=$7(r,t),o=pc(r,t);return a.push(...d,...o,...ot(r)),{errors:a,modifiedData:r}}get isExtendedProperty(){const e=this.parent.allBasePropertiesFromExtendedAndImplementedEntities.find(t=>t.name===this.name);return!!e&&e.id!==this.id&&!e.abstract}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new P({id:`${this.id}--${I.InvalidParentUpdate}`,code:I.InvalidParentUpdate,severity:D.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
44
44
|
This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),(e.readsValue||e.writesValue)&&t.push(new P({id:`${this.id}--${j.InvalidObjectStructure}`,code:j.InvalidObjectStructure,severity:D.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
|
|
45
45
|
${Ld}`,issue:null})),{errors:t,modifiedData:e}}subscribeDependents(e){return e.forEach(t=>{this.detachedDependents[t.entity.id]||(this.detachedDependents[t.entity.id]=t)}),this}syncDependents(){const e=[],t=[],r=[],a=[];return Object.values(this.detachedDependents).forEach(d=>{const o=d.entity.afterAllChildrenInitialized();e.push(...o.updated),t.push(...o.added),r.push(...o.removed),a.push(...o.affected)}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}onDetachedDependencyRemoved(e,t,r){const a=[],d=[],o=[],l=[];return t==="implements"&&(this.setImplements(null,r),a.push(this)),{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}onDetachedDependencyRestored(e,t,r){const a=[],d=[],o=[],l=[];return t==="implements"&&(this.setImplements(e,r),a.push(this)),{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}subscribeToDependencies(){var e,t,r,a,d;return(t=(e=this.implements)==null?void 0:e.subscribeDependents)==null||t.call(e,[{entity:this,field:"implements"}]),(d=(a=(r=this.dataType)==null?void 0:r.entity)==null?void 0:a.subscribeDependents)==null||d.call(a,[{entity:this,field:"data-type-entity"}]),this}increaseVersion(e){if(e&&!T(e).isValid())throw new Error(`The shared timestamp '${e}' is not a valid ISO 8601 date string.`);return e&&T(e).isSame(T(this.createdAt))?this:(this.previousVersion=this.version,this.version=R.UUID.uuid(),this.createdAt=T(e).toISOString()||T().toISOString(),this)}captureVersion(){var t,r;const e=((t=this.knownVersions)==null?void 0:t.get(this.version))||new Ie(this,this.project);return(r=this.knownVersions)==null||r.set(this.version,e),e.defaultValue=this.defaultValue,e.dataType=this.dataType,e.implements=this.implements,e.parent=this.parent,this}recursiveCaptureUpstreamVersions(e){const t=[],r=[],a=[],d=[];if(this.parent&&this.parent.type!==n.PrimitiveEntity&&this.parent.type!==n.BuiltInBaseEntity){this.parent.increaseVersion(e);const o=this.parent.recursiveCaptureUpstreamVersions(e);t.push(this.parent,...o.updated),r.push(...o.added),a.push(...o.removed)}return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}async restoreVersion(e){var l;const t=[],r=[],a=[],d=[];if(this.version===e)return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this};if(!this.knownVersions){const p=new Map;for(const[h,c]of this.knownVersions||new Map){if(p.set(h,c),c.activeVersion=!1,c.knownVersions)for(const[v,E]of c.knownVersions)p.set(v,E);c.knownVersions=null}}let o=(l=this.knownVersions)==null?void 0:l.get(e);if(!o){const p=await this.APILoadVersion({},e);if(!p)throw new Error(`Version with id '${e}' for entity with id '${this.id}' not found.`);o=new Ie(p,this.project)}return this.metaSync(o.toShallowJSON(),null),this.defaultValue=o.defaultValue,this.dataType=o.dataType,this.implements=o.implements,this.parent=o.parent,{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}hydrateAncestors(){const e=[],t=[],r=[],a=[];if(this.initialData.parent){const d=B(this.initialData.parent),o=this.project.get(d);if(o)this.setParent(o,null),e.push(o);else throw new Error(`${Wt(this.type)} with id '${this.id}' has a parent reference "${d}" which is missing in the project`)}else throw new Error(`${Wt(this.type)} with id '${this.id}' is missing a parent reference`);if(this.initialData.implements){const d=B(this.initialData.implements),o=this.project.get(d);o&&(this.setImplements(o,null),e.push(o))}return{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}afterAllChildrenInitialized(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"after-all-children-initialized"))){const t=[],r=[],a=[],d=[];return this.initialized=!0,this.captureVersion(),e==null||e.attemptAutoclose("after-all-children-initialized",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSelfToProject(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-self-to-project"))){const t=[this],r=[],a=[],d=[];return this.parent.addProperty(this),t.push(this.parent),this.subscribe(),this.subscribeToDependencies(),e==null||e.attemptAutoclose("add-self-to-project",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}setParent(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"set-parent"))){var r;return((r=this.parent)==null?void 0:r.id)!==(e==null?void 0:e.id)&&(this.parent=e,t&&(t==null||t.add(this,b.Updated),t==null||t.attemptAutoclose("set-parent",this.id))),this}setImplements(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"set-implements"))){var r;return((r=this.implements)==null?void 0:r.id)!==(e==null?void 0:e.id)&&(this.implements=e,t&&(t==null||t.add(this,b.Updated),t==null||t.attemptAutoclose("set-implements",this.id))),this}initChildren(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.initialData.defaultValue&&(this.defaultValue=V(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this,null),this.defaultValue.initChildren(e)),this.initialData.dataType){const t=V(this.initialData.dataType,this.project);t.setParent(this,null),t.initChildren(e),this.dataType=t}if(this.initialData.implements){const t=V(this.initialData.implements,this.project);this.setImplements(t,null)}return this.subscribeToDependencies(),this.afterAllChildrenInitialized(e),e==null||e.attemptAutoclose("init-children",this.id),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-meta"))){const r=dt(this,e);return e.deleted===!0&&!this.deleted?t==null||t.add(this,b.Removed):e.deleted===!1&&this.deleted?t==null||t.add(this,b.Added):r&&(t==null||t.add(this,b.Updated)),super.metaSync(e),this.name=e.name||this.name,this.description=e.description||this.description,this.abstract=e.abstract!==void 0?e.abstract:this.abstract,this.private=e.private!==void 0?e.private:this.private,this.index=e.index||(e.index!==0?this.index:0),this.static=e.static!==void 0?e.static:this.static,this.hidden=e.hidden!==void 0?e.hidden:this.hidden,this.constant=e.constant!==void 0?e.constant:this.constant,this.required=e.required!==void 0?e.required:this.required,t==null||t.attemptAutoclose("sync-meta",this.id),this}async APILoad(e=L,...t){return await Ie.repository.APILoad(this.id,...t),this}async APICreate(e=L,...t){return await Ie.repository.APICreate(this.toShallowJSON(),...t),this}async APIUpdate(e=L,...t){return await Ie.repository.APIUpdate(this.toShallowJSON(),...t),this}async APIDelete(e=L,...t){return await Ie.repository.APIDelete(this.toShallowJSON(),...t),this}async APIClone(e=L,...t){return await Ie.repository.APIClone(this.id,...t),this}async APILoadVersion(e=L,t,...r){return await Ie.repository.APILoadVersion(this.id,t,...r)}remove({ignoreUpstream:e}={ignoreUpstream:!1},t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-entity"))){const r=[],a=[],d=[],o=[];if(t!=null&&t.hasRemoved(this.id))return t==null||t.attemptAutoclose("remove-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(a.push(this),this.unsubscribe(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},t),Object.values(this.detachedDependents).forEach(l=>{const{updated:p,removed:h,added:c}=l.entity.onDetachedDependencyRemoved(this,l.field,t);r.push(...p),a.push(...h),d.push(...c)}),this.defaultValue){const{updated:l,removed:p}=this.defaultValue.remove({ignoreUpstream:!0},t);r.push(...l),a.push(...p)}if(this.dataType){const{updated:l,removed:p}=this.dataType.remove({ignoreUpstream:!0},t);r.push(...l),a.push(...p)}return e||this.parent.type===n.DefinitionEntity&&(this.parent.removeProperty(this),r.push(this.parent)),t==null||t.attemptAutoclose("remove-entity",this.id),{added:u(d),updated:u(r),removed:u(a),affected:u(o),self:this}}restore({}={},e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"restore-entity"))){const t=[],r=[],a=[],d=[];if(e!=null&&e.hasAdded(this.id))return e==null||e.attemptAutoclose("restore-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},e),this.defaultValue){const{updated:o}=this.defaultValue.restore({},e);r.push(...o)}if(this.dataType){const{updated:o}=this.dataType.restore({},e);r.push(...o)}return this.parent.type===n.DefinitionEntity&&(this.parent.addProperty(this),r.push(this.parent)),e==null||e.attemptAutoclose("restore-entity",this.id),{added:u(t),updated:u(r),removed:u(a),affected:u(d),self:this}}toFlat(e=new Set){var r,a;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.defaultValue)==null?void 0:r.toFlat(e))||[],...((a=this.dataType)==null?void 0:a.toFlat(e))||[],...this.parent.toFlat(e)])}toFlatIds(e=new Set){var r,a;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.defaultValue)==null?void 0:r.toFlatIds(e))||[],...((a=this.dataType)==null?void 0:a.toFlatIds(e))||[],...this.parent.toFlatIds(e)])}toJSON(e=new Set){var t,r,a;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,constant:this.constant,abstract:this.abstract,hidden:this.hidden,defaultValue:((t=this.defaultValue)==null?void 0:t.toJSON(e))||null,dataType:((r=this.dataType)==null?void 0:r.toJSON(e))||null,implements:((a=this.implements)==null?void 0:a.toJSON(e))||null,parent:this.parent.toReference()})}toJSONClone(e=Z){var r,a,d,o,l,p,h;let t;return(r=e.seenEntityMaps)!=null&&r.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||ct(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(d=e.seenEntities)!=null&&d.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:R.UUID.uuid(),createdAt:e.timestamp||T().toISOString(),author:"1",previousVersion:null,deleted:!1,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,constant:this.constant,abstract:this.abstract,hidden:this.hidden,defaultValue:((p=this.defaultValue)==null?void 0:p.toJSONClone({...e,newId:null}))||null,dataType:((h=this.dataType)==null?void 0:h.toJSONClone({...e,newId:null}))||null,implements:(()=>{var c;return this.implements&&this.project.getBuiltIn(this.implements.id)?this.implements.toJSON():((c=this.implements)==null?void 0:c.toJSONClone({...e,newId:null}))||null})(),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:t,version:this.version,entityType:this.type}}toShallowJSON(e=Z){var r,a,d,o;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,name:this.name,description:this.description,type:this.type,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,constant:this.constant,hidden:this.hidden,defaultValue:((a=this.defaultValue)==null?void 0:a.toReference(e))||null,dataType:((d=this.dataType)==null?void 0:d.toReference(e))||null,implements:((o=this.implements)==null?void 0:o.toReference(e))||null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){var r,a,d;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.defaultValue)==null?void 0:r.toFlatJSON(e))||[],...((a=this.dataType)==null?void 0:a.toFlatJSON(e))||[],...((d=this.implements)==null?void 0:d.toFlatJSON(e))||[],...this.parent.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,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.defaultValue)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e,t;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.dataType)==null||t.clearErrors(),this}validate(){return this.errors=U7(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t,r;return[...this.errors,...((t=this.defaultValue)==null?void 0:t.getErrors())||[],...((r=this.dataType)==null?void 0:r.getErrors())||[]]}getShallowErrors(){return this.errors}clone(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"clone-entity")),t=null,r=null,a=!0){var E,O;let d=ft(t,this);const o=r||R.UUID.uuid();let l=t||this.parent;const p={hidden:!1,id:o,version:R.UUID.uuid(),createdAt:(e==null?void 0:e.timestamp)||T().toISOString(),author:(e==null?void 0:e.author)||"1",previousVersion:null,deleted:!1,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,constant:this.constant,required:this.required,abstract:this.abstract,static:this.static,defaultValue:null,dataType:null,implements:this.implements,parent:l},h=lt(p,d);a&&h.subscribe(),h.setParent(l,null),h.initChildren(e),e==null||e.add(h,b.Added);const c=((E=this.dataType)==null?void 0:E.clone(e,h,R.UUID.uuid(),a))||null;c&&h.setDataType(c);const v=(O=this.defaultValue)==null?void 0:O.clone(e,h,R.UUID.uuid(),a);return h.defaultValue=v||null,this.implements&&(h.implements=this.implements),h.addSelfToProject(null),e==null||e.attemptAutoclose("clone-entity",this.id),h}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"get-data-type"))){return this.dataType}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}};f(Ie,"repository",{APICreate:async(e,...t)=>e,APIUpdate:async(e,...t)=>e,APIDelete:async(e,...t)=>e,APIClone:async(e,...t)=>{},APILoad:async(e,...t)=>null,APILoadVersion:async(e,t,...r)=>null}),f(Ie,"type",n.Property),f(Ie,"USER_MANAGED_PARENT_TYPES",[n.DefinitionEntity]),f(Ie,"PARENT_TYPES",[...Ie.USER_MANAGED_PARENT_TYPES,n.PrimitiveEntity,n.BuiltInBaseEntity]),f(Ie,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required","constant"]),f(Ie,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),f(Ie,"BASE_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,...Ie.INMUTABLE_BASE_PROPERTIES]),f(Ie,"MUTABLE_META_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,"index"]),f(Ie,"INMUTABLE_META_PROPERTIES",[...Ie.INMUTABLE_BASE_PROPERTIES]),f(Ie,"META_PROPERTIES",[...Ie.MUTABLE_META_PROPERTIES,...Ie.INMUTABLE_META_PROPERTIES]),f(Ie,"MUTABLE_UPSTREAM_PROPERTIES",[]),f(Ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),f(Ie,"UPSTREAM_PROPERTIES",[...Ie.MUTABLE_UPSTREAM_PROPERTIES,...Ie.INMUTABLE_UPSTREAM_PROPERTIES]),f(Ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),f(Ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),f(Ie,"DOWNSTREAM_PROPERTIES",[...Ie.MUTABLE_DOWNSTREAM_PROPERTIES,...Ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),f(Ie,"PROPERTIES",[...Ie.META_PROPERTIES,...Ie.UPSTREAM_PROPERTIES,...Ie.DOWNSTREAM_PROPERTIES]);let Bi=Ie;function F7(i){var a;const s=V6(),e=i.toJSON();s.safeParse(e).success,(a=i.dataType)==null||a.validate();const r=[];if(i.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const d=ye({id:`${i.id}--${q.PropertyImplementsNonAbstact}`,message:`Property "${G(i,i.project)}" with id "${i.id}" implements a non-abstract property "${G(i,i.project)}" with id "${i.id}".`,issue:null,severity:D.Error,code:q.PropertyImplementsNonAbstact,entity:i});r.push(d.error)}return Ye(i.errors,r)}var k1=(i=>(i.Implements="implements",i.DataTypeEntity="data-type-entity",i))(k1||{});const be=class be extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"name");f(this,"description",null);f(this,"index");f(this,"required");f(this,"constant",!0);f(this,"isError");f(this,"type",n.ReturnDeclaration);f(this,"defaultValue",null);f(this,"dataType",null);f(this,"readsValue",null);f(this,"implements",null);f(this,"project");f(this,"errors",[]);f(this,"parent");f(this,"detachedDependents",{});f(this,"knownVersions",null);f(this,"activeVersion",!1);f(this,"initialized",!1);f(this,"startedInitialization",!1);f(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.constant=!0,this.isError=e.isError}static fromGenerationTarget(e,t){const r=B(e.parent),a=t.get(r);let d=null;if(e.readsValue){const p=B(e.readsValue);d=t.get(p)}const o={id:e.id,version:R.UUID.uuid(),createdAt:T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:e.name,type:n.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,defaultValue:null,implements:null,required:e.required,constant:!0,readsValue:d,dataType:null,parent:a},l=V(o,t);return l.setParent(a,null),l.initChildren(null),l}static validateGenerationTarget(e,t){var l,p;let r=JSON.parse(JSON.stringify(e));const a=[],d=Et(r,{parent:{list:!1,types:[n.ReturnStatement,n.Search,n.BreakStatement,n.ContinueStatement]}},t),o=fc(r,t);if(r=d.modifiedData,r.parent){const h=t.get(B(r.parent));if(h&&[n.BreakStatement,n.ContinueStatement].includes(h.type)){const c=h,v=c.parent,E=[...v.breakStatements.filter(w=>w.id!==h.id),...v.continueStatements.filter(w=>w.id!==h.id)];if(c.outputs.length)a.push(new P({id:`${r.id}--${j.NoOverlapWithImplementedSignature}`,code:j.NoOverlapWithImplementedSignature,severity:D.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${r.id}' cannot be added to the parent entity of type '${c.type}' with id '${c.id}'. This '${c.type}' already has return declarations.
|
|
46
46
|
${Rc}`,issue:null}));else{const w=(p=(l=E[0])==null?void 0:l.outputs[0])==null?void 0:p.name;w!==r.name&&a.push(new P({id:`${r.id}--${j.NoOverlapWithImplementedSignature}`,code:j.NoOverlapWithImplementedSignature,severity:D.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${r.id}' cannot be added to the parent entity of type '${c.type}' with id '${c.id}'. This new 'return-declaration' doesn't have the same name "${w}" as the return declarations on the other statements in the same scope.
|
|
@@ -405,4 +405,4 @@ If an entity is called by another, they must be in the same scope, which means t
|
|
|
405
405
|
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}}subscribeDependents(e){return e.forEach(t=>{this.detachedDependents[t.entity.id]||(this.detachedDependents[t.entity.id]=t)}),this}syncDependents(){const e=[],t=[],r=[],a=[];return Object.values(this.detachedDependents).forEach(d=>{const o=d.entity.afterAllChildrenInitialized();e.push(...o.updated),t.push(...o.added),r.push(...o.removed),a.push(...o.affected)}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}onDetachedDependencyRemoved(e,t,r){const a=[],d=[],o=[],l=[];if(t==="declaration"){const{updated:p,added:h,removed:c}=this.remove({ignoreUpstream:!1},r);a.push(...p),d.push(...h),o.push(...c)}if(t==="parent"){const{updated:p,added:h,removed:c}=this.remove({ignoreUpstream:!1},r);a.push(...p),d.push(...h),o.push(...c)}return{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}onDetachedDependencyRestored(e,t,r){const a=[],d=[],o=[],l=[];if(t==="declaration"){const{updated:p,added:h,removed:c}=this.restore({},r);a.push(...p),d.push(...h),o.push(...c)}if(t==="parent"){const{updated:p,added:h,removed:c}=this.restore({},r);a.push(...p),d.push(...h),o.push(...c)}return{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}subscribeToDependencies(){var e;return(e=this.parent)==null||e.subscribeDependents([{entity:this,field:"parent"}]),this.declaration.subscribeDependents([{entity:this,field:"declaration"}]),this}increaseVersion(e){if(e&&!T(e).isValid())throw new Error(`The shared timestamp '${e}' is not a valid ISO 8601 date string.`);return e&&T(e).isSame(T(this.createdAt))?this:(this.previousVersion=this.version,this.version=R.UUID.uuid(),this.createdAt=T(e).toISOString()||T().toISOString(),this)}captureVersion(){var t,r;const e=((t=this.knownVersions)==null?void 0:t.get(this.version))||new ke(this,this.project);return(r=this.knownVersions)==null||r.set(this.version,e),e.inputs=this.inputs,e.outputs=this.outputs,e.error=this.error,e.successCalls=this.successCalls,e.errorCalls=this.errorCalls,e.process=this.process,e.declaration=this.declaration,e.calledBySuccess=this.calledBySuccess,e.calledByError=this.calledByError,e.calledByEntry=this.calledByEntry,e.parent=this.parent,this}recursiveCaptureUpstreamVersions(e){const t=[],r=[],a=[],d=[];if(this.parent){this.parent.increaseVersion(e);const o=this.parent.recursiveCaptureUpstreamVersions(e);t.push(this.parent,...o.updated),r.push(...o.added),a.push(...o.removed)}return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}async restoreVersion(e){var l;const t=[],r=[],a=[],d=[];if(this.version===e)return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this};if(!this.knownVersions){const p=new Map;for(const[h,c]of this.knownVersions||new Map){if(p.set(h,c),c.activeVersion=!1,c.knownVersions)for(const[v,E]of c.knownVersions)p.set(v,E);c.knownVersions=null}}let o=(l=this.knownVersions)==null?void 0:l.get(e);if(!o){const p=await this.APILoadVersion({},e);if(!p)throw new Error(`Version with id '${e}' for entity with id '${this.id}' not found.`);o=new ke(p,this.project)}return this.metaSync(o.toShallowJSON(),null),this.inputs=o.inputs,this.outputs=o.outputs,this.error=o.error,this.successCalls=o.successCalls,this.errorCalls=o.errorCalls,this.process=o.process,this.declaration=o.declaration,this.calledBySuccess=o.calledBySuccess,this.calledByError=o.calledByError,this.calledByEntry=o.calledByEntry,this.parent=o.parent,{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}hydrateAncestors(){const e=[],t=[],r=[],a=[];if(this.initialData.parent){const d=B(this.initialData.parent),o=this.project.get(d);o&&(this.setParent(o,null),e.push(o))}if(this.initialData.declaration){const d=B(this.initialData.declaration),o=this.project.get(d);o&&(this.setDeclaration(o),e.push(o))}return this.initialData.calledByEntry.forEach(d=>{const o=B(d),l=this.project.get(o);l&&(this.addEntryCaller(l,null),e.push(l))}),this.initialData.calledBySuccess.forEach(d=>{const o=B(d),l=this.project.get(o);l&&(this.addSuccessCaller(l,null),e.push(l))}),this.initialData.calledByError.forEach(d=>{const o=B(d),l=this.project.get(o);l&&(this.addErrorCaller(l,null),e.push(l))}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}afterAllChildrenInitialized(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"after-all-children-initialized"))){const t=[],r=[],a=[],d=[];this.initialized=!0,this.captureVersion();const{updated:o,added:l,removed:p}=this.syncMissingFixedInputs(e),{updated:h,added:c,removed:v}=this.syncMissingFixedOutputs(e);return t.push(...o,...h),r.push(...l,...c),a.push(...p,...v),e==null||e.attemptAutoclose("after-all-children-initialized",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSelfToProject(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-self-to-project"))){var o;const t=[this],r=[],a=[],d=[];return this.parent===this.project&&this.project.addFunctionCall(this),(o=this.process)==null||o.writesValues.forEach(l=>{l.setValueWriter(this.process),t.push(l)}),this.successCalls.forEach(l=>{l.addSuccessCaller(this,e),t.push(l)}),this.errorCalls.forEach(l=>{l.addErrorCaller(this,e),t.push(l)}),this.calledBySuccess.forEach(l=>{l.addSuccessCall(this),t.push(l)}),this.calledByError.forEach(l=>{l.addErrorCall(this),t.push(l)}),this.calledByEntry.forEach(l=>{l.addCall(this),t.push(l)}),this.subscribe(),this.subscribeToDependencies(),e==null||e.attemptAutoclose("add-self-to-project",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self: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,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-success-caller"))){return this.calledBySuccess.find(r=>r.id===e.id)||(this.calledBySuccess.push(e),t&&(t==null||t.add(this,b.Updated),t==null||t.add(e,b.Affected)),t==null||t.attemptAutoclose("add-success-caller",this.id)),this}addErrorCaller(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-error-caller"))){return this.calledByError.find(r=>r.id===e.id)||(this.calledByError.push(e),t&&(t==null||t.add(this,b.Updated),t==null||t.add(e,b.Affected)),t==null||t.attemptAutoclose("add-error-caller",this.id)),this}addEntryCaller(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-entry-caller"))){return this.calledByEntry.find(r=>r.id===e.id)||(this.calledByEntry.push(e),t&&(t==null||t.add(this,b.Updated),t==null||t.add(e,b.Affected)),t==null||t.attemptAutoclose("add-entry-caller",this.id)),this}addErrorCall(e){return this.errorCalls.find(t=>t.id===e.id)||this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.find(t=>t.id===e.id)||this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,1),this}removeCaller(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-caller"))){return this.calledBySuccess=this.calledBySuccess.filter(r=>r.id!==e.id?(t&&(t==null||t.add(this,b.Updated),t==null||t.add(r,b.Affected)),!0):!1),this.calledByError=this.calledByError.filter(r=>r.id!==e.id?(t&&(t==null||t.add(this,b.Updated),t==null||t.add(r,b.Affected)),!0):!1),this.calledByEntry=this.calledByEntry.filter(r=>r.id!==e.id?(t&&(t==null||t.add(this,b.Updated),t==null||t.add(r,b.Affected)),!0):!1),t==null||t.attemptAutoclose("remove-caller",this.id),this}setParent(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"set-parent"))){var r;return((r=this.parent)==null?void 0:r.id)!==(e==null?void 0:e.id)&&(this.parent=e,t&&(t==null||t.add(this,b.Updated),t==null||t.attemptAutoclose("set-parent",this.id))),this}setDeclaration(e){return this.declaration=e,this}initChildren(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.initialData.declaration.type===n.FunctionDeclaration){const t=V(this.initialData.declaration,this.project);this.declaration=t}else{const t=B(this.initialData.declaration),r=this.project.get(t);this.declaration=r}return this.successCalls=this.initialData.successCalls.map(t=>{const r=V(t,this.project);return r.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(r.type)?(r.setParent(this.parent.parent,null),r.initChildren(e)):r.type!==n.InternalCall&&(r.setParent(this.parent,null),r.initChildren(e)),r}),this.errorCalls=this.initialData.errorCalls.map(t=>{const r=V(t,this.project);return r.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(r.type)?(r.setParent(this.parent.parent,null),r.initChildren(e)):r.type!==n.InternalCall&&(r.setParent(this.parent,null),r.initChildren(e)),r}),this.inputs=this.initialData.inputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(e),r}),this.initialData.process&&(this.process=V(this.initialData.process,this.project),this.process.setParent(this,null),this.process.initChildren(e)),this.initialData.error&&(this.error=V(this.initialData.error,this.project),this.error.setParent(this,null),this.error.initChildren(e)),this.subscribeToDependencies(),this.afterAllChildrenInitialized(e),e==null||e.attemptAutoclose("init-children",this.id),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-meta"))){const r=dt(this,e);return e.deleted===!0&&!this.deleted?t==null||t.add(this,b.Removed):e.deleted===!1&&this.deleted?t==null||t.add(this,b.Added):r&&(t==null||t.add(this,b.Updated)),super.metaSync(e),this.x=e.x||this.x,this.y=e.y||this.y,t==null||t.attemptAutoclose("sync-meta",this.id),this}async APILoad(e=L,...t){return await ke.repository.APILoad(this.id,...t),this}async APICreate(e=L,...t){return await ke.repository.APICreate(this.toShallowJSON(),...t),this}async APIUpdate(e=L,...t){return await ke.repository.APIUpdate(this.toShallowJSON(),...t),this}async APIDelete(e=L,...t){return await ke.repository.APIDelete(this.toShallowJSON(),...t),this}async APIClone(e=L,...t){return await ke.repository.APIClone(this.id,...t),this}async APILoadVersion(e=L,t,...r){return await ke.repository.APILoadVersion(this.id,t,...r)}remove({ignoreUpstream:e}={ignoreUpstream:!1},t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-entity"))){var l;const r=[],a=[],d=[],o=[];if(t!=null&&t.hasRemoved(this.id))return t==null||t.attemptAutoclose("remove-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(a.push(this),this.unsubscribe(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},t),Object.values(this.detachedDependents).forEach(p=>{const{updated:h,removed:c,added:v}=p.entity.onDetachedDependencyRemoved(this,p.field,t);r.push(...h),a.push(...c),d.push(...v)}),this.process){const{updated:p,removed:h}=(l=this.process)==null?void 0:l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}if(this.inputs.forEach(p=>{const{updated:h,removed:c}=p.remove({ignoreUpstream:!0},t);r.push(...h),a.push(...c)}),this.outputs.forEach(p=>{const{updated:h,removed:c}=p.remove({ignoreUpstream:!0},t);r.push(...h),a.push(...c)}),this.error){const{updated:p,removed:h}=this.error.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}return this.successCalls.forEach(p=>{r.push(p),p.removeCaller(this)}),this.errorCalls.forEach(p=>{r.push(p),p.removeCaller(this)}),e||this.calledBy.forEach(p=>{r.push(p),p.removeCall(this)}),t==null||t.attemptAutoclose("remove-entity",this.id),{added:u(d),updated:u(r),removed:u(a),affected:u(o),self:this}}restore({}={},e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"restore-entity"))){const t=[],r=[],a=[],d=[];if(e!=null&&e.hasAdded(this.id))return e==null||e.attemptAutoclose("restore-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},e),this.process){const{updated:o}=this.process.restore({},e);r.push(...o)}return this.inputs.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.outputs.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.successCalls.forEach(o=>{r.push(o),o.addSuccessCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.addErrorCaller(this)}),this.calledBySuccess.forEach(o=>{r.push(o),o.addSuccessCall(this)}),this.calledByError.forEach(o=>{r.push(o),o.addErrorCall(this)}),this.calledByEntry.forEach(o=>{r.push(o),o.addCall(this)}),e==null||e.attemptAutoclose("restore-entity",this.id),{added:u(t),updated:u(r),removed:u(a),affected:u(d),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):[],...this.calledBy.flatMap(r=>r.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(e=new Set){var t,r;return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(a=>a.toJSON(e)),errorCalls:this.errorCalls.map(a=>a.toJSON(e)),calledBySuccess:this.calledBySuccess.map(a=>a.toReference()),calledByError:this.calledByError.map(a=>a.toReference()),calledByEntry:this.calledByEntry.map(a=>a.toReference()),process:(t=this.process)==null?void 0:t.toJSON(e),declaration:this.declaration.toJSON(e),inputs:this.inputs.map(a=>a.toJSON(e)),outputs:this.outputs.map(a=>a.toJSON(e)),parent:this.parent.toReference(),error:(r=this.error)==null?void 0:r.toJSON(e)})}toJSONClone(e=Z){var r,a,d,o,l,p,h;let t;return(r=e.seenEntityMaps)!=null&&r.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||ct(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(d=e.seenEntities)!=null&&d.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:this.version,createdAt:e.timestamp||T().toISOString(),previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(c=>c.toJSONClone({...e,newId:null})),errorCalls:this.errorCalls.map(c=>c.toJSONClone({...e,newId:null})),calledBySuccess:this.calledBySuccess.map(c=>c.toReference({seenEntityMaps:e.seenEntityMaps})),calledByError:this.calledByError.map(c=>c.toReference({seenEntityMaps:e.seenEntityMaps})),calledByEntry:this.calledByEntry.map(c=>c.toReference({seenEntityMaps:e.seenEntityMaps})),process:(p=this.process)==null?void 0:p.toJSONClone({...e,newId:null}),declaration:this.declaration.toJSONClone({...e,newId:null}),inputs:this.inputs.map(c=>c.toJSONClone({...e,newId:null})),outputs:this.outputs.map(c=>c.toJSONClone({...e,newId:null})),error:(h=this.error)==null?void 0:h.toJSONClone({...e,newId:null}),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:t,version:this.version,entityType:this.type}}toShallowJSON(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference(e):null,inputs:this.inputs.map(a=>a.toReference(e)),outputs:this.outputs.map(a=>a.toReference(e)),declaration:this.declaration.toReference(e),successCalls:this.successCalls.map(a=>a.toReference(e)),errorCalls:this.errorCalls.map(a=>a.toReference(e)),calledBySuccess:this.calledBySuccess.map(a=>a.toReference(e)),calledByError:this.calledByError.map(a=>a.toReference(e)),calledByEntry:this.calledByEntry.map(a=>a.toReference(e)),error:this.error?this.error.toReference(e):null,parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(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,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,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=Cq(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=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"clone-entity")),t=null,r=null,a=!0){var O,w;let d=ft(t,this);const o=this.toJSON(),l=r||R.UUID.uuid();o.inputs=[];const p=l.split("-id"),h=p[p.length-1||0]||l;o.id=l,o.version=R.UUID.uuid(),o.createdAt=(e==null?void 0:e.timestamp)||T().toISOString(),o.author=(e==null?void 0:e.author)||"1",o.previousVersion=null,o.deleted=!1;const c=lt(o,d);t?c.setParent(t,null):c.setParent(this.parent,null),a&&c.subscribe(),c.initChildren(e),e==null||e.add(c,b.Added);const v=(O=this.inputs)==null?void 0:O.map((C,U)=>C.clone(e,c,h+"-input-map-"+U+"-id",a));c.inputs=v;const E=(w=this.outputs)==null?void 0:w.map((C,U)=>C.clone(e,c,h+"-output-map-"+U+"-id",a));return c.outputs=E,this.error&&(c.error=this.error.clone(e,c,h+"-error-map-id",a)),this.process&&(c.process=this.process.clone(e,c,h+"-process-id",a)),e==null||e.attemptAutoclose("clone-entity",this.id),c}removeUnrecognizedInputs(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-unrecognized-inputs"))){const t=[],r=[],a=[],d=[];return this.inputs.forEach(o=>{if(!this.declaration.inputs.find(p=>{var h;return p.id===((h=o.declaration)==null?void 0:h.id)})){const p=o.remove({ignoreUpstream:!1},e);a.push(...p.removed),t.push(...p.updated)}}),e==null||e.attemptAutoclose("remove-unrecognized-inputs",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}removeUnrecognizedOutputs(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-unrecognized-outputs"))){const t=[],r=[],a=[],d=[];return this.outputs.forEach(o=>{if(!this.declaration.getUniqueReturnDeclarations().find(p=>{var h;return p.id===((h=o.declaration)==null?void 0:h.id)})){const p=o.remove({ignoreUpstream:!1},e);a.push(...p.removed),t.push(...p.updated)}}),e==null||e.attemptAutoclose("remove-unrecognized-outputs",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}syncMissingFixedInputs(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-missing-fixed-inputs"))){const t=[],r=[],a=[],d=[],o=this.declaration.inputs.filter(c=>!this.inputs.find(v=>v.declaration.id===c.id));this.inputs.sort((c,v)=>c.index-v.index),o.forEach(c=>{this.inputs.forEach(O=>{O.index>=c.index&&O.metaSync({index:O.index+1},e)});const v={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(e==null?void 0:e.timestamp)||T().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.InputMap,declaration:c.toJSON(),readsValue:null,defaultValue:null,index:c.index,name:null,description:null,parent:this.toReference()},E=V(v,this.project);E.setParent(this,e),E.initChildren(e),e==null||e.add(E,b.Added),E.addSelfToProject(e),r.push(E)}),this.inputs.sort((c,v)=>c.index-v.index);const{updated:l,added:p,removed:h}=this.removeUnrecognizedInputs(e);return t.push(...l),r.push(...p),a.push(...h),e==null||e.attemptAutoclose("sync-missing-fixed-inputs",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}syncMissingFixedOutputs(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-missing-fixed-outputs"))){const t=[],r=[],a=[],d=[],o=[];this.outputs=this.initialData.outputs.map(v=>{const E=V(v,this.project);return o.push(E.index),E.setParent(this,null),E.initChildren(e),E});const l=this.declaration.getUniqueReturnDeclarations().filter(v=>!this.outputs.find(E=>E.declaration.id===v.id));this.outputs.sort((v,E)=>v.index-E.index),l.forEach((v,E)=>{this.outputs.forEach(U=>{U.index>=v.index&&U.index++});const O=o.includes(v.index)?this.outputs.length-1+E:v.index,w={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(e==null?void 0:e.timestamp)||T().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.OutputMap,declaration:v.toJSON(),defaultValue:null,writesValues:[],index:O,parent:this.toReference()},C=V(w,this.project);C.setParent(this,e),C.initChildren(e),e==null||e.add(C,b.Added),C.addSelfToProject(e)}),this.outputs.sort((v,E)=>v.index-E.index);const{updated:p,added:h,removed:c}=this.removeUnrecognizedOutputs(e);return t.push(...p),r.push(...h),a.push(...c),e==null||e.attemptAutoclose("sync-missing-fixed-outputs",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}};f(ke,"repository",{APICreate:async(e,...t)=>e,APIUpdate:async(e,...t)=>e,APIDelete:async(e,...t)=>e,APIClone:async(e,...t)=>{},APILoad:async(e,...t)=>null,APILoadVersion:async(e,t,...r)=>null}),f(ke,"type",n.FunctionCall),f(ke,"USER_MANAGED_PARENT_TYPES",[...mt,n.Project]),f(ke,"PARENT_TYPES",[...ke.USER_MANAGED_PARENT_TYPES]),f(ke,"MUTABLE_BASE_PROPERTIES",[]),f(ke,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),f(ke,"BASE_PROPERTIES",[...ke.MUTABLE_BASE_PROPERTIES,...ke.INMUTABLE_BASE_PROPERTIES]),f(ke,"MUTABLE_META_PROPERTIES",["x","y"]),f(ke,"INMUTABLE_META_PROPERTIES",[...ke.INMUTABLE_BASE_PROPERTIES]),f(ke,"META_PROPERTIES",[...ke.MUTABLE_META_PROPERTIES,...ke.INMUTABLE_META_PROPERTIES]),f(ke,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),f(ke,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),f(ke,"UPSTREAM_PROPERTIES",[...ke.MUTABLE_UPSTREAM_PROPERTIES,...ke.INMUTABLE_UPSTREAM_PROPERTIES]),f(ke,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),f(ke,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),f(ke,"DOWNSTREAM_PROPERTIES",[...ke.MUTABLE_DOWNSTREAM_PROPERTIES,...ke.INMUTABLE_DOWNSTREAM_PROPERTIES]),f(ke,"PROPERTIES",[...ke.META_PROPERTIES,...ke.UPSTREAM_PROPERTIES,...ke.DOWNSTREAM_PROPERTIES]);let qi=ke;function Cc(i){return i&&typeof i.then=="function"}class Bc{constructor(s){f(this,"order",[]);f(this,"flatRecord",{});f(this,"allBuiltInEntityIds",Wr());f(this,"onGoingVisits",{});this.flatten(s),this.orderEntities()}flatten(s){const e=new Set(Wr()),t=u(N(s,e,{ignoreBuiltInBaseEntities:!0})),r=new Set;for(const a of t)this.flatRecord[a.id]=a,r.add(a.id);this.order=Array.from(r)}moveEntityAfterDependencies(s){const{upstream:e}=qd(s,this.flatRecord,{ignoreBuiltInBaseEntities:!0,allBuiltInEntityIds:this.allBuiltInEntityIds});for(const t of Object.keys(e)){const r=this.order.indexOf(t),a=this.order.indexOf(s.id);if(r>a)return this.order.splice(a,1),this.order.splice(r,0,s.id),!0}return!1}orderEntities(){let s=!1;for(let e=0;e<this.order.length;e++){const t=this.order[e],r=this.flatRecord[t];if(this.moveEntityAfterDependencies(r)){s=!0;break}}s&&this.orderEntities()}getUpstreamOngoingDependenciesVisits(s,e){const{upstream:t}=qd(this.flatRecord[s],this.flatRecord,{ignoreBuiltInBaseEntities:!0,allBuiltInEntityIds:this.allBuiltInEntityIds}),r={};return Object.entries(this.onGoingVisits[e]||{}).forEach(([a,d])=>{Object.keys(t).includes(a)&&(r[a]=d)}),r}getDownstreamOngoingDependenciesVisits(s,e){const t=Object.keys(this.onGoingVisits[e]||{}),r=new Set(t.flatMap(d=>Object.keys(qd(this.flatRecord[d],this.flatRecord,{ignoreBuiltInBaseEntities:!0,allBuiltInEntityIds:this.allBuiltInEntityIds}).downstream))),a={};return Array.from(r).forEach(d=>{d===s&&(a[d]=this.onGoingVisits[e][d])}),a}async settlePromises(s,e){const t=Object.values(s);t.length&&await Promise.all(t),Object.keys(s).forEach(r=>{delete this.onGoingVisits[e][r]})}visit(s){const e=this.order;for(const t of e)s(this.flatRecord[t],this.flatRecord);return this}reverseVisit(s){const e=this.order.slice().reverse();for(const t of e)s(this.flatRecord[t],this.flatRecord);return this}async visitAsync(s){const e=this.order,t=Math.random().toString(36).substring(7);this.onGoingVisits[t]={};for(const r of e){const a=this.getUpstreamOngoingDependenciesVisits(r,t);Object.keys(a).length&&await this.settlePromises(a,t);const d=s(this.flatRecord[r],this.flatRecord);Cc(d)&&(this.onGoingVisits[t][r]=d)}return await this.settlePromises(this.onGoingVisits[t],t),this.onGoingVisits[t]={},this}async reverseVisitAsync(s){const e=this.order.slice().reverse(),t=Math.random().toString(36).substring(7);this.onGoingVisits[t]={};for(const r of e){const a=this.getDownstreamOngoingDependenciesVisits(r,t);Object.keys(a).length&&await this.settlePromises(a,t);const d=s(this.flatRecord[r],this.flatRecord);Cc(d)&&(this.onGoingVisits[t][r]=d)}return await this.settlePromises(this.onGoingVisits[t],t),this.onGoingVisits[t]={},this}}function vO(i,s){switch(i.id){case S["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const e=i.project.entities.filter(l=>!!l.implements.find(p=>p.id===S["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(e.find(l=>!!l.properties.find(p=>{var h;return p.implements&&p.implements.id===S["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((h=p.getDefaultValue())==null?void 0:h.value)===!0}))){const p=e[0].properties.find(c=>c.implements&&c.implements.id===S["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),h=p==null?void 0:p.defaultValue;if(h)h.value=!0;else if(p!=null&&p.dataType){const c={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(s==null?void 0:s.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.LiteralValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:p==null?void 0:p.dataType.toReference()},v=V(c,i.project);return v.setParent(p==null?void 0:p.dataType,s),v.initChildren(s),s==null||s.add(v,b.Added),v.addSelfToProject(s),{newEntities:[v]}}return{newEntities:[]}}const r=i.project.get(S["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),a=Fd(r,"Main database",s);if(a.errors.length>0)return{newEntities:[]};const d=a.implemented.properties.find(l=>l.implements&&l.implements.id===S["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),o=d==null?void 0:d.defaultValue;if(o)o.value=!0;else if(d!=null&&d.dataType){const l={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(s==null?void 0:s.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.LiteralValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:d==null?void 0:d.dataType.toReference()},p=V(l,i.project);p.setParent(d==null?void 0:d.dataType,s),p.initChildren(s),s==null||s.add(p,b.Added),p.addSelfToProject(s)}return{newEntities:[a.implemented]}}}return{newEntities:[]}}function TO(i,s){return i.implements.filter(t=>t.type===n.BuiltInBaseEntity).map(t=>{switch(t.id){case S["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=i.project.entities.filter(l=>l.implements.find(p=>p.id===S["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(l=>!!l.properties.find(p=>{var h;return p.implements&&p.implements.id===S["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((h=p.getDefaultValue())==null?void 0:h.value)===!0}));if(!a)return{newEntities:[]};const d=i.properties.find(l=>l.implements&&l.implements.id===S["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id),o=d==null?void 0:d.defaultValue;if(d&&(d!=null&&d.dataType)&&!o){const l={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(s==null?void 0:s.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.LiteralValue,name:g.EntityTemplate,autogeneration:null,value:null,valueAsTypeSingle:a,valueAsTypeList:null,parent:d==null?void 0:d.dataType.toReference()},p=V(l,i.project);return p.setParent(d==null?void 0:d.dataType,s),p.initChildren(s),s==null||s.add(p,b.Added),p.addSelfToProject(s),{newEntities:[p]}}return{newEntities:[]}}}}),{newEntities:[]}}function Fd(i,s,e,t){const r=t||R.UUID.uuid(),a={id:r,version:R.UUID.uuid(),createdAt:(e==null?void 0:e.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,name:s,type:n.DefinitionEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[i],x:0,y:0,parent:i.project},d=Bd(a,i.project);if(d.length>0)return{errors:d,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const o=vO(i,e),l=V(a,i.project);l.setParent(i.project,e),l.initChildren(e),e==null||e.add(l,b.Added);const p=i.properties.map(v=>{const E=R.UUID.uuid(),O=v.clone(e,l,E);return O.abstract=!1,O.implements=v,e==null||e.add(O,b.Added),O.setParent(l,e),l.addProperty(O),O}),h=i.abstractMethods.map(v=>{const E=R.UUID.uuid(),O=v.asFunctionDeclarationTransfer(E),w={id:E+"-parent-ref-id",type:n.GenericReference,entityId:r,version:R.UUID.uuid(),entityType:n.DefinitionEntity},C={...O,implements:v,parent:w},U=V(C,i.project);return l.addMethod(U),U.setParent(l,e),U.initChildren(e),e==null||e.add(U,b.Added),U.implements=v,U});a.properties=p,a.methods=h;const c=TO(l,e);return{implemented:l,errors:[],entitiesChanges:{new:[l,...o.newEntities,...c.newEntities],updated:[l],deleted:[]}}}function _c(i,s){return s.entities.find(r=>{const a=r.properties,d=a.map(c=>c.name),o=i.every(c=>d.includes(c)),l=d.filter(c=>!i.includes(c)),p=a.every(c=>!l.includes(c.name)||!c.required);return o&&p})||null}function EO(i,s,e,t=Rt.OrDataTypeGroup){const r=[],a=[],d=[],o=[],p={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(e==null?void 0:e.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,entity:i.toJSON(),isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:t,parent:s.toReference()},h=V(p,i.project);return a.push(h),h.setParent(s,e),h.initChildren(e),e==null||e.add(h,b.Added),h.setEntity(i),h.addSelfToProject(e),{updated:u(r),added:u(a),removed:u(d),affected:u(o),self:h}}function Mc(i,s,e,t,r){var p,h,c,v,E,O,w,C;const a=[],d=[],o=[],l=[];switch(typeof i){case"string":let U=!1;const F=new Date(i);if(F instanceof Date&&!isNaN(F.valueOf())&&(U=!0),U){const _=s.project.getBuiltIn(S[n.PrimitiveEntity][g.Date].id);s.setEntity(_);break}else{const _=s.project.getBuiltIn(S[n.PrimitiveEntity][g.String].id);s.setEntity(_);break}case"number":s.setEntity(s.project.getBuiltIn(S[n.PrimitiveEntity][g.Number].id));break;case"boolean":s.setEntity(s.project.getBuiltIn(S[n.PrimitiveEntity][g.Boolean].id));break;case"object":if(i===null){s.setEntity(s.project.getBuiltIn(S[n.PrimitiveEntity][g.Null].id));break}else if(Array.isArray(i))if(s.metaSync({isList:!0},t),i.length>0){const _=i.slice(0,5).filter(k=>k!==void 0);if(_.every(k=>typeof k==typeof _[0])&&(typeof _[0]!="object"||_[0]===null))switch(typeof _[0]){case"string":s.setEntity(s.project.getBuiltIn(S[n.PrimitiveEntity][g.String].id));break;case"number":s.setEntity(s.project.getBuiltIn(S[n.PrimitiveEntity][g.Number].id));break;case"boolean":s.setEntity(s.project.getBuiltIn(S[n.PrimitiveEntity][g.Boolean].id));break;case"object":s.setEntity(s.project.getBuiltIn(S[n.PrimitiveEntity][g.Null].id));break}else{const k=[];let W=!1;_.forEach(pe=>{var Te,K,se,Ht;if(Array.isArray(pe)&&(W=!0),typeof pe=="object"&&!Array.isArray(pe)&&pe!==null){const zr=Sd(pe,s.project,{...e,id:R.UUID.uuid()},t,r);zr.hasCreated&&k.push((Te=zr.changeSet)==null?void 0:Te.self),a.push(...(K=zr.changeSet)==null?void 0:K.updated),d.push(...(se=zr.changeSet)==null?void 0:se.added),o.push(...(Ht=zr.changeSet)==null?void 0:Ht.removed)}});const ee=u(k);if(!ee.length&&!W){_.forEach(pe=>{const Te={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,entity:null,isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:Rt.OrDataTypeGroup,parent:s.toReference()},K=V(Te,s.project);switch(K.setParent(s,t),K.initChildren(t),t==null||t.add(K,b.Added),K.addSelfToProject(t),typeof pe){case"string":K.setEntity(K.project.getBuiltIn(S[n.PrimitiveEntity][g.String].id));break;case"number":K.setEntity(K.project.getBuiltIn(S[n.PrimitiveEntity][g.Number].id));break;case"boolean":K.setEntity(K.project.getBuiltIn(S[n.PrimitiveEntity][g.Boolean].id));break;case"object":K.setEntity(K.project.getBuiltIn(S[n.PrimitiveEntity][g.Null].id));break}});break}else ee.length===1&&!W?s.setEntity(ee[0]):_.forEach(pe=>{if(typeof pe=="object"&&!Array.isArray(pe)&&pe!==null){const Te=_c(Object.keys(pe),s.project);if(Te){const K=EO(Te||ee[0],s,t,Rt.OrDataTypeGroup);a.push(...K.updated),d.push(...K.added),o.push(...K.removed)}}else{const Te={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,entity:null,isList:Array.isArray(pe),asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parentRelationType:Rt.OrDataTypeGroup,parent:s.toReference()},K=V(Te,s.project);K.setParent(s,t),K.initChildren(t),t==null||t.add(K,b.Added),K.addSelfToProject(t);const se=Mc(pe,K,{...e,id:R.UUID.uuid()},t,r);a.push(...se.updated),d.push(...se.added),o.push(...se.removed)}})}}else{const _=Sd(i[0],s.project,{...e},t,r);s.setEntity((p=_.changeSet)==null?void 0:p.self),a.push(...(h=_.changeSet)==null?void 0:h.updated),d.push(...(c=_.changeSet)==null?void 0:c.added),o.push(...(v=_.changeSet)==null?void 0:v.removed);break}else{const _=Sd(i,s.project,{...e},t,r);s.setEntity((E=_.changeSet)==null?void 0:E.self),a.push(...(O=_.changeSet)==null?void 0:O.updated),d.push(...(w=_.changeSet)==null?void 0:w.added),o.push(...(C=_.changeSet)==null?void 0:C.removed);break}}return{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:s}}function Sd(i,s,e,t,r){const a=[],d=[],o=[],l=[],p=Object.keys(i),h=_c(p,s);if(h)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],affected:[],self:h}};const c=r?e.name+" of "+r.name:e.name,E={id:e.id||R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,name:c,type:n.DefinitionEntity,description:e.description||null,static:e.static||!1,abstract:e.abstract||!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[],x:0,y:0,parent:s.toReference()},O=V(E,s);return O.setParent(s,t),O.initChildren(t),t==null||t.add(O,b.Added),O.addSelfToProject(t),d.push(O),p.forEach((w,C)=>{const F={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,name:w,type:n.Property,description:null,static:!1,abstract:!1,defaultValue:null,constant:!1,dataType:null,implements:null,index:C,hidden:!1,private:!1,required:!0,parent:O.toReference()},_=V(F,s);_.setParent(O,t),_.initChildren(t),t==null||t.add(_,b.Added),_.addSelfToProject(t),d.push(_);const $=i[w],W={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,entity:null,isList:!1,asType:null,andChildrenGroup:null,orChildrenGroup:null,like:!0,inferred:!1,parent:_.toReference()},ee=V(W,s);ee.setParent(_,t),ee.initChildren(t),t==null||t.add(ee,b.Added),ee.addSelfToProject(t),d.push(ee);const pe=Mc($,ee,{...e,name:w,id:R.UUID.uuid()},t,r||O);a.push(...pe.updated),d.push(...pe.added),o.push(...pe.removed)}),{hasCreated:!0,changeSet:{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:O}}}function xd(i,s){const e=Mn(i);if(e.length===0)return{list:[],last:null};let t=null;return{list:e.flatMap(a=>{if(a===s)return t=a,[a];const d=xd(a,s);return d.last&&(t=d.last),[a,...d.list]}),last:t}}function IO(i,s,e=new Set){const t=Ji(i),r=Ji(s),a=t.filter(l=>!r.includes(l)),d=t.filter(l=>r.includes(l)),o=a.reduce((l,p)=>e.has(p.id)?l:(e.add(p.id),u([...l,...IO(p,s,e)])),[]);return u([...d,...o])}function Vs(i,s){const e=xd(i,s);return e.last===s&&e.list.length>0&&e.list[0]!==s}function Bq(i,s){return!!xd(i,s).last}function _q(i){if(at.includes(i.type))return i;if([...Vr,n.VariableDeclaration].includes(i.type)){const s=i.parent;return at.includes(s.type)?s:null}return null}function gc(i,s){if(!i||!s)throw new Error("Both entities must be defined to find a common ancestor");if(i===s)return i;const e=i.parent;if(e){if(e===s)return s;if(e.type===n.Project)return null}else return null;const t=s.parent;if(t){if(t===i)return i;if(t.type===n.Project)return null}else return null;return gc(e,t)}function wt(i){if($s.includes(i.type)){if(i.type===n.FunctionDeclaration){const s=i.parent;if(s.type===n.DefinitionEntity)return s;if(s.type===n.Loop)return s}return i}else{const s=i.parent;return s?wt(s):null}}function kd(i,s){const e=Cs(i,s);if(!e)return null;if($s.includes(e.type)){if(e.type===n.FunctionDeclaration){const t=Cs(e.parent,s);if(t){if(t.type===n.DefinitionEntity)return t;if(t.type===n.Loop)return t}}return e}else{const t=e.parent?Cs(e.parent,s):null;return t?kd(t,s):null}}function bO(i){if(!i)return null;if(Vr.includes(i.type))return i;const s=i.parent;return s?bO(s):null}function RO(i){if(!i)return null;if(nt.includes(i.type))return i;const s=i.parent;return s?RO(s):null}function AO(i){if(!i)return null;if(Cr.includes(i.type))return i;const s=i.parent;return s?AO(s):null}function Mq(i){return i.type===n.VariableDeclaration?[i]:nt.includes(i.type)?[...i.inputs,...i.outputs||[]]:st.includes(i.type)?i.outputs:jn.includes(i.type)||i.type===n.FunctionDeclaration?i.inputs:[]}function gq(i){const s=Ji(i),e=[],t=[];Kc.includes(i.type)&&e.push(...Nc(i));const r=s.filter(a=>{const d=e.includes(a);return d?!1:Vr.includes(a.type)&&!d?(t.push(a),!1):!0});return e.sort((a,d)=>Vs(d,a)?-1:0),t.sort((a,d)=>Vs(d,a)?-1:0),[...e,...t,...r]}function DO(i){return[...i].sort((s,e)=>Vs(e,s)?-1:0)}function Nq(i){const s=DO(i),e=[];return s.forEach(t=>{const r=e[e.length-1];if(r){const a=r[r.length-1];Vs(t,a)?e.push([t]):r.push(t)}else e.push([t])}),e}function Yt(i){const s=i.map(e=>wt(e));return u(s)}function Nc(i){return nt.includes(i.type)?[...Yt(i.successCalls),...Yt(i.errorCalls)]:at.includes(i.type)?Yt(i.calls):[]}function Lq(i,s){return Nc(i).includes(s)}function Lc(i){return i.writesValues||[]}function Uq(i,s){return Lc(i).includes(s)}function OO(i){var s;return Qe.includes((s=i==null?void 0:i.readsValue)==null?void 0:s.type)?i.readsValue:null}function jq(i){return i.writesValues}function PO(i=[]){return i.map(OO).filter(s=>!!s)}function Zd(i=[]){return i.map(s=>s.writesValues).flat().filter(s=>Qe.includes(s.type))}function wO(i=[]){return i.map(s=>s.readsValue).filter(s=>!!s&&Qe.includes(s.type))}function VO(i){return Qe.includes(i.type)?i:null}function CO(i){return i.writesValues.map(VO).filter(s=>!!s)}function BO(i=[]){return i.reduce((s,e)=>e.type===n.OutputMap?[...s,...CO(e)]:s,[])}function it(i){return nt.includes(i.type)?[...Jr(Yt(i.successCalls)),...Jr(Yt(i.errorCalls))]:at.includes(i.type)?Jr(Yt(i.calls)):[]}function $q(i){return nt.includes(i.type)?[...Jr(Yt(i.successCalls)),...Jr(Yt(i.errorCalls))]:at.includes(i.type)?Jr(Yt(i.calls)):[]}function _O(i,s=new Set){return i.writesValues.filter(t=>Qe.includes(t.type)&&!s.has(t.id)).reduce((t,r)=>s.has(r.id)?t:[...t,...We(r,s)],[])}function MO(i,s=new Set){var t;return(((t=i.readsValue)==null?void 0:t.writesValues)||[]).filter(r=>Qe.includes(r.type)&&!s.has(r.id)).reduce((r,a)=>s.has(a.id)?r:[...r,...We(a,s)],[])}function We(i,s=new Set){if(s.has(i.id))return[];if(i.type===n.ReturnStatement)return wO(i.outputs).reduce((t,r)=>[...t,...We(r,s)],[]);if(i.type===n.FunctionCall||i.type===n.Operation||i.type===n.Condition)return[...it(i).reduce((a,d)=>{const o=wt(d);return[...a,...We(o||d,s)]},[]),...PO(i.inputs),...BO(i.outputs)].reduce((a,d)=>[...a,...We(d,s)],[]);if(jn.includes(i.type)){const e=Zd(i.inputs),r=it(i).reduce((a,d)=>{const o=wt(d);return[...a,...We(o||d,s)]},[]);return e.push(...r),e.reduce((a,d)=>[...a,...We(d,s)],[])}if(i.type===n.FunctionDeclaration){const e=[...Zd(i.inputs)],r=it(i).reduce((a,d)=>{const o=wt(d);return[...a,...We(o||d,s)]},[]);return e.push(...r),e.reduce((a,d)=>[...a,...We(d)],[])}if(Qe.includes(i.type)){s.add(i.id);const t=it(i).reduce((r,a)=>{const d=wt(a);return[...r,...We(d||a,s)]},[]);return[i,...t,...MO(i,s),..._O(i,s)]}return[]}function ir(i,s=new Set){return s.has(i.id)?[]:(s.add(i.id),[...Ji(i).reduce((r,a)=>[...r,a,...ir(a,s)],[])])}function Jr(i){return i.reduce((s,e)=>e.type===n.ReturnStatement||e.type===n.ContinueStatement||e.type===n.BreakStatement?[...s,e]:[...s,e,...it(e)],[])}function gO(i){const s=i.entities||[],e=[...s,...i.functions||[],...i.events||[],...i.projects||[]],t=s.reduce((l,p)=>[...l,...p.properties],[]),r=s.reduce((l,p)=>[...l,...p.methods],[]),a=r.reduce((l,p)=>[...l,...Zd(p.inputs),...Jr(Yt(p.calls)),...p.returnStatements],[]),d=i.functions.reduce((l,p)=>[...l,...Jr(Yt(p.calls)),...p.returnStatements],[]),o=i.events.reduce((l,p)=>[...l,...Jr(Yt(p.calls)),...p.returnStatements],[]);return[...e,...t,...r,...a,...d,...o]}function NO(i,s){return s.filter(t=>{if(!t)return!1;switch(t.type){case n.FunctionCall:return t.inputs.find(r=>r.id===i.id)!==void 0||t.outputs.find(r=>r.id===i.id)!==void 0;case n.Condition:return t.successCalls.find(r=>r.id===i.id)!==void 0||t.errorCalls.find(r=>r.id===i.id)!==void 0||t.inputs.find(r=>r.id===i.id)!==void 0;case n.Operation:return t.outputs.find(r=>r.id===i.id)!==void 0;case n.VariableDeclaration:return nt.includes(i.type)?dP(i).find(a=>{var d;return((d=a.readsValue)==null?void 0:d.id)===t.id})!==void 0:!1;case n.DefinitionEntity:return t.properties.find(r=>r.id===i.id)!==void 0||t.methods.find(r=>r.id===i.id)!==void 0;case n.FunctionDeclaration:return t.inputs.find(r=>r.id===i.id)!==void 0||(t.returnStatements.map(r=>r.outputs).flat()||[]).find(r=>r.id===i.id)!==void 0;default:return!1}})}function Gq(i){const s=gO(i.project);return NO(i,s)}function Cs(i,s){return i?typeof i=="string"?s[i]:i.type===n.GenericReference?s[i.entityId]:s[i.id]?s[i.id]:null:null}function qd(i,s={},e={ignoreBuiltInBaseEntities:!1,allBuiltInEntityIds:[]}){if(e.ignoreBuiltInBaseEntities&&(hr.includes(i.type)||(e.allBuiltInEntityIds||[]).includes(i.id)))return{upstream:{},downstream:{}};const t=i,r=i,a=i,d=i,o=i,l=i,p=i,h=i,c=i,v=i,E=i,O=i,w=i,C=[...w.readsValue?[w.readsValue]:[],...w.declaration?[w.declaration]:[],...(O.calledByEntry||[]).flatMap($=>$),...(O.calledBySuccess||[]).flatMap($=>$),...(O.calledByError||[]).flatMap($=>$),...(a.extends||[]).flatMap($=>$),...v.parent?[v.parent]:[]];Array.isArray(a.implements)?C.push(...a.implements.flatMap($=>$)):c.implements&&C.push(c.implements),o.valueAsTypeList&&Array.isArray(o.valueAsTypeList)&&C.push(...o.valueAsTypeList.flatMap($=>$)),o.valueAsTypeSingle&&C.push(o.valueAsTypeSingle);const U=[...(t.inputs||[]).flatMap($=>$),...(E.inputsDeclarations||[]).flatMap($=>$),...(t.outputs||[]).flatMap($=>$),...(E.outputsDeclarations||[]).flatMap($=>$),...(w.internalCalls||[]).flatMap($=>$),...w.writesValues||[],...O.dataType?[O.dataType]:[],...l.body?[l.body]:[],...O.defaultValue?[O.defaultValue]:[],...(O.successCalls||[]).flatMap($=>$),...(O.errorCalls||[]).flatMap($=>$),...(a.properties||[]).flatMap($=>$),...(a.methods||[]).flatMap($=>$),...(a.abstractMethods||[]).flatMap($=>$),...p.error?[p.error]:[],...p.process?[p.process]:[],...v.throws?[v.throws]:[],...(r.andChildrenGroup||[]).flatMap($=>$),...(r.orChildrenGroup||[]).flatMap($=>$),...(h.entities||[]).flatMap($=>$),...(h.functions||[]).flatMap($=>$),...(h.functionCalls||[]).flatMap($=>$),...(h.events||[]).flatMap($=>$),...(h.conditions||[]).flatMap($=>$),...(h.operations||[]).flatMap($=>$),...(h.loops||[]).flatMap($=>$),...(h.variableDeclarations||[]).flatMap($=>$),...(h.variableInstances||[]).flatMap($=>$),...(h.searches||[]).flatMap($=>$),...(h.projects||[]).flatMap($=>$),...(d.calls||[]).flatMap($=>$)];i.type===n.DataType&&(r.entity&&s[B(r.entity)]&&s[B(r.entity)].parent&&B(s[B(r.entity)].parent)===i.id?U.push(r.entity):r.entity&&C.push(r.entity));const F={},_={};return C.forEach($=>{const k=B($);if(k&&e.ignoreBuiltInBaseEntities&&(hr.includes($.type)||(e.allBuiltInEntityIds||[]).includes(k)))return;const W=$.version;k&&(F[k]=W)}),U.forEach($=>{const k=B($);if(k&&e.ignoreBuiltInBaseEntities&&(hr.includes($.type)||(e.allBuiltInEntityIds||[]).includes(k)))return;const W=$.version;k&&(_[k]=W)}),{upstream:F,downstream:_}}function Fq(i,s){const e=[];if(Vr.includes(i.type)){cr(i).forEach(a=>{const d=kd(a,s);d&&e.push(d)});const r=[...i.inputs||[],...i.outputs||[]].map(a=>{const d=Cs(a,s);return d?uP(d,s):null}).filter(a=>a!==null);e.push(...u(r))}if(Qe.includes(i.type)){const t=Jd(i);t&&e.push(t)}return u(e)}function Mn(i){const s=[];if(Vr.includes(i.type)){i.calledBy.forEach(r=>{const a=wt(r);a&&s.push(a)});const t=[...i.inputs||[],...i.outputs||[]].map(r=>Jd(r)).filter(r=>r!==null);s.push(...u(t))}if(Qe.includes(i.type)){const e=Jd(i);e&&s.push(e)}return u(s)}function cr(i){return[...i.calledByEntry||[],...i.calledByError||[],...i.calledBySuccess||[]].filter(s=>s.type!==n.GenericReference)}function LO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.ActionDescriptor)throw new Error("Entity must be an action descriptor to be flattened");return[i,...i.inputs.flatMap(t=>N(t,s,e)),...i.outputs.flatMap(t=>N(t,s,e)),...i.error?N(i.error,s,e):[],...i.parent?N(i.parent,s,e):[]]}function UO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.ArgumentDeclaration)throw new Error("Entity must be an argument declaration to be flattened");return[i,...i.defaultValue?N(i.defaultValue,s):[],...i.writesValues.flatMap(t=>N(t,s,e)),...i.dataType?N(i.dataType,s,e):[],...i.parent?N(i.parent,s,e):[]]}function jO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.BreakStatement)throw new Error("Entity must be a break statement to be flattened");return[i,...i.outputs.flatMap(t=>N(t,s,e)),...i.throws?N(i.throws,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function $O(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.BuiltInBaseEntity)throw new Error("Entity must be a built-in base entity to be flattened");return[i,...(i.properties||[]).flatMap(t=>N(t,s,e)),...(i.methods||[]).flatMap(t=>N(t,s,e)),...(i.abstractMethods||[]).flatMap(t=>N(t,s,e)),...(i.extends||[]).flatMap(t=>N(t,s,e))]}function GO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.Condition)throw new Error("Entity must be a condition to be flattened");return[i,...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function FO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.ContinueStatement)throw new Error("Entity must be a continue statement to be flattened");return[i,...i.outputs.flatMap(t=>N(t,s,e)),...i.throws?N(i.throws,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function SO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.DefinitionEntity)throw new Error("Entity must be a definition entity to be flattened");return[i,...(i.extends||[]).flatMap(t=>N(t,s,e)),...(i.implements||[]).flatMap(t=>N(t,s,e)),...(i.properties||[]).flatMap(t=>N(t,s,e)),...(i.methods||[]).flatMap(t=>N(t,s,e)),...(i.abstractMethods||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function xO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.DataType)throw new Error("Entity must be a data type to be flattened");return[i,...(i.andChildrenGroup||[]).flatMap(t=>N(t,s,e)),...(i.orChildrenGroup||[]).flatMap(t=>N(t,s,e)),...i.entity?N(i.entity,s,e):[],...i.parent?N(i.parent,s,e):[]]}function kO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.FunctionCall)throw new Error("Entity must be a function call to be flattened");return[i,...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.outputs||[]).flatMap(t=>N(t,s,e)),...i.error?N(i.error,s,e):[],...i.process?N(i.process,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function ZO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.FunctionDeclaration)throw new Error("Entity must be a function declaration to be flattened");return[i,...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.calls||[]).flatMap(t=>N(t,s,e)),...i.implements?N(i.implements,s,e):[],...i.parent?N(i.parent,s,e):[]]}function qO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.GlobalEvent)throw new Error("Entity must be a global event to be flattened");return[i,...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.calls||[]).flatMap(t=>N(t,s,e)),...i.implements?N(i.implements,s,e):[],...i.parent?N(i.parent,s,e):[]]}function JO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.InputMap)throw new Error("Entity must be an input map to be flattened");return[i,...i.readsValue?N(i.readsValue,s,e):[],...i.declaration?N(i.declaration,s,e):[],...i.defaultValue?N(i.defaultValue,s,e):[],...i.parent?N(i.parent,s,e):[]]}function WO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.InstalledProject)throw new Error("Entity must be an installed project to be flattened");return[i,...(i.functions||[]).flatMap(t=>N(t,s,e)),...(i.events||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function YO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.InternalCall)throw new Error("Entity must be an internal call to be flattened");return[i,...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.outputs||[]).flatMap(t=>N(t,s,e)),...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.error?N(i.error,s,e):[],...i.process?N(i.process,s,e):[],...i.parent?N(i.parent,s,e):[]]}function zO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.LiteralValue)throw new Error("Entity must be a literal value to be flattened");return[i,...i.valueAsTypeSingle?N(i.valueAsTypeSingle,s,e):[],...i.valueAsTypeList&&Array.isArray(i.valueAsTypeList)?i.valueAsTypeList.flatMap(t=>N(t,s,e)):[],...i.parent?N(i.parent,s,e):[]]}function HO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.Loop)throw new Error("Entity must be a loop to be flattened");return[i,...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.outputs||[]).flatMap(t=>N(t,s,e)),...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...i.error?N(i.error,s,e):[],...i.process?N(i.process,s,e):[],...i.body?N(i.body,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function KO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.Operation)throw new Error("Entity must be an operation to be flattened");return[i,...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.outputs||[]).flatMap(t=>N(t,s,e)),...i.error?N(i.error,s,e):[],...i.process?N(i.process,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function XO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.OutputMap)throw new Error("Entity must be an output map to be flattened");return[i,...(i.writesValues||[]).flatMap(t=>N(t,s,e)),...i.declaration?N(i.declaration,s,e):[],...i.defaultValue?N(i.defaultValue,s,e):[],...i.parent?N(i.parent,s,e):[]]}function QO(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.PrimitiveEntity)throw new Error("Entity must be a primitive entity to be flattened");return[i,...(i.properties||[]).flatMap(t=>N(t,s,e)),...(i.methods||[]).flatMap(t=>N(t,s,e)),...(i.abstractMethods||[]).flatMap(t=>N(t,s,e))]}function eP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.Project)throw new Error("Entity must be a project to be flattened");return[i,...(i.entities||[]).flatMap(t=>N(t,s,e)),...(i.functions||[]).flatMap(t=>N(t,s,e)),...(i.events||[]).flatMap(t=>N(t,s,e)),...(i.projects||[]).flatMap(t=>N(t,s,e)),...(i.variableDeclarations||[]).flatMap(t=>N(t,s,e)),...(i.variableInstances||[]).flatMap(t=>N(t,s,e)),...(i.operations||[]).flatMap(t=>N(t,s,e)),...(i.conditions||[]).flatMap(t=>N(t,s,e)),...(i.functionCalls||[]).flatMap(t=>N(t,s,e)),...(i.projects||[]).flatMap(t=>N(t,s,e)),...(i.loops||[]).flatMap(t=>N(t,s,e)),...(i.searches||[]).flatMap(t=>N(t,s,e))]}function tP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.Property)throw new Error("Entity must be a property to be flattened");return[i,...i.defaultValue?N(i.defaultValue,s,e):[],...i.dataType?N(i.dataType,s,e):[],...i.parent?N(i.parent,s,e):[]]}function rP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.ReturnDeclaration)throw new Error("Entity must be a return declaration to be flattened");return[i,...i.readsValue?N(i.readsValue,s,e):[],...i.defaultValue?N(i.defaultValue,s,e):[],...i.dataType?N(i.dataType,s,e):[],...i.parent?N(i.parent,s,e):[]]}function iP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.ReturnStatement)throw new Error("Entity must be a return statement to be flattened");return[i,...(i.outputs||[]).flatMap(t=>N(t,s,e)),...i.throws?N(i.throws,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function nP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.Search)throw new Error("Entity must be a search to be flattened");return[i,...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...(i.inputsDeclarations||[]).flatMap(t=>N(t,s,e)),...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.outputsDeclarations||[]).flatMap(t=>N(t,s,e)),...(i.outputs||[]).flatMap(t=>N(t,s,e)),...i.error?N(i.error,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.parent?N(i.parent,s,e):[]]}function aP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.ValueDescriptor)throw new Error("Entity must be a value descriptor to be flattened");return[i,...i.defaultValue?N(i.defaultValue,s,e):[],...i.dataType?N(i.dataType,s,e):[],...i.parent?N(i.parent,s,e):[]]}function sP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.VariableDeclaration)throw new Error("Entity must be a variable declaration to be flattened");return[i,...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.outputs||[]).flatMap(t=>N(t,s,e)),...(i.internalCalls||[]).flatMap(t=>N(t,s,e)),...(i.writesValues||[]).flatMap(t=>N(t,s,e)),...i.readsValue?N(i.readsValue,s,e):[],...i.defaultValue?N(i.defaultValue,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.dataType?N(i.dataType,s,e):[],...i.parent?N(i.parent,s,e):[]]}function oP(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(s.has(i.id))return[];if(s.add(i.id),i.type!==n.VariableInstance)throw new Error("Entity must be a variable instance to be flattened");return[i,...(i.successCalls||[]).flatMap(t=>N(t,s,e)),...(i.errorCalls||[]).flatMap(t=>N(t,s,e)),...(i.inputs||[]).flatMap(t=>N(t,s,e)),...(i.outputs||[]).flatMap(t=>N(t,s,e)),...(i.internalCalls||[]).flatMap(t=>N(t,s,e)),...(i.writesValues||[]).flatMap(t=>N(t,s,e)),...i.readsValue?N(i.readsValue,s,e):[],...i.defaultValue?N(i.defaultValue,s,e):[],...(cr(i)||[]).flatMap(t=>N(t,s,e)),...i.declaration?N(i.declaration,s,e):[],...i.parent?N(i.parent,s,e):[]]}function Wr(){const i=new Set;return zE.flatMap(e=>N(e,i)).map(e=>e.id)}function N(i,s=new Set,e={ignoreBuiltInBaseEntities:!1}){if(!i)throw new Error("Entity must be defined to be flattened");if(i.type===n.GenericReference)return[];if(e.ignoreBuiltInBaseEntities&&(hr.includes(i.type)||Wr().includes(i.id)))return[];if(s.has(i.id))return[];switch(i.type){case n.FunctionCall:return kO(i,s,e);case n.Operation:return KO(i,s,e);case n.Condition:return GO(i,s,e);case n.Loop:return HO(i,s,e);case n.Search:return nP(i,s,e);case n.GlobalEvent:return qO(i,s,e);case n.ReturnStatement:return iP(i,s,e);case n.ContinueStatement:return FO(i,s,e);case n.BreakStatement:return jO(i,s,e);case n.VariableDeclaration:return sP(i,s,e);case n.DefinitionEntity:return SO(i,s,e);case n.FunctionDeclaration:return ZO(i,s,e);case n.Project:return eP(i,s,e);case n.ActionDescriptor:return LO(i,s,e);case n.ArgumentDeclaration:return UO(i,s,e);case n.ReturnDeclaration:return rP(i,s,e);case n.ValueDescriptor:return aP(i,s,e);case n.InputMap:return JO(i,s,e);case n.OutputMap:return XO(i,s,e);case n.DataType:return xO(i,s,e);case n.InstalledProject:return WO(i,s,e);case n.InternalCall:return YO(i,s,e);case n.LiteralValue:return zO(i,s,e);case n.Property:return tP(i,s,e);case n.VariableInstance:return oP(i,s,e);case n.BuiltInBaseEntity:return e.ignoreBuiltInBaseEntities?[]:$O(i,s,e);case n.PrimitiveEntity:return e.ignoreBuiltInBaseEntities?[]:QO(i,s,e)}return[]}function Uc(i){return i.type===n.FunctionCall||i.type===n.InternalCall||[n.Operation,n.Condition,n.Loop].includes(i.type)?i.declaration.inputs:i.type===n.FunctionDeclaration||jn.includes(i.type)?i.inputs:i.type===n.Search?i.inputsDeclarations:[]}function Sq(i,s){return s.type===n.Condition?s.inputs.find(e=>e.declaration.id===i.id):s.type===n.FunctionCall||s.type===n.Operation?s.inputs.find(e=>e.declaration.id===i.id):null}function dP(i){return nt.includes(i.type)?i.inputs:[]}function lP(i){var s;return i.type===n.FunctionCall?((s=i.declaration.returnStatements[0])==null?void 0:s.outputs)||[]:[n.Operation,n.Condition,n.Loop].includes(i.type)?i.declaration.outputs:i.type===n.Search?i.outputsDeclarations:st.includes(i.type)?i.outputs:[]}function xq(i,s){return s.type===n.Condition?null:s.type===n.FunctionCall||s.type===n.Operation?s.outputs.find(e=>e.declaration.id===i.id):null}function kq(i){return i.type===n.Condition?[]:nt.includes(i.type)?i.outputs:[]}function Jd(i){const s=i.readsValue;return s?wt(s):null}function uP(i,s){const e=i.readsValue;return e?kd(e,s):null}function pP(i){const s=i.internalCalls||[];return u(Yt(u(s.flatMap(e=>[...e.successCalls,...e.errorCalls]))))}function Ra(i){const s=Lc(i),e=[];return s.forEach(t=>{if(Qe.includes(t.type))e.push(t);else if(hi.includes(t.type)){const r=t.parent;e.push(r)}}),e}function u(i){const s=new Set;return i.filter(e=>!e||s.has(e.id)?!1:(s.add(e.id),!0))}function Ji(i,s=!1){const e=[];if(i.type===n.Project&&e.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)||[]),mt.includes(i.type)&&e.push(...(i==null?void 0:i.detachedChildren)||[]),i.type===n.DefinitionEntity){const t=[...i.suggestedMethods,...i.methods].flatMap(r=>r.collapsed&&s?[]:Ji(r));e.push(...t)}if(i.type===n.Condition){const t=i.successCalls.map(a=>wt(a)),r=i.errorCalls.map(a=>wt(a));e.push(...t,...r)}if(jn.includes(i.type)){if(i.collapsed&&s)return[];const t=i.inputs.map(a=>Ra(a)).flat(),r=i.calls.map(a=>wt(a));e.push(...u(t),...r)}if(nt.includes(i.type)&&i.type!==n.Condition&&i.type!==n.Loop){const t=i==null?void 0:i.outputs.map(d=>Ra(d)).flat(),r=i.successCalls.map(d=>wt(d)),a=i.errorCalls.map(d=>wt(d));e.push(...u(t),...r,...a)}if(Qe.includes(i.type)){const t=Ra(i),r=pP(i);e.push(...t,...r)}if(i.type===n.Loop){const t=i.outputs.map(d=>Ra(d)).flat();if(i.body){const d=Ji(i.body,s);e.push(...d)}const r=i.errorCalls.map(d=>wt(d)),a=i.successCalls.map(d=>wt(d));e.push(...u(t),...a,...r)}if(i.type===n.FunctionDeclaration){if(i.collapsed&&s)return[];const t=i.inputs.map(a=>Ra(a)).flat(),r=i.calls.map(a=>wt(a));e.push(...u(t),...r)}return u(e)}function cP(i,s=!1){const e=Ji(i,s),t=[...e,...e.reduce((r,a)=>[...r,...cP(a,s)],[])];return u(t)}function fP(i){const s=Mn(i),e=[...s,...s.reduce((t,r)=>[...t,...fP(r)],[])];return u(e)}function Wd(i){return i.implements.reduce((s,e)=>e.type===n.DefinitionEntity?[...s,n.DefinitionEntity,...Wd(e),...Yd(e)]:[...s,e.name],[])}function Yd(i){return i.extends.reduce((s,e)=>e.type===n.DefinitionEntity?[...s,n.DefinitionEntity,...Yd(e),...Wd(e)]:[...s,e.name],[])}function jc(i){return i.extends.reduce((s,e)=>e.type===n.DefinitionEntity?[...s,e,...jc(e),...$c(e)]:[...s,e],[])}function $c(i){return i.implements.reduce((s,e)=>e.type===n.DefinitionEntity?[...s,e,...$c(e),...jc(e)]:[...s,e],[])}function Gc(i){return[...Yd(i),...Wd(i)].filter((e,t,r)=>r.indexOf(e)===t)}function yP(i){return i.implements.length===0&&i.extends.length===0?null:i.implements.find(t=>t.type===n.BuiltInBaseEntity&&t.name===z.PERSISTED_ENTITY)?i:[...i.implements,...i.extends].reduce((t,r)=>{if(r.type===n.DefinitionEntity){const a=yP(r);if(a)return a}return t},null)}function Zq(i){const s=i.extends.find(e=>e.type===n.BuiltInBaseEntity);return s&&s.type===n.BuiltInBaseEntity?s:null}function qq(i){const s=i.implements.find(e=>e.type===n.BuiltInBaseEntity);return s&&s.type===n.BuiltInBaseEntity?s:null}function Fc(i){const s=i.extends.find(e=>e.type===n.DefinitionEntity);return s&&s.type===n.DefinitionEntity?s:null}function Wi(i){const s=[...i.implements,...i.extends].reduce((e,t)=>t.type===n.BuiltInBaseEntity?[...e,t]:t.type===n.DefinitionEntity?[...e,...Wi(t)]:e,[]);return u(s)}function Sc(i){return i.type===n.PrimitiveEntity?!0:i.type===n.BuiltInBaseEntity?i.interactive:!Wi(i).find(t=>!t.interactive)}function Jq(i){return i.parent===i.project&&i.project.variableDeclarations.includes(i)}function xc(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 hP(i){if([...at,n.DefinitionEntity,n.InstalledProject,n.Project].includes(i.type)||xc(i))return!1;const s=Mn(i);return s.length===0?!0:s.some(e=>hP(e))}function kc(i){return[...at,n.DefinitionEntity,n.InstalledProject,n.Project].includes(i.type)||xc(i)?!1:Mn(i).length===0}function mP(i,s=0){if(kc(i)){const e=Mn(i);return e.length===0?i:e.map(r=>mP(r,s+1)).reduce((r,a)=>r?a&&a.x<r.x?a:r:a,null)}return null}function vP(i){const s=[];if(kc(i))s.push(i);else return[];return Mn(i).forEach(t=>{s.push(...vP(t))}),s}function TP(i){return i.type===n.FunctionDeclaration&&i.parent!==i.project&&!![n.DefinitionEntity,n.Loop,n.InstalledProject].includes(i.parent.type)}function Wq(i,s){const e=new Map;return i.forEach(t=>{e.set(t.id,t)}),s.forEach(t=>{e.set(t.id,t)}),Array.from(e.values())}function Bs(i){switch(i){case n.DefinitionEntity:return zi;case n.FunctionDeclaration:return Mi;case n.VariableDeclaration:return ji;case n.VariableInstance:return Ui;case n.FunctionCall:return qi;case n.Operation:return gi;case n.Condition:return Li;case n.ReturnStatement:return _i;case n.Loop:return Ni;case n.Search:return $i;case n.InputMap:return kr;case n.OutputMap:return Zr;case n.ArgumentDeclaration:return Fi;case n.ReturnDeclaration:return rr;case n.Property:return Bi;case n.InstalledProject:return Gi;case n.Project:return R;case n.BuiltInBaseEntity:return Yr;default:return null}}function zt(i,s){if(mt.includes(i.type))return i;if(hr.includes(i.type))return null;const e=i.parent;if(!e)return null;if(e.type===n.GenericReference){const t=B(e);if(!t)return null;const r=s.get(t);return r?zt(r,s):null}else return e===s?s:zt(e,s)}function Zc(i,s){if(hr.includes(i.type)||s.getBuiltIn(i.id))return null;const e=nr(i.parent,s);return e?e===s?mt.includes(i.type)?i:null:e.type===n.DefinitionEntity?i:Zc(e,s):null}function zd(i,s,e){if(i===s||s===e||i===e)return!1;const t=zt(s.parent,e);return t===i?!0:zd(t,s,e)}var Hd=(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))(Hd||{});function _s(i,s,e){const t=zt(i,e),r=zt(s,e);if(!t)throw new Error("Could not find scope owner for the entity: "+i.id);if(!r)throw new Error("Could not find scope owner for the entity: "+s.id);if(t===r&&t.type!==n.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:t};if(t===r&&t.type===n.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:t};if(t.type===n.Project&&r.type!==n.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:t};if(t.type!==n.Project&&r.type===n.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:r};if(zd(t,r,e))return{compatible:!0,type:"b-in-a",commonAncestorScope:t};if(zd(r,t,e))return{compatible:!0,type:"a-in-b",commonAncestorScope:r};const o=gc(t,r);return o===e?{compatible:!1,type:"parallel-in-project",commonAncestorScope:o}:o?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:zt(o,e)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:e}}function EP(i,s,e){const t=_s(i,s,e);if(!t.compatible||t.type!=="same-both-local")return null;if(i===s)return i;let r=zt(i.parent,e);if(r){if(r===s)return s;if(r.type===n.Project)return i}else return i;for(;r;){if(r){if(r===s)return s;if(r.type===n.Project)return i}else return i;r=zt(r.parent,e)}let a=zt(s.parent,e);if(a){if(a===i)return i;if(a.type===n.Project)return s}else return s;for(;a;){if(a){if(a===i)return i;if(a.type===n.Project)return s}else return s;a=zt(a.parent,e)}return null}function IP(i){return i.length===0?null:i.length===1?i[0]:i.reduce((e,t)=>{const r=EP(e,t,t.project);return!r||r===t?e:t},i[0])}function nr(i,s){if(!i)return null;let e;return typeof i=="string"?e=i:i.type===n.GenericReference?e=B(i):e=i.id,e===s.id?s:s.get(e)}function Yi(i){if(!i)return null;if(hr.includes(i.type))return i;if(i.type===n.Project)return null;if(i.project.getBuiltIn(i.id))return i;const s=i.parent;return!s||s.type===n.Project?null:Yi(s)}function Yq(i,s){var e;if(i.readsValue){const t=nr(i.readsValue,s.project);s.setValueWriter(t),t.addValueReader(s)}else i.readsValue===null&&((e=s.readsValue)==null||e.removeValueReader(s),s.readsValue=null);return s}function Ms(i){const s=[];function e(a,d){return s.some(o=>o.blockedByCaller===a&&o.blockedByCalling===d)}function t(a,d){e(a,d)||s.push({blockedByCaller:a,blockedByCalling:d})}const r=Zc(i,i.project);return i.calledBySuccess.forEach(a=>{[...a.successCalls||[]].forEach(l=>{st.includes(l.type)&&l!==i&&(it(i).find(c=>c===l)||t(a,l))});let o;if(nt.includes(a.type)&&(o=a),o){const l=Ms(o);l.reachable||it(i).find(c=>c===a)||l.blocks.forEach(c=>{t(a,c.blockedByCalling)})}}),i.calledByError.forEach(a=>{[...a.errorCalls||[]].forEach(l=>{st.includes(l.type)&&l!==i&&(it(i).find(c=>c===l)||t(a,l))});let o;if(nt.includes(a.type)&&(o=a),o){const l=Ms(o);l.reachable||it(i).find(c=>c===a)||l.blocks.forEach(c=>{t(a,c.blockedByCalling)})}}),i.calledByEntry.forEach(a=>{if([...a.calls||[]].forEach(l=>{st.includes(l.type)&&l!==i&&(it(i).find(c=>c===l)||t(a,l))}),a===r)return;let o;if(a.type===n.FunctionDeclaration){const l=wt(a);if(l.type===n.DefinitionEntity)return;l.type===n.Loop&&(o=l)}if(o){const l=Ms(o);l.reachable||l.blocks.forEach(p=>{t(a,p.blockedByCalling)})}}),{reachable:s.length===0,entryPoint:r,blocks:s}}function zq(i){return $s.includes(i.type)?i.type===n.FunctionDeclaration?!TP(i):!0:!1}function Hq(i){if(n.ActionDescriptor===i.type){if(i.project.operationDeclarations.find(a=>a.id===i.id))return n.Operation;if(i.project.globalEventActionDescriptors.find(a=>a.id===i.id))return n.GlobalEvent;if(i.project.loopDeclarations.find(a=>a.id===i.id))return n.Loop;if(i.project.conditionDeclarations.find(a=>a.id===i.id))return n.Condition}return i.type}function Aa(i,s){if(i.type!==n.DefinitionEntity||i.abstract)return!1;const e=Fc(i)||i;return!!Gc(e).includes(s)}function Kq(i){const s=[];return i.entities.forEach(e=>{if(Aa(e,z.PERSISTED_ENTITY)){s.push(e);return}}),u(s)}function Xq(i){const s=[];return i.entities.forEach(e=>{if(Aa(e,z.RELATIONAL_DATABASE)){s.push(e);return}}),u(s)}function Qq(i){return i.type!==n.DefinitionEntity||i.abstract||!Aa(i,z.PERSISTED_ENTITY)?null:(i==null?void 0:i.properties.find(e=>{var t;return((t=e.implements)==null?void 0:t.id)===S[n.BuiltInBaseEntity][z.PERSISTED_ENTITY].properties.primaryKey.id&&!e.abstract}))||null}function eJ(i){if(i.type!==n.DefinitionEntity)return[];if(i.abstract)return[];if(!Aa(i,z.PERSISTED_ENTITY))return[];const s=[],e=i.properties.filter(t=>{var r;return((r=t.implements)==null?void 0:r.id)!==S[n.BuiltInBaseEntity][z.PERSISTED_ENTITY].properties.database.id&&!t.abstract});return s.push(...e),s}function tJ(i){var e;if(!i||i.type!==n.DefinitionEntity||!Aa(i,z.PERSISTED_ENTITY))return null;const s=i.properties.find(t=>{var r;return((r=t.implements)==null?void 0:r.id)===S[n.BuiltInBaseEntity][z.PERSISTED_ENTITY].properties.database.id});return(e=s==null?void 0:s.getDefaultValue())==null?void 0:e.valueAsTypeSingle}function ft(i,s){var t;if(!Qc.includes(s.type)||!i)return s.project||null;let e=s.project;return i.type===n.Project?e=i:((t=s.project)==null?void 0:t.id)!==i.project.id&&(e=i.project),e}function rJ(i){switch(i){case n.Project:return R;case n.InstalledProject:return Gi;case n.DefinitionEntity:return zi;case n.FunctionDeclaration:return Mi;case n.GlobalEvent:return Vn;case n.VariableInstance:return Ui;case n.VariableDeclaration:return ji;case n.InputMap:return kr;case n.OutputMap:return Zr;case n.Condition:return Li;case n.Operation:return gi;case n.FunctionCall:return qi;case n.ReturnDeclaration:return rr;case n.ArgumentDeclaration:return Fi;case n.PrimitiveEntity:return fr;case n.DataType:return wn;case n.Property:return Bi;case n.ActionDescriptor:return qe;case n.ReturnStatement:return _i;case n.ContinueStatement:return $t;case n.BreakStatement:return Cn;case n.Loop:return Ni;case n.Search:return $i;case n.ValueDescriptor:return Si;case n.InternalCall:return Bn;case n.LiteralValue:return _n}return null}function iJ(i){const s={added:{},updated:{},removed:{},affected:[],seenEntities:[],self:i==null?void 0:i.self};return i==null||i.added.forEach(e=>{s.added[e.id]=e}),i==null||i.updated.forEach(e=>{s.updated[e.id]=e}),i==null||i.removed.forEach(e=>{s.removed[e.id]=e}),s.affected=Array.from(new Set(i==null?void 0:i.affected.map(e=>e.id))),s}function dt(i,s){const e=Bs(i.type);return e?!e.MUTABLE_META_PROPERTIES.every(r=>{const a=i[r],d=s[r];return d===void 0||a===d?!0:Array.isArray(a)&&Array.isArray(d)?a.length!==d.length?!1:a.every((o,l)=>o===d[l]):!1}):!1}function Kd(i,s={}){if(i.type===n.Project)return[];if(!i.parent)return[];const e=B(i.parent);if(!e)return[];const t=s[e];return t?[t.id,...Kd(t,s)]:[]}function nJ(i,s){const e=[];if(i.parent)if(i.id===i.parent)e.push(new P({id:`${i.id}--${i.parent}--${I.SelfReference}`,code:I.SelfReference,severity:D.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 t=s.get(i.parent);t?[n.Project,n.DataType].includes(t.type)||e.push(new P({id:`${i.id}--${i.parent}--${I.InvalidParentReference}`,code:I.InvalidParentReference,severity:D.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})):e.push(new P({id:`${i.id}--${i.parent}--${I.ReferencedEntityNotFound}`,code:I.ReferencedEntityNotFound,severity:D.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(t=>{if(i.id===t){e.push(new P({id:`${i.id}--${t}--${I.SelfReference}`,code:I.SelfReference,severity:D.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 r=s.get(t);r?[n.DefinitionEntity,n.BuiltInBaseEntity].includes(r.type)?r.abstract||e.push(new P({id:`${i.id}--${t}--${I.InvalidImplementsReference}`,code:I.InvalidImplementsReference,severity:D.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})):e.push(new P({id:`${i.id}--${t}--${I.InvalidImplementsReference}`,code:I.InvalidImplementsReference,severity:D.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'implements' reference that isn't pointing to an entity of type 'definition-entity' or 'built-in-base-entity'.`,issue:null})):e.push(new P({id:`${i.id}--${t}--${I.ReferencedEntityNotFound}`,code:I.ReferencedEntityNotFound,severity:D.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${t}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}):e.push(new P({id:`${i.id}--${j.InvalidObjectStructure}`,code:j.InvalidObjectStructure,severity:D.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(t=>{const r=s.get(t);r?[n.DefinitionEntity,n.BuiltInBaseEntity].includes(r.type)?r.abstract&&e.push(new P({id:`${i.id}--${t}--${I.InvalidExtendsReference}`,code:I.InvalidExtendsReference,severity:D.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})):e.push(new P({id:`${i.id}--${t}--${I.InvalidExtendsReference}`,code:I.InvalidExtendsReference,severity:D.Error,message:`Entity of type "${i.type}" with id "${i.id}", has an 'extends' reference that isn't pointing to an entity of type 'definition-entity' or 'built-in-base-entity'.`,issue:null})):e.push(new P({id:`${i.id}--${t}--${I.ReferencedEntityNotFound}`,code:I.ReferencedEntityNotFound,severity:D.Error,message:`Entity of type "${i.type}" with id "${i.id}", is referencing an entity with id "${t}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),e}var bP=(i=>(i.Extends="extends",i.Implements="implements",i))(bP||{});const Le=class Le extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"name");f(this,"description",null);f(this,"x");f(this,"y");f(this,"static");f(this,"abstract");f(this,"type",n.DefinitionEntity);f(this,"properties",[]);f(this,"methods",[]);f(this,"abstractMethods",[]);f(this,"extends",[]);f(this,"implements",[]);f(this,"project");f(this,"errors",[]);f(this,"parent");f(this,"detachedDependents",{});f(this,"knownVersions",null);f(this,"activeVersion",!1);f(this,"initialized",!1);f(this,"startedInitialization",!1);f(this,"suggestedProperties",[]);f(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let r=t;if(e.parent){const p=B(e.parent);r=t.get(p)}const a=[];e.implements&&e.implements.forEach(p=>{a.push(t.get(p)||t.getBuiltIn(p))});const d=[];e.extends&&e.extends.forEach(p=>{d.push(t.get(p)||t.getBuiltIn(p))});const o={id:e.id,version:R.UUID.uuid(),createdAt:T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:e.name,type:n.DefinitionEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:d,implements:a,x:0,y:0,parent:r},l=V(o,t);return l.setParent(r,null),l.initChildren(null),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],d=nJ(r,t),o=Bd(r,t);a.push(...d,...o,...ot(r));const l=r.parent?t.get(r.parent):null;if(l&&l.type===n.DataType){const p=l;p.entity&&a.push(new P({id:`${e.id}--${I.NewEntityWouldOverriteExisting}`,code:I.NewEntityWouldOverriteExisting,severity:D.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.
|
|
406
406
|
You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
|
|
407
407
|
${qr({describe_entity:p.entity.id})}
|
|
408
|
-
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 allBasePropertiesFromExtendedAndImplementedEntities(){return u([...this.extends.reduce((e,t)=>[...[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract),...e],[]),...this.implements.reduce((e,t)=>[...[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract),...e],[])])}get extendedPropertiesFromOriginalParents(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...r]},[]))}get implementedPropertiesFromOriginalParents(){return u([...this.extends.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[]),...this.implements.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[])].filter(e=>!!e.abstract))}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new P({id:`${this.id}--${I.InvalidParentUpdate}`,code:I.InvalidParentUpdate,severity:D.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}}subscribeDependents(e){return e.forEach(t=>{this.detachedDependents[t.entity.id]||(this.detachedDependents[t.entity.id]=t)}),this}syncDependents(){const e=[],t=[],r=[],a=[];return Object.values(this.detachedDependents).forEach(d=>{const o=d.entity.afterAllChildrenInitialized();e.push(...o.updated),t.push(...o.added),r.push(...o.removed),a.push(...o.affected)}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}onDetachedDependencyRemoved(e,t,r){const a=[],d=[],o=[],l=[];return t==="implements"&&this.removeImplementation(e),t==="extends"&&this.removeExtension(e),{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}onDetachedDependencyRestored(e,t,r){const a=[],d=[],o=[],l=[];return t==="implements"&&this.addImplementation(e),t==="extends"&&this.addExtension(e),{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}subscribeToDependencies(){return this.implements.forEach(e=>{hr.includes(e.type)||e.subscribeDependents([{entity:this,field:"implements"}])}),this.extends.forEach(e=>{hr.includes(e.type)||e.subscribeDependents([{entity:this,field:"extends"}])}),this}increaseVersion(e){if(e&&!T(e).isValid())throw new Error(`The shared timestamp '${e}' is not a valid ISO 8601 date string.`);return e&&T(e).isSame(T(this.createdAt))?this:(this.previousVersion=this.version,this.version=R.UUID.uuid(),this.createdAt=T(e).toISOString()||T().toISOString(),this)}captureVersion(){var t,r;const e=((t=this.knownVersions)==null?void 0:t.get(this.version))||new Le(this,this.project);return(r=this.knownVersions)==null||r.set(this.version,e),e.properties=this.properties,e.methods=this.methods,e.abstractMethods=this.abstractMethods,e.extends=this.extends,e.implements=this.implements,e.parent=this.parent,this}recursiveCaptureUpstreamVersions(e){const t=[],r=[],a=[],d=[];if(this.parent){this.parent.increaseVersion(e);const o=this.parent.recursiveCaptureUpstreamVersions(e);t.push(this.parent,...o.updated),r.push(...o.added),a.push(...o.removed)}return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}async restoreVersion(e){var l;const t=[],r=[],a=[],d=[];if(this.version===e)return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this};if(!this.knownVersions){const p=new Map;for(const[h,c]of this.knownVersions||new Map){if(p.set(h,c),c.activeVersion=!1,c.knownVersions)for(const[v,E]of c.knownVersions)p.set(v,E);c.knownVersions=null}}let o=(l=this.knownVersions)==null?void 0:l.get(e);if(!o){const p=await this.APILoadVersion({},e);if(!p)throw new Error(`Version with id '${e}' for entity with id '${this.id}' not found.`);o=new Le(p,this.project)}return this.metaSync(o.toShallowJSON(),null),this.properties=o.properties,this.methods=o.methods,this.abstractMethods=o.abstractMethods,this.extends=o.extends,this.implements=o.implements,this.parent=o.parent,{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}hydrateAncestors(){const e=[],t=[],r=[],a=[];if(this.initialData.parent){const d=B(this.initialData.parent),o=this.project.get(d);o&&(this.setParent(o,null),e.push(o))}return this.initialData.extends.forEach(d=>{const o=B(d),l=this.project.get(o);l&&(this.addExtension(l),l.type!==n.BuiltInBaseEntity&&e.push(l))}),this.initialData.implements.forEach(d=>{const o=B(d),l=this.project.get(o);l&&(this.addImplementation(l),l.type!==n.BuiltInBaseEntity&&e.push(l))}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}afterAllChildrenInitialized(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"after-all-children-initialized"))){const t=[],r=[],a=[],d=[];this.initialized=!0,this.captureVersion();const{updated:o,added:l,removed:p,affected:h}=this.syncImplementationProperties(e);t.push(...o),r.push(...l),a.push(...p),d.push(...h);const{updated:c,added:v,removed:E,affected:O}=this.addExtendedProperties(e);return t.push(...c),r.push(...v),a.push(...E),d.push(...O),this.addSuggestions(),e==null||e.attemptAutoclose("after-all-children-initialized",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSelfToProject(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-self-to-project"))){const t=[this],r=[],a=[],d=[];if(this.parent.type===n.DataType){const o=this.parent;o.entity=this,t.push(o)}else this.project.addDefinitionEntity(this);return this.subscribe(),this.subscribeToDependencies(),e==null||e.attemptAutoclose("add-self-to-project",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}setParent(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"set-parent"))){var r;return((r=this.parent)==null?void 0:r.id)!==(e==null?void 0:e.id)&&(this.parent=e,t&&(t==null||t.add(this,b.Updated),t==null||t.attemptAutoclose("set-parent",this.id))),this}addExtension(e){return this.extends.includes(e)||this.extends.push(e),this}removeExtension(e){return this.extends=this.extends.filter(t=>t.id!==e.id),this}addImplementation(e){return this.implements.includes(e)||this.implements.push(e),this}removeImplementation(e){return this.implements=this.implements.filter(t=>t.id!==e.id),this}removeProperty(e){return this.properties=this.properties.filter(t=>t.id!==e.id),this}addMethod(e){return this.methods.includes(e)||(this.methods.push(e),this.suggestedMethods=this.suggestedMethods.filter(t=>t.name!==e.name)),this}removeMethod(e){return this.methods=this.methods.filter(t=>t.id!==e.id),this}addProperty(e){return this.properties.includes(e)||(this.properties.push(e),this.suggestedProperties=this.suggestedProperties.filter(t=>t.name!==e.name)),this}addSuggestedProperty(e){return this.suggestedProperties.includes(e)||this.suggestedProperties.push(e),this}addSuggestedMethod(e){return this.suggestedMethods.includes(e)||this.suggestedMethods.push(e),this}removeSuggestedProperty(e){return this.suggestedProperties=this.suggestedProperties.filter(t=>t.id!==e.id),this}removeSuggestedMethod(e){return this.suggestedMethods=this.suggestedMethods.filter(t=>t.id!==e.id),this}addAbstractMethod(e){return this.abstractMethods.includes(e)||this.abstractMethods.push(e),this}removeAbstractMethod(e){return this.abstractMethods=this.abstractMethods.filter(t=>t.id!==e.id),this}initChildren(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"init-children"))){return this.initialized||this.startedInitialization?this:(this.startedInitialization=!0,this.properties=this.initialData.properties.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(e),r}),this.methods=this.initialData.methods.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(e),r}),this.abstractMethods=this.initialData.abstractMethods.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(e),r}),this.extends=this.initialData.extends.map(t=>V(t,this.project)),this.implements=this.initialData.implements.map(t=>V(t,this.project)),this.subscribeToDependencies(),this.afterAllChildrenInitialized(e),e==null||e.attemptAutoclose("init-children",this.id),this)}syncImplementationProperties(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-implementation-properties"))){const t=[],r=[],a=[],d=[],o=this.properties,l=this.implementedPropertiesFromOriginalParents,p=[...this.allBasePropertiesFromExtendedAndImplementedEntities,...o];return l.filter(c=>!p.find(E=>{var O;return((O=E.implements)==null?void 0:O.id)===c.id})).forEach(c=>{if(this.properties.find(w=>{var C;return((C=w.implements)==null?void 0:C.id)===c.id}))return;const E=this.properties.find(w=>w.name===c.name&&!!w.abstract&&!w.implements);if(E){E.implements=c,E.abstract=!1;return}const O=c.clone(e,this,R.UUID.uuid());O.initChildren(e),r.push(O),e==null||e.add(O,b.Added),O.setImplements(c,e),O.metaSync({abstract:!1},e),this.addProperty(O)}),e==null||e.attemptAutoclose("sync-implementation-properties",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addExtendedProperties(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-extended-properties"))){const t=[],r=[],a=[],d=[],o=this.properties,l=this.extendedPropertiesFromOriginalParents,p=l.filter(c=>l.find(E=>{var O;return((O=E.implements)==null?void 0:O.id)===c.id})?!1:!c.abstract),h=new Set(o.map(c=>c.name));return p.forEach(c=>{if(h.has(c.name))return;h.add(c.name);const v=c.clone(e,this,R.UUID.uuid());v.initChildren(e),r.push(v),e==null||e.add(v,b.Added),this.addProperty(v)}),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSuggestions(){return this.implements.forEach(e=>{M5(this,e).forEach(a=>{const d=a.toJSON();d.id=`_suggestion--parent--${this.id}--${a.id}`;const o=V(d,this.project);o.suggestion=!0,o.setParent(this,null),o.initChildren(null),this.addSuggestedProperty(o)}),g5(this,e).forEach(a=>{const d=`_suggestion--parent--${this.id}--${a.id}`,o=a.asFunctionDeclarationTransfer(d),l=V(o,this.project);if(l.suggestion=!0,l.setParent(this,null),l.initChildren(null),l.inputs.forEach(p=>{p.suggestion=!0}),l.returnStatements.length){const p=l.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(l)})}),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-meta"))){const r=dt(this,e);return e.deleted===!0&&!this.deleted?t==null||t.add(this,b.Removed):e.deleted===!1&&this.deleted?t==null||t.add(this,b.Added):r&&(t==null||t.add(this,b.Updated)),super.metaSync(e),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,t==null||t.attemptAutoclose("sync-meta",this.id),this}async APILoad(e=L,...t){return await Le.repository.APILoad(this.id,...t),this}async APICreate(e=L,...t){return await Le.repository.APICreate(this.toShallowJSON(),...t),this}async APIUpdate(e=L,...t){return await Le.repository.APIUpdate(this.toShallowJSON(),...t),this}async APIDelete(e=L,...t){return await Le.repository.APIDelete(this.toShallowJSON(),...t),this}async APIClone(e=L,...t){return await Le.repository.APIClone(this.id,...t),this}async APILoadVersion(e=L,t,...r){return await Le.repository.APILoadVersion(this.id,t,...r)}remove({ignoreUpstream:e}={ignoreUpstream:!1},t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-entity"))){const r=[],a=[],d=[],o=[];if(t!=null&&t.hasRemoved(this.id))return t==null||t.attemptAutoclose("remove-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(a.push(this),this.unsubscribe(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},t),Object.values(this.detachedDependents).forEach(l=>{const{updated:p,removed:h,added:c}=l.entity.onDetachedDependencyRemoved(this,l.field,t);r.push(...p),a.push(...h),d.push(...c)}),this.properties.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.methods.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.abstractMethods.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.suggestedProperties.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.suggestedMethods.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),!e){if(this.parent.type===n.Project)this.parent.removeDefinitionEntity(this);else if(this.parent.type===n.DataType){const l=this.parent.setEntity(null);r.push(l)}}return t==null||t.attemptAutoclose("remove-entity",this.id),{added:u(d),updated:u(r),removed:u(a),affected:u(o),self:this}}restore({}={},e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"restore-entity"))){const t=[],r=[],a=[],d=[];return e!=null&&e.hasAdded(this.id)?(e==null||e.attemptAutoclose("restore-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},e),this.properties.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.methods.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.abstractMethods.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.suggestedProperties.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.suggestedMethods.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),e==null||e.attemptAutoclose("restore-entity",this.id),{added:u(t),updated:u(r),removed:u(a),affected:u(d),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)),...this.parent.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)),...this.parent.toFlatIds(e)])}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),implements:this.implements.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e)),parent:this.parent.toReference()})}toJSONClone(e=Z){var r,a,d,o,l;let t;return(r=e.seenEntityMaps)!=null&&r.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||ct(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(d=e.seenEntities)!=null&&d.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:R.UUID.uuid(),createdAt:e.timestamp||T().toISOString(),author:"1",previousVersion:null,deleted:!1,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(p=>p.toJSONClone({...e,newId:null})),methods:this.methods.map(p=>p.toJSONClone({...e,newId:null})),abstractMethods:this.abstractMethods.map(p=>p.toJSONClone({...e,newId:null})),implements:this.implements.map(p=>p.type===n.BuiltInBaseEntity?p.toJSON():p.toJSONClone({...e,newId:null})),extends:this.extends.map(p=>p.type===n.BuiltInBaseEntity?p.toJSON():p.toJSONClone({...e,newId:null})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:t,version:this.version,entityType:this.type}}toShallowJSON(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,name:this.name,description:this.description,type:this.type,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(a=>a.toReference(e)),methods:this.methods.map(a=>a.toReference(e)),abstractMethods:this.abstractMethods.map(a=>a.toReference(e)),implements:this.implements.map(a=>a.toReference(e)),extends:this.extends.map(a=>a.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(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)),...this.parent.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.DefinitionEntity).flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===n.DefinitionEntity).flatMap(r=>r.toFlatGenerationTarget(e)),...this.parent.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=_5(this),{success:!0,error:null,data:null}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"clone-entity")),t=null,r=null,a=!0){var w,C,U;let d=ft(t,this);const o=this.toJSON(),l=r||R.UUID.uuid();o.properties=[],o.methods=[],o.abstractMethods=[];const p=l.split("-id"),h=p[p.length-1||0]||l;o.id=l,o.version=R.UUID.uuid(),o.createdAt=(e==null?void 0:e.timestamp)||T().toISOString(),o.author=(e==null?void 0:e.author)||"1",o.previousVersion=null,o.deleted=!1;const c=lt(o,d);t&&c.setParent(t,null),a&&c.subscribe(),c.initChildren(e),e==null||e.add(c,b.Added);const v=(w=this.properties)==null?void 0:w.map(F=>F.clone(e,c,R.UUID.uuid(),a));c.properties=v;const E=(C=this.methods)==null?void 0:C.map((F,_)=>F.clone(e,c,h+"-method-"+_+"-id",a));c.methods=E;const O=(U=this.abstractMethods)==null?void 0:U.map((F,_)=>F.clone(e,c,h+"-abstract-method-"+_+"-id",a));return c.abstractMethods=O,e==null||e.attemptAutoclose("clone-entity",this.id),c}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"implement-definition-entity")),r){const a=Fd(this,e,t,r);return t==null||t.attemptAutoclose("implement-definition-entity",this.id),a}getAllInteractiveMethods(){const e=this.implements.filter(r=>r.type===n.DefinitionEntity||r.type===n.BuiltInBaseEntity&&r.interactive);return u([...this.methods,...this.extends.flatMap(r=>r.getAllInteractiveMethods()),...e.flatMap(r=>r.getAllInteractiveMethods())])}inferFromInputs(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"infer-definition-entity-from-inputs"))){const r=[],a=[],d=[],o=[];if(this.parent.type!==n.DataType||!this.parent.inferred)return t==null||t.attemptAutoclose("infer-definition-entity-from-inputs",this.id),{added:[],updated:[],removed:[],affected:[],self:this};const l=[];e.forEach(c=>{l.find(E=>G(E,this.project)===G(c,this.project))||l.push(c)});const p=this.properties.filter(c=>!c.dataType);l.forEach(c=>{var U,F;const v=p.find(_=>G(_,this.project)===G(c,this.project));if(!v)return;const O=Pn(c.parent).getMasterInputWithValueWritterFromAllInstances(c),w=xr(O,t),C=w==null?void 0:w.clone(t,v,R.UUID.uuid(),!0);if(C){const _=(U=v.dataType)==null?void 0:U.merge(C,t);v.dataType&&(_==null?void 0:_.self.id)!==v.dataType.id&&v.dataType.remove({ignoreUpstream:!1},t),C.id!==((F=_==null?void 0:_.self)==null?void 0:F.id)&&C.remove({ignoreUpstream:!1},t),_!=null&&_.self&&(_.self.metaSync({inferred:!0,like:!0},t),t==null||t.add(_.self,b.Added),v.setDataType(_.self),t==null||t.add(v,b.Updated))}c.setDeclaration(v),t==null||t.add(c,b.Updated)});const h=[];return l.forEach(c=>{if(!c.declaration){h.push(c);return}}),h.length===0?(t==null||t.attemptAutoclose("infer-definition-entity-from-inputs",this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(h.forEach(c=>{var _,$,k,W;const v=this.properties.find(ee=>G(ee,this.project)===G(c,this.project));if(v){if(c.setDeclaration(v),!v.getDataType(t)){const pe=Pn(c.parent).getMasterInputWithValueWritterFromAllInstances(c),Te=xr(pe),K=Te==null?void 0:Te.clone(t,v,R.UUID.uuid(),!0);if(K){const se=(_=v.dataType)==null?void 0:_.merge(K,t);v.dataType&&(se==null?void 0:se.self.id)!==v.dataType.id&&v.dataType.remove({ignoreUpstream:!1},t),K.id!==(($=se==null?void 0:se.self)==null?void 0:$.id)&&K.remove({ignoreUpstream:!1},t),se!=null&&se.self&&(se.self.metaSync({inferred:!0,like:!0},t),t==null||t.add(se.self,b.Added),v.setDataType(se.self),t==null||t.add(v,b.Updated))}}return}const E={id:R.UUID.uuid(),type:n.Property,version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:G(c,this.project),description:c.description,defaultValue:null,static:!0,abstract:!1,private:!1,hidden:!1,required:!1,constant:!0,index:c.index,implements:null,dataType:null,parent:this.toReference()},O=V(E,this.project);O.setParent(this,t),O.initChildren(t),t==null||t.add(O,b.Added);const C=Pn(c.parent).getMasterInputWithValueWritterFromAllInstances(c),U=xr(C),F=U==null?void 0:U.clone(t,O,R.UUID.uuid(),!0);if(F){const ee=(k=O.dataType)==null?void 0:k.merge(F,t);O.dataType&&(ee==null?void 0:ee.self.id)!==O.dataType.id&&O.dataType.remove({ignoreUpstream:!1},t),F.id!==((W=ee==null?void 0:ee.self)==null?void 0:W.id)&&F.remove({ignoreUpstream:!1},t),ee!=null&&ee.self&&(ee.self.metaSync({inferred:!0,like:!0},t),t==null||t.add(ee.self,b.Added),O.setDataType(ee.self),t==null||t.add(O,b.Updated))}return this.addProperty(O),c.setDeclaration(O),t==null||t.add(c,b.Updated),O}),t==null||t.attemptAutoclose("infer-definition-entity-from-inputs",this.id),{added:u(r),updated:u(a),removed:u(d),affected:u(o),self:this})}};f(Le,"repository",{APICreate:async(e,...t)=>e,APIUpdate:async(e,...t)=>e,APIDelete:async(e,...t)=>e,APIClone:async(e,...t)=>{},APILoad:async(e,...t)=>null,APILoadVersion:async(e,t,...r)=>null}),f(Le,"type",n.DefinitionEntity),f(Le,"USER_MANAGED_PARENT_TYPES",[n.Project,n.DataType]),f(Le,"PARENT_TYPES",[...Le.USER_MANAGED_PARENT_TYPES]),f(Le,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),f(Le,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),f(Le,"BASE_PROPERTIES",[...Le.MUTABLE_BASE_PROPERTIES,...Le.INMUTABLE_BASE_PROPERTIES]),f(Le,"MUTABLE_META_PROPERTIES",[...Le.MUTABLE_BASE_PROPERTIES,"x","y"]),f(Le,"INMUTABLE_META_PROPERTIES",[...Le.INMUTABLE_BASE_PROPERTIES]),f(Le,"META_PROPERTIES",[...Le.MUTABLE_META_PROPERTIES,...Le.INMUTABLE_META_PROPERTIES]),f(Le,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),f(Le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),f(Le,"UPSTREAM_PROPERTIES",[...Le.MUTABLE_UPSTREAM_PROPERTIES,...Le.INMUTABLE_UPSTREAM_PROPERTIES]),f(Le,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),f(Le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),f(Le,"DOWNSTREAM_PROPERTIES",[...Le.MUTABLE_DOWNSTREAM_PROPERTIES,...Le.INMUTABLE_DOWNSTREAM_PROPERTIES]),f(Le,"PROPERTIES",[...Le.META_PROPERTIES,...Le.UPSTREAM_PROPERTIES,...Le.DOWNSTREAM_PROPERTIES]);let zi=Le;function aJ(i){const s=l6(),e=i.toJSON();s.safeParse(e).success;const r=[];return Ye(i.errors,r)}const Ns=class Ns extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"version");f(this,"name");f(this,"description",null);f(this,"type",n.BuiltInBaseEntity);f(this,"abstract",!1);f(this,"static");f(this,"properties",[]);f(this,"methods",[]);f(this,"abstractMethods",[]);f(this,"extends",[]);f(this,"interactive",!1);f(this,"errors",[]);f(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=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.methods=this.initialData.methods.map(r=>{const a=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.extends=this.initialData.extends.map(r=>V(r,this.project))}get allBasePropertiesFromExtendedAndImplementedEntities(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract);return[...e,...r]},[]))}get extendedPropertiesFromOriginalParents(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...r]},[]))}get implementedPropertiesFromOriginalParents(){return u([...this.extends.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[])])}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async APILoad(e=L,...t){return await Ns.repository.APILoad(this.id,...t),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(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e))})}toReference(e=Z){return{id:this.id+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(e=Z){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(t=>t.toReference()),methods:this.methods.map(t=>t.toReference()),abstractMethods:this.abstractMethods.map(t=>t.toReference()),extends:this.extends.map(t=>t.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(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=aJ(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}implement(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),null,!0,"implement-built-in-base-entity")),r){const a=Fd(this,e,t,r);return t==null||t.attemptAutoclose("implement-built-in-base-entity",this.id),a}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(r=>r.type===n.BuiltInBaseEntity&&r.interactive||r.type===n.PrimitiveEntity).forEach(r=>{r instanceof Ns&&e.push(...r.getAllInteractiveMethods())})),u(e)}};f(Ns,"repository",{APILoad:async(e,...t)=>null});let Yr=Ns;function sJ(i){const s=e6(),e=i.toJSON();s.safeParse(e).success;const r=[];return Ye(i.errors,r)}const Qd=class Qd extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"name");f(this,"description",null);f(this,"type",n.PrimitiveEntity);f(this,"static");f(this,"abstract");f(this,"properties",[]);f(this,"methods",[]);f(this,"abstractMethods",[]);f(this,"extends",[]);f(this,"errors",[]);f(this,"project");this.initialData=e,this.project=t,this.id=e.id,this.name=e.name,this.static=e.static,this.abstract=e.abstract,this.properties=this.initialData.properties.map(r=>{const a=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.methods=this.initialData.methods.map(r=>{const a=V(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=V(r,this.project);return a.parent=this,a})}get allBasePropertiesFromExtendedAndImplementedEntities(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract);return[...e,...r]},[]))}get extendedPropertiesFromOriginalParents(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...r]},[]))}get implementedPropertiesFromOriginalParents(){return u([...this.extends.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[])])}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async APILoad(e=L,...t){return await Qd.repository.APILoad(this.id,...t),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(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e))})}toReference(e=Z){return{id:this.id+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(e=Z){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,properties:this.properties.map(t=>t.toReference()),methods:this.methods.map(t=>t.toReference()),abstractMethods:this.abstractMethods.map(t=>t.toReference()),extends:this.extends.map(t=>t.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(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=sJ(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(r=>r.type===n.BuiltInBaseEntity&&r.interactive||r.type===n.PrimitiveEntity).forEach(r=>{r instanceof Yr&&e.push(...r.getAllInteractiveMethods())}),u(e)}};f(Qd,"repository",{APILoad:async(e,...t)=>null});let fr=Qd;function lt(i,s){if(!i)throw new Error("Entity is null");const e=s.get(i.id);switch(i.type){case n.LiteralValue:return e||new _n(i,s);case n.DefinitionEntity:return e||new zi(i,s);case n.PrimitiveEntity:return e||new fr(i,s);case n.FunctionDeclaration:return e||new Mi(i,s);case n.GlobalEvent:return e||new Vn(i,s);case n.DataType:return e||new wn(i,s);case n.Property:return e||new Bi(i,s);case n.FunctionCall:return e||new qi(i,s);case n.Condition:return e||new Li(i,s);case n.Operation:return e||new gi(i,s);case n.VariableDeclaration:return e||new ji(i,s);case n.VariableInstance:return e||new Ui(i,s);case n.OutputMap:return e||new Zr(i,s);case n.ReturnDeclaration:return e||new rr(i,s);case n.ArgumentDeclaration:return e||new Fi(i,s);case n.InputMap:return e||new kr(i,s);case n.Project:return e||new R(i);case n.InstalledProject:return e||new Gi(i,s);case n.ActionDescriptor:return e||new qe(i,s);case n.ReturnStatement:return e||new _i(i,s);case n.Loop:return e||new Ni(i,s);case n.Search:return e||new $i(i,s);case n.ValueDescriptor:return e||new Si(i,s);case n.BuiltInBaseEntity:return e||new Yr(i,s);case n.InternalCall:return e||new Bn(i,s);case n.ContinueStatement:return e||new $t(i,s);case n.BreakStatement:return e||new Cn(i,s);case n.GenericReference:return s.get(i.entityId);default:throw new Error("Invalid entity type: "+i.type)}}function V(i,s){if(!i)throw new Error("Entity is null");const e=lt(i,s);return e.subscribe(),e}function oJ(i,s){if(!i)throw new Error("Entity is null");switch(i.type){case n.LiteralValue:return _n.fromGenerationTarget(i,s);case n.DefinitionEntity:return zi.fromGenerationTarget(i,s);case n.FunctionDeclaration:return Mi.fromGenerationTarget(i,s);case n.GlobalEvent:return Vn.fromGenerationTarget(i,s);case n.DataType:return wn.fromGenerationTarget(i,s);case n.Property:return Bi.fromGenerationTarget(i,s);case n.FunctionCall:return qi.fromGenerationTarget(i,s);case n.Condition:return Li.fromGenerationTarget(i,s);case n.Operation:return gi.fromGenerationTarget(i,s);case n.VariableDeclaration:return ji.fromGenerationTarget(i,s);case n.VariableInstance:return Ui.fromGenerationTarget(i,s);case n.OutputMap:return Zr.fromGenerationTarget(i,s);case n.ReturnDeclaration:return rr.fromGenerationTarget(i,s);case n.ArgumentDeclaration:return Fi.fromGenerationTarget(i,s);case n.InputMap:return kr.fromGenerationTarget(i,s);case n.InstalledProject:return Gi.fromGenerationTarget(i,s);case n.ReturnStatement:return _i.fromGenerationTarget(i,s);case n.Loop:return Ni.fromGenerationTarget(i,s);case n.Search:return $i.fromGenerationTarget(i,s);case n.ActionDescriptor:return qe.fromGenerationTarget(i,s);case n.ValueDescriptor:return Si.fromGenerationTarget(i,s);case n.InternalCall:return Bn.fromGenerationTarget(i,s);case n.ContinueStatement:return $t.fromGenerationTarget(i,s);case n.BreakStatement:return Cn.fromGenerationTarget(i,s);default:throw new Error("Invalid entity type: "+i.type)}}const Z={seenEntityMaps:new Map,seenEntities:new Set,timestamp:T().toISOString()};class RP{constructor(){f(this,"initialData")}}const L={cascade:!1},AP={APILoad:async(i,...s)=>null},dJ={APICreate:async(i,...s)=>i,APIUpdate:async(i,...s)=>i,APIDelete:async(i,...s)=>i,APIClone:async(i,...s)=>{},APILoadVersion:async(i,s,...e)=>null,...AP};class lJ{}class uJ extends RP{}class pJ{}class cJ{}class fJ{}class qc{}class yJ extends qc{}class hJ extends qc{}class mJ{}class yi{static initReadsValue(s){if(s.initialData.readsValue&&s.initialData.readsValue.type!==n.GenericReference)s.readsValue=V(s.initialData.readsValue,s.project);else if(s.initialData.readsValue&&s.initialData.readsValue.type===n.GenericReference){const e=nr(s.initialData.readsValue,s.project);e&&(s.readsValue=e)}if(s.readsValue){if(Qe.includes(s.readsValue.type)){let e=s.parent;mt.includes(e.type)||(e=e.parent);const t=s.type===n.InputMap&&s.parent.type===n.Loop;t&&(e=s.parent.parent),s.readsValue.setParent(e,null),s.readsValue.initChildren(null),!t&&e.detachedChildren.includes(s)?e.replaceDetachedChild(s,s.readsValue):t||e.subscribeDetachedChild(s.readsValue)}s.readsValue.addValueReader(s)}return s.readsValue}static hydrateReadsValue(s){if(s.initialData.readsValue&&s.initialData.readsValue.type!==n.GenericReference)s.readsValue=V(s.initialData.readsValue,s.project);else if(s.initialData.readsValue&&s.initialData.readsValue.type===n.GenericReference){const e=nr(s.initialData.readsValue,s.project);e&&(s.readsValue=e)}if(s.readsValue){if(Qe.includes(s.readsValue.type)){let e=s.parent;mt.includes(e.type)||(e=e.parent);const t=s.type===n.InputMap&&s.parent.type===n.Loop;t&&(e=s.parent.parent),s.readsValue.setParent(e,null),!t&&e.detachedChildren.includes(s)?e.replaceDetachedChild(s,s.readsValue):t||e.subscribeDetachedChild(s.readsValue)}s.readsValue.addValueReader(s)}return s.readsValue}}class gs{static initWritesValues(s,e){const t=s.initialData.writesValues.reduce((a,d)=>{if(d.type===n.GenericReference||s.writesValues.some(l=>l.id===d.id))return a;const o=V(d,s.project);return o.setValueWriter(s),Qe.includes(o.type)&&(o.setParent(e,null),o.initChildren(null)),[...a,o]},[]),r=[...s.writesValues];return s.writesValues=u([...r,...t]),s.writesValues}}class vJ{}const de=class de extends rt{constructor(e){super(e);f(this,"initialData");f(this,"id");f(this,"type",n.Project);f(this,"name",null);f(this,"description",null);f(this,"x");f(this,"y");f(this,"entities",[]);f(this,"projects",[]);f(this,"functions",[]);f(this,"events",[]);f(this,"variableDeclarations",[]);f(this,"variableInstances",[]);f(this,"conditions",[]);f(this,"operations",[]);f(this,"functionCalls",[]);f(this,"loops",[]);f(this,"searches",[]);f(this,"primitives",[]);f(this,"builtInBaseEntities",[]);f(this,"operationDeclarations",[]);f(this,"globalEventActionDescriptors",[]);f(this,"loopDeclarations",[]);f(this,"loopDeclarationsBodies",[]);f(this,"conditionDeclarations",[]);f(this,"valueDescriptors",[]);f(this,"dataTypes",[]);f(this,"project");f(this,"instances",{});f(this,"builtInInstances",{});f(this,"deletedInstances",{});f(this,"errors",[]);f(this,"references",[]);f(this,"history",[]);f(this,"detachedDependents",{});f(this,"knownVersions",null);f(this,"activeVersion",!1);f(this,"initialized",!1);f(this,"startedInitialization",!1);f(this,"onCloseChangeSetCallback",null);this.initialData=e,this.id=e.id,this.name=e.name,this.description=e.description,this.x=0,this.y=0,this.instances[this.id]=this;try{(!de.UUID||de.UUID.isBackup)&&(de.UUID=Lo==null?void 0:Lo()),de.UUID||(de.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:t=>t})}catch(t){console.error("Error initializing UUID module",t),de.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:r=>r}}}static injectUUIDModule(e){de.UUID=e}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...ot(r)),{errors:a,modifiedData:r}}onCloseChangeSet(e){this.onCloseChangeSetCallback=e}closeChangeSet(e){this.onCloseChangeSetCallback&&this.onCloseChangeSetCallback(e)}addChangeSet(e){if(!this.history.length)return this.history.push(e),e;const t=this.history.find(a=>a.id===(e==null?void 0:e.id));if(t)return t;const r=this.history.findIndex(a=>T(a.timestamp).isBefore(T(e==null?void 0:e.timestamp)));return r===-1?this.history.push(e):this.history.splice(r,0,e),e}discardChangeSet(e){const t=this.history.findIndex(r=>r.id===(e==null?void 0:e.id));return t!==-1&&this.history.splice(t,1),this}undo(){const e=[],t=[],r=[],a=[];return{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}redo(){const e=[],t=[],r=[],a=[];return{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}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}}subscribeDependents(e){return e.forEach(t=>{this.detachedDependents[t.entity.id]||(this.detachedDependents[t.entity.id]=t)}),this}syncDependents(){const e=[],t=[],r=[],a=[];return Object.values(this.detachedDependents).forEach(d=>{const o=d.entity.afterAllChildrenInitialized();e.push(...o.updated),t.push(...o.added),r.push(...o.removed),a.push(...o.affected)}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}onDetachedDependencyRemoved(e,t,r){const a=[],d=[],o=[],l=[];return{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}onDetachedDependencyRestored(e,t,r){const a=[],d=[],o=[],l=[];return{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}subscribeToDependencies(){return this}increaseVersion(e){if(e&&!T(e).isValid())throw new Error(`The shared timestamp '${e}' is not a valid ISO 8601 date string.`);return e&&T(e).isSame(T(this.createdAt))?this:(this.previousVersion=this.version,this.version=de.UUID.uuid(),this.createdAt=T(e).toISOString()||T().toISOString(),this)}captureVersion(){var t,r;const e=((t=this.knownVersions)==null?void 0:t.get(this.version))||new de(this);return(r=this.knownVersions)==null||r.set(this.version,e),e.entities=this.entities,e.projects=this.projects,e.functions=this.functions,e.events=this.events,e.variableDeclarations=this.variableDeclarations,e.variableInstances=this.variableInstances,e.conditions=this.conditions,e.operations=this.operations,e.functionCalls=this.functionCalls,e.loops=this.loops,e.searches=this.searches,this}recursiveCaptureUpstreamVersions(e){const t=[],r=[],a=[],d=[];return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}async restoreVersion(e){var l;const t=[],r=[],a=[],d=[];if(this.version===e)return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this};if(!this.knownVersions){const p=new Map;for(const[h,c]of this.knownVersions||new Map){if(p.set(h,c),c.activeVersion=!1,c.knownVersions)for(const[v,E]of c.knownVersions)p.set(v,E);c.knownVersions=null}}let o=(l=this.knownVersions)==null?void 0:l.get(e);if(!o){const p=await this.APILoadVersion({},e);if(!p)throw new Error(`Version with id '${e}' for entity with id '${this.id}' not found.`);o=new de(p)}return this.metaSync(o.toShallowJSON(),null),this.entities=o.entities,this.projects=o.projects,this.functions=o.functions,this.events=o.events,this.variableDeclarations=o.variableDeclarations,this.variableInstances=o.variableInstances,this.conditions=o.conditions,this.operations=o.operations,this.functionCalls=o.functionCalls,this.loops=o.loops,this.searches=o.searches,{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}hydrateAncestors(){const e=[],t=[],r=[],a=[];return{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}afterAllChildrenInitialized(e=null){const t=[],r=[],a=[],d=[];return this.initialized=!0,this.captureVersion(),this.validate(),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSelfToProject(e){const t=[],r=[],a=[],d=[];return this.subscribe(),this.subscribeToDependencies(),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}get instancesList(){return Object.values(this.instances)}isOperationDeclaration(e){return this.operationDeclarations.includes(e)}isGlobalEventActionDescriptor(e){return this.globalEventActionDescriptors.includes(e)}isLoopDeclaration(e){return this.loopDeclarations.includes(e)}isConditionDeclaration(e){return this.conditionDeclarations.includes(e)}initChildren(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"init-children"))){return this.initialized||this.startedInitialization?this:(this.startedInitialization=!0,this.entities=this.initialData.entities.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.projects=this.initialData.projects.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.variableDeclarations=this.initialData.variableDeclarations.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.variableInstances=this.initialData.variableInstances.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.conditions=this.initialData.conditions.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.operations=this.initialData.operations.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.functions=this.initialData.functions.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.events=this.initialData.events.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.functionCalls=this.initialData.functionCalls.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.loops=this.initialData.loops.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.searches=this.initialData.searches.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.attachOrphanReferences(),this.subscribeToDependencies(),this.afterAllChildrenInitialized(e),e==null||e.attemptAutoclose("init-children",this.id),this)}subscribeInstance(e){return(!this.instances[e.id]||this.instances[e.id]!==e)&&(this.instances[e.id]=e),this}subscribeDeletedInstance(e){return(!this.deletedInstances[e.id]||this.deletedInstances[e.id]!==e)&&(this.deletedInstances[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}unsubscribeDeletedInstance(e){return delete this.deletedInstances[e.id],this}findSubscribedBuiltInInstance(e){return this.builtInInstances[e.id]||null}get(e){return this.instances[e]||this.builtInInstances[e]||null}getDeleted(e){return this.deletedInstances[e]||null}getManaged(e){return this.getBuiltIn(e)?null: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}metaSync(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-meta"))){const r=dt(this,e);return e.deleted===!0&&!this.deleted?t==null||t.add(this,b.Removed):e.deleted===!1&&this.deleted?t==null||t.add(this,b.Added):r&&(t==null||t.add(this,b.Updated)),super.metaSync(e),this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,t==null||t.attemptAutoclose("sync-meta",this.id),this}async APILoad(e=L,...t){return await de.repository.APILoad(this.id,...t),this}async APICreate(e=L,...t){return await de.repository.APICreate(this.toShallowJSON(),...t),this}async APIUpdate(e=L,...t){return await de.repository.APIUpdate(this.toShallowJSON(),...t),this}async APIDelete(e=L,...t){return await de.repository.APIDelete(this.toShallowJSON(),...t),this}async APIClone(e=L,...t){return await de.repository.APIClone(this.id,...t),this}async APILoadVersion(e=L,t,...r){return await de.repository.APILoadVersion(this.id,t,...r)}remove({ignoreUpstream:e}={ignoreUpstream:!1},t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-entity"))){return{added:[],updated:[],removed:[],affected:[],self:this}}restore({}={},e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"restore-entity"))){return{added:[],updated:[],removed:[],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,...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),[this.id,...this.entities.flatMap(r=>r.toFlatIds(e)),...this.functions.flatMap(r=>r.toFlatIds(e)),...this.events.flatMap(r=>r.toFlatIds(e)),...this.projects.flatMap(r=>r.toFlatIds(e)),...this.variableDeclarations.flatMap(r=>r.toFlatIds(e)),...this.variableInstances.flatMap(r=>r.toFlatIds(e)),...this.conditions.flatMap(r=>r.toFlatIds(e)),...this.operations.flatMap(r=>r.toFlatIds(e)),...this.functionCalls.flatMap(r=>r.toFlatIds(e)),...this.loops.flatMap(r=>r.toFlatIds(e)),...this.searches.flatMap(r=>r.toFlatIds(e))])}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,entities:this.entities.map(t=>t.toJSON(e)),variableDeclarations:this.variableDeclarations.map(t=>t.toJSON(e)),variableInstances:this.variableInstances.map(t=>t.toJSON(e)),conditions:this.conditions.map(t=>t.toJSON(e)),operations:this.operations.map(t=>t.toJSON(e)),loops:this.loops.map(t=>t.toJSON(e)),searches:this.searches.map(t=>t.toJSON(e)),functions:this.functions.map(t=>t.toJSON(e)),events:this.events.map(t=>t.toJSON(e)),projects:this.projects.map(t=>t.toJSON(e)),functionCalls:this.functionCalls.map(t=>t.toJSON(e))})}toJSONClone(e={uuidStrategy:"uuid"}){const t=new Map,r=new Set,a=this.getAllBuiltInIds();return Object.keys(this.instances).forEach(d=>{if(a.includes(d)){t.set(d,d);return}t.set(d,de.UUID.uuid())}),r.add(this.id),{id:t.get(this.id),version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,entities:this.entities.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),projects:this.projects.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),variableDeclarations:this.variableDeclarations.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),variableInstances:this.variableInstances.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),conditions:this.conditions.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),operations:this.operations.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),functions:this.functions.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),events:this.events.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),functionCalls:this.functionCalls.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),loops:this.loops.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),searches:this.searches.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null}))}}toReference(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+de.UUID.uuid()+"--ref",type:n.GenericReference,entityId:t,version:this.version,entityType:this.type}}toShallowJSON(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,entities:this.entities.map(a=>a.toReference(e)),functions:this.functions.map(a=>a.toReference(e)),events:this.events.map(a=>a.toReference(e)),projects:this.projects.map(a=>a.toReference(e)),variableDeclarations:this.variableDeclarations.map(a=>a.toReference(e)),variableInstances:this.variableInstances.map(a=>a.toReference(e)),conditions:this.conditions.map(a=>a.toReference(e)),operations:this.operations.map(a=>a.toReference(e)),functionCalls:this.functionCalls.map(a=>a.toReference(e)),loops:this.loops.map(a=>a.toReference(e)),searches:this.searches.map(a=>a.toReference(e))}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...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=O5(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return this}getDefinitionEntity(e){return this.entities.find(t=>t.id===e)||null}addDefinitionEntityFromTransfer(e){const t=V(e,this);return this.addDefinitionEntity(t),t}addDefinitionEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=V(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=V(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=V(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=V(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=V(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=V(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=V(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=V(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=V(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=V(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeDefinitionEntity(e){const t=this.entities.findIndex(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=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.functionCalls.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.operations.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.loops.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.searches.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.functionCalls.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.conditions.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.loops.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.searches.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.conditions.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.operations.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.loops.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.searches.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.functionCalls.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.conditions.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.operations.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.loops.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.searches.reduce((t,r)=>{const a=We(r);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.functionCalls.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.conditions.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.operations.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.loops.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.searches.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[])]}getVariableDeclarations(){return u([...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.functionCalls.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.conditions.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.operations.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.loops.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.searches.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(r=>{if(!r.declaration){const a=r.initialData,d=a.declaration.entityId||a.declaration.id,o=t.find(l=>l.id===d);o&&r.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===z.PERSISTED_ENTITY)||null}};f(de,"UUID",{isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),f(de,"repository",{APICreate:async(e,...t)=>e,APIUpdate:async(e,...t)=>e,APIDelete:async(e,...t)=>e,APIClone:async(e,...t)=>{},APILoad:async(e,...t)=>null,APILoadVersion:async(e,t,...r)=>null}),f(de,"type",n.Project),f(de,"USER_MANAGED_PARENT_TYPES",[]),f(de,"PARENT_TYPES",[...de.USER_MANAGED_PARENT_TYPES]),f(de,"MUTABLE_BASE_PROPERTIES",["name","description"]),f(de,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),f(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),f(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"x","y"]),f(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),f(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),f(de,"MUTABLE_UPSTREAM_PROPERTIES",[]),f(de,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),f(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUTABLE_UPSTREAM_PROPERTIES]),f(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),f(de,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),f(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUTABLE_DOWNSTREAM_PROPERTIES]),f(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let R=de;var DP=(i=>(i.PersistChangeSet="persist-change-set",i.CreateSingle="create-single",i.CreateBulk="create-bulk",i.CreateSingleNested="create-single-nested",i.CreateBulkNested="create-bulk-nested",i.Update="update",i.Clone="clone",i.Delete="delete",i.Load="load",i.LoadNested="load-nested",i.LoadVersion="load-version",i))(DP||{});class OP extends qe{constructor(e){super(Rr,e);f(this,"id",He.Parallel);f(this,"name",He.Parallel);f(this,"description","Execute a list of actions one after the other");f(this,"version","1");f(this,"autoexecutable",!0);f(this,"initialData",Rr);f(this,"type",n.ActionDescriptor);f(this,"inputs",[]);f(this,"outputs",[]);f(this,"error",null);f(this,"project");this.project=e,this.inputs=Rr.inputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.outputs=Rr.outputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.error=Rr.error?V(Rr.error,this.project):null}}class PP extends qe{constructor(e){super(Ft,e);f(this,"id",Ft.id);f(this,"name",Ft.name);f(this,"description",Ft.description);f(this,"version",Ft.version);f(this,"autoexecutable",!1);f(this,"initialData",Ft);f(this,"type",n.ActionDescriptor);f(this,"inputs",[]);f(this,"outputs",[]);f(this,"error",null);f(this,"project");this.project=e,this.inputs=Ft.inputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.outputs=Ft.outputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.error=Ft.error?V(Ft.error,this.project):null}}class wP extends qe{constructor(e){super(ti,e);f(this,"id",He.Sequential);f(this,"name",He.Sequential);f(this,"description","Execute a list of actions one after the other");f(this,"version","1");f(this,"autoexecutable",!0);f(this,"initialData",ti);f(this,"type",n.ActionDescriptor);f(this,"inputs",[]);f(this,"outputs",[]);f(this,"error",null);f(this,"project");this.project=e,this.inputs=ti.inputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.outputs=ti.outputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.error=ti.error?V(ti.error,this.project):null}}class TJ extends qe{constructor(s){super(wa,s)}}class EJ extends qe{constructor(s){super(Xi,s)}}class IJ extends qe{constructor(e){super(Qi,e);f(this,"autoexecutable",!0)}getEntityToMatchInputMap(e){return e.inputs.find(t=>{var r;return((r=t.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].inputs.entityToMatch.id})||null}getDataToValidateInputMap(e){return e.inputs.find(t=>{var r;return((r=t.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].inputs.dataToValidate.id})||null}getOutputDataOutputMap(e){return e.outputs.find(t=>{var r;return((r=t.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].outputs.outputEntity.id})||null}getEntityToMatch(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"get-entity-to-match-validate-data"))){let r=null;if(e.readsValue){const d=e.readsValue.getDataType(t);d&&d.entity&&d.entity.type===n.DefinitionEntity&&(r=d.entity)}const a=e.getDefaultValue();return!r&&a&&a.valueAsTypeSingle&&!Array.isArray(a.valueAsTypeSingle)&&a.valueAsTypeSingle.type===n.DefinitionEntity&&(r=a.valueAsTypeSingle),r}syncOperationInstance(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-operation-instance-validate-data"))){const r=[],a=[],d=[],o=[],l=this.getEntityToMatchInputMap(e);if(l){const{added:c,updated:v,removed:E,affected:O}=this.syncEntityToMatchInputMapDataType(l,t);r.push(...v),a.push(...c),d.push(...E),o.push(...O)}const p=this.getDataToValidateInputMap(e);if(p){const{added:c,updated:v,removed:E,affected:O}=this.syncDataToValidateInputMapDataType(p,t);r.push(...v),a.push(...c),d.push(...E),o.push(...O)}const h=this.getOutputDataOutputMap(e);if(h){const{added:c,updated:v,removed:E,affected:O}=this.syncOutputDataOutputMapDataType(h,t);r.push(...v),a.push(...c),d.push(...E),o.push(...O)}return t==null||t.attemptAutoclose("sync-operation-instance-validate-data",this.id),{updated:u(r),added:u(a),removed:u(d),affected:u(o),self:e}}syncEntityToMatchInputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-entity-to-match-input-map-data-type"))){var p,h,c;const r=[],a=[],d=[],o=[];if(((p=e.declaration)==null?void 0:p.id)!==S.operation[Ke.Validate].inputs.entityToMatch.id)return t==null||t.attemptAutoclose("sync-entity-to-match-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!e.dataType){const v={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!0,entity:null,like:!0,inferred:!0,parent:e.toReference()},E=V(v,e.project);E.setParent(e,t),E.initChildren(t),t==null||t.add(E,b.Added),r.push(E),e.setDataType(E)}(h=e.dataType)==null||h.metaSync({inferred:!0,like:!1,asType:!0},t);const l=this.getEntityToMatch(e,t);return(c=e.dataType)==null||c.setEntity(l),e.dataType&&a.push(e.dataType),t==null||t.attemptAutoclose("sync-entity-to-match-input-map-data-type",this.id),{updated:u(a),added:u(r),removed:u(d),affected:u(o),self:e.dataType}}syncDataToValidateInputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-data-to-validate-input-map-data-type"))){var c,v,E;const r=[],a=[],d=[],o=[];if(((c=e.declaration)==null?void 0:c.id)!==S.operation[Ke.Validate].inputs.dataToValidate.id)return t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};const l=this.getEntityToMatchInputMap(e.parent);if(!l)return t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!this.getEntityToMatch(l,t))return t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!e.dataType){const O={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,like:!0,inferred:!0,parent:e.toReference()},w=V(O,e.project);w.setParent(e,t),w.initChildren(t),t==null||t.add(w,b.Added),r.push(w),e.setDataType(w)}(v=e.dataType)==null||v.metaSync({inferred:!0,like:!0,asType:!1},t);const h=this.getEntityToMatch(l,t);return(E=e.dataType)==null||E.setEntity(h),e.dataType&&a.push(e.dataType),t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:u(a),added:u(r),removed:u(d),affected:u(o),self:e.dataType}}syncOutputDataOutputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-output-data-output-map-data-type"))){var c,v,E;const r=[],a=[],d=[],o=[];if(((c=e.declaration)==null?void 0:c.id)!==S.operation[Ke.Validate].outputs.outputEntity.id)return t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};const l=this.getEntityToMatchInputMap(e.parent);if(!l)return t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!this.getEntityToMatch(l,t))return t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!e.dataType){const O={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,like:!0,inferred:!0,parent:e.toReference()},w=V(O,e.project);w.setParent(e,t),w.initChildren(t),t==null||t.add(w,b.Added),r.push(w),e.setDataType(w)}(v=e.dataType)==null||v.metaSync({inferred:!0,like:!0,asType:!1},t);const h=this.getEntityToMatch(l,t);return(E=e.dataType)==null||E.setEntity(h),e.dataType&&a.push(e.dataType),t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:u(a),added:u(r),removed:u(d),affected:u(o),self:e.dataType}}inferInputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"infer-input-map-data-type-validate-data"))){var r,a;if(((r=e.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].inputs.entityToMatch.id){const{added:d,updated:o,removed:l,affected:p}=this.syncEntityToMatchInputMapDataType(e,t);return t==null||t.attemptAutoclose("infer-input-map-data-type-validate-data",this.id),{updated:u(o),added:u(d),removed:u(l),affected:u(p),self:e.dataType}}else if(((a=e.declaration)==null?void 0:a.id)===S.operation[Ke.Validate].inputs.dataToValidate.id){const{added:d,updated:o,removed:l,affected:p}=this.syncDataToValidateInputMapDataType(e,t);return t==null||t.attemptAutoclose("infer-input-map-data-type",this.id),{updated:u(o),added:u(d),removed:u(l),affected:u(p),self:e.dataType}}return{updated:[],added:[],removed:[],affected:[],self:null}}inferOutputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"infer-output-map-data-type-validate-data"))){var r;if(((r=e.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].outputs.outputEntity.id){const{added:a,updated:d,removed:o,affected:l}=this.syncOutputDataOutputMapDataType(e,t);return t==null||t.attemptAutoclose("infer-output-map-data-type-validate-data",this.id),{updated:u(d),added:u(a),removed:u(o),affected:u(l),self:e.dataType}}return{updated:[],added:[],removed:[],affected:[],self:null}}}class bJ extends qe{constructor(s){super(ul,s)}}class RJ extends qe{constructor(s){super(cl,s)}}class AJ extends qe{constructor(s){super(fl,s)}}class DJ extends qe{constructor(s){super(ks,s)}}class OJ extends qe{constructor(s){super(Fs,s)}}class PJ extends qe{constructor(s){super(Pa,s)}}function wJ(i){const s=[new wP(i),new OP(i),new PP(i),new TJ(i),new EJ(i),new IJ(i),new DJ(i),new bJ(i),new AJ(i),new RJ(i),new OJ(i),new PJ(i),new qe(ll,i),new qe(dl,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.operationDeclarations=s,s}class VP extends Yr{constructor(e){super(Ot,e);f(this,"initialData");f(this,"id",z.PERSISTED_ENTITY);f(this,"version","1");f(this,"name",z.PERSISTED_ENTITY);f(this,"description",Ot.description);f(this,"type",n.BuiltInBaseEntity);f(this,"abstract",Ot.abstract);f(this,"static",Ot.static);f(this,"properties",[]);f(this,"methods",[]);f(this,"abstractMethods",[]);f(this,"extends",[]);f(this,"errors",[]);f(this,"project");this.initialData=Ot,this.project=e,this.id=Ot.id,this.version=Ot.version,this.name=Ot.name,this.static=Ot.static,this.abstract=Ot.abstract,this.properties=this.initialData.properties.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.methods=this.initialData.methods.map(t=>{const r=V(t,this.project);return r.parent=this,r}),this.abstractMethods=this.initialData.abstractMethods.map(t=>{const r=V(t,this.project);return r.parent=this,r}),this.extends=this.initialData.extends.map(t=>V(t,this.project))}}function VJ(i){const s=[new VP(i),new Yr(ga,i),new Yr(gr,i),new Yr(so,i)];return s.forEach(e=>{i.subscribeBuiltInInstance(e)}),i.builtInBaseEntities=s,s}function CJ(i){const s=[new fr(ne,i),new fr(Kr,i),new fr(me,i),new fr(At,i),new fr(Xr,i),new fr(Br,i),new fr(Qr,i),new fr($n,i)];return s.forEach(e=>{i.subscribeBuiltInInstance(e)}),i.primitives=s,s}function BJ(i){const s=[new qe(lo,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.globalEventActionDescriptors=s,s}function _J(i){const s=[new qe(_a,i),new qe(mi,i),new qe(Ca,i),new qe(Sn,i),new qe(xn,i),new qe(Ks,i)];s.forEach(t=>{t.initChildren(null),i.subscribeBuiltInInstance(t)}),i.loopDeclarations=s;const e=[new qe(to,i),new qe(Ba,i),new qe(Qs,i),new qe(Pl,i),new qe(Vl,i),new qe(Xs,i)];return e.forEach(t=>{t.initChildren(null),i.subscribeBuiltInInstance(t)}),i.loopDeclarationsBodies=e,s}function MJ(i){const s=[new Si(uo,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.valueDescriptors=s,s}function gJ(i){const s=[new qe(an,i),new qe(Wn,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.operationDeclarations=s,s}const gn={},Xd={};async function NJ(i,s={}){const e={...ZA};return e.id=i.id,s.empty?{data:{id:i.id,type:n.Project,version:R.UUID.uuid(),createdAt:T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:e}}function Jc(i){const s=new R(i);return CJ(s),VJ(s),wJ(s),BJ(s),_J(s),MJ(s),gJ(s),Array.from(new Set([...s.getAllBuiltInIds(),...Wr()])).forEach(t=>{!s.builtInInstances[t]&&s.instances[t]&&(s.builtInInstances[t]=s.instances[t],delete s.instances[t])}),s}function Wc(i,s){return i.instancesList.filter(t=>T(t.createdAt).isAfter(T(s)||!!t.previousVersion))}function LJ(i,{enrich:s}={enrich:!0}){const e=new Map,t=Array.from(new Set([...i.getAllBuiltInIds(),...Wr()]));Object.keys(i.instances).forEach(p=>{if(t.includes(p)){e.set(p,p);return}const h=i.get(p);if(!Kd(h,{...i.instances,...i.builtInInstances}).every(E=>!t.includes(E))){e.set(p,p);return}e.set(p,R.UUID.uuid())});const r=T().toISOString(),a=i.toShallowJSON({seenEntityMaps:e});a.previousVersion=null,a.createdAt=r,a.version=R.UUID.uuid();const d=Jc(a),o=s?d.addChangeSet(new A(d,"",r,d)):null,l=new Bc(i);return l.visit(p=>{const h=p.toShallowJSON({seenEntityMaps:e});h.previousVersion=null,h.createdAt=r,h.version=R.UUID.uuid();const c=V(h,d);c.hydrateAncestors(),c.addSelfToProject(o),o==null||o.add(c,b.Added)}),s?(l.visit(p=>{const h=d.get(e.get(p.id));h&&h.afterAllChildrenInitialized(o)}),d.afterAllChildrenInitialized(o)):Wc(d,r).forEach(h=>{h.remove({ignoreUpstream:!0},null)}),d.instancesList.forEach(p=>{p.previousVersion=null}),o==null||o.close(),d}function CP(i,{enrich:s}={enrich:!0}){const e=Jc(i),t=T().toISOString(),r=s?e.addChangeSet(new A(e,"",t,e)):null;r&&(r.type=hc.Automatic);const a=new Bc(i);return a.visit(d=>{const o=V(d,e);o.hydrateAncestors(),o.addSelfToProject(r)}),s?(a.visit(d=>{const o=e.get(d.id);o&&o.afterAllChildrenInitialized(r)}),e.afterAllChildrenInitialized(r)):Wc(e,t).forEach(o=>{o.remove({ignoreUpstream:!0},null)}),r==null||r.close(),e}async function UJ(i,s={}){if(i.id&&gn[i.id])return gn[i.id];if(i.id&&Xd[i.id])return await Xd[i.id],gn[i.id];const e=NJ(i,s);i.id&&(Xd[i.id]=e);const t=await e;if(t.data){const r=CP(t.data);return gn[i.id]=r,i.id&&delete Xd[i.id],r}return null}function jJ(i){return gn[i.id]&&delete gn[i.id],null}const $J="test_primitive_entities_export";y.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=Pc,y.ALL_BUILT_IN_BASE_ENTITIES=CE,y.ALL_BUILT_IN_CONDITION_ENTITIES=kE,y.ALL_BUILT_IN_GLOBAL_EVENT_ENTITIES=qE,y.ALL_BUILT_IN_LOOP_BODY_ENTITIES=aT,y.ALL_BUILT_IN_LOOP_ENTITIES=nT,y.ALL_BUILT_IN_OPERATION_ENTITIES=m0,y.ALL_BUILT_IN_PRIMITIVE_ENTITIES=of,y.ALL_BUILT_IN_TOP_LEVEL_ENTITIES=zE,y.ALL_BUILT_IN_VALUE_DESCRIPTORS=YE,y.ActionDescriptorState=qe,y.ActionInputMapState=lq,y.ActionOutputMapState=cq,y.AppendToListOperationInputIds=hh,y.AppendToListOperationOutputIds=mh,y.ArgumentDeclarationDependencyField=tO,y.ArgumentDeclarationState=Fi,y.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=Rc,y.BUILT_IN_BASE_ENTITY_IDS=S,y.BUILT_IN_ENTITY_TYPES=hr,y.BaseCanvasDraggableState=pJ,y.BaseEntityNames=z,y.BaseState=uJ,y.BaseValueDescriptorIds=Gs,y.BreakStatementDependencyField=vc,y.BreakStatementState=Cn,y.BuiltInBaseEntityState=Yr,y.CACHED_PROJECTS_BY_ID=gn,y.CALLABLE_ENTITIES_EXPLANATION=Iq,y.CALLABLE_TYPES=Vr,y.CALLER_ENTITIES_EXPLANATION=sO,y.CALLER_TYPES=Cr,y.CALLS_UPDATE_EXPLANATION=ki,y.COMPARISON_CONDITIONS=SE,y.CONDITIONS=xE,y.CUSTOM_ENTITY_OPERATIONS=Nm,y.CallableEntityClass=fJ,y.CallerEntityClass=qc,y.ChangeSet=A,y.ChangeSetChangeCaptureType=hc,y.ChangeSetEntityChangeType=b,y.ChildEntityState=cJ,y.ComparisonOperatorTypes=pt,y.ConditionDependencyField=z1,y.ConditionState=Li,y.ContinueStatementDependencyField=mc,y.ContinueStatementState=$t,y.CreateNewInputIds=dm,y.CreateNewOutputIds=lm,y.DRAGGABLE_CALLABLE_TYPES=rl,y.DRAGGABLE_CALLER_TYPES=Kc,y.DRAGGABLE_ELEMENT_TYPES=$s,y.DRAGGABLE_EXECUTABLE_TYPES=NP,y.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=js,y.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES_WITH_OUTPUTS=tl,y.DataTypeCompatibilityTypes=Er,y.DataTypeDependencyField=q1,y.DataTypeParentChildRelation=Rt,y.DataTypeState=wn,y.DefinitionEntityDependencyField=bP,y.DefinitionEntityState=zi,y.EDITABLE_PERSISTANCE_REPOSITORY_DEFAULTS=dJ,y.ENTITIES_WITH_VALLUES_EXPLANATION=Ld,y.ENTITY_PERSISTANCE_OPTIONS_DEFAULTS=L,y.ENTITY_RECUSION_OPTIONS_DEFAULTS=Z,y.ENTITY_TYPES=LP,y.ENTITY_WITH_DECLARATION_TYPES=MP,y.ENTITY_WITH_LOGIC_SCOPE_TYPES=mt,y.ENTITY_WITH_NAMES_TYPES=Xc,y.ENTITY_WITH_PARENT_TYPES=BP,y.ENTITY_WITH_USER_MANAGED_DECLARATION_TYPES=zc,y.ENTITY_WITH_USER_MANAGED_SINGLE_IMPLEMENTS_TYPES=_P,y.ENTITY_WITH_VALUE_TYPES=Yc,y.ENTRY_POINT_ENTITIES_EXPLANATION=Ps,y.ENTRY_POINT_TYPES=at,y.EVENT_TYPES=jn,y.EXECUTABLE_TYPES=gP,y.EXECUTION_OPERATIONS=om,y.EntityAction=DP,y.EntityError=hn,y.EntityErrorSeverity=D,y.EntityGenerationError=P,y.EntityGenerationErrorCode=I,y.EntityInstanceErrorCode=q,y.EntityOperations=Ke,y.EntityType=n,y.EntityWithLogicScopeClass=vJ,y.EntityWithValueClass=mJ,y.EntryPointEntityClass=yJ,y.ExecutionOperations=He,y.ExecutionTerminationType=W1,y.FunctionCallDependencyField=mO,y.FunctionCallState=qi,y.FunctionDeclarationDependencyField=Z1,y.FunctionDeclarationState=Mi,y.GLOBAL_EVENT_DECLARATIONS=ZE,y.GetLastInListOperationInputIds=ih,y.GetLastInListOperationOutputIds=nh,y.GlobalEventNames=Hr,y.GlobalEventState=Vn,y.HTTPOperations=Ct,y.HTTP_OPERATIONS=y0,y.InputMapDependencyField=Q1,y.InputMapState=kr,y.InstalledProjectState=Gi,y.InternalCallDependencyField=X1,y.InternalCallState=Bn,y.JoinListOperationInputIds=Ay,y.JoinListOperationOutputIds=Dy,y.LIST_OPERATIONS=Ch,y.ListOperations=fe,y.LiteralValueDependencyField=rO,y.LiteralValueState=_n,y.LoopDependencyField=Y1,y.LoopState=Ni,y.LoopTypes=X,y.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Zi,y.NUMBER_OPERATIONS=jf,y.NumberOperations=Xe,y.OPERATION_DECLARATIONS=h0,y.OperationDependencyField=J1,y.OperationState=gi,y.OutputMapDependencyField=eO,y.OutputMapParentChildRelation=Un,y.OutputMapState=Zr,y.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=Ud,y.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=xi,y.PASS_THROUGH_CALLABLE_TYPES=nt,y.PASS_THROUGH_CALLABLE_TYPES_WITH_OUTPUTS=Hc,y.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=Oc,y.ParallelExecutionOperation=OP,y.PassThroughCallableEntityClass=hJ,y.PersistedEntity=VP,y.PersistedEntityMethods=sr,y.PrimitiveEntityState=fr,y.PrimitiveTypes=g,y.ProjectState=R,y.PropertyDependencyField=x1,y.PropertyState=Bi,y.READ_ONLY_ENTITY_PERSISTANCE_REPOSITORY=AP,y.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=bq,y.ReturnDeclarationDependencyField=k1,y.ReturnDeclarationState=rr,y.ReturnStatementDependencyField=_d,y.ReturnStatementState=_i,y.STANDALONE_CONDITIONS=ME,y.STRING_OPERATIONS=Ry,y.ScopeCompatibilityType=Hd,y.SearchDependencyField=K1,y.SearchState=$i,y.SequentialExecutionOperation=wP,y.SequentialExecutionOperationInputIds=Yh,y.SequentialExecutionOperationOutputIds=zh,y.SharedEntityErrorCode=j,y.SharedStateFunctionality=RP,y.SplitListOperationInputIds=Gy,y.SplitListOperationOutputIds=Fy,y.StandaloneOperatorTypes=yr,y.StringOperations=Ee,y.TERMINATION_TYPES=st,y.Traverser=Bc,y.USER_MANAGED_ENTITY_TYPES=Qc,y.UserManagedEntityStateTemplate=lJ,y.VALUE_READING_ENTITIES_EXPLANATION=Dc,y.VALUE_READING_TYPES=hi,y.VALUE_WRITING_ENTITIES_EXPLANATION=oO,y.VALUE_WRITING_TYPES=ht,y.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=Ac,y.VARIABLE_TYPES=Qe,y.ValueAutogenerationType=yt,y.ValueDescriptorDependencyField=iO,y.ValueDescriptorParentChildRelation=M,y.ValueDescriptorState=Si,y.ValueReadingEntityClass=yi,y.ValueWritingEntityClass=gs,y.VariableDeclarationDependencyField=H1,y.VariableDeclarationState=ji,y.VariableInputMapState=dq,y.VariableInstanceDependencyField=Tc,y.VariableInstanceState=Ui,y.VariableOutputMapState=pq,y.WaitOperation=PP,y.WaitOperationInputIds=Sh,y.WaitOperationOutputIds=xh,y.appendToListOperation=ks,y.appendToListOperationElementToAppendArgument=hl,y.appendToListOperationElementToAppendArgumentParentRef=Dh,y.appendToListOperationElementToAppendArgumentRef=Eh,y.appendToListOperationError=Vh,y.appendToListOperationErrorParentRef=wh,y.appendToListOperationListArgument=yl,y.appendToListOperationListArgumentParentRef=Ah,y.appendToListOperationListArgumentRef=vh,y.appendToListOperationListDataType=Th,y.appendToListOperationResultListDataType=Rh,y.appendToListOperationResultListReturn=Ph,y.appendToListOperationResultListReturnParentRef=Oh,y.appendToListOperationResultListReturnRef=bh,y.appendToListOperationSecondListDataType=Ih,y.asGenerationActionExample=qr,y.booleanPrototype=Kr,y.capitalizeFirstLetter=Wt,y.changeSetJSONRecordToUniqueIds=G7,y.checkAreDataTypesCompatible=Ir,y.checkAreDefinitionEntitiesCompatibleAsDataType=C1,y.checkArePropertiesCompatibleAsDataType=V1,y.checkHasMetadataChanged=dt,y.checkIsBranchDependentButNotDirectlyOnBranch=Vs,y.checkIsBranchDependentOnBranch=Bq,y.checkIsCallableEntityReachable=Ms,y.checkIsCanvasEntity=zq,y.checkIsDetachedBranch=hP,y.checkIsDetachedBranchShallow=kc,y.checkIsGlobalVariable=Jq,y.checkIsGloballyDeclared=xc,y.checkIsMethod=TP,y.checkIsNestedScope=zd,y.checkScopeCompatibility=_s,y.cloneProject=LJ,y.countedLoopActionDescriptor=_a,y.countedLoopActionDescriptorDynamicReturnDeclaration=Hv,y.countedLoopActionDescriptorDynamicReturnDeclarationParentRef=zv,y.countedLoopActionDescriptorStringArgumentDeclaration=Yv,y.countedLoopActionDescriptorStringArgumentDeclarationDataType=Jv,y.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValue=Zv,y.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValueParentRef=kv,y.countedLoopActionDescriptorStringArgumentDeclarationDataTypeParentRef=qv,y.countedLoopActionDescriptorStringArgumentDeclarationParentRef=Wv,y.countedLoopBodyActionDescriptor=to,y.countedLoopBodyActionDescriptorAnyDynamicArgument=tT,y.countedLoopBodyActionDescriptorAnyDynamicArgumentParentRef=eT,y.countedLoopBodyActionDescriptorAnyDynamicReturn=iT,y.countedLoopBodyActionDescriptorAnyDynamicReturnParentRef=rT,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Bl,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Xv,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Kv,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Qv,y.createDefinitionEntityFromJSONObject=Sd,y.createEntityError=ye,y.createNestedDataTypeForEntity=EO,y.createNewInstanceOperation=Xi,y.createNewInstanceOperationEntityToInstanciateArgument=vm,y.createNewInstanceOperationEntityToInstanciateArgumentRef=ym,y.createNewInstanceOperationEntityToInstanciateDataType=hm,y.createNewInstanceOperationError=bm,y.createNewInstanceOperationErrorParentRef=Im,y.createNewInstanceOperationNewEntityDataArgument=fm,y.createNewInstanceOperationNewEntityDataArgumentDataType=cm,y.createNewInstanceOperationNewEntityDataArgumentDataTypeParentRef=pm,y.createNewInstanceOperationNewEntityDataArgumentParentRef=um,y.createNewInstanceOperationOutputEntityDeclaration=Em,y.createNewInstanceOperationOutputEntityDeclarationParentRef=Tm,y.createNewInstanceOperationRef=mm,y.createSemanticId=S1,y.createStateFromGenerationTargetType=oJ,y.createStateFromType=lt,y.createStateFromTypeAndSubscribe=V,y.cronJobBuiltInBaseEntity=so,y.cronJobBuiltInBaseEntityExpressionProperty=wE,y.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=xP,y.cronJobBuiltInBaseEntityExpressionPropertyRef=OE,y.cronJobBuiltInBaseEntityRef=PE,y.cronJobTriggeredFunctionDeclarationBlueprint=Zl,y.cronJobTriggeredFunctionDeclarationBlueprintParentRef=AE,y.dataTypeCompatibilityToErrorExplanation=hO,y.datePrototype=Br,y.dateValueAutogenerationSchema=ip,y.definitionEntityToZodSchema=pI,y.deletePersistedEntityMethod=kl,y.deletePersistedEntityMethodParentRef=dE,y.deleteRootProject=jJ,y.endpointBuiltInBaseEntity=ga,y.endpointBuiltInBaseEntityRef=lT,y.endpointBuiltInBaseEntityRefFour=ZT,y.endpointBuiltInBaseEntityRefThree=TT,y.endpointBuiltInBaseEntityRefTwo=yT,y.endpointBuiltInCorsProperty=uT,y.endpointBuiltInCorsPropertyDataType=dT,y.endpointBuiltInCorsPropertyDataTypeRef=sT,y.endpointBuiltInCorsPropertyRef=oT,y.endpointBuiltInMethodProperty=Ml,y.endpointBuiltInMethodPropertyDataType=vT,y.endpointBuiltInMethodPropertyDataTypeRef=hT,y.endpointBuiltInMethodPropertyRef=mT,y.endpointBuiltInPathProperty=_l,y.endpointBuiltInPathPropertyDataType=fT,y.endpointBuiltInPathPropertyDataTypeRef=pT,y.endpointBuiltInPathPropertyRef=cT,y.endpointPathParamsArgumentDeclaration=Nl,y.endpointPathParamsArgumentDeclarationRef=VT,y.endpointPathParamsVariableDataType=CT,y.endpointPathParamsVariableDataTypeRef=wT,y.endpointReachedTriggerActionDescriptor=Fl,y.endpointReachedTriggerActionDescriptorRef=BT,y.endpointReachedTriggerActionDescriptorRefFour=gT,y.endpointReachedTriggerActionDescriptorRefThree=MT,y.endpointReachedTriggerActionDescriptorRefTwo=_T,y.endpointRequestBodyArgumentDeclaration=Ul,y.endpointRequestBodyArgumentDeclarationRef=RT,y.endpointRequestBodyVariableDataType=AT,y.endpointRequestHeadersArgumentDeclaration=gl,y.endpointRequestHeadersArgumentDeclarationRef=IT,y.endpointRequestHeadersVariableDataType=bT,y.endpointRequestHeadersVariableDataTypeRef=ET,y.endpointRequestQueryParamsArgumentDeclaration=Ll,y.endpointRequestQueryParamsArgumentDeclarationRef=OT,y.endpointRequestQueryParamsVariableDataType=PT,y.endpointRequestQueryParamsVariableDataTypeRef=DT,y.endpointResponseBodyDataType=xT,y.endpointResponseBodyReturnDeclaration=Gl,y.endpointResponseBodyReturnDeclarationRef=ST,y.endpointResponseCodeDataType=LT,y.endpointResponseCodeReturnDeclaration=jl,y.endpointResponseCodeReturnDeclarationRef=NT,y.endpointResponseHeadersDataType=GT,y.endpointResponseHeadersDataTypeRef=jT,y.endpointResponseHeadersReturnDeclaration=$l,y.endpointResponseHeadersReturnDeclarationRef=$T,y.endpointReturnStatementRef=UT,y.endpointReturnStatementRefThree=kT,y.endpointReturnStatementRefTwo=FT,y.enrichFromKnownEntities=Cs,y.enumOptionsProperty=sf,y.enumOptionsPropertyDataType=nf,y.enumOptionsPropertyDataTypeRef=tf,y.enumOptionsPropertyRef=rf,y.enumPrototype=Xr,y.enumPrototypeRef=af,y.executionBuiltInBaseEntity=oo,y.executionBuiltInEntityAbortMethod=ql,y.executionBuiltInEntityAbortMethodParentRef=VE,y.filterOutDuplicateEntities=u,y.filterOutDuplicateErrors=q9,y.findEntityFromKeys=_c,y.findReferenceToSelfInList=NO,y.findReferencesToSelfInProject=Gq,y.flattenActionDescriptor=LO,y.flattenArgumentDeclaration=UO,y.flattenBreakStatement=jO,y.flattenBuiltInBaseEntity=$O,y.flattenCalls=Jr,y.flattenCanvasAncestorsUntil=xd,y.flattenCondition=GO,y.flattenContinueStatement=FO,y.flattenDataType=xO,y.flattenDefinitionEntity=SO,y.flattenDefinitionEntityExtensionAndImplementationTypes=Gc,y.flattenDefinitionEntityExtensionTypes=Yd,y.flattenDefinitionEntityExtensions=jc,y.flattenDefinitionEntityImplementations=$c,y.flattenDefinitionEntityImplementionTypes=Wd,y.flattenDerivedCanvasEntities=ir,y.flattenDetachedBranch=vP,y.flattenElementCalls=it,y.flattenElementCallsOnTheSameScope=$q,y.flattenEntity=N,y.flattenFunctionCall=kO,y.flattenFunctionDeclaration=ZO,y.flattenGlobalEvent=qO,y.flattenInputMap=JO,y.flattenInstalledProject=WO,y.flattenInternalCall=YO,y.flattenLiteralValue=zO,y.flattenLoop=HO,y.flattenOperation=KO,y.flattenOutputMap=XO,y.flattenPrimitiveEntity=QO,y.flattenProject=eP,y.flattenProjectElements=gO,y.flattenProperty=tP,y.flattenRelatedCanvasElementsOnTheLeft=fP,y.flattenRelatedCanvasElementsOnTheRight=cP,y.flattenReturnDeclaration=rP,y.flattenReturnStatement=iP,y.flattenSearch=nP,y.flattenValueDescriptor=aP,y.flattenVariableDeclaration=sP,y.flattenVariableInstance=oP,y.flattenVariableReads=MO,y.flattenVariableWrites=_O,y.flattenVariables=We,y.fromChangeSetToRecordChangeSet=iJ,y.fromZodParseToEntityGenerationErrors=Ec,y.generate=JV,y.generateActionExample=Rq,y.generateExecutionDataType=C7,y.generateIdFromStrategy=ct,y.generateMutablePropertiesExplanation=Md,y.generateRandomBoolean=$I,y.generateRandomDate=hI,y.generateRandomDateAfter=cI,y.generateRandomDateBefore=fI,y.generateRandomDateBetweenRange=yI,y.generateRandomNumber=gI,y.generateRandomNumberAfter=BI,y.generateRandomNumberBefore=_I,y.generateRandomNumberBetweenRange=MI,y.generateRandomText=jI,y.generateRandomTextAfter=NI,y.generateRandomTextBefore=LI,y.generateRandomTextBetweenRange=UI,y.generateUniqueUUID=CI,y.getAllActionDescriptorsForConditions=Gd,y.getAllActionDescriptorsForGlobalEvents=jd,y.getAllActionDescriptorsForLoops=$d,y.getAllActionDescriptorsForOperations=Pq,y.getAllBuiltInEntityIds=Wr,y.getAllGloballyDeclaredFunctionDeclarationsExplanation=cO,y.getBaseBuiltInEntities=Wi,y.getBaseSchemaBasedOnType=nO,y.getBuiltInEntityOwner=Yi,y.getCallableEntityReferenceSchema=Dt,y.getCallableEntityTypeSchema=mD,y.getCalledBy=cr,y.getCallerEntityReferenceSchema=z3,y.getCallerEntityTypeSchema=Y3,y.getCalls=Nc,y.getCanvasEntitiesDerivedFromInternalCalls=pP,y.getCanvasEntitiesDerivedFromWrites=Ra,y.getCanvasEntityDerivedFromValueReadingEntity=Jd,y.getCanvasEntityDerivedFromValueReadingEntityFromTransfer=uP,y.getCanvasEntityReferenceSchema=c5,y.getCanvasEntityTypeSchema=p5,y.getChildrenEntityWithValues=Mq,y.getColumnProperties=eJ,y.getCommonAncestor=gc,y.getCommonChildren=IO,y.getDatabaseEntities=Xq,y.getDatabaseEntity=tJ,y.getDeclaration=Pn,y.getDeepestScope=IP,y.getDefinitionEntityExtends=Aa,y.getDraggableCallableEntityReferenceSchema=TD,y.getDraggableCallableEntityTypeSchema=vD,y.getDraggableCallerEntityReferenceSchema=K3,y.getDraggableCallerEntityTypeSchema=H3,y.getDraggableExecutableEntityReferenceSchema=t5,y.getDraggableExecutableEntityTypeSchema=e5,y.getDraggablePassThroughCallableEntityReferenceSchema=vd,y.getDraggablePassThroughCallableEntityTypeSchema=md,y.getDraggablePlayableEntityReferenceSchema=s5,y.getDraggablePlayableEntityTypeSchema=a5,y.getEntitiesCreatedSinceInitialization=Wc,y.getEntityArgumentDeclarations=Uc,y.getEntityInputMaps=dP,y.getEntityOutputMaps=kq,y.getEntityReferenceSchema=u5,y.getEntityReturnDeclarations=lP,y.getEntityTypeSchema=l5,y.getEntityWithLogicScopeReferenceSchema=ui,y.getEntityWithLogicScopeTypeSchema=r5,y.getEntityWithValueReferenceSchema=hD,y.getEntityWithValueTypeSchema=W3,y.getEntryPointEntityReferenceSchema=bt,y.getEntryPointEntityTypeSchema=wi,y.getEventEntityReferenceSchema=yd,y.getEventEntityTypeSchema=fd,y.getExecutableEntityReferenceSchema=Q3,y.getExecutableEntityTypeSchema=X3,y.getExtendedBuiltInEntity=Zq,y.getExtendedDefinitionEntity=Fc,y.getGenerationTargetSchemaBasedOnType=aO,y.getHeadIfPartOfDetachedBranch=mP,y.getHighestScope=EP,y.getImplementedBuiltInEntity=qq,y.getIsInteractive=Sc,y.getLastInListOperation=fl,y.getLastInListOperationError=yh,y.getLastInListOperationErrorParentRef=fh,y.getLastInListOperationInputListArgument=uh,y.getLastInListOperationInputListArgumentParentRef=lh,y.getLastInListOperationInputListArgumentRef=ah,y.getLastInListOperationInputListDataType=sh,y.getLastInListOperationOutputElementDataType=dh,y.getLastInListOperationOutputElementReturn=ch,y.getLastInListOperationOutputElementReturnParentRef=ph,y.getLastInListOperationOutputElementReturnRef=oh,y.getLinkedEntitiesFromArgumentDeclaration=jq,y.getLowestPersistedEntityImplementation=yP,y.getParentCallableEntity=bO,y.getParentCallerEntity=AO,y.getParentCanvasEntities=Yt,y.getParentCanvasEntity=wt,y.getParentCanvasEntityFromTransfer=kd,y.getParentEntryPoint=_q,y.getParentPassthroughCallableEntity=RO,y.getPassThroughCallableEntityReferenceSchema=et,y.getPassThroughCallableEntityTypeSchema=hd,y.getPeristedEntities=Kq,y.getPlayableEntityReferenceSchema=n5,y.getPlayableEntityTypeSchema=i5,y.getProject=UJ,y.getPrototypeByType=Bs,y.getRecusriveParentsIds=Kd,y.getReferenceEntityId=B,y.getReferencedEntitiesStateOrErrors=Nd,y.getReferencedEntityStateOrErrors=Ic,y.getReferencedIds=qd,y.getRelatedCanvasElementsOnTheLeft=Mn,y.getRelatedCanvasElementsOnTheLeftFromTransfer=Fq,y.getRelatedCanvasElementsOnTheRight=Ji,y.getRootEntryPointScopeOwner=Zc,y.getScopeOwner=zt,y.getStateClassFromType=rJ,y.getTerminationReferenceSchema=d5,y.getTerminationTypeSchema=o5,y.getUsedArgFromDeclaration=Sq,y.getUsedReturnFromDeclaration=xq,y.getValueReadingEntityReferenceSchema=yD,y.getValueReadingEntityTypeSchema=li,y.getValueWritingEntityReferenceSchema=J3,y.getValueWritingEntityTypeSchema=ms,y.getVariableFromInputMapping=OO,y.getVariableFromReturnVariablePointer=VO,y.getVariableReferenceSchema=Pi,y.getVariableTypeSchema=In,y.getVariablesFromArgumentDeclarations=Zd,y.getVariablesFromInputMaps=PO,y.getVariablesFromOutputMapping=CO,y.getVariablesFromOutputMaps=BO,y.getVariablesFromReturnDeclarations=wO,y.getVariablesInSameOrHigherScope=dc,y.getWrites=Lc,y.groupCallsBasedOnParallelizableExecution=Nq,y.handleAfterEntityImplementationSideEffects=TO,y.handleBeforeEntityImplementationSideEffects=vO,y.httpRequestBodyArgument=Ws,y.httpRequestBodyArgumentRef=Wm,y.httpRequestBodyDataType=Ym,y.httpRequestHeadersArgument=Js,y.httpRequestHeadersArgumentRef=qm,y.httpRequestHeadersDataType=Jm,y.httpRequestMethodArgument=Zs,y.httpRequestMethodArgumentRef=km,y.httpRequestMethodDataType=Zm,y.httpRequestMethodDataTypeRef=Sm,y.httpRequestOperation=wa,y.httpRequestOperationErrorValueDescriptor=bl,y.httpRequestOperationErrorValueDescriptorDatatype=f0,y.httpRequestOperationErrorValueDescriptorRef=c0,y.httpRequestOperationRef=d0,y.httpRequestOperationRefEight=u0,y.httpRequestOperationRefFive=s0,y.httpRequestOperationRefFour=a0,y.httpRequestOperationRefNine=p0,y.httpRequestOperationRefSeven=l0,y.httpRequestOperationRefSix=o0,y.httpRequestOperationRefThree=n0,y.httpRequestOperationRefTwo=i0,y.httpRequestQueryParamsArgument=Il,y.httpRequestQueryParamsArgumentRef=Gm,y.httpRequestQueryParamsDataType=Fm,y.httpRequestVariableURLArgument=qs,y.httpRequestVariableURLArgumentRef=jm,y.httpRequestVariableURLDataType=$m,y.httpRequestVariableURLDataTypeRef=Lm,y.httpResponseBodyReturnDataType=r0,y.httpResponseBodyReturnDataTypeRef=e0,y.httpResponseBodyReturnReturn=Hs,y.httpResponseBodyReturnReturnRef=t0,y.httpResponseCodeDataType=Hm,y.httpResponseCodeReturn=Ys,y.httpResponseCodeReturnRef=zm,y.httpResponseHeadersDataType=Qm,y.httpResponseHeadersDataTypeRef=Km,y.httpResponseHeadersReturn=zs,y.httpResponseHeadersReturnRef=Xm,y.implement=Fd,y.inferArgumentDeclarationDataType=B1,y.inferDataType=xr,y.inferInputMapDataType=ac,y.inferOutputMapDataType=oc,y.inferPropertyDataType=g1,y.inferReturnDeclarationDataType=sc,y.inferValueDescriptorDataType=N1,y.inferVariableDeclarationDataType=M1,y.inferVariableInstanceDataType=_1,y.initBaseProjectEntity=Jc,y.initProject=CP,y.isPromise=Cc,y.iterateOverListActionDescriptorListArgumentDeclaration=W0,y.iterateOverListActionDescriptorListArgumentDeclarationDataType=q0,y.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=Z0,y.iterateOverListActionDescriptorListArgumentDeclarationParentRef=J0,y.iterateOverListLoopActionDescriptor=mi,y.iterateOverListLoopActionDescriptorDynamicReturnDeclaration=z0,y.iterateOverListLoopActionDescriptorDynamicReturnDeclarationParentRef=Y0,y.iterateOverListLoopBodyActionDescriptor=Ba,y.iterateOverListLoopBodyActionDescriptorAnyDynamicArgument=nv,y.iterateOverListLoopBodyActionDescriptorAnyDynamicArgumentParentRef=iv,y.iterateOverListLoopBodyActionDescriptorAnyDynamicReturn=sv,y.iterateOverListLoopBodyActionDescriptorAnyDynamicReturnParentRef=av,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclaration=eo,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=K0,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=H0,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=X0,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclaration=rv,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=ev,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Q0,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=tv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclaration=pv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataType=lv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataTypeParentRef=dv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationParentRef=uv,y.iterateOverObjectKeysLoopActionDescriptor=Sn,y.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclaration=fv,y.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclarationParentRef=cv,y.iterateOverObjectKeysLoopBodyActionDescriptor=Pl,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgument=Rv,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgumentParentRef=bv,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturn=Dv,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturnParentRef=Av,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Ol,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=hv,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=yv,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=mv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Iv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Tv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=vv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Ev,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclaration=Cv,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataType=wv,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataTypeParentRef=Pv,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationParentRef=Vv,y.iterateOverObjectValuesLoopActionDescriptor=xn,y.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclaration=_v,y.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclarationParentRef=Bv,y.iterateOverObjectValuesLoopBodyActionDescriptor=Vl,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgument=Fv,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgumentParentRef=Gv,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturn=xv,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturnParentRef=Sv,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclaration=wl,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=gv,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=Mv,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Nv,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclaration=$v,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Uv,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Lv,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=jv,y.iterateOverStringActionDescriptorDynamicReturnDeclaration=M0,y.iterateOverStringActionDescriptorDynamicReturnDeclarationParentRef=_0,y.iterateOverStringActionDescriptorStringArgumentDeclaration=B0,y.iterateOverStringActionDescriptorStringArgumentDeclarationDataType=V0,y.iterateOverStringActionDescriptorStringArgumentDeclarationDataTypeParentRef=w0,y.iterateOverStringActionDescriptorStringArgumentDeclarationParentRef=C0,y.iterateOverStringLoopActionDescriptor=Ca,y.iterateOverStringLoopBodyActionDescriptor=Qs,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgument=F0,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgumentParentRef=G0,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturn=x0,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturnParentRef=S0,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Al,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=N0,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=g0,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=L0,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Dl,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=j0,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=U0,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=$0,y.joinListOperation=ul,y.joinListOperationError=$y,y.joinListOperationErrorParentRef=jy,y.joinListOperationFirstListArgument=My,y.joinListOperationFirstListArgumentParentRef=_y,y.joinListOperationFirstListArgumentRef=Oy,y.joinListOperationFirstListDataType=Py,y.joinListOperationResultListDataType=By,y.joinListOperationResultListReturn=Uy,y.joinListOperationResultListReturnParentRef=Ly,y.joinListOperationResultListReturnRef=Cy,y.joinListOperationSecondListArgument=Ny,y.joinListOperationSecondListArgumentParentRef=gy,y.joinListOperationSecondListArgumentRef=wy,y.joinListOperationSecondListDataType=Vy,y.joinListWithLastSeparator=ie,y.joinStringsOperation=Pa,y.joinStringsOperationDynamicStringArgument=ny,y.joinStringsOperationDynamicStringArgumentParentRef=iy,y.joinStringsOperationDynamicStringArgumentRef=ty,y.joinStringsOperationDynamicStringDataType=ry,y.joinStringsOperationError=ey,y.joinStringsOperationErrorParentRef=Qf,y.joinStringsOperationFirstStringArgument=Ss,y.joinStringsOperationFirstStringArgumentParentRef=Zf,y.joinStringsOperationFirstStringArgumentRef=$f,y.joinStringsOperationFirstStringDataType=Gf,y.joinStringsOperationResultStringDataType=kf,y.joinStringsOperationResultStringReturn=Oa,y.joinStringsOperationResultStringReturnParentRef=Xf,y.joinStringsOperationResultStringReturnRef=xf,y.joinStringsOperationSecondStringArgument=xs,y.joinStringsOperationSecondStringArgumentParentRef=Kf,y.joinStringsOperationSecondStringArgumentRef=Ff,y.joinStringsOperationSecondStringDataType=Sf,y.joinStringsOperationSeparatorStringArgument=Hf,y.joinStringsOperationSeparatorStringArgumentParentRef=zf,y.joinStringsOperationSeparatorStringArgumentRef=qf,y.joinStringsOperationSeparatorStringDataType=Yf,y.joinStringsOperationSeparatorStringDataTypeDefaultValue=Wf,y.joinStringsOperationSeparatorStringDataTypeDefaultValueParentRef=Jf,y.keyValuePrototype=$n,y.lowercaseFirstLetter=Od,y.manualFlowActionDescriptorDeclarationArgumentDeclaration=Rl,y.manualFlowActionDescriptorDeclarationArgumentDeclarationDataType=I0,y.manualFlowActionDescriptorDeclarationArgumentDeclarationDataTypeParentRef=E0,y.manualFlowActionDescriptorDeclarationArgumentDeclarationParentRef=b0,y.manualFlowLoopActionDescriptor=Ks,y.manualFlowLoopActionDescriptorDynamicReturnDeclaration=T0,y.manualFlowLoopActionDescriptorDynamicReturnDeclarationParentRef=v0,y.manualFlowLoopBodyActionDescriptor=Xs,y.manualFlowLoopBodyActionDescriptorAnyDynamicArgument=A0,y.manualFlowLoopBodyActionDescriptorAnyDynamicArgumentParentRef=R0,y.manualFlowLoopBodyActionDescriptorAnyDynamicReturn=O0,y.manualFlowLoopBodyActionDescriptorAnyDynamicReturnParentRef=D0,y.mapActionDescriptorToTypeItRepresents=Hq,y.mergeEntityErrorsList=J9,y.mergeListOfEntities=Wq,y.methodDefaultValue=xm,y.mockClientProject=ZA,y.moreThanOrEqualCondition=Wn,y.moreThanOrEqualConditionLeftHandArgument=UE,y.moreThanOrEqualConditionLeftHandArgumentDataType=NE,y.moreThanOrEqualConditionLeftHandArgumentDataTypeParentRef=gE,y.moreThanOrEqualConditionLeftHandArgumentParentRef=LE,y.moreThanOrEqualConditionRightHandArgument=FE,y.moreThanOrEqualConditionRightHandArgumentDataType=$E,y.moreThanOrEqualConditionRightHandArgumentDataTypeParentRef=jE,y.moreThanOrEqualConditionRightHandArgumentParentRef=GE,y.notEmptyCondition=an,y.notEmptyConditionArgument=_E,y.notEmptyConditionRef=BE,y.nullPrototype=ef,y.numberAdditionOperation=Fs,y.numberAdditionOperationDynamicSummandArgument=If,y.numberAdditionOperationDynamicSummandArgumentType=Ef,y.numberAdditionOperationDynamicSummandArgumentTypeParentRef=Tf,y.numberAdditionOperationError=vf,y.numberAdditionOperationErrorParentRef=mf,y.numberAdditionOperationFirstNumberArgument=il,y.numberAdditionOperationFirstNumberArgumentRef=df,y.numberAdditionOperationFirstNumberDataType=lf,y.numberAdditionOperationRef=yf,y.numberAdditionOperationRefThree=al,y.numberAdditionOperationRefTwo=hf,y.numberAdditionOperationResultNumberDataType=ff,y.numberAdditionOperationResultNumberReturn=sl,y.numberAdditionOperationResultNumberReturnRef=cf,y.numberAdditionOperationSecondNumberArgument=nl,y.numberAdditionOperationSecondNumberArgumentRef=uf,y.numberAdditionOperationSecondNumberDataType=pf,y.numberPrototype=me,y.numberSubtractionOperation=dl,y.numberSubtractionOperationDynamicSubtrahendArgument=Uf,y.numberSubtractionOperationDynamicSubtrahendArgumentType=Lf,y.numberSubtractionOperationDynamicSubtrahendArgumentTypeParentRef=Nf,y.numberSubtractionOperationError=gf,y.numberSubtractionOperationErrorParentRef=Mf,y.numberSubtractionOperationFirstNumberArgument=wf,y.numberSubtractionOperationFirstNumberArgumentRef=bf,y.numberSubtractionOperationFirstNumberDataType=Rf,y.numberSubtractionOperationRef=ol,y.numberSubtractionOperationRefThree=Bf,y.numberSubtractionOperationRefTwo=Vf,y.numberSubtractionOperationResultNumberDataType=Pf,y.numberSubtractionOperationResultNumberReturn=_f,y.numberSubtractionOperationResultNumberReturnRef=Of,y.numberSubtractionOperationSecondNumberArgument=Cf,y.numberSubtractionOperationSecondNumberArgumentRef=Af,y.numberSubtractionOperationSecondNumberDataType=Df,y.numberValueAutogenerationSchema=rp,y.parallelExecutionOperation=Rr,y.parallelExecutionOperationError=Fh,y.parallelExecutionOperationErrorParentRef=Gh,y.parallelExecutionOperationListOfExecutionResultsDataType=Uh,y.parallelExecutionOperationListOfExecutionResultsReturn=vl,y.parallelExecutionOperationListOfExecutionResultsReturnRef=Lh,y.parallelExecutionOperationListOfFunctionsArgument=ml,y.parallelExecutionOperationListOfFunctionsArgumentDatatype=Nh,y.parallelExecutionOperationListOfFunctionsArgumentRef=gh,y.parallelExecutionOperationListOfFunctionsBlueprint=Mh,y.parallelExecutionOperationListOfFunctionsBlueprintDynamicInput=_h,y.parallelExecutionOperationListOfFunctionsBlueprintDynamicOutput=Bh,y.parallelExecutionOperationRef=jh,y.parallelExecutionOperationRefThree=$h,y.persistedBuiltInBaseEntity=Ot,y.persistedBuiltInBaseEntityDatabaseProperty=Zn,y.persistedBuiltInBaseEntityDatabasePropertyDataType=pE,y.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=FP,y.persistedBuiltInBaseEntityDatabasePropertyParentRef=cE,y.persistedBuiltInBaseEntityDatabasePropertyRef=uE,y.persistedBuiltInBaseEntityPrimaryKeyProperty=qn,y.persistedBuiltInBaseEntityPrimaryKeyPropertyDataType=IE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOption=yE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOptionParentRef=fE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyParentRef=bE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyRef=EE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOption=mE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOptionParentRef=hE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOption=TE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOptionParentRef=vE,y.processOutputGlobalValueDescriptorDataType=WE,y.processOutputGlobalValueDescriptorReturn=uo,y.processOutputGlobalValueDescriptorReturnRef=JE,y.projectPublicationCompletedGlobalEvent=lo,y.propertyToZodSchema=uI,y.relationalDatabaseBuiltInBaseEntity=gr,y.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=xl,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataType=sE,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=aE,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=oE,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=nE,y.relationalDatabaseBuiltInBaseEntityDefaultProperty=Sl,y.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataType=iE,y.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=tE,y.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=rE,y.relationalDatabaseBuiltInBaseEntityIdentifierProperty=ro,y.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataType=WT,y.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=qT,y.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=JT,y.relationalDatabaseBuiltInBaseEntityMinSizeProperty=ao,y.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataType=eE,y.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=XT,y.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=QT,y.relationalDatabaseBuiltInBaseEntityPasswordProperty=no,y.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataType=KT,y.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=GP,y.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=HT,y.relationalDatabaseBuiltInBaseEntityRef=kn,y.relationalDatabaseBuiltInBaseEntityUsernameProperty=io,y.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataType=zT,y.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=$P,y.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=YT,y.resolveActionDescriptorName=F1,y.resolveBaseEntityName=U1,y.resolveBuiltInBaseEntityDataTypeLabel=j1,y.resolveClonedEntityProject=ft,y.resolveConditionOperatorLabel=Cd,y.resolveDataType=Pd,y.resolveDataTypeEntityOrNestedChildrenFromLiteralValue=Mc,y.resolveDataTypeLabel=Vd,y.resolveDefinitionEntityDataTypeLabel=N7,y.resolveEntityDataTypeLabel=g7,y.resolveEntityName=G,y.resolveFirstCallsSecond=Lq,y.resolveFirstWritesSecond=Uq,y.resolvePrimaryKeyProperty=Qq,y.resolvePrimitiveEntityName=G1,y.resolveSearchName=$1,y.resolveVariableScope=B7,y.sequentialExecutionOperation=ti,y.sequentialExecutionOperationError=sm,y.sequentialExecutionOperationErrorParentRef=am,y.sequentialExecutionOperationListOfExecutionResultsDataType=rm,y.sequentialExecutionOperationListOfExecutionResultsReturn=El,y.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=nm,y.sequentialExecutionOperationListOfExecutionResultsReturnRef=tm,y.sequentialExecutionOperationListOfFunctionsArgument=Tl,y.sequentialExecutionOperationListOfFunctionsArgumentDatatype=em,y.sequentialExecutionOperationListOfFunctionsArgumentParentRef=im,y.sequentialExecutionOperationListOfFunctionsArgumentRef=Qh,y.sequentialExecutionOperationListOfFunctionsBlueprint=Xh,y.sequentialExecutionOperationListOfFunctionsBlueprintDynamicInput=Kh,y.sequentialExecutionOperationListOfFunctionsBlueprintDynamicOutput=Hh,y.softDeletePersistedEntityMethod=SP,y.softDeletePersistedEntityMethodParentRef=RE,y.sortCallsBasedOnExecutionDependencies=DO,y.sortChildrenEntitiesBasedOnExecutionDependencies=gq,y.splitListOperation=cl,y.splitListOperationError=rh,y.splitListOperationErrorParentRef=th,y.splitListOperationFirstOutputListDataType=qy,y.splitListOperationFirstOutputListReturn=Ky,y.splitListOperationFirstOutputListReturnParentRef=Hy,y.splitListOperationFirstOutputListReturnRef=pl,y.splitListOperationInputListArgument=Wy,y.splitListOperationInputListArgumentParentRef=Jy,y.splitListOperationInputListArgumentRef=Sy,y.splitListOperationInputListDataType=xy,y.splitListOperationSecondOutputListDataType=Xy,y.splitListOperationSecondOutputListReturn=eh,y.splitListOperationSecondOutputListReturnParentRef=Qy,y.splitListOperationSplitIndexArgument=zy,y.splitListOperationSplitIndexArgumentParentRef=Yy,y.splitListOperationSplitIndexArgumentRef=ky,y.splitListOperationSplitIndexDataType=Zy,y.splitStringOperation=ll,y.splitStringOperationError=by,y.splitStringOperationErrorParentRef=Iy,y.splitStringOperationFirstPartResultStringDataType=uy,y.splitStringOperationFirstPartResultStringReturn=Ey,y.splitStringOperationFirstPartResultStringReturnParentRef=Ty,y.splitStringOperationFirstPartResultStringReturnRef=ly,y.splitStringOperationIndexArgument=my,y.splitStringOperationIndexArgumentParentRef=hy,y.splitStringOperationIndexArgumentRef=oy,y.splitStringOperationIndexDataType=dy,y.splitStringOperationSecondPartResultStringDataType=cy,y.splitStringOperationSecondPartResultStringReturn=UP,y.splitStringOperationSecondPartResultStringReturnParentRef=vy,y.splitStringOperationSecondPartResultStringReturnRef=py,y.splitStringOperationStringArgument=yy,y.splitStringOperationStringArgumentParentRef=fy,y.splitStringOperationStringArgumentRef=ay,y.splitStringOperationStringDataType=sy,y.stringPrototype=ne,y.stringValueAutogenerationSchema=tp,y.suggestNewIdForEntity=yc,y.test_primitive_entities_export=$J,y.toCamelCase=_7,y.toEntityState=nr,y.toKebabCase=L1,y.toLowerCaseKebabCase=wd,y.toPascalCase=M7,y.untypedDataPrototype=At,y.updateErrorsList=Ye,y.updateValueReader=Yq,y.urlDefaultValue=Um,y.uuidPrototype=Qr,y.validateArgumentDeclarationName=cc,y.validateCalledByErrorIdInAction=Dq,y.validateCalledByIdInAction=Aq,y.validateCallers=pO,y.validateConditionEntityDeclaration=wq,y.validateDataOperation=Qi,y.validateDataOperationDataToValidateArgument=Om,y.validateDataOperationDataToValidateArgumentParentRef=Dm,y.validateDataOperationDataToValidateArgumentRef=Rm,y.validateDataOperationDataToValidateDataType=Am,y.validateDataOperationEntityToMatchTypeArgument=Cm,y.validateDataOperationEntityToMatchTypeArgumentParentRef=Vm,y.validateDataOperationEntityToMatchTypeArgumentRef=Pm,y.validateDataOperationEntityToMatchTypeDataType=wm,y.validateDataOperationError=gm,y.validateDataOperationErrorParentRef=Mm,y.validateDataOperationOutputEntityDeclaration=_m,y.validateDataOperationOutputEntityDeclarationParentRef=Bm,y.validateDefinitionEntityName=Bd,y.validateEntryCaller=uO,y.validateErrorCaller=lO,y.validateFunctionCallDeclaration=fO,y.validateFunctionDeclarationName=lc,y.validateGeneratedEntityParentIsNotBuiltInEntity=Eq,y.validateGeneration=vq,y.validateGenerationTarget=ot,y.validateGenerationUpdate=Tq,y.validateLoopEntityDeclaration=Vq,y.validateName=L7,y.validateOperationEntityDeclaration=yO,y.validatePropertyName=pc,y.validateReachability=fi,y.validateReadsValueInActionPayload=Oq,y.validateReferenceObject=gd,y.validateReferenceToOne=bc,y.validateReferences=Et,y.validateReturnDeclarationName=fc,y.validateSuccessCaller=dO,y.validateValueReaderGenerationUpdate=ws,y.validateValueWritter=wc,y.validateVariableDeclarationName=uc,y.validateVariableInternalCallUse=Vc,y.valueAutogenerationCurrentDateAndTimeSchema=WA,y.valueAutogenerationGenericSchema=Xo,y.valueAutogenerationOptions=np,y.valueAutogenerationOptionsSchema=JA,y.valueAutogenerationRandomBooleanSchema=ep,y.valueAutogenerationRandomDateBetweenSchema=rD,y.valueAutogenerationRandomDateFromSchema=eD,y.valueAutogenerationRandomDateSchema=td,y.valueAutogenerationRandomDateUntilSchema=tD,y.valueAutogenerationRandomNumberBetweenSchema=HA,y.valueAutogenerationRandomNumberFromSchema=YA,y.valueAutogenerationRandomNumberSchema=Qo,y.valueAutogenerationRandomNumberUntilSchema=zA,y.valueAutogenerationRandomSchema=ls,y.valueAutogenerationRandomTextBetweenSchema=QA,y.valueAutogenerationRandomTextFromSchema=KA,y.valueAutogenerationRandomTextSchema=ed,y.valueAutogenerationRandomTextUntilSchema=XA,y.valueAutogenerationRangeValueTypesSchema=ds,y.valueAutogenerationUniqueSchema=Qu,y.waitOperation=Ft,y.waitOperationMillisecondsNumberArgument=Ki,y.waitOperationMillisecondsNumberArgumentRef=kh,y.waitOperationMillisecondsNumberDataType=Zh,y.waitOperationOperationError=Wh,y.waitOperationOperationErrorParentRef=Jh,y.waitOperationRef=qh,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|
|
408
|
+
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 allBasePropertiesFromExtendedAndImplementedEntities(){return u([...this.extends.reduce((e,t)=>[...[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract),...e],[]),...this.implements.reduce((e,t)=>[...[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract),...e],[])])}get extendedPropertiesFromOriginalParents(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...r]},[]))}get implementedPropertiesFromOriginalParents(){return u([...this.extends.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[]),...this.implements.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[])].filter(e=>!!e.abstract))}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new P({id:`${this.id}--${I.InvalidParentUpdate}`,code:I.InvalidParentUpdate,severity:D.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}}subscribeDependents(e){return e.forEach(t=>{this.detachedDependents[t.entity.id]||(this.detachedDependents[t.entity.id]=t)}),this}syncDependents(){const e=[],t=[],r=[],a=[];return Object.values(this.detachedDependents).forEach(d=>{const o=d.entity.afterAllChildrenInitialized();e.push(...o.updated),t.push(...o.added),r.push(...o.removed),a.push(...o.affected)}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}onDetachedDependencyRemoved(e,t,r){const a=[],d=[],o=[],l=[];return t==="implements"&&this.removeImplementation(e),t==="extends"&&this.removeExtension(e),{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}onDetachedDependencyRestored(e,t,r){const a=[],d=[],o=[],l=[];return t==="implements"&&this.addImplementation(e),t==="extends"&&this.addExtension(e),{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}subscribeToDependencies(){return this.implements.forEach(e=>{hr.includes(e.type)||e.subscribeDependents([{entity:this,field:"implements"}])}),this.extends.forEach(e=>{hr.includes(e.type)||e.subscribeDependents([{entity:this,field:"extends"}])}),this}increaseVersion(e){if(e&&!T(e).isValid())throw new Error(`The shared timestamp '${e}' is not a valid ISO 8601 date string.`);return e&&T(e).isSame(T(this.createdAt))?this:(this.previousVersion=this.version,this.version=R.UUID.uuid(),this.createdAt=T(e).toISOString()||T().toISOString(),this)}captureVersion(){var t,r;const e=((t=this.knownVersions)==null?void 0:t.get(this.version))||new Le(this,this.project);return(r=this.knownVersions)==null||r.set(this.version,e),e.properties=this.properties,e.methods=this.methods,e.abstractMethods=this.abstractMethods,e.extends=this.extends,e.implements=this.implements,e.parent=this.parent,this}recursiveCaptureUpstreamVersions(e){const t=[],r=[],a=[],d=[];if(this.parent){this.parent.increaseVersion(e);const o=this.parent.recursiveCaptureUpstreamVersions(e);t.push(this.parent,...o.updated),r.push(...o.added),a.push(...o.removed)}return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}async restoreVersion(e){var l;const t=[],r=[],a=[],d=[];if(this.version===e)return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this};if(!this.knownVersions){const p=new Map;for(const[h,c]of this.knownVersions||new Map){if(p.set(h,c),c.activeVersion=!1,c.knownVersions)for(const[v,E]of c.knownVersions)p.set(v,E);c.knownVersions=null}}let o=(l=this.knownVersions)==null?void 0:l.get(e);if(!o){const p=await this.APILoadVersion({},e);if(!p)throw new Error(`Version with id '${e}' for entity with id '${this.id}' not found.`);o=new Le(p,this.project)}return this.metaSync(o.toShallowJSON(),null),this.properties=o.properties,this.methods=o.methods,this.abstractMethods=o.abstractMethods,this.extends=o.extends,this.implements=o.implements,this.parent=o.parent,{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}hydrateAncestors(){const e=[],t=[],r=[],a=[];if(this.initialData.parent){const d=B(this.initialData.parent),o=this.project.get(d);o&&(this.setParent(o,null),e.push(o))}return this.initialData.extends.forEach(d=>{const o=B(d),l=this.project.get(o);l&&(this.addExtension(l),l.type!==n.BuiltInBaseEntity&&e.push(l))}),this.initialData.implements.forEach(d=>{const o=B(d),l=this.project.get(o);l&&(this.addImplementation(l),l.type!==n.BuiltInBaseEntity&&e.push(l))}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}afterAllChildrenInitialized(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"after-all-children-initialized"))){const t=[],r=[],a=[],d=[];this.initialized=!0,this.captureVersion();const{updated:o,added:l,removed:p,affected:h}=this.syncImplementationProperties(e);t.push(...o),r.push(...l),a.push(...p),d.push(...h);const{updated:c,added:v,removed:E,affected:O}=this.addExtendedProperties(e);return t.push(...c),r.push(...v),a.push(...E),d.push(...O),this.addSuggestions(),e==null||e.attemptAutoclose("after-all-children-initialized",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSelfToProject(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-self-to-project"))){const t=[this],r=[],a=[],d=[];if(this.parent.type===n.DataType){const o=this.parent;o.entity=this,t.push(o)}else this.project.addDefinitionEntity(this);return this.subscribe(),this.subscribeToDependencies(),e==null||e.attemptAutoclose("add-self-to-project",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}setParent(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"set-parent"))){var r;return((r=this.parent)==null?void 0:r.id)!==(e==null?void 0:e.id)&&(this.parent=e,t&&(t==null||t.add(this,b.Updated),t==null||t.attemptAutoclose("set-parent",this.id))),this}addExtension(e){return this.extends.includes(e)||this.extends.push(e),this}removeExtension(e){return this.extends=this.extends.filter(t=>t.id!==e.id),this}addImplementation(e){return this.implements.includes(e)||this.implements.push(e),this}removeImplementation(e){return this.implements=this.implements.filter(t=>t.id!==e.id),this}removeProperty(e){return this.properties=this.properties.filter(t=>t.id!==e.id),this}addMethod(e){return this.methods.includes(e)||(this.methods.push(e),this.suggestedMethods=this.suggestedMethods.filter(t=>t.name!==e.name)),this}removeMethod(e){return this.methods=this.methods.filter(t=>t.id!==e.id),this}addProperty(e){return this.properties.includes(e)||(this.properties.push(e),this.suggestedProperties=this.suggestedProperties.filter(t=>t.name!==e.name)),this}addSuggestedProperty(e){return this.suggestedProperties.includes(e)||this.suggestedProperties.push(e),this}addSuggestedMethod(e){return this.suggestedMethods.includes(e)||this.suggestedMethods.push(e),this}removeSuggestedProperty(e){return this.suggestedProperties=this.suggestedProperties.filter(t=>t.id!==e.id),this}removeSuggestedMethod(e){return this.suggestedMethods=this.suggestedMethods.filter(t=>t.id!==e.id),this}addAbstractMethod(e){return this.abstractMethods.includes(e)||this.abstractMethods.push(e),this}removeAbstractMethod(e){return this.abstractMethods=this.abstractMethods.filter(t=>t.id!==e.id),this}initChildren(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"init-children"))){return this.initialized||this.startedInitialization?this:(this.startedInitialization=!0,this.properties=this.initialData.properties.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(e),r}),this.methods=this.initialData.methods.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(e),r}),this.abstractMethods=this.initialData.abstractMethods.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(e),r}),this.extends=this.initialData.extends.map(t=>V(t,this.project)),this.implements=this.initialData.implements.map(t=>V(t,this.project)),this.subscribeToDependencies(),this.afterAllChildrenInitialized(e),e==null||e.attemptAutoclose("init-children",this.id),this)}syncImplementationProperties(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-implementation-properties"))){const t=[],r=[],a=[],d=[],o=this.properties,l=this.implementedPropertiesFromOriginalParents,p=[...this.allBasePropertiesFromExtendedAndImplementedEntities,...o];return l.filter(c=>!p.find(E=>{var O;return((O=E.implements)==null?void 0:O.id)===c.id})).forEach(c=>{if(this.properties.find(w=>{var C;return((C=w.implements)==null?void 0:C.id)===c.id}))return;const E=this.properties.find(w=>w.name===c.name&&!!w.abstract&&!w.implements);if(E){E.implements=c,E.abstract=!1;return}const O=c.clone(e,this,R.UUID.uuid());O.initChildren(e),r.push(O),e==null||e.add(O,b.Added),O.setImplements(c,e),O.metaSync({abstract:!1},e),this.addProperty(O)}),e==null||e.attemptAutoclose("sync-implementation-properties",this.id),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addExtendedProperties(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"add-extended-properties"))){const t=[],r=[],a=[],d=[],o=this.properties,l=this.extendedPropertiesFromOriginalParents,p=l.filter(c=>l.find(E=>{var O;return((O=E.implements)==null?void 0:O.id)===c.id})?!1:!c.abstract),h=new Set(o.map(c=>c.name));return p.forEach(c=>{if(h.has(c.name))return;h.add(c.name);const v=c.clone(e,this,R.UUID.uuid());v.initChildren(e),r.push(v),e==null||e.add(v,b.Added),this.addProperty(v)}),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSuggestions(){return this.implements.forEach(e=>{M5(this,e).forEach(a=>{const d=a.toJSON();d.id=`_suggestion--parent--${this.id}--${a.id}`;const o=V(d,this.project);o.suggestion=!0,o.setParent(this,null),o.initChildren(null),this.addSuggestedProperty(o)}),g5(this,e).forEach(a=>{const d=`_suggestion--parent--${this.id}--${a.id}`,o=a.asFunctionDeclarationTransfer(d),l=V(o,this.project);if(l.suggestion=!0,l.setParent(this,null),l.initChildren(null),l.inputs.forEach(p=>{p.suggestion=!0}),l.returnStatements.length){const p=l.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(l)})}),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-meta"))){const r=dt(this,e);return e.deleted===!0&&!this.deleted?t==null||t.add(this,b.Removed):e.deleted===!1&&this.deleted?t==null||t.add(this,b.Added):r&&(t==null||t.add(this,b.Updated)),super.metaSync(e),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,t==null||t.attemptAutoclose("sync-meta",this.id),this}async APILoad(e=L,...t){return await Le.repository.APILoad(this.id,...t),this}async APICreate(e=L,...t){return await Le.repository.APICreate(this.toShallowJSON(),...t),this}async APIUpdate(e=L,...t){return await Le.repository.APIUpdate(this.toShallowJSON(),...t),this}async APIDelete(e=L,...t){return await Le.repository.APIDelete(this.toShallowJSON(),...t),this}async APIClone(e=L,...t){return await Le.repository.APIClone(this.id,...t),this}async APILoadVersion(e=L,t,...r){return await Le.repository.APILoadVersion(this.id,t,...r)}remove({ignoreUpstream:e}={ignoreUpstream:!1},t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-entity"))){const r=[],a=[],d=[],o=[];if(t!=null&&t.hasRemoved(this.id))return t==null||t.attemptAutoclose("remove-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(a.push(this),this.unsubscribe(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},t),Object.values(this.detachedDependents).forEach(l=>{const{updated:p,removed:h,added:c}=l.entity.onDetachedDependencyRemoved(this,l.field,t);r.push(...p),a.push(...h),d.push(...c)}),this.properties.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.methods.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.abstractMethods.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.suggestedProperties.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),this.suggestedMethods.forEach(l=>{const{updated:p,removed:h}=l.remove({ignoreUpstream:!0},t);r.push(...p),a.push(...h)}),!e){if(this.parent.type===n.Project)this.parent.removeDefinitionEntity(this);else if(this.parent.type===n.DataType){const l=this.parent.setEntity(null);r.push(l)}}return t==null||t.attemptAutoclose("remove-entity",this.id),{added:u(d),updated:u(r),removed:u(a),affected:u(o),self:this}}restore({}={},e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"restore-entity"))){const t=[],r=[],a=[],d=[];return e!=null&&e.hasAdded(this.id)?(e==null||e.attemptAutoclose("restore-entity",this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},e),this.properties.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.methods.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.abstractMethods.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.suggestedProperties.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),this.suggestedMethods.forEach(o=>{const{updated:l}=o.restore({},e);r.push(...l)}),e==null||e.attemptAutoclose("restore-entity",this.id),{added:u(t),updated:u(r),removed:u(a),affected:u(d),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)),...this.parent.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)),...this.parent.toFlatIds(e)])}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),implements:this.implements.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e)),parent:this.parent.toReference()})}toJSONClone(e=Z){var r,a,d,o,l;let t;return(r=e.seenEntityMaps)!=null&&r.has(this.id)?t=e.seenEntityMaps.get(this.id):(t=e.newId||ct(this,this.project,e.uuidStrategy),e.seenEntityMaps&&e.seenEntityMaps.set(this.id,t)),(a=e.seenEntities)!=null&&a.has(t)||(d=e.seenEntities)!=null&&d.has(this.id)?this.toReference({seenEntityMaps:e.seenEntityMaps}):((o=e.seenEntities)==null||o.add(t),(l=e.seenEntities)==null||l.add(this.id),{id:t,version:R.UUID.uuid(),createdAt:e.timestamp||T().toISOString(),author:"1",previousVersion:null,deleted:!1,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(p=>p.toJSONClone({...e,newId:null})),methods:this.methods.map(p=>p.toJSONClone({...e,newId:null})),abstractMethods:this.abstractMethods.map(p=>p.toJSONClone({...e,newId:null})),implements:this.implements.map(p=>p.type===n.BuiltInBaseEntity?p.toJSON():p.toJSONClone({...e,newId:null})),extends:this.extends.map(p=>p.type===n.BuiltInBaseEntity?p.toJSON():p.toJSONClone({...e,newId:null})),parent:this.parent.toReference({seenEntityMaps:e.seenEntityMaps})})}toReference(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:t,version:this.version,entityType:this.type}}toShallowJSON(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,name:this.name,description:this.description,type:this.type,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(a=>a.toReference(e)),methods:this.methods.map(a=>a.toReference(e)),abstractMethods:this.abstractMethods.map(a=>a.toReference(e)),implements:this.implements.map(a=>a.toReference(e)),extends:this.extends.map(a=>a.toReference(e)),parent:this.parent.toReference(e)}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(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)),...this.parent.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.DefinitionEntity).flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===n.DefinitionEntity).flatMap(r=>r.toFlatGenerationTarget(e)),...this.parent.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=_5(this),{success:!0,error:null,data:null}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"clone-entity")),t=null,r=null,a=!0){var w,C,U;let d=ft(t,this);const o=this.toJSON(),l=r||R.UUID.uuid();o.properties=[],o.methods=[],o.abstractMethods=[];const p=l.split("-id"),h=p[p.length-1||0]||l;o.id=l,o.version=R.UUID.uuid(),o.createdAt=(e==null?void 0:e.timestamp)||T().toISOString(),o.author=(e==null?void 0:e.author)||"1",o.previousVersion=null,o.deleted=!1;const c=lt(o,d);t&&c.setParent(t,null),a&&c.subscribe(),c.initChildren(e),e==null||e.add(c,b.Added);const v=(w=this.properties)==null?void 0:w.map(F=>F.clone(e,c,R.UUID.uuid(),a));c.properties=v;const E=(C=this.methods)==null?void 0:C.map((F,_)=>F.clone(e,c,h+"-method-"+_+"-id",a));c.methods=E;const O=(U=this.abstractMethods)==null?void 0:U.map((F,_)=>F.clone(e,c,h+"-abstract-method-"+_+"-id",a));return c.abstractMethods=O,e==null||e.attemptAutoclose("clone-entity",this.id),c}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"implement-definition-entity")),r){const a=Fd(this,e,t,r);return t==null||t.attemptAutoclose("implement-definition-entity",this.id),a}getAllInteractiveMethods(){const e=this.implements.filter(r=>r.type===n.DefinitionEntity||r.type===n.BuiltInBaseEntity&&r.interactive);return u([...this.methods,...this.extends.flatMap(r=>r.getAllInteractiveMethods()),...e.flatMap(r=>r.getAllInteractiveMethods())])}inferFromInputs(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"infer-definition-entity-from-inputs"))){const r=[],a=[],d=[],o=[];if(this.parent.type!==n.DataType||!this.parent.inferred)return t==null||t.attemptAutoclose("infer-definition-entity-from-inputs",this.id),{added:[],updated:[],removed:[],affected:[],self:this};const l=[];e.forEach(c=>{l.find(E=>G(E,this.project)===G(c,this.project))||l.push(c)});const p=this.properties.filter(c=>!c.dataType);l.forEach(c=>{var U,F;const v=p.find(_=>G(_,this.project)===G(c,this.project));if(!v)return;const O=Pn(c.parent).getMasterInputWithValueWritterFromAllInstances(c),w=xr(O,t),C=w==null?void 0:w.clone(t,v,R.UUID.uuid(),!0);if(C){const _=(U=v.dataType)==null?void 0:U.merge(C,t);v.dataType&&(_==null?void 0:_.self.id)!==v.dataType.id&&v.dataType.remove({ignoreUpstream:!1},t),C.id!==((F=_==null?void 0:_.self)==null?void 0:F.id)&&C.remove({ignoreUpstream:!1},t),_!=null&&_.self&&(_.self.metaSync({inferred:!0,like:!0},t),t==null||t.add(_.self,b.Added),v.setDataType(_.self),t==null||t.add(v,b.Updated))}c.setDeclaration(v),t==null||t.add(c,b.Updated)});const h=[];return l.forEach(c=>{if(!c.declaration){h.push(c);return}}),h.length===0?(t==null||t.attemptAutoclose("infer-definition-entity-from-inputs",this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(h.forEach(c=>{var _,$,k,W;const v=this.properties.find(ee=>G(ee,this.project)===G(c,this.project));if(v){if(c.setDeclaration(v),!v.getDataType(t)){const pe=Pn(c.parent).getMasterInputWithValueWritterFromAllInstances(c),Te=xr(pe),K=Te==null?void 0:Te.clone(t,v,R.UUID.uuid(),!0);if(K){const se=(_=v.dataType)==null?void 0:_.merge(K,t);v.dataType&&(se==null?void 0:se.self.id)!==v.dataType.id&&v.dataType.remove({ignoreUpstream:!1},t),K.id!==(($=se==null?void 0:se.self)==null?void 0:$.id)&&K.remove({ignoreUpstream:!1},t),se!=null&&se.self&&(se.self.metaSync({inferred:!0,like:!0},t),t==null||t.add(se.self,b.Added),v.setDataType(se.self),t==null||t.add(v,b.Updated))}}return}const E={id:R.UUID.uuid(),type:n.Property,version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:G(c,this.project),description:c.description,defaultValue:null,static:!0,abstract:!1,private:!1,hidden:!1,required:!1,constant:!0,index:c.index,implements:null,dataType:null,parent:this.toReference()},O=V(E,this.project);O.setParent(this,t),O.initChildren(t),t==null||t.add(O,b.Added);const C=Pn(c.parent).getMasterInputWithValueWritterFromAllInstances(c),U=xr(C),F=U==null?void 0:U.clone(t,O,R.UUID.uuid(),!0);if(F){const ee=(k=O.dataType)==null?void 0:k.merge(F,t);O.dataType&&(ee==null?void 0:ee.self.id)!==O.dataType.id&&O.dataType.remove({ignoreUpstream:!1},t),F.id!==((W=ee==null?void 0:ee.self)==null?void 0:W.id)&&F.remove({ignoreUpstream:!1},t),ee!=null&&ee.self&&(ee.self.metaSync({inferred:!0,like:!0},t),t==null||t.add(ee.self,b.Added),O.setDataType(ee.self),t==null||t.add(O,b.Updated))}return this.addProperty(O),c.setDeclaration(O),t==null||t.add(c,b.Updated),O}),t==null||t.attemptAutoclose("infer-definition-entity-from-inputs",this.id),{added:u(r),updated:u(a),removed:u(d),affected:u(o),self:this})}};f(Le,"repository",{APICreate:async(e,...t)=>e,APIUpdate:async(e,...t)=>e,APIDelete:async(e,...t)=>e,APIClone:async(e,...t)=>{},APILoad:async(e,...t)=>null,APILoadVersion:async(e,t,...r)=>null}),f(Le,"type",n.DefinitionEntity),f(Le,"USER_MANAGED_PARENT_TYPES",[n.Project,n.DataType]),f(Le,"PARENT_TYPES",[...Le.USER_MANAGED_PARENT_TYPES]),f(Le,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),f(Le,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),f(Le,"BASE_PROPERTIES",[...Le.MUTABLE_BASE_PROPERTIES,...Le.INMUTABLE_BASE_PROPERTIES]),f(Le,"MUTABLE_META_PROPERTIES",[...Le.MUTABLE_BASE_PROPERTIES,"x","y"]),f(Le,"INMUTABLE_META_PROPERTIES",[...Le.INMUTABLE_BASE_PROPERTIES]),f(Le,"META_PROPERTIES",[...Le.MUTABLE_META_PROPERTIES,...Le.INMUTABLE_META_PROPERTIES]),f(Le,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),f(Le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),f(Le,"UPSTREAM_PROPERTIES",[...Le.MUTABLE_UPSTREAM_PROPERTIES,...Le.INMUTABLE_UPSTREAM_PROPERTIES]),f(Le,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),f(Le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),f(Le,"DOWNSTREAM_PROPERTIES",[...Le.MUTABLE_DOWNSTREAM_PROPERTIES,...Le.INMUTABLE_DOWNSTREAM_PROPERTIES]),f(Le,"PROPERTIES",[...Le.META_PROPERTIES,...Le.UPSTREAM_PROPERTIES,...Le.DOWNSTREAM_PROPERTIES]);let zi=Le;function aJ(i){const s=l6(),e=i.toJSON();s.safeParse(e).success;const r=[];return Ye(i.errors,r)}const Ns=class Ns extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"version");f(this,"name");f(this,"description",null);f(this,"type",n.BuiltInBaseEntity);f(this,"abstract",!1);f(this,"static");f(this,"properties",[]);f(this,"methods",[]);f(this,"abstractMethods",[]);f(this,"extends",[]);f(this,"interactive",!1);f(this,"errors",[]);f(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=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.methods=this.initialData.methods.map(r=>{const a=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.extends=this.initialData.extends.map(r=>V(r,this.project))}get allBasePropertiesFromExtendedAndImplementedEntities(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract);return[...e,...r]},[]))}get extendedPropertiesFromOriginalParents(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...r]},[]))}get implementedPropertiesFromOriginalParents(){return u([...this.extends.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[])])}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async APILoad(e=L,...t){return await Ns.repository.APILoad(this.id,...t),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(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e))})}toReference(e=Z){return{id:this.id+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(e=Z){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(t=>t.toReference()),methods:this.methods.map(t=>t.toReference()),abstractMethods:this.abstractMethods.map(t=>t.toReference()),extends:this.extends.map(t=>t.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(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=aJ(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}implement(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),null,!0,"implement-built-in-base-entity")),r){const a=Fd(this,e,t,r);return t==null||t.attemptAutoclose("implement-built-in-base-entity",this.id),a}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(r=>r.type===n.BuiltInBaseEntity&&r.interactive||r.type===n.PrimitiveEntity).forEach(r=>{r instanceof Ns&&e.push(...r.getAllInteractiveMethods())})),u(e)}};f(Ns,"repository",{APILoad:async(e,...t)=>null});let Yr=Ns;function sJ(i){const s=e6(),e=i.toJSON();s.safeParse(e).success;const r=[];return Ye(i.errors,r)}const Qd=class Qd extends rt{constructor(e,t){super(e);f(this,"initialData");f(this,"id");f(this,"name");f(this,"description",null);f(this,"type",n.PrimitiveEntity);f(this,"static");f(this,"abstract");f(this,"properties",[]);f(this,"methods",[]);f(this,"abstractMethods",[]);f(this,"extends",[]);f(this,"errors",[]);f(this,"project");this.initialData=e,this.project=t,this.id=e.id,this.name=e.name,this.static=e.static,this.abstract=e.abstract,this.properties=this.initialData.properties.map(r=>{const a=V(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.methods=this.initialData.methods.map(r=>{const a=V(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=V(r,this.project);return a.parent=this,a})}get allBasePropertiesFromExtendedAndImplementedEntities(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.allBasePropertiesFromExtendedAndImplementedEntities].filter(a=>!a.abstract);return[...e,...r]},[]))}get extendedPropertiesFromOriginalParents(){return u(this.extends.reduce((e,t)=>{const r=[...t.ownDeclaredProperties,...t.extendedPropertiesFromOriginalParents].filter(a=>!a.abstract);return[...e,...r]},[]))}get implementedPropertiesFromOriginalParents(){return u([...this.extends.reduce((e,t)=>{const r=t.implementedPropertiesFromOriginalParents,a=[...t.ownDeclaredProperties].filter(d=>!!d.abstract&&!r.find(o=>o.name===d.name));return[...r,...a,...e]},[])])}get extendedProperties(){return this.properties.filter(e=>e.isExtendedProperty)}get ownDeclaredProperties(){return this.properties.filter(e=>!e.isExtendedProperty)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async APILoad(e=L,...t){return await Qd.repository.APILoad(this.id,...t),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(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,properties:this.properties.map(t=>t.toJSON(e)),methods:this.methods.map(t=>t.toJSON(e)),abstractMethods:this.abstractMethods.map(t=>t.toJSON(e)),extends:this.extends.map(t=>t.toJSON(e))})}toReference(e=Z){return{id:this.id+"--"+R.UUID.uuid()+"--ref",type:n.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(e=Z){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,properties:this.properties.map(t=>t.toReference()),methods:this.methods.map(t=>t.toReference()),abstractMethods:this.abstractMethods.map(t=>t.toReference()),extends:this.extends.map(t=>t.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(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=sJ(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(r=>r.type===n.BuiltInBaseEntity&&r.interactive||r.type===n.PrimitiveEntity).forEach(r=>{r instanceof Yr&&e.push(...r.getAllInteractiveMethods())}),u(e)}};f(Qd,"repository",{APILoad:async(e,...t)=>null});let fr=Qd;function lt(i,s){if(!i)throw new Error("Entity is null");const e=s.get(i.id);switch(i.type){case n.LiteralValue:return e||new _n(i,s);case n.DefinitionEntity:return e||new zi(i,s);case n.PrimitiveEntity:return e||new fr(i,s);case n.FunctionDeclaration:return e||new Mi(i,s);case n.GlobalEvent:return e||new Vn(i,s);case n.DataType:return e||new wn(i,s);case n.Property:return e||new Bi(i,s);case n.FunctionCall:return e||new qi(i,s);case n.Condition:return e||new Li(i,s);case n.Operation:return e||new gi(i,s);case n.VariableDeclaration:return e||new ji(i,s);case n.VariableInstance:return e||new Ui(i,s);case n.OutputMap:return e||new Zr(i,s);case n.ReturnDeclaration:return e||new rr(i,s);case n.ArgumentDeclaration:return e||new Fi(i,s);case n.InputMap:return e||new kr(i,s);case n.Project:return e||new R(i);case n.InstalledProject:return e||new Gi(i,s);case n.ActionDescriptor:return e||new qe(i,s);case n.ReturnStatement:return e||new _i(i,s);case n.Loop:return e||new Ni(i,s);case n.Search:return e||new $i(i,s);case n.ValueDescriptor:return e||new Si(i,s);case n.BuiltInBaseEntity:return e||new Yr(i,s);case n.InternalCall:return e||new Bn(i,s);case n.ContinueStatement:return e||new $t(i,s);case n.BreakStatement:return e||new Cn(i,s);case n.GenericReference:return s.get(i.entityId);default:throw new Error("Invalid entity type: "+i.type)}}function V(i,s){if(!i)throw new Error("Entity is null");const e=lt(i,s);return e.subscribe(),e}function oJ(i,s){if(!i)throw new Error("Entity is null");switch(i.type){case n.LiteralValue:return _n.fromGenerationTarget(i,s);case n.DefinitionEntity:return zi.fromGenerationTarget(i,s);case n.FunctionDeclaration:return Mi.fromGenerationTarget(i,s);case n.GlobalEvent:return Vn.fromGenerationTarget(i,s);case n.DataType:return wn.fromGenerationTarget(i,s);case n.Property:return Bi.fromGenerationTarget(i,s);case n.FunctionCall:return qi.fromGenerationTarget(i,s);case n.Condition:return Li.fromGenerationTarget(i,s);case n.Operation:return gi.fromGenerationTarget(i,s);case n.VariableDeclaration:return ji.fromGenerationTarget(i,s);case n.VariableInstance:return Ui.fromGenerationTarget(i,s);case n.OutputMap:return Zr.fromGenerationTarget(i,s);case n.ReturnDeclaration:return rr.fromGenerationTarget(i,s);case n.ArgumentDeclaration:return Fi.fromGenerationTarget(i,s);case n.InputMap:return kr.fromGenerationTarget(i,s);case n.InstalledProject:return Gi.fromGenerationTarget(i,s);case n.ReturnStatement:return _i.fromGenerationTarget(i,s);case n.Loop:return Ni.fromGenerationTarget(i,s);case n.Search:return $i.fromGenerationTarget(i,s);case n.ActionDescriptor:return qe.fromGenerationTarget(i,s);case n.ValueDescriptor:return Si.fromGenerationTarget(i,s);case n.InternalCall:return Bn.fromGenerationTarget(i,s);case n.ContinueStatement:return $t.fromGenerationTarget(i,s);case n.BreakStatement:return Cn.fromGenerationTarget(i,s);default:throw new Error("Invalid entity type: "+i.type)}}const Z={seenEntityMaps:new Map,seenEntities:new Set,timestamp:T().toISOString()};class RP{constructor(){f(this,"initialData")}}const L={cascade:!1},AP={APILoad:async(i,...s)=>null},dJ={APICreate:async(i,...s)=>i,APIUpdate:async(i,...s)=>i,APIDelete:async(i,...s)=>i,APIClone:async(i,...s)=>{},APILoadVersion:async(i,s,...e)=>null,...AP};class lJ{}class uJ extends RP{}class pJ{}class cJ{}class fJ{}class qc{}class yJ extends qc{}class hJ extends qc{}class mJ{}class yi{static initReadsValue(s){if(s.initialData.readsValue&&s.initialData.readsValue.type!==n.GenericReference)s.readsValue=V(s.initialData.readsValue,s.project);else if(s.initialData.readsValue&&s.initialData.readsValue.type===n.GenericReference){const e=nr(s.initialData.readsValue,s.project);e&&(s.readsValue=e)}if(s.readsValue){if(Qe.includes(s.readsValue.type)){let e=s.parent;mt.includes(e.type)||(e=e.parent);const t=s.type===n.InputMap&&s.parent.type===n.Loop;t&&(e=s.parent.parent),s.readsValue.setParent(e,null),s.readsValue.initChildren(null),!t&&e.detachedChildren.includes(s)?e.replaceDetachedChild(s,s.readsValue):t||e.subscribeDetachedChild(s.readsValue)}s.readsValue.addValueReader(s)}return s.readsValue}static hydrateReadsValue(s){if(s.initialData.readsValue&&s.initialData.readsValue.type!==n.GenericReference)s.readsValue=V(s.initialData.readsValue,s.project);else if(s.initialData.readsValue&&s.initialData.readsValue.type===n.GenericReference){const e=nr(s.initialData.readsValue,s.project);e&&(s.readsValue=e)}if(s.readsValue){if(Qe.includes(s.readsValue.type)){let e=s.parent;mt.includes(e.type)||(e=e.parent);const t=s.type===n.InputMap&&s.parent.type===n.Loop;t&&(e=s.parent.parent),s.readsValue.setParent(e,null),!t&&e.detachedChildren.includes(s)?e.replaceDetachedChild(s,s.readsValue):t||e.subscribeDetachedChild(s.readsValue)}s.readsValue.addValueReader(s)}return s.readsValue}}class gs{static initWritesValues(s,e){const t=s.initialData.writesValues.reduce((a,d)=>{if(d.type===n.GenericReference||s.writesValues.some(l=>l.id===d.id))return a;const o=V(d,s.project);return o.setValueWriter(s),Qe.includes(o.type)&&(o.setParent(e,null),o.initChildren(null)),[...a,o]},[]),r=[...s.writesValues];return s.writesValues=u([...r,...t]),s.writesValues}}class vJ{}const oe=class oe extends rt{constructor(e){super(e);f(this,"initialData");f(this,"id");f(this,"type",n.Project);f(this,"name",null);f(this,"description",null);f(this,"x");f(this,"y");f(this,"entities",[]);f(this,"projects",[]);f(this,"functions",[]);f(this,"events",[]);f(this,"variableDeclarations",[]);f(this,"variableInstances",[]);f(this,"conditions",[]);f(this,"operations",[]);f(this,"functionCalls",[]);f(this,"loops",[]);f(this,"searches",[]);f(this,"primitives",[]);f(this,"builtInBaseEntities",[]);f(this,"operationDeclarations",[]);f(this,"globalEventActionDescriptors",[]);f(this,"loopDeclarations",[]);f(this,"loopDeclarationsBodies",[]);f(this,"conditionDeclarations",[]);f(this,"valueDescriptors",[]);f(this,"dataTypes",[]);f(this,"project");f(this,"instances",{});f(this,"builtInInstances",{});f(this,"deletedInstances",{});f(this,"errors",[]);f(this,"references",[]);f(this,"history",[]);f(this,"detachedDependents",{});f(this,"knownVersions",null);f(this,"activeVersion",!1);f(this,"initialized",!1);f(this,"startedInitialization",!1);f(this,"onCloseChangeSetCallback",null);this.initialData=e,this.id=e.id,this.name=e.name,this.description=e.description,this.x=0,this.y=0,this.instances[this.id]=this;try{(!oe.UUID||oe.UUID.isBackup)&&(oe.UUID=Lo==null?void 0:Lo()),oe.UUID||(oe.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:t=>t})}catch(t){console.error("Error initializing UUID module",t),oe.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:r=>r}}}static injectUUIDModule(e){oe.UUID=e}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...ot(r)),{errors:a,modifiedData:r}}onCloseChangeSet(e){this.onCloseChangeSetCallback=e}closeChangeSet(e){this.onCloseChangeSetCallback&&this.onCloseChangeSetCallback(e)}addChangeSet(e){if(!this.history.length)return this.history.push(e),e;const t=this.history.find(a=>a.id===(e==null?void 0:e.id));if(t)return t;const r=this.history.findIndex(a=>T(a.timestamp).isBefore(T(e==null?void 0:e.timestamp)));return r===-1?this.history.push(e):this.history.splice(r,0,e),e}discardChangeSet(e){const t=this.history.findIndex(r=>r.id===(e==null?void 0:e.id));return t!==-1&&this.history.splice(t,1),this}undo(){const e=[],t=[],r=[],a=[];return{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}redo(){const e=[],t=[],r=[],a=[];return{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}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}}subscribeDependents(e){return e.forEach(t=>{this.detachedDependents[t.entity.id]||(this.detachedDependents[t.entity.id]=t)}),this}syncDependents(){const e=[],t=[],r=[],a=[];return Object.values(this.detachedDependents).forEach(d=>{const o=d.entity.afterAllChildrenInitialized();e.push(...o.updated),t.push(...o.added),r.push(...o.removed),a.push(...o.affected)}),{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}onDetachedDependencyRemoved(e,t,r){const a=[],d=[],o=[],l=[];return{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}onDetachedDependencyRestored(e,t,r){const a=[],d=[],o=[],l=[];return{updated:u(a),added:u(d),removed:u(o),affected:u(l),self:this}}subscribeToDependencies(){return this}increaseVersion(e){if(e&&!T(e).isValid())throw new Error(`The shared timestamp '${e}' is not a valid ISO 8601 date string.`);return e&&T(e).isSame(T(this.createdAt))?this:(this.previousVersion=this.version,this.version=oe.UUID.uuid(),this.createdAt=T(e).toISOString()||T().toISOString(),this)}captureVersion(){var t,r;const e=((t=this.knownVersions)==null?void 0:t.get(this.version))||new oe(this);return(r=this.knownVersions)==null||r.set(this.version,e),e.entities=this.entities,e.projects=this.projects,e.functions=this.functions,e.events=this.events,e.variableDeclarations=this.variableDeclarations,e.variableInstances=this.variableInstances,e.conditions=this.conditions,e.operations=this.operations,e.functionCalls=this.functionCalls,e.loops=this.loops,e.searches=this.searches,this}recursiveCaptureUpstreamVersions(e){const t=[],r=[],a=[],d=[];return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}async restoreVersion(e){var l;const t=[],r=[],a=[],d=[];if(this.version===e)return{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this};if(!this.knownVersions){const p=new Map;for(const[h,c]of this.knownVersions||new Map){if(p.set(h,c),c.activeVersion=!1,c.knownVersions)for(const[v,E]of c.knownVersions)p.set(v,E);c.knownVersions=null}}let o=(l=this.knownVersions)==null?void 0:l.get(e);if(!o){const p=await this.APILoadVersion({},e);if(!p)throw new Error(`Version with id '${e}' for entity with id '${this.id}' not found.`);o=new oe(p)}return this.metaSync(o.toShallowJSON(),null),this.entities=o.entities,this.projects=o.projects,this.functions=o.functions,this.events=o.events,this.variableDeclarations=o.variableDeclarations,this.variableInstances=o.variableInstances,this.conditions=o.conditions,this.operations=o.operations,this.functionCalls=o.functionCalls,this.loops=o.loops,this.searches=o.searches,{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}hydrateAncestors(){const e=[],t=[],r=[],a=[];return{updated:u(e),added:u(t),removed:u(r),affected:u(a),self:this}}afterAllChildrenInitialized(e=null){const t=[],r=[],a=[],d=[];return this.initialized=!0,this.captureVersion(),this.validate(),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}addSelfToProject(e){const t=[],r=[],a=[],d=[];return this.subscribe(),this.subscribeToDependencies(),{updated:u(t),added:u(r),removed:u(a),affected:u(d),self:this}}get instancesList(){return Object.values(this.instances)}isOperationDeclaration(e){return this.operationDeclarations.includes(e)}isGlobalEventActionDescriptor(e){return this.globalEventActionDescriptors.includes(e)}isLoopDeclaration(e){return this.loopDeclarations.includes(e)}isConditionDeclaration(e){return this.conditionDeclarations.includes(e)}initChildren(e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"init-children"))){return this.initialized||this.startedInitialization?this:(this.startedInitialization=!0,this.entities=this.initialData.entities.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.projects=this.initialData.projects.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.variableDeclarations=this.initialData.variableDeclarations.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.variableInstances=this.initialData.variableInstances.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.conditions=this.initialData.conditions.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.operations=this.initialData.operations.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.functions=this.initialData.functions.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.events=this.initialData.events.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.functionCalls=this.initialData.functionCalls.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.loops=this.initialData.loops.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.searches=this.initialData.searches.map(t=>{const r=V(t,this);return r.setParent(this,null),r.initChildren(e),r}),this.attachOrphanReferences(),this.subscribeToDependencies(),this.afterAllChildrenInitialized(e),e==null||e.attemptAutoclose("init-children",this.id),this)}subscribeInstance(e){return(!this.instances[e.id]||this.instances[e.id]!==e)&&(this.instances[e.id]=e),this}subscribeDeletedInstance(e){return(!this.deletedInstances[e.id]||this.deletedInstances[e.id]!==e)&&(this.deletedInstances[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}unsubscribeDeletedInstance(e){return delete this.deletedInstances[e.id],this}findSubscribedBuiltInInstance(e){return this.builtInInstances[e.id]||null}get(e){return this.instances[e]||this.builtInInstances[e]||null}getDeleted(e){return this.deletedInstances[e]||null}getManaged(e){return this.getBuiltIn(e)?null: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}metaSync(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-meta"))){const r=dt(this,e);return e.deleted===!0&&!this.deleted?t==null||t.add(this,b.Removed):e.deleted===!1&&this.deleted?t==null||t.add(this,b.Added):r&&(t==null||t.add(this,b.Updated)),super.metaSync(e),this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,t==null||t.attemptAutoclose("sync-meta",this.id),this}async APILoad(e=L,...t){return await oe.repository.APILoad(this.id,...t),this}async APICreate(e=L,...t){return await oe.repository.APICreate(this.toShallowJSON(),...t),this}async APIUpdate(e=L,...t){return await oe.repository.APIUpdate(this.toShallowJSON(),...t),this}async APIDelete(e=L,...t){return await oe.repository.APIDelete(this.toShallowJSON(),...t),this}async APIClone(e=L,...t){return await oe.repository.APIClone(this.id,...t),this}async APILoadVersion(e=L,t,...r){return await oe.repository.APILoadVersion(this.id,t,...r)}remove({ignoreUpstream:e}={ignoreUpstream:!1},t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"remove-entity"))){return{added:[],updated:[],removed:[],affected:[],self:this}}restore({}={},e=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"restore-entity"))){return{added:[],updated:[],removed:[],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,...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),[this.id,...this.entities.flatMap(r=>r.toFlatIds(e)),...this.functions.flatMap(r=>r.toFlatIds(e)),...this.events.flatMap(r=>r.toFlatIds(e)),...this.projects.flatMap(r=>r.toFlatIds(e)),...this.variableDeclarations.flatMap(r=>r.toFlatIds(e)),...this.variableInstances.flatMap(r=>r.toFlatIds(e)),...this.conditions.flatMap(r=>r.toFlatIds(e)),...this.operations.flatMap(r=>r.toFlatIds(e)),...this.functionCalls.flatMap(r=>r.toFlatIds(e)),...this.loops.flatMap(r=>r.toFlatIds(e)),...this.searches.flatMap(r=>r.toFlatIds(e))])}toJSON(e=new Set){return e.has(this.id)?this.toReference():(e.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,entities:this.entities.map(t=>t.toJSON(e)),variableDeclarations:this.variableDeclarations.map(t=>t.toJSON(e)),variableInstances:this.variableInstances.map(t=>t.toJSON(e)),conditions:this.conditions.map(t=>t.toJSON(e)),operations:this.operations.map(t=>t.toJSON(e)),loops:this.loops.map(t=>t.toJSON(e)),searches:this.searches.map(t=>t.toJSON(e)),functions:this.functions.map(t=>t.toJSON(e)),events:this.events.map(t=>t.toJSON(e)),projects:this.projects.map(t=>t.toJSON(e)),functionCalls:this.functionCalls.map(t=>t.toJSON(e))})}toJSONClone(e={uuidStrategy:"uuid"}){const t=new Map,r=new Set,a=this.getAllBuiltInIds();return Object.keys(this.instances).forEach(d=>{if(a.includes(d)){t.set(d,d);return}t.set(d,oe.UUID.uuid())}),r.add(this.id),{id:t.get(this.id),version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,entities:this.entities.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),projects:this.projects.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),variableDeclarations:this.variableDeclarations.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),variableInstances:this.variableInstances.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),conditions:this.conditions.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),operations:this.operations.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),functions:this.functions.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),events:this.events.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),functionCalls:this.functionCalls.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),loops:this.loops.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null})),searches:this.searches.map(d=>d.toJSONClone({...e,seenEntityMaps:t,seenEntities:r,newId:null}))}}toReference(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t+"--"+oe.UUID.uuid()+"--ref",type:n.GenericReference,entityId:t,version:this.version,entityType:this.type}}toShallowJSON(e=Z){var r;let t=this.id;return(r=e.seenEntityMaps)!=null&&r.has(this.id)&&(t=e.seenEntityMaps.get(this.id)),{id:t,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,entities:this.entities.map(a=>a.toReference(e)),functions:this.functions.map(a=>a.toReference(e)),events:this.events.map(a=>a.toReference(e)),projects:this.projects.map(a=>a.toReference(e)),variableDeclarations:this.variableDeclarations.map(a=>a.toReference(e)),variableInstances:this.variableInstances.map(a=>a.toReference(e)),conditions:this.conditions.map(a=>a.toReference(e)),operations:this.operations.map(a=>a.toReference(e)),functionCalls:this.functionCalls.map(a=>a.toReference(e)),loops:this.loops.map(a=>a.toReference(e)),searches:this.searches.map(a=>a.toReference(e))}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...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=O5(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return this}getDefinitionEntity(e){return this.entities.find(t=>t.id===e)||null}addDefinitionEntityFromTransfer(e){const t=V(e,this);return this.addDefinitionEntity(t),t}addDefinitionEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=V(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=V(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=V(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=V(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=V(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=V(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=V(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=V(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=V(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=V(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeDefinitionEntity(e){const t=this.entities.findIndex(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=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.functionCalls.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.operations.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.loops.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[]),...this.searches.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.functionCalls.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.conditions.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.loops.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[]),...this.searches.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.conditions.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.operations.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.loops.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[]),...this.searches.reduce((t,r)=>{const a=it(r);return[...t,...a.filter(d=>d.type===n.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.functionCalls.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.conditions.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.operations.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.loops.reduce((t,r)=>{const a=We(r);return[...t,...a]},[]),...this.searches.reduce((t,r)=>{const a=We(r);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.functionCalls.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.conditions.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.operations.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.loops.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[]),...this.searches.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableInstance);return[...t,...d]},[])]}getVariableDeclarations(){return u([...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.functionCalls.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.conditions.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.operations.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.loops.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[]),...this.searches.reduce((t,r)=>{const d=We(r).filter(o=>o.type===n.VariableDeclaration);return[...t,...d]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(r=>{if(!r.declaration){const a=r.initialData,d=a.declaration.entityId||a.declaration.id,o=t.find(l=>l.id===d);o&&r.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===z.PERSISTED_ENTITY)||null}};f(oe,"sessionAuthor",null),f(oe,"UUID",{isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),f(oe,"repository",{APICreate:async(e,...t)=>e,APIUpdate:async(e,...t)=>e,APIDelete:async(e,...t)=>e,APIClone:async(e,...t)=>{},APILoad:async(e,...t)=>null,APILoadVersion:async(e,t,...r)=>null}),f(oe,"type",n.Project),f(oe,"USER_MANAGED_PARENT_TYPES",[]),f(oe,"PARENT_TYPES",[...oe.USER_MANAGED_PARENT_TYPES]),f(oe,"MUTABLE_BASE_PROPERTIES",["name","description"]),f(oe,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),f(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),f(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"x","y"]),f(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),f(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),f(oe,"MUTABLE_UPSTREAM_PROPERTIES",[]),f(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),f(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),f(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),f(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),f(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),f(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let R=oe;var DP=(i=>(i.PersistChangeSet="persist-change-set",i.CreateSingle="create-single",i.CreateBulk="create-bulk",i.CreateSingleNested="create-single-nested",i.CreateBulkNested="create-bulk-nested",i.Update="update",i.Clone="clone",i.Delete="delete",i.Load="load",i.LoadNested="load-nested",i.LoadVersion="load-version",i))(DP||{});class OP extends qe{constructor(e){super(Rr,e);f(this,"id",He.Parallel);f(this,"name",He.Parallel);f(this,"description","Execute a list of actions one after the other");f(this,"version","1");f(this,"autoexecutable",!0);f(this,"initialData",Rr);f(this,"type",n.ActionDescriptor);f(this,"inputs",[]);f(this,"outputs",[]);f(this,"error",null);f(this,"project");this.project=e,this.inputs=Rr.inputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.outputs=Rr.outputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.error=Rr.error?V(Rr.error,this.project):null}}class PP extends qe{constructor(e){super(Ft,e);f(this,"id",Ft.id);f(this,"name",Ft.name);f(this,"description",Ft.description);f(this,"version",Ft.version);f(this,"autoexecutable",!1);f(this,"initialData",Ft);f(this,"type",n.ActionDescriptor);f(this,"inputs",[]);f(this,"outputs",[]);f(this,"error",null);f(this,"project");this.project=e,this.inputs=Ft.inputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.outputs=Ft.outputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.error=Ft.error?V(Ft.error,this.project):null}}class wP extends qe{constructor(e){super(ti,e);f(this,"id",He.Sequential);f(this,"name",He.Sequential);f(this,"description","Execute a list of actions one after the other");f(this,"version","1");f(this,"autoexecutable",!0);f(this,"initialData",ti);f(this,"type",n.ActionDescriptor);f(this,"inputs",[]);f(this,"outputs",[]);f(this,"error",null);f(this,"project");this.project=e,this.inputs=ti.inputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.outputs=ti.outputs.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.error=ti.error?V(ti.error,this.project):null}}class TJ extends qe{constructor(s){super(wa,s)}}class EJ extends qe{constructor(s){super(Xi,s)}}class IJ extends qe{constructor(e){super(Qi,e);f(this,"autoexecutable",!0)}getEntityToMatchInputMap(e){return e.inputs.find(t=>{var r;return((r=t.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].inputs.entityToMatch.id})||null}getDataToValidateInputMap(e){return e.inputs.find(t=>{var r;return((r=t.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].inputs.dataToValidate.id})||null}getOutputDataOutputMap(e){return e.outputs.find(t=>{var r;return((r=t.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].outputs.outputEntity.id})||null}getEntityToMatch(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"get-entity-to-match-validate-data"))){let r=null;if(e.readsValue){const d=e.readsValue.getDataType(t);d&&d.entity&&d.entity.type===n.DefinitionEntity&&(r=d.entity)}const a=e.getDefaultValue();return!r&&a&&a.valueAsTypeSingle&&!Array.isArray(a.valueAsTypeSingle)&&a.valueAsTypeSingle.type===n.DefinitionEntity&&(r=a.valueAsTypeSingle),r}syncOperationInstance(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-operation-instance-validate-data"))){const r=[],a=[],d=[],o=[],l=this.getEntityToMatchInputMap(e);if(l){const{added:c,updated:v,removed:E,affected:O}=this.syncEntityToMatchInputMapDataType(l,t);r.push(...v),a.push(...c),d.push(...E),o.push(...O)}const p=this.getDataToValidateInputMap(e);if(p){const{added:c,updated:v,removed:E,affected:O}=this.syncDataToValidateInputMapDataType(p,t);r.push(...v),a.push(...c),d.push(...E),o.push(...O)}const h=this.getOutputDataOutputMap(e);if(h){const{added:c,updated:v,removed:E,affected:O}=this.syncOutputDataOutputMapDataType(h,t);r.push(...v),a.push(...c),d.push(...E),o.push(...O)}return t==null||t.attemptAutoclose("sync-operation-instance-validate-data",this.id),{updated:u(r),added:u(a),removed:u(d),affected:u(o),self:e}}syncEntityToMatchInputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-entity-to-match-input-map-data-type"))){var p,h,c;const r=[],a=[],d=[],o=[];if(((p=e.declaration)==null?void 0:p.id)!==S.operation[Ke.Validate].inputs.entityToMatch.id)return t==null||t.attemptAutoclose("sync-entity-to-match-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!e.dataType){const v={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!0,entity:null,like:!0,inferred:!0,parent:e.toReference()},E=V(v,e.project);E.setParent(e,t),E.initChildren(t),t==null||t.add(E,b.Added),r.push(E),e.setDataType(E)}(h=e.dataType)==null||h.metaSync({inferred:!0,like:!1,asType:!0},t);const l=this.getEntityToMatch(e,t);return(c=e.dataType)==null||c.setEntity(l),e.dataType&&a.push(e.dataType),t==null||t.attemptAutoclose("sync-entity-to-match-input-map-data-type",this.id),{updated:u(a),added:u(r),removed:u(d),affected:u(o),self:e.dataType}}syncDataToValidateInputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-data-to-validate-input-map-data-type"))){var c,v,E;const r=[],a=[],d=[],o=[];if(((c=e.declaration)==null?void 0:c.id)!==S.operation[Ke.Validate].inputs.dataToValidate.id)return t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};const l=this.getEntityToMatchInputMap(e.parent);if(!l)return t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!this.getEntityToMatch(l,t))return t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!e.dataType){const O={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,like:!0,inferred:!0,parent:e.toReference()},w=V(O,e.project);w.setParent(e,t),w.initChildren(t),t==null||t.add(w,b.Added),r.push(w),e.setDataType(w)}(v=e.dataType)==null||v.metaSync({inferred:!0,like:!0,asType:!1},t);const h=this.getEntityToMatch(l,t);return(E=e.dataType)==null||E.setEntity(h),e.dataType&&a.push(e.dataType),t==null||t.attemptAutoclose("sync-data-to-validate-input-map-data-type",this.id),{updated:u(a),added:u(r),removed:u(d),affected:u(o),self:e.dataType}}syncOutputDataOutputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"sync-output-data-output-map-data-type"))){var c,v,E;const r=[],a=[],d=[],o=[];if(((c=e.declaration)==null?void 0:c.id)!==S.operation[Ke.Validate].outputs.outputEntity.id)return t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};const l=this.getEntityToMatchInputMap(e.parent);if(!l)return t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!this.getEntityToMatch(l,t))return t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:[],added:[],removed:[],affected:[],self:null};if(!e.dataType){const O={id:R.UUID.uuid(),version:R.UUID.uuid(),createdAt:(t==null?void 0:t.timestamp)||new Date().toISOString(),author:"1",previousVersion:null,deleted:!1,type:n.DataType,isList:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,like:!0,inferred:!0,parent:e.toReference()},w=V(O,e.project);w.setParent(e,t),w.initChildren(t),t==null||t.add(w,b.Added),r.push(w),e.setDataType(w)}(v=e.dataType)==null||v.metaSync({inferred:!0,like:!0,asType:!1},t);const h=this.getEntityToMatch(l,t);return(E=e.dataType)==null||E.setEntity(h),e.dataType&&a.push(e.dataType),t==null||t.attemptAutoclose("sync-output-data-output-map-data-type",this.id),{updated:u(a),added:u(r),removed:u(d),affected:u(o),self:e.dataType}}inferInputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"infer-input-map-data-type-validate-data"))){var r,a;if(((r=e.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].inputs.entityToMatch.id){const{added:d,updated:o,removed:l,affected:p}=this.syncEntityToMatchInputMapDataType(e,t);return t==null||t.attemptAutoclose("infer-input-map-data-type-validate-data",this.id),{updated:u(o),added:u(d),removed:u(l),affected:u(p),self:e.dataType}}else if(((a=e.declaration)==null?void 0:a.id)===S.operation[Ke.Validate].inputs.dataToValidate.id){const{added:d,updated:o,removed:l,affected:p}=this.syncDataToValidateInputMapDataType(e,t);return t==null||t.attemptAutoclose("infer-input-map-data-type",this.id),{updated:u(o),added:u(d),removed:u(l),affected:u(p),self:e.dataType}}return{updated:[],added:[],removed:[],affected:[],self:null}}inferOutputMapDataType(e,t=this.project.addChangeSet(new A(this.project,"",T().toISOString(),this,!0,"infer-output-map-data-type-validate-data"))){var r;if(((r=e.declaration)==null?void 0:r.id)===S.operation[Ke.Validate].outputs.outputEntity.id){const{added:a,updated:d,removed:o,affected:l}=this.syncOutputDataOutputMapDataType(e,t);return t==null||t.attemptAutoclose("infer-output-map-data-type-validate-data",this.id),{updated:u(d),added:u(a),removed:u(o),affected:u(l),self:e.dataType}}return{updated:[],added:[],removed:[],affected:[],self:null}}}class bJ extends qe{constructor(s){super(ul,s)}}class RJ extends qe{constructor(s){super(cl,s)}}class AJ extends qe{constructor(s){super(fl,s)}}class DJ extends qe{constructor(s){super(ks,s)}}class OJ extends qe{constructor(s){super(Fs,s)}}class PJ extends qe{constructor(s){super(Pa,s)}}function wJ(i){const s=[new wP(i),new OP(i),new PP(i),new TJ(i),new EJ(i),new IJ(i),new DJ(i),new bJ(i),new AJ(i),new RJ(i),new OJ(i),new PJ(i),new qe(ll,i),new qe(dl,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.operationDeclarations=s,s}class VP extends Yr{constructor(e){super(Ot,e);f(this,"initialData");f(this,"id",z.PERSISTED_ENTITY);f(this,"version","1");f(this,"name",z.PERSISTED_ENTITY);f(this,"description",Ot.description);f(this,"type",n.BuiltInBaseEntity);f(this,"abstract",Ot.abstract);f(this,"static",Ot.static);f(this,"properties",[]);f(this,"methods",[]);f(this,"abstractMethods",[]);f(this,"extends",[]);f(this,"errors",[]);f(this,"project");this.initialData=Ot,this.project=e,this.id=Ot.id,this.version=Ot.version,this.name=Ot.name,this.static=Ot.static,this.abstract=Ot.abstract,this.properties=this.initialData.properties.map(t=>{const r=V(t,this.project);return r.setParent(this,null),r.initChildren(null),r}),this.methods=this.initialData.methods.map(t=>{const r=V(t,this.project);return r.parent=this,r}),this.abstractMethods=this.initialData.abstractMethods.map(t=>{const r=V(t,this.project);return r.parent=this,r}),this.extends=this.initialData.extends.map(t=>V(t,this.project))}}function VJ(i){const s=[new VP(i),new Yr(ga,i),new Yr(gr,i),new Yr(so,i)];return s.forEach(e=>{i.subscribeBuiltInInstance(e)}),i.builtInBaseEntities=s,s}function CJ(i){const s=[new fr(ne,i),new fr(Kr,i),new fr(me,i),new fr(At,i),new fr(Xr,i),new fr(Br,i),new fr(Qr,i),new fr($n,i)];return s.forEach(e=>{i.subscribeBuiltInInstance(e)}),i.primitives=s,s}function BJ(i){const s=[new qe(lo,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.globalEventActionDescriptors=s,s}function _J(i){const s=[new qe(_a,i),new qe(mi,i),new qe(Ca,i),new qe(Sn,i),new qe(xn,i),new qe(Ks,i)];s.forEach(t=>{t.initChildren(null),i.subscribeBuiltInInstance(t)}),i.loopDeclarations=s;const e=[new qe(to,i),new qe(Ba,i),new qe(Qs,i),new qe(Pl,i),new qe(Vl,i),new qe(Xs,i)];return e.forEach(t=>{t.initChildren(null),i.subscribeBuiltInInstance(t)}),i.loopDeclarationsBodies=e,s}function MJ(i){const s=[new Si(uo,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.valueDescriptors=s,s}function gJ(i){const s=[new qe(an,i),new qe(Wn,i)];return s.forEach(e=>{e.initChildren(null),i.subscribeBuiltInInstance(e)}),i.operationDeclarations=s,s}const gn={},Xd={};async function NJ(i,s={}){const e={...ZA};return e.id=i.id,s.empty?{data:{id:i.id,type:n.Project,version:R.UUID.uuid(),createdAt:T().toISOString(),author:"1",previousVersion:null,deleted:!1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:e}}function Jc(i){const s=new R(i);return CJ(s),VJ(s),wJ(s),BJ(s),_J(s),MJ(s),gJ(s),Array.from(new Set([...s.getAllBuiltInIds(),...Wr()])).forEach(t=>{!s.builtInInstances[t]&&s.instances[t]&&(s.builtInInstances[t]=s.instances[t],delete s.instances[t])}),s}function Wc(i,s){return i.instancesList.filter(t=>T(t.createdAt).isAfter(T(s)||!!t.previousVersion))}function LJ(i,{enrich:s}={enrich:!0}){const e=new Map,t=Array.from(new Set([...i.getAllBuiltInIds(),...Wr()]));Object.keys(i.instances).forEach(p=>{if(t.includes(p)){e.set(p,p);return}const h=i.get(p);if(!Kd(h,{...i.instances,...i.builtInInstances}).every(E=>!t.includes(E))){e.set(p,p);return}e.set(p,R.UUID.uuid())});const r=T().toISOString(),a=i.toShallowJSON({seenEntityMaps:e});a.previousVersion=null,a.createdAt=r,a.version=R.UUID.uuid();const d=Jc(a),o=s?d.addChangeSet(new A(d,"",r,d)):null,l=new Bc(i);return l.visit(p=>{const h=p.toShallowJSON({seenEntityMaps:e});h.previousVersion=null,h.createdAt=r,h.version=R.UUID.uuid();const c=V(h,d);c.hydrateAncestors(),c.addSelfToProject(o),o==null||o.add(c,b.Added)}),s?(l.visit(p=>{const h=d.get(e.get(p.id));h&&h.afterAllChildrenInitialized(o)}),d.afterAllChildrenInitialized(o)):Wc(d,r).forEach(h=>{h.remove({ignoreUpstream:!0},null)}),d.instancesList.forEach(p=>{p.previousVersion=null}),o==null||o.close(),d}function CP(i,{enrich:s}={enrich:!0}){const e=Jc(i),t=T().toISOString(),r=s?e.addChangeSet(new A(e,"",t,e)):null;r&&(r.type=hc.Automatic);const a=new Bc(i);return a.visit(d=>{const o=V(d,e);o.hydrateAncestors(),o.addSelfToProject(r)}),s?(a.visit(d=>{const o=e.get(d.id);o&&o.afterAllChildrenInitialized(r)}),e.afterAllChildrenInitialized(r)):Wc(e,t).forEach(o=>{o.remove({ignoreUpstream:!0},null)}),r==null||r.close(),e}async function UJ(i,s={}){if(i.id&&gn[i.id])return gn[i.id];if(i.id&&Xd[i.id])return await Xd[i.id],gn[i.id];const e=NJ(i,s);i.id&&(Xd[i.id]=e);const t=await e;if(t.data){const r=CP(t.data);return gn[i.id]=r,i.id&&delete Xd[i.id],r}return null}function jJ(i){return gn[i.id]&&delete gn[i.id],null}const $J="test_primitive_entities_export";y.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=Pc,y.ALL_BUILT_IN_BASE_ENTITIES=CE,y.ALL_BUILT_IN_CONDITION_ENTITIES=kE,y.ALL_BUILT_IN_GLOBAL_EVENT_ENTITIES=qE,y.ALL_BUILT_IN_LOOP_BODY_ENTITIES=aT,y.ALL_BUILT_IN_LOOP_ENTITIES=nT,y.ALL_BUILT_IN_OPERATION_ENTITIES=m0,y.ALL_BUILT_IN_PRIMITIVE_ENTITIES=of,y.ALL_BUILT_IN_TOP_LEVEL_ENTITIES=zE,y.ALL_BUILT_IN_VALUE_DESCRIPTORS=YE,y.ActionDescriptorState=qe,y.ActionInputMapState=lq,y.ActionOutputMapState=cq,y.AppendToListOperationInputIds=hh,y.AppendToListOperationOutputIds=mh,y.ArgumentDeclarationDependencyField=tO,y.ArgumentDeclarationState=Fi,y.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=Rc,y.BUILT_IN_BASE_ENTITY_IDS=S,y.BUILT_IN_ENTITY_TYPES=hr,y.BaseCanvasDraggableState=pJ,y.BaseEntityNames=z,y.BaseState=uJ,y.BaseValueDescriptorIds=Gs,y.BreakStatementDependencyField=vc,y.BreakStatementState=Cn,y.BuiltInBaseEntityState=Yr,y.CACHED_PROJECTS_BY_ID=gn,y.CALLABLE_ENTITIES_EXPLANATION=Iq,y.CALLABLE_TYPES=Vr,y.CALLER_ENTITIES_EXPLANATION=sO,y.CALLER_TYPES=Cr,y.CALLS_UPDATE_EXPLANATION=ki,y.COMPARISON_CONDITIONS=SE,y.CONDITIONS=xE,y.CUSTOM_ENTITY_OPERATIONS=Nm,y.CallableEntityClass=fJ,y.CallerEntityClass=qc,y.ChangeSet=A,y.ChangeSetChangeCaptureType=hc,y.ChangeSetEntityChangeType=b,y.ChildEntityState=cJ,y.ComparisonOperatorTypes=pt,y.ConditionDependencyField=z1,y.ConditionState=Li,y.ContinueStatementDependencyField=mc,y.ContinueStatementState=$t,y.CreateNewInputIds=dm,y.CreateNewOutputIds=lm,y.DRAGGABLE_CALLABLE_TYPES=rl,y.DRAGGABLE_CALLER_TYPES=Kc,y.DRAGGABLE_ELEMENT_TYPES=$s,y.DRAGGABLE_EXECUTABLE_TYPES=NP,y.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=js,y.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES_WITH_OUTPUTS=tl,y.DataTypeCompatibilityTypes=Er,y.DataTypeDependencyField=q1,y.DataTypeParentChildRelation=Rt,y.DataTypeState=wn,y.DefinitionEntityDependencyField=bP,y.DefinitionEntityState=zi,y.EDITABLE_PERSISTANCE_REPOSITORY_DEFAULTS=dJ,y.ENTITIES_WITH_VALLUES_EXPLANATION=Ld,y.ENTITY_PERSISTANCE_OPTIONS_DEFAULTS=L,y.ENTITY_RECUSION_OPTIONS_DEFAULTS=Z,y.ENTITY_TYPES=LP,y.ENTITY_WITH_DECLARATION_TYPES=MP,y.ENTITY_WITH_LOGIC_SCOPE_TYPES=mt,y.ENTITY_WITH_NAMES_TYPES=Xc,y.ENTITY_WITH_PARENT_TYPES=BP,y.ENTITY_WITH_USER_MANAGED_DECLARATION_TYPES=zc,y.ENTITY_WITH_USER_MANAGED_SINGLE_IMPLEMENTS_TYPES=_P,y.ENTITY_WITH_VALUE_TYPES=Yc,y.ENTRY_POINT_ENTITIES_EXPLANATION=Ps,y.ENTRY_POINT_TYPES=at,y.EVENT_TYPES=jn,y.EXECUTABLE_TYPES=gP,y.EXECUTION_OPERATIONS=om,y.EntityAction=DP,y.EntityError=hn,y.EntityErrorSeverity=D,y.EntityGenerationError=P,y.EntityGenerationErrorCode=I,y.EntityInstanceErrorCode=q,y.EntityOperations=Ke,y.EntityType=n,y.EntityWithLogicScopeClass=vJ,y.EntityWithValueClass=mJ,y.EntryPointEntityClass=yJ,y.ExecutionOperations=He,y.ExecutionTerminationType=W1,y.FunctionCallDependencyField=mO,y.FunctionCallState=qi,y.FunctionDeclarationDependencyField=Z1,y.FunctionDeclarationState=Mi,y.GLOBAL_EVENT_DECLARATIONS=ZE,y.GetLastInListOperationInputIds=ih,y.GetLastInListOperationOutputIds=nh,y.GlobalEventNames=Hr,y.GlobalEventState=Vn,y.HTTPOperations=Ct,y.HTTP_OPERATIONS=y0,y.InputMapDependencyField=Q1,y.InputMapState=kr,y.InstalledProjectState=Gi,y.InternalCallDependencyField=X1,y.InternalCallState=Bn,y.JoinListOperationInputIds=Ay,y.JoinListOperationOutputIds=Dy,y.LIST_OPERATIONS=Ch,y.ListOperations=fe,y.LiteralValueDependencyField=rO,y.LiteralValueState=_n,y.LoopDependencyField=Y1,y.LoopState=Ni,y.LoopTypes=X,y.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Zi,y.NUMBER_OPERATIONS=jf,y.NumberOperations=Xe,y.OPERATION_DECLARATIONS=h0,y.OperationDependencyField=J1,y.OperationState=gi,y.OutputMapDependencyField=eO,y.OutputMapParentChildRelation=Un,y.OutputMapState=Zr,y.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=Ud,y.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=xi,y.PASS_THROUGH_CALLABLE_TYPES=nt,y.PASS_THROUGH_CALLABLE_TYPES_WITH_OUTPUTS=Hc,y.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=Oc,y.ParallelExecutionOperation=OP,y.PassThroughCallableEntityClass=hJ,y.PersistedEntity=VP,y.PersistedEntityMethods=sr,y.PrimitiveEntityState=fr,y.PrimitiveTypes=g,y.ProjectState=R,y.PropertyDependencyField=x1,y.PropertyState=Bi,y.READ_ONLY_ENTITY_PERSISTANCE_REPOSITORY=AP,y.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=bq,y.ReturnDeclarationDependencyField=k1,y.ReturnDeclarationState=rr,y.ReturnStatementDependencyField=_d,y.ReturnStatementState=_i,y.STANDALONE_CONDITIONS=ME,y.STRING_OPERATIONS=Ry,y.ScopeCompatibilityType=Hd,y.SearchDependencyField=K1,y.SearchState=$i,y.SequentialExecutionOperation=wP,y.SequentialExecutionOperationInputIds=Yh,y.SequentialExecutionOperationOutputIds=zh,y.SharedEntityErrorCode=j,y.SharedStateFunctionality=RP,y.SplitListOperationInputIds=Gy,y.SplitListOperationOutputIds=Fy,y.StandaloneOperatorTypes=yr,y.StringOperations=Ee,y.TERMINATION_TYPES=st,y.Traverser=Bc,y.USER_MANAGED_ENTITY_TYPES=Qc,y.UserManagedEntityStateTemplate=lJ,y.VALUE_READING_ENTITIES_EXPLANATION=Dc,y.VALUE_READING_TYPES=hi,y.VALUE_WRITING_ENTITIES_EXPLANATION=oO,y.VALUE_WRITING_TYPES=ht,y.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=Ac,y.VARIABLE_TYPES=Qe,y.ValueAutogenerationType=yt,y.ValueDescriptorDependencyField=iO,y.ValueDescriptorParentChildRelation=M,y.ValueDescriptorState=Si,y.ValueReadingEntityClass=yi,y.ValueWritingEntityClass=gs,y.VariableDeclarationDependencyField=H1,y.VariableDeclarationState=ji,y.VariableInputMapState=dq,y.VariableInstanceDependencyField=Tc,y.VariableInstanceState=Ui,y.VariableOutputMapState=pq,y.WaitOperation=PP,y.WaitOperationInputIds=Sh,y.WaitOperationOutputIds=xh,y.appendToListOperation=ks,y.appendToListOperationElementToAppendArgument=hl,y.appendToListOperationElementToAppendArgumentParentRef=Dh,y.appendToListOperationElementToAppendArgumentRef=Eh,y.appendToListOperationError=Vh,y.appendToListOperationErrorParentRef=wh,y.appendToListOperationListArgument=yl,y.appendToListOperationListArgumentParentRef=Ah,y.appendToListOperationListArgumentRef=vh,y.appendToListOperationListDataType=Th,y.appendToListOperationResultListDataType=Rh,y.appendToListOperationResultListReturn=Ph,y.appendToListOperationResultListReturnParentRef=Oh,y.appendToListOperationResultListReturnRef=bh,y.appendToListOperationSecondListDataType=Ih,y.asGenerationActionExample=qr,y.booleanPrototype=Kr,y.capitalizeFirstLetter=Wt,y.changeSetJSONRecordToUniqueIds=G7,y.checkAreDataTypesCompatible=Ir,y.checkAreDefinitionEntitiesCompatibleAsDataType=C1,y.checkArePropertiesCompatibleAsDataType=V1,y.checkHasMetadataChanged=dt,y.checkIsBranchDependentButNotDirectlyOnBranch=Vs,y.checkIsBranchDependentOnBranch=Bq,y.checkIsCallableEntityReachable=Ms,y.checkIsCanvasEntity=zq,y.checkIsDetachedBranch=hP,y.checkIsDetachedBranchShallow=kc,y.checkIsGlobalVariable=Jq,y.checkIsGloballyDeclared=xc,y.checkIsMethod=TP,y.checkIsNestedScope=zd,y.checkScopeCompatibility=_s,y.cloneProject=LJ,y.countedLoopActionDescriptor=_a,y.countedLoopActionDescriptorDynamicReturnDeclaration=Hv,y.countedLoopActionDescriptorDynamicReturnDeclarationParentRef=zv,y.countedLoopActionDescriptorStringArgumentDeclaration=Yv,y.countedLoopActionDescriptorStringArgumentDeclarationDataType=Jv,y.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValue=Zv,y.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValueParentRef=kv,y.countedLoopActionDescriptorStringArgumentDeclarationDataTypeParentRef=qv,y.countedLoopActionDescriptorStringArgumentDeclarationParentRef=Wv,y.countedLoopBodyActionDescriptor=to,y.countedLoopBodyActionDescriptorAnyDynamicArgument=tT,y.countedLoopBodyActionDescriptorAnyDynamicArgumentParentRef=eT,y.countedLoopBodyActionDescriptorAnyDynamicReturn=iT,y.countedLoopBodyActionDescriptorAnyDynamicReturnParentRef=rT,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Bl,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Xv,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Kv,y.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Qv,y.createDefinitionEntityFromJSONObject=Sd,y.createEntityError=ye,y.createNestedDataTypeForEntity=EO,y.createNewInstanceOperation=Xi,y.createNewInstanceOperationEntityToInstanciateArgument=vm,y.createNewInstanceOperationEntityToInstanciateArgumentRef=ym,y.createNewInstanceOperationEntityToInstanciateDataType=hm,y.createNewInstanceOperationError=bm,y.createNewInstanceOperationErrorParentRef=Im,y.createNewInstanceOperationNewEntityDataArgument=fm,y.createNewInstanceOperationNewEntityDataArgumentDataType=cm,y.createNewInstanceOperationNewEntityDataArgumentDataTypeParentRef=pm,y.createNewInstanceOperationNewEntityDataArgumentParentRef=um,y.createNewInstanceOperationOutputEntityDeclaration=Em,y.createNewInstanceOperationOutputEntityDeclarationParentRef=Tm,y.createNewInstanceOperationRef=mm,y.createSemanticId=S1,y.createStateFromGenerationTargetType=oJ,y.createStateFromType=lt,y.createStateFromTypeAndSubscribe=V,y.cronJobBuiltInBaseEntity=so,y.cronJobBuiltInBaseEntityExpressionProperty=wE,y.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=xP,y.cronJobBuiltInBaseEntityExpressionPropertyRef=OE,y.cronJobBuiltInBaseEntityRef=PE,y.cronJobTriggeredFunctionDeclarationBlueprint=Zl,y.cronJobTriggeredFunctionDeclarationBlueprintParentRef=AE,y.dataTypeCompatibilityToErrorExplanation=hO,y.datePrototype=Br,y.dateValueAutogenerationSchema=ip,y.definitionEntityToZodSchema=pI,y.deletePersistedEntityMethod=kl,y.deletePersistedEntityMethodParentRef=dE,y.deleteRootProject=jJ,y.endpointBuiltInBaseEntity=ga,y.endpointBuiltInBaseEntityRef=lT,y.endpointBuiltInBaseEntityRefFour=ZT,y.endpointBuiltInBaseEntityRefThree=TT,y.endpointBuiltInBaseEntityRefTwo=yT,y.endpointBuiltInCorsProperty=uT,y.endpointBuiltInCorsPropertyDataType=dT,y.endpointBuiltInCorsPropertyDataTypeRef=sT,y.endpointBuiltInCorsPropertyRef=oT,y.endpointBuiltInMethodProperty=Ml,y.endpointBuiltInMethodPropertyDataType=vT,y.endpointBuiltInMethodPropertyDataTypeRef=hT,y.endpointBuiltInMethodPropertyRef=mT,y.endpointBuiltInPathProperty=_l,y.endpointBuiltInPathPropertyDataType=fT,y.endpointBuiltInPathPropertyDataTypeRef=pT,y.endpointBuiltInPathPropertyRef=cT,y.endpointPathParamsArgumentDeclaration=Nl,y.endpointPathParamsArgumentDeclarationRef=VT,y.endpointPathParamsVariableDataType=CT,y.endpointPathParamsVariableDataTypeRef=wT,y.endpointReachedTriggerActionDescriptor=Fl,y.endpointReachedTriggerActionDescriptorRef=BT,y.endpointReachedTriggerActionDescriptorRefFour=gT,y.endpointReachedTriggerActionDescriptorRefThree=MT,y.endpointReachedTriggerActionDescriptorRefTwo=_T,y.endpointRequestBodyArgumentDeclaration=Ul,y.endpointRequestBodyArgumentDeclarationRef=RT,y.endpointRequestBodyVariableDataType=AT,y.endpointRequestHeadersArgumentDeclaration=gl,y.endpointRequestHeadersArgumentDeclarationRef=IT,y.endpointRequestHeadersVariableDataType=bT,y.endpointRequestHeadersVariableDataTypeRef=ET,y.endpointRequestQueryParamsArgumentDeclaration=Ll,y.endpointRequestQueryParamsArgumentDeclarationRef=OT,y.endpointRequestQueryParamsVariableDataType=PT,y.endpointRequestQueryParamsVariableDataTypeRef=DT,y.endpointResponseBodyDataType=xT,y.endpointResponseBodyReturnDeclaration=Gl,y.endpointResponseBodyReturnDeclarationRef=ST,y.endpointResponseCodeDataType=LT,y.endpointResponseCodeReturnDeclaration=jl,y.endpointResponseCodeReturnDeclarationRef=NT,y.endpointResponseHeadersDataType=GT,y.endpointResponseHeadersDataTypeRef=jT,y.endpointResponseHeadersReturnDeclaration=$l,y.endpointResponseHeadersReturnDeclarationRef=$T,y.endpointReturnStatementRef=UT,y.endpointReturnStatementRefThree=kT,y.endpointReturnStatementRefTwo=FT,y.enrichFromKnownEntities=Cs,y.enumOptionsProperty=sf,y.enumOptionsPropertyDataType=nf,y.enumOptionsPropertyDataTypeRef=tf,y.enumOptionsPropertyRef=rf,y.enumPrototype=Xr,y.enumPrototypeRef=af,y.executionBuiltInBaseEntity=oo,y.executionBuiltInEntityAbortMethod=ql,y.executionBuiltInEntityAbortMethodParentRef=VE,y.filterOutDuplicateEntities=u,y.filterOutDuplicateErrors=q9,y.findEntityFromKeys=_c,y.findReferenceToSelfInList=NO,y.findReferencesToSelfInProject=Gq,y.flattenActionDescriptor=LO,y.flattenArgumentDeclaration=UO,y.flattenBreakStatement=jO,y.flattenBuiltInBaseEntity=$O,y.flattenCalls=Jr,y.flattenCanvasAncestorsUntil=xd,y.flattenCondition=GO,y.flattenContinueStatement=FO,y.flattenDataType=xO,y.flattenDefinitionEntity=SO,y.flattenDefinitionEntityExtensionAndImplementationTypes=Gc,y.flattenDefinitionEntityExtensionTypes=Yd,y.flattenDefinitionEntityExtensions=jc,y.flattenDefinitionEntityImplementations=$c,y.flattenDefinitionEntityImplementionTypes=Wd,y.flattenDerivedCanvasEntities=ir,y.flattenDetachedBranch=vP,y.flattenElementCalls=it,y.flattenElementCallsOnTheSameScope=$q,y.flattenEntity=N,y.flattenFunctionCall=kO,y.flattenFunctionDeclaration=ZO,y.flattenGlobalEvent=qO,y.flattenInputMap=JO,y.flattenInstalledProject=WO,y.flattenInternalCall=YO,y.flattenLiteralValue=zO,y.flattenLoop=HO,y.flattenOperation=KO,y.flattenOutputMap=XO,y.flattenPrimitiveEntity=QO,y.flattenProject=eP,y.flattenProjectElements=gO,y.flattenProperty=tP,y.flattenRelatedCanvasElementsOnTheLeft=fP,y.flattenRelatedCanvasElementsOnTheRight=cP,y.flattenReturnDeclaration=rP,y.flattenReturnStatement=iP,y.flattenSearch=nP,y.flattenValueDescriptor=aP,y.flattenVariableDeclaration=sP,y.flattenVariableInstance=oP,y.flattenVariableReads=MO,y.flattenVariableWrites=_O,y.flattenVariables=We,y.fromChangeSetToRecordChangeSet=iJ,y.fromZodParseToEntityGenerationErrors=Ec,y.generate=JV,y.generateActionExample=Rq,y.generateExecutionDataType=C7,y.generateIdFromStrategy=ct,y.generateMutablePropertiesExplanation=Md,y.generateRandomBoolean=$I,y.generateRandomDate=hI,y.generateRandomDateAfter=cI,y.generateRandomDateBefore=fI,y.generateRandomDateBetweenRange=yI,y.generateRandomNumber=gI,y.generateRandomNumberAfter=BI,y.generateRandomNumberBefore=_I,y.generateRandomNumberBetweenRange=MI,y.generateRandomText=jI,y.generateRandomTextAfter=NI,y.generateRandomTextBefore=LI,y.generateRandomTextBetweenRange=UI,y.generateUniqueUUID=CI,y.getAllActionDescriptorsForConditions=Gd,y.getAllActionDescriptorsForGlobalEvents=jd,y.getAllActionDescriptorsForLoops=$d,y.getAllActionDescriptorsForOperations=Pq,y.getAllBuiltInEntityIds=Wr,y.getAllGloballyDeclaredFunctionDeclarationsExplanation=cO,y.getBaseBuiltInEntities=Wi,y.getBaseSchemaBasedOnType=nO,y.getBuiltInEntityOwner=Yi,y.getCallableEntityReferenceSchema=Dt,y.getCallableEntityTypeSchema=mD,y.getCalledBy=cr,y.getCallerEntityReferenceSchema=z3,y.getCallerEntityTypeSchema=Y3,y.getCalls=Nc,y.getCanvasEntitiesDerivedFromInternalCalls=pP,y.getCanvasEntitiesDerivedFromWrites=Ra,y.getCanvasEntityDerivedFromValueReadingEntity=Jd,y.getCanvasEntityDerivedFromValueReadingEntityFromTransfer=uP,y.getCanvasEntityReferenceSchema=c5,y.getCanvasEntityTypeSchema=p5,y.getChildrenEntityWithValues=Mq,y.getColumnProperties=eJ,y.getCommonAncestor=gc,y.getCommonChildren=IO,y.getDatabaseEntities=Xq,y.getDatabaseEntity=tJ,y.getDeclaration=Pn,y.getDeepestScope=IP,y.getDefinitionEntityExtends=Aa,y.getDraggableCallableEntityReferenceSchema=TD,y.getDraggableCallableEntityTypeSchema=vD,y.getDraggableCallerEntityReferenceSchema=K3,y.getDraggableCallerEntityTypeSchema=H3,y.getDraggableExecutableEntityReferenceSchema=t5,y.getDraggableExecutableEntityTypeSchema=e5,y.getDraggablePassThroughCallableEntityReferenceSchema=vd,y.getDraggablePassThroughCallableEntityTypeSchema=md,y.getDraggablePlayableEntityReferenceSchema=s5,y.getDraggablePlayableEntityTypeSchema=a5,y.getEntitiesCreatedSinceInitialization=Wc,y.getEntityArgumentDeclarations=Uc,y.getEntityInputMaps=dP,y.getEntityOutputMaps=kq,y.getEntityReferenceSchema=u5,y.getEntityReturnDeclarations=lP,y.getEntityTypeSchema=l5,y.getEntityWithLogicScopeReferenceSchema=ui,y.getEntityWithLogicScopeTypeSchema=r5,y.getEntityWithValueReferenceSchema=hD,y.getEntityWithValueTypeSchema=W3,y.getEntryPointEntityReferenceSchema=bt,y.getEntryPointEntityTypeSchema=wi,y.getEventEntityReferenceSchema=yd,y.getEventEntityTypeSchema=fd,y.getExecutableEntityReferenceSchema=Q3,y.getExecutableEntityTypeSchema=X3,y.getExtendedBuiltInEntity=Zq,y.getExtendedDefinitionEntity=Fc,y.getGenerationTargetSchemaBasedOnType=aO,y.getHeadIfPartOfDetachedBranch=mP,y.getHighestScope=EP,y.getImplementedBuiltInEntity=qq,y.getIsInteractive=Sc,y.getLastInListOperation=fl,y.getLastInListOperationError=yh,y.getLastInListOperationErrorParentRef=fh,y.getLastInListOperationInputListArgument=uh,y.getLastInListOperationInputListArgumentParentRef=lh,y.getLastInListOperationInputListArgumentRef=ah,y.getLastInListOperationInputListDataType=sh,y.getLastInListOperationOutputElementDataType=dh,y.getLastInListOperationOutputElementReturn=ch,y.getLastInListOperationOutputElementReturnParentRef=ph,y.getLastInListOperationOutputElementReturnRef=oh,y.getLinkedEntitiesFromArgumentDeclaration=jq,y.getLowestPersistedEntityImplementation=yP,y.getParentCallableEntity=bO,y.getParentCallerEntity=AO,y.getParentCanvasEntities=Yt,y.getParentCanvasEntity=wt,y.getParentCanvasEntityFromTransfer=kd,y.getParentEntryPoint=_q,y.getParentPassthroughCallableEntity=RO,y.getPassThroughCallableEntityReferenceSchema=et,y.getPassThroughCallableEntityTypeSchema=hd,y.getPeristedEntities=Kq,y.getPlayableEntityReferenceSchema=n5,y.getPlayableEntityTypeSchema=i5,y.getProject=UJ,y.getPrototypeByType=Bs,y.getRecusriveParentsIds=Kd,y.getReferenceEntityId=B,y.getReferencedEntitiesStateOrErrors=Nd,y.getReferencedEntityStateOrErrors=Ic,y.getReferencedIds=qd,y.getRelatedCanvasElementsOnTheLeft=Mn,y.getRelatedCanvasElementsOnTheLeftFromTransfer=Fq,y.getRelatedCanvasElementsOnTheRight=Ji,y.getRootEntryPointScopeOwner=Zc,y.getScopeOwner=zt,y.getStateClassFromType=rJ,y.getTerminationReferenceSchema=d5,y.getTerminationTypeSchema=o5,y.getUsedArgFromDeclaration=Sq,y.getUsedReturnFromDeclaration=xq,y.getValueReadingEntityReferenceSchema=yD,y.getValueReadingEntityTypeSchema=li,y.getValueWritingEntityReferenceSchema=J3,y.getValueWritingEntityTypeSchema=ms,y.getVariableFromInputMapping=OO,y.getVariableFromReturnVariablePointer=VO,y.getVariableReferenceSchema=Pi,y.getVariableTypeSchema=In,y.getVariablesFromArgumentDeclarations=Zd,y.getVariablesFromInputMaps=PO,y.getVariablesFromOutputMapping=CO,y.getVariablesFromOutputMaps=BO,y.getVariablesFromReturnDeclarations=wO,y.getVariablesInSameOrHigherScope=dc,y.getWrites=Lc,y.groupCallsBasedOnParallelizableExecution=Nq,y.handleAfterEntityImplementationSideEffects=TO,y.handleBeforeEntityImplementationSideEffects=vO,y.httpRequestBodyArgument=Ws,y.httpRequestBodyArgumentRef=Wm,y.httpRequestBodyDataType=Ym,y.httpRequestHeadersArgument=Js,y.httpRequestHeadersArgumentRef=qm,y.httpRequestHeadersDataType=Jm,y.httpRequestMethodArgument=Zs,y.httpRequestMethodArgumentRef=km,y.httpRequestMethodDataType=Zm,y.httpRequestMethodDataTypeRef=Sm,y.httpRequestOperation=wa,y.httpRequestOperationErrorValueDescriptor=bl,y.httpRequestOperationErrorValueDescriptorDatatype=f0,y.httpRequestOperationErrorValueDescriptorRef=c0,y.httpRequestOperationRef=d0,y.httpRequestOperationRefEight=u0,y.httpRequestOperationRefFive=s0,y.httpRequestOperationRefFour=a0,y.httpRequestOperationRefNine=p0,y.httpRequestOperationRefSeven=l0,y.httpRequestOperationRefSix=o0,y.httpRequestOperationRefThree=n0,y.httpRequestOperationRefTwo=i0,y.httpRequestQueryParamsArgument=Il,y.httpRequestQueryParamsArgumentRef=Gm,y.httpRequestQueryParamsDataType=Fm,y.httpRequestVariableURLArgument=qs,y.httpRequestVariableURLArgumentRef=jm,y.httpRequestVariableURLDataType=$m,y.httpRequestVariableURLDataTypeRef=Lm,y.httpResponseBodyReturnDataType=r0,y.httpResponseBodyReturnDataTypeRef=e0,y.httpResponseBodyReturnReturn=Hs,y.httpResponseBodyReturnReturnRef=t0,y.httpResponseCodeDataType=Hm,y.httpResponseCodeReturn=Ys,y.httpResponseCodeReturnRef=zm,y.httpResponseHeadersDataType=Qm,y.httpResponseHeadersDataTypeRef=Km,y.httpResponseHeadersReturn=zs,y.httpResponseHeadersReturnRef=Xm,y.implement=Fd,y.inferArgumentDeclarationDataType=B1,y.inferDataType=xr,y.inferInputMapDataType=ac,y.inferOutputMapDataType=oc,y.inferPropertyDataType=g1,y.inferReturnDeclarationDataType=sc,y.inferValueDescriptorDataType=N1,y.inferVariableDeclarationDataType=M1,y.inferVariableInstanceDataType=_1,y.initBaseProjectEntity=Jc,y.initProject=CP,y.isPromise=Cc,y.iterateOverListActionDescriptorListArgumentDeclaration=W0,y.iterateOverListActionDescriptorListArgumentDeclarationDataType=q0,y.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=Z0,y.iterateOverListActionDescriptorListArgumentDeclarationParentRef=J0,y.iterateOverListLoopActionDescriptor=mi,y.iterateOverListLoopActionDescriptorDynamicReturnDeclaration=z0,y.iterateOverListLoopActionDescriptorDynamicReturnDeclarationParentRef=Y0,y.iterateOverListLoopBodyActionDescriptor=Ba,y.iterateOverListLoopBodyActionDescriptorAnyDynamicArgument=nv,y.iterateOverListLoopBodyActionDescriptorAnyDynamicArgumentParentRef=iv,y.iterateOverListLoopBodyActionDescriptorAnyDynamicReturn=sv,y.iterateOverListLoopBodyActionDescriptorAnyDynamicReturnParentRef=av,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclaration=eo,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=K0,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=H0,y.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=X0,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclaration=rv,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=ev,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Q0,y.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=tv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclaration=pv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataType=lv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataTypeParentRef=dv,y.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationParentRef=uv,y.iterateOverObjectKeysLoopActionDescriptor=Sn,y.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclaration=fv,y.iterateOverObjectKeysLoopActionDescriptorDynamicReturnDeclarationParentRef=cv,y.iterateOverObjectKeysLoopBodyActionDescriptor=Pl,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgument=Rv,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicArgumentParentRef=bv,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturn=Dv,y.iterateOverObjectKeysLoopBodyActionDescriptorAnyDynamicReturnParentRef=Av,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Ol,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=hv,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=yv,y.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=mv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Iv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Tv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=vv,y.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Ev,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclaration=Cv,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataType=wv,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataTypeParentRef=Pv,y.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationParentRef=Vv,y.iterateOverObjectValuesLoopActionDescriptor=xn,y.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclaration=_v,y.iterateOverObjectValuesLoopActionDescriptorDynamicReturnDeclarationParentRef=Bv,y.iterateOverObjectValuesLoopBodyActionDescriptor=Vl,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgument=Fv,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicArgumentParentRef=Gv,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturn=xv,y.iterateOverObjectValuesLoopBodyActionDescriptorAnyDynamicReturnParentRef=Sv,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclaration=wl,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=gv,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=Mv,y.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Nv,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclaration=$v,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Uv,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Lv,y.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=jv,y.iterateOverStringActionDescriptorDynamicReturnDeclaration=M0,y.iterateOverStringActionDescriptorDynamicReturnDeclarationParentRef=_0,y.iterateOverStringActionDescriptorStringArgumentDeclaration=B0,y.iterateOverStringActionDescriptorStringArgumentDeclarationDataType=V0,y.iterateOverStringActionDescriptorStringArgumentDeclarationDataTypeParentRef=w0,y.iterateOverStringActionDescriptorStringArgumentDeclarationParentRef=C0,y.iterateOverStringLoopActionDescriptor=Ca,y.iterateOverStringLoopBodyActionDescriptor=Qs,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgument=F0,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicArgumentParentRef=G0,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturn=x0,y.iterateOverStringLoopBodyActionDescriptorAnyDynamicReturnParentRef=S0,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Al,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=N0,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=g0,y.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=L0,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Dl,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=j0,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=U0,y.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=$0,y.joinListOperation=ul,y.joinListOperationError=$y,y.joinListOperationErrorParentRef=jy,y.joinListOperationFirstListArgument=My,y.joinListOperationFirstListArgumentParentRef=_y,y.joinListOperationFirstListArgumentRef=Oy,y.joinListOperationFirstListDataType=Py,y.joinListOperationResultListDataType=By,y.joinListOperationResultListReturn=Uy,y.joinListOperationResultListReturnParentRef=Ly,y.joinListOperationResultListReturnRef=Cy,y.joinListOperationSecondListArgument=Ny,y.joinListOperationSecondListArgumentParentRef=gy,y.joinListOperationSecondListArgumentRef=wy,y.joinListOperationSecondListDataType=Vy,y.joinListWithLastSeparator=ie,y.joinStringsOperation=Pa,y.joinStringsOperationDynamicStringArgument=ny,y.joinStringsOperationDynamicStringArgumentParentRef=iy,y.joinStringsOperationDynamicStringArgumentRef=ty,y.joinStringsOperationDynamicStringDataType=ry,y.joinStringsOperationError=ey,y.joinStringsOperationErrorParentRef=Qf,y.joinStringsOperationFirstStringArgument=Ss,y.joinStringsOperationFirstStringArgumentParentRef=Zf,y.joinStringsOperationFirstStringArgumentRef=$f,y.joinStringsOperationFirstStringDataType=Gf,y.joinStringsOperationResultStringDataType=kf,y.joinStringsOperationResultStringReturn=Oa,y.joinStringsOperationResultStringReturnParentRef=Xf,y.joinStringsOperationResultStringReturnRef=xf,y.joinStringsOperationSecondStringArgument=xs,y.joinStringsOperationSecondStringArgumentParentRef=Kf,y.joinStringsOperationSecondStringArgumentRef=Ff,y.joinStringsOperationSecondStringDataType=Sf,y.joinStringsOperationSeparatorStringArgument=Hf,y.joinStringsOperationSeparatorStringArgumentParentRef=zf,y.joinStringsOperationSeparatorStringArgumentRef=qf,y.joinStringsOperationSeparatorStringDataType=Yf,y.joinStringsOperationSeparatorStringDataTypeDefaultValue=Wf,y.joinStringsOperationSeparatorStringDataTypeDefaultValueParentRef=Jf,y.keyValuePrototype=$n,y.lowercaseFirstLetter=Od,y.manualFlowActionDescriptorDeclarationArgumentDeclaration=Rl,y.manualFlowActionDescriptorDeclarationArgumentDeclarationDataType=I0,y.manualFlowActionDescriptorDeclarationArgumentDeclarationDataTypeParentRef=E0,y.manualFlowActionDescriptorDeclarationArgumentDeclarationParentRef=b0,y.manualFlowLoopActionDescriptor=Ks,y.manualFlowLoopActionDescriptorDynamicReturnDeclaration=T0,y.manualFlowLoopActionDescriptorDynamicReturnDeclarationParentRef=v0,y.manualFlowLoopBodyActionDescriptor=Xs,y.manualFlowLoopBodyActionDescriptorAnyDynamicArgument=A0,y.manualFlowLoopBodyActionDescriptorAnyDynamicArgumentParentRef=R0,y.manualFlowLoopBodyActionDescriptorAnyDynamicReturn=O0,y.manualFlowLoopBodyActionDescriptorAnyDynamicReturnParentRef=D0,y.mapActionDescriptorToTypeItRepresents=Hq,y.mergeEntityErrorsList=J9,y.mergeListOfEntities=Wq,y.methodDefaultValue=xm,y.mockClientProject=ZA,y.moreThanOrEqualCondition=Wn,y.moreThanOrEqualConditionLeftHandArgument=UE,y.moreThanOrEqualConditionLeftHandArgumentDataType=NE,y.moreThanOrEqualConditionLeftHandArgumentDataTypeParentRef=gE,y.moreThanOrEqualConditionLeftHandArgumentParentRef=LE,y.moreThanOrEqualConditionRightHandArgument=FE,y.moreThanOrEqualConditionRightHandArgumentDataType=$E,y.moreThanOrEqualConditionRightHandArgumentDataTypeParentRef=jE,y.moreThanOrEqualConditionRightHandArgumentParentRef=GE,y.notEmptyCondition=an,y.notEmptyConditionArgument=_E,y.notEmptyConditionRef=BE,y.nullPrototype=ef,y.numberAdditionOperation=Fs,y.numberAdditionOperationDynamicSummandArgument=If,y.numberAdditionOperationDynamicSummandArgumentType=Ef,y.numberAdditionOperationDynamicSummandArgumentTypeParentRef=Tf,y.numberAdditionOperationError=vf,y.numberAdditionOperationErrorParentRef=mf,y.numberAdditionOperationFirstNumberArgument=il,y.numberAdditionOperationFirstNumberArgumentRef=df,y.numberAdditionOperationFirstNumberDataType=lf,y.numberAdditionOperationRef=yf,y.numberAdditionOperationRefThree=al,y.numberAdditionOperationRefTwo=hf,y.numberAdditionOperationResultNumberDataType=ff,y.numberAdditionOperationResultNumberReturn=sl,y.numberAdditionOperationResultNumberReturnRef=cf,y.numberAdditionOperationSecondNumberArgument=nl,y.numberAdditionOperationSecondNumberArgumentRef=uf,y.numberAdditionOperationSecondNumberDataType=pf,y.numberPrototype=me,y.numberSubtractionOperation=dl,y.numberSubtractionOperationDynamicSubtrahendArgument=Uf,y.numberSubtractionOperationDynamicSubtrahendArgumentType=Lf,y.numberSubtractionOperationDynamicSubtrahendArgumentTypeParentRef=Nf,y.numberSubtractionOperationError=gf,y.numberSubtractionOperationErrorParentRef=Mf,y.numberSubtractionOperationFirstNumberArgument=wf,y.numberSubtractionOperationFirstNumberArgumentRef=bf,y.numberSubtractionOperationFirstNumberDataType=Rf,y.numberSubtractionOperationRef=ol,y.numberSubtractionOperationRefThree=Bf,y.numberSubtractionOperationRefTwo=Vf,y.numberSubtractionOperationResultNumberDataType=Pf,y.numberSubtractionOperationResultNumberReturn=_f,y.numberSubtractionOperationResultNumberReturnRef=Of,y.numberSubtractionOperationSecondNumberArgument=Cf,y.numberSubtractionOperationSecondNumberArgumentRef=Af,y.numberSubtractionOperationSecondNumberDataType=Df,y.numberValueAutogenerationSchema=rp,y.parallelExecutionOperation=Rr,y.parallelExecutionOperationError=Fh,y.parallelExecutionOperationErrorParentRef=Gh,y.parallelExecutionOperationListOfExecutionResultsDataType=Uh,y.parallelExecutionOperationListOfExecutionResultsReturn=vl,y.parallelExecutionOperationListOfExecutionResultsReturnRef=Lh,y.parallelExecutionOperationListOfFunctionsArgument=ml,y.parallelExecutionOperationListOfFunctionsArgumentDatatype=Nh,y.parallelExecutionOperationListOfFunctionsArgumentRef=gh,y.parallelExecutionOperationListOfFunctionsBlueprint=Mh,y.parallelExecutionOperationListOfFunctionsBlueprintDynamicInput=_h,y.parallelExecutionOperationListOfFunctionsBlueprintDynamicOutput=Bh,y.parallelExecutionOperationRef=jh,y.parallelExecutionOperationRefThree=$h,y.persistedBuiltInBaseEntity=Ot,y.persistedBuiltInBaseEntityDatabaseProperty=Zn,y.persistedBuiltInBaseEntityDatabasePropertyDataType=pE,y.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=FP,y.persistedBuiltInBaseEntityDatabasePropertyParentRef=cE,y.persistedBuiltInBaseEntityDatabasePropertyRef=uE,y.persistedBuiltInBaseEntityPrimaryKeyProperty=qn,y.persistedBuiltInBaseEntityPrimaryKeyPropertyDataType=IE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOption=yE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyNumberDataTypeOptionParentRef=fE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyParentRef=bE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyRef=EE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOption=mE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyStringDataTypeOptionParentRef=hE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOption=TE,y.persistedBuiltInBaseEntityPrimaryKeyPropertyUUIDDataTypeOptionParentRef=vE,y.processOutputGlobalValueDescriptorDataType=WE,y.processOutputGlobalValueDescriptorReturn=uo,y.processOutputGlobalValueDescriptorReturnRef=JE,y.projectPublicationCompletedGlobalEvent=lo,y.propertyToZodSchema=uI,y.relationalDatabaseBuiltInBaseEntity=gr,y.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=xl,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataType=sE,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=aE,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=oE,y.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=nE,y.relationalDatabaseBuiltInBaseEntityDefaultProperty=Sl,y.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataType=iE,y.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=tE,y.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=rE,y.relationalDatabaseBuiltInBaseEntityIdentifierProperty=ro,y.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataType=WT,y.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=qT,y.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=JT,y.relationalDatabaseBuiltInBaseEntityMinSizeProperty=ao,y.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataType=eE,y.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=XT,y.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=QT,y.relationalDatabaseBuiltInBaseEntityPasswordProperty=no,y.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataType=KT,y.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=GP,y.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=HT,y.relationalDatabaseBuiltInBaseEntityRef=kn,y.relationalDatabaseBuiltInBaseEntityUsernameProperty=io,y.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataType=zT,y.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=$P,y.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=YT,y.resolveActionDescriptorName=F1,y.resolveBaseEntityName=U1,y.resolveBuiltInBaseEntityDataTypeLabel=j1,y.resolveClonedEntityProject=ft,y.resolveConditionOperatorLabel=Cd,y.resolveDataType=Pd,y.resolveDataTypeEntityOrNestedChildrenFromLiteralValue=Mc,y.resolveDataTypeLabel=Vd,y.resolveDefinitionEntityDataTypeLabel=N7,y.resolveEntityDataTypeLabel=g7,y.resolveEntityName=G,y.resolveFirstCallsSecond=Lq,y.resolveFirstWritesSecond=Uq,y.resolvePrimaryKeyProperty=Qq,y.resolvePrimitiveEntityName=G1,y.resolveSearchName=$1,y.resolveVariableScope=B7,y.sequentialExecutionOperation=ti,y.sequentialExecutionOperationError=sm,y.sequentialExecutionOperationErrorParentRef=am,y.sequentialExecutionOperationListOfExecutionResultsDataType=rm,y.sequentialExecutionOperationListOfExecutionResultsReturn=El,y.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=nm,y.sequentialExecutionOperationListOfExecutionResultsReturnRef=tm,y.sequentialExecutionOperationListOfFunctionsArgument=Tl,y.sequentialExecutionOperationListOfFunctionsArgumentDatatype=em,y.sequentialExecutionOperationListOfFunctionsArgumentParentRef=im,y.sequentialExecutionOperationListOfFunctionsArgumentRef=Qh,y.sequentialExecutionOperationListOfFunctionsBlueprint=Xh,y.sequentialExecutionOperationListOfFunctionsBlueprintDynamicInput=Kh,y.sequentialExecutionOperationListOfFunctionsBlueprintDynamicOutput=Hh,y.softDeletePersistedEntityMethod=SP,y.softDeletePersistedEntityMethodParentRef=RE,y.sortCallsBasedOnExecutionDependencies=DO,y.sortChildrenEntitiesBasedOnExecutionDependencies=gq,y.splitListOperation=cl,y.splitListOperationError=rh,y.splitListOperationErrorParentRef=th,y.splitListOperationFirstOutputListDataType=qy,y.splitListOperationFirstOutputListReturn=Ky,y.splitListOperationFirstOutputListReturnParentRef=Hy,y.splitListOperationFirstOutputListReturnRef=pl,y.splitListOperationInputListArgument=Wy,y.splitListOperationInputListArgumentParentRef=Jy,y.splitListOperationInputListArgumentRef=Sy,y.splitListOperationInputListDataType=xy,y.splitListOperationSecondOutputListDataType=Xy,y.splitListOperationSecondOutputListReturn=eh,y.splitListOperationSecondOutputListReturnParentRef=Qy,y.splitListOperationSplitIndexArgument=zy,y.splitListOperationSplitIndexArgumentParentRef=Yy,y.splitListOperationSplitIndexArgumentRef=ky,y.splitListOperationSplitIndexDataType=Zy,y.splitStringOperation=ll,y.splitStringOperationError=by,y.splitStringOperationErrorParentRef=Iy,y.splitStringOperationFirstPartResultStringDataType=uy,y.splitStringOperationFirstPartResultStringReturn=Ey,y.splitStringOperationFirstPartResultStringReturnParentRef=Ty,y.splitStringOperationFirstPartResultStringReturnRef=ly,y.splitStringOperationIndexArgument=my,y.splitStringOperationIndexArgumentParentRef=hy,y.splitStringOperationIndexArgumentRef=oy,y.splitStringOperationIndexDataType=dy,y.splitStringOperationSecondPartResultStringDataType=cy,y.splitStringOperationSecondPartResultStringReturn=UP,y.splitStringOperationSecondPartResultStringReturnParentRef=vy,y.splitStringOperationSecondPartResultStringReturnRef=py,y.splitStringOperationStringArgument=yy,y.splitStringOperationStringArgumentParentRef=fy,y.splitStringOperationStringArgumentRef=ay,y.splitStringOperationStringDataType=sy,y.stringPrototype=ne,y.stringValueAutogenerationSchema=tp,y.suggestNewIdForEntity=yc,y.test_primitive_entities_export=$J,y.toCamelCase=_7,y.toEntityState=nr,y.toKebabCase=L1,y.toLowerCaseKebabCase=wd,y.toPascalCase=M7,y.untypedDataPrototype=At,y.updateErrorsList=Ye,y.updateValueReader=Yq,y.urlDefaultValue=Um,y.uuidPrototype=Qr,y.validateArgumentDeclarationName=cc,y.validateCalledByErrorIdInAction=Dq,y.validateCalledByIdInAction=Aq,y.validateCallers=pO,y.validateConditionEntityDeclaration=wq,y.validateDataOperation=Qi,y.validateDataOperationDataToValidateArgument=Om,y.validateDataOperationDataToValidateArgumentParentRef=Dm,y.validateDataOperationDataToValidateArgumentRef=Rm,y.validateDataOperationDataToValidateDataType=Am,y.validateDataOperationEntityToMatchTypeArgument=Cm,y.validateDataOperationEntityToMatchTypeArgumentParentRef=Vm,y.validateDataOperationEntityToMatchTypeArgumentRef=Pm,y.validateDataOperationEntityToMatchTypeDataType=wm,y.validateDataOperationError=gm,y.validateDataOperationErrorParentRef=Mm,y.validateDataOperationOutputEntityDeclaration=_m,y.validateDataOperationOutputEntityDeclarationParentRef=Bm,y.validateDefinitionEntityName=Bd,y.validateEntryCaller=uO,y.validateErrorCaller=lO,y.validateFunctionCallDeclaration=fO,y.validateFunctionDeclarationName=lc,y.validateGeneratedEntityParentIsNotBuiltInEntity=Eq,y.validateGeneration=vq,y.validateGenerationTarget=ot,y.validateGenerationUpdate=Tq,y.validateLoopEntityDeclaration=Vq,y.validateName=L7,y.validateOperationEntityDeclaration=yO,y.validatePropertyName=pc,y.validateReachability=fi,y.validateReadsValueInActionPayload=Oq,y.validateReferenceObject=gd,y.validateReferenceToOne=bc,y.validateReferences=Et,y.validateReturnDeclarationName=fc,y.validateSuccessCaller=dO,y.validateValueReaderGenerationUpdate=ws,y.validateValueWritter=wc,y.validateVariableDeclarationName=uc,y.validateVariableInternalCallUse=Vc,y.valueAutogenerationCurrentDateAndTimeSchema=WA,y.valueAutogenerationGenericSchema=Xo,y.valueAutogenerationOptions=np,y.valueAutogenerationOptionsSchema=JA,y.valueAutogenerationRandomBooleanSchema=ep,y.valueAutogenerationRandomDateBetweenSchema=rD,y.valueAutogenerationRandomDateFromSchema=eD,y.valueAutogenerationRandomDateSchema=td,y.valueAutogenerationRandomDateUntilSchema=tD,y.valueAutogenerationRandomNumberBetweenSchema=HA,y.valueAutogenerationRandomNumberFromSchema=YA,y.valueAutogenerationRandomNumberSchema=Qo,y.valueAutogenerationRandomNumberUntilSchema=zA,y.valueAutogenerationRandomSchema=ls,y.valueAutogenerationRandomTextBetweenSchema=QA,y.valueAutogenerationRandomTextFromSchema=KA,y.valueAutogenerationRandomTextSchema=ed,y.valueAutogenerationRandomTextUntilSchema=XA,y.valueAutogenerationRangeValueTypesSchema=ds,y.valueAutogenerationUniqueSchema=Qu,y.waitOperation=Ft,y.waitOperationMillisecondsNumberArgument=Ki,y.waitOperationMillisecondsNumberArgumentRef=kh,y.waitOperationMillisecondsNumberDataType=Zh,y.waitOperationOperationError=Wh,y.waitOperationOperationErrorParentRef=Jh,y.waitOperationRef=qh,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|